tag:blogger.com,1999:blog-78881568662697202892023-11-16T08:53:50.494+01:00Linux, Games, Programming, and some other random stuffscummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.comBlogger61125tag:blogger.com,1999:blog-7888156866269720289.post-33674146401734732212015-10-08T16:12:00.003+02:002015-10-08T16:12:30.320+02:00Blog movedI decided to continue this blog on my own installation, so please go to <a href="http://blog.svenbrauch.de/">http://blog.svenbrauch.de/</a> in the future if you're interested. This is the last post around here. :)scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com0tag:blogger.com,1999:blog-7888156866269720289.post-50903054934774751842015-04-26T18:54:00.000+02:002015-04-26T19:07:27.892+02:0021cm hydrogen line telescope, version 2Much has happened since my <a href="http://scummos.blogspot.de/2014/08/14204-mhz-hydrogen-line-there-it-is.html">last status report</a> on my attempts to observe the galactic hydrogen emission at the famous <a href="https://en.wikipedia.org/wiki/Hydrogen_line">1420.4 MHz hyperfine structure line</a>. Now, the new setup is finally proven to be basically working, and in this post I want to describe some of the changes I did.<br />
<h3>
New data acquisition module</h3>
Most importantly, I replaced the spectrum analyzer by a self-made data acquisition unit which is basically a Software-defined radio (SDR). Its purpose is to take the 1.4 GHz signal, digitize it, and send it to a computer. <br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkqA9inkhGDM_Q7tdXmjB33GwVLPSrwb39JHoVs4rRAh1n8tHvDPz2zgRA4L4C0hXLtE9IBmnRWZ4c91s4weaR5bh1iDP2VvzHm5TGeTRUHrIMFSrBfzGBNIUNgDFdDXPDVnh20Et4UOg/s1600/finished_on.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkqA9inkhGDM_Q7tdXmjB33GwVLPSrwb39JHoVs4rRAh1n8tHvDPz2zgRA4L4C0hXLtE9IBmnRWZ4c91s4weaR5bh1iDP2VvzHm5TGeTRUHrIMFSrBfzGBNIUNgDFdDXPDVnh20Et4UOg/s1600/finished_on.jpg" height="265" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Revision 2 of the new data-acquisition board. Signal input is at at the top right port, then there is a lot of analog stuff (details below) and the signal is finally fed to the microcontroller (the big black IC) which passes it to the computer via USB. The plug in the upper left corner is an additional power supply.</td></tr>
</tbody></table>
<h4>
Functionality description </h4>
The board contains various submodules, most of which are labelled in the following image.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEDz2evKw6wgjz3O-JQNVoydf8mTqxZpfjRe4QTfDB69JlNbDR2JIH51a760UdKFIT934FzninBEhLNfEy5EIcr7qLNDVKXNpJ6-Oq7ZRc2u_F-KEICst-svkrTJU6hJEkN4oHcxL8Vak/s1600/components.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEDz2evKw6wgjz3O-JQNVoydf8mTqxZpfjRe4QTfDB69JlNbDR2JIH51a760UdKFIT934FzninBEhLNfEy5EIcr7qLNDVKXNpJ6-Oq7ZRc2u_F-KEICst-svkrTJU6hJEkN4oHcxL8Vak/s1600/components.png" height="266" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Some of the components of the acquisition board.</td></tr>
</tbody></table>
The first thing which happens is <i>down-conversion</i> through a so-called <i>mixer</i> [<a href="http://www.farnell.com/datasheets/1717059.pdf">data sheet of part used here</a>]: it takes the portion of the 1.42 GHz signal we are interested in and moves it down to a lower frequency of approx. 150 MHz. This has various advantages; especially it makes further filtering, amplifying and digitizing the signal much easier. Since we are only interested in a small part of the signal, this conversion can happen in a way such that no information is lost.<br />
Mixing works by multiplying the actual signal with a reference signal, the so-called <i>Local Oscillator</i> (LO) [<a href="http://www.analog.com/media/en/technical-documentation/data-sheets/ADF4351.pdf">data sheet of part used here</a>]. You can imagine the LO as a component which generates a sine wave at a specific, but programmable, frequency (in this case around 1.27 GHz); then the mixer basically subtracts this frequency from the frequency of the original signal (so in this case, with 1.42 GHz and 1.27 GHz you end up at 0.15 GHz = 150 MHz). The lower-frequency signal (the 150 MHz in this case) is called the<i> Intermediate Frequency</i> (IF) signal.<br />
<br />
Next, there are various filters and amplifiers which are very simple to understand; they just make the signal amplitude large enough so that it can comforatbly be detected by the <i>analog-digital-converter</i> later on.<br />
This part of the circuit ends with a so-called <i>Surface Acoustic Wave (SAW) filter</i> [<a href="http://www.mouser.com/ds/2/347/sf2120c-52370.pdf">data sheet of part used here</a>], which is a quite modern kind of filter with the special property that it can select a relatively small part of the signal very accurately, while blocking everything else almost completely. It only lets the frequency components of the signal pass which have frequencies between about 148 and 151 MHz. Which part of the <i>original</i> signal can be found in this range (remember, we move the original signal to a different frequency) is determined by the mixing step: through programming the local oscillator (LO) for a different reference frequency, one can look at the input signal's spectrum one part at a time.<br />
<br />
The bridge between the analog and the digital world is built by the <i>Analog-Digital-Converter</i> (ADC) [<a href="http://www.analog.com/media/en/technical-documentation/data-sheets/AD9283.pdf">data sheet of part used here</a>]. It gets an input clock from the microcontroller, which is just a signal which toggles up and down exactly 11.25 million times per second; on each tick of that clock, it measures the voltage at its input pin, and converts it into an 8-bit digital value. Each of the bits of that value is then provided as a voltage level (either +3.3V for "1" or 0V for "0") on one of the output pins. They are read in by the microcontroller [<a href="http://www.nxp.com/documents/data_sheet/LPC435X_3X_2X_1X.pdf">data sheet of microcontroller</a>], packed into chunks of a few kB in size in the controller's RAM, and then sent out via USB.<br />
Getting the microcontroller firmware to do this as fast as required was
surprisingly nontrivial, but that's such a broad topic that I do not
want to get started on it here. <br />
The computer receives the data, calculates the fourier transform to get the frequency spectrum, and averages the resulting spectra (see end of post for software screenshots).<br />
<br />
(If you ever heard of the <a href="https://en.wikipedia.org/wiki/Nyquist_frequency">Nyquist frequency</a>, you might wonder how it is possible to digitize a 150 MHz signal with just 11.25 MSa/s sample rate. This is why we need the narrow SAW filter in front of the ADC: it limits the bandwidth of the signal to 3 MHz and thus allows to use the <a href="https://en.wikipedia.org/wiki/Undersampling">undersampling technique</a>. In this case, the ADC samples the 26th alias of the original signal.)<br />
<i><br /></i>
Below<i> </i>is an illustration of the paths the signals described above take through the board. Note that almost all of the blue path is at 150 MHz; just the first centimeter up to the small black mixer IC is at 1.4 GHz.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlGLxZISX53zTc8I8ZF_gLe9QrRAcF4LAocPt3e75_2aK9uq1TR3WYR1GFR9bSg6uBTmX0oZSlXqObzIYKOzBqo56z4p1tQWWrbAAwtWxpbzRkGYGRop8N6YF9YdF6_iu67sI8SQTeUcY/s1600/paths.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlGLxZISX53zTc8I8ZF_gLe9QrRAcF4LAocPt3e75_2aK9uq1TR3WYR1GFR9bSg6uBTmX0oZSlXqObzIYKOzBqo56z4p1tQWWrbAAwtWxpbzRkGYGRop8N6YF9YdF6_iu67sI8SQTeUcY/s1600/paths.jpg" height="266" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Signal paths in the data acquisition board.</td></tr>
</tbody></table>
<h4>
Manufacturing the board</h4>
This is a 4-layer board; that means, it has tracks on the top and bottom side, and two metal layers in between (you cannot see them, they are glued inside the board) which also have tracks. Connections between the layers are established by metal-filled drill holes (in this case about 1000 of them, each 0.3mm in diameter).<br />
Having 4 layers makes it much easier (or possible at all) to arrange tracks in a way that they do not cross, and also has some important advantages for high-frequency signals. Unfortunately, it also makes fabrication of the prototypes more expensive. There are various chinese vendors which will manufacture a small amount of pieces of such a board for an affordable price; including customs and shipping it will end up costing about 100 € for 5 pieces (less pieces doesn't get cheaper though). Components are extra and you have to put them on the board yourself.<br />
There is specific software to design such circuit boards; first, you usually draw a schematic, and then you use the layout editor to place components and tracks in accordance with the schematic. The layout itself quickly becomes hard to overlook; the software guarantees electrical equivalence between the easy-to-read schematic and the layout (e.g. it guarantees you don't have wrong connections, missing connections, or tracks which cross or are too close together -- of course only if you did it right in the schematic).<br />
The software exports vector-graphics like files for each layer and a list where holes must be drilled, which is then sent to the manufacturer.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdKmXdKb7a8X7qCxhCvawcgRzSq0posRcoF8Us1Gs_JUotFyKDZVtN9Bf3UqvhZ98bqUc-OejuCI49UjSjvbYLIa0Gor0XQWzFnek1Adx5WXvJjISsZjw_Po_tBl65hFGqg1ry9ZVOOPs/s1600/kicad.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdKmXdKb7a8X7qCxhCvawcgRzSq0posRcoF8Us1Gs_JUotFyKDZVtN9Bf3UqvhZ98bqUc-OejuCI49UjSjvbYLIa0Gor0XQWzFnek1Adx5WXvJjISsZjw_Po_tBl65hFGqg1ry9ZVOOPs/s1600/kicad.png" height="250" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">This board's layout loaded in kicad. Only the top (red) and bottom (green) layers are shown.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdv_iiYSaU7Bauk_nUVW2wFHLWic-yfSlZfMr5eWGWwMnvzPJrP2lhjLJOA1tb2M4B8P6x2jnCSV9kLwHVGLfL4vdOrvBFO4xyzASWz0prIuTL-NmWIWpeHBTLKEpzXzfAt2_0GFf7iKA/s1600/stencil.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdv_iiYSaU7Bauk_nUVW2wFHLWic-yfSlZfMr5eWGWwMnvzPJrP2lhjLJOA1tb2M4B8P6x2jnCSV9kLwHVGLfL4vdOrvBFO4xyzASWz0prIuTL-NmWIWpeHBTLKEpzXzfAt2_0GFf7iKA/s1600/stencil.jpg" height="266" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">A raw board without components (but with soldering paste on it) and the stencil for the board. Also an example for how not to use a stencil.</td></tr>
</tbody></table>
For this, I decided to use a <i>stencil</i> this time, which is a rather thin piece of metal with all the pieces cut out where a component is supposed to be soldered onto the board. The stencil is put on top of the board, then you smear some solder paste on it, and force it through with a credit card; then, you lift off the stencil to only have the solder paste on the places where it belongs. You can then put the components into their spots and heat the whole thing; the solder paste will melt and form a firm, electrically conductive bond between the component and the pad on the board after cooling down again. After a few attempts, I managed to get a good result for the paste print: it is important to firmly fix the stencil in the right postion, then <i>press the paste through with a single swipe</i>, and then remove the stencil again by lifting it straight up carefully.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0luTQVxUAV-xhQmdYun6tbEkb-FCKF08Htw460kegcTTs5Rfg2WJLsPLKQWWjpxrKkeJ0HJNPim6MUOi-d4MKYEnrHmCbo0CPfOZF4wqOHbZkAvbYm-yiptaZqsdBnQ5FjKn9LsRFPPI/s1600/stencil2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0luTQVxUAV-xhQmdYun6tbEkb-FCKF08Htw460kegcTTs5Rfg2WJLsPLKQWWjpxrKkeJ0HJNPim6MUOi-d4MKYEnrHmCbo0CPfOZF4wqOHbZkAvbYm-yiptaZqsdBnQ5FjKn9LsRFPPI/s1600/stencil2.jpg" height="257" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Board with solder paste, ready for component placement.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzHhBR5pmiS2dH0DXyfivyxM9kgRRzQwSvXV2i8-Ue6Do7IVlRSR5rZ1FpmcU9qY2mjRKRMtV8K5ETcZ-fywZLwUs-PByWOEvO80_ZBUA9zsDF1rX5bSra1vitKAYWMIzVOEeaAgVjw60/s1600/finished_closeup.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzHhBR5pmiS2dH0DXyfivyxM9kgRRzQwSvXV2i8-Ue6Do7IVlRSR5rZ1FpmcU9qY2mjRKRMtV8K5ETcZ-fywZLwUs-PByWOEvO80_ZBUA9zsDF1rX5bSra1vitKAYWMIzVOEeaAgVjw60/s1600/finished_closeup.jpg" height="266" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Board with components placed, after heating it up and letting it cool down again (and fixing a few things by hand). Most of the solder joints look pretty good.</td></tr>
</tbody></table>
With all the software and tooling stuff already in place from a first version of the prototype, it was quite easy to get this board to work as expected. Only very few minor fixes were needed.<br />
<h3>
Mirror filter</h3>
When mixing a signal to a different frequency as described above, there is one problem I did not mention so far: if I mix 1.27 GHz with a broadband signal (as it comes from the antenna, it doesn't only contain the 1.42 GHz part but lots of uninteresting noise at basically all other frequencies as well) of which I am interested in the 1.42 GHz part only, there are actually two frequencies of the broadband signal which will end up at 150 MHz in the intermediate frequency (IF) signal. This is the 1.42 GHz = 1.27 GHz + 0.15 GHz part I want, but also the 1.15 GHz = 1.27 - 0.15 GHz part, which I have no interest in. After the mixing step, those two signals are added together and cannot be separated again. It is thus necessary to remove the 1.15 GHz part of the signal <i>before</i> it reaches the mixer.<br />
To do this, a bandpass filter is needed. I did some simulation with <a href="http://www.sonnetsoftware.com/">Sonnet</a> (give it a try if you want to do stuff like this, it has a quite functional free version), which basically allows you to simulate electromagnetic waves in planar (i.e. "mostly 2D") arrangements of metal, and ended up with this magic-looking design:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVd9vGqRFWEJLTXK6me0pOgwrImb6T9kArcEKSDAyNDLJ3ASbgHWLIxXg5SRNHK52kgiUa_0-108Ryri-L9CcSUrcAJ7pFOxW_efcfRGuXlCmcxF6qtnFNRrh3KZ7kfHaR5IpF08FZFaY/s1600/geometry.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVd9vGqRFWEJLTXK6me0pOgwrImb6T9kArcEKSDAyNDLJ3ASbgHWLIxXg5SRNHK52kgiUa_0-108Ryri-L9CcSUrcAJ7pFOxW_efcfRGuXlCmcxF6qtnFNRrh3KZ7kfHaR5IpF08FZFaY/s1600/geometry.png" height="268" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Geometry for a microstrip bandpass filter at 1.42 GHz.</td></tr>
</tbody></table>
The green stuff is copper, white is just board material, and the 1 resp. 2 is the input / output port. This is the simulated filter response:
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT9GxTiHH5R_oRfEbRKmoZEd4ki9g4xaFV6Jxsaa2JrLMcQq8Q9lE6vE-1_UAhp41-B7e8hRYMoFACkZJYbifQSoPQRINaEkM-hs9RmRchxa6ndsV-EXB7ea1NUbtfs-jFhUkRhPXBC-U/s1600/end.bmp" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT9GxTiHH5R_oRfEbRKmoZEd4ki9g4xaFV6Jxsaa2JrLMcQq8Q9lE6vE-1_UAhp41-B7e8hRYMoFACkZJYbifQSoPQRINaEkM-hs9RmRchxa6ndsV-EXB7ea1NUbtfs-jFhUkRhPXBC-U/s1600/end.bmp" height="226" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Simulated filter response for the optimized design.</td></tr>
</tbody></table>
Looks good! It lets through the 1.42 GHz signal nicely, and blocks the unwanted signal at 1.15 GHz by 40 dB (factor 10000 in power).<br />
For a prototype, I then proceeded to cut this geometry into a copper board by hand ...<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRm0PRYDJSYfIJRmm-4iOwMSj3F073p6fisnf6uMTuLVdML1qj1_MKIoWi_3-hfGO5f9-WXDjYqQrfZ2v-0EuJ7h2pw9WQIX3PE6-5GrPEd6b6i5_Lm33jGfMlgexI2NAl87boMR_vVJA/s1600/microstrip.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRm0PRYDJSYfIJRmm-4iOwMSj3F073p6fisnf6uMTuLVdML1qj1_MKIoWi_3-hfGO5f9-WXDjYqQrfZ2v-0EuJ7h2pw9WQIX3PE6-5GrPEd6b6i5_Lm33jGfMlgexI2NAl87boMR_vVJA/s1600/microstrip.jpg" height="272" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Hand-made prototype (with a cutter knife).</td></tr>
</tbody></table>
<br />
... and measured it to compare with the simulation. As expected, it has more loss in the passband than in the simulation (reality always has more loss than expected) but not much, and the shape of the response is much more irregular, probably mostly because of manufacturing inaccuracies. Still, the important parameters agree really well with the simulation, which I find quite impressive.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEdLm4Mzanf4ugk0yec5AW_Ryi5g4zjwQPvnzgWH6Fs1eIUPLwXIShZ9dOpyIQo44PN08JramfserMqDgoUEjZzgO7l5Ey2Tuld3o6mUhzba_XqLl8erpJxvdmAoZiU6lEoYGyzfBCBz4/s1600/measured.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEdLm4Mzanf4ugk0yec5AW_Ryi5g4zjwQPvnzgWH6Fs1eIUPLwXIShZ9dOpyIQo44PN08JramfserMqDgoUEjZzgO7l5Ey2Tuld3o6mUhzba_XqLl8erpJxvdmAoZiU6lEoYGyzfBCBz4/s1600/measured.png" height="240" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Measured filter response. Note that the filed-of-view is much wider to the left than in the simulation image shown above (it goes down to f = 0 Hz here), the two markers M1 and M2 are in the same spot though. Everything below the y= -40dB line can be completely neglegected in practice for this application.</td></tr>
</tbody></table>
<h3>
Astronomy</h3>
Now, finally all the important components are in place! I set up my 1.2m dish and pointed it at the sky, and tadaa -- the familiar HI signature of our galaxy showed up:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDnI0gdhQs0qfMGrg923qPlXnobw-b9rbqhK7oJbGqUXSYZyWm0szp1WVKANebl6zr2_tEc6HsXyAfaZZKTpaHNdyeSRee9LFDrZ5z3KjvA09pdatdCkmuawLRtwvZwhL-5x6SI1RHQuc/s1600/firstlight.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDnI0gdhQs0qfMGrg923qPlXnobw-b9rbqhK7oJbGqUXSYZyWm0szp1WVKANebl6zr2_tEc6HsXyAfaZZKTpaHNdyeSRee9LFDrZ5z3KjvA09pdatdCkmuawLRtwvZwhL-5x6SI1RHQuc/s1600/firstlight.png" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The two wide peaks probably are two spiral arms of our galaxy. The slope in the underground signal (more signal to the right, less to the left) is wideband interference from some human-made source. About 21 gigabytes of data were acquired and averaged (to reduce noise) by the board described above to create this image. Integration time is 12 minutes, total measurement time 24 minutes (12 minutes on-source observation and 12 minutes background noise measurement)</td></tr>
</tbody></table>
I really need to repeat this test outside of a city full of people with interfering electrical devices (that really makes a huge difference), but as a proof-of-concept, this is completely sufficient. As such, this is the first spectrum I acquired with all significant components in the reception chain made by myself :)<br />
The signal is calibrated by a method called <i>frequency switching</i>: one periodically shifts the observation frequency by a few MHz, and thus observes just the background noise. This background noise is then subtracted from the actual measurement. This might sound like it reduces noise (it does not, but that's not trivial to understand), but the real gain is that the frequency dependence of the IF part of the acquisition board is removed from the signal. Why this is important may become evident from the following image:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCH-_OaPl6SuiJs9aGFj59K32-POztz8Zl-h8h8mdhiZs8AwGlJIZw6s_2GAZsGBZElALHr6ROlcqL7_F3G6cuqfJWw7ChIP58FckUB4AlG4s3s4eWSW790_Bnr8O4eGqfWzKq9I45i90/s1600/with_dish4.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCH-_OaPl6SuiJs9aGFj59K32-POztz8Zl-h8h8mdhiZs8AwGlJIZw6s_2GAZsGBZElALHr6ROlcqL7_F3G6cuqfJWw7ChIP58FckUB4AlG4s3s4eWSW790_Bnr8O4eGqfWzKq9I45i90/s1600/with_dish4.png" height="250" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Screenshot of PC software (written specifically for this board). The curve on the right is the acquired spectrum, and contains information from about a million ADC samples fourier-transformed and averaged together. One can nicely see the bandpass; the shape is almost entirely determined by the Surface Acoustic Wave (SAW) filter mentioned above. At the left, there's controls for adjusting amplitude and looking at different parts of the spectrum by changing the local oscillator frequency.</td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<br />
None of the peaks shown there is an actual astronomical signal; the signal shown in the plot is far too weak to see it here. The non-flatness of the band is created by the bandpass filter (the sharp spikes are interference); this non-flatness should be calibrated away in order to reliably distinguish real signals from the bandpass shape. <br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTjSC6gG5tgy9_mt7qiPqF61-oqK02ZsMjRDvrt4IZZei6ifxRI_xFwzFbGWBR07IY1-2h-xNVutI2nnPQomD7-7qD38kqWrrF5NTdjr5RWStwK401vy_0VE3Pirp_XNsuErBbLQ8P3as/s1600/with_dish5.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTjSC6gG5tgy9_mt7qiPqF61-oqK02ZsMjRDvrt4IZZei6ifxRI_xFwzFbGWBR07IY1-2h-xNVutI2nnPQomD7-7qD38kqWrrF5NTdjr5RWStwK401vy_0VE3Pirp_XNsuErBbLQ8P3as/s1600/with_dish5.png" height="250" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Spectrum obtained by frequency switching. The structure of the bandpass is mostly removed. (You might wonder why the edges left and right are still visible; this is due to wideband interference signals with non-constant amplitude. In a more noise-free environment, those should not be visible either and the baseline should be completely flat)</td></tr>
</tbody></table>
As you can see, the bandpass shape is removed, and the actual astronomical signal is visible in the middle (this is already averaged for a while, though).<br />
<br />
Another interesting thing is to look at the waterfall plot of the record, i.e. encode signal intensity by color, and use the y-axis for time instead:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjChMuvUnA8ggqw9zCkAXLBhMWd7btzVxECXmDhkaQH9w5LmXrNaTvrSAtw-3BK7H6EUylkVsa2n6eEfxxCpdrg8CZxzAfR7D_ujo-OlyrVGKq1REhNQBmgWFZqQwfBULBLsxsCDRFwJh4/s1600/with_dish3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjChMuvUnA8ggqw9zCkAXLBhMWd7btzVxECXmDhkaQH9w5LmXrNaTvrSAtw-3BK7H6EUylkVsa2n6eEfxxCpdrg8CZxzAfR7D_ujo-OlyrVGKq1REhNQBmgWFZqQwfBULBLsxsCDRFwJh4/s1600/with_dish3.png" height="250" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Waterfall diagram of the acquired signal. </td></tr>
</tbody></table>
The relatively faint green vertical stripe around x=1000 is the signal we are looking for. Other vertical stripes are narrow-band interference; horizontal stripes are temporary but broad-band interference.<br />
<h3>
Next steps</h3>
<br />
The next thing I will try to do is build another of those boards, and do a bit of interferometry. Stay tuned!scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com1tag:blogger.com,1999:blog-7888156866269720289.post-584331906368053972014-09-15T01:51:00.000+02:002014-09-15T02:49:48.308+02:00Snippets in Kate 5Recently I spent some time to port and clean up the Snippets plugin and the underlying template interface for Kate 5. It's now fully working again and more powerful than ever. The template code was originally written by Joseph Wenniger and most of what I show here is still working like originally implemented by him. Still, there were some improvements I would like to show; also, I'm sure many readers might not be aware of this great feature at all.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC9PQXEgZWnDZiRNQ7l2zGqOeAUoF4oc7IhWE0LhAaupxTNTN-RgtxtghJcT9hWnQbkgdEZt6ZdqOwt0sElleuk5u0WBT3D6FERNiTyjeeoIqADhZzee8CzhqWxJ5I-lXF6-BXSza6AM4/s1600/test.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC9PQXEgZWnDZiRNQ7l2zGqOeAUoF4oc7IhWE0LhAaupxTNTN-RgtxtghJcT9hWnQbkgdEZt6ZdqOwt0sElleuk5u0WBT3D6FERNiTyjeeoIqADhZzee8CzhqWxJ5I-lXF6-BXSza6AM4/s1600/test.png" height="400" width="370" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Classical snippets use case: insert a for loop witout having to type the iterator variable three times.</td></tr>
</tbody></table>
The template interface, which is part of the long-time stable KTextEditor API, was heavily cleaned up and now just consists of a single function<br />
<pre> bool insertTemplate(const KTextEditor::Cursor& insertPosition,
const QString& templateString,
const QString& script = QString());</pre>
which inserts a template into a view at the given position. It's very easy to use and still powerful -- if you write an application which uses KTextEditor, it might be worth to spend a moment thinking about how you might be able to make use of it.<br />
I also heavily refactored the implementation of the interface. More than 1000 lines of code were removed while effectively enhancing functionality. <br />
<h3>
Core functionality changes</h3>
I changed the language of the snippets a bit to make it more clear and easy to use. In the following, I want to give a short overview of how it works now. <br />
<br />
The heart of the templates (or snippets) are editable fields (shown in green). They are created in the template string by writing <span style="font-family: "Courier New",Courier,monospace;">${fieldname}</span>. They can have a default value, which can be any JavaScript expression. Pressing Tab jumps between the fields of a template. Whenever such a field is changed, all so-called <i>dependent</i> fields are updated. Those can simply be mirror fields (created by having a second field with the same name), or can do something which depends on the contents of the other fields in the template, such as perform replacements or concatenations. Again, you can have arbitrary JavaScript expressions doing that.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikBlFYRrwLu10BL_NiGemXImzzTW_kQKSDgb1SAdv7lfB5cS4KcfqraHgo5mS8MMIz7_Tad3FrOq-MAdacir2hXbKpwsg2srd2BmS1SUd01w4lWVC4nTYfvUowi8VMDX5zIP14YM41f7o/s1600/find_replace.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikBlFYRrwLu10BL_NiGemXImzzTW_kQKSDgb1SAdv7lfB5cS4KcfqraHgo5mS8MMIz7_Tad3FrOq-MAdacir2hXbKpwsg2srd2BmS1SUd01w4lWVC4nTYfvUowi8VMDX5zIP14YM41f7o/s1600/find_replace.png" height="400" width="370" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">An example snippet (not very useful in practice) which has three editable fields (find, replace and sample_text) with a default value for each. Changing the values will update the result in the red "dependent" field in real-time.</td></tr>
</tbody></table>
Noticeable improvements over the previous functionality (from KDE 4 times) is that you can have fields with arbitrarily complicated default values which are still editable, and that the dependent fields can use all other fields as input (not just one like in KDE 4). It is now also possible to have inline JavaScript doing simple operations in the template.<br />
<br />
The Shortcuts feature for the snippets now actually works in Kate.<br />
<br />
Snippets now also have proper undo; in KDE 4, only a single character typed could be undone at once while editing a snippet. Now, undo grouping works like it always does. <br />
<h3>
User interface improvements</h3>
For easy testing of your snippets, the "Edit Snippet" dialog has a "Test
snippet" button now, which lets you test your snippet on-the-fly. <br />
The user interface was simplified by removing unneeded options, and an inline quick-help feature was added which introduces the user to the most important features of the snippet language. Just click the "More" button.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb1YBtnIYE8w_iHxT63KBT6nKGybXrS15lw7gcgcQpAahnzmnvLVkh-pvexQlS2uZhVHlvBjRkO5X_Lt-9q1uxRgjvok6rcoqZ4vcVDUYdjtQuh6TLwHxx20LqSWiAy1Y4z8NxdwegTMo/s1600/help.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb1YBtnIYE8w_iHxT63KBT6nKGybXrS15lw7gcgcQpAahnzmnvLVkh-pvexQlS2uZhVHlvBjRkO5X_Lt-9q1uxRgjvok6rcoqZ4vcVDUYdjtQuh6TLwHxx20LqSWiAy1Y4z8NxdwegTMo/s1600/help.png" height="315" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Inline documentation on how snippets work</td></tr>
</tbody></table>
<h3>
An example: C++ Header guards</h3>
As an example for how this feature works, let's look at how to create a snippet to generate a C++ header guard. First, create a repository for your C++ snippets:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBiQQzYCKvZ37goo6t_BPL2lI6CGDNHYcgGyUPb1yPj20lfoQ20Z8Y8muy7_dRViPx9H51BBRKn4iiENxmXB_FxcPqNwknWaVBdU0pCSOmh_NhsqL747c8jS1osE97fAJbf7MR3JnMRmA/s1600/test.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBiQQzYCKvZ37goo6t_BPL2lI6CGDNHYcgGyUPb1yPj20lfoQ20Z8Y8muy7_dRViPx9H51BBRKn4iiENxmXB_FxcPqNwknWaVBdU0pCSOmh_NhsqL747c8jS1osE97fAJbf7MR3JnMRmA/s1600/test.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Open the Snippets toolview and click "Add Repository".</td></tr>
</tbody></table>
Then, enter a name and specify that you want this only for C++ files:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPaAMu7KDDbw-yrh_mysRHxM9Z8itS8_ZG4samaXVfE0Xe2RtrXd5z5CoOxt-2FJ2uu9ySp0pxcyAuNkkPPZ-Vofh5CzSLnkiwE9G2suxJRdoNJ6NjYuBq9fwtj7XylvdUsRNRejB9HXw/s1600/createrepo.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPaAMu7KDDbw-yrh_mysRHxM9Z8itS8_ZG4samaXVfE0Xe2RtrXd5z5CoOxt-2FJ2uu9ySp0pxcyAuNkkPPZ-Vofh5CzSLnkiwE9G2suxJRdoNJ6NjYuBq9fwtj7XylvdUsRNRejB9HXw/s1600/createrepo.png" height="277" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Create your new repository.</td></tr>
</tbody></table>
Then, add a snippet:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ1i2dPev4lS_PHuzMmSa0Fs1knb9guuVLkDQGRGJVhmNnlOWEwyHeP6d2H45Y24_xnlOuhyt0u5dadXK-SaXfJLuL_enFMFOFOdEvRNNbzLV79S_b6-IuajZF0ovOhDWMEm9h6pFFOJ8/s1600/add.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ1i2dPev4lS_PHuzMmSa0Fs1knb9guuVLkDQGRGJVhmNnlOWEwyHeP6d2H45Y24_xnlOuhyt0u5dadXK-SaXfJLuL_enFMFOFOdEvRNNbzLV79S_b6-IuajZF0ovOhDWMEm9h6pFFOJ8/s1600/add.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Add a snippet. Easy.</td></tr>
</tbody></table>
<br />
You can retrieve the document's file name from the editor, make it upper-case and replace dots by underscores automatically to get a nice header-guard-suitable format by using code like this:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjutjfuAApj6SiqOJHO8AaeimDj-M3Gvh7IlPyeSkPq3YZTb6CKln5P9SaBe_J-2BvCAy5w1SPG5b8QnQtOk6xIIuwqbFtCBgKZocPIAftcYVIwo5Hb5zYcg10s8aBpD9qoUZgF3ehl_U4/s1600/editdialog.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjutjfuAApj6SiqOJHO8AaeimDj-M3Gvh7IlPyeSkPq3YZTb6CKln5P9SaBe_J-2BvCAy5w1SPG5b8QnQtOk6xIIuwqbFtCBgKZocPIAftcYVIwo5Hb5zYcg10s8aBpD9qoUZgF3ehl_U4/s1600/editdialog.png" height="363" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Example code for how you can create C++ header guards fully automatically.</td></tr>
</tbody></table>
If you do not want the guard field to be editable, just create a function which does the <span style="font-family: "Courier New",Courier,monospace;">upper(fileName...) </span>stuff, and have three fields which call the function (like <span style="font-family: "Courier New",Courier,monospace;">${func()}</span>) instead of the two mirror fields and one default-valued editable field. If you do that, the template handler will immediately exit and not present any editable fields.<br />
The <span style="font-family: "Courier New",Courier,monospace;">${cursor}</span> variable can be used to place the cursor after all fields were filled. When you type something there, the handler will exit.<br />
<br />
Click Ok. Now, to use your snippet, either press the shortcut you defined (if any), click it in the snippets toolview, or use code completion:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxnoYfm2LJtkDCoUv-jZcbo9dFNSNTOwFnR6ZJoam2I51YZNSOrSv6d1AQnT14ax53VMiS1xFsowG-RC4X6OKEioiElPTW_D_cz02vE2El-pRDaZCzFZ8GxaHylCTl7lawh4FWrY-DVqk/s1600/completion.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxnoYfm2LJtkDCoUv-jZcbo9dFNSNTOwFnR6ZJoam2I51YZNSOrSv6d1AQnT14ax53VMiS1xFsowG-RC4X6OKEioiElPTW_D_cz02vE2El-pRDaZCzFZ8GxaHylCTl7lawh4FWrY-DVqk/s1600/completion.png" height="273" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Snippets appear in code completion.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVo3RIcnZEaiJJgVIAn6O69EDNXelP_v_AQMu3cCEbfq969e4YOOgOi40jJdjMWS_PoCQwJ7YKVVP4eLU_1TAKA4u32-yTQK-KQrMRsKsL9fVBDuLN0OaqAl_gjgTgP4Mhbz8mcL2uJZs/s1600/executed.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVo3RIcnZEaiJJgVIAn6O69EDNXelP_v_AQMu3cCEbfq969e4YOOgOi40jJdjMWS_PoCQwJ7YKVVP4eLU_1TAKA4u32-yTQK-KQrMRsKsL9fVBDuLN0OaqAl_gjgTgP4Mhbz8mcL2uJZs/s1600/executed.png" height="270" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Result after executing our new header guard script. A sensible default value was selected automatically. Pressing Escape or Alt+Enter will exit the template handler and place the cursor at the point marked with <span style="font-family: "Courier New",Courier,monospace;">${cursor}</span> in the template.</td></tr>
</tbody></table>
That should hopefully equip you with most of the knowledge you need to write your own snippets. If you like, you can use the full kate scripting API to write snippet code -- it for example allows you to retrieve the text in the current selection and similar useful things.<br />
<h3>
Some more examples on what you can do </h3>
Here's a few snippets demonstrating the features of the engine while partly being of debatable practical relevance. I'm sure you can come up with better use cases for some of those things though.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5CA6jbWzGxBi0bgHFEePkJIQpme3DouTETudIc31JUQqxAFwGpNdAqP6C9v4h59gzXuEFxkCaN_pyOeFXG4RRUhb_NmweTAzpuETt5YOtMOzbvq0uJP1AWSRjsw2gFdi1JC8yternWww/s1600/regex.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5CA6jbWzGxBi0bgHFEePkJIQpme3DouTETudIc31JUQqxAFwGpNdAqP6C9v4h59gzXuEFxkCaN_pyOeFXG4RRUhb_NmweTAzpuETt5YOtMOzbvq0uJP1AWSRjsw2gFdi1JC8yternWww/s1600/regex.png" height="391" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Write a clean regular expression in a comment and have the snippet mirror it with added extra-backslashes and removed spaces in a QRegularExpression variable. Makes regular expressions even more write-only than they already are.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTvcH-PFsL9MbYKA6-vlGZXwxpE8eI8KRAYg_2iPG_dgvv_zkA0YtKDcfHVrO_WVW4sw4JQ1LqDXcfulp6fnuN3MJ4LdRJxSJmKohY7a9rR2VlWhjiS7hNDRT_ZSSsxhPsFa3vDl2SwpE/s1600/encoding.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTvcH-PFsL9MbYKA6-vlGZXwxpE8eI8KRAYg_2iPG_dgvv_zkA0YtKDcfHVrO_WVW4sw4JQ1LqDXcfulp6fnuN3MJ4LdRJxSJmKohY7a9rR2VlWhjiS7hNDRT_ZSSsxhPsFa3vDl2SwpE/s1600/encoding.png" height="376" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Get the file encoding from the editor and use it as the coding of a python file header.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfY08ygouCoemligBhRCwWWpWlRhIhnmTbCwqBPPv4LeaKC20XAS12EUHunXPuX0rB4gQ2PJ33GK_xfhyphenhyphen8kdeMCSHxW1NaMmqOjfcwjm2tl4Sa0Uh8MjWPJzC4PADqXeZtg-6YCbAhZBo/s1600/b64_before.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfY08ygouCoemligBhRCwWWpWlRhIhnmTbCwqBPPv4LeaKC20XAS12EUHunXPuX0rB4gQ2PJ33GK_xfhyphenhyphen8kdeMCSHxW1NaMmqOjfcwjm2tl4Sa0Uh8MjWPJzC4PADqXeZtg-6YCbAhZBo/s1600/b64_before.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Some base64 in the selection ...</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT3Chcub4o-9RCV9qppPpz54k0FDhYcV6o2-Ct8abjZ0tj2hQcPYjiQLYM8OFb-sZi7kyEMD2ZrcJ_rHAMwrrlm-g4UPkrKeyAR8iXpMpEUU7SmRH_rKFB6kbNcOtHKhA0twgqZhAPbmA/s1600/b65_after.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT3Chcub4o-9RCV9qppPpz54k0FDhYcV6o2-Ct8abjZ0tj2hQcPYjiQLYM8OFb-sZi7kyEMD2ZrcJ_rHAMwrrlm-g4UPkrKeyAR8iXpMpEUU7SmRH_rKFB6kbNcOtHKhA0twgqZhAPbmA/s1600/b65_after.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">... decoded by a snippet which takes the selection and inserts the base64-decoded result.</td></tr>
</tbody></table>
<h3>
Next steps</h3>
My next step will be to make this plugin loadable in KDevelop as well -- which should be quite easily possible due to the awesome work done in kate to make the plugin infrastructure more generic. If you have further ideas on how to improve the snippets, let me know :)scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com11tag:blogger.com,1999:blog-7888156866269720289.post-15160721982765985212014-08-30T00:55:00.000+02:002014-08-30T00:58:37.552+02:001420.4 MHz Hydrogen line: There it is!With a reasonably simple setup, I finally succeeded in detecting the 1420.4 MHz galactic hydrogen hyperfine structure line:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiM4vSmepbEYWCLsy7iS62sw6wFHOewfqJj43c9BX6yq5zAs2_lOrrzMfXscjf2SQFu5yystII0wgIAD0Htf913i4fH7D-Wg7-JzNGCvg55eZ4Kt2L-cUNh7o5pYJY0fjrPajmU82y2aS8/s1600/firstlight.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiM4vSmepbEYWCLsy7iS62sw6wFHOewfqJj43c9BX6yq5zAs2_lOrrzMfXscjf2SQFu5yystII0wgIAD0Htf913i4fH7D-Wg7-JzNGCvg55eZ4Kt2L-cUNh7o5pYJY0fjrPajmU82y2aS8/s400/firstlight.png" height="240" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">One of the first successful measurements. The little bulge in the center of the image is the hydrogen line. The sharp, high peaks are man-made interference and not part of the astronomical signal. The yellow line is with the telescope pointed towards the milky way, the pink line is for a different location far off (the bulge is gone here, as should be). The different base levels are probably mostly caused by different elevations leading to different amounts raditation from the ground reaching the antenna.</td></tr>
</tbody></table>
<h3>
Setup </h3>
The setup consists of a 1.2m dish with a feed and two homemade 1.4 GHz low-noise preamplifiers. The amplifiers have about 19dB of gain each at 1.42 GHz and a noise figure too small to measure for my equipment (certainly below 2dB I would claim). The simulated noise figure is about 0.4dB, but that is without taking the Q factor of the matching components into account. A spectrum analyzer (Rigol DSA 815) is used as the detector for now.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPZ9sGFLJwT0hDiqhyphenhyphenli2Qh0MGDNG_PZwhWBkTB6_Qfq4onIXxxfFOQGRZfHKwKd_dgF2OBhL2iy2XiswZVCP8rHjrcd4mZDSQSEcoEnBzucGHs70JPAJHSLRLn32Bg_EStoZ1ZPHTodw/s1600/board_construction.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPZ9sGFLJwT0hDiqhyphenhyphenli2Qh0MGDNG_PZwhWBkTB6_Qfq4onIXxxfFOQGRZfHKwKd_dgF2OBhL2iy2XiswZVCP8rHjrcd4mZDSQSEcoEnBzucGHs70JPAJHSLRLn32Bg_EStoZ1ZPHTodw/s400/board_construction.jpg" height="267" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Preamplifier made by hand: traces are cut in a copper-coated epoxy board and components are soldered onto the board (linear voltage regulator as example). For small boards with low component count I found this technique to be significantly simpler than toner-transfer etching -- and no less effective.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRP0-39Hycs2fRYLAjN5HI57oa56SFJUVJG4QfEo-Jt4pubpTQsj1IcnTqEonwJwvw-xkc170QDIZ_yCLam1ZEgsdlIKIMV0X4e58hfDyFC8qUqT8v59hP-8IRVa79rWAIUU_k1tgxvu4/s1600/both.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRP0-39Hycs2fRYLAjN5HI57oa56SFJUVJG4QfEo-Jt4pubpTQsj1IcnTqEonwJwvw-xkc170QDIZ_yCLam1ZEgsdlIKIMV0X4e58hfDyFC8qUqT8v59hP-8IRVa79rWAIUU_k1tgxvu4/s400/both.jpg" height="266" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Dish with mounted feed (for the latter, see text and pictures below)</td></tr>
</tbody></table>
Since you obviously cannot simply attach a coaxial cable to a parabolic dish reflector, a so-called <i>feed</i> is required to absorb the radiation collected by the dish reflector. I adapted a feed design commonly used for wireless LAN for the HI frequency (which is done by just multiplying all lengths by the ratio of the two frequencies). This design consists of a biquad antenna over a ground plane with two reflectors on the side (those are to make the radiation pattern more symmetric and fit the dish better). It provides an excellent match at the design frequency and seems to work well.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9TEAQDeAzeE3nfjYrIFsRQTcEoBgIZofTtqMINQsKJFax6C2LY4tkJxAmPMt8RAkUy0e-484IRGUL3waHmFPBqTLcABjN-4et8TAXyyCrGP3GA1LHnrs3QDo0jHbwUjXmZpVUSZ3myls/s1600/feed.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9TEAQDeAzeE3nfjYrIFsRQTcEoBgIZofTtqMINQsKJFax6C2LY4tkJxAmPMt8RAkUy0e-484IRGUL3waHmFPBqTLcABjN-4et8TAXyyCrGP3GA1LHnrs3QDo0jHbwUjXmZpVUSZ3myls/s400/feed.jpg" height="266" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Biquad feed. A piece of wire forming two squares is placed above a ground plane. The coaxial cable is attached at the back side and is connected to the wire. The feed can be moved back and forth to focus. Theoretically. If I had a criterion for when it is in focus. (Seriously though, I moved it towards the dish a bit and saw the spillover decrease (less unwanted radiation from the ground reaching the feed, i.e. base signal level drops) thus I picked a point roughly where I saw no further significant decrease in spillover)</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI6Kyqo4ioLy2OXvN-uBt-zOi5Q2vUw0AqdLl0p6cKhRGvEIVr1DCJRjDobbedGKvO4ipFdycfVDsm0urVfteWYlQBINRur0VKK69WPKUfWRoTbI6pG3WAKU3HMlAHIihTNg-MmEgOxs0/s1600/feed_back.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI6Kyqo4ioLy2OXvN-uBt-zOi5Q2vUw0AqdLl0p6cKhRGvEIVr1DCJRjDobbedGKvO4ipFdycfVDsm0urVfteWYlQBINRur0VKK69WPKUfWRoTbI6pG3WAKU3HMlAHIihTNg-MmEgOxs0/s400/feed_back.jpg" height="266" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Biquad feed and the two amplifiers from the back side. The preamplifier is connected directly to the feed with a SMA connector. Note the paper towel roll wrapped in tape which is hot-glued to the feed for mechanical mounting (hey, it works!)</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUSxgohmm2Kr8R02Ym9qQefz79le2eFKisvy9pFnodPQINalNj7So9VxZD-pgNtCmrFh6BLGGkd5W5Fc4VS5zGd_oID7LzyxyR3PCybFnIHRnPNK3TrtnuDKJxJz15i9UjVEcnIjVE8i4/s1600/feed+s11.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUSxgohmm2Kr8R02Ym9qQefz79le2eFKisvy9pFnodPQINalNj7So9VxZD-pgNtCmrFh6BLGGkd5W5Fc4VS5zGd_oID7LzyxyR3PCybFnIHRnPNK3TrtnuDKJxJz15i9UjVEcnIjVE8i4/s400/feed+s11.png" height="240" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">S11 of the biquad feed shown above. After a few adjustments, it provides an excellent match of more than 18dB return loss at the design frequency. That number means that less than two percent (10^(-18.21/10)) of the signal are lost due to feed mismatch.</td></tr>
</tbody></table>
For the more serious measurements I conducted, the detector (digital spectrum analyzer, gray box below -- the thing which makes the black screenshots with the yellow curves in them) is controlled by a computer. It records 4 sweeps with 30 seconds duration each and about 1 MHz bandwidth and averages them; the computer fetches the result and stores it on disk. The camping mat is metallic and serves as interference protection (yes, it actually works ... a bit). <br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzXR7dZ64V3mWUXbFaUcJuB8wL7fxT4BhTwtLk45j1oPI5asQy_DE_Ssn7V2e7qTcZNy2oH7JEnRnKaeFKVFhmpeWrLvIoft9SU_0PW9VPi1joYv3vmHb_bm1PRJM9dea4mWqkTtYTpWg/s1600/rfi_iso.JPG" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzXR7dZ64V3mWUXbFaUcJuB8wL7fxT4BhTwtLk45j1oPI5asQy_DE_Ssn7V2e7qTcZNy2oH7JEnRnKaeFKVFhmpeWrLvIoft9SU_0PW9VPi1joYv3vmHb_bm1PRJM9dea4mWqkTtYTpWg/s400/rfi_iso.JPG" height="266" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Metallic camping mats designed to isolate the user from low temperatures can also be used as faraday cages -- with moderate success.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC1odPu2DUrrsF2krgcanIvMR6vl9ak0faPEA6oPEoNK47OKC_-jWmTF8G6KQP4xdsts0gqCSc1DpRN7vw_2Zi0sgVFuWSOsUTNprViZLRdDjSinWnbDIsErF8wKU1B9NZoWsqNotR0RA/s1600/teleskop.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC1odPu2DUrrsF2krgcanIvMR6vl9ak0faPEA6oPEoNK47OKC_-jWmTF8G6KQP4xdsts0gqCSc1DpRN7vw_2Zi0sgVFuWSOsUTNprViZLRdDjSinWnbDIsErF8wKU1B9NZoWsqNotR0RA/s400/teleskop.jpg" height="266" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The complete setup. With chairs to prevent people from tripping over the wires. Left: Parabolic dish antenna with feed; Center: Laboratory power supply to power the amplifiers; right: Notebook and spectrum analyzer for recording the data.</td></tr>
</tbody></table>
<h3>
Results</h3>
With this recording technique, I was able to take some nice data sets. In all of them, the antenna points into a fixed direction of the sky and the sky moves across the picture. The x (right) axis is frequency; the y axis is time in the upper graph, and intensity in the lower one. Intensity is encoded as color in the upper graphs. Thus, if you look in the upper graph from top to bottom, you actually see different regions of the sky moving across the antenna. In the lower graph, you see the intensity of radiation of all those regions added together (the lower graph is the upper one integrated along the top-to-bottom axis, so to speak). All intensity scales are logarithmic.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM8Fgc-tNuBOMl2pzp5clq6cv-3xoHInvMakdDnHx1NuoTE4-oZCX6IIq1lvMrI5_aSF_OpPZlDpH-UOyOWzgaNw2-PnCG2naA5TDyTNlo-_7dR-yLxW85t4EoMfmGbaWmK1Zh0GPGTu4/s1600/cyg_cas_pers_rfi.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM8Fgc-tNuBOMl2pzp5clq6cv-3xoHInvMakdDnHx1NuoTE4-oZCX6IIq1lvMrI5_aSF_OpPZlDpH-UOyOWzgaNw2-PnCG2naA5TDyTNlo-_7dR-yLxW85t4EoMfmGbaWmK1Zh0GPGTu4/s400/cyg_cas_pers_rfi.png" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Started quite late in the night, with about 80° elevation (almost straight up); different parts (roughly Cyg, Cas, Perseus) of the milky way move through the picture.</td></tr>
</tbody></table>
Unfortunuately, my aiming is quite inaccurate and the antenna beam size is 10 degrees, so I can only very roughly tell what is currently visible in the picture. Still, in the picture above, you can clearly see three wide peaks which are HI emission, and three narrow peaks which are interference. We can remove the interference to get a nicer picture:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_SNXKjKtQhH-wn63z7305Z-ZfMAxkdzT37y5JLmBY3fv7vu4-VllHb9SxcHu6zRMEHkmaHrqgSiDkc9wtO4o9thAcALUukys5Ju21MR7iQ6CcEOpfbwCrCPaE1OpGp72R7z9APtGcBQQ/s1600/cyg_cas_pers.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_SNXKjKtQhH-wn63z7305Z-ZfMAxkdzT37y5JLmBY3fv7vu4-VllHb9SxcHu6zRMEHkmaHrqgSiDkc9wtO4o9thAcALUukys5Ju21MR7iQ6CcEOpfbwCrCPaE1OpGp72R7z9APtGcBQQ/s400/cyg_cas_pers.png" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Same picture as above after interference removal algorithm.</td></tr>
</tbody></table>
This works by manually flagging the locations of the interference peaks, and then fitting a curve of the form a*x^2+b*x+c+d*exp(-f*(x-e)^2) to those locations (second-order polynomial for the "real", wide spectrum and a gaussian-shaped peak for the interference).<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDt4n819NwnT0-upPvoV1Q6YzpFsZE96vRCjHN0yasuRG2hco-jCVqGYNAVjLkd4NKDkY0iHSjFpOdUi6OmEaTjXmYwNIC7Gmey0ZjbEB8dc5vts2kHlalnYgp5c3YTo3BXzjTC4WuTXI/s1600/rfi_removal.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDt4n819NwnT0-upPvoV1Q6YzpFsZE96vRCjHN0yasuRG2hco-jCVqGYNAVjLkd4NKDkY0iHSjFpOdUi6OmEaTjXmYwNIC7Gmey0ZjbEB8dc5vts2kHlalnYgp5c3YTo3BXzjTC4WuTXI/s400/rfi_removal.png" height="301" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Small section of the spectrum shown above with interference peak (center). The blue line is data, the green line is a fit of a*x^2+b*x+c+d*exp(-f*(x-e)^2) to the data.</td></tr>
</tbody></table>
The d*exp(-f*(x-e)^2) term is then simply subtracted from the data, which leaves only the baseline, without the interference peak. This method even partially "recovers" data hidden by the interference peak (how reliable that information is is a different question, but in this case it looks fine).<br />
After this treatment, you can clearly see three wide bulges in the curve.<br />
You might have noticed that the x axis is not labeled with frequency, but velocity. This is because the actual emission of the kind of radiation observed here only happens at one specific frequency (1.4204 GHz -- where the 0 in the graph is). Still, we see it at different frequencies because of <i>doppler shift</i>. Thus, the observed frequency of the radiation translates directly to the velocity with which the matter which emits the radiation moves towards us -- or away from us.<br />
I would carefully claim that the three observed peaks originate from three different spiral arms of the milky way which rotate with different velocities. I'm not sure if that is accurate though.<br />
<br />
With the same method, I took several more similar pictures of different regions of the milky way, some shown below.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEichNQBaz29NWW8TT88BX3KVBQUvOQ8G0rT7QWbg82aca7A2NOVYSAwzJl4Nm7pec6XLgCyHgfCb30KpzCWvYKo1LVALVQ8KfeRZxjHiHnNUbqP7enUD9LTweO6zXHsh0VyTCs80_-3jvs/s1600/perseus.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEichNQBaz29NWW8TT88BX3KVBQUvOQ8G0rT7QWbg82aca7A2NOVYSAwzJl4Nm7pec6XLgCyHgfCb30KpzCWvYKo1LVALVQ8KfeRZxjHiHnNUbqP7enUD9LTweO6zXHsh0VyTCs80_-3jvs/s400/perseus.png" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Transit of (roughly) Perseus through the beam.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaiUQvFENO5kKkAHVd6DIe2b698D1ZpKCaWfplS0TErzPQzx4o6rVfpSohQg6bANQ1uBS9PzuJCLfmaVnoXVNoR9ac9nlD9Qc3_Qigs4unyhHO8I3olvenZ-pQjG67kG-5XjeFDicEO8E/s1600/sag_aqu.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaiUQvFENO5kKkAHVd6DIe2b698D1ZpKCaWfplS0TErzPQzx4o6rVfpSohQg6bANQ1uBS9PzuJCLfmaVnoXVNoR9ac9nlD9Qc3_Qigs4unyhHO8I3olvenZ-pQjG67kG-5XjeFDicEO8E/s400/sag_aqu.png" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Transit of (again, roughly) Sagittarius / Aquila through the beam. Note that -- different from the pictures above -- all the matter observed here moves towards (positive velocity) us, not away from us.</td></tr>
</tbody></table>
<h3>
Future plans</h3>
My long-term plan is to attempt creating a survey of a significant part of the sky -- basically a map which tells how much HI radiation at what doppler shift is observed at which point of the sky. For that, I need two things: A reliable way to determine the antenna position; and a consistent way to compare signal amplitudes.<br />
For the former, I'm currently trying to build a tilt-compensated compass with elevation sensor (basically a three-axis magnetic field sensor and a three-axis acceleration sensor with software). It's working a bit, but not really.<br />
For the latter, in professional radio astronomy, one tool which is used is a <i>noise diode</i>. That is a small device which injects noise into the receiver system at the very start of the signal path (in my case, it's a small device inside the biquad feed). It is periodically switched on and off and adds a <i>constant</i> offset to the amplitude of the observed signal. The trick is that this constant offset is reliably constant, over long periods of time. When we see it change in the recorded data (and we will), we can be fairly sure this change is caused by the receiver system (amplifier, detector) changing -- for example because of temperature drift. Thus, by dividing the observed amplitude of this constant offset, signals amplitudes can be evaluted even if the receiver and detector system drifts.<br />
I built a zener-diode based noise generator which seems to work fine for my purpose. It can be switched on and off using a transistor and the Raspberry Pi GPIOs, and is powered by battery to get as little fluctuation as possible in the noise signal itself. The generator is attached to a small piece of wire as an antenna and is glued inside the feed. <br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN5xUIWRNyslwVsFJwqcZtv6dkfH2vK9TCJtnPTP73skPnyseerdWrzavgIR8X6epZZRUj-cH7d7APACHUlrEFTu9vg4iu3ZNpX8EPmHWX5O5DN8o_zV-gedhE4FPsTsQnZE7yrYOCSp8/s1600/noise+diode.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN5xUIWRNyslwVsFJwqcZtv6dkfH2vK9TCJtnPTP73skPnyseerdWrzavgIR8X6epZZRUj-cH7d7APACHUlrEFTu9vg4iu3ZNpX8EPmHWX5O5DN8o_zV-gedhE4FPsTsQnZE7yrYOCSp8/s400/noise+diode.png" height="240" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Noise diode test. Pink curve: noise diode powered on; yellow curve: noise diode off. This is without the feed and amplifiers, but it looks similar with them.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu7qHT2Rv_TJeMGETM9L9nkNvGjnzdQwTMc_KDiKJX6WRGv0dPe8XtXL3KVqsFMERwrZHtH81v5S5vM6NxlwxCeGyCQaEWgnwQ3D9a5bS7Yhtou9AdCxxKXP2xjpPxoUxbmAoKNfkN7f8/s1600/cal_diode.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu7qHT2Rv_TJeMGETM9L9nkNvGjnzdQwTMc_KDiKJX6WRGv0dPe8XtXL3KVqsFMERwrZHtH81v5S5vM6NxlwxCeGyCQaEWgnwQ3D9a5bS7Yhtou9AdCxxKXP2xjpPxoUxbmAoKNfkN7f8/s400/cal_diode.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Noise diode test with actual sky data. Unfortunately, no real astronomical signal visible this time :( The upper graph is as explained above (x-axis frequency, y-axis time), the lower graph has time on the x-axis and integrated intensity on the y-axis. The spikes in the lower graph and the stripe pattern in the upper graph is the switching of the noise diode. Performing a calibration would bring all the spikes to an equal height, and then remove the spikes.</td></tr>
</tbody></table>
<h3>
Caveats of using a spectrum analyzer as a detector for radio astronomy</h3>
It took me a while to figure out how to best configure the spectrum analyzer for this purpose. One thing which is easy to overlook (because it is nearly irrelevant in most applications) is that a spectrum analyzer does sweeping measurements, i.e. it measures intensity at one frequency span at a time, then goes to the next etc. This means the resolution bandwith (RBW), which basically controls the spectral resolution of the analyzer, also controls how much signal power is detected at once during the sweep. If it is set to 100 Hz, the analyzer will walk through the whole frequency span in 100 Hz chunks, detecting only 100 Hz of the spectrum's power at once. If set to 10 kHz, it will detect a hundred times as much power at once -- which gives an effective signal-to-noise ratio which is a hundred times better in the end! This is very unintuitive because the noise level displayed by the analyzer actually <i>increases</i> for higher RBW values (which makes sense of course if you think about it: if you accumulate a larger part of the spectrum into a single channel, that channel will have more noise power overall). Thus, when using a spectrum analyzer for this purpose, you have a trade-off between S/N and spectral resolution (you always have a trade-off between S/N and spectral resolution, but in this case it's far more grave than usual -- exponent 3/2 instead of 1/2 [as usual] for the channel count if I'm not mistaken). I selected 10 kHz spectral resolution, more resolution (lower RBW) certainly makes no sense for this kind of signal. Probably 30 kHz would be fine as well -- but that makes interference detection and removal harder again because the narrow interference peaks are quite smeared out.<br />
This also means a spectrum analyzer is not a very good detector for this kind of telecope -- with 10 kHz RBW and 1 MHz bandwidth (about what I used above) 99% of the signal power are lost simply because they are not detected at a given time.<br />
<h3>
Conclusion</h3>
It is very nice to finally see some results come out of this project. I'm looking forward to improving the receiver system (eventually I want to replace the analyzer by an A/D converter + mixer) and the calibration process.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzXR7dZ64V3mWUXbFaUcJuB8wL7fxT4BhTwtLk45j1oPI5asQy_DE_Ssn7V2e7qTcZNy2oH7JEnRnKaeFKVFhmpeWrLvIoft9SU_0PW9VPi1joYv3vmHb_bm1PRJM9dea4mWqkTtYTpWg/s1600/rfi_iso.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDt4n819NwnT0-upPvoV1Q6YzpFsZE96vRCjHN0yasuRG2hco-jCVqGYNAVjLkd4NKDkY0iHSjFpOdUi6OmEaTjXmYwNIC7Gmey0ZjbEB8dc5vts2kHlalnYgp5c3YTo3BXzjTC4WuTXI/s1600/rfi_removal.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaiUQvFENO5kKkAHVd6DIe2b698D1ZpKCaWfplS0TErzPQzx4o6rVfpSohQg6bANQ1uBS9PzuJCLfmaVnoXVNoR9ac9nlD9Qc3_Qigs4unyhHO8I3olvenZ-pQjG67kG-5XjeFDicEO8E/s1600/sag_aqu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC1odPu2DUrrsF2krgcanIvMR6vl9ak0faPEA6oPEoNK47OKC_-jWmTF8G6KQP4xdsts0gqCSc1DpRN7vw_2Zi0sgVFuWSOsUTNprViZLRdDjSinWnbDIsErF8wKU1B9NZoWsqNotR0RA/s1600/teleskop.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS687LDl7KFQWF3mucW9o7dLjtJrtBZszQm5gj14nceE_4qu9iwxSygFHr1jdc1PqR4AKwoJeZ9nUFHflsnDRBBvtoI3QWyUFhV_ZLZpMuCN_9bhLSyNbbC2bPpmqBPNpsygNU7gFXsAg/s1600/teleskop_feed.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiM4vSmepbEYWCLsy7iS62sw6wFHOewfqJj43c9BX6yq5zAs2_lOrrzMfXscjf2SQFu5yystII0wgIAD0Htf913i4fH7D-Wg7-JzNGCvg55eZ4Kt2L-cUNh7o5pYJY0fjrPajmU82y2aS8/s1600/firstlight.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com3tag:blogger.com,1999:blog-7888156866269720289.post-37576284736632185412014-07-23T15:54:00.000+02:002014-07-23T15:55:21.443+02:00Project: Detecting the 1420.4MHz hydrogen line -- status reportA while ago, I decided it would be a fun thing to try to detect the 21cm hydrogen line. The 21cm line is a hyperfine structure line of hydrogen; the latter is abundant in interstellar matter in our galaxy (and in other galaxies too). That makes this transition's radiation an interesting object to study, especially because you can determine the velocity of the regions emitting the raditation quite precisely by looking at the doppler shift of the radiation. That makes it possible to construct for example rotation profiles of galaxies. You can do that even if your spatial resolution is low (which is important, since spatial resolution is limited by the size of your antenna: as a rule of thumb, the area you see as one big smeared "pixel" is about the inverse of the size of your antenna expressed in wavelengths taken as radians -- so if your antenna is 1.05m big, which is 5 wavelengths at 21cm, that gives you a spatial resolution of about 1/5rad which is about 11 degrees. That's about 22 sun diameters, which is really bad if you wanted to make an image of the sky).<br />
<h3>
An antenna</h3>
First thing you need is an antenna. For this purpose, I built a 14-element Yagi antenna, as seen below.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOmwNLBBqVRNq43aZqhlL0JYIBgQ7x3soosFTqCJOs5IlCU1OfLMWSwxssbLQnY1Bzt4PxG94rjW0vg-zhm-BYCLdghQcBbmargjqlYCEf1nz7QtkXCZDFBJtwaVVF2Q5WAeojZmu_8gQ/s1600/yagi.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOmwNLBBqVRNq43aZqhlL0JYIBgQ7x3soosFTqCJOs5IlCU1OfLMWSwxssbLQnY1Bzt4PxG94rjW0vg-zhm-BYCLdghQcBbmargjqlYCEf1nz7QtkXCZDFBJtwaVVF2Q5WAeojZmu_8gQ/s1600/yagi.jpg" height="158" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">14-element 1.4GHz Yagi antenna</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhkPaaBf76KYCq1enaREKPaPhAcjqttMBLxX6SQkwwIR_NT2aJ3IE5sW2JZFnaDmcYO2HWtAL9IAH6wbNPUyURmSN7OiFImL-YCmlqvjRlrTJCPU7ypMVBsUmzjZxqw0gz6ZYm8Nk4Vhg/s1600/closeup.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhkPaaBf76KYCq1enaREKPaPhAcjqttMBLxX6SQkwwIR_NT2aJ3IE5sW2JZFnaDmcYO2HWtAL9IAH6wbNPUyURmSN7OiFImL-YCmlqvjRlrTJCPU7ypMVBsUmzjZxqw0gz6ZYm8Nk4Vhg/s1600/closeup.jpg" height="266" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Closeup of the amplifier next to the resonator of the antenna. The circuitry is hidden below the copper shielding.</td></tr>
</tbody></table>
It has quite a lot of tape on it -- I underestimated the size and need for mechanical stability a bit. For the next try, I will definitely use a more sturdy piece of wood as the base. Anyways, first measurements indicate that it should work well enough; not great, but good enough for a first test.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1zNWYSTbsHaqLm-2DLS_0yQ5I5-pVaC6ylFlxFjAcFbdnCROVO_z9m9BDcBVjND0IDWL3EzsA7nGkO5sDnt6eUYdqkcDc59cRfGmkwAJ8ZLS5roWCN-2wGAzuL-ypIlyEu7Clybx_iNM/s1600/yagi_s11.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1zNWYSTbsHaqLm-2DLS_0yQ5I5-pVaC6ylFlxFjAcFbdnCROVO_z9m9BDcBVjND0IDWL3EzsA7nGkO5sDnt6eUYdqkcDc59cRfGmkwAJ8ZLS5roWCN-2wGAzuL-ypIlyEu7Clybx_iNM/s1600/yagi_s11.png" height="240" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">S11 of the yagi antenna shown above. x is frequency, y is log reflected power (lower is better).</td></tr>
</tbody></table>
<h3>
A Preamplifier</h3>
The second thing in the signal path is a preamplifier, which is usually placed directly at the antenna and has the purpose of amplifying the received signal before any degradation can happen (e.g. through cables, which weaken the signal and add noise). The <i>noise figure</i> of the preamplifier (which is often called <i>LNA</i>, for low-noise amplifier) is important; it tells how much additional noise will be present in the detected signal. The noise figure of all subsequent amplifiers is usually not relevant: they amplify the noise added by the LNA, which is far worse than their own added noise. Thus, it makes sense to carefully design the very first amplifier, while the rest of them can be as cheap and simple as possible.<br />
It is very difficult to design a good LNA though; so for some first tests, I use a generic wideband amplifier IC as my preamplifier, which has a not-very-good noise figure of 2dB. I hope it will work as a proof-of-concept; I plan to add a proper LNA later then.<br />
<h3>
More amplifiers </h3>
The next thing you want to do is to somehow amplify the received signal so much that its quality is limited by thermal noise: as soon as you reach that point, further amplification buys you nothing, you need to improve the antenna or cool your LNA. How much amplification that is exactly will depend on the circumstances, but since my measurement device can detect power levels down to roughly -120 dBm/Hz without problems and thermal noise from the antenna will probably be somewhere around -180 dBm/Hz, I will need somewhere around +60dB amplification at least -- better a bit more. That's about a factor one million more power.<br />
<h3>
Wide-band gain blocks are not a solution for every problem :(</h3>
My first attempt to achieve this was to use several more wideband amplifier blocks -- since they're cheap (~3€) and incredibly easy to use (connect signal in, signal out, add 5V power, done). That wasn't a very good idea for two reasons though: <br />
First, besides the noise figure, another not-so-obvious disadvantage of a wideband amplifier is that it is, well, wideband: it will amplify everything, especially for example the very bright GSM (mobile phone stuff) band around 937 MHz. That is bad, because such a strong signal can cause intermodulation products which affect the quality of the signal you actually want to detect, or even cause the amplifiers to go into saturation.<br />
Second, it is very easy to turn broadband amplifiers into oscillators. You have to strictly separate them from each other and avoid any kind of feedback, or they will start spitting out large power levels at seemingly random frequencies.<br />
Both problems seem easy to solve by building a bandpass filter -- but I found it quite hard to build a good bandpass filter for 1.42GHz. It is a frequency where lumped-element filters (those made out of capacitors and inductors) are not really viable any more since you need capacitors with incredibly small values, while distributed-element (<a href="http://scummos.blogspot.de/2013/01/rf-microstrip-breadboard.html">microstrip, see this blog post</a>) filters are not that great either because a half- or quarter wavelength of 21cm is still pretty large.<br />
<h3>
A new experiment: Frequency Mixers</h3>
All those resaons taken together brought me away from using this simplest possible solution, so I decided to try what all the cool people do: use a frequency mixer to bring the signal down to a more manageable frequency after the preamplifier, then amplify and filter it at that low frequency. A frequency mixer is effectively a device which shifts the spectrum of a signal along the frequency axis: Mixing a 1GHz sine with a 995MHz sine will result in signals at the difference (and the sum) of those frequencies, so a 5MHz sine (and a 1995MHz sine, but that can easily be filtered away -- if you don't want it). Signal components which are shifted below 0Hz appear mirrored at the appropriate positive frequency (so, if a signal would be shifted to -3MHz, it will appear at 3MHz instead -- with a phase shift, but that is barely relevant).<br />
Mixers are very versatile devices which are used basically everywhere where radio frequency signals are present -- for example in WLAN, in GSM, radio, or satellite television (in the latter, there's actually a mixer in the LNA thing which you put in front of your satellite dish which shifts the received ~10GHz signal to somewhere around 2GHz to reduce losses in the cable to your TV receiver).<br />
Professional radio astronomy applications tend to use more than one mixer stage to lower the frequency gradually (that has various advantages mostly related to filtering), but I hope I can get away with just one stage for this project.<br />
<br />
I thus built a test board based on the <a href="http://www.farnell.com/datasheets/1717059.pdf">LT5560</a> mixer (~3€) which is designed to mix a 1420 MHz signal down to 20 MHz using a 1400 MHz local oscillator (LO, that's the name for the frequency you're mixing the signal you're interested in with). As the LO, I use a programmable frequency synthesizer I built a while ago which is based on the <a href="http://www.analog.com/static/imported-files/data_sheets/ADF4350.pdf">ADF4350 </a>(~8€, but wow that thing is difficult to put on a working board -- took me three attempts with a new board design each).<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfH9kYXWg6CiGR0LnjaZ3p2OPAoL-fGRTC9NRSck5dm5IBERCFUlwMklgiqb6WLtsrbvQ9qlHjbuxmU_O-WJlA9KPNpWwOCQcwZfWwcE1CSszx4x37rJjtNKzYvsaYKsOzjLC1y5b-RpA/s1600/freqsynth.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfH9kYXWg6CiGR0LnjaZ3p2OPAoL-fGRTC9NRSck5dm5IBERCFUlwMklgiqb6WLtsrbvQ9qlHjbuxmU_O-WJlA9KPNpWwOCQcwZfWwcE1CSszx4x37rJjtNKzYvsaYKsOzjLC1y5b-RpA/s1600/freqsynth.jpg" height="291" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">ADF4350-based frequency synthesizer (left) controlled by a raspberry pi (right). This construction is used as the Local Oscillator (LO) for the mixer. A 1399.5 MHz signal is produced by this circuit on the coaxial cable on the left.</td></tr>
</tbody></table>
<h3>
Balanced and Unbalanced signals </h3>
Apart from input matching, which is not very difficult to do since it is described in detail in the data sheet of the part, the one difficult thing which needs to be done when using a mixer of this type is that it requires <i>balanced</i> inputs, while the signal on your coax cable is usually <i>unbalanced</i>. The difference between those two is basically that the unbalanced signal has two voltage levels -- ground and the signal, while balanced has three, plus the signal, minus the signal, and ground. A device which converts one of those into the other is called a <i>balun</i> (for balanced-unbalanced). They always work both ways (balanced - unbalanced or unbalanced - balanced). A balun is usually made in one of two ways:<br />
<ul>
<li>transformer type: the unbalanced signal is passed into a transformer and by clever choice of taps on the load side you can get a balanced signal</li>
<li>delay line type: transmission lines of certain fractions of the wavelength of the expected signals (e.g. 1/4 and 3/4) are connected to the balanaced signal, and tap different phases of the wave form because of their different length, which allows to extract a balanced signal</li>
</ul>
The former only works for low-ish frequencies (I don't know exactly how high you can go while they're still usable, but it will be somewhere in the few-hundred-MHz area, at least for handmade ones), the second one works for high frequencies as well but is very narrow-band (it only works for one specific kind of signal). In my test board, both are used: a delay-line type balun is used to convert the unbalanced input from the LNA into a balanced signal, and a transformer-type balun is used to convert the balanced mixer output into an unbalanced signal for the next amplifier stage.<br />
I will not go into details on how to build those baluns here, but good documents describing how to do it include <a href="http://www.hard-core-dx.com/nordicdx/antenna/feed/4_1balun.html">this</a>, <a href="http://www.darc.de/uploads/media/Baluns__Ununs___Co_01.pdf">this (german)</a>, <a href="http://www.sm0vpo.com/antennas/balun0.htm">this</a> and <a href="http://www.klimaco.com/hamradiopages/hf_antennas.htm">this</a> (ready-made components are available and are not even very expensive, but I did not find any Europe-based distributor who actually sells them. And I don't want to pay $20 shipping fees and wait a week each time I need a part).<br />
I checked the performance of the self-made baluns with a spectrum analyzer and directional coupler, and they seem to work well after a few experiments -- although I am not entirely happy with the performance of the transformer-type one: a return loss of -13dB means about 1/20 of the signal power will get reflected back into the mixer, which is more than I would like. I think one reason for this is that the windings of the wire are a bit chaotic which makes the coupling between the windings a bit non-deterministic. Still -- all good enough for the prototype ;)<br />
The S11 curve of the delay-line one is much sharper than the one shown here, and it also has a better return loss at the design frequency.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE82d9TkUmDuyr_zsHHYODVU87doqFzRTpiU23Y7LVC0yHQngY9rA3cGbF6EdRMt-R_gqY0eLY1PQ-6BFgrKHrbBF5PeeJya50eiWRuHSehptJMyEhQ6x5c2ToXjSzlxDDgQEvRSg_Q3Q/s1600/16_1_balun2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE82d9TkUmDuyr_zsHHYODVU87doqFzRTpiU23Y7LVC0yHQngY9rA3cGbF6EdRMt-R_gqY0eLY1PQ-6BFgrKHrbBF5PeeJya50eiWRuHSehptJMyEhQ6x5c2ToXjSzlxDDgQEvRSg_Q3Q/s1600/16_1_balun2.png" height="240" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">S11 (return loss) of the transformer-type balun; x axis is frequency, y axis is log power</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM-We3JEgCzPCjCG9uBYD7NxLf2dSwNlDYokrh7lEqsQtEpz5y4jt_jFS_0FQleV1izfiWGC7ySvTC7oDZDwSTPKukmP0DIT00ljYNFYbzCLdw_KZnhyl4xkM4AXrkWTJBH2Rf1JZd-c4/s1600/transmission_line_balun.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM-We3JEgCzPCjCG9uBYD7NxLf2dSwNlDYokrh7lEqsQtEpz5y4jt_jFS_0FQleV1izfiWGC7ySvTC7oDZDwSTPKukmP0DIT00ljYNFYbzCLdw_KZnhyl4xkM4AXrkWTJBH2Rf1JZd-c4/s1600/transmission_line_balun.png" height="240" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">S11 of the delay line type balun. The resonance frequency around 1.4 GHz is easy to spot. The ripple at lower frequencies is probably at least partly an artifact of the measurement method. x axis is frequency, y axis is log power</td></tr>
</tbody></table>
<br />
But most important, it actually works:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha1R3D4tvXji0F6KPPDSGMF7yi9nxxgOXO0ZMwQ60QD_ByVVFdWPVrAJIXX5jeuluRUfYKtIBTYMBVP6Z-rxcZtgxfRj6RMayaBSRcC4A4rXSGMD4enaFst24z6tmnqF_K8lQngodrN2U/s1600/symmetric_0dbm.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha1R3D4tvXji0F6KPPDSGMF7yi9nxxgOXO0ZMwQ60QD_ByVVFdWPVrAJIXX5jeuluRUfYKtIBTYMBVP6Z-rxcZtgxfRj6RMayaBSRcC4A4rXSGMD4enaFst24z6tmnqF_K8lQngodrN2U/s1600/symmetric_0dbm.png" height="240" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Balanced signal created from an unbalanced input with the transformer balun. The yellow and teal curve show the plus and minus components of the balanced signal, the violet one is their difference, which resembles the original unbalanced signal. Input level is 0dBm.</td></tr>
</tbody></table>
A balun can also have an impedance transformation ratio, which in this case plays an important role in impedance matching. The transformer balun I built is a 16:1 balun, which takes a 800Ω unbalanced signal and turns it into a 50Ω balanced one -- very convenient for this mixer circuit here, since 800Ω is reasonably close to the mixer's output impedance (as detailed in the data sheet) at that frequency.<br />
<h3 id="results">Results</h3>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi4M-_rRjNy-3z6UnGt760Bh5QgEKwH4j3PPMouX_FLS3NE_IvsW8feU_zFSLunpo-bjD-CmAhDuxirIFO3aP7UpdIM-JnSfqS3_R9dfGy8PkVJsZtFP0cT-6Yx3IQRTb0b4XSLcm5b8o/s1600/mixer.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi4M-_rRjNy-3z6UnGt760Bh5QgEKwH4j3PPMouX_FLS3NE_IvsW8feU_zFSLunpo-bjD-CmAhDuxirIFO3aP7UpdIM-JnSfqS3_R9dfGy8PkVJsZtFP0cT-6Yx3IQRTb0b4XSLcm5b8o/s1600/mixer.jpg" height="278" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">LT5560 active mixer test board. Yes, it looks quite horrible because lots of repairs were needed after the initial fabrication ;) Next one will look nicer.</td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
And after fixing several grave issues with the LT5560 test board (including components we forgot to solder onto the board, an accidental short-circuit of the power line which involved overlooking that the baluns both pass-through DC current, the lack of enough ground vias across the board, missing DC paths for the input pins, and an oscillating circuit involving the power supply (which was fixed by adding some 10Ω resistors in series with the RF chokes used) and a few more) it actually works! Look:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDpvV-2z4T_YvDG0VZdpU0710KU8WKokEB0Cn-SOutWIYIHzMmZsgyLpcjXnlc7KkQAo6hrVQKGR-Rswta-ez9UxQ9ga2HvcZlT-Nsv3Bok2ku6qs5Qw4jIPDnS8KjUo7yUvRAltXck0E/s1600/1420MHz_in_large.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDpvV-2z4T_YvDG0VZdpU0710KU8WKokEB0Cn-SOutWIYIHzMmZsgyLpcjXnlc7KkQAo6hrVQKGR-Rswta-ez9UxQ9ga2HvcZlT-Nsv3Bok2ku6qs5Qw4jIPDnS8KjUo7yUvRAltXck0E/s1600/1420MHz_in_large.png" height="240" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Output of the mixer circuit for 1.3995GHz LO frequency and 1.42 GHz input frequency. Upper panel is time domain (time -- voltage), lower panel is frequency domain (frequency -- power). A strong tone is present at the difference of the two frequencies (20.5 MHz, where the cursor is).</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmOt8FoO-WyZozYwPo-9lUrgfJW80Jlyc1QsHFZ7PNoZ-J6xyhxQyUCLLKWns0YqI12_GRQ0e91dndM5Qf8JFsZPg4-GZggipxFNKY9zR-28AxaH1f3CGc_zVS1ZZKKQ9ptKDltdxrwf4/s1600/1405MHz_in.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmOt8FoO-WyZozYwPo-9lUrgfJW80Jlyc1QsHFZ7PNoZ-J6xyhxQyUCLLKWns0YqI12_GRQ0e91dndM5Qf8JFsZPg4-GZggipxFNKY9zR-28AxaH1f3CGc_zVS1ZZKKQ9ptKDltdxrwf4/s1600/1405MHz_in.png" height="240" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Mixer output for 1.3995GHz LO and 1.405 GHz input. If the input frequency is lowered to and then below the LO frequency, the frequency peak moves to the left until it hits zero frequency and then starts moving right again.</td></tr>
</tbody></table>
There's some fairly strong "noise" on the output which seems to be somewhere around 400 MHz. I'm not sure where that comes from (higher-order intermodulation product?) but it will be easy to remove through a low-pass filter.<br />
<h3>
Next steps</h3>
Now, most of the difficult components for my 1.42GHz receiver should hopefully be in place. I plan to build a 20 MHz amplifier and lowpass filter shortly; I hope to be able to present a few more concrete results here shortly!scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com0tag:blogger.com,1999:blog-7888156866269720289.post-53670873370067480922014-03-17T23:00:00.000+01:002014-03-21T23:23:34.021+01:00kdevelop-python for Python 3: first stable version (1.6.0) released!Yesterday, Python 3.4 was finally released, so I'm now happy to announce the first stable release of kdevelop-python which supports Python 3! See below for the tarballs.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg33Q7KulW5MVv9J8DFTikpPWj0DvKRs1jGzSx0KziKmAkA6_NWFUYgLQ_be6Kh_HJ6NHyDPqW1FG2VxAu4n3WWF6S77qSIozDyhKzTmomf4drm9xx6YJ_L9aTKneNwBPmyRwaWFrk5QpQ/s1600/qt.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg33Q7KulW5MVv9J8DFTikpPWj0DvKRs1jGzSx0KziKmAkA6_NWFUYgLQ_be6Kh_HJ6NHyDPqW1FG2VxAu4n3WWF6S77qSIozDyhKzTmomf4drm9xx6YJ_L9aTKneNwBPmyRwaWFrk5QpQ/s1600/qt.png" height="65" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">As in the Python 2 series, PyQt continues to be one of the best supported frameworks.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="background-color: #dde1ff; font-size: 85%; margin: 8px; padding: 8px;">
<b>Obsolete, </b><b> please use 1.6.1-py3 (see below)</b><b> -- 1.6.0 didn't build on some systems</b>
<strike><b>kdev-python version 1.6.0-py3</b></strike><br />
<strike><a href="http://download.kde.org/stable/kdevelop/kdev-python/1.6.0/src/kdev-python-v1.6.0-py3.tar.xz.mirrorlist">http://download.kde.org/stable/kdevelop/kdev-python/1.6.0/src/kdev-python-v1.6.0-py3.tar.xz.mirrorlist</a></strike><br />
<strike><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">SHA256:974178fa00a34c5e2a4d9f6408c7fcbf92e7933182dd59216a11c1452238ceb7</span></span></strike><br />
<b><br /></b><b>kdev-python version 1.6.1-py3</b><br />
<a href="http://download.kde.org/stable/kdevelop/kdev-python/1.6.1/src/kdev-python-v1.6.1-py3.tar.xz.mirrorlist">http://download.kde.org/stable/kdevelop/kdev-python/1.6.1/src/kdev-python-v1.6.1-py3.tar.xz.mirrorlist</a><b> </b><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: x-small;">SHA256: 26b1fa25e8f24f1e0b801ece02b283a750e77543e6df1e571dd52b36778859a5</span><b><br /></b><br />
<br />
<b>The kdev-python 1.6-py3 series is compatible with KDevelop 4.6 (kdevplatform 1.6) and is suitable for working with Python 3.x source code.</b><br />
<b>If you're only interested in using (as opposed to packaging or developing) kdev-python, you should consider installing kdev-python from your distribution's package manager instead of downloading the source code. </b><br />
<b>The python 3 and python 2 versions cannot be installed at the same time currently!</b></div>
There's not that much more to say than what was already said in the <a href="http://scummos.blogspot.de/2014/03/kdevelop-python-for-python-3-beta.html">beta announcement</a>, so I will just post some screenshots of what continues to work in the Python 3 version:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlsVUhIbYjSTVQ4LH14l4MEikDLZU5Hfr3PN6O6hpU6Fm4nL6g4-xLbr0u5VvEMhsiRNovr0_FphTHjZYH7QVa6dQwq5PO3YdwQEKjvVyUo6CR9Dvs-fgWW_1UDNlXC4MFPnP6yMVHiHg/s1600/completion.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlsVUhIbYjSTVQ4LH14l4MEikDLZU5Hfr3PN6O6hpU6Fm4nL6g4-xLbr0u5VvEMhsiRNovr0_FphTHjZYH7QVa6dQwq5PO3YdwQEKjvVyUo6CR9Dvs-fgWW_1UDNlXC4MFPnP6yMVHiHg/s1600/completion.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Code completion is powerful as ever and tries very hard to only make suggestions which are useful in the current context.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjidTn7KLKlb940xdsTUXS-J-01OnjynxaBRMyIkx759_D3RSq8R7cPytuljycTCAoW-5SMYs3mZLrBCUPNRVYFyA2UTyzPTdyLTgs721AgvqB-UO42sVQFwZ5naWK4VHpS-mKEs4RoAJ0/s1600/typeinference.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjidTn7KLKlb940xdsTUXS-J-01OnjynxaBRMyIkx759_D3RSq8R7cPytuljycTCAoW-5SMYs3mZLrBCUPNRVYFyA2UTyzPTdyLTgs721AgvqB-UO42sVQFwZ5naWK4VHpS-mKEs4RoAJ0/s1600/typeinference.png" height="158" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Code tooltips are still there, too.</td></tr>
</tbody></table>
As always, please report any bugs you might find to the <a href="https://bugs.kde.org/enter_bug.cgi?product=kdev-python&format=guided">bug tracker</a>. Happy hacking!scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com7tag:blogger.com,1999:blog-7888156866269720289.post-25158367732784874852014-03-04T20:17:00.000+01:002014-03-04T20:20:32.395+01:00kdevelop-python for python 3: beta releaseGood news: Python 3.4 is about to be released, and with it kdevelop-python's first version to support Python 3. Until that happens in a few days, here's a beta:
<br />
<div style="background-color: #dde1ff; font-size: 85%; margin: 8px; padding: 8px;">
<b>kdev-python version 1.5.80-py3</b><br />
<a href="http://download.kde.org/unstable/kdevelop/kdev-python/1.5.80/src/kdev-python-1.5.80-py3.tar.xz.mirrorlist">http://download.kde.org/unstable/kdevelop/kdev-python/1.5.80/src/kdev-python-1.5.80-py3.tar.xz.mirrorlist</a><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">SHA256:99ca1ce97e2a7e553051be7505c17a921ab1aaf318999826ea285f771bcc538a</span></span><br />
<b><br /></b><b>The kdev-python 1.6-py3 series is compatible with KDevelop 4.6 (kdevplatform 1.6) and is suitable for working with Python 3.x source code.</b><br />
<b>If you're only interested in using (as opposed to packaging or developing) kdev-python, you should consider installing kdev-python from your distribution's package manager instead of downloading the source code. </b></div>
There are a few things which need to be announced about this, so read on!<br />
<h3>
Embedded Python fork</h3>
First and foremost, this abomination is finally gone in the -py3 series. Python 3.4 merged a patch which is required by kdev-python, and now we can use the system's python installation. This will especially make kdev-python comply with all distribution's requirements for packaging software, which means it will hopefully soon be available in all major distribution's package repositories.<br />
This also means that kdev-python <b>now depends on Python =3.4</b>. <br />
<h3>
Python 2 compatibility</h3>
The py3 series is not compatible with Python 2, and currently you <b>can not</b> install kdev-python and kdev-python3 side-by-side. I will try to address this restriction in the future and I will also publish a script to install the two versions into separate environments, but for now that's what is like. Especially, <b>for packagers, this means that kdev-python must conflict with kdev-python3</b>. The problem cannot be solved by renaming all the files, it also requires new UI and glue code to be written to select the correct language version, which I only have done partially as of today.<br />
<h3>
Branch names in kdev-python.git</h3>
I also used this opportunity to reorganize the branches in kdev-python.git a bit:<br />
<ul>
<li>python3 is now python3-legacy (do not use)</li>
<li>python3-nofork is now python3; this branch is the most recent (unstable) version of the python3 version of the plugin, and compiles against kdevplatform master</li>
<li>there's a 1.6-py3 branch which is like 1.6 but for python 3.</li>
</ul>
If you had any of the renamed branches checked out, you might need to do <span style="font-family: "Courier New",Courier,monospace;">git reset --hard origin/<i>branchname</i></span>. In the near future, master will also be renamed to python2 and python3 will be renamed to master (but not yet).<br />
<h3>
Feature comparison of kdev-python3 and kdev-python2</h3>
Generally, the Python 3 version has all the features from Python 2 plus a few more and some bug fixes. Not all new Python 3 features are understood yet (the syntax is supported, but the semantics isn't, e.g. nonlocal does nothing), though. What is there however is support for function annotations:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQaSm-bwnvja7V-g4kDAbpyzpwjEuSjpIEovFGIIBYMmu4EYQ7V5B_vLP4AApiNvHYR_t_yQ_h3ngI08WuHOln1WNuZ7Bdv9JdSdtpFXhgBQi_gBxRhTXDc_CMrD3KHjkVGwJHKQ7HEXw/s1600/hint.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQaSm-bwnvja7V-g4kDAbpyzpwjEuSjpIEovFGIIBYMmu4EYQ7V5B_vLP4AApiNvHYR_t_yQ_h3ngI08WuHOln1WNuZ7Bdv9JdSdtpFXhgBQi_gBxRhTXDc_CMrD3KHjkVGwJHKQ7HEXw/s1600/hint.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">If the expressions in a function annotation represent a type (i.e. not an instance or something different) they are used to adjust the function's return and argument types.</td></tr>
</tbody></table>
I really hope this feature gets used for type hints, so this is a first step to encourage you to use it for that. ;)<br />
Not all is awesome just yet, though: Although I'm not aware of any major issues, there will be regressions (things which were working in Python 2 but are now broken). There are always regressions, even with the ~90% test coverage kdev-python has. That's the purpose of this beta: go forth and test, and report all the bugs to the tracker so they can be slain!scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com2tag:blogger.com,1999:blog-7888156866269720289.post-6845748890958059182014-02-07T23:38:00.000+01:002014-02-07T23:38:30.445+01:00kate: intelligent code completion for all languages!... well, maybe that's a bit of an exaggeration, but it's certainly much more intelligent than before. Look:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHEdBKH01x8SmclMdGcCzEzeUn192WSs5yK6WZz-wOizwjYzuwBb5nVSa8AOKQWsqQ1H3nZAPR3_iWgm_hHiX3AySoxYcSj_hABVYDNqA6O-qReJBBD64uxzqVXx46zSL2OM8GX23Zc_U/s1600/css.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHEdBKH01x8SmclMdGcCzEzeUn192WSs5yK6WZz-wOizwjYzuwBb5nVSa8AOKQWsqQ1H3nZAPR3_iWgm_hHiX3AySoxYcSj_hABVYDNqA6O-qReJBBD64uxzqVXx46zSL2OM8GX23Zc_U/s1600/css.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Code completion in CSS</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXI0NatQGVx8fLRQipzsqd7oPEIfuFzIVOxWsMyEL6ulJrDHwS0c5eS7gO09FjW0piys_UyouHo5fEpUxNCL7IOoy3HYMETlFCLeWlC9ZGdGDoUlnz8ju_u0sJhf7fegemuwa2OZfvyT0/s1600/bash.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXI0NatQGVx8fLRQipzsqd7oPEIfuFzIVOxWsMyEL6ulJrDHwS0c5eS7gO09FjW0piys_UyouHo5fEpUxNCL7IOoy3HYMETlFCLeWlC9ZGdGDoUlnz8ju_u0sJhf7fegemuwa2OZfvyT0/s1600/bash.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">... bash</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjymA_yvxOmOrGgDmtt5tAVytVJZC7r-sSQaz-YqCQUj3uO-6b3bI3wVYr3JuoCXIa-GutK841nsHD1CG1sJIKVa7PXZTmSBVnwj26Jx-qWrx6xRUSj_nMy7q7wJPgE33pUodrmw7E7OaU/s1600/lua.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjymA_yvxOmOrGgDmtt5tAVytVJZC7r-sSQaz-YqCQUj3uO-6b3bI3wVYr3JuoCXIa-GutK841nsHD1CG1sJIKVa7PXZTmSBVnwj26Jx-qWrx6xRUSj_nMy7q7wJPgE33pUodrmw7E7OaU/s1600/lua.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">... Lua</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeMDzl47_BOx3HNKR9VeBUttlyE7-4k_S7PmjgXzIepRu3mlnE2vPK2If5vFfqBI3blznC4ugFwb2iIlG4Y4EY1ZzvDsx6cRsmybza4J8qMKqSi21igTUqyCtBCf3MbjJzgYQOfu9-R0I/s1600/php.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeMDzl47_BOx3HNKR9VeBUttlyE7-4k_S7PmjgXzIepRu3mlnE2vPK2If5vFfqBI3blznC4ugFwb2iIlG4Y4EY1ZzvDsx6cRsmybza4J8qMKqSi21igTUqyCtBCf3MbjJzgYQOfu9-R0I/s1600/php.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">... PHP</td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj9J7RSREisl0eDidxr-_rCa1DdB-e7NOYFK3D12NcYZKFROOz7ewWbqhzjnwcsM8iepn4FZr-8yQgfGP55nwyw_MVUPacHsPX1TWVZojMvSDobzfuWbyMeHofyOjwaCzhyphenhyphenO5IGFt0OIk/s1600/gnuplot.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj9J7RSREisl0eDidxr-_rCa1DdB-e7NOYFK3D12NcYZKFROOz7ewWbqhzjnwcsM8iepn4FZr-8yQgfGP55nwyw_MVUPacHsPX1TWVZojMvSDobzfuWbyMeHofyOjwaCzhyphenhyphenO5IGFt0OIk/s1600/gnuplot.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">even Gnuplot!</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdL3-UscBJqsqJ8lXuyAz2JFepJkxiQi9fNly95ihsSA2L7eyLdBHhI-Swzh0DhHAx9bwcFZ3HhKg_QZ_mZtVwOIKUyZsn-RYXZhpvLxeG0P-P-_gvMkaFe6aOdgS0CcJ-k_xFKqCAvQc/s1600/gnuplot2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdL3-UscBJqsqJ8lXuyAz2JFepJkxiQi9fNly95ihsSA2L7eyLdBHhI-Swzh0DhHAx9bwcFZ3HhKg_QZ_mZtVwOIKUyZsn-RYXZhpvLxeG0P-P-_gvMkaFe6aOdgS0CcJ-k_xFKqCAvQc/s1600/gnuplot2.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Note how this one has a different set of possible items for the same query, respecting the context.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcYBHqnffhi8tiFBbrDeiox9AEOL_93zxapsacz2aHkiNF_HRgQuqBfcMDIkbq41tbwb4beDLWNLSq-ONidiWhwvbKXbbLhKGvdDLUUtSCH_YgXHw9kMKkkMH8z1u5mZ4NLRhq5aPIk90/s1600/mathematica.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcYBHqnffhi8tiFBbrDeiox9AEOL_93zxapsacz2aHkiNF_HRgQuqBfcMDIkbq41tbwb4beDLWNLSq-ONidiWhwvbKXbbLhKGvdDLUUtSCH_YgXHw9kMKkkMH8z1u5mZ4NLRhq5aPIk90/s1600/mathematica.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Even Mathematica ;) This image shows a problem which still needs to be fixed: in case-insensitive languages, all completion suggestions are lowercased (which is not technically wrong of course, but a bit ugly). It's easy to fix but simply not done yet.</td></tr>
</tbody></table>
There's unexpected profit from this in quite some areas, even KDevelop: for example, through this we now get code completion for all keywords in doxygen comments:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHJyCCQ-zGyUk-oxdvtdAyE1_hoq2x-Li1b-AzIwbeVQ9jvzf59-lBORiZdoPcr6PnWX2A7ZZOEIQXevHpHlMZDHV-Ep3ZySu-F1YXdL5S2pnUW2aKN6g9VZOdbvxi3skge7d50qj48zw/s1600/doxygen.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHJyCCQ-zGyUk-oxdvtdAyE1_hoq2x-Li1b-AzIwbeVQ9jvzf59-lBORiZdoPcr6PnWX2A7ZZOEIQXevHpHlMZDHV-Ep3ZySu-F1YXdL5S2pnUW2aKN6g9VZOdbvxi3skge7d50qj48zw/s1600/doxygen.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Completion for doxygen keywords inside a doxygen comment</td></tr>
</tbody></table>
Of course, those only appear inside actual doxygen, and not C++. When the cursor is in C++ code, it shows the C++ keywords instead (but they will not be very visible in KDevelop, since they're sorted below KDevelop's suggestions, which are better).<br />
<h3>
How does this work?</h3>
Short answer: magic! Correct answer: it uses the highlighting files. For highlighting, kate has a list of possible keywords for languages listed in highlighting files (<span style="font-family: "Courier New",Courier,monospace;">/usr/share/apps/katepart/snytax/$language,xml</span>). Those keywords are even context-sensitive: you will notice that e.g. the PHP highlighter does not highlight PHP function names inside comments or strings. So, the highlighting engine needs to know which keywords are valid at which position. Those are precisely the keywords which are suggested in the list.<br />
<h3>
What now?</h3>
Now that we have this feature, I think we can make more out of it in quite some cases. Especially, I want to invite you to have a look at your favourite language, and make sure all keywords / builtin functions / etc. are actually listed. Because of this feature, it might make sense to list keywords for languages where they are not terribly helpful for highlighting; a prominent example would be HTML, where currently the highlighter is totally generic and does not actually look at e.g. the tag names (thus, there's no completion). If you'd fix that by actually listing all valid HTML tag names, you'd (1) get better highlighting, e.g. you can mark undefined elements (think typos) as errors and (2) completion for free with that.<br />
<br />
Another thing which can be improved is the context sensitivity. Some languages already do this rather well, but many languages will higlight keywords also in places where it'd be easy to detect that the keyword does not make sense there. That doesn't matter that much for highlighting only, because generally users write code which makes sense, but still -- if you can detect it, both consumers of the highlighting data (the actual highlighting, and the completion engine) gain something from it. So, extra motivation for making things more exact! ;)<br />
<br />
I'm sure we can do more cool stuff with this. If you can come up with a good idea -- tell me, I'm happy to talk about it.scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com20tag:blogger.com,1999:blog-7888156866269720289.post-25332528754994700672014-01-26T01:45:00.000+01:002014-01-26T01:45:32.938+01:00KDevelop / Kate sprint in Barcelona in January 2014Last week I have been in Barcelona at the KDevelop / Kate sprint with all the other nice people working on those projects. As always, it was very cool to meet everyone again and spend a week together improving software. A big thanks to the organizers and sponsors, too!<br />
<br />
Since most of the time I work on a fairly encapuslated subsystem (Python support for KDevelop) and only a smaller part of my contributions goes towards the KDevelop / Kate core repositories, I don't have any world-changing news to announce -- unlike for kate and KDevelop, no Qt5 / KF5 porting is happening yet in Python support. It doesn't make much sense to start porting until all the interfaces have stabilized.<br />
<br />
Still, quite some interesting things have piled up in the last few months, and especially during the sprint.<br />
In the following, I want to give a quick summary of those.<br />
<a name='more'></a><h3>
News in KDevelop</h3>
<h4>
Abbreviation matching in QuickOpen</h4>
Similar to the abbrevition matching feature introduced in code completion recently, this now also works
in KDevelop's quickopen.
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8C0kyIhR8c-N7FwoQshQR1hdRWrN8fH02aaxKa_dDbzbb5WeRruwxKD4rX9AWExxkcnK6CrUst7ujmDMT4KIGtAVksFmHhWDhpneFPEp2onJ79wRd31vz8laKWPDRzbSOcHFaqRr-uyg/s1600/qopen.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8C0kyIhR8c-N7FwoQshQR1hdRWrN8fH02aaxKa_dDbzbb5WeRruwxKD4rX9AWExxkcnK6CrUst7ujmDMT4KIGtAVksFmHhWDhpneFPEp2onJ79wRd31vz8laKWPDRzbSOcHFaqRr-uyg/s1600/qopen.png" height="233" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Abbreviations can now be used to filter the QickOpen and Outline lists.</td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<h4>
Improvements to the Execute Script plugin</h4>
Some issues were fixed in the Execute Script plugin, which is -- among other things -- used to run and debug Python files. Especially, clicking items now works properly when the output filter is being used; for common mimetypes, a suitable intepreter and output filter is pre-selected; and you can now run scripts directly from the context menu.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEganJEHvJFqb1_KPqA4avNiVOBC0jCNKNBgRKAAPXknHi3yDWVoibXCzSoNTCx6Uywj7eU0JJq6c9dO4kLwxOnfSHVY2KnnSI-rYh-tzDV_3_YR58rww2e9iQme7xpXVerv6kgPoN7bXio/s1600/execute.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEganJEHvJFqb1_KPqA4avNiVOBC0jCNKNBgRKAAPXknHi3yDWVoibXCzSoNTCx6Uywj7eU0JJq6c9dO4kLwxOnfSHVY2KnnSI-rYh-tzDV_3_YR58rww2e9iQme7xpXVerv6kgPoN7bXio/s1600/execute.png" height="156" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Python scripts and other common scripts can be run without going through the Launch Configuration dialog. The interpreter is derived automatically from the mime type. If this automatic detection doesn't work you can edit the resulting configuration in the Run | Configure Launches.</td></tr>
</tbody></table>
<br />
You can now also create launch configurations which run or debug the script which is currently active in the editor.<br />
<h4>
Revamp of KDevelop's Problem Assistant</h4>
When you use KDevelop, you certainly noticed the small assistant at some point which pops up when there's a problem in your code for which the language engine can propose corrections. This assistant was always very useful (not so much for Python yet, but I plan to implement some in near future) but had some problems in its current implementation. Especially, it looked really bad with the default colour schemes in some distributions; and its placement choice, which made it cover toolview controls quite frequently, was perceived as odd by many users I talked to. To make this assistant more flexible and more pretty, the widget was remade in QtQuick; it integrates with your editor colour scheme now and is placed inside the editor.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiPpQZchZ6J5UIqi3qdgMwnMnnGCzOuLw46C4DfY6t4Oz7YZGcd1X9gyZO-ckC416u6EIGo3gJBOV5usL6ydP7ht_WAGpbuK7zbn021Wzk_TUzsu__6HRCdAvaQXrOl4MD_anUybksP34/s1600/assistant_light.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiPpQZchZ6J5UIqi3qdgMwnMnnGCzOuLw46C4DfY6t4Oz7YZGcd1X9gyZO-ckC416u6EIGo3gJBOV5usL6ydP7ht_WAGpbuK7zbn021Wzk_TUzsu__6HRCdAvaQXrOl4MD_anUybksP34/s1600/assistant_light.png" height="90" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">New assistant with default colour scheme for the editor</td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiQCMGCXQfv4QcLaig09ZeAeFNvaIVOXr7ZoJUPUSzXFmRKcnIc1Tb0tULRHBxgHd-E-zUyg_dxYCRKiRk0kBdGqmInIMoP5bceK6I2CEXPsnlyZ0VMnrE-bePjv4XqeEby9ioiSB8GMw/s1600/assistant.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiQCMGCXQfv4QcLaig09ZeAeFNvaIVOXr7ZoJUPUSzXFmRKcnIc1Tb0tULRHBxgHd-E-zUyg_dxYCRKiRk0kBdGqmInIMoP5bceK6I2CEXPsnlyZ0VMnrE-bePjv4XqeEby9ioiSB8GMw/s1600/assistant.png" height="100" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">New assistant with dark colour scheme for the editor. The blue highlight is added while you press the trigger key (default Alt, not currently configurable but could now be changed easily with the new implementation)</td></tr>
</tbody></table>
<br />
There's certainly room for improvement (comments welcome, just post them to the mailing list or the bugtracker), but the new implementation should make it easy to try different layouts and play with what works best.<br />
<h4>
Code completion item alignment</h4>
The Prefix (left column) of the completion widget is now aligned to the right, to avoid jumping of the text when scrolling through the list. This makes ist easier to find e.g. a function with a specific return type.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXSE0X_ltHYllk4TvVpu_Hjh8a0GsOPfIz7Q2OfR-pB1NdBffHzlrBbSc1sR_vTR4s4cAiIMe_RZUs6soPV1HPp4eOAmtvioP9E_-R7EuA6rWS8wMCVF1TTwp38FiF6wacVT9dHv_Wl_k/s1600/right-alig.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXSE0X_ltHYllk4TvVpu_Hjh8a0GsOPfIz7Q2OfR-pB1NdBffHzlrBbSc1sR_vTR4s4cAiIMe_RZUs6soPV1HPp4eOAmtvioP9E_-R7EuA6rWS8wMCVF1TTwp38FiF6wacVT9dHv_Wl_k/s1600/right-alig.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Types in the completion list are aligned to the right now.</td></tr>
</tbody></table>
<h4>
Annotations sidebar</h4>
An underrated feature is the git annotations sidebar. It has been even more useful since you can bind a shortcut to it (I suggest Meta+A), which makes it very easy to look at who wrote some code, or why, and at which time it was last changed (using a shortcut was possible since the last sprint actually thanks to Aleix whom I annoyed until he implemented it because I couldn't figure out a proper way to do it). In this sprint, I fixed a few small issues with it; especially, it now uses proper colours when you have a dark editor background colour.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggXFIy6IJHCjbohpzHEORYfEK6mRSKCN3UudV252LpR5YN1AQAWO9ZquQhLcNUvFaX6QyR18xxDhqIRyPGMQf9eBmIK9NwiIyNRWpDPNWILZViDWqptuw9wYNybDfLCLH9wKh6OD_LMgQ/s1600/sidebar.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggXFIy6IJHCjbohpzHEORYfEK6mRSKCN3UudV252LpR5YN1AQAWO9ZquQhLcNUvFaX6QyR18xxDhqIRyPGMQf9eBmIK9NwiIyNRWpDPNWILZViDWqptuw9wYNybDfLCLH9wKh6OD_LMgQ/s1600/sidebar.png" height="208" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The annotations sidebar now uses properly readable font colors on dark schemes.</td></tr>
</tbody></table>
<h4>
Automatic file reloading for git-managed projects</h4>
This feature has been there for a few weeks now but it turned out to be much more useful than I imagined (while other things I implemented turned out to be much less useful than I imagined -- such is life). If you use KDevelop with git, you almost certainly were in the situation that you used e.g. git pull or git checkout while having affected files open in KDevelop, and then got lots of popup dialogs asking "The file was changed on disk, do you want to reload it?". Those dialogs are by themselves a necessary and useful feature; they have protected me from data loss more than once, when I for example redirected the output of my program into its source file or fat-fingered some rm or git reset --hard command. For branch switches or similar operations, though, they are really annoying -- and not only annoying, but dangerous too, since a warning with lots of false positives trains the user to click "ignore" as a reflex, and thus makes it possible that data loss occurs despite the warning. The aim of this feature is thus to attempt to reduce the dialogs to those situations where data loss could actually occur. The basic idea is, "when git has a version of a document in some tree, then the user can always go back there using git, so no data loss can occur". So, when we know that a particular version of a document exists in some git commit, and that particular version of the document is currently open in the editor, and then the file gets changed on disk, it is safe to discard the open version and automatically load the new one.<br />
<br />
This is implemented with a combination of <span style="font-family: "Courier New",Courier,monospace;">git-hash-object</span> and <span style="font-family: "Courier New",Courier,monospace;">git-cat-file</span>. When an open document changes on disk, KDevelop will take the text which is currently visible in the editor and pass it to <span style="font-family: "Courier New",Courier,monospace;">git-hash-object</span>. That command simply computes a checksum of the contents, which identifies the data. Then it passes this checksum to <span style="font-family: "Courier New",Courier,monospace;">git-cat-file</span>, which will tell KDevelop whether a file with this checksum exists somewhere in git's object datbase. If that is the case, the document is reloaded (or closed, if it was deleted on disk) automatically, without asking the user if he wants to keep the old buffer; otherwise, the old behaviour (popup dialog) is applied. The rationale is that the user cannot lose data if the check succeeds, since he can always retrieve the old version from git's object database (for most operations, simply using git checkout on the most recent entry in git reflog is enough).<br />
<br />
The interface for implementing this for other VCS is there, but I doubt any of the current supported ones is flexible enough to support this. <br />
<h3>
News in kdev-python</h3>
<h4>
Item access on unsure types</h4>
In the python3 branch, we can now do this:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaoFouoX4VojK2SmbAWulUsp00wKEaoHZpTrn0Wv8d58-wt49EwlXavb4I64c7ehNtsgaTRNaoKRVq63oSbPpLLA48jJgM9CZy8NxMyH4nthQbT-tSCkyO0cNQ9KbupqOwDQXLKGweQiA/s1600/unsure.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaoFouoX4VojK2SmbAWulUsp00wKEaoHZpTrn0Wv8d58-wt49EwlXavb4I64c7ehNtsgaTRNaoKRVq63oSbPpLLA48jJgM9CZy8NxMyH4nthQbT-tSCkyO0cNQ9KbupqOwDQXLKGweQiA/s1600/unsure.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Types are correctly deduced when a subscript is used on an unsure type.</td></tr>
</tbody></table>
<br />
It's a minor improvement, sure, but it didn't work before and caused quite some code to not produce the correct types.<br />
<h4>
Calltips for constructors</h4>
Another very minor feature, but neverthereless annoying that it wasn't there so far.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUBYmKnCZMfx4hTZYZnFoPzBBV-0J8H5hSdE2ktv8g7wyy7nB9x6WDVLzPK6Vl9X4Px0uz3xKNIaVbdI-9wfeJkTy20Gz_zhBAqMh7MKw9bInoH4O-BCP3_9VoQgRLjLMTAA4w0vFysTY/s1600/constructor.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUBYmKnCZMfx4hTZYZnFoPzBBV-0J8H5hSdE2ktv8g7wyy7nB9x6WDVLzPK6Vl9X4Px0uz3xKNIaVbdI-9wfeJkTy20Gz_zhBAqMh7MKw9bInoH4O-BCP3_9VoQgRLjLMTAA4w0vFysTY/s1600/constructor.png" height="82" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Constructors now have call tips (the popup above the cursor) like all other functions.</td></tr>
</tbody></table>
<h4>
Less weird items in the import completion list</h4>
Items containing dashes are now filtered out of the import completion list. Ridiculous feature, I know, but useful neverthereless ;)<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPheNEmz1_QlZJ0ISJIcm8rCTmxeXbl-2Lh9wi6014at1omVz8ynwBouwuEULeYmZcdPpbAbWzyIvtFLuLUI_tQbLlym9iThYaBa2llHA0URskzsJcvivddS5TDSNmnlAOvyYIvNh5Cr4/s1600/import.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPheNEmz1_QlZJ0ISJIcm8rCTmxeXbl-2Lh9wi6014at1omVz8ynwBouwuEULeYmZcdPpbAbWzyIvtFLuLUI_tQbLlym9iThYaBa2llHA0URskzsJcvivddS5TDSNmnlAOvyYIvNh5Cr4/s1600/import.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">No more foo-bar.egg items in the completion list.</td></tr>
</tbody></table>
<h4>
Debugger</h4>
I don't use the debugger much myself, so I didn't notice it was quite broken since the 1.5 release (something about the output view changed in kdevplatform and I didn't adjust the debugger code to work with it). Now it's fixed, though, and I backported the fix to the 1.5 and 1.6 branches. Unfortunately, the debugger is still very hackish; as a user, you will most likely not notice that, but the code is a bit troubling ;) It was originally only meant as a prototype, but worked so well that I didn't yet implement it properly. If you have interest in improving the situation here -- would be great!<br />
<h4>
Google Code-In: Specifying types</h4>
KDevelop's python support also got some cool improvements from Google Code-In tasks this year, of which I want to outline the most noteworthy ones here. There has been a problem forever with libraries like matplotlib, which kdev-python can analyze quite well if you look at the internal code, but on which it still fails to provide proper completion and highlighting in many cases because some small, central piece of information is missing. That is hard to fix; the approach of shipping with a file containing all the function and class signatures from the library (which is e.g. used for PyQt) doesn't scale well and is also very unelegant in this case because it is maintenance-heavy. What we can do now is this:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkpo9tZuy-Hmmg1n301KWv3kx5RWzoF-FX5fnfswPfhP05QMT2wEAUqJZi5JIScY6Z_26g4S8seivdILNpoo8tF-stabI8KTm2gGD0Ljx0DMZdGJsmjZvcjxhssoTAkz6e-zE58U56VXA/s1600/tspec_1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkpo9tZuy-Hmmg1n301KWv3kx5RWzoF-FX5fnfswPfhP05QMT2wEAUqJZi5JIScY6Z_26g4S8seivdILNpoo8tF-stabI8KTm2gGD0Ljx0DMZdGJsmjZvcjxhssoTAkz6e-zE58U56VXA/s1600/tspec_1.png" height="145" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Before: the type of the object is unknown.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3D1Pw0u5JwtkQByTmBzNk7c1nfyi6oxCaDG6Y9-UNpe9sQWsq8n7o8osjlC2IZqsC8Onbw93jSiVLNK6OxPBcetgCLtwN6cL6b4g99GBPkIqa6siJXNSDalwfDwUA_OylJHfCVxr-tk4/s1600/tspec_2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3D1Pw0u5JwtkQByTmBzNk7c1nfyi6oxCaDG6Y9-UNpe9sQWsq8n7o8osjlC2IZqsC8Onbw93jSiVLNK6OxPBcetgCLtwN6cL6b4g99GBPkIqa6siJXNSDalwfDwUA_OylJHfCVxr-tk4/s1600/tspec_2.png" height="248" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Click "Specify type" in the context menu.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKy1-sJztMzgvnZ_p97VVg47SN8j1HXh_QRZA6DjwRVRrbDqjJLTozcBOUDw0KgRkFY0IAKFVgnQa7d47bLCyRzgiP66wU7UgNdoSqI8MPpER-KKuCpEYXm5O2wLxUFx62kX1Pn83fEJo/s1600/tspec_3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKy1-sJztMzgvnZ_p97VVg47SN8j1HXh_QRZA6DjwRVRrbDqjJLTozcBOUDw0KgRkFY0IAKFVgnQa7d47bLCyRzgiP66wU7UgNdoSqI8MPpER-KKuCpEYXm5O2wLxUFx62kX1Pn83fEJo/s1600/tspec_3.png" height="211" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">A magic dialog opens. Enter a python expression which evaluates to the type you want the object to have; in this example, [int()] which evaluates to "list of int".</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEyR2H70rlA0iN4MiBxIvwT-9R3tIraoepQXaJBf05ghBY5OpdbrV-fDxnyMH4YescRGVQBV976OaEKKc3TOSErOq9mWMEMNiWbsLRiI8pnx1RLISKa1pwznnC43fkJX1IglzXmzLscMc/s1600/tspec_4.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEyR2H70rlA0iN4MiBxIvwT-9R3tIraoepQXaJBf05ghBY5OpdbrV-fDxnyMH4YescRGVQBV976OaEKKc3TOSErOq9mWMEMNiWbsLRiI8pnx1RLISKa1pwznnC43fkJX1IglzXmzLscMc/s1600/tspec_4.png" height="131" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Confirm the dialog. Tada!</td></tr>
</tbody></table>
The information on what object has what type is bound to the names of the objects and stored in small, python-syntax files (similar to the existing documentation files). Thus, for libraries like matplotlib, we can ship with a very small (20 lines-ish) set of hints which already greatly improve the quality of code completion and highlighting for that library. And the best thing is, thanks to the above assistant, it is very easy for users to do it themselves (there's certainly room for improvement in the UI, e.g. imports should really be added automatically since they are hard to get right).<br />
This is an experiment -- we'll see how well it works out in practice.<br />
A prototype for this feature was implemented in a branch a while ago, and as part of Google Code-In, Atanas Gospodinov implemented the actual generation of the hint files from the informaton entered in the UI dialog (which is the key part of making it actually useful for end-users). In the sprint last week, I did some final fixes on it and merged the branch, and now it seems to be working quite nicely. One thing I want to emphasize when talking about this feature is that it is <i>not meant to specify hundreds of types in your source code</i>. If you do that, you <i>will</i> run into problems (consider using things like "<span style="font-family: "Courier New",Courier,monospace;">assert isinstance(...)</span>" instead -- it makes your code nicer, anyways).<br />
It is meant to make system libraries, especially those for which kdev-python understands almost everything but not a few key wrappers or similar, work better without having to modify those libraries themselves. In matplotlib, if you find the right place (the root cause of a problem in the analysis), often one hint is enough to fix e.g. dozens of function return types. If, for fixing your problem, you need to specify fifty function return types by hand, this is <i>not</i> the right feature to use.<br />
<h4>
Google Code-In: string formatting</h4>
Another Google Code-In task which deserves to be mentioned is the string formatting completion feature. It works like this:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6CLKWT878bfdGugXRHIqGb-0cawFzMKasA7EOCYL6Rr7kNWwbtIxMAv9wbAbz00QbjXwdhn5ZgXcRbujwjSpFS3Tj415AquuffvsY-c7UMwjvtURhNOfbwo8VXm3eFTN7jQJHkNoyXGA/s1600/stringformat.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6CLKWT878bfdGugXRHIqGb-0cawFzMKasA7EOCYL6Rr7kNWwbtIxMAv9wbAbz00QbjXwdhn5ZgXcRbujwjSpFS3Tj415AquuffvsY-c7UMwjvtURhNOfbwo8VXm3eFTN7jQJHkNoyXGA/s1600/stringformat.png" height="213" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The new string formatting completion, implemented by GCI student Atanas Gospodinov, allows to easily craft advanced expressions in python's string formatting mini-language by repeatedly invoking code completion while the cursor is in a string literal.</td></tr>
</tbody></table>
It was implemented by Atanas Gospodinov, too, and is quite nice when you (like me) can never remember the exact syntax for how to use this string formatting mini-language.<br />
Unfortunately, this feature is one of the things which turned out to be less useful than I expected. That is not Atanas' fault -- his implementation is fine (it even uses kate's awesome template engine!). It's an inherent problem of the feature; you just don't do the task it supports terribly often. For this reason, I disabled its automatic invocation (i.e. automatic popup while typing) in the current master branch; it will only show up when you request it manually using Ctrl+Space. Before doing that, I personally found it getting in my way too much when typing e.g. dict indexes which were strings. And not getting into your way is one of the key design principles of KDevelop.<br />
<br />
Another GCI student which deserves to be mentioned is Levente Kurusa, who did some smaller fixes e.g. for binary operators.<br />
<h4>
Python 3 </h4>
The Python 3 version is in the "python3-nofork" branch and can be compiled against Python 3.4 beta. It works quite nicely, and you could probably carefully start using it for actual work. It is even starting to gain some advantages over the Python 2 plugin, since I do no longer implement all new features in the Python 2 branch (in case ugly merge conflicts seem likely).<br />
An official release will happen as soon as Python 3.4 gets released.<br />
I have investigated making the Python 2 and Python 3 versions installable at the same time. Unfortunately, I currently don't see a proper way to make this work. I'll post an update in case I have an idea. Until that, the only way to get Python 2 and Python 3 support simultaneously (aka, in different KDevelop sessions which run at the same time -- in the same session it's not possible) is installing the two plugin versions into two different prefixes and creating helper scripts for launching KDevelop in those prefixes. I will publish a script which does this automatically in the future if I can't find a better solution.<br />
<h4>
Debug vs. release mode</h4>
As a final word, I'd like to mention that it makes quite a difference in performance whether you compile kdev-python and kdevplatform in debug or release mode. For daily use of the program, I would really recommend building in release mode; everything is much smoother. If you encounter a crash, it has to be reproducable to be a useful bug report anyways, so you can just recompile in debug mode and trigger it again to get a proper backtrace. scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com5tag:blogger.com,1999:blog-7888156866269720289.post-6543195565113912712013-10-29T21:14:00.000+01:002013-10-29T23:29:42.361+01:00kdev-python update: version 1.5.2 releasedI'm happy to announce the availability of a second stabilization update for the 1.5 series of kdev-python, the Python language support plugin for the KDevelop development environment. See <a href="http://scummos.blogspot.de/2013/05/kdev-python-15-released.html">the 1.5 announcement</a> for more information.<br />
<div style="background-color: #dde1ff; font-size: 85%; margin: 8px; padding: 8px;">
<b>kdev-python version 1.5.2</b><br />
<a href="http://download.kde.org/stable/kdevelop/kdev-python/1.5.2/src/kdev-python-v1.5.2.tar.xz.mirrorlist">http://download.kde.org/stable/kdevelop/kdev-python/1.5.2/src/kdev-python-v1.5.2.tar.xz.mirrorlist</a><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">SHA256:84ae7015623a3848b1c1ce8e8f958c32778e9ba0afafa3ea3b3dd70687e1fe40</span></span><br />
<b><br /></b><b>The kdev-python 1.5 series is compatible with KDevelop 4.5 (kdevplatform 1.5) and is suitable for working with Python 2.x source code.</b><br />
<b>If you're only interested in using (as opposed to packaging or developing) kdev-python, you should consider installing kdev-python from your distribution's package manager instead of downloading the source code.</b></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwoU3UipBLvXCNVW0_8n2C7kpGgA0D84VsTPqktuxeyOBp8-c2IUccvVlN1y82Y7C1Wx_g8AD7clDF8Mk2_pNXjbG90sOzT4SkJaibjdft39tNP4_tftG1Ej1DKW_fF9HcxZ-ERD9u5Ao/s1600/kdev-python.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwoU3UipBLvXCNVW0_8n2C7kpGgA0D84VsTPqktuxeyOBp8-c2IUccvVlN1y82Y7C1Wx_g8AD7clDF8Mk2_pNXjbG90sOzT4SkJaibjdft39tNP4_tftG1Ej1DKW_fF9HcxZ-ERD9u5Ao/s400/kdev-python.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">kdev-python running in KDevelop master</td></tr>
</tbody></table>
Changes in this release (relative to 1.5.1):<br />
<ul>
<li>Fix a bug which led to the PEP8 checker running on non-python files in some cases</li>
<li>Properly support unicode docstrings (thanks to Alexandr Zamaraev)</li>
<li>Fix a crash in code completion which happened in some rare cases</li>
<li>Fix a crash which could happen when a list comprehension was used as the default value for a function parameter</li>
</ul>
This is a small update containing only the above 4 bug fixes; all users are urged to switch to the new version as soon as it becomes available in their distribution.<br />
<br />
There will be a larger update containing various cool new features in a few weeks, so stay tuned!scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com8tag:blogger.com,1999:blog-7888156866269720289.post-22776281666065339042013-10-28T23:47:00.001+01:002013-10-28T23:47:51.024+01:00kte-collaborative 0.2: First stable release of the collaborative text editing projectI'm pleased to announce the first stable release of kte-collaborative, which provides collaborative text editing in kate through kde-telepathy, and an update to the libqinfinity library.
<br />
<div style="background-color: #dde1ff; font-size: 85%; margin: 8px; padding: 8px;">
<b>libqinfinity version 0.5.2</b>:<br />
<a href="http://download.kde.org/stable/libqinfinity/0.5.2/src/libqinfinity-v0.5.2.tar.xz.mirrorlist">http://download.kde.org/stable/libqinfinity/0.5.2/src/libqinfinity-v0.5.2.tar.xz.mirrorlist</a><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">SHA256: 739f99afb7fd464e4b541e2980e07911c8f30924f9871f14294dc3148137825a</span></span><br />
<b><br /></b>
<b>kte-collaborative version 0.2.0 (aka 0.2)</b>:<br />
<a href="http://download.kde.org/stable/kte-collaborative/0.2.0/src/kte-collaborative-v0.2.0.tar.xz.mirrorlist">http://download.kde.org/stable/kte-collaborative/0.2.0/src/kte-collaborative-v0.2.0.tar.xz.mirrorlist</a><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">SHA256: 06c8cfb16b93a8fe3c5e2267ba3f71110526966267f73fed20a902c3f7982a55</span></span>
<br />
<br />
<i>kte-collaborative 0.2 depends on kde-telepathy 0.7 beta or later, and works with libinfinity 0.5.x.</i></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2P4m7DnTUYzS-cxzAJSa7ZUmxotrYADQ_-f_StFe3I8phChc4gOsNanhJ4IFcr823KaxNBJHHj8RSPRALkMjQTpLD1brByD7MbZvnz-qhvjqJv0jue64BTemQhB5zKQ8DX7kzWCZVcrU/s1600/collab.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2P4m7DnTUYzS-cxzAJSa7ZUmxotrYADQ_-f_StFe3I8phChc4gOsNanhJ4IFcr823KaxNBJHHj8RSPRALkMjQTpLD1brByD7MbZvnz-qhvjqJv0jue64BTemQhB5zKQ8DX7kzWCZVcrU/s400/collab.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">kte-collaborative 0.2, with dolphin listing some files from gobby.0x539.de and editing a file in kate.</td></tr>
</tbody></table>
There have not been many noteworthy user-visible changes since the last beta release, so please to refer to <a href="http://scummos.blogspot.de/2013/09/collaborative-text-editing-02-beta.html">the 0.2 beta announcement</a> for more information. As always, please report any bugs you find to <a href="http://bugs.kde.org/">bugs.kde.org</a>!scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com5tag:blogger.com,1999:blog-7888156866269720289.post-6170080784291174952013-10-23T01:06:00.001+02:002013-10-23T01:07:08.311+02:00Advanced code completion filtering in kate / KDevelopI have implemented two new ways to filter the code completion popup in kate: filtering the list using an abbreviation, and filtering the list using text not occuring at the word's beginning. This can probably best be demonstrated by lots of pictures:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTi5bi_d96DYjZ3wlE9kStcw1fm-Qy8WnTRltuKTUBMAEIj0Oq7mYKbeCqc2qTOHee7TbV3MbtygqgQGITl1UME7pswtA0lFzjSh5JWMCGE3pvPqX8GUPRhqAWKsH6FjAR4AOz5paEW_4/s1600/abbrev.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTi5bi_d96DYjZ3wlE9kStcw1fm-Qy8WnTRltuKTUBMAEIj0Oq7mYKbeCqc2qTOHee7TbV3MbtygqgQGITl1UME7pswtA0lFzjSh5JWMCGE3pvPqX8GUPRhqAWKsH6FjAR4AOz5paEW_4/s1600/abbrev.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">You can match completion items by their abbreviation. This works for both camel case and underscore notation.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwFHGGPxiHj2JfEPKCHsrR-n2S2RHUsw08F5wEwFnubsPN-u71X_yV5h5HIucDfPzska6s_1ikhyQ7suJzyyHXDfUhzR0PWYRoxA4fJ_LyD3eCTESCFthnOZrrIWYlTcT_feJTuQmliek/s1600/contains.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwFHGGPxiHj2JfEPKCHsrR-n2S2RHUsw08F5wEwFnubsPN-u71X_yV5h5HIucDfPzska6s_1ikhyQ7suJzyyHXDfUhzR0PWYRoxA4fJ_LyD3eCTESCFthnOZrrIWYlTcT_feJTuQmliek/s1600/contains.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">You can also match entries by words they merely contain but do not start with. This matching is only allowed at word borders (capitals or underscores). This feature makes it far easier to find that damn class which has an unexpected name prefix, or the m_foo variable you thought was called foo.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYKkRC1i2WuCPJbnUNElSQcHoXOIcZTlkkIayUDlZwVCgVjdE7YSCkZrYGxBXaN8rRcBNgkyHo5QPAnG1DVKmkYPJQZvxvDmJbZ5Sx7yJar69_TjtNIcneUfiJR1imtSACrm7PLrYeFw0/s1600/partial.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYKkRC1i2WuCPJbnUNElSQcHoXOIcZTlkkIayUDlZwVCgVjdE7YSCkZrYGxBXaN8rRcBNgkyHo5QPAnG1DVKmkYPJQZvxvDmJbZ5Sx7yJar69_TjtNIcneUfiJR1imtSACrm7PLrYeFw0/s1600/partial.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The abbreviation expansion engine also allows you to type parts of the words from the abbreviation, making your search more specific in a convenient way.</td></tr>
</tbody></table>
This feature is not specific to kdev-python, it works in all kate-based apps. It is available in kate's master branch, and will be available in KDE SC >= 4.12.<br />
<br />
If you have more suggestions or cases which are not handled well, I'm happy to discuss this further. Have fun hacking!<br />
<br />
P.S. If anyone can come up with an efficient algorithm for doing what is depicted in the last image, I'd be interested. The current one is quite slow for some corner cases. scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com10tag:blogger.com,1999:blog-7888156866269720289.post-782369811136028492013-10-06T00:43:00.000+02:002013-10-06T00:43:30.559+02:00Extracting text from Photoshop (PSD) imagesI just needed to grab text from some Photoshop images and put it into a LaTeX document. But, how do I get that text on Linux? GIMP can't do it, nor can any other program I tried (they all rasterize the text). Fortunately the text is just saved in plain in the .psd file, so it's relatively easy to get it out of there. However it's in utf-16, so with just grep it's quite painful. <a href="http://pastebin.kde.org/piiylb7he">Here</a>'s a little Python script which finds and decodes text from psd images (inline version below).
You use it by passing it the .psd file, and the beginning of the text you want to find, and it'll give you the rest.
<pre>python psdtextextract.py myimage.psd "This is"</pre>
will result in "This is a text layer." if that's the text your layer indeed contains. To find a sample of the text you can use any image viewer such as gwenview. Quite stupid, I know, but it works ;)
<br><br>
Inline source code:
<div style="height: 150px; font-size:80%; overflow: scroll; padding: 8px; margin: 8px;"><pre>#!/usr/bin/env python
# -*- coding:utf-8 -*-
from codecs import encode, decode
def get_next_occurence(text, buf, start):
text = encode(text, "utf-16")[2:] # cut BOM
index = buf.find(text, start)
if index == -1:
return b"", -1
end = buf.find(b'\x00\x00', index)
if end == -1:
return b"", -1
chunk = b'\x00' + buf[index:end + 2]
return chunk.replace(b'\x5C', b''), end
def get_all_occurences(text, buf):
start = 0
items = []
while start != -1:
try:
found, start = get_next_occurence(text, buf, start)
items.append(decode(found, "utf-16be").replace('\r', '\n'))
except UnicodeDecodeError as e:
continue
print(" - undecodable match skipped:", e)
return items
if __name__ == '__main__':
import sys
if len(sys.argv) > 4 or len(sys.argv) < 3:
print("Usage: psdtextextract.py file.psd pattern [display-all-matches]")
with open(sys.argv[1], 'rb') as f:
items = get_all_occurences(sys.argv[2], f.read())
if "display-all-matches" not in sys.argv:
print(items[0])
else:
for item in items:
print(item)
</pre></div>scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com4tag:blogger.com,1999:blog-7888156866269720289.post-79038935587158235472013-09-24T13:36:00.000+02:002013-09-24T13:36:06.590+02:00Collaborative text editing: 0.2 beta release and end of GSoCAfter three months and 430 commits introducing 23165 changes <span style="color: #999999;"><i>(line insertions/removals; in the kte-collaborative repository, plus about 50 more commits in kde-telepathy and libqinfinity)</i></span>, the beta release I hereby announce marks the end of my Google Summer of Code project, which consisted of implementing collaborative text editing in KTextEditor (<a href="http://scummos.blogspot.de/2013/08/collaborative-text-editing-in.html">see previous</a>).<br />
<br />
For more general information about the project, make sure to also have a look at <a href="http://quickgit.kde.org/?p=scratch/brauch/kte-collaborative-docs.git&a=blob&b=master&f=docs.pdf&o=plain">the user manual</a>, which has some in-depth explanations on how things work.<br />
<br />
First, the technical stuff:<br />
<div style="background-color: #dde1ff; font-size: 85%; margin: 8px; padding: 8px;">
<b>libqinfinity version 0.5.1</b>:<br />
<a href="http://download.kde.org/stable/libqinfinity/0.5.1/src/libqinfinity-v0.5.1.tar.xz.mirrorlist">http://download.kde.org/stable/libqinfinity/0.5.1/src/libqinfinity-v0.5.1.tar.xz.mirrorlist</a><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">SHA256: bcfeb899921057cf4e7f393c48ca6b4f7e3ee21c64c783f692a5af48118755ad</span></span><br />
<b><br /></b>
<b>kte-collaborative version 0.1.80 (aka 0.2 beta 1)</b>:<br />
<a href="http://download.kde.org/unstable/kte-collaborative/0.1.80/src/kte-collaborative-v0.1.80.tar.xz.mirrorlist">http://download.kde.org/unstable/kte-collaborative/0.1.80/src/kte-collaborative-v0.1.80.tar.xz.mirrorlist</a><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">SHA256: 2679611900796be86af8fc84a5f90bb76fedff715f29d4530ed5ccf982c3fe03</span></span>
<br />
<br />
<i>kte-collaborative depends on kde-telepathy 0.7 beta or later.</i></div>
Now, read on for the more interesting things!<br />
<a name='more'></a><h3>
Initiating sessions from the kde-telepathy chat window</h3>
To make the feature more discoverable and intuitive to use, there's now a "Share document with contact" button in kde-telepathy's chat window.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNuQg_AxoqIGMOIzXt9DP9hDKQAhXVDcRPuKsyzlE0I-wbztdvIJ3CiO_gM8xygcqdeDFVadHmxMWhyphenhyphenOSlOIlCD7_4Q7L-xEl1Arr9BrIxs6-dI4tVhUH1y3T_lomzzA96EquajqR2-34/s1600/collab-edit.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNuQg_AxoqIGMOIzXt9DP9hDKQAhXVDcRPuKsyzlE0I-wbztdvIJ3CiO_gM8xygcqdeDFVadHmxMWhyphenhyphenOSlOIlCD7_4Q7L-xEl1Arr9BrIxs6-dI4tVhUH1y3T_lomzzA96EquajqR2-34/s400/collab-edit.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">You can easily share documents with contacts right from the chat window.</td></tr>
</tbody></table>
It allows you to select a document, and asks the remote to accept the request. After that, it'll automatically launch both person's favourite editor to edit the document; in the case below, you can see a person with kwrite editing a document with someone using KDevelop.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJeTxfIXPt5Yp_atSanOJWEDYTNoIc1MawBGG88l6EZSVFEiO6WfFlgdAD7Twl_Ni1IFUUxMyQtezyLAQHwOUmL28Ps7GRy2EdzJOtC0447HOGlpVuBx4I-PPkC7QGmahFiLO8jzUDfuQ/s1600/shared.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJeTxfIXPt5Yp_atSanOJWEDYTNoIc1MawBGG88l6EZSVFEiO6WfFlgdAD7Twl_Ni1IFUUxMyQtezyLAQHwOUmL28Ps7GRy2EdzJOtC0447HOGlpVuBx4I-PPkC7QGmahFiLO8jzUDfuQ/s400/shared.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Collaborative editing session initiated by kde-telepathy. There's a plasma session running for a different user (with his own jabber account) inside a Xephyr window, to simulate two different people using the feature.</td></tr>
</tbody></table>
This way, you can for example quickly get help from someone regarding a programming problem. It's much easier than using pastebin or similar services, since both persons can edit the document in real-time, look at it with proper syntax highlighting, etc.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZu-0mKvEH7A8yGm5DrU2ltJIHPtM8THuvT5nOPzcFwKgB6FfM9qeZiVUfZlbM8SVNTE5Bj8jC39eYJwB0ZoOiDZecjSfpwzp_ToUWRPjYwYorbu0Z9H6nbeUcG0LrhS7kAOsOnjDpQ44/s1600/edited.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZu-0mKvEH7A8yGm5DrU2ltJIHPtM8THuvT5nOPzcFwKgB6FfM9qeZiVUfZlbM8SVNTE5Bj8jC39eYJwB0ZoOiDZecjSfpwzp_ToUWRPjYwYorbu0Z9H6nbeUcG0LrhS7kAOsOnjDpQ44/s400/edited.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The KWrite user quickly got useful help from his imaginary friend.</td></tr>
</tbody></table>
<h3>
Notifier</h3>
There now finally is a feature to tell you when new files are added to a server you're connected to, or on a connection you previously set up with a contact. The same program will automatically refresh all affected folder views, so that you actually notice when new files are added.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB_6wbhVI0KOCy0G5ikZUb3-Z62OrNFlSIW8lYXXNBT1lXdHjdz4OvWHCMb7qXly3f3iPN2C5j2tMO89G2pqDRelayZ-Ebqe6R9ivpmRFyRSXVQbzDaLKgpQnKvFDJkiKYz_FyOzvm460/s1600/notify.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB_6wbhVI0KOCy0G5ikZUb3-Z62OrNFlSIW8lYXXNBT1lXdHjdz4OvWHCMb7qXly3f3iPN2C5j2tMO89G2pqDRelayZ-Ebqe6R9ivpmRFyRSXVQbzDaLKgpQnKvFDJkiKYz_FyOzvm460/s1600/notify.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The new notification module tells you when new documents were added to a connection. You can of course disable these notifications.</td></tr>
</tbody></table>
<h3>
New user list</h3>
I re-wrote the user list (not that there was terribly much code to rewrite) to be prettier and more useful; especially, it now includes the colors of the users, and can be configured to show only some users. If the list ends up taking too much space, it will collapse into a minimal form, displaying only colored icons with tooltips.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN8QPVVAtnGvkYQHaob2070acqgqA40kl_Etvozy1NCO7qkVRtxAMxcdEGoDIT-ji4TToMnQAWDzOm7wW36kilgBTvnkdYGRv6MfPQs_XAelxRjGNPCN6JqLXmmGJM8U7c6sud_T3-Uw8/s1600/userlist.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN8QPVVAtnGvkYQHaob2070acqgqA40kl_Etvozy1NCO7qkVRtxAMxcdEGoDIT-ji4TToMnQAWDzOm7wW36kilgBTvnkdYGRv6MfPQs_XAelxRjGNPCN6JqLXmmGJM8U7c6sud_T3-Uw8/s1600/userlist.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The new user list, and its configuration options, when there's enough space.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBoUuUOYmqLbaf1d4zW9mPPa2wbk87Fz_HhUMGV0MamRCGXWhnAJ7zjOLg11ut0VUZGJQXdeV5AQZ7_cECf6S-Cs2UoUaPzqH5q9hrFwkhYGjbNy4gyCoDmbHQHAf4FmUuryEuQUw_HcA/s1600/userlist-small.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBoUuUOYmqLbaf1d4zW9mPPa2wbk87Fz_HhUMGV0MamRCGXWhnAJ7zjOLg11ut0VUZGJQXdeV5AQZ7_cECf6S-Cs2UoUaPzqH5q9hrFwkhYGjbNy4gyCoDmbHQHAf4FmUuryEuQUw_HcA/s1600/userlist-small.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Collapsed form of the new user list.</td></tr>
</tbody></table>
<h3>
"Splash Screen"</h3>
Since especially for telepathy-initiated connections, the connection might be a bit slow and for larger documents loading might take several seconds, the program now includes a splash screen to make the user aware of the loading progress. It also serves the purpose of making it clear that although the document is already open and contains text, it may not yet be edited since synchronization is still in progress.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPxv2wjjZ_tANEYpzWiSVUvm06ZIesmbHjEiXAmvJATpAZrNT1ZQKOEc-xvzh_LgdG-SWoLfcU4skr8y4jdE7AT9cRoASCyAcoX3-8vdM0uTqwpt-ACifBklAhM6lEoj2vbMNIpfn43cg/s1600/splash.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPxv2wjjZ_tANEYpzWiSVUvm06ZIesmbHjEiXAmvJATpAZrNT1ZQKOEc-xvzh_LgdG-SWoLfcU4skr8y4jdE7AT9cRoASCyAcoX3-8vdM0uTqwpt-ACifBklAhM6lEoj2vbMNIpfn43cg/s400/splash.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Splash screen displayed while a document is being loaded.</td></tr>
</tbody></table>
<h3>
Unicode support</h3>
There's now finally proper support for the full range of unicode characters.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg8N4JscQOwdYLffVwxN1qYkGORuQ74jnOAbuujQczx_OvzSI7LbYynSvM2R_fGLwmxR4hDMUhzgAMVXKZ4yO3Fn8bTmBSieiD-i0Leb7zIweV3krDQSv4uk5yZRK7xwToPquJdKO5BQE/s1600/unicode.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="112" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg8N4JscQOwdYLffVwxN1qYkGORuQ74jnOAbuujQczx_OvzSI7LbYynSvM2R_fGLwmxR4hDMUhzgAMVXKZ4yO3Fn8bTmBSieiD-i0Leb7zIweV3krDQSv4uk5yZRK7xwToPquJdKO5BQE/s400/unicode.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Have fun adding cat faces to your collaborative documents.</td></tr>
</tbody></table>
<h3>
User manual</h3>
I have written a detailed user manual, which is available as a PDF. The most recent version is always available <a href="http://quickgit.kde.org/?p=scratch/brauch/kte-collaborative-docs.git&a=blob&b=master&f=docs.pdf&o=plain">here</a>.<br />
<h3>
Mandatory statistics</h3>
I already put some statistics in the preamble; but calculating those left me wondering, how much is that actually? Is what I do in 430 commits comparable to what other persons do in 430 commits, or are my commits much smaller or much larger than the average?<br />
Of course, those questions cannot be left unanswered. Thus, I wrote a script to compare the median size of commits of different persons. I think a good measure for average commit size is not the average, but the median size of a commit; this will be much more resistant against artifacts than the mean value, especially big commits such as copying over files from a different repository, adding generated files, ...<br />
<br />
Looking at most of KTp, kte-collaborative and libqinfinity, I get the following interesting data (all the numbers are "number of lines added or removed", the average/median numbers are "per commit"; changing a line thus counts as 2; ordered by median):<br />
<br />
Gregory Haynes: average <b>115.1±285.7</b>, median <b>39.5</b>, total 51 350 <br />
Dan Vrátil: average <b>141.4±401.5</b>, median <b>19.0</b>, total 22 206 <br />
Sven Brauch: average <b>54.7±213.6</b>, median <b>15.5</b>, total 26 353<br />
David Edmundson: average <b>272.8±7 402.2</b>, median <b>12.5</b>, total 357 849<br />
Martin Klapetek: average <b>527.3±11 143.8</b>, median <b>10.0</b>, total 304 763<br />
Daniele Domenichelli: average <b>41.4±211.9</b>, median <b>8.0</b>, total 25 425<br />
Script Kiddy: average <b>16.3±68.0</b>, median <b>4.0</b>, total 21 216<br />
<br />
(Gregory Haynes is the original author of libqinfinity and kobby, a KDE-based editor using libqinfinity; this project has a different architectural approach, but still I could re-use quite some of the code he created.)<br />
<br />
You can clearly see that the mean value is useless, the standard deviation is far too big. The median however looks quite interesting. Deduce from this data whatever you want ;)<br />
<br />
Other interesting results turns up when you plot a histogram of "lines changed per commit"; first, me versus Gregory:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzE0aVA4hdXQUwSMfZEVW9onWxvpc-PAdcXy5YyIOqFcDBmlcu-zvIsWaZ6muCKhha97D-h8f6MVrJchcQI8DJnzETVfu03DG3j0FMaMhU6VfbIFF_94RGS5eJSFGo-He62jb3TNUj5aY/s1600/sven-greg.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzE0aVA4hdXQUwSMfZEVW9onWxvpc-PAdcXy5YyIOqFcDBmlcu-zvIsWaZ6muCKhha97D-h8f6MVrJchcQI8DJnzETVfu03DG3j0FMaMhU6VfbIFF_94RGS5eJSFGo-He62jb3TNUj5aY/s400/sven-greg.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Histogram of commit size. Y is ratio of commits with that size, X is commit size in lines.</td></tr>
</tbody></table>
You can clearly see that I have a significantly higher ratio of commits <i>changing</i> one or two lines (sizes 2 and 4), and generally much more smaller commits, while Gregory has generally more commits in the 25-60 lines added/removed range.<br />
<br />
Then, me versus David:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjXh9QwqXZL3jNG8ZnIbYUW9o6EpbADfmNK484RVfhqPHLECv0bel5Iy3fmKvroccu_q_hf127ZlAlOZo1Y67-i4xG5FJYYgIrnGWwegj_tzDZR3s5KXPi2uzuwtl2EZnCBUsgDg2y7yk/s1600/sven-david.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjXh9QwqXZL3jNG8ZnIbYUW9o6EpbADfmNK484RVfhqPHLECv0bel5Iy3fmKvroccu_q_hf127ZlAlOZo1Y67-i4xG5FJYYgIrnGWwegj_tzDZR3s5KXPi2uzuwtl2EZnCBUsgDg2y7yk/s400/sven-david.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Histogram of commit size. Y is ratio of commits with that size, X is commit size in lines.</td></tr>
</tbody></table>
The interesting thing to note here is that David has much more commits <i>changing</i> one line (size 2). I boldly claim that commits with small, even numbers are more common if you <i>maintain</i> and improve an existing code base, as opposed to writing new code, since you'll often fix small issues which are contained in one or two lines (which are changed, and leave you with 2 points per line changed).<br />
If you want to verify or disprove that, feel free to use <a href="http://quickgit.kde.org/?p=scratch%2Fbrauch%2Fcommit-analyzer.git">the program</a> on your own code ;)scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com4tag:blogger.com,1999:blog-7888156866269720289.post-67503456783792983672013-08-25T17:20:00.000+02:002013-08-25T17:20:34.345+02:00Collaborative text editing in KTextEditor and kde-telepathy: Preview releaseWe have decided that kte-collaborative (the "Collaborative text editing in KTextEditor via kde-telepathy" project -- <a href="http://scummos.blogspot.com/2013/08/gsoc-collaborative-text-editing-in-kate.html">see previous</a>) is ready for a first release! This release is explicitly flagged as "preview" and might not be suitable for daily use just yet. There are still some known problems; the release is meant as an invitation to curious users to test the program and tell us about any problems they encounter.<br />
<br />
Release tarballs:<br />
<ul>
<li>libqinfinity: <a href="http://download.kde.org/stable/libqinfinity/0.5.0/src/libqinfinity-v0.5.0.tar.xz.mirrorlist">http://download.kde.org/stable/libqinfinity/0.5.0/src/libqinfinity-v0.5.0.tar.xz.mirrorlist</a> <span style="font-size: x-small;">(sha256: <span style="font-family: "Courier New",Courier,monospace;">dcd044b6f21a0356b4a95fedc778def4543e8b45b153c7256cce222a49394d07</span>)</span></li>
<li>kte-collaborative: <a href="http://download.kde.org/unstable/kte-collaborative/0.0.95/src/kte-collaborative-0.0.95.tar.xz.mirrorlist">http://download.kde.org/unstable/kte-collaborative/0.0.95/src/kte-collaborative-0.0.95.tar.xz.mirrorlist</a> <span style="font-size: x-small;">(sha256: <span style="font-family: "Courier New",Courier,monospace;">37026b8bcfd4469243dd694f4e62aa19601416792bdb8c184453715fe950ab71</span>)</span></li>
</ul>
You might want to use the heads of the 0.5 and 0.1 git branches of libqinfinity and kte-collaborative instead to profit from the latest fixes made after the release tagging.<br />
<a name='more'></a><h3>
Intention of the release</h3>
The goal of this release is getting interested users to test the program, in order to get some feedback on what areas work well already, and what areas we need to concentrate on improving next. There are almost four weeks left of the time intended for working on GSoC projects -- well enough to do all the polishing and bug fixing tasks which will surely come up.<br />
<h3>
What works</h3>
<ul>
<li>You can open documents from an existing infinote server and edit them, in at least kate, kwrite, kile, and KDevelop.</li>
<li>You can browse documents in dolphin and also copy one or more documents to the server there.</li>
<li>You can save any document to the server to have it shared in the same way.</li>
<li>You can select Jabber contacts which have the program installed too and edit documents with them without any (network) setup required, except for having your Jabber account set up in Telepathy.</li>
<li>This also works for Jabber chatrooms.</li>
<li>Such a connection, once established, can be used to share an arbitrary amount of documents, simply by using Collaborative -- Share document, and selecting the existing connection.</li>
</ul>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg25zoBlsoMaFaDli1Ewr9fNgcGSXwhYHsVNP12XSlq-4ZuxV5KKEGPV3poOoWTmQXJZY4ZNDeN4WtFsMCJW_-7eEwDC1T1_3yGqG7cBZlG_wmowoIoi4zBnMNR44CN4tFwSN3KT6Ysrnc/s1600/snapshot1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="297" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg25zoBlsoMaFaDli1Ewr9fNgcGSXwhYHsVNP12XSlq-4ZuxV5KKEGPV3poOoWTmQXJZY4ZNDeN4WtFsMCJW_-7eEwDC1T1_3yGqG7cBZlG_wmowoIoi4zBnMNR44CN4tFwSN3KT6Ysrnc/s400/snapshot1.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Sharing a document with a contact will automatically ask that contact what to do, after he approved the request.</td></tr>
</tbody></table>
<h3>
Known issues</h3>
The following issues are known and you don't need to report them as bugs or wishes.
<br />
<ul>
<li>Wide unicode characters are not supported. It's an easy fix but I didn't yet get around to do it.</li>
<li>Gabble (the library dealing with Jabber in the background) sometimes hits some very high timeout values when establishing connections. This means that randomly, it might take several minutes to connect. This will have to be fixed in G<span id="goog_1030542112"></span><span id="goog_1030542113"></span>abble.</li>
<li>In case the data is proxied over the jabber server (<i>in-band bytestream</i>), as it is currently frequently the case unless you're using the program in a local network, there might be constraints on how many messages you're allowed to send in a certain time interval. Unfortunately, against the recommendation in the in-band bytestream XEP, gabble will disconnect the bytestream when you hit that limit (instead of waiting a moment and trying again). Thus, typing quickly for a while can disconnect you and you'll have to manually reconnect.</li>
<li>There is no automatic reloading of folder views when files are added by other users. You'll have to press F5 to reload the view.</li>
<li>For the same reason, once a connection is established there are no notifications to a remote user that further documents have been added.</li>
</ul>
<h3>
Installation Instructions</h3>
To get this cool stuff running on your computer, you might do the following:<br />
<ul>
<li>Install kde-telepathy from your distribution's repositories and configure your Jabber account, if you haven't done so already. There's usually a package called kde-telepathy-meta or similar.</li>
<li>Install libinfinity and infinoted, if the latter is a separate package in your distribution</li>
<li>Get and install (please with -DCMAKE_BUILD_TYPE=debug!) libqinfinity from: <span style="font-family: "Courier New",Courier,monospace;">git clone git://anongit.kde.org/libqinfinity; git checkout 0.5</span></li>
<li>Get and install (please with -DCMAKE_BUILD_TYPE=debug!) kte-collaborative from <span style="font-family: "Courier New",Courier,monospace;">git clone git://anongit.kde.org/kte-collaborative; git checkout 0.1</span></li>
<li>Run kbuildsycoca, and restart mission-control-5, telepathy-gabble, dbus, and kate (if running). The easier and more reliable way is to restart your computer.</li>
<li>In any application using XMLGUI and katepart, e.g. kate or KDevelop, you should now have a "Collaborative" menu with various useful actions.</li>
</ul>
<h3>
Troubleshooting</h3>
<ul>
<li><b>There is no "Collaborative" menu.</b> The KTextEditor plugin is not loaded. Go to Settings -- Configure Editor -- Extensions, and verify that "Collaborative text editing" is listed and checked.</li>
<li><b>The "Share with contact" dialog lists none of my Jabber contacts. </b>The application can determine in advance which of your contacts support the collaborative editing service, so we only list those which claim to support it. The dialog being empty means none of your contacts has the program installed -- get someone to install it!</li>
<li><b>The program crashes. </b>That's a bug. <a href="https://bugs.kde.org/enter_bug.cgi?product=kte-collaborative&format=guided">Please report it here.</a> Potentially useful information to attach to bug reports: <b>Full backtrace</b> in case of crashes, debug output from the editor (enable all collaborative-related debug areas in kdebugdialog), relevant parts of the contents in the "Gabble" tab in ktp-debugger.</li>
</ul>
scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com6tag:blogger.com,1999:blog-7888156866269720289.post-41778353930635265082013-08-17T14:32:00.000+02:002013-08-17T16:46:45.387+02:00GSoC: Collaborative text editing in Kate + kde-telepathy: status report No. 3<i>Read <a href="http://scummos.blogspot.com/2013/06/gsoc-collaborative-text-editing-in-kate.html">my first status report</a> for a more general introduction on what is happening. The <a href="http://scummos.blogspot.com/2013/07/gsoc-collaborative-text-editing-in-kate.html">second report</a> gives some information about features implemented earlier.</i><br />
<br />
Much has happened in the "bring collaborative text editing to kate and kde-telepathy" project! This blog post will outline some of the most important changes, such as undo support and sharing documents with chatrooms.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbOHxyayho9QArp4fqDnkp7JZqQzdozwjDwAgKGsEFzhh47MXMn5BhWJRXDScr_5IB2fnyCBEZNyX4HlURcfs4M-1v4F8RehDUpOv60A10ji2r1ffHelnVcYWGiV40LUJNrxln-daGeBA/s1600/overview.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="242" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbOHxyayho9QArp4fqDnkp7JZqQzdozwjDwAgKGsEFzhh47MXMn5BhWJRXDScr_5IB2fnyCBEZNyX4HlURcfs4M-1v4F8RehDUpOv60A10ji2r1ffHelnVcYWGiV40LUJNrxln-daGeBA/s400/overview.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Current snapshot of kte-collaborative</td></tr>
</tbody></table>
<br />
<a name='more'></a><br />
<h3>
Sharing documents with chatrooms</h3>
<br />
Cool feature, but not much to say about it: You can now share documents with XMPP chatrooms. As soon as a user joins the chatroom with any Telepathy-based client (or when he's already in there), he will receive an invitation to accept the "edit document" request.<br />
In such a connection, the user initiating the connection is the host; if he disconnects, the connection breaks. This might need to be improved in the future.<br />
<br />
<h3>
Interacting with existing connections</h3>
So far, connections established by Telepathy (i.e. connections created through clicking "Share with contact") were pretty much a black box to the user; they were created in the background and never appeared explicitly in the user interface. Experience has shown me that this is not going to work; the topic of how connections should be managed (when to create a new connection, when to re-use which connection, when to close a connection ...), although it might seem simple, gets surprisingly complex quickly -- to a point where it's very difficult for an algorithm to make the choice the user actually wants. Even the question on when to close a connection gets very complex when both users can use an arbitrary amount of applications (e.g. kate and KDevelop) to edit an arbitrary amount of different documents.<br />
I have thus decided that the concept of connections should be transparent to the user so he can decide himself what to do.<br />
For this, we have a new widget listing Telepathy-iniatated connections, which is used in the "Open" and "Share" dialogs:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ66-wASY2Zv7TOlGn1XptwtDHuFRpRM7rg990uh5DTTi5ELggflFkg0Hixuin4-37FIq_u1uoCp0zPmM1MY3jSPMtOQUmsT7-JYX-YloDTGAettsI_t4fBQM2HIGhbg5fECH9sKfhbnQ/s1600/opendialog.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="297" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ66-wASY2Zv7TOlGn1XptwtDHuFRpRM7rg990uh5DTTi5ELggflFkg0Hixuin4-37FIq_u1uoCp0zPmM1MY3jSPMtOQUmsT7-JYX-YloDTGAettsI_t4fBQM2HIGhbg5fECH9sKfhbnQ/s400/opendialog.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The new "Open" dialog, allowing to open files from existing connections</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpZBlu1HxfYRcMmnDJuVWyWsQVqUwidY6adncgDLFa19or3lYs8V_mtsfNHf3ulszYRPzDWD-e5h0HYAOE4SBT5JW7usw0ol3jHtXhaMv-LqeWRoIrIk8jFLK9ItkvrzcaIUVz1Z7BFVQ/s1600/sharedialog.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpZBlu1HxfYRcMmnDJuVWyWsQVqUwidY6adncgDLFa19or3lYs8V_mtsfNHf3ulszYRPzDWD-e5h0HYAOE4SBT5JW7usw0ol3jHtXhaMv-LqeWRoIrIk8jFLK9ItkvrzcaIUVz1Z7BFVQ/s400/sharedialog.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The new "Share" dialog, allowing to share documents with chatrooms, and adding documents to existing connections</td></tr>
</tbody></table>
<h3>
Text tooltips</h3>
After fixing the interface for this in kate, we now have tooltips when moving the cursor over some text which tell who wrote this text!<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh914PNRD8NXC28yAyKlU0Jf_RPg-pqFJIov9RYVIJDzCNk3QWKHb5Qf8-BKKFSi2G1yw9vqp34NsIGLJowp5iXrHEO3uIWfaGmjtZfkfxxxNfdAFV1m5zNt7mTkIkApttHjPOf-Ck7fTs/s1600/tooltips.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh914PNRD8NXC28yAyKlU0Jf_RPg-pqFJIov9RYVIJDzCNk3QWKHb5Qf8-BKKFSi2G1yw9vqp34NsIGLJowp5iXrHEO3uIWfaGmjtZfkfxxxNfdAFV1m5zNt7mTkIkApttHjPOf-Ck7fTs/s400/tooltips.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Tooltips telling you who wrote some text.</td></tr>
</tbody></table>
Like every feature which could possibly be annoying, you can of course turn this off in the settings.<br />
<br />
<h3>
Undo support</h3>
The collaborative undo implemented by libinfinity now replaces KTE's plain undo. This means if you hit "undo" now, the editor will only undo what <i>you</i> wrote, and not what another user might just be typing.<br />
Because of resource constraints, the size of the undo history is quite limited though, so I am considering to provide two undo functions -- one which only undoes what you wrote, and one which just stupidly undoes the last operation globally.<br />
<h3>
General UI polishing and bug fixes</h3>
Several grave and several less grave bugs have been fixed, making the program much more stable and reliable. Additionally the UI has been improved in several places. An example for this is better integration with dark colour schemes.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoLjLSDDTVVtYvbyhX-FRo-2TyDGMe32VVojOQPw98fAc0CvTvKr7Hrf5obsayjQliX1ofAs4oECdC3_X7SArPiqZTiIVgId6nNR4Vp_e4If9CA84VsbktoF68p2mVmx6DFDchMbEJkeA/s1600/darkcolors.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoLjLSDDTVVtYvbyhX-FRo-2TyDGMe32VVojOQPw98fAc0CvTvKr7Hrf5obsayjQliX1ofAs4oECdC3_X7SArPiqZTiIVgId6nNR4Vp_e4If9CA84VsbktoF68p2mVmx6DFDchMbEJkeA/s400/darkcolors.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Reasonable automatic choice of colours for dark colour schemes</td></tr>
</tbody></table>
Fine-tuning of the colours can be done in the settings dialog.<br />
<br />
<h3>
Internal restructuring</h3>
A lot of internal restructuring has been done in the Telepathy-related parts of the project, which for example allowed for the "existing connections" widget presented above to be created.<br />
<br />
<h3>
Future plans</h3>
There are a few points which need to be sorted out next:<br />
<ul>
<li>Error recovery for the text buffer part: in case something goes wrong, we should just reload the document (this doesn't lose data). Of course nothing <i>should</i> go wrong, but you all know what computers are like.</li>
<li>Automatic updates in the KIO slave, to display files created by remote users in the list immediately</li>
<li>Stabilization of the Telepathy Tubes backend we use for establishing connections (there's some issues there, but I'm quite positive we've tracked them down now).</li>
</ul>
Regardless of how bullet points 2 and 3 go, the plan is to do a beta release as soon as 1 is implemented, and have a stable release before the end of the next week; with the intention of people testing the concept and the non-Telepathy related parts (the latter need a bit more polishing before they are truly great).scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com0tag:blogger.com,1999:blog-7888156866269720289.post-38574243209231033282013-07-08T17:30:00.000+02:002013-07-08T17:30:35.567+02:00GSoC: Collaborative text editing in Kate + kde-telepathy: status report No. 2<i>Read <a href="http://scummos.blogspot.com/2013/06/gsoc-collaborative-text-editing-in-kate.html">my first status report</a> for a more general introduction on what is happening.</i><br />
<br />
In the last two weeks, I have implemented many shiny new things in kte-collaborative! Here's a short summary of the most prominent ones.<br />
<br />
<br />
<br />
<br />
<a name='more'></a><br />
<h3>
Sharing documents using kde-telepathy</h3>
<br />
There's a prototype for sharing documents using kde-telepathy now! It will take care of all the connection details automatically and should "just work".<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUZ2ZgwtCKR_JoxkoflVkO8sAg2KSTp5enydrmS8TotpvuTWde0Fbys6R66CzLlYJ79fnRpuD1ssn6bVL9Gyg4WsBKwrN7n3TOp7ASWw3wAY6c-GAV7IapBA1wThVFvVaSqOGuX9hINB8/s1600/arrows.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUZ2ZgwtCKR_JoxkoflVkO8sAg2KSTp5enydrmS8TotpvuTWde0Fbys6R66CzLlYJ79fnRpuD1ssn6bVL9Gyg4WsBKwrN7n3TOp7ASWw3wAY6c-GAV7IapBA1wThVFvVaSqOGuX9hINB8/s400/arrows.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Sharing a document using kde-telepathy</td></tr>
</tbody></table>
To use this feature, in any application using katepart (and XMLGUI), just click Collaborative ↣ Share document. This will open a dialog which shows all of your available contacts; you can just select one and click "Ok". Telepathy will establish a connection (usually through a proxy server) and will launch an appropriate text editor for the selected contact automatically.<br />
This is currently limited to one connection per contact (which can contain an arbitrary number of documents though -- click "Open file manager" to see them or add new ones) and 1-1 connections. I'm currently working on removing both restrictions. <br />
<h3>
Publishing whole document trees</h3>
The infinote KIO slave, which is responsible for displaying, creating and opening documents, has gained support for uploading files with initial content. Thus, you can now copy a whole directory with documents to the server using e.g. dolphin:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYfe358WsCPI-T2cKpjpLyEQTpfUJHkp7RIFfTo8QyDnLgQVP10lklyRUCwB12cZ0PpPJntlmLHq-simBdgUfJ5OO5R23jbfVqk54lJC1oO3V4YWcc6Lfv4XYCXl9CKOQU2OX52gr7Ucw/s1600/copy.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYfe358WsCPI-T2cKpjpLyEQTpfUJHkp7RIFfTo8QyDnLgQVP10lklyRUCwB12cZ0PpPJntlmLHq-simBdgUfJ5OO5R23jbfVqk54lJC1oO3V4YWcc6Lfv4XYCXl9CKOQU2OX52gr7Ucw/s400/copy.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">To make documents available for collaborative editing, just copy them to the server using your preferred file manager (e.g. dolphin or konqueror). You can easily open up a file manager displaying the server contents shared with a contact from the "Collaborative" menu in kate.</td></tr>
</tbody></table>
This of course also works for telepathy-initiated connections. <br />
Then, all connected users can browse the documents and edit them:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX2WFYfxizXhZBBOHaDL9dLOJOYNElj9nEGjEeSDS25MScpbvJIhSSrqhHN2DOQiCWIZXX7WUgo5DlPb55ME0QvjOaJClJV4zZfiW4EH8077pzwQdLVJ7SrXVCw7EacFlzBVprHhS3tH0/s1600/open.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX2WFYfxizXhZBBOHaDL9dLOJOYNElj9nEGjEeSDS25MScpbvJIhSSrqhHN2DOQiCWIZXX7WUgo5DlPb55ME0QvjOaJClJV4zZfiW4EH8077pzwQdLVJ7SrXVCw7EacFlzBVprHhS3tH0/s400/open.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Users can then browse documents and open them for editing. A remote user can change a document even if the host of the session doesn't have it opened in his editor -- changes will still be displayed once another user opens the document.</td></tr>
</tbody></table>
<h3>
Saving local copies</h3>
Another simple, yet useful feature can be found in Collaborative ↣ Save local copy: It will allow you to select a location to save a copy of the document to, and you can then press a shortcut to copy the current contents of the collaborative buffer to that location, without ending the collaborative session (which is what would happen if you would use File ↣ Save as...).<br />
<h3>
Better text highlighting and notification widgets</h3>
The colors used for text background highlighting are now much more sensible, and will also automatically adjust to your colour scheme. The small popup widgets telling which user typed text will behave correctly when the view is scrolled or the widget should be outside the view.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGooT9OkcHZ4McrjZZatioX2FQFYy5-A5qURFhisnYu6TRALehsAr1ZRFEepRt9zeD4lKy8o-rXLg-k9hrZYJcxjws72RjDJPN3XreM-lKy3ijjbQ5JBFHMzm0W0h0mgiB0VEE7OTLxBw/s1600/notify.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="207" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGooT9OkcHZ4McrjZZatioX2FQFYy5-A5qURFhisnYu6TRALehsAr1ZRFEepRt9zeD4lKy8o-rXLg-k9hrZYJcxjws72RjDJPN3XreM-lKy3ijjbQ5JBFHMzm0W0h0mgiB0VEE7OTLxBw/s400/notify.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">If a user types something outside of the current view, the notification widget moves to the top left (or bottom left) corner now, indicating that the document changed above your current scroll position,and telling what user changed it.</td></tr>
</tbody></table>
Additionally, there's now a "Clear user highlights" button in the context menu, which allows you to clean up the background highligting if it gets too messy. There's also some useful configuration options now:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWlpPCNx2WGJBmOgmuhg4YKBDnWytr4uE0O4bYQ0d471WZbl57OohTqUp4OZ13wZUIDzoRusc0ziFMC9xhi95CRPTlV0OjN-UZYa1Vvp-hz4vrGYYpVJm4qPbBW7Szg_7DREtUL2oXl3A/s1600/configure.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="252" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWlpPCNx2WGJBmOgmuhg4YKBDnWytr4uE0O4bYQ0d471WZbl57OohTqUp4OZ13wZUIDzoRusc0ziFMC9xhi95CRPTlV0OjN-UZYa1Vvp-hz4vrGYYpVJm4qPbBW7Szg_7DREtUL2oXl3A/s400/configure.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The small, but useful configuration dialog of the plugin -- more options to come later :)</td></tr>
</tbody></table>
<h3>
KTextEditor buffer interface</h3>
I <a href="https://git.reviewboard.kde.org/r/111407/">suggested</a> an interface for KTextEditor which is required to get some buffer-related things working correctly (such as replace-tabs on). It is currently pending review.<br />
<h3>
Next steps</h3>
The next step is to get kde-telepathy based connection handling to work correctly with multiple contacts, and also allowing things like "invite contact to session". Once that works, most of the basic functionality is in place, and we can start doing cool extra stuff and stabilization.<br />
Another thing which will need to be tackled soon is handling undo/redo correctly. Akademy will probably be a good opportunity to discuss this.scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com3tag:blogger.com,1999:blog-7888156866269720289.post-90056129510512958102013-06-24T20:36:00.000+02:002013-06-24T20:37:18.129+02:00GSoC: Collaborative text editing in kate + kde-telepathyFirst of all, I've been accepted for GSoC this year! I'll be working on creating a collaborative text editor based on the KTextEditor interface and libinfinity library, and on integrating that editor into kde-telepathy. The point of integration with kde-telepathy is that it will allow for a nice user experience in setting up connections: instead of typing IP addresses, they can just select a person from their contact list.<br />
"Integration" doesn't mean you'll be required to use it, though -- it'll work just fine with the old-fashioned way, too.<br />
This post will give a rough overview over the project and what I have done so far.
<br />First, here's a nice image so you don't get bored.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpGze9Wzntaoo9_QY4js11vG74riV5LWVQPGK-VjHR5CqXvvmPiW-jybxuzYxLYrGHfsRkwXmWZ596qN9254mcHremUHREz-LrWwBF5-lDIVR1EyIASmRHw9Kl_Yr_jj-t2pZpnIPAv7U/s1600/editing_status.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpGze9Wzntaoo9_QY4js11vG74riV5LWVQPGK-VjHR5CqXvvmPiW-jybxuzYxLYrGHfsRkwXmWZ596qN9254mcHremUHREz-LrWwBF5-lDIVR1EyIASmRHw9Kl_Yr_jj-t2pZpnIPAv7U/s400/editing_status.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Collaborative editing in kate.</td></tr>
</tbody></table>
<a name='more'></a>
This is based on the <a href="http://scummos.blogspot.de/2013/04/collaborative-editing-in-kte-prototype.html">prototype I made a while ago</a>. As you can see, there's now many more nice features, such as:<br />
<ul>
<li>a status bar telling about the connection status and active users</li>
<li>coloured text depending on which user wrote it</li>
<li>a "Collaborative" menu (more on that later).</li>
</ul>
Most improvements are not visible in a screenshot, though; numerous issues were fixed which caused crashes or errors in synchronization.<br />
In the following, I want to write down a few details about some of the components.<br />
<h3>
Using KTextEditor</h3>
What you see in the screenshots is a plugin for KTextEditor. KTextEditor is located in kdelibs and defines an interface for a text editor; but only for the text editor, not for e.g. managing multiple documents. The most popular (and only?) implementation of the interface is KatePart. Common applications which use KatePart include kate, kwrite, KDevelop, and kile. Those applications could use any other implementation of the KTextEditor interface, if there were any, though.<br />
KTextEditor itself defines a plugin interface; in addition to that, each of the applications listed above define an extra plugin interface. A kate plugin is more powerful than a KTextEditor plugin, since it has some capabilities which a KTextEditor plugin can by definition not have -- such as "open a document", "add a toolview" etc. However, implementing this project as a kate plugin would mean that it can only be used in kate (obviously). Getting it to work in other applications, such as kile (where it would certainly be useful, too) would cause quite some extra work. Thus I decided I want to implement this project only as a KTextEditor plugin -- although it causes quite some difficulties in some places, I think it's worth the trouble. Over the course of the project, it will be necessary to add one or two interfaces to KTextEditor (and implement them in KatePart), but almost all of the things we need are in place already.<br />
<br />
Apart from that "application plugin vs interface plugin" question, using KTextEditor at all gives us an excellent text editor with numerous features for free, and even makes implementation of some of the things required for collaborative editing very easy, such as changing the background colour of text depending on who wrote it. Especially, in contrast to other collaborative editing applications such as gobby or etherpad, KTextEditor provides the end user with a wealth of features and plugins (such as snippets, text-completion, block-based editing, and scripts). Last but not least, it's a well-known editor for many people, which is good for getting someone to actually use it :)<br />
<br />
It also might be worth mentioning that this project is based on the <a href="http://kobby.greghaynes.net/">Kobby</a> application, originally written by Gregory Haynes, which -- although a bit outdated and buggy in some places -- provided an excellent starting point. <br />
<h3>
Using libinfinity</h3>
<a href="http://gobby.0x539.de/trac/wiki/Infinote/Libinfinity">libinfinity</a>, written by Armin Burgmeier, is a library which implements a collaborative editing protocol (called <i>infinote</i>) and all the difficult parts of collaborative editing, such as <a href="http://en.wikipedia.org/wiki/Operational_transformation">multi-user text merging algorithms</a>. Using it is what makes this project possible at all, since writing such a library in addition to an editor on top of it would be well out of the scope of a GSoC project. In addition to having bug-free and well-tested algorithms right from the start, a benefit from using this library is compatibility with applications such as <a href="http://gobby.0x539.de/trac/">gobby</a>. (Yeah, you get the idea, I'm not actually doing anything, I'm just putting pieces together!)<br />
Why another editor on top of the same protocol, you might ask? I partially explained it in the previous section already -- gobby is an editor built around a collaborative editing library, and it is clear that such an application will have a difficult time competing with KTextEditor feature-wise (since the latter was developed for years by many people as a powerful text editor specifically). Just think about KTextEditor's VI mode, for example, and what huge amount of work it would be to get that in gobby. I think it's a great idea to re-use all that effort and all its achievements instead of trying to compete with it by writing another editor. Also, katepart rocks ;)<br />
<h3>
Integration into kde-telepathy</h3>
One of the main drawbacks of desktop (i.e. not etherpad or google docs or similar web-based interfaces) collaborative editing applications is that connecting to someone is difficult. Almost all network setups do not allow you to open ports without special configuration, and many users are either unwilling or incapable of performing the necessary changes. Web interfaces solve this problem, but introduce various other problems -- such as having to rely on third parties (server running the service), being slow, and generally being not very powerful editors.<br />
By using <a href="http://telepathy.freedesktop.org/wiki/Tubes/">telepathy tubes</a> for connecting KTextEditor instances, we get the goodies of both worlds: the setup is very easy, and we have a powerful and fast editor application. In detail, telepathy gives us a nice API allowing to exchange arbitrary data with a contact,
without firewalls or routers getting in the way. To achieve this, telepathy will try to establish a direct connection, then a connection over a
proxy server, and if both fails transfer data base64-encoded inside
jabber messages.<br />
<br />
Thus instead of typing IP addresses, in the end of this project you will be able to just select an IM contact from your contact list, click "Share document", and telepathy will handle all the difficult setup for you. As a bonus, telepathy will -- as mentioned -- try the efficient peer-to-peer-connection method first -- so if you have actually done the network setup mentioned above, you will still profit from it (better performance).<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs49n5BW4n5sLdqTRnlRKXT7OqeRGsb0ITL7JIEBQqMXGDjXXriGwG-yLflL6Wy0qVK1j2tWX2XyybAzsP-yGxfnVPh_bDjMwKLLwfgrSaLxqRLsuQ0NxDkJHsMj8moHnsnr_9ftwfg7w/s1600/menu.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="267" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs49n5BW4n5sLdqTRnlRKXT7OqeRGsb0ITL7JIEBQqMXGDjXXriGwG-yLflL6Wy0qVK1j2tWX2XyybAzsP-yGxfnVPh_bDjMwKLLwfgrSaLxqRLsuQ0NxDkJHsMj8moHnsnr_9ftwfg7w/s400/menu.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">"Collaborative" menu, which will (as soon as it's implemented *grin*) allow you to share documents with any XMPP IM contact, by just selecting the contact from a list.</td></tr>
</tbody></table>
<h3>
What I have done -- week 1</h3>
Ok, enough cheap talk! Here's what I have done so far as part of GSoC.<br />
<h4>
Stabilization</h4>
The editor does no longer crash when you close a document, or disconnect the server. Other crashes relating to unicode characters were fixed too.<br />
<h4>
KIO slave</h4>
The KIO slave is now working much better; it'll verify that operations completed successfully, and throw appropriate error messages if not. It also allows to delete things now.<br />
<h4>
Editor part -- user interface</h4>
There's now text with coloured background depending on which user typed what. There's also a status bar, which shows the connection status and how many users are currently connected. Also, a menu was added which allows to perform actions such as disconnecting from the server, or changing your user name (*cough* which is a bit fragile currently).<br />
<h4>
Editor part -- backend</h4>
Various bugs were fixed in the editor backend which led to synchronization problems. As of today, I don't know of anything causing synchronization problems any more. However my tests are using a not-yet-merged interface to KTE, which I will keep un-merged until I know what other features I need (it is optional for compiling the application).<br />
<h4>
Unit tests!</h4>
There are now basic unit tests for the editor backend. They're already useful :)<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6U-gG4WxCxAfG0RWTT7LrGwM2VJCZ2Zv2A_fgFLLmfYQJYl2sTQpLuspMLSTFqD3f1rcROTVJMlHKlcNiygQ6oZ_ODrv31w_FeZ7EPxQECPe0h-QJetKzh_G_FWC0z5UQuXk9Q3Yh4r4/s1600/tests.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="127" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6U-gG4WxCxAfG0RWTT7LrGwM2VJCZ2Zv2A_fgFLLmfYQJYl2sTQpLuspMLSTFqD3f1rcROTVJMlHKlcNiygQ6oZ_ODrv31w_FeZ7EPxQECPe0h-QJetKzh_G_FWC0z5UQuXk9Q3Yh4r4/s400/tests.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Unit tests for collaborative editing, yay</td></tr>
</tbody></table>
<h4>
Exploring telepathy tubes</h4>
I have written a few test applications which experiment with telepathy tubes. Locally, this works nicely already (you can even use it for collaborative editing already), but numerous tests with my patient GSoC mentor David Edmundson have shown that some more work is needed for actual remote contacts.<br />
<br />
All in all, everything is going well and the project is progressing nicely. By the way, I'll be in Bilbao -- I'm looking forward to meeting you all there! scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com5tag:blogger.com,1999:blog-7888156866269720289.post-40115580437401672602013-05-18T14:49:00.000+02:002013-05-18T14:55:07.174+02:00kdev-python 1.5.1 released<i>kdev-python provides Python language support for the KDevelop integrated development environment. For more information, please look at the <a href="http://scummos.blogspot.de/2012/11/kdev-python-14-stable-released.html">1.4</a> and <a href="http://scummos.blogspot.de/2013/05/kdev-python-15-released.html">1.5</a> release announcements, and especially make sure to watch <a href="https://www.youtube.com/watch?v=WLhigzo00iM">this short demonstration video</a>!</i><br />
<br />
The 1.5.1 release fixes a few issues with 1.5.0. Especially, it<br />
<ul>
<li>fixes a crash bug which could happen when PEP8 checking was enabled</li>
<li>fixes capitalization in the coding line completion</li>
<li>displays the correct plugin version in the About dialog</li>
</ul>
This is a rather minor update and I recommend it to everyone running 1.5.<br />
<br />
There's one thing I forgot to announce in the 1.5 release: <b>PEP8 checking support</b> (which was actually a good thing, since it was rather crashy until now ;)).<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3omBQ8Z_98cIiwasspd_OC18PJ6fZTgGHd6Ne8m3UbUCII2NhPdy06DDLzG6gZc5SBOyw6jNwnvTZbxnvyWKwDv2nSB7d7J-z_1rrgHJfqpHbLp7u6jnMiCx7CJFioPPsgLtCUuGDtgs/s1600/pep8.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3omBQ8Z_98cIiwasspd_OC18PJ6fZTgGHd6Ne8m3UbUCII2NhPdy06DDLzG6gZc5SBOyw6jNwnvTZbxnvyWKwDv2nSB7d7J-z_1rrgHJfqpHbLp7u6jnMiCx7CJFioPPsgLtCUuGDtgs/s400/pep8.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">PEP8 checking suppot in kdev-python 1.5.1</td></tr>
</tbody></table>
It will run the PEP8 style checker whenever an open file is modified and display all errors inline (if you have inline error display enabled) and in the Problems toolview.<br />
By default it is disabled though, since it displays a lot of errors for people who don't follow PEP8, so if you want to use it, go to Settings -- Configure KDevelop -- PEP8 style checking (the change will only apply to newly opened or modified files).<br />
<br />
If there's any issues, please make sure to let me know on the <a href="https://bugs.kde.org/enter_bug.cgi?product=kdev-python&format=guided">bug tracker</a>.<br />
<br />
The tarball can be found <a href="http://download.kde.org/stable/kdevelop/kdev-python/1.5.1/src/kdev-python-v1.5.1.tar.bz2.mirrorlist">here</a>, sha256 checksum is <span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">d9b68bd2dd9361961e264254d2acfebc9ce0ea4b47ea2689d2f01a3ed81f7c47</span></span>scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com12tag:blogger.com,1999:blog-7888156866269720289.post-80697707621849630502013-05-03T13:41:00.000+02:002013-05-03T14:24:25.893+02:00kdev-python 1.5 released!Hi!<br />
<br />
I'm happy to announce the the availability of version 1.5 of kdev-python, the Python language support plugin for the KDevelop development environment. For the official (short) announcement containing links to the tarballs, see <a href="http://kdevelop.org/45/kdev-python-15-and-142-released">the announcement on the KDevelop website</a>.<br />
<br />
Here's a short video which demonstrates some of kdev-python's (and KDevelop's) nice features:<br />
<span style="font-size: x-small;">(if your network connection allows it, you can also watch the <a href="http://files.feorar.org/static/kdev-python-15.ogg">full-resolution version</a> -- or here's a <a href="https://www.youtube.com/watch?v=WLhigzo00iM">link to the youtube version</a> <span style="font-size: x-small;">if the embed<span style="font-size: x-small;">ded one doesn't work<span style="font-size: x-small;">)</span></span></span></span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='480' height='400' src='https://www.youtube.com/embed/WLhigzo00iM?feature=player_embedded' frameborder='0'></iframe></div>
If you prefer a written summary of features and changes, please refer to <a href="http://scummos.blogspot.de/2012/11/kdev-python-14-stable-released.html">the kdev-python 1.4 announcement</a> and to the <a href="http://scummos.blogspot.de/2013/04/kdev-python-15-rc1-please-test.html">what's new in kdev-python 1.5 post</a>.<br />
<br />
I probably have written it often enough, but I'll repeat it once more: Python 3 support in kdev-python will be released together with Python 3.4.<br />
<br />
Another note, if you're using master, you have to clear your build directory (this includes running make clean in python-src/) to make it build again due to changes in the build system. If you didn't do any changes yourself, you can also run "cd kdev-python; git clean -f". Be aware that this will delete all untracked files in the kdev-python directory.scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com21tag:blogger.com,1999:blog-7888156866269720289.post-37386418535229992902013-04-30T01:26:00.003+02:002013-04-30T01:28:38.446+02:00About SSD hard drive durabilityWhen SSD disks popped up some time ago, many people's main concern was their durability. The claimed 10k write cycles for each block didn't really sound much to most people (including me). Still, I thought I'd risk it, and bought one (an 128GB Crucial/Micron RealSSD m4/C400) about one and a half years ago. The speedup is noticeable, especially for things which need short access times (find, copying large amounds of files, starting applications). Also, it's absolutely silent which is nice too. So from that perspective, I'd say it's definitely worth the money.<br />
<br />
But, how about its durability? Of course, I can only really tell about the durability once it breaks, but there is a handy little tool called <i>smartctl</i> which can read various bits of information from the hard drive's self test capabilities. For my device, it reports various things, such as a power-on time of about 5000 hours and a power cycle count of about 2200. The most interesting number, though, is probably the <i>wear levelling count</i>: From what I understand, this is the maximum amount of times a block on the disk has been re-written (you know, of the 10k times it is supposed to survive). Interestingly, after 18 months of daily usage, this is a whopping <b>53</b> (sic!) times for the worst-case block. Thus, the controller seems to do an excellent job at wear levelling (if it would be perfect, this 53 would mean an average disk write of 1.3GB per power-on hour, which seems ok; I do quite some IO-heavy tasks and you also have to take the wear levelling overhead into account). Quite impressive, I think!<br />
<br />
So: From the block wearout perspective, I don't think there's anything at all to worry about for SSD disks. Mine would survive another 100 years if it's about up to its spec. I guess the controller or something will fail much earlier than the actual memory blocks. And remember: The larger your disk, the better wear levelling is going to work, so this problem will be even less severe.scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com1tag:blogger.com,1999:blog-7888156866269720289.post-40450631397514203302013-04-28T19:33:00.002+02:002013-04-29T12:07:57.514+02:00Busting KDevelop mythsFor every KDevelop release, announcements are made by various people on various news sites, and there's plenty of comments. Depending on the news site, those comments are more or less accurate, but generally, comments on KDE applications outside of the "KDE world" (planet, developer blogs, ...) are often alarmingly mis-informed and are spreading a lot of FUD. I'm sure most projects have similar issues, but I feel it's especially bad for KDE, and for KDevelop in particular. I have no idea why, but I'd like to collect and clarify a few common misunderstandings and wrong things said about KDevelop.<br />
<a name='more'></a><h3>
First of all: KDevelop 3</h3>
KDevelop 3 is not KDevelop 4. Please, if you have used KDevelop 3 and you think that makes you know <i>anything</i> about KDevelop 4: forget it. The two applications have nothing to do with each other. And by nothing, I mean <b>nothing</b>. They have a totally different philosophy and a totally different code base, and they mostly have been developed by different people.<br />
<h3>
About KDevelop's philosophy</h3>
The way KDevelop 4 works differs from the way many other IDEs work, which means some people are sometimes confused about how it works and why. But, if we wanted it to work like something that alreay exists, there would be little point in creating it. So, here's some bullet points of things people often seem to get misunderstand:<br />
<ul>
<li><b>KDevelop 4 is not a programming tutorial</b>
<ul>
<li>KDevelop 4 is designed for people who know how to program, and who know how to use their tools. For example, KDevelop 4 supports building projects with CMake -- which does not mean it will magically create or maintain CMakeLists.txt files for you. It means we have tools to help you do it, such as CMake code completion and assistants to add new files. Of course, you can use KDevelop as a beginner -- I personally think it's an excellent choice -- but it's not an IDE that will save you from understanding how building an application works. Which we think is a good thing. In KDevelop, for all UI elements that have to do with things like building and debugging, or VCS support, it's very easy to tell how you'd do the same thing in the shell. It's just more convenient to have a button or a keyboard shortcut to do it.</li>
<li>KDevelop's aim is <b>not</b> to create an application which makes it as easy as possible to compile "Hello World" programs (although it happens to be pretty easy with the application templates).</li>
</ul>
</li>
<li><b>KDevelop 4 does not aim to be a collection of wrappers around as many tools as possible.
</b>
We try to integrate existing tools instead of wrapping around them, and we try to keep everything fully transparent to the user by design. For example, although we have git support, we expect people using it to know how git works.
</li>
<li>We try to be as non-invasive and transparent as possible. Especially, we have no project files (well, we have, but it
only contains your project name and a few similar settings -- it's not
something you want to have in your project repository, it's more like a personal
settings file). We have no workbench, i.e. importing a project into
kdevelop is as easy as "open this directory in KDevelop" and clicking
"yes use git support". You're not really "importing a project", you're
just opening a directory. The only thing which brands this
directory as being a KDevelop project is the <i>project</i>.kdev4 file, which, as said
above, is just some convenient meta-data. </li>
<li><b>The main focus of KDevelop 4 is language support. </b>The main focus of the IDE is things like code completion, syntax highlighting, marking syntactic and semantic errors, finding information about objects in the code (type of variables, ...) and quickly navigating in your code. This is what most time is spent on in development, and what -- in my personal opinion -- makes KDevelop really more useful<b> </b>than a text editor plus a few GUI tools for debugging and stuff. Yes, we have things like unit test integration, debugger support, tools to edit your build configuration cache etc, but the heart piece of the IDE is the language support part. I think the eclipse people would tell you something different about their IDE.</li>
<li><b>KDevelop is not a compiler and not a build system, nor does it contain either.</b> </li>
</ul>
<h3>
Comments frequently encountered and why they're pointless</h3>
<h4>
"kdevelop 3 was good, but kdevelop 4 has none of the features"</h4>
<ul>
<li>KDevelop 3 did lots of stuff, but it did little things really well. While KDevelop 3 supported almost every language and build system, for many of them it is questionable what benefits it provided over just using, say, kate. In KDevelop 4, this is different; we just do a few things, but we try to do them really well. If what you need is not among the things we do, then that is unfortunate, but I'm sure it's better to provide a really good tool to a few users than a mediocre tool which everyone <i>could</i> use, but nobody actually <i>does</i> use because there is better, more specialized alternatives.</li>
<li>KDevelop 3 focused on being a wrapper around dozens of development tools, quite the opposite of what KDevelop 4 does. If you're looking for wrappers around tools which are difficult to use by themselves, maybe you should instead look for better tools (such as CMake over automake).</li>
<li>If you're looking for complete GUI wrappers (as opposed to helpers) around tools which already have a nice interface, KDevelop 4 probably is not for you (e.g. CMake). As said above, we expect users to understand the tools we support. </li>
</ul>
<h4>
"kdevelop is slow"</h4>
It's not. Seriously, it's not. I'm not going to do an excessive benchmark now, because "slow" is so ill-defined, but KDevelop 4 is by far the most responsive and slim IDE I know. <br />
A little less subjectively, here's some numbers I took on my Arch Linux x64 (04/2013), SATA2 SSD, Intel Core i5 540M 2.4GHz CPU, 4GB RAM system (all numbers are after the respective appliction has been started before, because I'm too lazy to reboot twenty times):<br />
<br />
<b>RAM usage (RES):</b><br />
All applications with the KDevelop repository loaded as a project, after a fresh startup.<br />
KDevelop: around 250 MB <br />
Eclipse: around 400MB (Eclipse does not appear to hold a parsed representation of the project's source code, at least I've never seen it parse it?! I don't know...)<br />
Netbeans: about 600-700MB<br />
<br />
<b>Storage space: </b><br />
Without all dependencies, from pacman's "installed size". <br />
Eclipse CDT: 320MB<br />
Netbeans: 540MB<br />
KDevelop + kdevplatform: 50MB<br />
Of course, this will change if you don't have the dependencies; KDevelop depends on kdelibs (around 50MB, but depends on some more things itself) and friends, and Eclipse and Netbeans depend on the java stuff, so subjectively on an empty system (just plain X11 installed) I'd say it doesn't make much of a difference. Real numbers on what those IDEs plus all dependencies need storage-space-wise would be welcome of course. I would be very much surprised though if KDevelop (with all dependencies) would end up using significantly more storage space than Eclipse CDT (with all dependencies).<br />
That being said, it's a stupid point anyways, because who cares about whether it needs 100 MB or 500 MB on your hard disk nowadays (I don't). If it required several gigabytes (like mathematica or so), I might complain, but in the few-hundred-megabyte-range, everything is all right for an application I use every day.<br />
<br />
<b>Startup time:</b><br />
(until main window + all widgets shows up; "warm" start!)<br />
KDevelop: around 3 seconds<br />
Eclipse CDT: around 11 seconds<br />
Netbeans: around 18 seconds (plus an extra at least 5 until a file shows up in the editor)<br />
<br />
I'm perfectly aware that this is not a benchmark of any kind, or even a serious comparision. But maybe I just need to post some numbers in order to make people try for themselves if stuff is slow or not instead of just making random uninformed claims.<br />
<h4>
"$language is not supported"</h4>
Supported languages are: C++, CMake, PHP, Python, Ruby (not yet released but good), JavaScript/QML (not yet released and quite basic).<br />
Everything else is indeed not supported, and if you need an IDE which supports that language, you'll have to implement it yourself in KDevelop, or use a different IDE. <br />
But, be aware that "not supported" only means "no extra-fancy features". We do have syntax highlighting and such basic stuff for everything, from Action Script to Yacc, so you can edit files from other languages just fine.<br />
<h4>
"there is no GUI designer"</h4>
No, there is not. You can just use QtDesigner alongside KDevelop. How do you want QtDesigner integrated in KDevelop, do you want the designer window inside KDevelop? Or a "new UI file" button? What's the point?<br />
I claim that if you understand how KDevelop is meant to be used, you will have to agree that there is little point in QtDesigner integration beyond having a template for "UI file with C++ class" (which we have), because all you could do is pinning the designer window into a KDevelop tab, which I don't see a point in.<br />
<h4>
"it's KDE so it's slow / bloaty / cannot be used under FOOBARDE /..."</h4>
"it's KDE" just means that it uses the KDE libraries which means it'll depend on some packages. Other IDEs have dependencies as well, they use a different set of libraries (when I installed eclipse for the test above, I didn't have java installed for example). I don't see a qualitative difference between depending on Java and depending on kdelibs.<br />
It also doesn't mean you can't use it in other environments than KDE's plasma, that's a myth which just keeps popping up for whatever reason. It's about as pointless as claiming that you can't run vim on X11 because X11 is GUI and vim is terminal. Or so.<br />
It also doesn't mean it'll be any slower in non-KDE environments. Of course, if you use a lot of KDE applications, they will, combined, use less memory and start up faster because of shared libraries, but that's an extra benefit you don't get for other applications anyways.<br />
<h4>
"the syntax coloring makes my eyes bleed"</h4>
First, you can turn it off if you don't like it. Second, try using it for a week -- I have yet to meet someone who turned it off after having used it for a while.<br />
<a href="http://userbase.kde.org/KDevelop4/Manual/Working_with_source_code#Rainbow_color_highlighting_explained">Here's an extensive explanation about how syntax coloring works.</a> <br />
<h4>
"it's unstable and crashy"</h4>
It's not. There was problems with stability in the 4.1 era (wich was years ago), and there's a bug in some Qt versions before 4.8.3 which made it crash too, but the current version is perfectly stable.<br />
<br />
That's about all. I hope that with this post I have covered most things that usually come up, so I can just link to this page when it happens again ;)<br />
<br />
<br />
<br />scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com10tag:blogger.com,1999:blog-7888156866269720289.post-36651088917109091072013-04-25T11:39:00.000+02:002013-04-25T11:48:39.970+02:00kdev-python 1.5 rc1 -- please test!Hi!<br />
<br />
Five months have passed since the release of kdev-python 1.4.1, and it's about time for the next release! The 1.5 release will contain various new features and bug fixes, and also will work with KDevelop 4.5, which is to be released soon.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUcETOna6v_-kh2nDN-tHpB5-puQef8JK-GRaK04pTrWjgiLZX4egshAv-LmpcoHetT_siiOgrFfSFXXoRw6SUxSTjHwOOov1726ks2_OFr-ozY8v4116STovq9oB5KNEjYop6PWQvR4E/s1600/initproperty.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUcETOna6v_-kh2nDN-tHpB5-puQef8JK-GRaK04pTrWjgiLZX4egshAv-LmpcoHetT_siiOgrFfSFXXoRw6SUxSTjHwOOov1726ks2_OFr-ozY8v4116STovq9oB5KNEjYop6PWQvR4E/s1600/initproperty.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">One of the new features in kdev-python 1.5: initializing properties in class constructors via code completion</td></tr>
</tbody></table>
<h3>
Notable Bugs fixed</h3>
The following issues were fixed, among others:<br />
<ul>
<li><span style="font-size: xx-small;"><i>312275</i></span> don't add brackets if importing functions</li>
<li><span style="font-size: xx-small;"><i>318802</i></span> fix quadruple-quotes from causing completion to malfunction</li>
<li><span style="font-size: xx-small;"><i>317998</i></span> issue with function definition ranges causing completion to malfunction</li>
<li><i><span style="font-size: xx-small;">317808</span></i> correct inheritance completion with member access</li>
<li><i><span style="font-size: xx-small;">309817</span></i> correctly build uses for declarations in some corner cases</li>
<li><i><span style="font-size: xx-small;">309469</span></i> include documentation files for PyKDE and the rest of PyQt</li>
<li><i><span style="font-size: xx-small;">308986</span></i> fix a rare crash with some function definitions</li>
<li><i><span style="font-size: xx-small;">1d34b03</span></i> fix an infinite loop in the debugger plugin</li>
<li><span style="font-size: xx-small;"><i>031badc</i></span> don't reparse files on session restart if not necessary</li>
</ul>
The numbers are the bug / commit IDs of the change.<br />
<h3>
Notable new Features</h3>
The following new features are worth mentioning:<br />
<ul>
<li><span style="font-size: xx-small;"><i>333cf91</i></span> sort completion items based on name similarity</li>
<li><i><span style="font-size: xx-small;">6dc24ad</span></i> class attribute initialization completion</li>
<li><i><span style="font-size: xx-small;">cd03cee</span></i> PEP8 error checking. Enable it in "configure kdevelop" if you want to use it.</li>
<li><i><span style="font-size: xx-small;">b3ba512</span></i> support adding watches in the debugger plugin</li>
</ul>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWsQcXxlAgI0TlFDwNAXuF66EnuL7GPuPK2A4hZvGW3gX0DDABLVxJzt39EOJRalkqaS52WWE-_WR1jML2VUHmniBRTFSIFGrCM_lCk1aEkZLi7e7InqJa_UrUilZp8dNHaNpppAuxiTc/s1600/sorting.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWsQcXxlAgI0TlFDwNAXuF66EnuL7GPuPK2A4hZvGW3gX0DDABLVxJzt39EOJRalkqaS52WWE-_WR1jML2VUHmniBRTFSIFGrCM_lCk1aEkZLi7e7InqJa_UrUilZp8dNHaNpppAuxiTc/s1600/sorting.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Name-aware variable sorting: Although "the_bar" comes first alphabetically, "the_foo" is sorted first because its name matches the left side of the expression. You can still get an alphabetical list by invoking full completion.</td></tr>
</tbody></table>
<h3>
Features that didn't make it into 1.5 yet</h3>
Two things that I wanted in 1.5 but which are not there are Python 3 support, and GHNS support. The latter is just not ready yet (might be in 1.5.1 or 1.5.2, but probably 1.6), the former can only be released in Q1 2014, <a href="http://scummos.blogspot.de/2013/03/various-news-in-kdevelop-kdev-python.html">as explained here</a>.<br />
<h3>
Get it</h3>
kdev-python 1.5 is to be used with kdevplatform 1.5, and only 1.5 (so, kdevplatform with version numbers >= 1.4.60 and < 1.5.40). It's not going to work with kdevplatform master, or kdevplatform 1.4. <br />
Please test this RC thoroughly and report any issues you find <a href="http://bugs.kde.org/">to the bugtracker</a>, so the final 1.5 release can be as nice as possible! Get the tarball <a href="http://download.kde.org/unstable/kdevelop/kdev-python/1.4.90/src/kdev-python-v1.4.90.tar.bz2.mirrorlist">from download.kde.org</a>. The sha256sum of the tarball is<br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">441f675baddbfb9832a49458cc3c9a17daac4db55e7312c7a85d184bc0f4c776</span></span><br />
Have fun with it! (not with the checksum, with the program I meant... you know)<br />
<br />scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com27tag:blogger.com,1999:blog-7888156866269720289.post-14121892580755447352013-04-04T01:22:00.000+02:002013-04-04T01:31:26.116+02:00Collaborative editing in KTE (prototype)I had a bit of spare time, so I decided I'd try to implement collaborative editing in KTextEditor, and see how far I can get in a week. That week is over now -- and this is how far I got:
<br />
<video controls="" width="540">
<source src="http://files.feorar.org/static/multi-user.ogv" type="video/ogg"></source>
Your browser does not support the video tag.
</video> <br />
<br />
<span style="font-size: x-small;">(If your browser doesn't support HTML5 video, here's a <a href="http://files.feorar.org/static/multi-user.ogv">direct link</a>)</span><br />
<a name='more'></a><h3>
Technical implementation</h3>
In the background, all this is based on <a href="http://gobby.0x539.de/trac/wiki/Infinote/Libinfinity">libinfinity</a>. There has been a KDE project in the past which attempted to build a collaborative editor on top of that protocol/library, called <a href="http://kobby.greghaynes.net/">kobby</a>, which is based on KTE (KTextEditor -- the thing used by kate, kwrite, kdevelop, kile, ...) too, but builds a seperate application on top of KTE (like kate or kwrite). I decided to try fixing its bugs, and turning it into a KTE plugin instead of starting from scratch. Developed together with kobby there's a library called <a href="http://gitorious.org/libqinfinity">libqinfinity</a> which is a Qt wrapper around libinfinity (which is written in gobject-based C). So: <i>kobby-kte</i> (work-name for this project) is based on libinfinity and libqinfinity, and is a continuation of the kobby code base.<br />
<br />
All the functionality currently resides in a KTE plugin, and a kioslave. The KTE plugin watches the documents being opened, and if a document uses the inf:// (infinity) protocol, it tries to subscribe to a collaborative editing session. The reason for splitting the program into a kioslave and a KTE plugin is that a KTE plugin cannot do anything which is related to managing documents (such as, opening a document), because that is specific to the application (KDevelop manages open documents in a different way than kate does). Also, a KTE plugin cannot really add UI (like a toolview for example), because that, too, is specific to the application. Since the only UI this project really needs is a way to browse remote documents, it seemed like a good idea to just write a kio slave and use the application's "Filesystem" toolview or "Open" dialog for that purpose.<br />
<h4>
kio slave</h4>
Not much needs to be said about the kioslave; it's very basic, it can just list files and directories, and create empty files and new directories. But because I like pictures and videos, here's a picture and a video:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl3qsTpXaXV3Ehg0hMrrvN3bsCFQANBHtJBNABpuz9g4t1Xl_6pUU1fqM1uXAwRv8ZqjZpEEimO1ZbwIBSSqlZ4rR9S_ls0LdYUArO2peO2f3qWwY5BpyNP34ARsPSgy8aqz5ysf_r73c/s1600/kio.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl3qsTpXaXV3Ehg0hMrrvN3bsCFQANBHtJBNABpuz9g4t1Xl_6pUU1fqM1uXAwRv8ZqjZpEEimO1ZbwIBSSqlZ4rR9S_ls0LdYUArO2peO2f3qWwY5BpyNP34ARsPSgy8aqz5ysf_r73c/s400/kio.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">kioslave listing data from infinoted running on localhost</td></tr>
</tbody></table>
<br />
<video controls="" width="540">
<source src="http://files.feorar.org/static/inf-protocol.ogv" type="video/ogg"></source>
Your browser does not support the video tag.
</video> <br />
<br />
<span style="font-size: x-small;">(If your browser doesn't support HTML5 video, here's a <a href="http://files.feorar.org/static/inf-protocol.ogv">direct link</a>)</span><br />
<br />
<h4>
KTE plugin</h4>
The remaining functionality, mainly synchronizing documents, is implemented in the KTE plugin. The code used in the plugin is mainly from kobby (modified sometimes slightly, sometimes considerably), with just the plugin-related stuff and the fancy popup widgets implemented in the plugin itself. Here's another video of it synchronizing stuff across kate and kdevelop:
<br />
<video controls="" width="540">
<source src="http://files.feorar.org/static/kate-kdevelop.ogv" type="video/ogg"></source>
Your browser does not support the video tag.
</video> <br />
<br />
<span style="font-size: x-small;">(If your browser doesn't support HTML5 video, here's a <a href="http://files.feorar.org/static/kate-kdevelop.ogv">direct link</a>)</span><br />
Oh, the popups are done in QML of course! I'm aware that they flicker a bit, I think it can be solved easily, I just didn't get around to do it yet.<br />
Note how KDevelop's code completion synchronizes flawlessly into kate! Another nice way to convince people using such mundane editors of the powers of KDevelop ;)<br />
<h3>
Main remaining issues</h3>
There's a few major things which are broken with this (as you probably guessed for something that was glued together in a week). The most obvious ones are:<br />
<ul>
<li>There's no way to set the username, it'll be choosen randomly. I will implement this using the protocol's auth, so you can go to inf://myuser:mypassword@localhost:12345/foo.py and then you'll be editing foo.py with username myuser. That's easy, I just didn't do it yet.</li>
<li>When the remote inserts or removes text, the document will jump to <i>your</i> current cursor location. I have noticed this behaviour of KTE before, I'm not sure why it does that. Could even be a bug in KTE.</li>
<li>There's no proper undo/redo. Undo/redo does something, but it'll break in real-world use cases. The infinity library has this problem solved; it's just a matter of taking the undo/redo actions away from the KTE view, and re-assigning them to the library functions. That needs to be talked about, though, since there's currently no sane way to do that.</li>
<li>When KTE changes something as a direct reaction to you typing text, and that happens only in the remote application (so, you type something, and {if your peer had typed it instead, something other than what was typed would have changed}*), stuff breaks. For example, if one person has "replace tabs by spaces" on and the other person has it off**, strange things will happen. <a href="http://files.feorar.org/static/kte-collaborative-bug.ogv">Here's an even more subtle example (video).</a> However I currently believe that all those issues are the same bug in the core, and can probably be fixed with one or two mutexes in the right place (it's just a matter of <i>finding</i> that place). Handling conflicts on the network / insertion order level is not a concern of ours, it's handled by the library automatically (and this is the far more difficult thing).</li>
<li>There's barely error handling code in both the kioslave and the plugin. For example, if your user name is already taken, it'll just write a kWarning to stdout, instead of giving you a dialog to enter a new user name; there's no proper timeouts in the kioslave; etc. Lots of error conditions are just handeled with asserts or even crashes (in a week, you just don't have enough time to write lots of error boxes ;)</li>
</ul>
<h3>
Code</h3>
If you <i>really</i> want, you can find the code in two KDE scratch repos of mine (called <i>kobby</i> and <i>libqinfinity</i>; see the <i>kobby-plugin</i> branch for the kobby repo). Be warned though, the code is a bit mixed up (there's about 3 layers of wrappers stacked on top of each other which makes everything a bit complicated). If you still want to work on this, it's very much appreciated, I'm not sure if I will have the time to finish and/or maintain it in the future. Although the code is a bit screwy at places, it's very little code (below 2500 SLOC, so it's easy to fix structural defects), and it's really fun to work on since you can get fancy stuff fairly easily (also it has QML!1!!1!). One more note, lots of documents in the repo are actually unused (and are not even being built), they're just there still because I didn't decide yet whether we need to integrate them into the plugin or not. Most of what is not being built currently can probably be removed (the difference is about 3000 SLOC, so out of 5500 lines in the repo only 2500 are being built and used).<br />
There also has been some fuzz around GSoC projects similar to this... maybe someone wants to continue it in GSoC? I'm open for everything, just email me or ping me in IRC. (note that I'm not a GSoC mentor though)<br />
<h3>
Credits</h3>
The main work about this was done by Armin, who wrote libinfinity, and Gregory, the author of kobby. I just wrote some glue code to turn the existing stuff into something new.<br />
<br />
______<br />
* Wait, so you're telling me I can't use curly braces to mark the semantics in a sentence? Where do <i>you</i> come from? Go away.<br />
** The issue with this is that it will replace a tab (one character) by four spaces (four characters), <i>inside</i> the "we're currently inserting text written by the remote, don't notify the remote of changes done just now" block. That's why it breaks.<br />
<br />
P.S.: The definition of irony: <a href="http://www.html-seminar.de/html-5-video.htm">A video explaining how to embed videos in HTML without flash -- in a flash video player</a>. scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com10tag:blogger.com,1999:blog-7888156866269720289.post-39781420775375538862013-03-24T02:11:00.000+01:002013-03-24T02:23:30.281+01:00Various news in kdevelop, kdev-python, kdev-qmljsBefore everything else, I want to send a big "thank you" to our hard-working sysadmins who spent so much time and effort recently on fixing the git servers! It's working nicely again.<br />
<br />
Other than that, there's various news in kdevelop-land: kdev-python now has a branch which builds against upstream python 3.4 (which is not released yet), there's a few fancy new features in kdev-qmljs (QML / javascript language support for KDevelop), and KDevelop has a new splash screen.<br />
<br />
<a name='more'></a><br />
<h3>
kdev-python without modified Python fork</h3>
Until now, kdev-python's repository contained a fork of Python. This fork was modified from the official version of Python to fix some issues which were counteracting its use as a parser in an IDE. Fortunately, a patch of mine now was accepted upstream which solves most of the issues, so in the future, the fork will not be necessary any more. Unfortunately tough, the patches changes are not binary compatible, and thus will only go into the next feature release of Python (3.4), and also cannot be backported. This means that the Python 2 version of kdev-python will have to stay with the fork.<br />
<br />
This also means that plans for Python 3 in kdev-python support have changed: since I don't want to maintain three versions (python2, python3 with fork, and python3 without fork) the official release of kdev-python3 will have to wait for the release of Python 3.4 (early 2014). I'm sorry. If you need it, either build the (now unmaintained) python3 branch, or build Python 3.4 from mercurial and build kdev-python's python3-nofork branch against that. Alpha releases of Python 3.4 are going to happen soon-ish, you should also be able to build against those.<br />
<br />
Apart from this local (in time) trouble however this is great news for kdev-python -- it'll make it much easier to maintain and adjust to future releases of Python, also it'll be easier to package, use less memory, and less disk-space (one can question the relevance of the two latter points of course ;)<br />
<h3>
New features in kdev-qmljs</h3>
After all that dry and difficult hacking on python's and kdev-python's AST, I wanted to do something fancy. So, I made this:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUVps8qYDJTN98nM_QZJ4uZsgW6zKj293Z1rrDbiu1-dv1f5061tZgJWRHKn7UroXJYoQIHTdqpcbSuR-GPNjQeNEkVGnOsLArTlI3yLeztrQYW7_sMty-qV0I4QYZ2JxTAlf9xJmZSq8/s1600/colorpicker.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUVps8qYDJTN98nM_QZJ4uZsgW6zKj293Z1rrDbiu1-dv1f5061tZgJWRHKn7UroXJYoQIHTdqpcbSuR-GPNjQeNEkVGnOsLArTlI3yLeztrQYW7_sMty-qV0I4QYZ2JxTAlf9xJmZSq8/s1600/colorpicker.gif" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Inline color picker in kdev-qmljs</td></tr>
</tbody></table>
It should be rather self-explaining what it does. It needs a slight change to kdevplatform, so you need to update that too if you want to try it. I also made similar popup widgets for a number of other things in QML too:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8dJAtx1AuAk6cHszZyWjMod2DKYmKsLmTUPlAGu9AEbMpobR9S1WAWj2AzPdodF4ZXRIN4fBC5lL95NyjVSCVJ9B8XWeiVCTb6kYZ69V2bKcv2rwdYo36DBjTwgfJOeAmc4VRNXMoulA/s1600/spacing.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8dJAtx1AuAk6cHszZyWjMod2DKYmKsLmTUPlAGu9AEbMpobR9S1WAWj2AzPdodF4ZXRIN4fBC5lL95NyjVSCVJ9B8XWeiVCTb6kYZ69V2bKcv2rwdYo36DBjTwgfJOeAmc4VRNXMoulA/s1600/spacing.gif" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Inline popup widget for modifying item spacing</td></tr>
</tbody></table>
Those widgets always show a generic preview image and allow modifying a property with a slider or similar. They're written in pure QML, so it's easy to add more widgets for other properties (adding a new widget currently requires a one-line-change in C++ tough, this might be useful to change in the future to make it easy for users to add their own widgets).<br />
<br />
I know that the usefulness of those is questionable. The color picker is useful for sure, but about the rest... I don't know. It seemed like a good idea, so I tried it out -- opinions, ideas and other feedback is welcome.<br />
<br />
Oh, the color picker currently doesn't work with alpha colors, I know, I'll fix it some day.<br />
<h3>
New splash screen for kdevelop</h3>
Another thing which was a victim of my "I want to do something fancy" streak was kdevelop's splash screen. It's now also written in mainly QML, and gets progress info from kdevplatform. It looks like this:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZMURUU0HlBUp6cioe5LPt9vMoI-VgbZB9PJ_U0HUZzLfFhX5inkX85C9WrKTyoLBk1Z3a_Th9_v53gaHNYOLptzyU1rYdJBLsaFrdnV7BZo6_w3eGR6NRjKJa9YMIXekrn5J62GU-2Vs/s1600/splash.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZMURUU0HlBUp6cioe5LPt9vMoI-VgbZB9PJ_U0HUZzLfFhX5inkX85C9WrKTyoLBk1Z3a_Th9_v53gaHNYOLptzyU1rYdJBLsaFrdnV7BZo6_w3eGR6NRjKJa9YMIXekrn5J62GU-2Vs/s400/splash.gif" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">KDevelop's new splash screen.</td></tr>
</tbody></table>
The progress steps might need a bit of work. The timing is not accurate here, I had to pick few frames to get a reasonable file size.<br />
<br />
Oh also, look what awesome old splash screens you can find in the current kdevelop repository:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijpYlKNFxFB6LLJicJOqS5c3mefpcwq8Zc_v9tC_xVQ_UcuOuIv7h_LkUf3ccARd_6y9OF0uWOhzl6MOQczeXWfrcH7Q8fxz0RASs60ooGonCRCFhsMn613wanew0rSFKzfOw1OcG4dMU/s1600/startlogo.bmp" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijpYlKNFxFB6LLJicJOqS5c3mefpcwq8Zc_v9tC_xVQ_UcuOuIv7h_LkUf3ccARd_6y9OF0uWOhzl6MOQczeXWfrcH7Q8fxz0RASs60ooGonCRCFhsMn613wanew0rSFKzfOw1OcG4dMU/s1600/startlogo.bmp" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Actual picture!</td></tr>
</tbody></table>
<br />scummoshttp://www.blogger.com/profile/12133795109922287229noreply@blogger.com13