<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on surus' blog</title><link>https://www.schlieper.ch/posts/</link><description>Recent content in Posts on surus' blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>&lt;a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener">CC BY-NC 4.0&lt;/a></copyright><lastBuildDate>Wed, 28 Dec 2022 16:28:02 +0100</lastBuildDate><atom:link href="https://www.schlieper.ch/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>Rusty Trader</title><link>https://www.schlieper.ch/posts/2022/12/rusty-trader/</link><pubDate>Wed, 28 Dec 2022 16:28:02 +0100</pubDate><guid>https://www.schlieper.ch/posts/2022/12/rusty-trader/</guid><description>The source code for this project can be found here.
Motivation Almost a year ago, Fireship, a great Youtube creator and developer, released a video on his channel, where he created a stock trading bot based on the inverse Jim Cramer strategy. The idea behind this being, that Jim Cramer gives terrible stock picks and doing the opposite might actually result in a positive return. I was very intrigued by this video and decided to try it out myself.</description><content type="html"><![CDATA[<p>The source code for this project can be found <a href="https://github.com/xSurus/rusty_trader">here</a>.</p>
<h2 id="motivation">Motivation</h2>
<p>Almost a year ago, Fireship, a great Youtube creator and developer, released a video on his channel, where he created a <a href="https://www.youtube.com/watch?v=BrcugNqRwUs&amp;t=132s">stock trading bot</a> based on the <a href="https://www.whitecoatinvestor.com/jim-cramer-inverse-etf/">inverse Jim Cramer</a> strategy. The idea behind this being, that Jim Cramer gives terrible stock picks and doing the opposite might actually result in a positive return. I was very intrigued by this video and decided to try it out myself.</p>
<p>Furthermore, I had been reading frequently about how US senators <a href="https://www.reddit.com/r/options/comments/n940ze/i_analyzed_9000_trades_made_by_us_senators_in_the/">tend outperform the market</a>, and I wanted to see if I could replicate this.</p>
<p>So after a few months of procrastinating, and in the wake of a project presentation for some interviews I had at Optiver, I decided to give it a try.</p>
<h2 id="the-project">The project</h2>
<p>Since I wanted to grow more accustomed to Rust, I decided to use Rust over a language such as JavaScript or Python. With a clear goal in mind, I got started with working on the integration of the Alpaca API. For this I used the crate provided <a href="https://github.com/d-e-s-o/apca">here</a>. This crate provides an integration into rust for all the endpoints of the Alpaca API. This was very useful, since I could focus on the actual trading strategy instead of the API integration.</p>
<p>To connect to the Alpaca API I used something along the lines of the following code:
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-rust" data-lang="rust"><span style="color:#66d9ef">let</span> args <span style="color:#f92672">=</span> Cli::parse(); <span style="color:#75715e">// retrieve the API key and API secret key from the environment variables
</span><span style="color:#75715e"></span><span style="color:#66d9ef">let</span> api_info <span style="color:#f92672">=</span> ApiInfo::from_env().unwrap();
<span style="color:#66d9ef">let</span> client <span style="color:#f92672">=</span> Client::new(api_info);
<span style="color:#66d9ef">let</span> account <span style="color:#f92672">=</span> client.issue::<span style="color:#f92672">&lt;</span>account::Get<span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&amp;</span>()).<span style="color:#66d9ef">await</span>.unwrap();
</code></pre></div></p>
<p>To extract the information of what trades were placed by US house members, I used <a href="https://housestockwatcher.com/">this website</a>. It provides a list of all the trades made by US house members. This was very useful, since I could extract the information I needed from the website, without having to manually extract the information from the documents in which they were submitted. I then create a request using the (reqwest crate)[https://docs.rs/reqwest/latest/reqwest/] to the API endpoint (which came to using 16 .unwrap() on 25 lines) to query the trades placed on day X. I fixed X to be about 3 days in the past, since it normally took a few days until all the trades were fully transcribed. This website was very useful, since I could extract the information I needed from the it, without having to manually extract the information from the documents myself.
The response from the API endpoint was a JSON object, which I parsed using the serde_json crate. After parsing the JSON object I extracted the information I needed from the JSON object using regex. I was interested in three pieces of information: what was traded (ticker symbol), was it a buy or a (partial) sell, and for how much was this order executed (the price). This was done using the following code:
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-rust" data-lang="rust"><span style="color:#66d9ef">fn</span> <span style="color:#a6e22e">extract_ticker</span>(input: <span style="color:#66d9ef">&amp;</span><span style="color:#66d9ef">str</span>) -&gt; Option<span style="color:#f92672">&lt;&amp;</span><span style="color:#66d9ef">str</span><span style="color:#f92672">&gt;</span> {
    <span style="color:#75715e">// regex expression to extract everything between &gt; and &lt;, which comes out to be the ticker
</span><span style="color:#75715e"></span>    lazy_static<span style="color:#f92672">!</span> {
        <span style="color:#66d9ef">static</span> <span style="color:#66d9ef">ref</span> RE: <span style="color:#a6e22e">Regex</span> <span style="color:#f92672">=</span> Regex::new(
            <span style="color:#e6db74">&#34;&gt;([A-Z]+)&lt;&#34;</span>
        ).unwrap();
    }
    RE.captures(input).and_then(<span style="color:#f92672">|</span>cap<span style="color:#f92672">|</span> cap.get(<span style="color:#ae81ff">1</span>)).map(<span style="color:#f92672">|</span>m<span style="color:#f92672">|</span> m.as_str())
}

<span style="color:#66d9ef">fn</span> <span style="color:#a6e22e">extract_amount</span>(input: <span style="color:#66d9ef">&amp;</span><span style="color:#66d9ef">str</span>) -&gt; Option<span style="color:#f92672">&lt;</span><span style="color:#66d9ef">i64</span><span style="color:#f92672">&gt;</span> {
    <span style="color:#75715e">// regex expression to extract amount given by $250,001 - $500,000 and then average it
</span><span style="color:#75715e"></span>    lazy_static<span style="color:#f92672">!</span> {
        <span style="color:#66d9ef">static</span> <span style="color:#66d9ef">ref</span> RE: <span style="color:#a6e22e">Regex</span> <span style="color:#f92672">=</span> Regex::new(
            <span style="color:#e6db74">r&#34;\$([\d+,]+) - \$([\d+,]+)&#34;</span>
        ).unwrap();
    }
    <span style="color:#66d9ef">let</span> min <span style="color:#f92672">=</span> RE.captures(input).and_then(<span style="color:#f92672">|</span>cap<span style="color:#f92672">|</span> cap.get(<span style="color:#ae81ff">1</span>)).map(<span style="color:#f92672">|</span>m<span style="color:#f92672">|</span> m.as_str())<span style="color:#f92672">?</span>;
    <span style="color:#66d9ef">let</span> min <span style="color:#f92672">=</span> min.replace(<span style="color:#e6db74">&#34;,&#34;</span>, <span style="color:#e6db74">&#34;&#34;</span>).parse::<span style="color:#f92672">&lt;</span><span style="color:#66d9ef">i64</span><span style="color:#f92672">&gt;</span>().unwrap();
    <span style="color:#66d9ef">let</span> max <span style="color:#f92672">=</span> RE.captures(input).and_then(<span style="color:#f92672">|</span>cap<span style="color:#f92672">|</span> cap.get(<span style="color:#ae81ff">2</span>)).map(<span style="color:#f92672">|</span>m<span style="color:#f92672">|</span> m.as_str())<span style="color:#f92672">?</span>;
    <span style="color:#66d9ef">let</span> max <span style="color:#f92672">=</span> max.replace(<span style="color:#e6db74">&#34;,&#34;</span>, <span style="color:#e6db74">&#34;&#34;</span>).parse::<span style="color:#f92672">&lt;</span><span style="color:#66d9ef">i64</span><span style="color:#f92672">&gt;</span>().unwrap();
    <span style="color:#66d9ef">return</span> Some((min <span style="color:#f92672">+</span> max) <span style="color:#f92672">/</span> <span style="color:#ae81ff">2</span>);
}
</code></pre></div></p>
<p>Equipped with this information, I created an order struct that contained the ticker symbol, the amount, and the type of the order. All of these orders were then added to a vector and passed to the Alpaca API.</p>
<p>To actually execute an order, I had to know how many shares I wanted to buy, which depends on the amount of money I have available as well as the current price the share trades at. This posed a bit of a challenge, since live data is not fully accessible with the free version of the API. Thus I settled on using data, that was slightly older (15 minutes) from a secondary marketplace (not the nasdaq).</p>
<p>One last functionality that I wanted to implement was the ability to get an overview of one&rsquo;s portfolio. I wanted to get the current value of the portfolio, each individual stock and the total return for each of the stock as well as the portfolio&rsquo;s standing. This was done using the following code:
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-rust" data-lang="rust"><span style="color:#66d9ef">pub</span> <span style="color:#66d9ef">async</span> <span style="color:#66d9ef">fn</span> <span style="color:#a6e22e">print_positions</span>(client: <span style="color:#a6e22e">Client</span>, cash: <span style="color:#a6e22e">Num</span>) -&gt; () {
    <span style="color:#66d9ef">let</span> positions <span style="color:#f92672">=</span> get_positions(<span style="color:#f92672">&amp;</span>client).<span style="color:#66d9ef">await</span>;
    <span style="color:#66d9ef">let</span> <span style="color:#66d9ef">mut</span> sum <span style="color:#f92672">=</span> <span style="color:#ae81ff">0</span>;
    println<span style="color:#f92672">!</span>(
        <span style="color:#e6db74">&#34;{0: &gt;10} | {1: &gt;12} | {2: &gt;10} | {3: &gt;10} | {4: &gt;10}&#34;</span>,
        <span style="color:#e6db74">&#34;Name&#34;</span>, <span style="color:#e6db74">&#34;Amount&#34;</span>, <span style="color:#e6db74">&#34;Relative gain&#34;</span>, <span style="color:#e6db74">&#34;Absolute gain&#34;</span>, <span style="color:#e6db74">&#34;Market value&#34;</span>
    );
    println<span style="color:#f92672">!</span>(<span style="color:#e6db74">&#34;=========================================================================&#34;</span>);
    <span style="color:#66d9ef">for</span> position <span style="color:#66d9ef">in</span> positions.unwrap() {
        <span style="color:#66d9ef">let</span> value <span style="color:#f92672">=</span> position.market_value.unwrap();
        sum <span style="color:#f92672">+=</span> value.to_i64().unwrap();
        println<span style="color:#f92672">!</span>(
            <span style="color:#e6db74">&#34;{0: &gt;10} | {1: &gt;12.2} | {2: &gt;12.2}% | {3: &gt;12.2}$ | {4: &gt;10.2}$&#34;</span>,
            position.symbol,
            position.quantity,
            position.unrealized_gain_total_percent.unwrap(),
            position.unrealized_gain_total.unwrap(),
            value
        );
    }
    println<span style="color:#f92672">!</span>(<span style="color:#e6db74">&#34;=========================================================================&#34;</span>);
    println<span style="color:#f92672">!</span>(<span style="color:#e6db74">&#34;Your total balance is: {:.2}&#34;</span>, sum <span style="color:#f92672">+</span> cash.to_i64().unwrap());
}
</code></pre></div></p>
<p>After a few days of working on the API integration I had a working version of the bot. I decided to run the bot on a raspberry pi, since I had one lying around. I also decided to run the bot on a schedule, so that I could run it every day at 17:30 (since the NASDAQ opens at 3:30 and I am situated in Switzerland). For this I used the crontab utility. This utility allows you to schedule tasks to run at a specific time at specific intervals.</p>
<h2 id="the-results">The results</h2>
<p>I have now had this program running for about a month. So far, the returns have not been astonishing.
I started by putting 1044$ into my alpaca account. At the time of writing this post, my portfolio&rsquo;s worth stands at about 950$, which corresponds to a loss of about 9.5%. Comparing this to the S&amp;P 500, which stands at -4.5% over the last month, we are down 5%.</p>
<p>The reason for this is up to speculation. Since US house members need to report their trades in a timeframe of 45 days, this might have an impact on the performance of this program. As explained in the above mentioned blog post, however, despite this lag, on average the members would have still outperformed the S&amp;P 500 by a considerable margin.
Another reason might just me that either the timing might be bad or that these picks are unlucky at this time.</p>
<h2 id="what-i-learned">What I learned</h2>
<p>Through this project I managed to improve my skills in rust. I got to work a lot with different APIs as well as trying out some regex for the first time (which initially was extremely painful). This is definitely one of the bigger projects of mine to this date and I hope to expand it to a point where it might be useful to other people as well.</p>
<p>I am very pleased with how this project turned out (despite the returns not being stellar) and will definitely make use of what I learned throughout this.</p>
<h2 id="what-the-future-holds">What the future holds</h2>
<p>At the moment I am working on expanding this project to track, which senators made the best trades and adjust my actions according to these statistics. This would allow me to optimize this trading strategy in the long run.</p>
<p>I am also planning to implement a portfolio tracker for some other assets I have, with the goal being to have a CLI for all purposes in the end.</p>
]]></content></item><item><title>voucherio --- Viscon Hackathon 2022</title><link>https://www.schlieper.ch/posts/2022/12/voucherio-viscon-hackathon-2022/</link><pubDate>Wed, 21 Dec 2022 16:28:11 +0100</pubDate><guid>https://www.schlieper.ch/posts/2022/12/voucherio-viscon-hackathon-2022/</guid><description>Our student association recently hosted a hackathon with the goal of creating a voucher marketplace for businesses (henceforth referred to as suppliers). The idea was to provide a platform for businesses to offer discounts and promotions to groups (henceforth referred to as seekers) and to thus simplify the purchasing of such amenities. The hackathon was a great success, with a diverse group of students coming together to work on the project.</description><content type="html"><![CDATA[<p>Our student association recently hosted a hackathon with the goal of creating a voucher marketplace for businesses (henceforth referred to as suppliers). The idea was to provide a platform for businesses to offer discounts and promotions to groups (henceforth referred to as seekers) and to thus simplify the purchasing of such amenities. The hackathon was a great success, with a diverse group of students coming together to work on the project. We were amazed at the creativity and dedication of the participants, and were proud to see the finished product take shape over the course of the weekend.</p>
<h2 id="the-challenge">The Challenge</h2>
<p>The voucher marketplace that was developed is a web-based platform that allows suppliers to create and post vouchers for seekers to purchase. Seekers can browse the available vouchers and purchase them. The vouchers can then be redeemed at the participating businesses, providing a convenient and cost-effective way for seekers to find vouchers for their events (such as this hackathon).</p>
<h2 id="how-it-works">How it works</h2>
<p>For the frontend, we used the Next.js framework to build a responsive and user-friendly interface for the voucher marketplace. Next.js is a popular framework for building server-rendered React applications, and we found it to be a great choice for this project due to its ease of use and powerful features. On the backend, we used a Postgres database to store and manage the data for the voucher marketplace. Postgres is a widely used and reliable open-source database, and we found it to be a great fit for our needs. We used the Node.js runtime to connect to the Postgres database and perform various operations, such as creating, reading, updating, and deleting vouchers.</p>
<p>Throughout the project I took on the responsibility as project lead, and I was very happy with the results. This was one of the first times that I officially took on this role and I definitely faced new challenges. As project lead it was my responsibility to make the   to coordinate between the two members working on the backend with the other two members working on the frontend. I also had to make sure that the project was on track and that we were able to meet the deadline. To do that I had to identify and follow through on the crucial parts of the project and cut out aspcts that were not necessary. One of the compromises we had to undergo was the decision for the design of the payement system, which takes on a very tedious and time-consuming process.</p>
<h2 id="features">Features</h2>
<p>voucherio has a number of features that make it a great tool for both suppliers and seekers. Some of the most notable features include:</p>
<ul>
<li>A user-friendly interface that allows suppliers to easily create and manage their vouchers</li>
<li>A search function that allows seekers to find vouchers that match their needs</li>
<li>A filter function that allows seekers to filter vouchers by category
<figure>
    <img src="/images/orders.png"
         alt="Overview of the orders page" width="600px"/> <figcaption>
            <p>Overview of the orders page</p>
        </figcaption>
</figure>

<figure>
    <img src="/images/offers.png"
         alt="Overview of the orders page" width="600px"/> <figcaption>
            <p>Overview of the orders page</p>
        </figcaption>
</figure>

One of the standout features of the voucher marketplace is the ability for businesses to customize their vouchers to suit their specific needs. This includes setting expiration dates, limits on the number of vouchers that can be purchased, and other parameters to ensure that the vouchers are used effectively.
<figure>
    <img src="/images/filter.png"
         alt="Example of the filter on offers" width="600px"/> <figcaption>
            <p>Example of the filter on offers</p>
        </figcaption>
</figure>
</li>
</ul>
<h2 id="improvements">Improvements</h2>
<p>We are proud of the work that we have done on voucherio, and believe that it is a great example of what can be achieved in a short amount of time. However, there are still many improvements that can be made to the project, and we hope to continue working on it in the future. Some of the improvements that we would like to make include:</p>
<ul>
<li>Improving the current payment system to allow seekers to purchase vouchers more easily</li>
<li>Adding a statistics page to allow suppliers to view the performance of their vouchers</li>
<li>Reworking the UI and theme the whole page</li>
</ul>
<h2 id="results">Results</h2>
<p>We are very happy with the results of the hackathon, and believe that we have created a great product that will be useful to many people. As with any other hackathon project, there are still many improvements that can be made, and we hope to continue working on the project in the future. It was a challenge, but, as always, a very welcome one.</p>
<p>We now began working with CAT, our student associations computer application team. The goal being to translate this project into production code that can be used by our student association. To do this we are in the process of reworking some of our backend code to make it more efficient and scalable. We are also working on the frontend to make it more user-friendly and to add some new features. We are very excited to see the finished product and hope that it will be a great success.</p>
]]></content></item><item><title>STARTHack</title><link>https://www.schlieper.ch/posts/2022/08/starthack/</link><pubDate>Thu, 25 Aug 2022 15:33:37 +0200</pubDate><guid>https://www.schlieper.ch/posts/2022/08/starthack/</guid><description>New year new hack. After the success of the last hackathon, we decided to attend another one. This time we decided to go for a more ambitious project. For this hackathon we, a friend group of about 15 people, travelled from Zurich to St. Gallen to attend STARTHack, hosted by the university of St. Gallen.
The hackathon This hackathon was designed to be a 36 hour hackathon. The hackathon started on Friday at 10pm and ended on Sunday at 10am.</description><content type="html"><![CDATA[<p>New year new hack. After the success of the last hackathon, we decided to attend another one. This time we decided to go for a more ambitious project. For this hackathon we, a friend group of about 15 people, travelled from Zurich to St. Gallen to attend STARTHack, hosted by the university of St. Gallen.</p>
<h2 id="the-hackathon">The hackathon</h2>
<p>This hackathon was designed to be a 36 hour hackathon. The hackathon started on Friday at 10pm and ended on Sunday at 10am. The hackathon was hosted by the university of St. Gallen and was sponsored by a few companies. Opposed the my prior experience with Hackathons, this one was backed by big names, such as Sunrise, Accenture and UNEP. The amenities were considerably bigger and (as always) included free refreshments such as mate and redbull. There was even an indoor trampoline and access to a nearby swimming pool. What was important, which we did not perceive as such at that time, was that this was primarily an enterpreneurial hackathon.</p>
<h2 id="the-team">The team</h2>
<p>We were composed of 4 people, each of them ETH students in theri second year studying computer science. In our team I was the only one with prior experience in hackathons.</p>
<h2 id="the-project">The project</h2>
<p>Out of 10 or so possible challenges we decided to take on UNEP&rsquo;s challenge. We were tasked to create a Machine Learning algorithm which, based on historical data collected in HongKong, could predict landslides at a reasonable accuracy. We approached this problem as a regression problem, where we tried to predict the probability of a landslide occuring at a given location. We used a dataset of 1000+ locations in HongKong, each of them containing a set of features such as the elevation, the slope, the moisture of the soil and the type of rock.</p>
<p>For this project we had the opportunity to work with a team of extremely talented people from all around the globe, including a Professor from the university of Hong Kong, that worked on an implementation of such a machine learning model himself.</p>
<p>To harness this dataset we introduced some data preprocessing. We first conducted some correlation analysis to isolate the values which weigh in most on the prediction. Following this we standardized the data and split it into a training and a test set. We then trained a catboost model on the training set and evaluated it on the test set. With this simple pipeline we were able to achieve an f1-score of approximately 0.6.</p>
<p>To improve on this score we decided to use cross validation to determine the optimal hyperparameters for our model. In addition we got started to feature engineer some new features. This process was a very lengthy one, as the feature generation took a lot of time to run as well as to implement it. In the end, we managed to get it to work and it delivered us an additional 10 features. Evaluating our model brought us to an f1-score of 0.7, which was a considerable improvement.</p>
<p>From then on the improvements were few and far between. We evaluated different models, such as a random forest, a gradient boosting model and a neural network. We also tried to use different feature selection methods, such as PCA and Lasso. In the end we were not able to improve our score any further. We decided to stop our efforts at this point and present our results.</p>
<h2 id="the-presentation">The presentation</h2>
<p>The presentation was a very interesting experience. We were given 5 minutes to present our project. We decided to split the presentation into 3 parts. The first part was a short introduction to the problem and the dataset. The second part was a short overview of our approach and the results we achieved. The third part was am outlook on what we would have done differently and what we would have done to improve our results.</p>
<p>Being stuck on a rather mediocre score we did not dedicate enough time to the presentation. We got very hung up on being the 4th place in the leaderboard and focused solely on improving our model, may it be by a score of 0.001.</p>
<p>This is where the fact, that this was an enterpreneurial hackathon comes into play. The judges were not interested in our model, but rather in our approach. They were interested in how we could take the model and develop an idea or a concept based on that model. We did not have a good answer to these questions and as a result we did not win our group.</p>
<h2 id="what-i-learned">What I learned</h2>
<p>This experience has tought me that it is not worth it to focus solely on the product. It is important to have a good prouct, but it is even more important to have a good direction. Perfectionism can be your downfall and being stuck on a minute detail (or rather in this case not being the top of the leaderboard) can be a very costly mistake. What we could have done, in retrospect, is take our model as-is and improve on it in a similar fashion as was done by the winners of our group. They had the idead to use the model to predict the probability of a landslide occuring at a given location using satellite data in addition to the data collected on the ground. Using these two datasets they were then able to develop a map which shows the probability of a landslide occuring.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Despite the result not being as we&rsquo;d hoped, I had a lot of fun. Spending two sleepless nights with some of my best friends is part of some of the best experiences in the past year. I learned a lot and I am looking forward to the next hackathon.</p>
]]></content></item><item><title>Viscon Hackathon 2021</title><link>https://www.schlieper.ch/posts/2021/10/viscon-hackathon-2021/</link><pubDate>Fri, 22 Oct 2021 15:33:29 +0200</pubDate><guid>https://www.schlieper.ch/posts/2021/10/viscon-hackathon-2021/</guid><description>After having finished a year of ETH I believed myself to be able to muster any problem thrown my way. After hearing from our student association, vis, that they were hosting a Hackathon at their VIScon, we signed up immediately. This was all of our first time participating in any kind of such competition and much like with this post, we didn&amp;rsquo;t really know what we were doing. I gathered four of my friends, some of whom were better programmers, and we dove in head-first.</description><content type="html"><![CDATA[<p>After having finished a year of ETH I believed myself to be able to muster any problem thrown my way. After hearing from our student association, vis, that they were hosting a Hackathon at their VIScon, we signed up immediately. This was all of our first time participating in any kind of such competition and much like with this post, we didn&rsquo;t really know what we were doing. I gathered four of my friends, some of whom were better programmers, and we dove in head-first.</p>
<h1 id="challenges-and-organization">Challenges and organization</h1>
<p>This hack was hosted at our university in the libraries and lecture halls. It started on a Friday afternoon, and we were soon introduced to the framework of this hackathon. Our task was to facilitate the life of our students through services that could be implemented by the student association.</p>
<p>I do not quite recall all the challenges that one could choose from, but this should present a rough overview:
One challenge consisted of creating a web app which, using a pretrained model, one could input the recording of a lecture, and it would present you with a summary of the contents of the lecture, cut down to a rough length determined by the user.</p>
<p>Another challenge prompted you to remake the vis poster collection and to implement new features such as a search feature.
Yet another challenge was to create an infrastructure finder application for our campus. The university does provide maps, but they are hard to read at times, do not include all the facilities and don&rsquo;t really show you the way to the desired destination. This ended up being the challenge that we chose.</p>
<h1 id="in-the-beginning">In the beginning</h1>
<p>The beginning was optimistic, as all hacks are. High spirits, free mate, beer and food were some of the highlights. We quickly got started brainstorming for the structure of our website. Once we got settled on the structure and the design, we discussed how we would implement this. We decided that we were going to use next.js, which gives us a wide range of useful features, for our application in the frontend and mongoDB as our backend solution.</p>
<p>As a team of 5 we had a good amount of manpower, we only needed to correctly split up the tasks to ensure efficient completion of the tasks. We decided to split up the tasks as follows: 2 of my friends and I would be responsible for the frontend implementation, and the other two (who were significantly more experienced than either 3 of us) would be responsible for the backend and troubleshooting the inevitable problems that would arise. I furthermore took on the responsibility as team lead and kept an overview of who was doing what and where we stood with each part of our application. We were all very excited to get started, and we dove right in.
<figure>
    <img src="/images/IMG_2906.jpg"
         alt="A picture of us working, the only team that brought an ultrawide monitor." width="500px"/> <figcaption>
            <p>A picture of us working, the only team that brought an ultrawide monitor.</p>
        </figcaption>
</figure>

I got started on creating a landing page. Drafting up a first version didn&rsquo;t take too long, little did I know, though, that this was far from the final product.</p>
<p>During the hack, we had a few mentors who were there to help us with any problems that we might have. They were very helpful, and we were able to get a lot of help from them. Among others, there was a UI/UX expert from beekeeper. He managed to give me a lot of insight on what goes into the design of a website and how to make it more appealing to the user. He also gave me some tips on how to make the website more responsive and how to make it look better on mobile devices. I was very grateful for his help and I learned a lot from him.</p>
<p>In the end, the landing page was remade/tweaked about a dozen times.</p>
<h1 id="our-application">Our application</h1>
<p>The actual application to find amenities on campus took more time. The first challenge was to get the location of the amenities. Unfortunately, the university does not provide a public API for this, so we had to scrape the data from the university website. This was a bit of a challenge as the website was not very well-structured and the data was not easily accessible. We managed to get the data though, and we were able to get the location of the amenities.</p>
<p>The orientation inside the building was the next challenge. It is VERY challenging to locate the user in a 3 dimensional space. We thought of a few different approaches, but none of them were feasible to implement. We ended up letting the user select his location himself, inputting the building, floor and closest room number.</p>
<p>The last piece of the puzzle was to find the way from our current location to the closest (functional) selected amenity. Our suggest approach was to implement a coordinate grid on top of the maps and use a pathfinding algorithm (such as A*). We quickly had to scrap the idea of actually coding this up, since that would have been  outside the scope of this hackathon.
For the demonstration, we decided to hard-code some locations and the corresponding paths. This was not ideal, but it was the best we could do in the time we had.</p>
<h1 id="the-result">The result</h1>
<p>After 36 grueling hours (and a collective amount of 7 hours of sleep over two nights) we got to presenting our finalized product. We were very proud of what we had managed to build in this timeframe.</p>
<p>When it came to the judging, we were not expecting much. We were however one of the few teams that had a working demo.
We ended up getting 2nd place in the hackathon, which was a huge delight for us. Not only that, but we also managed to snag a few wins, including best commit message, the best Lego creation and best readme.
<figure>
    <img src="/images/stats.JPG"
         alt="Awards for various aspects" width="600px"/> <figcaption>
            <p>Awards for various aspects</p>
        </figcaption>
</figure>

<figure>
    <img src="/images/best_commit.JPG"
         alt="The best commit messages." width="600px"/> <figcaption>
            <p>The best commit messages.</p>
        </figcaption>
</figure>
</p>
<h1 id="summary">Summary</h1>
<p>These 36 hours were an incredible experience for me. I managed to learn a lot about web development and got to meet a lot of new people. I am very grateful for the opportunity to participate in this hackathon, and I am looking forward to the next one.</p>
<p>It showed me that for an application to work, a lot of coding, designing, rewriting and scrapping is required.</p>
]]></content></item><item><title>Fun with integrations</title><link>https://www.schlieper.ch/posts/2021/06/fun-with-integrations/</link><pubDate>Sat, 12 Jun 2021 09:47:54 +0200</pubDate><guid>https://www.schlieper.ch/posts/2021/06/fun-with-integrations/</guid><description>In the first post of this series centered around my university degree I will be talking about integration. Now this topic wasn&amp;rsquo;t mentioned in our script but I rather stumbled upon it on youtube.
The premise is the following:
We assume that we have a function f(x) which we can integrate over the interval a to b.
Calculate the following integral: $$\int_{2}^{4}\frac{\sqrt{x}}{\sqrt{6-x} + \sqrt{x}} dx$$ Doesn&amp;rsquo;t look trivial now, does it?</description><content type="html"><![CDATA[<p>In the first post of this series centered around my university degree I will be talking about integration. Now this topic wasn&rsquo;t mentioned in our script but I rather stumbled upon it on youtube.</p>
<p>The premise is the following:</p>
<p>We assume that we have a function f(x) which we can integrate over the interval a to b.</p>
<p>Calculate the following integral:
$$\int_{2}^{4}\frac{\sqrt{x}}{\sqrt{6-x} + \sqrt{x}} dx$$
Doesn&rsquo;t look trivial now, does it?
But miraculously, it is! This whole integral equates to:
$$\frac{b-a}{2} = 1$$.</p>
<p>Let&rsquo;s take a look at another integral for fun.
$$\int_{0}^{\frac{\pi}{2}}\frac{\sqrt{sin x}}{\sqrt{sin x} + \sqrt{cos x}}dx$$</p>
<p>Can you see an emerging pattern? This is yet again equal to:
$$\frac{b-a}{2} = \frac{\frac{\pi}{2}}{2} = \frac{\pi}{4}$$.</p>
<p>We can observe that for any integral of the form
$$\int_{a}^{b}\frac{f(x)}{f(a+b-x) + f(x)}dx$$
the following holds:
$$\int_{a}^{b}\frac{f(x)}{f(a+b-x) + f(x)}dx = \frac{b-a}{2}$$.</p>
<p>Now if I were to just throw this out there I would probably get lynched by Ueli Maurer himself. Thus the proof goes as following:
We know that:
$$\int_{a}^{b}\frac{f(x)}{f(a+b-x) + f(x)}dx = I$$
This will be our first equation.
Now we set \(u = a + b - x\) and \(\frac{du}{dx} = - 1 \implies du = -dx\) by putting that into our integral we receive:
$$\int_{b}^{a}\frac{f(a+b-u)}{f(u) + f(a+b-u)} (-du) = I\newline
\implies \int_{a}^{b}\frac{f(a+b-u)}{f(u) + f(a+b-u)} du = I \newline
\implies \int_{a}^{b}\frac{f(a+b-x)}{f(x) + f(a+b-x)} dx = I
$$
Since u is only used as a placeholder variable we may rename it as x.
By adding these two integrals (which both equal I) together, we are left with:
$$
\int_{a}^{b}\frac{f(a+b-x) + f(x)}{f(x) + f(a+b-x)} dx = 2I\newline
\implies \int_{a}^{b} dx = 2I \newline
\implies b-a = 2I \newline
\implies I = \frac{b-a}{2} \square $$</p>
<p>Now you can solve some integrals very quickly and without the need of much calculation!</p>
<p>This post was largely inspired and based on this <a href="https://www.youtube.com/watch?v=BfZObnTIsYk">&ldquo;MindYourDecisions&rdquo;</a> video. Check it out for another example for an integral which you can solve with this method.</p>
]]></content></item><item><title>Exam period</title><link>https://www.schlieper.ch/posts/2021/05/exam-period/</link><pubDate>Tue, 25 May 2021 15:37:47 +0200</pubDate><guid>https://www.schlieper.ch/posts/2021/05/exam-period/</guid><description>Since I am a student at ETH I will be entering my so called &amp;ldquo;holidays&amp;rdquo; in a week. They are &amp;ldquo;holidays&amp;rdquo; since they serve as 2 months of preparation for a series of exams. During this time I will be posting the one or the other concept, algorithm or thought experiment that fall into one of four subject:
Algorithms and Probabilities Algorithms and Probabilities, or AnW for short, is all about probabilistic algorithms.</description><content type="html"><![CDATA[<p>Since I am a student at ETH I will be entering my so called &ldquo;holidays&rdquo; in a week. They are &ldquo;holidays&rdquo; since they serve as 2 months of preparation for a series of exams. During this time I will be posting the one or the other concept, algorithm or thought experiment that fall into one of four subject:</p>
<h2 id="algorithms-and-probabilities">Algorithms and Probabilities</h2>
<p>Algorithms and Probabilities, or AnW for short, is all about probabilistic algorithms. This ranged from colouring to matchings over to probabilities (expected value, variance) to flows and convex hulls.</p>
<h2 id="analyis-1">Analyis 1</h2>
<p>Analysis I is your basic Calculus course. From supremum and infimum up to partial integration this represents the main, purely mathematical part of this semester&rsquo;s courses.</p>
<h2 id="digital-design-and-computer-architecture">Digital design and computer architecture</h2>
<p>Digital design and computer architecture, or DDCA for short, deals with the essence of computers at a lower abstraction level. This ranges from simple logic gates all the way to branch prediction and memory optimization.</p>
<h2 id="parallel-programming">Parallel Programming</h2>
<p>Parallel Programming, or Pprog for short, discusses, as the name suggests, the idea of parallel programming. Starting off with manually starting threads over using ForkJoin pools to transactional memory and STM. We looked at the benefits, but mainly the flaws of each of the implemented methods.</p>
<p>During this period of &ldquo;relaxation&rdquo; I will only be posting in this format. Hopefully there will be a few interesting topics for you too :)</p>
]]></content></item><item><title>Welcome</title><link>https://www.schlieper.ch/posts/2021/04/welcome/</link><pubDate>Mon, 19 Apr 2021 19:50:31 +0200</pubDate><guid>https://www.schlieper.ch/posts/2021/04/welcome/</guid><description>Welcome to my blog. This is my first ever post and I&amp;rsquo;ll be going over what you can expect on here and how to navigate the site.
Introduction This will be a personal work where I outline interesting projects, small guides and other little quirks. The content will be mainly based around CS-related subjects as well as some interesting mathematical concepts.
Navigating this blog As any other blog this one has three components: The home page, where you will get a rough overview of the blog, the about page, where you get to find out more about this blog as well as about me and last but not least the Posts page where all of my posts will be listed.</description><content type="html"><![CDATA[<p>Welcome to my blog. This is my first ever post and I&rsquo;ll be going over what you can expect on here and how to navigate the site.</p>
<h2 id="introduction">Introduction</h2>
<p>This will be a personal work where I outline interesting projects, small guides and other little quirks. The content will be mainly based around CS-related subjects as well as some interesting mathematical concepts.</p>
<h2 id="navigating-this-blog">Navigating this blog</h2>
<p>As any other blog this one has three components: The home page, where you will get a rough overview of the blog, the about page, where you get to find out more about this blog as well as about me and last but not least the <code>Posts</code> page where all of my posts will be listed.</p>
<h2 id="what-is-this-polyring">What is this &lsquo;Polyring&rsquo;?</h2>
<p>Polyring is a webring made by <a href="https://xyquadrat.ch/">JulianXY</a>. This webring links to like-minded CS students that are currently studying at ETH too. By clicking <code>next</code> you get to the next blog in the ring, where you&rsquo;ll find yet another polyring. This is a great way to discover new high-quality blogs.</p>
<p>To finish this up, I hope that you, whoever decides to visit this, have a good time and if yout noticed something unsettling or want to contact me, you&rsquo;ll find my details on the homepage. Thanks for dropping by :)</p>
]]></content></item></channel></rss>