NUF Programming Club's Learning Corner

Discussion in 'Tech Discussion' started by holyshin, Mar 3, 2017.

  1. Qt

    Qt Qt is cute

    Joined:
    Mar 8, 2017
    Messages:
    352
    Likes Received:
    145
    Reading List:
    Link
    white hat? perhaps you can find some stuff in /r/opendirectories or something in reddit. I've got some book and tutorial there. But never feel the need to read it, so it lays abandoned somewhere.
     
    udonsage and Mau like this.
  2. Dragon God

    Dragon God {King of Peasants} {Tanya's Husbando}

    Joined:
    Jan 3, 2017
    Messages:
    1,862
    Likes Received:
    621
    Reading List:
    Link
    I second this.

    Guess I'll be keeping an eye on this thread.
     
  3. Dragon God

    Dragon God {King of Peasants} {Tanya's Husbando}

    Joined:
    Jan 3, 2017
    Messages:
    1,862
    Likes Received:
    621
    Reading List:
    Link
    Learn to code first.

    Later visit www.hackthissite.org

    Take their lessons.
     
  4. Mau

    Mau S m i l e

    Joined:
    Apr 8, 2016
    Messages:
    268
    Likes Received:
    586
    Reading List:
    Link
    I know how to code. (studied IT)^^
     
  5. Dragon God

    Dragon God {King of Peasants} {Tanya's Husbando}

    Joined:
    Jan 3, 2017
    Messages:
    1,862
    Likes Received:
    621
    Reading List:
    Link
    Check the link then. Welcome to the Dark Side. &_&
     
  6. Hastur

    Hastur Active Member

    Joined:
    Mar 12, 2017
    Messages:
    17
    Likes Received:
    6
    Reading List:
    Link
    What is &_& ? I've see it appearing a lot more lately, enlighten this traveller.
     
  7. Dragon God

    Dragon God {King of Peasants} {Tanya's Husbando}

    Joined:
    Jan 3, 2017
    Messages:
    1,862
    Likes Received:
    621
    Reading List:
    Link
    I just made it up a little while ago. I was frustrated with not getting some emotes, so I decided to share my pain.

    It means: whatever you think it means.

    Or it can mean fire eyes. _
     
  8. Hastur

    Hastur Active Member

    Joined:
    Mar 12, 2017
    Messages:
    17
    Likes Received:
    6
    Reading List:
    Link
    I see, I had a quick google while I was waiting

    So look out not to get into any misunderstanding
     
  9. Dragon God

    Dragon God {King of Peasants} {Tanya's Husbando}

    Joined:
    Jan 3, 2017
    Messages:
    1,862
    Likes Received:
    621
    Reading List:
    Link
    @_@ Oh well.
     
  10. Aizelf

    Aizelf 『....』

    Joined:
    May 8, 2016
    Messages:
    501
    Likes Received:
    290
    Reading List:
    Link
    (python)
    How do you get to know whether a character in string A is in string B? I just need to know if at least one character is common in both of them.
    for eg.
    x = 'asdf'
    y = 'fghj'
    In this, we know that 'f ' is common. How to make a program to find out whether x and y have a character in common?
    (Since I don't need to to find the substring x in y or vice versa, I cannot use in or .find , right?)
     
  11. Truerror

    Truerror Well-Known Member

    Joined:
    Jan 10, 2016
    Messages:
    546
    Likes Received:
    292
    Reading List:
    Link
    Except a character is a substring in python. So the simplest way is to iterate through x and see whether the current character is in y, in which case, both in and find() are viable.
     
    Aizelf likes this.
  12. noisypixy

    noisypixy Sacatunn que pen, que summum que tun.

    Joined:
    Jun 25, 2016
    Messages:
    716
    Likes Received:
    950
    Reading List:
    Link
    Code:
    set(x).intersection(y)
     
    keklel, Aizelf and Truerror like this.
  13. Truerror

    Truerror Well-Known Member

    Joined:
    Jan 10, 2016
    Messages:
    546
    Likes Received:
    292
    Reading List:
    Link
    Neat. I didn't know Python has goodies for set operations. Thank you.
     
  14. Aizelf

    Aizelf 『....』

    Joined:
    May 8, 2016
    Messages:
    501
    Likes Received:
    290
    Reading List:
    Link
    (sorry for the late reply)
    hmm...when you just do x in y, the whole substring x is searched in the same sequence in y. But I only wanted one character. I guess loop is the best option. Here is what I wrote (I have just started functions; I originally wanted this for writing a function):
    def isIn(x, y):
    for i in x:
    if i in y:
    return True
    return False # defined the function
    w = 'qwefsdsav'
    q = 'asdaugfwq'
    print(isIn(w, q))
    True :)

    Too simple to be true. But sadly I am a novice. I will have to stick to loops right now :/
    thanks
     
    Last edited: Apr 18, 2017
  15. Truerror

    Truerror Well-Known Member

    Joined:
    Jan 10, 2016
    Messages:
    546
    Likes Received:
    292
    Reading List:
    Link
    I know, right? This is why Python has a wide fanbase. It's simple and it comes equipped with lots of nice things.

    Also, I think your solution is good enough. However, @noisypixy showed us a cleaner one. Note that according to Python's docs, you should use frozensets instead of sets because set() was deprecated in 2.6.
     
  16. noisypixy

    noisypixy Sacatunn que pen, que summum que tun.

    Joined:
    Jun 25, 2016
    Messages:
    716
    Likes Received:
    950
    Reading List:
    Link
    It's the sets module that was deprecated, not the set/frozenset builtins.
     
  17. Truerror

    Truerror Well-Known Member

    Joined:
    Jan 10, 2016
    Messages:
    546
    Likes Received:
    292
    Reading List:
    Link
    Yeah, I see it now. Thanks.
     
  18. MrNebulist

    MrNebulist Well-Known Member

    Joined:
    Feb 5, 2016
    Messages:
    755
    Likes Received:
    553
    Reading List:
    Link
    this thread had no replies for over a month :/
     
  19. NeoUsui

    NeoUsui [Melon Lord] [Unrivaled Super Hottie]

    Joined:
    Sep 4, 2016
    Messages:
    199
    Likes Received:
    165
    Reading List:
    Link
    I know, right? >: I'm still waiting for my guide....
     
    MrNebulist likes this.
  20. Truerror

    Truerror Well-Known Member

    Joined:
    Jan 10, 2016
    Messages:
    546
    Likes Received:
    292
    Reading List:
    Link
    What guide?