Computing desk | ||
---|---|---|
< August 6 | << Jul | August | Sep >> | August 8 > |
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. |
some sites are password protected espcially the site of cambridge www.cie.org.uk, the teachers section . this web contains past papers for IGCSE which is important to students .......watever... how can i hack into this site just for good reasons please ......
How would a Greasemonkey script that just searches a document and replaces all instances of some phrase with another look like? --Oskar 06:18, 7 August 2007 (UTC)
var node = document.firstChild;
while (node) {
if (node.nodeType == 3) {
node.nodeValue = node.nodeValue.replace(/phrase/g, "something else");
}
// Walk the DOM tree:
if (node.firstChild) {
node = node.firstChild;
} else {
while (!node.nextSibling && node.parentNode)
node = node.parentNode;
node = node.nextSibling;
}
}
I want to create a simple game from the scratch, with a bit of animation, some game logic, some audio effects and some kind of scoring. The player should be able to select some characters froma pool of characters depending on some situations. Then these characters will complete some tasks (the computer should do this). For each task completed, there should be some score. If the player selects a wrong character to for a task, there should be some penalty points. Each of the tasks should have some animation, with some audio effects etc etc. Is there any free software that I can use for this? I have no experience in animation. -- WikiCheng | Talk 08:01, 7 August 2007 (UTC)
Thanks to both of you. I'll give gamemaker a try. Just a last question: Is it free? -- WikiCheng | Talk 13:59, 9 August 2007 (UTC)
How can I insert combo box/combo list box in a cell in MS Excel Sheet?
Hello. Does Internet Explorer 7's search bar use website prefixes? For example, if I search something on Wikipedia using the search bar, does it use Wikipedia's website prefix en.wikipedia.orghttps://demo.azizisearch.com/lite/wikipedia/page/...? Alternatively, when I search something on Google using the search bar not Google Toolbar, does the search bar use Google's website prefix www.google.ca/search?hl=en&q=…&meta=? Thanks in advance. --Mayfare 15:05, 7 August 2007 (UTC)
www.google.com/search?q=%query
and then replace %query
with your actual search string, appropriately escaped such that it would actually work — e.g. if you enter "café noir" as your search string then it will use "caf%C3%A9%20noir" to actually search.). Angus Lepper(T, C, D) 17:05, 7 August 2007 (UTC)Anyone know a good bookmark manager/social bookmarking site that would let me do fulltext searches of every pages I've bookmarked and by default set it up so that others can't see what sites i've bookmarked? Bookmark managers don't seem to have full text search. Social bookmarking don't seem to allow "Private bookmarks" by default. Furl and Delicious, for example, can let you check a box to specify a bookmark as private, but you have to do the tedious step of clicking "private" every single time to bookmark a site, I think. --Alecmconroy 15:40, 7 August 2007 (UTC)
How do you allow webpage viewers to download files such as .mp3's using php? (basically, what php code do I type to allow users to download content from my website to their computer?) 69.205.180.123 17:14, 7 August 2007 (UTC)
header("Content-type: application/x-download");
header("Content-Length: ".filesize($filepath));
header("Content-Disposition: attachment; filename=\"$filepath\"");
header("Content-Transfer-Encoding: binary");
readfile($filepath);
Is there a way to have Word Document A linked to documents B, C, and D, so that A is just the sum of BCD? And you can change the individual BC&D and that will change A? Thanks, XM 18:28, 7 August 2007 (UTC)
On a Mac (10.4.10, Tiger), is there a way to let apps that automatically run in fullscreen run in a window instead? I'm thinking of games here, so that I can play them while still seeing my Gmail notifier and Adium buddy lists. Thanks! McMillin24 contribstalk 20:24, 7 August 2007 (UTC)
Does a mobile phones internal battery (the one that is tiny and soldered to the circuit board)just control the 24hr clock/memory or the whole processor clock? It seems to be that when that battery dies many mobiles phones start malfunctioning. Or is that coincidence? or built in obsolescence?
Can someone please explain to me (or point me to an explanation):
1: Exec functions and their proper use (I've read my system's man page and it just made me more confused).
2: Pointers to functions: how they work, how to use and create them, etc. (Again, I've read the best resource I have available (K&R's The C Programming Language) without any enlightenment)
Thanks in advance! 69.123.113.89 21:45, 7 August 2007 (UTC)
Pointers to functions are just a variable (like any pointer). It's easiest to explain with code samples:
// pointer to function, initially set to NULL int (* pointer_to_function)( int arg1, int arg2 ) = NULL; // define some function as normal (note: same argument and return types as above) int addition ( int arg1, int arg2 ) { return arg1 + arg2; } // set pointer to a value pointer_to_function = addition; // call the function (returns 3) pointer_to_function(1, 2);
[edit] can be used for callbacks, eg: qsort. --h2g2bob (talk) 23:45, 7 August 2007 (UTC)
exec()
(and its variants — execvp()
, etc. — which differ in what extra information you pass and how you pass it) cause the process that executes them to be replaced with another process, started from an executable file on disk and initialized with your choice of arguments and/or environment variables. In Unix, there is no (standard, portable) way to create a new process except fork()
, which creates another copy of the process that calls it. As such, there has to be a way to make one of the two copies (usually the child) into a different program if any choice is to be had about what programs are executed.int x=/*...*/,y=/*...*/,*p; if(/*...*/) p=&x; else p=&y; /*...*/ *p=4; /* assigns to whichever of x and y was chosen earlier */ ++x; ++y; printf("%i\n",*p); /* uses whichever was chosen, so prints 5 */
double (*p)(double); if(/*...*/) p=sin; else p=cos; /*...*/ printf("%g\n",p(3.1415926536)); /* uses whichever was chosen, so prints 0 or -1 */
&
and *
are optional with function pointers, because you can do fewer things with functions and so there is no ambiguity. Of course, normal pointers are more common, partly because they are simpler, partly because they (unlike function pointers) can be used to build data structures (like linked lists), and partly because function pointers tend to impose significant performance penalties on modern hardware (if used frequently and where speed matters). Both kinds of pointer have the important ability to be stored and passed among functions so that the choice of target for the pointer and the use of the pointer can be quite far apart in terms of code, time of execution, and conceptual design. --Tardis 23:50, 7 August 2007 (UTC)Now just because "pointer_to_function = addition;" is legal C because there's no real ambiguity doesn't mean you should use it- I had to puzzle over it for a few seconds to realize that what you really meant was "pointer_to_function = &addition;" though as tardis pointed out it's the same thing really --frotht 03:21, 8 August 2007 (UTC)
On the exec question...
Exec is used when you want to replace one running program with another. By itself, this isn't a very useful thing to do. But combined with fork, it becomes a very powerful thing to do because it allows one program to "spawn off" a series of other programs. exec is almost always used with fork and, in fact, most programmers tend to think of them as one word: "fork-n-exec".
fork-n-exec can be used, for example, when a software system is starting up. Perhaps there is some sort of master program and a series of subsidiary programs that intercommunicate with the master. Those subsidiary programs are each started by forking off from the master program and then exec'ing the subsidiary program.
The shell does the same thing when you execute a pipeline. The shell fork-n-execs each of the elements that you specify in the pipeline, arranging them to intercommunicate via pipes.
Does this explanation help you?
Atlant 12:20, 8 August 2007 (UTC)
Lets say you have two functions with prototypes: int func1 (int blah); int func2 (int blah); These functions are of the same type. They are both int NAME (int); You can declare a pointer to this type of function as: int (*functionpointer)(int); You can then set this pointer to point two either func1 or func2: functionpointer = func1; You can then make a function call, through the pointer: (*functionpointer)(0); Which in this case would be eqvialanet to doing: func1(0); An interest quirk of C is that whenever you reference a function you ALWAYS gets its address. So that these 3 lines all do the same thing: functionpointer = func1; functionpointer = &func1; functionpointer = *func1; They all set function pointer to point to func1.