tag:blogger.com,1999:blog-73937681722523733052024-03-14T06:02:10.322+01:00Coding in the Rainmiserable facts, coding help and agile spice for C#, ASP.NET, IIS, BlackBerry, Android, WiMo etc...Unknownnoreply@blogger.comBlogger22125tag:blogger.com,1999:blog-7393768172252373305.post-38129774348084825912011-06-30T00:46:00.003+02:002011-06-30T00:54:15.520+02:00Mobile - Design for reusabilityI have faced the problem of writing the very same feature/screen for many apps. It seems quite obvious. Designing the interface, using some inheritance can easily make the day.<br /><br />However there are some small and ridiculous issues:<br />- watch out for helper or utility methods, constants! - try to use a unified set of helper classes for some task, so you can easily share or in worse case copy them.<br />- check hidden requirements! if the "same" feature in two areas looks 90% similar- it will give you a hard time to implement for both cases.<br /><br />Languages:<br />- C-based lets you build a common code folder to include or even a library<br />- Java based projects will give you a hard imeas package identifiers will contain app specific parts. Consider library based approach.Attila Faragohttp://www.blogger.com/profile/02786845334339923523noreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-51225713057886088472011-05-09T16:10:00.003+02:002011-05-09T16:16:45.212+02:00Cocoa with loveCocoa & objective-C - though somewhat strange to us, earthlings grown up on Visual Studio with C# and Eclipse with Java - has some quite interesting and useful and interesting features to be used.<br /><br />As I just exploring this whole new galaxy, it shall not be a shame to present some of these "stone samples" just found...<br /><br /><pre class="cpp" name="code"><br />[customers valueForKeyPath:@"@avg.emailAddress.length"];<br /></pre><br />... more on Cocoa key paths <a href="http://www.cimgf.com/2008/08/24/cocoa-tutorial-c-linq-or-cocoa-key-paths-and-nspredicate/">here</a>.<br /><br /><pre class="cpp" name="code"><br />NSPredicate *bPredicate =<br /> [NSPredicate predicateWithFormat:@"SELF beginswith[c] 'b'"];<br />NSArray *beginWithB =<br /> [array filteredArrayUsingPredicate:bPredicate];<br /></pre><br />...more on predicates <a href="http://stackoverflow.com/questions/110332/filtering-nsarray-into-a-new-nsarray-in-objective-c">here</a>.Attila Faragohttp://www.blogger.com/profile/02786845334339923523noreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-73168517549536216252011-04-09T18:20:00.004+02:002011-04-09T18:47:37.135+02:00Folk dancing bubble sortI am always fond of any visualization of algorithms and making (not so) complex things easy to understand for everyone.<br /><br /><iframe title="YouTube video player" width="500" height="300" src="http://www.youtube.com/embed/lyZQPjUT5B4" frameborder="0" allowfullscreen></iframe>Attila Faragohttp://www.blogger.com/profile/02786845334339923523noreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-11238702181534553832011-04-06T14:08:00.002+02:002011-04-06T14:16:02.306+02:00NSInvocation in Objective C via delegateI had some hard time finding the solution for a smooth usage of NSInvocation.<br />Furthermore I was to call a method within a delegate.<br /><br />All's well that ends well and I am happy now.<br /><br />Here is my code snippet.<br />My very last error was that I forgot to call the setSelector method :)<br /><br /><pre class="cpp" name="code"><br />if (self.delegate)<br />{<br /> SEL sel = @selector(fetchComplete:withParam1:withParam3:);<br /> if (self.delegate!=nil && [self.delegate respondsToSelector:sel])<br /> {<br /> NSMethodSignature *sig = [[self.delegate class] instanceMethodSignatureForSelector:sel];<br /> NSInvocation *inv = [NSInvocation invocationWithMethodSignature:sig];<br /> <br /> [inv setSelector:sel];<br /> [inv setTarget:self.delegate];<br /> [inv setArgument:&Param1 atIndex:2];<br /> [inv setArgument:&Param2 atIndex:3];<br /> [inv setArgument:&Param3 atIndex:4];<br /> <br /> [inv invoke];<br /> <br />// [self.delegate performSelector:@selector(fetchComplete:withParam1:withParam2:)<br />// withObject:elementtype<br />// withObject:Param2<br />// withObject:Param3<br />// ];<br /> }<br />}<br /></pre>Attila Faragohttp://www.blogger.com/profile/02786845334339923523noreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-89374464374100191812011-03-15T22:18:00.006+01:002011-03-15T22:43:07.753+01:00Facebook development made easyRecently a colleague of mine talked about some quite cool facebook app, he developed.<br /><br />About the motivation: I am always quite enthusiastic about any web application, especially when integrated.<br /><br />It was quite astonishing to see that facebook has a very easy to use integration library.<ol><li>download the <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=CCD46762-45EC-4FBE-AD91-FC916671E734&displaylang=en">Facebook Development Toolkit</a> from Microsoft</li><li>install it</li><li>add the necessary tabs to the toolbox (default path for the dlls are C:\Program Files\Coding4Fun\Facebook\Binaries\)</li><li>Create an IIS website for the application</li><li><span style="font-style: italic;">(my default site was tergeted for v2.0 .NET framework, and yielded errors. Thus I needed to change to v4.0 framework)</span></li><li><span>you might host your app in your own server, however for simplicity </span><span>why not register </span><span>your application at localhost? :)</span><span style="font-style: italic;"><br /></span></li><li>off you go...</li></ol><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-DeMszSTvV1g/TX_cWcvE1yI/AAAAAAAAADE/KKc40TxZQMI/s1600/FireShot%2Bcapture%2B%2523002%2B-%2B%2527Untitled%2527%2B-%2Blocalhost_8080__auth_token%253D2e1afe1e778f98eb21944c1a89f8f907.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 90px;" src="http://3.bp.blogspot.com/-DeMszSTvV1g/TX_cWcvE1yI/AAAAAAAAADE/KKc40TxZQMI/s320/FireShot%2Bcapture%2B%2523002%2B-%2B%2527Untitled%2527%2B-%2Blocalhost_8080__auth_token%253D2e1afe1e778f98eb21944c1a89f8f907.png" alt="" id="BLOGGER_PHOTO_ID_5584424341191579426" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-OEAO6W26CKQ/TX_ba0mR_eI/AAAAAAAAAC8/8g2Ed7nlI4E/s1600/FireShot%2Bcapture%2B%2523002%2B-%2B%2527Untitled%2527%2B-%2Blocalhost_8080__auth_token%253D2e1afe1e778f98eb21944c1a89f8f907.png"><br /></a>Should you need some hint or sample code, just visit this <a href="http://www.stevetrefethen.com/blog/DevelopingFacebookapplicationsinCwithASPNET.aspx">blog post</a> from Steve.Attila Faragohttp://www.blogger.com/profile/02786845334339923523noreply@blogger.com1tag:blogger.com,1999:blog-7393768172252373305.post-1203850189428623772011-03-02T01:28:00.003+01:002011-03-02T01:31:04.527+01:00You Win, RIM (link)A colleague of mine has drawn mine attention to this nice and funny <a href="http://blog.jamiemurai.com/2011/02/you-win-rim/">blog post</a> about a superhero developer just tring to develop on BlackBerry RIM platform.<br />As I have experienced the very same attitude I can just congratulate the guy for his willing.Attila Faragohttp://www.blogger.com/profile/02786845334339923523noreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-11766905111988254572011-02-17T13:22:00.001+01:002011-02-17T13:44:43.123+01:00Sociometry, Social Network AnalisysA couple years ago I have created a simple tool to visualize a sociometry.<br />
A sociometry is a <a href="http://en.wikipedia.org/wiki/Sociometry">simple quantitative method</a> to visualize social relations.<br />
<br />
Given a class the teacher asks some questions about likes and dislikes within the predefined group of persons (class).<br />
<br />
Given a connection matrix between the individuals the main task is to visualize and cluster groups within the class and understand important factors like central and peripheral positions.<br />
<br />
Here is a visualization of a sample dataset (without names).<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-JBcjpiY5uK4/TV0RtHtD2VI/AAAAAAAAHQc/aKK8q8fAW7U/s1600/sociometry.png" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="150" width="200" src="http://3.bp.blogspot.com/-JBcjpiY5uK4/TV0RtHtD2VI/AAAAAAAAHQc/aKK8q8fAW7U/s200/sociometry.png" /></a></div><br />
The tool takes the individuals and the connections into account and attracts and distracts/repels the nodes (persons) thus minimizing the total aggregated force within the system (attraction is +, repel is -).<br />
<br />
I am keen to rewrite the whole tool in C# in the near future.<br />
<br />
My current formulas for the sliders are:<br />
<ul><li>repel: sqrt(exp(1/dist)*trProximity.Position)*cos(angleA)<br />
<li>attrack: sgn(ddist)*sqrt(exp(abs(ddist)/trConnection2.Position)*trConnection.Position)*cos(angleA)<br />
<li>mutual connections can receive bonus attraction<br />
</ul>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-89089114295862604882011-02-14T18:32:00.002+01:002011-02-14T18:40:29.058+01:00Performance counters runnning wild -- Perfmon, Data Collection SetsIn our project we were lucky enough to reach the point for performance profiling and optimization.<br />
My colleagues were constantly fighting with time: the profiled instance being requested from the cloud and they were monitoring and then saving the screenshot and the data from performance monitor. They were not able to leave the office until the measurement typically taking 1 hour were done. We needed data from the perfmon.<br />
<br />
I just happened to meet the adequate solution on windows.<br />
One can define Data Collection Sets and afterwards getting data out via reports with the perfmon tool.<br />
A sample for ReadyBoost technology profiling can be found <a href="http://www.techrepublic.com/blog/window-on-windows/keep-tabs-on-readyboost-with-windows-7s-performance-monitor/2257">here</a>.<br />
<br />
Do you happen to know the demotivational poster about <a href="http://blog.eveningcreek.com/?p=123">premature optimization</a> & the devil? And <a href="http://www.c2.com/cgi/wiki?PrematureOptimization">Mr Knuth</a> of course.)<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-y-_eIBHKK7Q/TVlo4Zrw9XI/AAAAAAAAHOM/IUziLpXoOZ4/s1600/premature-6%255B1%255D.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="148" width="200" src="http://1.bp.blogspot.com/-y-_eIBHKK7Q/TVlo4Zrw9XI/AAAAAAAAHOM/IUziLpXoOZ4/s200/premature-6%255B1%255D.jpg" /></a></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-45693628506605592342011-02-04T12:33:00.001+01:002011-02-04T12:35:12.749+01:00Long long time ago, there was a .NET/CLRRecently I had a quite interesting opportunity to talk about .Net fundamentals.<br />
Though using C# for various reasons and framework I am aware that I lack the real bits and bolts of the language & the framework.<br />
<br />
An interesting (and quite basic topic) - FYI.<br />
<br />
What will b1 and b2 be (and why)?<br />
<br />
<pre class="cpp" name="code"> object s1 = "apple";
object s2 = "apple";
bool b1 = s1 == s2;
object i1 = 1;
object i2 = 1;
bool b2 = i1 == i2;
</pre><br />
I remembered that I need the fundamentals of boxing and unboxing, etc; therefore my answer was ok, however the reasoning was not ok. Some background <a href="http://msdn.microsoft.com/en-us/magazine/cc301569.aspx">here</a>.<br />
The solution is (true, false). My understanding about the reasons: b1: Reference, however string is immutable thus CLR maps to same address; b2: boxed value type becomes reference type, thus different pointers.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-92087998940992074912011-02-03T12:36:00.000+01:002011-02-03T12:36:05.590+01:00Taking screenshots on an Android phoneThe team has just finished our brand new Android client application.<br />
I was naive enough to make an attempt to capture some screenshots on the device.<br />
<br />
This task was very straightforward on iPhone, Windows Mobile and even with some utility on BlackBerry. However on Android every forum tried to go for turning on the USB debugging option and then taking the screenshots on the PC.<br />
I do not like this approach (and also it wouldn't work on my PC due to some missing Samsung drivers).<br />
<br />
A smartphone should be self-contained: installing apps, taking screenshots, everything.<br />
<br />
After some googling I managed to find this nice utility: <a href="http://www.androidmanual.net/taking-a-screenshot-on-android-phone.html">screenshot.apk</a>.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_IwVEsrGwbqc/TUqTGS2qL7I/AAAAAAAAHNc/bUuX14rD-PA/s1600/screenshot_5%255B1%255D.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/_IwVEsrGwbqc/TUqTGS2qL7I/AAAAAAAAHNc/bUuX14rD-PA/s320/screenshot_5%255B1%255D.jpg" width="213" /></a></div><br />
<br />
Try it, it seems to perform well.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-65438828528440771522011-01-26T23:10:00.001+01:002011-02-03T12:36:23.485+01:00A very motivating discussionToday I took part in a very motivating discussion with Ed, the tech lead for a huge and working software, envisioning a change to unify many applications on a single platform starting from business use cases to real architecture.<br />
<br />
A bold, yet realistic plan.<br />
How many teams are brave enough to dream about such a transition?<br />
And how many companies over 100 are brave enough?<br />
Respect.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-61248135199127675182011-01-23T23:13:00.000+01:002011-01-23T23:13:03.787+01:00VMWare Player on Windows 7Off topic.<br />
I have tried to install VMWare Player 3 on my Windows 7 system.<br />
The installer produced a quite weird error: setup window pops up then... shazam.... shazam..... uh well. Nothing happens.<br />
An ugly grey and empty window grins on the unhappy user, as found in many complains all around google.<br />
<br />
Log says: "20110123224814:ERROR** CHtmlDialog::CallJScript: Failed to obtain required required jscript ID; COM Error: -2147352570".<br />
Many posts claim that booting safe mode will help.<br />
No, it wont :(<br />
<br />
The solution was quite simple, yet annoying - this is the reason for my post.<br />
<br />
I have booted up an old XP machine, started the installer there. Afterwards looked for the temp folder with a vmware_<some numbers> folder. The folder contains the "vmware player.msi" installer, that can be copied back to my Windows Seven system :-)<br />
<br />
Happy End.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-23202529293986984742011-01-21T01:26:00.000+01:002011-01-21T01:26:39.425+01:00ASP.NET,avoiding unnecessary async AJAX postbacksI have faced an issue trying to avoid unnecessary async postbacks.<br />
<br />
First of all, <a href="http://www.codeproject.com/Articles/140801/How-to-Improve-ASP-NET-UpdatePanel-Performance.aspx">improve</a> the website asp.net performance - e.g. avoid using updates by design (e.g. markup or default UpdateMode="always" behaviour),instead use UpdateMode="Conditional" and even consider ChildrenAsTriggers="false".<br />
<br />
In this manner one will be able to minimize the need for updating specific update panels and thus posting back dummy markup and causing flicker applying them.<br />
<br />
So far, so good, I am able to tell if e.g. updUpdatepanel1 is to be updated by my code and the very same for updUpdatepanel2. I could even check if an UpdatePanel is being updated or not with some little <a href="http://stackoverflow.com/questions/2899614/custom-webcontrol-using-jquery-that-needs-to-work-inside-an-updatepanel">tricks</a>.<br />
<br />
But I could not find any means to:<br />
<ul><li>check if no update is pending (on server side) and cancel the postback<br />
currently I am experimenting with Response.End.</li>
<li>cancel only one updatepanel at a later point and cause only a small part of the page to be partially rendered....</li>
</ul>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-10868456143732678132011-01-06T23:37:00.001+01:002011-01-06T23:39:07.462+01:00Thoughts about Scrum ("re-blog")I have found many interesting thoughts in this post about what is scrum about and what it is not about.<br />
Tips, tricks, hints and failures...<br />
<br />
Scrum will not save your project instantly. If started without careful preparation and knowledge there will be little success or fun...<br />
<br />
The original post in <a href="http://blog.vidabalazs.hu/post/84699087/gondolatok-scrum-kapcsan">Hungarian</a> and a very <a href="http://www.blogger.com/">rough translation</a>.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-79426097673409154072011-01-05T22:12:00.001+01:002011-01-05T22:13:07.604+01:00Under-promise & over-deliver versus (?) ScrumOne of my colleagues, happens to be in a fortunate situation to control English almost as a mother tounge. It is always a pleasure to get fresh new ideas from him.<br />
<br />
Lately he pops up again and again the under-deliver-over-promise saying.<br />
<br />
In Eastern Europe this is one thing most people do not seem to value enough.<br />
<br />
Though at some level there can be a <a href="http://ezinearticles.com/?We-Got-It-Wrong:-Never-Under-Promise-and-Over-Deliver&id=59584">trap</a> in this I think that applied carefully and right this can serve as a key element of scrum.<br />
Yeah, I know -- Scrum is about honesty, but currently I seem so many bad examples of over-promising and under-delivering that as a direction is seems to be very tempting.<br />
<br />
<a href="http://www.agileat5280.com/2010/09/scrum-challenge-keeping-new-team-honest.html">Keeping the team honest</a> should be the most essential part of any working methodology & project...Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-19612394709215978382011-01-04T16:53:00.000+01:002011-01-04T16:53:33.954+01:00Recommended eBook: Agile Development Made Easy!Some months ago I ran into some slides of Kelly Waters.<br />
I see he has a promising <a href="http://www.agile-software-development.com/2011/01/special-offer-get-my-ebook-for-just-10.html">eBook</a>, now on sale for ten bucks.<br />
<br />
I have checked his "<a href="http://www.agile-software-development.com/2007/02/principle-1-active-user-involvement-is.html">agile principles</a>" in the past and I have found his style quite enjoyable. He has a brief, well structured mindset, yet doesn't fall into the common mistake of writing some introduction in a agile-for-dummies minimalistic style. I really got useful ideas.<br />
<br />
(please note, I am just convinced: I do not get any percentage :-)Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-5222338963370832302010-12-30T00:24:00.003+01:002010-12-30T01:15:59.500+01:00Agile development versus Frequent delivery -- Continous DeliveryJez Humble has a quite <a href="http://www.infoq.com/presentations/Continuous-Delivery">cool presentation</a> on this topic @ InfoQ.<br />
In our agile development process developing software at high velocity with good quality is already there.<br />
However as Macaulay Culkin is the only one good in "home alone" style. Working with other teams as <i>testing</i> and <i>operation</i> can be tough and iterating again and again in release testing and launch doesn't work very well at my company and project.<br />
I am seeking for any means to revolutionize the release and launch process from a feature being code-complete to being available to customers.<br />
<blockquote>@8:38 - big bang releases are bad, small deltas are cool! Release in incremental fashion.<br />
Probably replacing subsystems while running could do the trick?<br />
@10:35 - this reflects also real project progress<br />
done is nothing else than done. anything less is not done!<br />
manifesto: satisfy the customer early and continuous delivery of valuable software<br />
this is a team metric!<br />
@13:00 - create a completely automated system to test if code is production ready<br />
==> code will be always production ready.<br />
no one is done until sw is done!<br />
everyone is on the topic to make the product production-ready<br />
@15:00 - project teams are created, then after sw is ready, project team is dismantled, operation team is created. huge barrier, huge waste.<br />
product team shall be created: developers, testers, operation people.<br />
cross functional teams are essential.<br />
@19:22 - deployment pipeline, automated acceptance tests, then user acceptance tests<br />
fast feedback!<br />
@23:10 - if it hurts, do it more often and bring the pain forward<br />
create a repeatable, reliable process for releasing<br />
automate (almost) everything!<br />
everyone is responsible for quality & testing: developers, operation <i>(project managers, business analysts, CEO)</i><br />
if something fails: everyone should focus on the problem<br />
done means released<br />
continuous improvement - do not make one big step now, it will not work!<br />
@26:10 - "how long would it take your organization to deploy a change that involved just a line of change?"<br />
(cycle time)<br />
@27:50 - build binaries once, include config data separately.<br />
bad clearcase model: build again-and-again.<br />
@31:00 - continuous integration = working on main line<br />
branching is bad, causes major bugs<br />
@36:00 - testers should not do any regression testing! it must be automated<br />
@37:00 - canary releasing, release to a small set of users. (A-B testing)<br />
small set of users are redirected to version+1<br />
use only high quality - do not use this for testing! <br />
<i><b>(my question: how to use data migration / data schema changes? we should separate A-B users completely beforehand? should not use same data tables for data ids? e.g. primary keys for result raw tables)</b></i></blockquote>As I understand recommended further readings are<br />
<ul><a href="http://www.amazon.com/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912?ie=UTF8&tag=codingi-20&link_code=bil&camp=213689&creative=392969" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank"><img alt="Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler))" src="http://ws.amazon.com/widgets/q?MarketPlace=US&ServiceVersion=20070822&ID=AsinImage&WS=1&Format=_SL160_&ASIN=0321601912&tag=codingi-20" /></a>
<li>Continuous delivery the book, <a href="http://www.amazon.com/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912?ie=UTF8&tag=codingi-20&link_code=btl&camp=213689&creative=392969" target="_blank">Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler))</a><img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=codingi-20&l=btl&camp=213689&creative=392969&o=1&a=0321601912" style="border: medium none ! important; float: right; margin: 0px ! important; padding: 0px ! important;" width="1" /><img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=codingi-20&l=bil&camp=213689&creative=392969&o=1&a=0321601912" style="border: medium none ! important; margin: 0px ! important; padding: 0px ! important;" width="1" /> <img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=codingi-20&l=bil&camp=213689&creative=392969&o=1&a=0321601912" style="border: medium none ! important; margin: 0px ! important; padding: 0px ! important;" width="1" /></li>
<li><a href="http://continuousdelivery.com/">Continuous delivery</a> the site</li>
<li><a href="http://en.wikipedia.org/wiki/Lean_software_development">Lean software development wiki</a>.</li>
</ul>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-7666973471989845242010-12-28T19:12:00.001+01:002010-12-28T19:16:40.249+01:00sizeof(T) where T : structI have been messing around with this nice face recognition API, and just got thinking on one code line in the samples retrieving the size of a struct.<br />
<br />
<pre class="cpp" name="code">thesize = sizeof(double) + 3*sizeof(int)</pre><br />
Why on earth would anyone do this? I've been coding in C# for 5-6yrs, however, I have never ever needed the sizeof operator. Have you ever?<br />
So I went the straightforward sizeof way. <br />
<br />
I got a nice error: <br />
<blockquote>struct does not have a predefined size, therefore sizeof can only be used in an unsafe context (consider using System.Runtime.InteropServices.Marshal.SizeOf) </blockquote><br />
I have found an excellent post on how to retrieve the size of a structure on <a href="http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=698">informit</a>.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-42857291238847810572010-12-20T00:37:00.001+01:002010-12-20T00:38:07.626+01:00A small ride to the new horizon of MVC3Started my first sample project with ASP.NET MVC3 beta.<br />
<br />
Cool concept, yet I am eager to find the non db presistency layer (such as SessionState in ASP.Net 3.5 and Backing Beans in JSF).<br />
<br />
Probably wrong concept from my side.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-21715612506052815612010-12-15T22:50:00.002+01:002010-12-19T13:49:07.670+01:00Why should we use agile & scrum?In these days I had to summarize why I was pushing my team & project to an agile/scrum life style.<br />
<br />
First I felt happiness.<br />
Talking about Scrum is great! However working & living in a development project accoring to scrum, is just slightly better.<br />
<br />
So: why all the scrum?<br />
<br />
Requirements change without notice.<br />
I tried small companies with outsourced projects, big companies with own or outsourced projects.<br />
All the same.<br />
Sometimes there is a little fuss or bureaucracy <b>after</b> the change, anyway the change will take place. They occur right now, and there is really no sense walking forward on the wrong path.<br />
Sounds familiar?<br />
<br />
If changes happen, one should play with it and instead of being nervous or sad about it, one should really take advantage of the creative and happy atmosphere scrum <b>can</b> provide.<br />
<br />
Please note: scrum, if misused can be even worse than a classic waterfall. And we do not want a new broom that is stinky and leaves bad odor around ;).<br />
<blockquote><i>Walking on water and developing software from a specification are easy if both are frozen.</i></blockquote>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-55991080256782423682010-12-14T11:41:00.003+01:002010-12-14T11:42:56.936+01:00IIS tricking me and the WCF service againOnce upon a time my team started implementing a thin client for an SaaS solution.<br />
<br />
It happened, that we needed webservices. Cool, just add some traditional asxm webservice, working fine.<br />
<br />
Afterwards the customer came and asked for some domain change.<br />
No problem, the installer added additional domains to the IIS bindings to the same protocol for backwards compatibility.<br />
<br />
We understood the need for a service API e.g. for performance or automated testing to access some business functionality through a carefully crafted Service API layer.<br />
However we have visioned service with WCF technology. Brighter, nicer, more trendy ;)<br />
<br />
Then came the suprise: <br />
<br />
<pre name="code" class="cpp">Server Error in '/Services/InternalApiService' Application.
This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item]
System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item) +11526110
System.Collections.Generic.SynchronizedCollection`1.Add(T item) +67
System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses) +49
System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +129
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +28
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +331
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +11666348
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479
[ServiceActivationException: The service '/Services/EnterpriseApiService/EnterpriseApiService.svc' cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item.]
System.ServiceModel.AsyncResult.End(IAsyncResult result) +11536522
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
</pre><br />
After some minutes of painful debugging and staring at the stack-trace we have discovered the root cause.<br />
One cannot add a WCF service to a site with multiple bindings to same protocol.<br />
It clearly seems to be a design problem with WCF, however as I am not an expert, wouldn't judge.<br />
<br />
e.g.: http://subdomain1.domain.com & http://subdomain2.domain.com<br />
<br />
Anyway, it is a painful constraint.<br />
<br />
Workaround is easy: create a dedicated web site....Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7393768172252373305.post-36617929313626457052010-12-13T22:54:00.003+01:002010-12-13T23:29:20.263+01:00Just a stupid coding blog with some agile spiceHi everyone.<br />
period.<br />
<br />
Day by day I meet or rather suffer from ... and after a mere hour or day ... laugh at smaller or bigger tech issues.<br />
It is always fun to share or write down some miserable details.<br />
<br />
I have always felt the urge to start a tech blog.<br />
<br />
This is it.<br />
full stop.<br />
<pre name="code" class="cpp">void main()
{
start();
}
</pre>Unknownnoreply@blogger.com0