364 reputation
28
bio website
location England, United Kingdom
age 44
visits member for 3 years, 11 months
seen Oct 13 at 19:37

A software engineer, programmer, project manager, Gnu+Linux user, and a dad.


Oct
12
comment Efficient Code Design for Pattern Search Using a Singleton Pattern
I don't have an answer, except to say I think you may be on the wrong path. singleton is considered harmful, god/master class is considered harmful, making a library of patterns is considered harmful: Some patterns can be libryfied in some languages, but in general they can not. Pattern seek to go beyond libraries. There are reusable ideas, where as libraries are reusable code.
Oct
12
comment Efficient Code Design for Pattern Search Using a Singleton Pattern
Please note comments are not answers, therefore they do not answer the question.
Oct
12
comment Efficient Code Design for Pattern Search Using a Singleton Pattern
The most important reason — Singleton violates “single responsibility principle”: singleton is a class and its factory rolled into one. The less important reason — Singleton in nearly impossible to implement, at there is almost always a way around it.
Oct
12
comment Efficient Code Design for Pattern Search Using a Singleton Pattern
singleton is a bad idea, it is ever not needed or will lead to trouble.
Sep
28
comment Need help understanding a recursion example in Python
Note: in python, you will get a stack-overflow for large values of n. This is because python has no tail-call optimisation. (This is a design feature, to allow the implementation of full stack tracing.)
Sep
24
awarded  Autobiographer
Jul
29
comment I made improvements to free code I found online and notified the author. Was this the right thing to do?
@RobP. Yes this is correct for most Free Software or Open Source licences, it is not necessary to distribute changes. The only exception I Know of is AGPL (not GPL), then if you use the software on a server, you have to make the AGPL software available to those that have access to the server, that would include the changes. That is how you pay for the software. The FSF don't want your money, they just want you to love one another. If you can't love then don't use the software.
Jul
28
comment I made improvements to free code I found online and notified the author. Was this the right thing to do?
@Rob did you mean “And they might not want you giving it away”, if so then they must consider that giving away the 1% is cheaper than writing 100% and keeping it to them self.
Jul
28
comment I made improvements to free code I found online and notified the author. Was this the right thing to do?
I am not a lawyer. It depends on the copyright laws in you location, and possibly on contract law (a licence is a contract). In uk an ambiguous license is interpreted in favour of the party that did not write it. But of much more importance is the last sentence “Re-distribution of this software is NOT permitted without explicit permission.”
Jul
28
comment How do VMs implement function calling?
Yes most CPUs work like this, they don't support structured programming (loops, selection, subroutines), these are synthesised as you have described. A good processor to learn is ARM it is simple and still in use.
Jul
28
comment Why are there so many CSS properties which are essentially the same?
Where as if you sit next to a site that stream video, and uses way way way way way more bandwidth, then they may put in a network upgrade, and your site will get faster. (I did not, and can not, put in enough “ways” to illustrate how much bandwidth video uses compared to text.)
Jul
28
awarded  Citizen Patrol
Jul
28
comment Why are there so many CSS properties which are essentially the same?
They use there own name, because the standard is not finalised, the standard can change. By using the standards name incorrectly or before finalisation, they will be out of compliance.
Jul
28
comment Why are there so many CSS properties which are essentially the same?
The features have to be tested, to do that they have to be implemented. It is hard to design on paper and get it correct first time, I have never seen it done.
Jul
28
comment Why are there so many CSS properties which are essentially the same?
If you are worrying about bandwidth, then consider that text uses a lot less bandwidth compared with video, audio or pictures. Also with compression, as there is a lot of similarity in all 6 cases it will use even less, so make sure your server supports compression (and caching).
Jul
28
comment Why was the first compiler written before the first interpreter?
Just remembered. A friend of mine told be how he wrote an special purpose interpreter, because there was not enough memory for a compiled program.
Jul
28
comment Why is 0 false?
Is it? In C, 0 is false, all other values are true. However in sh the unix shell, 0 is true, all other values are false. (C and sh where written around the same time, as part of Unix. Unix is mostly consistent, but not here.)
Jul
28
comment Why is OOP difficult?
I like to think of classes as little programs, that are easy to join together.
Jul
28
comment Why is OOP difficult?
There was a study that showed that for graduate programmer, junior programmer and programmer programmes in OO languages was worse. But for senior programmer OO languages was better. I have no idea if this is because of the quality of OO languages, or of OO it self.
Jul
28
comment Which algorithm is faster?
Binary search has already been mentioned, but I would like to add that the binary-search algorithm is provably the fastest algorithm when the range is known, and you can ask am I too high/low.