Wednesday, July 31, 2019

Treating failures as opportunities

Any non-trivial engineering project is bound to face failures / errors / bugs. Instead of haphazardly fixing the error, I propose the following approach:
  1. If you are in a hurry and there is a quick fix, fix it, but take note and do the following steps when you have more time.
  2. Analyze and repeat the problem, find the root cause and solve it.
  3. Improve error indicators (e.g. different blinking LED frequencies / beep sounds for different errors) and error messages. A good error message contains a description of the problem and possible work arounds, it there are any. You might think that you have solved the error for good but the same error might be triggered from a different path and then you will be glad that you have a nice error indicator helping you solve the problem in half an hour instead of a week.
  4. Add unit tests proving that the bug was solved and leaving a trail of what kinds of bugs had to be tackled with in the past.

Tuesday, July 30, 2019

Matlab: Dynamic cell array with string elements

In Matlab, to dynamically update cell array with string elements, use the following:

myCellArray = {}; %initializing cell array
for i=...
    myCellArray = [myCellArray; someString]; %dyn. update cell array
end

Note that when initializing the cell array you use curly brackets "{ }", while resizing the cell array you use square brackets "[ ]".

Monday, July 29, 2019

Software development maturity levels

Software development maturity levels are:
  1. Modular design and implementation.
  2. Nightly build script and pass/fail email.
  3. Automated tests with tools like Macro Scheduler.
  4. Unit tests.
  5. Continuous integration.
  6. Continuous deployment.

Friday, July 26, 2019

Asteroids game with JavaScript

Recently I watched the Make JavaScript Asteroids in less than one hour video and decided to give it a go. I changed the ship shape to make it clearer which side is the nose, added thrust animations and sound effects. Most of the sounds are my son's recordings. I did the thrust sounds with Audacity's pink and brown noises. My code is on GitHub. Game play in web browser video:

Wednesday, July 24, 2019

Transforming low-tech companies to high-tech

I have been involved in the digital transformation of low technology companies to high technology ones. The motivation for tranformation was competitive advantage, higher profit margins and diversification into new markets. 
Almost every organization seems to include digital transformation in its vision and strategy, but most struggle with executing digital transformation initiatives. There are myriad reasons: the challenges of introducing new technologies and providing the workforce with relevant skills, ensuring that the company’s culture and organizational structures are conducive to change, and anticipating correctly which processes need to change and how, to name a few.
Key areas that I had to oversee and lead were the following:
  1. Have short and to the point meetings, no excessive story telling.
  2. Focus on the right problems, i.e. good analysis, instead of wasting effort on poorly defined objectives.
  3. Create high tech transformation road map document.
  4. Instead of local server infrastructure, use cloud services (e.g. G Suite vs Office 365, GitHub) as much as possible. Prerequisite: Fast and reliable internet connection of all offices and factories.
  5. Mentor managers and lead engineers. Teach the importance and best practices of good documentation, reviews and good tests in achieving quality. Form a culture that embraces trial and error and treats failures as improvement opportunities. Focus on minimum viable products. Have short design/development/test cycles via sprints.
  6. Eliminate micromanagement, communicate business context.
  7. Develop critical tech (algorithms, software, electronics, tools, simulators/emulators and HWIL test infrastructure) in-house.
  8. Tailor certification standards to project scope because most standards are a mess.
  9. Make sure that quality procedures are adequate and applicable in real world scenarios.
  10. Improve hiring practives, form capable tech teams. Provide remote working opportunities to attract talent. Isolate them from mundane work to decrease turn-over rates.
  11. Improve information dissemination through wikis and forums. To improve technical docs, when an engineer is assigned to a task that he is a novice of, he also has to update documantation related to that task.
  12. Have methodologies in place to support remote work (daily scrum video conferences, sprints, Google Drive, GitHub etc.)
  13. Improve internet presence (dynamic web site, videos) for better marketing and recruitment.

Friday, July 19, 2019

Double quote problem in Visual Studio post-build event command line

Recently I was working with OpenCV and I had to copy a dll in Visual Studio 2017 post-build event. When I tried it I got "Error MSB3073 The command "copy ... exited with code 1". When I copied and pasted the command in the error message to cmd.exe, it worked! After one day of frustration, I realized that the double quote character in Visul Studio Post-Build Event Command Line was slightly different. I copied the non-working and working versions to Notepad++ and zoomed in. The first line has the wrong double quote and the second line has the correct one:
I wrote the line first in a Google Docs and then copy-pasted it to Visual Studio, which  preserved formatting for the double quote and gave me that strange error. It was not possible for me to spot the difference in Google Docs, I only noticed it when I zoomed in Notepad++. The unbearable lightness of software development...

Monday, July 15, 2019

Yemek yapmanın dayanılmaz ağırlığı

Günlük yemek yapmanın gerektirdiği zaman ve iş gücü can sıkıcı. Maddelersek:
  1. Her hafta en az bir kez pazara git.
  2. Her hafta en az bir kez markete git.
  3. Malzemeleri dolaplara yerleştir.
  4. Ekmek al.
  5. Hemen her gün ne yemek yapacağını düşün, yemek yapmak için malzemeleri yıka, doğra, pişir.
  6. Yemek malzeme kabukları ile dolan çöpü çıkar.
  7. Bulaşıkları makineye koy, yıkandıktan sonra geri çıkar.
  8. Yeterince yardımcı olmadığın için eşinden azar işit (!)
Rutin adımların dışında gerekenler:
  1. Bir sürü tencere, tava, tabak, çanak, kepçe, bıçak, kaşık.
  2. Çanak çömleği koymak için bir sürü dolap.
  3. Büyükçe bir lavabo ve bulaşıklık.
  4. Fırın.
  5. Mikrodalga.
  6. Ocak, tüp.
  7. Aspiratör.
  8. Bulaşık makinesi.
  9. Dondurucusu olan büyük bir buzdolabı.
  10. Mutfak robotu (rondo)
  11. Tüm bunlara ev sahipliği yapan mutfak.
Yemek yapmayın demiyorum, hobi olarak yine yapın (!) İnternetin ve lojistik imkanlarının gelişmesi sayesinde yemek abonelik sistemine geçmemek için teknik bir neden yok, geriye maliyet ve lezzet kalıyor. Yemek abonelik hizmetleri yeterince iyi ise mutfak ve içindekilere gerek olmayacak, evin bir köşesinde küçük bir buzdolabı ve mikrodalga yeterli olacaktır.

Hazır bu hafta kendi başıma evdeyken yemek servislerini deneyeyim dedim, MealBox ve Rafinera'yı inceledim ve Rafinera'yı seçtim. Sebebi MealBox şikayetlere cevap yazmazken Rafinera'nın cevap yazmasıydıRafinera'nın protein plus paketini beş gün denemeye karar verdim. Teslimat saati olarak üç seçenek var: 07:30-08:30, 08:30-09:30, 09:30-10:30. İlk sipariş yarın sabah geliyor, izlenimlerimi gün gün buraya yazacağım.

16.07.2019 (Gün 1/5): Sabah 08:25'te yemek kutum geldi (teslimat saati olarak 08:30-09:30 seçmiştim). Kahvaltı, öğle ve akşam yemekleri doyurucuydu. Demek ki 2100 kcal protein plus paketi benim gibi 80kg'lık biri için yeterli. Öğle ve akşam yemeklerini orjinal kaplarında, çatalla birkaç delik açarak mikrodalgada ısıttım, yanlarında biraz domates, maydanoz ve yoğurt yedim.

17.07.2019 (Gün 2/5): Bugün için teslimat saatini 07:30-08:30 seçtiğim halde saat 9'a kadar paket ulaşmayınca Rafinera'yı aradım. Paket 09:05'te elime ulaştı, teslim eden kurye polis çevirmesi nedeniyle yarım saat kaybettiğini söyledi. Biraz sonra Rafinera aradı ve bir önceki gün teslimat saatinin 08:30-09:30 olması nedeniyle karışıklık yaşandığını söyledi. Lojistik konusu iyileştirmeye açık görünüyor. Bugünkü menü:

Rafinera'yı ailecek (iki yetişkin, bir çocuk) yıl boyu kullanmak istesek durum nedir diye analiz ettim: Benim iş yerinde ve çocuğumun okulunda öğle yemeği çıkıyor, ancak eşimin iş yerinde öğle yemeği yok. Kahvaltı hazırlamak da kolay, kahvaltının gelmesine gerek yok. Bu nedenle hafta içi günde 1+1+2 = 4 dört yemeğe ihtiyacımız var. Hafta sonu yine kahvaltıyı kendimiz hazırlarız, günde 2+2+2 = 6 yemeğe ihtiyacımız var. Rafinera Pazar günleri çalışmıyor. Yani kabaca bir ayda 4*20 + 6*4 = 104 yemek gerekli. Rafinera resmi tatillerde de çalışmadığı için ortalama ayda 96 yemek diyelim. Kahvaltısız paket öğle akşam yemeği ile iki ara öğün içeriyor, yani hafta için her gün iki paket, C.tesi de üç paket işimizi görüyor. Şu anki fiyatlarla (klasik menü, kahvaltısız, 1900 kcal, 90+gün) aylık en az (4/2*20+6/2*4)*59*96/104 = 2832TL ediyor. Eğer üçümüz için ayrı ayrı tek öğünlük gündüz programını seçseydik 96*54=5184TL olurdu. Mesaimize yetişebilmemiz için teslimatın en geç 08:00'da yapılmasını da garantilersek bu iş olur. Teslimat saatiyle ilgili müşteri hizmetlerine mail attım, iki saat sonra Abdullah Bey aradı, lojistik sorumluları ile görüştüğünü, bizim adres için 08:15'i garantileyebileceklerini söyledi. Teşekkür ettim ve sabah en geç 8'i sağladıkları gün hazır müşterileri olduğumu söyledim.

Bize yakın Med Yemek şirketini arayıp aile paketleri var mı diye sordum, yemek servisleri olduğunu, bizim bulunduğumuz yere servisleri var mı diye bakıp döneceğini söyledi. Aradan yarım gün geçti, ses seda yok...

Diğer seçenekler: Diyetta, FormenaBaşak Ev Yemekleri, G4

18.07.2019 (Gün 3/5): Kutu sabah 07:25'te geldi.

19.07.2019 (Gün 4/5): Kutu sabah 07:50'de geldi.

20.07.2019 (Gün 5/5): Kutu sabah 08:15'te geldi.


Günün müziği: