Disclaimer: This is a personal web page. Contents written here do not represent the position of my employer.
Saturday, December 18, 2021
geewallet 0.4.300.0 released!
10th of my 21-day quarantine*! And to celebrate, I'm going to release a new version of geewallet. It's not that I blog about geewallet releases often (or blog at all, lately), but this one is a special one for me. We decided to call it 0.4.300.0
The highlights:
- We fixed the GTK theme for our snap package. (Long version of the story: ever since we upgraded our snap generation process to take place in Ubuntu 20.04 instead of Ubuntu 18.04, the theme stopped working so the app was not showing anymore with the default theme of the system, but with the default Gtk theme, which is very plain. Even if you might consider this issue important, we haven't had time to look at it because we've been very busy finishing Lightning support. Sorry.)
- The chart rendering doesn't use SkiaSharp anymore, but good-old Cairo. This fixes some UI glitches that we had in the GTK frontend. (Long version: for this, we didn't just draw the chart using Cairo in our Gtk frontend, we actually wrote an implementation of the Shapes API for the Xamarin.Forms' GTK backend, and we contributed the work upstream: https://github.com/xamarin/Xamarin.Forms/pull/14235 . Hopefully they merge it soon so that we don't need to use our own forked repo/nuget anymore.)
- Fixed a crash when pairing with a cold-storage wallet. (Long version: user might not know that pairing is only allowed against another geewallet instance; low-hanging fruit bugfix which I shouldn't have neglected for so long, I know.)
- Fixed a crash when scanning some QR-codes that contained unknown parameters in the bitcoin URI. (Long version: I was actually in El Salvador and when trying to use a BTM, I found this bug! Apparently some BTMs here add an extraneous "chivo" param in the URI's querystring, in case the wallet being used is the one from the government; not sure why. In this case, geewallet was failing fast instead of ignoring the unexpected intruder.)
- Our CI now checks that our Android, macOS, and iOS frontends don't break. Previously the only frontends that we built in CI were the Gtk one (Linux) and the Console one (cross-platform, it's just terminal-based).
- We do snap package generation in GitLab now instead of GitHub. This is good because Microsoft keeps changing the Linux VMs being used in the GitHubActions service so we cannot keep up fixing things that just break out of the blue (so, they break independently from what we change in our commits, which is very confusing!). (Long version: we had to use GitHubActions because GitLabCI uses docker under the hood; so given that snapcraft uses systemd, it conflicts with it; now we use a "docker in docker" approach to be able to run in GitLabCI; which also allows us to publish the snap package as an artifact in the GitLabCI pipeline, not just publishing it to the Snap Store; this way, in case you somehow need a previous version in the future you can grab it from there, something that you couldn't just via snap AFAIU).
- Even though this wallet supports two ETH currencies (ETH itself, and DAI), we don't recommend their use at the moment because of the high fees and long confirmation waits these days. This is because the wallet waits for an ETH transaction to be mined (to make sure it didn't run out of gas, and if it did, report the problem to the user), but these days this wait is longer than the time-out. The short-term fix for this is either a) assume it will never ran out of gas, since our address is not a contract anyway (so I guess it can never run out of gas, right? feel free to prove me wrong, my ETH knowledge is not top-notch), or b) have some UI indicating that a transaction has been sent but not accepted by the network yet. The long-term fix is to have off-chain (Layer2) technology supported by the wallet, but we don't know which technology we will choose for this, and of course we're giving priority to the first Layer2 technology: Lightning (which is only compatible with BTC and LTC). All this aside, the wallet works well with ETC (an Ethereum-compatible technology). Anyway, this doesn't worry me too much because... what is the ETH blockchain used for these days, mainly? NFTs and DeFi pyramid schemes. In case you didn't get the memo, most of the former (if not all) are scams, and the latter are all of them mainly based on dubious centralized stablecoins (which could suffer fractional reserve and therefore cause bank runs, as Elizabeth Warren has already warned about).
- Despite this wallet being implemented with .NET (F#), our Windows compatibility story is very poor :'-( We ran into limitations of the Microsoft's AOT technology being used for UWP apps (required by the official process required to publish it in the WindowsStore) in the past. Nowadays apparently you can publish apps in the WindowsStore without these limitations, but we haven't tried again. Maybe by the next time we give it another go, we might have moved to MAUI already (which means WinUI instead of UWP under the hood). As always, if this is your cup of tea, we accept MRs!
Labels: General, Gnome, Mono, Programacion, SoftwareLibre, Xamarin
Saturday, February 08, 2020
Xamarin forks and whatnots
- In Linux(GTK), cold storage mode when pairing was broken, because the absence of internet connection was not being detected properly. The bug was in a 3rd-party nuget library we were using: Xam.Plugin.Connectivity. But we couldn't migrate to Xamarin.Essentials for this feature because Xamarin.Essentials lacks support for some platforms that we already supported (not officially, but we know geewallet worked on them even if we haven't released binaries/packages for all of them yet). The solution? We forked Xamarin.Essentials to include support for these platforms (macOS and Linux), fixed the bug in our fork, and published our fork in nuget under the name `DotNetEssentials`. Whenever Xamarin.Essentials starts supporting these platforms, we will stop using our fork.
- The clipboard functionality in geewallet depended on another 3rd-party nuget library: Xamarin.Plugins.Clipboard. The GTK bits of this were actually contributed by me to their github repository as a Pull Request some time ago, so we just packaged the same code to include it in our new DotNetEssentials fork. One dependency less to care about!
- Xamarin.Forms had a strange bug that caused some buttons sometimes to not be re-enabled. This bug has been fixed by one of our developers and its fix was included in the new pre-release of Xamarin.Forms 4.5, so we have upgraded geewallet to use this new version instead of v4.3.
Labels: CSharp, General, Ingenieria, Miscelanea, Mono, Programacion, SoftwareLibre, Xamarin
Sunday, January 05, 2020
Introducing geewallet
- Make it even more user friendly: blockchain addresses are akin to the numeric IP addresses of the early 80s when DNS still didn’t exist. We plan to use either ENS or IPNS or BNS or OpenCAP so that people can identify recipients much more easily.
- Implement Layer2 technologies: we’re already past the proof of concept phase. We have branches that can open channels. The promise of these technologies is instantaneous transactions (no waits!) and ridiculous (if not free) fees.
- Switch the GTK Xamarin.Forms driver to work with the new “GtkSharp” binding under the hood, which doesn’t require glue libraries. (I’ve had quite a few nightmares with native dependencies/libs when building the sandboxed snap package!)
- Integrate with some Rust projects: MimbleWimble(Grin) lib, the distributed COMIT project for trustless atomic swaps, or other Layer2-related ones such as rust-lightning.
- Cryptography work: threshold keys or deniable encryption (think "duress" passwords).
- NFC support (find recipients without QR codes!).
- Tizen support (watches!).
- Acceptance testing via UI Selenium tests (look up the Uno Platform).
- Flatpak support: unfortunately I haven’t had time to look at this sandboxing technology, but it shouldn’t be too hard to do, especially considering that there’s already a Mono-based project that supports it: SparkleShare.
- Ubuntu packaging: there’s a patch blocked on some Ubuntu bug that makes the wallet (or any .NET app these days, as it affects the .NET package manager: nuget) not build in Ubuntu 19.10. If this patch is not merged soon, the next LTS of Ubuntu will have this bug :( As far as I understand, what needs to be solved is this issue so that the latest hotfixes are bundled. (BTW I have to thank Timotheus Pokorra, the person in charge to package Mono in Fedora, for his help on this matter so far.)
- GNOME community: I’m in search for a home for this project. I don’t like that it lives in my GitLab username, because it’s not easy to find. One of the reasons I’ve used GitLab is because I love the fact that being open source, many communities are adopting this infrastructure, like Debian and GNOME. That’s why I’ve used as a bug tracker, for merge requests and to run CI jobs. This means that it should be easy to migrate to GNOME’s GitLab, isn’t it? There are unmaintained projects (e.g. banshee, which I couldn’t continue maintaining due to changes in life priorities...) already hosted there, so maybe it’s not much to ask if I could host a maintained one? It's probably the first Gtk-based wallet out there.
- Please don’t ask me to add support for your favourite %coin% or <token>.
- If you want to contribute, don’t ask me what to work on, just think of your personal itch you want to scratch and discuss it with me filing a GitLab issue. If you’re a C# developer, I wrote a quick F# tutorial for you.
- Thanks for reading up until here! It’s my pleasure to write about this project.
PS: If you're still not convinced about these technologies or if you didn't understand that PoW video I posted earlier, I recommend you to go back to basics by watching this other video produced by a mathematician educator which explains it really well.
Labels: CSharp, General, Gnome, Ingenieria, Miscelanea, Mono, Programacion, Seguridad, SoftwareLibre, Xamarin
Wednesday, January 23, 2019
WORA-WNLF
- Xamarin (the company) was bought by Microsoft and, at the same time, Xamarin (the product) was open sourced.
- Xamarin.Forms is opensource now (TBH not sure if it was proprietary before, or it was always opensource).
- Xamarin.Forms started supporting macOS and Windows UWP.
- Xamarin.Forms 3.0 included support for GTK and WPF.
Labels: CSharp, General, Gnome, Ingenieria, Mono, Programacion, SoftwareLibre, Xamarin
Tuesday, March 17, 2015
How do you upgrade your distro? A tale of two workarounds
Every classic Linuxer would know why it's very handy to dedicate a separate partition for the /home folder of your tree: you could in theory share it between multiple OSs that you installed in your box (which you choose to run when you start your computer).
Now, I'm guessing that many people reading and nodding to the above, will also know that sharing /home/ is one thing, sharing $HOME (/home/yourUserName) is a completely different beast.
For example: you have a stable distro installed in your box; you decide to install a new version of that distro along the old one, in the same box. You run the new distro with a new account tied to the old /home/yourUserName folder: KABOOM!!! Weird things start happening. Among these:
- The newer versions of your desktop or desktop programs don't run properly with the settings saved in your .dotDirectories (they are to blame because they didn't probably have a settings-conversion feature).
- The newer versions of your desktop or desktop programs have a buggy settings-conversion feature; because your program does not run properly, or as well as it would have run if it had been ran for the first time with no settings saved at all.
- The newer versions of your non-buggy desktop or desktop programs convert your settings to a new format. Then when you go back and run your old distro again, your old-versioned programs stop working because they see settings in a new format which they don't understand. (This is impossible to fix, or very hard.) It's very important that this scenario works, because the migration to the new version of your distro may not be immediate, it may take you some days to figure everything out, and until that happens, you want to still be able to run the stable version of your desktop and desktop programs
- Etc.
To workaround these problems, I have a strategy: I use a different /home/ sub-directory for each distro installed in my system. For example, for distro X version A.B I use /home/knocteXAB/, for distro Y version C.D I use /home/knocteYCD/. The advantage about this is that you can migrate your settings manually and at your own pace. But then, you may be asking, how to really take advantage of sharing the /home folder when using this technique?
Easy: I keep non-settings data (mainly the non-dotfiles) in a different /home/ folder with no associated account in any of the distros. For example: /home/knocte/ (no version suffix). Then, from each of the suffixed /home/ subfolders, I setup symlinks to this other folder, setting the appropriate permissions. For instance:
- /home/knocteXAB/Music -> /home/knocte/Music
- /home/knocteXAB/Documents -> /home/knocte/Documents
- /home/knocteYCD/Music -> /home/knocte/Music
- /home/knocteYCD/Documents -> /home/knocte/Documents
- Etc.
- Debugger not stopping on breakpoints.
- Builds breaking with obscure error messages.
- Debugger opening file in the IDE which was already open, duplicating two tabs for the same file.
- Etc.
So I had to use a workaround for my workaround: clone all my projects in $HOME instead of /home/knocte/Documents/Code/OpenSource/ (yah, I'm this organized ;) ).
I've been trying to fix these problems for a while, without much time on my hands.
But the last weeks a magical thing happened: I decided to finally sit down and try to fix the last two remaining, and my patches were all accepted and merged last week! (at least all the ones fixing symlink-related problems), woo!!!
So the lessons to learn here are:
- Even the slickest workarounds have problems. Try to fix or report settings-conversion bugs!!
- Don't ever quit trying to fix a problem. Some day you'll have the solution and you will realize it was simpler than you thought.
- realpath is your friend.
- MonoDevelop (master branch) is now less buggy and as amazing as (or more than) ever (</PUBLIC_SERVICE_ANNOUNCEMENT>).
Labels: CSharp, General, Gnome, Mono, Programacion, SoftwareLibre
Tuesday, May 20, 2014
Banshee GSoC-2014 projects under Gnome umbrella
This time, Google has given plenty of slots to the GNOME project, so we could accept many participants, including 3 brilliant students to work on the Banshee project. In case they haven't blogged about it, or didn't give much detail, I'll elaborate a bit about what they will be aiming to do these months:
- Nicholas Little will be working on creating a new extension for Bluetooth synchronization, and if time permits, refactoring our MTP support. In regards to the latter, if you have an Android phone you might have experienced some bugs getting it to work with Banshee lately (our MassStorage synchronization support is great, but the latest versions of Android have been deprecating this mode in favour of MTP, which we never supported very well); we have been working hard on fixing them, but Nicholas is going to try to give it that extra push at the end of the summer, which I'm confident he will do very well (he was the developer who brought Symbian support for the masses -or rather, for his Nokia N95 ;) -, on Banshee 2.9.0). And you may be wondering, why do we need Bluetooth sync? Well, we understand that it's much slower than USB or Wifi, but:
- USB can work for the first sync, but whenever you update your library, I never remember to connect my phone again with my cable, or I'm too lazy to do it. Now imagine that whenever your phone is near your computer (and of course if you have Banshee running), they could negotiate together to update the sync without the need of moving a finger!
- Wifi could work also for the use case I just explained, but getting Wifi to work, compared to Bluetooth, would involve creating an app for the phone that could talk with Banshee. And we all know what are the problems associated with that: we would need to be cross-platform for at least the 3 main mobile platforms out there (well, iOS wouldn't even work neither with this nor with Bluetooth, because there are no public APIs to integrate with the music database of the OS, sigh iTunes...), and that means a lot of maintenance burden (even if we choose a same-language native platform like Xamarin), and a user experience that is not so seamless (as it would require the user to install an app first).
- Marcin Kolny, which has convinced us that he will do a great job given his great patches and the fact that he's already very involved in opensource (maintainer of C++ bindings to GStreamer if I recall correctly), will be working on integration with AcoustID. To summarize it very bluntly, AcoustID is the open-source alternative to Shazam, so thanks to this, if you have many tracks in your library which didn't get ripped properly with tags, or you got from some friend which is not very metadata-driven ;) then you will be able to fix this situation! We will be likely reusing the MetadataFixer extension that we already have in Banshee, to not reinvent the UI wheel.
- Dmitriy Petukhov, a very motivated Russian student, will be helping us get two extensions in shape, which were developed in the last GSoC (more details about this in my previous blog post), but were not ready for mainstream yet. The FanArt.TV extension, which retrieves artist logos and shows them next to your album icons, needs some caching (we could even violate FanArt.TV service's ToS if we don't do this) and UI polish (our ListView widget doesn't play well with differently-sized images, so we need to modify this custom GTK widget to allow rendering rows with different heights). The SongKick extension works great, but also needs caching, and it especially needs GeoLocation to maybe even work autonomously (imagine, you don't even know what SongKick is, and because you installed the banshee-community-extensions package of your distro, you suddenly get told that one of your favorite bands is soon playing a gig near your city!).
I'm very happy about starting the mentoring of these projects this year. And I'm specially jealous about my students... I became mentor of GSoC myself without being GSoC student first! (Maybe I should switch roles in the future?)
Wish them good luck! It was actually just yesterday when GSoC really started! (gotta love mondays)
UPDATE: Fixed embarrassing typo: I meant AcoustID, not OpenID!
Labels: General, Gnome, Mono, Programacion, SoftwareLibre
Sunday, May 04, 2014
Belated Gnome .NET Hackfest post
- I got my house refurbished in the last months, which has been such a long planning endeavour, and a real stressful PITA while it was being done.
- Before the above started, and after it was finished, I had to move, so that's 2 moves! (I hate moving)
- I've been kind of busy in regards to Gnome-related contributions: we released Banshee 2.6.2, GStreamer-Sharp 0.99.0, Banshee 2.9.1, and a big etcetera (including pre-mentoring for GSoC! more about that in a subsequent post).
- Hylke Bons, sparkleshare creator, Red Hat designer.
- Mirco Bauer, smuxi creator and debian developer (mono packager).
- Jo Shields, debian developer (mono packager), Collabora sysadmin.
- Robert Nordan, Pinta contributor.
- Jared Jennings, Tomboy contributor.
- Stephen Shaw, ex-Novell coworker (build developer), and currently at Xamarin. (Yes, I was Stephen's team-mate when at Novell, but had never met him in person!)
- Stefan Hammer, Tomboy contributor and hackfest local-host.
- Timo Dörr, Tomboy and Banshee contributor, GSoC student.
- Stephan Sundermann, GSoC student for GStreamerSharp and Bindinator.
(BTW I didn't include the awesome Bertrand Lorentz, fellow Banshee co-maintainer and GtkSharp gatekeeper, in the list, because I had already met him before, it wasn't my first time!).
And it was with the latter Stephan (not Stefan) the one I ended up spending more time with, because we decided to work on the new GStreamerSharp bindings since the 2nd day of the hackfest (the 1st day I mainly worked with Bertrand to release Banshee 2.9.0, our first Gtk3 compatible release, which he already blogged about).
So what was special about this work?
- GStreamerSharp 0.10.x releases were not compatible with GStreamer 1.x releases, so this had to be fixed soon. However, much of the architecture of this old version of the bindings used many manually crafted binding code.
- Stephan, by using the new Bindinator (a GObjectIntrospection metadata parser that outputs GAPI metadata, that allows generating .NET bindings, created by Andreia Gaita) in his GSoC, created a better foundation for the new bindings.
- He targetted GI metadata from GStreamer 1.0 and 1.2 versions (the jump from 0.10 to 1.0 was a big and not easy leap, since lots of APIs were modified and deprecated).
- We needed to polish them enough to make Banshee be able to consume them without glitches.
Main kudos should go to him though. I mainly added Banshee expertise, gtk-sharp contributing expertise, and lots of motivation (or at least I thought).
We had a big success: a Banshee playing audio with GStreamerSharp. Unfortunately video playback was freezing. But some months later after the hackfest we fixed it, and we released first GStreamerSharp 1.0 preview, which we called "0.99.0", and we released the first Banshee release that depends on this work: 2.9.1.
And it was my first time in Austria (and in Vienna). Overall a great experience, and I need to mention our awesome sponsors:

Labels: General, Gnome, Mono, Programacion, SoftwareLibre
Friday, June 14, 2013
Modernizing blam's autotools (or shaving the yak to move out from GoogleReader...)
Yes, I've been victim of Google's cuts too... And I was wondering, where should I move? Feedly? ThingyBob? Well, I shouldn't make the same mistake twice, right?
Actually, some time ago I was using a desktop app to avoid relying on software that I cannot control (yes, vendor lock-in, the most important thing that open source tries to solve, right?): Thunderbird. But somehow the convenience of a web app (that I can access from any computer) and the hassle of using my mail client for RSS reading made me move to the web.
I should be able to find a replacement that no company or individual can "take down", and which feels less clunky than Thunderbird for reading RSS. So, enter blam (in the future I'll figure out how to sync its state between computers, maybe using SparkleShare?, to achieve that same convenience that a web-app provides), that Gnome app that has strangely managed to not catch my eye until now...
Well, maybe because if I install it from debian sid and I try to import my very first RSS feed from my GoogleReader list it doesn't work? Well, apparently it is a bug that is already fixed upstream, thanks to Carlos which has modernized the way that the program deals with XML and serialization.
Then I went ahead and tried to compile master myself... and guess what, the autogen.sh execution fails. Here the yak shaving begins, when I feel like this when trying to fix the autotools stuff:
Fortunately, after some tinkering (and some copy&paste from banshee's build scripts), I managed to fix the problem, and also modernized a bit some things (like using the brand new ".ac" extension instead of ".in" for the configure script, or using properly the AC_INIT and AM_AUTOMAKE_INIT macros,...).
Anyway, the real thing to highlight here is that while I was fixing this stuff and pushing to the repository...
... I saw some really good stuff committed by Carlos: using the new .NET 4.5 C# async patterns to get rid of those ugly callbacks! Kudos to him.
And if you're willing to help more with our autotools housekeeping, please do, I still feel this autogen.sh is way too long and needs some ironing.
* And if you're wondering what's up with GSoC (aka Google Summer of Code):
- I had Nicholas Little lined up to work on Rygel+Banshee integration, but sadly he couldn't apply due to work commitments (hopefully he will still work with me on it in his spare time).
- I had Rashid Khan lined up to work on Cydin+Banshee integration, but sadly there were not enough GSoC spots for him :( (fortuntately he told me he still wanted to work on it with me in his spare time).
- I had Tomasz Maczyński lined up to work on Banshee integration with more REST APIs, and fortunately he was selected! So expect some nice FanArt.TV and SongKick plugins soon!
Labels: CSharp, General, Gnome, Mono, SoftwareLibre
Tuesday, May 01, 2012
Apple and LastFM can still receive open source love
But contradicting what you may think, open source is still friendly to them.
If you have an Apple device supported by libgpod* and you're an avid user of LastFM's scrobbling feature, you can today configure Banshee to send all the songs that were played on your device to your LastFM account the next time you connect your device while you have Banshee running.
Pretty handy, especially if you own a device that doesn't have internet connection these days (something definitely not on the rise). You should thank our new Banshee developer Phil Trimble for doing an awesome job on implementing this feature (and on resisting to not sending me to hell when I made the patch reviews...).
The next version of Banshee, in the 2.5.x series, should include this feature. Until then, hold on to your seats! (or compile it yourself from master ;) )
* Beware: not the last generation ones! you would have to donate to libgpod project if you want those recognised.
PS: If you're a developer and want to extend this feature to other kind of devices, you should just implement the interface IBatchScrobblerSource in the corresponding Source class of your device. If you want to make it scrobble to a different service than LastFM, just create a Banshee addin (simple sample here) that subscribes to the ServiceManager.SourceManager.SourceAdded event to then later subscribe to the IBatchScrobbleSource.ReadyToScrobble event from it, to later make the corresponding HttpWebRequests to the scrobbling service.
Labels: CSharp, General, Gnome, Mono, Programacion, SoftwareLibre
Sunday, May 08, 2011
#gtk#
I had never seen this channel with people in it at all in the past. I guess the recent interest comes from the fact that gtk-sharp master is already targeting Gtk+ 3.x API and some people are starting to use it to port things.
One example is Hyena, the awesome library that Gnome projects F-Spot, Banshee and PdfMod use (am I missing some other?). I started the port some weeks ago and all I have received is positive feedback, encouragement, and also a lot of help! For example Olivier Dufour (which I guess he will be recently known as one of the superstars that brought DVD support to Banshee -- work finished but still unmerged) who helped with accessibility and warnings, and Mike Kestner (father/maintainer of all these GAPI-based *-sharp bindings) which helped reviewing my patches to the binding and fixing other issues I reported (and of course for making huge efforts, in the first place, to have the bindings ready for the 3.x cycle, with even some GObject-Introspection experimentation, which I guess is still in the early stages and not enabled yet).
Stay tuned for the progress! (as new contributors have expressed interest in helping out soon). Branches are being created so you can join the effort if you feel like (bugs in bugzilla too, to track what's pending).
Labels: CSharp, General, Gnome, Mono, Programacion, SoftwareLibre
Monday, April 11, 2011
Calling hackers who care about Android+Banshee
Unfortunately my Android phone broke completely (don't ask me the details...) so I cannot work on the patch anymore. Anyone wants to continue the work?
If yes, go ahead and ask me anything you want, I'm usually in irc://irc.gnome.org/banshee with the "knocte" nickname, or you could also ask the question on the channel if I'm not there, there are usually awesome contributors there that will try to help. If you haven't ever coded for banshee, check the Contributing page first.
BTW, kudos to all the people involved in the Banshee v.2.0 release!
Labels: CSharp, General, Mono, Programacion, SoftwareLibre
Sunday, April 10, 2011
WTF reduction
What it basically does is a bit of what I call WTF reduction: you will no longer get a confusing message like "For property 'Foo' expected 'Bar' of type 'Bar' but got 'Bar' of type 'Bar'" when unit testing your entities' properties.
AFAIK the next release will include this, and will be the first one to link to the new version of NHibernate, 3.0, which I've found that works very well.
Labels: CSharp, General, Mono, Programacion, SoftwareLibre
Sunday, March 27, 2011
RT: MEF vs MonoAddins
> Can you give a short summary on why you replaced MEF with Mono.Addins?
Basically it came down to maturity. Mono.Addins seems far more stable and mature than MEF. The MEF documentation was lacking, inconsistent and out of date in a lot of places. But all that could be worked around, and for the first few internal versions of our app, MEF was servicing us just fine.
Then our addins became a bit more complex. We needed to package them up with multiple files, ideally distribute them as an archive, host them online in a plugin exchange, allow them to be discovered and installed easily. Essentially this page covers features in Mono.Addins that made us switch rather than implementing a lot of the same things using MEF ourselves:
http://monoaddins.codeplex.com/wikipage?title=Creating%20and%20Managing%20Add-in%20Packages&referringTitle=Programming%20Guide
At the time as well MEF had issues on Mono on linux. This might have been a problem with how we were using it, but it just turned out easier to plonk Mono.Addins in instead. Was an easy migration and has a lot more power and features straight out of the box (and it worked on Linux).
Your millage may vary, and your needs are probably different. MEF might be an awesome tool for your requirements. It is a little simpler to get up and running and requires less engineering to support it (which was one of the reasons we used it first off).
Hope that helps,
Michael
Labels: CSharp, General, Mono, Programacion, SoftwareLibre
Wednesday, September 08, 2010
Version Tolerant Serialization with Mono
(Zoot Woman - Lonely By Your Syde)
During the last months I've kept working {with|on} Mono, but not working for Novell anymore.
Today I'm proud to blog about a bit of work I've done on Mono towards a better Binary Serialization experience:
- mono-api-info command now can output ABI instead of API if you append the flag --abi. It has been useful for us in LindenLab while working on binary serialization compatibility between versions (already upstream!, so will be available in Mono v2.8, even with a new man page).
If you ever wondered why your .NET code is no longer capable of deserializing some old binary object you had in your servers, instead of fixing the problem in a case-by-case basis, you can now see the whole picture by just diffing the output of mono-api-info --abi from your current and old codebase! A small TODO that I haven't completed yet is to deal with automatic properties (because we still don't use them) so that would be an exercise for the reader! - Fix for upstream Mono to act as .NET in regards to Version Tolerant Serialization, a patch to which I have just added a lot more unit tests (soon to be pushed hopefully).
You can see the patch of this quite old mono bug here. Disclaimer: to be honest you will only need the previous --abi tool if you use a Mono version prior this fix, because from my testing VTS in MS.NET works as if every new field had an [OptionalField] attached! (At least the BinaryFormatter, the TODO here for the reader is to test the SoapFormatter ;) )
On a totally unrelated note: kudos to the MonoDevelop team for making such a great releases lately (and fixing the bugs I report so promptly). I've been testing it the last months on Windows and I can say it's a great experience to see your favorite IDE working cross-platform and making you not depend on VS anymore if you need to work on Windows from time to time (I know the Express versions are free, and are great! but they do not support plugins :( ). BTW, I've been lately experimenting with the C language support in this IDE, and have had some problems, but the real culprit seems to lay behind some wierd behaviour of my gdb in opensuse. Taking advantage that I'm in opensuse planet, can I do a couple of lazyweb requests?:
a) If you're quite familiar with gdb, can you take a look at these 2 bugs in case it rings any bell for you? BNC#588175, BNC#459274
b) Can you try to reproduce those bugs in openSUSE 11.3? (I haven't migrated yet from 11.2 because I fear about the HALlessness of it :) )
PS: Wondered why the video on the top? Well, I like the trend that some people have about posting random photos in their blog posts even when they may be completely unrelated, but in my case I love music so I figured this would suit better. Of course I would rather embed a WebM video or, even better, something that can preview a song (without video) in a "normally-lower-quality-than-what-you-can-buy" way, so if you have any hints, those are welcome! I especially mention the latter in this case because the Album version of the song above is much much better (synth pop FTW!).
UPDATE 28-AUG-2012: Found a video-less alternative to youtube for embedding songs! It is GoEar.
Labels: CSharp, General, Ingenieria, Mono, Programacion, SoftwareLibre
Tuesday, July 06, 2010
Mono? What?
.NET Culture Shock: Why .NET Adoption Lags Among Startups
Especially sad to find that Mono is not mentioned in the article.
Especially super sad to find that Mono is mentioned in the comments, but in a negative way.
Hey Mono community, help me reply all this nonsense.
Labels: CSharp, General, Ingenieria, Mono, Programacion, SoftwareLibre, WebDev
Monday, June 01, 2009
It's all about synchronization
Who could have imagined at that time, that 3 years later I would not only be working for Novell, but also be able to contribute to it at normal work hours! Yes, this is ITO, and our team spent a week hacking on other projects. In my case, I worked with the awesome guys Stephen Shaw and Mario Carrión. We managed to create an iFolder appliance for the server based on openSUSE 11.1, very easy to install thanks to SUSE Studio and to a new OBS repository where we packaged a preview of Mono 2.4.2 and some fixes needed to make it work.
We even created some demos! (Sorry for the quality of the sound, we had some problems when recording them)
The first one: setting up the appliance.
The second one: creating a user and using the Linux iFolder client.
Now, the next two videos are intended to show the second part of our work on that innovation week: new features.
The third one: automatic/immediate local detection of changes, server side trash can.
The fourth one: automatic/immediate remote synchronization of changes.
How cool is that? Unfortunately, the patches still need work and cleanup (help welcome!), but I plan to do it soon and/or on next hack week.
Before coming back to hacking on iFolder, I wanted to finish some stuff am working on for Banshee, which is also about synchronization! Look at this bug for more details. Yes! bidirectional Rating synchronization, not only from Banshee to the iPod but from the iPod to Banshee. The patch is working fine for me, be sure to give it a go and provide some feedback. Thanks!
Another thing I have on my TODO list is integrate some old mono-based GPL ed2k library into monsoon, now that it's getting MonoAddins support! (Lately there's been many people asking me for the source code.) And now that I talk about monotorrent, how cool would be to make iFolder work with this awesome library??
PS: Hello PlanetSUSE! First post. Hola Planeta GnomeHispano ;)
UPDATE Jun-08-2009: It seems someone wants to resurrect the lphant kernel as well, but using WPF! (WTF?): http://sourceforge.net/projects/hathi/.
Labels: CSharp, General, Mono, Programacion, SoftwareLibre
Monday, March 30, 2009
I14Y happens
Some months later I came to know the new term 'a11y', and I started to see it in a lot of places. By that time, I only associated it with the web development world. Terms like "Unobstrusive JavaScript" were very related to it (and I even created an "AJAXy" library called AMUSE for this purpose).
Now let's talk about the next one: I14Y. This concept is present when things like this happen: "I can open an (Microsoft's)OpenXML file with some (Novell's) edition of (Sun's)OpenOffice". Or even more weird things: "I can manage my (Apple's)IPod thanks to a (Microsoft's).NET-powered application called (Novell's)Banshee". Or even more awesome ones: "I can use (Sun?'s)Orca screen reader to control my (Microsoft's)Windows.Forms-powered applications in my (Novell's)SUSE Linux Box!".
So, yeah, we made it! Along with the awesome releases of Mono 2.4 and MonoDevelop 2.0.
Now, guess what's the word?
Labels: CSharp, General, Ingenieria, Mono, Mozilla, Programacion, SoftwareLibre, WebDev
Wednesday, February 04, 2009
My first .NET runtime wishlist item
public class TestStaticInits
{
public static readonly X var = new X ("Hello" + world);
private static string world = " World";
}
public class X
{
public X (string s)
{
Console.WriteLine (s);
}
public override string ToString () { return "Bye"; }
}
public class WishList
{
public static int Main(string[] args)
{
Console.WriteLine (TestStaticInits.var.ToString ());
return 0;
}
}
Shouldn't this print Hello World instead of just Hello? Basic initializations should have more priority than those involving constructors :)
At least it works if you replace the second static with const... But this confused me a bit for a while. So definitely something the compiler could warn about (ok, Gendarme is another candidate too).
UPDATE: And anyway, if we accept that our runtime is not so clever, it should give a NRE instead of printing Hello, right? You cannot concatenate a string with null. So is this a .NET bug?
UPDATE: Doh! I could have sworn that I got a lot of NRE's in the past when coding this
Console.WriteLine ("Hey" + null); (I mean, when using a var and not protecting against null). Thanks for all the comments.Labels: CSharp, General, Mono, Programacion
Sunday, September 07, 2008
Hackweeks
I was not so lucky as most of my teammates, who spent the week on the wonderful offices (as they say) of Novell Utah. Maybe if I was in the states already... but well, I had recently an interview in the US Embassy which was the last step of my visa process, so I hope that at least I can make it for the Gnome Boston Summit!
So, firstly I thought of dedicating my week to this task that I submitted to the ideas website, but in the end realized it would be a ton of work to complete without help, and nobody joined me so I decided to learn to use OpenSuseBuildService in order to package Bugzilla, a pretty complex server side software.
Fortunately, I've learnt a lot this week, especially thanks to all the people in irc://irc.freenode.net/#openSUSE-buildservice (above all, darix) and some people from my team (Ray Wang and Stephen Shaw). I could also contact the author of the RPM file for Fedora (who was formerly working for Red Hat), and he's willing to help on joining efforts, as OBS is cross-distribution.
Unfortunately, packaging is a complex task and I didn't finish the package. The documentation is a bit incomplete and having past experience in packaging is a plus that I didn't have. It's awesome that inside our UIA Team we have exclusive resources dedicate to this, because it would be impossible to do from just the developer side.
One of the difficulties I found is finding packages I needed. I could find some of them (BTW, using Webpin is cool for searching on SUSE software repositories, including Packman; except for the fact that doesn't enhance one-click-install) but not all so then I'll have to help on providing packages for some CPAN Perl modules, contributing to the devel:languages:perl official repo.
On the way of learning OBS, I also filed bugs and feature requests (not only to OBS, but also to Banshee! as I have been using it a lot lately at the same time I hack and I even cooked some small patches):
OBS:
Usability issues in project creation page
Link to "My projects" fails if no home:login project has been created yet
New option for uploading the tarball
ChangeLogs parsing is too strict: lines beginning with tab are not recognized, only one date format is accepted
OBS should not allow to create a package named "packageand"
The spec parser should detect the use of a miscplaced packageand(_:_) keyword
Banshee:
No such file or directory errors while importing
Cannot empty some ID3 tag fields
Importing songs without album metadata breaks artist navigation on the iPod
Banshee inserts deduced fictional text on metadata
Should try to locate correct album (and download its cover) in case no album is supplied on metadata
The patches are quite simple so I hope they get committed soon! Clearly Banshee devs and contributors are doing an amazing work, I'm specially amazed by the Moonlight effects, the Muinshee front-end and the effort that it seems is being dedicated to bring Library Sync & Refresh for 1.4. I wish them all the best success.
So let's get back to packaging. Firstly I thought I had found some limitations in OBS or rpm systems because the lack of proper "dual dependency" support. In the past when I installed Bugzilla manually (and updated it to newer versions) I found it a bit hard to do it, specially to deal with DB creation and upgrade. I wanted to make this process easier for the potential rpm user, but without limiting the choice of the DB engine used (as now Bugzilla supports MySQL, PostgreSQL, and Oracle, although the latter was not on my scope). It turns out that it's really hard to apply virtual-provides rules for these cases, as we should stablish more sub-dependencies depending on the db engine you choose, such as perl-DBD-mysql or perl-DBD-Pg, and because it would cause inconsistent situations in case someone in the future replaces his DB-engine with the alternative one (as in theory it should work at the dependencies-level without warning). For references, you may be interested in reading the whole thread about it in the BuildService mailing-list, whose last message includes a possible hack to workaround these problems using patterns (although I don't like to use patterns for solving something like this).
Even discarding the dream about solving this at a package level, it's difficult to solve it at an app level that wouldn't involve reading manuals. My idea was to modify Bugzilla upstream in order to avoid running manually a local script for its initialization, and replace it with a nice web front-end (even if it's only allowed to be run locally). That would cause problems because normally the webserver user doesn't have enough permissions to create files and the database tables and initial data (I'm sure there's always a solution that also doesn't expose security problems, but it's hard to find it as it's noticed in this thread in bugzilla devel newsgroup; so, help is truly welcome).
Maybe the easier and fastest solution is a mixture of both worlds, that is, having a web front-end that asks you the initial configuration, and the form submission process just writes it in a local XML and tells the admin to open a console and run a script as root to finish the process. But even with this solution I guess we should need something to detect at runtime (which should be cross distribution) if some package is installed (which also checks the version). I guess there's already some of that capabilities used in the bugzilla's script checksetup.pl, so I would reuse them. However, in case it finds a problem, there's no way for the application to request installation of a package directly to your OS (but I've attended to a PackageKit conference in last Guadec in which I heard something about this possibility in the future!).
Labels: CSharp, General, Mono, Mozilla, Programacion, Seguridad, SoftwareLibre, WebDev
Tuesday, July 08, 2008
Subversion 1.5.0 highlights and some MD hacking
- A common problem in older versions of Subversion was the way in which svn update handled incoming copies and moves.
Consider this scenario: Harry runs svn move foo bar; svn commit, and meanwhile Sally makes local changes to 'foo', and then runs svn update. In earlier versions of Subversion, the server would send down a completely new file 'bar', and unversion the file 'foo' (if it had no uncommitted changes, Subversion would remove it entirely.) From Sally's point of view, her changes seem to be lost; the newly added 'bar' file has the older content, and the file 'foo' has been taken out of version control.
In Subversion 1.5, the client and server both attempt to be smarter about this. The server doesn't send a whole new file during the update, but rather instructions to copy something that likely already exists in the working copy. So Sally's 'foo' file is copied to 'bar' (with local edits intact!). - Merge tracking means Subversion keeps track of what changes have been merged where. This reduces the overhead involved in maintaining branches, and gives users a way to inquire what changes are merged — or are available to be merged — on different lines of development.
Example (one of the improvements in place): Merging changes from (say) trunk to a branch no longer requires that you specify the revision range. Instead, each time you want to sync up with trunk, you can just do:
$ cd BRANCH_WORKING_COPY
$ svn merge URL_TO_TRUNK
Subversion will figure out what changes from URL_TO_TRUNK have not yet been merged and pull in just those changes. When it's time to merge the branch back to trunk, do this:
$ cd TRUNK_WORKING_COPY
$ svn merge --reintegrate URL_TO_BRANCH - Sparse checkouts (via new --depth option): Many users have very large trees of which they only want to checkout certain parts. In previous versions of Subversion, checkout -N was not really up to this task. Subversion 1.5 introduces the --depth option to the checkout, and other subcommands.
- Conflict resolution is now done interactively by the command-line client for the update/switch/merge subcommands.
- Relative URLs and @peg revisions for svn:externals.
Don't you think this is AMAZING? This means we almost got full/real MOVE support and that merging is taking the best ideas from DVCS systems (yes, we lack yet local commits).
To get up to speed with DVCS features I would also add pending commits feature although there are concerns and people seem to prefer it to be implemented upstream in bug tracking tools.
Well, I guess you already may have noticed I don't like current DVCS tools (at least the most popular), by a different set of (a little bit subjective, I know) set of reasons:
- Git: it's implemented in an unmanaged language (yeah SVN too, but at least the latter is cross-platform!).
- Bazar & Mercurial: they're implemented in a "too-managed" language (yeah sorry I dislike dynamically typed languages very much, especially for big developments that need to have a long life; yeah, refactorings are a pain with these ones, although I don't know the test coverage they may have...).
Maybe Git# (Mono SoC2008) is the answer? (I don't know the progress of this project.)
I was discussing about this yesterday with JP, and when I talked to him about this SVN 1.5.0 he said "too late!". Ermmm, what?, Gnome hasn't switched to DVCS yet so, why too late? Maybe because it's imminent? I don't know. Sincerely, there is much contradiction about how people approach migrations... Today I've been attending for almost an hour a meeting about Gnome Mobile, and one thing that was arised is the lack of flexibility and ease of use of the Gtk+ toolkit, as opposed to other toolkits. People were concerned about it and wanted to fix it, and nobody wanted to give up pushing Gtk+ just because it's old. Then, why doing this for Subversion? Subversion is very mature, and their devs have demonstrated to be worried about its lack of flexibility wrt the new distributed ways of work, so they are fixing it, they are *supporting* us. And however at Guadec here it seems everybody wants to push for the migration (but only taking care of doing the correct decision, i.e., select the 1 from the 3 we all know, but why not considering just to update to new SVN and wait a bit more to see where we go?
Well, now that I'm talking about Subversion, I'm going to talk you about a couple of features I worked on recently (and committed today), as my first ITO day, in the Subversion Addin of MonoDevelop: revert to revision, and revert changes from a revision. The mandatory screenshot (you get to this dialog when requesting the Log inside the Version Control contextual menu):

This reduces the need of having a console open when coding with the MonoDevelop IDE, which is a thing that many developers request.
Another feature I completed is the new pattern for searching in many files inside MonoDevelop: Current project (previously we only had "Whole solution", "Directories" and "Open files"):

Enjoy them! (Currently on SVN.)
Labels: CSharp, General, Mono, Programacion, SoftwareLibre








