Software engineering by Mikołaj Kania2024-01-16T00:40:12+00:00http://mikolajkania.comMikołaj Kania2023 - My year in review2024-01-16T00:00:00+00:00http://mikolajkania.com/2024/01/16/year-in-review<p>Looking back into learnings, changes and… culture.</p>
Can DVC be used for Kaggle?2022-08-07T00:00:00+00:00http://mikolajkania.com/2022/08/07/dvc-kaggle-mlops<p>The more I am working with data science, the more need for organized process I see. It can be enforced be conventions, documentation, code reviews, but as always it is automation that pays off the most. ‘Developer <em>must</em> be lazy’, as one of my teachers used to say. This is why, when I took part in another <a href="https://github.com/mikolajkania/kaggle-03-house-prices">Kaggle competition</a>, I decided to build it around more mature ideas than just experimenting in Jupyter Notebook.</p>
Kaggle2021-05-15T00:00:00+00:00http://mikolajkania.com/2021/05/15/kaggle-disaster-tweets<p>I took part in Kaggle’s NLP competition called <a href="https://www.kaggle.com/c/nlp-getting-started/overview">Disaster Tweets</a>. The goal was to predict if given tweet is about real catastrophe or not.</p>
How to run newer code on older Java?2020-04-14T00:00:00+00:00http://mikolajkania.com/2020/04/14/run-newer-code-on-older-java<p>If you ever had a situation when you were forced to stick with specific Java version due to dependant library version or (ekhem) licensing restriction, you can now breathe a sigh of relief: due to fantastic JVM community it is possible to avoid this issue! I will show you how to achieve this in simple, ready to use, project.</p>
All you need to know about String memory performance in Java in 20192019-01-02T00:00:00+00:00http://mikolajkania.com/2019/01/02/all-you-need-to-know-about-string-performance-in-java<p>Did you know that, according to Java implementators, <a href="https://openjdk.java.net/jeps/192" target="_blank">about 25% of memory</a> consumed by large-scale applications are Strings? And what if I tell you that you can decrease this value with a single command?</p>
Genetic Ranker - genetic algorithms for search2018-06-15T00:00:00+00:00http://mikolajkania.com/2018/06/15/Genetic-ranker-a-genetic-algorithms-for-search<p>Working as a search engineer myself I decided to <a href="https://github.com/mikolajkania/genetic-ranker" target="_blank">develop a framework</a> for finding optimal query weights for search engines like Elasticsearch or Solr. It is based on a machine learning branch called genetic programming, inspired by the process of natural selection. In this post I’ll describe it and briefly discuss how the good process of building the quality of search should look like. Let’s start!</p>
How to change Solr standard tokenizer rules?2017-08-27T00:00:00+00:00http://mikolajkania.com/2017/08/27/How-to-change-standard-tokenizer-rules<p>Although Solr comes with standard tokenizer implementation, which is well prepared to tokenize most of the texts, there are cases when it is helpless. Imagine a document with many numbers, of which many are followed by percentage sign. In a certain contexts it is expected to distinguish queries that refer to those percentages & plain numbers. How to achieve that? We need a custom tokenizer.</p>
Extract entities from document with Solr Text Tagger2017-03-30T00:00:00+00:00http://mikolajkania.com/2017/03/30/extract-entities-with-solr-text-tagger<p>Algorithms for recognizing entities from text are ones of the most crucial aspects of text analysis. They lead to better understanding of the content, enable additional operations like filtering or grouping and - most importantly - allow to process data automatically. In the <a href="http://mikolajkania.com/2017/02/19/how-to-add-data-to-solr-during-indexing/">previous post</a> I announced combination of text indexing & such extraction and in order to keep my promise I created a <a href="https://github.com/mikolajkania/SolrTextTagger">fork</a> of <a href="https://github.com/OpenSextant/SolrTextTagger">Solr Text Tagger</a>.</p>
How to add data to Solr document during indexing?2017-02-19T00:00:00+00:00http://mikolajkania.com/2017/02/19/how-to-add-data-to-solr-during-indexing<p>The process of indexing in Solr in an advanced topic covered by many publications. On the most basic level it can be described as putting data into previously prepared containers. But what if user wants to perform additional data processing depending on documents that already are in the index?</p>
Is asynchronous request processing worth your time?2016-10-31T00:00:00+00:00http://mikolajkania.com/2016/10/31/asynchronous-request-processing-in-spring-mvc<p>Recently, going through the Spring MVC documentation, I found a feature I haven’t previously used - asynchronous request processing. It is an addition of <a href="https://jcp.org/en/jsr/detail?id=315" target="_blank">Servlet 3 API</a> and a part of Java EE since its sixth edition from 2009; <a href="https://spring.io/blog/2012/05/07/spring-mvc-3-2-preview-introducing-servlet-3-async-support" target="_blank">Spring started support it three years later</a>. As it looks interesting (and as <em>async</em> is a popular word in developer’s journey since at least early Web 2.0 days) I decided to go deeper into details of it.</p>
What is Project Lombok and why you should use it?2016-06-28T00:00:00+00:00http://mikolajkania.com/2016/06/28/what-is-project-lombok-and-why-you-should-use-it<p>Java is well known for its necessity to write quite a lot of code to perform simple tasks: all this getter/setter methods <a href="https://msdn.microsoft.com/en-us/library/aa287786(v=vs.71).aspx" target="_blank">handled nicely by the competitors</a>, common <a href="https://i.imgur.com/y41pi4n.jpg" target="_blank">Problem Factories</a>, Calendar & Date or logging jumbo. As more languages with plain syntax arise, staying put with actual aproach seems to be a bit out-of-date. There are even some propositons to <a href="http://blog.joda.org/2016/03/var-and-val-in-java.html" target="_blank">add JavaScript’s-like val folding</a> to change things, but with Oracle’s lacking investment it is hard to believe that any changes appear in a finite time. On the other hand Java ecosystem is full of decent libraries that can fill this gap; one of this libraries is Project Lombok.</p>
What is and how to defend against a server side request forgery?2016-05-21T00:00:00+00:00http://mikolajkania.com/2016/05/21/how-to-defend-against-server-side-request-forgery<p>Server side request forgery occurs when attacker enters one application and is able to use to it to perform some activity on another application(s). It can be scaning internal network, calling services or making request to another website - our case. Note, that a hacked application would be responsible for an attack - as it produces a call! - not hacker’s machine. More information can be found on numerous sites on the Internet, e.g. <a href="https://blogs.mcafee.com/mcafee-labs/server-side-request-forgery-takes-advantage-vulnerable-app-servers/" target="_blank">here</a>.</p>
Compression modes in Solr 5.52016-04-10T00:00:00+00:00http://mikolajkania.com/2016/04/10/compression-modes-in-solr-5.5<p>The ideal situation is when whole index can be located in memory, due to disk operations are much slower then those in RAM. What’s more, often companies have to fit the requirenments of the tender or reduce server costs, which put pressure on developers to come up with a solution that will make the index smaller.</p>
Solr with VisualVM via JMX2016-03-13T00:00:00+00:00http://mikolajkania.com/2016/03/13/solr-visualvm<p>Recently I had a need to measure Solr memory usage and I decided to use free Oracle tool - VisualVM. As usual an <a href="https://cwiki.apache.org/confluence/display/solr/Taking+Solr+to+Production#TakingSolrtoProduction-EnableRemoteJMXAccess" target="_blank">official documentation</a> provides some help, but to make things simpler I extended my <a href="http://mikolajkania.com/2016/01/10/solr-startup-script-windows/">Solr startup script for Windows</a> to put all important information in one place.</p>
Solr startup scripts on Windows2016-01-10T00:00:00+00:00http://mikolajkania.com/2016/01/10/solr-startup-script-windows<p>As we all know from <a href="http://lucene.apache.org/solr/" target="_blank">Solr</a> website:</p>
<blockquote>
<p>Solr is the popular, blazing-fast, open source enterprise search platform built on Apache Lucene.</p>
</blockquote>
<p>It’s all true but on the other hand Solr is not known from its ease-of-use. In the fifth version community decided to address one of the main issues making Solr more demanding for newcomers than competition, that is simplicity of startup.</p>