#3 dexonline – Approximate search using trigrams

As I mentioned in my last post, during the last two weeks I have been changing my first implementation, giving up the idea of a filter applied on the suggestions found by the classic levenshtein.

Now, my implementation went directly into the mysql UDF. I made a matrix with the distances between each letter on the keyboard: 5 for neighbour letters on the horizontal, 10 for the ones on the vertical and 15 for the rest. Then, I have the following rules, instead of the classic +1 in the levenshtein algorithm: I add 5 for a missing letter, 5 for switched letters, and for typing the wrong letter or an extra letter 5, 10 or 15, depending on the distance.

The algorithm is not 100% perfect, it has some bugs on some searches, because there are some particular cases for which I haven’t found a rule. But overall, I tested it with 2500 searches from the log and the resulted suggestions are pretty good.

In the following days, the code will be put online, and step by step, an increasing percentage of searches will use it, in order to test its functioning.

#3 Webkit – Particle System

Since my last post I have completed the program for point particles (no textures). I have a little problem with the compiling of the opengl functions, but nothing that cannot be fixed. I have added a function for textures, but it isn’t ready.

The code can be found on Github, but if anyone wants to download it, you should wait, because next week I will put my final commit:

https://github.com/vlad-iordanescu/Particle-System.git

Next week I will start adding my program to the Webkit source.

#3 vmchecker

The last two weeks have passed very quickly.

I have made some changes to the user interface.

I have changed the menu.

It is a dropdown menu now.It wasn’t very easy for me to implement because I am  new to css.

The menu doesn’t change anymore when you access the teacher interface from the admin interface.

I have added the feature that Laura requested.

It still has some bugs that I have to fix.

You can now select the course and homework you want to work with before you start grading.

The script saves the informations in a cookie for 10 hours.

Before you start grading, when you press on “Noteaza” you have to select the course and assignment. I have added a dinamically filled dropdown too.

I have made a workflow in order to know exactly what I have to implement in the coming weeks and to get to a consensus with my teacher about the application.

I have made a better modularization of my code.

The link -  [0] , user – [1] and password [2] are the same.

[0] https://elf.cs.pub.ro/vmchecker-rsoc/login.php

[1] administrator

[2] administrator1

#3 – [WHC] Weekly Report

Did you know? Qt is the best C++ framework fro writing cross-platform application.

As I promised, this report will be mainly about Project Compilation in WHC IDE. When i said about it on previous post, I didn’t think that it won’t be that complicated.
First of all I didn’t know anything about how to run a program inside of another program (some sort of inception, i know :) ) , but Qt helped me a lot by providing a really useful thing: QProcess – class for running shell commands and executables.
And here comes the first big challenge: Running make inside of my program made my application simply freeze, until make is done. Here i learned a lot about running QProcess in synchronous mode and and asynchronous mode. Asynchronous mode is a little bit tricky, and requested me to make a “ring” of 3 methods: configureTask, makeTask, nextTask.
It worked really nice and even porting it to windows wasn’t that hard, only replaced make with nmake and set some specific options for each OS.
Second big challenge was to fix, or maybe to re-implement ProjectTree. It didn’t provide some options and after operating some changes on project tree, i must reload the project. Building a big tree over and over again isn’t reasonable if you have a lot of source files and since i didn’t manage to fix the old one, i build my own ProjectTree. With the old one even deleting files ran in O(n lg n)- because i was forced to find that files. Now all operations Add Task/ Add File/ Delete File/ work in O(lg n), where n is the number of files.
The third and the last big challenge: Setting cmake paths for Windows. Well Then i tested last week, WHC IDE was build using cl(Visual Studio Compiler in QtCreator) and everything worked just fine, but when I tried to compile it with minGW, cmake wasn’t able to configure because “cl” was not found. So I started to add environment variables to QProcess. I wasn’t able to find out what variables are requested and after few fails I added all extra 16(!) from Visial Studio Command line … after successful configuration, i was able to reduce their number to 9. Everything that work so nice and well on Linux, end up in the worst way on Windows.
But I’ve managed to do all of this and I’m happy.

So, WHC IDE got these new options:
- Build all task in a separate build folder
- Clean all
- Faster and better Add Task/ Add File/Delete Selected options for project management

Next weeks, I’ll work on Diagram View, part that let the user configure tasks and assign inputs and outputs, according to my mentor’s opinion, this is the most difficult part and it will require some time to make it. Hope Qt will help me one more time and provide some useful classes so i wouldn’t need to implement all by myself.

My colleague Cosmin, also want to tell you something:

Hello, in this report I will write about saving project and some problems that occurred during highlighting the code.
Basically, for saving project I had to create a listener which activates a method whenever someone tries to close a tab, or the main window. Those methods act like triggers, also as explicit save button.Then I iterate through unclosed tabs and save the ones that are not saved.
The problem with text highlight is that Windows 7 does not always support the actual implementation, for example on my computer it doesn’t work, but on my colleague’s it does, I also read on some forums about that and it seems that the OS is the problem.
Another problem was that some libraries were included in .cpp files, when I tried to move them I received an error completely irrelevant(; missing), the solution was to declare the prototype of some classes at the beginning of the .h file.
There is also the problem that currently the program does not load in memory the highlight rules but load them every time a tab is opened, that causes a little bit of delay especially for languages with a large number of keywords(OpenCL).
I hope that I will finish the other projects that I’m working on soon and implement the things that I have in mind, one of them is swap files, the other is to complete highlight(load the highlight rules in memory) and a interface for editor.
See you on next report, I hope with better results :)

#3 dexonline – Games

The last 2 weeks were rather different than what I expected.

College tends to introduce one in a rather large array of tools for use in development. I always had a tendency to believe tools should be kept at a minimum and concepts should stand at the core. I still believe I am right in this matter…

And now the “but”… in a development process one needs to use a lot of tools (and unlike college, all of them at the same time), this also was the case with DEX, which uses a wide array of tools for it’s tasks, from the standard php, apache, mysql to smarty and other interesting toys. What I didn’t expect was that I would be the one to introduce a new tool, unfortunately I have to.

The tool that I introduce has at first glance no connection between it and a web development process or a game, but somehow the knowledge I gathered in college comes in handy. I will add antlr (Another Tool for Language Recognition). I need it to parse the definitions as I mentioned in the previous post.

What it does?

Well a definition has a bit more data than one needs. It has type and the place where the word comes from and a number of example of uses and meanings for each. What I need for the games I’m making is just one simple definition for just one meaning of each word. So I parse the large definition and extract what I need. This is harder than usual because definitions don’t have a very strict syntax like is the case with a programming language and the grammar I am writing needs to accept as many variations as possible. Not to mention that different dictionary’s have a different syntax and a grammar is needed for each of them.

#3 Apache HBase – Extending the current web UI

I believe that the things on the past two weeks went pretty well.

 

I managed to solve most of the bugs on the shell. Currently there is only one bug which occurs when the user tries to evaluate scripts that contain infinite loops.
To resolve this problem I will try to create a daemon which loads the ruby sources and I will try to count the evaluation. In this way I will be able to kill the process if the evaluation
takes too long.

 

Besides solving the bugs I’ve done these shell improvements :
  • build “resize” method (this one allows the user to resize the shell)
  • build “timeout” method (this one allows the user to extend the request timeout)
  • build “start” and “stop” methods (these will be used if the shell access will be based on a whitelist)
  • there are three options to display the output :
      1. paginated output (behaves like the unix command “more“)
      2. scrollable output (without history)
      3. scrollable output (saving shell history)
  • the user can enable or disable the webshell configuring hbase-site.xml file.

 

Also I exposed on the interface information about the cluster state which will be used to debug problems that will occur. For this I created a JS which use a AJAX request to get information from a servlet. The servlet instantiates a java class which evaluates “hbck” script, captures its output and returns it to the script. When the response is complete I expose the information on the front page. In this way the call method is asynchronous and the information is exposed only when it’s complete.

 

So I think that I sticked to the schedule. I still have to solve that bug, but I’ve already created that daemon and the engine that runs it and captures its output. However there are some details that I hope I will solve by Tuesday.

#3 Chat, improved communication

In the last week I have started to prepare for the mid term, just like I said in the application schedule. I have spoken with my mentor, and we have decided that my code should be refactoring.

I began with removing the reuses functions and then to create new functions for the duplicated code. I removed the show and hide buttons from global chat and I decided to put the chat in the page.

It was easy work and now everything looks pretty nice [1]. Meanwhile, I resolved all bugs and finished all features that I mention in the preview post.

The testing process continues to be local, but I have started to follow some tutorials in order to make a unit test.

I’m still in the schedule, and right now I am creating the contact box. I will come up with a new post at the end of this week and I will talk more in detail about it

#2 Kreator – reveal.js slide tool prototype

It’s been awhile since the last blog post and I have made a lot of progress with the project. Now you can actually download your presentation in a nice .zip archive, all packed with the css and js you need for your viewing pleasure. Nodejitsu entered public beta and being on the waiting list for pretty much 6 months I got an account right away, now the app is also online at here it’s very much up to date, I deploy a new version every time I push updates to the github repo.

A roundup of new features

  • Settings, allowing you to customize background color and default font size
  • Download button
  • Presentation mode in fullscreen (preview for the presentation)
  • Updated the code to the latest reveal.js version
  • Now with nodejs backend goodies
  • A lot of bug fixes

An issue I am currently having is with the user images. The server does not store any content from the slides, it just receives the content adds it to the archive and sends it back your way and I would like to keep it that way for images too. It would be a scalability problem if many images get added at once or even privacy issues. One solution might be to upload the images to imgur when the user adds them to the slides and embed the url or use imgur as temporary storage given that the API provides you with a delete url.

User settings are not available in the downloaded presentation, but they will be soon enough I plan to add a custom css file where all the options will be saved. This file will be created from scratch when the user requests to download his presentation. I need to find a CSS parser of some sort that converts JSON to CSS rules.

Templates would be a nice feature but I’m not sure if I will keep them since you can customly move elements around and position them wherever you like, making it a much for flexible option.

Custom fonts are still on the list. Google Webfonts exposes an API so it is just a matter of making the UX easy for the user to understand.

The backend uses NodeJS, I use 0.8 on my localhost and 0.6 on the server. ExpressJS for routing and templating (ejs module for parsing html, quick and dirty, I will rewrite the template in jade but that is not a priority), requestjs for fetching the different files that go into the archive, node async to make sure those request happen in the correct order and node-native-zip to create the archive.

That’s about it, hope I will manage to accomplish the things I discussed here until my next blog post <3

#2 Webkit – Particle System

The progress in the past two weeks has been steady and on schedule.

I have written the source code for a basic particle system with points, textures will added in the near future. I also worked on the a couple basic movements, for example:

- expanding from a point

- a ripple effect(like in water)

- a curve or straight line between two points

- a random movement on the screen

I also included some room for customization, like size of the particle, the color(or transition between two colors), movement speed(some basic accelerating and decelerating effects).

I wrote the rendering file for a standalone product to test the behavior of the particle and fix any bugs that could appear.

The next step is to include this particle system with webkit and expand it.

#2 – vmchecker

This is my second post on my vmchecker project and I can say that things are going pretty well.

I have understood how vmchecker works and what scripts are most important for my project.

I have changed a part of the user interface.

The add new course function works, but I have to add the change holidays option.

I had problems with modifying the course config file and calling the script that initialises the course storer, but I mostly solved them.

I have made a working grading system, but I still have some security issues. The grading system consists of three search boxes with suggestions.

  • The first one has to match the name of the course directory.
  • The second one has to match the name of the assignment directory.
  • The third one has to match the name of the student.

I have made a script that changes the vmchecker.vmr containing  the grader comments and grades, which will be available to the student.

It has a dinamically add text box and select, when pressing  the “Add” button. You can also  remove some of them by pressing the “Remove” button. You can view your changes in the grade.vmr file by pressing the “Vizualizare comentarii si punctaje” button.

I have also started working on the add new assignment function. I have implemented the required text inputs and a search box with suggestions that get you the course in which you want to add a new assignment.

I have added my code on github: [1]

You can also see my project on: [2]

The username is “administrator” and the password is “administrator1″.

I have also started  a documentation for vmchecker because it doesn’t have a very good one at the moment.

[1] https://github.com/cosmin1123/vmchecker

[2] https://elf.cs.pub.ro/vmchecker-rsoc/login.php