Programming, computers, etc. [Serious]

All things asdf (and anything else)
User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Sun Apr 08, 2012 3:55 pm

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
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 37513
Joined: Wed May 23, 2007 3:43 pm
Location: green
Pronouns: he / they / that submarine
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Sun Apr 08, 2012 7:03 pm

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
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Mon Apr 09, 2012 12:26 am

I have a friend who does, who also programs, so it might be useful to him.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 37513
Joined: Wed May 23, 2007 3:43 pm
Location: green
Pronouns: he / they / that submarine
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Mon Apr 09, 2012 1:04 pm

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.
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Mon Apr 09, 2012 2:41 pm

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?
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 37513
Joined: Wed May 23, 2007 3:43 pm
Location: green
Pronouns: he / they / that submarine
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Mon Apr 09, 2012 5:45 pm

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.
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Mon Apr 09, 2012 10:12 pm

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.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
Dreams
ASDF High Priest
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]

Post by Dreams » Wed Apr 11, 2012 4:30 pm

Have fun! I have never learned much VB because I've seen the things that can happen if you do risky scripts.

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Wed Apr 11, 2012 7:22 pm

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
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 37513
Joined: Wed May 23, 2007 3:43 pm
Location: green
Pronouns: he / they / that submarine
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Thu Apr 12, 2012 11:10 am

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.
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Thu Apr 12, 2012 1:40 pm

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. :)
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
qwertzuiop
ASDF High Priest
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]

Post by qwertzuiop » Thu Apr 12, 2012 2:12 pm

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!

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 37513
Joined: Wed May 23, 2007 3:43 pm
Location: green
Pronouns: he / they / that submarine
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Thu Apr 12, 2012 2:31 pm

@AF: I added that line, and it's still showing up.. :(
@qwertzuiop: i haven't tried WinRT yet, but I should.
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Thu Apr 12, 2012 2:54 pm

Ok, new plan:
  1. Get rid of that line.
  2. Get a hex editor like this one.
  3. Delete the first three bytes from the file.
Alternate plan:
  1. Open the file in an advanced text editor, such as Notepad++.
  2. Get rid of the meta line.
  3. 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.
Last edited by Anonymously Famous on Thu Apr 12, 2012 3:02 pm, edited 1 time in total.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 37513
Joined: Wed May 23, 2007 3:43 pm
Location: green
Pronouns: he / they / that submarine
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Thu Apr 12, 2012 3:01 pm

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.
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Thu Apr 12, 2012 3:06 pm

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...
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 37513
Joined: Wed May 23, 2007 3:43 pm
Location: green
Pronouns: he / they / that submarine
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Sat Apr 14, 2012 1:39 pm

these days i'm starting to unhate java.. at least the applets. I kinda like the applets. I still loathe JSP though..
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Dreams
ASDF High Priest
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]

Post by Dreams » Mon Apr 16, 2012 12:56 pm

Java is kind-of fun. It's just super-tedious sometimes. Also, the applets tend to crash more than any other web application.

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 37513
Joined: Wed May 23, 2007 3:43 pm
Location: green
Pronouns: he / they / that submarine
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Mon Apr 16, 2012 1:56 pm

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.
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Dreams
ASDF High Priest
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]

Post by Dreams » Mon Apr 16, 2012 2:47 pm

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.

Post Reply