Wikipedia:Reference desk/Archives/Computing/2009 October 14
Computing desk | ||
---|---|---|
< October 13 | << Sep | October | Nov >> | October 15 > |
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. |
October 14
[edit]Long email
[edit]I can only see 768k of an email (no attachments). Is there a way to load it in Word? Clarityfiend (talk) 02:40, 14 October 2009 (UTC)
- What e-mail program are you using? What happens when you choose "Save As" in your e-mail program and then open the resulting file with Word? Tempshill (talk) 04:15, 14 October 2009 (UTC)
- It's hotmail. When I try to print to file, it says I can't save it for some reason, but oddly enough, it then displays the entire message in a new window, so that's fine. Go figure. Clarityfiend (talk) 05:06, 16 October 2009 (UTC)
Portable web design software with tag suggestion ability?
[edit]One thing I love about Dreamweaver is how it automatically brings up a list of possible values for each tag you create. I'd never be able to remember all of those otherwise.
I'm looking at portable (run from USB) software to use when I'm away from home (& my Dreamweaver) but am having trouble finding any that offers this feature. Programmer's Notepad seems awfully nice, but I'll be seriously hamstrung if I don't have that helpful recommendation feature...
I realize this is somewhat of an IO (idiot operator) problem, but hopefully there's a sympathetic sort out there who is equally reliant on those context-sensitive recommendations when they code who can help me find the right app!
Thank you, 218.25.32.210 (talk) 03:44, 14 October 2009 (UTC)
- You can use VMWare's ThinApp to create your own portable version of Dreamweaver. The last time I used it, ThinApp was freely downloadable as a free trial. Like most VMWare products, it is very easy to use. Many people have already made portable versions of Dreamweaver. Just Google it, and you'll see what I mean.--Drknkn (talk) 03:55, 14 October 2009 (UTC)
Any quick way to download the text from a series of html pages?
[edit]I want to download the text from these pages http://algoma.concat.ca/opac/extras/opensearch/1.1/-/html-full?searchTerms=Office+management&searchClass=subject and save it in one text file, so that I can study it at my leisure. Is there any quick way to do it please, rather than manually downloading and copying all 21 pages? 78.146.56.252 (talk) 15:10, 14 October 2009 (UTC)
- Both wget and cURL are available for many standard computing platforms. They can help automate your task. If you prefer a browser plugin instead of a standalone software tool, you can look at DownThemAll! for Firefox. Many other tools exist. To merge all the files to a single file, you might want to use the cat (Unix) tool, or its equivalent on Windows (TYPE (DOS command)). (e.g. the command line "cat *.html > merged.html" will merge the files.) Merging HTML files might cause weird rendering artifacts depending on how you choose to view the file. Nimur (talk) 18:13, 14 October 2009 (UTC)
The text I added to this seems to have disappeared. What I wrote was that wget just downloads every link (and every book record has several links), despite restricting it to down-the-tree only. Is there any way to get it or cURL to just follow the "next page" only please? 92.29.57.166 (talk) 00:01, 15 October 2009 (UTC)
A good back-up Wikipedia edit counter
[edit]This one is perfect except that it sometimes goes down for days at a time: [1]
Is there a comparable one that anyone knows about? I've Googled to no avail. Vranak (talk) 15:37, 14 October 2009 (UTC)
- How about WikiChecker? It's a bit slow and the English is...interesting, but at least it always works. Xenon54 / talk / 15:44, 14 October 2009 (UTC)
- Awesome, thanks. Vranak (talk) 16:47, 14 October 2009 (UTC)
Changing File Extension Changes File Type?
[edit]My friend changed a file extension from .png to .jpg by renaming the file and actually by doing so managed to change the file type from .png to .jpg. She showed me the screenshot of the 'properties' box and indeed the file type had been changed, however I was unable to do it even after repeating the exact same procedure that she had performed. We are both on Vista but can't work out why she can do it but I can't (to be honest, I never ever thought it was possible anyway, and this is why I asked her to show me the screenshot mentioned above). Can anyone work out what I am doing wrong? I think I should mention that my file ended up being called 'XXXX.jpg.png'. (Also, there are plenty of other ways to do this, many of which I am aware of, I am just asking this question to see if and how our systems are different). --KageTora - SPQW - (影虎) (talk) 18:34, 14 October 2009 (UTC)
- A file name does not necessarily match the actual file type. Changing the extension (which is just a special case of renaming the file) categorically does not change the file's contents on any operating system (including Windows Vista). It is remotely possible that your friend has installed some custom, third-party shell extension that does a file-type conversion when it detects a file rename, but this is very unlikely.
- This being said, it is also important to know that the "reported" file type also does not necessarily match the actual file contents. (So when you click on a file and it "claims" to be a PNG file - that may be an incorrect claim. It depends on what method is used to verify the file type). Some simple programs simply check the file extension (so they are easily fooled). Certain Windows components also rely exclusively on this method. In that case, changing the extension will cause the reported file type to show up differently (though the actual file type has not changed). Further, because both PNG and JPG are images, Windows Vista handles them similarly - typically passing them to an image viewing program when they are double-clicked (for example). That image-viewer program probably does a more thorough file-type check - ignoring the mismatch between file extension and actually reading the binary contents to determine the correct way to display the image. So, an incorrectly named JPEG image file which is named as if it were a PNG might claim (to the Windows Explorer shell) to be a PNG - and when you click it, it may open up and display properly - but it is still a JPEG image. If you want to verify, you can open the file with a hex editor and see if it contains the JFIF header; or take the MD5 hash of the file (which takes no notice of the file name or "extension") to see if the renaming actually made any change to the file contents. Nimur (talk) 18:50, 14 October 2009 (UTC)
- The "type of file" displayed in the File Properties window is determined by the extension. For example, I just changed a file 26av500u.pdf and renamed it to 26av500u.jpg and Windows now thinks it's a JPEG file. That doesn't mean it can be opened by Windows Photo Gallery, or anything else expecting an actual JPEG file. I also experimented with a PNG and was able to open the JPEG version, however that just mean that Photo Gallery is smart enough to read the file header instead of relying on the extension. --LarryMac | Talk 18:53, 14 October 2009 (UTC)
- This is why for many years the convention on Unix was to avoid "file extensions" altogether - and rely exclusively on correct parsing of the file to verify that it was a valid, properly-formed member of whatever type. However, this has given way to the file extension convention, which is very convenient for both human and machine "first-pass" file type detection. Nimur (talk) 18:57, 14 October 2009 (UTC)
- On windows, the file extension (the part after the ".") is how Windows identifies file type. If you change the extension, Windows will change the file type. However, that doesn't change the file contents at all. Despite its file type, the file is still a JPG image, though you might encounter some difficulties opening it with some programs.
- One thing to consider, perhaps your friend opened the JPG image in an image editor, then resaved it as a PNG image. In that case, the file will really be a PNG image.
- Note that you can also get some odd behavoir if you have "Hide extensions for known filetypes" ticked in your folder options. If you were to rename the JPG image "example" to "example.png", then that would not change the file type at all (what you would actually have done is renamed "example.jpg" to "example.png.jpg"). Windows only takes notice of the last extension when determining the file type. Astronaut (talk) 19:15, 14 October 2009 (UTC)
- I remember that misfeature being the source of a security hole a while back where you would get an email containing the evil program "agent-scully-naked.gif.exe", but Windows tells you it's a GIF, and clicky clicky. --Sean 19:52, 14 October 2009 (UTC)
Thnaks a lot, but just to clarify, we both used Jing to make the file, and the default output of Jing is .png. She changed her file to .jpg simply by right-clicking and renaming it. In her properties box, it then said the file was a .jpg. I did exactly the same things as her (using the same software) and got the result above. I guessed it may be because of the 'file extension displayed/not displayed' thingy, but have not so far worked out how to get them displayed in order to test that theory. Can anyone point the way for me there? --KageTora - SPQW - (影虎) (talk) 19:31, 14 October 2009 (UTC)
- From Control Panel, open Folder Options. On the View tab there is a check box for "Hide extensions for known file types". Clear this box, then Click OK. --LarryMac | Talk 19:38, 14 October 2009 (UTC)
- Excellent! Thank you! Plus, it worked. The file I just tried it on is now a .jpg rather than a .png, as it was previously. Thank you. This answers my query perfectly. --KageTora - SPQW - (影虎) (talk) 20:52, 14 October 2009 (UTC)
- Not necessarily. If you have used your image creation software to make a PNG and then renamed the file to use the extension .jpg, the file will still be a PNG. Windows will tell you it's a JPEG, since it only uses the extension to determine the file type. Leaving a PNG file with a .jpg extension isn't a terribly good idea, since there will be programs that understand the JPEG format but not PNG and these will try, but fail, to open the file. You can prove this by renaming the file to something like .txt and seeing what happens. --Phil Holmes (talk) 09:57, 15 October 2009 (UTC)
- You cannot actually change the file data by changing the filename extension. It just will not occur. A PNG and a JPEG do not have identical bits. A image with an incorrect extension may still open—if the program opening it is both intelligent about how it determines file types (not relying on the extension) and can open the actual type in question. But renaming files is NOT a way to convert them between types AT ALL and should really NOT be done—it is a horrible practice. --Mr.98 (talk) 14:57, 15 October 2009 (UTC)
impotance of newtwork
[edit]what is the importance and application of network? what are the research area for the network? —Preceding unsigned comment added by Aqdusnoor (talk • contribs) 18:46, 14 October 2009 (UTC)
- The reference desk will not do your homework for you. Take a look at the network disambiguation page and pick the type of network your question is about. Come back here if you have a specific area of difficulty and can show that you have at least tried to do your own homework. Astronaut (talk) 19:20, 14 October 2009 (UTC)
- wikt:Network may also be of limited use in giving you a broad brush definition. Otherwise, I concur with Astronaut, can you be a bit more specific? - Jarry1250 [ In the UK? Sign the petition! ] 19:25, 14 October 2009 (UTC)
Intel i7 vs Core 2's in MacBooks
[edit]Generalizing, are the new Intel i7 based laptops faster than MacBook Pros running on Core 2's? Is it safe to assume that the next generation of MacBooks will have i7 processors? Acceptable (talk) 20:24, 14 October 2009 (UTC)
- Intel's intention is, eventually, to replace all core2 architecture products with a core-i7 (Nehalem) product, although they'll degrade and downbrand some as i3 and i5. If the i7 product rollout goes like core and core2 did, there will be a considerable (maybe 12 or 18 month) period of overlap, where they make a core2 and a Nehalem chip in much the same space, and manufacturers will typically push Nehalem down the product line. Apple evidently like to keep an offering near the top end of the performance line; whether the very next iteration of a given Apple product will have i7 depends on how they feel about what Intel's offering is at that time, and the price and volume deals they can get from Intel. Manufacturers are loath to leave a large gap between iterations, waiting for a supplier (Intel in this case) to ship in volume before they can; so they'll be very tempted to put out product with the latest incremental improvement of core2 in the meantime. So, generalizing, I think not (or not all). -- Finlay McWalter • Talk 23:32, 14 October 2009 (UTC)
- It's also a function of the new chip's thermal properties; if the new chip dissipates the same heat, and through the same interface, as the core2 equivalent, then it's much easier to fit it into a variant of an existing chassis. If the new thing (and its associated chipset and any voltage-regulation circuitry it needs nearby) dissipates significantly more heat, or in different places, then they'd need a new design, FloTHERM it, and retool for the modified chassis - if it's a big job, they might miss a schedule and have to ship a core2 in the interim. -- Finlay McWalter • Talk 23:43, 14 October 2009 (UTC)
Template for struct array
[edit]I have a shuffle function in C++ that takes an array of Card structs. It is just "void shuffle(Card cards[], int size);" The size is the size of the array. This function works fine. I wanted to template it so I could shuffle any array. So, I wrote:
template <class T> void shuffle(T items[], int size);
When I try to compile, it fails. I have "shuffle(cards, 52);" which worked before. Now the compiler says there is no match for shuffle<Cards>(Cards *[52], int). What am I doing wrong? —Preceding unsigned comment added by 67.43.242.174 (talk) 22:33, 14 October 2009 (UTC)
- While you wait for a C++ expert to come along, check out Wikipedia:Reference desk/How to ask a software question. Also, I think you'll find that declaring it as shuffle(T *items, int size) will work, though I'm not sure that that's your problem since I can't see your code. Also, see here for the STL-ish way to shuffle an array. --Sean 23:38, 14 October 2009 (UTC)
- As far as I know T items[] is legal and equivalent to T* items even when T is a template parameter, but try T* items to see if it makes your compiler happier. Template functions need to be defined (not just declared) in every compilation unit where they're used, so if you really just have a prototype like the one you wrote above, you need to change that to a definition. -- BenRG (talk) 23:59, 14 October 2009 (UTC)
- The following C++ code compiles without warning or error. Perhaps this is what you are trying to do:
struct Card
{
int value;
char suit;
};
template <typename T>
void shuffle(T c[], int s)
{
// Just show usage to avoid warnings.
c[0] = c[1];
s++;
}
int main()
{
Card c[52];
shuffle(c, 52);
return 0;
}
- That works, but not when I put shuffle in shuffle.cpp and main in main.cpp. I get "main.cpp:(.text+0x1c): undefined reference to `void shuffle<Card>(Card*, int)'". I have main.h with the struct definition, main.cpp with the main function, shuffle.h with the template prototype, and shuffle.cpp with the shuffle function. 67.43.242.174 (talk) 01:52, 15 October 2009 (UTC)
- Template functions will throw linker errors if they are not in the same logical file as the file that uses them. So, you have a couple choices: Put the entire definition of shuffle in shuffle.h or have main.h include shuffle.cpp directly. -- kainaw™ 02:30, 15 October 2009 (UTC)
- Or add one or more explicit instantiation directives to shuffle.cpp. But see below. decltype (talk) 06:27, 15 October 2009 (UTC)
- Template functions will throw linker errors if they are not in the same logical file as the file that uses them. So, you have a couple choices: Put the entire definition of shuffle in shuffle.h or have main.h include shuffle.cpp directly. -- kainaw™ 02:30, 15 October 2009 (UTC)
- First of all, there is no need to pass the size as a parameter, because it is known to the compiler. Second, per BenRG, declaring a function parameter of type "array of T" is equivalent to "pointer to T". In fact,
void f(int arr[]);
void f(int * ptr) { }
int main() { int n; f(&n); }
- is well-formed. What you actually want is to pass the array by reference. Since the size of the array is known by the compiler, it can be deduced. This leaves us with:
#include <algorithm>
template<typename T, unsigned N>
void shuffle( T(&arr)[N])
{
std::random_shuffle(arr, arr+N);
}
- Since the C++ Standard Library provides an excellent shuffle implementation, this function is just a convenience wrapper around that. You may want to consider dropping the function in favor of simply using random_shuffle directly:
#include <algorithm>
int main()
{
typedef int Card; // for convenience
const int Size = 52;
Card arr[Size] = {};
std::random_shuffle( arr, arr + Size);
}
- Regards, decltype (talk) 06:27, 15 October 2009 (UTC)
I've put wget into the c:\windows folder as suggested. It has downloaded some pages. But I've got absolutely no idea where on my computer they have been downloaded to, as the manual is perplexingly silent on this. They are not at c:\windows nor are they at c:\. I also need to ask the same question for cUrl, as the documentation for that does not tell you where things are downloaded to either. Why is this obviously needed information missed out? 92.29.57.166 (talk) 23:38, 14 October 2009 (UTC)
- I have only used wget for Linux... However, you might try searching the entire system for one or more of the filenames that you downloaded. If they are there, a search should turn them up and tell you where they are.
I have no idea what the filenames are. 92.29.57.166 (talk) 00:00, 15 October 2009 (UTC)
- Normally the files end up in the current directory. That might be c:\Documents and Settings\your user name (XP) or c:\Users\your user name (Vista). In the future you should probably open a command prompt and cd to the directory you want before running wget. -- BenRG (talk) 00:06, 15 October 2009 (UTC)
- If you run it with the -O switch, you can specify the filename to use. All the options are displayed if you use --help. --Phil Holmes (talk) 09:48, 15 October 2009 (UTC)