for fname in os.listdir(os.getcwd()):
print “text.count( hi mom )”
print text.count(‘hi mom’)
Posted in Mac OS-X, Macintosh Computers, Personal Computers, Programming Languages, Python, Software development
Tagged baby step, for, function call, import, print, program, Python, trivial
A philosophic reason to sets pointers to NULL after free’ing them.
On reflection, I think I got this one right, and I kinda like it! I have experienced other people’s double-free errors, surprisingly, but the value of crashing-on-access-via-null is persuasive to me. Making double-free happen silently and without error is a small cost for positively crashing on a rogue access through a freed pointer.
January 24, 2014 in Computers, Personal Computers
Tagged "C language", C++, computer programming, double-free, excluding bad, free, including good, malloc, memory, philosophy, philosophy of including good or excluding bad, pointers