Jump to content

Wikipedia:Reference desk/Computing

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 182.18.179.2 (talk) at 19:20, 21 July 2014 (→‎Method in Java). 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:


July 16

Copy and paste password?

I couple of times that I've been on the phone to technical support, they've told me to not copy and paste a password into their software or website (type it in instead). Why is that? Bubba73 You talkin' to me? 22:47, 16 July 2014 (UTC)[reply]

Well, there could be a security issue, in that a hacker might find the document you cut and paste from, or look at the cut-and-paste buffer directly. Also, there could be hidden formatting characters is some documents, such as those using rich text format. A flat ASCII text document is safer, but you still might get extra spaces and return characters. And if you try to copy a password from a field where it displays as asterisks, that probably won't work. StuRat (talk) 23:04, 16 July 2014 (UTC)[reply]
I have my passwords in a plain text file. Most of the ones have dots in the password field, but it normally works to copy & paste from the file. Bubba73 You talkin' to me? 23:32, 16 July 2014 (UTC)[reply]
Probably a security issue, like StuRat said. Any application, including malware, can look at the clipboard buffer (trivially, by pasting) so it's unsafe while the PW is in there. Pain (a typo, but quite funny imo) Plain text files are easily accessible, too. From a security POV, they are less safe than other formats.
A browser with an internal copy/paste buffer would be much safer; that way, one can check the PW for typos before submitting it.
Some log-in pages provide a "don't hide PW" option, which you can use if you are alone or in a safe place. - ¡Ouch! (hurt me / more pain) 06:55, 17 July 2014 (UTC)[reply]
It appears that the main reasoning is that it is safer, however, see [1], [2] for arguments to the contrary (I happen to agree - it's certainly no harder to compromise a system with a keylogger, and manual typing does make it harder to use longer randomized pw's). On the other hand, though, they may be asking you to do this, if you had trouble logging in, just to make sure extra characters aren't getting added or invisible gibberish from where you stored the password is getting carried over, and hence, screwing up the process. I'm not really sure if such problems happen frequently (or if that was the reasoning in your case), but they can occur, see [3], [4], [5] for mentions, and middle section of [6].Phoenixia1177 (talk) 07:28, 17 July 2014 (UTC)[reply]
Any arbitrary website used to be able to inspect the contents of your clipboard through javascript. Now (and for the last several years) it seems like the major browsers prevent it entirely or ask for user permission on sites the user hasn't previously approved. I doubt the technique was ever used much due to the huge variety of things it could find in there, and the incredibly low odds of whatever is in your clipboard being a password that you use with an account that they can determine the username for. Katie R (talk) 13:50, 17 July 2014 (UTC)[reply]

July 17

Custom XML serialiser in .NET WCF code?

I have run into a rather unusual problem at work. We use a WCF service written in .NET C# code. This is otherwise OK, but now it has come into attention that the WCF service should not map the type xsd:decimal in the SOAP messages to System.Decimal as it does by default, but instead into our internal Decimal class, because System.Decimal has too little precision. I think I need to write a custom XML serialiser for this, but how do I go about doing it? The only difference is the handling of the xsd:decimal type. I would like to get this done by writing as little custom code as possible. JIP | Talk 11:07, 17 July 2014 (UTC)[reply]

You could create a wrapper class around the System.decimal, and create a custom serialiser/deserialiser for it. It'd probably be less work than writing a serialiser/deserialiser for the parent class. CS Miller (talk) 15:04, 17 July 2014 (UTC)[reply]
But how will the WCF service know that xsd:decimal should be deserialised to this new class instead of System.Decimal? From what I understand, the incoming SOAP messages could contain numbers that are so precise that if they ever get made into System.Decimal objects, we lose precision, or the whole process fails. JIP | Talk 15:14, 17 July 2014 (UTC)[reply]
If I understand WCF correctly, it uses DataContractSerializer to serialise and deserialize C#.net objects to/from XML. It looks (frankly I haven't tried it) that there are two ways to customise its behaviour to handle new types. The first is (statically) to add a new known type, which has its own handler. The second is to dynamically handle things with a custom resolver, which is provided as a helper when you create a new deserialiser (the resolvename() method is the locus of your interest). What I don't know is whether either of these can override an existing type; I don't see any documentation, particularly for the latter way of doing things, which says you can't - I think you'll have to try it and see. -- Finlay McWalterTalk 17:53, 18 July 2014 (UTC)[reply]

Terminology of email accounts

I admin a site that has many users and many email addresses. I have a solid idea of what they do and what they are but for non-tech people, I sometimes have a hard time coming up with a succinct term for the difference between the accounts.

There are Forwards which we mostly use as a dispersion sort of thing, e.g. something comes in to Billing@ and that forwards those messages to several people.

Then there are the regular email accounts which are basically meant for individual people, e.g. Mary@, Joe@, etc.

What is the common terminology to differentiate between these types of accounts? Would you term them as Forwards and Accounts? Forwards and Inboxes? The problem my brain has is that the forwards are accounts as well but not really. So, what's the common term to differentiate for explanations to non-tech people? Dismas|(talk) 12:00, 17 July 2014 (UTC)[reply]

I'd call the former a role address, or a role account. CS Miller (talk) 15:01, 17 July 2014 (UTC)[reply]
Another option might be "service account" or "service address", compared to "personal account" or "personnel account", etc. One common thing is to have addresses like help@example.com or webmaster@example.com these are for roles or services, and not designed to reach a specific person. As I'm sure you've discovered, it's very hard to use google to find documentation on this... SemanticMantis (talk) 17:23, 17 July 2014 (UTC)[reply]
Or how about a "bot account", meaning a bot is used to forward the mail from there. StuRat (talk) 17:54, 17 July 2014 (UTC)[reply]
It's not a bot though. I would tend to describe the "forwarding" address as an email alias. In my organisation (and in others) [7], [8], these accounts are known as generic email addresses.--Kateshortforbob talk 11:59, 18 July 2014 (UTC)[reply]

July 18

Where are google earth "pins" stored?

I've recently changed from an XP PC to a Win7 PC> I'd like to copy my google earth pins across. Where would they be on the XP and where should they go on the Win7? -- SGBailey (talk) 11:45, 18 July 2014 (UTC)[reply]

I just found this with google:
Your Placemarks are stored in a file named myplaces.kml
XP: C:\Documents and Settings\YOUR user name\Application Data\Google\GoogleEarth\myplaces.kml
Win7: C:\users\YOUR user name\appData\LocalLow\Google\GoogleEarth\myplaces.kml 

-- SGBailey (talk) 22:26, 18 July 2014 (UTC)[reply]

Reminders

I would like to be able to remind myself of actions to take at some future time. (Eg, pay for a holiday 6 weeks before travel in 6 months time...)

Is there anything that can readily do this on Windows 7? I had thought to use a perl script (which I run at bootup anyway) to add a sticky note to the sticky notes file, but I can't determine how to add a note to the stickynotes file.

Any suggestions? -- SGBailey (talk) 12:20, 18 July 2014 (UTC)[reply]

Google Calendar does this. You can set any reminder for any time you like and it will e-mail you when you want it to. Mingmingla (talk) 16:01, 18 July 2014 (UTC)[reply]
I'm giving that a try. Thanks -- SGBailey (talk) 17:19, 18 July 2014 (UTC)[reply]
I use my cell phone for this type of thing. Most cell phones have a calendar with this capability. Then there's also a paper calendar, which is less likely to lose that info if you reinstall the O/S. Of course, you need to get in the habit of checking your paper calendar every day, as it can't set an alarm. For really important things, like say your wedding anniversary, it's best to use multiple methods, if you want there to be another anniversary next year. StuRat (talk) 16:11, 18 July 2014 (UTC)[reply]
The thing I like about Google Calendar (and I presume Apple's iCal works the same way) is that it syncs across devices and the web services that you have, presuming you have a Google account. So my phone, my tablet, my desktop and my e-mail will all notify me one way or the other with an audible alarm, a notification, and the aforementioned e-mail. This prevents the O/S installation and accidental deleting from losing a single device from being an issue. It's "in the cloud". Mingmingla (talk) 22:12, 18 July 2014 (UTC)[reply]
That's pretty good, but my paper calendar will still work after an EMP. :-) StuRat (talk) 23:00, 18 July 2014 (UTC) [reply]

(1)How can I add the music Handel's "Messiah" to my PowerPoint for class; (2)how to documented the music to a "Works Cited" page?

Hi Wiki,

Have questions:

(1)How can I add the music Handel's "Messiah" to my PowerPoint for class;

   and

(2)how to documented the music to a "Works Cited" page?

Grateful,

Didi Abel — Preceding unsigned comment added by Didiabel (talkcontribs) 17:05, 18 July 2014 (UTC)[reply]

1) Do an Internet search to find the piece in a supported PP format: [9], then download it and import it into the PP presentation. Note that some formats sound better than others, and some recordings will be better than others, so avoid any version performed on the kazoo. :-) StuRat (talk) 17:40, 18 July 2014 (UTC)[reply]

Dataflow driven programming framework

I'm developing a high-performance DSP system in C++. I've designed and simulated the algorithm but now it's time to start working out a structure for the actual code. It can be visualized as a directed graph of data streams, being transformed by MIMO blocks. Most streams will be fixed rate, but there may be some special cases where samples come in at arbitrary intervals. All samples will be timestamped, or a timestamp can be inferred based on the sample rate.

At several stages of the flow there are points I would like to be able to log and analyze data.

The output is being used for real-time control of a low-latency system, so I would like to be able to specify that the output thread must run at real-time priority, and the framework should be able to infer what other components of the system will also need to run at that priority. Other outputs that are being used for diagnostic displays or end-of-run reports would not need to run in real time, so their processing could be done in lower priority threads, or if needed be suspended entirely unless buffering their input starts causing memory pressure.

The basic concept I have is some sort of directed graph model with lazy evaluation. If the output thread is running at real-time priority, then it could work backwards up its dependency chain running any needed calculations at its priority level. Lower priority threads would work the same way, and could take advantadge of the work done by the high-priority sections once they reach a point where they are dependent on them.

I have some ideas of how to go about implementing this, but I was wondering if there are any existing frameworks that would be good for building this sort of system. The concept isn't too hard, but there's no point in me reinventing the wheel, especially with all the possible gotchas in implementing some of the details. Katie R (talk) 18:02, 18 July 2014 (UTC)[reply]

Is there a daily maintenance period ? If so, then all the low priority jobs could be run then, if once a day is sufficient.
Something else to think about is if you have too many high priority jobs running at once, do you prefer to slow them all down equally, or suspend some until later ? StuRat (talk) 18:21, 18 July 2014 (UTC)[reply]
By low-priority I mean that the output period can be slowed down to hundreds of milliseconds between updates instead of tens of microseconds, or in some cases it can wait till the end of a test that runs for a few hours. I've designed the system so there will be enough processing overhead to handle everything it needs without violating any timing constraints - the most intense real-time processing comes in bursts and there is enough memory for the lower priority stuff to queue up data instead of process it, then catch up when the real-time code isn't working as hard. The problem now is just finding a framework that lets me implement this sort of system without having to dive into the nitty-gritty details of managing the scheduling of each component. The dataflow is simple enough that I feel like a framework designed for this sort of problem should be able to work out those details itself, now that I've proven that there will be enough overhead for it to work. It would also make things more flexible when it comes to changing the design down the road because I would just have to work at the higher level. Katie R (talk) 18:35, 18 July 2014 (UTC)[reply]
Still, even though you think you have enough resources to get the job done, you should have a backup plan in place for what to do if resources are more limited than you expect. I've seen system go to page swapping when handling too much at a time, and consequently grind to a crawl, where just cutting back on the running processes would have made everything run much more smoothly. StuRat (talk) 19:14, 18 July 2014 (UTC)[reply]
I know precisely what resources I have, what processes are running on the system and at what priority, the purpose and frequency of each interrupt on the system and the delays involved in handling it. Non-essential interrupts are preemptible, and I can place precise bounds on the delays in the critical data processing interrupts. I monitor the running processes for unexpected amounts of memory usage and the operating system scheduler puts precise limits on the amount of CPU time each process is allowed to use. My process's code segment is pinned in physical memory, and before running a test all data pages are pre-faulted and pinned. I have mathematically proven the correctness and performance of my algorithm, confirmed those results through simulation, and have a test plan in place to empirically verify the performance on actual hardware once it is implemented. System monitoring code watches for anything to go outside of acceptable bounds and immediately attempts a smooth shutdown and termination of the run, because if something goes outside of those bounds then something is happening that I do not yet expect or understand, so it should stop until we analyze the situation.
This isn't a question about best practices for handling high CPU loads and many jobs, it's about frameworks for high performance dataflow-based DSP algorithms on multiprocessor systems. Katie R (talk) 19:50, 18 July 2014 (UTC)[reply]
In the functional community, the sort of lazy evaluation you are talking about is sometimes called reactive programming. There are a number of C++ libraries that implement some sort of dataflow structure:
  1. DSPatch
  2. Boost::Dataflow
  3. dc-lib
  4. Route11
If you want to get closer to the metal, SystemC is more of a software version of an HDL. --Mark viking (talk) 19:28, 18 July 2014 (UTC)[reply]
Thanks for the links - I'll start looking into them. I should have also added that this is proprietary code, so GPL and other licenses that would require it to be open-sourced aren't acceptable. I'm hoping to stay at the high level here, I've done enough low level stuff writing the DAC/ADC drivers and managing all fiddly bits of the system that can lead to delays, and have a pretty clean abstraction of it all by the time I get to my C++ code. Katie R (talk) 19:50, 18 July 2014 (UTC)[reply]
Oooh and DSPatch looks very shiny! And LGPL so I can use it. :-) Katie R (talk) 19:54, 18 July 2014 (UTC)[reply]

July 19

Online port scanner for my computer

Does anyone know of an online port scanner that is capable of scanning ports 0-65535 all in one go (i.e. all of them)? I just want to thoroughly check my computer's security. Cheers. --Kurt Shaped Box (talk) 11:17, 19 July 2014 (UTC)[reply]

GRC ShieldsUp! do that.. or at least, that is what the page claims. It also checks for other leaks and holes. WegianWarrior (talk) 19:31, 19 July 2014 (UTC)[reply]
Yup - but that one only scans from 0-1056. Those are the standard ports, but there are more. I believe that you can enter the higher numbers in a custom scan, but only 64 at a time. There did used to be a site that did what I was looking for - the scan took about 10/15 minutes. I don't know if it's gone from the internet now though... --Kurt Shaped Box (talk) 08:23, 20 July 2014 (UTC)[reply]
These sites, [10], [11], [12] all appear to do what you are looking for. This site [13] asks you to only do a range of 500, but it looks like it may do more (I did not test it, only including it in the event that the others all fail to satisfy, you still have an option).Phoenixia1177 (talk) 03:33, 21 July 2014 (UTC)[reply]

Concurrent programming languages and non-concurrent programming languages

What makes a programming language non-concurrent? Can't all languages start a process, a second process and so on? (in the same way that a user can start several programs). OsmanRF34 (talk) 12:36, 19 July 2014 (UTC)[reply]

It may be instructive to turn the question around and ask "what makes a programming language concurrent ?". Some languages provide native support for a concurrent programming paradigm. This is not just the ability to start new processes, but also involves a model for communicating between processes and handling interrupts. Other languages require an extension, add-on or library to support concurrent programming. This creates an additional learning overhead for the programmer, and may be less efficient (slower running, more memory overheads etc.) than a language that provides native support. Gandalf61 (talk) 13:53, 19 July 2014 (UTC)[reply]
Some languages are designed around concurrency to such an extent that virtually any nontrivial program in that language will make heavy use of it. Erlang and ToonTalk are examples. Others (like Java) are conventional sequential-imperative programming languages that just happen to have standard support for concurrency, and I wouldn't necessarily call those concurrent languages. Wikipedia's Category:Concurrent programming languages seems to be inconsistent about this—it includes Java but not C++11, for example. -- BenRG (talk) 23:01, 19 July 2014 (UTC)[reply]
Are there any languages/compilers that can figure out for themselves what can be optimized into concurrent processes and what can't ? (In some cases, it might need to gather statistics from several typical runs to figure this out, similar to how some relational database systems gather stats and use those to optimize indexing, etc.) StuRat (talk) 04:06, 20 July 2014 (UTC)[reply]
Automatic parallelization is very hard in general. The overhead of creating and synchronizing threads is large enough that you need to do a fairly large amount of independent computation in each one before it pays for itself, and most programs don't have such long independent computational chains in them, at least not without high-level algorithmic changes that compilers aren't smart enough to do automatically. Automatic vectorization, using SIMD instructions instead of threads, is much easier and a lot of popular optimizing compilers support it. (Historically this was a strength of Fortran compilers, but I think the C++ compilers have caught up.) -- BenRG (talk) 05:56, 20 July 2014 (UTC)[reply]
Thanks. StuRat (talk) 12:13, 20 July 2014 (UTC)[reply]

simple cross-platform library to display rasters?

I have a C program that runs a simulation and outputs the final state as a PGM raster image, but I want to make it display rasters for the intermediate states as they're computed. I know almost nothing about graphics libraries. I'm on my way to figuring out how to do what I want with OpenGL and GLFW. But that seems like overkill for such a simple task. If I understand right, the whole point of OpenGL is rendering, and I don't need any rendering. Just a window I can draw pixels on. So what am I missing? Is there a conventional cross-platform way to do what I want? Or do people just use OpenGL, since it exists and works? Thanks! --Allen (talk) 19:18, 19 July 2014 (UTC)[reply]

Graphics libraries take primitives operations like "draw line" and generate image files (or image buffers in memory). They don't display them. It sounds like you don't need the graphics library part at all (you're doing that yourself in your own code). What you need, as you say, is something to make a visible window, provide your program with something to draw into, and manage the usual events that keep a graphical application on Windows, Linux, etc. working okay. That's the job of a GUI toolkit; there are a bunch of cross-platform ones, including wxWidgets, GTK+ and Qt. But these are heavy tools for this simple job you want. For what you want, I'd recommend Simple DirectMedia Layer (SDL). Although SDL is designed for games, it's good for what you want too, and it's super simple to use. I have a program somewhere that draws a Mandelbrot set into an SDL window, with progressive updates as the computation proceeds. I'm pretty sure I used SDL; I'll see if I can dig it up. -- Finlay McWalterTalk 19:32, 19 July 2014 (UTC)[reply]
Thanks Finlay! I'll look into SDL. And it'd be great to see your Mandelbrot code if you do come across it. --Allen (talk) 19:47, 19 July 2014 (UTC)[reply]
It turns out I had some SDL code, and some Mandelbrot code, but they weren't together. So I merged the two to make this very basic example. Note that the flow of this code mostly resembles a conventional non-interative program, and as such it's a bad example of how you'd actually code in any interactive GUI system (whether SDL or another toolkit). Because a program has to respond to inputs and other events, they're typically event driven, where the main event loop never blocks (to keep the program responsive). In such environments, if a program needs to do long-running computation, the calculation is farmed out to a different thread, and care must be taken to properly synchronise (coordinate) access to shared resources. In this case, for simplicity (and laziness) I do just block, which is why the program is totally unresponsive during the calculation; it can't even be closed. -- Finlay McWalterTalk 22:32, 19 July 2014 (UTC)[reply]
I should note that it is possible to do long-running calculations without the complexity of another thread. What one typically does is have the main loop poll for events, and then (if there's no event to service) do just a tiny bit of the calculation (only a few millseconds worth) before going back and polling again. This isn't hard, but it rather everts the flow of control, so it takes a bit of getting used to. -- Finlay McWalterTalk 22:37, 19 July 2014 (UTC)[reply]
This is exactly what I needed; thank you! I'm not worried about interactivity just yet, so blocking is no problem. I'm just happy to know how to put pixels on a window. --Allen (talk) 02:24, 20 July 2014 (UTC)[reply]
I'd like to know the same thing, but from Fortran (specifically gfortran). My current approach is to output an image file and display that, but this is too slow for continuous updates. StuRat (talk) 02:30, 20 July 2014 (UTC)[reply]
In your position, I'd just have the program write out these consecutive intermediate images into a somewhat more common format (PNG, JPEG - using libpng and libjpg respectively) into a directory someplace and write a simple HTML wrapper so you can view your raster images in a browser. The nice thing about doing this stuff there is that the browser takes care of all of the windowing stuff for you. It's really easy to use JavaScript to grab different images and display them consecutively or whatever.
SteveBaker (talk) 03:57, 20 July 2014 (UTC)[reply]
That's exactly what I do now, from Fortran. It takes several seconds to update an image, though, and closing the old image is tricky, requiring you to kill the browser process. I used IE as the browser, since that's likely to be on any Windows PC. StuRat (talk) 04:02, 20 July 2014 (UTC)[reply]
There is a trick to making it reload - I used this to load still frames from a webcam feed - the file "webcamOutput.jpg" gets reloaded about once a second. To prevent the system from caching it, add a garbage "?t=xxx" to the end of the filename and increment xxx each time:
 <html>
 <head>
   <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
   <script>
     var unique = 0 ;
     function reloadImage()
     {
       var webcam0 = document.getElementById ( "webcam0" ) ;
       webcam0.src = "webcamOutput.jpg?t=" + unique ;
       unique++ ;
       setTimeout ( "reloadImage()", 1000 ) ;
     }
   </script>
 </head>
 <body>
   <div id="webcamWrapper">
     <img id="webcam0" src="webcamOutput.jpg">
   </div>
   <script>
     reloadImage() ;
   </script>
 </body>
 </html>
should work on any browser. (IE is by *far* the worst browser to choose for this kind of thing!) SteveBaker (talk) 15:38, 20 July 2014 (UTC)[reply]
So changing the title of the image file stops it from reading it from the cache ? Thanks, I might try that. But it still is probably too slow of a refresh rate for many applications. One issue that comes up is image compression. Either I spend the time to compress each image, or I deal with huge files, either of which may slow things down to an unacceptable degree. StuRat (talk) 16:25, 20 July 2014 (UTC)[reply]
Yes - changing the filename WOULD avoid the cache issues - but that's not quite what I'm doing. When the browser requests a file via a URL, it can add parameters to that request (like if you check a box in an online form). If the file (which in this case is a dumb image) has no interest in those parameters, they are ignored...but they serve to make the request unique - even though the file isn't. And that's enough to bypass the cache without you end up with a bazillion junk images on your computer. As for speed. I'm using this to monitor a web cam at one frame per second (or so) - and it's plenty fast enough for that - even grabbing the file over the Internet. However, if you need more speed than that, or if your files are *HUGE* then you're effectively building a full graphical program and/or engineering a video stream and then you'll be writing a LOT more code! However, for monitoring slow-running processes - this is great because you can view it over the network, view it on your phone and the amount of code you need is tiny. So YMMV. SteveBaker (talk) 17:04, 20 July 2014 (UTC)[reply]
My particular application was a redneck version of the board game Clue, featuring characters like "Skeeter" and "Bubba", locations like "The Trailer" and "the Outhouse", and weapons like "Bottle of Jack Daniels" and "Pit Bull". I had a separate text command line interface window, and wanted to also show the game board graphically. So, if I wanted to display (barefoot) foot prints when the player moved, a one second delay would be too slow for each step, with up to 12 steps per move. A tenth of a second would be good, though. I ended up using an animated GIF to get the speed I needed. StuRat (talk) 17:32, 20 July 2014 (UTC)[reply]
OpenGL is supposed to be a general graphics library with support for 2D as well as 3D graphics. If you just want to blit a bitmap into a window without any fancy 3D effects, glDrawPixels will do that efficiently. Here's a complete example doing more or less what you want, though using GLUT rather than GLFW. It's quite similar to Finlay McWalter's SDL code. GLUT doesn't support event polling, so you would have to do your calculation in the glutIdleFunc callback (which could be a hassle because of the control inversion), or else use GLFW which does support polling. -- BenRG (talk) 05:26, 20 July 2014 (UTC)[reply]

July 20

iVillage

What the happened to iVillage as a whole? Especially, I couldn't post this in the talk selection of their page here. Basically, it went under and will be merging with NBC Today Show internet page as whole, next mo.

Sounds like you answered your own Q. Are you asking why it "went under" ? StuRat (talk) 17:40, 20 July 2014 (UTC)[reply]

July 21

What is the difference between formulas and algorithms?

If you take a formula, for example, Celsius Fahrenheit conversion, you can apply it step by step, and somehow fulfil the definition of algorithm (something that's finite and step by step to solve a problem). At least, with an intuitive interpretation that makes sense. Is the difference just the way you express things?OsmanRF34 (talk) 09:03, 21 July 2014 (UTC)[reply]

"Formula" usually means a mathematical equation or something similar. Evaluating a formula is indeed a simple algorithm, but algorithms can be more complicated: in particular, they can include ways to vary the sequence of actions, similar to "while" or "if" statements in a programming language. --50.100.189.160 (talk) 10:35, 21 July 2014 (UTC)[reply]
An algorithm is a series of steps to solve a problem or perform a task. A formula is a series of steps that takes an input and produces an output. In your example, the formula requires a Celsius input and produces a Fahrenheit output. The algorithm is the series of steps requires to solve the problem.
The articles on formula and algorithm should help. --  Gadget850 talk 12:18, 21 July 2014 (UTC)[reply]
A formula is a kind of minimalist algorithm - but it only encompasses arithmetic operations. An algorithm can be much more than that. For example, I can say that the algorithm for making a phone call is:
  1. Pick up your phone.
  2. Make sure it's turned on.
  3. Touch the phone button.
  4. Dial the number
  5. Wait for the caller to answer.
That's an entirely valid algorithm - but it would be impossible to express it as a formula. That said, as you pointed out, the Celsius to Fahrenheit conversion formula is indeed a very small algorithm.
So a formula is a kind of algorithm but an algorithm isn't necessarily a formula. There is another sense to it though. A formula can trivially be described as an equation 'F=Cx9/5+32' - and an equation can do something that an algorithm can't - you can use the standard rules of algebra to discover that 'C=(F-32)x5/9' - which means that you had a second algorithm (one that converts Fahrenheit into Celcius) contained within that very same formula. So in that sense, a formula (by it's very simplicity) is capable of conveying information that a generalized algorithm may not. This becomes increasingly clear as you consider equations with more unknowns in them. Ohm's law (I=V/R) effectively contains the description of three algorithms...I=V/R, V=IR and R=V/I.
The name of the FORTRAN programming language is short for "Formula Translation" - and it was first envisaged as a means to convert formulae into algorithms. That capability (to type in a formula into your computer program and have the compiler or interpreter of your software convert the formulae into algorithms) is now such a standard feature that we tend to forget that it's there. SteveBaker (talk) 14:37, 21 July 2014 (UTC)[reply]
  • There is obviously some overlap, and sometimes some ambiguity between the terms, as others have pointed out. One additional conceptual difference is that formulae are essentially declarative, while algorithms are essentially procedural. For example F=ma is a declarative statement, without any necessary action. Steve's example algorithm is a set of procedures, with no declarations. There is also an analogy to programming language paradigms, List_of_programming_languages_by_type has examples of declarative and procedural languages. SemanticMantis (talk) 15:47, 21 July 2014 (UTC)[reply]
It might be instructive to compare "equation" to "equation solving." These terms have a similar relationship like "formula" and "algorithm." Of course, in common parlance, these kinds of related terms can be applied in a variety of ways, blurring their dictionary-definitions and defying all efforts to draw a distinction among them. Nimur (talk) 16:41, 21 July 2014 (UTC)[reply]

Malware

Some time ago, during the World Cup playoffs, I picked up a virus that keeps plaguing me with popups advertising all kinds of things. It also makes my browser, Firefox, go back TWO pages when I hit the back arrow, and throws up unwanted/weird pages on my screen. Fortunately, Wiki seems relatively unaffected by these ploys. But when I'm visiting other websites, such as Reuters, BBC, AP, AOL (mail) it drives me crazy.

I reloaded AVG, and it keeps killing malware, but that keeps coming back like a metastasizing cancer. I've done innumerable AVG scans, which have isolated such things as Malsign.Generic.6E2 and Trojan Horse, but the problem continues.

Suggestions? Should I remove Firefox and reload it? Help!

TNX. Sca (talk) 16:32, 21 July 2014 (UTC)[reply]

If your machine is compromised, you need to completely re-install it. There is no way to confidently assert that any type of anti-malware or anti-virus software can ever possibly restore the machine to proper working order. If you'd like to dive in to the technical details regarding why antivirus software is completely unable to confidently assert that the malware is gone, we can explain in more elaborate detail. But, as this 2012 StackOverflow discussion also emphasizes, it is better if we just phrase it this way. "It will take longer and cost more money and cause more collateral damage if you correctly run anti-malware software than if you cleanly wipe and re-install your machine." The most rational choice, to minimize your time, effort, and data loss, is to wipe the machine and re-install it. The next course of action is your choice. Nimur (talk) 17:05, 21 July 2014 (UTC)[reply]

Method in Java

I have a confusion with System.out.println() regarding its not taking methods with void return type. i mean why cant i call a method inside S.O.P that returns void.? i browsed it on web but did not come up with relevant answers.182.18.179.2 (talk) 19:18, 21 July 2014 (UTC)[reply]