Wikipedia:Reference desk/Archives/Computing/2007 June 8
Computing desk | ||
---|---|---|
< June 7 | << May | June | Jul >> | June 9 > |
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. |
June 8
[edit]Removing chunks of Xvid video with freeware.
[edit]I've got a batch of Xvid videos with V2 MP3 audio that I need to cut chunks out of. I'd usually use Virtualdub, but according to the error message that greets me when I try to open the videos, Virtualdub doesn't like VBR audio. Is there any similar freeware app that will cut up video without re-compressing it? (Virtualdub will push the audio out of sync.) Down M. 00:09, 8 June 2007 (UTC)
- Nandub is a fork of VirtualDub that correctly handles VBR audio. Rabidfurby 00:44, 8 June 2007 (UTC)
Vista fonts
[edit]I can't seem to download any fonts for windows vista. I get the zipped, try to extract it to the font folder, then there is an error. Any help? Thanks in advance
- What does the error say? Specific details would greatly help us answer your question. Splintercellguy 02:53, 8 June 2007 (UTC)
- It's not even displaying an error anymore. I extract it without problem, but it doesn't show up in the font folder.
- Umm, is that the correct procedure for installing a font? I haven't done this in ages but are you supposed to perhaps unzip the font file then either double click or right click it and select "merge" or "install" or something? it rings a bell that you can't just copy and paste into the fonts folder because then windows doesn't register the font, which sounds like that's the problem... Vespine 05:12, 8 June 2007 (UTC)
- I don't think it will work if you just extracted it there. You have to extract it somewhere else and then copy it to the Fonts folder which will trigger automatic installation dialogue. --antilivedT | C | G 05:47, 8 June 2007 (UTC)
- Yah, it just seems like sloppy interaction between the "Compressed/Zipped Folder" program and Explorer- maybe the zip code going behind Explorer's back and writing directly to a lower-level routine? --frotht 17:13, 8 June 2007 (UTC)
- I thought it was always..decompress anywhere...then go into the control panel...and then open Fonts and then choose File>Install New Font....yeah..that's how ive always done it... xD 200.35.168.129 23:17, 8 June 2007 (UTC) Ag for MemTech
- Well, it works like that pre-Vista fine. But I guess Vista has another crappy thing going for it. --Wirbelwindヴィルヴェルヴィント (talk) 04:07, 9 June 2007 (UTC)
LDAP arbitrary objectClass
[edit]Is there a "generic" objectClass schema in LDAP that does not specify any required or optional attributes (so they can be freely added without requirements?). I guess there's problems with attribute typing, but say I don't need it.
C++ "eval" for arithmetics
[edit]I'm looking for a nice way to parse strings as arithmetic expressions in C++. Nothing fancy, but I need it so I can have custom functions and variables, such as: "test(t,f) + (t/2)^2 - sin(3t/4) / pi".
I'm sure something like that has been developed already, but I have no idea where and what to look for. Could anyone point me to the right direction? Thanks! — Kieff | Talk 06:12, 8 June 2007 (UTC)
- Well, you'll probably want a recursive function to find your operands and user functions. It needs to be able to evaluate your order of operations too. Good luck! -wizzard2k (C•T•D) 06:29, 8 June 2007 (UTC)
- Several potential solutions comes to mind: system ("perl -e expr"), or use a symbolic debugger, or an interpreted implementation of C++. So you might want to say what you're trying to achieve. C++ is compiled in most instances, so an expression interpreter isn't readily available like it is with interpretive languages. —EncMstr 06:31, 8 June 2007 (UTC)
- I know an interpreter isn't available built-in, but I'm hoping there'll be some sort of code, like a class, made for this sort of arithmetic parsing of strings and that has been released to the public. — Kieff | Talk 07:56, 8 June 2007 (UTC)
- You might try a google search for symbolic algebra c++. I found SymbolicC++, but I have never worked with it. You should realize already that your task is pretty complicated. Be careful assuming a "magic" fix by dropping in a third-party library! Good luck, Nimur 09:25, 8 June 2007 (UTC)
- If you're allowing custom functions, you're really talking about implementing a full-fledged programming language. Why not use one that has been designed, implemented, debugged, optimized, and documented already? Perl, Python, and Scheme, etc. are all easy to embed in C++. --TotoBaggins 15:27, 8 June 2007 (UTC)
- Or you could write your functions as C, compile and dynamically load the resulting .dll or .so file into the live executable, and then run the function for whatever necessary purpose. INCREDIBLY insecure, but loads of fun! Root4(one) 16:17, 8 June 2007 (UTC)
- As far as answering the original poster, you could always develop a grammar using lex and yacc. Root4(one) 16:41, 8 June 2007 (UTC)
- See also Greenspun's Tenth Rule. --cesarb 22:54, 9 June 2007 (UTC)
Thanks, people. I've decided to go for embedding Perl or Python in the code (haven't picked yet). I guess it'll work well. — Kieff | Talk 00:24, 11 June 2007 (UTC)
Laptop battery
[edit]My G4 Mac is more or less always connected to the mains power. It has been suggested that I should therefore remove the battery, but no explanation was given. Why should I remove the battery please? There are the odd occasions when I would want to use the laptop away from mains power, which would be difficult if the battery has discharged itself. Any advice would be appreciated please. Thanks--88.110.32.237 08:40, 8 June 2007 (UTC)
- I think this is probably why they suggested it [1] - X201 08:43, 8 June 2007 (UTC)
- This is often suggested as it is supposed to prolong battery life. I assume the G4 has a lithium-ion battery. While these are better than older style batteries as far as surviving continual charging, they still age, and age more quickly at higher temperatures. It can get pretty warm inside a computer, so if you're not using it they recommend you remove it to make it last longer (and preferably keep it somewhere cool, like in the fridge). To me I think it depends how long you expect to keep the computer. I personally prefer to leave the battery in my laptop so as if there's a power outage I don't lose my work and can keep using the computer. After about three years of pretty much continual use the battery may only be good for half-an-hour to an hour off mains, but I'm not keeping the thing much past that anyway. --jjron 09:37, 8 June 2007 (UTC)
- Putting the battery in a cool place (as suggested above), would be the best way to preserve battery life. Only problem with using a fridge is if there is a power outage, you would lose power, and if you're away and the power goes out and the battery is in the fridge, it could get wet. Batteries don't cost more then 60 or 70 USD if I remember correctly, so after 3 years or so, you could replace it for not to much. By then you might buy a new laptop anyway.--GTPoompt(talk) 14:07, 8 June 2007 (UTC)
- Even if you buy a replacement, if it's made 3 years ago, it's not going to give you good ratings either. The safest bet is to buy a spare battery early on and store it in the fridge at 40% charge, but that's a big hassle, and an extra battery that you won't need in 3 years cause your laptop fell on the ground. --Wirbelwindヴィルヴェルヴィント (talk) 04:04, 9 June 2007 (UTC)
- Putting the battery in a cool place (as suggested above), would be the best way to preserve battery life. Only problem with using a fridge is if there is a power outage, you would lose power, and if you're away and the power goes out and the battery is in the fridge, it could get wet. Batteries don't cost more then 60 or 70 USD if I remember correctly, so after 3 years or so, you could replace it for not to much. By then you might buy a new laptop anyway.--GTPoompt(talk) 14:07, 8 June 2007 (UTC)
- This is often suggested as it is supposed to prolong battery life. I assume the G4 has a lithium-ion battery. While these are better than older style batteries as far as surviving continual charging, they still age, and age more quickly at higher temperatures. It can get pretty warm inside a computer, so if you're not using it they recommend you remove it to make it last longer (and preferably keep it somewhere cool, like in the fridge). To me I think it depends how long you expect to keep the computer. I personally prefer to leave the battery in my laptop so as if there's a power outage I don't lose my work and can keep using the computer. After about three years of pretty much continual use the battery may only be good for half-an-hour to an hour off mains, but I'm not keeping the thing much past that anyway. --jjron 09:37, 8 June 2007 (UTC)
Webdesign - not sure what I want (PHP or what?)
[edit]I know advanced HTML, and I have my own server to play with (php 4 installed), and I have Dreamweaver MX, but I'm not sure what technology(s) I actually need:
I want to create a "TEMPLATE" - and this will be used throughout the website, so for example if I want to change the theme and graphics of my site, I only have to change it in the template and not have to edit every single page on the site.
Then for the content - that is the unique stuff that goes on each page - that I want to provide separately and say "Hey, use this template".
What should I be learning? PHP, CSS? anything else?
Rfwoolf 09:52, 8 June 2007 (UTC)
- CSS.
- I looked at CSS and it looks like it can't even do tables ... So that's not what I want. I want to do something like this:
- I looked at CSS and it looks like it can't even do tables ... So that's not what I want. I want to do something like this:
TEMPLATE:
<table width=700px>
<image src"mylogo.jpg"> <font color="red">
[CONTENT GETS AUTOMATICALLY INSERTED HERE]
</font>
</table>
CONTENT:
Hi guys. this is the home page.
(or)
Hi guys, this is the contact page.
- Rfwoolf 10:14, 8 June 2007 (UTC)
- Basic PHP! I would do it by creating header.php and footer.php, with header.php having everything BEFORE the content in, and footer.php having everything AFTER the content. You need not put any actual PHP in these files - they are just called ".php", and that's not even necessary.
- Then, in, say, about.php (your about page), you have: <?PHP require('./header.php'); ?><h1>About Us</h1><p>We are a cool website from Vietnam and have a really large selection of stuffed monkeys</p><?PHP require('./footer.php'); ?>
- Then it'll include and print the header, then print all the about us content, then the contents of the footer. Hope that helps. I don't want to explain too much and clog up the reference desk, so leave a message on my talk page for more help. JoshHolloway 10:18, 8 June 2007 (UTC)
- Thanks! That seems to clear that up. To my dismay the info on the net was very scratchy - people talking about CSS, RSS, XHTML, -- all with reference to PHP. And then they talk about MySQL (why would I need a database?) - so thanks, I'll give it a shot. Rfwoolf 10:27, 8 June 2007 (UTC)
Make your php like this:
<?php include "_top.php" ?> <H1>Title</H1> <P>Whatever here</P> <?php include "_bottom.php" ?>
and get _top.php and _bottom.php to automatcally print the rest. Make the HTML fragment as general as possible, ie put all CSS style rules in a stylesheet. --h2g2bob (talk) 10:23, 8 June 2007 (UTC)
- Great. Seems simple enough. How could I possibly go wrong? ;)
- What I'll do is create the page in straight-up HTML, then disect it into a header and footer and make those PHP files, then do what you said.
- Thanks all. Rfwoolf 10:27, 8 June 2007 (UTC)
- I still think you should look at CSS. You're using tables for style and structure, you can do the same with CSS, and you won't even need to make it part of a template. JSBillings 11:58, 8 June 2007 (UTC)
- There are other PHP options, depending on how much of a geek you are. I use a series of functions: html() writes the html and meta tags, then calls head() and body(). head() writes the head tags, title, adds in my css and scripts as necessary. body() writes the body tags and the main page. When it comes to the content section, it calls content(). Each page I create, I create one function, content() and then call html().
- I've also seen uber-geeks make an html class and extend it for each page. In my opinion, it is a lot of overhead with very little benefit. --Kainaw (talk) 12:08, 8 June 2007 (UTC)
- Sounds like CSS to me, since CSS is just formatting. It can't do tables because you have to use HTML/XHTML with it. Format the table how you want it to look in CSS, link the CSS file in your HTML file, and whenever you call table or p, it'll grab the formatting from the CSS file. I actually have never used PHP, so I don't know whether that is a superior option or not.--GTPoompt 12:27, 8 June 2007 (UTC)
No I don't think CSS is what I'm really looking for here - I think I need to go with PHP. For example I want to use tables, and images to give the site a "skin" almost. Also, my "Header" will in effect start a table and not close it off -> Then goes content -> then goes my footer which closes off the table and carries on. Is that even possible in CSS? I don't think so Rfwoolf 12:51, 8 June 2007 (UTC)
- It isn't possible in CSS (yet). CSS is a layout tool. You are adding content to each page, not just layout. The semantics are confusing because we are using "content" to refer to the stuff that is different on each page. However, it also means "anything other than layout stuff" - which encompasses your header and footer. --Kainaw (talk) 13:02, 8 June 2007 (UTC)
- You can do both CSS and PHP, and make your life easier for both. Just have your PHP header code put the content in the header in a <div id="header"> ... </div> and the same for the footer and even content. Then, in your CSS, write style definitions for the #header type. That way you can define the style in the CSS, while having PHP do the heavy lifting for generating dynamic footer/headers. --JSBillings 13:36, 8 June 2007 (UTC)
- I think you probably need to read up a little more on what HTML, CSS, and PHP all do. They are not incompatible — they just accomplish different things. You can definitely use tables with CSS (you can use any HTML structure in CSS). --24.147.86.187 13:44, 8 June 2007 (UTC)
- Nod with 187. Learning some elementary CSS will make your life SO much easier... as far as complete CSS layout, and dealing with IE bugs, well, that's not so easy. Root4(one) 16:14, 8 June 2007 (UTC)
- For the record, Wikipedia's skins are all CSS. Main Page and this skin are the same HTML, only CSS changes. --h2g2bob (talk) 16:44, 8 June 2007 (UTC)
- That said, all the menus are written as <UL><LI> ... </LI></UL> etc using PHP, soyou have to do both. --h2g2bob (talk) 16:47, 8 June 2007 (UTC)
- Yes, user:h2g2bob, only the CSS changes, but the PHP tells it when to print. You certainly need both. CSS is for structure, and PHP for wrapping the structure around the content. JoshHolloway 18:55, 8 June 2007 (UTC)
- HTML gives stucture and meaning, whilst CSS gives style; PHP gives... fancy stuff. →Ollie (talk • contribs) 20:12, 9 June 2007 (UTC)
- Yes, user:h2g2bob, only the CSS changes, but the PHP tells it when to print. You certainly need both. CSS is for structure, and PHP for wrapping the structure around the content. JoshHolloway 18:55, 8 June 2007 (UTC)
- That said, all the menus are written as <UL><LI> ... </LI></UL> etc using PHP, soyou have to do both. --h2g2bob (talk) 16:47, 8 June 2007 (UTC)
- For the record, Wikipedia's skins are all CSS. Main Page and this skin are the same HTML, only CSS changes. --h2g2bob (talk) 16:44, 8 June 2007 (UTC)
Macros in Excel
[edit](After edit conflict) Whenever I try doing the following: Workbooks("PKLIZH.xls").Sheets("1").Cells(Row, 7).Select
I get an error message saying Select method of Range class failed. There's only one sheet in the workbook and it's called "1". When I replace Sheets("1") by Sheets(1) the same thing happens. When I click on help, nothing useful comes up. What am I doing wrong? Its part of a For.. Loop in Row.
Zain Ebrahim 13:56, 8 June 2007 (UTC)
- Are you starting Row at least at 1? The following block of code works for me:
Sub tester() Dim Row As Long For Row = 1 To 8 Workbooks("Book1.xls").Sheets("1").Cells(Row, 7).Select Next Row End Sub
-wizzard2k (C•T•D) 14:27, 8 June 2007 (UTC)
Bizarre UserAgent string
[edit]My Site Meter shows a hit to my blog with the user agent "MERONG 0.9". The visit came from the IP address of my friend. Does anyone know what that means? I am afraid it could be some sort of spyware on my friend's computer. Thanks, Mike R 19:36, 8 June 2007 (UTC)
- I think it's adware known as Overpro. iames 21:52, 8 June 2007 (UTC)
Alt codes
[edit]Does anyone know either the alt code for the Lambda symbol(either capital or lowercase),or a place where i can find a plain text table of said codes? Pikajedi3 19:36, 8 June 2007 (UTC)
- I believe that whether that character is available at all depends on the font family you are using. A quick check of Windows charmap utility in both Arial and Courier New show that upper case lambda does not have an alt keycode, but is available as Unicode 039B. If you want to use the character on a webpage, you can use an HTML Entity, Λ shows up as Λ List of XML and HTML character entity references. --LarryMac | Talk 19:54, 8 June 2007 (UTC)
- If you want capital, use Λ (Λ). For lower case, use λ (λ). --Kainaw (talk) 19:57, 8 June 2007 (UTC)
thank you.don't suppose you could tell me how to USE Unicode? ‡ is what results when i transfer that code (039B) into Hex (03911) then pressing alt->numpad +->03911.. anyway,so i am evidently approaching from the wrong direction.. Pikajedi3 20:14, 8 June 2007 (UTC)
- It would help if you'd tell us how/where you're trying to use this. In the meantime, have a look at Unicode#Input_methods, that might help you out. --LarryMac | Talk 20:17, 8 June 2007 (UTC)
- Oh, and when converting a hex number to decimal, you can't just change the B to 11. x039B = 923, but that's still not going to be an alt keycode. --LarryMac | Talk 20:20, 8 June 2007 (UTC)
- But it's probably something you can put after &# --frotht 11:53, 9 June 2007 (UTC)
- Oh, and when converting a hex number to decimal, you can't just change the B to 11. x039B = 923, but that's still not going to be an alt keycode. --LarryMac | Talk 20:20, 8 June 2007 (UTC)
very well,i want to know it so i can ,instead of having to go into character map etc etc. i primarily want to be able to type into things which will not allow copy/pasting,such as some java apps,and also to save time in typing. reading that article was one of the first things i did,by the way. Pikajedi3 20:22, 8 June 2007 (UTC)
- OK, for some applications, you can use the Alt-x method, as described in Alt codes. I just tried it in Wordpad on Windows 2000, and pressing Alt-x, and then 0923 did give me the upper case lambda. However, I can't use that method in this editing box, because Alt-x is not supported in IE6. From what I can tell, this is all extremely application dependent, at least in the Microsoft/Windows world. --LarryMac | Talk 20:33, 8 June 2007 (UTC)
› is what i get from both alt-x and alt-numpad+ in Firefox,using 0923,and a slightly curved on in Excel,Word97 and notepad. ah well,thanks for the help =Þ
- Yeah, that's why I emphasized "some" applications. I think we're about a (software) generation or two away from Unicode support in most applications. Not sure if we'll ever get to all. --LarryMac | Talk 23:52, 8 June 2007 (UTC)
In this edit box? You can use Λ Λ λ λ --Kjoonlee 19:56, 10 June 2007 (UTC)
javascript:p=(document.all)?document.selection.createRange().text:((window.getSelection)?%20
window:document).getSelection().toString();if(!p)void(p=prompt('Text...',''));%20
while(p){q='';for(i=0;i<p.length;i++){j=p.charCodeAt(i);q+=(j==38)?'&':%20
(j<128)?p.charAt(i):'&#'+j+';';}void(p=prompt(p,q));}
Join this all into one line (without spaces or linebreaks) and put it into a bookmark. Click on it and enter any character to see its decimal character reference. --Kjoonlee 20:02, 10 June 2007 (UTC)
javascript:var%20hD=%220123456789ABCDEF%22;function%20d2h(d){var%20h=hD.substr(d&15,1);while(d>15){d>>=4;
h=hD.substr(d&15,1)+h;}return%20h;}p=(document.all)?document.selection.createRange().text:
((window.getSelection)?window:document).getSelection().toString();if(!p)void(p=prompt('Text...',''));
while(p){q='';for(i=0;i<p.length;i++){j=p.charCodeAt(i);q+=(j==38)?'&':(j<128)?p.charAt(i):
'&#x'+d2h(j)+';';}void(p=prompt(p,q));}
- And here's a hexadecimal version. With Firefox, you can select text in the browser area (not in forms or edit areas, but in rendered output) and click on a bookmark for instant conversion. --Kjoonlee 20:05, 10 June 2007 (UTC)
Data retrieval on SD card
[edit]Hi all, hope you can help. Is there any (free) way I can retrieve images accidentally deleted from the SD card in a digital camera? I'm dual-booting windonws xp and linux, so a solution on either of these OSes would be fine. Thanks. 80.169.64.22 21:50, 8 June 2007 (UTC)
- Any disk recovery software should be able to work, as long as you haven't taken any new pictures yet that might have overwritten it. I've used BadCopy Pro before, but it wasn't free. -wizzard2k (C•T•D) 21:53, 8 June 2007 (UTC)
- SD cards generally use FAT32, so good old MS-DOS UNDELETE should work. I'd be interested in linux versions though, suggestions welcome. --h2g2bob (talk) 23:40, 8 June 2007 (UTC)
- TestDisk might do the trick. --LarryMac | Talk 23:55, 8 June 2007 (UTC)
- PhotoRec is probably better (according to our article, it "is shipped with TestDisk"). --cesarb 22:49, 9 June 2007 (UTC)
- TestDisk might do the trick. --LarryMac | Talk 23:55, 8 June 2007 (UTC)
- SD cards generally use FAT32, so good old MS-DOS UNDELETE should work. I'd be interested in linux versions though, suggestions welcome. --h2g2bob (talk) 23:40, 8 June 2007 (UTC)
SpeedStream 5360 Ethernet ADSL Modem
[edit]Hello. Whenever I turn on my modem, I must wait for the DSL light to turn on in order to connect to the Internet. Since a few weeks ago, the DSL light will flash and turn off repeatedly. All connections (power, directly plugging my phone wire to my phone jack without any telephone splitters in the way, Ethernet cable to the back of the computer, my phones have filters) are connected correctly and securely. I must turn off my modem for 10 minutes and turn it back on for the DSL light to work. Two days ago, I emailed my ISP (295.ca) technical support at support@295.ca and did not receive a reply. How can I solve this problem? Thanks. --Mayfare 23:54, 8 June 2007 (UTC)
- Try calling them next time. They might be able to diagnose the modem or the circuit remotely. --JSBillings 00:16, 9 June 2007 (UTC)
- Yeah call them, but don't let them fob you off with "it's a "router" not our responsibility" like the ISPs here do. In this case it sounds like their problem with their modem. SMC 10:30, 9 June 2007 (UTC)
It's fixed. Thanks. --Mayfare 22:45, 13 June 2007 (UTC)