Wikipedia:Reference desk/Archives/Computing/2010 August 11

Computing desk
< August 10 << Jul | August | Sep >> August 12 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


August 11

edit

Best Way of Automating Getting Information from Website?

edit

As stated, I'm trying to automate copying text from a website and then write it to a file. The text comes from JavaScript so it seems that I need to access the website through a browser (so I can't just download the source). I would like to be able to execute this process through something like a batch script so that it could be done every hour for example. I'm willing to try to write a program as I have some experience. The best idea I have now is try my hand at making some sort of Firefox add-on. I also have wondered if there is a program or language that will allow me to automate clicking patterns (ie click at coordinates on desktop which will open browser, click at other coordinates, drag, copy...) Any help is appreciated. 206.59.150.250 (talk) 04:35, 11 August 2010 (UTC)[reply]

Lynx (web browser) has javascript capability and if you run it with the "-dump" option, it will dump the rendered page to a text file. -- kainaw 04:42, 11 August 2010 (UTC)[reply]
I'm striking the above comment because it appears that the easy-to-download Windows binary of Lynx does not support JavaScript at all. I also noticed that many Linux flavors, like RedHat, use Lynx with JavaScript completely missing. -- kainaw 04:46, 11 August 2010 (UTC)[reply]

Undoubtedly if you wanted to dig into Java script you could figure out how it's rendering the page and write something that can find what you are looking for in it. What you really want is a java script engine that will work with a scripting language. That's the more efficient way to do this than automating clicks on your computer, although setting that up is probably easier. Although I don't think it'll deal with the java script, you might check out cURL for the general idea. Shadowjams (talk) 06:37, 11 August 2010 (UTC)[reply]

If you want to automate clicking patterns, I have not used it myself, but my colleagues have found AutoIt to be pretty excellent for that purpose, assuming you are using Windows. It's basically Windows macros on steroids. It seems to have no trouble reading pages rendered by browsers automatically. --Mr.98 (talk) 12:57, 11 August 2010 (UTC)[reply]

Structure Declaration

edit

Hello friends, I have a Small issue in structure.That is

Struct{
 char a,b,c,d;
}pi;

and

struct{
 char a;
 char b;
 char c;
 char d;
}pi;

What is the difference between those two things, Even i am not getting any error message when i compile. and the code is working well. Which is correct? Is there any problem to assign like that? —Preceding unsigned comment added by 122.164.60.10 (talk) 11:24, 11 August 2010 (UTC)[reply]

They're the same (strictly you put a capital S on the first struct above). -- Finlay McWalterTalk 11:28, 11 August 2010 (UTC)[reply]
They are equivalent from a language point of view. From a style point of view, the second generalizes to different types, avoids errors such as " char* a,b; , and looks better in metrics that count lines of code ;-). On the other hand, if you want to develop a full multi-user-multi-tasking operating system on a machine with 16 Kbytes of RAM, the first version is more compact. ;-) --Stephan Schulz (talk) 13:15, 11 August 2010 (UTC)[reply]
They compile to the same size binary. I think Stephan Schulz's joke referred to saving a few bytes of RAM while editing the text-file. Nimur (talk) 15:06, 11 August 2010 (UTC)[reply]
No jokes! When I wrote Magic Brush, I had to hand-link about 100 binary parts because the largest text file the computer could handle was about 11 kbytes, and the very primitive Z80 assembler I had did not support something like a real symbol table or a linker. --Stephan Schulz (talk) 15:20, 11 August 2010 (UTC)Thank you[reply]

MySQL table wildcard

edit

I have never done this and I can't find a reference to it in the MySQL manual... Suppose I have a bunch of tables named Table00, Table01, Table02... Table99. I want to update all of them with one query. Is there a way to use a wildcard in the table name like: update Table* set... -- kainaw 12:55, 11 August 2010 (UTC)[reply]

You can show tables that match a pattern, and I think you can use this as a sub-statement that specifies the table for the rows you want to update. Here is some example SQL: "alter all tables in a database" from the MySQL forum. Nimur (talk) 15:09, 11 August 2010 (UTC)[reply]
As an alternative, if they all have the same structure (Ughh) you could consider joining them with a Union and updating the union? --Phil Holmes (talk) 17:03, 11 August 2010 (UTC)[reply]
They do have the same structure (but it isn't what you probably think. Each table is on a different server in a different city). I didn't think it was possible to update a union and have it update more than the temp table created by the union. -- kainaw 17:07, 11 August 2010 (UTC)[reply]

Copying and uploading .ogg files

edit

I have searched for an answer but found nothing about this. We are operating a wikiclone site and are trying to use .ogg files. When I copy a sample file, say e.g., . The file uploads as File:Rhof-histWaschmaschine.ogv, but then only appears as a blue file entry in the test article. If I open it, I get a picture of a speaker and in any event the video does not play. ???? Thanks in advance for any help you can give. Д-рСДжП,ДС 17:29, 11 August 2010 (UTC)[reply]

You need the Ogg Handler extension for MediaWiki. Here are the official installation instructions. Nimur (talk) 18:39, 11 August 2010 (UTC)[reply]
That definitely explains why its not working! Thanks. Д-рСДжП,ДС 16:41, 13 August 2010 (UTC)[reply]

FutuRe CouRses

edit

i've done B.Sc. Comp. Sci.

from Mumbai University

what should i go now for

M.C.A. or M.C.M. or M.C.S.  ??????

please help

i've Scored 56%

in Third Year Exam............. —Preceding unsigned comment added by Dipesh357 (talkcontribs) 17:51, 11 August 2010 (UTC)[reply]

Firefox

edit
  Resolved

Can you start a Firefox addon directly, say Chatzilla, without the browser window opening? 82.43.88.151 (talk) 18:27, 11 August 2010 (UTC)[reply]

No. Mozilla add-ons are not stand-alone programs, and require Firefox (or other Mozilla projects) to provide critical functionality that the add-ons do not implement themselves. For a technical overview of exactly what services Firefox provides for add-ons that it is hosting, see Developing add-ons from the Mozilla Developers website. Loosely, there are three different types of addons (themes, extensions, and plug-ins). There is no feasible way to "port" a theme or extension to be stand-alone, because they are actually nestled deep and completely intwined with the Mozilla API. A plug-in consists of a large portion of non-Mozilla code that interfaces to a Mozilla project via an API - so with significant programming effort (and source-code), you could redesign a plugin to do whatever it does as a stand-alone application (but usually, better practice is to find whatver existing stand-alone application that the plug-in was originally designed to replicate inside Mozilla/Firefox). Lastly, if you just want to run an IRC client like Chatzilla, but without Firefox, consider reading our List of IRC clients for other software. Nimur (talk) 20:48, 11 August 2010 (UTC)[reply]
Addendum: this posting says that you can run firefox -chat to start Chatzilla without opening a browser window. Strictly speaking, though, the full version of Firefox is running, though no browser window is visible on screen. I misread your original question; you probably only care about visibility of the window, and not whether Firefox is background`ed. Nimur (talk) 20:51, 11 August 2010 (UTC)[reply]
Thanks 82.43.88.151 (talk) 21:39, 11 August 2010 (UTC)[reply]

Solid state hard drive

edit

Could someone dumb down Solid state (electronics) for me a bit. I just read it and it doesn't help me out.

I recently put a new hard drive in my wife's computer (Mac, not PC, before anyone gets the wrong idea) for her business. The rest of the system is starting to show its wear as well now. So, she's looking at a new system. Part of the literature says that the new ones come with "solid state drives". To me, solid state is like a stick of RAM with no moving parts. A hard drive would have moving parts, right? e.g. the platters, read/write head, etc. So are these 512 GB drives basically huge sticks of non-volatile RAM? Thanks, Dismas|(talk) 20:43, 11 August 2010 (UTC)[reply]

Solid state drive. Yes, they are basically huge sticks of non-volatile RAM. Dragons flight (talk) 20:46, 11 August 2010 (UTC)[reply]
Electronically, they are quite different from DRAM; and they don't come in sticks, but mechanically, they have no moving parts. They are more similar to flash memory than to the DRAM in the main memory of your system; depending on the specific model, they may actually be a different silicon technology altogether. See electronic non-volatile memory for a list of common technologies. "Solid-state" is a very general term; in this context, it is meant to refer to "semiconductor." Strictly speaking, a magnetic mechanical hard-drive is also a "solid-state" technology (magnetized platter); so the terminology is not ideal; unfortunately, "NAND-flash drive" apparently doesn't sound as good for marketing purposes. Nimur (talk) 20:56, 11 August 2010 (UTC)[reply]
Cool! Thanks guys, Dismas|(talk) 01:29, 12 August 2010 (UTC)[reply]

Hard drive diagnostic software

edit

I have found a few of these types of software in Google searches, are they any good and worth they time downloading and running. Some claim that they can tell you the lifetime left of your HD, thanks Mo ainm~Talk 21:03, 11 August 2010 (UTC)[reply]

Hard disk failure is a random event, no tool can guarantee you that your harddisk will not fail the coming xx weeks. Any lifetime prediction is probably based on the data provided by S.M.A.R.T., which records faults on the HD, and an increase in faults may be an indication that the disk is wearing out and may fail soon (but a disk may just as well fail without any advance warning.) If you're looking for these tools because you suspect something may already be wrong, you may be able to find data in your operating systems logfiles, eg the Event Viewer in Windows. Unilynx (talk) 21:16, 11 August 2010 (UTC)[reply]
This study by Google [1] of SMART errors is instructive. Google has the advantage of having access to a huge number of hard drives and running them quite hard. They found that 36% of drives failed without previously reporting any diagnostic errors, and that 54% failed without previously generating any bad sectors (an indicator of local disk damage). So a large fraction of drive failures are proceeded by essentially no indications. Further, though the presence of errors did greatly increase the chances of a near future failure (more than 10-fold for some kinds of errors), the fraction of drives with errors that failed in the following year was never more than about 33%. Hence, even though errors are a strong cause for concern, they can't be seen to predict more than a third of near-term failures. Dragons flight (talk) 22:29, 11 August 2010 (UTC)[reply]
That Google study's a goldmine of information dispelling a lot of hard drive myths (I like those related to cooling HDs). SMART plus Raid-5 is probably a good solution for protecting critical data from pure drive failure. Shadowjams (talk) 07:43, 12 August 2010 (UTC)[reply]