<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2951930193152375440</id><updated>2012-01-23T03:46:21.366-08:00</updated><category term='C#'/><category term='Coding'/><category term='Mod Arithmetic'/><category term='object orientation'/><category term='file tracking'/><category term='bandwidth'/><category term='software'/><category term='file collaboration'/><category term='development'/><category term='programming'/><category term='methodology'/><category term='file sharing'/><category term='file synchronisation'/><category term='cross threading'/><category term='safely invoking'/><title type='text'>Coderoo</title><subtitle type='html'>A journal of our software development ideas.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://coderoo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2951930193152375440/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://coderoo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>corpsekicker</name><uri>http://www.blogger.com/profile/13023104363640072354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp0.blogger.com/_RP6EUo1-7LI/SIMVgZi-ENI/AAAAAAAAABU/fz0mmhdV0B0/S220/31.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2951930193152375440.post-5624379009921097184</id><published>2011-09-29T01:19:00.000-07:00</published><updated>2011-09-29T01:35:49.513-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='development'/><category scheme='http://www.blogger.com/atom/ns#' term='cross threading'/><category scheme='http://www.blogger.com/atom/ns#' term='safely invoking'/><category scheme='http://www.blogger.com/atom/ns#' term='Coding'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Safely invoking view-related methods from a controller</title><content type='html'>Now I've got this situation where I need to call view-refresher stuff from my controller. But the call happens to be inside a background worker. I get a cross thread exception: you can't access stuff that was created on the view thread.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution: Invoke it safely:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      public void RefreshView()&lt;br /&gt;      {&lt;br /&gt;          if (this.InvokeRequired)&lt;br /&gt;          {&lt;br /&gt;              this.Invoke(new UpdateDisplayStateCallback(this.RefreshViewInternally));&lt;br /&gt;          }&lt;br /&gt;          else&lt;br /&gt;          {&lt;br /&gt;              this.RefreshViewInternally();&lt;br /&gt;          }&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;(RefreshViewsInternally can now contain references to view components you wanted to actually refresh.)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What's that? You want to know how to make your call back method something with parameters? No problem:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      public void RefreshViews(ReallyComplexObjectYouCreatedYourself myReallyComplexObjectYouCreatedYourself)&lt;br /&gt;      {&lt;br /&gt;          if (this.InvokeRequired)&lt;br /&gt;          {&lt;br /&gt;              this.Invoke(new Action&lt;reallycomplexobjectyoucreatedyourself&gt;(this.RefreshViewsInternally), myReallyComplexObjectYouCreatedYourself);&lt;br /&gt;          }&lt;br /&gt;          else&lt;br /&gt;          {&lt;br /&gt;              this.RefreshViewsInternally(myReallyComplexObjectYouCreatedYourself);&lt;br /&gt;          }&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Now, RefreshViewsInternally is allowed to have this signature: RefreshViewsInternally(ReallyComplexObjectYouCreatedYourself myReallyComplexObjectYouCreatedYourself);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Booya.&lt;br /&gt;&lt;/reallycomplexobjectyoucreatedyourself&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2951930193152375440-5624379009921097184?l=coderoo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://coderoo.blogspot.com/feeds/5624379009921097184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://coderoo.blogspot.com/2011/09/safely-invoking-view-related-methods.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2951930193152375440/posts/default/5624379009921097184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2951930193152375440/posts/default/5624379009921097184'/><link rel='alternate' type='text/html' href='http://coderoo.blogspot.com/2011/09/safely-invoking-view-related-methods.html' title='Safely invoking view-related methods from a controller'/><author><name>corpsekicker</name><uri>http://www.blogger.com/profile/13023104363640072354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp0.blogger.com/_RP6EUo1-7LI/SIMVgZi-ENI/AAAAAAAAABU/fz0mmhdV0B0/S220/31.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2951930193152375440.post-3480429320557125218</id><published>2011-06-13T00:20:00.000-07:00</published><updated>2011-06-13T00:29:42.757-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mod Arithmetic'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Coding'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Modular Arithmetic</title><content type='html'>More a note to self than anything else:&lt;br /&gt;&lt;br /&gt;Given x, return a value which is a multiple of y and "still sufficiently close to x". Surely there's a way of phrasing that second part more eloquently?&lt;br /&gt;&lt;br /&gt;In C# code:&lt;br /&gt;&lt;br /&gt;decimal TransformXToMultipleOfY(decimal x, decimal y)&lt;br /&gt;        {&lt;br /&gt;            decimal modResult = x % y;&lt;br /&gt;&lt;br /&gt;            if (modResult == 0)&lt;br /&gt;            {&lt;br /&gt;                return x;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            return x+ (y - (x % y));&lt;br /&gt;        }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2951930193152375440-3480429320557125218?l=coderoo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://coderoo.blogspot.com/feeds/3480429320557125218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://coderoo.blogspot.com/2011/06/modular-arithmetic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2951930193152375440/posts/default/3480429320557125218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2951930193152375440/posts/default/3480429320557125218'/><link rel='alternate' type='text/html' href='http://coderoo.blogspot.com/2011/06/modular-arithmetic.html' title='Modular Arithmetic'/><author><name>corpsekicker</name><uri>http://www.blogger.com/profile/13023104363640072354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp0.blogger.com/_RP6EUo1-7LI/SIMVgZi-ENI/AAAAAAAAABU/fz0mmhdV0B0/S220/31.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2951930193152375440.post-163967135204858599</id><published>2009-05-10T11:14:00.000-07:00</published><updated>2009-05-10T11:42:03.305-07:00</updated><title type='text'>Okay so I have the tools, now what?</title><content type='html'>Coming from a linux / vim environment where trying to get something to do what it's supposed to can at times be a painful experience I was surprised to see just how easy a package like Visual Studio can make your life. It seems as if a great deal of effort has been put into taking away the time consuming and frustrating tasks developers face.&lt;br /&gt;&lt;br /&gt;The intellisense-thingy rocks. I know most packages offer this but I've never stopped to think just how much it can speed up what you're doing. Another feature that seems pretty cool are breakpoints. I expect the more I learn I'll see how powerful tools like these can be.&lt;br /&gt;&lt;br /&gt;So where to now? I'll be doing alot of reading on &lt;a href="http://msdn.microsoft.com/en-us/vcsharp/aa336766.aspx"&gt;msdn&lt;/a&gt; and another nice place to get some quick information is &lt;a href="http://stackoverflow.com"&gt;stackoverflow&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I think firstly I should get a better understanding of OO concepts and how it's actually used. Internet to the rescue!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2951930193152375440-163967135204858599?l=coderoo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://coderoo.blogspot.com/feeds/163967135204858599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://coderoo.blogspot.com/2009/05/okay-so-i-have-tools-now-what.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2951930193152375440/posts/default/163967135204858599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2951930193152375440/posts/default/163967135204858599'/><link rel='alternate' type='text/html' href='http://coderoo.blogspot.com/2009/05/okay-so-i-have-tools-now-what.html' title='Okay so I have the tools, now what?'/><author><name>emong</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2951930193152375440.post-3617137346189233455</id><published>2009-04-06T05:39:00.000-07:00</published><updated>2009-04-06T06:02:48.490-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='file synchronisation'/><category scheme='http://www.blogger.com/atom/ns#' term='file collaboration'/><category scheme='http://www.blogger.com/atom/ns#' term='development'/><category scheme='http://www.blogger.com/atom/ns#' term='methodology'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='file sharing'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='object orientation'/><category scheme='http://www.blogger.com/atom/ns#' term='bandwidth'/><category scheme='http://www.blogger.com/atom/ns#' term='file tracking'/><title type='text'>Project 1: File Contribution, Tracking, Sharing, Collaboration, Synchronisation</title><content type='html'>On Friday, the 3rd of April at about 6 in the morning, it struck Robert that learning C# might not be a bad idea. We identified that the problem with learning a programming language or any software development methodology from scratch using online tutorials is that the usage examples don't really make any sense. &lt;br /&gt;&lt;br /&gt;When people ask me what object orientation is, I use the classic example of the class "Person" and the object instantiation of "Person", "kareema" or "aPerson". I hear myself going on and on about how a Person needs a Name, an Age and a Sex and that kareema, the instantiation of the class Person needs particular values for those criteria. &lt;br /&gt;&lt;br /&gt;Robert asks me, "When will I ever need that?" and it's clear to me that the only way to learn stuff like that is to need it. Incidentally, we do. &lt;br /&gt;&lt;br /&gt;Enter the problem: My sisters and I have a network set up at home. We all share the same DSL internet connection and we all download data. Sometimes we download the same stuff without realising it. Bandwidth usage is a big thing for us because it happens to be relatively expensive where we live and we'd like to minimise it. &lt;br /&gt;&lt;br /&gt;I know there are file synchronisation tools available for downloading and buying but we thought this would be a great opportunity to exercise skills, become more familiar with the development environment and identify needs for patterns and such the like.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2951930193152375440-3617137346189233455?l=coderoo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://coderoo.blogspot.com/feeds/3617137346189233455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://coderoo.blogspot.com/2009/04/project-1-file-contribution-tracking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2951930193152375440/posts/default/3617137346189233455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2951930193152375440/posts/default/3617137346189233455'/><link rel='alternate' type='text/html' href='http://coderoo.blogspot.com/2009/04/project-1-file-contribution-tracking.html' title='Project 1: File Contribution, Tracking, Sharing, Collaboration, Synchronisation'/><author><name>corpsekicker</name><uri>http://www.blogger.com/profile/13023104363640072354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp0.blogger.com/_RP6EUo1-7LI/SIMVgZi-ENI/AAAAAAAAABU/fz0mmhdV0B0/S220/31.JPG'/></author><thr:total>0</thr:total></entry></feed>
