tag:blogger.com,1999:blog-22793433966835000312024-03-14T14:16:22.569+03:00caught Somewhere In Time = true;A blog about programming and yes it is caught somewhere in timeSezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.comBlogger157125tag:blogger.com,1999:blog-2279343396683500031.post-78045464331683955722023-10-03T16:15:00.010+03:002023-10-03T16:49:23.011+03:00SQS listener in your Spring Boot projectI was adding SQS listener support to our spring boot based microservice and I realized that most of the examples online are for old versions of spring boot (2.x) or aws starter and I had few problems with dependencies etc so I wanted to prepare this small tutorial for people having similar experiences. The most complete one I could find was this one but lack of local running SQS is a Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-7577591349544748002020-10-24T18:38:00.005+03:002020-10-24T18:38:45.934+03:00docker tutorial part 2 - the good the bad and the ipIn this second part of docker tutorial, I'll explain basics of networking in docker with stand-alone containers. Remember from the previous part of the tutorial where we mapped port of our host machine and the container? In this part, we will setup our containers so they can communicate with each other and for that we don't need to do an explicit mapping like we previously did with -p Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-41383698017798860222020-10-13T22:54:00.002+03:002020-10-13T22:54:26.487+03:00docker tutorial part 1 - fistfull of containerIn this docker tutorial series, my aim is to explain basics of docker and to do that with min number of words but maximum number of examples. Before doing anything I want you to install docker on your machine and I hope you have an idea what docker does. If not please check docker.com.Now let me explain two basic things related to docker:image: File to be used in docker container. You may have a Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-8318759407350581562020-09-08T01:24:00.000+03:002020-09-08T01:24:02.189+03:00best intellij idea plug-insI've been using Intellij Idea as IDE for some time and wanted to share my favorite plug-ins as I think they can be quite useful for every developer out there. Without a specific order here they are:Key Promoter X: Although its name's like cheap midi controller, it is a really useful plug-in for those who want to master intellij idea shortcuts. It shows notifications for almost each click you do Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-51061782358566980782020-07-19T15:08:00.002+03:002020-07-19T15:11:03.845+03:00how to publish jar to maven centralYou created your brand new project and you want to release it to maven central so people can use in their maven based project. It is not a really straightforward thing to accomplish so I wanted to write a step by step guide on it (based on this stackoverflow post). -Create your jira account on sonatype-Login to your jira account-Create a ticket for your project: For this step you will need aSezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-57485362828323085132020-05-12T10:17:00.000+03:002020-05-12T10:17:37.844+03:00java puzzlers from oca part 7
In this part of the Java Puzzlers from OCA series, I will show multiple ways of defining Strings and potential surprises related to that.
Two basic types of creating Strings are creation with new keyword, and by just using the string literal.
String strWithNew = new String("hey");
String strWithLiteral = "ho";
As Strings are frequently used JVM uses a string pool and use the values in it so Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-33750591071540380512020-05-09T15:25:00.001+03:002020-05-09T15:25:12.348+03:00java puzzlers from oca part 6
Even for new Java developers, constructors are probably no big mystery.
In essence, when you create an instance of a class, the constructor of this class is started.
In the 6th part of Java Puzzlers series, we will see a case related to constructors.
public class Puzzler {
public Puzzler(){
System.out.println("Puzzler no arg constructor");
}
public static void main(Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com3tag:blogger.com,1999:blog-2279343396683500031.post-58356739014909620702020-05-09T15:25:00.000+03:002020-05-09T15:25:00.970+03:00java puzzlers from oca part 5
In the fifth part of the Java Puzzlers series, we will see something related to X.parseX(String s) methods.
You can see what we expect from X.parseX() methods.
public class Puzzler {
public static void main(String[] args){
int i = Integer.parseInt("2");
System.out.println(i); // prints 2
}
}
We give the methods a String that can be converted to the primitive Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-52290535109344319982020-05-02T08:02:00.000+03:002020-05-02T08:02:15.301+03:00java puzzlers from oca part 4
In the fourth part of Java Puzzlers, we have something related to char type.
public class Puzzler {
public static void main(String[] args){
char myChar = 'a';
myChar++;
System.out.println(myChar);
}
}
You may have guessed it. It will print "b" and the reason for it is that char type is unsigned numeric primitive in the disguise of a character. So if I add Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-18309356854566476142020-05-02T08:01:00.000+03:002020-05-06T14:54:36.171+03:00java puzzlers from oca part 3
In this third part of Java puzzlers, we will see a surprise in variable naming restrictions.
If I show you this, I'm sure you won't be surprised that this does not compile.
static is one of the reserved keywords so why should it work?
public class Puzzler {
public static void main(String[] args){
int static = 2;
}
}
Now I'll ask you a more difficult one. What you think Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-86029151281749695072020-04-19T21:46:00.000+03:002020-04-20T18:20:38.242+03:00java puzzlers from oca part 2
Welcome to the second part of Java Puzzlers from OCA. In this part we will see an interesting case about the underscore separator in numeric literals which came with Java 7.
In the below class you can see the separator underscore in the decimal literal.
Also notice the class compiles now without a problem. Octal is the octal representation, binary is the binary and I'm sure you can't guess hexSezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com1tag:blogger.com,1999:blog-2279343396683500031.post-47311276356223528282020-04-18T12:47:00.002+03:002020-04-18T12:48:40.753+03:00java puzzlers from oca part 1
I'm reading Oracle Certified Associate Java SE Programmer book from Mala Gupta in my spare time and I'm surprised with some of the new things I learn. Some of the time they really don't make sense, some of the time they make sense but really surprising to see. So in this article series, I wanted to share them as "Java Puzzlers" which sounded much cooler than "Java Surprises".
Lets check the Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-1820612595678479592020-03-05T15:48:00.001+03:002020-03-05T15:48:24.618+03:00scripting with painless language
Recently I've been working on a complex scoring function in Elasticsearch and stumbled upon this really cool article for painless language. Very well prepared and easy to understand.
Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-68854744701967928202020-01-18T14:56:00.000+03:002020-01-18T14:56:11.481+03:00lambdas and streams master class
If you want to master lambdas and streams from Java 8 & 9, you can check these java koans. That's one of the best koans I could find for a deeper learning. Also there are two videos on these koans: part1 and part2.
Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-27637827698049392952020-01-07T12:39:00.000+03:002020-01-07T12:39:31.553+03:00send your data async on kafka
For a project, I'm trying to log the basic transactions of the user such as addition and removal of an item and for multiple types of items and sending a message to kafka for each transaction. The accuracy of the log mechanism is not crucial and I don't want it to block my business code in the case of kafka server downtime. In this case an async approach for sending data to kafka is a better waySezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-6186075314858549262019-12-02T14:00:00.000+03:002019-12-02T14:22:10.587+03:00spring annotations i never had the chance to use part 2: @ConfigurationProperties
Few days ago, I accidentally stumbled upon a Spring annotation from Spring Boot project while I was checking something else.
We all know how to bind property values with "@Value" to the classes and we all know that this can be quite cumbersome if there are multiple properties to bind. Spring Boot is here to help. You can use "@ConfigurationProperties" and bind multiple values quite concisely. Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-40773499449831862992019-10-23T15:15:00.000+03:002019-10-23T15:24:26.608+03:00benchmark for new string methods of java 11
While I was checking what's new in Java 11, I saw that there are several new methods for String class. So I wanted to do a microbenchmark with old way of doing things and by using new methods. These new methods are;
boolean isBlank()
String strip()
Stream lines()
isBlank() is tested agains trim().isEmpty(), strip() is tested agains trim() and lines() is tested agains split().
Here are Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-66877100841045070332019-02-12T19:43:00.001+03:002019-02-12T19:43:55.450+03:00cool elasticsearch client
I was searching for an elastic client so I can have auto-complete for queries and a graphical way of seeing how things are going for our test elastic servers. Few years ago we had Sense plug-in which I think now a part of Kibana. After a little googling, I found head plug-in for chrome and it is so cool. I highly recommend it to everyone with this kind of need.
Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-24991476890707034352019-02-08T12:52:00.001+03:002019-02-08T12:52:24.155+03:00simple introduction to CAP theorem
Yesterday I discovered a beautifully written introduction to CAP theorem. Thanks to Kaushik Sathupadi for this.
Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-4168257312327434532018-06-19T13:39:00.001+03:002018-06-19T13:43:56.668+03:00machine learning ass-kicking in java part 2
Welcome to the second part of the tutorial for scoring your PMML files using LightningScorer, which is a side project of mine.
Let's find out how additional parameters work.
The initial steps are similar to the first part of the tutorial.
Get your local copy first
git clone https://github.com/sezinkarli/lightningscorer.git
and build it with maven
mvn clean install
and start it by Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-28937323167615895712018-05-28T15:50:00.000+03:002018-05-28T16:05:43.724+03:00machine learning ass-kicking in java part 1
You searched for some way to export your machine learning models so you can use them for evaluating your data and you see that you can export them in PMML format. You actually work in Java ecosystem but not motivated to write neither your PMML library nor an rest api for it. Then I will recommend you LightningScorer, which is a side project of mine.
Let's take you a tour for deploying, andSezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com4tag:blogger.com,1999:blog-2279343396683500031.post-88955207662229078292018-05-12T15:29:00.000+03:002018-05-12T15:30:01.537+03:00lightningscorer - blazing fast pmml scoring web service
I've been working on a side project lately dubbed "LightningScorer". You can basically deploy your PMML files (which is the xml language for machine learning models) and score them with your inputs. My main inspiration was Openscoring project and I'm quite happy to build something faster than that. LightningScorer is lightweight and easy to use.
Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-1826500660244086632017-05-12T15:41:00.000+03:002017-05-12T15:45:13.655+03:00custom deserialize your field in jackson
Currently I'm doing an integration to a third party service api. I had a trouble while trying to deserialize a field as a Date. Their json contains a date field with an odd formatting. e.g. /Date(1494579066000)/
So I have to deserialize it into a date by taking the number between paranthesis, then casting it to a Date object.
Here is my model for json
public class Result implements Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com1tag:blogger.com,1999:blog-2279343396683500031.post-23293514932757418112017-05-03T13:38:00.001+03:002017-05-03T13:38:40.259+03:00web sessions
eloone wrote a beatiful article on web sessions and I think that's a fine reading for everyone who wants to learn more about web sessions or for those who forgot its details.
Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0tag:blogger.com,1999:blog-2279343396683500031.post-47577020813809625672017-04-21T17:41:00.002+03:002017-04-21T17:43:11.048+03:00org.openqa.selenium.WebDriverException: cannot get automation extension
In our current project, we write CI tests using Selenium. But several weeks has passed since I wrote a new test and there goes a nice exception while running the old ones.
org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension
Doesn't explain much, right?
I find the solution in upgrading my chrome driver.
Sezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.com0