Sunday, 13 March 2016

AMX TextEdit: A fast, open-source text editor written in C++

Leave a Comment
Editing text documents is something all of us do all the time. Be it taking some quick notes from a call, creating an on-the-moment to-do list, or writing down some points of the brilliant idea you just had – a notepad (the virtual one) is open even before you know it. For Microsoft® Windows users, Notepad is the go-to text editor for almost everyone in need of a quick place to write anything down and it does this job well, being fast and extremely lightweight. But with these pros come some cons as well – Notepad lacks some very much needed features such as tabs. There exist other editors which do support tabs and a whole lot of other features but that comes at the cost of speed. Those editors are often quite slow in comparison to the simple and fast Notepad.

So, the quest remains for an editor which is both fast and lightweight like Notepad and has tabs as well. Well, that quest has come to an end (hopefully).

I present to you: AMX TextEdit


AMX TextEdit is a small, fast, open-source text editor with tabs – the perfect replacement for your notepad. It’s being written in C++ and is still in alpha but is already ahead of Notepad in features. It has almost all the features of Notepad and more!

Features:
  • Speed – AMX TextEdit is extremely fast.
  • Portability – Just one file, no installation!
  • Size – Under 2 MB!
  • Tabs – Edit as many files as you like in tabs.
  • Advanced Editing – Undo, Redo, line numbering, jump to a line and more.
  • Syntax Highlighting - Syntax Highlighting for C/C++.
  • C/C++ Compilation - One-click compile and run right from the editor (Requires gcc and g++ to be in PATH)
  • Free – AMX TextEdit is completely free!
  • Open Source – AMX TextEdit is open-source, hosted on GitHub and released under the MIT License.

Download

AMX TextEdit may be downloaded from the project page:

AMX TextEdit – afaan.ml


Any questions or suggestions may be posted below!
Read More...

Friday, 4 March 2016

Tic Tac Toe: One Game; Two Languages

Leave a Comment
Whenever anyone among us wishes to learn to program, the reason, most often than not, is to be able to create games – the fantasy of everyone who plays them. Thus, to make learning to program a little bit more fun, we learn the concepts and try implementing them in making a simple yet playable game. Same is the case here.

Tic Tac Toe or Noughts & Crosses or Xs and Os is a game that everyone knows how to play, and it is simple enough that anyone who has learnt the basics of any major programming language can make it without much frustration.

I did the same.

At first, I created a console version (CUI) in C++ playable by a human against a human. Straight enough, not much game logic.

Tic Tac Toe C++ Console

The next step was creating a GUI version. This one was created in C# .NET and the primary difference between this one and the above C++ version is that this one is GUI and only for Windows. The rest of it is same. Human v/s Human only.

Tic Tac Toe C#

Then, while learning cross-platform GUI programming in C++ using the wxWidgets toolkit, I created a GUI version in C++. This time, it has a major difference. It can be played by a human against a human as well as a human agains the computer. The game logic is mostly brute-force. It also has the additional feature of keeping the score. The only downside is that the computer plays a perfect game, i.e., you can never win against the computer – either the computer wins or it will be a draw. That’s because Tic Tac Toe is a zero-sum game.

Tic Tac Toe C++ GUI

And now, the great news is that all of the above have been made open-source, under the MIT License, for new programmers to learn from and try out. After all, have to give back to the community, no?

The source and binaries may be downloaded from:

Any questions or suggestions? Use the comment box below.
Read More...

Thursday, 4 February 2016

Live HTML Editor: Edit HTML Live!

Leave a Comment
Good news for web designers!
Live HTML Editor is open source under the MIT License.
The web designers and developers among us know how tiresome it gets to switch between your editor and your browser continuously as you go on making minute changes such as changing the font, color, margin or padding – the changes which need us to continuously look at the output on every small change we make to see if it’s finally the way we want.

We increase the padding by 2px , save the file, switch to our browser, reload the page, and see that it’s a little less. Then we switch back to our editor, increase the padding a little more, save the file and then switch back to our browser and again reload the page to see that it’s a little more than required, then we switch back to our editor and so on. In this process, we waste so much time in saving, switching and reloading that it tends to be more than the time we spent in actually designing the web app! How sad is that!

Well, it’s time to rejoice!

I present to you: Live HTML Editor!

Live HTML Editor is an open source Windows program that I wrote to overcome these problems. I needed something that could automate the process of saving, switching and reloading for me, so that I could concentrate on designing the perfect web app. In the end, I had to write it on my own, because even though such softwares and online services do already exist, they are all premium.

Live HTML Editor provides you with a syntax-highlighted editor, and an output window side-by-side. It tracks changes in files automatically so that while you are editing a file, it saves the file automatically on every change and at the same time updates the output window on the right to show the latest output. Thus, it eliminates the need for manually saving, switching and reloading, hence saving a good amount of time and increasing productivity at the same time!

Main Features:

  • See the HTML output live as you edit it.
  • Edit many files together in tabs.
  • Syntax highlighting for ease of coding.
  • Automatic saving.
  • Customizable editor and much more...

Download

You can download the setup at the project page: afaan.ml/Live-HTML-Editor.

The source can be downloaded from the github repo:
GitHub: github.com/AfaanBilal/Live-HTML-Editor

License

Live HTML Editor is open source and released under the MIT License.

Any questions, comments or suggestions may be posted below.
Wassalam!
Read More...

Saturday, 30 January 2016

Simple Math Programs in C

Leave a Comment
Updated: 20th March 2016
Added:
  • Decimal-Binary Conversion
  • nCr (Combination) 
  • nPr (Permutation)
  • Binomial Expansion
  • Reverse a number


It is often that while learning to program in any language, it is advised to try out small mathematical programs like calculating factorial of a number, printing the fibonacci series, checking if a number is prime, etc. to help the learners get a good hold of the language and enable them to be able to implement various algorithms effectively as required.

In the same manner, while learning to program in C,  instructors advise the learners to learn these simple mathematical algorithms and implement them in C to make them familiar with the syntax. For many of us, some of these implementations seem a little bit difficult and thus, we end up searching the web for them.

To make the path easier, here is a collection of some of the small and simple mathematical programs written in C for all the learners out there to benifit from:

The project page of the above collection is at afaan.ml/math-tools-in-c.

The above collection is hosted on GitHub at github.com/AfaanBilal/math-tools-in-c and is released under the MIT License.

For any questions or suggestions, please use the comment box below!
Wassalam!
Read More...