Dalla Rosa

0 notes &

plist2ota - Generate OTA Manifests from plists

A friend of mine was in need of a script to automatically generate the OTA Manifests needed to distribute iOS apps internally through the iOS Developer Enterprise License

So I wrote a little Ruby script that uses the plist gem for creating a Ruby Array from the plists information. One limitation I found in the plist gem is that it can’t parse binary plists. Right now I’m working on implementing that in Ruby and see if I can get it added to the gem but, for now, I just added to the package this perl script I found, indicated by this page.

If your plist is a binary one, just convert the plist to XML using the plutil.pl script and then using plist2ota.rb to generate your OTA Manifest. 

The link is here: https://github.com/dallarosa/plist2ota

Requests, issues and sugestions, please use Github’s issues page :)

Filed under plist ota manifest apple ios development tech linux macosx ruby perl

0 notes &

CommandT and Ctrl+S on Mac OS X

One of the best plugins I’ve found for vim is CommandT.  It lets you open files in a very speedy and intuitive way, making it very simple to search files and open them in tabs, splits or vertical splits. Or so it should be. On OS X, opening a file on a new split doesn’t really work. You should be able to do it using the Ctrl-S shorcut but it just doesn’t work.

Today I decided to go after this problem. Looking around the net, I found an article explaining the reason:

 I found a related tip indicating that by default, Terminal.app reserves Ctrl-S for old-fashioned XON/XOFF flow control.

Ok, so the Terminal app doesn’t allow us to use Ctrl-S because it’s a reserved shortcut. What to do?

Simple, just add the lines below in your ~/.bashrc

stty -ixon -ixoff

It will disable the above behavior and free Ctrl-S and Ctrl-Q for use in terminal apps!

Reminder: Just adding that to your bashrc won’t change the settings in the currently open terminal windows. Type the command above on the terminal so you can have the benefits right now, or reopen all your sessions.

Filed under vim macosx commandt terminal tech programming

0 notes &

In the end, it’s all about DNA

Today, I want to talk about company culture, and the best analogy I could find was a child. So bear with me until the end and let’s us not deviate into the field of children psychology.

They way a child is raised by its parents is very important and decisive in its future. Children tend to take in account their parents tastes and way of thinking when molding their own and most of the we can say that they grown to be just like their parents were, for good or for bad.

I believe companies are just the same. The founders way of thinking, their DNA is gonna be what’s going to decide the way a company is going to develop in the future. That DNA will influence the hiring process, it will determine what’s going to be the primary focus of the company and in no time, that will take a life of its own it will become what people generally call the “culture” of the company.

In a house of teachers and academics, you can say it’s very probable that the children will tend to go the academic way and it’s fairly common to find that most singers and musicians were influenced by parents who played instruments or sang in the church choir.  You can see the same phenomenon with companies: The egocentric guy who had an interest in calligraphy and cared for the design of the things created the company that became known for it’s excellency in design and for it’s centrism. The two PhD guys who found a company who is known for it’s focus in engineering, research and experimentation. 

We inherit these ways of thinking and doings things from our parents, but once we’re grown and take our lives into our own hands we might think that maybe that’s not the way we should think, that’s not the way we should act. However, we also find out how hard it is to change our ideas and habits. It’s not uncommon to see cases of domestic violence involve men and women who were either victims or were witnesses of domestic violence in their own homes, by their own parents. In the same way, it’s pretty hard for a company to change its way after years of having a defined mentality. So, it can be very easy for a company who has been focused on sales and sales being it’s primary strength and focus for all its existence to say that it will become a technology company and will make its engineering task force in primary focus. However when that company doesn’t really have many people (or any person at all) with actual engineer experience and  focus in its decision-making department, as its leadership, that vision might as well be impossible, or at best very hard to implement.

I won’t say it’s impossible, nothing is. However, imagine how hard it is to act in a way that just contradicts what you’ve being told to be wrong, or at least not the most correct. Do I root for the Miami Heat or the Hornets? To I focus on sales numbers of technical excellency?  What’s my religion? Do I want a company known for its profitability or for being on the bleeding edge of technology, for offering the best environment for its engineering staff?

Google, Apple and Facebook are making the billions and everyone knows that but for most people in the tech world those companies are synonyms of “Engineering excellence”, “Design Excellence”, “Hacker culture” (Move fast, break things). So, whenever you’re invited to work for a company who doesn’t have an engineering history but who says that it wants to become a company for engineers, remember that in the end it’s its DNA who will really dictate how things work and make sure you understand what that will mean.

Filed under company culture tech

0 notes &

Code of the day: Circular shift for integers (python)

“x” is the number you want to rotate. “n” is the number of rotations you want to apply.
While writing this I actually felt how slow python’s math lib is. I’ve wrote this a while ago, but iirc a version I wrote using string operations was actually faster than this.
I managed to get to a pretty fast version later on but it involves caching all functions in local variables, replacing range with xrange and a bunch of other little improvements. I’ll keep this version because it pretty readable and it’s pretty self-explanatory on how to shift rotate numbers.
It was very fun trying to get every little millisecond I could from the code and I might just write a post on the differences of performance for each implementation I did.

def rotate(x,n):
  result = x
  mag_x = len(str(x))
  for i in range(0,n):
    mag_res = len(str(result))
    first = 0 if mag_x > mag_res else int(result/pow(10,mag_res))
    tmp = result - first*pow(10,mag_res)
    result = tmp*10 + first
  return result

Filed under code python math tech integer circular shift

0 notes &

I’m back! and Let’s talk about Rails

For some reason lately I don’t feel as productive as before. For some reason I don’t feel as motivated as before.

I’ve been giving some thought to that and I guess it’s because I haven’t spoken out loud about the stuff I’ve been doi.ng. 

I’m gonna keep this rant short so I get to the point. 

I plan on writing something on this blog every day.Yes. Every day. It can be something short, a memo to myself or some interesting tech news that I saw. I’ll also try to post code and talk about the projects I’m working on and the kind of difficulties I’ve been finding along the road.

As for today:

I’ve been re-reading the latest edition of “Agile Web Development with Rails”, based on Rails 3.2.6.(I bought the eletronic version which gives me free updates to the latest version). The book evolved a lot since the last time I checked it out. Tests became a main subject since the first chapters which makes the book feel much more solid and focused in turning you into a real ruby/rails programmer than just a person who can make a simple app in rails (A very common phenomenon with PHP “programmers” that just learned how to build a CMS from a bunch of tutorials and have no idea about testing.

Second topic of today is about a project of mine: A site to help people learn about algorithms and their implementations. This one has been taking a while mostly because I thought of making a website that would be an “authority in algorithms implementation”. However, I later realized that to do that I’d have to be an authority on algorithms myself, so I decided to go for a more realistic approach: This will be an website to track my studies about algorithm. A website that will improve together with me and the recommendations I get. It will be more about learning and transmitting that, rather than trying to pretend to be something I’m not. And as projects need dates and goals, I make it a goal to release this site in the next month, meaning till the end of September.

Here I start. Let’s see for how long I can keep up with this.

Filed under tech rails algorithms

0 notes &

A new resolution: No more 32 bit software for me.

10 years ago, when I started dabbling with linux and later decided to make it my main environment, there were things from the Windows world that I couldn’t let go. Be it games, tools, services. I would spend hours and hours trying to get Wine to work and to run those things I could’nt live without. Until one day I realized that…I could live without them. Since that day I decided that if a tool, a service, a game wasn’t available for Linux it wouldn’t exist for me. 

10 years later, I see myself having the same problem but now regarding 32 bit applications. My notbook has a 64bit processor and I decided to fully use it with the latest 64bit version of Slackware. However, lately I’ve been spending just too much time messing around with my machine to get full multilib support so to get a few a applications working properly (namely Skype) that I ended up having more trouble with conflicting packages then with a proper solution to the original problem.

That led me to a new resolution: I won’t use anything that doesn’t have 64bit support. 

I totally don’t mind compiling packages, I totally don’t mind making patches for stuff. I don’t mind writing my own stuff. However, closed source software, like Skype, don’t really allow me to do any of those things.  Skype 4 came and we still don’t have a package that supports 64bit Linux. So no more skype for me. I’ll still be using it on Android and on Mac but at the same time I’ll be looking for a different solution, one that can offer me a 64bit linux compatible solution.

Filed under linux skype 64bit 32bit software tech

4 notes &

Ruby is accepted as an International Standard

Ruby, the language created by Yuhikiro “Matz” Matsumoto in 1993 has been accepted as and International by the International Standards Organization (ISO) as the ISO/IEC 30170 standard.

The Information technology Promotion Agency (IPA) has developed the draft standard specification document of Ruby and it was registered as the  JIS (Japanese Industrial Standard) X 3017 on 2011.

Since 2008 a working group lead by Ikuo Nakata, professor emeritus of University of Tsukuba, has been working on an international standard for Ruby.

Ruby’s acceptance marks also the first time a language developed in Japan is accepted as an international standard.

Ruby was created in 1993 by Yuhikiro “Matz” Matsumoto with the goal of making programming fun[1]:

“I hope to see Ruby help every programmer in the world to be productive, and to enjoy programming, and to be happy. That is the primary purpose of Ruby language.”

My first contact with Ruby was almost 3 years ago, during my Master’s, where many of the students would prefer programming in Ruby, rather than the more well-known perl or python. The reason most fo them gave me is the abundance of documentation in Japanese, as it’s a made in Japan language. (I live in Japan) Under their influence I played a bit with it but nothing really deep. It’ wasn’t until 2010 when I decided to try Rails that I first started to study Ruby more properly. It’s expressiveness and ease of use really stand out. The flexibility given by the fact that everything is an object and the meta-programming features make Ruby a great language for fast prototyping.

This announcement comes together with Matz receiving the FSF’s 2011 Free Software Award.

Congratulations Ruby, congratulations Matz!

Here’s the original announcement, from the IPA (in Japanese):

http://www.ipa.go.jp/about/press/20120402_2.html

Filed under tech ruby programming language

0 notes &

Maximizing and restoring panes in tmux

Recently I gave up on screen for tmux. From the tmux homepage:

tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.

Tmux is screen on steroids. You can customize just everything, from starting applications automatically to the background color to the key bindings. The multi-pane temrinal thing is pretty cool but sometimes you just wanna focus and work in just one fullscreen pane while keeping the ability to switch back to the multi-pane mode.

Originally there are no bindings for (or a simple command) to maximize and restore the size of a pane.

After some googling, I found a perfect solution for the problem and I decided to share it with everyone:

unbind + 
bind + new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \; swap-pane -s tmux-zoom.0 \; select-window -t tmux-zoom 
unbind - 
bind - last-window \; swap-pane -s tmux-zoom.0 \; kill-window -t tmux-zoom

These will bind the “+” and “-” for maximizing and restoring, respectively. 

My own tmux.conf can be found on github.

(Source: superuser.com)

Filed under tmux terminal multiplexer linux macosx maximize restore