Friday, March 18, 2016

The fish is out

nemonewThis is a project I’ve worked for several months now. It was internally called “project Nemo” (I like having internal project names) and it was about speeding up the process of generation.
In one of our regulars Development Team Meetings (DTM) somebody mentioned about an issue where generating Genexus’ Structured Data Types (SDTs) was taking too long, and how she was fighting that issue. That got me thinking that SDTs are “simple” classes definitions, I mean there’s no complex logic on finding related tables, closure, and stuff for what prolog is very good. So we started talking with Gastón about it and we thought it would be a good sample of simple template-based code generation. What does that mean? if you take a look at the generated code of an SDT it starts with a class definition, some initialization methods, property definitions, serialization methods (ToJson) and finally the rest interface with its properties. Every single SDT is generated with the same components.
 
 

So what is Nemo?

Nemo is a new generator for SDTs (for now) that uses StringTemplate technology for code generation. The generation has two parts, a “specificator” and the code generator itself.
The specificator “listens” to internal Genexus events like saving or deleting an object. If this object is an SDT, it specifies it. That specification is a serialization of every property of the SDT needed for later generation. That specification is saved as a json file which is then read by the generator, to generate (of course) the source for that SDT, it could be one or many source code files depending on the levels of an SDT.

WIIFY

So, “what’s in it for me?” you might say. Well, it depends on the size of your KnowledgeBase (KB) and the amount of SDTs in that KB, but we’ve seen generation times cut off by 30%, which we believe is pretty good for a start.

Roadmap

Right now, Nemo is turned on by default in Genexus Salto Beta 2, released last week (March 10th). Right now it’s only generating C#, Java is expected for the Beta 3 release. Also, there are other objects that can be generated by Nemo, like Domains, BusinessObjects (BCs) and that is also under the radar.
So give it a try, download the beta 2 of Genexus Salto and start taking advantage of the improvements.

Read Full Post

Thursday, October 08, 2015

Running twurl on Windows

This post will sound ridiculous to some people, "what's so hard about running twurl on Windows"? Actually nothing, once you know what to do.
Twurl (OAuth-enabled curl for the Twitter API) is a very helpful command line utility used to reach out to the Twitter API. If you're familiar with the twitter API and basically any OAuth API, handling the signing of every request can be painful, at least until you get it right the first time.

I use twurl to see what an actual good request to the API looks like, so after I get the good sample I use fiddler to debug my shelltwit requests and compare the two of them.

So, how do I use twurl? There are many ways, being one of them getting the source files and building the project yourself out of Github.
But probably the easiest way is to use the "compiled binary" (actually, it is not a binary nor compiled).

Twurl can be installed as a Ruby Gem. What does that mean? I have no idea. Well, I do have an idea but a really good way of explaining since I'm not a Ruby wiz.
Cut the crap already!!! okay, okay, I'll assume you're familiar with Chocolately, if you're a Windows "power user" you really need to get to know it.
So, first things first... you need to install the Ruby environment on your machine, so, open your favorite command line shell as Administrator and type

choco install ruby


There, ruby is now installed. Now you need to install twurl and since it's a Ruby gem this is what you you need to do

gem install twurl


And that's it, that will install the twurl gem and now you can use twurl from your command line to, for instance, upload an image to twitter like the following

twurl -H upload.twitter.com -X POST "/1.1/media/upload.json" --file "/path/to/media.jpg" --file-field "media"


Cool uh! Let me know if you found this post useful

Read Full Post

Sunday, March 01, 2015

Building mobile apps for the modern enterprise or consumer

I recently came across an interesting “article” on building mobile apps, actually is more of a Visual Studio brochure. It had some interesting facts that easily explain why you should choose for either building native smart devices apps or go for a common features/language scenario where you get the apps fast in the market.

Interesting enough they even have a chart that shows the choices you have:

IC752185   

Let’s see what this chart tell us. On the far left you have great quality, high costs, great apps. I don’t want to start a fight over colors again, but I see that balloon in a redish/pink background. Then you have Xamarin, where you have a little less quality but gain a little in productivity. Then it goes down to Cordova, where you loose a lot of quality but gain a good chunk of productivity. And the lowest point in productivity comes mobile web, where you obviously gain productivity because you basically write one single HTML app and show it in every platform.

But the funny thing about the chart is that it has an “ideal spot” that reads “Great quality on all devices, agile development”.

Guess who’s in that spot? that’s right… I am, I work with a tool that generates great quality native apps in an agile and productive way. I bet you do too :)

IC752185_gx

What’s my point with this? I’m not trying to sell Genexus, I’m a terrible sales person, my point is that those of us who use Genexus are in the right path. Maybe some day there will be only one platform and it’ll be easier to start device development, but right now, where there are clearly 3 major players, having a tool that can help us with cross-platform development is a must, and of course, we want the best experience in each platform.

On a side note, keep in mind I’m not even talking about model driven development, which for me is must. I had a teacher at the university that more than 10 years ago said to us, “if you start a new project writing public class you’re obviously doing something wrong”.

Those of us who use a tool for cross-platform agile development have clearly and advantage over the rest, either by app quality or time to market, and when I say time to market I mean time to the 3 major markets. So start your great ideas today.
(great ideas not included)

Source to the original article and chart: http://www.visualstudio.com/explore/modern-mobile-apps-vs

Read Full Post

Thursday, February 19, 2015

Where’s Create GUID in VS2013?

Is not there, is not where it used to be, but thankfully it’s easy to put it back where it belongs.

Just go to TOOLS –> External Tools and add it. It is located under the Tools directory of your Visual Studio 2013 installation.

image

Read Full Post

Saturday, November 29, 2014

Deploy to Azure button, WOW!

Deploy to Azure Button

Every now and then some technology, technique, product or whatever comes along that makes you open your eyes wide open and drop your jaw.

A few days ago Microsoft released the Deploy to Azure button, you can read the original post here, but TL;DR it’s a button you put in the README.md file of your GitHub repository and it would “automagically” deploy your repository to an Azure Web Site.

At first I thought, cool, but I’m sure there’s something they’re not telling you, like what’s the structure I need to have in my repository? do I also need to add my binaries, will they build my solution and deploy the assemblies?

So today I gave it a try. I do have a repository on GitHub which output also run on an Azure WebSite so I thought this would be the perfect test. The project is Azure Storage Explorer, and if you take a look the structure of the repository looks it is just a solution file (.sln) with two folders that are a web site project and a helper library.

github

So I added the button to my README.md file which in my case that meant adding this line to the file:

[![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/?repository=https://github.com/sebagomez/azurestorageexplorer)

And that’s it. After I pushed it to GitHub I clicked on the button and this site called azuredeploy.net showed up telling me that my repository was going to published to an Azure Web Site. It let me pick a few config settings like the name of the web site AND THAT WAS IT!

What happened in between? I don’t know, I guess something cloned my repo, found and .sln file and built the solution and then moved everything (?) to a web site? I don’t know what they did, I’m just glad it worked the way it did. I’m not saying it is rocket science, it’s just that it’s nice when you find such a simple solution for a much complicated task to do manually.

Kudos to whoever thought having that button was a good idea!

p.s: I wish we had something like that in Genexus Server. I guess we could…

Read Full Post