Monday, March 30, 2009
Om vikten att bygga muskler
Speciellt när det går bra gäller det att investera en del av sin tid för att vässa sig ytterligare mentalt och fysiskt. När man har momentum ska man agera och skapa grunden för nästa och ännu högre framgångsvåg.
Postivit tänkande
Är väldigt förtjust i positivt tänkande. Läste i Time att endast 25% av hur positiv man är, är medfött. Resten kan tränas upp. Dock är det hårt arbete och man måste ständigt göra det.
När man känner sig nedåt gäller det att snabbt skapa ett momentum genom att aktivera sig, peppa sig och sätta upp mål på livets alla olika områden.
Som född i Sverige tror jag faktiskt man kan få nästan precis vad man vill i livet. Det handlar bara om att vilja tillräckligt mycket och ofta.
När man känner sig nedåt gäller det att snabbt skapa ett momentum genom att aktivera sig, peppa sig och sätta upp mål på livets alla olika områden.
Som född i Sverige tror jag faktiskt man kan få nästan precis vad man vill i livet. Det handlar bara om att vilja tillräckligt mycket och ofta.
Extrainkomster
Jag har kommit på två ytterligare sätt att accelerera mitt sparande.
Den första består i att hyra ut stugan de veckor vi inte använder den. Detta borde enligt beräkning kunna ge ca 12 000 om året.
En annan idé är att ha företagspengarna (så mycket som möjligt av dem) på SveaDirekt där de ger ränta. Detta borde kunna ge ca 8 000 om året.
Totalt alltså ytterligare inkomster på 14 000 netto. Inte fel alls :)
Den första består i att hyra ut stugan de veckor vi inte använder den. Detta borde enligt beräkning kunna ge ca 12 000 om året.
En annan idé är att ha företagspengarna (så mycket som möjligt av dem) på SveaDirekt där de ger ränta. Detta borde kunna ge ca 8 000 om året.
Totalt alltså ytterligare inkomster på 14 000 netto. Inte fel alls :)
Sunday, March 15, 2009
Lite söndags-TA
Aktier med fin stigande trend och högre bottnar
Atlas Copco
Volvo
Connecta
SSAB
NCC
Dock bör de troligen komma ned lite innan köpläge uppstår.
Gällande Sandvik skulle jag vara lite försiktig i nuläget. För Boliden är det troliga scenariot att det är något överköpt i dagsläget och bör komma ned en del inför fortsatt uppgång. Stöd finns på 31 SEK.
Högriskare med potential för stora rekyler uppåt:
MTG
ENiro
Andra som jag väntar mig att de kommer att vända upp så småningom då stöd bör vara nådda:
AstraZeneca
Holmen
Atlas Copco
Volvo
Connecta
SSAB
NCC
Dock bör de troligen komma ned lite innan köpläge uppstår.
Gällande Sandvik skulle jag vara lite försiktig i nuläget. För Boliden är det troliga scenariot att det är något överköpt i dagsläget och bör komma ned en del inför fortsatt uppgång. Stöd finns på 31 SEK.
Högriskare med potential för stora rekyler uppåt:
MTG
ENiro
Andra som jag väntar mig att de kommer att vända upp så småningom då stöd bör vara nådda:
AstraZeneca
Holmen
Friday, January 16, 2009
Enterprise Value
Föredra Enterprise Value framför P/E-tal då denna drar in skuldsättning som framförallt kan dra ned aktierna vid lågkonjunktur.
Friday, December 26, 2008
Holiday reading update
I just had a look at the .NET Stock Trader sample application. Wow, it included some great features such as virtualization of service endpoints, a configuration management system etc. This stuff should considered when I develop my next distributed system.
On another note I have really started digging IoC containers like Castle Windsor. And LINQ to XML. The Entity Framework I am not too excited about and what I've heard about Oslo sounds like something from the MDA era and the reason why it failed.
For ORM-mapping I think my options today are (depending on project and complexity...):
NHibernate
.netTiers
d00dads
Rhino Mocks looks like a great tool too I think I will use it soon.
On another note I have really started digging IoC containers like Castle Windsor. And LINQ to XML. The Entity Framework I am not too excited about and what I've heard about Oslo sounds like something from the MDA era and the reason why it failed.
For ORM-mapping I think my options today are (depending on project and complexity...):
NHibernate
.netTiers
d00dads
Rhino Mocks looks like a great tool too I think I will use it soon.
Monday, December 15, 2008
Friday, December 12, 2008
Some nice technologies
i have come across lately
Balsamiq mockups. Awesome tool to create GUI mockups.
T4 code generator. Built into Visual Studio as of VS 2008
Naked objects. Generate GUI from database.
Balsamiq mockups. Awesome tool to create GUI mockups.
T4 code generator. Built into Visual Studio as of VS 2008
Naked objects. Generate GUI from database.
Tuesday, December 09, 2008
Null coalescing operator in C# 2.0 for ASP.NET ViewState property access
instead of
public bool Enabled
{
get
{
if(ViewState["Enabled"] == null)
return false;
return (bool)ViewState["Enabled"];
}
}
we can now write:
public bool Enabled
{
get
{
return (bool)(ViewState["Enabled"] ?? false);
}
}
Cool! But if we are dealing with a complex type i prefer defensive casting, using something like:
public ComplexObject Complex
{
get
{
return ViewState["Complex"] as ComplexObject;
}
}
public bool Enabled
{
get
{
if(ViewState["Enabled"] == null)
return false;
return (bool)ViewState["Enabled"];
}
}
we can now write:
public bool Enabled
{
get
{
return (bool)(ViewState["Enabled"] ?? false);
}
}
Cool! But if we are dealing with a complex type i prefer defensive casting, using something like:
public ComplexObject Complex
{
get
{
return ViewState["Complex"] as ComplexObject;
}
}
Stepping it up with power tools
I bought a book called Windows Developer Power Tools and started looking for tools
to apply in a specific project. For this project I came up with the following:
Enterprise Library Block. To apply best practises within loggin etc.
NUnit 2.4.8. To have an automated test suite for some basic behavious such as object CRUD.
MyGeneration and custom templates. For generating manager classes among other things. ORM-code can be generated with dOOdads templates.
Caste Windsor Container. To promote reusability and get rockin things such as swappable business rules using Inversion of Control.
NDoc. To create professionally looking documetation.
CoolCommands. To improve developer productivity in VS.
VSFileFinder. To find files fast inside VS.
FxCop. To write code that uses best practises.
SourceMonitor. To manage code complexity.
NDepend. Find dependencies in your application that can be improved.
NTime. To verify that performance is acceptable for critical parts of the application.
NProf. To find out in which method time is spent.
Reclector.NET. To look into assemblies when documentation sucks.
Dotfuscator. To prevent reverse engineering of code.
Fiddler. To examinate HTTP traffic.
WSCF. To create contract based web services. Don't deal with the stuff VS produces out of the box.
Subversion. Source control.
AnhkSvn. Subversion in VS.
TortoiseSvn. Subversion in explorer.
Other tool not mentioned that I use:
YSlow. To find out how websites can be optimized.
XP IIS admin. To create multiple IIS websites in XP.
SelfSSL. To generate certs on localhost.
Now if I could just get my hands on a suitable AOP framework...
to apply in a specific project. For this project I came up with the following:
Enterprise Library Block. To apply best practises within loggin etc.
NUnit 2.4.8. To have an automated test suite for some basic behavious such as object CRUD.
MyGeneration and custom templates. For generating manager classes among other things. ORM-code can be generated with dOOdads templates.
Caste Windsor Container. To promote reusability and get rockin things such as swappable business rules using Inversion of Control.
NDoc. To create professionally looking documetation.
CoolCommands. To improve developer productivity in VS.
VSFileFinder. To find files fast inside VS.
FxCop. To write code that uses best practises.
SourceMonitor. To manage code complexity.
NDepend. Find dependencies in your application that can be improved.
NTime. To verify that performance is acceptable for critical parts of the application.
NProf. To find out in which method time is spent.
Reclector.NET. To look into assemblies when documentation sucks.
Dotfuscator. To prevent reverse engineering of code.
Fiddler. To examinate HTTP traffic.
WSCF. To create contract based web services. Don't deal with the stuff VS produces out of the box.
Subversion. Source control.
AnhkSvn. Subversion in VS.
TortoiseSvn. Subversion in explorer.
Other tool not mentioned that I use:
YSlow. To find out how websites can be optimized.
XP IIS admin. To create multiple IIS websites in XP.
SelfSSL. To generate certs on localhost.
Now if I could just get my hands on a suitable AOP framework...
Saturday, December 06, 2008
Improving ASP.NET code
I have an ASP.NET application that suffers from some problems.
We have a page that dynamically loads a lot of different components, and these components needs to access per-request properties of the application, such as user id, product name etc. Today this can be done something like:
string stateValueToGet = string.Empty;
// Coding horror..
// Component a is where stateValueToGet is parsed.
ComponentA compA = this.Parent.Parent as ComponetA;
if(compA != null)
{
stateValueToGet = compA.GetStateValue();
}
// do something with stateValueToGet ...
To begin with this is not good design to have components be dependent on each other like that. If the component should have a dependency it should probably only be to the page.
But alternative way to store these kind of per request values that need to be accessed in many different places during a page request is to use the HttpContext.Items property that allows you to store data as name-value pairs. However we should not access values directly from the Items collection but instead use proper C# helper classes or properties in the page class for that in order to hide validation, formatting etc.
One drawback with this solution is that dependencies among components will not be as clear but we should strive to minimize those anyway.
How to manage per-requst properties should be a core concern of the architecture.
In addition we need to handle session properties if those are used. Since session properties are used in a lot of different places these should be accessed using C# classes rather than properties in pages. An alternative way is to place these is a MasterPage or BasePage but i don't like that idea due to the fact that using this kind of inheritance can restrict reuse of components.
We have a page that dynamically loads a lot of different components, and these components needs to access per-request properties of the application, such as user id, product name etc. Today this can be done something like:
string stateValueToGet = string.Empty;
// Coding horror..
// Component a is where stateValueToGet is parsed.
ComponentA compA = this.Parent.Parent as ComponetA;
if(compA != null)
{
stateValueToGet = compA.GetStateValue();
}
// do something with stateValueToGet ...
To begin with this is not good design to have components be dependent on each other like that. If the component should have a dependency it should probably only be to the page.
But alternative way to store these kind of per request values that need to be accessed in many different places during a page request is to use the HttpContext.Items property that allows you to store data as name-value pairs. However we should not access values directly from the Items collection but instead use proper C# helper classes or properties in the page class for that in order to hide validation, formatting etc.
One drawback with this solution is that dependencies among components will not be as clear but we should strive to minimize those anyway.
How to manage per-requst properties should be a core concern of the architecture.
In addition we need to handle session properties if those are used. Since session properties are used in a lot of different places these should be accessed using C# classes rather than properties in pages. An alternative way is to place these is a MasterPage or BasePage but i don't like that idea due to the fact that using this kind of inheritance can restrict reuse of components.
Sunday, November 02, 2008
Idéer
Jag har idag formulerat en målsättning att jag innan jag inom några år ska ha möjlighet att kunna bedriva verksamhet vart som helst i världen med hjälp av laptop och internet. Målet ska inte vara en enkel livsstil som kännetecknas av överflöd av allt som gör livet värt att leva. Behöver inte vara så motsägelsefullt som det låter vågar jag påstå.
Realistiska sätt att nå detta mål kan vara:
• Att jobba med programmering och IT på konsultbasis.
• Investeringar i aktier, värdepapper.
• Hjälpa företagare med råd vad gäller ekonomiska affärer och skatteplanering.
• Skapa internetsidor som generar annonsintäkter som överstiger driftskostnad.
• Ta del av passiva inkomster (räntor, utdelningar, uthyrning av stugan etc.).
Möjliga sätt att nå detta mål skulle kunna vara:
• Trading i aktier och värdepapper (här är det inte bevisat och inte heller statistiskt roligt att jag går plus).
• Spela poker (här är det inte bevisat och inte heller statistiskt roligt att jag går plus). Möjligen kan man tänka sig att jag kan spela in en låg summa pengar per timme med nuvarande kunskaper.
Fördelar med denna livsstil skulle kunna vara:
• Ta del av intryck och erfarenheter från runt om i världen för att utveckla mig som person och entreprenör.
• Bedriva verksamhet från utvecklande ekonomier samtidigt som intäkter generas från mogna ekonomier, vilket teoretiskt möjliggör högre marginaler.
• Slippa binda förmögenhet i fast egendom vilket möjliggör att kunna utnyttja de osunda svängningar som uppstår på de finansiella marknaderna.
Ett exempel på budget.
Jag utgår från att jag skulle klara mig på 12 000 netto per månad utomlands.
För passiva inkomster, säg att uthyrning borde kunna ge en vinst på 1000 SEK efter skatt per månad. Säg sedan att vi har en KF med aktier som kan avkasta 4% om året efter skatt i utdelning. Säg att den delen står för 2000 SEK månad, då är aktierna värde på 450 000.
Då är 9000 kvar att ta in. Detta bör inte vara några problem då det med en timlön på säg låga 300 innebär endast 60 debiterbara timmar per månad.
Ex. på platser att kunna jobba ifrån:
- Berlin.
- Thailand.
- Malaysia.
- Brasilien.
- Argentina.
- Stugan.
Realistiska sätt att nå detta mål kan vara:
• Att jobba med programmering och IT på konsultbasis.
• Investeringar i aktier, värdepapper.
• Hjälpa företagare med råd vad gäller ekonomiska affärer och skatteplanering.
• Skapa internetsidor som generar annonsintäkter som överstiger driftskostnad.
• Ta del av passiva inkomster (räntor, utdelningar, uthyrning av stugan etc.).
Möjliga sätt att nå detta mål skulle kunna vara:
• Trading i aktier och värdepapper (här är det inte bevisat och inte heller statistiskt roligt att jag går plus).
• Spela poker (här är det inte bevisat och inte heller statistiskt roligt att jag går plus). Möjligen kan man tänka sig att jag kan spela in en låg summa pengar per timme med nuvarande kunskaper.
Fördelar med denna livsstil skulle kunna vara:
• Ta del av intryck och erfarenheter från runt om i världen för att utveckla mig som person och entreprenör.
• Bedriva verksamhet från utvecklande ekonomier samtidigt som intäkter generas från mogna ekonomier, vilket teoretiskt möjliggör högre marginaler.
• Slippa binda förmögenhet i fast egendom vilket möjliggör att kunna utnyttja de osunda svängningar som uppstår på de finansiella marknaderna.
Ett exempel på budget.
Jag utgår från att jag skulle klara mig på 12 000 netto per månad utomlands.
För passiva inkomster, säg att uthyrning borde kunna ge en vinst på 1000 SEK efter skatt per månad. Säg sedan att vi har en KF med aktier som kan avkasta 4% om året efter skatt i utdelning. Säg att den delen står för 2000 SEK månad, då är aktierna värde på 450 000.
Då är 9000 kvar att ta in. Detta bör inte vara några problem då det med en timlön på säg låga 300 innebär endast 60 debiterbara timmar per månad.
Ex. på platser att kunna jobba ifrån:
- Berlin.
- Thailand.
- Malaysia.
- Brasilien.
- Argentina.
- Stugan.
Sunday, October 26, 2008
Ny giv
Jag ska lämna fiaskot som stockpickingen resulterat i, på sikt avveckla hålen jag hamnat i och övergå till att placera i indexfonder, och då primärt OMX30. Jag hoppas kunna uppta denna någon gång i framtiden när jag byggt en mer stryktålig portfölj med stabil tillväxt.
Runt nyår borde jag då kunna ha runt 400 att placera. Det är XACTS fonder som jag kommer satsa på primärt, kanske i en KF.
För timingen då pengarna ska in så använder jag två bra indikatorer, dels http://teknisk-analys.blogspot.com samt farsan. Troligen måste företagens vinster bottna innan det är dags. Pengarna ska stötas in i omgångar. Vid tendens till eventuell rekyl kan jag tänka på att placera 100 mer kortsiktigt om indikatorerna är positiva till detta.
Runt nyår borde jag då kunna ha runt 400 att placera. Det är XACTS fonder som jag kommer satsa på primärt, kanske i en KF.
För timingen då pengarna ska in så använder jag två bra indikatorer, dels http://teknisk-analys.blogspot.com samt farsan. Troligen måste företagens vinster bottna innan det är dags. Pengarna ska stötas in i omgångar. Vid tendens till eventuell rekyl kan jag tänka på att placera 100 mer kortsiktigt om indikatorerna är positiva till detta.
Thursday, August 07, 2008
Subversion
Notes about Subversion:
http://subversion.tigris.org/
link where to download Windows version:
http://www.collab.net/downloads/subversion/
Subversion client
Ankhsvn - open source plugin for visual studio.
Getting started
http://ankhsvn.open.collab.net/servlets/ProjectProcess?pageID=3794
Free book:
http://svnbook.red-bean.com
Notes:
A typical repository often holds the files for several projects.
To checkout repository subbtree using the command line:
svn checkout http://svn.example.com/repos/repository_subtree_name
There are numerous client tools, some important are svnlook and synadmin.
See the quick start guide on page 346.
See page 137 i pdf version of book for information on how to create
Among the server options svnserve is the on to look for.
The easiest way is to run the server process as a Windows Service, see page 168.
http://subversion.tigris.org/
link where to download Windows version:
http://www.collab.net/downloads/subversion/
Subversion client
Ankhsvn - open source plugin for visual studio.
Getting started
http://ankhsvn.open.collab.net/servlets/ProjectProcess?pageID=3794
Free book:
http://svnbook.red-bean.com
Notes:
A typical repository often holds the files for several projects.
To checkout repository subbtree using the command line:
svn checkout http://svn.example.com/repos/repository_subtree_name
There are numerous client tools, some important are svnlook and synadmin.
See the quick start guide on page 346.
See page 137 i pdf version of book for information on how to create
Among the server options svnserve is the on to look for.
The easiest way is to run the server process as a Windows Service, see page 168.
Sunday, August 03, 2008
Friday, August 01, 2008
Spring.NET
I decided that that the new Policy Injection Block probably is not for me so I'll be checking out Spring.NET since
I need to take my coding and architecting to the next level using AOP.
I am also going to do something I should have done ages ago, order (and read) a copy of Code Complete. I am aware of
much of the content in the book but still I want to really dig in on it and reflect.
Next week will be my first as Independent Consultant so I am very exciteed!
I need to take my coding and architecting to the next level using AOP.
I am also going to do something I should have done ages ago, order (and read) a copy of Code Complete. I am aware of
much of the content in the book but still I want to really dig in on it and reflect.
Next week will be my first as Independent Consultant so I am very exciteed!
Friday, May 09, 2008
BizTalk Orchestration and the #error "Errors exist for one or more children."
Sometimes when you work with an orchestration you get #error "Errors exist for one or more children." as the only error. I managed to get this when I had a loop. Looking in the odx file manually I was able to determine which loop and branch of decide the error was in. Then I could see that one of my shapes had the error flag in the designer. It turned out that it was this line of code in an expression shape that did the error:
transform (DeliveryMessage) = tMap(InboundMessage);
Notice the blank space after transform. That's what did it. However, some strange stuff is:
1. I copied the orchestration from another project where this code worked.
2. Once i had compiled the orchestration i added the white space once again and now it worked.
Ok, I am not too impressed with the Orch Designer.
transform (DeliveryMessage) = tMap(InboundMessage);
Notice the blank space after transform. That's what did it. However, some strange stuff is:
1. I copied the orchestration from another project where this code worked.
2. Once i had compiled the orchestration i added the white space once again and now it worked.
Ok, I am not too impressed with the Orch Designer.
Friday, May 02, 2008
Visdom
Har kommit på en sak vad gäller aktier. Tidigare har jag mest kollat på undervärderade företag som gör bra vinster. Men detta bör vara hitta undervärderade företag som gör bra vinster och vars aktie uppvisar stark trend.
Tuesday, April 29, 2008
Design Patterns – Template method
The idea is to design a method in a superclass that defines the skeleton of an algorithm. Implementation of varying steps in the algorithm is deferred to a subclass. The superclass can implement a default.
An example would be to create a mechanism for caching objects. The logic for how to cache objects remains the same so we create a template method for it. However, the means for how to get the object from storage differs so it is left to the subclass to implement. The logic is something like:
if (IsObjectInCache(anObjectKey))
{
return GetObjectFromCache(anObjectKey);
}
else
{
Object anObject = GetObjectFromStorage(anObjectKey);
SaveObjectInCache(anObjectKey, anObject);
}
The SaveObjectInCache is then overridden in the subclass.
However, for this example this pattern might not be ideal for this situation. Since caching is normally an application wide concern it might be better solved using an AOP technique or somehow implementing it more loosely using in combination with the Decorator pattern.
Another possible approach would be this: Have all business entities implement a single interface that takes their key (in form a Dictionary object created automatically by using reflection) and loads the object representation. Then have a CacheManager implementing the method skeleton.
So remember that the drivers behind this pattern can be created using some other technique than subclassing.
An example would be to create a mechanism for caching objects. The logic for how to cache objects remains the same so we create a template method for it. However, the means for how to get the object from storage differs so it is left to the subclass to implement. The logic is something like:
if (IsObjectInCache(anObjectKey))
{
return GetObjectFromCache(anObjectKey);
}
else
{
Object anObject = GetObjectFromStorage(anObjectKey);
SaveObjectInCache(anObjectKey, anObject);
}
The SaveObjectInCache is then overridden in the subclass.
However, for this example this pattern might not be ideal for this situation. Since caching is normally an application wide concern it might be better solved using an AOP technique or somehow implementing it more loosely using in combination with the Decorator pattern.
Another possible approach would be this: Have all business entities implement a single interface that takes their key (in form a Dictionary object created automatically by using reflection) and loads the object representation. Then have a CacheManager implementing the method skeleton.
So remember that the drivers behind this pattern can be created using some other technique than subclassing.
Subscribe to:
Posts (Atom)