Open Side Menu Go to the Top

06-27-2014 , 12:12 PM
Quote:
Originally Posted by clowntable
Never heard of Alice before
Neither has any other respectable programmer >.>

Quote:
Originally Posted by adios
Probably posting the code sample or something the illustrates the concept you are trying implement would be helpful in getting an answer. I am not familiar with Alice so my wild ass guess is that it is a scope issue with the variable. The variable you are incrementing goes out of scope when you exit the method. Again just a guess.
Code:
world.findSatellites ( ) 
    totalLaunched = 0
    	  While ( totalLaunched <= 2 )
    	  totalLaunched set value to ( ( totalLaunched + 1 ) )
  If ( totalLaunched < 2 )
    	  madScientist say I have launched 1 satellite so far! duration = 3.5 seconds
  Else
 	  madScientist say ( I have launched joined with ( ( totalLaunched as a string ) joined with satellites so far! ) ) duration = 3.5 seconds
Tried to cut out any irrelevant text. If it's not obvious, the if/else is nested in the while statement.

What I ended up doing (above) was having this loop 3 times.

What I wanted to happen was that the method would be called when the user pushed a key, and after pushing it so many times the text would change, but the totalLaunched was not being incremented no matter what I tried. Until I used a while statement, that is.

The original code, leaving out the push key to trigger event, would just be:

Code:
 world.findSatellites ( ) 
    totalLaunched = 0
    	  totalLaunched set value to ( ( totalLaunched + 1 ) )
  If ( totalLaunched < 2 )
    	  madScientist say I have launched 1 satellite so far! duration = 3.5 seconds
  Else
 	  madScientist say ( I have launched joined with ( ( totalLaunched as a string ) joined with satellites so far! ) ) duration = 3.5 seconds
We're just now starting to get into return statements. So maybe that's what the problem was, with the world.findSatellites method not returning a value? I don't know, talking out my ass here obviously.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
06-27-2014 , 12:47 PM
Another guess since I don't know this language so take it FWIW.

At the beginning of the program:

Code:
 
totalLaunched = 0
......
......
The idea is to make totalLaunched a global, crude but hopefully effective.

Code:
world.findSatellites ( ) 
 
    	  totalLaunched set value to ( ( totalLaunched + 1 ) )
  If ( totalLaunched < 2 )
    	  madScientist say I have launched 1 satellite so far! duration = 3.5 seconds
  Else
 	  madScientist say ( I have launched joined with ( ( totalLaunched as a string ) joined with satellites so far! ) ) duration = 3.5 seconds
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-27-2014 , 01:26 PM
Yeah, I have no clue how to set a global variable, or if it's even possible in Alice. It's a very quirky quasi-language that's not terribly adaptable. While this may be a summer course, it makes sense that we'd only spend about 3 weeks working with it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-27-2014 , 06:22 PM
Quote:
Originally Posted by Low Key
learning programming in a school setting and we're using Alice as a language, well, as a 'language'.

Final project needed to include an accumulator, which we've done before, but when I tried it this time it just wasn't working properly. I assumed I could increment a variable in a method each time the method is called, but that just didn't work. In the end I had to loop the method and increment the variable at the end of a while loop.

Is it possible to increment a variable when called as an event or no? Perhaps this is just a limitation of the IDE we're working in. I can't do some other things that I figure would be fairly straightforward, like using the mouse to move the camera around.
It's going to depend on the scope of the variable and if you're dealing with the same object each time the event fires or a new one. Code sample would help...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-27-2014 , 09:22 PM
Quote:
Originally Posted by Low Key
Yeah, I have no clue how to set a global variable, or if it's even possible in Alice. It's a very quirky quasi-language that's not terribly adaptable. While this may be a summer course, it makes sense that we'd only spend about 3 weeks working with it.
Each time that method gets called totalLaunched is set to 0. Just move it out of that method.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-27-2014 , 09:47 PM
The db girl has been working with me for a solid month now and I've learned a metric ****-ton from managing this woman. I now understand why the C# guy I worked under acted the way he did and it is incredibly subtle.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-27-2014 , 11:28 PM
^^ Just to clarify, I have absolute deep respect for her and amazed to see someone this smart. Hurts my brain.

And big reveal: You can't code PL/pgSQL in Lisp.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-28-2014 , 11:00 AM
Anyone know if it's possible to create transcripts of a movie or TV show (or any video/audio file) automatically? Essentially an AI which is able to detect English words from an audio file. I assume since my iphone can do it with my voice it's theoretically possible -- but is there any open-source software out there built to do this explicitly?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-28-2014 , 11:04 AM
I would be interested in that as well. I needed this in some project I gave up on due to lazyness and copyright issues I had no inclination of ever dealing with (I tried scraping subtitles sites instead which was a pain). May I ask what you need that for?

It's a pretty hard problem to solve in the general case.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-28-2014 , 11:12 AM
Nothing serious, just a random fun idea I thought of.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-28-2014 , 11:44 AM
Cool. I wanted to build a "learn a language by watching TV" kind of site. Mostly because that's how I learned English.
Might still do it but like I said...copyright hassles.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-28-2014 , 02:29 PM
Looks like there are quite a few open source programs out there. Quick search suggests Palaver, which uses the Google Voice API, and Simon. Youtube has some auto-captioning service. I'm guessing that is embedded via JavaScript, so it may be open-source, albeit obfuscated.

What is the interesting idea?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-28-2014 , 03:41 PM
Quote:
Originally Posted by clowntable
Cool. I wanted to build a "learn a language by watching TV" kind of site. Mostly because that's how I learned English.
Might still do it but like I said...copyright hassles.
In High school, I suggested the Japanese class buy imported games (RPG's) to learn with.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-28-2014 , 04:32 PM
Quote:
Originally Posted by daveT
What is the interesting idea?
make all of seinfeld searchable. type in a quote or phrase and pull up the video clip. ideally you want not only transcription into text, but voice recognition as well so you can attach lines to characters.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-28-2014 , 05:07 PM
Quote:
Originally Posted by gaming_mouse
make all of seinfeld searchable. type in a quote or phrase and pull up the video clip. ideally you want not only transcription into text, but voice recognition as well so you can attach lines to characters.
There is already a site with all the Seinfeld scripts.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-28-2014 , 06:54 PM
Quote:
Originally Posted by KatoKrazy
There is already a site with all the Seinfeld scripts.
Every line would also need a time code
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-28-2014 , 07:17 PM
seems .srt files would be good for that?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-28-2014 , 10:16 PM
Quote:
Originally Posted by gaming_mouse
make all of seinfeld searchable. type in a quote or phrase and pull up the video clip. ideally you want not only transcription into text, but voice recognition as well so you can attach lines to characters.
Haha. Seinfeld was the show I wanted to prototype with since I own all the DVDs and it covers a reasonable amount of standard/everyday vocabulary (and it's the best comedy of all time). A little old but couldn't bring myself to sub in crap like HIMYM.

Quote:
Originally Posted by gaming_mouse
Every line would also need a time code
If that's all you need...just search for a subtitle site. They have the official subs for all episodes and they are timecoded.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-28-2014 , 10:34 PM
Just got this from meetup.com:

Quote:
The term "MEAN stack" was coined to denote the all-JavaScript web application stack of MongoDB, ExpressJS, AngularJS, and NodeJS... but you already knew that, didn't you?
I learn something new every day.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-29-2014 , 12:07 AM
Quote:
Originally Posted by clowntable
Haha. Seinfeld was the show I wanted to prototype with since I own all the DVDs and it covers a reasonable amount of standard/everyday vocabulary (and it's the best comedy of all time). A little old but couldn't bring myself to sub in crap like HIMYM.


If that's all you need...just search for a subtitle site. They have the official subs for all episodes and they are timecoded.
that's a good point.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-29-2014 , 04:23 AM
I'm stumped.

I have this from the eBay API:

https://github.com/timotheus/ebaysdk...sage-with-yaml

Code:
api = Finding(config_file='myfile.yaml')
response = api.execute('findItemsAdvanced', {'keywords': 'Python'})
print(response.dict())
And I can't seem to get it to work. The error is:

Code:
print(response.dict())
AttributeError: 'Connection' object has no attribute 'dict'

Okay...

So I do:

Code:
print(dir(response))

which gives me:

['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_get_resp_body_errors', '_request_id', '_reset', '_resp_body_errors', '_resp_body_warnings', '_resp_codes', '_response_content', '_response_dict', '_response_dom', '_response_error', '_response_obj', '_response_soup', '_time', 'build_request', 'build_request_data', 'build_request_headers', 'config', 'debug', 'debug_callback', 'do', 'error', 'error_check', 'execute', 'execute_request', 'getNodeText', 'method', 'parallel', 'process_response', 'proxies', 'proxy_host', 'proxy_port', 'request', 'response', 'response_code', 'response_codes', 'response_content', 'response_dict', 'response_dom', 'response_json', 'response_obj', 'response_soup', 'response_status', 'session', 'timeout', 'v', 'verb', 'warnings']


???
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-29-2014 , 12:31 PM
It's got a '__dict__' but not a 'dict'. Maybe try 'response_dict'?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-29-2014 , 05:09 PM
Yeah, that returns none. I guess my Python is getting a bit rusty.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-29-2014 , 07:37 PM
Use: response.__dict__
Note that some classes (not your case but good to know) don't have a dict: https://docs.python.org/2/reference/...del.html#slots

Last edited by clowntable; 06-29-2014 at 07:42 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-29-2014 , 09:15 PM
Turns out that response_dict() was the correct answer.

To say the least, the documentation is... lacking accuracy.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m