- Thursday: Hardware Hacking Meeting today in this room @ 12:30
I’ve been trying to learn RubyMotion recently, using Ruby to develop iOS appeals to me.
I have no prior Objective-C or Cocoa API knowledge besides the basic HelloWorld. I’ve been using this tutorial and have learned more about Cocoa API faster using Ruby than with Objective-C. There is less boilerplate code that needs to be written for defining interfaces and implementations.
The main takeaway of RubyMotion is that it is not your standard Ruby implementation. It is a Ruby runtime wrapped around the Objective-C runtime. All Ruby objects map directly to there corresponding Objective-C object — Array to NSMutableArray, Hash to NSMutableDictionary, etc. RubyMotion does not come with the standard library as other flavors, you are relying on Cocoa API as the standard library.
There is even a difference in Ruby syntax to map directly to Objective-C. The Objective-C language does message passing for “method invocation”. This means that a method call on an object is determined by parameters rather than just method name. RubyMotion had to include this language feature, so you will actually see Ruby that is invalid all other Ruby flavors.
class MyObject def doSomething(doSomething, argument: argument) end #This does not override the method defined above def doSomething(doSomething, anotherArgument: argument) end end
Luckily there are extensions for your favorite editors. Rubymine even supports MacRuby syntax, but does not support autocomplete, yet.
Two weeks ago, I saw a talk about RubyMotion from its creator in Berlin. He gave the basic HelloWorld demonstration, but also gave an introduction in the community. It is small, but great things are coming out of it.
The community has started taking the power of Ruby and making the libraries and DSL-y things we love in Ruby.
With all this, there is one question that always gets asked. Is RubyMotion worth it? Yes! Laurent, the creator, is in it to win it! This is why he charging for the RubyMotion; funding ensures that he can continue to work on it.
RubyMotion comes with a prebuilt RSpec (actually a port of bacon) like testing framework. The testing framework supports the testing of views and controller using the UIAutomation framework. I think that we can agree that it could be better, but I believe there is enough to get started and allow us to expand on it.
The RubyMotion community is still growing. I look forward to see what comes out of it, so that I can use Ruby in other devices.
Some pivots have experience with this working pretty well!
Draper/CI Reporter wasn’t our problem. Not entirely sure what was – but signs point to a Spork/ResqueSpec loader order problem on Linux only.
Sometimes when you’re paginating you have to run 2 queries, one for the first n records, and another for the total count.
It’s possible to get both in one query using OVER().
SELECT , COUNT() OVER() as total_count FROM blog_posts ORDER BY created_at DESC LIMIT 25;
Each record will come back with a total_count attribute, so you will have to look at one of the records to figure out the count.
To get into the spirit of working with the framework, read about Xtuple’s recent experience at http://www.xtuple.org/node/5000 and be inspired by the ease of Enyo!
Eventbrite Invite: http://enyobootcampnewyorkcity.eventbrite.com/
It looks like there’s a lot of them – does anyone have any personal recommendations?
This goes back to the Help a couple of weeks ago re: JSON being undefined. We blame Draper & its RSpec integration, but don’t yet have a solution.
Eager loading doesn’t happen from rake tasks. This causes a problem if you are running in thread safe mode and dependency loading is disabled.
But until that is released, you can possibly branch your thread safe declaration on the existence of the $rails_rake_task global.
Come and talk about programming, and other aspects of XP. 6:30pm
It can be stifling to jump into a big project as a new user or team member, you don’t want to accidentally delete stuff, reprioritize iterations etc. We’ve got you covered; try out a sample project. We designed this on purpose as a sandbox for people to poke around and build. Check out this short screencast for a quick demo of how to start a sample project and a few things you can do within it. Create, explore, and don’t be afraid to get lost.
Here’s the breakdown if you don’t want to watch the video.
Clones and inits and updates all the submodules.
https://github.com/conversation/chrome_debugger seems like it will be useful for something.
Any tips for reading HttpPerf?
LogReplay, any good gems or tips to replay requests from server logs?
Jeff dean mentioned some strategies dealing with week based reporting, and the oddities that arise when week 0 bleeds into the next year.
Week number: The week 1 of YYYY starts with a Sunday or Monday (according to %U or %W). The days in the year before the first week are in week 0. %U - Week number of the year. The week starts with Sunday. (00..53) %W - Week number of the year. The week starts with Monday. (00..53)
:eq(n) pseudoselector gives you a single element that is at index
n out of all matched elements. While this is certainly a useful selector to have, it’s unfortunately not supported in standard CSS. If you find yourself repeatedly using
:eq in your jQuery code, be careful that you are not relying too heavily on
:eq to the point where your styles are difficult to match in “pure” CSS.
If we were to express
:nth-child in terms of the
:eq selector, it would be like using
:eqscoped to all of the immediate descendant contents of a single element. Or in my own words,
:nth-child adds a constraint to the selector that the matched element must be the nth element in its parent container.
So if we had a snippet of HTML like
<div> <div id="bar1" class="foo"></div> <div id="bar2" class="foo"></div> <div id="bar3" class="foo"></div> </div>
Then the selector
.foo:nth-child(2)will match the div
#bar2. If we insert another element at the front of the container:
<div> <p>Shift!</p> <div id="bar1" class="foo"></div> <div id="bar2" class="foo"></div> <div id="bar3" class="foo"></div> </div>
And again we select
.foo:nth-child(2), we match the div
#bar1 because the 2nd child of the container also matches
Thus, in this second example, if we try
.foo:nth-child(1) or the equivalent
.foo:first-child, we will not match any elements because the first child element in that container — the
p tag — does not match
:nth-child can match children in multiple containers. In the HTML snippet:
<div> <p>Shift!</p> <div id="bar1" class="foo"></div> <div id="bar2" class="foo"></div> <div id="bar3" class="foo"></div> </div> <div> <div id="quux" class="foo"></div> </div>
.foo:last-child will match the divs
.foo:nth-child(1) will only match
#quux because the first child of the first container is, again, not a
Correlating debugging errors to source files.
Currently using Sprockets template name in-lined. Any better solutions?