Wikipedia:Reference desk/Archives/Computing/2007 November 30
From Wikipedia, the free encyclopedia
Computing desk | ||
---|---|---|
< November 29 | << Oct | November | Dec >> | December 1 > |
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. |
Contents |
[edit] November 30
[edit] Where is the Icon stored in an exe file
I'm wondering, where in a .exe file is the "icon" that will be visualised by windows is stored ? And also which tools can be used to put an icon on an exe file (I never touched any compiler so far, is it an option in Visual C++ ?). - Esurnir (talk) 04:26, 30 November 2007 (UTC)
- The icons, bitmaps etc. are called resources. There are lots of freeware resource editors out there.
I use ResHacker [[1]]
http://www.angusj.com/resourcehacker/ 59.93.35.12 13:27, 30 November 2007 (UTC)
[edit] Quoting the result of a preprocessor directive in C
I'm relatively new to C, and I'm just starting to get into some of the really odd areas of the language. As part of an experiment with C and gcc, I need to use asm("...")
to modify the internal name of a function. My code looks something like this:
/* ASM_USES_UNDERSCORES is defined elsewhere. */ #if ASM_USES_UNDERSCORES #define EXT_C(sym) _ ## sym #else #define EXT_C(sym) sym #endif /* Example usage: asm_prototype(void, f, (int a)); */ #define _asm_prototype(type, name, params, extcName) type name params asm(#extcName) #define asm_prototype(type, name, params) _asm_prototype(type, name, params, EXT_C(name))
Unfortunately, this doesn't work: the preprocessor quotes the EXT_C
literally, giving me prototypes that look like this:
void f(int a) asm("EXT_C(f)");
... which is obviously not what I intended! Since I can't use ## with double quotes, how should I convince the preprocessor to quote this properly? (Sorry if it's a dumb question, most of my C experience has come from fiddling.) --Aaron Rotenberg (talk) 05:47, 30 November 2007 (UTC)
- Your goal can be achieved by using an extra layer of macro-ization, like this:
#define Str(x) #x #define _asm_prototype(type, name, params, extcName) type name params asm(Str(extcName))
- The more work you do with the preprocessor, the uglier it gets. --tcsetattr (talk / contribs) 11:05, 30 November 2007 (UTC)
- Ah, I was thinking that might work. Thank you! --Aaron Rotenberg 21:00, 30 November 2007 (UTC)
[edit] A problem with my MP4/WMA/REC/AMV player..
I have a ploblem with my mp4 player... actually it has a capacity of 4GB.. but after i format (FAT) more than 3 times that device, now it shows capacity of 0.99 MB.. when it was formated first(FAT- 64 cluster) i could get only 12 songs..but it shows more than that...when accessing the 13 th song it shows a message "Format Error". can anyone suggest a software for formatting that device and to get actual capacity.?
..version... XID_91N51_V5 2007-09-17 9.0.50 2005-01-09 —Preceding unsigned comment added by 202.177.162.187 (talk) 12:48, 30 November 2007 (UTC)
I would suggest you to consult your owner's manual for the device, find out what format to use, and reformat the device. Formatting the device a certain number of times typically should not render it useless. Could we have more detals on what type of storage (flash?) your device uses? Thanks. --Kushalt 04:49, 3 December 2007 (UTC)
[edit] Disabling Keystroke Loggers
Hello. Is pressing Shift+Ctrl+Alt+W on Windows 2000 or XP to disable keystroke loggers a hoax? Thanks in advance. --Mayfare 17:31, 30 November 2007 (UTC)
- If a keystroke logger is installed as an administrator-level (or kernel-level) entity then nothing will disable it short of removing it entirely. If it's a hardware logger then only removing it will do. So if you've any reason whatever to believe a machine might be compromised in this matter, then it's obviously unwise to type anything confidential into it. -- Finlay McWalter | Talk 17:36, 30 November 2007 (UTC)
- Not sure where you heard about that (Google pops up nothing), but there is nothing de facto about that said of keystrokes (or any set of keystrokes) that should disable keystroke loggers. (Yes, I know that some keystrokes are reserved by some Windows OS's for the Winlogon process, but even that wouldn't "disable keystroke loggers", it'll just make it so that specifically logging in or out of windows is out of reach of any software, i.g. only a small subset of activities)--24.147.86.187 23:25, 30 November 2007 (UTC)
[edit] Power supply question
I'm trying to get a new power supply for my machine and wanted to ask some advice here on the subject. The machine is an A64 machine with 2 hard drives and a floppy, so it needs the ATX style connector, one of those 4 pin connectors, and the relevant number of "Molex" connectors. Beyond that I don't really know what factors to discriminate with. 68.39.174.238 19:37, 30 November 2007 (UTC)
- Take a look at ATX#Power supply. I guess (never having seen an Athlon 64 motherboard) that it'll be the 24 pin WTX (or ATX-24) connector. If not then it'll be a regular ATX (ATX-20) connector. -- Finlay McWalter | Talk 01:54, 1 December 2007 (UTC)
-
- I mean, advice like company (if any), wattage, etc. 68.39.174.238 03:48, 3 December 2007 (UTC)
-
-
- This is going to be nearly useless advice, I fear, but all I can say is "Go big!". A weak power supply is difficult to debug, and it is suprising what can push you over the line. I was fine with my A64X2 and a big video card, but as soon as I put an extra GB of memory in, the machine wouldn't start! I upgraded to an Antec TruePower Trio 650 Power Supply, which has been more than sufficent for me. The Antec name seems to be pretty well trusted, and the power supply was nice and quiet, too. --Mdwyer 22:15, 3 December 2007 (UTC)
-
[edit] Wikipedia Programming Info
I was wondering a couple things about the programming of Wikipedia.
I guess initially, from my research I'm pretty sure that Wikipedia is programmed in PHP. As I'm learning about PHP and MySQL programming (and Apache thrown in (which is surprisingly amazingly difficult to learn)), Wikipedia is an amazing site to learn from.
I was wondering, for the "Show changes" button on the "editing page" for Wikipedia articles, what do they do, or how could it be implemented in PHP to compare changes in this fashion? Even if it's not in PHP, how could it be accomplished in PHP?
Obviously, with a "submit" button and a form, or three submit buttons and a form, I'm assuming that each button is given its own value in "POST", and that value is initially used to trigger the compare function. Though on a side note here, I'm not sure how GET values are passed in a POST form submission, unless they're written directly into the form "action" attribute?. Then it's to the page comparisons. I'm assuming that the current data is retrieved from "a database" (even if it's not, for my method I'll have to assume it's a MySQL database for example), then this is where I'm really wondering what happens. Perhaps use of the strstr() function, checking for literal errors, which would even check for case-changes. Or a slower and more complex Regular Expression, which I'm not sure would be applicable to this function. However even with strstr(), I'm not quite sure how this would be implemented, looking for changes (to be highlighted in red), then continuing past them and counting the additional (somehow deemed "already existing") parts after the "changes" - "un-changed". This is where I'm really wondering how it's done, perhaps in some sort of loop or something?
Thanks so much for your help!-TAz69x 23:32, 30 November 2007 (UTC)
- The Mediawiki software stores the current wikitext of each article (in a MySQL table called "cur"). For older entries it stores the "backwards deltas" that you need to go back one version. These are computed using a diff algorithm (I don't know if the software does the diff in PHP, a C library, or if it outsources the job to one of several Unix diff programs). The diff algorithm is also used if you're comparing two non-adjacent versions (in which case the software has to perform the diff when you make the request). -- Finlay McWalter | Talk 23:37, 30 November 2007 (UTC)
- Just a note, yes, you're right that you can write GET values into a POST submission by modifying the action attribute. That's usually how it is done if you are using both of them.--24.147.86.187 00:58, 1 December 2007 (UTC)
- From what I can tell (I just downloaded MediaWiki to see), all of MediaWiki's different calculation is done within PHP (the code is in the file DifferenceEngine.php). As code goes it is not too hard to follow though you'd have to know a lot about how MediaWiki handled content before being able to actually use it for anything, and it seems to use some pretty computer-sciency code to calculate it. What it seems to do, and maybe I'm wrong about this, is to first find everything that is the SAME between the two files and then work backwards from there. The code comments mentioned this link as a helpful one; it's pretty readable and gives a good idea of how these sorts of problems are optimally solved programmatically: http://www.ics.uci.edu/~eppstein/161/960229.html. --24.147.86.187 22:12, 1 December 2007 (UTC)
-
- Thanks so much for your help so far guys!, this is amazingly helpful! That link is kind of along the lines of the way I thought it would work as I sketched out a "diff-like" function in my head. And I just downloaded mediaWiki (it just occurred to me that you can, as I read your post! I'm looking through the files now, and it's so awesome (and amazing) to figure out that Wikipedia is programmed in PHP, especially as I've been programming in PHP and MySQL for the past year after I had the great difficulty in choosing a programming language that I could use to program a real website, perhaps with high traffic. Choosing "the right" programming language was so very hard to do [especially with no know-how]! (eg. ASP, C#, Visual Basic, PHP, Perl, Java, etc. etc.!) So it's great that all of my work and effort and everything has all been for something! (I always knew that Yahoo! is written in PHP, but soooo many other websites seem to be written in ASP that I had wondered if I had chosen correctly) Anyways, so far so good! Any more help, comments, suggestions, side-thoughts, etc. etc. are all greatly appreciated! It's so interesting to learn how everything works here.--TAz69x 23:36, 1 December 2007 (UTC)
-
- PS- How do the controls (is it called a WYSIWIG.. something or other?) on the editing form work? Are they Javascript? Anyways, thanks so much for your help again!