Wikipedia:Reference desk/Archives/Computing/2009 August 11

Computing desk
< August 10 << Jul | August | Sep >> August 12 >
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.


August 11

edit

Quick ASP Question

edit

Hi,

I was just wondering why this code keeps failing:

<%
dim conn, db
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
db = Server.MapPath("myDB.mdb")
conn.Open db
conn.Close
set conn = nothing
%>

The MDB file is in the same directory, and I didn't set any password on it. The error my host is providing is not very helpful, just a generic HTTP 500 - Internal server error. Any thoughts? Thanks in Advance PrinzPH (talk) 03:39, 11 August 2009 (UTC)[reply]

I don't know a lot about ASP (though it looks a lot like VB), considering you're getting the internal server error, it might be good to check and see if other things are broken. This looks like it might be a configuration problem on the server or database, rather than a code error. Just a thought. --Kraftlos (Talk | Contrib) 11:29, 11 August 2009 (UTC)[reply]
Yes, HTTP 500 could be anything. Check permissions of all of the files, check the encoding of the page. HTTP 500 is the most unpleasant of all the HTTP messages, in my opinion, because of the wide, wide range of things it could be. --98.217.14.211 (talk) 13:59, 11 August 2009 (UTC)[reply]


First (assuming you're using IE) check you haven't got "Friendly HTTP error messages" checked in Tools/Options/Advanced. This often hides useful information from the server. Second, try adding some error checking to your code - something like this (untested) may give more clues (I'm guessing the conn.open is causing the error - if not you'd need to check other statements in the same way:
<%
dim conn, db
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
db = Server.MapPath("myDB.mdb")
on error resume next 
conn.Open db
if err <> 0 then
 Response.write "Error opening connection: " & Err.Description
 Response.end
end if
on error goto 0 ' reset error handling
conn.Close
set conn = nothing
%>
AndrewWTaylor (talk) 15:00, 11 August 2009 (UTC)[reply]
  Resolved
Thanks a heap Andrew! This definitely pointed me in the right direction. I got an actual description of the error: Error opening connection: "Provider cannot be found. It may not be properly installed.". So I guess I'll have to take it up against our provider. Thanks again! PrinzPH (talk) 17:12, 11 August 2009 (UTC)[reply]
Do be aware that the "provider" is the provider of your data - in this case the mdb file. The error is telling you it can't open the file for one reason or another. --Phil Holmes (talk) 14:34, 13 August 2009 (UTC)[reply]
Glad to help! Another idea you might try is to use a connection string to open the connection - see here for examples of the syntax for Access. The code would then read (e.g.)
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=;"
AndrewWTaylor (talk) 17:48, 11 August 2009 (UTC)[reply]

Wordpress

edit

How much maximum space (how much MB or GB) does Wordpress allow in a free personal blog? --InternetTraveller (talk) 10:56, 11 August 2009 (UTC)[reply]

"You’ll get your own WordPress.com address (like you.wordpress.com), a selection of great free and customizable designs for your blog (we call them themes), 3 gigabytes of file storage (that’s about 2,500 pictures!) and all the other great features listed here. " - Features You'll Love. APL (talk) 12:53, 11 August 2009 (UTC)[reply]

Thank you. Please tell me one more thing. How do I know how much space (i.e. how much KB or MB) is used in a post? For example is there any tool by which I can measure the size of an article or a paragraph (KB or MB) posted in the blog? --InternetTraveller (talk) 13:34, 11 August 2009 (UTC)[reply]
The text is almost nothing at all. One printed page of text, by itself, is less than 2KB even with formatting. Images are what take up the real space. --98.217.14.211 (talk) 13:57, 11 August 2009 (UTC)[reply]
Thanks. Three final queries. How many personal blogs can I create in Wordpress? Can I moderate the comments made by visitors in my Wordpress blog? Who will be the owner of the copyright of what is written in my blog - me or Wordpress? InternetTraveller (talk) 14:54, 11 August 2009 (UTC)[reply]
1. There is nothing in their terms of service that says you can't make an arbitrary number of them. 2. Yes, of course. Wordpress (the software) has quite sophisticated moderation capabilities. 3. You own it though you grant the company a license to use it for displaying and promoting your blog. --98.217.14.211 (talk) 16:10, 11 August 2009 (UTC)[reply]

Linked accounts

edit

Some major websites have been offering a feature that links one account with another. So that now if I sign into my Gmail account, I can also be logged into Youtube and Facebook. How does this work? Does Facebook read the cookies of Gmail to check if I'm signed in? Or maybe it checks with the Gmail server?

And also, is a security issue for people who are paranoid about getting hacked everyday? --Yanwen (talk) 12:55, 11 August 2009 (UTC)[reply]

See OpenID. -- Coneslayer (talk) 13:46, 11 August 2009 (UTC)[reply]
There are ways to make such an authentication system crypotgraphically secure, such as kerberos (protocol). Kerberos works by granting an authorization ticket from a canonical server; other servers who want to verify your identity use public-key cryptography. No password is ever transmitted over the network; if a malicious third-party server wishes to obtain your authorization, it will not be able to decrypt your transactions with it. However, both OpenID and Kerberos requires a centralized administrator; for Kerberos, I trust my university IT people; but I am not sure I trust the guys at Facebook (or in general, anyone who is outside of my organization). This trusted third-party is a required element of the protocol - to determine which servers have the right to request authorization; I am not convinced that OpenID's method of "trusting Facebook and Google" is actually a sound security choice. By the very nature that it is intended to work across organizational boundaries, I don't see how it could even be possible to guarantee a reasonable level of trust in the providers. This seems like biggest conceptual limitation of OpenID. Overall, though, I am not convinced that OpenID is as secure as they claim it to be - and I'm still confused why I would want to access my financial institution and my email with the same login authorization. It certainly qualifies as a single point of failure, if compromised; this is inherently a security risk. Nimur (talk) 15:52, 11 August 2009 (UTC)[reply]

Numeric keyboard not working over SSH

edit

I'm logging into a Linux machine from a Windows machine using SSH with PuTTY. When I use e.g less or vim, pressing any key on the numeric keyboard produces some kind of operation codes enclosed in angle brackets. No such problem exists when I use the numeric keyboard on the command line, in the same SSH session. Can anyone help me diagnose the problem? 193.40.37.168 (talk) 13:06, 11 August 2009 (UTC)[reply]

Try choosing "Change settings" from the PuTTY system menu, going to the "Keyboard" panel (under "Terminal") and choosing something different under "The Function keys and keypad". "Linux" might be a good bet. If that doesn't work look at the output of echo $TERM to see what Linux thinks the terminal type is. -- BenRG (talk) 14:16, 11 August 2009 (UTC)[reply]
You can do that by echoing:
echo $TERM
as BenRG suggested. Nimur (talk) 20:07, 11 August 2009 (UTC)[reply]
Ctrl-NumLock often helps. --grawity 10:28, 13 August 2009 (UTC)[reply]

Thanks everyone. I tried setting "the function keys and keypad" from the default "ESC[n~" to "Linux" and "Xterm R6". ($TERM is "xterm"). However. nothing ever changes, the numeric keys always generate ESCoq, ESCor, ESCos etc.

Ctrl-NumLock helps though, but I have to press it again each time I restart vim. What does this do exactly? 193.40.5.245 (talk) 11:14, 13 August 2009 (UTC) (the original poster)[reply]

Implementing a priority queue

edit

The article about priority queues gives two possible implementations:

  • Insert items as normal. When removing items, search through the entire queue to find the one with the highest priority.
  • When inserting items, search through the entire queue to find a correct place for them. Remove items as normal.

Isn't there an entirely different way of implementing them, as follows? Assuming priorities are discrete and there is a finite number of them, don't even bother putting everything in the same queue. Instead, maintain a separate queue for each priority. When inserting, insert the item to its correct queue. When removing, find the non-empty queue with the highest priority and remove an item from it. Would this work? JIP | Talk 19:18, 11 August 2009 (UTC)[reply]

Sure, that works, but may not be a good idea in practice. It's inefficient (in both time and space) if the number of priorities is more than a few, as you have to pay for (storage, search time) the queue even if it has 1 (or, depending on your implementation, 0) elements in it. I've certainly seen implementations of things where there is a high-priority and a low-priority queue. -- Finlay McWalterTalk 19:26, 11 August 2009 (UTC)[reply]
Basically, you have a hash table where the index is the priority and each index is either null or has an item. You still have the problem of finding the highest index in the hash table that is not null. You have to search through all the indexes until you find one. Even if you keep a separate variable of the "highest not null", that is only useful until you pull that item. Then, you have to search for the next highest not null. The result is a lot of space used without solving the "search through the items" problem. -- kainaw 19:42, 11 August 2009 (UTC)[reply]

Actually what you've described is in the article Priority_queue#Usual_implementation and the section after that (sort of). What you're describing is a heap with n (the number of priorities) nodes at the first branch (that's a slight misrepresentation of a heap - it's more a tree - but who cares?) But yes it would work. I've no real experience of priority queues myself - but the idea is general - if you had many priority levels it's obviously a good idea. I'd imagine having a set of n pointers to the beginning of n lists. No reason not to do it if it's sensible in a given case.83.100.250.79 (talk) 20:39, 11 August 2009 (UTC)[reply]

The usual implementation of priority queues is using a heap implemented in an array, as when doing heapsort — which does not involve any kind of searching for the item with the highest priority. David.Monniaux (talk) 10:33, 12 August 2009 (UTC)[reply]

Cut/coped text not appearing in MS Word Clipboard

edit

Not sure what version I have - it's maybe a couple years old - but I'm suddenly unable to cut and paste. When I cut, the text in a document disappears, but it doesn't go to the clipboard.

I did have a large (over 2 MB) document open recently, but I hadn't copied it. In fact, there is nothing in the clipboard, so it's not at the limit of 24, or at the size limit. I did try copying a page or so from it and it wouldn't do it. (It was as a .txt file, I'm trying right now in .doc files.)

I tried restarting the computer, I could copy from a test page after that, then tried again after opening that large .doc file but couldn't, once again.

Any ideas? Thanks.209.244.30.221 (talk) 19:20, 11 August 2009 (UTC)[reply]

Thanks, I figured it out; my text file had something incompatible with MS Word, it seems; when I told the computer to save it int he latest version of MS Word I have, the problem was solved. (Y'all are so good, you've got ESP, I guess :-) Wait, no, I'd be the one with that 209.244.30.221 (talk) 19:56, 11 August 2009 (UTC)[reply]

Search Engines

edit

Is there a way of finding out which internet searches achieve few results and how many times the search criteria are used? 90.198.147.123 (talk) 20:17, 11 August 2009 (UTC)[reply]

I'm not sure - but there is a 'game' called Googlewhack which people play (popularised by Dave Gorman who did a - brilliant - comedy tour on the subject). Basically a googlewhack is where you input 2 words into a search (no speech marks and must be underlined in the google result as being in the dictionary) and are returned only 1 result. There are some side-rules too, but basically the idea is to put 2 unusual largely unrelated words together to find one. E.g. (off the top of my head) a search for scrupulous aloe returned 8,510 results - a terrible effort. ny156uk (talk) 22:11, 11 August 2009 (UTC)[reply]

I got 2,190 for "turbulent orangutan" (no speech marks). Not great, but first effort lol. Back to the point, does anyone know the answer to my question? 90.198.147.123 (talk) 22:42, 11 August 2009 (UTC)[reply]

1,050 for sexy tobogganist lol 90.198.147.123 (talk) 22:44, 11 August 2009 (UTC)[reply]

Also, if you want to pitch one Google result against another, try Googlefight. Fribbler (talk) 00:01, 12 August 2009 (UTC)[reply]
chromodynamic antidisestablishmentarianism...55. If you tell Google not return hits for "chromodynamics" and only for "chromodynamic", you get just two hits...I don't know whether that's legal. Tough game! SteveBaker (talk) 01:57, 12 August 2009 (UTC)[reply]
So to answer the OPs original question, there is no way besides just guessing. As for how many times the terms are searched, I don't think Google Trends would have any data on searches that obscure, since that is only useful for comparing searches like 'star wars' and 'lord of the rings'. —Akrabbimtalk 12:20, 12 August 2009 (UTC)[reply]

Deleting History

edit

How do I delete my browse history and my address bar history(WindowsXP Professional)? Thanks —Preceding unsigned comment added by 87.116.161.170 (talk) 23:55, 11 August 2009 (UTC)[reply]

Your browser is more important, which one? Fribbler (talk) 23:59, 11 August 2009 (UTC)[reply]

Internet Explorer —Preceding unsigned comment added by 87.116.161.170 (talk) 00:04, 12 August 2009 (UTC)[reply]

Tools, Internet Options, General, "Clear History" button Sandman30s (talk) 11:00, 12 August 2009 (UTC)[reply]
Actually, I recently was told to download Internet Explorer 8, which I did. For me, "delete browsing history" is under "Safety", which is to the left of "Tools".Vchimpanzee · talk · contributions · 14:25, 12 August 2009 (UTC)[reply]