Wikipedia:Reference desk/Computing

From Wikipedia, the free encyclopedia
Jump to: navigation, search

The Wikipedia Reference Desk covering the topic of computing.

Welcome to the computing reference desk.
Want a faster answer?

Main page: Help searching Wikipedia

How can I get my question answered?

  • Provide a short header that gives the general topic of the question.
  • Type ~~~~ (i.e. four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
  • Post your question to only one desk.
  • Don't post personal contact information – it will be removed. We'll answer here within a few days.
  • 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.

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:
Help desk
Village pump
Help manual

November 21[edit]

reading / writing a file with javascript[edit]

Hi, I'm trying to write a simple game in html/css/javascript and want to be able to read / write the score, etc to/from a file, is this at all possible? I know that visualbasic scripting has Scripting.FileSystemObject. Any help/comment would be appreciated.

(ps. I have no option to google or download stuff from other sites.) — Preceding unsigned comment added by Bejacobs (talkcontribs) 11:01, 21 November 2015 (UTC)

Javascript in a web browser doesn't have untrammelled access to the user's file system, as this would be a massive security problem. The new File API allows users to grant limited access to some pages, although (because it's new) support for it is patchy. If you just want persistent storage on the client (e.g. to save state, which can be recovered the next time someone plays the game) you can use the localstorage API or even just store what you need in a cookie. -- Finlay McWalterTalk 11:09, 21 November 2015 (UTC)
If, on the other hand, you were writing in Javascript but on the server rather than the client, environments like NodeJS have a filesystem API. -- Finlay McWalterTalk 11:12, 21 November 2015 (UTC)
If you're only needing a small amount of information to be saved (less than 4096 bytes), then you can store it in a JavaScript cookie that you can create, write, read and destroy using the document.cookie interface (see: THIS for a good HOWTO document). You do need to add an expiry date to the cookie or the browser will delete it when you leave that web page - but you can set that date decades into the future and reset it each time the game is played - so it's not likely to be a problem.
The actual information will be squirreled away someplace by the browser, so it won't appear as an obvious file in the user's file system...and if you play the game on a different computer, you won't see your high score from the first session. For those reasons, storing the information in a database on the server is a much better way to go...but for a learning exercise in JavaScript, and if you don't want much more than the user's name, game preferences and a high score table - then you can certainly use a cookie. SteveBaker (talk) 13:51, 21 November 2015 (UTC)
Oh - you said you couldn't get to other sites (not even W3Schools?!?! -- YIKES!) - so I guess you'll need an actual example. I've added comments to the W3Schools example (I didn't test this - so I hope I didn't screw up - but it is pretty simple):

function setCookie(cname, cvalue, exdays)
  // cname is the name of the data (a text string),
  // cvalue is the value of that data (a text string)
  // exdays is the number of days until the cookie 'expires'
  //         (eg make exdays be 3652 for ~10 years!)

  var d = new Date();
  d.setTime(d.getTime() + (exdays*24*60*60*1000));
  var expires = "expires="+d.toUTCString();
  document.cookie = cname + "=" + cvalue + "; " + expires;

function getCookie(cname)
  // cname is the name you gave to the date in 'setCookie'
  // the return value is the 'cvalue' you gave to 'setCookie'
  // it returns the empty string if you didn't create the cookie
  // yet (eg the first time you played the game).

  var name = cname + "=";
  var ca = document.cookie.split(';');
  for(var i=0; i<ca.length; i++)
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1);
      if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
  return "";

So when the program starts up you can use 'if (getCookie("highscore")=="") setCookie("highscore","0",3560) ;' - to check that the cookie exists and set the highscore to zero if it doesn't. Then at the end of each round of the game, 'var myHighScore = parseInt(getCookie("highscore"));' to fetch the previous high score and 'if (myCurrentScore > myHighScore) setCookie("highscore", myCurrentScore, 3560);' at the end of each round to save it.
SteveBaker (talk) 14:09, 21 November 2015 (UTC)

The ″cookie″ option is a good alternative. Thanks for helping me out. Bejacobs (talk) 18:22, 21 November 2015 (UTC)

C language to machine code[edit]

Couldn't detect answer from Google... what langauge stands between C to machine code?... In Windows Os or Linux Os? is it one of the assembly languages? Or anything else? if at all? (talk) 19:30, 21 November 2015 (UTC)

It depends on the compiler - the intermediate language article lists some. -- Finlay McWalterTalk 19:36, 21 November 2015 (UTC)
It also depends on the question. From a user-level, C is typically translated to machine code. There almost always is an intermediate step to assembly language, which is just a mnemonic form of machine language - there is a 1-to-1 correspondence between assembler instructions and machine instructions. As Finlay wrote, most modern compilers have a front-end translating to an intermediate representation, which then can be transformed and optimised before it's finally translated to the machine-specific language. But this intermediate language is usually neither directly manipulated by humans nor directly executed by a machine. --Stephan Schulz (talk) 20:44, 21 November 2015 (UTC)
"...there is a 1-to-1 correspondence between assembler instructions and machine instructions." That's frequently not the case. Many (most?) modern assemblers have all kinds of bells and whistles like macros, optimization, data typing, and even things like support for object-oriented programming (see assembly language). Of course no one is (usually) forcing you to use these features, but you can't assume by default that each assembler instruction maps to a single ISA instruction. -- (talk) 05:42, 22 November 2015 (UTC)
It depends on how you define "instruction": There should be a 1-to-1 correspondence between the actual opcode mnemonics and the opcodes themselves (at least, this has been the case for every processor I've worked with). The other "bells and whistles" like data typing and macros use pseudo-instructions that are only meaningful to the assembler. OldTimeNESter (talk) 21:19, 23 November 2015 (UTC)
Using the GNU C compiler, you get the choice. If you compile using "gcc -o foo foo.c" then 'foo' will be in a binary machine code. But if you compile using "gcc -S foo.c" then you'll get a file called 'foo.s' which in assembly code. But if you grab a copy of Emscripten then you can compile C code into JavaScript!
None of that has anything to do with operating systems by the way - I can do all of those things with GNU C under Windows, Linux or MacOS.
In practice, under most operating systems, you go straight from C to machine code - just because going to assembly code and then assembling that in to machine code is a pointless waste of time. However, I have on occasion had reason to believe there was a bug in the compiler - and generating human-readable assembly code was an invaluable way to figure out what was going wrong. Sometimes, it's useful to compile very short C subroutines to Assembly language in order that you can hand-optimize them when the compiler isn't doing a good job of it...although I haven't had a need to do that for about 20 years - because compilers generally write better assembly code than I do.
There are some notable exceptions to that - I often need assembly-coded inserts into C++ programs when running on a microcontroller like Arduino because some low level hardware operations can't be written in C or C++. In such cases, I write a nice 'wrapper' function in C++, compile it with the '-S' option to get the assembly code, then hand edit it to put in a couple of lines of assembly code to do something very specific (eg turning interrupts on and off).
SteveBaker (talk) 21:05, 23 November 2015 (UTC)

My phone contacts disappeared even though I had never synced them with iCloud. Is there any way to get them back?"[edit]

I have an iCloud account but I never use it. I wanted to eliminate it from my iPhone. But I didn't remember my password, so I tried to turn off the option o syncing my phone contacts with the iCloud account. But I have never synced it. So I turned it off. It showed a message saying that all my contacts that had been synced with iCloud would be eliminated. And all my phone contacts disappeared EVEN THOUGH I had never synced them with iCloud. Is there any way to get all those contacts back?

Posted on behalf of a user without www access by μηδείς (talk) 23:13, 21 November 2015 (UTC)

Sometime when you plug an iPhone into a PC with iTunes, it will back up the contents. This could be restored if it existed. Graeme Bartlett (talk) 09:51, 23 November 2015 (UTC)
Thanks, my friend actually thought of that solution immediately, but the phone involved belonged to someone else. At this point I've been asked to close the thread, with thanks, as hopelessly as academic. μηδείς (talk) 20:09, 23 November 2015 (UTC)

November 22[edit]

Help with PGP[edit]

I am so confused. Okay, so I am trying to learn how to set up and use PGP. I downloaded the GPG Suite. I was attempting to follow the instructions here but I'm lost. I am on a Mac, running Snow Leopard (10.6.8). I successfully installed the program. I then set up a new email account as I want to have an anonymous one to use for encypted messages. I set up one at I then followed the instructions and used that email address as the one the instructions show on the first screenshot at the PGP program help page. I entered the email address I set up, hit generate key and it worked as shown.

I then went to the next step of "Your first encrypted mail". There's where I got completely lost. First they tell you "All you need for this first test is a sec/pub key in GPG Keychain matching the mail address used in" I have no idea what is. After fumbling about for about a half hour, I got the idea that it may be the mail program through my Mac -- since when you search finder for "" it comes up. I've never used that once in my life (I use all web based mail directly), but I am guessing that there's some way to set an online mail server to go through that program? Anyway, I fumbled about some more attempting this. I went through the steps to set up that mail program to feed to the email I set up. On the first screen it says:

Full Name:
Email Address:

Respectively, I put in something random for my name (since I'm trying to set up something anonymous), put in the ghostmail email address, and for the password, I used the password I set up for that ghostmail account. When I clicked continue, the next screen then says "account type" and "POP" is filled in, but I could choose, in a dropdown, IMAP, Exchange 2007 or Exchange IMAP. I left POP in. It asks me to fill in "incoming mail server" so I put in the ghostmail address again (the user name and password fields below those were still populated with the ghostmail name and password I had entered). I then click continue and it says every time "The POP server "" is not responding. Try checking the network connection..."

I have no idea if this is even what was meant when the help page told me to go to "", and if I'm even close to on the right track, I need handholding.-- (talk) 04:02, 22 November 2015 (UTC)

It's too late now, but Wikipedia has an article on (or a redirect, anyway).
GhostMail's help page says they don't support external email clients. If you plan to use this email account only to send and receive GPG messages, you can sign up with an ordinary email provider (that supports IMAP), since the client-side GPG encryption will protect your emails even if the provider has lousy security practices (if you do it right). An email provider that supports POP/IMAP/SMTP will tell you the appropriate server names (often and You should probably pick IMAP over POP. Basically you are on the right track but you were doomed to failure because GhostMail doesn't support -- BenRG (talk) 06:23, 22 November 2015 (UTC)
Good answer! To clarify one bit: When you are asked for the "incoming server", the system expects a server address (either an IP address or, more typically nowadays, a hostname), not an email address. A hostname has no "@" and in this case, typically 3 dot-separated parts, as in Ben's examples. --Stephan Schulz (talk) 08:20, 22 November 2015 (UTC)
Backing up a bit, there are two completely different ways of using email these days:
  1. Traditionally, you used an email client, dedicated to the task of sending and reading email. The client talked to a mail server using a protocol also dedicated to the task; the two best-known ones are POP and IMAP. (Even more popular, though no one ever thinks about it and I don't know what it's called, is whatever protocol Microsoft Outlook uses to talk to Microsoft's Exchange and other servers.)
  2. These days, many people use web mail. You use an ordinary web browser, talking to a webserver somewhere using ordinary http or https. The webserver does whatever it takes to render pages showing your mail, and letting you compose your mail, in HTML (with, these days, heavy dollops of CSS, JavaScript, and other modern web technologies).
Now, it sounds like you'd like to use #2. But it sounds like GPG is all set up for #1. When it asked you to set up (and when you tried to), you were setting up an email client. It wanted you to enter the address of the mail server (one that speaks POP or IMAP), but there's not actually one of those in your picture. —Steve Summit (talk) 12:44, 22 November 2015 (UTC)

November 23[edit]

Convert SVG to JPEG or other format[edit]

Is there a good way to convert an SVG file to a format such as JPEG and retain the quality? I've done this many times by doing a screenshot, but that loses a lot of quality. I've just tried four things I found on the internet and they all give very poor results. What can I do that will retain quality? Bubba73 You talkin' to me? 00:37, 23 November 2015 (UTC)

SVG is for vector graphics, and often has simple lines and hard transitions. This is not good for JPEG - you might want to go with something like PNG. For most of these jobs, ImageMagick is very good. I've never used it with SVG (afair), but it s among the formats listed as supported. Just install it and type "convert myimage.svg myimage.png" and it will do its magic. --Stephan Schulz (talk) 01:14, 23 November 2015 (UTC)
Thanks. I just tried that on Windows 10 and it was running, but then gave an error message: "ImageMagick Studio library and utility programs has stopped working. A problem caused the program to stop working correctly..." Bubba73 You talkin' to me? 01:56, 23 November 2015 (UTC)
Well, despite the error message, it did actually convert it to a PNG, but the resolution is poor. Bubba73 You talkin' to me? 01:58, 23 November 2015 (UTC)
Does ImageMagick have a parameter that sets the resolution during the conversion ? StuRat (talk) 02:09, 23 November 2015 (UTC)
I don't know about Windows, but yes, ImageMagick convert does have about a zillion options, listed at Try convert -density 300 myimage.svg myimage.jpg, and maybe throw -antialias in there. Careful - as far as I know, the order of files and options is significant, so you want to set the density before the file name ("sample at that density"). --Stephan Schulz (talk) 07:44, 23 November 2015 (UTC)
Open the svg file in Inkscape and use "save as". Select "Cairo .PNG" or "Extended metafile .EMF". Both can be opened in Windows paint (Windows 7). Then save as jpeg. --NorwegianBlue talk 07:22, 23 November 2015 (UTC)
It would be better to keep it as a PNG unless you have to use JPEG. JPEG is designed for photographs (the P of the acronym) and does a terrible job on line art. -- BenRG (talk) 07:33, 23 November 2015 (UTC)
Yes, I'll link Vector graphics, raster graphics and Rasterisation for good measure.
You absolutely cannot convert SVG to JPEG, PNG, BMP, GIF or any other raster format without losing some quality - period. In SVG, a circle has an origin and a radius - and that's about it. In a raster format, you have an explicit list of pixels stored somehow. The centers of those pixels are at integer coordinates - and that can't ever represent a circle perfectly because PI isn't a rational number.
So, any effort to convert SVG (or any other vector format) into JPEG (or any other raster format) is 100% guaranteed to lose precision. The real question here is how much precision you actually need - once you know that, you can do the conversion and get a result that's precise enough to at least meet the precision that you need. If you're going to display your SVG-converted-to-JPEG image full-screen on a monitor that's 1900x1200 pixels, then you're going to need an image that's at least that resolution. If it's only going to be displayed on an iWatch then a mere 400x400 would be overkill. But if you then expect to be able to zoom that image without it getting blocky - then you'll need more resolution. If you're going to send your image off to a print shop and have them make a 50 foot tall poster with pixels so small that it doesn't look blurry - then you may need 50,000 x 50,000 pixels.
SVG will never be blocky, no matter how big you blow it up...but since the display device you're using uses pixels (almost certainly) then the price you pay is that the image has to be re-rendered every time it's displayed. The cost of doing that may become rather extreme if you have a very complex image.
SteveBaker (talk) 20:50, 23 November 2015 (UTC)
GIMP can read SVG and export it as JPG. JPG can not be scaled. When opening the SVG You will be prompted for a resolution or size in pixels for the picture to be rendered. A later rescaling up the picture will decrease picture quality. --Hans Haase (有问题吗) 23:16, 24 November 2015 (UTC)

OK, I'm going to try some of these other suggestions. When I used ImageMagick without any parameters, the results were much poorer than using the browser to blow up the SVG as large as it could, take a screen shot, and import it into photoshop. And, you are right, I don't need it as a JPEG - just something that I can crop out pieces in Photoshop. Bubba73 You talkin' to me? 06:10, 25 November 2015 (UTC)

On a Mac, at least Google Chrome allows you to print an SVG image to PDF (via the print dialog -> open PDF in preview), and Preview can crop and convert the image to many different formats. The PDF is still vectorised, i.e. you don't lose any quality in that step. I think modern Windows will also support "Print to file" or something similar. --Stephan Schulz (talk) 10:01, 25 November 2015 (UTC)

November 24[edit]

Ad blockers[edit]

I have heard people complaining about ads that appear while they are surfing the internet, online. In response, I have heard others say "Well, just get an ad blocker. That will solve your problems." So, what exactly is an ad blocker? What does it do, exactly? How do I get one? Where do I find them? Are they free or do I need to pay for them? Thanks. 2602:252:D13:6D70:D08A:A57B:D028:8C8 (talk) 03:43, 24 November 2015 (UTC)

Well, you could start by reading ad blocking. -- (talk) 06:09, 24 November 2015 (UTC)
It is highly likely that you have a web browser that has "add-ons" or "extensions" up in the toolbar or menu. Click on that and click the search button. You can type in "ad blocker". You will likely see "AdBlocker" and "AdBlockerPro". They do the same thing, but they are two completely separate products. Both are free. Just click "install". (talk) 13:11, 24 November 2015 (UTC)
Thanks. So do you have to pick one or the other? Or do you install both? 2602:252:D13:6D70:453:997A:722E:124F (talk) 18:56, 24 November 2015 (UTC)
Just install one. The lists of what ads to block are usually pulled from a common source (such as EasyList), so the matter of which ad blocker to use is up to personal preference. clpo13(talk) 19:05, 24 November 2015 (UTC)
What they (mostly) do is to look at the situation when a web page pulls in content from a different site than the one where it is stored (cross-site loading). The ad blocker compares the name of the site from which this request is made to a black-list of known advertisement sources and prevents the item from being loaded. This isn't a 100% perfect strategy - so if I write "Eat at Joe's Diner - their roast aardvark is to die for!" right here in Wikipedia, that's an advert - but the ad blocker can't block it because that content came from Wikipedia itself - not from a cross-site download. But since most websites get paid for advertising by going through one of a relatively small number of agencies, the black-list approach works fairly well - and I rarely see an advert. Moreover, by taking this approach, it's almost impossible for the ad-blocker to block content that ISN'T an advert - although it's quite possible for an occasional advert to slip through.
Other things such as pop-up ads can also be trapped and ignored because of they way that they are displayed - but in that case, you run the risk of the tool blocking things that aren't adverts - which is highly problematic.
Like many (most?) people, I use AdBlock - which is a really easy thing to install in your browser and puts up a logo (a red octagon with a hand in it) in the top-right corner of the browser which shows you how many ads it blocked on the page you're looking at. It contains a menu that allows you to un-block ads temporarily, or on just one particular web page - and has a bunch of other fancy options. If it fails to block an advert, you can also report the fact - and presumably, if they get enough reports, they'll add the offending advertisement source to their blacklist, so the tool automatically tracks new advert sources and adapts accordingly.
SteveBaker (talk) 13:56, 24 November 2015 (UTC)
Thanks. So are there any disadvantages or problems (bugs, glitches) that accompany this ad blocking notion? It seems to good to be true. So, I am bracing to hear what the downside is? Thanks. 2602:252:D13:6D70:453:997A:722E:124F (talk) 18:59, 24 November 2015 (UTC)
Some sites will say "Turn off ad blocker to view this site" and won't work. If you really want to see an ad, it may be blocked. You need to turn off the ad blocker to see it. If everyone blocked ads for a site, the site would lose income and may go away. If you really like the website, you need to help it. You can turn off ad blocker for a specific site. (talk) 19:01, 24 November 2015 (UTC)
Some adblockers upgrade their filters automaticly, some needs to be configured with a filter list manually. If You do not select and install the filter list, it can not be applied. The blocker addon makes the browser skip web content defined in the filterlist. --Hans Haase (有问题吗) 23:07, 24 November 2015 (UTC)
Just as a bit of additional information to go with SteveBaker’s response, AdBlock and AdBlock Plus available at Adblock Plus are two very effective ad-blockers that can greatly reduce the chance of any unwanted pop-pops. However, as well as your ad-block may be, certain adware retains the ability to circumvent pop-up blockers. It is always important to keep in mind to not only install an ad-blocker from an official website, but also regularly scan your computer for malware if you ever find that a large quantity of pop-ups are still getting through.
If your computer is already infected with malware, you can read into this article on the Norton webpage about removing it Here.
Armbandit95 (talk) 21:44, 25 November 2015 (UTC)


I've found out that just about everyone I know uses GMail for their personal e-mail. Is GMail strictly webmail only, or does it offer SMTP/POP/IMAP connections for use through a normal, bog-standard, common-or-garden mail reader like Evolution or Outlook? JIP | Talk 19:56, 24 November 2015 (UTC)

I don't mean to be rude, but why not use Google to find that out? --LarryMac | Talk 20:04, 24 November 2015 (UTC)
@JIP: Yes it does. clpo13(talk) 20:07, 24 November 2015 (UTC)
I'm using it. Just ensure You do not retrieve the information of server settings from blogs or untrusted source. Refer the providers information only. Your password will be send to the server You entered in the mail clients settings. --Hans Haase (有问题吗) 22:58, 24 November 2015 (UTC)

November 25[edit]

How do they do it?[edit]

How do programs like Spoon Studio and ThinApp redirect registry and filesystem read/writes of third party programs without dissembling and rewriting their source code? — Preceding unsigned comment added by (talk) 01:14, 25 November 2015 (UTC)

See Hooking for a description of the process and some code examples. Tevildo (talk) 01:33, 25 November 2015 (UTC)

Website downloader[edit]

Hello, I'm looking for a reliable open source software similar to this. Can someone help me with this please? Regards. -- Space Ghost (talk) 05:51, 25 November 2015 (UTC)

cURL is very popular. It is a free software tool and library that can be used as a web crawler. Nimur (talk) 12:06, 25 November 2015 (UTC)
It may help if you specify what exactly you're looking for that's different from what you already have. You linked to HTTrack which as the page you linked to and our article says, is FLOSS released under GPL v3, so open source isn't the issue. Is it that it isn't reliable? If so, why isn't it reliable? Or is it reliable but doesn't have certain features you need? If so, what are these? Nil Einne (talk) 12:42, 25 November 2015 (UTC)
wget also can copy or download a html or other file without following the links inside. It simply graps the target or the forward, the webserver redirects itselves to the requested file. --Hans Haase (有问题吗) 13:15, 25 November 2015 (UTC)
Nil Einne, Nimur, wget: Someone gave me the link and told me that the software downloads the whole website, you can also use its links and everything without using the internet dongle after download too. I'm looking for something similar. I went to the website, the information was confusing plus I was confused after reading the following i.e., This free software program is not guaranteed, and is provided "as is". I thought I ask you guys if you could help me with this or something similar... What do you guys suggest? I'm happy as long as I can download and move through the links without an internet connection. -- Space Ghost (talk) 18:44, 25 November 2015 (UTC)
What you read is standard terminology. Pretty much all FLOSS is not going to be guaranteed in any way. The only way to get some sort of guarantee would be to pay for a support contract. Although it isn't really the FLOSS part, closed source software that's free will generally likewise come with no guarantees. Heck even a lot of commercial proprietary software actually has little guarantee if you read the EULA. Nil Einne (talk) 18:54, 25 November 2015 (UTC)
"As is, no guarantee" doesn't mean it won't work, just that you can't sue the author for damages if it doesn't work. No one could afford to make free software if they couldn't disclaim liability in this way.
I think you will find any website mirroring program difficult to use because it's inherently a difficult problem (impossible in general). HTTrack is probably a good choice because it's widely used, which means you'll have an easier time getting help (but not from me, as I've never used it). -- BenRG (talk) 18:51, 26 November 2015 (UTC)
I tried a website, it raped me for my mb (145mb); was still downloading. I really wasn't expecting it to be more than 100Mb. -- Space Ghost (talk) 19:50, 26 November 2015 (UTC)
Did you look at what it was downloading? It may have spread to pages outside of that site (since most sites link to other sites, and there's not necessarily any clear way to tell what a site's boundaries are unless you tell it), or it may have been fetching an infinite number of useless autogenerated pages (such as blank pages 3, 4, 5... of a list of items that ended on page 2), or it may have fetched multiple copies of the same pages under different aliases (if the site includes a random ID in URLs, for example). If it's a popular web site, someone else may solved these problems and made a working HTTrack configuration that you could use. -- BenRG (talk) 06:54, 27 November 2015 (UTC)

Could a Bottom-up Parser use left most derivation in reverse to parse a string?[edit]

I would like to know whether a bottom-up parser succeed only if it parses in the reverse of rightmost derivation?Isn't it possible for this to happen in reverse of left most derivation?Is there any reason that makes bottom-up parser to parse only in the reverse of rightmost direction?JUSTIN JOHNS (talk) 09:11, 25 November 2015 (UTC)

A bottom-up parser succeeds iff there's any derivation (i.e., iff the sentence is grammatical), and among the possible derivations it finds the rightmost one. This is just a side effect of how the parser works; it isn't a limitation (unless you wanted some other derivation, I guess).
As an example, if the grammar is S→AB, A→pq, B→rs, then when parsing the only grammatical sentence, "pqrs", the bottom-up parser first collapses pq to A, then rs to B, then AB to S. That's the reverse of the rightmost derivation, which is S→AB then B→rs then A→pq. A bottom-up parser that read the sentence from right to left would produce (the reverse of) the leftmost derivation. -- BenRG (talk) 21:57, 25 November 2015 (UTC)

Yeah thanks.I just wanted to know whether bottom up parsing is possible to parse in the reverse of leftmost derivation?It's possible.I really couldn't get why bottom up parser always parse in the reverse of rightmost derivation.It might be because it reads the string from right to left isn't it.JUSTIN JOHNS (talk) 06:23, 26 November 2015 (UTC)

Well, a derivation is (by definition) top-down. The bottom-up parser does things from the bottom up, so it can only produce a derivation in reverse. It reads the string from left to right, and does reductions from left to right, so when you reverse the order (as you must to get a derivation), the expansions happen from right to left. -- BenRG (talk) 18:57, 26 November 2015 (UTC)

Global publication alert[edit]

I have been trying to find out if there is such a thing as a global publication alert service/site - i.e. something that monitors the output of all indexed journals in a given field (or across all fields) and pings you if a publication matching your criteria is published. In my case, I just have the author's name and the likely keywords, but no publication info other than that it will be out somewhere, sometime next year (by which time I will have forgotten to go look for it). Individual publishers (e.g. Elsevier) have that service, but is there a cross-publisher scraper-type one?-- Elmidae 12:37, 25 November 2015 (UTC)

Google Scholar has an Alerts feature. As I understand it, you can use the same syntax as for normal Scholar queries, and new publications are matched against this. --Stephan Schulz (talk) 12:47, 25 November 2015 (UTC) know, Scholar was the first place I looked, and that completely escaped my attention. Durrr. Thank you! -- Elmidae 12:54, 25 November 2015 (UTC)
You might try to use the seach key beside your key words, to restrict the alert to a single page. Some pages will be retrieved for indexing a hundred times per day, some in few weeks only. --Hans Haase (有问题吗) 14:59, 25 November 2015 (UTC)
Pubmed has good alerts too, that's what I use. It sends me a weekly digest of my chosen terms. Fgf10 (talk) 20:16, 25 November 2015 (UTC)

November 26[edit]

Chess programming with Negamax[edit]

I have programmed a chess engine and use negamax with alpha beta pruning and my own evaluation function. However I don't understand one thing.

I evaluate a given position by calculation the total value of all pieces and some other criteria. If I search to a depth of one, then the evaluation will say that a move where a rock is taken is good, even if the players loses the queen in the following move. The same will happen for any depth of course. It will always give a high score for that kind of situations.

How do one solve this problem? I have googled it but can't find a good answer. If no one here knows how to do it, maybe someone knows where on the internet to look?

Chess Q (talk) 09:20, 26 November 2015 (UTC)

Do our articles on Quiescence search and Horizon effect help? --Guy Macon (talk) 09:27, 26 November 2015 (UTC)
They certainly do, I will look into those concepts more carefully. Thanks! Chess Q (talk) 10:06, 26 November 2015 (UTC)
Also, when I play chess I also consider board position as important, not points alone. I might very well choose to sacrifice a pawn if it gives me a better board position, even if I don't see any immediate gain in pieces. So, programming this into a chess engine would be a good idea. Of course, defining a "good board position" might be rather difficult. (This might be why chess grandmasters, until recently, could beat computers. Not that they could visualize more moves ahead, but because they could use intangibles like board position in their planning.) StuRat (talk) 05:32, 27 November 2015 (UTC)
True. So far I have thought of some basic ones, like double pawns are bad. But as you say, it has proven hard to define general "rules". To define what a "quiet" move is (for the quiescence search mentioned above) also seems like a challenge. I have found a few guides on the internet but if anyone knows of some good resources, books or online, that would be appreciated. Thanks so far! Chess Q (talk) 08:20, 27 November 2015 (UTC)

Hands-off Linux[edit]

I have a request to set up a computer for a disabled person. He wants Linux - which is why I've been asked to do it. He can control a touch-pad with a toe. He cannot type in any way. Anything that is not mouse-driven must be voice controlled. I got a Linux box running with a virtual keyboard that allows him to type, but he wants to be able to do voice recognition for typing emails. I've never had a reason to do voice recognition, but I've found projects, such as "julius" and "cmusphinx" that promise voice recognition. It appears that these are libraries for programmers to use. They are not voice recognition applications. What I want is very specific: Voice recogntion/dication to type an email in Thunderbird on Linux. Does that exist yet? From what I can see, it is something that will be coming in the distant future. The tools are being developed ... slowly. (talk) 15:36, 26 November 2015 (UTC)

Have you seen this article Speech_recognition_software_for_Linux. I've seen NaturallySpeaking used and that article says you can get it working under linux using WINE, i don't know how hard that is. Here's a tutorial Vespine (talk) 01:20, 27 November 2015 (UTC)

November 27[edit]

Music software sought[edit]

Say I make noise - such as La, La, La, - with a high and low pitch voice, according to some of the alphabets defined in the piano, is there a music software out there that will turn this vocal into instrumental music, such as piano keys? If you guys know what I mean... -- Space Ghost (talk) 05:19, 27 November 2015 (UTC)

The hard part will be the vocal note recognition. Still, that sounds much easier than voice recognition. Once you have the notes recorded, and the timing, it should be simple to synthesize that as any instrument you like. But one thing you probably will need is a way to edit the notes, in case it doesn't get it quite right. StuRat (talk) 05:25, 27 November 2015 (UTC)
If you google for "voice to midi app" - you'll find a lot of applications (many for phones) that will take audio of your voice and convert it to MIDI notation. Once it's in MIDI, you can generate any kind of musical instrument sound you want from that recording. It's likely that you'll need to edit the recording to 'clean up' any small errors in the recording, tighten up the timing perhaps...and there's a ton of software out there to do that too. Recommending a precise set of applications that will allow you to follow this chain of processes is difficult - much depends on what computers/phones/tablets you have - runnning which operating systems. But it can certainly be done.
SteveBaker (talk) 06:37, 27 November 2015 (UTC)