Jump to content

Wikipedia:Reference desk/Archives/Computing/2007 February 9

From Wikipedia, the free encyclopedia
Computing desk
< February 8 << Jan | February | Mar >> February 10 >
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.


February 9

[edit]

MySQL Query for Returning Most Played Songs

[edit]

I am writing a system which shows users' recently played songs. When a user listens to a song, details of this song are sent to my website which then inserts the artist, song, time and username into a MySQL database table. What I want to do, however, is show the 10 most listened to songs in addition to the most recent songs. I've got the most recent songs query working absolutely fine but I am facing problems with getting a list of the most played songs.

The table schema is as follows:

listenid - int(10) unsigned auto-increment key (the key row)
artist - varchar(255) (the name of the song's artist)
song - varchar(255) (the song name)
fulltext - char(64) (the artist and song name concatenated and run through MD5 cyphering - I thought this would help for counting rows since only one column needs counting as opposed to two, which I don't think is supported)
time - int(10) unsigned (the UNIX timestamp for the time when the song was submitted to the site)

Basically, I need a list of the number of rows with matching song name and artist, ordered descending. I tried using the following to no avail:

SELECT artist, song, COUNT(fulltext) AS times
FROM nowplaying
GROUP BY fulltext
LIMIT 10

That query returns an error message saying there is a problem with the syntax near 'fulltext)'. Any ideas? RevenDS 01:35, 9 February 2007 (UTC)[reply]

See if this works:

SELECT MIN(artist), MIN(song), COUNT(fulltext) AS times
FROM nowplaying
GROUP BY fulltext
LIMIT 10

EncMstr 01:43, 9 February 2007 (UTC)[reply]

Fulltext is probably a MySQL keyword, escape that field name with quotes or backticks or whatever MySQL uses for escaping fields. The MIN() and MAX() functions shouldn't be used on character types, either. What's more, this design won't scale well at all because of the aggregate function on a character field. However, if you don't plan to have a few million rows in this table it should work okay. From what I can see, there's no need for the fulltext field anyway; you can group aggregate functions by multiple fields:
SELECT artist,song,COUNT(*) times
    FROM nowplaying
    GROUP BY artist,song
    ORDER BY times DESC
    LIMIT 10
-- mattb @ 2007-02-09T03:26Z
I believe you hit on the optimal solution just before I did. Nice work! —EncMstr 03:59, 9 February 2007 (UTC)[reply]
Unless I'm mistaken, the original syntax error that User:RevenDS mentioned—"problem with the syntax near 'fulltext)'"—was because the field was renamed to "times" using AS times, and so GROUP BY should refer to the same name, i.e. GROUP BY times instead of GROUP BY fulltext. If AS times was omitted, you should use GROUP BY COUNT(fulltext). Feel free to correct if I'm wrong. —XhantarTalk 07:26, 9 February 2007 (UTC)[reply]
I can see why you might consider that, but group by count(*) wouldn't give a useful result. Group by doesn't have to reference a field which appears in the select_list. COUNT(*) AS times creates a new variable, so to speak. I had trouble escaping fulltext to prevent MySQL from using it as a keyword: and that's what the errors I got seemed to be pointing to. —EncMstr 07:40, 9 February 2007 (UTC)[reply]
You're mistaken, I'm afraid. The syntax error is because fulltext is a MySQL keyword. -- mattb @ 2007-02-09T07:38Z
Thanks a lot, mattb, your SQL did the trick. I did not realise you could use GROUP BY on multiple fields. For clarity, I was refering to this; this is the SQL that will successfully retrieve a list of the most-mentioned artist/song combination:
SELECT artist, song, COUNT(*) AS times
FROM nowplaying
GROUP BY artist, song
ORDER BY times DESC
LIMIT 10
Thanks again. RevenDS 19:54, 10 February 2007 (UTC)[reply]

RAID 1/0 Setup

[edit]

I have two SATA 160 GB drives that I would like to arrange such that there are three small RAID 0 partitions for WinXP, OpenSUSE and Ubuntu and a large RAID 1 partition(s) for important data. Is it possible to have the same drives set up like this? Is it complicated? --Seans Potato Business 06:11, 9 February 2007 (UTC)[reply]

I believe it is possible, yes, though the instructions I lack. Splintercellguy 16:22, 9 February 2007 (UTC)[reply]
You want to triple-boot into two kinds of Linux and one kind of Windows, using RAID for all three of your boot partitions? If you're using hardware RAID, I doubt you can create RAID sets at the partition (rather than drive) level. Linux has its own software RAID, but Windows won't work with that. I think you'd have to change your parameters at least a bit. For instance, you could get an additional smaller drive, run your triple-boot system off of that, and run your (hardware) RAID 1 partition across the two 160GB disks. If you'd asked about booting various types of Linux off of that setup, I'd say it's likely possible, but if you're going to be booting Windows as well, you'd need a kind of RAID support that Windows doesn't have. I'm going to lean toward "no" for the answer, absent some kind of magical cross-platform partition-level RAID tool. grendel|khan 18:52, 9 February 2007 (UTC)[reply]
Clearly, I posted too soon. See Non-standard RAID levels#Matrix RAID; you can get one RAID-0'd block device and one RAID-1'd block device out of your two drives. Install your operating systems on the RAID-0'd "drive" (good luck with the triple-booting thing) and the rest on the RAID-1'd one. grendel|khan 18:56, 9 February 2007 (UTC)[reply]
Doesn't that need a driver in Windows? If it needs a driver in Windows that means it's still a soft RAID and thus might not be supported in Linux. --antilivedT | C | G 07:01, 10 February 2007 (UTC)[reply]
Since I'm using an AMD motherboard and certainly don't want to have to change it, should I just forget the whole thing? --Seans Potato Business 15:19, 10 February 2007 (UTC)[reply]

Designing my website

[edit]

Is there freeware for website design, best if it is WYSIWYG (probably) ... that I can use to design, test, and demonstrate my website without actually publishing it to the web on a server? My 'site', I suppose, would be a file that could be viewed by my browser (or I can send the file to someone else who could view it on their browser...), as though I were online, but without actually being online where my incomplete or confidential information might be accessed. (...hate sounding like such a rookie, but you go to war with the army you have, so to speak...)

WYSIWYG is somewhat counterproductive for actually learning these things. If you're dead set on it anyways, there's three free software editors that I can find: Nvu, Mozilla Composer, and Amaya. Web browsers can view saved HTML/XHTML/CSS/etc. files the same as though they were uploaded to a webhost, so there will be no problems for you there. -- Consumed Crustacean (talk) 17:33, 9 February 2007 (UTC)[reply]
Browsers can render SGML and derivatives whether it's local or being sent from a server. Also, your site will definately be more than one file (and much more if you use a WYSIWYG editor that insists on exporting everything to common files) --frothT 18:18, 9 February 2007 (UTC)[reply]
As far as "as though I were online", you might want to actually run a web server on your own computer temporarily. If you're just making static HTML pages, it doesn't make any difference, but if you have any dynamic content beyond Javascript or so you'll need the server to run them. You can prevent outside users from connecting to this server if you like, although even without such precautions it's relatively unlikely that someone would find it without being told about it (and with many common home network setups it's impossible without your help). --Tardis 20:11, 9 February 2007 (UTC)[reply]

Signing X.509 certificates with OpenPGP keys.

[edit]

I have an X.509 certificate which is being used on our local mail server. I want to sign this certificate with my OpenPGP key so that someone who trusts me trusts me will trust the server. I have an inkling that this is possible (we're using Enigmail with Mozilla Thunderbird), but I have no idea how to go about it. Is it worth doing? Is it possible? I fetched the cert with openssl s_client -connect myserver:993, and I have it in ASCII armored format. I'm using GPG to manage my OpenPGP keys. grendel|khan 16:47, 9 February 2007 (UTC)[reply]

Where can I find a FREE program that tapes/records streaming media and converts to mp3?

[edit]

Where can I find a FREE program that tapes/records streaming media and converts to mp3? Im ooking for a free program that can record streaming, realmedia, online radio, youtube sound and music and convert them into mp3 files. The best I found so far was audacity although I came across a demo of a very goo dproduct that recorded just the song and not the background sounds on the computer. It even blacked out lags in the sound.--Jacobin1949 17:43, 9 February 2007 (UTC)[reply]

Streamripper can record MP3 or OGG/Vorbis streams, mainly Shoutcast streams (such as those one Shoutcast.com). Unplug or the videodownloader website can download Youtube/etc. videos; they can be converted to some other format with SUPER. Not sure about real audio or windows media audio; doing it manually with Audacity may be the only choice. -- Consumed Crustacean (talk) 17:53, 9 February 2007 (UTC)[reply]
Try Audacity [1]. It can record, edit and save mp3 and ogg/vorbis files. 84.250.227.44 19:08, 9 February 2007 (UTC)[reply]
With Screamer Radio, you can record the streaming content. Anchoress 20:13, 9 February 2007 (UTC)[reply]

Adobe/Macromedia apps

[edit]

GAH! This is terrible. Somebody on the computer let one of the Adobe or Macromedia apps use the internet, and they all disabled themselves. What do I delete so that either I can use it, reinstall, or something? For some reason Distiller and Acrobat Pro 6 have not been affected. If that cannot be helped, I need a program to convert three flash documents I created into movies. .fla into .swf Thanks for any help! [Mαc Δαvιs] X (How's my driving?)18:51, 9 February 2007 (UTC)[reply]

Uhh, they were warez'd and were disabled by the product activation? Get a new crack? Or is something else occurring? -- Consumed Crustacean (talk) 19:15, 9 February 2007 (UTC)[reply]
Yes! They were. Eek. [Mαc Δαvιs] X (How's my driving?)20:03, 9 February 2007 (UTC)[reply]
Suggest attempting to delete the preferences and repeat the installation. 68.39.174.238 15:40, 10 February 2007 (UTC)[reply]
Did that! I am pretty sure I deleted all the preferences and it won't let me reinstall. I also deleted registration files (I didn't register), and probed Application Support. [Mαc Δαvιs] X (How's my driving?)22:39, 10 February 2007 (UTC)[reply]

Registering a Domain Name

[edit]

I want to register a domain name for my first website. What is the best registry? Ie, which website registry offers the most trustworthy service for the least money. Ideas? Many thanks.

The "best" depends on your needs. However, I do agree with the List_of_top_ranking_domain_registrars if that can help :) → Icez {talk | contrib} 20:01, 9 February 2007 (UTC)[reply]
Network Solutions --frothT 22:54, 9 February 2007 (UTC)[reply]
I agree with Froth. I currently host 306 domain names for clients (I used to host a lot more before I "quit" the hosting business). I've never had a client have trouble with Network Solutions. I've had six instances of a client losing an unexpired domain name through GoDaddy because some punk tricked their system into allowing them to take over ownership. Then, to get ownership back, you have to pay GoDaddy well over $500 to "investigate". The punks know this, so they only charge $450 to give the domain name back. I also had a client lost all of his domain names when the "free domain name" company he went with went out of business. He just quit instead of trying to get them back. --Kainaw (talk) 20:26, 10 February 2007 (UTC)[reply]

Connecting two computers in a network

[edit]

Hello, I have connected my laptop and the home PC in a network, I have done the necessary configuration so that I can access shared drive of both the laptop and the PC. But the problem is that I can't access the shared drive of the PC from my laptop, it displays the following message " (PC name) is not accessible, you might not have permission to use this network resource. Contact the administrator of the server to find out if you have access permissions", Any idea why is this happening? Note: I am able to access the shared drive of my laptop from the PC. Many thanks.

Is your firewall setup to allow the incoming connection? By the way, I'm assuming you're using windows xp on both machines. - Akamad 21:43, 9 February 2007 (UTC)[reply]
I'm thinking the machines are on the same network. I think it's the result of some group policy or whatever barring the ability to open shares without passworded account authentication. Splintercellguy 00:51, 10 February 2007 (UTC)[reply]


They are on the same network, and yah I am running windows xp on both sides. I am able to view all other things on the PC from the laptop such as shared printers and faxes, but only the shared folder of the PC cannot be accessed.

I don't know what the problem is sp I did a google search on the error message you are getting. Have a look at the results, hopefully they will help: [2]. - Akamad 12:24, 13 February 2007 (UTC)[reply]

Reassociating .JAR files

[edit]

I know .JAR files can be launched from the command line (java -jar file), but how do I reassociate them with Windows to open on a double click? I recently upgraded my JRE/JDK to version six, however removing version five of the JRE/JDK apparently broke the file association. Any assistance would be much appreciated. Kyra~(talk) 22:42, 9 February 2007 (UTC)[reply]

Open an explorer window, go to Tools -> Folder Options -> File Types, find .JAR, and edit to your content. --Wirbelwindヴィルヴェルヴィント (talk) 00:18, 10 February 2007 (UTC)[reply]

Wifi connection in Win XP MCE 2002 SP2

[edit]

Hi folks,

I'm having some trouble setting up a wireless network adapter in a PC running Windows XP Media Centre Edition 2002 with Service Pack 2 (*gasp for breath* longest OS name ever!).. after faffing around for a while and having no joy getting it to recognise the card at all, it occurred to me to wonder - does MCE2k2 actually even support wireless networking? I can't seem to find a straight answer on that anywhere, but unlike newer versions of XP, when I go into the network connections panel, there are no references to wireless networks at all. It DOES have the 'Wireless Network Setup Wizard' in control panel, but I don't want to create a new network, just connect to an existing one. Normally what I'd do is (assuming the card was correctly installed) go into Control Panel/Network Connections/Wireless Network Connection, and work from there.. but.. there appears to be no such thing in this version of XP. Am I just nailing jelly to a wall here?

Any advice welcome, thanks! --Cryptess 22:55, 9 February 2007 (UTC)[reply]

Yes, as a former WinXP MCE user, I can confirm it does support wireless networks. Is it possible it doesn't recognise your wireless network adapter? To check this, go into device manager (can't remember ho you get there, and no longer have windows on my PC) and see if its there - if it is, see if there's a red "x" against it. Cheers, Davidprior 01:33, 10 February 2007 (UTC)[reply]
I'm starting to suspect that the card is defective. Device manager doesn't recognise it - merely shows it as an unknown ethernet device. Neither the supplied drivers, nor the latest version from the website helped.. I've emailed the company's tech support for more info, but it's good to know that at least it's probably not the OS at fault. I'm aware that XPMCE2005 supports wireless, but wasn't so sure about 2002. Cheers :) --Cryptess 01:41, 10 February 2007 (UTC)[reply]

Outlook Question

[edit]

In Outlook 2003, how do you re-send/receive to receive old emails that were alreaded deleted in the program.

Assuming that Outlook is connecting to a POP3 account, and its set to delete messages after it has retrieved them, its not possible. If this isn't the case, can we please have some more details. Cheers, Davidprior 01:26, 10 February 2007 (UTC)[reply]
If you are connected to an Exchange server, talk to your Exchange admin. Deleted message are actually stored on the Exchange server for a certain number of days (configured by the admin) before being permanently deleted. --Robertstinnett 16:05, 10 February 2007 (UTC)[reply]
How do you get RE-send and receive messages; so that would be dulicate messages? 68.193.147.179 01:34, 10 February 2007 (UTC)[reply]
Three-part answer:
  • You'll be able to resend it if it is still in your sent box - there may be a "proper" way to do so, but I don't know how, what I don know is that you could simply forward them from there (deleting anything which indicates a forward).
  • If you've deleted them but not compacted your personal folders, there may be some way t do this, but its beyond me - perhaps someone else can advise...
  • If you've deleted them, and compacted your personal folders, I cannot see any way to do this, short of proffesional (expensive) data recovery.
Hope this is of some help, Davidprior 02:18, 10 February 2007 (UTC)[reply]

Outlook Question 2

[edit]

How can I make outlook automatically send and recevice messages when I am not on outlook or when my computer is off? 68.193.147.179 00:28, 10 February 2007 (UTC)[reply]

  • When your PC is off, there's not much it can do, including sending or receiving e-mails :-) In seriousness, you may have a device that uses less electricity than your PC, but can check your mail acct(s) and beep (or similar) if you have a message waiting - I think some routers can do this (some versions of the Linksys WRT54G series could certainly be made to do so). I believe some ISPs can even send you a txt message if you have an e-mail waiting
  • If your PC is on, but Outlook is not open, I'm not 100% sure, there are definitely programs that can check for email (assuming your provider uses a common protocol such as POP3 or IMAP) and alert you if a message is waiting - there may even be applications that can retrieve these messages and add them to the .pst file in which Outlook stores messages - however, given the proprietary nature of this file format, I'd guess this is unlikely
Cheers, Davidprior 01:42, 10 February 2007 (UTC)[reply]
Are you using Outlook on a home computer or an office network? Anchoress 02:06, 10 February 2007 (UTC)[reply]
a home computer