Some Trials & a lot of Errors

I tried a bunch of framework and other language and I usually feel overwhelm when its time to do something real with what I've learned. So that why I created this site, to write my progress and help some noob like me that stumble into the sames problems.

Book I’ve read in 2019…

By Chris on February 10, 2021

I know 2019 is like light years away, but I haven’t had the time to write and you will see that I haven’t had much time to read either in 2019. Having a baby who doesn’t sleep will do that to you.

How to be miserable

I got this book after watching CGP Grey’s “7 Ways to Maximize Misery“. I recommend both the video and the book – the video is based on seven of the 40 strategies given in the book.

Excellent reverse psychology to avoid doing the list of actions that will make you miserable. Some of the excerpts had me in tears laughing because I could see what I had been doing without really realizing it. After starting that list I’ve read some part of the book again, I definitely will put that book in my re-read list.

The gift of failure: How the Best Parents Learn to Let Go So Their Children Can Succeed

In our overprotective society, Jessica Lahey warns us that shielding our kids too much from mistakes is not actually helping. We need to let them make their own mistakes in order to learn and be ready later in life. Failure should not be looked at as a negative, but rather a stepping stone to success.

A great book that state the obvious, today kids are so shielded from everything they don’t get to experience what it’s like to live and this might have some dire consequences when they get older and need to leave the nest. It’s helped me worry less about grades (a little less) and everything around them and let them be kids, let them experience the world with their genuine curiosity and thirst for knowledge.

The storm before the storm

From the triumph to the fall of the Roman republic this book goes into the bloody details of what happened during that time.

I was a big fan of Mike Duncan podcast on Roman history and I love how he tells the stories of these Roman citizens. This book is no different, I couldn’t put the book down near the end even though I knew where this was heading and the implication of what would come next.

If you’re a fan of Roman history I highly recommend it. If you want to understand the parallel between that period in history and our current US event you can checkout his interview on Ryan Holiday Daily Stoic podcast.

Posted in book | Tagged 2019, book, How to be miserable, The gift of failure, The storm before the storm | Leave a response

Constructor XXX in enum XXX cannot be applied to given types in mapstruct

By Chris on May 20, 2020

I was having that weird error when I was working with mapstruct, turn out that the default java version for mapstruct is java 6. Since our project was in java 11 I was getting the error “Constructor XXX in enum XXX cannot be applied to given types”.

My starting config was :

        <dependencies>
             <dependency>
                 <groupId>org.mapstruct</groupId>
                 <artifactId>mapstruct</artifactId>
                 <version>${org.mapstruct.version}</version>
             </dependency>
         </dependencies>
         <build>
             <plugins>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
                     <version>3.8.0</version>
                     <configuration>
                         <release>${java.version}</release>
                         <source>1.6</source> <!-- or higher, depending on your project -->
                         <target>1.6</target> <!-- or higher, depending on your project -->
                         <annotationProcessorPaths>
                             <path>
                                 <groupId>org.mapstruct</groupId>
                                 <artifactId>mapstruct-processor</artifactId>
                                 <version>${org.mapstruct.version}</version>
                             </path>
                         </annotationProcessorPaths>
                     </configuration>
                 </plugin>
             </plugins>
         </build>

After some research, turn out there a mapstruct version for java 8 and more. You can use the following maven to configure mapstruct for java 8 or higher :

        <dependencies>
             <dependency>
                 <groupId>org.mapstruct</groupId>
                 <!-- use mapstruct-jdk8 for Java 8 or higher --> 
                 <artifactId>mapstruct-jdk8</artifactId> 
                 <version>${org.mapstruct.version}</version>
             </dependency>
         </dependencies>
        <build>
             <plugins>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
                     <version>3.8.0</version>
                     <configuration>
                         <release>${java.version}</release>
                          <!-- or higher, depending on your project -->
                         <source>1.11</source> 
                         <target>1.11</target> 
                         <annotationProcessorPaths>
                             <path>
                              <groupId>org.mapstruct</groupId>
                              <artifactId>mapstruct-processor</artifactId>
                              <version>${org.mapstruct.version}</version>
                             </path>
                         </annotationProcessorPaths>
                     </configuration>
                 </plugin>
             </plugins>
         </build>

Let me know if you had that problem and if this helped you.

Posted in error, java | Tagged java, java8, mapstruts, maven | Leave a response

Book Review Autumn 2018

By Chris on January 8, 2019

Perenial Seller:
The Art of Making and Marketing Work that Lasts 

I’m subscribed to Ryan Holiday newsletter and read is latest work on stoic philosophy (Obstacle if the way, Ego is the Enemy, Daily stoic) and when he usually get a book out I buy it.
In his book, Perenial Seller, we study on what it takes to create timeless, lasting work. Ignore the trends of the day to focus on what matters and what will lead to real impact.
If you want to write, produce, or build something amazing, read this book.

Principle by Ray Dalio

A big book (600+ page) about one of the great Investor of our time, Ray dalio and is life and work principle.

Ray Dalio is the founder and co-chairman of Bridgewater Associates, which, over the last forty years, has become the largest and best performing hedge fund in the world.
Mr. Dalio let us dive in in this part memoir, part how-to guide and show us what priciple guide is life and business.
My main take away of this book is to pratice radical honesty, which is the ability to open oneself to appreciate pointed criticism and use it to improve and have a sense of humility and introspection.
There 3 main part in the book, is biography to understand where he come from, is life principle and is work principle that he used to build Bridgewater.

Factfulness

I bought this book after seeing Bill Gates recommendation, and my god this book is eye opening. Hans Rosling explains how what we see on the media, our preconceptions and statistical illiteracy make us believe in the wrong worldview. Surprise, surprise, other countries aren’t like they used to be 50 years ago. The book carefully break the 10 most important sources of bias and misconceptions and give ways to avoid them. Forget about the “Developping world”, most countries today would be considered developed. We should categorize the developments in four income level instead and at the end of the book there are examples on what different in the life of a level one vs other level of income. Each countries have average income level that help us determine the problem of the population and the degree of extremes poverty.

Posted in book, Uncategorized | Tagged 2018, book | Leave a response

Book review Summer 2018

By Chris on December 22, 2018

No drama discipline

A another parenting book, I’ve read 3 of those in 2017 alone it’s from the same author of the Whole brain child.
Learning to help your child to use their upstairs brain when they are overwhelm in their downstairs brain (emotion). Connect with your child first before trying to do discipline.
See the refrigerator sheet

Da Vinci Code (FR)


By Source, Fair use, Link

Along with the Fiction Book the digital fortress my father gave me a bunch of Dan Brown books. Da Vinci code is probably the most famous of is book and it even been adapted into a Movie. However, I’ve seen the movie age ago when it was out in theater and was surprise how little I remember about it.

I didn’t remember who was the villain, but I did remember the ending and what it was about.

Recession Proof Graduate

Recession proof graduate was a gift from the Play for a living from Kickstarter. 

Recent graduates, who have been repeatedly told by elders that long studies entitled them to a good job, are surprised when they realize blindly posting resumes online and hoping a company will hire them does not produce the desired result.

In this book, Charlie describes another way you need to do to land your dream job. And it’s not the advice you will get from your parents, profs, or counsellors.
Charlie mentions that you have to be willing to do free work for people you admire. Because with free work comes low expectations and allow you to get your foot in the door. The book goes into more detail, but with this method, you start building a portfolio, contacts and a reputation.

Even that I’m not a new grad, a lot of principle and strategies he explains in is book can be applied to anyone who wants to have a career or help there business.

Love yourself (59 pages)


Very short self-help book (59 pages) that go to the point. Well the title go to the point, it’s a book about loving yourself and that if you want to help other and be loved by others you should seek your inner love before seeking validation from others. The fact that it’s short make it a great re-read when you’re feeling down or just need a pep-talk.

Posted in book | Tagged 2018, book, Da Vinci Code, Love yourself, No drama discipline, Recession Proof Graduate | Leave a response

How to give a list of value in a where clause in sql (on oracle) ?

By Chris on July 24, 2018

I have a list of guild but I don’t want to call that sql for each guild. (check previous post for the structure)
This one is a little easier, you just have to use the IN (PARAMETER, OPERAND, KEYWORD) instead of equal (=) and you give your list of guild you want in it.

select * where
from USER_TABLE u inner join JOB_ASSIGN assign on u.USER_ID = assign.USER_ID, GUILD_TABLE guild where assign.guildId = guild.id AND assign.guildid = ?

If you want to hand pick the number of guild you can use the KEYWORD IN:
select * where
from USER_TABLE u inner join JOB_ASSIGN assign on u.USER_ID = assign.USER_ID, GUILD_TABLE guild where assign.guildId = guild.id AND assign.guildid IN (12,13,14)

 

Related : What to do if I want give a list of value in my where clause parameters?

Posted in db | Tagged List, oracle, sql, where | Leave a response

April 2018 Book: Unshakeable

By Chris on April 29, 2018

April was a busy month, I’ve only managed to finish one book. I’ve finished Unsheakable by Tony Robin, a follow-up of is other book Money: Master the game that is shorter and can be read independently.

Unshakeable

A lot of what is said in Money: master the game is re-told in unshakable, it makes me feel that Robin wanted to a shorter book (225 pages vs the 600+ pages for Money: master the game) to reach more people and promote is partnership with Creative Planning which was left out of the other book.

Its start off making you aware of how bad the financial industry is treating you and how to do it on your own or find a good advisor.

First he goes how bad are mutual fund which are outperform by the index most of the time after including the fee you pay (95% of the time according to the book).

He then goes to show how most financial advisor don’t have your interest at heart because they are actually broker and will push product that may give them bigger commission.

Other topic are covered like 401K, how to prepare and take advantage of market correction and bear market, tax efficiency and more.

The last section is about real wealth and how it is emotional, psychological and spiritual. How living a fulfilling life is more important than just success.

This section in my opinion what makes this book and money (it has a similar chapter) stand out compare to most other financial help book out there.

My final take is that if you’re interested to read about your finance this book is a good start, it contains the message of it previous book and is a much lighter read. It will get you started, I found so chapter tedious at the beginning even though he made a good effort of keeping the book interesting.

Posted in book, Review | Tagged 2018, april, book, review, Unshakeable | Leave a response

Books Q1 2018: Sapien, Digital Fortress, Essentialism & Ready Player One

By Chris on April 9, 2018

It’s been three month, so I decided to give a little update on the book of 2018, this is a follow up of my list of book of 2017.

Sapien

Recommended by Bill Gate and many podcast I’ve listened too, Sapien is a brief (a synopsis if you wish) of the history of mankind.
He deconstruct different revolution that the Sapien had and he touch on the drawback of the Sapien expansion. From pre-historic time where the Sapien clashed with the neanderthal, where they drove extinct the mega-fauna of every ecological system they entered, to modern time.
I really liked that he approached some lesser know fact, like that hunter gathered had it better in term of life expectancy, quality of life, health that human in the agricultural revolution.
I love those kinds of read even though it’s a long one.

 

Digital Fortress

My father is a big Dan Brown fan and lend me some of is book, I started with this one because it seems more in my line of work (computer, cryptography) than the others (The Da Vinci Code & other).
Writen in 1998, what caught my attention was some of event in the book happens recently.
One of the plot point of the book is that a character will release an undecryptable algorithm to the world if the NSA don’t reveal that they have a super computer that read everybody mail and can decrypt all of the current cryptographic algorithm.
Sound like what Snowden did, letting know that the NSA was spying on their own citizen and their allied.

Note to self: I should write a goodread review on this one.
https://www.goodreads.com/book/show/11125.Digital_Fortress

Essentialism

Essentialism.jpg

I’ve bought the book from Charlie Hoehn recommendation. When I’ve backed his kickstarter project and he gave the backers the opportunity to tell him what they were struggling with and try to give them advice.
so here my mail

Hi Charlie,

I think my biggest problem right now is not being afraid to say no.
I say yes to everything I’m mildly interested and then I can’t keep up, it’s especialy hard saying no to my spouse and my kids.

Thanks and I can’t wait to get my copy of the book,
Chris

Is respond was swift and short: Buy the book Essentialism and keep reading it.
After reading it, I understand why he said that, the second I’ve finished the book I had to read it again.

What is it about?
It’s about focusing on your priorities instead of letting yourself get sidetracked by the bombardment of secondary demands dictating our everyday lives.
The secret is to concentrate your efforts on your immediate task and prevent others to distract you away from the job at hand.
The author states in so many words that if you don’t make the choice, others will make it for you and that someone else’s choice may mean as an example that you won’t get that report in on time.

Ready player one

Ready player one.jpg

A good friend of mine recommended this book last year, I already bought it, but didn’t get around reading it. With the movie adaptation coming out this Easter, I had to read it. In the year 2045, global oil reserve are depleted and for the many the only way to escape this harsh world is to dive in the OASIS, a virtual reality/MMO where you can play, go to school, conduct business, etc.
The creator of the OASIS, just died recently and added a easter egg in it that will give control to the OASIS.
We follow the story of the young Wade, trying to find that legendary artifact along with some friend against an evil global corporation.
If you’re a child of the 80s-90s or into video game in general you will love this one. It’s full of reference to both, pop culture and many more easter egg.

Have any of you read these book, let me know what you liked/disliked about them or learned any special.

Posted in book, inspiration, Review | Tagged 2018, book, Digital Fortress, Essentialism, List, Ready Player One, reviews, Sapien | Leave a response

How to turn a list from a select into a column of another select (Oracle) ?

By Chris on April 2, 2018

A old process we had was fetching a list from a query for each player one by one, and adding it in a excel file with other data needed on the player.  

Seeing that process was slow, we decided to turn it into a query.

If we take a close look at the model we have 4 tables, 3 that will be used in the query.

The player table (PLAYER_TABLE), the guild table (GUILD_TABLE), a job table (JOB_TABLE) and a table to link the 3 tables together call job assignation (JOB_ASSIGN). 

(note this is a simple representation, the original had around 30+ fields for each of the equivalent of the player and guild table)

What we want is to display all the info of the player and all the job the player have for each guild in one row.

So one row will look like

user_id server classname lv job list
543123 1 ROGUE 23
diplomat, carpenter, florist
34533 1 MAGE 66
alchemist, diplomat
234334 2 MAGE 34 alchemist, ring maker
776565 3 WARRIOR 5 brewer

All the job are in varchar so what we need it’s to put them in a string separated with a comma instead of having a row for each of them.

Selecting a value from another select

This is a start but the value is a string we need to make a select of the job table and get the list.

this would work for the total of job for the player.

but first we need to know how to select in a select (sql select in a select)

From Stackoverflow example:

SELECT  TypesAndBread.Type, TypesAndBread.TBName,
        (
        SELECT  Count(Sandwiches.[SandwichID]) As SandwichCount
        FROM    Sandwiches
        WHERE   (Type = 'Sandwich Type' AND Sandwiches.Type = TypesAndBread.TBName)
                OR (Type = 'Bread' AND Sandwiches.Bread = TypesAndBread.TBName)
        ) As SandwichCount
FROM    TypesAndBread

This work fine if the select return only on value per entry (player) if there multiple entry and we want to put them in a single line we need something else.

Displaying a list of result (varchar) on a single line.

If we want to display a series of string (varchar) together we need to concatenate them together.

We could try to do something with the concat method, but since Oracle 11g R2 there a another method to concatenate a sql result into a string oracle with a delimiter called LISTAGG.

SELECT job.JOB_ASSIGN_ID,

   LISTAGG( job.JOB_NAME, ',') WITHIN GROUP (ORDER BY job.JOB_ASSIGN_ID)

from JOB_TABLE job  

GROUP BY job.JOB_ASSIGN_ID;

Note: db exception on GROUP BY if your select have more than one row for job.JOB_ASSIGN_ID.

Then you can add this select has a column on the previous select where we calculated the number of job.

select u.USER_ID, u.SERVER, u.CLASSNAME, u.LV, 

(SELECT LISTAGG( job.JOB_NAME, ',') WITHIN GROUP (ORDER BY  assign.USER_ID) As userJobList

from JOB_TABLE job join JOB_ASSIGN assign on job.JOB_ASSIGN_ID = assign.JOB_ASSIGN_ID

where assign.USER_ID= u.USER_ID

GROUP BY assign.USER_ID) As userJobList 

from USER_TABLE u inner join JOB_ASSIGN assign on u.USER_ID = assign.USER_ID where assign.guildid = 12 

Note that you can put compare on column inside the inner select, that how I've separated the value per user.

Posted in db | Tagged batch, listagg, oracle, sql | Leave a response

The 20+ books I’ve read in 2017

By Chris on January 29, 2018

In January 2017 I’ve decided I would read 16 books, my goal is to hit 100 books read before I turn 40. I’ve already read 34 in 2013-2014, 26 in 2015, 12 in 2016, so I’m only 8 shorts of my goal, so I’m going to try to read 12 book this year since I’m going to have 40 this year. The rules are simple, more that’s 20-30 pages (my average is around 300-400 pages), audio books are fair game, but all book must be book I’ve never read.

1-Deep work

Having problems focusing at home and work, this book was a great way to work in a more meaningful and focused way. I’ve basically quit Twitter and facebook this year because of it. This helped the avoid distraction a bit, but I have kids and has you might know they are distractions machine. Hopefully I will manage to keep the distraction down, despite having them around.

2-Whole brain child

Interesting take on what helps a kid develops is brain in the early years. One of my big takeaway is that the amount of word that a family speak around the child have a huge impact on the kids development and that TV doesn’t count, it’s the interaction with people and the word spoken that help the child.

3-The subtle art of not giving a f*ck

A great book about life without being preachy. Just writing about it makes me realized I should reread my note about it.

4-Fahrenheit 451 (Fr)

Some friends at work kind of started a book club, they’ve already read 1984 and Brave new world so I suggested this book, which is kind of similar to the two others. It’s a classic

5-Nobody want to read your shit

Another gem by Steven Pressfield, focus on writing, but it advice can probably be applied to most creative endeavor.

6-Dale Carnegie – the 5 essential people skill (audio)

Not sure where to find the book, it a series on how to speak to your employees and colleagues.

7-Instinct de survie (French) ( or The Escapist if you want the english version)

Written by GABRIEL FILIPPI and BRETT POPPLEWELL (English version). The Escapist tells the life story of veteran climber Gabriel Filippi and his struggle with by survivor’s guilt and post-traumatic stress disorder. Probably my favorite book of the year, it becomes a page turner the second he start telling stories about is climb. Side note, I actually bought the book directly from the author at a Banff Film Festival viewing.

8-La mort d’Ivan Ilitch (Fr)

Another book from our book club at work, a classic written by the legendary Russian writer Tolstoy. While this story is really shorter that is magnum opus War & Peace, it’s still a great book. I could relate to the character, despite the story taking place 100 years in the past.

9-This will make you smarter (audio)

A create book on critical thinking, scientific method and how to address people stuck in their ways (climate change denier for instance).

10-How to talk so kids will listen…

A new version of a parenting book written in the 80’s with a new section by the daughter of the author where she talks about where it’s got her, and how she is now raising her kid.

11-Money master the game (Canadian edition. French translation)

Tony Robbin book on money, great read, a lot of principle found in the intelligent investor. Interview with investors at the top of their games. I usually try to read the original, but I got this one in French from the library.

12-Your first dollars (ebook)

Ed Dale one of (or the) authors of “the 30 days challenge,” which taught how to make a niche site in 30 days. The book seems to take elements of “the challenge” but mostly focus on the psychology of doing things. A lot of gems even if your not planning to start a niche site or business. It’s short too, less than a hundred pages if I recall.

13-The Daily stoic

The Daily Stoic offers 366 days of Stoic insights and exercises, I’ve usually read two page days every day (one in the morning and one at night)

14-Peaceful parent, happy kids

A parenting book, I might need to re-read it because we have problem getting my daughter to go to bed before 8pm

15-Barking up the wrong tree

I’m having a hard time reviewing this one in one sentence. It’s kind of a self-help book, but instead of preaching, the authors take preconception we have about success and smash them into pieces with fact and statistics.

He has a blog to that I was unaware of definitely worth reading.

16-Le horla (Fr) (Maupassant)

A classic from French literature that was selected in our book club at work.

17-Your move (ebook)

Ramit new ebook about building an online business, a lot of gem about providing value and business in our day and age.

18-Celtes et Gaulois (small 50 pages) (French)

Small Book about various aspect of the Gallic life (deity, cities, weapon, family structure and more)

19-Vercingétorix (Camille Julian) (French)

Written in 1909 by Camille Julian, this book tell the story of the leader that united the Gallic Tribes to rise against Roman occupation after Caesar thought he had Gaul in is hand.

20-La véritable histoire de Marc-Aurèle (The real story of Marcus-Aurelius) (French)

A quick book (around 160 pages) about the life of Marcus-Aurelius through letters sent by his mentor and other correspondent and though is diary call nowadays “Meditation”.

Read but not completely (skim or to short to count)

Google Analytic (3rd edition)
S.Q.P.R. (a Roman history book starting from Cicero)
Play for a living (collection of quote and beautiful artwork, was from Charlies Hoehn Kickstarter)

Hope there some book you want to read in the list, let me know what book you’ve read in 2017 and want do you want to read in 2018.

Posted in book, Review | Tagged book, List, reviews | Leave a response

SVN moving files lose history

By Chris on October 19, 2014

My coworker was moving files around in our SVN repo and we end up losing the history of the file. It seem it was because of our IDE (eclipse svn at the time), after some searching we manage to find a way to do it by using the svn command rename & move.

Doing everything by command line can be a nightmare if you are looking for a external tool Tortoise SVN should do the trick, it has the rename command and you can use Tortoise to repair the move operation.

The following will tell SVN that the new file is actually the renamed old one:

  1. Open the “Check for Modifications” Window.
  2. Mark both the old file name (listed as missing) and the new one (listed as unversioned)
  3. Right click this selection and chose “Repair Move”.

If you already lost the history on a file you really need, you can always resurrect the old file with svn copy. You “svn copy” the old version into its old place, merge the new file’s history into it then”svn move’’ this file to the new file name.

More info type:

svn help rename

in the command prompt.

Posted in prog | Tagged source control, svn | Leave a response

Next »

Tags

4hww 2018 about addiction arraylist book ClassLoaders date dating db deployment DeploymentException errors hibernate icon ideas j2ee java java.util.List jboss linux List memory motivation mysql netstat oracle port programing quora rest reviews self help soap sql star startup String struts struts tag styleClass tags to_date welcome windows

Recent Comments

  • kevin on Oracle have no Boolean, how to fix this

Calendar

February 2021
MonTueWedThuFriSatSun
« May  
1234567
891011121314
15161718192021
22232425262728

Archives

  • February 2021
  • May 2020
  • January 2019
  • December 2018
  • July 2018
  • April 2018
  • January 2018
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • November 2013
  • September 2013
  • August 2013
  • July 2013

Copyright © 2021 Some Trials & a lot of Errors.

Powered by WordPress and Hybrid.