|
|
Where I post whatever is crossing my mind...
|
|
Every day I love http://yuml.me more and more. Btw: I think I’ve stabilised on the following color schema:  [<<Interface>>{bg:darkseagreen}]^=realises[AbstractBaseClass|-PrivateAttr;+PublicAttr;=InternalAttr|-PrivateMethod;+PublicMethod;=InternalMethod{bg:steelblue}] [<<Interface>>]<=[note:Something with a comma&44;] [AbstractBaseClass]generalises^[ConcreteClass] [ConcreteClass]->[Order] [Order]++->aggregation[LineItem] [Assembly]->[XActLib assembly {bg:green}] [Assembly]uses=>used[3rdParty assembly dependency {bg:red}] But Can’t figure out how to do # !!!! Although: <: works, (so does < ) "
'
&
|
|
|
|
|
“Open source OpenInviterTM (Open InviterTM) is a free import contacts (addressbook) script from email providers like Mail2World, Grafitti, Web.de, Aussiemail, Mail.in, Uk2, Clevergo, Canoe, LinkedIn, Inbox.com, FastMail, Pochta, India, GMail, Bigstring, Yahoo!, Evite, YouTube, Mail.ru, MSN, O2, OperaMail, Hushmail, AOL, IndiaTimes, Freemail, 5Fm, Live/Hotmail, Meta, Care2, Azet, Mail.com, Bordermail, Zapakmail, Lycos, Walla, Nz11, Popstarmail, Atlas, Inet, GMX.net, Doramail, KataMail, Libero, Techemail, Netaddress, Abv, Mynet.com, Yandex, Wp.pt, Rambler, Virgilio, Gawab, Terra, Sapo.pt, Kids, Apropo, Rediff, Interia or social portals like Bookcrossing, Xuqa, Kincafe, NetLog, Livejournal, Lovento, Orkut, Brazencareerist, Skyrock, Konnects, Plazes, Xing, Bebo, Perfspot, Faces, Xanga, Multiply, Flickr, Plurk, Friendfeed, Vimeo, Mydogspace, Famiva, Fdcareer, Hi5, Flixster, Plaxo, Vkontakte, Meinvz, Friendster, Tagged, Hyves, Ning, Mycatspace, MySpace, Koolro, Mevio, Last.fm, Motortopia, Facebook, Flingr, Eons, Cyworld, Badoo, Twitter. This contacts importer script is integrating with content management systems (aka CMS) like Drupal, phpizabi, Social Engine, Dating Pro, SimpleMachines Forum (SMF), PunBB, jamit job, PHPMELODY, Boonex Dolphin, myBB, nowFire, JamRoom, symfony, RoundCube, Vwebmail, PhpBB, joovili, Wordpress, vBulletin, Atmail5, Buddy Zone, phpFoX, Joomla, Joomla1.0. Open Inviter is written in PHP 5 (no database required but cURL or wget required) and running on any webserver (tested on Apache) offering advanced tell a friend features. OpenInviterTM is a free self hosted solution that does not use a third party gateway (or API) to import contacts.” http://openinviter.com/ Now…if only I had a PHP to C# converter…
|
|
|
|
|
Monolithic untestable code is much like Parachute Jackets. Designed in 1912 by German inventor Franz Reichelt, the parachute jacket had a high-profile unveiling when Reichelt wore one for a jump from the Eiffel Tower. It didn't deploy. Reichelt died.
Seriously. SOLID/IoC. Look it up.
|
It’s that time of the year again… where if you are unlucky enough to be hosting your website on DNN you have to clear the bastards out…
Read More »
|
In the Guardian no less! The high brow summary of Craig Venter: "It's very easy to mock Venter," Jones suggests. "When he first appeared, people just kind of sneered at him. But they stopped sneering when they saw his brilliance in realising that the genome was not a problem of chemistry but a problem of computer power. I don't think anybody can deny that that was a monumental achievement and he has been doing fantastically interesting things subsequently with marine life. Having said that, though, the man is clearly a bit of a prick and one with a serial addiction to publicity." http://www.guardian.co.uk/theobserver/2010/may/23/observer-profile-craig-venter
|
At dinner the other night I was asked quite a lot of questions on how I was laying out a project I am working on… went over to yuml and put this together as a response… Produced on http://yuml.me via the following textual description: [XAct.App.UI.Web.MVC]->[XAct.App.Common] [XAct.App.UI.Web.MVC]->[note: before starting find out why a) God classes suck b) SOLID patterns save time and c) both 'new' and 'static' are to be avoided at all cost {bg:yellow}] [XAct.App.UI.Web.MVC]->[XAct.Web.Mvc] [XAct.Web.Mvc{bg:green}]-[note:code lib for working with Mvc {bg:yellow}] [XAct.App.UI.Web.MVC]->[XAct.App.Common.IoC.Ninject] [XAct.App.UI.Web.MVC]->[Microsoft.IdentityModel] [Microsoft.IdentityModel{bg:red}]-[note:WIF is the new claims based Authentification Framework{bg:yellow}] [XAct.App.Common.IoC.Ninject]-[note: Contains NinjectModules for Repositories and Services that are instantiated by MVCs global.asax{bg:yellow}] [XAct.App.Common.IoC.Ninject]->[Ninject] [Ninject{bg:red}]-[note:Don't let refs to the IoC framework leak into your app...{bg:yellow}] [XAct.App.UI.Web.MVC]->[XAct.App.UI.Assets] [XAct.App.UI.Assets]->[note: UI Strings and Images that can be updated often are not kept in XAct.App.Common{bg:yellow}] [XAct.App.UI.Web.MVC]->[XAct.App.UI.MVC.ViewModels] [XAct.App.UI.MVC.ViewModels]->[XAct.Web.Mvc] [XAct.App.UI.MVC.ViewModels]->[XAct.App.Common] [XAct.App.Biz.Services]->[XAct.App.Common] [XAct.App.Biz.Services]->[note: Services wrap 1+ Repositories but only via injected interfaces (no direct binding) {bg:yellow}] [XAct.App.Biz.Services]->[XAct.Data] [XAct.App.Biz.Services]->[XAct.Core] [XAct.App.Biz.Services]->[Microsoft.IdentityModel] [XAct.App.Common]->[XAct.Data] [XAct.App.Common]-[note:Contains common Enums as well as interfaces for Services Repositories Identity and Value Objects{bg:yellow}] [XAct.App.Common.IoC.Ninject]->[XAct.Data] [XAct.App.Common.IoC.Ninject]->[XAct.Data.Entity] [XAct.Data.Entity]->[note:code lib for working with EF4{bg:yellow}] [XAct.App.Common.IoC.Ninject]->[XAct.App.Biz.Services] [XAct.App.Common.IoC.Ninject]->[XAct.App.Common] [XAct.App.Common.IoC.Ninject]->[XAct.App.Data.Model.Entity] [XAct.App.Common.IoC.Ninject]->[XAct.App.Data.Repositories] [XAct.App.Data.Repositories]-[note: Repositories are not bound to any ORM specific assemblies and return only Interfaces -- not even POCO -- so as to stop upper layers from having a dependency on anything specific to ORM chosen{bg:yellow}] [XAct.App.Data.Repositories]->[XAct.Data] [XAct.App.Data.Repositories]->[XAct.Data.Entity] [XAct.Data.Entity{bg:green}]->[System.Data.Entity] [XAct.Data.Entity]->[XAct.Data] [XAct.App.Data.Repositories]->[XAct.App.Common] [XAct.App.Data.Repositories]->[XAct.App.Data.Model.Entity] [XAct.App.Data.Model.Entity]->[System.Data.Entity] [System.Data.Entity{bg:red}]-[note: Keep refs to which ever ORM used limited to the Model and no higher (T4 allows injection of entity Interfaces required){bg:pink}] [XAct.App.Data.Model.Entity]->[XAct.App.Common] [XAct.App.Data.Model.Entity]->[XAct.Data] [XAct.App.Data.Model.Entity]->[note: Contains POCOs -- generated by EF4 -- that implement interfaces defined in XAct.App.Common{bg:yellow}] [XAct.Data{bg:green}]-[note: code lib for working with DBs and Repositories{bg:yellow}] [XAct.Core{bg:green}]-[note: code lib for such as Arg Validation etc -- used pretty much everywhere{bg:yellow}] [EDIT: XAct.App.Repository now has no dependency on System.Data.Entity or XAct.App.Model.Entity – it’s completely portable] PPS: (note that the image is dynamically updated as a service – so might change over time… PPPS: Or maybe not…I think I’ve just hit the 2048byte limit for GETs…oh well…twas fun while it lasted…I was going to keep on, mapping the interactions with a remote client…
|
Everybody who tries PowerShell has a conniption fit with the escape character and the comparison methods… Here’s the official answer (by Bruce Payette): Let’s talk about the most contentious design decision in the PowerShell language. And the winner is: why the heck did we not use the conventional symbols for comparison like “>”, “>=”, “<”, “<=”, “==”, and “!=” ? My, this was a touchy issue. The answer is that the “>” and “<” characters are used for output redirection. Since PowerShell is a shell and all shell languages in the last 30 years have used “>” and “<” for I/O redirection, people expected that PowerShell should do the same. During the first public beta of PowerShell, this topic generated discussions that went on for months. We looked at a variety of alternatives, such as modal parsing where sometimes “>” meant greater-than and sometimes it meant redirection. We looked at alternative character sequences for the operators like “:>” or “->”, either for redirection or comparison. We did usability tests and held focus groups, and in the end, settled on what we had started with. The redirection operators are “>” and “<”, and the comparison operators are taken from the UNIX test(1) command. We expect that, since these operators have a 30-year pedigree, they are adequate and appropriate to use in PowerShell. (We also expect that people will continue to complain about this decision, though hopefully not for 30 more years.) As I only know only one (1) user who uses Powershell, even though it fits a true need, I’ll propose that it was…the wrong design choice. At the very least, offer a ‘mode’ switch, maybe like @USETRADITIONALSYMBOLS=true. Grr.
|
"Monopoly is a control or advantage obtained by one entity over the commercial market in a specific area. Monopolization is an offense under federal anti trust law. The two elements of monopolization are (1) the power to fix prices and exclude competitors within the relevant market. (2) the willful acquisition or maintenance of that power as distinguished from growth or development as a consequence of a superior product, business acumen or historical accident. A market condition in which there is only one seller and one buyer is called a bilateral monopoly. A situation where one buyer controls the market is called monopsony." U.S. Legal Definitions http://arstechnica.com/apple/news/2010/01/apple-responsible-for-994-of-mobile-app-sales-in-2009.ars
|
|
|
The story goes that Michael Faraday, the 19th century physicist who discovered the principles behind the electric generator and the electric motor, was asked by Gladstone, then Chancellor of the Exchequer, about the practical value of his discoveries. To which Faraday is said to have replied, "one day, sir, you may tax it".
|
|
|
“War is an ugly thing, but not the ugliest of things. The decayed and degraded state of moral and patriotic feeling which thinks that nothing is worth war is much worse. The person who has nothing for which he is willing to fight, nothing which is more important than his own personal safety, is a miserable creature and has no chance of being free unless made and kept so by the exertions of better men than himself. “ John Stuart Mill (1806 – 1873)
|
An example of creating Providers with Ninject: public class WebIdentityProvider : SimpleProvider<IIdentity>
{
protected override IIdentity CreateInstance(IContext context)
{
return HttpContext.Current.User.Identity;
}
public override bool IsCompatibleWith(IContext context)
{
return HttpContext.Current != null;
}
}
Src: http://mhinze.com/httpcontext-ninject-providers/
|
|
|
I’m just posting this to remind myself to make the service proxies by hand: 'http://schemas.datacontract.org/2004/07/Microsoft.Synchronization:SyncIdFormatGroup' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'SyncIdFormatGroup' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details. {"Error in line 1 position 526. Element ':formats' contains data of the 'http://schemas.datacontract.org/2004/07/Microsoft.Synchronization:SyncIdFormatGroup' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'SyncIdFormatGroup' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer."}
|
|
|
|
|
|
|
Just a friendly reminder: When you create a Stored Proc that contains passed arguments that are, eg, of Type INT: CREATE Procedure [dbo].[GetNewUsersForEmailing]
@NowUTC datetime,
@PageNumber int,
@PageSize int = 100,
@TotalCount int = 0 Output
it’s common to check the args and make sure they fall in a certain range:
If @NowUTC IS Null Set @NowUTC = GETUTCDATE()
If @PageNumber <= 0 Set @PageNumber = 1
If @PageSize <=0 Set @PageSize = 100
Unfortunately, the above arg validation has errors.
What’s wrong is that the validation code for the PageNumber is assuming that the argument is an INT.
It isn’t. A non-passed arg – even if of type INT – is a value of NULL, so the full check is really:
If (@PageNumber IS NULL) OR (@PageNumber <= 0) Set @PageNumber = 1
Since those kinds of details usually are hard to spot in the rush of things, I simply suggest that one gets in the habit of checking for NULLs everytime and be done with it:
If @NowUTC IS Null Set @NowUTC = GETUTCDATE()
If (@PageNumber IS NULL) OR (@PageNumber <= 0) Set @PageNumber = 1
If (@PageSize IS NULL) OR (@PageSize <=0) Set @PageSize = 100
|
I've always thought that the most interesting task for a school maths teacher is working out how a particular pupil gets it wrong. Most cognitive errors are systematic rather than random - so if Johnny cannot do long division, there must be a specific step in the process that he is getting wrong, or a specific axiom or principle that he hasn't properly understood. This would be subject to mathematical analysis http://www.users.globalnet.co.uk/~rxv/sqm/pitfalls.htm
|
|
|