Posts

Showing posts from June, 2016

Manipulating data frame with Deedle in FSharp - Part 2

Manipulating data frame with Deedle in FSharp - Part 2 Today, I would like to show more functionalities of Deedle and how they can be used in a real life scenario. If you never heard of Deedle before, you can find A primer on Deedle (Part 1) here . In real life, data rarely (if not never) come in a format exploitable for analysis therefore, a first step of manipulation of data is always needed before analysis. This step involves taking data from CSVs or databases, renaming, categorizing, reordering, transposing or pivoting tables and data. Without any tools or libraries, it would be a pain to do these common operations. Deedle is a library which simplifies data exploration by providing functions to execute common manipulation on dataframes and timeseries. http://bluemountaincapital.github.io/Deedle/ Even though I went through some of the feature in Part 1 , I would like to share more features with you which are extremely useful when manipulating dataframes. This post is compo

Keep your UI framework up to date for your WebSharper SPA with Paket GitHub dependencies

Keep your UI framework up to date for your WebSharper SPA with Paket GitHub dependencies Have you ever been guilty of referencing Bootstrap in your web app just to use one feature (like the navbar for example)? Hunting for the most full featured CSS/JS UI framework for hours. Referencing a huge framework just to use one or two features. Bootstrap , Foundation , MUI or Materialize , there are so many that it takes a lot of time to find the one that fits your needs. Few months back, I started to build a prototype to manage expenses and all I needed was a navbar and a card style. Because of bad habits, I directly started to hunt for a UI framework which would provide me beautiful cards. After few hours of search, I realised how time consuming that was and most importantly how unlikely would it be for me to find something tailored for my needs. So I decided to do something that I should have done long ago - Build my own tailored JS/CSS UI framework . So today, I will share what I’

Three ways to manage your resources for WebSharper SPA

Three ways to manage your resources for WebSharper SPA WebSharper official documentation can be found here http://websharper.com/docs/resources . The doc focus more on how to reference resources for Sitelets so today, I will explain how you can reference your own js and css file and explore the different ways available to make the SPA of your dreams. There are three ways to reference files: Reference an external resource through url Reference a resource served from your own server Bundle your resources in the WebSharper compiled JS and CSS If we take a look at the files generated by a SPA under \Content we should see: \Content | |-- MyApp.js |-- MyApp.min.js |-- MyApp.css |-- MyApp.Head.js |-- MyApp.Head.html MyApp.js and MyApp.min.js are the WebSharper generated JS from our F# code. MyApp.css , MyApp.Head.js and MyApp.Head.html contain the content extracted from our resources. Each of this file is loaded in the index.html . <!DOCTYPE html

Nice features and tricks with SQLite

Nice features and tricks with SQLite For the past few days, I have been writing a lot of SQL queries to query SQLite databases. I had to extract data for reporting purposes from SQLite databases where simple SELECT-FROM-WHERE queries weren’t enough. From this experience, I learnt few tricks that I am sure some of you will be interested in. So today, I will list it all in this blog post. This post is composed by six parts: Use the built in date functions Cast your string to integer with CAST Transpose a table using GROUP BY , CASE and Aggregate functions Concatenate value with || Attach databases to JOIN on tables from different databases Improve the performance of your query with EXPLAIN QUERY PLAN The parts aren’t related with one another. 1. Use the built in date functions strftime is the main function for datetime manipulation. It takes a format , a string date and some modifiers . Here are the format extracted from https://www.sqlite.org/lang_datefunc.html . %