Hey!

The new code folding is taking shape. Actually it is implemented. 🙂

The next step will be testing it (and debugging, if necessary) and implementing some new features.

Also there are some keyboard shortcuts that didn’t worked so well on the previous version and they need to be fixed too.

If you want to help us with the testing, you can download my clone and play a little with code folding. Also, if you have some ideas about the new features that Kate’s folding should have, let me know. If it is possible and there is time, they will be implemented.

Greetings,

Adrian

### Like this:

Like Loading...

*Related*

Hello.

It’s nice to hear the word “algorithm” on PKO, and especially in a GSOC post. Fortunately, not all developers have yet forgotten that programming is not only plumbing existing library components together or working off somebody else’s work, but a creative scientific activity that has never been easy. 🙂

Thus, I’d like to ask you:who checks/evaluates/validates your algorithm, if anybody? Are there any profs that you can ask for advice or any other highly experienced guys? Algorithm design is quite a complex beast, and it’s damn easy to make a small mistake that will silently sit there and then discover itself, ruining the apllication all of a sudden under certain circumstances.

Regards,

–thorGT

Hi!

Thank you for the nice words 🙂

I explained in the previous post how I managed to test the algorithm. I developed a new (Qt) project, implemented two algorithms (this tree algorithm and a simpler, stack algorithm) and created some methods that compared the two outputs. I made tens of tests. Each test had thousands of moves. And it worked really well. This helped me testing the tree algorithm used by the code folding. To test the entire code folding, a Kate’s community member has offered to help me develop a test module. And that would be one of the next steps 🙂

I see. This effectively means that you follow an empiric (practical) approach to algorithm design. Well, you see, I’m highly theoretical on the contrary, and often forget that a brute force practical approach can help, so I’ve asked you about the theoretical validation of the algorithm.

Have you used any books like Cormen or Knuth for the fundamental nformation on algorithms applied in similar cases? Like the data structures, the mathematical abstraction of the problem? I wonder if the knowledge of algorithms you obtained University was enough to solve this problem.

Regards,

–thorGT

No. I cannot say that I used some algorithm theory. But that doesn’t mean that the knowledge of algorithms gained in University didn’t help me.

Actually it helped me a lot because there were some courses that encourage you to develop algorithms and not learn them by hart. 🙂

Greetings,

Adrian

Well. That’s awesome in fact. True knowledge lies in understanding, not in memorizing stuff. But on the other hand, there’s always some basics that you need to know and on top of which you can later build your own algos.

Excuse my curiosity (I’m interested in algos too but lack any substantial knowledge ATM), but to be sure:

Have I understood it right that you tend to work the way towards the solution directly from the problem, without first building a mathematical abstraction of it and then tailoring an existing solution to the current situation? Or was this exact case easy enough to solve without any maths and I’m overcomplicating things? (These seem to be two fundamentally different approaches to me, and I tend to follow the mathematical way personally.)

Well I didn’t start writing code without having anything to inspire from. If you read an older post (Folding algorithm started) you’ll find a paper there. That paper was written by me a couple of months ago when I sent my GSoC application. It proved not to be perfect, but it helped me a lot. The basic ideas were great. I did some serious research before writing that paper, so I worked a little before I actually started coding 🙂

I would love it if kate had a fold/unfold everything function. fold/unfold top level doesn’t work so well if you have a file with include guards on it.

One feature I use a lot in notepad++ and which is very great and probably fairly easy to implement is a series of actions (including keyboard shortcuts, Alt+1-9 in notepad++) which fold and unfold all elements of a given depth in the tree.

If the explanation is not clear, I suggest you open some random xml in notepad++ and try Alt+5, Alt+4, Alt+3 etc… It gives a very good overview of the file structure.

Sounds pretty good. I’ll see what I can do with that 🙂