Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
RussianManiac
Dec 27, 2005

by Ozmaugh
This is sort of a sstupid question but what is the easiest way to mine data on facebook? Say I would like to build a spider that would have my login info and go through my profile and collect keywords I put there then go through all my friends and then their friends collecting their profile info?

Is it easier to make a program doing HTTP requests with my login info, or is there some API for doing this?

Adbot
ADBOT LOVES YOU

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
There's probably a RESTful API for that sort of poo poo, but worst comes to worst WWW::Mechanize can probably do the job easily enough

shrughes
Oct 11, 2008

(call/cc call/cc)

Plorkyeran posted:

Latin was my favorite class in high school. Sadly I've forgotten 90% of it now.

Also, learning to read hiragana and katakana took me a weekend :smugdog:.

You memorized upwards of 80 symbols in two days? Are you smart?

ErIog
Jul 11, 2001

:nsacloud:

Richard M Nixon posted:

You memorized upwards of 80 symbols in two days? Are you austistic?

Put them in batches of 5, and keep adding 5 flashcards once you know the last 5. I was memorizing about 80 vocabulary words a day when I was busting my rear end in Japan. The key, though, is to review them regularly. When you learn fast you also forget fast, and so you need to actively work to move stuff to long term memory. It's not difficult, but none of the skills I used to learn Japanese well were ever taught in any of my classes.

Likewise, you shouldn't expect your CS classes to give you the skills to learn programming well.

Your question about frameworks can be answered by wikipedia:
http://lmgtfy.com/?q=wikipedia+software+framework&l=1

ErIog fucked around with this message at 03:20 on Feb 23, 2010

Richard M Nixon
Apr 26, 2009

"The greatest honor history can bestow is the title of peacemaker."

ErIog posted:

Put them in batches of 5, and keep adding 5 flashcards once you know the last 5. I was memorizing about 80 vocabulary words a day when I was busting my rear end in Japan. The key, though, is to review them regularly. When you learn fast you also forget fast, and so you need to actively work to move stuff to long term memory. It's not difficult, but none of the skills I used to learn Japanese well were ever taught in any of my classes.

Likewise, you shouldn't expect your CS classes to give you the skills to learn programming well.

Your question about frameworks can be answered by wikipedia:
http://lmgtfy.com/?q=wikipedia+software+framework&l=1

I'll pretend you're not being a smartass like I was when I use lmgtfy on customers. I have read the wiki article and was looking for something a little more real world, such as if someone took a course and the instructor said "here, use this textbook and learn this framework," so I could then go get that book and DIY.

ErIog
Jul 11, 2001

:nsacloud:

Richard M Nixon posted:

I'll pretend you're not being a smartass like I was when I use lmgtfy on customers. I have read the wiki article and was looking for something a little more real world, such as if someone took a course and the instructor said "here, use this textbook and learn this framework," so I could then go get that book and DIY.

Well, the framework all depends on what you want to do, what languages you're comfortable with, and your target platforms. You've already been given instructions on how you should proceed with your D&D thing. You should do it as a console-mode application first, and then work on more things related to GUI once you're fairly certain you've not hosed the whole thing up.

ErIog fucked around with this message at 03:47 on Feb 23, 2010

Richard M Nixon
Apr 26, 2009

"The greatest honor history can bestow is the title of peacemaker."

ErIog posted:

Well, the framework all depends on what you want to do and what languages you're comfortable with. You've already been given instructions on how you should proceed with your D&D thing. You should do it as a console-mode application first, and then work on more things related to GUI once you're fairly certain you've not hosed the whole thing up.

I've been working on that. I was trying to bite off a lot more than I could chew, apparently, and this pace is much better to learn from. I was asking about frameworks more as a "hey, I ran across this whilst googling, wtf is it" sort of thing.

xPanda
Feb 6, 2003

Was that me or the door?
I was going to post this in the Python thread but quickly realised this has little to do with Python and much to do with Windows.

I want a script which will run on windows XP and terminate/pause a process when a user logs in, and start the process when there are no users logged in. The script would presumably be started by SYSTEM and so would run before any user logs in. The computers on which this script would run spend most of their time at the login screen.

My issue is mainly with detecting the state of logged in users. It seems the best thing to use is the pywin32 package, and the win32ts module which interfaces windows terminal services. I'm digging into the way windows xp handles such things (Sessions, Stations, Desktops...), and it seems that there is always 1 session running (Console?) when you enumerate sessions. However when enumerating all processes there are at least 4 distinct SIDs associated with the running processes. What is the relationship between logged-in users and Sessions, and what would be the best way to determine the number of logged in users?

I feel that it is a reasonably simple problem but that I am being held back by my unfamiliarity with the way windows handles these concepts and the contextual jargon.

The Diddler
Jun 22, 2006


I do a fair amount of mainframe work, but it's mostly following instructions. I would like to learn workflow language (it's what we use) so I understand more of what I'm doing, but it appears that it's all but dead. Does anyone have any idea where I can try looking to find information? I could try to get info from my boss, but he's pretty busy, and I would like to do it at my own pace.

EDIT: And as soon as I post this, the Unisys programming manual comes back online. So, I have that, but would appreciate some sort of structured approach to learning it, if it exists.

The Diddler fucked around with this message at 06:12 on Feb 23, 2010

raminasi
Jan 25, 2005

a last drink with no ice

RussianManiac posted:

This is sort of a sstupid question but what is the easiest way to mine data on facebook? Say I would like to build a spider that would have my login info and go through my profile and collect keywords I put there then go through all my friends and then their friends collecting their profile info?

Is it easier to make a program doing HTTP requests with my login info, or is there some API for doing this?

http://wiki.developers.facebook.com/index.php/API

RussianManiac
Dec 27, 2005

by Ozmaugh

That doesn't really help me as I don't have a facebook app, I justs need to mine some data for a personal project.

The1ManMoshPit
Apr 17, 2005

Scraping people's profiles and storing the information is actually against the Facebook terms of service, so you probably shouldn't do it and you should also probably stop being a creepy loving weirdo.

RussianManiac
Dec 27, 2005

by Ozmaugh

The1ManMoshPit posted:

Scraping people's profiles and storing the information is actually against the Facebook terms of service, so you probably shouldn't do it and you should also probably stop being a creepy loving weirdo.

It's for scientific research purposes!

The1ManMoshPit
Apr 17, 2005

All scientists are creepy.

raminasi
Jan 25, 2005

a last drink with no ice

RussianManiac posted:

That doesn't really help me as I don't have a facebook app, I justs need to mine some data for a personal project.

the link you apparently didn't read posted:

The API uses a REST-like interface. This means that our Facebook method calls are made over the internet by sending HTTP GET or POST requests to the Facebook API REST server (http://api.facebook.com/restserver.php) . Nearly any computer language can be used to communicate over HTTP with the REST server.

you just make http requests

RussianManiac
Dec 27, 2005

by Ozmaugh

GrumpyDoctor posted:

you just make http requests

Yes but you need to have a Facebook app registered with them to authenticate and be able to do anything with that API.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

RussianManiac posted:

True nerds take Latin not Japanese.

No, they learn hexadecimal. *eyes you meaningfully*

raminasi
Jan 25, 2005

a last drink with no ice

RussianManiac posted:

Yes but you need to have a Facebook app registered with them to authenticate and be able to do anything with that API.

oh whoops i'm retarded sorry about that :shobon:

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

Avenging Dentist posted:

No, they learn hexadecimal. *eyes you meaningfully*

:cry: Stop decoding me with your eyes, pervert!

floWenoL
Oct 23, 2002

Avenging Dentist posted:

No, they learn hexadecimal. *eyes you meaningfully*

He was doing so well, too...

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Avenging Dentist posted:

No, they learn hexadecimal. *eyes you meaningfully*
:aaa:

(I don't care if it's actually true or not but this is a fun enough twist in the CoC soap opera to play along with)

RussianManiac
Dec 27, 2005

by Ozmaugh
How would anybody speak hexadecimal? You mean speak/read hexadecimal numbers representing ASCII characters?

shrughes
Oct 11, 2008

(call/cc call/cc)

Dijkstracula posted:

:aaa:

(I don't care if it's actually true or not but this is a fun enough twist in the CoC soap opera to play along with)

This was thought to be common knowledge. It serves you right for not being in #cobol.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

RussianManiac posted:

How would anybody speak hexadecimal?

It's a mix of beep bop boop and the sound a modem makes. Kchhhhhhhaachhhhh uhhhhchhhshhh REEEYAAWWREEEYAAWW wongkshhhhhh *click*

Scaevolus
Apr 16, 2007

ErIog posted:

Put them in batches of 5, and keep adding 5 flashcards once you know the last 5. I was memorizing about 80 vocabulary words a day when I was busting my rear end in Japan. The key, though, is to review them regularly. When you learn fast you also forget fast, and so you need to actively work to move stuff to long term memory. It's not difficult, but none of the skills I used to learn Japanese well were ever taught in any of my classes.

http://en.wikipedia.org/wiki/Spaced_repetition
http://www.supermemo.com/english/princip.htm
http://ichi2.net/anki/

You can learn all the kana in about 4 hours if you use mnemonic devices.

ErIog
Jul 11, 2001

:nsacloud:

Scaevolus posted:

http://en.wikipedia.org/wiki/Spaced_repetition
http://www.supermemo.com/english/princip.htm
http://ichi2.net/anki/

You can learn all the kana in about 4 hours if you use mnemonic devices.

You think I learned Japanese to a high level without reading up on spaced repetition? I didn't want to derail the thread with a schpiel about learning a foreign language. I was simply refuting the idea that learning kana was time consuming or hard.

smith7800
Sep 25, 2004
Stupid question answered.

smith7800 fucked around with this message at 12:00 on Feb 24, 2010

ErIog
Jul 11, 2001

:nsacloud:
I'm starting to be relied on more heavily at work for programming little utilities to automate department workflows. I'm good at it, but I'm concerned that since I was not ever trained to be a programmer(have only dabbled for my entire life until recently) that there are probably things I'm missing.

My biggest question right now is about graceful exception handling. Is there some documentation somewhere that goes through good design philosophy for this stuff? I know the basics like checking inputs to make sure data is in the expected format, but it bothers me that I don't know when I should use exception handling.

I know that I could use it everywhere, but I know that's not the right way.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

ErIog posted:

I'm concerned that since I was not ever trained to be a programmer(have only dabbled for my entire life until recently) that there are probably things I'm missing.

It is beyond fantastic that you're concerned. You should channel that concern into being proactive about learning newer and better programming techniques. The maintenance programmers after you (including you) will thank you.

ErIog posted:

My biggest question right now is about graceful exception handling. Is there some documentation somewhere that goes through good design philosophy for this stuff? I know the basics like checking inputs to make sure data is in the expected format, but it bothers me that I don't know when I should use exception handling.

I learned this from this forum... "Exceptions should be exceptional." If you're working with validation and you know an error case is going to pop up every so often, that's not an exception, that's something you code for. An exception is like if the abstraction falls from beneath you or memory is corrupted or the disk blows up or something crazy like that. Something exceptional. And then deal with it if possible.

RussianManiac
Dec 27, 2005

by Ozmaugh

ErIog posted:

I'm starting to be relied on more heavily at work for programming little utilities to automate department workflows. I'm good at it, but I'm concerned that since I was not ever trained to be a programmer(have only dabbled for my entire life until recently) that there are probably things I'm missing.

My biggest question right now is about graceful exception handling. Is there some documentation somewhere that goes through good design philosophy for this stuff? I know the basics like checking inputs to make sure data is in the expected format, but it bothers me that I don't know when I should use exception handling.

I know that I could use it everywhere, but I know that's not the right way.

What language are you using? Generally it is considered good design to catch more specific types of exception than have catch(Exception e) type stuff. Depending on logic of your application there may be same points but that may fail in many different ways and so if it makes sense to take different action on each different sort of exception you should have a series of catch clauses specifying different types of exception.

Also there is issue of deciding when to put throws into function definition or handle the error inside the function itself. You need to decide that somebody using your methods/classes needs to know if those errors/exceptions are generated. Graceful or good design is largely determined by how you want the other programmers to interact with your system and what you would want to expose to them.

I am not sure what is good online source for this, but would be interested myself in a link to read about this, as most of what I learned was just from experience.

ErIog
Jul 11, 2001

:nsacloud:

RussianManiac posted:

What language are you using? Generally it is considered good design to catch more specific types of exception than have catch(Exception e) type stuff.

I'm using Python, and thankfully none of my utilities have ever been big enough that there's a whole mess of things that could go wrong. I try to write sets of very small tools that work together to make adhering to our workflows less time-consuming.

I don't think any of my utilities have catch-all exceptions. Which means at worst case the error messages that are generated are gibberish to the user, but would tell a programmer where to start looking for the error.

RussianManiac
Dec 27, 2005

by Ozmaugh

ErIog posted:

I'm using Python, and thankfully none of my utilities have ever been big enough that there's a whole mess of things that could go wrong. I try to write sets of very small tools that work together to make adhering to our workflows less time-consuming.

I don't think any of my utilities have catch-all exceptions. Which means at worst case the error messages that are generated are gibberish to the user, but would tell a programmer where to start looking for the error.

Hmm, I may be wrong, but relying on exceptions for debugging purposes is probably not a very good idea. Better way is to create unit tests that are as specific as possible and have enough of them to cover most of the functionality in your software.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

RussianManiac posted:

Hmm, I may be wrong, but relying on exceptions for debugging purposes is probably not a very good idea.

You are.

RussianManiac
Dec 27, 2005

by Ozmaugh

Avenging Dentist posted:

You are.

If you are just using exceptions for debugging purposes then there is no reason to have anything beyond catch all as you can print the specific exception information anyway. Well at least in Java, not sure how python works.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

RussianManiac posted:

If you are just using exceptions for debugging purposes then there is no reason to have anything beyond catch all as you can print the specific exception information anyway.

What? Of course there is. Not all exceptions are equal, and some may have specific information provided in them to facilitate debugging.

raminasi
Jan 25, 2005

a last drink with no ice
Doesn't Python use exceptions for unexceptional flow control or something?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

GrumpyDoctor posted:

Doesn't Python use exceptions for unexceptional flow control or something?

Yes. The end of iteration is signaled by an exception. But that's not actually visible to the user.

BigRedDot
Mar 6, 2008

GrumpyDoctor posted:

Doesn't Python use exceptions for unexceptional flow control or something?

Iterators raise StopIteration to indicate there is nothing further to return.

Edit: that's what I get for walking away from my desk for two minutes.

FlyingDodo
Jan 22, 2005
Not Extinct
I hope I have the right thread for this questions. I'm using c++ visual studio 2008 express. I have code that will be used in multiple projects. For example math code like matrices, vectors, planes which will be used for both a level editor and a game. I've only ever really made small programs in VS so I just had multiple projects and just copy-pasted code if necessary. Of course I realise this is stupid and it makes things difficult.

What is the correct way to go about this?

Adbot
ADBOT LOVES YOU

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Make a library.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply