Skip to main content

Posts

Showing posts from 2013

Fitness inspektor: World Class Wenceslas/Vaclavské náměstí

Druhou zastávkou na tour de multisport karta bylo fitko na Václaváku, konkrétně World Class Wenceslas . Hned na začátku, kvůli lokaci, trošku problém s parkováním, protože na Václavském náměstí člověk prostě zdarma nezaparkuje. Zařízení má vlastně tři podlaží. Nahoře recepce, pár strojů, v mezipatře cardio a sál, dole klasická posilka včetně regulérní hrazdy - asi jediné plus, které jsme ještě ke všemu nepoužili :-) V pátek večer narváno zrovna nebylo, ale fitko vypadalo plné, nedokážu si představit třeba úterý večer. Všechna patra jsou v podzemí, takže žádná okna. Díky tomu na mě nepůsobilo nijak pozitivním dojmem. Když člověk přičte starší stroje, tak z návštěvy nadšený moc nejsem. Sprchy, šatny a sauna celkově horší, takže za me tři mínus .

Fitness inspektor: Fitness Kotva

Na první zkušenost s multisport kartou jsme vyrazili do Fitness Kotva . V centru Prahy na Náměstí republiky, parkovat lze v Kotvě několik hodin zdarma. Dostupnost tedy jak MHD tak autem velmi dobrá. Jedná se o středně velké fitness - velké pro mě znamená Fitness BBC na Želivského . Příjemné prostředí, nějaký pátek od otevření to už bude, ale vše relativně nové. Aerobní část má řádově deset strojů od běhacích pásů přes orbitrek až po veslování. Dostupné jsou dvě multiposilovací zařízení s hrazdou, docela dost jednoúčlových strojů, celkem slušná "činkárna" s benchem a multipressy, protahovace-posilovací koutek se zrcadly, několika míči, podložkami atd. Dohromady to funguje. Za dvě návštěvy jsme narazili vždycky na solidní osazenstvo, ani ve špičce není nijak narváno, takže šlo vždycky pohodně cvičit. Za mě je to dvojka :-)

Multisport karta

Multisport je takový gadget mezi fitnessy, až jsem o něm musel napsat článek :-) O co jde? Zaplatíte určitý obnos peněz za parmanentku, se kterou můžete navštěvovat různá sportovní zařízení . Genialita spočívá v tom, že jen v Praze jsou těch zařízení stovky , od fitness přes bojové sporty, badminton, tenis, bruslení, bazén, wellness, sauny atd. Více v seznamu partnerů . Jediné omezení spočívá v tom, že na multisport kartu můžete navštívit jen jednoho partnera denně, což v praxi moc velké omezení není. Zároveň v seznamu partnerů nejsou ty TOP záležitosti, např. z posiloven jsou tam převážně ty menší. Např. moje oblíbené fitness BBC tam není. S ním konec konců budu srovnávat všechna fitka dále v minirecenzích. Zároveň ještě některé podniky maji problém při kolektivních sportech, např. jsme řešili problém s Erpetem na badminton, kdy na jeden kurt neumí rozpůlit cenu, tzn. že já bych "platil" multisport kartou a kolega penězi. Museli bychom mít karty oba dva, abych ji já mo

Redis messaging using Spring and Kryo serialization

Redis is famous enterprise key/value data store which provides simple messaging using publisher/subscriber . I've decided to use the system to notify remote nodes (components) about a change of state between those components. Spring among the others allows to use it's templating system to decouple business logic from messaging system used under the hood. The use of spring data for Redis guarantees a solution which does not utilize any redis command in the code. Redis contains serialized content, either byte[] or string. So the last thing to reveal is domain model serialization. I've decided to fast binary serialization using  Kryo framework as a winner of battle of serializators . Maven First of all, it's necessary to define all dependant components. Obviously, usual component like spring itself missing. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <dependency> <groupId> com.esotericsoftware.kryo </groupId> <artifactId> kryo &l

Scala: get rid of not-null validations

Scala has been always known as a language which allows special handling of null  values. There is ton of articles regarding Some[T], None, Option[T] . What is most annoying code for me? Null validations, see usual example: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 class Entity { } class ServiceA { def method ( a : Entity , b : Entity , c : Entity , d : Entity ) = { Validate . notNull ( a ) Validate . notNull ( b ) Validate . notNull ( c ) Validate . notNull ( d ) } } class ServiceB ( val a : ServiceA ) { def method () = { a . method ( null , null , null , null ) } } When you start to write save code in the term of fails-as-fast-as-possible , your code, services or even domain model, will be weedy, you will find such boilerplate code at every method because you can't be sure which parameter supplied someone to you class or method. Unfortunately Scala has beautiful way how to achieve nice and

Tomcat 7 remote deployment

I decided to provide automatic deployment of war packaged application using Jenkins and Deployment plugin . The target platform is Amazon with Tomcat 7, see nice set of articles  to find out how to setup such environment for free. Well, there is couple of tutorials but they missing some points so it pushed me to lost one hour of my work. What I got Fresh installation of Tomcat 7 on remote machine with opened 8080 port on firewall Personal war file supposed to be deployed How to push it to tomcat? 1. First of all, there is simple configuration of tomcat users in file tomcat-users.xml  - it was my pain in the ass :-) As original comprehensive documentation says, it's necessary to define user, but which one(s)? Here is working example of tomcat-users.xml : <tomcat-users> <user username="manager-gui" password="changeit" roles="manager-gui"/> <user username="manager-script" password="changeit" roles

Jenkins + git revision in all build names

Jenkins by default assigns version of a build using local counter within each type of a build. An example is better. When you look at this overview, you definitely do not know which code revision was used in Compile build and which in Integration Tests . I've followed nice article regarding real CI pipeline using jenkin s. It uses Build Name Setter Plugin. Unfortunately this article uses SVN revision number. So I said I'll just use git revision as git is my source control. But it's not so easy as how it could seem for first look. My Jenkins setup comprised of first compile build step which clones git server and performs an compilation. Second build steps clones the repository from first step and executes integration tests . The problem here is that the second step does not know which git revision compile step cloned. Here is list of steps how to do that. 1. You obviously need Git Plugin , Build Name Setter Plugin and Parameterized Trigger Plugin 2. Compile

Constructor dependency injection over property autowiring

I use dependency injection pattern on all projects where it makes any sense, especially spring  is following me all my life. Once I've discovered domain driven design , I've realized that model should be rich, clear, reusable, no meaningless dependencies. Combining of clear model along with spring annotation can bring few issues except model dependency on spring jar files. See following example what's going on: And relevant unit tests. Once you decided to write reboust component, you can't be absolutely sure that someone will use spring (or other DI framework) to push all dependencies. Well, you need them check. Those are the reasons why I decided to use dependency injection via constructor. The componets just use fully supplied constructor requiring all mandatory dependencies. See the code: Advantages Such code brings couple of other advantages which you must not see at a glance: Obviously clearer code as there is just only one place where all

Rozšiřte náš R&D tým!

Máte rádi nové zajímavé technologie? Lidé v našem týmu je rádi používají, ale ještě raději je vytváří. V současné době pracujeme na produktu simulujícím chování komplexních softwarových kompoment v enterprise software rešeních. Náš systém si můžete představit jako T1000, liquid robot z Terminator 2, který umí replikovat a simulovat chování softwarových komponent. Produkt se skládá z grafického rozhraní, kterým se ovládá a modifikuje chování simualce, škálovatelný simulátor, který zvládá zpracovávat tisíce transakcí za vteřinu, a sadu adapterů do enterprise technologii jako je SOAP, REST, JMS, MQ, EJB, TIBCO, SAP, Mainframe a další. V současné době pracujeme na nové verzi produktu, která bude realizována jako SaaS cloud řešení. Rádi bychom s Vámi diskutovali možnost spolupráce na našem produktu. Jsme kompaktní přátelský tým 25 lidí od juniorů čerstvě po škole až po zkušené vývojáře s patnáctiletou zkušeností v enterprise software. Vynalézání systému probíha v Praze, produkt manage

Čas dát NHibernatu sbohem #2 - performance

V minulém díle jsem jsem rozebíral pár nedostatků NHibernatu , které mají z mého pohledu zásadní vliv k nasazení či nenasazení toho výborného frameworku. V tomhle díle bych rád rozebral performance. Performance lze různě ladit, jak jsem již před pár lety rozbíral . Je spousta možností, jak věci delat. Cachovani, stateless session atd. Ve chvíli, kdy se dostane člověk na hranu rychlosti databáze, musí se začít zaobírat méně obvyklými věcmi, které se běžně neladí. Kontrukce entit Vždy jsme na našel projektu ctili DDD , čili chtěli jsme mít rich entity a ne naked. Tím chci říct, že všechny atributy/fieldy jsou encapsulované get/set metodami. Pokud nechcete zveřejnit privátní fieldy, musíte začít používat reflection, což při velkém měřítku při používání pro většinu mapovaných entit začíná být pro .NET problém. Je to pomalé. Existuje několik frameworků (např. FastReflect ), které dokážou cachovat reflection přístup, čistou performance přístupu k privátním fieldům to pak zrychlí v na

Book: Functional Programming for Java Developers: Tools for Better Concurrency, Abstraction, and Agility

Probably all of us forget functional programming  in the name of object oriented  one. As concurrency and scalability are two buzzwords mentioned these days in every technical acrticle the functional programming notion seems to growing. The book Functional Programming for Java Developers: Tools for Better Concurrency, Abstraction, and Agility is brief introduction why and how could developer or architect think about development, especialy in the scope of reusable components. The couple of chapters at the beggining show how functional programming approach can improve thinking of every programmer. Special attention is put on objects immutability or functional recursion. Next chapters present the example how to write immutable list and maps, how to write useful methods operating above the list using recursion and how to use these methods for everything what you can want from the structure. Well, I read the book twice. The impact was immediate since I was writting a component ba