Jump to content

Wikipedia:Reference desk/Archives/Computing/2007 January 29

From Wikipedia, the free encyclopedia
Computing desk
< January 28 << Dec | January | Feb >> January 30 >
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.


January 29

[edit]

python analogue to 'getattr' (getobj?)

[edit]

How do I use a string literal to specify an object instance in the same way you can invoke getattr to use a string literal to specify an object attribute. For example, I want the code that makes all of the following lines mean the same thing:

  value = MyObject.attribute
  value = getattr(MyObject, "attribute")
  value = getattr(getobj("MyObject"),"attribute") ### what's the correct way to code this?

thanks for any help, links to docs, keywords to search etc. NoClutter 01:43, 29 January 2007 (UTC)[reply]

MyObject, like any other name that does not require qualification with an instance or class, is just an object in some module (possibly the module __main__ that holds the overall script), which is itself an object. So just call getattr() on that. --Tardis 18:16, 29 January 2007 (UTC)[reply]

Gaps between CD audio tracks

[edit]

I have a music CD containing "interludes" between audio tracks: that is, after one track completes, there is a period of music when the track time is displayed as negative, before 0:00 of the next audio track. Is there a term for this (which I suppose is comparable to a pregap, only after index 01)? How would this be created?

Furthermore, this behaviour is only exhibited by my stereo, whereas all computer CD drives seem to treat these gaps as part of their preceding tracks, and there is no negative track time. What causes this? –Unint 02:40, 29 January 2007 (UTC)[reply]

I think they're still called pregaps. Notice carefully how pregap says pregaps come before INDEX 01, not TRACK 01. Here's a short example of an EAC cue sheet (music software):
TITLE "test"
FILE "test.wav" WAVE
  TRACK 01 AUDIO
    TITLE "Test 1"
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    TITLE "Test 2"
    INDEX 00 00:08:00
    INDEX 01 00:10:00
--Kjoonlee 12:13, 29 January 2007 (UTC)[reply]
Okay, so I assume in that article subsequent mentions of "the pregap" is just shorthand for "the first pregap"?
Also, so I could write a cue sheet to exclude these gaps when playing/ripping? –Unint 17:50, 29 January 2007 (UTC)[reply]

ipod disk defragment?

[edit]

Is it possible (and beneficial) to defragment the HDD on a fifth-generation ipod? Also, can the defragmentation corrupt data on the disk? (like basic operating software etc) Mango Sango 03:10, 29 January 2007 (UTC)[reply]

I don't think defragmenting an external HD is recommended, but if it is, then, yes it could be good, because the ipod uses FAT, a filesystem that is often fragmented quickly. --wj32 talk | contribs 05:42, 29 January 2007 (UTC)[reply]

I would only recommend defragmenting it after you put on a lot of albums because the partition, as Wj32 said, gets easily fragmented. Xaro 11:06, 29 January 2007 (UTC)[reply]

Software over hardware...?

[edit]

Is there anything that software (a short subroutine) could do in the way of causing physical damage to a harddrive such as physically destroying track zero? 71.100.10.48 03:22, 29 January 2007 (UTC)[reply]

Not exactly physical damage, but it could use some (undocumented and proprietary) commands to do things like overwrite the disk's firmware or even some essential control data in the disk itself. Recovering from that could probably be done only by the manufacturer. It's also possible (though very unlikely) for it to change the firmware in such a way it drives the pins in a invalid way, causing a short circuit and thus burning some of the disk's controller chips.
Having said that, since such things would work only on specific disk models, most disk-damaging malware just erase the data on the disk via the usual means, so the disk is not bricked and can easily be reused. --cesarb 03:42, 29 January 2007 (UTC)[reply]
Back when they used different voltages for the different flavors of IDE, I remember seeing something about it being possible to overvolt some hard drives from the IDE bus, possibly burning out their logic. Droud 18:08, 29 January 2007 (UTC)[reply]

JPEG format output...?

[edit]

Is there any way such as an add-on that will allow Visual Basic 6 savepicture function to output pictures in a jpeg(jpg) format instead of a BMP format? 71.100.10.48 03:33, 29 January 2007 (UTC)[reply]

VB6... try using an InfectiveX control, and if that doesn't work, try executing a BMP to JPEG program from your program. --wj32 talk | contribs 05:37, 29 January 2007 (UTC)[reply]

802.11g

[edit]

What is the wireless card range of the Macbook Pro (core duo), when in ad hoc mode with other macbooks and macbook pros (all core duo)? Thanks in advance!--Ryan 04:21, 29 January 2007 (UTC)[reply]

The range of any wifi system is highly dependent on what is going on in the required frequency space. There have been some articles lately on how you can pick up a lot of neighbours (crowded airspace), and that the local wifi is randomly dropping out. If you set up a whole cluster of wifi adhoc stations, this is probably worse than having neighbours! --Zeizmic 17:11, 29 January 2007 (UTC)[reply]
But what would the range be?
Well, it depends on how many walls are inbetween you, solar storms, the color of the sky, and many other random variables. You would have to try it yourself, but, it wouldn't be a constant result. I would guess that the range is standard for a wireless router. (It really dosen't depend on the color of the sky.) -Trident523 15:13, 7 February 2007 (UTC)[reply]

Booting

[edit]

Any idea how to change which operating system boots first and which is the default operating system? Is it possible to have two versions of 98 installed on the comp??

It would be appropriate to know the operating system you use but from the last bit of your question it appears to be win98. Im comfortable with win xp where you right click on my computer icon, then click properties, then click advanced, then click startup and recovery, from here you can edit(click on edit but be carefull not to mess it up you can save somewhere it before you start edditing.

With Win 98 there is a hidden file called boot.ini which you can edit using notepad. Im not sure about this!

Use something like Acronis OS selector. Splintercellguy 23:00, 29 January 2007 (UTC)[reply]

Ram diagnosis

[edit]

I just added new Ram to my comp..WINXP works fine without reinstallation. But WIN98 hangs up sometimes and often I get a message that I have run out of memory.Also reinstallation of WIN98 did not work.Any idea on how to make WIN98 accept the new memory without reinstallation?

Maybe the RAM block is defect. Happened to me once with a brandnew 512MB block of RAMs, after inserting it into the computer, Windows XP crashed all the time to bluescreens and worse, after I ejected the block it (and installed a new one) it was fine again without any software modifications or new installations. Also I recon if you use Windows 98 still, your PC could be an older one too? If so, some old Pentiums had to have 2 exact same blocks of RAM in it to function correctly (i.e. if you want 1024 MB you would have to use 2x512MB and could not use 512MB 2x256MB). Also please sign your posts with 4 tildes (~~~~). -- Aetherfukz 16:36, 29 January 2007 (UTC)[reply]
Try Memtest, that is a sure way to tell if the chips are okay or not. Knowing the configuration of your PC would be helpful (Processor class/type, mainboard will suffice). I stretch my PC to the limits (a board that originally ran a PII/450 now runs a PIII/850 with 512 MB RAM) so maybe I could help. Cheers. --Ouro 19:02, 29 January 2007 (UTC)[reply]
How much memory does your computer have? Windows 98 doesn't work right if you have more than 768 MB of RAM in your computer. There are a couple of workarounds: either hide the extra memory from Windows, or tweak Windows so it works properly. See http://support.microsoft.com/kb/253912 for details. --Carnildo 22:03, 29 January 2007 (UTC)[reply]

hp wireless mouse info needed.

[edit]

I have a hp wireless mouse with no usp adapter. Modle No:MUR0208 Assy P/N: 343364-001 Spares P/N: 343808-001. What do I need to get it working, or do I just get another one. Thanks, <email removed> —The preceding unsigned comment was added by 63.20.28.21 (talkcontribs).

If you don't have the USB adapter, you might as well get another one. Wireless mice aren't that expensive nowadays. --Wirbelwindヴィルヴェルヴィント (talk) 07:27, 29 January 2007 (UTC)[reply]

Windows XP automatically restarts

[edit]

I have got a laptop that runs Windows XP. Every time I run "cmd", it automatically reboots itself without any warning. I unchecked "automatically restart" option of "startup and recovery - system failure" dialog box but it didn't help. I would be obliged if anybody could help me sort out this problem.--203.78.175.219 09:15, 29 January 2007 (UTC)[reply]

You might want to check HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun and HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun to see if there's anything there to cause the behavior. –RHolton12:39, 29 January 2007 (UTC)[reply]
Check your computer for viruses or spyware. They could do that to stop you from removing them. --wj32 talk | contribs 23:48, 29 January 2007 (UTC)[reply]
Search the drive for CMD.EXE, typically it should be in the windows\system32 folder. If there are more than 1 copy do the sizes/time stamps match? I agree with Wj32, sounds like a viral issue but don't jump the gun, could be a memory issue too Anfearard 15:41, 3 February 2007 (UTC)[reply]

about web site finance

[edit]

what is/are the financial source(s) for maitaining a web site?

What do you mean financial source? The source I recon would be your money. If you want to know what you need to finance a website, you need to either buy a server PC and pay the connection for it, or rent webspace at a provider. Either way you also have to pay for the domain you want to have.

PLEASE SIGN YOUR COMMENTS

Did you know that you can sign your comments to Talk pages by clicking the signature button () or by typing four tildes, like so: ~~~~? That way we know who made comments on the Talk page, and when. Thanks!

Also see WP:SIG for more information.

Aetherfukz 16:40, 29 January 2007 (UTC)[reply]

Submitting a form with javascript

[edit]

I don't know how they do it but the firefox password wallet feature doesn't work on my school's proxy login page. So I'm making a bookmarklet to log me in. So far it fills in my username and password but I can't get it to sumbit. Using

document.authenticator.submit()

since the form's name is "authenticator" doesn't work. The form submits fine (to the directory /auth-cups/) but the connection with the server weirds out and firefox tells me "The connection was reset. The connection to the server was reset while the page was loading."

There's no funky javascript going on on the login page. The only unusual thing is that the login page itself is being served through SSL (securely). Does anyone know what the problem is? Or why the password wallet doesn't work on the novell proxy login? --frothT 17:36, 29 January 2007 (UTC)[reply]

Have you tried filling in the details, then clicking submit by hand - does this work? The only thing I can think of is that the page tries to navigate to, or is still "running" the javascript link. Try putting the submit bit in a settimeout, ie
  • document.setTimeout("document.getElementById('authenticator').submit()", 500);
which should let the link finish running, then in 0.5 sec click the submit button. Also check if the submit button is <input type="submit" ...> or if it is <button value="..." ...> - if it is the second one, it sends extra information saying which button has been pressed. No idea why the wallet doesn't work though. --h2g2bob 13:00, 30 January 2007 (UTC)[reply]
Yes, filling in the details with the bookmarklet and clicking submit by hand works. Also, I've been using settimeout from the beginning to no avail :( But you're spot-on with the submit value.. its name is loginButton and its value is Login. Do you think this could be the problem? How would I simulate loginButton=Login through POST with javascript? --frothT 15:40, 30 January 2007 (UTC)[reply]

While you could script a XMLHttpRequest, you'd get all sorts of complications, as the "login complete" page will only exist inside the request, and would not be displayed in the browser. I'd just say go right around the problem if possible, by making yourself a html file with a copy of the form, with a few alterations. Ie:

<HTML><BODY>
* use the full url in the form. copy the   enctype and anything else too
<FORM method="POST" action="http://full-url-here/login.php" id="my_form">
* copy stuff from form but add values:
   <INPUT type="text" name="whatever" value="something">
   <INPUT type="text" name="whatever" value="something">
* add this to "spoof" the button:
   <INPUT type="text" name="loginButton" value="Login">
</FORM>
<SCRIPT type="text/javascript">
   window.onload = function {
      document.getElementById("my_form").submit();
   } ;
</SCRIPT>
</BODY></HTML>

Of course, that won't work if you've got some crazy cookie stuff going on, but otherwise it should be fine. --h2g2bob 23:37, 30 January 2007 (UTC)[reply]

Something really crazy -was- going on. I still can't figure out how clicking the submit button and invoking submit() should appear any different to the server. I was playing with some real wacky DOM code:
void(document.getElementsByTagName('td')[11].innerHTML='<input type="hidden" value="Login" name="loginButton">');document.authenticator.submit();
since Login=loginButton is in fact submitted to the server and that was the only thing I could think of. But after a simple google search I come up with the ridiculously simple solution:
document.getElementsByTagName('input')[4].click();
Haha! Thanks anyway for your help --frothT 05:48, 31 January 2007 (UTC)[reply]

when will Win XP become obsolete?

[edit]

At what point in time (year, etc.) do you think Win XP will become obsolete, unsupported by Microsoft or unusable because of everybody using newer OS like Vista?--Sonjaaa 20:17, 29 January 2007 (UTC)[reply]

Microsoft support cycles have typically been only a few years long. But a lot of people are probably going to stick with XP until microsoft gets its act together with a couple of service packs. And most businesses probably won't upgrade at all- it's not cost-effective for the few new features. Also there's been a lot of kicking and screaming from the tech community over vista being slow, flashy, and DRM heavy, but eventually an upgrade is inevitable. But microsoft's really competing with itself here.. they poured millions into patching XP to the hilt for 5 years straight and ended up with a solid OS; people are hesitant to switch. Like I said, though, even if Vista turns out to be a flop like ME, in 5-7 years the vast majority of windows users will have upgraded to vista or beyond --frothT 20:33, 29 January 2007 (UTC)[reply]
BBC said today that Microsoft says it will continue support for XP until 2011, my guess is they will do it longer, like they did with 98 (due to a lot of people (like myself) still using it, they supported it until last year). Cheers. --Ouro 21:09, 29 January 2007 (UTC)[reply]
I know that for myself, if XP becomes unsupported (not likely to be too soon, since they're releasing SP3 for XP in 2008), I'll probably move to FreeBSD or something. I dislike Vista myself just because it's multimedia-heavy. I can't stand WMP10 and 11 for example, and if Vista is similar in terms of Microsoft's aim, then I can't ever see myself using Vista. --Wirbelwindヴィルヴェルヴィント (talk) 22:52, 29 January 2007 (UTC)[reply]
Have to agree with you, Wirbelwind, on this one. I dislike even XP, although have used it, but never had the time to learn to tweak it enough. Vista is not the way to go. I am waiting for my data gloves to get delivered. --Ouro 07:40, 30 January 2007 (UTC)[reply]

synchronize mp3 player?

[edit]

What's the easiest way to syncronize mp3 and ogg vorbis files to my Samsung mp3 player? Some sort of software I need?--Sonjaaa 20:28, 29 January 2007 (UTC)[reply]

If your mp3 player doesn't have software that does it, software like Windows Media Player 9 and above have it, and I believe Winamp has it (Portable Device Sync - Supports iPod®, PlaysForSure®, and Creative® Devices is all Winamp lists, unfortunately). Specifically, which mp3 player do you have? Might want to check the Samsung site. --Wirbelwindヴィルヴェルヴィント (talk) 22:57, 29 January 2007 (UTC)[reply]