We went to Mini Makers Faire in Seattle today and one of most surprising thing I learned was how abundant are the local
resources for hackers and makers! Reminded me of geek fairy tales of Homebrew Computer Club that you often hear. Here are some of the things
you want to check out if you are interested in making stuff and live in Seattle area:
Metrix Create: Space – I think this was the coolest thing I came to know about.
They have a shop with everything from sewing machine to electronics. They run lots of interesting workshops & classes. It’s your neighborhood fab lab!
Make Seattle Meetup Group – Regular meet ups for Arduino/electronics makers and
learners to exchange ideas and get help on your projects
West Seattle Tools Library – I thought this was the coolest concept. They have a
collection of 1500 tools that you can checkout for your projects. Just look at their tool of the week series. There is also Fixers Collective who meet up at Tools Library and would be happy to fix your broken stuff or just
Workshop Space – They provide you space to work on your projects along with access to almost everything you need such as
power tools, soldering stations, oscilloscopes, electronics components, drill presses, sand blasters, table saws, sanders,
There were quite a few of cool things we saw there everything from The
Brain Machine, Zigduino, Lifesuit, Drawbots, to The Most Useless Machine Ever.
I also jotted down the next classes I want to do at Pratt and All Metal Arts.
Strange thing happened today. I upgraded one of the internal tool to .Net 4.0 without any issues but as soon as I attempt to debug/run the binary, I’ll see this exception:
System.BadImageFormatException was unhandled Message: Could not load file or assembly SomeTool.exe' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Normally you see this exception if the machine doesn’t have right run time installed. But this was obviously not the case. Changing build to x86 or x64 didn’t made any difference either. Next I ran peverify.exe which happily reported that there was nothing wrong with the binary image. Finally I needed to pull out the big guns, ask fuslogvw, which would show me if there are any dependent assembly binding that was failing. But that also didn’t produce any boom sounds. So the last resort was to just meditate over the issue for few minutes. And that works. In a sign of enlightenment I saw app.config buried along with bunch of files and it had these lines:
Aha! Apparently the app.config doesn’t get updated (may be because it was in TFS?) when VS did the 4.0 upgrade. As app.config didn’t had anything else, just deleting this file solved the issue. I do wonder how many people come across this gotcha.
If you have found Sony NEX-5 Camera in a black carry on, please do let me know! It’s pictures inside that are important, not the camera itself. So I would be very happy to buy you a beer or take you on a nice hike (whatever is your fix) if you have seen this thing at Lincoln Park beach in West Seattle near Alki beach area.
There is no substitute to reading official Survival Guide but it does leaves out many things. So instead of writing my detailed trip report I thought about all the mistakes I’d made and converting them to tips. Here it goes…
- Sun shelter (things that look like REI Alcove) is absolutely essential if you just have a camping tent. I would however not recommend REI Alcove itself because it broke after withstanding 3 days of sandstorms. Obviously you also need nice camping chair to go with it.
- Regular tent stacks are not very useful to secure tents on playa. I didn’t believed that and my tent almost came out in sandstorms. The correct way to secure tent in playa is using something called “rebars”. You need 4 rebars for a regular camping tent, each 3” long and 1/2” wide. You need another 4 or 6 for sun shelter. Stores like Home Depot would cut the metal rod for you in these sizes. Of course, you will need big hammer as well to stack them (they don’t have pointy end). Finally, it’s a hazard to leave other end of these rusty metal rods open so you must stick a tennis ball or empty bottles on end of the rod that is sticking out.
Sandstorms! In 2009 there were 3 full days of sandstorms. If you never seen one then here’s how it works: About 20-60 foot tall wall of sand that comes at you at anywhere between 10 miles to 40 miles an hour. The visibility typically drops to 5ft to 50ft and you see brownish sand everywhere around you. This can last for up to 8 hours straight. It actually looks cool and as a matter of fact I intentionally spent lots of time inside sandstorm taking photos (note: Many SLRs are not dust proof). Even on severe storm days almost everyone continued their activities as if it was normal weather. But they were prepared. Here’s what you need to be prepared:
- You have to have sun glasses with minimum open space around lenses. I had Tifosi Ventoux and they worked kind of OK. A retainer is also essential not to loose them (remember there are no shops to buy extra pair).
- Mask for the nose and mouth. I used Buff bandana so I can pull it up all the way to sunglasses. Next time I would also be using this, this or this mask so I can be absolutely worry free about staying longer out in dust storms.
- Hat with cord and visor. This will allow you to walk heads down while visor protects your face. I used this hat and it’s absolutely the best hat I’ve ever owned. Added advantage of this hat is that it’s veil can be put in the direction of wind.
- As a first timer I found that 4 nights provides a very good breadth and depth for the experience. The reason it’s perfect is because you have to carry less food and water, not worry too much about getting shower and you still get to see nearly everything that’s out there. I would strongly recommend against staying less than 3 nights.
- Make a stop at Reno at least for a night before heading towards Black Rock City. Besides mini-Las Vegas style environment, you can also visit REI, Walmart and Walgreens to get the gear, water, grocery and so on. Pepermill Resort is where I stayed overnight because it’s cheapest awesome hotel in Reno.
- A compass is very useful to have to get on the right street when coming back in the night far away from playa.
- If you have 3-season camping tent you are probably in trouble. These tents usually have mesh in the walls for ventilation and they have rain fly to protect against rain. This arrangement however is pretty useless to protect against sandstorms. On a typical stormy day I would get about half inch layer of sand inside my 3 season tent and I had to spend an hour every night cleaning things up. Make sure you have duct tapes and things to cover up. Everything outside tent should be tied to rebars so it doesn’t fly away with storms.
- Weather at burning man is 110F+. It’s normally not possible to sleep inside the tent after 10 AM. It’s not unusual to stay up until 3 AM. Nights are cold and you will need a fleece jacket. I’d 30 degree rated bag which was bit warmer but worked fine. BTW, try to bring sleeping bag liner to avoid it getting sweaty.
- As a first timer it might be hard to understand culture of gifts. For example, someone I don’t know at all would give me something and I would be confused if I should really take it. This can spoil the experience for the giver and the taker. Here’s how it works: If someone gives you a gift, take it with a smile without hesitation and give them a gift in return. It’s that simple. The only thing to remember is to bring bunch of gifts that you can easily carry around. Here are some of the examples of gifts: Custom stickers with your favorite quotes, necklaces, bead jewelry, things that glows, Trillion Dollars Notes, candies, custom printed postcards and so on. A single major mistake first timers make is not to bring gifts to give away.
- Bicycles would be your savior. If you can’t bring from home then rent or steal from Reno. BRC is really huge and you would be lucky if you could walk just one street a day. Most events that I was interested usually were many miles apart and it’s impossible to make it on time without bicycle. Besides you really don’t want to get tired after walking 10 miles just to attend couple of events.
- As soon as you enter gate you will be handed a map and booklet of events. The map is easy to understand because of it’s semi-circle streets. Any location is specified by using hand of clock and name of the street. The 6 o’clock is the center while 2 o’clock and 10 o’clock are two ends of semi-circle. The street names are different every year depending on the theme.
- There is NO assigned camping sites at Burning Man (except for theme camps). Normally all except outer two streets are occupied within first couple of days. When I arrived on Wednesday evening I decided to keep as much distance from outer road as possible because that’s where all the cars keep passing by. But I did not wanted to be too inside because the view of vast playa on the outer street is awesome. I also wanted to stay in middle so distance to get on any side is minimized. Always consider if your neighbors have enough space around their tent to put picnic table or chairs or grills or another car. The best space I found on Wednesday night was at 7:15 and Kinship.
- If someone asks you “which camp are you in?” then that usually means “what is the name of your camp?”. You can consult with your neighbor to decide on some name for group camp and put on the sign. You can also tell the location such as 7:15 & Kinship like other first timers do.
- The iPhone & AT&T did worked with full 4 bars at Black Rock City in 2009. It’s really really a good choice to turn it off and resist temptation to tweet/facebook for your entire stay.
- Here’s one of the most disgusting part of my Burning Man experience: The place I choose to camp was up-winds in the path of potty patties. That means every time wind blew even a little it would smell really really bad. It was horrible. Fortunately I came to my tent only to sleep when smell was gone. It’s really worth to make sure you avoid such smelly spaces.
- Don’t wear jeans at Burning Man! Many places that do not allow jeans believe that they are too “casual” for them but at Burning Man you don’t want to wear jeans because they would be too “formal”! I wore my normal jeans on first night and felt so out of place and formal that it was embarrassing. If you must wear jeans then take your old jeans, paint them or tear them or whatever. Shorts are semi-casual options at Burning Man.
- The list of events at Burning Man is overwhelming. You do not have to go crazy to attend as many events as possible and it’s best to chose no more than 3 events per day to attend. It’s good idea to reserve one day just sit back at your tent and look at vast playa in mild warm wind :).
- Cooking at Burning Man can get tricky because of sandstorms. I’d bought my camping stove which didn’t work out in storms. Fortunately more prepared folks did cooking in their camps and gave away lots of free food. I’d also bought some non-perishable stuff like bananas, milk powder, Sahale snacks, bars, chips and so on. One last option for food is to go back to town via bus or car but that might ruin your experience. Fortunately I did not had that option because I didn’t had car and I never found the bus. One good outcome was that I lost few pounds! Next time I might just buy or rent a grill because it work better in dust storms.
- I estimated 1.5 gallon of water per day per person and it worked out well for me.
- You can meet and greet your neighbors without feeling awkward. When you cook meal, offer some to them. Always have at least two gifts to give away to your two neighbors while departing. Example of gifts are some sketch you made while at Burning Man or other art work or a poem or your favorite book or some photo you took.
- Yes, you do need kitchen sink! You will need it to brush teeth, wash hands etc. It’s not OK to spill water with soap on playa floor but if your sink is small and soap biodegradable then you would be ok to collect water in it and then go to outer street to flung it away
- Most people do not shower at Burning Man (or so I think). There are few elaborate large camps that set up showers and some even offer them to others as well. But in general, don’t expect showers. Alternative is wet towel to wipe off of your body.
- Many camps on inner circle serves free drinks to anyone who wants but you need to bring your own cup. It helps a lot if you have a cup with lid.
- There is a place everybody refers to as “The Temple”. It’s located beyond The Man and many first timers would even miss it because they usually don’t go beyond The Man (it’s a LONG walk too). The Temple is truly sacred in many aspects without being connected to even the concept of religion. It’s humbling and even moving to spend a day at the temple. The Temple burns on next day after The Man burns and more spectacularly.
- Burning Man usually has 35,000+ people which causes 2 to 4 hours of traffic jams while leaving. While it’s fun to see the parade of every RV ever made, the time with least traffic to leave Burning Man is on Saturday night after The Man burns. But the flip side is that you will miss even more spectacular burn of The Temple which is on Sunday night. Another flip side of leaving on Saturday night is that you run huge risk of falling sleep while driving. When I left on Saturday night I saw at least 3 accidents on the way and so I decided to just pull over and sleep anyway. For my next time, I would be leaving on Monday late afternoon.
Finally here are pictures from my trip which hopefully would give some idea about what to expect.
Today I got in to some heavy weight TSQL tuning. This time the target was a legendary sproc that was taking 3 mins and now I’m about to call it a day when this giant SP is eating only 16 sec. Not excellent but not bad at this point. Here are some notes…
- Apparently resetting identity using DBCC CHECKIDENT can be expensive operation if you are also deleting all items from the table. One way to reduce time is use TRUNCATE TABLE before DBCC CHECKIDENT.
- I prefer table variables instead of temp tables but one place temp tables are required is if you have lots of data in them and want index!
- Data Tuning Wizard would come out with zero suggestions on many occasions but it does not mean there are no significant optimizations possible. The best way to “guess” possible index is to have index for all columns used in join and use INCLUDE clause that has columns accessed in SELECT. This last thing does attracts even the least interested query plans to use the index :).
- If you have temp tables, it’s usually better to create index after you have inserted data instead of before.
- If you have complex sproc, SQL Server Profiler will spit out thousands of trace lines during the run. A quick way to pin point the SQL statements needing performance tuning is to use File > Save As to put the trace results in to a table. You can use then following query that immediately surfaces culprits. Notice that statements which run in WHILE loop might take less time individually but collectively their duration sum may be higher. Below query would reveal this culprits immediately.
select SUBSTRING(TextData, 1, 4000), SUM(duration), COUNT(1)
group by SUBSTRING(TextData, 1, 4000)
order by 2 desc
One of the big performance hits occur when you must process individual rows one at a time instead of in set. For instance, let’s say you have a table with a column that has comma delimited values. Now you want to split these values in each cell and create a new table which would have N rows for each row in original table – one for each spitted value. The Internet is littered with dozen ways to split strings in TSQL, some even uses CTEs (not a good idea because there are lots of gotchas like max recursion limit). So far the best way is to use SQL CLR with code like below. Its as fast as any native TSQL juggling, if not faster. However most important thing here is not SQL CLR but how you use this table valued function and here’s the secret: The best bang for the performance you would get is using CROSS APPLY (or OUTER APPLY) with table valued UDF.
public partial class UtilityFunctions
[Microsoft.SqlServer.Server.SqlFunction(FillRowMethodName = "FillRow", TableDefinition="StringPart nvarchar(max)",
IsDeterministic=true, IsPrecise=true, SystemDataAccess=SystemDataAccessKind.None)]
public static IEnumerable ClrSplitString(SqlString sqlStringToSplit, SqlChars delimiter, SqlBoolean removeEmptyEntries)
, (StringSplitOptions)(removeEmptyEntries ?
StringSplitOptions.RemoveEmptyEntries : StringSplitOptions.None));
public static void FillRow(object obj, out SqlString splittedString)
if (obj != null)
splittedString = new SqlString((string)obj);
splittedString = SqlString.Null;
Just a note… if you are getting "Exception has been thrown by the target of an invocation" message when opening Test Results window in Visual Studio 2008 then it’s most likely because you have an open solution in offline mode that was bound to some TFS instance. A bug that can waste lots of your time if you didn’t knew about it!
I’ve spent way too much of time today (again!) on this error so here’s blog post for future reminder to me!
If you are generating or working with very large proxies then you might see following error:
Message: Unable to generate a temporary class (result=1).
error CS0001: Internal compiler error (0xc00000fd)
error CS0003: Out of memory
This error typically occurs when .Net infrastructure attempts to generate *XmlSerializers.dll on the fly. To do this csc.exe is spawned off and if your proxy is too large then it might error out with a message like above. This seems to be a bug in csc and reportedly it might get fixed in .Net 4.0.
Meanwhile, here’s how you can workaround it:
First make sure all your classes that are derived from SoapHttpClientProtocol (i.e. the proxy classes) are decorated with WebServiceBindingAttribute. If you have a whole class hierarchy that derives from SoapHttpClientProtocol then all classes in that hierarchy must be decorated.
Next, for all the projects that contains classes derived from SoapHttpClientProtocol, turn “Generate serialization assembly” option on Build page to ON. Remember you will need to do this for Debug as well as Release mode or your code will fail in production.
Now you are set. The *XmlSerializers.dll will be generated and signed+versioned automatically (if your project is signed and versioned) when you do build and csc.exe won’t get spawned to cause above error.
Few more things to keep in mind:
- One of the “popular” workaround in some forums is to switch IIS app pool for WCF to 32-bit. I wouldn’t advise this because you loose all the advantage of 64-bit, primarily, access to all the memory available on server.
- Above error often occurs for Microsoft Dynamics CRM proxies if you have tons of entities and attributes.
- If your code is running as plugin then you might have plugin DLLs hosted at different location than main app exe. An example of this is Microsoft Dynamics CRM plugins that gets hosted by CRM Async service. In this case, you need to copy the *XmlSerializer.dll generated after the build to same location as host exe otherwise it won’t be found by .Net infrastructure!
- If you are using Visual Studio integrated debugging feature for WCF services then you must run Visual Studio as Administrator or above error will pop its ugly head when you are debugging.
If above steps doesn’t solve your problem then you might have to dig deeper using techniques described here, watching binding errors from fuslogvw or attempt to generate Xml serilizer DLL manually using sgen.
Just a note… if you have Tomato installed as firmware in the router and Comcast cable internet then try followings:
- Disconnect cable modem and router and wait until their lights go off. For Comcast modem it takes fair bit of time because of internal battery.
- If Internet connection is still lost then connect your computer directly to cable modem. If this doesn’t work then you need to call Comcast at 1-800-COMCAST.
- If above works then the problem is that your router isn’t syncing with cable model. To confirm this, log in to router login page usual http://192.168.(0 or 1).1. See the status in overview. If this status is "Renewing…" and never changes then disconnect cable co-axial wire going to model. Turn off cable model. After all LEDs goes off turn it back on. Reconnect cable co-ax to it.
Some of the most disastrous code usually takes the following form
Silencing exceptions is almost never good but sometime the problem is minor and you don’t want want to blow up and call for an exit. However wouldn’t it be better if exceptions don’t remain silent and scream for your attention when you are debugging and behave less aggressively otherwise?
How about if we can replace above code with following:
The mysterious IgnoreExceptionButNotIfDebugging is a simple method that takes lambda and it would look like below:
public static void IgnoreExceptionButNotIfDebugging(Action codeBlockToExecute)
catch (Exception ex)
Trace.Write("Exception occured: " + ex.Message);
EventLog.WriteEntry("MyApp", ex.Message, EventLogEntryType.Warning);
Now you can surround any of your code by IgnoreExceptionButNotIfDebugging and make sure things don’t remain silent when you are debugging!