Wednesday, October 22, 2014

Whatever you've heard about me, it's not the whole truth - I am worse.

I've heard some things about me from various sources recently and I didn't like them. But whatever you've heard, it's not the worst.

This quote from Spurgeon sums up how to think about the charges against me:
“Brother, if any man thinks ill of you, do not be angry with him; for you are worse than he thinks you to be. If he charges you falsely on some point, yet be satisfied, for if he knew you better he might change the accusation, and you would be no gainer by the correction. If you have your moral portrait painted, and it is ugly, be satisfied; for it only needs a few blacker touches, and it would be still nearer the truth.” – Charles Spurgeon.

Depravity - The Bible makes my wickedness very clear. Genesis 6:5 says "every inclination of the thoughts of the human heart was only evil all the time". I was born with a desperately wicked heart (Psalm 51:5). I have no merit of my own. Any charge you can find to bring against me, there is worse available. Much worse.

Propitiation - my favourite word (a life saver). When God calls me to Himself with a repentant heart, in simple faith, the eternal wrath of a Holy God has been removed, He has absolutely no record of anything ever having gone wrong in my life, and I am restored to relationship with Him, and treated as a son, irreversibly, and for ever (Titus 3:7).

Praise the God of restoration, praise the God who gives, and takes away. Let me always walk through life "sorrowful, yet always rejoicing" (2 Cor 6:10). I will always have sorrows, that is a fact of life, and yet in Christ I always have much more cause for rejoicing. Praise God that through these tough times he drives me closer into fellowship with other believers, and closer to the foot of his Throne in humble dependence on Him, and Him alone.

Praise Him that he continues to work through broken vessels, like me.
(Spurgeon quote came from this very helpful article)

Thursday, October 09, 2014

Jehovah's Witnesses visit our home

Please note this post is descriptive, not prescriptive. I am not advising anyone to do this, I am simply describing what I did. Inviting well versed people from a cult into your home is not a safe thing to do. It could go badly wrong. But, in this case it didn't and although they said stuff I had no good answer to, I know this will only drive me deeper into the word, and into the doctrine I have come to believe. It will make my foundations more sure, and not weaken them.

Last Saturday I had a knock at the door, and it was two well dressed ladies from the local Jehovah's Witnesses. After thinking about how to deal with this encounter, and how I should prepare for it, well, here it was and I was unprepared. But, the opportunity was in front of me, so I asked them in. They said they couldn't, but they would come back another time, so I said that would be grand.

Well, last night they arrived again. It was one of the ladies, and her husband. I had done some reading, some listening, and some learning, but in my heart I really didn't want to pummel them with 2nd hand information as that seems a bit unfair. Better to deal with them as who I am, and from where I am. I am confident in my own faith, I am confident in my own theology, poor and all as my knowledge is. I know what I believe, even if I haven't got the basis for everything at hand.

So, they came in. And sat down. And we sort of looked at each other. I was expecting a pummelling with the standard JW speel, but that didn't come. So I told them that I don't think it is fair to fully form opinions on other communities without actually knowing anyone personally. So the guy started to explain some of the differences between what they believe and what 'Christians' believe.

He started with the Trinity, just giving an overview of their perceived roles of Jesus, God and the Holy Spirit. Then they told of how they don't give blood and the old testament background of that. They mentioned that they believe in Jesus, which they say surprises some people, they said they have even had people tell them they don't believe in Jesus. I do understand this as it seems they believe in a significantly different version of Jesus, but I was able to empathise with people telling me what I do or don't believe. They explained how they don't believe in hell. I listened interested, and attentively to all they had to say, asking for clarification many times throughout.

It is difficult to know where to start with something like this, but I knew Jesus talked a lot about hell, so I started by checking with them that they agreed that the entire Bible was the inspired word of God, and that it was an infallible source of information  They agreed. Phew. We talked about a few references to hell, and they explained that they believe that it is just a second death, which is final, and is an annihilation  a final end. To me this idea is quite attractive  as I think I often don't have a proper appreciation for the seriousness of sin, and the punishment it requires. Anyway, we went through a few texts, which embarrassingly they helped me to find from my poor Biblical knowledge. One by one they were knocking them down, as it was possible to read them all through the lens of annihilation  However we got to the words 'eternal fire' in Matthew 18:8 "And if your hand or your foot causes you to stumble, cut it off and throw it from you; it is better for you to enter life crippled or lame, than having two hands or two feet, to be cast into the eternal fire," The word eternal there signifies that it will be a punishment forever, not just temporary. It is not simply the fire that is eternal. Well, that was the best I could come up with, but I later found Rev 20:10 which is better: "And the devil that deceived them was cast into the lake of fire and brimstone, where the beast and the false prophet are, and shall be tormented day and night for ever and ever" not so ambiguous. Anyway, we can keep that one for next time.

Then we gradually worked our way around to works-based faith, and lack of assurance. I find it sad that their reading of the Bible cumulates in a lack of assurance, and it ends up a bit of a lottery as to whether you have done enough to please God. Anyway, i took them through various texts about the finished work of Christ, and about once for all, and so on. They brought up James, "faith without works", and I told them I agreed. But I told them that cause and effect are the other way around from what they believe. They believe that doing good works helps with their prospects of salvation. I explained that when a person is 'born again' or renewed, they repent of their old way of life (sins) and their heart and desires are changed, some instantly, some over time, but that is the actual moment of salvation. "There is now no condemnation" from that point on.

I explained this again with the old testament story of the two women who bring the baby to Solomon. He says cut it in two, and give the women half each - which causes one of the women to shout out, and say that the other could have the child. Now, here is a classic example (the best I know in fact) of an outworking of something hidden. The shout did not make the women the mother of the child. She was already the mother before that, but it wasn't possible to discern that fact visually, outwardly. The woman did not shout to become the mother of the child, she shouted because she already was the mother. She was the mother long before the dispute arose. In the same way we do not do good works to gain God's favour, but we do good works because we already have gained his favour. The works are an outward sign of an inward change that has already taken place. The JWs said they had never heard it explained like that before, and hadn't thought of it like that. For this I thank God, and pray that they will ponder this.

We also talked about true and false conversion, and how hating sin is a sign of true conversion, and about how it says that many will hear 'I never knew you'.

The conversation was gracious from both sides (I hope!) and I felt while it seemed that we agreed on some things we cam to an amicable disagreement on others. This is exactly how dialogue like this should go. Praise God.

We talked for about 2 hours in total, and covered many other topics too.

They said some interesting things, like about how little engagement they actually receive on the doorsteps. They said it was rare, and actually a bit scary to get invited into a home. They said it was unusual to meet a family (Susan and the kids were in the room for most of the time) who were devoted to and convicted by their Christian beliefs. They also said it was nice to discuss these things, rather than having people ram stuff down their throats - funny how they are scared of the same things that others fear about them!

At the end, when they left I felt it had went well. It wasn't as intimidating as I had expected  Although they clearly knew their doctrine much better than I did, they didn't know everything  and admitted it. They were just ordinary people.

I thank God for the help He gave me during this visit. He did not give me all the right texts, He did not instantly give me all the right answers, but through the faith He has given me, He helped me to show them what a genuine follower of Jesus Christ looks like, warts and all. All I can do now is pray that some of my foolishness will be turned into wisdom in their minds, by the one who created all things from nothing. I think that sounds quite feasible.

Monday, August 25, 2014

Kitesurfing - 25th August 2014

There is no kitesurfing for 6 months, and then 3 nights in less than a week. Tonight was east wind, which I'm not fond of, seemed quite strong when I got there, so I set up the 9, but it was clearly not enough, so I set up the 12.

Out on the water for a good while, mowing the lawn at the start, but working on toeside and even some powered jumps in the right to left direction.

There were almost no breaking waves, but it was odd on the way out, it was like constantly riding over a sine wave, which was actually quite tricky to do. It reminded me a bit of Magilligan point, in the mouth of the Foyle.

The best thing of all was getting to surf through the sunset, at about 8:40pm or so. Lovely.

Friday, August 22, 2014

Kitesurfing - Fri 22nd Aug 2014

Another night's kiting this week! Tonight I did a big downwinder from the mouth of the beach (Benone) to the river.

The wind was great, and the waves made better ramps than Tuesday night. I was going well, it seemed to blow up a bit as we went back up the beach to start again, and when I got back to the starting place, the wind dropped.

I tried, but I failed, the kite went down, wet, little wind, trouble relaunching, so I quit. Kite was soaked, and I was a bit disappointed. Maybe another time :/

Tuesday, August 19, 2014

Kitesurfing - Tuesday 19th August 2014

Tonight's forecast has been good, so even after a pre-6am start I decided to take a short run to the beach tonight.

It was well worth it, the wind was a good westerly direction, although the ramps weren't there as much as I'd like them to be.

I was a bit worried about the whole thing, as it is many months since I've been out, but the mice hadn't eaten my kite, I remembered where the blue and red lines went, and I also seemed to manage to kitesurf without undue amounts of falling in.

A grand evening out.

Tuesday, May 13, 2014


I read this quote and it hit me hard: 
"I did not love my wife as Christ loves the church; instead of laying down my life for her,
 I wanted her to lay her life down for me."

Saturday, April 05, 2014

Tunnelling VNC (or anything) over ssh

To set up a tunnel to reach a vnc server running on port 5901 of remote_host, it is possible to tunnel the port over an ssh connection. Then you just connect to localhost:5901 

ssh -C -L 5901:localhost:5901 -N -f -l remote_user -p 22 remote_host

So that is:
ssh -C -L local_port:localhost:remote_host_port -N -f -l remote_user -p 22 remote_host

Friday, March 28, 2014

c# update clock display once per second

For my heating controls project I display a clock on my main screen. It is just a label which I set the time in. Previously I had used a System.Threading.Timer with an interval of 50ms to do the updates, and this works fine, but on mono on the Raspberry Pi it takes up too much CPU. Top was showing that the process was taking 8-10% of the CPU when at idle.

The problem is that if you set a timer to run every 1000ms, sometimes expirations will be slightly longer, meaning that if you watch the clock every now and then it will skip displaying a second. If you go for something like 900ms update, that doesn't work either, you get 9 short seconds and one long one.

Googling turned up this stackoverflow article, and it contains the answer that got me started, but I wanted it to be a little more versatile. I wanted a timer that I could configure to fire every 'x' ms, and I could either set it to 1000, for each second, or if that was still too CPU hungry I could set it to 60000, which would only update the clock once per minute.

In my form_load I initialise the timer.

            clockUpdateTimer = new System.Timers.Timer();
            clockUpdateTimer.Elapsed += clockTimer_Elapsed;
            clockUpdateTimer.Interval = 100;

I set the initial interval to 100ms which means my clockTimer_Elapsed() method gets its first call pretty much straight away.

        private long updateMainScreenIntervalMs = 1000;

        private void clockTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
            //start the timer to run until 200ms after the next clock second boundary
            long timeInMs = System.DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
            long wait = (updateMainScreenIntervalMs * (timeInMs / updateMainScreenIntervalMs + 1)) - timeInMs;
            //Debug.WriteLine("wait ms: " + wait);
            clockUpdateTimer.Interval = (int)wait + 200;

This method firstly stops the existing timer, and then calls my callback method to update the label (TimerCallback()). Next I get timeInMs which is the current system time in milliseconds. Then I do some maths which essentially finds the nearest full cycle of time, and subtracting the current time from this value figures out how long we have to wait until this time. 
Then I start the timer with that time. For a 1 second interval it typically waits about 750ms. 

Any improvements welcome, if it helps you please post a comment!

Kitesurfing - Friday 28th March 2014

I got to Benone just after an early exit to work, so I was there for about 4:20. It was blowing about 25 on my wind meter, so I set up the 9. However, after a couple of runs showed me that it was too small. The 12 was too big, but I'd rather be overpowered than underpowered.

It was a great session, long flats, nice waves. The only funny thing was the direction was East, which meant I was going the opposite way to normal, but it was still good practice, and it meant that I was able to ride a little toeside out over the breaking waves.

The water is still cold, and it felt even colder when I took my wetsuit socks off, feet were freezing, but at least I could feel the board. I really don't like having something on my feet, I find it very tricky.

Monday, March 24, 2014

Heating Touchscreen Screen Captures

I have made a few updates to my touchscreen client, and one of those has been a bit of work on the visual aspect. A few screenshots are posted below. (the windows are all border-less on mono, but display with borders for debugging on Windows)

Main Screen

PIN input form

Program Entry

Time entry for a specific program

System settings dialog (not themed)

Wednesday, March 12, 2014

How to hold modules from apt-get update

Recently I had to do an update, but the bootloader update broke my touchscreen driver. So I wanted to do an update without updating the bootloader, so I had to run this command:

 sudo apt-mark hold libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc libraspberrypi0 raspberrypi-bootloader