This week started with the previous bug only in which the clang-format was showing unusual indentation style for a block of code:

BLayoutBuilder::Group<>(this, B_VERTICAL)
		.Add(new BSeparatorView(B_HORIZONTAL))

But the expected output was:

BLayoutBuilder::Group<>(this, B_VERTICAL)
		.Add(new BSeparatorView(B_HORIZONTAL))

As previously I have send a commit which was giving expected output but it was correct results only for already correct code , but in cases where the initial indent is incorrect, it doesn’t fully fix things. So, it was little bit complex task it took 2-3 days to correct this and then I send a commit. But mentor was ill so he advised me to ask other people on the haiku forum to test the changes on different pieces of code and report the problems they find? So, along with this directory I send the commit for other directories also.

Then they asked me to correct one thing. The .SetInsets line was not getting aligned correctly. I just spend 2 days into this but got output like this:

               B_USE_WINDOW_SPACING, 0)

But the expected output was:


This week ended with solving  indentation of BLayoutBuilder blocks (where we usually have an indentation level for each AddGroup).


This week started with solving the same bug as of Week-3 in which an extra indentation was added befor ++ operator like:

for (itr = fMouseSettingsObject.begin(); itr != fMouseSettingsObject.end();

As per my mentor, I need to find the better solution. But found nothing and told my mentor I am not able to proceed for this bug. After my mentor look into that previous bug but same he also didn’t find anything. He also looked at changes in llvm 12 (newer version) in case there was a related bug fix there, but didn’t see anything that seems related to our problem. So, he adviced me to ask about this bug on llvm mailing list. So, I just ask my problem there and side by side started working on new bug in which the clang-format was showing unusual indentation style for a block of code:

BLayoutBuilder::Group<>(this, B_VERTICAL)
		.Add(new BSeparatorView(B_HORIZONTAL))

But the expected output was:

BLayoutBuilder::Group<>(this, B_VERTICAL)
		.Add(new BSeparatorView(B_HORIZONTAL))

This issue was discussed during the review period. As per the discussion the conclusion was that this case needs some specific handling.

Options to solve this are:

  • Have some very specific code to detect the use of BLayoutBuilder and the specific indentation it needs
  • Annotate the sourcecode with some comments to tell clang-format to not touch this part of the code.

As the haiku code contains number of such block, so it will become messy to use clang-format off. So, I just proceed with first option and started working on this and after spending 2-3 days the code was working fine for the file I was using for testing. But as soon as I run the clang-format on the directory I see some unusual changes.

After looking into those changes I found that every file is following some different style and indentation for same code. It was difficult for me to find the correct one. So, I just call for a meet with my mentor and discuss these changes and found the correct one so that I can proceed. Then I just show my changes to her and said theses are right and asked me to push the code and after that other developers can have a look.

I just rectify my code and send a commit and send this to my mentor for review. He told me to clean tha code and change the class name. Doing these changes, I just send a commit.

This week ended with this. 🙂


Yeah yeah, now I am done with the bug discussed in the last post. The problem was that the code was not working for the statements which contain loops inside them like

    while (Top == 0) {
       cout << "fasdfsfsdfsfsfasfasdfsaTdsjfhkjdshfkjdshfsjkdhfsfasfsdfsad"
				 << endl;

This else should be within braces as it contain more than one statement. I worked on it for 2-3 days of week-3 and was able to just add opening brace( { ) at right position but not able to add closing brace( { ). I tried different ways but was not able to find a solution. Then, I contacted my mentor and show him my code and then he look into my code and solved it. Then I came to know that the problem was I didn’t remove the old version code properly, after that my mentor merge my base code for this bug and also send a new commit with removing “redundant braces remover” code.

With that this bug got solved and then I move on solving next problem in which an extra space was added before ++ operator in for loop like

for (itr = fMouseSettingsObject.begin(); itr != fMouseSettingsObject.end();

Then, I confirmed from mentor and he said we need to remove that space only and there should be only 1 tab. Then spending a day on this I send a commit to my mentor on which my mentor asked me to find that function which is adding the space instead of overwriting that function.

Then I start looking for that and again send a commit but my mentor suggested me that there can be much better option than this and suggested me to look into ContinuationIndentor.cpp file which will contain some function which is violating our defined options style configuration which were

UseTab set to UT_Always so even if it tries to do alignment, it should be using only tabs. set bracket style to BAS_DontAlign so it should not be aligning things this way.

As it was always aligned with the parenthese instead of using one tab level. Then I started looking for that function and started to work on it. Hope to get this solved as soon 🙂

How to Install Composer and PHP on Windows 10

Download and Extract PHP

Go to the Windows PHP download page and download the .zip of the version of PHP you require. In this guide, we are installing PHP 8.0 (8.0.7) x64 Non Thread Safe, which is the latest version as of writing (2021-Jun).

Once downloaded, create a new folder in c:\php8 (or wherever you prefer) and extract your PHP zip to it.

Download and Install Composer

In the second step of Composer Setup, make sure the correct path to php.exe is set and click Next.

If Setup prompts to create php.ini, allow it and click Next.

Skip the Proxy URL settings, just click Next then click Install.

Click Finish once install is complete.

Test PHP

If you have any Command Prompt windows currently open, close them now.

Open Command Prompt, type php -v and press Enter. You should now see the PHP version.

If it returns a PHP version, you can move to next step to test Composer.

If you get an error “‘php’ is not recognized as an internal or external command,
operable program or batch file.”, you may need to Add a Path Environment Variable.

Test Composer

Open up Command Prompt and type composer -V.

If all was installed correctly, you should see a version number.

Hurrah! You can now run Composer and PHP on Windows 10.

If you find any errors above, please comment below:)

GSOC Days Week: 2

So, after solving a basic issue I moved on to next issue in which the braces were not added when control statement like if, else consists of more than one statement. For example:

if (acceptFirstClickBox)
	= acceptFirstClickBox->Value() == B_CONTROL_ON;

So, this should be like this according to Haiku guidelines:

if (acceptFirstClickBox) {
	= acceptFirstClickBox->Value() == B_CONTROL_ON;

So, I searched and tried different ways but nothing worked. I have once send a mail to LLVM regarding this issue. But at that time they said it is impossible for clang-format. But in this week I got mail from them with a solution of this bug. I didn’t wait at all and started testing it. But it was not working so it took me 2 days to made it run according to my expectations. Then this issue got solved but later on I was testing it, I found one problem that it was not working for the statements which contain loops inside them like

    while (Top == 0) {
       cout << "fasdfsfsdfsfsfasfasdfsaTdsjfhkjdshfkjdshfsjkdhfsfasfsdfsad"
				 << endl;

This else should be within braces as it contain more than one statement. This code was failing for this situation. I tried different ways but nothing works till now.

Will meet in next blog with the solution. 🙂

GSOC Days Week: 1

The results were announced on May 17th and from then to June 7 was the Community Bonding Period. Which means that you need to interact with the mentors, with the organisation and get to know how they work. But we had done this already during the review period so we continued working. 

During review period, I was working to solve the problem of unusual indentation of comment. So, I continued working on it. The problem was that some comments need one level more indentation than previous line. In past clang-format doesn’t accept these one level indented comments and change their indentation to previous line indentation. For example

 if (a)
 return ;
  // Comment to remain as it is
else {

So, this comment was previously getting equal to indentation of return statement. Then I write some code which was working correctly and send a commit to get it reviewed from my mentor. After that my mentor tested this and found one issue where the indentation for code and comments was changed for a block

Then it took me a day to solve this issue and after that I again sent a commit which my mentor approved and asked me to add a functionality that this code should only work when “haiku” is passed as argument as some people may not want that for their project. Then I added this functionality and got commit reviewed from my mentor again.

By luckily, my mentor approved it and said it looks correct and then I send a pull request.

This marked the end of the first week. 🙂

GSOC Days: Intro

Yeah, I was selected in GSoC 2021. 🙂

 And if you don’t know, GSoC stands for Google Summer of Code

If you know GSoC, you know that the toughest part is to get selected! The selection process is an elaborate one and not everyone is selected. Well a lot of factors play a role in selection:

  1. Is your proposal good enough?
  2. Does the organisation need your proposed project?
  3. How good is your profile?
  4. Have you contributed to that organisation before?
  5. Did you get in touch with them while applying?

The Project

My GSOC project is Coding style checker bot for Gerrit. In the past, Haiku code review was done manually due to which there was some delay between the patch submission and the initial feedback. There is no system to check whether a change compiles or not. A lot of time is spent just on checking the code format due to which most review comments are only about code formatting and it becomes difficult for reviewers to focus on functionality of the patch. The user has to wait a long time to check whether their code is working as expected or not.

Haiku has its own coding standards  which describe how the code should be formatted. There is a tool for reformatting and checking if code follows these guidelines, but it has to be compiled on the developer machine and then run manually. The tool ‘ haiku-format ’ is work in progress which can be used to check the format according to guidelines which will be integrated with concourse to automate the process of checking coding style.

In this project I will work on the below-mentioned things:

For checking the code formatting

  • Improve the haiku-format to give results as stated by Haiku guidelines  
    • Haiku-format is a tool that reformats code according to Haiku coding style but it is not giving desired results. So, we need to format the code such that when this code is run on Haiku the coding style of code gets updated according to haiku guidelines.
    • This tool when integrated with concourse will run the automatic build when a new patch or commit is submitted then it will give the results by describing which changes need to be modified. This will help reviewers to focus only on the functioning of the code rather than checking the coding style.
    • The code of this tool is pretty clear and almost easy to edit. For instance if we want to know that if there is a new keyword on the left of a given character like opening parenthesis then Leftis(kw_new) will return true, if on the left there is a new keyword otherwise false.
    • More examples of code like IsOneOf() takes a number of arguments and will return true if the present character is one of the characters in the argument.
  • Run the haiku-format on the source code of Haiku.
  • Maintaining the code that is good (can be merged) and bad (That needs discussion and rework).

So you see, it’s quite a simple but elegant project idea. In the coming posts, we will follow the journey of this project in a weekly manner.

Django Vs Flask

Do you want to know which framework is better to use for web development, Flask vs Django? Many Python-based web frameworks enable developers to build scalable applications quickly. From simple to complex websites, these frameworks can do it all. Out of the many popular choices, Django vs Flask are the most talked about – and mostly because both are similar in some ways and different in many other ways! That leads to a comparison between both, and while each of these web development frameworks has its unique features, there are many factors you should look at before choosing one for your applications.

Django is a full-stack web framework, whereas Flask is a micro and lightweight web framework. The features provided by Django help developers to build large and complex web applications. On the other hand, Flask accelerates development of simple web applications by providing the required functionality. Hence, the developers must keep in mind the needs of individual projects while comparing Flask and Django.

Django has been around since 2005; Flask kept its foot in 2010 – about 5 years later. However, both are top frameworks in the Python world as of today. Their growing popularity is evident, considering the number of questions people ask about both these frameworks in various tech forums.
You can work on any of the frameworks if you have a working knowledge of Python. For your convenience, we have given a basic overview of both Django and Flask so that you can appreciate the differences and usage of each in a better way.


Django is a widely-used Python web application framework with a “batteries-included” philosophy. The principle behind batteries-included is that the common functionality for building web applications should come with the framework instead of as separate libraries. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.

Features of Django

1.Django was designed with the intention to make a framework which takes less time to build web application. The project implementation phase is a very time taken but Django creates it rapidly.

2.Django takes security seriously and helps developers to avoid many common security mistakes, such as SQL injection, cross-site scripting, cross-site request forgery etc. Its user authentication system provides a secure way to manage user accounts and passwords.

3.Django is scalable in nature and has ability to quickly and flexibly switch from small to large scale application project.

4.The framework aids developers to create an application in minimum type. Throughout the creation process, Django ensures that the deliverable is efficient as well as cost effective. It is the best fit for projects having tight deadlines and where time is a priority.

5.Django includes various helping task modules and libraries which can be used to handle common Web development tasks. Django takes care of user authentication, content administration, site maps, RSS feeds etc


Flask is an API of Python that allows us to build up web-applications. It was developed by Armin Ronacher. It is also easier to learn because it has less base code to implement a simple web-Application. A Web-Application Framework or Web Framework is the collection of modules and libraries that helps the developer to write applications without writing the low-level codes such as protocols, thread management, etc. Flask is based on WSGI(Web Server Gateway Interface) toolkit and Jinja2 template engine.

Features of Flask

1.Flask has a lightweight and modular design, so it easy to transform it to the web framework you need with a few extensions without weighing it down
2.ORM-agnostic: you can plug in your favourite ORM e.g. SQLAlchemy.
3.Basic foundation API is nicely shaped and coherent.
4.Flask documentation is comprehensive, full of examples and well structured. You can even try out some sample application to really get a feel of Flask.
5.It is super easy to deploy Flask in production (Flask is 100% WSGI 1.0 compliant”)
6.HTTP request handling functionality
7.High Flexibility
8.The configuration is even more flexible than that of Django, giving you plenty of solution for every production need.

Django vs Flask: Head to Head Comparison

Well, you should have got the hang of it by now – while Django is a full-fledged framework with loads of functionalities already done for you, Flask leaves everything under your control. But this is not the only difference; several differences help you understand which one you should pick for your web application. Here you go to get the difference between Flask vs Django– 

Created in 2010Created in 2005
Python web framework built for rapid development.Python web framework built for easy and simple projects.
Flask is WSGI framework.Django is a Full Stack Web Framework.
Flask provides support for API.Django doesn’t have any support for API.
Support Visual Debug.No support for Visual Debug.
Flask allows you to use multiple types of databases.Django doesn’t offer multiple types of databases.
Flask has no default support for forms, but you can use WTForms to fill the gap.Django comes Form with which can be integrate with the ORM and the admin site.
Flask does not offer dynamic HTML pages.Django offers dynamic HTML pages.
The request based object is imported from the flask module, which is a global variable in Flask.All views are set as an individual parameter in the Django.
Flask is much younger platform compared to Django.Django is a very mature framework.
Flask offers a diversified working style.Django offers a Monolithic working style.
It supports an extension which could be implemented in the framework.Django has its own module library. So, it stores several prewritten codes.
The structure of the project layout for Flask web framework is random.The structure of the project layout for the Django is conventional.
Flask web framework uses a Ninja2 template design.Django web framework helps you to utilizes the View web templating system.
URL dispatcher of the Flask web framework is a RESTful request.URL dispatcher of this Django framework is based on controller-regex.
Flask does not offer a built-in bootstrapping tool.Django-admin enables developers to start building web applications without any external input.
Flask is a good choice if you want a lightweight codebase.The best feature of Django is Robust documentation.
Flask framework is suitable for single application.Django framework allows developers to divide a project into multiple page application.
Flask Web Framework doesn’t offer support for third-party applications.Django Web Framework supports a large number of third-party applications.
Git hub stars 48.8 KGit hub stars 47.1 K
Best features of the flask is it is lightweight, open source, and offer minimal coding for developing an application.The best features of Django are Rapid development, Open source, Great Community, Easy to learn.
Famous companies using Flask are: Netflix, Reddit, Lyft, MITFamous companies using Django are Instagram, Coursera, Udemy.

Which is which? Hammer vs toolbox, or which framework to choose

Let’s summarize the particularities and strengths of Django and Flask so you can decide which framework to choose.

Choose Django if you’re short on time or have a limited budget. Django is a perfect solution for MVPs, e-commerce platforms, mHealth apps, and government websites.

Choose Flask if you have a small or mid-sized project that has unique requirements and requires custom components. Flask is especially good for prototyping.

Given that Django has a huge number of built-in solutions and Flask is often chosen in order to use the appropriate package to solve a certain problem, our verdict is this: Django is a toolbox and Flask is a hammer.

The ultimate choice depends on what you want to achieve with the framework. But once you do, you can start building high-quality web apps.

You have learned enough! START taking action today and GET a Python web app! 🙂

How to Install Zammad Ticketing System on Ubuntu 18.04

Zammad is a free, open-source and fully-featured ticketing solution written in Ruby. It is a web-based system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails. You can easily deal with customer queries and complaints. Zammad comes with a rich set of features including, full-text search, auto-save, auditable, supports external authentication, support multi-language and much more.

1. A server running Ubuntu 18.04 with minimum 2 GB memory.
2. A root password set up on your server.

Getting Started

Before starting, you will need to install Java on your system. You can install Java 8 with the following command:

sudo apt-get install openjdk-8-jdk -y

Once installed, you can check the version of Java with the following command:

java -version

Install Elasticsearch

First, you will need to install Elasticsearch for search functionality. By default, Elasticsearch is not available in the Ubuntu 18.04 default repository. So you will need to add Elasticsearch repository on your system.

First, install apt-transport-https with the following command:
apt-get install apt-transport-https sudo wget

Next, add Elasticsearch repository with the following command:

echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

Next, download and add Elasticsearch public key with the following command:

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

Next, update the repository and install Elasticsearch with the following command:

apt-get update
apt-get install openjdk-8-jre elasticsearch
sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment

Once the installation has been completed, start elasticsearch service and enable it to start on system reboot with the following command:

systemctl restart elasticsearch
systemctl enable elasticsearch

You can check the status of elasticsearch with the following command:

systemctl status elasticsearch

Install Zammad
By default, Zammad is not available in the Ubuntu 18.04 repository. So you will need to add Zammad repository to your system.

Check locale
$ locale
If there is nothing with UTF-8 in the name shown like “LANG=en_US.UTF-8” you have to set a new locale.

Set locale

$ apt-get install apt-transport-https locales sudo wget
$ locale-gen en_US.UTF-8
$ echo "LANG=en_US.UTF-8" > /etc/default/locale

Add Zammad DEB Repo

$ wget -qO- https://dl.packager.io/srv/zammad/zammad/key | sudo apt-key add -
$ sudo wget -O /etc/apt/sources.list.d/zammad.list \

Install on Ubuntu

$ sudo apt-get update
$ sudo apt-get install zammad

Go to http://localhost and you’ll see:
“Welcome to Zammad!”, there you need to create your admin user and invite other agents.

You can manage the Zammad services manually:

$ sudo systemctl status zammad
$ sudo systemctl stop zammad
$ sudo systemctl start zammad
$ sudo systemctl restart zammad

Only web application server

$ sudo systemctl status zammad-web
$ sudo systemctl stop zammad-web
$ sudo systemctl start zammad-web
$ sudo systemctl restart zammad-web

Only worker process

$ sudo systemctl status zammad-worker
$ sudo systemctl stop zammad-worker
$ sudo systemctl start zammad-worker
$ sudo systemctl restart zammad-worker

Only websocket server

$ sudo systemctl status zammad-websocket
$ sudo systemctl stop zammad-websocket
$ sudo systemctl start zammad-websocket
$ sudo systemctl restart zammad-websocket

Configure Nginx for Zammad
By default, Zammad can be accessible only from localhost. So you will need to configure Nginx to access Zammad from remote location. You can do it by editing zammad virtual host file:

nano /etc/nginx/sites-available/zammad.conf

Replace the localhost with your server FQDN or IP-Address

server_name your-server-ip;

Save and close the file. Then, restart Nginx service to apply configuration changes.

systemctl restart nginx

Access Zammad Web Interface
Now, open your web browser and type the URL http://your-server-ip. You will be redirected to the following page:

Click on the Setup new system button. You should see the following page:

 Provide your administrator’s name, email, password and click on the Create button. You should see the following page:

Provide your Organization name, system URL, upload your logo and click on the Next button. You should see the following page:

Choose a proper email sending method and click on the Continue button. You should see the following page:

Now, click on the Skip button to finish the installation. You should see the Zammad dashboard in the following page:

Congratulations! You have successfully installed and configured Zammad Ticketing System on Ubuntu 18.04 server.
You can now easily deploy Zammad in a production environment.

If you find any errors above, please comment below:)

How to Setup Mailbox : UVdesk Open Source Helpdesk

What Is Mailbox?

Mailbox allows all the e-mails sent to your specified e-mail address to be automatically imported as the support ticket in your helpdesk system. Now the owner or the agent can manage inquiries in a much better way using helpdesk features and tools.

Swift Mailer Configuration

Step 1– When you will go to the dashboard, you will see “Swift Mailer” icon under setting section.

Swift Mailer UVdesk Helpdesk

Step 2 – Now, just click on “Swift Mailer” and hit on “Create Configuration” button.

Step 3 – Need to fill out all below details and proceed with by clicking “save changes” button.

  • Swift Mailer Id: Enter mailer Id name which will further use while creating mailbox.
  • Transport Type: Name of transport method used to deliver email e.g, SMTP (for Yahoo)
  • Enable Delivery: Click on check box to enable swift mailer.
  • Server: SMTP server used for outgoing mails e.g, smtp.mail.yahoo.com (for Yahoo)
  • Email: Here you need to enter your support email Id which you want to configure with UVdesk.
  • Password: Enter the password for same email Id which you have entered.
  • Port: The SMTP port of your server e.g, 465 (for Yahoo)
  • Encryption Mode: Select encryption mode as SSLTLS or None as required from the drop down as required.
  • Authentication Mode: Select authentication mode as Login, Plain or Cram-MD5 from the drop down.
  • Sender Address:  All email will be delivered with this address as the “return path” address, which is where bounced email should go.
  • Delivery Address:All email messages will be sent to this address instead of being sent to their actual recipients.

Mailbox Configuration

Step 1 – Next step is to click on “Mailbox” option under settings.

Step 2 – Now, just click on “New Mailox” button.

Step 3 – Need to fill out all below details and proceed with by clicking “Proceed” button.

  • Id: Enter the name of mailbox
  • Name: Enter the Correspondents or Sender name

Incoming Mail (IMAP) Server

  • Transport: Select transport as GmailYahoo or IMAP
  • Host: Every email service has unique IMAP HOST like Gmail – {imap.gmail.com:993/imap/ssl}INBOX, Yahoo – {imap.mail.yahoo.com:993/imap/ssl}INBOX
  • Email: Put email address of IMAP(incoming mail server)
  • Password: Enter password of given email.

Outgoing Mail (SMTP) Server

  • Swift Mailer ID: Select created swiftmailer id from the drop down

Email Settings

Email settings is use to send the reply from ticket panel to the customer email id hence this setting is mandatory. To do this, directly go to email settings by navigating through  Settings-> Email Settings 

Now fill the required details Email Id, Name, Swiftmailer id and Proceed.

  • Email Id: This email address sends ticket reply to your customer email id.
  • Name: Enter any name for identification.
  • Swiftmailer Id: Select switfmailer id from the drop down.

Note: Now, need to edit few changes in code, navigate through config->packages->uvdesk.yaml  and find site_url, enter the localhost or domain path till public, make sure you have removed http://

For examplelocalhost/folder_name/public

Run Cron Job

Run below refresh command through terminal into project root directory to fetch emails as a tickets.

php bin/console uvdesk:refresh-mailbox email-address@example.com Run Cron Job Schedule Cron Job that needs to be executed repeatedly (e.g., hourly, daily, or weekly), you can use the crontabcommand. for more details refer to this guide.

Common Issues:

If you are getting the error “Can not authenticate to IMAP server: [ALERT]

Make sure you’re not using 2 step verification.

First sign in into the Gmail account in a browser on the device then, need to ensure you have enabled IMAP status and Allow less secure apps should be ON and have already done the continue step to allow access to your Google account.

Here we have done all the settings of mailbox configuration, now you can able to send and receive emails over the ticket panel.

That’s it!

Thanks for reading,feel free to comment/ask any of your doubts and also in case you like this post. 😉

Blog at WordPress.com.

Up ↑

Create your website with WordPress.com
Get started