Wednesday, September 28, 2022

html selectors and FS-IA6B receiver

 random posts.

Playing with remote controls and want to do some projects with them.  Bought a Flysky FS-i6X 6 channel remote controller, and want to use it to control some servos.  The manual is minimal, and found this site https://blog.vertile.com/article/flysky-i6-radio-setup-and-hacking-guide/ with good information. 


Found the page on html selectors https://drafts.csswg.org/selectors/

Tuesday, October 26, 2021

found my old account finally

 I lost this account for a long time, can't remember which user I used to login this.  Today by some really strange event (I found one of my favorite professors back in college, found his blog and that made me want to recover my blog).


Anyway, a lot has happened.  Started doing a bunch of arduino/pi stuff, but lost interest. I am now primarily on node/react, got looped back to C++/.net for a small side project for my church on and off (to recognize faces to solve the seat assignment issue at my church).  Let's see what happens next.

Wednesday, September 23, 2015

cloud-init slowness

Noticed my ubuntu box have very slow startup time, and it is cloud-init.

edit /etc/cloud/cloud.cfg.d/90_dpkg.cfg, and change [...] to [ None ], fixed for me :)

Friday, April 3, 2015

icse014a usb problems

Recently I started getting interested in automation.  So for a small project I want to try out, bought icse014a 8 relay control via USB.  It arrived today and can't get it to work, device shows status 10 (with a yellow question mark).

After some search found this page: http://leftbraintinkering.blogspot.com/2013/05/usb-to-serial-prolific-2303-device.html  .  The guy was doing the same with some other device and  found windows 8 no longer support the driver.  So some smart guy wrote something to fix it https://www.sendspace.com/file/5m5afw

Now it is working and I can control the device, thanks guys!

Saturday, July 26, 2014

ffmpeg shrink file

I got some mts files that has not been uploaded for a long time, and got some time today to do that.  Windows Movie Maker is nice but one by one upload is just too slow.

Did some research, so finally find a way to do it in batch:

1.  loop all files do:  ffmpeg -i input.mts -fv scale=720:-1 output.mp4

2. drop all the mp4 to youtube :)

Thursday, June 5, 2014

CallContext ThreadStatic and SQL transactions

Recently we changed all our DB calls to async/await, as they are much more "thread" efficient.

And most of our old code, the SQL transactions runs on Thread local.  This won't work on async/awaits since now they are all interrupt like and can run on any thread. (we are not running with coordinated transactions for other reasons)

One of our guys implemented the new way initially with a static context, and we have to pass the context name to all calls.  When it is time for me to fix some of the code, it just feels so unnatural, no only there are a lot of code changes, if you miss one they won't be in the transaction.

And during the research, someone found CallContext, it works very much like Thread Statistic, and I think Microsoft copies it to new threads, so with simple fixes everything is working again (of course anything in a transaction is synchronized again without the DTC, that we can live with for now).

Sunday, February 23, 2014

c# async model

I dislike the async/await way of doing things, thinking that it made the developer's life harder, hiding the threading for no reason (not to mention the messed up stock). Recently one of our companies project was done with that, and I was able to make the project faster by remove some of the async stuff (there is an operation that writes on a single pipe, so I made it single threaded and used a queue instead of the async way of doing things). However during a recent discussion, one of my college's comment kind of wake me up a bit. He said the reason async/await is better is that internally it actually queue things up. Now that made sense. I think MS should make it even better, that is on any IO operation on a task, it should immediately queue it and make the thread available for next queued task, this way we can actually do away with the async/await mess and the complexity will be handled internally without any developer mangling.