tag:blogger.com,1999:blog-76916942024-03-07T15:32:48.803-03:00sebastian gomezI'm a Software Engineer at Genexus R+D team.Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.comBlogger141125tag:blogger.com,1999:blog-7691694.post-20306858656652160412016-03-18T11:52:00.001-03:002016-03-18T11:55:11.297-03:00The fish is out<div style="text-align: left"><a style="margin-bottom: 1em; float: left; clear: left; margin-right: 1em" href="https://lh3.googleusercontent.com/-RghKdOZnIug/VuwVFdfkynI/AAAAAAAALiY/4Q9NSbn_TCE/s1600-h/nemonew%25255B2%25255D.png"><img title="nemonew" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="nemonew" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM0uvOaaCsJKyoOfq8NCqj8UOpso8VwA-VqojGlvZkIEHUELh8YgLG5bIYcm8JjK_sLByMSIm0W7lmGhEI3aFE0Bh1NRyfz7d4Qp8nRw1LQAFvn8KYkPdl9bVSxWijDz8bLmCXZw/?imgmax=800" width="244" height="184" /></a>This 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.</div> <div align="left">In one of our regulars Development Team Meetings (DTM) somebody mentioned about an issue where generating Genexus’ <a href="http://wiki.genexus.com/commwiki/servlet/wiki?10021,Structure+SDT+Object,">Structured Data Types</a> (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.</div> <div align="left"> </div> <div align="left"> </div> <h3 align="left">So what is Nemo?</h3> <div align="left">Nemo is a new generator for SDTs (for now) that uses <a href="http://www.stringtemplate.org/">StringTemplate</a> technology for code generation. The generation has two parts, a “specificator” and the code generator itself.</div> <div align="left">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.</div> <h3 align="left">WIIFY</h3> <div align="left">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.</div> <h3 align="left">Roadmap</h3> <div align="left">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.</div> <div align="left">So give it a try, download the beta 2 of <a href="http://gxtechnical.com/salto">Genexus Salto</a> and start taking advantage of the improvements.</div>Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-58467580382812785232015-10-08T23:30:00.000-03:002015-10-08T23:30:33.641-03:00Running twurl on WindowsThis post will sound ridiculous to some people, "what's so hard about running twurl on Windows"? Actually nothing, once you know what to do.<br />
<a href="https://github.com/twitter/twurl">Twurl</a> (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.<br />
<br />
I use twurl to see what an actual good request to the API looks like, so after I get the good sample I use <a href="http://www.telerik.com/fiddler">fiddler</a> to debug my <a href="http://sgomez.blogspot.com.uy/2010/06/introducing-shelltwit.html">shelltwit</a> requests and compare the two of them.<br />
<br />
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.<br />
But probably the easiest way is to use the "compiled binary" (actually, it is not a binary nor compiled).<br />
<br />
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.<br />
Cut the crap already!!! okay, okay, I'll assume you're familiar with <a href="https://chocolatey.org/">Chocolately</a>, if you're a Windows "power user" you really need to get to know it.<br />
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 <br />
<br />
<h4>
choco install ruby</h4>
<br />
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<br />
<br />
<h4>
gem install twurl</h4>
<br />
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 <br />
<br />
<h4>
twurl -H upload.twitter.com -X POST "/1.1/media/upload.json" --file "/path/to/media.jpg" --file-field "media"</h4>
<br />
Cool uh! Let me know if you found this post usefulSebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com6tag:blogger.com,1999:blog-7691694.post-759277904477059262015-03-01T12:15:00.001-02:002015-03-01T12:16:58.758-02:00Building mobile apps for the modern enterprise or consumer<p>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.</p> <p>Interesting enough they even have a chart that shows the choices you have:</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnZ-m0BAvDt6CU2Wt2HJbPHbF2IgnXlsBRvolq7s59aLB8RWPFltIn7Ri1wlD_rVEM2WeAaSE5GLJAMOHWAPOl-NBwWOaH8pG3v0cKJIi0xWvkCrfMzZOrBBFt0CnXnT2U42H8dw/s1600-h/IC752185%25255B8%25255D.png"><img title="IC752185" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto" border="0" alt="IC752185" src="http://lh6.ggpht.com/-NBZtPC5TF14/VPMfEWTNnMI/AAAAAAAALbw/4XjjyIOW4qc/IC752185_thumb%25255B6%25255D.png?imgmax=800" width="607" height="423" /></a>    </p> <p>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 <a href="http://www.wired.com/2015/02/science-one-agrees-color-dress/">colors</a> 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.</p> <p>But the funny thing about the chart is that it has an “ideal spot” that reads “Great quality on all devices, agile development”.</p> <p>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 :)</p> <p><a href="http://lh4.ggpht.com/-gnzN7fKgRwg/VPMfE1NN6AI/AAAAAAAALb4/knHLG1fDk2s/s1600-h/IC752185_gx%25255B6%25255D.png"><img title="IC752185_gx" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto" border="0" alt="IC752185_gx" src="http://lh6.ggpht.com/-O9pwaCKZrCo/VPMfFf6JKXI/AAAAAAAALcA/uboG2Z736lc/IC752185_gx_thumb%25255B4%25255D.png?imgmax=800" width="621" height="436" /></a></p> <p>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. </p> <blockquote> <p>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 <strong>public class</strong> you’re obviously doing something wrong”. </p> </blockquote> <p>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. <br /><font size="1">(great ideas not included)</font></p> <p>Source to the original article and chart: <a title="http://www.visualstudio.com/explore/modern-mobile-apps-vs" href="http://www.visualstudio.com/explore/modern-mobile-apps-vs">http://www.visualstudio.com/explore/modern-mobile-apps-vs</a></p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com11tag:blogger.com,1999:blog-7691694.post-20032368730782174572015-02-19T11:17:00.001-02:002015-02-19T11:17:41.632-02:00Where’s Create GUID in VS2013?<p>Is not there, is not where it used to be, but thankfully it’s easy to put it back where it belongs.</p> <p>Just go to TOOLS –> External Tools and add it. It is located under the Tools directory of your Visual Studio 2013 installation.</p> <p><a href="http://lh5.ggpht.com/-j2HQ0Xib7bM/VOXicTb-lcI/AAAAAAAALaw/wGPLAs0uL7M/s1600-h/image%25255B2%25255D.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://lh6.ggpht.com/-_6r2N6ZwUH8/VOXic1wdPKI/AAAAAAAALa4/NcrF_HuUmjQ/image_thumb.png?imgmax=800" width="244" height="239" /></a></p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-10782121488364557362014-11-29T01:07:00.001-02:002015-03-15T12:25:38.432-03:00Deploy to Azure button, WOW!<p><a href="http://azure.microsoft.com/blog/2014/11/13/deploy-to-azure-button-for-azure-websites-2"><img title="DeployAzureButton" style="float: left; display: inline" alt="Deploy to Azure Button" src="http://azuredeploy.net/deploybutton.png" align="left" /></a></p> <p>Every now and then some technology, technique, product or whatever comes along that makes you open your eyes wide open and drop your jaw. </p> <p>A few days ago Microsoft released the Deploy to Azure button, you can read the original post <a href="http://azure.microsoft.com/blog/2014/11/13/deploy-to-azure-button-for-azure-websites-2/">here</a>, but TL;DR it’s a button you put in the README.md file of your <a href="http://github.com/">GitHub</a> repository and it would “automagically” deploy your repository to an Azure Web Site. </p> <p>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?</p> <p>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 <a href="https://github.com/sebagomez/azurestorageexplorer">Azure Storage Explorer</a>, 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. </p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibEGY15VTFbEcROL1pR1vXWaLCp36V59YwnAOEZHIx2aLolaazzoOHb3I72qXLVzfZx-edGHFe2DFNILT7qEHUxf51DNiS34fGVZ3-rybg8EWH05C-Pk4TGaO5CWd-W0ieQyBubg/s1600-h/github%25255B4%25255D.png"><img title="github" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="github" src="http://lh5.ggpht.com/-36KXf2sCO7Y/VHk4fJPPGAI/AAAAAAAALZw/QY23aglRwIs/github_thumb%25255B2%25255D.png?imgmax=800" width="699" height="473" /></a></p> <p>So I added the button to my README.md file which in my case that meant adding this line to the file:</p> <blockquote> <p>[![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/?repository=https://github.com/sebagomez/azurestorageexplorer)</p> </blockquote> <p>And that’s it. After I pushed it to GitHub I clicked on the button and this site called <a href="http://azuredeploy.net/">azuredeploy.net</a> 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!</p> <p>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.</p> <p>Kudos to whoever thought having that button was a good idea!</p> <p>p.s: I wish we had something like that in <a href="http://gxserver.com/">Genexus Server</a>. I guess we could…</p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-45473346957155606492014-11-28T00:40:00.001-02:002014-11-28T10:03:33.974-02:00Ctrl+[, S<a href="http://lh6.ggpht.com/-GDnbv2M8qrk/VHfgof195UI/AAAAAAAALZE/wKAYP83rEaQ/s1600-h/VS%25255B2%25255D.png"><img alt="VS" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHPLYQxOS5GyIJlwCIJlbj4rdAHEi9Glsn-rfAQU8duv9sNurY1i8Nrat05hrwbi3JfNk7gE_fJrpDLlLT8Cy0YIxakWMgk2HBDgbU-ffOe_W3QRXyNzhqyVHkEyr6F3-XXowkMw/?imgmax=800" height="135" style="background-image: none; border-image: none; border: 0px currentColor; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="VS" width="244" /></a>Just a little short reminder about this useful shortcut in Visual Studio I always forget. It syncs the file you’re viewing with the Solution Explorer.<br />
It used to be called “Locate in Solution Explorer” in previous VS versions extensions tools like <a href="http://weblogs.asp.net/gmilano/coolcommands-for-visual-studio-2010-coolx">Gaston’s CoolCommands</a>.<br />
Anyway, let’s see if writing this post helps me either remember the freaking shortcut or at least find it easily in the future.<br />
Full list of (default) Visual Studio 2013 keyboard shortcuts <a href="http://visualstudioshortcuts.com/2013/">here</a>.Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-43604654582450009292014-11-15T17:55:00.004-02:002014-11-15T17:55:48.737-02:00Contributing on Github<span style="font-family: Verdana, sans-serif;">This is one of those things I end up doing now for the third time, and since it is not something I do pretty often, I always forget the steps since I don’t work with git on my day to day job. Also, as </span><a href="http://www.hanselman.com/blog/YourWordsAreWasted.aspx"><span style="font-family: Verdana, sans-serif;">Scott Hanselman</span></a><span style="font-family: Verdana, sans-serif;"> suggested some time ago, you should write a post for future reference, chances are it will also eventually help others.</span><br />
<span style="font-family: Verdana, sans-serif;">So here it is, this is my step by step guide on how to contribute on a Github repository (actually any git repository) you don’t own. When you own it, it’s obviously simpler, we’ll see that part too, but when you don’t own it and don’t have enough privileges to push your changes to your repository, you need to create a pull request. </span><br />
<span style="font-family: Verdana, sans-serif;">Little disclaimer: I’m not a git wiz or anything, I’m just annotating the steps that I found that worked for me for what I wanted to do. If there is a “better” option or you see anything that should be done differently, don’t hesitate to leave a comment.</span><br />
<h3>
<strong><span style="font-family: Verdana, sans-serif;">Fork it</span></strong></h3>
<span style="font-family: Verdana, sans-serif;">So, if you want to pull a request, you have to have a repository to pull from. To do that go to the upper right corner of the repository page and hit the fork button (I assume you already have a github account).</span><br />
<a href="http://lh5.ggpht.com/-oK0FTlu80DU/VGet0QtQC5I/AAAAAAAALXc/OM-kdCwzsts/s1600-h/fork%25255B7%25255D.png"><span style="font-family: Verdana, sans-serif;"><img alt="fork" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT9oJDDXnv7LzDlxhcOgaFyhZi9TQ02iVLhKjo1qLIyrYYlVxDKZ0gmiStbmmYVfExvSGYLtrgfIVC2IEvfsBjjNsYN5D-O7RzHvnJ_8JNwObigHqNq8OpRYYmaBoCQTmXI5B05w/?imgmax=800" height="133" style="background-image: none; border: 0px currentColor; display: block; float: none; margin-left: auto; margin-right: auto; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="fork" width="400" /></span></a><br />
<h3>
<strong><span style="font-family: Verdana, sans-serif;">Clone it</span></strong></h3>
<span style="font-family: Verdana, sans-serif;">Ok, you have your “own copy” of the repository, but where? yeap, up in the sky. You now want to bring the sources to your hard drive. To do that you need to clone the repository. In order to clone it you need first to know the clone address, you’ll find that address again in your repository fork page under <em>HTTPS clone url</em> (clever, uh?)</span><br />
<span style="font-family: Verdana, sans-serif;">So, open a command line, yes a command line, the command line is your friend, go to the directory where you want the source code to go and type:</span><br />
<span style="font-family: Verdana;"></span><br />
<div align="center">
<span style="font-family: "Courier New", Courier, monospace;">git clone <your clone="" https="" url=""></your></span></div>
<div align="center">
<span style="font-family: Verdana;"></span> </div>
<span style="font-family: Verdana, sans-serif;">After that you’ll see some magic. If it’s the first time you’ll be asked for credentials.</span><br />
<h3>
<strong><span style="font-family: Verdana, sans-serif;">Do some work and commit the changes</span></strong></h3>
<span style="font-family: Verdana, sans-serif;">After the transfer is done, you have your own local copy, of your own repository in your hard drive, now we can start changing what we want.</span><br />
<span style="font-family: Verdana, sans-serif;">Always remember git status, git status is also your friend and it is the one that will tell you what’s going on. If you run git status right after the clone, you’ll get a message saying everything is up to date. But if you do run it after you modified a file, you’d get a message saying there are some changes but it’s not being tracked, which means it will not be committed, so you’ll need to add the files to what’s called as stage.</span><br />
<span style="font-family: Verdana, sans-serif;">To do that type:</span><br />
<div align="center">
<span style="font-family: "Courier New", Courier, monospace;">git add –a</span></div>
<div align="center">
</div>
<span style="font-family: Verdana, sans-serif;">If you run git status now you’ll see everything is ready for commit, so, let’s commit that.</span><br />
<div align="center">
<span style="font-family: "Courier New", Courier, monospace;">git commit –m “your commit comment goes here”</span></div>
<div align="center">
</div>
<h3>
<strong><span style="font-family: Verdana, sans-serif;">Push it</span></strong></h3>
<span style="font-family: Verdana, sans-serif;">Now you need to push the commit to the server, in this case, the forked repository. If you come from non-distributed version control systems and don’t know why is there a <strong>commit</strong> and a <strong>push</strong> I suggest you go read a little bit about git and distributed version control systems. Also, there’s a pretty good hand-on lab tutorial that helped me start with git (</span><a href="http://try.github.com/" title="Try Git"><span style="font-family: Verdana, sans-serif;">Try Git</span></a><span style="font-family: Verdana, sans-serif;">).</span><br />
<br />
<div align="center">
<span style="font-family: "Courier New", Courier, monospace;">git push</span></div>
<div align="center">
</div>
<h3>
<strong><span style="font-family: Verdana, sans-serif;">Pull request</span></strong></h3>
<span style="font-family: Verdana, sans-serif;">Now go to the original repository and create a pull request. You’ll see that you’ll be able to see you own repository commit where you’ll create the pull request.</span><br />
<span style="font-family: Verdana, sans-serif;">And that’s it, you just created a pull request and hopefully it’ll be accepted and merged into the original repository. </span><br />
<h3>
<strong><span style="font-family: Verdana, sans-serif;">Remote add</span></strong></h3>
<span style="font-family: Verdana, sans-serif;">That’s it? well, not exactly. Chances are, you’ll want to keep your copy of the repository up to date so you can continue contributing. In order to do that you need to add another remote repository to your local copy. This remote will be linked to the original repository you forked from.</span><br />
<span style="font-family: Verdana, sans-serif;">So type: </span><br />
<span style="font-family: Verdana;"></span><br />
<div align="center">
<span style="font-family: "Courier New", Courier, monospace;">git remote add <new name=""> <original clone="" https="" repository="" url=""> </original></new></span></div>
<div align="center">
</div>
<h3>
<strong><span style="font-family: Verdana, sans-serif;">Keep your copy up-to-date</span></strong></h3>
<span style="font-family: Verdana, sans-serif;">You need to update your local copy from the original repository, the one that changed, since I’m the only one working on my own fork.</span><br />
<span style="font-family: Verdana;"></span><br />
<div align="center">
<span style="font-family: "Courier New", Courier, monospace;">git pull <original name="" remote=""> master</original></span></div>
<div align="center">
<span style="font-family: Verdana;"></span> </div>
<h3>
<strong><span style="font-family: Verdana, sans-serif;">Again, push</span></strong></h3>
<span style="font-family: Courier New;"><span style="font-family: Verdana;">Keep in mind you just pulled the changes from the original repository, this changes are not in your own forked repository, so you need to push those to your fork.</span></span><br />
<span style="font-family: Verdana;"></span><br />
<div align="center">
<span style="font-family: Courier New;">git push origin master</span></div>
<div align="center">
<span style="font-family: Courier New;"></span> </div>
<div align="center">
<span style="font-family: Courier New;"></span> </div>
<span style="font-family: Verdana, sans-serif;">And that’s pretty much all you have to do. Keep in mind you’ll be iterating thru pulling from the original repository, adding your changes, committing and pushes your changes and creating pull requests to the original repository.</span><br />
<span style="font-family: Verdana, sans-serif;">The following diagram pretends to show you a “big” picture about the procedure.</span><br />
<br />
<a href="http://lh6.ggpht.com/-iorNA8gVlVU/VGet1oWoy4I/AAAAAAAALXs/mo1XRkk3aPc/s1600-h/git%25255B10%25255D.png"><img alt="git" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinA43h07gVbALtuOT3ThAC5yoQKktdbPG4YbJmxldHlbXgonPY-o7n_SDZjUVcdSydhnOCE9yNyE-tavQliEzQNCHjZ7aZDaK1BeR2ntVjgpVQLMCd-9DagP3wJ0qPKGmWRhtflw/?imgmax=800" height="539" style="background-image: none; border: 0px currentColor; display: block; float: none; margin-left: auto; margin-right: auto; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="git" width="687" /></a><br />
<br />
<span style="font-family: Verdana, sans-serif;">As mentioned before, I’m not a git wiz or anything like it so if anything goes wrong, you’re pretty much on your own. Because as a common statement of this blog, this is 100% “works on my machine” certified.</span><br />
<br />
<a href="http://blog.codinghorror.com/the-works-on-my-machine-certification-program/"><img alt="workonmymachone" src="http://lh3.ggpht.com/-v5Q4yyIfKGo/VGet20RgKAI/AAAAAAAALX4/AYT_91tW2yA/workonmymachone%25255B4%25255D.png?imgmax=800" height="193" style="display: inline;" title="workonmymachone" width="200" /></a>Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-18879156894755737742014-05-30T17:19:00.001-03:002014-06-03T17:26:55.713-03:00Cross-platform is a feature<p>The way of making software has changed a lot since the early days, it has changed more than what the software itself has. Think of an old <a href="http://en.wikipedia.org/wiki/Green-screen_display">green-screen</a> program where you had a lot of data entry to do. Now think of a brand new (smooth, <a href="http://en.wikipedia.org/wiki/Single-page_application">spa</a>) web application also for data entry, they might even look the same, but I’m sure the process of building each is totally different.</p> <p><a href="https://twitter.com/njodal">Nicolás Jodal</a> mentioned in a recent keynote that the way of creating software is much more complicated than what it used to be. I couldn’t agree more, and I’ll try to explain here why.</p> <p>Back in the old days when you were asked for a piece of software, you had (almost every time) the chance to choose the programming language and tools of your choice. Were you good at <a href="http://en.wikipedia.org/wiki/PHP">php</a>, or <a href="http://en.wikipedia.org/wiki/Active_Server_Pages">asp</a>? you could work in whatever you wanted and then tell your customer what hardware he needed to run the software you would provide. Sometimes of course, the client would tell you he had an old Linux server he wanted to use for that piece of software. Then, you would go to your office (bed room?) and hack for days in order to get to the promised schedule with something good enough to show your client. Once you had the program “done” you would deliver it to the client. There were some features he wanted but never told you about. He wanted the software to run smooth, with no delays (I remember 3secs per page load being the affordable top) and of course, secure. He didn’t want it to be hacked.</p> <p>Now everything is a little more complex than that.</p> <p>When you are asked for a program, it’ll will most likely be for a phone and/or tablet. That’s where the trends are. You could be asked for an app or a whole solution with back-end integration with existing software. Plus, you’ll most likely be asked to provide services to talk to other programs, and also consume from other programs. One thing is clear: you will have to provide many platforms.</p> <p>Being good (expert) in <a href="http://en.wikipedia.org/wiki/Java_(programming_language)">Java</a> and provide one single “flavor” of the app for <a href="http://en.wikipedia.org/wiki/Android_(operating_system)">Android</a> is not good enough. You will have to learn <a href="http://en.wikipedia.org/wiki/Objective-C">Objective-C</a> for <a href="http://en.wikipedia.org/wiki/Ios">iOS</a> and <a href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)">C#</a> (or <a href="http://en.wikipedia.org/wiki/Javascript">Javascript</a>) for <a href="http://en.wikipedia.org/wiki/Windows_phone">Windows Phone</a>. And that’s just as of today, we have no idea what will come next.</p> <p>So a lot of people realized that, it is not something new, and are trying to provide some layer of abstraction so you don’t have to actually learn everything that comes out. </p> <p><a href="http://en.wikipedia.org/wiki/Xamarin">Xamarin</a> provides you with a single language approach, where just by knowing C#, you can create native apps for every major smart device platform. That is OK, but still, you need to learn how the different programming models work.</p> <p>Let’s say you want to show a small message in you app, you would have to write something like these depending on the platform:</p> <hr /> <p><font face="Courier New">Toast.MakeText (this.Activity, "Please verify your Xamarin account credentials and try again", ToastLength.Long).Show();</font></p> <hr /> <p><font face="Courier New">var alert = new UIAlertView ("Could Not Log In", "Please verify your Xamarin account credentials and try again", null, "OK"); <br />alert.Show (); <br />alert.Clicked += delegate { <br />LoginView.PasswordField.SelectAll (this); <br />LoginView.PasswordField.BecomeFirstResponder (); <br />};</font></p> <hr /> <p>The first line is for Android, while the second snippet is for iOS. Trust me when I say they’re both C#, but as you can see, when developing for Android you need to learn what Toasts and Activities are. While for iOS the code looks totally different and you need to learn about the UIAlertView, program it’s delegate for the callback and so on. </p> <p>As you can see, the language is not the problem here, the problem is that you still need to learn a lot from every platform you are targeting, and this is a simple example of course.</p> <p>Xamarin recently released <a href="http://en.wikipedia.org/wiki/Xamarin#Xamarin.Forms">Xamarin.Forms</a>. This trends to solve this problem by adding another layer with controls and pages that match a specific control in Andoid and iOS.</p> <p>The other problem I see with traditional approaches, and this brand new from Xamarin, is that you need to write your business rules in a Word document (?) and then write the code, and sometimes also comment that code to explain what is supposed to do. That means that you have the same information in 3 different means.</p> <p>Wouldn’t it be great if you could have all that information someplace centralized and versioned, let’s say a model? And run some process for which its output is the program that implements those rules? Wouldn’t it be great if once you have your Android app you could just (after tweaking some properties) run the process again and have your iOS app ready?</p> <p>Wouldn’t that be awesome?</p> <p>You cannot afford to learn everything if you really need to, I’m not saying it would be fun, but if you really need to do real world stuff that just does not scale up. What if a new platform shows up? Would your customer wait for you to learn the new thing (say <a href="http://en.wikipedia.org/wiki/Swift_(programming_language)">Swift</a>)?</p> <p>It just does not scale up.</p> <p>I mentioned before about <a href="http://findmyplane.azurewebsites.net/Home.aspx">Find my Plane</a>, the flight tracker app I built which is now for Android, iOS and Windows 8. I could have never done that app for every platform in the time it actually took me. And now I’m able to prototype and deploy new versions easily, why? because I work on a model where I declare what I want to happen next and then I run this process to generate the many versions of my app.</p> <p><a href="http://lh6.ggpht.com/-jwItZVH5nVs/U4jn5F85zSI/AAAAAAAALTM/cKRMHmjPd5w/s1600-h/image%25255B7%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="image" src="http://lh6.ggpht.com/--7E2SNufyXk/U4jn6Z30aQI/AAAAAAAALTU/saPKl2EuIFk/image_thumb%25255B3%25255D.png?imgmax=800" width="635" height="364" /></a> </p> <p>That’s why I believe Genexus is on the right track. I’m not saying it is done or solves every developer problem, but it sure helped me and thousands of developers around the world to take their apps out there. On time.</p> <p>NOTE: The code shown above was taken from the actual app from Xamarin Store. You can download the app here: <a title="http://xamarin.com/sharp-shirt" href="http://xamarin.com/sharp-shirt">http://xamarin.com/sharp-shirt</a></p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-88428526411763161492014-03-16T12:02:00.001-03:002014-03-22T15:06:52.475-03:009 reasons to use Genexus for cross-platform development<p>I recently came across an article talking about the best 5 reasons to use some particular product for cross-platform development, but when I read the article all I saw was smart devices development. I know we’re using the word platform for many things nowadays, but if you ask me, smart device technology is just one platform. Desktop apps and web apps are two more platforms that need to be added to the mix.</p> <p>So, I thought I would write a post, from my own point of view and list the reasons why anyone considering writing cross-platform apps, should take a look at Genexus. </p> <p><strong><em>Disclaimer</em></strong>: I currently work for Genexus, but prior to joining them, I used their toolset in my previous job. And even though it will be difficult for me to be objective, I’ll try to stick to facts and leave my subjective opinions aside. These are my own thoughts.</p> <p>If you’re not familiar with Genexus, let me give you a little background. Genexus is a 4GL development tool which represents your entities (or classes) in a a structure called Transaction. You define your structures (Transactions) and do not have to worry about the physical representation of the data, because Genexus is smart enough to create a <a href="http://en.wikipedia.org/wiki/3rd_normal_form">3NF</a> normalization of your data in the database engine of your choice.</p> <p>With that <em>knowledge</em>, Genexus will create the necessary programs to access the data, but you always have complete control of the program. You can define rules and access control. It’s everything you’re used to, but easier. </p> <p>With that introduction, here’s my list of reasons why Genexus is THE TOOL to start paying attention to.</p> <h4>1. One Language to rule them all</h4> <p>If you’re a Genexus developer you can skip this one. If not, I know what you’re probably thinking: “do I have to learn another programming language?”. I’ll be honest with you.. yes, you do! But there are two primary benefits of learning the Genexus programming language.</p> <ol> <li>If you know English, you’re 50% closer. The Genexus language is really simple. Of course you have control flow statements, variable assignations, and basic native functions to perform every task you do, as with every other programming language. </li> <li>The Genexus programming language has been around for more than 25 years. It has evolved and improved over time. Can you imagine yourself using one single programming language for more than 25 years? Can you imagine your level of expertise in that language? You don’t have to move on, Genexus does it for you. </li> </ol> <h4></h4> <h4>2. Real cross-platform</h4> <p>As I mentioned earlier, Genexus has been around for over 25 years. We didn’t generate native iOS apps back in 1989, we had COBOL and XBase. Then RPG came along. Then there was FoxPro for Windows, Visual Basic and Visual FoxPro, then Java, C# and Ruby for the web, plus HTML and Javascript, and recently Objective-C, Java (for Android and BlackBerry) and Javascript for WinJS and the new Microsoft stack.</p> <p>So, we know what cross-platform is all about.</p> <h4>3. Native apps</h4> <p>We always thought of Genexus as a platform agnostic tool, so no matter what your target is, your same Genexus programs will execute in every platform. But that does not mean “platform ignorant”. We know where you what to run your programs. And we know what the best practices, or ways to execute programs, depends on the specific target platform. For that reason, we generate native target platform code. Take our Android-generated apps, for instance: you could open the generated sources with Eclipse, or use XCode for our Objective-C iOS generated code. </p> <p>Let me be clear. You don’t have to -- there’s actually no need to do that -- I’m just saying you could if you wanted to.</p> <h4>4. Faster development</h4> <p>Well, of course is faster. But I’m not going to give you some marketing/sales pitch – but I can share my personal experience with you. I created <a href="http://sgomez.blogspot.com/2012/06/find-my-plane.html">Find My Plane</a> for Android, iOS (iPhone) and Windows 8 (Modern UI) in a month using Genexus Smart Device toolset.</p> <p>Do you think you can do better than that? Let me remind you that every app has specific layouts for its platform. I did reuse some of them, but most of them are exclusive for its target platform.</p> <h4></h4> <h4>5. Practically no bugs</h4> <p>Of course we have bugs. But when you generate your code, most of the time you will generate the bug over and over again, so it’s easier to find. You could write an event and, if there’s a bug, it will depend on our event-firing mechanism or on our generated version of your code. What I’m saying is, our event-firing mechanism is the same for every event no matter what the developer wrote, so it’s really well tested (and used).</p> <h4>6. Model based</h4> <p>Since I started talking about architecture, let me tell you that Genexus is <a href="http://en.wikipedia.org/wiki/Model-driven_Software_development">model based</a>, which is a great feature.I won’t take up space to here to explain why that’s a great thing. <a href="https://twitter.com/gmilano">Gaston</a> created a list 8 reasons supporting the superiority of model driven development and you can find it here: <a href="http://www.genexus.com/global/read-news/8-reasons-why-model-driven-development-is-great-by-gaston-milano-chief-technology-officer?en">8 reasons why Model Driven Development is great</a>.</p> <h4>7. Real world scenarios</h4> <h4></h4> <p>We have all seen a cool demo about a new development tool, language, or technology where, with just a few key strokes you get a “Hello World!” kind of example up & running. Genexus is more robust than that. Of course, I could show you the “Hello World!” text on an iPhone in less than 5 minutes, but that’s not what Genexus is all about. Genexus is about real world stuff… from a little <a href="http://findmyplane.azurewebsites.net/">flight tracker app</a>, to a huge world class <a href="http://www.k2b.com/">ERP</a>, and believe me, there are tons of <a href="http://www.genexus.com/success-stories">great examples</a> in between.   </p> <h4>8. Future Proof</h4> <p>There’s no much to say here. We told our RPG/Cobol users we were future proof; we also told that to our VB/Visual FoxPro users -- so now we are telling you we are future proof. But what does that mean? It means that no matter what the big players are going and no matter they are doing, we will take you there. And what if new players show up? We will be there too. In fact, right now we are working on our Windows Phone generator, and adding iBeacon support to our apps.</p> <h4></h4> <h4>9. Free DB reorganizations</h4> <p>This item should get a whole post by itself. If you know Entity Framework, think of Genexus as Entity Framework on steroids. What happens when you need to move an attribute from a table to another or remove a whole table because you managed to merge its data into other tables? Genexus takes care of that. I know it sounds like black magic, but don’t just take my word for it -- give it a try yourself.</p> <p>I didn’t want to write a marketing post, but I know I failed. The thing is I do believe Genexus is a great tool for agile software development. I know what some people is thinking because I’ve been there too: “I like to program my own code”, “I don’t want a generator” (and yet you use a compiler). I thought the same way. It’s a whole new world, and a whole new way of approaching a software development problem. It requires you to get out of your comfort zone, learn something new. But I guaranteed, you will never look back once you create your first app in half the time you would have using traditional tools.</p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com4tag:blogger.com,1999:blog-7691694.post-54554196515051564402013-05-05T15:48:00.001-03:002013-05-05T15:48:41.511-03:00Privacy Statement for Windows Store Applications<p> </p> <p><strong>We are committed to maintaining your confidence and trust, and recognize your right to keep your personal information private. We maintain the following privacy policy to protect personal information you provide:</strong></p> <p><strong>Basic Privacy Policy</strong> <br />The application does not store any personal information at any time. If you share personal information, such as your username, Live ID, IP or email address, we will keep this information private and confidential. We will use this information only to save the application settings and progress across multiple platforms or installations. <br /><strong>Information collected during the use of the application</strong> <br />All remotely stored information will only be used for the purpose of determining the most popular features, and to determine what to develop later. <br /><strong>We do Not share information with third parties</strong> <br />Personal information and usage statistics of the application will not be given to third parties, except as necessary to fulfill the purpose for which you provide your information, or legally required, as in the case of an investigation of an offense criminal serving a search warrant.</p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com1tag:blogger.com,1999:blog-7691694.post-56261836765540345622013-02-07T12:47:00.001-02:002013-02-07T12:47:59.774-02:00My very own Microsoft Surface RT experience<p>I’ve been trying to write this post for a long time now, but I’m glad I didn’t do it right after a month or so of use. I’m glad I waited all this time because there a few things that now look a lot different. Although there are some things that I have not change my mind of, some of them good, some of them bad.</p> <p>I started using the Surface a little skeptical, I was looking for apps that would make me use the device. It was not easy at the beginning. Just a few apps in the Windows Store and some of them you could tell just from the icon that were pieces of crap. And that was Microsoft’s fault, they let people upload apps with the default icon Visual Studio would add to your test app (a black cross). They did change that and the store started to look better.</p> <p>When talking about the Surface I guess you need to separate 3 different aspects of it. Its hardware, its Metro side (yeah I said Metro, deal with it), and the Desktop side.</p> <p>Hardware: Great! I love the hardware, I love the resolution and the fact that the screen is 16:9. It’s great when reading plain text to use it portrait. It is super responsive, the first time you grab a Surface you want to swing around the start screen (I guess that’s all you can do) and it is very responsive or as Microsoft says it, fast and fluid.</p> <p>The gestures are not that intuitive, you have to learn them, but once you do they feel pretty natural. </p> <p>The Metro side. It’s ok. I like the fact that every app looks the same, so you know where to go look for stuff. Whenever I come across an app that does not follows Microsoft UI guidelines (*) it takes me a while (30 secs?) to understand how to use it. I also like the Semantic Zoom and the ability to have a big picture view of my apps. </p> <p>The Desktop side. What a piece of crap!. Why is it even there? I don’t want it!, but unfortunately I need it :(</p> <p>The first time I got and email with an attachment in my Surface it was a log file (plain text), so how do I open those? with good old notepad, which runs of course as a desktop app. Calculator? desktop app. I have found Metro style replacement apps for these.</p> <p>Why is the desktop side there? because of Office. Is it easy to use? hell no! Why do you think Microsoft’s previous tablets (with XP) never took off? Precisely because they had the same XP you would found on a desktop PC. Why didn’t Windows CE for phones wasn’t that big of a deal… because you had to be a friking genius with that little stylus in order to move around the OS. And now they add the same OS they had before in a 10.6 inches screen? Do you know how hard it is to hit the X on the top right to close Power Point? try selecting a word and make its font bold, it’ll drive you nuts!</p> <p>Having that said, I had used Power Point with SkyDrive to prepare a presentation. I love the way SkyDrive integrates everywhere but I know you’d get that with DropBox also, although I have 25GB of free space on SkyDrive :)</p> <p>As a developer there are a couple of reasons I use the desktop side. First of all, it comes with PowerShell which is needed to locally deploy apps. And second, there’s a cool feature of remote debugging your apps thru the Visual Studio remote debugger which is a desktop app. This app allows you to run your app in a Surface while debugging it with Visual Studio in your PC, and that’s a killer feature (for developer only of course)</p> <p>So, to wrap thing up. I love the Surface RT, I love the way it feels and I love the fact that there are cool apps coming everyday (have you heard of <a href="http://bit.ly/FMPWinStore">Find My Plane</a>? :) .Will I get a Surface Pro? Hell no! I have a notebook for that! Yes, it’s a huge 17inches heavy ass Vaio, I like the big screen, the Surface Pro is a netbook, and netbooks are just not for me. Everywhere I read about the Surface Pro they talk about how to hook it to an external monitor so I don’t think even Microsoft knows where is the Surface Pro targeting. (I really hope I’m wrong)</p> <p>*: If you create your app with <a href="http://www.genexus.com/tilo">Genexus</a> you don’t have to worry about this.</p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com3tag:blogger.com,1999:blog-7691694.post-46815580057838989822012-10-30T00:19:00.001-02:002012-10-30T00:21:53.727-02:00The Windows Store apps ecosystem<p>It’s been pretty exciting lately with all the announcements from Microsoft. Windows 8 finally came out, we saw the Surface tablet and other some really cool devices, and today Windows Phone 8 was announced to hit the stores in a few days.</p> <p>I’ve been using Windows 8 since the developer preview and of course it takes some time to get used to it, but if you think about it, and you actually DON’T think too hard about it, Windows 7 keyboard shortcuts work as expected on Windows 8. So if you’re a keyboard wiz, you will have no trouble to find your way around.</p> <p>What I like about all this new wave is the concept of one app in many devices. I don’t have an Xbox (yet) but being able to take a photo with my phone and have sent over my my notebook, tablet or favorite social network, is (for me) a big step forward. I know people with iPhone and Android devices will say “hey, I can do that with my phone already”, I know. I know it’s not rocket science, I’m just saying it’s a time saver to have it now with Windows, the OS my whole family uses… so now my mom won’t be calling me to help her hook the camera with the computer (that’s not a good example since she’s got an iPad, but you get the idea).</p> <p>What I don’t like for what I’ve seen so far? The Windows Store. I guess Microsoft didn’t think it would grow-up so fast… the Windows Store as we know will NOT scale up. It’s already difficult to find an app. I don’t know what others have done, but it’s almost impossible to find a game I would like with such an awful layout. At this moment the games category has 1033 apps (games) laid out awfully, so unless you’re looking for Angry Birds or Cut the Rope, it’s frustrating to go in there in pursuit of a cool game. I’ve shut the window store app many times without a single download.</p> <p>Another weird thing is how many apps have the default Visual Studio 2012 templates images. Either from previous preview versions as for the official released version, I’m talking about the little cross in a box or the star. What’s up with that? Why is Microsoft allowing those crappy looking apps into the store?… there’s no way in hell I’ll even pay attention to an app that’s was not paid attention in the first place from its own developers. That not only increases the amount of apps, which in this case is not good, but it also gives the impression of “beta”… and I’m not talking about the apps, I’m talking about the store.</p> <p>I know what’s going on. There are a bunch of Microsoft developers who saw how others got rich with apps for iOS and/or Android. Nobody thought that could be possible. Even so, five years ago there were 0 (zero) iOS developers, today they say there more than a quarter million. While those “developers” made millions of apps, some Microsoft developers waited for Microsoft to come up with something, and now it did. And I bet those developers thought, “ok, now is my turn. I know this shit, I’ll get a Windows Store app in no time”. Well my friend, you don’t know shit about Windows Store apps. Actually nobody knows, we’re all learning about it, and if you take a look at the official Microsoft made apps, you’ll see they are also learning. So don’t give me that “I know Silverlight and Xaml, I know what I’m doing” cause your app will look like crap if you don’t sit down and read the tons of guidelines out there about Windows Store apps.</p> <p>I’ve heard a lot lately that the Surface is great; great hardware but no good apps. I can’t believe there’s no facebook app, aren’t you guys friends anymore? and no official twitter app either? I just hope it’s not attempt from Microsoft to “make us” use IE10 instead, like they’re doing with Xbox.</p> <p>The good news is, we’re making a Windows Store apps generator. I wrote before about it and showed some of the cool features you can take advantage of with our generator. You might be wondering what kind of apps can we build with this generator. Is it final consumer apps or is it enterprise level apps? Yes to both o them. There’s a big <a href="http://showcase.genexus.com">showcase</a> of apps we have built with Genexus for iOS and Android, so expect the same apps for Windows 8 soon.</p> <p>So, is there an app that you wish Windows 8 had but it is not there? Don’t wait for someone else to build something close to what you need. Download <a href="http://www.genexus.com/tilo">Genexus Tilo</a> now, and start creating the next Windows 8 killer app.</p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com1tag:blogger.com,1999:blog-7691694.post-12141632043456487952012-10-02T20:03:00.001-03:002012-10-02T20:03:20.299-03:00Building a code generator, and running a marathon<p><a href="http://lh4.ggpht.com/-2zY0uprbDM4/UGtykZQDKMI/AAAAAAAAJjw/xcl7DEv1XXg/s1600-h/485778_4347864811580_1796142993_n3.jpg"><img style="margin: 0px 9px 0px 0px; display: inline; float: left" title="485778_4347864811580_1796142993_n" alt="485778_4347864811580_1796142993_n" align="left" src="http://lh3.ggpht.com/-al0GIrRcS5c/UGtylKnzvnI/AAAAAAAAJj4/cRUwX1Binlo/485778_4347864811580_1796142993_n_th.jpg?imgmax=800" width="256" height="172" /></a>Many have been told about how writing code resembles to exhaust training. The long hours, the dedication, the exclusion of what others think of fun, and specially how others can’t understand what you do or why you do it. (assuming you also code for fun) </p> <p>In the latest months I’ve been doing both of them, training for a marathon and writing the Genexus “Tilo” Windows 8 generator… but unlike the Win8 generator, I can say I finished the marathon (in one piece). </p> <p>Of course I can’t say the generator is finished, the guys from Android and iOS have been working on them for over a year now so there’s a ton of work to be done. But just like while running the marathon(*), I’m not going to think about what’s missing but what we have achieved instead.</p> <p>In <a href="http://www.genexus.com">Genexus</a> we care about letting you model your solution, your needs, and don’t worry about what platform you’re targeting. We call it “platform-independent” or “platform-agnostic” but what I think is most important is our “non platform-ignorant” philosophy. And what does that mean for our Win8 generator? That you as a customer will want your app to use all the “cool features”  Windows 8 has as you would if you develop the app from scratch (meaning writing all the code yourself). So the cool thing is we already wrote all that code so it’s dead simple for you to use. Here I’ll show you what we have and what you need to do in order to have it running on your next Genexus Win8 app.</p> <p><strong>Lives Tiles</strong></p> <p><a href="http://lh4.ggpht.com/-q6JNrqbMxxM/UGtynYwXSQI/AAAAAAAAJkA/GjnAHisxb5E/s1600-h/tiles4.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 15px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="tiles" border="0" alt="tiles" align="left" src="http://lh3.ggpht.com/-OR7KyXD63uo/UGtyoC6zZEI/AAAAAAAAJkI/WLaSczmr8IA/tiles_thumb2.png?imgmax=800" width="408" height="233" /></a></p> <p>Lives Tiles is probably the first feature that will call your attention. This feature allows the “icon” (tile) of you app to show different info about your app. A news app for instances shows the latest news, a weather app shows the current conditions and so forth. </p> <p>With Genexus all you need is a <a href="http://wiki.gxtechnical.com/commwiki/servlet/hwikibypageid?5270">DataProvider</a> that exposes the data you want to show in your tiles. That DataProvider must populate a known structure (<a href="http://wiki.gxtechnical.com/commwiki/servlet/hwikibypageid?10021">SDT</a>) so the app “knows” what to use for the image and what to use for the description. You have to keep in mind that only the latest 5 tiles will be displayed so you might want to limit that on the server side, on the dataprovider itself. </p> <p>Genexus will provide the SDT (called ‘TileSDT’) and an example of the DataProvider, so all you need to do is modify the DataProvider to populate the SDT as you wish. Remember the [Count = 5] so you don’t send unused data to your app.</p> <p><strong>Full Device Integration</strong></p> <p>This was something simple to implement but it is very useful for apps. If you declare an attribute as an <a href="http://wiki.gxtechnical.com/commwiki/servlet/hwikibypageid?4824">Image</a> and you want your users to edit it they will want to use all the features they already have on the device. So that picture could be a file from the local hard drive, or a photo taken with the device’s camera or use any of the images that image providers apps provide. For instance, Windows 8 comes with a Photos apps that connects with your facebook account, flickr, skydrive and other computers, so you can choose an image from your facebook wall album to upload into your app. Cool uh?  </p> <p>This comes “out of the box”. </p> <p><strong>Semantic Zoom</strong></p> <p><a href="http://lh4.ggpht.com/-bFi5f5v2FcM/UGtypFm0w_I/AAAAAAAAJkQ/pnpUpoNr3dw/s1600-h/SemanticZoom4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SemanticZoom" border="0" alt="SemanticZoom" align="right" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMYhIqC0phNU17fOlNfoM7yNtTamEM0lyi52x7Bt1Me1aBZaU56UKgeElcidgEF2JucCiy7RAPJWw7I-Z4Io82DrvhiN6SW-9ZmCO6qm9ry333r7vtQqhEvCG7_Yx6qw1XD7tRTA/?imgmax=800" width="371" height="211" /></a></p> <p>Semantic zoom lets you see a grid with a bigger picture view. So let’s say you’re showing contacts in your app and you have a grid where every item is of course a contact. You might want to reach to someone you know his name starts with an ‘S’ (like me). So you can scroll all the way to the S and then try to find me, or you can ‘pinch’ the grid and you will see a different view of the same grid, now grouped by the first name letter, doing it easier to go straight to the ‘S’ letter.</p> <p>With Genexus you already have the “break by” feature of a grid, and you can now define different layouts for the same grid. So with that info you can have semantic zoom in your app.</p> <p><strong>Heterogeneous layouts</strong></p> <p>You probably had seen this but didn’t know the name of it. Heterogeneous layouts is the feature that allows you to see specific items of a grid with a different layout.</p> <p>In Genexus you can define different layouts for your grids and pick on runtime the one you one for a specific pattern. Let’s say you want the item of the grid to be a big 2x2 square, or you want every 5 item to show one as a 2x1 ‘column’. Trust me, it sounds hardar than it is.</p> <p><strong>Search Charm</strong></p> <p>Charms is another cool feature of Windows 8. With the search charm you can search your apps, files, settings or in the context of an app. So you can search for ‘Angry Birds’ in the context of the Windows Store (which is an app) of course. </p> <p>Windows 8 Genexus generated apps comply the search contract so once you call it swiping your finger from the right, your app will be there as a search provider.</p> <p><a href="http://lh6.ggpht.com/-tTtJOuiJCdQ/UGtyq4bn9VI/AAAAAAAAJkg/Dk4Bkz-RLLc/s1600-h/Search4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="Search" border="0" alt="Search" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDw4xDf34Rj_gi2N5aNHu76VJDchXG_WuQAHBYVaK9vlVkkUuRedrYtiwOLiEoRVbrGllsRt4Vo85v13wOdXLpfgshdC-8wb1_TwcSpBcQQS1vHoJ33UCjpBL_oKLhO8J7L9hqXw/?imgmax=800" width="423" height="212" /></a></p> <p>In Genexus, select the object where you want to display your results by setting the property “Search Result Object”. This object must have a grid with an attribute set as ‘Search’. That attribute will be the one your app will query for.</p> <p><strong>Share Charm</strong></p> <p>The share charm allows you share something from you app with someone else. Depending on the sharing apps you have, and the content you’re trying to share, some apps will appear as sharing target. Some of those apps will allow you to twit, send over email, send to skydrive, or maybe publish to your facebook wall.</p> <p>Share is not an app wide feature, meaning that you must choose for every panel, that suits sharing of course, the attribute/variable you want to share.</p> <p>Panels in Genexus have now a Share property where you can set the Attribute or Variable you want to share. Another way of sharing is by calling the <a href="http://wiki.gxtechnical.com/commwiki/servlet/hwikibypageid?15528">Interop.SendMessage</a> function.</p> <p><strong>Everything else</strong></p> <p>Of course there are tons of features that work as you would expect. Keep in mind we’re not even in beta yet but if you put a Date attribute the Date picker will be display, or an Enum domain will show you a combo or even the dynamic combos (Country – City) work as expected.</p> <p>As mentioned before, there are some missing features… maps, notifications, audio, and more.</p> <p><strong>That’s a wrap!</strong></p> <p>So as you can see, there are quite a few cool Windows 8 features that your Genexus app can take advantage of. I encourage you to join the Genexus betatester program that will be available in a few weeks, download the Genexus Tilo night builds and give this generator a try. Right now there’s a alpha test program (at <a href="http://www.genexus.com/tilo">www.genexus.com/tilo</a>) that you could apply if you have a project for Windows 8 (right now), if you just want to play around with it you’ll have to wait.</p> <p>Also, just in case you just arrived earth from outer space, there’s this big (22nd) <a href="http://www.genexus.com/event2012">Genexus International Meeting</a> in Montevideo from Oct 1 to Oct 3. There are a few sessions you might be interested in (if you found this post interesting), but there are tons of sessions, keynotes, labs and activities you’ll find amusing and educational. I’ll be there so come down and say hello and I’ll be happy to show you all this features live! It’s easy to locate me, I’ll be the guy in the suit.</p> <p><a href="http://lh6.ggpht.com/-Dloh9APWJSA/UGtysxGzosI/AAAAAAAAJkw/2pM8rj-GdIg/s1600-h/works-on-my-machine%25255D%25255B4%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 1px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="works-on-my-machine]" border="0" alt="works-on-my-machine]" align="left" src="http://lh4.ggpht.com/-J4Oyi75Yxiw/UGtytodK4jI/AAAAAAAAJk4/DKw2YblMKx0/works-on-my-machine%25255D_thumb%25255B2%25255D.png?imgmax=800" width="67" height="72" /></a> </p> <p>As I always say, this is “works on my machine” certified, but this time it’ll be soon ready for your machine :) stay tuned!</p> <p>* <font size="1">When I reached the km 33 I hit “<a href="http://en.wikipedia.org/wiki/Marathon#Glycogen_and_.22the_wall.22">The Wall</a>”… from that point on it was all will. I knew I had 9 km ahead of me, and by that time that seemed a lot, by I had already ran 33km, so giving up was not in my plans.</font></p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-44251330800859216502012-06-19T21:13:00.001-03:002012-06-19T21:17:07.596-03:00The @FindMyPlane bot<p>A few days ago I wrote about the <a href="http://www.genexus.com">Genexus</a> Challenge developer edition and my first Smart Devices app, <a href="http://sgomez.blogspot.com/2012/06/find-my-plane.html">Find my Plane</a>. Once I get, what I think is, a good idea in my head I get around it a lot to improve it in every possible way. But this is not the case, sort of.</p> <p>Right after I deployed the app to the <a href="http://bit.ly/FMPiOS">Apple’s app store</a>, I thought “how can I advertise it, without paying for advertising of course”, I needed people to find out about the app and download it, and a good word about it would be awesome too. So I thought about social networks… Facebook is for friends and I already told them to download it (did I mentioned it’s free?!) so twitter came to mind… but what can I do to promote my app from twitter, other than twitting about it of course.</p> <p>So I thought of the <a href="http://twitter.com/findmyplane">@FindmyPlane</a> bot and this post will tell you how I did it, not that it’s rocket science, but I found an interesting use of Windows Azure’s Worker Roles*. Wait, what?! you’re gonna tell people how to build a twitter spammer bot? No, let me get into that.</p> <p>The <a href="http://twitter.com/findmyplane">@FindMyPlane</a> twitter account works like this. You send a twit to <a href="http://twitter.com/findmyplane">@FindMyPlane</a> with your flight number and find my plane will answer that tweet with useful info about it, the same kind of info you’d get in the <strong>Find My Plane</strong> app, but of course, only the info that fits in 140 characters.</p> <p>So this is how it works. There’s a worker role (called Receiver) that every ten seconds access the twitter api looking for mentions for the <a href="http://twitter.com/findmyplane">@FindMyPlane</a> account. Once it gets the list of tweets (if any of course) it saves them to a Table from Azure Storage and saves the latest tweet id in a Queue (also from Azure Storage) so the next time it just asks from that tweet on.</p> <p>This is pretty much the code:</p> <blockquote> <pre class="code"><span style="color: blue">string </span>lastTweet = <span style="color: #a31515">""</span>;<br /><span style="color: blue">string </span>previousMessageId = <span style="color: #a31515">""</span>;<br /><span style="color: blue">foreach </span>(<span style="color: #2b91af">CloudQueueMessage </span>message <span style="color: blue">in </span><span style="color: #2b91af">Queue</span>.GetAllMessages(<span style="color: #2b91af">Constants</span>.AZURE_STORAGE_ACCOUNT, <span style="color: #2b91af">Constants</span>.AZURE_STORAGE_KEY, <span style="color: #2b91af">Constants</span>.AZURE_QUEUE))<br />{<br /> previousMessageId = message.Id;<br /> lastTweet = message.AsString;<br />}<br /><br /><span style="color: blue">bool </span>first = <span style="color: blue">true</span>;<br /><span style="color: blue">foreach </span>(<span style="color: #2b91af">Status </span>status <span style="color: blue">in </span><span style="color: #2b91af">Mentions</span>.GetMentions(fmp, lastTweet))<br />{<br /> <span style="color: blue">try<br /> </span>{<br /> <span style="color: #2b91af">Table</span>.Insert(<span style="color: #2b91af">Constants</span>.AZURE_STORAGE_ACCOUNT, <span style="color: #2b91af">Constants</span>.AZURE_STORAGE_KEY, <span style="color: #2b91af">Constants</span>.AZURE_TABLE, <span style="color: #2b91af">TweetEntity</span>.FromStatus(status).ToString());<br /> }<br /> <span style="color: blue">catch </span>{ }<br /><br /> <span style="color: blue">if </span>(first)<br /> {<br /> lastTweet = status.Id;<br /> first = <span style="color: blue">false</span>;<br /> }<br />}<br /><br /><span style="color: blue">if </span>(!first)<br />{<br /> <span style="color: #2b91af">Queue</span>.DeleteMessage(<span style="color: #2b91af">Constants</span>.AZURE_STORAGE_ACCOUNT, <span style="color: #2b91af">Constants</span>.AZURE_STORAGE_KEY, <span style="color: #2b91af">Constants</span>.AZURE_QUEUE, previousMessageId);<br /> <span style="color: #2b91af">Queue</span>.CreateMessage(<span style="color: #2b91af">Constants</span>.AZURE_STORAGE_ACCOUNT, <span style="color: #2b91af">Constants</span>.AZURE_STORAGE_KEY, <span style="color: #2b91af">Constants</span>.AZURE_QUEUE, lastTweet);<br />}</pre><br /></blockquote><br /><br /><br /><p>And there’s a second Worker Role (called Replier) that every ten seconds queries the table where the tweets were saved for those that have not been replied yet and don’t have errors. For every tweet I try to get info of the flight number sent, if I do find info, I reply the tweet with that info and update the record on the table as replied. If I can’t find info, let’s say you tweeted “@FindMyPlane is awesome!” I update the record as ‘with errors’. This is just a way for me to know when I couldn’t reply because of an error on the system or because what I got was not a valid flight number.</p><br /><br /><p>Code here:</p><br /><br /><pre class="code"><span style="color: blue">string </span>query = <span style="color: #a31515">"Replied eq 'False' and Error eq 'False'"</span>;<br /><span style="color: blue">foreach </span>(<span style="color: #2b91af">TableEntity </span>entity <span style="color: blue">in </span><span style="color: #2b91af">Table</span>.Query(<span style="color: #2b91af">Constants</span>.AZURE_STORAGE_ACCOUNT, <span style="color: #2b91af">Constants</span>.AZURE_STORAGE_KEY, <span style="color: #2b91af">Constants</span>.AZURE_TABLE, query))<br />{<br /> <span style="color: blue">string </span>flightNumber = entity[<span style="color: #a31515">"Text"</span>].ToUpper().Replace(<span style="color: #a31515">"@FINDMYPLANE "</span>, <span style="color: #a31515">""</span>);<br /> <span style="color: blue">try<br /> </span>{<br /> <span style="color: #2b91af">FlightInfo </span>info = <span style="color: #2b91af">FlightStatus</span>.GetFlightStatus(flightNumber);<br /> <span style="color: blue">string </span>tweet = <span style="color: blue">string</span>.Format(<span style="color: #a31515">"@{0} {1}"</span>, entity[<span style="color: #a31515">"UserScreenname"</span>], info);<br /> <span style="color: #2b91af">Update</span>.UpdateStatus(tweet, fmp, entity[<span style="color: #a31515">"Id"</span>]);<br /> entity[<span style="color: #a31515">"Replied"</span>] = <span style="color: #a31515">"True"</span>;<br /><br /> <span style="color: #2b91af">Table</span>.UpdateEntity(<span style="color: #2b91af">Constants</span>.AZURE_STORAGE_ACCOUNT, <span style="color: #2b91af">Constants</span>.AZURE_STORAGE_KEY, <span style="color: #2b91af">Constants</span>.AZURE_TABLE, entity);<br /> }<br /> <span style="color: blue">catch <br /> </span>{<br /> <span style="color: blue">try<br /> </span>{<br /> entity[<span style="color: #a31515">"Error"</span>] = <span style="color: #a31515">"True"</span>;<br /> <span style="color: #2b91af">Table</span>.UpdateEntity(<span style="color: #2b91af">Constants</span>.AZURE_STORAGE_ACCOUNT, <span style="color: #2b91af">Constants</span>.AZURE_STORAGE_KEY, <span style="color: #2b91af">Constants</span>.AZURE_TABLE, entity);<br /> }<br /> <span style="color: blue">catch<br /> </span>{<br /> <span style="color: #2b91af">Table</span>.DeleteEntity(<span style="color: #2b91af">Constants</span>.AZURE_STORAGE_ACCOUNT, <span style="color: #2b91af">Constants</span>.AZURE_STORAGE_KEY, <span style="color: #2b91af">Constants</span>.AZURE_TABLE, entity.PartitionKey, entity.RowKey);<br /> }<br /> }<br />}</pre><br /><br /><br /><p>Cool uh?!</p><br /><br /><p>Here’s how all this works together</p><br /><br /><p><a href="http://lh5.ggpht.com/-6OlaVsoLqFQ/T-EVt7ZMRfI/AAAAAAAAJeA/ODZJ4Pv34Rk/s1600-h/image%25255B2%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-2UVyj_Mnaos/T-EVuuGdTyI/AAAAAAAAJeI/3e9ToFhp23U/image_thumb.png?imgmax=800" width="650" height="557" /></a></p><br /><br /><p>(*) for a good read on the Azure platform, Worker Roles and Storage (Table, Queues & Blobs) go to: <a title="http://bit.ly/SGAzure" href="http://bit.ly/SGAzure">http://bit.ly/SGAzure</a></p><br /><br /><p>You can download the ‘Find my Plane’ for <a href="http://bit.ly/FMPAndroid">Android</a> and for <a href="http://bit.ly.FMPiOS">iPhone</a>.</p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-39737251609750478522012-06-09T16:57:00.001-03:002012-06-09T16:58:09.556-03:00Find my Plane<p>At <a href="http://www.genexus.com">Genexus</a> we had a little contest. We had a few contest before where we asked customers and friends to create a cool app for Smart Devices with our brand new <a href="http://wiki.gxtechnical.com/commwiki/servlet/hwikibypageid?14451">Smart Devices generator</a>. Of course we could not participate, it would be unfair… (or at least that’s what they thought).</p> <p>So a month ago, <a href="http://www.twitter.com/GMilano">Gastón</a> told us we would have an internal contest, it was called “GX Challenge (Developer Edition)” in which whoever wanted to participate had to build an app. Who wins? whoever gets the most downloads per app. </p> <p>The most difficult thing is of course to come up with a good/cool idea, and I’m not saying that I finally came to a real good idea, with it was something that I’d definitely enjoy doing. So that’s how Find my Plane appeared.</p> <p>Find my Plane is a simple app where you enter a flight number and the app would give you info about the flight. From where to where, terminal and gate (where available) and if the flight is on time or delayed, and even as <a href="http://twitter.com/njodal">Nicolás</a> found out, if the plane was diverted to a different location.</p> <p>But it was still too simple. Who would download an app like that if you can get that info and more from other apps? So I added a few things. First, thanks to <a href="http://wunderground.com">wunderground.com</a> API I added the weather of both departure and arrival airports of the flight, plus another small feature that is being able to listen to the air traffic controllers available from the mentioned airports. You can get all that from different apps, but I haven’t seen one with all those features combined so I thought it would be a cool app, and fun to develop.</p> <p>It’s been on the <a href="http://bit.ly/FMPAndroid">Android</a> Marketplace (AKA Google Play) for over 2 weeks now with a little over 100 downloads plus 200+ downloads from the <a href="http://bit.ly/FMPiOS">Apple</a> Marketplace in less than a week.</p> <p>Here’s a little video of what the app looks like (on the Android emulator)</p> <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:df4eb586-e680-400f-8f72-80aab7f07e23" class="wlWriterEditableSmartContent"><div id="0b18b603-f780-47e1-a1be-a33ef329bb29" style="margin: 0px; padding: 0px; display: inline;"><div><a href="http://www.youtube.com/watch?v=WRLrc0aqDik" target="_new"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqyH_UKSbN28KXXfc1bsAXC-y4bZWnpkS-rJx2SkuK93p5PzkMoAe4Cl9uhOB2sPG0d7JUoIUDE0VCaOiYEJewwgKKbDvI96tDjOEYcelPym74rZicdq4JekyavMrE5mGAS5wZMQ/?imgmax=800" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('0b18b603-f780-47e1-a1be-a33ef329bb29'); downlevelDiv.innerHTML = "<div><object width=\"599\" height=\"336\"><param name=\"movie\" value=\"http://www.youtube.com/v/WRLrc0aqDik?hl=en&hd=1\"><\/param><embed src=\"http://www.youtube.com/v/WRLrc0aqDik?hl=en&hd=1\" type=\"application/x-shockwave-flash\" width=\"599\" height=\"336\"><\/embed><\/object><\/div>";" alt=""></a></div></div></div> <p>Like what you see? Download it now! </p> <p><a href="http://bit.ly/FMPAndroid">http://bit.ly/FMPAndroid</a></p> <p><a href="http://bit.ly/FMPiOS">http://bit.ly/FMPiOS</a></p> <p>p.s: Did I mention it is FREE!</p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com2tag:blogger.com,1999:blog-7691694.post-91736746452159970812012-03-12T15:58:00.001-03:002014-12-15T09:57:41.025-02:00Colored log4net log files in Notepad++Some time ago, I can’t tell exactly when, I discovered <a href="http://notepad-plus-plus.org/">Notepad++</a> (NPP). NPP is a great light weight text editor with tons of cool features. <br />
I’m also a big fun of <a href="http://logging.apache.org/log4net/">log4Net</a> since I discovered when I added the logging features to <a href="http://wiki.gxtechnical.com/commwiki/servlet/hwikibypageid?11346">Genexus</a> and <a href="http://wiki.gxtechnical.com/commwiki/servlet/hwikibypageid?10948">GXserver</a>. It is so easy to implement and helpful that I have used it in every project I worked ever since. <br />
So in my daily basis I get to work with log4net log files a lot. I was doing so last Saturday when it hit me, “I need syntax coloring for this”.<br />
So I looked up and found a great <a href="http://weblogs.asp.net/jgalloway/archive/2006/11/25/creating-a-user-defined-language-in-notepad.aspx">post</a> from <a href="https://twitter.com/#!/jongalloway">Jon Galloway</a> that explains how you can create your own “User Defined Language” in NPP. To my surprise it was pretty simple since NPP has a dialog to do so, I thought I’d have to some xml editing. The dialog does that for you and what’s even better you can see the results of what you’re changing while you’re doing it. <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6OU8aNoOTYGxPB324nDM4RSSPlwz0W6NRWUTtB8acmCi1OoZ11N5NKgqv4KVR5-9jTBTpV-DfBaau4OCMCf61cvB9Sp9d3KHRecAawUHVVerAcpN6R_yH7wV852JviymvuDZlmQ/s1600-h/notepadlog4net7.png"><img alt="notepadlog4net" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji5PqLOiomDm_72bLFXER04fSCJPYwKvlVLGSz16kneMhwAyCTqNhY8Eg7vfJTb-oAliNcvraKoyiAPYm3OCBYizkI8t8DoYDaaB4-9vSi9xxSkYQIpvepzPYlQdgCLoRX56C4lw/?imgmax=800" height="572" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="notepadlog4net" width="908" /></a><br />
The result is (to me) pretty cool. It’s now a lot easier to find the ERROR or WARN lines. <br />
I also added a couple of features that basically are a better way to focus on what’s important. <br />
Numbers are in <span style="color: black;">yellow</span>, single quoted strings are in <span style="color: black;">red</span>, each keyword (INFO, DEBUG, ERROR, WARN, FATAL) has its own color, plus I also added “comments”. By using the good old // to comment a line or /* to comment a block */, you can help you and others to pay attention to what really matters, or at least what you think matters.<br />
So, how do you get this?<br />
Simple way: If you have never defined of modified a User defined Language, you can simply download the posted file and override your existent in <strong>%APPDATA%\Notepad++</strong> (Make sure you backup your file first)<br />
“Harder” way: if you have modified of added a user defined language, you probably know what to do but anyways, download the file (same from above) open it in your favorite text editor ;) and copy the UserLang tag with its content and copy it to your current <strong>userDefineLang.xml</strong> file.<br />
<br />
**We moved to GitHub! Download the file from: <a href="https://github.com/sebagomez/log4net-for-notepadpp">https://github.com/sebagomez/log4net-for-notepadpp</a><br />
<br />
As usual, this is 100% “works on my machine” certified.<a href="http://lh3.ggpht.com/-TlyCHbWoC9w/T15IEVcTeQI/AAAAAAAAItc/Z3V4d1Vc5Ew/s1600-h/works-on-my-machine%25255D%25255B2%25255D.png"><img align="left" alt="works-on-my-machine]" border="0" src="http://lh6.ggpht.com/-fE3hjExf-tk/T15IFBLnmeI/AAAAAAAAItk/XcnFPcO5eEY/works-on-my-machine%25255D_thumb.png?imgmax=800" height="193" style="background-image: none; border-width: 0px; display: inline; float: left; margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="works-on-my-machine]" width="200" /></a>Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com9tag:blogger.com,1999:blog-7691694.post-16329067312240191092011-10-24T13:25:00.001-02:002011-10-25T16:29:50.707-02:00Featuring GXpowerCommands<p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV5vVqXcEDImkzJEDtebh3cfAIOvuzKG3ZTN-M_S3URZ0NEO3VsdAfxmvMBAFB8umTDsgNvrsioOlYUXEjwaZeYKUXok8t_zmiEg_WUEjum4fDtXkLDUpMzmxJUEBbCx8riU2Dqg/s1600-h/apgetwikiimage%25255B4%25255D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="apgetwikiimage" border="0" alt="apgetwikiimage" align="left" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy-QcwPceYRxlDYykrtH1_XR5Z0eH5pQpCRbH3IVyw25bPgB4kf5_THAlDYqWd3EHmpq-kBKTa0y3_G7I7vNHK4vbZtf4MQDLNiLFOZro2fGvFQwQaq5V0ptZ1UQPz-B3tFR6Dxw/?imgmax=800" width="324" height="241" /></a>After <a href="http://twitter.com/gmilano">@gmilano</a>’s <a href="http://visualstudiogallery.msdn.microsoft.com/53fe63d5-780d-409b-afc3-10d05906e0a6/">Cool Commands</a> for Visual Studio I thought I should write my own “cool commands” for <a href="http://www.genexus.com">Genexus</a>. There a few tasks the I need to do quite often and I thought I’d be great if I could have right there on a contextual menu, like completely deleting a folder and it’s content or “Rebuild and run” an object… or even run (execute) an object as is, no further specification of analysis needed.</p> <p>So I created this package with the extensions I found useful to myself. Here’s a little description of every command:</p> <p><strong>Empty and delete folder</strong>: I tries to delete every object in a folder and the folder itself. The success will depend on the references the contained objects have to. I any object A outside the selected folder) is referencing an object B from the folder, B won’t be able to be deleted, thus, the folder either. This command is not transactional. <br /><strong>Build/Rebuild folder objects</strong>: Ever wanted to build every object in a folder? It’s kind of painful to select every single object, right? Now you can step on a folder and choose to build or rebuild every single object in it. <br /><strong>Rebuild and run</strong>: Only valid for main objects, this command will execute a forced build (rebuild) and then execute (run) the generated program. <br /><strong>Run as is</strong>: What was that message again? I know the state of the generated program, I just want to execute it, no validation needed. This is the command that will fire the browser and show you the program “as is”.  <br /><strong>Command prompt here</strong>: This is a command that’s now built-in in Visual Studio. Applied to Genexus you can open a command prompt at the Knowledge Base directory or at your different environments directories. Just click on the desired node from the Preferences tree and voilá. <br /><strong>Windows Explorer here</strong>: Same as command prompt but for Windows Explorer. Enough said.</p> <p>This package can be freely downloaded from the <a href="http://marketplace.genexus.com/viewproduct.aspx?225">Genexus Marketplace</a>, so go ahead and give it a try.</p> <p>In this post I’ll like to answer the question I know some people must be wondering: “dude! you work at the Genexus Development Team, why aren’t these commands available in Genexus out of the box?”. Well, I’m no traditional Genexus developer so I’m not sure if these commands will actually be useful to the entire community so I don’t want to add “noise” to the already pretty big menus we have in Genexus. So depending on the adoption of these commands you might see some of them in Genexus in the near future.</p> <p>Spanish instructions <a href="http://wiki.gxtechnical.com/commwiki/servlet/hwikibypageid?17025">here</a>, download <a href="http://marketplace.genexus.com/viewproduct.aspx?225">here</a>.</p> <p>Like every other set of bits from this blog, this extension is “Works on my machine” certified, but this one has actually been tested by the guys at the Genexus marketplace <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXR-r7YJN4A4KgpiduaQSKsYCCPmvHbs06MeizRq3w14QlJ-DrxsvPqZAW3ZGPajBLDWYHvkx18kMhYFj7tzJHnQlaqYZJrQw7RcWNVyKI-ghdm76CPd_ZHMNQV5ylTlyeo_y_Og/?imgmax=800" /> <br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7g4DKKOhWoNJ2498KETh6yzRgeqdzxIVtN667KUQGmAjYCeikHKGERFszZ-M6GyqNsY63Ar9xswK3Gsja8IK65U_azCPf6DNL_zgt8lDYz5_tNPU4g2ko0ZhYN_qp_YpVpa1aSg/s1600-h/works-on-my-machine-starburst_3_thumb%25255B1%25255D%25255B2%25255D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="works-on-my-machine-starburst_3_thumb[1]" border="0" alt="works-on-my-machine-starburst_3_thumb[1]" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUFfz77qEoBRGNaXMtjgITDMxFYH-Uj0yB5iogITx9vH809AKdgIU2vgUAto_6LjodQu7_x5Mbl7HjprzfP-OhyphenhyphenbDuALNHZpFNVHL-TcTtCs6oFMbCfGlmShPnaysO3T259s0E2Q/?imgmax=800" width="200" height="193" /></a></p> <p><strong>EDIT 25-Oct-2011:</strong> Genexus X Evolution 2 support is now available. </p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com2tag:blogger.com,1999:blog-7691694.post-21789098773113680272011-03-31T11:46:00.001-03:002011-03-31T12:04:48.045-03:00WCF RIA Services Compositions with Entity Framework<p>I haven't been working on anything outside Genexus, Deklarit and Genexus Server for a while, so when my friend <a href="http://twitter.com/mateofd">Mateo</a> asked to help him on a new project for a client of his, based on brand new Microsoft technologies, I was saying yes before the end of the sentence.</p> <p>This blog post and probably some more to come will be related to our experience with Entity Framework 4, RIA Services 1 and Silverlight 4.</p> <p>But in this particular case I wanted to blog about a problem we had with Compositions. Compositions are very useful when you have an Association where a Parent entity needs to have its children all the time. </p> <p>The Update method of parent entities is a bit different than regular entities. I took the patter from this article (<a href="http://msdn.microsoft.com/en-us/library/ee707346%28VS.91%29.aspx">Compositional Hierarchies</a>) but things didn’t work as expected. I have to add that “m generating POCO entities and using the <a href="http://martinfowler.com/eaaCatalog/unitOfWork.html">Unit Of Work</a> pattern so it wasn’t easy just copy and paste the code for the article. I posted a few questions to the RIA services forum and found out that that pattern exposed a bug :(</p> <p>Fortunately I was redirected <a href="http://brettsam.com/2011/03/25/ria-services-composition-with-entity-framework/">this post</a> from Brett Samblament which described the new pattern to follow to write a fully functional UpdateParent method. But again, I can’t just copy and paste, so here’s the code I wrote for it. Also, by using generic, I’m able to call the exact pattern for every composition in my model, cool uh?!</p> <pre class="code"><span style="color: blue">public void </span>UpdateParent(<span style="color: #2b91af">Parent </span>parent)<br />{<br /> <span style="color: #2b91af">EntityHelper</span>.UpdateParentEntity(parent, ObjectContext.Parents, ChangeSet, ObjectContext);<br /><br /> <span style="color: blue">foreach </span>(<span style="color: #2b91af">Child </span>child <span style="color: blue">in </span>ChangeSet.GetAssociatedChanges(parent, o => o.Children))<br /> <span style="color: #2b91af">EntityHelper</span>.UpdateChildEntity(child, ObjectContext.Children, ChangeSet, ObjectContext);<br /><br />}</pre><br /><br /><p>And my EntityHelper class has the following methods:</p><br /><br /><pre class="code"><span style="color: blue">public static void </span>UpdateParentEntity<T>(T entity, <span style="color: #2b91af">IRepository</span><T> repository, <span style="color: #2b91af">ChangeSet </span>chgSet, <span style="color: #2b91af">IUnitOfWork </span>oc)<br /> <span style="color: blue">where </span>T : <span style="color: blue">class<br /></span>{<br /> <span style="color: blue">try<br /> </span>{<br /> <span style="color: #2b91af">ObjectContext </span>ctx = oc <span style="color: blue">as </span><span style="color: #2b91af">ObjectContext</span>;<br /> repository.ObjectSet.AddObject(entity);<br /><br /> T originalEntity = chgSet.GetOriginal<T>(entity);<br /><br /> <span style="color: blue">if </span>(originalEntity == <span style="color: blue">null</span>)<br /> ctx.ObjectStateManager.ChangeObjectState(entity, <span style="color: #2b91af">EntityState</span>.Unchanged);<br /> <span style="color: blue">else<br /> </span>repository.ObjectSet.AttachAsModified(entity, originalEntity);<br /> }<br /> <span style="color: blue">catch </span>(<span style="color: #2b91af">Exception </span>ex)<br /> {<br /> <span style="color: #2b91af">TraceManager</span>.Error(<span style="color: blue">string</span>.Format(<span style="color: #a31515">"An error occurred updating a {0}"</span>, <span style="color: blue">typeof</span>(T)), ex);<br /> <span style="color: blue">throw</span>;<br /> }<br />}</pre><br /><br /><pre class="code"><span style="color: blue">public static void </span>UpdateChildEntity<T>(T entity, <span style="color: #2b91af">IRepository</span><T> repository, <span style="color: #2b91af">ChangeSet </span>chgSet, <span style="color: #2b91af">IUnitOfWork </span>oc)<br /> <span style="color: blue">where </span>T : <span style="color: blue">class<br /></span>{<br /> <span style="color: blue">try<br /> </span>{<br /> <span style="color: #2b91af">ObjectContext </span>ctx = oc <span style="color: blue">as </span><span style="color: #2b91af">ObjectContext</span>;<br /> <span style="color: #2b91af">ChangeOperation </span>change = chgSet.GetChangeOperation(entity);<br /> <br /> <span style="color: blue">switch </span>(change)<br /> {<br /> <span style="color: blue">case </span><span style="color: #2b91af">ChangeOperation</span>.Delete:<br /> <span style="color: blue">if </span>(GetEntityState(entity, ctx) == <span style="color: #2b91af">EntityState</span>.Detached)<br /> repository.ObjectSet.Attach(entity);<br /> ctx.DeleteObject(entity);<br /> <span style="color: blue">break</span>;<br /> <span style="color: blue">case </span><span style="color: #2b91af">ChangeOperation</span>.Insert:<br /> <span style="color: green">// do nothing<br /> </span><span style="color: blue">break</span>;<br /> <span style="color: blue">case </span><span style="color: #2b91af">ChangeOperation</span>.None:<br /> ctx.ObjectStateManager.ChangeObjectState(entity, <span style="color: #2b91af">EntityState</span>.Unchanged);<br /> <span style="color: blue">break</span>;<br /> <span style="color: blue">case </span><span style="color: #2b91af">ChangeOperation</span>.Update:<br /> T original = chgSet.GetOriginal<T>(entity);<br /> <span style="color: blue">if </span>(original == <span style="color: blue">null</span>) { <span style="color: blue">throw new </span><span style="color: #2b91af">Exception</span>(<span style="color: #a31515">"Update with no original value found"</span>); }<br /> <span style="color: blue">if </span>(GetEntityState(entity, ctx) == <span style="color: #2b91af">EntityState</span>.Detached)<br /> repository.ObjectSet.Attach(entity);<br /> repository.ObjectSet.AttachAsModified(entity, original);<br /> <span style="color: blue">break</span>;<br /> <span style="color: blue">default</span>:<br /> <span style="color: blue">break</span>;<br /> }<br /> }<br /> <span style="color: blue">catch </span>(<span style="color: #2b91af">Exception </span>ex)<br /> {<br /> <span style="color: #2b91af">TraceManager</span>.Error(<span style="color: blue">string</span>.Format(<span style="color: #a31515">"An error occurred updating a {0}"</span>, <span style="color: blue">typeof</span>(T)), ex);<br /> <span style="color: blue">throw</span>;<br /> }<br />}</pre><br /><br /><pre class="code"><span style="color: blue">public static </span><span style="color: #2b91af">EntityState </span>GetEntityState(<span style="color: blue">object </span>entity, <span style="color: #2b91af">ObjectContext </span>ctx)<br />{<br /> System.Data.Objects.<span style="color: #2b91af">ObjectStateEntry </span>ose;<br /> <span style="color: blue">if </span>(ctx.ObjectStateManager.TryGetObjectStateEntry(entity, <span style="color: blue">out </span>ose))<br /> <span style="color: blue">return </span>ose.State;<br /> <span style="color: blue">else<br /> return </span><span style="color: #2b91af">EntityState</span>.Detached;<br />}</pre><br /><br /><p>I hope this helps someone clear the way… and I promise I’ll post more (and more often) about this.</p><br /><br /><p>As usual, this code is ‘works on my machine’ certified.</p><br /><br /><p><a href="http://lh3.ggpht.com/_JH5-QZJMtzc/TZSTq1_nGjI/AAAAAAAAIbk/RKLi-9BOTrw/s1600-h/works-on-my-machine-starburst_3_thumb%5B1%5D%5B3%5D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="works on my machine" border="0" alt="works on my machine" src="http://lh4.ggpht.com/_JH5-QZJMtzc/TZSTrVmerUI/AAAAAAAAIbo/TB0QuC9ldwA/works-on-my-machine-starburst_3_thumb%5B1%5D_thumb%5B1%5D.png?imgmax=800" width="200" height="193" /></a></p><br /><br /><p>I never get tired of this <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://lh5.ggpht.com/_JH5-QZJMtzc/TZSTrz6hBNI/AAAAAAAAIbs/MauzxaZGR_o/wlEmoticon-smile%5B2%5D.png?imgmax=800" /></p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-70469910013606600392010-08-06T13:05:00.001-03:002010-08-06T13:05:59.368-03:00Annoy Smarx from Windows Phone 7<p><a href="http://annoy.smarx.com/">Annoy Smarx</a> is a web app that <a href="http://www.twitter.com/smarx">Steve Marx</a> showed in Windows Azure Firestarter event. It is a web app that once you clicked on an image, Steve’s notebook wallpaper would change to the selected image. It was a pretty cool demo cause it showed you a good practical sample of <a href="http://msdn.microsoft.com/en-us/library/ee732537.aspx">AppFabric ServiceBus</a>. </p> <p>Last week I started playing around with the new <a href="http://developer.windowsphone.com/">Windows Phone 7 SDK</a>, and I faced the problem I do when I start something new, “what should I code”? I t has to be simple cause I’m new to this stuff (I’m no too familiar with <a href="http://www.silverlight.net/">silverlight</a> either) but not too simple… I hate the <a href="http://en.wikipedia.org/wiki/Hello_world_program">“Hello World!”</a> sample. So I thought maybe I can create a client for the AnnoySmarx sample and so I did.</p> <p>I liked it cause it a simple project, yet it has many cool features, like downloading blobs from <a href="http://www.microsoft.com/windowsazure/windowsazure/">Azure</a> Storage, using a ListBox to show the images, handling the double tap event on Windows Phone 7 (there’s no OnDoubleTap event, so it might be a little more complicated than you think), and calling a <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">rest</a> service on ServiceBus which is actually running on my computer.</p> <p>You’ll find all the resources you need at <a href="http://blog.smarx.com/posts/annoy-smarx-com-letting-the-internet-choose-my-wallpaper">Steve’s post</a> and the code for this client <a href="http://cid-7dd6dbc866de1c9c.office.live.com/self.aspx/Public%20Tools/AnnoySmarxWP7Client.rar">here</a>.</p> <p>I recorded a video of the app running on the emulator… </p> <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:b36a1af6-8a86-4fae-b191-9d5dc43a5cad" class="wlWriterEditableSmartContent"><div id="4abadbb3-5ebc-4b27-8575-a03549bcf550" style="margin: 0px; padding: 0px; display: inline;"><div><a href="http://www.youtube.com/watch?v=ToGc9v9jWbc" target="_new"><img src="http://lh4.ggpht.com/_JH5-QZJMtzc/TFwy4YkWdVI/AAAAAAAAIVY/YJ6Yt738WYM/video4a36f72149c8%5B19%5D.jpg?imgmax=800" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('4abadbb3-5ebc-4b27-8575-a03549bcf550'); downlevelDiv.innerHTML = "<div><object width=\"425\" height=\"355\"><param name=\"movie\" value=\"http://www.youtube.com/v/ToGc9v9jWbc&hl=en\"><\/param><embed src=\"http://www.youtube.com/v/ToGc9v9jWbc&hl=en\" type=\"application/x-shockwave-flash\" width=\"425\" height=\"355\"><\/embed><\/object><\/div>";" alt=""></a></div></div></div> <p>pretty cool uh?!</p> <br /> <p><a href="http://lh4.ggpht.com/_JH5-QZJMtzc/TFwy40TMr7I/AAAAAAAAIVc/El2e7pSVdXw/s1600-h/works-on-my-machine-starburst_3_thumb%5B1%5D%5B3%5D.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="works-on-my-machine-starburst_3_thumb[1]" border="0" alt="works-on-my-machine-starburst_3_thumb[1]" src="http://lh6.ggpht.com/_JH5-QZJMtzc/TFwy5WeoQjI/AAAAAAAAIVg/4IejXBNGiSU/works-on-my-machine-starburst_3_thumb%5B1%5D_thumb%5B1%5D.png?imgmax=800" width="200" height="193" /></a></p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-22017536788729463462010-06-30T18:49:00.001-03:002015-10-08T20:13:02.724-03:00Introducing shelltwit<img align="left" src="http://farm9.staticflickr.com/8363/8319299202_9282a7e6ed.jpg" height="241" style="display: inline;" width="472" /><br />
<br />
Some time ago I <a href="http://sgomez.blogspot.com/2010/01/yatc-yet-another-tweeter-client.html">talked about</a> a command line twitter client I was developing. Today I can proudly say it is finished… for now <img alt="Smile" class="wlEmoticon wlEmoticon-smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDUF4_wpl4cbFVMz0tL6_njD5UUgpWb93bsxB5NC6O77aJCdh_FLktJYBmx1p0w4hK3i7Lh1dhKMdEPuSvIHB6FQpRqFd7p-JBcMSzIXRlczW9YZCx3FMWapvQ7q5OSu8rNEC3bQ/?imgmax=800" /><br />
And I decided to upload the code to <a href="http://shelltwit.codeplex.com/"><strike>Codeplex</strike></a> <a href="https://github.com/sebagomez/shelltwit">GitHub</a> for a few reasons. First of all it uses <a href="http://dev.twitter.com/pages/xauth">xAuth</a> with .net with no extra library. Some may be asking “why would you want to do that if there are hundreds of libraries out there?”… well yeah but… no I don’t have an answer for that… I guess I just wanted to give it a try.<br />
Also, while developing this tool I encountered some problems that some people does not ever find, specially people from English speaking countries. The problem appears when you want to twit say… “<a href="http://en.wikipedia.org/wiki/C.A._Pe%C3%B1arol">Peñarol</a> Campeón!”. It took me a little while to discover the right encoding and as I said before, there’s not much written about it. (For more info take a look <a href="http://sgomez.blogspot.com/2010/05/encoding-strings-for-twitter-api.html">here</a>)<br />
And finally I wanted to share the code in case some soul out there wanted to give me a hand with the rest of the API. So far this tool only updates the status, but I’m also building a library (cleverly called shelltwitlib) where I’m intending to add every twitter API method.<br />
As a bonus, if you use the shelltwitlib (since it works with <a href="http://dev.twitter.com/pages/xauth">xAuth</a>) you’ll be able to have your tool displayed on your status like in the picture shown below.<br />
<a href="http://lh3.ggpht.com/_JH5-QZJMtzc/TCu7x3tI7QI/AAAAAAAAIUw/OcPMv61dg9M/s1600-h/ViaShelltwit%5B5%5D.png"><img alt="ViaShelltwit" border="0" class="wlDisabledImage" src="http://lh6.ggpht.com/_JH5-QZJMtzc/TCu7zWlxvqI/AAAAAAAAIU0/lCuvE-5UPNA/ViaShelltwit_thumb%5B3%5D.png?imgmax=800" height="240" style="border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="ViaShelltwit" width="398" /></a><br />
Want more? <a href="http://bit.ly/">Bit.ly</a> integration is also available <img alt="Smile" class="wlEmoticon wlEmoticon-smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDUF4_wpl4cbFVMz0tL6_njD5UUgpWb93bsxB5NC6O77aJCdh_FLktJYBmx1p0w4hK3i7Lh1dhKMdEPuSvIHB6FQpRqFd7p-JBcMSzIXRlczW9YZCx3FMWapvQ7q5OSu8rNEC3bQ/?imgmax=800" /><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyigdSLUjleq8rKFQX0tqB8m7MDSIqiEDkbyOPE7vtQmtwtHmsXl-hS7GauFkrQkFNmpT0wLORZp83xOnGdWgx05sXfzPrp2ZnCXfAAFBFd4KsyD-SGF7RoAEZNLCWTCvApK6wxQ/s1600-h/works-on-my-machine-starburst_3_thumb%5B1%5D%5B3%5D.png"><img alt="works-on-my-machine-starburst_3_thumb[1]" class="wlDisabledImage" src="http://lh3.ggpht.com/_JH5-QZJMtzc/TCu71X1y1lI/AAAAAAAAIU8/locUCycVxUg/works-on-my-machine-starburst_3_thumb%5B1%5D_thumb%5B1%5D.png?imgmax=800" height="193" style="display: inline;" title="works-on-my-machine-starburst_3_thumb[1]" width="200" /></a>Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-37735797092663361312010-06-22T15:29:00.001-03:002010-06-22T15:29:10.563-03:00HTTP Error 404.17 - Not Found<p>The requested content appears to be script and will not be served by the static file handler.</p> <p>For some (unknown at the time) reason I had this error while trying to view a WCF service app in the web browser. I googled (and binged) around and there was many reasons for that message.</p> <p>My problem was that my brand new computer came with Microsoft .net 3.0 installed but IIS was not active. So I installed IIS after the WCF support so the WCF mime types were not installed.</p> <p>To get this working all I had to do is running the following command: </p> <p><strong><em>C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg -i</em></strong></p> <p>Hope it helps someone else.</p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-56972165716576121552010-05-17T15:58:00.001-03:002010-05-17T15:58:11.625-03:00Encoding strings for the twitter API<p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiAlcASkug-jlUWPJADPw_I5Wgnk7c0UH16PMx1yyyBEVzC_xxAcLAi8XkTRZ0NXyl3qmrgkLdgTLKMOPCRDgCaX_Caufd8Kd-Gr202EjQiU0PwM18-w4OUOCW6BN-g39ALxRvZw/s1600-h/shelltwit9.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="gentleface.com free icon set" border="0" alt="gentleface.com free icon set" align="left" src="http://lh3.ggpht.com/_JH5-QZJMtzc/S_GRwog_wBI/AAAAAAAAIT0/NcXAJEN9QA8/shelltwit_thumb7.png?imgmax=800" width="68" height="68" /></a> Some time ago, I started to work on <a href="http://sgomez.blogspot.com/2010/01/yatc-yet-another-tweeter-client.html">shelltwit</a> a command line <a href="http://www.twitter.com">twitter</a> updater (it only updates your status), but I didn’t want to use any existing library because I wanted to learn how to work directly to twitter API. </p> <p>I looked around for some examples, the Twitter API doc is not well updated or complete, so it is not easy to start coding right away, you need to read a lot first (I hate when that happens). I found a good sample from <a href="http://voiceoftech.com/swhitley/">Shannon Whitley</a> called <a href="http://www.voiceoftech.com/swhitley/?p=864">Twitter xAuth with .net</a>. I started up with that code but I found an issue with international characters, like á, é or ñ, which kept me from posting about #Peñarol. So I started to hunt the bug, looked around online, went to the <a href="http://groups.google.com/group/twitter-development-talk">Twitter API user group</a> and found out that there are a lot of issues with international characters. I found people form Brazil, Russia and Japan complaining about it. Apparently most libraries were written by english speaking developers so very few encounter the issue. </p> <p>Now I can happily say that found the issue so I thought about posting the solution here. </p> <p>Encoded strings (your twitter status) must be made to <a href="http://en.wikipedia.org/wiki/UTF8">UTF8</a> according to RFC3986 and there’s no native .net function that does that, so after some researching I came up with an algorithm that does exactly that. So I hope it helps some one else.</p> <pre class="code"><span style="color: blue">static string </span>UNRESERVED_CHARS = <span style="color: #a31515">"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~"</span>;<br /><br /><span style="color: green">//http://en.wikipedia.org/wiki/Percent-encoding<br />//http://www.w3schools.com/tags/ref_urlencode.asp see 'Try It Yourself' to see if this function is encoding well<br />//This should be encoded according to RFC3986 http://tools.ietf.org/html/rfc3986<br />//I could not find any native .net function to achieve this<br /></span><span style="color: gray">/// <summary><br />/// </span><span style="color: green">Encodes a string according to RFC 3986<br /></span><span style="color: gray">/// </summary><br />/// <param name="value"></span><span style="color: green">string to encode</span><span style="color: gray"></param><br />/// <returns></returns><br /></span><span style="color: blue">public static string </span>EncodeString(<span style="color: blue">string </span>value)<br />{<br /> <span style="color: #2b91af">StringBuilder </span>sb = <span style="color: blue">new </span><span style="color: #2b91af">StringBuilder</span>();<br /> <span style="color: blue">foreach </span>(<span style="color: blue">char </span>c <span style="color: blue">in </span>value)<br /> {<br /> <span style="color: blue">if </span>(UNRESERVED_CHARS.IndexOf(c) != -1)<br /> sb.Append(c);<br /> <span style="color: blue">else<br /> </span>{<br /> <span style="color: blue">byte</span>[] encoded = <span style="color: #2b91af">Encoding</span>.UTF8.GetBytes(<span style="color: blue">new char</span>[] { c });<br /> <span style="color: blue">for </span>(<span style="color: blue">int </span>i = 0; i < encoded.Length; i++)<br /> {<br /> sb.Append(<span style="color: #a31515">'%'</span>);<br /> sb.Append(encoded[i].ToString(<span style="color: #a31515">"X2"</span>));<br /> }<br /> }<br /> }<br /> <span style="color: blue">return </span>sb.ToString();<br />}</pre><br /><a href="http://11011.net/software/vspaste"></a> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com1tag:blogger.com,1999:blog-7691694.post-40682371747615391162010-04-19T14:12:00.001-03:002010-04-19T14:12:38.952-03:00My Run 2.0 samples<p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1LyNeVXu3q1AVTbK9eDFAYhyKFZAnzJkxNzy8-sU8CDRV6af3u7tIKJoa5YVwUXzpm_QNUJlgcAu___mVpp5PFfYLL8ZRvr-M2nmrKNp5EUuVtwPlAa9HQhShDvEG9I-yuY3iLg/s1600-h/annoysgomez%5B3%5D.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="annoysgomez" border="0" alt="annoysgomez" align="left" src="http://lh6.ggpht.com/_JH5-QZJMtzc/S8yPBHgpIoI/AAAAAAAAITU/W9eWAifHzx8/annoysgomez_thumb%5B1%5D.png?imgmax=800" width="244" height="162" /></a> Last week Run 2.0 took place in Montevideo and I had the privilege of working with <a href="http://twitter.com/guadacasuso">Guadalupe Casuso</a> (from Microsoft) and <a href="http://twitter.com/luispandolfi">Luis Pandolfi</a> (from Infocorp) on part of the Keynote, we talked about <a href="http://www.microsoft.com/windowsazure/windowsazure/">Windows Azure</a> and if you ask me it was too short. </p> <p>After the keynote I talked to some people who told me the session was great, but most of them already knew about Azure, so I guess I never know how good/clear was for someone new to the Windows Azure Platform (if you’re in this category please send me a line). One thing Guadalupe told us, and I guess she was right, is that there’s no point of showing something you can’t use yet… it’s like showing a kid a candy. I don’t know, but one thing I do know is that we could have use the entire conference to talk about Azure :)</p> <p>On my part of the session I had to show something on <a href="http://www.microsoft.com/windowsazure/appfabric/">ServiceBus</a> so I showed <a href="http://twitter.com/smarx">Steve Marx</a>’s <a href="http://blog.smarx.com/posts/annoy-smarx-com-letting-the-internet-choose-my-wallpaper">AnnoySmarx</a> sample. I changed a few thing from the listener, one thread would never end unless you close the cmd window, and added a few messages for demoing purposes. The sample is pretty cool cause it let you change the wallpaper of my computer by clicking the images from an online web page (in this case hosted on Windows Azure). For my sample I deployed the web app at <a title="http://gomezwallpaper.cloudapp.net/" href="http://gomezwallpaper.cloudapp.net/">http://gomezwallpaper.cloudapp.net/</a> and people from the audience would get online and click on the images while on the main screen you could see the wallpaper of my notebook changing. I was pretty cool and showed how you can get servicebus up & running with a little extra work from what you do to host regular WCF services. </p> <p>Another tool I used is <a href="http://storageexplorer.cloudapp.net">Windows Azure Storage Explorer</a> which I built myself to browse and manage items from a Storage Account. I recently uploaded the source code to codeplex, the project is <a href="http://storageexplorer.codeplex.com/">here</a>.</p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-56170004239641076562010-03-24T15:58:00.001-03:002010-03-24T16:00:31.309-03:00Goodbye trim()<p>I’ve been playing a bit the the RC version of the .net framework 4 and already found a new cool method.</p> <p>Until now when I wanted to check for a valid string I had to use the following code: </p> <p><span style="color: blue">if </span>(<span style="color: blue">string</span>.IsNullOrEmpty(text) || <span style="color: blue">string</span>.IsNullOrEmpty(text.Trim())) <br />    <span style="color: blue">throw new</span><span style="color: #2b91af">ArgumentNullException</span>(<span style="color: #a31515">"text"</span>, <span style="color: #a31515">"text is not valid"</span>);</p> <p>And I had to do that because a string containing nothing but white spaces was not valid and if you called the Trim() method on a null string you’ll get a <a href="http://msdn.microsoft.com/en-us/library/system.nullreferenceexception.aspx">NullReferenceException</a>, you know the message… (“Object reference not set to an instance of an object.”)</p> <p>So, the new cool method I found is a static method from <a href="http://msdn.microsoft.com/en-us/library/system.string.aspx">string</a> called <a href="http://msdn.microsoft.com/en-us/library/system.string.isnullorwhitespace(VS.100).aspx">IsNullOrWhiteSpace</a>. the name pretty much says it all, except that the real name should be IsNullOrEmptyOrWhiteSpaces ;)</p> <p>Instead of writing the code shown above, where you could easily forget the second condition, now you can have the same behavior in one single sentence:</p> <p><span style="color: blue">if </span>(<span style="color: blue">string</span>.IsNullOrWhiteSpace(text)) <br />    <span style="color: blue">throw new</span><span style="color: #2b91af">ArgumentNullException</span>(<span style="color: #a31515">"text"</span>, <span style="color: #a31515">"text is not valid"</span>);</p> Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0tag:blogger.com,1999:blog-7691694.post-33952505395983957262010-03-09T17:00:00.001-02:002014-02-08T17:00:48.687-02:00New features to the Azure Web Storage Explorer<a href="http://lh6.ggpht.com/_JH5-QZJMtzc/S5aaxA97ISI/AAAAAAAAISM/2cJKZ7tXR6E/s1600-h/storageexplorer%5B4%5D.png"><img align="left" alt="storageexplorer" border="0" src="http://lh3.ggpht.com/_JH5-QZJMtzc/S5aayFkYm2I/AAAAAAAAISQ/YokwRt_O9gU/storageexplorer_thumb%5B2%5D.png?imgmax=800" height="167" style="border: 0px currentColor; display: inline; margin-left: 0px; margin-right: 0px;" title="storageexplorer" width="240" /></a> <br />
On the first version you could only manage blobs, upload, delete and download them. Now I added the same functionality for Queues and Tables.<br />
I found a pretty cool way of showing unstructured data from the Azure tables from a gridview control. How? with my good old friends the DataSets :) <br />
I also updated the source code so you can download the source files from the version that it’s right now running on the Azure platform.<br />
Go to <a href="http://storageexplorer.cloudapp.net/" title="http://storageexplorer.cloudapp.net/"><strike>http://storageexplorer.cloudapp.net/</strike></a> to see the application running and <a href="http://code.google.com/p/windowsazurewebstorageexplorer/">here</a> to download the source code.<br />
Feedback is always welcome!<br />
<br />
Edit: url is now <a href="http://azurestorage.azurewebsites.net/">http://azurestorage.azurewebsites.net</a>Sebastián Gómezhttp://www.blogger.com/profile/07542900638025481334noreply@blogger.com0