1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cameron's Help Panel

Discussion in 'Software/Coding' started by repository, May 4, 2015.

  1. repository

    repository Member

    Joined:
    May 3, 2015
    Messages:
    37
    Likes Received:
    127
    Trophy Points:
    33
    Gender:
    Male
    Home Page:
    Hi Everyone!

    Just thought I'd put this up in the meantime whilst I am working on my second programming tutorial.

    So ... here goes! :

    I will be able to provide full support with Java :
    • Anything bukkit-related (all the way from things such as locations to custom events, etc).
    • Most things application-related (for example graphical user interfaces, threading [pools, sync/async logic, executorservices, etc], and more).
    • Anything to do with the following databases (could be perks and cons, how they work, how to integrate and use the java-driver, etc).
    • Anything else that you may be stuck with! Whether it be private nested classes, static inner classes, generics (both level and class), functions and procedures, different primative and data types, abstraction, encapsulation, etc.
    • Anything software-related to do with Java (IDE selection, Git management, etc).
    I'll also be able to support you with a lot of other languages (C++, Python, and many more).

    I am just presuming you want to learn java since this is a minecraft related forum.

    Terms and conditions

    Sounds a bit strict ^ ! I know, but just to clarify the following :

    - Do not expect me to reply straight away, but I will reply.
    - Also, do not ask me to write all of the code for you - I will not do that.
     
  2. kkbubble

    kkbubble Member

    Joined:
    Mar 17, 2014
    Messages:
    1,610
    Likes Received:
    733
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    IM STALKING ORANGEGRAPEEATER
    Location:
    The chair in between good and evil
    seems cool :)
     
    repository likes this.
  3. repository

    repository Member

    Joined:
    May 3, 2015
    Messages:
    37
    Likes Received:
    127
    Trophy Points:
    33
    Gender:
    Male
    Home Page:
    I missed the actual databases I could provide support with! :

    MongoDB, Redis, CouchDB, PostgreSQL, MySQL.
     
  4. SevereWarning

    SevereWarning Member

    Joined:
    Nov 14, 2013
    Messages:
    5,677
    Likes Received:
    3,672
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    not much
    Location:
    Somewhere
  5. repository

    repository Member

    Joined:
    May 3, 2015
    Messages:
    37
    Likes Received:
    127
    Trophy Points:
    33
    Gender:
    Male
    Home Page:
    Update :

    Added to terms and conditions : "Don't ask stupid questions." xD
     
    SevereWarning likes this.
  6. snoepeter21

    snoepeter21 Member

    Joined:
    May 18, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    How did you learn to code. Because i want to learn to code, but everything what i find are pre-made examples that they just re-type. And they do not give any information how it works and how you can use if differently.
     
  7. repository

    repository Member

    Joined:
    May 3, 2015
    Messages:
    37
    Likes Received:
    127
    Trophy Points:
    33
    Gender:
    Male
    Home Page:
    If you have the patience of reading a book, then there are some really good in-depth books on whatever language you want to make a start on. I've personally been reading an intermediate PHP book recently and learning alot from it (although they are quite tedious at times) [I've also been practicing HTML and Javascript and also CSS along with this, getting really into web-development!].

    If you are more about watching tutorials on youtube, then go for that. I would be very careful when doing this however, as many people showcase bad practices in their tutorials which are against the language conventions (search them the language conventions if you are going to look at youtube tutorials and bare them in mind!).

    Another great way to learn a programming language is by looking at other people's projects they have developed. Developers call these 'git projects'. There are quite a few websites that support git, but the most popular one is http://www.github.com ... You can also contribute to git projects, etc, to enhance your knowledge!

    You could learn off of friends/forums if you like doing that too. I used to spend alot of time over at http://www.cplusplus.com when I was first learning C++, and I still do occasionally go back if I am stuck whilst making a program in C++.

    My foremost advice is : You have to explore the language and learn the syntax (how it looks) and also experiment on how things work. Find an application/plugin/etc that you want to make and try and do it (first of all looking at a tutorial if you are unsure on how to do it, and then redoing it without the use of tutorials and making it more complex).

    Quite often an IDE (Developer's platform program for coding a programming language) will suggest what methods you use, so just test them out and see what they do!

    Hope this helps,
    Cameron
     
    Drew McNamee likes this.
  8. alyphen

    alyphen Member

    Joined:
    Jan 4, 2014
    Messages:
    101
    Likes Received:
    96
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Technical Consultant
    Location:
    127.0.0.1
    Home Page:
    Happy to also offer advice, just some points so far:

    Books can be nice, but I think what really got me off the ground was text tutorials on the internet since you can look for incredibly topic-specific things, and stuff that wouldn't be covered by a general books can usually be found somewhere.

    Luke (rubik_cube_man) used this a lot, and it showed up in a lot of his early code - once you've got the hang of it though, you can read a lot more of other people's code, and this tends to neaten it up a lot. You learn what's idiomatic in a language as opposed to what can be ported easily between languages quickly.

    'git repositories' is actually the correct term for this, and not all of other people's projects are available in git repositories (probably worth making the distinction, as some people still use subversion or CVS, and some projects may have migrated to bazaar or mercurial instead)

    cplusplus.com is great for learning the basics of C++, but past that I haven't really found it useful.

    Best advice is simply to read a lot of code, and write a lot of code.

    Lastly, would it be possible to do some information on modern OpenGL (3 & 4), through both JOGL in Java and GLEW/GLFW in C++? I think it would be interesting to do something on the workflow from modelling software > rendering, and just showing some simple gamedev tips, for example a 3D maze game.
     
  9. repository

    repository Member

    Joined:
    May 3, 2015
    Messages:
    37
    Likes Received:
    127
    Trophy Points:
    33
    Gender:
    Male
    Home Page:
    - Yeah, fair - plus books cost money! So reading documentations on the internet can be a really good way to go, if you want to learn something specific.

    - My bad calling them projects instead of repositories :p

    - Yeah it's tutorials are generally quite handy. Even though it is a classic example of how you can't rely on tutorials for everything. For example on their tutorials for pointers when I first started, I really did find it hard to understand until I went out there myself and experimented writing code and researching more on the differences between pass-by-reference and pass-by-value. Suprisingly they do lack a lot of essential C++ topics too, such as the difference between .h (header files) and .cpp files.

    - And as for that advice - couldn't agree more!

    - I am super busy with exams currently, so it may have to wait! I was contemplating how I was going to carry on the programming tutorials in my head and what route I should actually take. I think it was agreed upon by some friends that I'd do videos on each one.. but not exactly the languages and the topics I'd cover. :p

    I feel like going over all of the concepts of Java in tutorials and then making Bukkit plugins with that.

    Ocassionally I also want to go over alot more generalised computing too, such as the different data structures and pro's and cons of using certain databases - probably with examples using the Java driver.

    I guess the only way to find out what people want is to do a poll sometime :p
     
  10. Trickmaster

    Trickmaster Member

    Joined:
    May 23, 2014
    Messages:
    1,178
    Likes Received:
    926
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Potato Heaven
    So here's an actual coding question (I'm just starting with the basics but its just a concept I'm wondering about)

    So the language is Python, and I'm wondering between the relationship between variables and functions. So lets say you have this code in the Python shell:

    >>>def sum(number1 , number2):
    print ('The sum is', number1 + number2,)

    >>>answer = sum(1, 3)

    You would get a line that says, The sum is 4.

    But my question is, if a variable in Python puts the value of the expression on the right (the function sum(1,3)) in a memory address, then stores the memory address in the variable, why does the function run and execute with an answer of "The sum is 4." I thought variables were only supposed to store things(expressions), not run things(functions).
    So shouldn't the line of code,

    >>>answer = sum(1, 3)

    return with nothing because the action is simply storing a value in the variable answer?


    P.S. I'm taking an online class on Coursera, thats where im learning this.
     
  11. Trickmaster

    Trickmaster Member

    Joined:
    May 23, 2014
    Messages:
    1,178
    Likes Received:
    926
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Potato Heaven
    Sorry about the spacing on the definition, it entered wrong :p
     
  12. Trickmaster

    Trickmaster Member

    Joined:
    May 23, 2014
    Messages:
    1,178
    Likes Received:
    926
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Potato Heaven
    Definition of the function I mean :p
     
  13. alyphen

    alyphen Member

    Joined:
    Jan 4, 2014
    Messages:
    101
    Likes Received:
    96
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Technical Consultant
    Location:
    127.0.0.1
    Home Page:
    The function runs when you call sum(1, 3) - so the print statement is run. Since there is no return statement, no value is stored in the answer variable. If you wanted to store something, you would use the following:

    >>>def sum(number1, number2):
    >>> return number1 + number2
    >>>
    >>>answer = sum(1, 3)

    The function is evaluated and the result stored in the variable 'answer', so the function is run first before the result is stored.
     
    Trickmaster likes this.
  14. Trickmaster

    Trickmaster Member

    Joined:
    May 23, 2014
    Messages:
    1,178
    Likes Received:
    926
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Potato Heaven
    Oh so the expression(function) on the right of the assignment statement is run first- ah ok.
     
  15. Camel

    Camel Member

    Joined:
    Jun 12, 2015
    Messages:
    18
    Likes Received:
    19
    Trophy Points:
    3
    By any Chance do you know anything about Kali Linux?

    If so Can you help me with a MITMF module, my Hook.js fails to Inject the Test lan Ip and I can't figure out why.
     
  16. repository

    repository Member

    Joined:
    May 3, 2015
    Messages:
    37
    Likes Received:
    127
    Trophy Points:
    33
    Gender:
    Male
    Home Page:
    @Camel I know of Kali Linux, yes.

    Even though I prefer not to use it (purely because I feel as though I could do a better job at writing my own MITM attack vector script or be it an SQL injection; which I would do manually, etc)..

    DM me though! I'd be more than willing to help, providing you're learning for the right reasons. ;P
     
    Camel likes this.
  17. Trickmaster

    Trickmaster Member

    Joined:
    May 23, 2014
    Messages:
    1,178
    Likes Received:
    926
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Potato Heaven
    In general, should we end function definitions in a return statement in Python?
     
  18. Trickmaster

    Trickmaster Member

    Joined:
    May 23, 2014
    Messages:
    1,178
    Likes Received:
    926
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Potato Heaven
    Nevermind, I found an answer in a separate forum.
     
  19. repository

    repository Member

    Joined:
    May 3, 2015
    Messages:
    37
    Likes Received:
    127
    Trophy Points:
    33
    Gender:
    Male
    Home Page:
    ok :p
     
  20. Trickmaster

    Trickmaster Member

    Joined:
    May 23, 2014
    Messages:
    1,178
    Likes Received:
    926
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Potato Heaven
    Python question: (Its about methods and slicing)

    Heres the following code:
    >>> #A quote from Alice in Wonderland
    >>> white_rabbit = "I'm late! I'm late! For a very important date!"
    >>> white_rabbit.find('late', 7)
    14

    My question is, if you can find a slice of a string like so:
    >>> white_rabbit[:19]

    to get the bold part of the string, "I'm late! I'm late! For a very important date!"

    How can you pass an argument for index end of white_rabbit.find? Something like
    >>> white_rabbit.find('late', 19]) doesn't work. Can someone explain the syntax of str.find:

    find(...)
    S.find(sub[, start[, end]]) -> int


    Return the lowest index in S where substring sub is found,
    such that sub is contained within S[start:end]. Optional
    arguments start and end are interpreted as in slice notation.

    Return -1 on failure.


    I know the [ are for optional arguments, but you don't put them in a method call? Like,
    >>> white_rabbit.find('late', 7)

    doesn't require brackets even though 7 is being passed in as the index start.

    Help on what the syntax symbols mean would be helpful.