tag:blogger.com,1999:blog-46804260441861076722024-02-19T20:35:34.489-06:00World of CodecraftMy thoughts on life, code and Warcraft. ;)IanCazhttp://www.blogger.com/profile/09356751538588602999noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-4680426044186107672.post-80336288271921579442018-02-22T19:41:00.001-06:002018-02-22T19:55:31.809-06:00Auto-starting mjpg-streamer on OctopiThe normal command for me to start my mjpg-streamer (from its directory) is:<br />
<span style="font-family: "courier new" , "courier" , monospace;"> ./mjpg_streamer -i "./input_uvc.so -n" -o "./output_http.so -w ./www"</span><br />
<br />
The problem arises, when you want this to start automatically when your Raspberry Pi reboots (or even run in the background). You can't just simply add an & and even the built-in -b(ackground) option doesn't seem to work amazingly well.<br />
<br />
So, here's what I've been able to sort out:<br />
Copy all of the files to:<br />
<span style="font-family: "courier new" , "courier" , monospace;"> /usr/local/sbin/mjpg-streamer/mjpg-streamer-experimental</span><br />
Test execution from any folder use the following full path:<br />
<span style="font-family: "courier new" , "courier" , monospace;"> /usr/local/sbin/mjpg-streamer/mjpg-streamer-experimental/mjpg_streamer -i "input_uvc.so -n" -o "output_http.so -w ./www"</span><br />
<br />
If you get the message "ERROR: could not find input plugin", use the following command:<br />
<span style="font-family: "courier new" , "courier" , monospace;"> export LD_LIBRARY_PATH=/usr/local/sbin/mjpg-streamer/mjpg-streamer-experimental/</span><br />
<br />
If you want it to run & stay running (background mode), use the -b switch:<br />
<span style="font-family: "courier new" , "courier" , monospace;"> /usr/local/sbin/mjpg-streamer/mjpg-streamer-experimental/mjpg_streamer -i "input_uvc.so -n" -b -o "output_http.so -w ./www"</span><br />
<br />
To stop the background mjpg-streamer daemon, use the following command:<br />
<span style="font-family: "courier new" , "courier" , monospace;"> kill -9 `pidof mjpg_streamer`</span><br />
<br />
To make the camera start-up automatically, add the following lines to /etc/rc.local:<br />
<span style="font-family: "courier new" , "courier" , monospace;"> /usr/local/sbin/mjpg-streamer/mjpg-streamer-experimental/mjpg_streamer -i "input_uvc.so -n" -o "output_http.so -w ./www" export LD_LIBRARY_PATH=/usr/local/sbin/mjpg-streamer/mjpg-streamer-experimental/</span><br />
Also, make sure that /etc/rc.local is set to execute:<br />
<span style="font-family: "courier new" , "courier" , monospace;"> sudo chmod 755 /etc/rc.local</span><br />
<br />
For clarity, the actual binary is mjpg_streamer but it is usually referred to in conversation as mjpg-streamer. If you're searching, search for both!IanCazhttp://www.blogger.com/profile/09356751538588602999noreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-63078665182265055812018-02-22T17:18:00.000-06:002018-02-23T00:16:21.920-06:00Flashing arduino mega2560 firmware from OctoPiI have a clone Arduino Mega2560 that I keep having to make changes to the firmware for my 3D printer. Most of the steps are straight forward:<br />
<br />
<ol>
<li>Make changes to firmware in Arduino software.</li>
<li>Save as hex</li>
<li>sftp/scp the file to the Raspberry Pi</li>
</ol>
<div>
The last step was the one that gave me so much grief. For my particular setup, here's the command that works:</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">avrdude -p m2560 -c stk500v2 -P /dev/ttyUSB0 -D -U flash:w:Marlin.ino.mega.hex:i</span></div>
IanCazhttp://www.blogger.com/profile/09356751538588602999noreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-33035286732538676902012-08-24T08:41:00.001-05:002012-08-24T08:41:30.715-05:00Remove pictures from copy/paste into ExcelI don't know about the rest of you, but I constantly find myself copying & pasting information from websites into Excel spreadsheets so that I can manipulate the data, or to just keep track of it for future reference.<br />
<br />
I recently did just this when creating backup copies of my different domain's DNS entries. The problem is, when I paste the tabulated data into Excel, it includes hyperlinks & images.<br />
<br />
<b>Hyperlinks</b>: Luckily in the newer versions of Excel this is as easy as selecting the whole sheet, right-clicking and selecting "Remove Hyperlinks".<br />
<br />
<b>Images</b>: Images are a little more difficult, since they often times don't even exist inside a cell, so they can't be easily deleted. Thanks to <a href="https://groups.google.com/d/msg/microsoft.public.excel/Ipt38gD-mFE/N4PSHEltzE8J">Dave Peterson over on the microsoft.public.excel newsgroup</a>, I got this little nugget of information:<br />
<br />
<blockquote class="tr_bq">
Hit Alt-F11 to get to the vbe (Visual Basic Editor)<br />Hit Ctrl-G to see the "immediate" window<br />Type the following and then press enter:<br />Activesheet.pictures.delete</blockquote>
This blows them all away quickly & cleanly. What's even better, is that if you're doing this multiple times, just keep copying & pasting pages in, then with each sheet highlighted, alt-tab back to the VBE screen, put your cursor at the end of the line & hit enter again to repeat the process.<br />
IanCazhttp://www.blogger.com/profile/09356751538588602999noreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-59761860936419471422011-12-14T10:32:00.001-06:002011-12-14T10:34:17.621-06:00Remove empty lines in text using Visual Studio<span class="Apple-style-span" >Visual Studio has ability to delete empty lines in replace operation using regular expressions.<br /><ol><li>Click Ctrl-H (quick replace)</li><li>Tick "Use Regular Expressions"</li><li>In Find specify ^$\n</li><li>In Replace box delete everything.</li><li>Click "Replace All"</li></ol>All empty lines will be deleted.</span><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 'Lucida Sans Unicode', 'Lucida Grande', 'Bitstream Vera Sans', 'Trebuchet MS', Geneva, Arial, sans-serif; font-size: 12px; line-height: 19px; background-color: rgb(213, 222, 237); "><span><span><span></span></span></span></p>IanCazhttp://www.blogger.com/profile/09356751538588602999noreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-44436602477402465172011-01-11T17:24:00.003-06:002011-01-11T17:32:43.356-06:00Google Checkout Issues with Android Market and Google Apps for Your Domain (GAFYD)<span style="font-family: verdana;">After upgrading GAFYD to the new infrastructure, I was no longer able to use the Android Market to purchase Apps for my DROID. After digging around for weeks for a solution to this, I was able to glean the following solution & decided to sum it up here.</span><br /><br /><span style="font-family: verdana;">Go to:</span><br /><span style="font-family: verdana;">Google Apps Control Panel => Organization & Users</span><br /><span style="font-family: verdana;">On the tabs below, click on the "Services" tab</span><br /><br /><span style="font-family: verdana;">Here's a direct link, if you substitute your domain name:</span><br /><span style="font-family: verdana;">https://www.google.com/a/cpanel/</span><span style="color: rgb(204, 0, 0); font-weight: bold; font-family: verdana;">{example.com}</span><span style="font-family: verdana;">/Organization#Organization/subtab=1</span><br /><br /><span style="font-family: verdana;">Scroll down in the list to the "Other Google Services" section & make sure Checkout is "switched to on".</span><a style="font-family: verdana;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-fRDqd6Y1-rh1YqPvPAh85DLQLh5NxUPaNNdjkVZxO2G5jxbgo5VGjpTtH1jrrrKc6XGagLpza2VenYeCmAMxXK57Zu1eoicV7Z-5kC7u2IqXXgQbzL627NXoINWTcs7lSh1KM7SP0II/s1600/Control+Panel.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 204px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-fRDqd6Y1-rh1YqPvPAh85DLQLh5NxUPaNNdjkVZxO2G5jxbgo5VGjpTtH1jrrrKc6XGagLpza2VenYeCmAMxXK57Zu1eoicV7Z-5kC7u2IqXXgQbzL627NXoINWTcs7lSh1KM7SP0II/s400/Control+Panel.png" alt="" id="BLOGGER_PHOTO_ID_5561074722522467426" border="0" /></a>IanCazhttp://www.blogger.com/profile/09356751538588602999noreply@blogger.com1tag:blogger.com,1999:blog-4680426044186107672.post-60445652203443588992010-03-04T10:02:00.004-06:002010-03-04T10:09:41.492-06:00Take your ASP.Net 2.0 App Offline quickly!!!I stumbled upon this little tidbit & decided it was reposting here. If you create a file in an ASP.Net 2.0 application named app_offline.htm it will bring down the appdomain & just return the contents of that HTML document!<br /><br />Make sure your HTML page is at least 512bytes in size, or IE's "friendly errors" may eat it. :)<br /><br />The <span style="font-style: italic;">MAJOR</span> benefit I see here is that you can quickly rename a standby page to app_offline.htm, make a few changes (replace locked files, etc) & then rename it back to app_online.htm & you're back in business.Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-3576266443560337192010-01-11T13:36:00.001-06:002010-01-11T13:38:54.072-06:00ASP Tags Not Recognized w/Nested Masterpages<p>Okay, I had an odd thing occur today while editing one of my projects. All of the <asp:*> tags had the red squiggly line under them, claiming:</asp:*></p> <p>“unrecognized tag prefix or device filter ‘asp’”</p> <p>After a little searching I found a <a href="http://groups.google.com/group/microsoft.public.vsnet.ide/browse_thread/thread/15c6061bf89e23a4/23c2760f3b78cb74?q=unrecognized+asp+prefix&rnum=1&safe=active" target="_blank">Google group post</a> stating that:<br />”…building makes no difference. what does make a difference is leaving the nested master page file open in the IDE editor window…”</p><p>So, just keep your "nested" master page open & all will be well.<br /></p>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-35104770646938659552009-10-27T09:19:00.007-05:002009-10-27T09:29:36.892-05:00My new obsession? The Droid!<p>Okay, it's finally time for me to carry on about my newest obsession, the Google Android based group of phones scheduled to hit Verizon soon™. What was initially thought to be <a href="http://droiddoes.com/" target="_blank">campaign</a> aimed at the Motorola Droid (a.k.a. Tao/Sholes). However, it’s been recently discovered that it’s actually a full “marketing blitz” for a range of Android OS phones on “Big Red”.</p><p><span style="font-weight: bold;">Known so far</span>:<br /><a href="http://www.boygeniusreport.com/2009/10/23/motorola-droid-preview/" target="_blank">Motorola Droid</a><br /><a href="http://www.engadgetmobile.com/2009/10/23/verizons-droid-is-a-series-not-just-a-phone-droid-eris-coming/" target="_blank">HTC Droid Eris</a> (re-brand of HTC Hero)</p><p><span style="font-weight: bold;">Rumored</span>:<br /><a href="http://www.boygeniusreport.com/2009/10/20/motorola-calgary-live-photos-verizons-second-motorola-android-device/">Motorola Calgary</a> (Running <a href="http://www.motorola.com/Consumers/US-EN/Consumer-Product-and-Services/MOTOBLUR/Meet-MOTOBLUR" target="_blank">Moto BLUR</a> UI)<br /><a href="http://phandroid.com/2009/09/16/htc-passion-3rd-verizon-android-in-2009/" target="_blank">HTC Passion</a> (Possibly the Dragon & running a Snapdragon 1GHz processor)</p><p>But that’s not of concern to me, I’ve got my eyes on the Moto Droid, it’s a wonderful bit of tech & may be enough to make me learn Java, just to be able to write apps for it!</p><p><a href="http://media.boygeniusreport.com/wp-content/uploads/2009/10/motorola-droid-preview-6.jpg" target="popUp"><img title="image" style="border-width: 0px; display: inline;" alt="image" src="http://media.boygeniusreport.com/wp-content/uploads/2009/10/motorola-droid-preview-6.jpg" border="0" width="400" /></a></p><p>It’s also supposed to come with this sexy dock, that turns it into an alarm clock! Woot!!!</p><p><a href="http://media.boygeniusreport.com/wp-content/uploads/2009/10/motorola-droid-preview-1.jpg" target="popUp"><img title="image" style="border-width: 0px; display: inline;" alt="image" src="http://media.boygeniusreport.com/wp-content/uploads/2009/10/motorola-droid-preview-1.jpg" border="0" width="400" /></a></p><p>The kicker for all of this is that it’s supposed to NOT be locked down by Verizon like all of their non-smartphone offerings.</p><p>So, needless to say, I’m really “geeking out” about this & can’t wait until tomorrow morning, when all will be revealed!</p>Anonymousnoreply@blogger.com1tag:blogger.com,1999:blog-4680426044186107672.post-6040445616718083232009-08-28T11:03:00.003-05:002009-08-28T11:22:34.768-05:00ASP.Net Custom Paging Control<p>I've been playing with GridViews for quite some time & have always wondered if there's a better way of displaying the pager at the bottom, instead of the "1 2 3 ..." that you get by default.</p> <p>As it worked out, I had the reason today to look more into this for a customer request. I happened to find <a href="http://forums.asp.net/t/823715.aspx#824634" target="_blank">an article</a> that gave code to do this. It was a decent starting point, but I didn’t like how the records displayed were numbered from 0-(count-1), but it got me going.</p> Here’s what two options I’m considering using:<br /><br />This one uses media player type links (i.e. |< << >> >|)<br /><pre class="brush: csharp;"><PagerTemplate><br /><asp:LinkButton CommandName="Page" CommandArgument="First" ID="LinkButton1" runat="server" Style="color: white">|&lt;</asp:LinkButton><br /><asp:LinkButton CommandName="Page" CommandArgument="Prev" ID="LinkButton2" runat="server" Style="color: white">&lt;&lt;</asp:LinkButton><br />[Records <%= (Grid.PageIndex * Grid.PageSize)+1 %> - <%= Grid.PageIndex * Grid.PageSize + Grid.Rows.Count %> (<%= iTotalRecordCount %>)]<br /><asp:LinkButton CommandName="Page" CommandArgument="Next" ID="LinkButton3" runat="server" Style="color: white">&gt;&gt;</asp:LinkButton><br /><asp:LinkButton CommandName="Page" CommandArgument="Last" ID="LinkButton4" runat="server" Style="color: white">&gt;|</asp:LinkButton><br /></PagerTemplate></pre>And this one has words for First/Last as well:<br /><pre class="brush: csharp;"><PagerTemplate><br /><asp:LinkButton CommandName="Page" CommandArgument="First" ID="LinkButton1" runat="server" Style="color: white">&lt;&lt; First</asp:LinkButton><br /><asp:LinkButton CommandName="Page" CommandArgument="Prev" ID="LinkButton2" runat="server" Style="color: white">&lt; Prev</asp:LinkButton><br />[Records <%= (Grid.PageIndex * Grid.PageSize)+1 %> - <%= Grid.PageIndex * Grid.PageSize + Grid.Rows.Count %> (<%= iTotalRecordCount %>)]<br /><asp:LinkButton CommandName="Page" CommandArgument="Next" ID="LinkButton3" runat="server" Style="color: white">Next &gt;</asp:LinkButton><br /><asp:LinkButton CommandName="Page" CommandArgument="Last" ID="LinkButton4" runat="server" Style="color: white">Last &gt;&gt;</asp:LinkButton><br /></PagerTemplate></pre>One caveat, I use a variable iTotalRecordCount that is defined on the code behind:<pre class="brush: csharp;">public int iTotalRecordCount = 0;</pre>And defined in a BindGrid() method I call on button click:<pre class="brush: csharp;">iTotalRecordCount = dataTable.Rows.Count;</pre>Lastly, you need to implement the "OnPageIndexChanging" event:<pre class="brush: csharp;"> protected void Grid_PageIndexChanging( object sender, GridViewPageEventArgs e ) {<br /> Grid.PageIndex = e.NewPageIndex;<br /> BindGrid( );<br /> }</pre>Anyway, I hope someone out there finds this useful. :)Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-22274845317313166452009-08-27T21:11:00.002-05:002009-08-27T21:16:03.584-05:00BlizzCon & the state of WarcraftWell another BlizzCon has come & gone, but alas, this time I was left watching the con from my living room. They sold 20,000 tickets in less than 1 minute...that's insane!<br /><br />One real benefit of buying the Internet Stream (not DirecTV in my house) is that I was able to watch the opening ceremony live, and then got to watch the rest of the segments "On Demand" from the website. If I had been there, it would have been "What did he say? Did I hear that correctly?" and then wait until I get to the hotel to see what the blogs/fansites were saying!<br /><br />That being said, I'm writing these thoughts since Silvermoon-US is currently down, along with a BUNCH of other servers as Blizzards Battle.Net authentication network has a massive stroke. :SAnonymousnoreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-80781871261972424512009-07-09T13:07:00.003-05:002009-07-09T13:09:03.983-05:00New Mechwarrior Game Announced!!!Woohoo, I'm sooo excited! I just read the <a href="http://kotaku.com/5310586/new-mechwarrior-game-confirmed-will-reboot-series">linked article</a> and am ecstatic to learn there's a "reboot" to the Mechwarrior series! From watching the trailer it looks AWESOME & fairly far along! Woot!Anonymousnoreply@blogger.com1tag:blogger.com,1999:blog-4680426044186107672.post-14875657842516630422009-06-04T16:12:00.003-05:002009-06-04T16:45:27.407-05:00Warrior Caps!Okay, so I'm trying to make sure that I've got all of my bases covered & after scouring over a TON of different posts on several sites, I believe I've compiled a concise list of the "soft caps" for a warrior. I've posted them here, so I can quit emailing myself this info & possibly help someone else out. Please feel free to comment below if my numbers are completely out of whack.<br /><br /><span style="font-weight: bold;">Protection-Tank</span>:<br />Hit Rating: 163<br />Expertise (Rating): 24 (189)<br />Defense: 540<br /><br /><span style="font-weight: bold;">DPS-Fury</span>:<br />Hit Rating: 165 (w/Precision)<br />Expertise (Rating):<br />- 18 (149) with Weapon Mastery<br />- 26 (214) without Weapon Mastery<br /><br /><span style="font-weight: bold;">DPS-Arms</span>:<br />Hit Rating: 263<br />Expertise (Rating):<br />- 18 (149) with Weapon Mastery<br />- 26 (214) without Weapon MasteryAnonymousnoreply@blogger.com2tag:blogger.com,1999:blog-4680426044186107672.post-31604220637774178972009-04-20T16:18:00.005-05:002009-04-20T16:28:40.950-05:00More Boxee Love - My BoxeeBoxOkay, so to alleviate the issues from my <a href="http://ian.cazabat.com/2009/04/feeling-boxxe-love-part-2.html">previous post</a>, I'm building a "new" BoxeeBox for use as my primary Media Center. Here are the parts I'm getting:<br /><ul><li><span style="font-weight: bold;">Case</span>: <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16811192090">Athena Power CA-1015IS30</a> (MicroATX)<a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16811192090"><br /></a><a target="popUp" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.newegg.com/Product/Product.aspx?Item=N82E16811192090"><img src="http://images17.newegg.com/is/image/newegg/11-192-090-TS?$S180W$" alt="Athena Power CA-1015IS30" border="0" /></a></li><li><span style="font-weight: bold;">Motherboard</span>: <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16813128379">GIGABYTE GA-MA78GM-US2H</a><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16813128379"><br /></a></li><li><span style="font-weight: bold;">Processor</span>: <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16819103210">AMD Athlon 64 X2 5200</a></li><li><span style="font-weight: bold;">RAM</span>: Use existing 2GB DDR2 sticks<br /></li><li><span style="font-weight: bold;">Hard Drive</span>: Use existing IDE for boot + 500GB MyBook for storage initially.<br /></li></ul>Several GREAT features of this motherboard:<br /><ul><li>Integrated 780G chipset (which includes the Radeon HD3200) and is discussed in-depth at <a href="http://www.tomshardware.com/reviews/amd-780g-chipset,1785.html">Tom's Hardware Guide</a>.</li><li>HD3200 features an embedded Universal Video Decoder (UVD) providing hardware decoding support for MPEG-2, H.264 and VC-1!!! Given this sort of hardware support, Tom's said that you could even use an AMD Sempron 3500+ to play back Full-HD.</li><li>HDMI Output direct to HDTV</li><li>eSATA connection for fast access to external storage</li></ul>Also, on a whim, I saw a great deal on a refurb <a href="http://www.buy.com/retail/product.asp?sku=210756030">Sony Blu-Ray drive at Buy.com</a> ($69.99)and so I picked one up. The Blu-Ray drive got here late last week, but the rest of the parts aren't scheduled to appear until Tuesday/Wednesday. I'll fill you guys in with a more detailed report, once I get the Case/MB/CPU in-hand & start the build!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-57328989849080841622009-04-20T15:19:00.004-05:002009-04-20T16:24:22.667-05:00Feeling the Boxee Love - Part 2Okay, so I've been playing with Boxee for awhile now (almost 2 months). I started out with Boxee on Ubuntu Linux and I was really excited to get to use Linux again (and avoid the hardware heavy MS operating systems). Unfortunately, I was plagued with Samba/smb issues & couldn't consistently get the sources to work. Luckily, I was invited to participate in the closed Alpha for Boxee for Windows.<br /><br />So, I reformatted the hard drive, installed XP & got to work with Boxee! So, a couple things of note here:<br /><ul><li>Don't use UNC names (i.e. \\MyComputer\MyMovies) as a source, map it to a drive instead.</li><li>Don't map drives to "internal" boxee drive letters (H:, Q:, T:, U: and Z:).</li></ul>I hijacked my wife's wireless keyboard/mouse to use & it makes life MUCH easier to manage/play. I was extremely impressed with how well the new nVidia software handles connection to a HDTV via DVI=> DHMI adapter. It allows you to "tweak" the settings & nailed the resolution the first time out.<br /><br />All that being said, a couple other "hardware issues" I had include:<br /><ul><li>An old Athlon XP CPU was not "up to snuff" for playing back DVD or HD content.</li><li>Wireless (802.11g) introduced additional latency that caused some streaming content to be "jumpy" (especially http://trailers.apple.com).</li><li>Having a loud computer next to your TV sucks. :(<br /></li></ul>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-84137485539850276832009-04-03T11:59:00.019-05:002009-04-03T15:19:46.790-05:00Nesting a Repeater inside of a GridView that is bound to an Array of Custom ObjectsWow, isn't that title a mouthful! But that's exactly the situation that presented itself to me at work this week. Since it too me way longer than I thought it should to figure out, I figured I'd put my effort in here, just in case it might be able to help someone else out someday (possibly even me).<br /><br />Here's the results:<table id="gvNestingSample" style="border: 1px none rgb(153, 153, 153); background-color: White; border-collapse: collapse;" border="1" cellpadding="3" cellspacing="0" rules="cols"><tbody><tr style="color: White; background-color: rgb(0, 0, 132); font-weight: bold;"><th scope="col">#</th><th scope="col">Name</th><th scope="col">Email Addresses</th></tr> <tr style="color: Black; background-color: rgb(238, 238, 238);" valign="top"> <td>1</td><td>Ian Cazabat</td><td><a href="mailto:IanCazabat@Example.com">IanCazabat@Example.com</a><br /><a href="mailto:Ian.B.Cazabat@Example.com">Ian.B.Cazabat@Example.com</a><br /><a href="mailto:IanCaz@Example.com">IanCaz@Example.com</a></td></tr> <tr style="color: Black; background-color: Gainsboro;" valign="top"> <td>2</td><td>Malcolm Reynolds</td><td><a href="mailto:CptnMal@Example.com">CptnMal@Example.com</a><br /><a href="mailto:Serenity1@Example.com">Serenity1@Example.com</a></td></tr><tr style="color: Black; background-color: rgb(238, 238, 238);" valign="top"> <td>3</td><td>Jonas Blane</td><td><a href="mailto:SnakeDr@Example.com">SnakeDr@Example.com</a><br /><a href="mailto:303rdLSG@Example.com">303rdLSG@Example.com</a></td></tr></tbody></table><br /><br />So, without any further delay here's the code:<br />ASPX:<br /><pre class="brush:csharp"><%@ Page Language="c-sharp" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head runat="server"><br /><title>Nested Sample</title><br /></head><br /><body><br /><form id="form1" runat="server"><br /><div><br /> <asp:GridView ID="gvNestingSample" AutoGenerateColumns="False" runat="server" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical"><br /> <RowStyle VerticalAlign="Top" BackColor="#EEEEEE" ForeColor="Black" /><br /> <Columns><br /> <asp:BoundField DataField="EmployeeId" HeaderText="#" /><br /> <asp:BoundField DataField="EmployeeName" HeaderText="Name" /><br /> <asp:TemplateField HeaderText="Email Addresses"><br /> <ItemTemplate><br /> <asp:Repeater runat="server" ID="rptEmailAddrs" DataSource='<%# DataBinder.Eval( Container.DataItem, "EmailAddresses" ) %>'><br /> <ItemTemplate><br /> <a href="mailto:<%# Container.DataItem %>"><%# Container.DataItem %></a><br /><br /> </ItemTemplate><br /> </asp:Repeater><br /> </ItemTemplate><br /> </asp:TemplateField><br /> </Columns><br /> <FooterStyle BackColor="#CCCCCC" ForeColor="Black" /><br /> <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" /><br /> <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /><br /> <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" /><br /> <AlternatingRowStyle BackColor="#DCDCDC" /><br /> </asp:GridView><br /></div><br /></form><br /></body><br /></html></pre><br /><br />CodeBehind:<br /><pre class="brush:c-sharp">using System;<br />using System.Data;<br />using System.Configuration;<br />using System.Web;<br />using System.Web.Security;<br />using System.Web.UI;<br />using System.Web.UI.WebControls;<br />using System.Web.UI.WebControls.WebParts;<br />using System.Web.UI.HtmlControls;<br /><br />public partial class _Default : System.Web.UI.Page {<br />protected void Page_Load( object sender, EventArgs e ) {<br />UserAccount[ ] aryUserAccounts = new UserAccount[ ] {<br /> new UserAccount( 1, "Ian Cazabat", new string[] {"IanCazabat@Example.com", "Ian.B.Cazabat@Example.com", "IanCaz@Example.com"}),<br /> new UserAccount( 2, "Malcolm Reynolds", new string[] {"CptnMal@Example.com", "Serenity1@Example.com"}),<br /> new UserAccount( 3, "Jonas Blane", new string[] {"SnakeDr@Example.com", "303rdLSG@Example.com"})<br />};<br /><br />gvNestingSample.DataSource = aryUserAccounts;<br />gvNestingSample.DataBind( );<br />}<br /><br />public class UserAccount {<br />private long employeeid;<br />private string employeename;<br />private string[ ] emailaddresses;<br /><br />public long EmployeeId {<br /> get { return employeeid; }<br /> set { employeeid = value; }<br />}<br />public string EmployeeName {<br /> get { return employeename; }<br /> set { employeename = value; }<br />}<br />public string[ ] EmailAddresses {<br /> get { return emailaddresses; }<br /> set { emailaddresses = value; }<br />}<br /><br />public UserAccount( ) {<br />}<br /><br />public UserAccount( long lEmployeeId, string strEmployeeName, string[] aryEmails ) {<br /> this.employeeid = lEmployeeId;<br /> this.employeename = strEmployeeName;<br /> this.emailaddresses = aryEmails;<br />}<br />}<br />}</pre><br />Okay, so there you have a working sample of how to create a GridView with a nested Repeater, that gets it's data from an Array of Custom Objects. Here's a couple points of interest:<br /><ol><li>In order to bind on the data in the object, they must be created as "fields" using get/set.<br /></li><li>To access the array that's part of the object use:<br /><span style="font-size:85%;"><span style="font-family:courier new;">DataSource='<%# DataBinder.Eval( Container.DataItem, "{Array Property Name}" ) %>'</span></span></li><li>To display the "data elements" from the array, you use:<br /><span style="font-size:85%;"><span style="font-family:courier new;"><%# Container.DataItem %></span></span><br /></li><li>If the "data elements" in the array are custom objects, then you need to use the following:<br /><span style="font-size:85%;"><span style="font-family:courier new;"><%# DataBinder.Eval( Container.DataItem, "{Property of Custom Object from Array}" )%></span></span></li></ol>Okay, so that's about got it, hopefully I've helped someone out & I've likely kept myself from losing too much sleep over this issue again! So, go forth & create! ;)Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-4680426044186107672.post-52096209735033846522009-03-09T12:42:00.004-05:002009-04-20T16:25:17.550-05:00So much for MythTV, I'm loving Boxee!!!Okay, I wrote quite some time ago about my experimentation with MythTV & my pursuit of a HTPC (Home Theater PC). So, the initial requirement was to be able to play my DVD's, CD's & look at pictures on my 56" TV in the living room. MythTV met this goal, but also added quite a bit of complexity when you factor in the PVR functionality that it provides.<br /><br />So, after weeks of playing with MythTV, I've been turned on to <a href="http://www.boxee.tv/">Boxee</a>! Boxee is quite simply, a digital media player, that allows me to do the following:<br /><ul><li>Play existing Movies - DVD, ISO, mpeg<br /></li><li>Play existing Music - CD, mp3<br /></li><li>Browse Photo slide-show</li><li>Watch on-demand streaming media from <a href="http://cbs.com/">CBS</a>, <a href="http://mtv.com/">MTV</a>, <a href="http://youtube.com/">YouTube</a> & <a href="http://hulu.com/">Hulu</a> (right now via a hack)</li><li>Listen to streaming audio via the internet</li><li>Browse photos from <a href="http://www.flickr.com/">Flickr</a> & <a href="http://picasa.google.com/">Picasa</a></li></ul>All of the media options are available using a local Optical Drive (CD/DVD), local hard drive, or across your local network via SAMBA!<br /><br />A great Blog post with a fairly <a href="http://opensourcepenguin.net/index.php?option=com_content&task=view&id=131">detailed write-up on installing Boxee on Ubuntu 8.10</a> can be found at the <a href="http://opensourcepenguin.net/">OpenSourcePenguin.net</a>. This is a nicely detailed piece, that doesn't waste time on a lot of unnecessary fluff.<br /><br />I'll be following up with another post regarding using a remote & how the rest comes along!<br /><span style="font-size:78%;"></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-46033640586941944732009-02-26T09:44:00.006-06:002009-02-26T09:49:56.725-06:00WTFs/minuteJust had to take a second & link this great comic I saw referenced on <a href="http://www.codinghorror.com/blog/">Coding Horror</a> that explains how to recognize good code during a code review:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.osnews.com/images/comics/wtfm.jpg"><img style="cursor: pointer; width: 350px;" src="http://www.osnews.com/images/comics/wtfm.jpg" alt="" border="0" /></a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-33755014745021471252009-01-09T15:58:00.002-06:002009-01-09T16:16:58.283-06:00MythTvMan, it's been a bit since I posted anything here...what a slacker.<br /><br />Well, here's my newest time waster, MythTv. Several years ago, I bought a Sony 400 disc DVD changer, to keep little fingers from destroying my DVD collection (problem #1). Alas, the navigation in the unit was crummy & digging through the "library" to find a movie never really worked. I wound up putting labels in the DVD cases telling what spot the DVD was in, but this left problem #2, all the cases were still cluttering up the living room.<br /><br />So, after 6+ years, I think I'm at the point where we need to move away from the beast, to a more useful solution, enter <a href="http://www.mythtv.org">MythTv</a>!!!<br /><br />MythTv is a Digital Video Recorder (DVR) & multimedia server of sorts. It will let you watch all of your "stand alone" movies, view your pictures & listen to your music. In addition to all of this, it'll also allow you to record/pause/rewind live TV with the use of a <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16815116028">TV Tuner Card</a>.<br /><br />Right now, I'm still infatuated with <a href="http://uverse.att.com/">AT&T's U-Verse</a>, so I don't really care about the DVR aspects, since U-Verse comes with a 4-tuner DRV (2-HD & 2-SD).<br /><br />What I DO care about, is it's built-in ability to RIP & Playback DVD's, in addition to all of your other Media Files.<br /><br />I've cobbled together a PC out of old parts, to play around with. My first cut is using <a href="http://www.mythdora.com/">MythDora</a> which is a complete Linux distribution, based on the Fedora Core distro. Another great benefit of MythTv is that it lets you break off the server/storage part & run a dedicated "front end" for MythTv. Assuming I'm happy with how this performs, I'll be looking for a small front-end to put by my TV, while keeping the monster hidden away downstairs, or in a closet.<br /><br />Ideally, there would be some way to access MythTv from my Wii, that's already taking up space. <a href="http://wiire.org/MythWiiFE">Wiire.org</a> has some promising info based on streaming video from MythTv (Using MythWeb) to the Wii, using the Internet Channel.<br /><br />Okay, enough for now...I'll post again, once I make more progress on this.Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-4680426044186107672.post-60275591904649933322008-10-07T14:15:00.002-05:002008-10-07T14:19:54.435-05:00BlizzCon 2008!!!This Friday & Saturday, geeks from around the world will gather in Anaheim, California to see what Blizzard, Inc. has to offer. Blizzard is responsible for franchises such as <span style="font-style: italic;">StarCraft</span>, <span style="font-style: italic;">WarCraft</span> & <span style="font-style: italic;">Diablo</span>. They also infected the world with <span style="font-style: italic;">World of WarCrack</span>, which has been present in my life for the better part of 4 years.<br /><br />So, a friend of mine and I are headed out to Cali to ROCK BLIZZCON!!!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-6387635900248362402008-08-15T14:18:00.003-05:002008-08-15T14:24:41.829-05:00How to Make Ice Cream at Home with Basic MaterialsEver wanted to make ice cream "quickly" at home? I found this cool (no pun intended) article on wikihow.com.<br /><h1 style="margin-bottom: 0px;"><a href="http://www.wikihow.com/Make-Ice-Cream">How to Make Ice Cream</a></h1><h2>Ingredients </h2>Makes one serving:<br /><ul><li>1/2 cup milk(any type), cream or half & half<br /></li><li>1 tablespoon of sugar<br /></li><li>1/4 teaspoon of vanilla extract or chocolate syrup<br /></li><li>lots of ice<br /></li><li>rock salt<br />- You can also <a href="http://www.wikihow.com/Make-Rock-Salt" title="Make Rock Salt">make your own rock salt from regular table salt</a><br /><br /></li></ul><a name="Steps"></a><h2> Steps </h2><a name="Plastic_Bag_Method"></a> Plastic Bag Method<br />This is good for making individual servings of ice cream to be eaten promptly after making. The video below shows a slightly different recipe but still instructs on how to make ice cream with a sandwich bag.<br /><ol><li>Mix sugar, milk or half & half, and flavoring in a bowl, then seal it in a quart-sized plastic bag.<br /></li><li>Take roughly two quarts of <a href="http://www.wikihow.com/Make-Ice-Cubes-With-an-Ice-Tray" title="Make Ice Cubes With an Ice Tray">ice</a> (crushed if possible) and place it into the gallon-sized bag with <a href="http://www.wikihow.com/Make-Rock-Salt" title="Make Rock Salt">rock salt</a>. Ideally, the gallon bag will be roughly half full with the ice and salt mixture.<br /></li><li>Place the <i>sealed</i> quart-sized bag with the ingredients into the gallon-sized bag. Make sure the bags stay sealed! Do not allow the contents to mix at any time. If the bags don't seal sufficiently, use duct tape to seal the top of both bags to ensure they don't open during shaking.<br /></li><li>Gently agitate, massage, and shake the bags for about ten to fifteen minutes. In this amount of time the contents of the quart (smaller) bag should start to turn into solid ice cream.As you agitate the two bags, it is important that you are mixing the contents of the inner bag, but you don’t want to be so aggressive that you burst the inner bag or cut it on the ice (double-bagging should prevent this).If your hands get uncomfortably cold, use a towel or an old t-shirt to hold the bags as you massage them; they will be quite cold and might become slippery with accumulated condensation. Consider using gloves or massaging while holding onto the top seal if a towel or similar cloth is not available.<br /></li><li>Remove the small bag from the large bag. Scoop the ice cream from the small bag and enjoy!<br /></li></ol><a name="Pot-Freezer_Method"></a><a name="Things_You.27ll_Need"></a><h2> Things You'll Need </h2><ul><li>spatula, whisk, or hand-held mixer<br /></li><li>one gallon-size zip one quart-size zip bag<br /></li></ul><a name="Related_wikiHows"></a><a name="Sources_and_Citations"></a><p>Parts of a<i>rticle provided by <a href="http://www.wikihow.com/Main-Page">wikiHow</a>, a collaborative writing project to build the world's largest, highest quality how-to manual. Please edit this article and find author credits at the original wikiHow article on <a href="http://www.wikihow.com/Make-Ice-Cream">How to Make Ice Cream</a>. All content on wikiHow can be shared under a <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/">Creative Commons license</a>.</i><br /></p>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-4680426044186107672.post-45741257401510902542008-07-31T09:57:00.002-05:002008-07-31T10:01:39.576-05:00No Dynamic Ports for Visual Studio 2005 Web ServerOcassionally, having VS2005 create localhost using a random number can be a pain. To get around this, click the website "root" in Solution Explorer & then bring up the properties. In the properties pane, set "Use dynamic ports" to False & then set "Port number" to whatever value you want between 1024 and 5000.Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-4680426044186107672.post-52173448531884062712008-07-21T15:22:00.006-05:002008-07-21T15:42:15.396-05:00Disable SuperFetch in VistaIn a comment on his Blog (<a href="http://www.codinghorror.com/blog/archives/000688.html">Coding Horror</a>), Jeff Atwood pointed out the command to temporarily turn off SuperFetch, Vista's new memory caching program. Some people have hinted that SuperFetch may cause slow-down or other issues. <a href="http://en.wiktionary.org/wiki/YMMV">YMMV</a><br /><br />Command:<br />net stop superfetch<br /><br />*Note: This will come back after a restart, so if you want to kill it, disable the service.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-4680426044186107672.post-62796772802832644432008-07-10T14:05:00.003-05:002008-07-21T15:34:00.696-05:00Display all the properties in an ObjectI've come across this problem before, sometimes when working with classes designed by different groups, other times when I'm being lazy & don't want to look through my code. Either way, it's sometimes handy to be able to iterate through the properties of an object. So, here's a "quickie" to dump the property names/values to an exception.<br /><br />Definition:<br /><blockquote><pre class="code">public void showObjProperties( object myObject ) {<br /> System.ComponentModel.PropertyDescriptorCollection objProperties = System.ComponentModel.TypeDescriptor.GetProperties( myObject );<br /> string strTmp = "";<br /> string strType = myObject.GetType( ).ToString( );<br /> for ( int i = 0; i < objProperties.Count; i++ ) {<br /> strTmp += strType + "." + objProperties[i].Name + Environment.NewLine;<br /> //strTmp += strType + "." + objProperties[i].Name + ": " + objProperties[i].GetValue( myObject ).ToString( ) + Environment.NewLine;<br /> }<br /> throw new Exception( "Props: " + Environment.NewLine + strTmp );<br /> }</pre></blockquote><br /><br />Calling code:<br /><blockquote><pre class="code">String[] aryString = new String[] { "test1", "test2", "test3" };<br />showObjProperties( aryString );</pre></blockquote><br /><br />Results:<br /><blockquote><pre class="code">Props: <br />System.String[].Length<br />System.String[].SyncRoot<br />System.String[].Rank<br />System.String[].IsReadOnly<br />System.String[].IsFixedSize<br />System.String[].IsSynchronized<br />System.String[].LongLength<br /></pre></blockquote>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-4680426044186107672.post-50903422214685390032008-07-02T10:19:00.005-05:002008-07-21T15:34:00.697-05:00Comparing Custom Objects in C#Once again I found myself trying to remember the specifics of how to compare specific attributes of a custom object when doing an Array Sort. The linked MS kb article has the specifics, but I'll copy some of that here, for longevity. ;)<br /><blockquote><pre class="code">private class sortYearAscendingHelper : IComparer<br />{<br /> int IComparer.Compare(object a, object b)<br /> {<br /> car c1=(car)a;<br /> car c2=(car)b;<br /> if (c1.year > c2.year)<br /> return 1;<br /> if (c1.year < c2.year)<br /> return -1;<br /> else<br /> return 0;<br /> }<br />}</pre></blockquote><br />The key is you have to return one of three values:<br /><ul><li>-1 if the first object is less than the second</li><li>1 if the first object is greater than the second</li><li>0 if the values of the two objects are equal</li></ul>Hope this helps someone,<br />IanUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680426044186107672.post-60431966570784603332008-06-26T15:30:00.005-05:002008-07-21T15:35:07.707-05:00Patches?It appears that in v2.4.3 Blizzard has made the decision to allow mounts at level 30. Man this really chaps my ass, since I just hit 43 on my priest. Ah well, on the bright side, it gives me a reason to level my hunter and warlock (25/21) again. ;)Unknownnoreply@blogger.com0