Check out this great chat client written in q/html with less than 50 lines of code. The author, Stephen Peck, describes it as “Persistent group chat in <50 lines using kdb+/k/q web sockets and JS”. You only need a working version of q/kdb and a browser to get it started. You can find the code …
Category Archives: q/kdb
Challenge#2 Reverse words in a phrase
Sorry for the delay in coming up with a new challenge. It’s been a busy few weeks. Last challenge was about partial sort. This week’s challenge will be about reversing words in a phrase. It’s a common challenge and many of you have probably seen it already. Task: Given a string with some words, produce …
Using functional forms of amend
In one of my previous posts, I talked about functional forms of select, exec, update and delete. I also briefly touched on the importance of functional queries and why you should get used to them as much as possible if you are serious about q. In this post, I will talk about functional forms of …
Challenge#1 – Partial sort
One of my colleagues recently introduced me to Project Euler. Project Euler is a great way for you to solve mathematical problems using your preferred language and then compare your solution with others. However, I noticed that most of the problems there were not practical for q. Many were designed to use loops which are …
Generating the fibonacci sequence
I am going to assume that you all know what is a fibonacci sequence (FS). If you don’t, you can read up about it here. In my last post, I talked about using the adverb over. In this post, I will show you how over can be used to generate FS. Main thing about FS is that you …
Scan and Over – iterating through lists
One of the first things I was told by my ex boss was to never use for/while loops unless it’s a matter of life and death. And he was dead serious. I had just taken two c++ classes in college so wasn’t sure how I would be able to replace for/while loops. They are easy …
Functional queries
I used to hate functional queries. Part of me still does. They are hard to write, look like gibberish and not as simple to understand as qsql queries. I can’t believe I am saying this but as you get more familiar with q, you start seeing their advantages and point of their existence. q is …
OOP concepts in q
Many of my friends (almost 90%) are programmers…object oriented programmers. They also have much more experience in programming than I do. Many of them have at least 4+ years of experience than me. I always hear them engaging in discussions about OOP concepts and to be honest, I feel left out sometimes. I have never …
qSQL queries for performing analytics
I realize that there are many developers out there that are not looking to get into q completely and are simply using q/kdb+ along with qsql to perform analytics (i.e. quants). My job requires all of this so I have some good experience running qsql queries. Of course, the type of query you need to …
Joins in kdb+
If you have spent some time working with kdb+, there is no doubt that you have had to use some sort of join in your query. Joins are essential to data analyzing. kdb+ query language is called qsql which, as you probably guessed by name, is based on popular query language, SQL. I don’t have …