hbtn pinned items

Thursday, May 18, 2017

daniel [8:34 PM]

Hi all. I just discovered a nasty thing. `errno` is not allowed in the `shell project`, specifications, and I got docked points for using it. I had made a mistake and assumed I had was forced to use it.

Julien interviewed me today and I learned of the command `gcc -E`. This can be a useful tool when compiling your own programs. Essentially, it spits out the result of the pre-processor to `stdout` after it’s done parsing your file, without moving forward to the compilation phase. This revealed to me that EOF was `0`, and I had mistakenly assumed EOF was `-1`, which led me to use `errno`.

I think that moving forward I am going to be more collaborative with others, and I encourage others to do the same. Slack has the unfortunate side effect of eating your messages after a while. I know this is a problem, since all our notes will be lost, and it would be useful to have a more permanent record of the hard work we make when we write posts like these. Therefore, each one of these notes I will keep locally, and I will compile them into a useful record.

daniel [8:55 PM]

P.S.: If you want something pinned, please message me with the slack link to your message (for example, click ‘Copy Link’ under the … button next to each message) , and I will manually add it to the record. I have made the record available at https://hbtn-pins.neocities.org. #pinme

electra [9:01 PM]

I like the neocities idea. It's cute!

bennettbuchanan [9:43 PM]

It would be amazing to have questions that have been discussed on slack tracked and organized.

egsy [9:53 PM]

one of my standups was about slack conservation --- posted the link then but here's the link again :smile: (i used to be slack admin at the school i worked at before holberton) https://drive.google.com/open?id=1FdCK0YN-zLkhrYFFGnHBcKTXhygZM6oSsl-upRb3KFE


Friday, May 19, 2017

daniel [6:33 AM]

So, I hope no one else gets confused by the post yesterday. To clear up any confusion, EOF is indeed `-1`. And also, it seems that `getline` function returns `-1` in both in case of error and in case of EOF being found. #pinme


Saturday, May 20, 2017

daniel [1:12 AM]

Hi all, I had a discussion with @gautie_a about some improvements to make on this project. I am trying to establish a system where we can give feedback on the project requirements and corrections to make it more clear what’s going on. Again, I’m the only one that seems to want to actually do something about this, so I would appreciate any support I can get on this. Right now, I’m going to basically be posting on Slack from time to time, and I hope that by pointing out these issues that I am not offending anyone, as assigning blame is not my goal.

With the above disclaimer, there is a suggestion that I can think of, and that is the following. On my correction for the shell project, I had apparently searched the PATH for programs to execute. I lost points on the correction. However, in trying to fix this, I noticed that the correction is set up in a way that there is little information about the errors, and sometimes the the tests themselves are not very well stated, meaning it’s hard to figure out what exactly failed in our tests.

```0.0 out of 10 points - Test "ls_mirror" => PATH = current path and execute copy of /bin/ls Reason: - [Got] CHECK OUTPUT: KO STDOUT: STDERR: (32 chars long) [Expected] OK (2 chars long) ```

#pinme

olivierc [1:18 AM]

I can of aggree with you, I think the test should be probably giving more information. But I also know the problem where students will only fix their code to pass tests. So the main problem is to find a good description without giving the full test information. Also I know @ju want all of you to brainstorm together on tests. I think it is also very important that you work together in having a common set of tests.

daniel [2:50 AM]

Olivier helped me out a lot via private message with some issues I had with my shell. #pinme

siphan [4:35 AM]

Hi Daniel, i hope you've figured out solutions to your shell errors.

[4:36] You probably already know about this, but just in case https://github.com/glyif/shellfish

daniel [9:38 PM]

If anyone wants to confirm this, there is something I’m not sure about this line. It seems that valgrind does not detect the presence of this free, and I’m not sure if that’s because my code is wrong, or because this is a limitation valgrind cannot overcome. https://github.com/dalzuga/simple_shell/blob/789388e281ab205e42e554b277f0e593dc59d160/get_fpath.c#L87

The only thing I can think of is that there is no way for valgrind to detect errors before execve calls it. If this is the case, I would like to be sure of it so I can be aware of this limitation and thus be able to check these edge cases separately in addition to running valgrind.

olivierc [11:48 PM]

Do you use --trace-children=yes ?


Sunday, May 21st, 2017

daniel [4:45 AM]

I did not know about this command. It is a really good one though, I’ll add it to my valgrind. I thought this command would show it, but it appears that when I do “echo `hi`” it does not detect any leaks, even when the `free` is omitted. This seems to be very advanced, so I’m going to leave it be, unless someone else has any ideas.

olivierc [4:50 AM]

I dont think it can detext it anyway

[4:50] execve will simply replace the wall heap of your code

[4:50] so basically you are not going to leak anything, because your allocation will simply not exists any more

sites.google.com/holbertonschool.com/batch3 soon.

Wednesday, May 24, 2017

concati [9:33 AM]

Memory Allocation Spreadsheet (View only) https://docs.google.com/a/holbertonschool.com/spreadsheets/d/1fB0c9JOef7K6dXcvFQADmwPtu9oYaFvTol8EK_9fZz4/edit?usp=sharing


Saturday, May 27th, 2017

daniel [3:38 AM]

sometimes the checker shows a border when it shouldn’t. to reproduce, see commit A, and commit B: https://github.com/dalzuga/holbertonschool-low_level_programming/commits/example


Friday, June 9th, 2017

concati [11:27 AM]

@olivierc Hi Olivier, I am building a makefile for my program, and want to be able to compile with -D NO_DEBUG to disable any debugging printouts. How will I be able to run this command: make --no-debug by adding to the makefile? Here is a link to the makefile: https://github.com/ianliu-johnston/FourNights/blob/master/c_poc/Makefile

olivierc [11:29 AM]

You just declare variable

you cannot really do parameters like this

but you can do

make DEBUG=0

or you can create different target

make debug

make release

etc .

concati [11:32 AM]

oh great thanks!

Wednesday, June 21st, 2017

daniel [7:55 AM]

Big O in general is mostly semantics. I think perhaps the specification / requirements could be a little clearer to make sure that the assumptions are completely disambiguated. @gautie_a #pinme

larry2 [2:20 PM]

Oh joy! `A newer version of the box "ubuntu/trusty64"` is available. Are there any downsides to running `vagrant box update`? I'd hate to end up with the wrong version of `gcc` ... (edited)

5 replies Last reply today at 2:53 PM View thread
(threads not included in overflow)

felicia [2:33 PM]

Per Julian/Guillaume, we should be using "gcc-4.8" when we compile

3 replies Last reply today at 2:54 PM View thread
(threads not included in Slack Overflow)

daniel [3:19 PM]

also valgrind edit: s/vagrant/valgrind/ (edited)

[3:20]

if you want gcc to work on 16.04 you can do:

Using built-in specs.
      COLLECT_GCC=gcc
      COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
      Target: x86_64-linux-gnu
      Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
      Thread model: posix
      gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
      daniel@ubuntu:/mnt/hgfs$
      

daniel [3:20 PM]

if you want gcc to work on 16.04 you can do:

daniel@ubuntu:/mnt/hgfs$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) daniel@ubuntu:/mnt/hgfs$

[3:20]

and recompile gcc from source with the “Configured with” line. (edited)

daniel [3:30 PM]

as said in the threads, by @birnbera and @felicia , you can use the gcc-4.8 package (did not know this!)