Joined August 2013

Mattias Andrée

Benevolent evil overlord for life
Benevolent evil overlord for life
Stockholm, Sweden

Indeed it should be used with care and most often you will wrap a function with functionally rather than reimplementing it. Of course, if a library provides functionally that can be done by redefining a function you should use the library's functionally.

Crazy stuff can also happen if you load multiple plugins for a program that defined the same function, because one may decide to undo its wrapping, which could be required (depending on the language) before a plugin could be reloaded with an updated version.

It can be used to do want a library have not thought of enabling you to do. But it can also be used to let a configuration script extend the program; if your program is not that big this is can be used to keep to code short and clean.


Why would I not know I about those things?
Especially SOLID, is there seriously anyone who don't?

I do not feel that you have anything concrete
to tell me so I cannot really reply.

The idea is not to have properties, the idea is to be able to redefine any function or method, so that you as a user of a library or as a user of program, can extend the program or library ad infinitum.

A very simple program I have that uses this idea is

Really, I have not touched C♯ in “eons”?

How would you replace a function/method
of an object or class in C♯ and call the previous
implemention from the new implement in just
one statement?
It is possible with some trickery in Python that
require that you write a couple of things in before-hand.

For reference, this is how you do it on unix-like system:


I think you might have missed that part as it looks like the only thing
you do is to make a partition that a bootmanager can boot, not actually
install a bootmanager on it.

I don't really get why you want to remove your *.pyc files.
But if you do, you probably want to do some allowing with
all compiled files. If so, add a rule in your make file named
clean that removes it. You can add clean-pyc for just
the pyc. Much better then using find and messing everything
up. To be on the safe side you can always do it the naïve
whey by combining find and rm. I actually do not understand
why find and delete files, it should not be up to find to
implement anything else than finding files, it us a Unix utility.

Posted to Git ignores empty folders over 1 year ago

Why would you ever want empty directories in your repository?

No, that is that find is for, -r will remove any file including directoried named with .pyc at the end.

Just a small note, it is only called ‘folder’ on Windows, on Linux we call it ‘directroy’ or sometimes ‘catalogue’ (US: catalog).

Also why do a recursive or even a forced removal?

Posted to Fast git commit w/ message over 1 year ago

I prefer a shell function:
gitcom() {git commit --signoff -m "*" }

Posted to Program locking over 1 year ago

NP. That awesome that you are looking for info and not just doing it the naïve way, there is too much of that, and often way do not even put it in the standard location: /run/lock, needless to say /run/lock is for system wide locks that applies to all users, but I guess you can create a directory for program and put users IDs in that for doing user individual locks, that is much cleaner that inside dot directories.

Posted to C and C++ memory management over 1 year ago


Well use the C way for arrays.
But you can allows stop using C++ class and use object orientation in C, it is better anyway (but this is not the right medium for explaining why C is better than C++.)

3 megapixels is not the same thing as 3 MB, you should clarify.

Posted to Useful gcc/g++ options over 1 year ago

I suggest -O3 as default optimisation when installing, unless there is a check, in which case -O6 can be used. (-O4 to -O6 can optimise incorrectly so the program behaves the wrong way.)

-Os opimises the size of the binaries.

And never forget -pedantic.

Posted to Git with intent to add! over 1 year ago

This seems counter-productive.

I perfer to have a shortly named function in the shell for opening emacs and stanging changes when it quits. And then have another function for committing. Files missed i .gitignore are not added that way and takes no time to make commit so I ca commit every logical step without it interrupting my focus.

No, I am pretty sure Internet Exporer uses Evil Sort, that is more Microsoft's style.

Yes, -X is a desirable setting, I just wanted to clearify what the configuration does.

-X means that the terminal will not be initalised so when less quits the text is not cleared.

P.S. You use a lot of git commands that launches pagers.

fatal: '/usr/share/doc/git-doc': not a documentation directory.

You may want add what package is needed.
Although I do not the the use in having it in the web browser
sense you do not work from you web browser.

From git pull --help:

This is a potentially dangerous mode of operation. It rewrites history, which does not bode well when you published that history already. Do not use this option unless you have read git-rebase(1) carefully.

I would rather have a safe and acturate history then a clean but incorrect history.
I would never work with anyone that just uses rebase willy-nilly. And you do never actually have to use it, or at least I have never seen any such case.

I would not even use it on a private personal repository.

279 Karma
8,094 Total ProTip Views