Wikipedia:Reference desk/Archives/Computing/2010 June 6
Computing desk | ||
---|---|---|
< June 5 | << May | June | Jul >> | June 7 > |
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 6
[edit]date of software installation
[edit]How do can I check in my computer the date when MS Office 2007 was installed? I bought my laptop on February 20, 2010 and then I installed MS Office 2007 few days later. Your requirement to get free MS Office 2010 is to install MS Office 2007 before March 5, 2010. I am hoping that I installed the program on or after March 5, so I can avail of the free installation or upgrade of MS Office 2010 in October.
Right now, I use the beta version and I enjoy it a lot. I worry that I won't be able to use the 2010 version in November. I hope the product will reach the Philippines on time.
Will it be a good idea to buy again MS Office 20007 and reinstall it just to avail of the MS Office 2010? Thank you. —Preceding unsigned comment added by 112.202.194.203 (talk) 02:12, 6 June 2010 (UTC)
- I'm pretty sure you are referring to this promotion. However, it says that you're eligible if you have "purchased, installed, and activated" the Office 2007 product, which seems to indicate you are out of luck. This page has more details about eligibility requirements. It sounds like they will eventually require your sales receipt, which will show an earlier purchase date, so it sounds to me like you may not be able to get the free version, in the end. Comet Tuttle (talk) 03:00, 6 June 2010 (UTC)
- The most relevant part:
- If you purchased your PC from an authorized reseller between March 5, 2010, and September 30, 2010, activated Office 2007 by September 30, 2010, and meet the other eligibility requirements you are eligible for the Tech Guarantee.
- Suggests as CT said that unfortunately you're ineligible
- Nil Einne (talk) 06:30, 6 June 2010 (UTC)
- The most relevant part:
How does the Windows XP Installation CD decide if repair is a viable option?
[edit]I have acquired another used laptop, this time one with a thoroughly wrecked Windows XP Professional installation, so bad that I get an error on bootup saying "c:\windows\system32\config\system is missing or corrupt" and suggesting I could try a repair with the installation CD. The file it mentions actually does exist on the disk, so I assume it is corrupted. However, when I boot off the installation CD, it detects the broken Windows but doesn't offer the repair option. Instead I get options to install in a different partition, format the hard disk or overwrite the broken installation and in the process destroy the settings of all the other installed programs. I would rather not destroy the settings for the other programs until I have had the chance to evaluate what is actually installed and whether it is useful or not, and especially since one of them is Microfoft Office Professional for which I don't have installation disks.
I am thinking that perhaps I could copy some files from another PC with Windows XP, but so far have had no success copying the system executables and libraries (the .exe and .dll files from c:\windows and c:\windows\system32). What other files should I copy over to the broken Windows installation, so that the installation CD will offer the repair option? Astronaut (talk) 04:00, 6 June 2010 (UTC)
- I would like to suggest a different approach. You seem to have borked your registry. Go to http://support.microsoft.com/?scid=kb%3Ben-us%3B307545&x=9&y=15 and start where it says "Part one". -- 109.193.27.65 (talk) 20:08, 7 June 2010 (UTC)
Why always modulo by a prime?
[edit]In programming competitions, when the correct result is very large, often you will be asked to return the correct result modulo a prime number. Why do they always choose prime numbers?--220.253.100.43 (talk) 07:34, 6 June 2010 (UTC)
- Because modular arithmetic is particularly clean and easy when done relative to a prime. See for instance Primitive root modulo n. You don't have to cope with all the factors of the number specially if you know it is a prime. Dmcq (talk) 10:47, 6 June 2010 (UTC)
- You can imagine a problem that is difficult to solve, but which has some easier-to-find factors. (trivial example: it's easy to see that 15! is divisible by 1000, since 5*5*5*2*2*2=1000) For a prime p, everything but multiples of p is relatively prime to p. If you're asked for a number mod p, and p isn't one of the factors of the answer, the trick doesn't work. "Highly composite" (so to speak) numbers often come up in combinatorics problems. Paul (Stansifer) 02:17, 7 June 2010 (UTC)
Waiting for Godot to hard boot
[edit]A long time ago, I was told you should wait 10 seconds after turning off your PC before switching it back on. Is there anything to this? Clarityfiend (talk) 08:22, 6 June 2010 (UTC)
- Similar statements are made in the instruction booklets for various things...My Sky box and my router, for example. I've always assumed that it was to ensure people don't switch it off and then immediately switch back on, since some things won't actually switch off immediately and may behave like they haven't been reset at all, but I'd be interested to know if I was right. Vimescarrot (talk) 09:33, 6 June 2010 (UTC)
- I was told that it had to do with capacitors. Capacitors in electronics store charge, and it can take them several seconds to self-discharge once the power is removed. The suggestion to leave electronics in the "off" state prior to restarting is to allow the capacitors to discharge fully, so that when you turn the power back on, all the electronics are in a consistent state. For computers, there is the additional issue of DRAM (standard memory), which stores the 1s & 0s in capacitors. You keep the computer off for a while so that there isn't any unknown garbage left in the memory when the computer restarts. -- 174.24.203.234 (talk) 17:21, 6 June 2010 (UTC)
- My laptop power-supply continues to provide power for about six seconds after turning off so I allow more than ten seconds to make sure that the restart is "clean". Capacitors in older TV sets can retain a charge for hours. Dbfirs 07:16, 7 June 2010 (UTC)
- I agree that it's something to do with capacitors - I recall blowing up a BBC Micro about 25 years ago by turning it off and straight back on again at the mains. Bobby P Chambers (talk) 13:22, 7 June 2010 (UTC)
- Thanks everyone. Clarityfiend (talk) 04:54, 8 June 2010 (UTC)
- I agree that it's something to do with capacitors - I recall blowing up a BBC Micro about 25 years ago by turning it off and straight back on again at the mains. Bobby P Chambers (talk) 13:22, 7 June 2010 (UTC)
- My laptop power-supply continues to provide power for about six seconds after turning off so I allow more than ten seconds to make sure that the restart is "clean". Capacitors in older TV sets can retain a charge for hours. Dbfirs 07:16, 7 June 2010 (UTC)
i am a 11th student
[edit]am in commerce stream wit IP . what can i learn after my 12th? what r the jobs that cud b available to me? —Preceding unsigned comment added by 117.206.42.237 (talk) 09:27, 6 June 2010 (UTC)
- For reference WHOIS indicates that the OP is located in India. I'm afraid I can't answer the question though as I have no knowledge of the Indian education system or job market. Equisetum (talk | email | contributions) 11:01, 6 June 2010 (UTC)
Networking
[edit]I wanted to know..if at all I wanted to be on a given web page for a long period without working on it,then will it be chargeable?Rohit.bastian (talk) 11:49, 6 June 2010 (UTC)
- The simple answer is 'no', but with lots of additional questions/comments.
- By 'chargeable', I assume that you are charged for the amount of data that you send and receive over the internet?
- Once you load a web page from the internet into your local browser, it is in the memory of your own machine. If you unplugged your internet, it would still be there, right? And, in that case, you could look at the page for as long as you liked, without being connected.
- There are, however, many complications - including;
- Some pages update themselves automatically - this happens a lot on news pages, for example. Each time they update, more data will be sent/received over the internet.
- All the time that you are connected to the internet, there are likely to be various 'control messages' flying back and forth; these depend a lot on your computer settings, but there are likely to be some pings, DNS lookup requests, and that sort of thing; you may have additional software to "check for updates", or to track instant messages - all of these will send and receive data.
- Perhaps the best answer would be, to save a local copy of the page on your machine, and then disconnect from the internet. Most browsers allow this, with "File", "Save page as..." or something similar. Chzz ► 12:00, 6 June 2010 (UTC)
Actually i have only a limited downloading of 1.5 GB ..so charges in the sense,will the download meter keep running??I'd not want it to exceed this limit.So what if i want my girlfriend to start a chat on gmail with me first rather than i doing so??I want to be connected!!Just an example..will it still cost?? —Preceding unsigned comment added by 117.204.3.131 (talk) 12:18, 6 June 2010 (UTC)
- Gmail is an expensive e-mail system on download size compared with other systems, but 1.5GB allows a lot of e-mails. I have only 0.5GB allowance, so I don't use gmail for regualar conversations. One useful trick is to disable downloading of images. Dbfirs 12:52, 6 June 2010 (UTC)
- You can also configure Gmail to work with offline news readers. That way, you would connect briefly to the internet, send/receive your email, and then disconnect. You can then spend as long as you like reading/replying, without being connected, and reconnect when you need to send, or wish to check for new messages.
- All email used to work this way; Webmail has become more popular in recent years, but plenty of people still read their email offline.
- I am not sure what operating system you are using, so I do not know what software you have. Most versions of Windows include 'Outlook Express', which is an offline mail reader - if you have that, you could Google for it; for help with other operating systems, try googling for 'gmail' plus the name of the email reader you have. For other options, see Comparison of e-mail clients.
- One tip: be careful about downloading attachments; you should be able to disable those. The text of even a very long email will only be a few kB, but attachments (pictures, etc) can be very large. Chzz ► 15:00, 6 June 2010 (UTC)
- I don't know if I'd say 'most' versions anymore. Ignoring Windows 95 as well as Windows NT branded OSes completely, Windows 98 is over 10 years old and support died a long time ago, Windows ME is nearly 10 years ago and support also died a long time ago. Windows 2k is over 10 years old and support is about to end. Windows XP and Windows Server 2003 are therefore the only ones it makes sense to still be using if you connect to the internet. And indeed Windows XP is probably the only Microsoft consumer OS with a fair number of users. Usage share of operating systems. Windows Vista & Windows 7 plus Server 2008 all of course don't have Outlook Express. Of course since Windows XP still dominates most Windows users have Outlook Express.
- One tip: be careful about downloading attachments; you should be able to disable those. The text of even a very long email will only be a few kB, but attachments (pictures, etc) can be very large. Chzz ► 15:00, 6 June 2010 (UTC)
- In terms of the question, I'm not sure how interested the OP actually is in e-mail. They said "So what if i want my girlfriend to start a chat on gmail with me first rather than i doing so" which suggests to me they're more interested in the chat function then e-mail. In such a case, they can download Gtalk or some other XMPP client but obviously it won't work offline. There will be some bandwidth usage, but it shouldn't really make that big a dent in the data cap unless you include, voice, video or a decent amount of file sharing (including things like photos desktop sharing etc). In other words, keep it to text and you should be fine. However it will use some data, so don't spend all your data on other things.
- Nil Einne (talk) 19:57, 6 June 2010 (UTC)
Could you elaborate on the thing of Outlook Express?? I have a windows 7 ultimate.I did get an account created there.Now how do i use it?? —Preceding unsigned comment added by 117.204.3.182 (talk) 09:36, 7 June 2010 (UTC)
- If you have Windows 7 Ultimate then you would have Windows Live Mail not Outlook Express. This [1] result of a quick search for 'windows live mail gmail' along with plenty of other guides from the same or a similar search should help you set up Windows Live Mail for Gmail e-mail if that's what you want to do. It won't help with the chat component of Gmail Nil Einne (talk) 17:43, 9 June 2010 (UTC)
Replacing .htaccess files with <Directory> sections in apache2.conf
[edit]I'm moving a web site from a hosted server to one I run myself. On the hosted server, I used .htaccess files to restrict access to certain directories. After some fiddling I managed to get .htaccess working on the server that I run myself. However, the apache2 docs advise against using .htaccess files if you have complete control over the server, as I have in this case, and instead use <Directory> sections in apache2.conf. "Any configuration that you would consider putting in a .htaccess file, can just as effectively be made in a <Directory> section in your main server configuration file."
I'm unable to figure out how to follow the above advice.
My apache2.conf contains this section,
<Directory "/var/www/*">
AllowOverride All
</Directory>
The directory that I want to protect contains this .htaccess file
AuthUserFile /some/directory/.htpasswd
AuthGroupFile /dev/null
AuthName "NO ENTRY!"
AuthType Basic
<Limit GET>
require valid-user
</Limit>
The .htpasswd file in /some/directory/ was created using the htpasswd program. According to the docs, there's a performance cost in using .htaccess files, because the apache server needs to check a lot of directories for .htacess files, hence the reccommendation of using <Directory> sections instead. I'm running Apache/2.2.9 (Debian 5.0.4) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 mod_perl/2.0.4 Perl/v5.10.0, in case the answer is version- or OS-dependant.
I'd be grateful if someone could show me how to protect a directory, say /var/www/mydir, such that only user nblue, whose password is 123, can access it — using <Directory> sections instead of .htaccess files. Thank you. --NorwegianBlue talk 12:19, 6 June 2010 (UTC)
- I'm pretty sure it's actually ridiculously simple: just create another Directory section for /var/www/mydir, and put all the .htaccess stuff in it. You can put it right below the other Directory section, I think. Like so:
<Directory "/var/www/mydir">
AuthUserFile /some/directory/.htpasswd
AuthGroupFile /dev/null
AuthName "NO ENTRY!"
AuthType Basic
<Limit GET>
require valid-user
</Limit>
</Directory>
- Does that work? Indeterminate (talk) 04:21, 9 June 2010 (UTC)
- Thanks, Indeterminate. I read your answer from my work PC earlier today, and was about to write that that was the very first thing I tried. But I decided to try it a second time, just to make sure, before responding. And whaddyaknow... it worked. I must have made some silly mistake, and spent too little time pursuing the obvious solution, before moving into more exotic solution-attempts (trying to include the contents of .htpasswd in apache2.conf). Thanks a million, for restoring my faith in docs, the universe and everything! --NorwegianBlue talk 21:21, 9 June 2010 (UTC)
![](http://upload.wikimedia.org/wikipedia/en/thumb/f/fb/Yes_check.svg/20px-Yes_check.svg.png)
Recommendation of free blogging application needed
[edit]I'm looking for a free locally-hosted blogging application for small group collaboration. It doesn't need to have advance features (being easy to install/use/administer is more important). Any suggestions? --173.49.77.55 (talk) 12:46, 6 June 2010 (UTC)
- I'm afraid you've given too little information about the hardware that is going to host the application, and about your requirements, to get a good answer. The MediaWiki software, which Wikipedia is built upon, would be a good choice IMO, if the hardware is a Linux machine (I've got no experience with MediaWiki on windows). --NorwegianBlue talk 20:05, 7 June 2010 (UTC)
- Applications that run on Linux would be good, which I assume MediaWiki is one. What would be a good way of using it for blogging? --173.49.77.55 (talk) 02:53, 8 June 2010 (UTC)
- You would need to learn how to use the Mediawiki markup. The best way of doing that is by browsing around Wikipedia, and see how things are done. A useful feature is transclusion. You would then write your posts as separate articles, and transclude them on the main page, like so: {{:Welcome to my blog}}. Note the colon after the double braces. Without the colon, the Mediawiki software will assume "Welcome to my blog" is in the template namespace, not the main namespace.
- Applications that run on Linux would be good, which I assume MediaWiki is one. What would be a good way of using it for blogging? --173.49.77.55 (talk) 02:53, 8 June 2010 (UTC)
- A slightly more technical addendum: Wikipedia uses a lot of templates. If you want wikipedia templates to work, you'll need to known that one template usually depends on other, more primitive templates, and on css and javascript. If you want a specific template to work, you'll need to copy the template to your site, along with the css/javascript (MediaWiki:Common.css, MediaWiki:Common.js, MediaWiki:Monobook.css or MediaWiki:Vector.css), as well as the more primitive templates. --NorwegianBlue talk 12:14, 8 June 2010 (UTC)
- If you're really looking for "blogging" and "easy" and "free", rather than "collaborative editing" and "hard to set up" and "free", I would recommend something like WordPress over Mediawiki. Mediawiki is powerful stuff, but it's a wiki. Using it as a blog is kind of overkill. WordPress is a blog. It is super easy to set up, and can run on anything that has PHP and MySQL, and very straightforward to blog with and manage (and modify, if you really want to). It's much less of a pain than Mediawiki. --Mr.98 (talk) 13:16, 8 June 2010 (UTC)
- I have no experience with WordPress, but I've experimented a little with Joomla, and have used the MediaWiki software quite a lot the last couple of years, for various projects. You'll need the same basic skills for all three (being able to set up Apache, a MySQL database, and PHP). I've found that it's easy to mess things up irrecoverably in Joomla, while the MediaWiki software is pretty robust. I'd prefer MediaWiki over Joomla for just about any task, but as stated, I haven't tried Wordpress, and the comparison is not really fair, because Joomla too is more than just a blog engine. To me, the MediaWiki software is kinda like emacs, it can be used for anything from toasting bread to writing an encyclopedia. --NorwegianBlue talk 21:56, 9 June 2010 (UTC)
- For a blog specifically, how does one generate the requisite RSS/ATOM syndication feeds using MediaWiki? The standard feeds that MediaWiki generates are change syndication rather than content, and it seems the other syndicated wikipedia content is generated by non-MediaWiki software. Is there a plugin for this? -- Finlay McWalter • Talk 22:14, 9 June 2010 (UTC)
- Not sure, but this appears to confirm that what is transmitted is change (modificaion) of content, not total replacement of content. As for the pros and cons of usig a wiki for blogging, see [2]. --NorwegianBlue talk 23:02, 9 June 2010 (UTC)
- For a blog specifically, how does one generate the requisite RSS/ATOM syndication feeds using MediaWiki? The standard feeds that MediaWiki generates are change syndication rather than content, and it seems the other syndicated wikipedia content is generated by non-MediaWiki software. Is there a plugin for this? -- Finlay McWalter • Talk 22:14, 9 June 2010 (UTC)
- I have no experience with WordPress, but I've experimented a little with Joomla, and have used the MediaWiki software quite a lot the last couple of years, for various projects. You'll need the same basic skills for all three (being able to set up Apache, a MySQL database, and PHP). I've found that it's easy to mess things up irrecoverably in Joomla, while the MediaWiki software is pretty robust. I'd prefer MediaWiki over Joomla for just about any task, but as stated, I haven't tried Wordpress, and the comparison is not really fair, because Joomla too is more than just a blog engine. To me, the MediaWiki software is kinda like emacs, it can be used for anything from toasting bread to writing an encyclopedia. --NorwegianBlue talk 21:56, 9 June 2010 (UTC)
Opening files in reverse alpha order
[edit]I have a list of files to go through and I'd like to have them open in reverse alpha/numeric order. Right now for example, if I highlight five files then 1 opens, 2, and so on. But I want to view 1 first, then 2 and so on, so I need 1 to open last and therefore be in front of the others. Is there a key sequence or setting that will allow this? I'm on a Mac running 10.5. Thanks, Dismas|(talk) 14:29, 6 June 2010 (UTC)
- The easiest way to do it is to change the sort order in the Finder window. For instance, if the files are currently sorted ascending by name, clicking the 'name' column header will change the finder window so that the files are sorted descending by name. Files will be sent to the application in top-to-bottom order as shown in the Finder window, so this will reverse the order of opening. of course, it depends on what application you're using: Preview, for instance, will always open files in alphabetical order. If you have stubborn files, you can always create a quick applescript to open them in any order you like, but I think changing the finder window ordering should do it for you. --Ludwigs2 17:40, 6 June 2010 (UTC)
- Hrm... I normally use column view and to list them in reverse order requires list view. I guess I can switch when I need to and then switch back... Not very elegant but it works. Thanks, Dismas|(talk) 20:49, 6 June 2010 (UTC)
- If you want a script that does it for you, let me know. it's easy to make. --Ludwigs2 18:28, 7 June 2010 (UTC)
Network
[edit]![](http://upload.wikimedia.org/wikipedia/en/thumb/f/fb/Yes_check.svg/20px-Yes_check.svg.png)
I have two standard computers, both modern-ish (WinXP and Win7). I want to connected them so they can share files and between them and both use the internet connection. Is this possible with just an ethernet cable? Or does one need more complicated set up like hubs and routers and special software? 82.43.89.11 (talk) 16:17, 6 June 2010 (UTC)
- Yes, you don't need a hub, or a router, and you don't need a null cable either. You need to enable "internet connection sharing" on the PC that has the internet connection (assuming it's a USB connection) and have the other get its IP address (etc.) via DHCP. If, however, your internet connection comes via an ethernet cable (say from a cable or adsl modem) then you would need a hub or switch (assuming the router doesn't have one already). -- Finlay McWalter • Talk 16:25, 6 June 2010 (UTC)
- Thank you. I'm slightly confused though. The internet does come via an ethernet cable to the first computer. However the first computer has two ethernet ports. Can I still connect the second computer to the first computers 2nd ethernet port, and share the internet? Or will two ethernet ports in use at the same time cause problems? 82.43.89.11 (talk) 16:29, 6 June 2010 (UTC)
- (ec) The standard way to do this is to buy a router. You use one Ethernet cable to connect the router to your cable modem or DSL modem, and then you connect each computer to the router with one Ethernet cable (or via a wireless connection, if it's a wireless router). The router uses a technology called DHCP to give each of your two computers its own IP address, and so they both share the Internet connection. If you don't want to buy a router, you can use one Ethernet cable to connect the DSL modem or cable modem to one PC (I'll call it "A") that has 2 Ethernet ports, and then use a second Ethernet cable to connect "A" to the other PC; and you'll set up "Internet Connection Sharing" on "A". Here is a Microsoft article about Internet Connection Sharing on Windows XP, and here is an article about setting it up on Vista (and Windows 7 should be the same). Comet Tuttle (talk) 16:31, 6 June 2010 (UTC)
- Could I do the same with an XP computer, and one or two Linux computers? Is that possible please? Thanks. 92.24.182.231 (talk) 09:05, 7 June 2010 (UTC)
- Yes. If the XP computer is the one with the 2 Ethernet ports, you would set up Internet Connection Sharing as noted above, and then plug your Linux computer into the second Ethernet port of the XP computer. The XP computer will tell the Linux computer its IP address. This page has some details, or google "share internet connection linux". Comet Tuttle (talk) 18:15, 7 June 2010 (UTC)
- Could I do the same with an XP computer, and one or two Linux computers? Is that possible please? Thanks. 92.24.182.231 (talk) 09:05, 7 June 2010 (UTC)
- (ec) The standard way to do this is to buy a router. You use one Ethernet cable to connect the router to your cable modem or DSL modem, and then you connect each computer to the router with one Ethernet cable (or via a wireless connection, if it's a wireless router). The router uses a technology called DHCP to give each of your two computers its own IP address, and so they both share the Internet connection. If you don't want to buy a router, you can use one Ethernet cable to connect the DSL modem or cable modem to one PC (I'll call it "A") that has 2 Ethernet ports, and then use a second Ethernet cable to connect "A" to the other PC; and you'll set up "Internet Connection Sharing" on "A". Here is a Microsoft article about Internet Connection Sharing on Windows XP, and here is an article about setting it up on Vista (and Windows 7 should be the same). Comet Tuttle (talk) 16:31, 6 June 2010 (UTC)
Thanks 82.43.89.11 (talk) 17:25, 6 June 2010 (UTC)
html -> mht
[edit]![](http://upload.wikimedia.org/wikipedia/en/thumb/f/fb/Yes_check.svg/20px-Yes_check.svg.png)
I need a program that can convert thousands of html files to mhtml, including all images and css and stuff. I've searched everywhere, sourceforge, google code, website after website etc etc and there's absolutely nothing. There's loads of programs for converting mht to html but that's the exact opposite of what I want. Does anyone know any program on any OS (yes, if I have to I'll install a different OS for this) that can do what I want? Hell if someone here could write a program which does this I'd pay you for it. The prospect of continuing to manually open batches of 100 tabs in firefox and save them with unmht (which takes HOURS) is making me want to kill myself 82.43.89.11 (talk) 17:30, 6 June 2010 (UTC)
- And there's nothing in these search results - such as the very first one - that's of any use to you? --Tagishsimon (talk) 17:49, 6 June 2010 (UTC)
- Tried batchwork, doesn't work. I even emailed them over it and they didn't reply. Perhaps I should be more specific in my wording; when I said "there's absolutely nothing" I mean "there's absolutely nothing that works". 82.43.89.11 (talk) 18:22, 6 June 2010 (UTC)
- If you're willing to pay, it's a pretty trivial job to get someone on ELance (or whatever) with Win32 skills to do it (C++, C#, VB), as Microsoft's Collaboration Data Objects IMessage object has an API to do it. For my own amusement, I figured it out in Python - use this as you will:
push show for python code example |
---|
here we gooooooo |
To run this, you'd need python2 (2.6 whatever) and pywin32. It takes two local files (cat1.jpg and cat2.jpg), authors an index.html to refer to them (this is needed as CreateMHTMLBody works by saving a page and its associated content, so you need a page to act as an index to that content). Then it creates fin.mht, an MHTML archive containing that index and both files. # Call IMessage CreateMHTMLBody to author an MHTML file with local content.
# http://msdn.microsoft.com/en-us/library/aa487621%28v=EXCHG.65%29.aspx
# Python code mostly from:
# http://timgolden.me.uk/python/win32_how_do_i/create-an-mhtml-archive.html
import os, sys
from win32com.client.gencache import EnsureDispatch as Dispatch
# sample index page - I'd imagine in practice you'd generate this programmatically
index="""Here are some cats:
<img src="cat1.jpg"/><br/>
<img src="cat2.jpg"/>
"""
f = open("index.html","w")
f.write(index)
f.close()
URL = r"file:index.html"
FILEPATH = r"fin.mht"
message = Dispatch ("CDO.Message")
message.CreateMHTMLBody (URL)
stream = Dispatch (message.GetStream ())
stream.SaveToFile (FILEPATH, 2)
stream.Close ()
|
- I really, really appreciate the effort and thank you so much :) but I don't understand anything about python, so I don't know what to do with this code. How do I use it to convert 2000 html file urls to mht? 82.43.89.11 (talk) 20:10, 6 June 2010 (UTC)
- Not by itself; it's proof of concept that it's a fairly trivial task. The ELance freelancer I'm suggesting you hire could use it as a basis of a program that would. -- Finlay McWalter • Talk 20:20, 6 June 2010 (UTC)
- The Mozilla maf extension that is used to save web pages in the .maff archive format seems to have a pretty capable conversion wizard that even can convert a pile of html pages into mht files (but maybe the .maff format would be the better choice than .mht), see http://maf.mozdev.org/documentation.html#convertingmorepages —Preceding unsigned comment added by 84.157.72.156 (talk) 20:18, 7 June 2010 (UTC)
- Thank you very much 84.157.72.156 for this extremely helpful answer :) I posted a more exuberant thank you earlier that was removed by the fun police, which you can still view here if you want. Again, thanks for this wonderful suggestion, it works perfectly :D 82.43.89.11 (talk) 21:58, 8 June 2010 (UTC)
What's the performance load of inner anonymous classes?
[edit]Hello! When I was learning Java with Sun's/Oracle's Java Tutorials, they recommended using a java.beans.EventHandler as much as possible in place of anonymous inner classes that implement ActionListener, PropertyChangeListener, etc. They explained the reason for this is the java ClassLoader has to load each inner class separately, whereas EventHandler coalesces *Listeners. My question is how much of a performance load do these anonymous inner classes impose? Is it worth junking up my code with hard-to-read EventHandler methods? Does it help if my inner classes are very short? Does it only really matter if I'm using dozens of inner classes? I'm aware of the technique to use a single ActionListener which delegates what code to run depending on the source of the passed Event, but nothing seems as clean to me as anonymous inner classes. Thank you!--el Aprel (facta-facienda) 18:03, 6 June 2010 (UTC)
- For sane human-written code, I doubt it's worth worrying about. Anonymous inner classes are just inner classes (from the jvm's perspective), and inner classes are mostly just classes. Each class loaded does take some time and some memory (regardless of how small they are) and if you have lots that's starting to be a burden. It's probably not ideal from a memory-locality perspective either, as each little handler is off in its own little line. But, at least on a full (SE,EE) grade JVM, for code you've written yourself, I'd doubt even dozens of such hand-written mini-handlers will make an appreciable difference. When talking about this in Swing, they take a fairly balanced view; if it were me I'd group handlers logically (personally I don't find the little AIC handler method terribly clean, but your mileage may differ) and worry if this is causing a genuine performance problem only if it is. I think really Soracle are writing to another audience - the (often quite mad) people who write tools that automatically generate Java code. Left to their own devices, they'd happily create 50,000 objects of 50,000 different classes and not worry about the heinous abuse they'd do to memory, and particularly the cache, in the process. -- Finlay McWalter • Talk 19:15, 6 June 2010 (UTC)
- Thank you, Finlay McWalter! Your response was very informative and helpful.--el Aprel (facta-facienda) 04:28, 7 June 2010 (UTC)
- I should stress that the above is really not true for a small-factor JVM (like CLDC) where memory is much more constrained and CPU cache is pitiful, where you really would expect to see a demonstrable harm from generating a few dozen extra classes than strictly necessary. It seems to be moot on Java Card, however - as far as I can tell, it handles what little "events" it has in a different way altogether. -- Finlay McWalter • Talk 15:40, 7 June 2010 (UTC)
Installable content management system for CentOS
[edit]Hello - long time listener, first time caller, so to speak!
I have a small web design company, let's say "www.mywebdesignco.com", that creates websites for clients. I have a virtual private server running CentOS 5.5, on which I host my clients' sites.
When clients want changes, they give me a call, I make the change and upload the changed pages to their site - it doesn't take too long, but I've been looking into pushing the burden back on them, as it were, by installing some sort of content management system.
There are some online options, such as PageLime and Cushy, which would allow me to do this for free, but unless I pay a subscription the facilities are (a) limited in number, and (b) branded with the CMS system, rather than my company's branding.
Given that I have a large server sitting there with loads of space, I've been trying to look into installable solutions so that I could create a sub-domain, say cms.mywebdesignco.com, at which I could install a CMS - I could then give clients their own login, they could log on, it would all be branded with my company's branding, they could make the changes to the relevant bits of their websites, and I don't need to worry about them.
The thing is, I'm great at designing and programming websites, but for some reason when it comes to Linux installations, et al, I go a bit blank - I run Virtualmin, so can handle the administration of my clients' domains, email and websites without too much difficulty, but the easier the better is my watchword when it comes to installing new applications onto my VPS.
So, I guess my question is whether there's such a solution, ideally free or open source, out there?
Thank you for taking the time to read through my question!
—Preceding unsigned comment added by Bobby P Chambers (talk • contribs) 20:16, 6 June 2010 (UTC)
Sorry Bobby P Chambers (talk) 20:19, 6 June 2010 (UTC)
- A lot of people use things like Drupal or Django-cms for this kind of thing (we have a lengthy, if perhaps unhelpful, list at List of content management systems). Half-decent ones let you assign roles and permissions (so the customer can change "news" stories and add articles, but can't mangle their page layouts or delete their databases). Unfortunately with great power comes a great big manual, so setting these up can be quite an undertaking. -- Finlay McWalter • Talk 20:27, 6 June 2010 (UTC)