I 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.
However there are some small and ridiculous issues:
- 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.
- 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.
Languages:
- C-based lets you build a common code folder to include or even a library
- Java based projects will give you a hard imeas package identifiers will contain app specific parts. Consider library based approach.
miserable facts, coding help and agile spice for C#, ASP.NET, IIS, BlackBerry, Android, WiMo etc...
Cocoa with love
Cocoa & 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.
As I just exploring this whole new galaxy, it shall not be a shame to present some of these "stone samples" just found...
... more on Cocoa key paths here.
...more on predicates here.
As I just exploring this whole new galaxy, it shall not be a shame to present some of these "stone samples" just found...
[customers valueForKeyPath:@"@avg.emailAddress.length"];
... more on Cocoa key paths here.
NSPredicate *bPredicate =
[NSPredicate predicateWithFormat:@"SELF beginswith[c] 'b'"];
NSArray *beginWithB =
[array filteredArrayUsingPredicate:bPredicate];
...more on predicates here.
Folk dancing bubble sort
I am always fond of any visualization of algorithms and making (not so) complex things easy to understand for everyone.
NSInvocation in Objective C via delegate
I had some hard time finding the solution for a smooth usage of NSInvocation.
Furthermore I was to call a method within a delegate.
All's well that ends well and I am happy now.
Here is my code snippet.
My very last error was that I forgot to call the setSelector method :)
Furthermore I was to call a method within a delegate.
All's well that ends well and I am happy now.
Here is my code snippet.
My very last error was that I forgot to call the setSelector method :)
if (self.delegate)
{
SEL sel = @selector(fetchComplete:withParam1:withParam3:);
if (self.delegate!=nil && [self.delegate respondsToSelector:sel])
{
NSMethodSignature *sig = [[self.delegate class] instanceMethodSignatureForSelector:sel];
NSInvocation *inv = [NSInvocation invocationWithMethodSignature:sig];
[inv setSelector:sel];
[inv setTarget:self.delegate];
[inv setArgument:&Param1 atIndex:2];
[inv setArgument:&Param2 atIndex:3];
[inv setArgument:&Param3 atIndex:4];
[inv invoke];
// [self.delegate performSelector:@selector(fetchComplete:withParam1:withParam2:)
// withObject:elementtype
// withObject:Param2
// withObject:Param3
// ];
}
}
Facebook development made easy
Recently a colleague of mine talked about some quite cool facebook app, he developed.
About the motivation: I am always quite enthusiastic about any web application, especially when integrated.
It was quite astonishing to see that facebook has a very easy to use integration library.
Should you need some hint or sample code, just visit this blog post from Steve.
About the motivation: I am always quite enthusiastic about any web application, especially when integrated.
It was quite astonishing to see that facebook has a very easy to use integration library.
- download the Facebook Development Toolkit from Microsoft
- install it
- add the necessary tabs to the toolbox (default path for the dlls are C:\Program Files\Coding4Fun\Facebook\Binaries\)
- Create an IIS website for the application
- (my default site was tergeted for v2.0 .NET framework, and yielded errors. Thus I needed to change to v4.0 framework)
- you might host your app in your own server, however for simplicity why not register your application at localhost? :)
- off you go...

Should you need some hint or sample code, just visit this blog post from Steve.
You Win, RIM (link)
A colleague of mine has drawn mine attention to this nice and funny blog post about a superhero developer just tring to develop on BlackBerry RIM platform.
As I have experienced the very same attitude I can just congratulate the guy for his willing.
As I have experienced the very same attitude I can just congratulate the guy for his willing.
Sociometry, Social Network Analisys
A couple years ago I have created a simple tool to visualize a sociometry.
A sociometry is a simple quantitative method to visualize social relations.
Given a class the teacher asks some questions about likes and dislikes within the predefined group of persons (class).
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.
Here is a visualization of a sample dataset (without names).
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 -).
I am keen to rewrite the whole tool in C# in the near future.
My current formulas for the sliders are:
A sociometry is a simple quantitative method to visualize social relations.
Given a class the teacher asks some questions about likes and dislikes within the predefined group of persons (class).
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.
Here is a visualization of a sample dataset (without names).
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 -).
I am keen to rewrite the whole tool in C# in the near future.
My current formulas for the sliders are:
- repel: sqrt(exp(1/dist)*trProximity.Position)*cos(angleA)
- attrack: sgn(ddist)*sqrt(exp(abs(ddist)/trConnection2.Position)*trConnection.Position)*cos(angleA)
- mutual connections can receive bonus attraction
Performance counters runnning wild -- Perfmon, Data Collection Sets
In our project we were lucky enough to reach the point for performance profiling and optimization.
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.
I just happened to meet the adequate solution on windows.
One can define Data Collection Sets and afterwards getting data out via reports with the perfmon tool.
A sample for ReadyBoost technology profiling can be found here.
Do you happen to know the demotivational poster about premature optimization & the devil? And Mr Knuth of course.)
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.
I just happened to meet the adequate solution on windows.
One can define Data Collection Sets and afterwards getting data out via reports with the perfmon tool.
A sample for ReadyBoost technology profiling can be found here.
Do you happen to know the demotivational poster about premature optimization & the devil? And Mr Knuth of course.)
Long long time ago, there was a .NET/CLR
Recently I had a quite interesting opportunity to talk about .Net fundamentals.
Though using C# for various reasons and framework I am aware that I lack the real bits and bolts of the language & the framework.
An interesting (and quite basic topic) - FYI.
What will b1 and b2 be (and why)?
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 here.
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.
Though using C# for various reasons and framework I am aware that I lack the real bits and bolts of the language & the framework.
An interesting (and quite basic topic) - FYI.
What will b1 and b2 be (and why)?
object s1 = "apple"; object s2 = "apple"; bool b1 = s1 == s2; object i1 = 1; object i2 = 1; bool b2 = i1 == i2;
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 here.
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.
Taking screenshots on an Android phone
The team has just finished our brand new Android client application.
I was naive enough to make an attempt to capture some screenshots on the device.
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.
I do not like this approach (and also it wouldn't work on my PC due to some missing Samsung drivers).
A smartphone should be self-contained: installing apps, taking screenshots, everything.
After some googling I managed to find this nice utility: screenshot.apk.
Try it, it seems to perform well.
I was naive enough to make an attempt to capture some screenshots on the device.
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.
I do not like this approach (and also it wouldn't work on my PC due to some missing Samsung drivers).
A smartphone should be self-contained: installing apps, taking screenshots, everything.
After some googling I managed to find this nice utility: screenshot.apk.
Try it, it seems to perform well.
A very motivating discussion
Today 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.
A bold, yet realistic plan.
How many teams are brave enough to dream about such a transition?
And how many companies over 100 are brave enough?
Respect.
A bold, yet realistic plan.
How many teams are brave enough to dream about such a transition?
And how many companies over 100 are brave enough?
Respect.
VMWare Player on Windows 7
Off topic.
I have tried to install VMWare Player 3 on my Windows 7 system.
The installer produced a quite weird error: setup window pops up then... shazam.... shazam..... uh well. Nothing happens.
An ugly grey and empty window grins on the unhappy user, as found in many complains all around google.
Log says: "20110123224814:ERROR** CHtmlDialog::CallJScript: Failed to obtain required required jscript ID; COM Error: -2147352570".
Many posts claim that booting safe mode will help.
No, it wont :(
The solution was quite simple, yet annoying - this is the reason for my post.
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 :-)
Happy End.
I have tried to install VMWare Player 3 on my Windows 7 system.
The installer produced a quite weird error: setup window pops up then... shazam.... shazam..... uh well. Nothing happens.
An ugly grey and empty window grins on the unhappy user, as found in many complains all around google.
Log says: "20110123224814:ERROR** CHtmlDialog::CallJScript: Failed to obtain required required jscript ID; COM Error: -2147352570".
Many posts claim that booting safe mode will help.
No, it wont :(
The solution was quite simple, yet annoying - this is the reason for my post.
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 :-)
Happy End.
ASP.NET,avoiding unnecessary async AJAX postbacks
I have faced an issue trying to avoid unnecessary async postbacks.
First of all, improve 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".
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.
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 tricks.
But I could not find any means to:
First of all, improve 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".
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.
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 tricks.
But I could not find any means to:
- check if no update is pending (on server side) and cancel the postback
currently I am experimenting with Response.End. - cancel only one updatepanel at a later point and cause only a small part of the page to be partially rendered....
Thoughts about Scrum ("re-blog")
I have found many interesting thoughts in this post about what is scrum about and what it is not about.
Tips, tricks, hints and failures...
Scrum will not save your project instantly. If started without careful preparation and knowledge there will be little success or fun...
The original post in Hungarian and a very rough translation.
Tips, tricks, hints and failures...
Scrum will not save your project instantly. If started without careful preparation and knowledge there will be little success or fun...
The original post in Hungarian and a very rough translation.
Under-promise & over-deliver versus (?) Scrum
One 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.
Lately he pops up again and again the under-deliver-over-promise saying.
In Eastern Europe this is one thing most people do not seem to value enough.
Though at some level there can be a trap in this I think that applied carefully and right this can serve as a key element of scrum.
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.
Keeping the team honest should be the most essential part of any working methodology & project...
Lately he pops up again and again the under-deliver-over-promise saying.
In Eastern Europe this is one thing most people do not seem to value enough.
Though at some level there can be a trap in this I think that applied carefully and right this can serve as a key element of scrum.
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.
Keeping the team honest should be the most essential part of any working methodology & project...
Recommended eBook: Agile Development Made Easy!
Some months ago I ran into some slides of Kelly Waters.
I see he has a promising eBook, now on sale for ten bucks.
I have checked his "agile principles" 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.
(please note, I am just convinced: I do not get any percentage :-)
I see he has a promising eBook, now on sale for ten bucks.
I have checked his "agile principles" 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.
(please note, I am just convinced: I do not get any percentage :-)
Agile development versus Frequent delivery -- Continous Delivery
Jez Humble has a quite cool presentation on this topic @ InfoQ.
In our agile development process developing software at high velocity with good quality is already there.
However as Macaulay Culkin is the only one good in "home alone" style. Working with other teams as testing and operation can be tough and iterating again and again in release testing and launch doesn't work very well at my company and project.
I am seeking for any means to revolutionize the release and launch process from a feature being code-complete to being available to customers.
In our agile development process developing software at high velocity with good quality is already there.
However as Macaulay Culkin is the only one good in "home alone" style. Working with other teams as testing and operation can be tough and iterating again and again in release testing and launch doesn't work very well at my company and project.
I am seeking for any means to revolutionize the release and launch process from a feature being code-complete to being available to customers.
@8:38 - big bang releases are bad, small deltas are cool! Release in incremental fashion.As I understand recommended further readings are
Probably replacing subsystems while running could do the trick?
@10:35 - this reflects also real project progress
done is nothing else than done. anything less is not done!
manifesto: satisfy the customer early and continuous delivery of valuable software
this is a team metric!
@13:00 - create a completely automated system to test if code is production ready
==> code will be always production ready.
no one is done until sw is done!
everyone is on the topic to make the product production-ready
@15:00 - project teams are created, then after sw is ready, project team is dismantled, operation team is created. huge barrier, huge waste.
product team shall be created: developers, testers, operation people.
cross functional teams are essential.
@19:22 - deployment pipeline, automated acceptance tests, then user acceptance tests
fast feedback!
@23:10 - if it hurts, do it more often and bring the pain forward
create a repeatable, reliable process for releasing
automate (almost) everything!
everyone is responsible for quality & testing: developers, operation (project managers, business analysts, CEO)
if something fails: everyone should focus on the problem
done means released
continuous improvement - do not make one big step now, it will not work!
@26:10 - "how long would it take your organization to deploy a change that involved just a line of change?"
(cycle time)
@27:50 - build binaries once, include config data separately.
bad clearcase model: build again-and-again.
@31:00 - continuous integration = working on main line
branching is bad, causes major bugs
@36:00 - testers should not do any regression testing! it must be automated
@37:00 - canary releasing, release to a small set of users. (A-B testing)
small set of users are redirected to version+1
use only high quality - do not use this for testing!
(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)
sizeof(T) where T : struct
I 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.
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?
So I went the straightforward sizeof way.
I got a nice error:
I have found an excellent post on how to retrieve the size of a structure on informit.
thesize = sizeof(double) + 3*sizeof(int)
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?
So I went the straightforward sizeof way.
I got a nice error:
struct does not have a predefined size, therefore sizeof can only be used in an unsafe context (consider using System.Runtime.InteropServices.Marshal.SizeOf)
I have found an excellent post on how to retrieve the size of a structure on informit.
A small ride to the new horizon of MVC3
Started my first sample project with ASP.NET MVC3 beta.
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).
Probably wrong concept from my side.
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).
Probably wrong concept from my side.
Why 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.
First I felt happiness.
Talking about Scrum is great! However working & living in a development project accoring to scrum, is just slightly better.
So: why all the scrum?
Requirements change without notice.
I tried small companies with outsourced projects, big companies with own or outsourced projects.
All the same.
Sometimes there is a little fuss or bureaucracy after the change, anyway the change will take place. They occur right now, and there is really no sense walking forward on the wrong path.
Sounds familiar?
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 can provide.
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 ;).
First I felt happiness.
Talking about Scrum is great! However working & living in a development project accoring to scrum, is just slightly better.
So: why all the scrum?
Requirements change without notice.
I tried small companies with outsourced projects, big companies with own or outsourced projects.
All the same.
Sometimes there is a little fuss or bureaucracy after the change, anyway the change will take place. They occur right now, and there is really no sense walking forward on the wrong path.
Sounds familiar?
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 can provide.
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 ;).
Walking on water and developing software from a specification are easy if both are frozen.
Subscribe to:
Posts (Atom)


