These are chat archives for learnclang/general

7th
Jan 2015
Fredrik Averpil
@fredrikaverpil
Jan 07 2015 07:47
@mottosso Well, I've been battling setting up 64-bit compilation in a certain environment, for python 2.6 64-bit, and that was really cumbersome and I can't say I fully understand why I had to do what I did to make it work: http://fredrik.averpil.com/post/91583656316 - and all of this to be able to compile packages when pip installing. So I'm not fully experienced to make descisions ;) ... but I think we are going to have a couple of use cases which are pretty much standard for any vfx/visualization work (such as 64-bit) that would be very useful to include in the most basic setup tutorials. So it quickly becomes a larger question when you start taking into consideration e.g. a specific python version... Perhaps the word "evolve" was not appropriate, in terms of designing the guides (as they will grow enormous). Basic, small and easy examples is the way to go forward. Perhaps it would be more useful to extend each setup guide for different purposes. So right now we're having the "hello world" setup guide, which is fine the way it is. But then we probably will need a separate setup guide, or sub-guide, for when you want to do a certain thing, such as compile for python 2.7 64-bit. If we could outline the table of contents of each compiler's setup guide, it would be easy for anyone to pitch in and fill out the info needed.
This message was deleted
Ricardo Viana
@RicardoViana
Jan 07 2015 08:51
Hi @mottosso, I'm unfamiliar with git. If someone makes a screencast about it. Would be fantastic. Also I'm not sure, is the first screencast today Wednesday or tomorrow?
Fredrik Averpil
@fredrikaverpil
Jan 07 2015 08:57
@RicardoViana about the screencast, it seems it was moved from Thursday to Wednesday (I did not see this myself until now when you mentioned it!)
Marcus Ottosson
@mottosso
Jan 07 2015 09:03

That's right, it's on Wednesday.

Screencast Today at 8 PM GMT+0

@ http://www.twitch.tv/learnclang


It was changed shortly after announcing that it was Thursday, sorry about that. If you scroll up, you'll find some more background to it.

I'm still trying to find the best way to keep updates like these from getting lost in the chat, the safest thing to do at the moment is to keep an eye on the repository related to the screencast, we might spend a little more time customising the front-page of the Twitch channel as well.

@fredrikaverpil About 64-compilation of Python plug-ins, we will definitely get into all of that in due time, but keep in mind that at the moment this group is for learning the language - C - and less about compiling plug-ins for various software.
@RicardoViana About a git screencast, glad you said that. Git can be a minefield, so I'll see what I can do about this. And if anyone would like to put up a tutorial or make a screencast about the basics of git, either tell us here, or ping me directly at marcus@abstractfactory.io and we'll make it happen.
Marcus Ottosson
@mottosso
Jan 07 2015 09:34
@/all This should (hopefully) notify everyone of the above!
Fredrik Averpil
@fredrikaverpil
Jan 07 2015 09:50
@mottosso Agreed!
Ricardo Viana
@RicardoViana
Jan 07 2015 09:53
@mottosso @fredrikaverpil thanks guys. I was on mobile and only after i scroll back up the feed i could see the definite date.
Fredrik Averpil
@fredrikaverpil
Jan 07 2015 10:23
@mottosso what do you think about advertising the screencast a bit? Maybe on selected email lists and/or CGTalk etc? It could draw some attention from other TDs/devs which could have a positive effect on the project, don't you think? Is it fine for me to post something onto e.g. 3DPRO and CGTalk?
Marcus Ottosson
@mottosso
Jan 07 2015 15:41
@fredrikaverpil I think that's a great idea, you are very welcome to spread the word!
Marcus Ottosson
@mottosso
Jan 07 2015 15:49

Here are what I would consider key-points for an announcement:

  1. Targeted at absolute beginners
  2. Centered around visual effects/games professionals
  3. Goal is to learn about C, the language, as a vessel for learning more about how the computer (really) works
  4. The screencast is 45 minutes
  5. Host is Sebastian Thiel, former Head of Pipeline at Trixter, Germany (if @byron feels it is appropriate)

Anything else?

maxnbk
@maxnbk
Jan 07 2015 15:51
I'm in!
Fredrik Averpil
@fredrikaverpil
Jan 07 2015 15:56
@mottosso didn't see the key points until now ... and I've already posted to 3DPRO, a slightly edited version of your email (initially sent to the python in maya list). So I think it should be fine. :)
Marcus Ottosson
@mottosso
Jan 07 2015 15:57
You're fast. :) But not to worry, the points are right here, and we might even put them up on the Twitch channel or repository, @Byron?
Fredrik Averpil
@fredrikaverpil
Jan 07 2015 15:59
@mottosso For the visual studio setup quide, looks like VS Community 2013 is the edition to go with? http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx
Sebastian Thiel
@Byron
Jan 07 2015 16:13
@mottosso please feel free to add to the screencast readme file as you see fit. I don't consider it private to me at all.
At Trixter I was Head of Technology, at least that's what they say on linkedin. Not that I would care, after all these titles are quite some nonesense.
Marcus Ottosson
@mottosso
Jan 07 2015 16:20
@fredrikaverpil Looks like the Community edition is the hip thing at the moment, from what I gather it's identical to the professional/ultimate version, but limited in terms of how large of an organisation you can be to use it.
Fredrik Averpil
@fredrikaverpil
Jan 07 2015 16:27
@mottosso okay, I'm downloading that then (community edition) and will attempt to complete the guide.
Marcus Ottosson
@mottosso
Jan 07 2015 16:34

Welcome new members

It's great to see so many new faces here!

As an introduction to what you've gotten yourself into, have a look at this Wiki page, which I will attempt to keep up to date with our latest high-level goals of the group as it evolves.

utopius21
@utopius21
Jan 07 2015 17:04
I'm in. Great idea!
findgus
@findgus
Jan 07 2015 17:04
Hi all, thanks for doing this. Time for me to brush up my coding. Having use that part of the brain properly for quite a while :) Thanks @mottosso for the invite.
Marcus Ottosson
@mottosso
Jan 07 2015 17:34
Thanks @utopius21 and @findgus, and welcome in!
Marcus Ottosson
@mottosso
Jan 07 2015 17:50

Screencast starts in 2 hours, and 10 minutes

lucienfostier
@lucienfostier
Jan 07 2015 19:15
hello, I'm in
Jarombrand
@Jarombrand
Jan 07 2015 19:21
Hello all, Im glad to be here with all you fine people to learn us some C
I second the git screencast idea.
Marcus Ottosson
@mottosso
Jan 07 2015 19:28

@lucienfostier and @Jarombrand, welcome in!

Noted about the a git screencast. If you can, add a +1 in the thread here: learnclang/about#1 so we can keep track of how many are interested.

About asking questions in the screencast

There will be a live chat to the side of the stream that you may ask questions in or converse with other viewers. To ask a question to Sebastian (@byron), try prefixing it with "@byron" so that it becomes a little more clear to Sebastian that it is meant for him.

Also keep in mind that there looks to be a delay between the time of recording and it actually reaching any of us of about 5 seconds or so, which means he won't be able to visually react to questions until double that time (5 seconds to reach him, and another 5 seconds for a response to reach us).

Q&A

There will also be a Q&A after the 45 minute mark during which Sebastian will try and answer any remaining questions.

See you in 30 minutes!
http://www.twitch.tv/learnclang

Marcus Ottosson
@mottosso
Jan 07 2015 20:29
Adding a summary to the stream as we go:
  • Using Qt Creator
  • C++ is (for the most part) a superset of C
  • Compiling C using a C++ compiler is fine
  • <somelibrary.h> means to search System Headers, as opposed to "someotherlibrary.h" which is a user-headers, a convention.
  • Return values of a main() is a value between 0-255
  • 0 means good, anything else is some form of error
  • The return value of main() is what is passed to the called of the executable.
  • Each line ends with a semi-colon
  • Whitespace doesn't matter, as opposed to Python which takes whitespace and newlines into account for syntax.
  • Qt Creator provides code completion and compilation output without leaving the IDE
  • printf() doesn't add a newline by default, as opposed to Python's print which does.
  • void means nothing
  • In C++, void is the same as passing nothing.
  • in C++, not specifying any arguments, any amount of arguments may be passed to the function.
  • int main(int argc, char* args[]): First argument is the amount of arguments that have been passed, the second argument contains the names of arguments as an array.
  • Always check your arguments!
  • fprintf provides an option to print to stderr, which is the error stream as opposed to stdout which is regular output. Both of these channels exist in Python as well
  • Use const for reusable constant values
  • #define replaces text before compilation, which can produce hard-to-discover bugs. Better to use standard variables.
  • ..Read up on pointers. :)
Marcus Ottosson
@mottosso
Jan 07 2015 21:02
Continued:
  • ..Read some more about pointers
  • Host a screencast on Pointer Theory. :)
  • Study pointers
  • Eat pointers for breakfast
  • Find a pointer, and beat it up
Sebastian Thiel
@Byron
Jan 07 2015 21:02
I will prepare the project so you can have a look at it yourself
Fredrik Averpil
@fredrikaverpil
Jan 07 2015 21:02
Sorry if this sounds dumb, but all of what we saw should compile on any platform, using any C/C++ compiler?
Marcus Ottosson
@mottosso
Jan 07 2015 21:02
Ok, I tried keeping up with points made during the screencast so I could summarize it, but I have to admit I got a little lost somewhere during the pointers :)
@fredrikaverpil Yes, I believe so
dekorkh
@dekorkh
Jan 07 2015 21:03
lol
Marcus Ottosson
@mottosso
Jan 07 2015 21:03
Whether something compiles on various platforms is essentially dependent on which #include's you do, like #include <windows.h> which is only available on Windows, for instance.
Is that right, @Byron?
David Martinez
@davidmartinezanim
Jan 07 2015 21:05
@mottosso I think that we could do a lot of work on a wiki for the repo of the screencast and have some questions in the form of issues so we develop the wiki as needed?
Marcus Ottosson
@mottosso
Jan 07 2015 21:06
And the headers he mentioned that were enclosed in <> (ie. system headers) are part of the language itself, and should exist on any platform.
@davidmartinezanim Good idea!
Fredrik Averpil
@fredrikaverpil
Jan 07 2015 21:06
@davidmartinezanim +1
dekorkh
@dekorkh
Jan 07 2015 21:07
I super recommend the K&R book for companionship during the lonely gaps between screencasts. http://www.amazon.com/C-Programming-Language-2nd/dp/0131103628/ref=sr_1_1?ie=UTF8&qid=1420664628&sr=8-1&keywords=K%26R+c+language
Marcus Ottosson
@mottosso
Jan 07 2015 21:08

Questions about the screencast

First of all, thanks for everyone who attended, hope you found it as informative and mindboggling as I did! :)

For any questions, feel free to speak up here or post a thread in the GitHub issues section here:

https://github.com/learnclang/screencast-1-rps/issues/new

Issues will be a little easier to maintain and store, as they will keep persistent and allows for streams of comments to be properly separated.
+1 on the K&R book, it looks to be a legend when learning about C!
Sebastian Thiel
@Byron
Jan 07 2015 21:10
Yes, the project will compile and run everywhere
David Martinez
@davidmartinezanim
Jan 07 2015 21:11
thanks a lot for the screencast @Byron
Cesar Saez
@csaez
Jan 07 2015 21:12
+1
The stream was a lot of fun, thanks @Byron
granier
@yoann01
Jan 07 2015 21:18
that was really interresting thanks !
Marcus Ottosson
@mottosso
Jan 07 2015 21:18

There are also some resources available in the Wiki for the organisation, here:
https://github.com/learnclang/about/wiki/Resources

Learn C the Hard Way is also a very interesting read, on the more practical side of things, as opposed to K&R which is more academic and theory.

Sebastian Thiel
@Byron
Jan 07 2015 21:18
Great you liked it - next one will be even nicer thanks to the pointer fhun
David Martinez
@davidmartinezanim
Jan 07 2015 21:19
looking forward to go crazy with pointers :-P
Fredrik Averpil
@fredrikaverpil
Jan 07 2015 21:19
yes, thanks bunch @byron!
elpie89
@elpie89
Jan 07 2015 21:20
+1
Sebastian Thiel
@Byron
Jan 07 2015 21:20
The program can now be found on github: https://github.com/learnclang/screencast-1-rps
Marcus Ottosson
@mottosso
Jan 07 2015 21:20
David Martinez
@davidmartinezanim
Jan 07 2015 21:20
hehe
Marcus Ottosson
@mottosso
Jan 07 2015 21:21
Sorry ;D
Fredrik Averpil
@fredrikaverpil
Jan 07 2015 21:23
@mottosso I took the liberty of adding OIIO to "Goals" in the wiki
David Martinez
@davidmartinezanim
Jan 07 2015 21:23

I tried to compile it with gcc and I got an error saying that loop initial declarations are only allowed in C99 mode

I've been able to compile though using the following syntax:

gcc rps.c -o rps.exe -std=c99

Marcus Ottosson
@mottosso
Jan 07 2015 21:23
@fredrikaverpil That's great!
Fredrik Averpil
@fredrikaverpil
Jan 07 2015 21:24
@davidmartinezanim that should get added to a comment in the .c file, perhaps?
David Martinez
@davidmartinezanim
Jan 07 2015 21:25
probably. or to the repo. Plenty of new stuff for me today
Cesar Saez
@csaez
Jan 07 2015 21:40
Maybe because of this?
error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
David Martinez
@davidmartinezanim
Jan 07 2015 21:40
yep
Cesar Saez
@csaez
Jan 07 2015 21:42
you can declare the variable outside the for loop and everything should work just fine
also, bool include is not used anymore
Kris
@jetka
Jan 07 2015 22:10
Hello everybody! I would like to take part of it, @mottosso can You add me, please :)
Oliver Markowski
@ultra-sonic
Jan 07 2015 22:12
sorry for being late to this party...i guess it's already over for today, is it?