1. Welcome to NoFap! We have disabled new forum accounts from being registered for the time being. In the meantime, you can join our weekly accountability groups.
    Dismiss Notice

Programming My Brain in Python

Discussion in 'Off-topic Discussion' started by Nathan Harris, May 12, 2021.

  1. script

    script Fapstronaut

    I'm also a python developer. I'm working on a web-app that I don't feel comfortable talking about here...
    But what I can tell you is the technology I use.

    It's built on a microframework called Flask that I have infused with libraries to the point that it's not micro anymore (still not sure that to make of that, was it good, bad, idk). My database is mongoDB which I manage via python as well. Up front I'm trying to use basic stuff (HTML, CSS, JS) but it seems like I'll have to use some more extensive js-libs, although I'm not happy about it at all. Anyways... lately I'm been writing something like a small css-framework that I really like.
    The whole thing will be running on debian with some gunicorn-workers.

    Oh and I used to play around with C++ for while as well, although I have no skills working with the standard-libs as I was working with Qt5 back then. But I want to get back into it to work on a visual programming-language frontend (with Qt6 of course).
     
    Nathan Harris likes this.
  2. Nathan Harris

    Nathan Harris Fapstronaut

    31
    1,122
    113
    *Pro Programmer has entered the chat*

    Well I am not a professional one and I just code for fun. Lately I've been working on making a Facebook clone. I used HTML, CSS, JS, Jquery at the front-end, MySQL for Database and PHP at the back-end, but I'm thinking of shifting to django framework for smoother development with it's template and all.
    Then Machine learning(AI) with python is going to be my next goal.
    Writing your own CSS framework? that sounds amazing but I have no idea about debian and gunicorn workers.
     
    Last edited: May 12, 2021
    I'M DC and <script> like this.
  3. script

    script Fapstronaut

    This is by far not complicated enough:

    Code:
    # if you find bugs you can eat them
    from nofap import NoFap, NoFapperMixin
    
    class NathanHarris(NoFapperMixin):
    
        def dont_peek_forever(self):
            while True:
                # adds instance to NoFap database for non-peekers
                NoFap.dont_peek(self)
    
        def run_routine(self):
            while True:
                if self.is_horny:
                    super.meditate()
                elif self.is_unoccupied:
                    super.study()
                    super.exercise()
                    super.no_pmo()
    
        def __init__(self):
            self.is_horny = False
            self.is_unoccupied = True
            self.peeking_thread = Thread(
                target = dont_peek_forever
            ).start() # does this return the thread? I just yolo'd this, lol
            self.routine_thread = Thread(
                target = run_routine
            ).start()
    
    
     
    Last edited: May 12, 2021
    Nathan Harris and kropo82 like this.
  4. script

    script Fapstronaut

    Django is kind of like Flask, but it has more functionality right out of the box. It would probably really get you going if you want to get into front-end. Corey Schafer on youtube has some really great tutorials on Flask and I assume his Django Tutorials are just as good. I'm new so I can't post links, so just go ahead and search youtube for "Corey Schafer - Python Django Tutorial" if you're interested.

    I wish you the best in learning to become a great programmer ;)
     
    Nathan Harris likes this.
  5. Nathan Harris

    Nathan Harris Fapstronaut

    31
    1,122
    113
    I have been watching tutorials of "programming with mosh" and "mike dane", they are also great and I'll surely check out your suggested youtuber.
    Thank you so much <script>!
     
    I'M DC and <script> like this.
  6. Nathan Harris

    Nathan Harris Fapstronaut

    31
    1,122
    113
    :eek:...............
    Just reading this code faded my horniness.
     
    I'M DC and <script> like this.
  7. Anti-Hero

    Anti-Hero Fapstronaut

    260
    421
    63
    My eyes! I'm generally against death penalty but I'd make an exception for people who write if x == True: instead of just if x:
     
    I'M DC, kropo82 and Nathan Harris like this.
  8. Anti-Hero

    Anti-Hero Fapstronaut

    260
    421
    63
    Good old C89 doesn't allow // comments.
     
    Nathan Harris likes this.
  9. Anti-Hero

    Anti-Hero Fapstronaut

    260
    421
    63
    Because of the nofap.com() part. C doesn't have methods.
     
    Nathan Harris likes this.
  10. Anti-Hero

    Anti-Hero Fapstronaut

    260
    421
    63
    You're making a desktop UI but not in Electron? You, sir, are a saint.
     
    Nathan Harris likes this.
  11. script

    script Fapstronaut

    I had to look up what Electron was, seems like it's built on Node.js, which is not suitable for my kind of application. Didn't know that VSCode is running on that, now I know why it's so slow sometimes...
    But yeah, I'm looking into LLVM atm, trying to figure out if it makes sense to write a small compiler frontend for my GUI, but that's in the future.

    On another note: Maybe try being less harsh to programming beginners. I get it you're just trying to correct some mistakes probably, but people here are already having a bad time with their porn-addictions. Just a lighthearted suggestion.
     
    Anti-Hero and Nathan Harris like this.
  12. Nathan Harris

    Nathan Harris Fapstronaut

    31
    1,122
    113
    C89 became obsolete before I was even born, why do we need to talk about that.
    How can you say it's a method and not a function, I don't think he meant to access com() method from class Nofap, that doesn't make sense. right? but I get the point.
     
  13. I was just referring to what I have written above. Moreover I am very new to these things so pardon me.
     
  14. Anti-Hero

    Anti-Hero Fapstronaut

    260
    421
    63
    Then you're not alive yet I guess :D C89 might be outdated but definitely not obsolete. The newer standards are still not supported everywhere and also it's not like there's a lot of changes in C anyway.
    Dots are not allowed in function names.
    But I was wrong, C structs can have function pointer members so this piece of code in fact could be legal C.

    I don't get this. If you're making a custom language, how could you opt out of building a compiler for it?
     
  15. Anti-Hero

    Anti-Hero Fapstronaut

    260
    421
    63
    The bros here can take the heat quite well. No need to worry about them.
     
    Munchausen and <script> like this.
  16. Nathan Harris

    Nathan Harris Fapstronaut

    31
    1,122
    113
    I am also a beginner and this is how we all learn. I also did some mistakes and there are people who will point out our mistakes, so we can improve.
    Don't ask for pardon, you didn't committed crime, maybe pardon me if I was rude.
     
    Last edited: May 12, 2021
    Selfdiscovery and Munchausen like this.
  17. script

    script Fapstronaut

    I'd still need to write a small part of a compiler, the frontend. The rest is possible because of how LLVM works: You can build a frontend with a tokenizer, parser, AST and codegen for LLVM-IR which is an intermediate representation of logic, you could say it's a higher level assembly-language. That LLVM-IR then proceeds into the other parts of the compiler toolchain allowing for optimization and such. So I don't need to write the whole compiler, I just nest myself within the existing toolchain and let LLVM do the heavy-lifting.
    But again, I don't know if I need the abstraction to create a small language for my frontend-GUI, the geek in me finds it incredibly cool, but it's a lot of work and might be unnecessary. Especially since C++ and it's features let me do so much already.
     
    Anti-Hero likes this.
  18. Anti-Hero

    Anti-Hero Fapstronaut

    260
    421
    63
    Yeah, I understand that part, generating x86 would be a hella lotta work.

    What I still don't get is how can you make an IDE for your own visual or whatever other language and not make a compiler, with LLVM or without it. I guess the other option is building an interpreter instead?

    Incidentally, I'm supposed to make something very similar as a school project.
     
  19. script

    script Fapstronaut

    So, have you heard about Flow-Based-Programming? That's what my "IDE" would look like. I pretty much want to create logic in a visual way to organize large chucks of it in a better way than how it's done today. I guess what I want to see is a platform that would allow me to create an app-structure in a more sophisticated way. Where I can share data with other programmers within projects, kind of like a network of dataflow that basically is the program. But the question then is, what is interpreted and what might be better compiled and into what. I mean, these thoughts are by no means evolved to the point where I's consider them to be good enough to start programming that thing. I'll have to grapple with it whenever I'm getting substantial income to I can afford to work on the project.

    There are other ideas I want to integrate into that project, but these ideas are not very well organized, which makes it hard for me to talk about them in a meaningful way. I shot my shot I guess.

    PS: I guess it's not really a programming language then, at least not as I described it there
     
    Last edited: May 13, 2021
  20. Anti-Hero

    Anti-Hero Fapstronaut

    260
    421
    63
    I see. The project I'm supposed to work on is just a simple procedural language - the visual part is just for the ease of use.

    Yours is a whole new concept. I guess it would be more akin to a functional language with lazy evaluation and things like that...
     
    <script> likes this.

Share This Page