tag:blogger.com,1999:blog-60939387809249231572024-02-07T10:33:55.696-08:00Orbiting World of WarcraftWOW player, former bot writerUnknownnoreply@blogger.comBlogger491125tag:blogger.com,1999:blog-6093938780924923157.post-41550164670407997992022-09-28T12:47:00.002-07:002022-09-28T12:47:56.420-07:00html selectors and FS-IA6B receiver<p> random posts.</p><p>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. </p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUvgM-iUWH44jnZHU2wvy1T_e-OIdix49_rB-_11tZxqHa3EqgeSfgoGpVk1K8CMWLMwb47ytR8rpJAHFYF8Ql_ywvtIClR_QqUvsqeKVZkzxtPUT9y3bEvQaUTIIseJ3nr3gvyevVcEDtnBfp-ftlLT5knbZ3WNpfKWGkVm5Pan73arvERekkhI3J/s500/FlySky_IA6B_pinout.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="375" data-original-width="500" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUvgM-iUWH44jnZHU2wvy1T_e-OIdix49_rB-_11tZxqHa3EqgeSfgoGpVk1K8CMWLMwb47ytR8rpJAHFYF8Ql_ywvtIClR_QqUvsqeKVZkzxtPUT9y3bEvQaUTIIseJ3nr3gvyevVcEDtnBfp-ftlLT5knbZ3WNpfKWGkVm5Pan73arvERekkhI3J/s320/FlySky_IA6B_pinout.jpg" width="320" /></a></div><p></p><p><br /></p><p>Found the page on html selectors https://drafts.csswg.org/selectors/<br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-39450400515454048942021-10-26T19:42:00.001-07:002021-10-26T19:42:22.974-07:00found my old account finally<p> 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).</p><p><br /></p><p>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.<br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-78316617779475186482015-09-23T18:39:00.000-07:002015-09-23T18:39:00.761-07:00cloud-init slownessNoticed my ubuntu box have very slow startup time, and it is cloud-init.<br />
<br />
edit /etc/cloud/cloud.cfg.d/90_dpkg.cfg, and change [...] to [ None ], fixed for me :)Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-40635794171295144252015-04-03T17:11:00.001-07:002015-04-03T17:11:19.206-07:00icse014a usb problemsRecently 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).<br />
<br />
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<br />
<br />
Now it is working and I can control the device, thanks guys!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-87506444488492542512014-07-26T20:29:00.001-07:002014-07-26T20:29:49.248-07:00ffmpeg shrink fileI 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.<br />
<br />
Did some research, so finally find a way to do it in batch:<br />
<br />
1. loop all files do: ffmpeg -i input.mts -fv scale=720:-1 output.mp4<br />
<br />
2. drop all the mp4 to youtube :)Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-2022924288130869522014-06-05T21:18:00.000-07:002014-06-05T21:18:04.120-07:00CallContext ThreadStatic and SQL transactionsRecently we changed all our DB calls to async/await, as they are much more "thread" efficient.<br />
<br />
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)<br />
<br />
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.<br />
<br />
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). Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-6682800931288046192014-02-23T21:05:00.001-08:002014-02-23T21:06:14.127-08:00c# async modelI 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.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-20971879451378851012013-09-23T20:37:00.000-07:002013-09-23T20:37:03.138-07:00Les MisérablesFinished watching Les Misérables tonight, such a pity I got so busy have to finish a movie over a week in small pieces. Read the story as a cartoon long time ago, and the movie certainly bring back most of the memories, I have to say for a opera it is well done. I don't like some of the singing, but I love the ending song and it brought down some tears.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-37930521635131777502013-07-01T20:03:00.000-07:002013-07-01T20:03:05.937-07:00Age of sorcery build pathI recently started to play a game on windows phone, Age of Sorcery. Found out no one has posted its building upgrade path yet, so here it is, hopefully it can be helpful to other new players when they google:
Academy => Shrine of fire 1
Academy 2 => shrine of wind 2
Academy 3 => shrine of earth 3
Academy 4 => shrine of fire 4
Academy 5 => City walls 5
Academy 6 => Shrine of Fire 5
Academy 7 => shrine of fire 6
Academy 8 => Castle 7
Academy 9 => Shrine of wind 8
Academy 10 => shrine of earth 10
House 2 => farm 1
House l3=> farm l2
House l4=> mithril 3
House l5 => farm l4
House l6 => Shrine of earth 1
House 7 => Academy 1
House l8 => warehouse l6
House 9 => City walls 7
House l10 => Warehouse l10
Warehouse 2 => Castle 1
Warehouse l3=> mithril l2
Warehouse l4=> House 3
Warehouse 5 => Shrine of Wind 2
Warehouse l6 => castle l5
Warehouse 7 => Castle 5
Warehouse 8 => house 7
Warehouse 9 => Castle 8
Warehouse 10 => City walls 9
Farm 2 => Castle 2
Farm 3 => Warehouse 2
Farm 4 => Castle 2
Farm 5 => Warehouse 4
Farm 6 => Shrine of Fire 1
Farm 7 => Academy 4
Farm 8 => City Walls 6
Farm 9 => City walls 8
Farm 10 => Warehouse 9
City walls 2 => Castle 1
City walls 3 => mithril 1
City walls 4 => farm 4
City walls 5 => House 6
City walls 6 => Warehouse 7
City walls 7 => Farm 7
City walls 8 => Mithril 7
City walls 9 => castle. 8
City walls 10 => castle 10
Castle 2 => House 1
Castle 3 => Warehouse 2
Castle 4 => City walls 3
Castle 5 => House 4
Castle 6 => Academy 5
Castle l7 => city walls l7
Castle 8 => Academy 7
Castle 9 => forge 5
Castle l10 => academy l9
Mithtil 2 => Warehouse 1
Mithril 3 => Warehouse 3
Mithtil 4 => Warehouse 3
Mithtil 5 => Academy 2
Mithril 6 => Academy 2
Mithril 7 => Castle 6
Mithtil 8 => city walls 7
Mithril 9 => Shrine of Fire 7
Mithtil 10 => shrine of fire 10
Shrine of wind => Castle 2
Shrine of Wind 2 => farm 3
Shrine of Wind 3 => mithril 3
Shrine of Wind 4 => mithril 6
Shrine of Wind 5 => farm 6
Shrine of Wind 6 => Castle 6
Shrine of Wind 7 => city walls 7
Shrine of Wind 8 => Farm 8
Shrine of wind 9 => Academy 9
Shrine of Wind 10 => Castle 10
Shrine of earth => Castle 3
Shrine of earth 2 => castle 3
Shrine of earth 3 => mithril 4
Shrine of earth 4 => Warehouse 5
Shrine of earth 5 => Castle 5
Shrine of earth 6 => forge 4
Shrine of earth 7=> forge 6
Shrine of earth 8 => Academy 7
Shrine of earth 9 => Academy 8
Shrine of earth 10 => Castle 10
Shrine of Fire => Castle 4
Shrine of Fire 2=> city walls 4
Shrine of Fire 3 => mithril 5
Shrine of Fire 4 => House 6
Shrine of Fire 5 => Castle 6
Shrine of Fire 6 => forge 4
Shrine of Fire 7 => Academy 6
Shrine of Fire 8 => Academy 6
Shrine of Fire 9 => Academy 8
Shrine of Fire 10=> Castle 10
Forge => Castle 7
Forge 2 => Shrine of wind 4
Forge 3 => Shrine of earth 5
Forge 4 => shrine of fire 5
Forge 5 => city walls 6
Forge 6 => shrine of earth 6
Forge 7 => shrine of wind 7
Forge 8 => Shrine of Fire 8
Forge 9 => city walls 9
Forge 10 => castle 10
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-36599235073789197332013-05-08T20:26:00.002-07:002013-05-08T20:26:40.481-07:00I xxking love scienceTake a look at this face book page, you will love it!
<a href="https://www.facebook.com/IFeakingLoveScience">https://www.facebook.com/IFeakingLoveScience</a>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-43270036658129615282013-05-05T14:48:00.001-07:002013-05-05T14:48:55.981-07:00Ants in mail boxToday my neighbor come by, after given us a mis-delivered letter, he told us ants are all over our mail box.
Initially I thought there are food inside, so I was planning to flush them out. But after some observation, I found the ants are delivering food into our mail box!!
Some search later, found the solution <a href="http://oldelephantwings.blogspot.com/2009/09/how-to-get-ants-out-of-your-mailbox.html">here</a>. It can be solved simply by open the mail box door :-)Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-37461397625868902902013-04-03T10:04:00.001-07:002013-04-03T10:04:31.104-07:00Eric Lippert’s BlogOne of my friend introduced me to Eric Lippert's blog. The conversion went from linqpad to nrefactor to Roslyn project than to him. Have not dig in yet but I will leave it here so I don't lose it.
<a href="http://blogs.msdn.com/b/ericlippert/?">http://blogs.msdn.com/b/ericlippert/?</a>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-48369700082568662802013-04-03T07:27:00.001-07:002013-04-03T07:27:46.347-07:00Full moon over Wellington , NZ... <a href="http://vimeo.com/58385453">http://vimeo.com/58385453</a>, beautiful moon raise, unedited :-)Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-78525387674590595242013-03-01T09:45:00.000-08:002013-03-01T09:46:13.322-08:00Entity framework and varcharJust learned about EF and varchar types. EF strings are unicode and when querying database, it will cause performance problems (I was surprised by this, one would assume it should cast to varchar first...).
There are 2 solutions, one is to use EntityFunctions.AsNonUnicode, i.e.
from t in table where t.id == EntityFunctions.AsNonUnicode(id)
The other is use attribute, [Column(TypeName = "varchar")] on the field.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-7345241948223157612013-02-20T10:17:00.003-08:002013-02-20T10:17:33.844-08:007 Things Developers Should Know About SQL ServerThis is from Brent Ozar: <a href="http://www.brentozar.com/archive/2013/02/7-things-developers-should-know-about-sql-server/">http://www.brentozar.com/archive/2013/02/7-things-developers-should-know-about-sql-server/</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-4149685563469639862013-02-17T10:42:00.002-08:002013-02-17T10:42:31.534-08:00The reality of a developer's lifeVery funny link for us developers :-)
<a href="http://www.lordofthejars.com/">http://www.lordofthejars.com/</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-22885095699033349442013-02-13T11:06:00.002-08:002013-03-01T09:45:59.771-08:00EF decimal precisionEncountered a strange problem at work. Entity framework code first, entity's decimal field always save to 2 decimal points even though the field has 4. Turned out in EF4 you need to specify percision:
modelBuilder.Entity<type>().Property(e=> e.property).HasPrecision(x, d);
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-70503898428462840142013-01-24T16:38:00.000-08:002013-01-24T16:38:13.764-08:00Cool HTML5 pageVery cool, roll and see some of the tricks :-)
<a href="http://fff.cmiscm.com/#!/main">http://fff.cmiscm.com/#!/main</a>
Also some tests seems run faster with IE, but some can't be run on IE.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-35231336460172134652012-12-18T09:32:00.001-08:002012-12-18T09:32:56.458-08:00Surprised by JoyHere is an very interest NYT article, talking from the author's own experience (see the open carton) to Tim Tebow.
<a href="http://www.nytimes.com/2012/12/16/magazine/let-my-tebow-go.html?pagewanted=1&_r=0">http://www.nytimes.com/2012/12/16/magazine/let-my-tebow-go.html?pagewanted=1&_r=0</a>
What touched me is the term "Surprised by Joy". I think in our life we are surprised many times, and try to remember them will be another joy :-)Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-47592504926674191642012-12-05T20:31:00.002-08:002012-12-05T20:31:20.384-08:00This will definitely cheer you upThe link blew. I just can't stop laughing at some of that.
<a href="http://www.buzzfeed.com/daves4/people-who-are-having-a-worse-day-than-you">http://www.buzzfeed.com/daves4/people-who-are-having-a-worse-day-than-you</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-30855702034824120642012-10-24T15:08:00.001-07:002012-10-24T15:08:42.460-07:00Cool prank :-)<a href="http://www.youtube.com/watch?v=NeXMxuNNlE8&feature=youtu.be">http://www.youtube.com/watch?v=NeXMxuNNlE8&feature=youtu.be</a>
That was so cool!!!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-3003475954519885022012-10-12T11:41:00.002-07:002012-10-12T11:41:46.367-07:00Why he got fired from facebook<a href="http://okdork.com/2012/09/29/why-i-got-fired-from-facebook-a-100-million-dollar-lesson/">A very interesting read from a former FB employee</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-39442629278625802682012-10-10T19:43:00.000-07:002012-10-10T19:43:33.557-07:00xhtmlConformance mode StrictDoing some jquery ui debug for my friend. Her calendar ui shows month/year select box stocked instead on one line. Did some checking and her table cells are 1px short ....
Found out it is the DOCTYPE HTML Transitional of her default asp.net rendering. And set xhtmlConformance mode Strict in web.config should fix that. However the Strict did touch the doctype at all, and a manual <!doctype html> fixed that. Will try to figure out why xhtmlConformance didn't work tomorrow.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-47275951631109055762012-09-19T13:33:00.000-07:002012-09-19T13:33:01.806-07:00mstest and localization hellI have a project which have some localized resources in a dll. My test won't pass because for some reason it can't find the resource. Funny thing is if I create another project with the same code, test works.
And it turned out someone added Test Settings and it set to deploy. So Visual studio copies everything to a TestResult directory, but forget to copy the localization dlls :-) Just that stupid thing alone took me a long time to figure out.
Then the test fails on the build server. The only difference is on build server it run under mstest.exe. I tried it on my machine, also not working if invoked with mstest.exe. So did some online search and a parameter /noisolation needs to be added to mstest.exe for it to work. Some more digging and the real solution is to add [DeploymentItem(@"xx-YY\Resources.resources.dll", "xx-YY")] (where xx-YY is the locale code, i.e. en-US).
Hope this can be of help to others.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6093938780924923157.post-29035717775766049822012-09-18T19:19:00.000-07:002012-09-18T19:19:58.201-07:00Parasits and brain tumorI was reading some thing about parasites, some parasites that usually inhabits in our digestive systems actually ends up in our brain and can cause a lot of issues.
However, this reminded me of something. I have recently learned that brain tumor is very hard to treat because there is a blood barrier between brain and blood vessels.
What if we can use the parasites (or borrow the way it went into the brain) to deliver cancer treatment drugs for brain cancel patients?Unknownnoreply@blogger.com0