Jump to content

Wikipedia:Reference desk/Computing

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Reflectionsinglass (talk | contribs) at 05:57, 17 June 2015 (Writing a bot for real-world library site search?: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Welcome to the computing section
of the Wikipedia reference desk.
Select a section:
Want a faster answer?

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.
See also:


June 12

iTunes and external disc

My Mac's main HD is crowded; music takes up a third of it. I copied the music to a mostly unused external disc. In iTunes preferences, I changed "iTunes Media folder location" to the external, but this has had no apparent effect; it's still playing from my home directory. What can I do? —Tamfang (talk) 08:19, 12 June 2015 (UTC)[reply]

How do you know that you are still playing from your home directory? —SGA314 (talk) 15:28, 12 June 2015 (UTC)[reply]
If the files are on the external drive, and space is limited on your internal, why keep the files on the internal drive? Dismas|(talk) 17:48, 12 June 2015 (UTC)[reply]
that was one of my thoughts to. —SGA314 (talk) 17:52, 12 June 2015 (UTC)[reply]
delete all music you dont use — Preceding unsigned comment added by A8v (talkcontribs) 21:10, 12 June 2015 (UTC)[reply]
Just a few thoughts on that...
A) When moving them to the external, the files themselves shouldn't have changed, so I don't see what danger there is in deleting the internal drive files.
B) I can confirm that they'll play from an external drive since this is the way that my music and movies are set up. A Mac Mini with an external drive for just the iTunes library. Barring something unique about your system, I don't know why it wouldn't work.
C) You could do a test on a small number of files (or even just one). Delete the internal drive copy, try to play the external. If it works, that would suggest that the external files are playable. Dismas|(talk) 04:51, 13 June 2015 (UTC)[reply]
  • A) Call me a cockeyed pessimist.
  • B) Did you always have it on external? If not, how did you transition?
  • C) And how do I "try to play the external"?
  • I suppose I could delete the internal files and then, whenever iTunes complains "I can't find that file," point it to the external. I'd only have to do that 15641 times. —Tamfang (talk) 09:12, 13 June 2015 (UTC)[reply]
My library has been moved from computer to computer a couple times. As for the Mini that it is currently hooked up to, it's always been on the external drive with that specific computer. As far as playing a file from the external drive: In the Finder, navigate to the file you want to play, double click it. Your default music player (iTunes, presumably) should open and play the file. Dismas|(talk) 23:56, 13 June 2015 (UTC)[reply]

Addenda: I prefer not to risk losing the "last played" or "play count" or "date added" metadata. — This may be the first time in ten years that The Missing Manual is no help at all, by the way. — One possibility is to trick the filesystem into treating the external directory as a subdirectory of $HOME. How hard/dangerous is that? Does it need to be a whole volume? —Tamfang (talk) 09:12, 13 June 2015 (UTC)[reply]

Have you tried going to iTunes Preferences then Advanced, then press the change location iTunes media location. Dja1979 (talk) 23:03, 13 June 2015 (UTC)[reply]
Have you read this thread? Dismas|(talk) 09:00, 14 June 2015 (UTC)[reply]
  • It seems to have worked. Hurrah!
    Resolved
    Tamfang (talk) 20:51, 14 June 2015 (UTC)[reply]

Algorithm to write proper sine and square waves using python's wave module?

Hello everyone. Here is a tricky question(at least for me). Does anyone know the proper algorithms to write sine and square waves to a .wav file (not both in the same file though)? I am using python's wave module to do this. I found an article that describes Linear pulse code modulation and how it works. It even gives a chart that depicts the values of a sine wave. However, I have found nothing that is really beneficial to me. My current method doesn't produce sine or square waves, but I can produce great white noise though(Hint: It uses random numbers). Here is some properly written samples of a 440 Hz square wave:

Frame 0 = '\x00\xcd\xcc\x0c'
Frame 1 = '\x00\xcc\xcc\x0c'
Frame 2 = '\x00\xce\xcc\x0c'
Frame 3 = '\x00\xcc\xcc\x0c'
Frame 4 = '\x00\xcd\xcc\x0c'
Frame 5 = '\x00\xce\xcc\x0c'
Frame 6 = '\x00\xcb\xcc\x0c'
Frame 7 = '\x00\xce\xcc\x0c'
Frame 8 = '\x00\xcc\xcc\x0c'
Frame 9 = '\x00\xcd\xcc\x0c'

I got this by using the wave module in python 2.7.6. The file was generated with Audacity. I used an audio track with a type of 32-bit float and a sample rate of 44100 Hz. I exported with an uncompressed codec and I used a header of type Microsoft WAV and an encoding type of Signed 16 bit PCM Signed 32 bit PCM. Thanks for your help in advance. —SGA314 I am not available on weekends (talk) 19:56, 12 June 2015 (UTC)[reply]

Your sample will have to come out of a sine function. Say you have samplerate (44100), frequency (440). Get values from math.sin(2*pi*frequency*samplenumber/samplerate), varying sample number from 1,2,3,.... And yes there looks to be a math.cos() function in Python as well. THe sin and cos use input in radians, so that is why the 2π is there. (disclaimer I have never programmed Python). Convert these values, that vary from -1.0 to 1.0 to your PCM range, is that -32768 to 32767 by multiplying by 32767 and converting to integer; math.floor may do this. Graeme Bartlett (talk) 22:11, 13 June 2015 (UTC)[reply]
@Graeme Bartlett: Sorry it took me so long to reply. What would my PCM range be? And what is the variable "samplenumber?" Oh and should I convert the integer to hexdecimal? —SGA314 I am not available on weekends (talk) 15:24, 15 June 2015 (UTC)[reply]
As it turns out, I am actually using a encoding type of Signed 32 bit PCM. Not Signed 16 bit PCM. —SGA314 I am not available on weekends (talk) 19:11, 15 June 2015 (UTC)[reply]
Edit: Updated the audio data for the square wave with the Signed 32 bit PCM audio data instead of the Signed 16 bit PCM audio data. —SGA314 I am not available on weekends (talk) 21:13, 15 June 2015 (UTC)[reply]
Wave files have a particular format, and from what I remember they are either 8 bit or 16 bit signed integers, they can be mono or stereo. When you write to the wave file it will have to be in binary form, including use of x00 characters. I have some code I wrote about 20 years ago in a C-- which is 386 assembler and c — it probably won't help you. The PCM range is the smallest value to the biggest value, I gave the numbers for a 16 bit coding, for 8 bit it might be -127 to +127, But I think it may be coded differently say 0 to 255. the samplenumber is just a counter that counts how many samples you have made. So after 1 second you will be up to number 44100 and after 2 seconds it will have counted up to 88200. You will just have to count up to duration*samplerate. I did not explain square waves, but they will be positive for a number of samples and then negative for the same number of samples. Graeme Bartlett (talk) 13:30, 16 June 2015 (UTC)[reply]
Ok I now understand what you meant by the samplecounter. But what are x00 characters? and I tried to write to the file in binary form but it still was not a 440 Hz sine wave. I think my problem is that I'm not using the proper PCM range. I think I'm exporting in a Signed 32 bit PCM format. That would mean my PCM range would be -2147483648 to 2147483647, or 0 to 4,294,967,294. Right? I guess worst case scenario, I am not exporting in a Signed 32 bit PCM format, so I would have to try PCM ranges from 8 bit to 32 bit. —SGA314 I am not available on weekends (talk) 15:42, 16 June 2015 (UTC)[reply]

10 lines code/day?

The Mythical Man-Month claims that the average output for a software engineer is 10 lines of code/day. Was it the case back then when the book was published? Is it true nowadays? --Scicurious (talk) 17:41, 12 June 2015 (UTC)[reply]

Well, from my POV, I can write in excess of 1,000 lines of code a day(given me enough time in a day that is). And I would think that more expirenced programmers could do even more than that. I guess that back then, code was very hard to write and thus took longer to write, because they were probably using either straight binary or assembly. That only applies though if your talking about that days before the first version of C, which I assume you are. —SGA314 (talk) 17:51, 12 June 2015 (UTC)[reply]
I don't know, but I encourage you to read Source_lines_of_code#Disadvantages before you put much stock in that number. Some days I can write hundreds of lines of simple code, some days I spend all day optimizing just a few lines. None of that matters as much as what the code does, and how well it does it. SemanticMantis (talk) 17:54, 12 June 2015 (UTC)[reply]
True to that. I didn't really think about the complexity of the code being written. Good point. —SGA314 (talk) 18:10, 12 June 2015 (UTC)[reply]
I can't find a statement that programmers produce 10 lines of code per day in Brooks. But Chapter 8, "Calling the Shot", is based on a number of studies of actual programming projects. So I would say that Brooks' results are base on actual experience, not some off-the-cuff guess. On page 88 Brooks explains that the productivity figures for large projects includes "planning, documentation, testing, system integration, and training times". He mentions a few small projects with much higher productivities. Jc3s5h (talk) 18:15, 12 June 2015 (UTC)[reply]
Corbató's Data, p. 93:
"MIT's Project MAC reports, however, a mean productivity of 1200 lines of debugged PL/I statements per man-year on the MUL TICS system (between 1 and 2 million words)." If there are 240 work days in a year, and half the staff are developers, that turns into 10 lines of code per person working in the project. --Scicurious (talk) 18:42, 12 June 2015 (UTC)[reply]
Of note, the final count excludes code written and discarded. For example, management asks for some new cool feature. It is implemented, tested, and shown to management. They then say that they don't like it, so it is removed. All of those lines of code fail to make the final count of lines of code. So, I have a gut feeling that some people may be in this conversation thinking that lines of code means "how many lines of code does a programmer write" while others are quoting sources that use lines of code to mean "how many lines of code make it to the final product." 209.149.113.240 (talk) 19:24, 12 June 2015 (UTC)[reply]
  • The Mythical Man-Month is a great book, but I wonder how many people realize that all of its main conclusions are wrong. Things that Brooks claimed are impossible are nowadays routinely done in open source projects by unorganized groups of volunteers. The basic problem is that Brooks did not grasp the value of modularity: he assumed that a project would work best if every developer was familiar with every aspect of the project. The result was that his developers were overwhelmed by complexity. Nowadays any large project is routinely divided into modules connected by rigorously structured interfaces. A developer who knows the specifications for a module can work on it without knowing anything about the other modules: thus even newcomers can be productive if they are assigned to relatively simple modules. Generally speaking, the larger a project, the greater the proportion of effort that goes into laying out the modules and defining their interactions. This sort of organizational code is much easier to write than the "deep" code that programmers in Brooks's day spent most of their time on -- much of it is boilerplate -- so the average number of lines of code written in a day has gone way up. Looie496 (talk) 15:25, 13 June 2015 (UTC)[reply]
I seriously doubt that. Someone needs to modularise the design and create the interfaces. And developers who don't understand the overall design at least on a general level will misunderstand the specifications and produce useless code. Specifying a module to the level that it "just needs coding" is a management fiction - it's about as hard as coding it, but the tool support is a lot worse. Increases in productivity that we do have come from better languages and libraries, and better tools (both software and hardware). --Stephan Schulz (talk) 15:38, 13 June 2015 (UTC)[reply]
Brooks' most important conclusion, for which the book is named, is still very true, and that is that adding people to a project when it is behind schedule is not helpful because the people have to come up to speed, and then spends time on the part of the senior people to bring them up to speed. Robert McClenon (talk) 16:01, 13 June 2015 (UTC)[reply]
The lines of code count should not be lines of code per coder, but debugged lines of code per person, where the people include the managers, requirements engineers, testers, and other people. Also, counting lines of code isn't as easy as you might think, when there are tools that generate code behind the scenes, for instance. Robert McClenon (talk) 16:06, 13 June 2015 (UTC)[reply]
Of significance here is that it's not "10 lines of typing" - it's "10 lines of fully debugged, fully documented code that's made it through quality assurance, has a build environment, an installer, an uninstaller, an editing history, and assorted support files and configuration systems". Certainly there have been days when I've written one or two thousand lines of code and it "just worked" and resulted in an application so simple that a 5 line "README" was all of the documentation it needed. But then there have been entire weeks where I've been tracking down a single incorrect line of code that caused everything to fail - and I contributed -1 lines of code over 10 days.
The "gut feel" for most programmers that this is a crazily low number - but when you calculate an average over a large project from start to completion, the 10 lines per day metric is surprisingly close to reality. Another point to note is that programming is not like most other occupations where any two workers will produce broadly similar quantities of output. It's not at all unusual to find that the best programmers be several hundred times more productive than the worst programmers - even on a single project - and a bad programmer can actually produce negative output by inserting bugs that take other people on the team a long time to find.
The big problem here is that managers who believe in the 10 lines per day metric have no way to know in advance how many lines need to be written in order to complete the project - and programmers can more accurately estimate how long it will take to complete the project than they can estimate the number of lines of code that result. Personally, I don't give a damn how many lines of code are written per day - I care how much of the final project gets done each day - and the two concepts cannot possibly be related by any kind of simple metric. SteveBaker (talk) 02:21, 14 June 2015 (UTC)[reply]
Indeed. When I was in industry, one of the developers I trained in programming became so good that in most projects where he increased functionality by 20%, he reduced overall code size by 30%, just by refactoring and cleaning up the mess that had grown over the years. And my second-to-last job was mostly to act as a buffer between developers and management, to cushion the cultural differences. I gave a copy of The Mythical Man Month to our COO, but I doubt that he read it... --Stephan Schulz (talk) 08:32, 14 June 2015 (UTC)[reply]

online game not working

http://www.myabandonware.com/game/balance-of-power-the-1990-edition-li/play i have updated flash and java and i run windows 8.1 and i use a gaming PC that can run battlefeild at max graphics — Preceding unsigned comment added by A8v (talkcontribs) 21:09, 12 June 2015 (UTC)[reply]

What browser do you use? If it's Chrome, are you aware of this? Rojomoke (talk) 04:40, 13 June 2015 (UTC)[reply]
It does not work in Mozilla Firefox or Google Chrome but works in Internet Explorer. — Preceding unsigned comment added by A8v (talkcontribs) 14:47, 13 June 2015 (UTC)[reply]

How to unlock a used Sprint phone

My friend without internet access has asked me to ask at the refdesk 'how to unlock an iphone that has already finished its contract with Sprint network, so it can be used in another company'. This will save paying a hacker two month's wages if it can be done by following a set of instructions. I suppose a link to a page that has text instructions would be ideal, and again this is a 4s. Thanks for any help. μηδείς (talk) 21:52, 12 June 2015 (UTC)[reply]

The first thing to try is simply to contact Sprint; see http://www.sprint.com/legal/unlocking_policy.html. They say they will unlock a device no problem if the contract period is over and the account is in good standing. —Noiratsi (talk) 06:55, 13 June 2015 (UTC)[reply]
Thanks, I have passed this on, and I don't know the account details. I am also unsure that their 800 number will work where the user is calling from. μηδείς (talk) 23:36, 13 June 2015 (UTC)[reply]
  • The user has an iphone 4 with iOS 7.1.2. Not residing in the US calling the 800 number will not work, and attempting a chat with customer service would be almost impossible, and prohibitively expensive. There are two options open, $25 hack (a month's wages) that will allow in country calls and a $70 hack which would allow texts and emails out of country. Given the latter is almost 3 month's wages, some better option is what's desired--unfortunately I have no knowledge of how to effect any of this. Is jailbreaking possible without first unlocking the phone? (Even for that I understand one needs to download the app first, a catch 22. Thanks. μηδείς (talk) 01:33, 14 June 2015 (UTC)[reply]
It turns out the phone is only CDMA network compatible, which is not able to be used in the destination country. But as relatives are coming to the US I have advised them to make all the arrangements here first, rather than trying to call internationally uncallable numbers and access unaccessible websites. Thanks.
Resolved

June 13

What is the difference between a YouTube addresses that contains 'feature=youtu.be' and the usual ones? The former may appear also as going to site youtu.be. And why is that one blacklisted by Wikipedia and the others not?

Here are examples:

  1. [https://www.youtube.com/watch?v=zBpBNr6tj8Y example 1] not blacklisted (example 1)
  2. [https://youtu.be/zBpBNr6tj8Y example 2] blacklisted
  3. [https://www.youtube.com/watch?v=zBpBNr6tj8Y&feature=youtu.be example 3] not blacklisted (example 3)

Note: because Preview doesn't tell you a link is blacklisted I had to save several times. Apologies for that.

Contact Basemetal here 11:25, 13 June 2015 (UTC)[reply]

The justification given for this global blacklisting (see m:Talk:Spam blacklist/Archives/2010-12#Youtu.be) is that URL redirection/shortening sites are redundant and can be used to circumvent existing blocks. This is consistent with WP:EL#Redirection sites, which says that "URL redirection sites are not to be used on Wikipedia". Some discussion of this can be found at MediaWiki talk:Spam-blacklist/archives/December_2011#youtu.beNoiratsi (talk) 14:09, 13 June 2015 (UTC)[reply]
The difference is the domain only, not special links on the webservers. See "www.youtube.com" and "youtu.be". --Hans Haase (有问题吗) 11:35, 15 June 2015 (UTC)[reply]

GoPro HERO 4 wifi streaming and getting internet at the same time

When you connect your computer to a GoPro HERO 4 via wifi to stream from it, can you still connect to your home wifi network to get the internet? In other word, if I want to stream from the GoPro HERO 4 and get internet via wifi at the same time, would I need to have two separate wifi adapters on my computer? I don't have GoPro HERO 4 yet so I can't test it out myself. My other car is a cadr (talk) 11:44, 13 June 2015 (UTC)[reply]

Wi Fi supports more than one device. So it should be possible. However does your internet connection have enough capacity? A HD stream uses a lot of bandwidth going out from home, and many of these home internet services have a limited bandwidth for uploads. So if you overload it it will be very slow for other uses. Graeme Bartlett (talk) 21:56, 13 June 2015 (UTC)[reply]
"Wi Fi supports more than one device" is a very ambiguous statement. You can obviously have a large number of devices on one wifi network but typically most devices/computers with one wifi adapter can only be connected to one wifi network at a time. I don't have a go pro but I have a canon camera that has wifi, it has 2 modes, it has ad hoc mode where you can connect directly to it (from a computer or phone/tablet) bit it also has a "network mode" where you first connect the camera to a wifi network and then a computer or phone on the same network (with the canon software) can connect to the camera. Maybe the go pro has a similar feature? having a very cursory browse, it looks like that might not be the case, i think gopro just creates its own adhoc network. Vespine (talk) 22:50, 16 June 2015 (UTC)[reply]

Encryption energy

If the WMF switch from HTTP to HTTPS is considered as a hypothetical, how much more energy would be consumed by HTTPS in a year (clients, transmission, and servers) compared with HTTP? All the best: Rich Farmbrough, 19:56, 13 June 2015 (UTC).[reply]

The impact, nowadays, is likely to be pretty trivial (see this blog post from 2010 by Google's Adam Langley). For some actual figures you could take a look at this 2003 research paper from Princeton: http://palms.ee.princeton.edu/PALMSopen/potlapally03analyzing.pdfNoiratsi (talk) 22:05, 13 June 2015 (UTC)[reply]
From what I can gather from the raw data linked from wikitech:Analytics/Data/Pagecounts-all-sites, all WMF wikis combined get a bit less than 10,000 connections per second, totalling a bit under 250 MB of transferred data per second. The blog post that Noiratsi linked says "Modern hardware can perform 1500 handshakes/second/core" (for RSA-1024, in 2010), and AES instruction set links a claim of 3.5 cycles/byte (i.e., around 1 GB per second) for authenticated AES encryption (also in 2010). So I'd guesstimate that the WMF's SSL overhead could be handled by the equivalent of one additional server, roughly. -- BenRG (talk) 04:32, 14 June 2015 (UTC)[reply]
Thanks! There is an information theoretic minimum too ref which would be even more negligible. All the best: Rich Farmbrough, 17:55, 15 June 2015 (UTC).[reply]

June 14

Word has increased the envelope height or width because it was too small. The minimum envelope dimensions are 6.4" by 2.13".

Hi, I'm getting this error in MS Word 2013 when setting custom envelope size: Word has increased the envelope height or width because it was too small. The minimum envelope dimensions are 6.4" by 2.13". Any help to solve this..?--Joseph 12:39, 14 June 2015 (UTC)[reply]

Are you trying to print to envelopes that are smaller than 6.4 by 2.13 inches (16.3 cm × 5.4 cm)? If so, you might be better selecting the "(sticky) labels" option instead. However, I don't know where that is. LongHairedFop (talk) 13:33, 14 June 2015 (UTC)[reply]
Yeah, I was trying to set up a 6x4" envelope.--Joseph 14:12, 14 June 2015 (UTC)[reply]
The other way to do it is set up a 7"x4" envelope, and then add a 1" right margin. — Preceding unsigned comment added by LongHairedFop (talkcontribs) 14:35, 14 June 2015 (UTC)[reply]

June 15

Which are the softwares used for titling in Hollywood films?

Hi, I'd like to know which are the softwares used for titling in Hollywood films.--Joseph 11:49, 15 June 2015 (UTC)[reply]

There are many. You can do it by just pointing a camera at a board with writing on it. Common programs are After Effects, Combustion, and Inscriber. Most companies have their own software as compositing text into a video is a rather simply process in any professional video editing system. 209.149.113.240 (talk) 13:08, 15 June 2015 (UTC)[reply]
There are loads of video editing software options like the examples above. See a complete List of video editing software. --Llaanngg (talk) 13:11, 15 June 2015 (UTC)[reply]

Crowdfunding tracking graphs

Are there any web sites which track the progress of crowdfunding projects (such as those on Kickstarter & Indiegogo) and offer graphs which show the day by day rate of funding of any one particular project? For instance, this 2 month campaign by Mars One raised $313,744 of its $400,000 goal to help fund some engineering studies. Where can I find a graph showing the daily funding progress of that project? -- ToE 16:15, 15 June 2015 (UTC)[reply]

The only one I know of is Kicktraq - X201 (talk) 19:23, 15 June 2015 (UTC)[reply]
Here you go, found a site that does Indiegogo. Here's your project - X201 (talk) 19:35, 15 June 2015 (UTC)[reply]
Thanks X201! You're my hero. -- ToE 21:15, 15 June 2015 (UTC)[reply]

June 16

Tic-tac-toe in JavaScript and HTML

i'm trying to make one tic tac toe game using only java script and html following is my code, can anyone help me how to show who wins ?? i'm trying to check the condition within win() function but its not working. can anyone help me plz ??

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>TIC TAC TOE</title>
<style>
td{
	height:100px;
	width:100px;
	font-size:70px;
	text-align:center;
}
</style>

<script>
var lastvalue;
var is_active;
function fun1(a)
{	
	if( lastvalue == 'x')
	{
	if(document.getElementById(a) != "X" && document.getElementById(a) != "O")
	{
		document.getElementById(a).innerHTML="o";
		 lastvalue="o";
		 is_active=false;
	}
	}
	else
	{
		 document.getElementById(a).innerHTML="x";
		 lastvalue="x";
		 is_active=false;	
	}
	win();
}

function win()
{
	if((document.getElementById('f1') == 'x') && (document.getElementById('f2') == 'x') && (document.getElementById('f3') == 'x'))
	{
		alert("x won");
	}	
};
</script>

</head>

<body>
<table border="1px">
<tr><td id="f1" onClick="fun1('f1')"></td><td id="f2" onClick="fun1('f2')"></td><td id="f3" onClick="fun1('f3')"></td></tr>
<tr><td id="f4" onClick="fun1('f4')"></td><td id="f5" onClick="fun1('f5')"></td><td id="f6" onClick="fun1('f6')"></td></tr>
<tr><td id="f7" onClick="fun1('f7')"></td><td id="f8" onClick="fun1('f8')"></td><td id="f9" onClick="fun1('f9')"></td></tr>
</table>
</body>
</html>
I formatted the code for you and added a section heading. Also, it looks like you're checking the f1 table cell three times as the win condition. --Canley (talk) 07:10, 16 June 2015 (UTC)[reply]
The most obvious problem with your code is that you are checking for equality between an Element and a string. Instead of document.getElementById('f1') == 'x' you should retrieve the text string contained in the DOM element using document.getElementById('f1').innerHTML == 'x' (I haven't checked that this works). —Noiratsi (talk) 12:51, 16 June 2015 (UTC)[reply]
This is a common problem. There is no "trick" to it. You literally must check every possible win scenario. There are 8 possible win scenarios for X and 8 possible win scenarios for O. You also need to see if 9 moves have been made. If you have 9 moves and nobody wins, it is a draw. 209.149.113.240 (talk) 12:52, 16 June 2015 (UTC)[reply]
@Noiratsi:Thats funny I was just about to say the same thing and yes, your suggestion does work. I think that checking all possible combinations could be done by a for loop. Give me a few minutes and maybe I can come up with something to demonstrate. —SGA314 I am not available on weekends (talk) 12:57, 16 June 2015 (UTC)[reply]
In reply to 209.149.113.240, I can think of a few 'tricks', though maybe this isn't the kind of thing you meant. You could use a Magic Square, or perhaps XOR the moves made by each player in some way. —Noiratsi (talk) 13:06, 16 June 2015 (UTC)[reply]
Ok Got it! I used the principal of a magic square(with a little modification. Good idea Noiratsi):
Very long code
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>TIC TAC TOE</title>
<style>
td{
	height:100px;
	width:100px;
	font-size:70px;
	text-align:center;
}
</style>
<script>

var lastvalue;
var is_active;
var MoveCount;
MoveCount = 0;
function fun1(a)
{
  if (document.getElementById(a).innerHTML != 'x' && document.getElementById(a).innerHTML != 'o')
  {
    MoveCount += 1;
    if (MoveCount <= 9)
    {
      if (lastvalue == 'x')
      {
        document.getElementById(a).innerHTML = 'o';
        lastvalue = 'o';
        is_active = false;
      }
      else
      {
        document.getElementById(a).innerHTML = 'x';
        lastvalue = 'x';
       is_active = false;
      }

      //Check to see if X has won.
      checkX();

      //Check to see if O has won.
      checkO();

      if (MoveCount == 9)
      {
        MoveCount = 10
        alert('Game Over! Its a Tie!')
      }
    }
  }
}

function checkX()
{
  for (var i = 1; i < 10; i++)
  {
    for (var c = 1 + i; c < 10; c++)
    {
      for (var d = 1 + c; d < 10; d++)
      {
        //alert(document.getElementById('f' + i).innerHTML);
        if (document.getElementById('f' + i).innerHTML != null)
        {
          if (document.getElementById('f' + c).innerHTML != null)
          {
            if (document.getElementById('f' + d).innerHTML != null)
            {
              //Check X diag
              if (i == 1)
              {
                if (c == 5)
                {
                  if (d == 9)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'x')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'x')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'x')
                        {
                          alert('x won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Check X diag

              //Check X -Diag
              if (i == 3)
              {
                if (c == 5)
                {
                  if (d == 7)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'x')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'x')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'x')
                        {
                          alert('x won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Check X -Diag

              //Check X Horizontal
              //Line 1
              if (i == 1)
              {
                if (c == 2)
                {
                  if (d == 3)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'x')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'x')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'x')
                        {
                          alert('x won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Line 1

              //Line 2
              if (i == 4)
              {
                if (c == 5)
                {
                  if (d == 6)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'x')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'x')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'x')
                        {
                          alert('x won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Line 2

              //Line 3
              if (i == 7)
              {
                if (c == 8)
                {
                  if (d == 9)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'x')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'x')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'x')
                        {
                          alert('x won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Line 3
              //End Check X Horizontal

              //Check X Vertical
              //Column 1
              if (i == 1)
              {
                if (c == 4)
                {
                  if (d == 7)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'x')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'x')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'x')
                        {
                          alert('x won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Column 1

              //Column 2
              if (i == 2)
              {
                if (c == 5)
                {
                  if (d == 8)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'x')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'x')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'x')
                        {
                          alert('x won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Column 2

              //Column 3
              if (i == 3)
              {
                if (c == 6)
                {
                  if (d == 9)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'x')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'x')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'x')
                        {
                          alert('x won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Column 3
              //End Check X Vertical

            }
          }
        }
      }
    }
  }
}

function checkO()
{
  for (var i = 1; i < 10; i++)
  {
    for (var c = 1 + i; c < 10; c++)
    {
      for (var d = 1 + c; d < 10; d++)
      {
        //alert(document.getElementById('f' + i).innerHTML);
        if (document.getElementById('f' + i).innerHTML != null)
        {
          if (document.getElementById('f' + c).innerHTML != null)
          {
            if (document.getElementById('f' + d).innerHTML != null)
            {
              //Check O diag
              if (i == 1)
              {
                if (c == 5)
                {
                  if (d == 9)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'o')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'o')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'o')
                        {
                          alert('o won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Check O diag

              //Check O -Diag
              if (i == 3)
              {
                if (c == 5)
                {
                  if (d == 7)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'o')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'o')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'o')
                        {
                          alert('o won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Check O -Diag

              //Check O Horizontal
              //Line 1
              if (i == 1)
              {
                if (c == 2)
                {
                  if (d == 3)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'o')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'o')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'o')
                        {
                          alert('o won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Line 1

              //Line 2
              if (i == 4)
              {
                if (c == 5)
                {
                  if (d == 6)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'o')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'o')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'o')
                        {
                          alert('o won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Line 2

              //Line 3
              if (i == 7)
              {
                if (c == 8)
                {
                  if (d == 9)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'o')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'o')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'o')
                        {
                          alert('o won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Line 3
              //End Check O Horizontal

              //Check O Vertical
              //Column 1
              if (i == 1)
              {
                if (c == 4)
                {
                  if (d == 7)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'o')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'o')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'o')
                        {
                          alert('o won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Column 1

              //Column 2
              if (i == 2)
              {
                if (c == 5)
                {
                  if (d == 8)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'o')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'o')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'o')
                        {
                          alert('o won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Column 2

              //Column 3
              if (i == 3)
              {
                if (c == 6)
                {
                  if (d == 9)
                  {
                    if (document.getElementById('f' + i).innerHTML == 'o')
                    {
                      if (document.getElementById('f' + c).innerHTML == 'o')
                      {
                        if (document.getElementById('f' + d).innerHTML == 'o')
                        {
                          alert('o won');
                          MoveCount = 10;
                          return;
                        }
                      }
                    }
                  }
                }
              }
              //End Column 3
              //End Check O Vertical
            }
          }
        }
      }
    }
  }
}

function Reset()
{
  for (var i = 1; i < 10; i++)
  {
    document.getElementById('f' + i).innerHTML = ''
  }
  MoveCount = 0;
  lastvalue = 0;
}
 
</script>

<style>
  #ResetBtn {position: relative; right:-400px; bottom:-325px}
</style>
</head>

<body>
<h1 align="center">Tic Tac Toe</h1>
<table border="1px" align="center">
<tr><td id="f1" onClick="fun1('f1')"></td>

<td id="f2" onClick="fun1('f2')"></td>

<td id="f3" onClick="fun1('f3')"></td></tr>

<tr><td id="f4" onClick="fun1('f4')"></td>

<td id="f5" onClick="fun1('f5')"></td>

<td id="f6" onClick="fun1('f6')"></td></tr>

<tr><td id="f7" onClick="fun1('f7')"></td>

<td id="f8" onClick="fun1('f8')"></td>

<td id="f9" onClick="fun1('f9')"></td></tr>

<button onclick="Reset()" id="ResetBtn">Reset Board</button>

</table>
</body>
</html>
I know its a lot of code, but it works though. If you don't want to game to reset every time you win, just comment out the Reset(); line. Hope you like it. —SGA314 I am not available on weekends (talk) 15:32, 16 June 2015 (UTC)[reply]
Explanation: the Function checkX() checks to see if there is 3 Xs in either diagonal direction or in the Horizontal direction. It does this by means of 3 nested for loops, one for each x. The function first checks to see if the for loop variables i, c, and d are equal to 1, 5, and 9. Then if this returns true, the program will check if the squares 1, 5, and 9 have Xs in them. The reverse is done for the other diagonal direction. So instead of checking to see if the for loop variables are 1, 5, and 9, we check to see if the variables are 3, 5, and 7. After the program has check the diagonals, it moves on to the horizontal. The horizontal part checks if the variables c and d are equal to the previous variable + 1. Example:
 
if (i + 1 == c)
{
  if (c + 1 == d)
  {
    //do whatever
  }
}
This will work in either forward or reverse. Now for the Vertical, I just used the same setup as I did for the horizontal. Basicaly, I hard coded all the possible win scenarios. checkO() does the same thing as checkX() but checks for Os instead. —SGA314 I am not available on weekends (talk) 16:17, 16 June 2015 (UTC)[reply]
Looping over all possible values of i, c, d only to check whether they are one of 8 specific triples is pointless. Instead, remove the loop and just assign the eight triples in turn. Or just substitute the values into the code and do away with the variables entirely. That makes the code much shorter, but it's still very long because you're still checking each of the 16 winning conditions separately.
I think what Noiratsi had in mind was to look up the Lo Shu values of each cell and see if they sum to 15, like this:
function check(xo) {
    var get = function(pos) {
        return document.getElementById('f' + pos).innerHTML;
    }
    var loshu = [undefined, 4, 9, 2, 3, 5, 7, 8, 1, 6];
    for (var i = 1; i <= 7; ++i)
        for (var j = i + 1; j <= 8; ++j)
            for (var k = j + 1; k <= 9; ++k)
                if (loshu[i] + loshu[j] + loshu[k] === 15) && xo === get(i) && xo === get(j) && xo === get(k))
                    return true;
    return false;
}
There are other ways to check whether a combination of three squares is a winning combination, but however you do it, the important thing is to collapse the 16 cases into one, and avoid copy and paste programming. -- BenRG (talk) 20:48, 16 June 2015 (UTC)[reply]

I thought of a neat trick: Regular expressions. Unless I've made a mistake, the expression /(^(...){0,2}x{3}(...){0,2}$)|((x..){2}x)|((x...){2}x)|(..(x.){3})/ matches all winning configurations for 'x', given a string of cells like 'xoxxxxxox'. I used jQuery to iterate over the cells in the table and turn them into a string like that.

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>TIC TAC TOE</title>
<style>
td {
	height:100px;
	width:100px;
	font-size:70px;
	text-align:center;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> 
<script>
var turn = 0, TOKENS = ['x','o'], table;

$(function(){
    (table = $('#ttt')).find("td").click(function(){
        if (!$(this).text()) $(this).text(TOKENS[1 - (turn = 1 - turn)]);
        for (player in [0,1]) {
            if (cellvalues().match(new RegExp("(^(...){0,2}"+TOKENS[player]+"{3}(...){0,2}$)|(("+TOKENS[player]+"..){2}"+TOKENS[player]+")|(("+TOKENS[player]+"...){2}"+TOKENS[player]+")|(..("+TOKENS[player]+".){3})"))) alert(TOKENS[player]+" wins");
        }  
    });
});

function cellvalues() {
    var text = '';
    table.find("td").each(function() {text += ($(this).text()?$(this).text():'#')});
    return text;
}
</script>
</head>
<body>
<table border=1 id="ttt">
    <tr><td></td><td></td><td></td></tr>
    <tr><td></td><td></td><td></td></tr>
    <tr><td></td><td></td><td></td></tr>
</table>
</body>
</html>

Noiratsi (talk) 17:17, 16 June 2015 (UTC)[reply]

I came up with a way to get the values without Jquery. And for some reason, I keep getting an error that $ is not defined. I am using firefox and I have a felling that this is related to Regular expressions. —SGA314 I am not available on weekends (talk) 17:45, 16 June 2015 (UTC)[reply]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>TIC TAC TOE</title>
<style>
td {
	height:100px;
	width:100px;
	font-size:70px;
	text-align:center;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> 
<script>
var turn = 0, TOKENS = ['x','o'], table;

$(function(){
    (table = $('#ttt')).find("td").click(function(){
        if (!$(this).text()) $(this).text(TOKENS[1 - (turn = 1 - turn)]);
        for (player in [0,1]) {
            if (cellvalues().match(new RegExp("(^(...){0,2}"+TOKENS[player]+"{3}(...){0,2}$)|(("+TOKENS[player]+"..){2}"+TOKENS[player]+")|(("+TOKENS[player]+"...){2}"+TOKENS[player]+")|(..("+TOKENS[player]+".){3})"))) alert(TOKENS[player]+" wins");
        }  
    });
});

function cellvalues() {
    var text = '';
    for (var i = 1; i < 10; i++)
    {
      text += document.getElementById('f' + i).innerHTML
    }
    //table.find("td").each(function() {text += ($(this).text()?$(this).text():'#')});
    return text;
}
</script>
</head>
<body>
<table border="1px" id = "ttt">
<tr><td id="f1" onClick="fun1('f1')"></td><td id="f2" onClick="fun1('f2')"></td><td id="f3" onClick="fun1('f3')"></td></tr>
<tr><td id="f4" onClick="fun1('f4')"></td><td id="f5" onClick="fun1('f5')"></td><td id="f6" onClick="fun1('f6')"></td></tr>
<tr><td id="f7" onClick="fun1('f7')"></td><td id="f8" onClick="fun1('f8')"></td><td id="f9" onClick="fun1('f9')"></td></tr>
</table>
</body>
</html>
Ok here is a good question. using my method(using the table with the onclick cells) how would you draw a strike through line that tells you who won? Look at this image to see what I am talking about: Tictactoe-X.svgSGA314 I am not available on weekends (talk) 19:44, 16 June 2015 (UTC)[reply]
OH...GOOD...GRIEF - the code shown above is abysmal! Use data structures people!
  • Label your squares 0..8...store the board as a 1 dimensional array:
 board [ 9 ] 
  • Use 0 to represent an empty square, +1 for an 'X' and -1 for a 'O'. Note that you can add up the the numbers in any line - and +3 represents a victory for X, -3 for O. This is a very handy property!
  • Build a (constant) hard-coded 2D array with one row for each line on the board (3 vertical, 3 horizontal and 2 diagonals). Each row contains the numbers of the three squares that make up that line.
 lines [ 8 ] [ 3 ] = {
  { 0, 1, 2 },  // Horizontal lines
  { 3, 4, 5 },
  { 6, 7, 8 },
  { 0, 3, 6 },  // Vertical lines
  { 1, 4, 7 },
  { 2, 5, 8 },
  { 0, 4, 8 },  // Diagonals
  { 2, 4, 6 } } ;
  • Now, to see if someone won:
  for ( i = 0 ; i < 8 ; i++ ) // Search each of the 8 lines.
  {
    var total = board[lines[i][0]] + board[lines[i][1]] + board[lines[i][2]] ;
    if ( total ==  3 ) { ...X wins!... ; break ; }
    if ( total == -3 ) { ...O wins!... ; break ; }
  }
Easy, 16 lines of code and just one for loop to test for victory.
Just like everything else in computer science, it's just a matter of getting the right data structures.
Having that array of lines makes generating computer strategy easy too.
WORTHWHILE EFFORT: Try doing the game on a three-dimensional board with 4x4x4 cells. It's hard to play and turns the game into a serious challenge. SteveBaker (talk) 02:54, 17 June 2015 (UTC)[reply]

What is Asynchronous (Javascript)?

What does the word "Asynchronous" means in this context? Please give the simplest explanation possible, I am a total Rookie in JS. Ben-Yeudith (talk) 15:06, 16 June 2015 (UTC)[reply]

Asynchronous is a term used to mean to run something in a another thread or precess. This is a term frequently used in mutlithreaded programming. —SGA314 I am not available on weekends (talk) 15:45, 16 June 2015 (UTC)[reply]
To be more precise... Asynchronous, in this context, refers to processing order. It is common to write a Javascript function as a single, highly ordered, procedure. It is commonly called procedural programming. It is also common to write Javascript in what Java programmers like to call an event-based or trigger-based manner. As such, you do not know the exact order that the set of functions will use. A very very simple example that I show students is to write a function that sends out 10 alert functions with a timeout, each with a 10 second timeout. Each one says, "I am X" with X being replaced with the numbers 0 through 9. I call them in order from 0 to 9, but they are all called in under a millisecond. So, technically, the computer sets the timeout for all them to be the same millisecond - ten seconds in the future. When that time comes, I get the first alert (most browsers cache alerts, making you clear one to see the next). Does the first one say "I am 0"? Not always. This is asynchronous. It could easily say "I am 5" followed by "I am 3" followed by "I am 8". To get really get into what is happening, you have to look at multithreading, which is what SGA314 was talking about. 209.149.113.240 (talk) 16:20, 16 June 2015 (UTC)[reply]
Wow that sounds fascinating. —SGA314 I am not available on weekends (talk) 17:22, 16 June 2015 (UTC)[reply]
I'd say that for functions, "asynchronous" quite simply is the opposite of "blocking", and for events, asynchronous means that they may occur at any place in the program. a non-blocking "read bytes" function is asynchronous, because it returns immediately and a user-defined callback function is called when data is available. the callback function itself may or may not be synchronous. it is, if it can be called by the system at any time (like an ISR can.) it is not, if the program dispatches callback calls by polling a message queue. similarly, keypresses are asynchronous at the most basic level (the computer doesn't know when the user decides to flex his/her finger to press a key (actually, the user himself doesn't, lol)), but if the program receives keypresses by polling a message queue, this is synchronous because it happens at a specific place in the program (inside the message loop, and usually in order.) Asmrulz (talk) 18:27, 16 June 2015 (UTC)[reply]
Most of JS is single-threaded and the bits of it that are asynchronous are simulated by a message loop mechanism somewhere deep inside the JS engine. This also means that, unlike in "true" concurrency (with interrupts, preemption, hardware parallelity etc), it would take the engine extra steps to interleave data in a random manner. thus, code like setTimeout(f, 1000); setTimeout(g, 1000); setTimeout(h, 1000), the functions f,g, and h will ideally be called in that order, but don't count on it. Asmrulz (talk) 18:52, 16 June 2015 (UTC)[reply]
Asynchronous I/O is the article. -- BenRG (talk) 20:59, 16 June 2015 (UTC)[reply]

☀️

I just encountered the ☀️ character. Even the most obscure normal characters get some links, e.g. Special:WhatLinksHere/🌞 is linked by Miscellaneous Symbols and Pictographs, Emoji, and {{Unicode chart Miscellaneous Symbols and Pictographs}}, but Special:WhatLinksHere/☀️ shows absolutely nothing. What kind of character is it? Nyttend (talk) 20:19, 16 June 2015 (UTC)[reply]

It's U+2600, which Miscellaneous Symbols notes is called "Black sun with rays" -- Finlay McWalterTalk 20:23, 16 June 2015 (UTC)[reply]
does exist, as a redirect to Solar symbol. More specifically it is "Black Sun With Rays". Your text also includes an invisible character, Variation Selector 16, which is why your link doesn't work. You can see it percent-encoded in the URL: Special:WhatLinksHere/%E2%98%80%EF%B8%8F. "%E2%98%80" is the solar symbol, %EF%B8%8F is the VS-16, which indicates the emoji variant of the symbol should be used, though not all browsers support that. Mr.Z-man 20:37, 16 June 2015 (UTC)[reply]
Weird. How is it that the single character ☀️ and the single character ☀ can be different? If I use the arrow keys to move through the sentence, it treats both like a single character; it's not like ☀​, the sun character followed by a zero-width space, which the arrow key notices and creates the appearance of going nowhere when you move past the zero-width space. Nyttend (talk) 22:17, 16 June 2015 (UTC)[reply]
They are both a single character. One is represented by two code points, but that's not unusual, and most editors will skip over whole characters as a unit even if they're more than one code point long. Whether they are the same character or two different characters is a tricky question. Unicode equivalence may be relevant. Apparently, none of the Unicode normalization algorithms delete variation selectors, so they are not even compatible characters as far as the standard is concerned, though it seems like they should be. -- BenRG (talk) 00:13, 17 June 2015 (UTC)[reply]


June 17

Wikipedia graphics

I am writing to let you know that at some point in the past few days Wikipedia has stopped loading graphics for any of its pages. This includes photographs, SVG images, and math equations. — Preceding unsigned comment added by 172.191.15.235 (talk) 00:30, 17 June 2015 (UTC)[reply]

You have already posted this on the help desk. Please do not create multiple threads on the same subject. AndyTheGrump (talk) 00:38, 17 June 2015 (UTC)[reply]

Writing a bot for real-world library site search?

I volunteer at a library, and one of my "jobs" is to pull, for example, fifth or more copies of fiction books—too many copies take up shelf space and are distributed to other branches. I have no idea why no one has thought of using this thing called a computer to their advantage—this is a modern library, not some small town thing—and I would think spreadsheet data could be created and a program written to search and export only titles that are at a specific branch that have 5 or more copies, for example. I will ask about this to my coordinator, but I can read a "no" person from about 10 yards away. So I've come here for some research. I know nothing about code or coding languages. But would it be possible, even easy, to write something that can use the library's public website, searching for all titles from A-Z, going to each title's specific page and "look" for 5+ items at one branch that is listed as in-house? Would I be violating some kind of ethical code in going over their head to do this? Btw, if I get a "not possible" (yes it is) from my coordinator, I'll go straight to the IT people and expect the same answer. I can search their website manually and see the results—or what I've been doing in real life is going through each shelf, book by book... which is what the librarians have been doing for decades. I'm only trying to increase productivity; my fear is someone thinking I'm just lazy. Ugh. Thanks so much. Reflectionsinglass (talk) 05:57, 17 June 2015 (UTC)[reply]