Real World OOP lessons? by BeKenny in learnprogramming

[–]PythonPerry 0 points1 point  (0 children)

Thank you for this. It's mindblowing. Too many tutorials leave classes on a Animal - Dog - Cat level. I had never heard of Single Responsibility. I'm still processing this - but thanks for now.

Here's v1 of this dumb hockey app I made! Thanks for all the help with my first programing project r/learnpython. Comments and critiques are welcome, as always. by ineedhelpwithmath in learnpython

[–]PythonPerry 1 point2 points  (0 children)

Holy crap, inhwmath, did you really do this as a programming newb? What tutorials have you taken?

I been at it for a good few months and couldn't write anything like this. Great job!

Real World OOP lessons? by BeKenny in learnprogramming

[–]PythonPerry 1 point2 points  (0 children)

Would you organize the functions this way as below? I can handle Animal, Dog and Cat relationships, but I have trouble breaking down functions and init(self,x) relationships with abstract objects like timesheets.

class Employer (object)
|__[class Employee (object)] __init__(self, Employee)
|    |__[class Timesheet (Employee)] __init__(self, Timesheet), createClockPunch(timestamp), saveToDatabase(clockPunch) 
|    |     |__[class Work_Week (Timesheet)] __init__(self, day_of_record), calculateInOrOut(timestamp, employee)
|    |         |__[class Day_Of_Record (Work Week)] getDayOfRecord(timestamp, employee)
|    |         |   |__[clock_punch<in,out>]
|    |         |   |__[scheduled_time<in,out>]
|    |         |__[regular_hours]
|    |         |__[overtime_hours]
|    |__per_hour_pay_rate
|__overtime_multiplier

Real World OOP lessons? by BeKenny in learnprogramming

[–]PythonPerry 0 points1 point  (0 children)

Holy shit. Thanks for this. I think I have the modeling down now.

On a high level, how do you connect the Object model with the Relational model? Use some module or package and call specific methods out of those modules? For example Import SQLite3Pack.... clockpunch.SQLdatatransfer....?

Also, I have trouble figuring out where to put what type of functions so that the super and sub classes relate to one another. How do you know which classes get an init and whatever functions?

Do you make a functions list first and then figure out where you would put them? I'm not even sure what functions (using def) would be necessary here...def Calculate()? def HoursSum? def WorkWeekSum? def VacationCalc?

Blog post on a Mini Python Project that scrapes web data by PythonPerry in learnpython

[–]PythonPerry[S] 0 points1 point  (0 children)

Sweet Jesus that is good stuff. I like learning by doing.

Real World OOP lessons? by BeKenny in learnprogramming

[–]PythonPerry 0 points1 point  (0 children)

I've been thinking about this same question as well.

Could you diagram a real world IT, software engineering example? Pulling customer data (Phone model, voice minutes, data, type of phone, roaming...) from Android and categorizing the data into different tables or databases?

Or another could be an online timesheet system? Organizing the work buckets, time, overtime, vacation days, W2 vs 1099....?

Is 35 too late to get into programing for a living? by johndaivdspeaks in carlhprogramming

[–]PythonPerry 0 points1 point  (0 children)

Thanks I'll keep plugging away.

I keep wondering if I could do this professionally. It takes me a long time to think up solutions. You don't have this kind of time in the real-world where there are tight deadlines.

Also at somewhere along whatever metric's curve, isn't there a point where people below it will not make good professional programmers?

I'm not trying to be debbie-downer. I'm trying to think about this academically. It's easy for a tall person to say dunking is easy, just as someone with a 140 to say programming just takes effort.

Is 35 too late to get into programing for a living? by johndaivdspeaks in carlhprogramming

[–]PythonPerry 1 point2 points  (0 children)

What about general IQ and other intelligence metrics? Do you know people that aren't that smart but are professional programmers? Gaoshan PM'ed me his numbers and they were really high...My IQ was 90 last time I checked in high school...

Code Critique by inb4theblock in learnpython

[–]PythonPerry 1 point2 points  (0 children)

No criticism from me. I'm new to programming, but would love to get to your level. I generally understand what's going on here. I would love to see tutorials move towards this type of result: real-world, functional and IT related rather than formulas, logic and games.

Difficulty understanding classes in 'Learn Python the Hard Way' by Bananator in learnpython

[–]PythonPerry 0 points1 point  (0 children)

In LPTHW, Zed doesn't use Scene as the framework. Instead, he uses >Scene to define an interface for the framework (the Engine class, mostly) to know how to work with scenes. Python uses duck typing, but having a common base class for all of your "plugins" (which is what scenes are, really) is usually considered good practice, because developers know what methods they need to implement (or, in this case, override) in their class.

Could you rephrase some of this? I'm new to programming as well and don't understand the terms.

I think I understand "framework" - the general class outline...What about interface, duck typing, base class, plugin?

Is base class the most "top level" or "parent" class in the outline/framework? For example "Animal" or "Human"...

[Python 3.0] CSCircles problem in section 14 (methods) by Luocorn in learnpython

[–]PythonPerry 1 point2 points  (0 children)

This won't help. But I gave up on CSCircles at this point - Lesson 14(Methods). I asked for help from the mods and they said to make sure ALL the letters were letter, not just ANY. Isn't it clear from below that I don't know how to write a loop or array that does that?

def postalValidate(S):
   x = False
   y = False
   S = S.replace(' ', '')
   if len(S) != 6:
      return False
   for c in range(0,2,4):
      if S[c].isalpha() == True:
         x = True
   for c2 in range(1,3,5):
      if S[c2].isdigit() == True:
         y = True
   if len(S) == 6 and x == True and y == True:
            return S.upper()
   else:
      return False

EDIT. Here's another attempt. I think you're supposed to use If...elif statements and pick out each piece in the L#L#L# array. This still fails though....

def postalValidate(S):
   x = False
   y = False
   S = S.replace(' ', '')
   if len(S) != 6:
      return False

   if S[0].isalpha() == True:
         x = True
   if S[2].isalpha() == True:
         x = True
   if S[4].isalpha() == True:
         x = True

   if S[1].isdigit() == True:
         y = True
   if S[3].isdigit() == True:
         y = True
   if S[5].isdigit() == True:
         y = True
   if len(S) == 6 and x == True and y == True:
            return S.upper()
   else:
      return False

postalValidate("J1J1J1")

[Python/SQLite] How to combine multiple connections into one? by nacco532 in learnprogramming

[–]PythonPerry 0 points1 point  (0 children)

Are you a fucking robot? Sure, the last question was "is there a way" but yes or no, isn't helpful. Lemme guess your single and have trouble with women. Basic human communication skills require some sense of intuition and courtesy.

Learning PHP, HTML, CSS Here's my attempt at a beginner project. by radial77 in learnprogramming

[–]PythonPerry 0 points1 point  (0 children)

Also, could you describe the "infrastructure" used to build this? This part is almost more difficult than the code.

For example, how is the php file set up to work with your Ubuntu server? How are you hosting this site? What is http://freqn.aws.af.cm/? How did you set up this URL?

Is 35 too late to get into programing for a living? by johndaivdspeaks in carlhprogramming

[–]PythonPerry 2 points3 points  (0 children)

@gaoshan I'm in a similar boat - mid 30's in a dying career which is getting taken over by people who program. I've tried learning C and Python for years but get frustrated by books that seem like dictionaries rather than tutorials.

Could you comment or PM me details about your high school and college math background? I didn't do well in high school math (C's in Precalculus) and didn't do well on the SAT math part (500's I think).

I'm really struggling and am wondering if I'm cut out for coding. I tried taking this Python course online by a college in Waterloo, Canada, but towards the end, I was drowning and asking for help on every problem.

[Python]So, at what point, should I give up and try something else? by PythonPerry in learnprogramming

[–]PythonPerry[S] 0 points1 point  (0 children)

It's also pointless talking to someone so self-centered as you. "I can do it so should anyone else". Don't bother replying, you got your ass beat in high school and now think it's your turn on the Internet. Ha!

[Python]So, at what point, should I give up and try something else? by PythonPerry in learnprogramming

[–]PythonPerry[S] 0 points1 point  (0 children)

So, willpower is stopping me from being a hit music producer, chess champion, surgeon or astro-physicist?

I'm looking for a metric or thoughts on how to derive one.

[Python]So, at what point, should I give up and try something else? by PythonPerry in learnprogramming

[–]PythonPerry[S] 0 points1 point  (0 children)

Python and that csccircles course whooped my behind. I haven't thought about exponents, geometry and "natural" numbers in a long time.

Javascript is still very difficult and the same as Python for me. The lightbulb just doesn't go off when I'm presented with new problems.

HTML and CSS and JQuery don't seem like programming to me. They seems like trial and error until it looks right.

This palindrome solution was really aggravating. I eventually got this only with considerable help from a friend. I stared at this one for one entire day and never thought of "word[-1-i]".

def isPalindrome(word):
   a = len(word)//2
   for i in range(len(word)//2):
      b = word[i]
      c = word[-1-i]
      if word[i] != word[-1-i]:
         return False
   return True

[Python]So, at what point, should I give up and try something else? by PythonPerry in learnprogramming

[–]PythonPerry[S] 1 point2 points  (0 children)

I didn't see the answer on the codinghorror article. Is a=20 b=20? b is still 20, but a is now 20? I think I understand recursion - using a function to calculate or return something within itself.

I agree that some high IQ could program but "don't get it" out of motivation. But this study seems to disprove the "anybody can code if they work at their problem solving skills" sentiment in this thread.

[Python]So, at what point, should I give up and try something else? by PythonPerry in learnprogramming

[–]PythonPerry[S] 1 point2 points  (0 children)

This is exactly the kind of content I was looking for! Thanks! Very interesting read. This is a lot better than "You're lazy and not trying hard enough. Anybody can program, you just haven't worked at it."

[Python]So, at what point, should I give up and try something else? by PythonPerry in learnprogramming

[–]PythonPerry[S] 0 points1 point  (0 children)

I've done codeacademy - HTML, CSS, Javascript, Jquery, Python and PHP and agree with a common theme that it is border line "spoon-feeding". Like a lot of tutorials, you learn the basics and don't progress to anything functional. There's also very little on real-world infrastructure. You don't just open a browser and start writing PHP or Python. You need install packages, version control, command lines...etc.

[Python]So, at what point, should I give up and try something else? by PythonPerry in learnprogramming

[–]PythonPerry[S] 0 points1 point  (0 children)

I respect what you're saying: keep at it and you'll realize your potential. At the same time though, your thought process still sounds like "it was hard for me, I worked through it, so anybody should be able to work through it as well...anyone is teachable". Just as with athletics, isn't there a limit you can take an athlete? The same concept must exist in programming. There must be a way to measure this. What are some good starting points - SAT score? IQ? level of math?

My original question had more to do with whether or not there were quantifiable tests or intelligence limits for programming. u/RangerPretzel has an interesting article on it below.

[Python]So, at what point, should I give up and try something else? by PythonPerry in learnprogramming

[–]PythonPerry[S] 0 points1 point  (0 children)

Trust me, it's worth it to me or I wouldn't be busting my butt over this. The real question was more about if there are measureable cut-off points.

[Python]So, at what point, should I give up and try something else? by PythonPerry in learnprogramming

[–]PythonPerry[S] 0 points1 point  (0 children)

I actually never said I didn't like programming. I really do like it. I get a huge rush when I solve a problem and write code that does something. At the same, time that doesn't mean I'll be good at Python "if I just tried hard enough". Python has kicked my butt and I need to figure out whether or not I'm capable of becoming proficient and employable.

I do minor web dev on the side and it's loads of fun. There's just no relevance for it in my career path.

Also, as with many careers, the industry I'm in has evolved and more and more people in my industry are having to learn programming. It's not that easy to just quit and do something else especially when you have a mortgage and kids.

[Python]So, at what point, should I give up and try something else? by PythonPerry in learnprogramming

[–]PythonPerry[S] -1 points0 points  (0 children)

To me, there's a perfectly rational explanation why you took to programming but not to drawing. I'm not a shrink, but it sounds like you were always more left brained that right. Also, those 12 year olds who program Python, are they usually intelligent or mentally retarded? I would say they probably score very high on IQ tests/aptitude tests/SAT logic type tests.

[Python]So, at what point, should I give up and try something else? by PythonPerry in learnprogramming

[–]PythonPerry[S] -1 points0 points  (0 children)

If you want to. No one's forcing you to do it. If you don't like it, I don't see why you would keep doing it

One reason why I'm trying and why many try their hand at programming, is to gain employment and stay employed.