Wikipedia:Reference desk/Archives/Computing/2008 May 22
Computing desk | ||
---|---|---|
< May 21 | << Apr | May | Jun >> | May 23 > |
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. |
May 22
editHow can I use public domain materials? Can I make money off of them?
editLet us say I have some public domain material (text). Let us say I modify it, add it my own, stuff like that. Now, can I call it falling under my copyright? Or, since it contains public domain sentences, do I have to call it all public domain? Smaug 01:07, 22 May 2008 (UTC)
- You can copy and sell them to make money, and there are books like that around. Usually the focus will be on producing a high quality book that can sell at a high price, even if the content is free. I have seen old books like this with copyright claimed by some company, and the only copyright bit is the new cover and verso page. Another common thing is to reproduce old pictures and sell at a premium price. Although you can claim copyright on your modifications you can't stop someone from copying the public domain component. Graeme Bartlett (talk) 02:36, 22 May 2008 (UTC)
- Even if you don't do anything to it you can make money off it if you want. Public domain means nobody has a (valid) copyright claim to it. Now if you don't modify anything, you can't claim copyright over it yourself, but if you add anything to it, that and only that are copyrighted.
- So let's say you decide to come out with your own series of Sherlock Holmes reprints. You can't claim copyright on the stories themselves—those are in the public domain (at least the early ones are). But let's say you add your own illustrations. Bingo! Those are all yours, copyrighted and so forth, exclusive to you. How about some annotations and footnotes? Hooray, those are yours too! Again, the basic text, the stuff unmodified, that's still public domain—you can't sue somebody else for having a Sherlock Holmes book. But the new material falls under copyright.
- Painting of the Mona Lisa? Public domain! Painting of the Mona Lisa that you drew sunglasses over? Can be copyrighted! But only the sunglasses part.
- For more details, see derivative work—the modifications made to an existing work carry their own copyrights (though they do not trump a pre-existing copyright claim on the work if one exists). --98.217.8.46 (talk) 02:50, 22 May 2008 (UTC)
- Also, technically you should indicate where your own copyright notice begins and ends—what materials are new to you. There is technically a penalty for claiming false copyright—e.g. over public domain material. I have never seen this prosecuted and major companies, esp. photo companies, violate this all the time (Corbis, for example, has a huge amount of material in its archive that was produced by the US Federal Government and is not copyrightable, yet it is labeled as copyrighted all the same). --98.217.8.46 (talk) 13:56, 22 May 2008 (UTC)
GIMP question
editHow is it possible to blend two pics together using the Blend Tool in GIMP? All it seems to give me is colours, and not a choice of pic.--ChokinBako (talk) 04:30, 22 May 2008 (UTC)
- Try adding a layer mask and putting a gradient in it. —Ilmari Karonen (talk) 04:48, 22 May 2008 (UTC)
- (Edit conflict) I would guess by using something like the "FG to Transparent" gradient type on the front layer. You might be able to find more in the online documentation. Good luck! --Prestidigitator (talk) 04:50, 22 May 2008 (UTC)
- Thanks, both of you. I added the layer mask and put the gradient in, and it worked, as it became transparent. But I couldn't put a pic over it. Was I supposed to do that on the second pic? AGH! Sudden realisation while I write!--ChokinBako (talk) 07:55, 22 May 2008 (UTC)
- Yup! Got it! Thanks!--ChokinBako (talk) 08:02, 22 May 2008 (UTC)
Running many with &&
editOn Windows XP, how can I run... many "msg" commands with one go? Typing in msg * Hello && msg * Hello Again won't work as expected. It does work from the command line. 212.149.216.233 (talk) 08:48, 22 May 2008 (UTC)
- I haven't tried it, but cmd /c "msg * Hello && msg * Hello Again" should work. -- BenRG (talk) 11:20, 22 May 2008 (UTC)
ActionScript: make _rotate rotate smoothly
editI have this script:
on (release) { mc1._rotation -=90; }
it rotates the movieclip 1, but I want it to rotate smoothly (accelerate and then brake).
How can I change it?
RgdsMr.K. (talk) 12:26, 22 May 2008 (UTC)
- One way is to do it with tweening in Actionscript, which has its own "ease" setting (which is the smoothness).
- The other way is to give your movieclip a property of, say, a destination_rotation and then have a function that every frame or so checks to see if the destionation_rotation has been hit or not and, if not, rotate the movieclip a bit. The way to make it "speed up" at the beginning and "slow down" at the end is just to figure out whether you are in the first or last 5% of all rotations and to adjust how many rotations you make per frame.
- Make sense? I don't have code handy but if you google "smooth motion actionscript" or "smooth rotation actionscript" there should be examples of both, I believe. --98.217.8.46 (talk) 13:47, 22 May 2008 (UTC)
- It seems to me that better would be to have a specified mathematical model: store an old_rotation, a destination_rotation, a rotation_time, and a rotation_start and then calculate where f is a surjective, monotonically increasing function from onto itself whose derivative is larger in the middle than at the ends. For instance, take so (using ) . If you don't want the speed to ever be 0, try instead for some positive c. One could also look at the arctangent function or the logistic curve depending on the precise amount of acceleration desired. --Tardis (talk) 15:09, 22 May 2008 (UTC)
- That would probably be more perfect in an ideal world, but for most actionscript it would be overkill and a bit processor intensive. Actionscript is pretty crappy at the big equations in my experience, and assuming you've got anything else going on at the same time it'll really lag it to do something that complicated. Again, we're talking about probably less than 100 frames here—precision isn't the problem. --98.217.8.46 (talk) 15:21, 22 May 2008 (UTC)
- It seems to me that better would be to have a specified mathematical model: store an old_rotation, a destination_rotation, a rotation_time, and a rotation_start and then calculate where f is a surjective, monotonically increasing function from onto itself whose derivative is larger in the middle than at the ends. For instance, take so (using ) . If you don't want the speed to ever be 0, try instead for some positive c. One could also look at the arctangent function or the logistic curve depending on the precise amount of acceleration desired. --Tardis (talk) 15:09, 22 May 2008 (UTC)
- Thanks for all answers. I'll go with the tweener class. Mr.K. (talk) 16:08, 22 May 2008 (UTC)
- The overhead involved in calculating a polynomial with as few terms as these have is so trivial as to not deserve mention. The actual math to rotate the image (and interpolate properly to avoid bad artifacts in so doing; see the similar image scaling problem) is so much more complicated that, even with the polynomial being interpreted and the image manipulation done directly by native code, my bet is on the image manipulation taking the majority of the effort. Anyway, premature optimization and all that. The only issue is whether evaluating t (that is, consulting the system clock) is expensive for some reason; then t could be a measure of frames instead. --Tardis (talk) 23:07, 22 May 2008 (UTC)
Incredibly stupid Python question...
editI'm a python neophyte and I have a question regarding a fundamental part of the language. In C-style languages, if you want to iterate over a sequence of numbers or the items in an array, you'd use the familiar for-construct:
for(i = 0; i<somenumber; i++)
Of course, it doesn't quite work like that in python, it uses the whole neat built-in looping over an array-thing instead of the old-school for loop. If you do want to iterate over a range of numbers, the python tutorial recommends iterating over the range function, like so:
for i in range(somenumber)
I have a question about this though: what if you want to iterate over, say, 5 million numbers? I mean, it seems incredibly stupid to create a five-million sized array just to iterate over (it makes me shudder in the old parts of my brain that spent hours optimizing c-code). Is there some smoother way to do this? Obviously, you could just use a while loop:
i = 0
while i<somenumber:
#here be code
#...
#...
i+=1
But this is not nearly as elegant, especially since you have to have the increment at the end (you could have it at the beginning, but then you'd have to initialize i to -1 and compare to somenumber-1, and that is even less elegant). There seems like there should be a better way, especially in a language like python which is all about elegance. Can anyone help a stupid guy out? 83.250.207.154 (talk) 15:33, 22 May 2008 (UTC)
- Of course Python has an elegant solution. In fact, it is so elegant that it is all but invisible. Although the Python for statement looks as if it is looping through a pre-built list, it actually uses iterator behaviour (derive and return next item, yield control) by default as long as its target object supports this behaviour - see iterator#Python and this article and this one too for more details. All of the Python built-in sequence classes support iterator behaviour, and you can add it to your own classes if you need it. You might also want to check out the xrange function - a memory-efficient alternative to range. (BTW, not a stupid question at all - the Python tutorial makes very little mention of iterators, which is a pity). Gandalf61 (talk) 16:02, 22 May 2008 (UTC)
- So if I understand you correctly, xrange is actually an iterator object, instead of a list? Clever! I have to say though, I still kinda prefer the traditional construct. It's so much more direct. I've (almost) come to peace with the whole "whitespace has semantic meaning"-thing, but the for-loop is going to take longer :) (btw, you do feel like a total moron when you've coded for the better part of two decades, and you have to ask a question about a fundamental control structure :) I blame the cabalistic alchemy that is the python programming language (seriously people, it has a lambda operator!). I really love the array slicing thing, though) 83.250.207.154 (talk) 19:26, 22 May 2008 (UTC)
- There's nothing cryptic about lambda, it just has a poorly chosen name. Some languages (like ML) call it function or fn instead. And some languages use iota for the numeric range operator, which makes it look cryptic. (I'm blanking on examples, though, aside from APL, where everything is cryptic.) I don't think iterating over a numeric range is less direct than initializing a variable and incrementing it until a termination condition is satisfied. It's just a more compact expression of the same thing. Both foreach and lambda are great ideas that are spreading to more and more languages. The upcoming C++0x standard has both (though not by those names). -- BenRG (talk) 23:13, 22 May 2008 (UTC)
- I just meant that it sounds like something Christian Rosencreutz would put in, if he was designing a language :) (new slogan: "Python: the language of choice for a Templar!"). I realize that it's very useful, but it has a sort-of mystical feel to it. It's not as bad as APL though, that language is deep black magic. As for the directness of iterating over a range of values instead of just incrementing a variable, that's just me being a fuddy-duddy. When you do that in C (or C++, Java, or any other C-style language), there is a sort of directness to it: you create a value, it resides in a specific place in memory, then you increment it. You're speaking pretty much directly to the computer, telling it what to do. In contrast, creating an object that calls an iterating function to step through the values is far more abstract, and far more removed from the nitty-gritty of what the computer is actually doing. I'm having a little trouble getting used to that, but I'm sure I'll be a converted python zealot soon enough 83.250.207.154 (talk) 07:25, 23 May 2008 (UTC)
- There's nothing cryptic about lambda, it just has a poorly chosen name. Some languages (like ML) call it function or fn instead. And some languages use iota for the numeric range operator, which makes it look cryptic. (I'm blanking on examples, though, aside from APL, where everything is cryptic.) I don't think iterating over a numeric range is less direct than initializing a variable and incrementing it until a termination condition is satisfied. It's just a more compact expression of the same thing. Both foreach and lambda are great ideas that are spreading to more and more languages. The upcoming C++0x standard has both (though not by those names). -- BenRG (talk) 23:13, 22 May 2008 (UTC)
- So if I understand you correctly, xrange is actually an iterator object, instead of a list? Clever! I have to say though, I still kinda prefer the traditional construct. It's so much more direct. I've (almost) come to peace with the whole "whitespace has semantic meaning"-thing, but the for-loop is going to take longer :) (btw, you do feel like a total moron when you've coded for the better part of two decades, and you have to ask a question about a fundamental control structure :) I blame the cabalistic alchemy that is the python programming language (seriously people, it has a lambda operator!). I really love the array slicing thing, though) 83.250.207.154 (talk) 19:26, 22 May 2008 (UTC)
- As regards the lambda expression, it is simply a shortcut for creating an in-line unbound function object. If you want to, you can avoid lambda completely by using def to create a function and bind a name to it instead. So
- (lambda *args: <some expression> )(foo, bar)
- is exactly the same as
- def spam(*args): return <some expression>
- spam(foo, bar)
- Having lambda in the language is just like being able to write
- eggs = eggs + 'Holy Grail'
- instead of being forced to create an object with value 'Holy Grail' and bind a name to it before you can reference it, like this
- holy_grail = 'Holy Grail'
- eggs = eggs + holy_grail
- Like iterators, lambda is another topic that is poorly explained in the "comes with" Python tutorial, which covers it in one short paragraph with a badly chosen, overly-complex example. The on-line book Dive into Python gives a much better explanation here. Gandalf61 (talk) 09:47, 23 May 2008 (UTC)
- As regards the lambda expression, it is simply a shortcut for creating an in-line unbound function object. If you want to, you can avoid lambda completely by using def to create a function and bind a name to it instead. So
Other useful commands are:
enumerate(['a', 'b', 'c'])
= [(0, 'a'), (1, 'b'), (2, 'c')]
zip(['a', 'b', 'c'], ['d', 'e', 'f', 'g'], ['h', 'i', 'j', 'k'])
= [('a', 'd', 'h'), ('b', 'e', 'i'), ('c', 'f', 'j')]
--h2g2bob (talk) 22:12, 22 May 2008 (UTC)
Blu-Ray playback on Mac (non-copyrighted material)
editI'm burning my own Blu-Ray video discs from hi-def camera footage. Is there any Blu-Ray playback software on the Mac? (not for movies, but for home authored projects) --70.167.58.6 (talk) 16:16, 22 May 2008 (UTC)
- There is no Apple-supplied Blu-Ray drive option for any current Macs. While it's possible to put a BR drive into an external enclosure and hook it up to the mac, last time I checked, OS X will only recognize this for data, and there is no existing playback of Blu-Ray video available. Donald Hosek (talk) 23:17, 22 May 2008 (UTC)
Different OS = different fonts?
editIf I have Windows can I use fonts that someone used in a Mac?Mr.K. (talk) 16:26, 22 May 2008 (UTC)
- The most common font format is TrueType and that formate is supported on both Mac OS and Windows. Seano1 (talk) 17:42, 22 May 2008 (UTC)
- And Linux for that matter. APL (talk) 23:52, 22 May 2008 (UTC)
- It didn't used to be the case, but now it pretty much is. --Captain Ref Desk (talk) 17:50, 24 May 2008 (UTC)
Sending e-mails without disclosing everyone copied into them.
editI have always simply clicked on To - and then clicked on addresses in my address book and then clicked on Send Now. But I am aware that my e-mail then shows everyone else's e-mail address to all other recipients. But I sometimes receive e-mails fom various people that have been copied to others but which don't show their e-addresses. How do I do that please? And thanks in anticipation.92.21.228.246 (talk) 17:00, 22 May 2008 (UTC)
- There should be a feature for blind carbon copy or BCC, depending on your e-mail application. --—— Gadget850 (Ed) talk - 17:18, 22 May 2008 (UTC)
- Often BCC is not enabled by default, but can be found if you muck around in the preferences. Nobody receiving the e-mail can see any of the addresses on the BCC list. --98.217.8.46 (talk) 00:02, 23 May 2008 (UTC)
FreeHand to SVG
editI'm looking for a decent freeware Macromedia Freehand to SVG converter. Admiral Norton (talk) 17:24, 22 May 2008 (UTC)
- If you actually have a copy of Freehand, you could try exporting to PDF (or EPS) format and using Scribus to convert to SVG. I've never worked with Freehand myself, but I've generally found that Scribus tends to do an excellent job of converting PDF to SVG (certainly better than Inkscape, usually). —Ilmari Karonen (talk) 18:09, 22 May 2008 (UTC)
More command prompt
editWhat command is used to open the D: drive in command prompt, and its syntax, please. Also, how does one shutdown the computer from command prompt? I can on my usual computer (with the "shutdown" command) which has a newer version of command prompt, but this is version 5.00.2195 in Windows 2000 (for both of these questions, in fact). Thanks, Zrs 12 (talk) 19:31, 22 May 2008 (UTC)
- You should be able to simply type "D:" then hit <Enter> if you are using DOS. From there you can issue any ensuing commands like "dir" to list the directory entries and so forth.
- For shutting down type "SHUTDOWN -s -t 01" for complete shutdown, and "SHUTDOWN -r -t 01" for restarting. I think these should work for your version... WDavis1911 (talk) 19:43, 22 May 2008 (UTC)
- Oh, now I meant open the drive to be able to place a CD in it. When I type in D: it says "Device not ready". Also, shutdown -s -t XX is the command I use on my normal computer, but it won't work with this version. When I type in shutdown -s -t 01, it says "'shutdown' is not recognized as an internal or external command, operable program, or batch file." -- Zrs 12 (talk) 20:04, 22 May 2008 (UTC)
- If you want to see the contents of the D: drive from the command prompt, you can type "explorer d:\". The shutdown command is not available on Win2K unless the Resource Kit is installed, but you can try TSSHUTDN (type TSSHUTDN /? to get the usage and switches). I didn't work on the system I just tried, perhaps because I'm connect via a remote control session. --LarryMac | Talk 19:59, 22 May 2008 (UTC)
- "TSSHUTDN" doesn't work. It says "'tsshutdn' is not recognized as an internal or external command, operable program, or batch file." And I am wanting to open the D: drive to be able to insert a CD. -- Zrs 12 (talk) 20:07, 22 May 2008 (UTC)
- For opening the drive tray, I don't think there's a built-in tool, but Google seems to turn up a ton of third party utilities. I can't actually view any "free software" sites from this computer, so you'll have to do the legwork on that one. TSSHUTDN is actually part of Terminal Services, so if that component wasn't installed then again, I'd search for a third party solution. --LarryMac | Talk 20:19, 22 May 2008 (UTC)
- Ah, I see. I don't know the DOS command (if one exists natively) for opening the CD drive, but there are utilities that you can install that let you do that. Try this link. For your other problem, is the Resource Kit available to you for you to install? If so I would take that route. WDavis1911 (talk) 20:17, 22 May 2008 (UTC)
- Note that "DOS" and "Windows command prompt" are two entirely different things. It looks like that link points to a DOS eject utility, and the page mentions that it may or may not work in Windows (and if it does it'll only be via a fairly circuitous process of emulation). These ones appear to be Windows apps, but I can't personally vouch for any of them: [1] [2] [3]. -- BenRG (talk) 21:03, 22 May 2008 (UTC)
Writing DVDs
editI have a faulty DVD+RW disk. Something went wrong during the finalisation process and now both my DVD players refuse to play the disk. However, my PC is sometimes able to play the DVD without error and at other times struggles to read the disk. On an occasion when it was working, I copied all the folder structure and files (.vob, .ifo, .buf) to my hard disk. Can I simply copy those folders and files onto a new blank DVD+RW and play it on my TV? Astronaut (talk) 21:28, 22 May 2008 (UTC)
- Yes- you can compile a DVD with the folder AUDIO_TS and VIDEO_TS and their contents and burn it like you would a data disc. --—— Gadget850 (Ed) talk - 00:15, 23 May 2008 (UTC)
- That's not necessarily true. DVD-Video is not just a bunch of files on a DVD; it requires the UDF file system (not ISO 9660) and it requires the files in the VIDEO_TS folder to be arranged in a particular way on the disc. You need DVD burning software with special support for writing DVD-Video discs. I'm pretty sure all DVD burning software has that support these days, but it won't necessarily be enabled automatically. You need to tell it that you're making a DVD-Video disc. But yes, those VOB, IFO, BUP files are the only ones you need. -- BenRG (talk) 01:40, 23 May 2008 (UTC)
Domains
editI have just created a new wiki on my own computer and at a home server. How do i get (something like) en.wiki.x.io as my domain name. I know it will cost. Can a 123reg.co.uk domain be used? How do you associate it? CyberThing (talk) 21:49, 22 May 2008 (UTC)
- I got my domain name registered at nominet.co.uk and my site is hosted by my ISP, for which I pay a small premium over my regular broadband fee. My ISP were the ones who sorted out the connection between my site on their servers and my domain name. I'm not sure how it works if you host the site on your own server but I would assume you need that machine to have a fixed IP address. Even so, your ISP are probably the best people to turn to because all traffic would have to be routed through their servers anyway.
- The difficulty I had was finding a domain name that wasn't already taken by a reseller and simply "parked". They usually offered those domains for sale, but why should I pay these scumbags when thay have no intention of using the domain for something more than selling it on. Astronaut (talk) 22:09, 22 May 2008 (UTC)
- You also need to check the fine print with your ISP. Running a web server may be against the terms of service for a home account. --—— Gadget850 (Ed) talk - 00:12, 23 May 2008 (UTC)
- See Dynamic DNS. One of these places could probably help you. However, as per above, make sure that your home ISP gives you the right to run a web server and that you have enough bandwidth to cover however much traffic you're expecting. APL (talk) 12:42, 23 May 2008 (UTC)
Excel question
editI have 3 columns of data in Excel. In Column "B", some cells have a trailing coma. If one of the cells in column "B" has a coma, I need that coma erased. If the coma isn't at the end of the column, I need it to stay.
Comas in other columns need to stay also.
Is there a way to accomplish this with find/replace? It could save me a full day. I'm using Excel 2007 for Mac, but have 2003 on my old HP machine, and I could use that if I have to.
Thanks for the help.
71.164.116.200 (talk) 21:57, 22 May 2008 (UTC) –I figured it out, I had to learn how to use Macros--I found one that did it. —Preceding unsigned comment added by 71.164.116.200 (talk) 23:39, 22 May 2008 (UTC)
- The easiest way is to just make a new column with a function like, =IF(RIGHT(B1,1)=",",LEFT(B1,LEN(B1)-1),B1)) which (unless I've counted parens incorrectly) will just give you column B except without trailing commas. Once you've applied that to an entire column then you can copy that new column and paste special > paste as values (or whatever it is called) over the old column. Voilà! --98.217.8.46 (talk) 00:01, 23 May 2008 (UTC)
- Even easier to use the text to column fuction, select the column, select text to column feature, select delimited, next, tick the comma box and click finish. This will remove all commas regardless of the field length Hughiemcl (talk) 19:50, 23 May 2008 (UTC) —Preceding unsigned comment added by Hughiemcl (talk • contribs) 19:47, 23 May 2008 (UTC)