Mostrando postagens com marcador development. Mostrar todas as postagens
Mostrando postagens com marcador development. Mostrar todas as postagens

quinta-feira, 10 de janeiro de 2013

[Rails] Feedzirra and custom fields

When we read RSS on any programming language normally only the default fields are necessary, but sometimes a comment page link, a subtitle or other important info is stored into custom fields.

I was working with Rails and Feedzirra when this problem appeared to me and with the example+solution below I hope other people don't have to struggle much on this.



For a common rss you would use


And now the magic line to register article:subtitle...


So the final code should be



You can even map to field to same single resulting field, when you have two different sources with different subtitle fields for instance.



That solves the issue

sexta-feira, 14 de dezembro de 2012

Instalando PostgreSQL no Mountain Lion

Antes de tentar instalar o postegres eu recomendo tentar o postgresapp, rápido e fácil.

Documentação: http://postgresapp.com/documentation

Agora se você mesmo assim quiser instalar direto na máquina

Pré-requisitos:
Homebrew

No terminal rode uma linha por vez:
- brew install postgresql
- initdb /usr/local/var/postgres -E utf8
- mkdir -p /Library/LaunchAgents
- cp /usr/local/Cellar/postgresql/%versãodopostgresql%/homebrew.mxcl.postgresql.plist /Library/LaunchAgents/ launchctl load -w /Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Obs: substitua %versãodopostgresql% pela versão utilizada, ex: 9.2.2

Se o brew cuspir um erro de syslink como por exemplo esse:
Error: Could not symlink file: /usr/local/Cellar/postgresql/9.2.2/share/doc/postgresql /usr/local/share/doc is not writable. You should change its permissions.
Abra a pasta em questão e dê permissão ao seu usuário de escrita e leitura e depois execute:
brew link postgresql

Existe um fix necessário com relação ao socket para pg, execute os seguintes passos: - mkdir /var/pgsql_socket
- sudo chown $USER /var/pgsql_socket
- Abra /usr/local/var/postgres/postgresql.conf num editor de texto e descomente unix_socket_directory editando para unix_socket_directory = '/var/pgsql_socket'

Use o comando abaixo para rodar o server:
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
E esse outro para parar o server:
pg_ctl -D /usr/local/var/postgres stop -s -m fast

Se o server não conseguir desligar, descarregue o autolaunch e tente novamente: launchctl unload -w /Library/LaunchAgents/org.postgresql.postgres.plist

Se o psql --version for uma versão diferente da instalada então o Mac está usando o command line pré instalado do psql. Exporte o PATH no bash_profile para fazer com que o OS use o correto.
- Execute no terminal: open /.bash_profile
- Adicione a linha e salve: export PATH="/usr/local/bin:/usr/local/sbin:/bin:$PATH"
- Reinicie o terminal para que as configs estejam corretas

Pronto você já deve conseguir conectar no host com:
psql -h localhost -d "nomedobanco" (rodando psql -l é mostrado o nome do banco)

Quando conectado você pode executar comandos sql suportados pelo postgre e use \q para sair do console.

Baseado em Install Postgresql on Mountain Lion

terça-feira, 27 de setembro de 2011

iOS Quick Tip - Turning Off Automatic Reference Counting aka ARC

When developing your new apps under the newest XCode beta with iOS 5 you`ll get the ARC as gift, ok not a full git YET, but still a powerful gift.
So the question(s) arises: "What to do with code that isn`t under ARC yet?", "Can I turn it off?", "Can I turn it off only in a few files?"

Easy now, that is not a big trouble, I do hope that Apple engineering team improve this but for now let`s stick with what we got.

Turning ARC off for a new project (XCode Preview 7 onward *we hope*)

This is the easiest way, when creating a new project just check/uncheck "Use Automatic Reference Counting"


Turning it off for a few files
I`m personally not a huge fan of compile parameters but at least we have then when nothing else help us.
So open your project and select your desired target. Then select Build Phases, expand Compile Sources. There you`ll find the files that XCode is compiling, select everyone that will not use ARC and hit "enter". In the white box type -fno-objc-arc and hit enter. Done!



That`s all we need to stop using ARC in some of our project files, and whenever you change your mind just remove the flag.





sexta-feira, 17 de junho de 2011

Using mercurial and bitbucket for projects

People tend to look for alternatives to SVN, MS Team Foundation Server, Git and others.

One option is a combo of mercurial and bitbucket. 
Why mercurial? Because is similar to git, is easy to use even in terminal and works in linux, mac and windows. Why BitBucket? Because its free source code hosting that works with mercurial, accept up to 5 members, has no limits of private and public repositories and no limit to its size.

What do you need on windows?
Install Mercurial (If you`re going to install Tortoise HG you don`t need to download Mercurial and THG alone, there is a package with both at mercurial`s page)
Install  TortoiseHG
Have any doubts on how to use? Access this manual http://tortoisehg.bitbucket.org/manual/0.9/explorer.html

What do you need on macosx?
Install Developer Tools (If you already have xcode don`t bother about this item)
Install Mercurial
Install MacHG
If you want another diff/merge application try DiffMerge

I didn`t have used it on linux yet but it shouldn`t be too dificult, if you did it please let me know so I can update this post, thanks.

What do you need to do on BitBucket?
Set up your account
Insert an ssh key, there is a excelente post at github that show how to do this -> GitHub Help

Any doubts? Send it to me or use stackoverflow!!


segunda-feira, 2 de maio de 2011

Quick Tip - IOS DEV - UIColor

This is a good fast tip for ios newbies (like me)....I was trying to use UIColor to create a color with RGB values like this:

But this natural approach is wrong and if you read Apple class reference here (as I did) you probably will realize that each color must be between 0 and 1....what a damn confusion uh Apple...

For those that didn't realize it before just divide it by 255 and everything goes well:

That's it folks!!!

quinta-feira, 13 de janeiro de 2011

Coding what? Coding Dojo!!!

Since I started to participate in py dojo people I invited have been asking me what is a coding dojo? In the beginning I didn't have the right awnser  to this question but as I went trough the dojos this awnser became more clear in my mind.

The awnser to the question: What is a Coding Dojo?

Basically a coding dojo is a meeting of developers group where they solve problems together in an specific language. Is good to remember that the type of dojo I'm describing here is non-competitive and fun where any level of skill is permitted, as far as I know there are other type of dojos with different focus.

The objectives are: of course have fun; improve your skills in the language used, your team work and your brainskills to solve problems (normally they are quite challenging).

Ok then, but what is needed for a coding dojo? The minimum requirements are an PC or Laptop, a local for the meeting, a projector and a minimum of one developer with great knowledge for being the guru.

The master is the guy that guides the dojo and guides the group in moments of doubt about the language.

How the dojo is organized

Now we already know what it is and what is needed. The next step is the execution, it happens more or less like this:
  • 20 min for choosing the problem and the initial approach.
  • a quick lunch, like 10 min or less (is easier to think after you eat).
  • First part with a real action, 1st hour coding.
  • another quick lunch, more 10 min or less (just to take a breath, sometimes the group solved the first challenge at this point).
  • Second part with more real action, 40 min or so coding.
  • After finishing we do a quick retrospective about the session with the good and bad things. The tip here is to use a board and put post-its with + and - signs, people tend to feel more confortable writting than talking.

How to the code the code

The meeting is organized but how we're supposed to code is not. If my memories are ok at the dojo I'm participating we use Randori Kata which is a way of saying how things happen.
  • The problem is solved in pairs, like extreme programming, a driver and a copilot.
  • Everyone is invited to help on the right time (I'm going to get the list of rules and update here).
  • Each pair has a timebox to advance, 7 min works for us.
  • Use TDD and BabySteps, is hard I know but you'll have to give your best.
  • Every time a timebox ends the driver gives his place to the copilot and another person takes place as the new copilot.
Things that worked for us

Add a white board and post-its as requirements. The white board is used to solve the problem, remember the problem, to place the rules of the dojo and for the retrospective time when we place the posts-its with good and bad things.

Try to change where the meeting occurs, like three weeks in one company, other three in an university and so on. This is good for seeing new places and new people.

Also try to change the days of the week it occurs, one week on monday the other on wednesday and so on. This helps newcomers and members being more constant.

My vision

All this explanation and I didn't mention a single word about what I think. For me the dojo exercise/teach us some important points:
  • Problems are not always only a matter of language.
  • Playing as a team is important, but think as one is a learning process.
  • TDD, boy this skills is fun and good but hell is dificult to get used to.
  • You're not alone in the world, the exchange of knowledge is a must have, exercise it! (is good to meet new people)
  • Attention, if you don't pay attention you'll loose yourself in the process.
  • Oh and I can't forget the fact that we are increasing our skills in the choosen language.
  • Having fun!!!
These are just a few reasons for participating of a coding dojo, pick one and happy coding.
 
To end I must thanks Rodolpho and Chester for leading such a great group of python coding dojo at São Paulo, Brazil.

Welcome to Windows JRuby!!!! Painless Ruby in Windows????

I read an interesting and funny post about JRuby on Windows and an appeal to Ruby community to make nicer to develop Ruby programs in Windows.

The best thing about this post is the fact that he was originated from a member of the community, Engine Yard. Why this is so nice? I guess its because we devs should worry about creating a program in Ruby not in buying the best hardware to program into it.

I really hope that Ruby grows in such way that Windows market share turns a natural part of its actual market share. The painless part about Ruby, in this case JRuby, in Windows is not needing any pre-reqs installed, just run JRuby installer and go rocking the world creating Rails applications or Ruby GUI applications immediately, awesome isn't it?

quarta-feira, 10 de novembro de 2010

Ericsson Application Awards 2011

Que tal participar de um concurso mobile e ainda ter a chance de mostrar seu aplicativo para o mundo?
É isso que o Ericsson Application Awards 2011 da Sony Ericsson propõe. Junte entre 2 e 4 amigos, seus notebooks/pcs e suas IDE's e mãos à obra!!!!
Não se esqueça de seguir os critérios de avaliação o melhor que puder:
— Sua app deve ser baseada em 1 ou mais API's do Ericsson Labs.
— Inspire-se no tema “Connected Things”.
— Tenha um protótipo funcional de aplicação.
— A solução deve ser inovadora. (lembre-se nem sempre inovação deve ser criar algo que ninguém nunca viu antes)
— Tente manter um potencial comercial. (acho que esse é o mais díficil pois vai limitar algumas idéias)

 Não é mais um estudante? Não tem problema, tente convencer seu chefe a formar um ou mais grupos para participar da categoria para empresas (de até 100 funcionários), quem sabe não conquista mais do que o concurso?

E antes que você fale: "Ah mas não ganho nada?" aí vai a resposta, além da baita divulgação e espaço para fechar negócios você ainda pode ganhar 15000 euros.
 
Para maiores informações acesse os links:
Site Oficial: http://www.ericssonapplicationawards.com/
Overview: http://www.ericssonapplicationawards.com/overview
Regras: http://www.ericssonapplicationawards.com/rules

quarta-feira, 10 de março de 2010

Searching for labels in Team Foundation Server - TFS

In my new work I started to dealing with TFS Version Control programming in c#, for some problems you could use the microsoft library, for others you have to use the TFS Command Line Utility both in code.

Ok, some of you could ask me what is this Team Foundation Server?

It's the server storage for the version control of the Team Foundation Suite of Microsoft. The Version Control here is a combo, composed by Server (TFS) and (TFVSC).

While Team Foundation Version Control is equivalent to Source Safe, provided by Microsoft too there are other equivalents like Tortoise Subversion, a excelent alternative for those with no money to expend in the sooooooooo expensive Microsoft set of solutions.
But in the case of Tortoise you still need a server to host your files, for example assembla.

Ok enough of this small talk! got it?

In a certain point of the tool I was developing appeared a need to query the server for all the labels of a specific folder. You could use it to get files labels too.

So let's go to method that solved the problem =D.

That's it! Ask any questions that you need....

Here you could see a deep explanation about

That's all, hope you like it.

See you next time...

quinta-feira, 6 de agosto de 2009

MySql 5.1 doesn't work with Ruby!!

I'm starting to develop applications with Ruby On Rails, my enviroment is Windows XP and Aptana Studio 1.2 or Netbeans 6.7, I'll talk about the IDE decision in other post.

Ok so I was reading my ebook, Simply Rails 2 by Patrick Lenz, I got it via email given by the editor's website, and I started to see the chapter about database interaction. When the command db:migrate was executed in the ruby console it returned the following error: "undefined method `each' for #"

First thing to do was to google the error rsrsrsrsr and after a little while in the web, something close to 30 min, I found one solution and one reason to the error.

The reason for that error to happen is that ruby 1.8 and 1.9 are still compiled to work with MySql version 5.0, they say that it might work with latter versions but that isn't my case =[.

So you have some ways to work it around:
First: Roll back your MySql version to 5.0 or earlier. Not a good one, but works.
Second: Put Instant Rails libmySQL.dll file into your ruby/bin directory. Save the old one for eventual needs. That's the one I used and works pretty well with MySql 5.1 and 6.0, at least until now.
Third: Choose another database, okay this isn't the best one but if anything else doesn't work at least there are another databases that are compatible with ruby.

If you have some work around for this problem too please feel free to comment here, or send it to my email vitor.navarro87@gmail.com and I'll make a post with your email in my blog =].

Hope this save others lives to.....