Wednesday, December 2, 2015

Mind-body problem, emergent property

Even respected neuroscientists, for example Rudolph Tanzi from Harvard, still struggle with the fallacy of division. They look at the brain with the latest tools available, learn all the current theories about how neurons function, find out some new stuff along the way, but still get confused, and that is just sad. They say consciousness cannot be encoded into fat and water and DNA, therefore souls exists, and we have a "life after death". The failure here is understanding what an emergent property is. Allow me to explain, using a simple car analogy, since everybody loves these.

Take an engine and a transmission, and put it on top of a frame with wheels attached to it. Congratulations, you now have a car. One of the car's properties, is that it can move on its own. In short, it has the property called "locomotion". Now take the four pieces apart, and look at them individually. Can the engine lomocote ?Nope. What about the wheels. Neither. What about the chassis ? The transmission ? Nope and nope. None of the COMPONENTS of the 'car' has the property of locomotion, but the CAR ITSELF does. Therefore, locomotion is an emergent property of the system that CANNOT be assigned to any of its components.

The same with the brain. No, you cannot reduce consciousness to individual neurons, or neural nets, or anything else. Consciousness is a property of a well functioning brain. Let's stop the bullshit please.

A second, slightly unrelated and much shorter refutation of the mind-body problem is this : how can something immaterial, that is, completely OUTSIDE of the physical world, outside of the planet system, outside of the galaxy, outside of the universe, outside time and space - how can such a thing ACT upon, take CONTROL of something material such as the brain ? How do you make that connection between what is OUTSIDE the physical world, and make it work with the physical world ? And no, you can't use energy, or dark energy, since both exist in the physical world.

Monday, June 29, 2015

My thoughts after 10 years of software maintenance

I have been paid to maintain software systems for the last 10 years now. I've rarely started developing a system from scratch, so I guess we could say I've mostly maintained existing systems. This is probably the norm. Also, thanks to the open source movement, I've also seen the source code to at least as many systems I've worked on professionally, and I believe my conclusions still hold for those systems as well.

Managers often push for features first, and quality attributes later. This is understandable, and I don't think changing that focus would be a good idea, except :

- Improving software attributes first (such as speed, reliability, resource consumption, usability, maintainability) might open the door to new features which wouldn't have been possible before. If the system can calculate its results quickly, we may be able to provide feedback to the user quicker, in a more user-friendly way. If its UI is resizable, it may be usable on tablets. 
- A lack of focus on the system quality attributes will lead to a costly rewriting from scratch.

I have seen both cases first hand, and often times, because of a lack of leadership in programming conventions, speed standards or testing, programs slowly degrade to the point of having to be rewritten. That's a no-brainer. The new program might have a slightly different feature set, but the development team will have to prove itself to the client and develop quickly, at the risk of having the project cancelled. As a result, quality becomes once again an after-thought. It's something left for the maintenance team to deal with. This vicious circle repeats itself over and over, and good programmers often move on before they can make a lasting impact on the health of the program. 

My advice would be to continuously maintain standards in the code as well as in the development lifecycle, and have managers allocate time for working on the quality attributes of the system as well, probably as a percentage of the feature development time. Use that time to 
- correct things that have been left for later, 
- write unit and integration tests, etc.

Wednesday, June 17, 2015

.Net assembly loading problem

So I had a problem at work today. I built my .net winforms application in visual studio, copy the bin/ and 
make sure I can start the application locally without issue. Then I hand it over to someone else, and 
boom, the application won't even load, with this dialog box popping up.


 








I didn't have the option to debug the program, and I couldn't reproduce the problem where I was. 
So I had to find another computer, change the application build mode to Console, so my 
Console.WriteLine would actually show up. I've traced the problem to a missing DLL.


The issue was that a certain library wasn't deployed in the bin/ directory Visual studio built, but it 
So the solution was easy, once the problem was identified.
But this got me thinking, how can I detect this sort of problem ?
I've started playing with DebugDiag, and build my own little application which throws an Exception 
Since now I know beforehand what the problem was, I could focus on which tools allow me to debug it. 

was in the GAC for me.



when clicked. I've managed to generate dumps, and load the actual exception. But I couldn't get it to 
work with my real program. Debug simply didn't recognize my application crashing.

So I found three tools/solutions :



Method 1 : FUSLOGVW.exe (Assembly Binding Log Viewer)
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\x64

The tool itself is horrible. It won't log anything unless you set up the custom log path. Once that is done,
 here we go :

Method 2 : Ilspy.exe : (http://ilspy.net/)
  1. Simply load the main .exe file, and explore each referenced DLL. Here, The Krypton 
  2.  library just won't show up.

Method 3 : Process Explorer
This one is tricky. Add custom load rules in process explorer as follows

And look for failed dll lookups in the application directory :







Bonus points :
The event viewer was my key to success in this case :

But it didn't mention which file and why.

On some other computer, I didn't even get the famous error dialog box, so
I had to enable it :

Saturday, June 13, 2015

Jiu-jitsu and weight training


About half a year has passed since I've injured my knee badly enough to require surgery.  I remember a very sharp and sudden pain following a pretty loud pop : the sound of my medial meniscus giving up as I was playing open guard.

To be fair, a white belt kicked me hard a few weeks back as I was standing to pass, and I had pain for a few weeks before. On the day of the second injury, I remember my body needing a rest, and I didn't listen to it. In the BJJ community, we are used to minor bruises, and that's what I thought that was. Bit big bruises can turn into big ones, that was my first lesson.

Thinking back, I am actually not angry anymore, and I don't regret it having happened to me. I've  learned that my quadriceps muscles needed to be strengthened post-surgery, as a way to delay the onset of osteoarthritis. They say that a 10% increase in knee extensor strength reduces the onset of OA after 25 years by 20%. So far, I've probably increased my strength by at least 50%.

I therefore had to change my training a little bit. I had to sacrifice two days of jiu-jitsu in order to hit the gym. Since I've learned the value of using my whole body when working out, I naturally gravitated towards free weights, and compound exercises specifically. This, despite the fact that a mixed of open and closed cycle exercise rehabilitates after a knee injury faster (machines and weights). I've discovered the deadlift, squat and clean and press, and I'm very thankful that I did.

The deadlift felt odd at first. I was surprised by how little weight I could support. My back was definitely weak. As the weeks went by, I've increased the weight gradually, and to be honest, I have never had such a stable core in my entire life. Almost gone also is the pain I had between one of the vertebrae in my lower back. The squat gave me significant increases into my leg power, and I could feel the difference when I skated just today. I know also understand why my passing has improved so much with so little training. Sweeping me got a little harder than it used to.

Finally, the clean and press, is for me, the exercise I feel the most beneficial. I use low weights and high reps, and since it's basically a combination of deadlift, upwards pull (clean) and a shoulder press, it works pretty much every muscle I care about, while also giving me a solid anaerobic cardio workout. It's hard to complete four sets without going out of breath.

All in all, I have changed my perspective about training jiu-jitsu. I strongly feel one should complement it with some other sport or activity in order to protect against injury. I recommend everyone to evaluate their body, and strengthen it accordingly if participating in full contact sports such as jiu-jitsu, judo or wrestling. 

Thursday, February 26, 2015

Are belts and competitions nonsense ?

In their current state, belts and competitions are nonsense. (Or why I'm never eager to compete …)

Quite simply, belts are not a guarantee of mat time, and we know mat time (MT) is the most important measure of skill, followed closely by the quality of the training partners as well as the actual training method (mixture of rolling time, drill time, technique time, calisthenics time).

If you don't buy this, as a thought experiment, just take a moment and imagine a blue belt and his twin brother who both train at the same gym, but one of them trains three times as much as the other. They get promoted following a set schedule, so as to remove any instructor bias, but I bet you'l be able to tell them apart if you saw them rolling against one another. This is where belts fail us.

Let's then agree on a number of hours a hobbyist typically trains per week. Does something between 2-6 hours a week seem fair ? That's your hobbyist . If now you get someone training 7-20 hours a week, there's your semi-pro. That is, he might beat the pros sometime, but the odds are against him. Then you have the full time typically unpaid pro, who puts in 20+ hours a week. Now if you think a hobbyist has a chance at beating a pro in competition (we're talking cumulative mat hours here), I have a name for that : it's wishful thinking. This is where competitions fail us as a measure of "who is better".

Therefore let's put athletes in two buckets. Let them declare for themselves that they're either :

an amateur - hobbyist - professional - family dad - I can train no more than let's say 6 (ish) hours a week

Or

I train at least 3-10 TIMES more than the hobbyist . I need money to support myself and aspire to become a world champ.


Create an amateur-only division, but allow them to join the pro divisions. Is this unreasonable to ask ?