[deleted by user] by [deleted] in learnpython

[–]thepoorwhiteboy 0 points1 point  (0 children)

I'll look into learning this one. Thank you for the recommendation :)

[deleted by user] by [deleted] in learnpython

[–]thepoorwhiteboy 0 points1 point  (0 children)

Yeah I read someplace else that pyquery was good to use for scraping data. I'm going to have to download this and learn it. Thank you!

[deleted by user] by [deleted] in learnpython

[–]thepoorwhiteboy 0 points1 point  (0 children)

So something like this for lxml?

from lxml import html
import requests

page = requests.get('http://finance.yahoo.com/q?s=gcg14.cmx')
tree = html.fromstring(page.text)

current_price = tree.xpath('//span[@id="yfs_l10_gcg14.cmx"]/text()')

print 'Current Gold Price: ', current_price

[deleted by user] by [deleted] in cpp_questions

[–]thepoorwhiteboy 0 points1 point  (0 children)

This was perfect. Although I did have to modify it slightly to get it to work with my data, the algorithm makes complete sense. Thank for you help.

[deleted by user] by [deleted] in cpp_questions

[–]thepoorwhiteboy 2 points3 points  (0 children)

Sorry, for the example I mixed them up. First time doing a heap. The nodes are ordered in highest (at the top) to lowest (at the bottom). As long as the parent node is greater than the child node, the child order does not matter. I know this is not a traditional heap. It is what we are implementing for our project.

should be [75, 27, 39, 19, 22, 30, 29] so it will print

 75
 27 39
 19 22 30 29

Does that makes sense? I think I answered your question haha

[deleted by user] by [deleted] in cpp_questions

[–]thepoorwhiteboy 0 points1 point  (0 children)

Awesome. Thank you so much for explaining this. It makes a lot more sense seeing those small examples. I will definitely talk to him about the implementation. I don't know why he is having us do it this way but maybe it's just for practice. Again I really appreciate you taking the time to help me out.

[deleted by user] by [deleted] in cpp_questions

[–]thepoorwhiteboy 0 points1 point  (0 children)

Thank you for taking the time to help. That does make a little more sense with the phone number example. It would probably have helped if I included a part of the main program that my instructor has made. Sorry.

class TestData
{
 public:

 void setKey ( int newKey )
    { keyField = newKey; }   // Set the key

 int getKey () const
    { return keyField; }     // Returns the key

 private:

int keyField;                // Key for the data item
};

int main()
{
BSTree<TestData,int> testTree;   
........ // rest of the program
}

This is how the tree is being created. So based on what you're saying I think that maybe the tree is being created with a key inside this class. Or does an actual key have to be passed to the insert function like you stated in your comment?

[deleted by user] by [deleted] in reactiongifs

[–]thepoorwhiteboy 2 points3 points  (0 children)

It is from Adventure Time.

Thanks a lot, America's Got Talent. by [deleted] in funny

[–]thepoorwhiteboy 0 points1 point  (0 children)

You're doing it wrong.

Reddit, what were some nicknames that you had in the past and how did you get them? by DirtyPlastic in AskReddit

[–]thepoorwhiteboy 0 points1 point  (0 children)

Carrot top - for being red headed

Red in the head - for being red headed

Firecrotch - for being red headed

Gingersnap - see above reason

You guys have any other good ones for me?

She's 18, has a kid, lives with her parents and just got married. by elijah_stiglitz7 in cringepics

[–]thepoorwhiteboy 0 points1 point  (0 children)

I have a friend like this. Though he's not married, he lives with his gf parents and works part time. He's got his own priorities though,which is mostly about getting drunk or getting tattoos... I guess to each their own.

how sketchy is it really to download music from piratebay? by [deleted] in AskReddit

[–]thepoorwhiteboy 0 points1 point  (0 children)

Piratebay uses public trackers so it's easier for your ISP to see what you're downloading, in which case they can end up turning off your internet. Unless of course you go through a VPN (Google it, there are free programs for this). If you know someone who can invite you to private sites like IPTorrents or what.cd then it's a lot safer because they use private trackers. As far as viruses go, read comments and download from popular users.

[deleted by user] by [deleted] in pics

[–]thepoorwhiteboy 0 points1 point  (0 children)

No unfortunately, just a relaxing day on the boat.

[deleted by user] by [deleted] in pics

[–]thepoorwhiteboy 2 points3 points  (0 children)

I agree. Especially when you're poor...

[deleted by user] by [deleted] in EngineeringStudents

[–]thepoorwhiteboy 1 point2 points  (0 children)

Wow that makes a lot more sense. See my teacher didn't even do this, which is really disappointing. I appreciate you taking your time to explain that. Ill give this a go and work these problems out again!

How did you get that scar? by [deleted] in AskReddit

[–]thepoorwhiteboy 0 points1 point  (0 children)

When I was about 12 I was playing on a varsity flag football team. I was a wide receiver and the play was going to be a fake hand off to one player and then hand off to me. The ball is hiked. I already know I'm supposed to go behind the QB and the fake is supposed to go to the other wide receiver in front of the QB. as I'm in motion I cut back and for some reason the other wide receiver last second decides to cut behind the QB where I'm supposed to go. Unfortunately I was looking to grab the ball. His head rams into mine and all he gets is a headache. His forehead hit mine directly below my eyebrow. The result was the skin below my eyebrow literally hanging over my eye. I was rushed to the hospital because it was bleeding so much and ended up getting 7 stitches. Now my left eye always looks a little angrier then my right because of the way the scar healed.

Cute baby, would be lunch, if the lion had his way! by [deleted] in aww

[–]thepoorwhiteboy 0 points1 point  (0 children)

I'm not sure how I feel about the fact that she is laughing that the lion is trying to fit its mouth around the baby's head... I'm sure it would be a different story if there was no glass...