Jump to content


Check out our Community Blogs

gonerogue

Member Since 20 Jun 2013
Offline Last Active Nov 06 2015 02:31 AM
-----

#670109 Second Interview with Apple

Posted by gonerogue on 16 April 2014 - 09:10 PM

Good luck !


  • 1


#668440 [C] Josephus Solution Using Circularly Linked List

Posted by gonerogue on 21 February 2014 - 04:49 AM

Yes, you do have memory leaks.

Is good to run the program under a runtime analysis tool to see this kind of problems.

I have run your program under valgrind, here is the report:

$ valgrind --leak-check=full ./test
==1791== Memcheck, a memory error detector
==1791== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==1791== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info
==1791== Command: ./test
==1791== 
How many children are in the circle -- must be > 0: 100
Remove every nth child -- value for n must be > 0: 4
 
 
Computing the answer...
 
 
Child number 34 is the winner.==1791== 
==1791== HEAP SUMMARY:
==1791==     in use at exit: 40 bytes in 5 blocks
==1791==   total heap usage: 104 allocs, 99 frees, 832 bytes allocated
==1791== 
==1791== 8 bytes in 1 blocks are definitely lost in loss record 1 of 5
==1791==    at 0x4023F50: malloc (vg_replace_malloc.c:236)
==1791==    by 0x80484C5: findSolution (test.c:11)
==1791==    by 0x80486E3: main (test.c:87)
==1791== 
==1791== 8 bytes in 1 blocks are definitely lost in loss record 2 of 5
==1791==    at 0x4023F50: malloc (vg_replace_malloc.c:236)
==1791==    by 0x80484D4: findSolution (test.c:12)
==1791==    by 0x80486E3: main (test.c:87)
==1791== 
==1791== 8 bytes in 1 blocks are definitely lost in loss record 3 of 5
==1791==    at 0x4023F50: malloc (vg_replace_malloc.c:236)
==1791==    by 0x80484E3: findSolution (test.c:13)
==1791==    by 0x80486E3: main (test.c:87)
==1791== 
==1791== 8 bytes in 1 blocks are definitely lost in loss record 4 of 5
==1791==    at 0x4023F50: malloc (vg_replace_malloc.c:236)
==1791==    by 0x80484F2: findSolution (test.c:14)
==1791==    by 0x80486E3: main (test.c:87)
==1791== 
==1791== 8 bytes in 1 blocks are definitely lost in loss record 5 of 5
==1791==    at 0x4023F50: malloc (vg_replace_malloc.c:236)
==1791==    by 0x8048521: findSolution (test.c:24)
==1791==    by 0x80486E3: main (test.c:87)
==1791== 
==1791== LEAK SUMMARY:
==1791==    definitely lost: 40 bytes in 5 blocks
==1791==    indirectly lost: 0 bytes in 0 blocks
==1791==      possibly lost: 0 bytes in 0 blocks
==1791==    still reachable: 0 bytes in 0 blocks
==1791==         suppressed: 0 bytes in 0 blocks
==1791== 
==1791== For counts of detected and suppressed errors, rerun with: -v
==1791== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 13 from 8)

  • 1


#666752 Who knows how to make a database engine in C?

Posted by gonerogue on 20 December 2013 - 01:00 PM

Create a CDB database library (http://cr.yp.to/cdb.htm).

An implementation I like is this one: TinyCDB (http://www.corpit.ru/mjt/tinycdb.html).

Look over the source code, understand the algorithm and try to make your own implementation. Is not that hard.

Another idea is to look over the source of GNU dbm (http://www.gnu.org.ua/software/gdbm/). Also fairly easy to understand and a good example of a well written C library.


  • 1


#662849 Version Control Systems

Posted by gonerogue on 13 August 2013 - 05:47 AM

Mercurial or Git, both are good. You will find good beginner documentation on Internet, such as:

http://hginit.com/

http://gitimmersion.com/

 

You also have good tools:

http://tortoisehg.bitbucket.org/

https://code.google.com/p/tortoisegit/

 

For your needs, I would choose Mercurial.


  • 1


#661188 Greetings

Posted by gonerogue on 09 July 2013 - 11:01 AM

Thanks. I have majored in computer science. I have no certifications (as from Microsoft, Oracle, ...).


  • 1


#661182 Greetings

Posted by gonerogue on 09 July 2013 - 10:45 AM

I'm Adrian, 34 years old, working as a software engineer. For the last 10 years I've participated in developing the codewarrior tools (mostly the debugger). Besides programming, I am also interested in cryptography and statistics. I enjoy reading SF, listening rock music and long distance running. Nice meeting you.


  • 1


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download