Sunday, August 17, 2014

My new keyboard - Realforce 87 U Silent - the best typing experience but with a high price #torpe #realforce #realforce87U

It's more than a year, that I have switched into the 'highly quality mechanical' keyboard search mode. I have to admit, considering the amount of money I have spent for more than a decade to medium or very bad overpriced conventional keyboards, that were promising some sort of quality and productivity boost during typing, I was late. 

Better late than never. For most of the people (if you exclude hard core gamers) investing in a good keyboard is some sort of, waste of money, since most of the regular keyboards seem to do the work. The thing is that if your work is about typing  a lot and when I mean a lot I am talking about hundreds of lines of code and text everyday, and you start monitoring your typing error rates, the amount of noise you produce when you hit the keys, a slight pain on your wrist or fingers after long hours of typing then you start wondering if there is a better way or tool? Anyway this post is not about, preaching the qualities and benefits of using a pro-mechanical or hybrid keyboard for intense typing jobs (like being a software developer) rather than my experiences on buying my second pro keyboard. 

I have stopped using Apple's keyboards for more than a year, my first attempt to the world of hybrid mechanical keyboards was the Matias Quiet Pro . Here is a post,  (in Greek) about my impressions and the market research I did in order to come up with it. Matias was a big change comparing to conventional keyboards, the feel was something very different for me, and I have to be honest I was more or less satisfied with this change. My typing errors were reduced, my max-out of the keyboard keys reduced even more and my keyboard stopped bumping in the air due to my hi intense (strong typing force) style. My typing rate was not increased though, due to the different feel and 'resistance' of the keys while pressing. My next priority was noise, Matias delivered, working in an office you don't want to get the blame for noise pollution due to clicking noises of your mechanical keyboard  and since I am also very 'sensitive' on noise issues at work I was looking for something 'office' friendly. I spent almost 8 months typing with Matias, and I consider it a very balanced keyboard for those who want to try the feel of a mechanical  keyboard  (actually is considered  a hybrid) in work without spending a small fortune.

During my research prior to buying the Quiet Pro, I did an extensive research on pure mechanical keyboards e.g flavors of keyboards using the CHERRY MX switches and the new kid on the block Topre. Due to the noise factor as already elaborated and while reading and listening to many youtube videos, I decided that one day I would buy a  Torpe based keyboard, something like the ultimate desitnation on the developer keyboard land. And so I did. In that post I wrote, that despite buying the Matias, my first choice would be RealFor87U, unfortunately it's price was a no go and  I did not have a prior experience on mechanical keyboards so I wanted to invest on a low risk solution.

The trial went well, I came to realize that I should have invested in a real good keyboard years before, so in my 34 birthday I decide to go the extra mile and buy the RealForce 87 U Silent, Variable Weighted press keys.

The good  things
  • It absolutely the best keyboard experience I have ever had, eventually the 45g weight keys are the perfect fit for my typing style (intest force, high rates on max-out the keys). After typing on the RealForce it seems that all the previous keyboards way behind.
  • I managed to reduce error rates, max out on keys, bumping of the keyboard was elimitated (since it is heavy and steady enough) and last but not least, managed to increase my typing rate!
  • Especially the very fist days, I was like eager to go at work and start typing, absolutely loving the feeling. (only developers would understand this I know). 
  • It is Silent!!! More silent comparing to the Matias.
The bad
  • High price, it is very expensive and  there is an extra hidden cost. Unfortunately Realforce ships from the US, considering the price, the item was picked in the customs office in my country (EU-Greece). With that price tag, you need to pay in taxes  another 100 USD dollars, and the worst thing is that the FedX delivery, is charging another 100 USD dollars for making the paper work and delivering the item to you + this extra is on top of the 60 USD you have  paid in the original price tag for FedX!. It is almost insane and I have to admit I would not recommended anyone outside of the US, buying this keyboard that way. I was so close on delivering the item back and requesting a refund. Since I decided to pay everything.. it still hurts, I can help other people avoiding my mistake.
    • Search for alternatives eg Amazon stores that, that have already a fixed tax tag for customs import.
    • Avoid FedX delivery and shipping when it involves customs, it seems for Greece UPS seems much more flexible. The amount of money requested for doing the paperwork are way too crazy.
    • if you have a friend in the states that is coming to EU, ask him/her to bring one with him as a present. 
  •  If you typing very strong I would recommend you go for the Fixed Weighted keys, this was my only mistake (but I how I could know, since you can not find them easily to test them out, especially in Greece). It seems that some of the (e.g Back space of space) that have different weight (feel) while pressing and I can max them out, while the majority of the alphanumeric keys which are on the 45g weight are ideal. So the only break in the overall silence is when I hit Back Space, and I maxing it out.

Overall, YES it is one of the best keyboards in the world, so a software developer would most probably love it. YES it is very expensive and if you order it outside of US your wallet might hurt for many months after the purchase.  I wish RealForce-EliteKeyboards and relevant Torpe Keyboard providers, reduce their price tags or start importing them in the EU so the European customers do not pay a small fortune (almost double price) for such a keyboard.

Saturday, July 19, 2014

Cosmos - a spacetime odyssey...κάτι που πρέπει να δεις



Δεν ξέρω πόσοι από εσάς σαν παιδιά πρόλαβαν την σειρά Cosmos του Carl Sagan είτε την χρονιά που ξεκινήσε (1980) , είτε λίγα χρόνια μετά στις αμέτρτητες επαναλήψεις. Θυμάμαι να την βλέπω σαν παιδί στην τότε ΕΡΤ. Ο Carl Sagan μιλήσε για το σύμπαν, το διάστημα, τον πλανητη μας, τα διάφορα φυσικά φαινόμενα, υπήρξε σήμειο αναφοράς για πολλές γενιές αργότερα. Λοιπόν αν σας ξέφυγε η αρχική σειρά έχετε μια δεύτερη ευκαιρία, επίσης αν εχετε και παιδιά σε  ηλικία που μπορούν να καταλάβουν πράγματα τότε η δευτερη ευκαιρίας σας γινεται πιο σημαντική, είναι υποχρέωση να την δείτε μαζί τους.

Μόλις σήμερα κατάφερα να ολοκληρώσω το remake της σειράς (2014), από έναν μαθητή του Sagan τον Neal deGrasse Tyson, που ακούει στο όνομα Cosmos - a Spacetime Odyseey. Πάλι στο ίδιο μοτίβο ο Tyson μας εξηγεί την ιστορία του σύμπαντος, του πλανήτη μας, φανερώνει τις ιστορίες μεγάλων επιστημών, μας προηδοποιεί για τις κλιματικές αλλαγές και την καταστροφή στον πλανήτη μας. Τα 2 αγαπημένα μου επεισόδια ήταν η ιστορία του μολύβδου και η δουλειά/έρευνα του C.C Patterson κατά των εταιριών παρασκευής βενζίνης και το πως φτάσαμε στην χρήση της αμόλυβδης, και το προτελευταίο όπου ο Tyson δίνει πολυ απλά και χαρακτηριστικά παραδείγματα για την κατακόρυφη άυξηση CO2 στον πλανήτη μας κάθε χρόνο και πως αυτή μεταβάλλει το κλίμα και κάνει τη Γη αρκετά πιο θερμή χρόνο με το χρόνο.. 

Σε πολλά επεισόδια έχει επιλεχθεί η εξιστόρηση με χρήση cartoon κάτι το οποίο κάνει την σειρά πιο φιλική και σε μικρές ηλικίες, ενώ τα γραφικά και οι εικόνες από το διάστημα ή απο κόσμους που δεν έχουμε μπορέσει ακόμα να επισκεφθούμε θα σας καθηλώσουν.

Αξίζει τον χρόνο σας, αν είστε εκπαδευτικός μην διστάσετε με την πρώτη ευκαιρία να  κάνετε προβολές και στα σχετικά μαθήματα.


Tuesday, July 01, 2014

Java EE7 and Maven project for newbies - part 7 - #jpa2 and Unit testing using #arquillian / #WildflyAs 8.1 #maven #jboss - using a real Datasource (#postgresql)

Resuming from the previous parts

Part #1, Part #2, Part #3, Part #4, Part #5 , Part #6

In the previous post (num 6) we discovered how we can unit test our JPA2 domain model, using Arquillian and Wildfly 8.1 In the previous post we made a simple configuration decision, we used the internal H2 database that is bundled with Wildfly 8.1 and the already configured Datasource (called ExampleDS). But what about a real DBMS? In this post we are going to extend a bit the previous work, use the same principles and 
  • test towards a running PostgreSQL in our localhost
  • use some of the really nice features of the ShrinkWrap API, Arquillian Offers.

Pre-requisites

You need to install locally a PostgreSQL RBDMS, my example is based on a server running on localhost and the Database name is papodb.

Adding some more dependencies

Eventually we will need to add some more dependencies in our sample-parent (pom). Some of the arem related to Arquillian and specifically the ShrinkWrap Resolvers feature (more on this later).

So our we need to add to the parent pom. xml the following


Some notes on the above change:
  •  In order to avoid any potential conflicts between dependencies, make sure to define the ShrinkWrap BOM on top of Arquillian BOM
Now on the sample-services (pom.xml) , the project that hosts are simple tests, we need to reference some of these dependencies.


Restructuring our test code

In the previous example, our test was simple, we we only used a certain test configuration. That resulted to single test-persistence.xml file and no web.xml file, since we were packaging our test application as a jar. Now we will upgrade our testing archive to a war. War packaging in JavaEE7 has become a first level citizen when it comes to bundling and deploying an enterprise application. The main difference with the previous example is that we would like to keep both the previous settings, meaning test using the internal H2 on wildfly, and the new setting testing towards a real RDBMS server. So we need to maintain 2 set of configuration files, and making use of the Maven Profiles feature, package them accordingly depending our mode. If you are new to Maven make sure to look on the concepts of profiles.

Adding separate configurations per profiles

So our test resources (watch out these are under src/test/resources) are now as illustrated below.


There are differences in both cases. The test-persistence.xml of h2 is pointing to the ExampleDS datasource, where the one on postgre is pointing to a new datasource that we have defined in the web.xml! Please have a look on the actual code, from the git link down below.

This how we define a datasource in web.xml


Notes on the above
  • the standard naming in the JNDI name java:jboss/datasources/datasourceName
  • the application server, once it reads the contents of the web.xml file, will automatically deploy and configure a new Datasource.
This our persistence.xml


Notes on the above
  • Make sure the 2 JNDI entries are the same both in the datasource definition and in the persistence.xml
  • Of course the Hibernate Dialect used for postGresql is different
  • The line that is highlighted is a special setting that is required for Wildfly 8.1 in cases that you want to deploy with one go, the datasource, the jdbc driver and the code. It hints the application server to initialize and configure first the datasource and then initialize the EntityManager. In cases that you have already deployed /configured the datasource this setting is not needed.

Define the profiles in our pom

In the sample-services pom.xml we add the following section. This our profile definition.


Depending on the profile actived, we instruct Maven to include and work with the xml files under a specific subfolder. So if we apply the following command

mvn clean test -Pdb2

Then maven will include the persistence.xml and web.xml under the resource-h2 folder and our tests will make use of the interall H2 DB. If we issue though

mvn clean test -Ppostgre 

Then our test web archive will be packaged with data source definition specific to our local postgresql server.

Writting a simple test

Eventually our new JUnit test is not very different from the previous one. Here is a screenshot indicating some key points.


Some notes on the code above:

  • The Junit test and basic annotations are the same with the previous post.
  • The init() method is again the same, we just create and persist a new SimpleUser Entity
  • The first major different is the use of ShrinkWrap Api, that makes use of our test dependencies in our pom, and we can locate the JBDC driver as a jar. Once located ShrinkWrap makes sure to package it along with the rest of resources and code in our test.war. 
  • Packaging only the jdbc driver though is NOT enough, in order this to work, we need a datasource to be present (configured) in the server. We would like this to be automatic, meaning we dont want to preconfigure anything on our test Wildfly Server. We make use of the feature to define a datasource on web.xml. (open it up in the code). 

  • The application server, once it scans the web.xml will pick up the entry and will configure a datasource under the java:jboss/datasources/testpostgre name. 
  • So we have bundled the driver, the datasource definition, we have a persistence.xml pointing to the correct datasourc. we are ready to test
  • Our test method is similar with the previous one.
We have modified a bit the resources for the H2 profile so that we package the same war structure every time. That means if we run the test using the -Ph2 profile, the web.xml included is empty, because we actually we don't need to define a datasource there, since the datasource is already deployed by Wildfly. The persistence.xml though is different, because in one case the dialect defined is specific to H2 and in the other is specific to Postgre.

You can follow the same principle and add a new resource subfolder, configure a Datasource for another RDBMS eg MySQL, add the appropriate code to fetch the the driver and package it along. 

You can get the code for this post on this bitbucket repo-tag.

Reference