Programming, computers, etc. [Serious]
- Anonymously Famous
- JKL; Assassin
- Posts: 11413
- Joined: Thu Mar 03, 2011 6:52 pm
- Location: Area ???, under Bermuda Triangle
Re: Programming, computers, etc. [Serious]
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.
BOTTOM TEXT
Proud poster of the 300kth post in GeneralThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
- atomtengeralattjaro
- Site Admin
- Posts: 37518
- Joined: Wed May 23, 2007 3:43 pm
- Location: green
- Pronouns: he / they / that submarine
- Contact:
Re: Programming, computers, etc. [Serious]
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
I'll probably publish the results, although I doubt any of you uses last.fm
- Anonymously Famous
- JKL; Assassin
- Posts: 11413
- Joined: Thu Mar 03, 2011 6:52 pm
- Location: Area ???, under Bermuda Triangle
Re: Programming, computers, etc. [Serious]
I have a friend who does, who also programs, so it might be useful to him.
BOTTOM TEXT
Proud poster of the 300kth post in GeneralThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
- atomtengeralattjaro
- Site Admin
- Posts: 37518
- Joined: Wed May 23, 2007 3:43 pm
- Location: green
- Pronouns: he / they / that submarine
- Contact:
Re: Programming, computers, etc. [Serious]
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.
- Anonymously Famous
- JKL; Assassin
- Posts: 11413
- Joined: Thu Mar 03, 2011 6:52 pm
- Location: Area ???, under Bermuda Triangle
Re: Programming, computers, etc. [Serious]
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?
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?
BOTTOM TEXT
Proud poster of the 300kth post in GeneralThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
- atomtengeralattjaro
- Site Admin
- Posts: 37518
- Joined: Wed May 23, 2007 3:43 pm
- Location: green
- Pronouns: he / they / that submarine
- Contact:
Re: Programming, computers, etc. [Serious]
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.
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.
- Anonymously Famous
- JKL; Assassin
- Posts: 11413
- Joined: Thu Mar 03, 2011 6:52 pm
- Location: Area ???, under Bermuda Triangle
Re: Programming, computers, etc. [Serious]
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.
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.
BOTTOM TEXT
Proud poster of the 300kth post in GeneralThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
- Dreams
- ASDF High Priest
- Posts: 2306
- Joined: Tue Nov 29, 2011 7:04 pm
- Location: STOP STALKING ME! I'M INSECURE!
- Contact:
Re: Programming, computers, etc. [Serious]
Have fun! I have never learned much VB because I've seen the things that can happen if you do risky scripts.
- Anonymously Famous
- JKL; Assassin
- Posts: 11413
- Joined: Thu Mar 03, 2011 6:52 pm
- Location: Area ???, under Bermuda Triangle
Re: Programming, computers, etc. [Serious]
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.
BOTTOM TEXT
Proud poster of the 300kth post in GeneralThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
- atomtengeralattjaro
- Site Admin
- Posts: 37518
- Joined: Wed May 23, 2007 3:43 pm
- Location: green
- Pronouns: he / they / that submarine
- Contact:
Re: Programming, computers, etc. [Serious]
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.
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.
- Anonymously Famous
- JKL; Assassin
- Posts: 11413
- Joined: Thu Mar 03, 2011 6:52 pm
- Location: Area ???, under Bermuda Triangle
Re: Programming, computers, etc. [Serious]
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:
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.
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"/>
BOTTOM TEXT
Proud poster of the 300kth post in GeneralThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
- qwertzuiop
- ASDF High Priest
- Posts: 2776
- Joined: Tue Jan 19, 2010 7:43 am
- Location: On the top of the Keyboard... No, not the numbers, under them!
Re: Programming, computers, etc. [Serious]
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?
Ҟℓøɰŋαɠə
MASTER SERGEANT SHOOTER SERGEANT IMPORTANT PERSON OF SERGEANTS EXTREME
I'M A STEGOSAURUS!
MASTER SERGEANT SHOOTER SERGEANT IMPORTANT PERSON OF SERGEANTS EXTREME
I'M A STEGOSAURUS!
- atomtengeralattjaro
- Site Admin
- Posts: 37518
- Joined: Wed May 23, 2007 3:43 pm
- Location: green
- Pronouns: he / they / that submarine
- Contact:
Re: Programming, computers, etc. [Serious]
@AF: I added that line, and it's still showing up..
@qwertzuiop: i haven't tried WinRT yet, but I should.
@qwertzuiop: i haven't tried WinRT yet, but I should.
- Anonymously Famous
- JKL; Assassin
- Posts: 11413
- Joined: Thu Mar 03, 2011 6:52 pm
- Location: Area ???, under Bermuda Triangle
Re: Programming, computers, etc. [Serious]
Ok, new plan:
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.
- Get rid of that line.
- Get a hex editor like this one.
- Delete the first three bytes from the file.
- 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...)
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.
Last edited by Anonymously Famous on Thu Apr 12, 2012 3:02 pm, edited 1 time in total.
BOTTOM TEXT
Proud poster of the 300kth post in GeneralThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
- atomtengeralattjaro
- Site Admin
- Posts: 37518
- Joined: Wed May 23, 2007 3:43 pm
- Location: green
- Pronouns: he / they / that submarine
- Contact:
Re: Programming, computers, etc. [Serious]
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.
The html was generated by visual studio, i guess i should be able to set it to generate it properly, but meh.
- Anonymously Famous
- JKL; Assassin
- Posts: 11413
- Joined: Thu Mar 03, 2011 6:52 pm
- Location: Area ???, under Bermuda Triangle
Re: Programming, computers, etc. [Serious]
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...
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...
BOTTOM TEXT
Proud poster of the 300kth post in GeneralThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
- atomtengeralattjaro
- Site Admin
- Posts: 37518
- Joined: Wed May 23, 2007 3:43 pm
- Location: green
- Pronouns: he / they / that submarine
- Contact:
Re: Programming, computers, etc. [Serious]
these days i'm starting to unhate java.. at least the applets. I kinda like the applets. I still loathe JSP though..
- Dreams
- ASDF High Priest
- Posts: 2306
- Joined: Tue Nov 29, 2011 7:04 pm
- Location: STOP STALKING ME! I'M INSECURE!
- Contact:
Re: Programming, computers, etc. [Serious]
Java is kind-of fun. It's just super-tedious sometimes. Also, the applets tend to crash more than any other web application.
- atomtengeralattjaro
- Site Admin
- Posts: 37518
- Joined: Wed May 23, 2007 3:43 pm
- Location: green
- Pronouns: he / they / that submarine
- Contact:
Re: Programming, computers, etc. [Serious]
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.
- Dreams
- ASDF High Priest
- Posts: 2306
- Joined: Tue Nov 29, 2011 7:04 pm
- Location: STOP STALKING ME! I'M INSECURE!
- Contact:
Re: Programming, computers, etc. [Serious]
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.