Getting navigation bar to look good in iOS 7
Apple has recently released iOS 7—a major upgrade to its operating system for mobile devices. Whether users like it or not—developers have to treat it seriously. There is nothing worse in the world of technology than being viewed as passé.
From the point of view of users, the new look and feel resembles somewhat the overall movement in the user interface design. The flat UI style is the new hotness nowadays.
On the developers’ side of the fence though, this means lots of hard work. Apple has introduced lots of changes so that many iOS apps had to be changed and even redesigned to look acceptable in iOS 7.
Some applications have already dropped support for older versions of iOS
One of them is… Evernote! Its team has decided that supporting older systems would be too costly and that they have decided to dump it. The only way to have the Evernote app is to have it installed before the release of its latest version.
The troublesome navigation bar
One issue I encountered while working on an iOS app lately was that the app started to display oddly. The top bar was overlapping with the contents of the views.
The reason is because now the top bar overlaps with the UI underneath. …
ios
3 common misconceptions about Ruby on Rails
1) Rails is easy to learn.
Rails has a steep learning curve and that’s never going away. From the beginning it was conceived of as an advanced tool for experienced web developers and having a low cost of entry for beginners is not part of the Rails way. Rails makes web development faster by depending on conventions that the developer needs to learn and utilize. There are a lot of these conventions and for a beginner the cost of learning them will be extremely low throughput initially. However, the investment pays off much later down the road when the throughput skyrockets due to familiarity with the framework. Another overlooked thing that makes Rails development hard to learn is that there is a lot more to learn than just Ruby and Rails, there’s also things like source code management, databases, front end servers, testing and while these subjects are common to web development in general, you’ll still need to learn the “Rails way” to approaching these satellite concerns that make up a typical production application. Brook Riggio created this fantastic chart that shows all the subjects that a Rails dev needs to be familiar with in the excellent article “Why Learning Rails is Hard”, …
rails
New Kamelopard version
I recently pushed new Kamelopard version (v0.0.14), and thought I should briefly mention it here. This release includes a few bug fixes, including one that fatally affected several v0.0.13 installations, but its major improvement is a greatly expanded test suite. For quite some time many Kamelopard functions have had only placeholder tests, marked as “pending" in the code, or no test at all. In particular, this includes many of the more complex (or in other words, difficult to test) functions. Version 0.0.14 added 35 new tests, including for the frequently used orbit() function as well as for the relatively new multidimensional function logic.
The typical Kamelopard test creates a Kamelopard object, test that it responds to the right set of methods, renders it to KML, and finally inspects the result for correctness. This can quickly become complicated, as some KML objects can take many different forms. Here are a few selections from one of the new tests, as an example. This is for the ColorStyle object, which is an abstract class handling part of the options in other style objects.
This first section indicates that this test includes several other tests, defined elsewhere. …
kamelopard visionport ruby open-source kml
Python decorator basics
Python decorators have been around since 2005, when they were included in the release of Python 2.4.1. A decorator is nothing more than syntax for passing a function to another function, or wrapping functions. Best put, a decorator is a function that takes a function as an argument and returns either the same function or some new callable. For example,
@foo
@bar
@baz
@qux
def f():
pass
is shorthand for:
def f():
pass
f = foo(bar(baz(qux(f))))
Say we have some functions we are debugging by printing out debug comments:
def mul(x, y):
print __name__
return x*y
def div(x, y):
print __name__
return x/y
The printing in the functions can be extracted out into a decorator like so:
def debug(f): # debug decorator takes function f as parameter
msg = f.__name__ # debug message to print later
def wrapper(*args): # wrapper function takes function f's parameters
print msg # print debug message
return f(*args) # call to original function
return wrapper # return the wrapper function, without calling it
Our functions get decorated with:
@debug
def mul(x, y):
return x*y
@debug
def div(x, y):
return x/y …
python
Managing Multiple Hosts and SSH Identities with OpenSSH
When I started working at End Point I was faced with the prospect of having multiple SSH identities for the first time. I had historically used an RSA SSH key with the default length of 2048 bits, but for my work at End Point I needed to generate a new key that was 4096 bits long.
Although I could have used ssh-copy-id to copy my new SSH public key to all of my old servers, I liked the idea of maintaining separate “personal” and “work” identities and decided to look for a way to automatically use the right key based on the server I was trying to connect to.
For the first few days I was specifying my new identity on the command line using:
ssh -i .ssh/endpoint_rsa patrick@server.example.com
That worked, but I often forgot to specify my new SSH identity when connecting to a server, only realizing my mistake when I was prompted for a password instead of being authenticated automatically.
Host Definitions
I had previously learned the value of creating an ssh_config file when I replaced a series of command-line aliases with equivalent entries in the SSH config file.
Instead of creating aliases in my shell:
alias server1='ssh -p 2222 -L 3389:192.168.1.99:3389 …
devops hosting ssh
An update to the email_verifier gem has been released
I have just released a newer version of the email_verifier gem. It now supports Rails localization out of the box.
If you are one of gem’s users—you can safely update your Bundles!
With this release, the project has also gained its first contributors. Some time ago, one of gem’s users—Franscesco Gnarra has asked me about a possibility of having validation messages localized. While I was planning to do it myself—Francesco took an action and contributed to the project himself.
The project also received a pull request from another Rails developer—Maciej Walusiak. His commit provided a way to handle Dnsruby::NXDomain exceptions.
It’s great to see that our work is helpful for others. If you’d like to contribute yourself—I invite you to do so.
Email verifier at GitHub: https://github.com/kamilc/email_verifier
email open-source ruby rails
A review of The Rails 4 Way
With a brand new project on the horizon (and a good candidate for Ruby on Rails 4 at that), I thought it would be a productive use of my time to bone up on some of the major differences introduced with this new version. My goal was to trade a little research for as many precluded that’s-not-how-we-do-it-anymore-500-errors as I could when fleshing out my first scaffold.
With this goal in mind, I purchased a copy of The Rails 4 Way by Obie Fernandez, Kevin Faustino, and Vitaly Kushner. Considering the free-nature of everything else Rails related, I will admit to a slight aversion to paying money for a Rails book. For those of you out there with similar proclivities, I felt compelled to share my experience.
The Rails 4 Way presents itself not as a tutorial of Ruby on Rails, but as “a day-to-day reference for the full-time Rails developer.” The tone of the book and the depth of information presented hints that the authors don’t want to teach you how to write Ruby on Rails applications. They want to share insight that will help you write better Ruby on Rails applications. Much of this is accomplished by fleshing out—utilizing a plentiful source of examples and snippets—the methods and …
books rails
How to Enable MySQL Event Scheduler
You may think that you already know what’s the opposite of “DISABLED”, but with MySQL Event Scheduler you’ll be wrong.
In fact MySQL Event Scheduler may have three different states[1][2]:
DISABLED - The Event Scheduler thread does not run [1]. In addition, the Event Scheduler state cannot be changed at runtime.
OFF (default) - The Event Scheduler thread does not run [1]. When the Event Scheduler is OFF it can be started by setting the value of event_scheduler to ON.
ON - The Event Scheduler is started; the event scheduler thread runs and executes all scheduled events.
So if you’re going to find it in the DISABLED state and instinctively set it to ENABLED you’ll end up with a non-starting MySQL daemon.
Be warned and stay safe out there!
[2]: When the Event Scheduler is not running does not appear in the output of SHOW PROCESSLIST
database mysql