Page 13 of 43
Re: Programming, computers, etc. [Serious]
Posted: Sun Apr 08, 2012 3:55 pm
by Anonymously Famous
If you're running it from Idle, that could be the problem, as that's happened to me even with Python 2.7. Try running it just through Python by double clicking it or through the command line.
Re: Programming, computers, etc. [Serious]
Posted: Sun Apr 08, 2012 7:03 pm
by atomtengeralattjaro
I am working on a program that uses the Last.fm API to get the artists I haven't listened to for a certain amount of time. They do have a similar feature built-in on the site, but that doesn't work as needed, because it doesn't allow setting the time period, so it also outputs artists that I have just listened to several weeks ago.
I'll probably publish the results, although I doubt any of you uses last.fm
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 09, 2012 12:26 am
by Anonymously Famous
I have a friend who does, who also programs, so it might be useful to him.
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 09, 2012 1:04 pm
by atomtengeralattjaro
well it turns out it's gonna be messy, the provided API functions don't make it easy.. I'm still looking for the best solution, because what I currently have works by sending a web request for every single artist in the user's library.. which can take ages.
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 09, 2012 2:41 pm
by Anonymously Famous
That would make things difficult. Do you have a link to the last.fm api? Maybe I can take a look. Who knows? Sometimes an extra set of eyes can make a big difference.
Edit: Is it easier to get the artists that a user has listened to recently? Could you get that list, then ask for a list that doesn't contain those artists?
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 09, 2012 5:45 pm
by atomtengeralattjaro
Thanks, in the meantime I've already figured it out.
Indeed, the user.getRecentTracks service works best. It's still not very fast, but bearable.
At first I didn't even consider it because for some reason I thought it only gave the most recent songs, but it turns out it responds with the info for every single song.
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 09, 2012 10:12 pm
by Anonymously Famous
So, I learned today, because I was curious, that you can use .Net code in VBScript (with CreateObject and some modifications). Now, I don't know why you'd want to, but you can.
Now I have a strange urge to see how far I can take this.
Now, I can just make a VB.net application, but it would be kind of fun to use .Net in an area where it wasn't really intended to go.
Re: Programming, computers, etc. [Serious]
Posted: Wed Apr 11, 2012 4:30 pm
by Dreams
Have fun! I have never learned much VB because I've seen the things that can happen if you do risky scripts.
Re: Programming, computers, etc. [Serious]
Posted: Wed Apr 11, 2012 7:22 pm
by Anonymously Famous
You start small, and only use other people's scripts as examples. Don't run them until you're 100% sure of what they'll do.
Re: Programming, computers, etc. [Serious]
Posted: Thu Apr 12, 2012 11:10 am
by atomtengeralattjaro
here is teh lame last.fm thingy:
http://lastfmreminder.atw.hu/
i should add a feature to filter the output to only show artists that have at least several plays in my library.. and i could get all sorts of info about each, even pictures, but i'm lazy.
Re: Programming, computers, etc. [Serious]
Posted: Thu Apr 12, 2012 1:40 pm
by Anonymously Famous
I've seen those three funny characters before. I checked the HTML file with a hex editor to be sure.
They're the UTF-8
byte order mark, and they're showing up because the page is trying to show up in the Central European (ISO-8859-2) encoding instead of the Unicode (UTF-8) encoding. Adding the following line in the head should fix it:
Code: Select all
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
Also, yesterday I did some Python research, and found out that there are libraries that will let me do some pretty cool stuff. They'll allow me to apply even more functional programming concepts that I learned while studying Haskell. Python already has some functional programming, but the standard modules allow for even more.

Re: Programming, computers, etc. [Serious]
Posted: Thu Apr 12, 2012 2:12 pm
by qwertzuiop
Has anybody started using WinRT? Seems nice so far to me, but when I try to get route information (from Bing services) the WebResponse has a ContentLength of -1 (although it's quite full). Anybody have an idea why this could be?
Re: Programming, computers, etc. [Serious]
Posted: Thu Apr 12, 2012 2:31 pm
by atomtengeralattjaro
@AF: I added that line, and it's still showing up..

@qwertzuiop: i haven't tried WinRT yet, but I should.
Re: Programming, computers, etc. [Serious]
Posted: Thu Apr 12, 2012 2:54 pm
by Anonymously Famous
Ok, new plan:
- Get rid of that line.
- Get a hex editor like this one.
- Delete the first three bytes from the file.
Alternate plan:
- Open the file in an advanced text editor, such as Notepad++.
- Get rid of the meta line.
- Save as ANSI or UTF-8 without BOM (In Notepad++, you can change the encoding in the "Encoding" menu (IE: Encoding -> Convert to...)
Actually, you can save as ANSI in plain old Notepad. File -> Save as... Then in the dialog that opens, you can just select ANSI.
The lower end of UTF-8 is identical to ASCII, so as long as you only have ASII characters in the file, it'll work just fine.
Re: Programming, computers, etc. [Serious]
Posted: Thu Apr 12, 2012 3:01 pm
by atomtengeralattjaro
Thanks! It worked.
The html was generated by visual studio, i guess i should be able to set it to generate it properly, but meh.
Re: Programming, computers, etc. [Serious]
Posted: Thu Apr 12, 2012 3:06 pm
by Anonymously Famous
I edited my post for other ways to get rid of the BOM.
Glad it worked out for you. You should also be able to have the website use a default encoding... I'll have to look into it.
Apparently, since it's xhtml, you could declare it the xml way...
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html...
Re: Programming, computers, etc. [Serious]
Posted: Sat Apr 14, 2012 1:39 pm
by atomtengeralattjaro
these days i'm starting to unhate java.. at least the applets. I kinda like the applets. I still loathe JSP though..
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 16, 2012 12:56 pm
by Dreams
Java is kind-of fun. It's just super-tedious sometimes. Also, the applets tend to crash more than any other web application.
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 16, 2012 1:56 pm
by atomtengeralattjaro
I like to think that such crashing is the fault of the developer of the crashing applet, and not java, but I might be wrong.
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 16, 2012 2:47 pm
by Dreams
I think it's both sometimes. Something as simple as minimizing the screen can break some applets that are very simple and shouldn't crash at all.