Logo

TrafficDito Blog

  • Random
  • Archive
  • RSS
  • Ask us anything!

TrafficDito Version 1.3.0: NB? EB? OMGWTFBBQ!

With March just right around the corner marking the beginning of the summer months, expect more of the blazing afternoon heat we’ve been experiencing these past few days. Not really being huge fans of being outdoors, this just meant more time for us to stay indoors and work on TrafficDito! LOL. The latest version of the iPhone app is live and ready for download on the App Store, still for the low low cost of… absolutely nothing!

Roads Ain’t All North or South

To say that Metro Manila’s roads are confusing is an understatement. While most of our main roads head either northbound or southbound, some of you guys have pointed out that there are a couple of ‘em where it wouldn’t make sense to say you’re headed in either direction.

Worry not then, fellow traffic-haters! We’ve tweaked the TrafficDito app to reflect Northbound/Southbound along roads like EDSA, C5, Commonwealth, etc. and Eastbound/Westbound along Ortigas, España, and Shaw Blvd., among others. Even along those winding and zig-zaggedy roads, the new compass should be able to detect your bearing without any problems!

Compass Confusion?

“Nasa C5 Libis na ako papuntang Ortigas pero BV yung traffic!”

We also realize that all these NB/SB/EB/WB acronyms can become a pain sometimes. For all the directionally-challenged out there, we’ve also changed the way TrafficDito spells out where you’re headed. The TD app now indicates the next major intersection or area you’re headed towards. If you report on the app, instead of “C5 Libis SB” for instance, it’ll now show “C5 Libis SB to Ortigas” on both the app and on TrafficDito.com’s stream. Awesome. Now I don’t have to use the sun to show me whether or not I’m headed east or west.

So make like a traffic ninja and head on over to the App Store and download the latest update or the TrafficDito app if (for shame!) you haven’t yet!

Also, don’t forget! After the recent launch of The AralDito Project, every single one of the reports you make on the TrafficDito app count for a P5 donation from us to the Tulong Dunong Foundation Inc.’s scholarship grant. Help send a teen to school just by reporting traffic. :)

-EJ, Product Marketing Padawan

    • #TrafficDitoUpdates
    • #SoftwareDevelopment
    • #ProductDesign
  • 1 year ago
  • Comments
  • Permalink
  • Share
    Tweet

The TD Team’s Must-Have Tools for Web Development and Collaboration

Being a web developer is tougher than most people think. Not only does it require you to work with rapidly evolving technologies such as databases and web frameworks, it also requires you to communicate effectively with other functional teams. As an agile team, we strongly agree that effective communication and collaboration plays a huge role in a project’s success.

Thankfully, we have tools to make our lives a lot easier, tools that over the years, have gotten better and better. Here are the tools we believe to be extremely useful for web developers, not only for programming but also for collaboration.

TextMate

Known as “The Missing Editor for Mac OS X”, TextMate is considered one of the best editors for Macs. It’s a lightweight editor that boasts of a lot of useful features, such as fast switching between files, foldable code blocks, the ability to run shell commands from within the document, and a whole lot more.There are also a lot of bundles and plug-ins that can save you time and effort when programming.

An example is the Git bundle which allows you access to common git commands without leaving your editor. For our project, we found the rspec and cucumber bundles convenient because they provided shortcuts for writing test examples and switching between spec and code files.

The downside to TextMate is that it’s exclusively for Mac. If you’re using Windows, you might want to check out E-TextEditor which claims to be similar to TextMate and has support for TextMate bundles. For Linux users, check out Redcar. It also has support for TextMate bundles. Oh, and it’s free.

Firebug

If your work often involves the frontend, this tool can’t be left out. Firebug is a very popular and powerful tool for Firefox browsers. It allows you to modify markup, style, and layouts in real time, which really speeds up making changes to the UI. It also has a JavaScript debugger, which allows you to measure the performance of your scripts, use breakpoints in debugging, and check your AJAX responses.

Take note that there’s also an extension called Firebug Lite for Google Chrome, which is a bit different from Firebug in that it has a couple of limitations such as not having the Javascript debugger. So if you’re using Chrome, you might be better off using the built-in “Inspect” tool under its developer tools, which is very similar to Firebug.

Photoshop

If you think being a web developer is all about backend stuff, you’re seriously mistaken. It’s pretty common that developers have to design the frontend based on some mock-ups from the user experience team. Naturally, this calls for an image editor, the obvious choice being Adobe Photoshop.

In our experience, we spend a fair amount of time slicing images and inspecting font styles from PSDs. Getting Photoshop is a little pricey, but if you plan to do a lot of UI stuff, it’s definitely a wise investment. If you’re really on a tight budget though, you might want to take a look at Gimp, a free image editing software that supports PSDs.

Basecamp

Basecamp differs from similar project management tools with its focus on improving collaboration through communication, rather than statistics, charts or graphs. Having managed over 4 million projects with a 98% satisfaction rate, it’s a project management tool that’s hard to ignore.

One look at the interface and you’ll notice how simple and attractive it is. I think that this is actually the best feature of Basecamp, the fact that it’s so simple, you really don’t need to have any prior experience to get the hang of it.

We use Basecamp for pretty much everything, from user experience debates, to programming discussions, even marketing campaigns and strategies. It’s also effective for communicating whatever problems we have and asking for other people’s opinions.

For the development team, we use Basecamp as a knowledge sharing tool, posting useful articles and presentations. We also post problems on it so other team members can collaborate to solve them. Having everything on Basecamp is useful for times when similar issues pop up, because then we always have previous references to look back at.

Campfire

Most of us still use IM clients like Skype or Y!M as our first option when talking to individual teammates. These tools are undoubtedly very handy and easy to setup but are sometimes lacking when it comes to communication within groups. This is why we use Campfire, which is like a chat room, designed specifically for teams.

One of the main advantages of using Campfire is that you can share files and code in real time. This makes it a lot easier to share information since you no longer have to manually send a file through other mediums such as email. It also allows live image previews, conference calling, and is integrated with Basecamp. If you’re a fan of emoji, some of them are also supported in Campfire, which makes things a little more fun. For your viewing pleasure, you can refer to this cheat sheet.

Within our team, we have members working from different locations, so having Campfire is super handy, especially if you need something right away. As an agile team, we also do our daily stand up meetings on Campfire.

Propane

Propane is a nice little Campfire Mac-client with a neat interface. It compliments Campfire nicely and is extremely helpful if you do a lot of drag-and-drop operations. It lets you customize notifications, even with Growl support, so you can set priorities on which messages are most important. All these features mesh well together to make sure you don’t miss a thing.

From our standpoint, these are the tools that really keep us working efficiently and cohesively as a team. Do you have any other suggestions, perhaps something your own team uses? We’d love to hear about it in the comments below!

-Gerald, Software Bear

    • #SoftwareDevelopment
  • 1 year ago
  • Comments
  • Permalink
  • Share
    Tweet

Developer Quick Tips: Awesome Print

Debugging can be pretty tough. As developers, narrowing down to the problem becomes a continuous exercise of patience as we inspect all sorts of objects at each and every step until we find what’s wrong. Staring at a cluttered screen littered with unformatted hashes, objects, and structures can be a bit overwhelming for most of us. And the worst part is that it’s all in monotonous black and white. Why does it have to be such a pain to look at?

Well, it actually doesn’t, and it’s all because we have Awesome Print. Awesome Print is a ruby gem that allows printing Ruby objects in full color. It’s just like using p or pp, but much better. Using ap lets you see your objects with proper indentation, shows you the index of array elements, and displays output in full color.

To start using Awesome Print, just type in gem install awesome_print on the console, or insert gem "awesome_print", "~> 1.0.2" in your Gemfile if you’re using Bundler. That’s all you have to do to start using ap!

Using Awesome Print is super easy. Like I said earlier, just use it as you would ‘pp.’ Yup, that’s it. Try it out in irb: type in require ‘ap’ and use ap<object>. In my case, report is a hash containing report information. It should look something like this:

Now, isn’t that better than using pp?

And if you’re one of those people who love to customize their tools, you can also pass multiple options to ap, such as indent, limit, and color. For example, if you want the indentation to be 4 spaces, and the color of strings to be cyan, you can do something like this:

ap report, :indent => 8, :color => {:string => "red"}

And there you have it, your very own customized output!

We found using ‘ap’ extremely helpful while building TrafficDito. We would frequently inspect report and user objects, which meant looking at them properly indented and fully colored made ‘em so much easier to read. It’s probably saved us from a lot of headaches and eye strain since we started using it.

For anyone who finds reading plain text in the console difficult, I highly recommend Awesome Print. Next time you find yourself in a debugging session, make sure to give it a try!

You can find more information regarding the gem and the available options at Github.

- Gerald, The Software Bear

    • #SoftwareDevelopment
  • 1 year ago
  • Comments
  • Permalink
  • Share
    Tweet

Automated iOS Testing for the TrafficDito App

Automated testing. It’s something we’d come to love about Rails. And as part of our Agile regimen, it was a necessary part of moving forward into the world of mobile. Unfortunately, the topic isn’t heavily discussed amongst iOS developers so it lead to a lot of time going back and forth on how best to achieve the end goal: being able to prove our changes work and at the same time making sure we didn’t break anything along the way.
 
In a series of posts, we’ll show you what we went through so that hopefully you don’t have to. We’ll investigate the options out there, what we settled on for TrafficDito, and finally show you how to use these tools for max profit. Let’s get started.
 
Iteration Zero: How the heck are we gonna do this? 
 
Testing is so important to us that we spent the first full week of the project just trying to research the tools and figure out which would be the the best for us.
 
We broke it down first. What tools do we need? From Rails, we knew of Cucumber and RSpec. Acceptance testing and unit testing, respectively. The former testing the business needs and ensuring all the code works in unison, and the latter testing the nitty gritty details as well as driving the actual design of our code.
 
As the subject matter for this post, we’ll focus specifically on acceptance testing, as it’s the first step in Behavior Driven Development.
 
Acceptance Testing
 
We wanted to test specifically as a real user would use our app just to ensure that it would always work. To show you what we mean, let’s take a quick peak at a little video.

Here are two of the scenarios we run from our full test suite. When a user taps Report, then they should see the report modal. And then when they tap on the moderate traffic condition, it should show in blue. And finally, when they tap “Report It,” they should see a loading screen, followed up the report showing in the stream. Then the same thing again, only from the map.

 
In the Rails world, this kind of testing was always best laid out in Cucumber. The programmer can write out their expectations simply in a language called Gherkin that matches up pretty well with English (or even Tagalog if you’re ambitious enough). That seemed like a good start for our research which led us to Frank.
 
Frank
 
Frank was exactly what we were looking for. Cucumber syntax that drives an iOS app through a little server on the device. We could write our expectations in Gherkin, write our step definitions in Ruby, and watch it all happen on the device. Word of warning, if you’re not familiar with Ruby, then you may be out of luck (or you can use this as an opportunity to learn something new).
 
Getting it all set up was the first hurdle to jump. Being our first week into Objective-C land, that may have played a part in the difficulty. Their documentation and setup tutorial was (and subsequently, as of this writing, still is) out of date. It left a lot for us to figure out. After several confusing hours, we got the thing to compile, but that was just the first step. Next up, getting Cucumber and Ruby to talk to Frank.
 
Back to the fighting. Things seemed like they were out of date yet again. The default Ruby steps didn’t work for us, and sifting through the documentation and code didn’t produce any immediate solutions. We decided to ask ourselves if this was the best approach, or if there was something better.
 
We saw a few other projects out there. UISpec (which Frank was built off of), KIF, and then we saw Apple had something much to our needs. UI Automation.
 
UI Automation
 
Now this was beautiful. No, it wasn’t Kim Chiu or anything like that. Just elegant. Apple’s own way of automating and testing a user interface.

It wasn’t… although I kind of wish it was.

With UI Automation, you write your tests in JavaScript. If you don’t know it, don’t worry, it’s such a simple language to pick up. There’s plenty of API documentation, just very little in the way of useful examples. But we were determined. After all, if Apple provides it, it must be the best thing.
 
With iOS 5, Apple added the ability to run the scripts from the command line. It still wasn’t anything like Cucumber, but we set out to fix that. We wrote a small wrapper that integrated Cucumber with UI Automation. If you can’t find the right tools, then make your own, right?
 
You’d write Gherkin. That’d compile a JavaScript file for you, and it’d output much like Cucumber does. This worked pretty well for several weeks. For your standard interactions with an iOS app (tapping, data entry, looking at the screen) it was exactly what we needed. And at the start of the app, that’s all we did: basic interactions.
 
Right off the bat, we noticed it was difficult to actually access things on the screen. You had to know the hierarchy of the views. You can’t just say “wait until I see ‘Report Sent’”. You have to know where it is you’re expecting to see that. What’s that a subview of? Is that a subview of something else?
 
These aren’t ideal things for acceptance tests because the hierarchy can and will change. While the output may be the same, the structure behind it will change (assuming you’re refactoring your code as you work). Tying your acceptance tests to your code in this way isn’t good. But that wasn’t the deal breaker for us.
 
The deal breaker came with the pull to refresh feature. Simple enough, right? You just tell UI Automation to swipe down a bunch until you see the little arrow thing, right? Now, where’s that swipe method? Wait… There’s no swipe method? Ok. I’ll be creative. Tap here, hold down, and release here. Wait. That’s not doing anything. It’s stopping once it reaches the top of the view, it won’t let me go out of bounds. Err.
 
This is UI Automation’s biggest flaw. It works great for standard interactions, but once you do something tricky, you’re stuck. There’s no way to reach into your app’s code and tell it to do something that you can’t do from the JavaScript API. And that’s a flaw inherent of Frank and UISpec as well. They exist outside your application’s code, so if there’s something you want to do, you either have to give up or do a bunch of creative stuff.
 
One solution we read about was adding buttons that would only show for the acceptance test build. Then, when that person needed to do something non standard, they’d tap that button to make it happen. That’s not very ideal. You’re cluttering your code base with a bunch of #ifdef things all over the place. No longer Kim Chiu-esque.
 
So while UI Automation has a lot of promise, it’s not there yet. But at least we found a new driving need, and thus, we could reconsider the options and see which tool best fit our new criteria. That led us back to KIF.
 
KIF
 
KIF is awesome, and so far, it’s worked exactly as we needed. It’s built by Square, a company that makes its living off iOS, so the support should be what we need. And it’s all written in Objective-C. It exists as a bundle with your app, so you can really tell things to do what you want when you want. Their documentation is up to date, and it has pictures! Oooh, pictures.
 
The downsides? It’s written in Objective-C. If we wanted the cleanliness and elegance of Cucumber, that’s gone. Only programmers can read that stuff.
 
And it’s out-of-the-box steps are not ideal. They work for what you usually need to do, but the naming… Come on… -stepToWaitForTappableViewWithAccessibiltyLabel: basically translates to “can I see it?” Their other basic step, -stepToWaitForViewWithAccessibilityLabel: doesn’t guarantee you can actually see anything, it’s just there…somewhere. It may be behind something (like a modal view).
 
So back to our pull to refresh problem. KIF allows us to get at specific elements through accessibility labels (just like all the others). But at least now we can interact with them. So we told the table view in question to scroll to a Y value of -70 and then continue on with the next step. Problem solved in just a few minutes, versus the hours we spent fighting with UI Automation. If only we were Pacquio, we’d knock these problems out faster.
 
And the final praise to give to KIF would be this: now that we’re inside our application’s code, we have so much more control over the testing. Cucumber and Rails work nicely together because, when needed, they can hack away at each other. Think of integration points. If your Rails app talks to a third party service, you use something like VCR and Webmock to prevent your app from actually sending those requests. With KIF, we can do the same thing. When we went to test the integration with Twitter, we stubbed out the lowest level methods we could find and forced a specific response. No need for some proxy setup, and no annoying our legions of followers with a bunch of dummy tweets when we run the test suite. Though maybe seeing us work so hard makes you feel better about the traffic you’re stuck in.
 
The Solution?
 
For automated acceptance testing, KIF worked best for us. And it may work best for you too. It certainly is the most flexible when you need it to be, it’s just not as elegant and easy to understand as the others.
 
But where do we go from here? With BDD, acceptance testing is only the first part of the problem. We can ensure our features work, but what about the actual code itself? What’s going to drive our code design and prove all the little edge cases of our methods? That’s where unit testing comes in, but that’s a story for another day… Until then.

-Stephen, Coke Zero-addicted coder
    • #SoftwareDevelopment
  • 1 year ago
  • Comments
  • Permalink
  • Share
    Tweet

Pimp My App: TD Gets Tricked Out!

TrafficDito is rollin’ out with some brand new rims, a shiny new paint job, and enough upgrades to make even Xzibit flip out. TD got a major tune up with its update, and is looking pretty slick - ready to hit the streets of Metro Manila!
 
Over the past couple of weeks, our crew of code monkeys have been hard at work on the app. We’ve streamlined the user experience for y’all and also made reports more comprehensive and detailed. Of course, our developers couldn’t help but throw in another Easter egg in the mix. See if you can find it! (Tweet us if you need hints!)
 
You can find this app update on the App Store right now! Give it a try if you haven’t already, and check out TrafficDito’s awesome new features. Here’s the low down on a few of the changes you’ll be seeing:
 

1. Tweet out your traffic reports!


 


We’ve integrated Twitter into the way you report! Tapping on the Twitter button on the report screen means TrafficDito automagically tweets out all the details from your traffic report. This means that you get to share the good stuff with your followers who aren’t on TD. They get your real-time traffic updates on their Twitter feeds! That’s an easy 1 million good karma points right there. Next time you feel like ranting about traffic on Twitter, do everyone else a favor and do it through TrafficDito!
 

2. NB/SB? OMG!


 


With your iPhone’s handy-dandy compass, TD now includes the direction you’re facing in its reports. Yessiree, you will now see NB or SB in your reports! Don’t worry if you’re the directionally-challenged type, the app does all this for you!

3. No 3G? No worries!



If you don’t enable 3G/mobile internet on your iPhone, we’ve got you guys covered too. For those using the app on Wi-Fi for example, you can load all the active reports up before hitting the road, those that are up to 3 hours old can still be viewed on the app even after you’ve disconnected from your wireless network.
 

4. Express yourself with Emoji


 


We at TrafficDito believe in the art of self-expression (through somewhat cheesy cartoon emoticons). It’s a social app, so how about throwing in a bit of personality with your reports? Now there’s no need for reports to look boring. Look at those cute little cartoon heads and tell me they wouldn’t cheer you up in traffic!
 

5. Problems on the road? Who you gonna call?!


 


TrafficDito, of course! The app’s assistance directory contains all the need-to-know numbers for any emergency situation. Need a cab? Car battery out of juice? Need your car towed? The TD directory has got it covered.
 
We’re excited to have you guys check out all the wicked cool new features! Of course, if there’s anything else you’d like to see on TrafficDito, just hit the comments below or email us at support@trafficdito.com. Hope to hear from you!
 
-EJ, Product Marketing Padawan
 
P.S.
For that Easter egg, here’s a little hint: Trout.

    • #TrafficDitoUpdates
    • #SoftwareDevelopment
  • 1 year ago
  • Comments
  • Permalink
  • Share
    Tweet

Meet our Geeks: the Coding Freaks

We threw a couple of questions to our website developers (a.k.a The Nerd Herd) to pick their brains on how it was working on TrafficDito. Of course, they insisted that they have a Q&A… boy band style. Yeahhh.

Here are some snippets from our imaginary press conference:

Q1: Give me a quick rundown of the role you played in building TrafficDito.

Padi: Aside from cleaning tables and computer desks, I program from front to back end (well, everyone in the team does). That means I’ll code for a while in JavaScript, then hop on down the stack to do some Ruby, making sure everything works. When I have extra time, I test the app by running along EDSA to report traffic. :D

Mil: We all share the responsibility of working on new features, fixing bugs, and maintaining the server. Personally, I’m in charge of setting up the Jenga tower, dealing cards for Pusoy Dos and doodling on the white board.

Patrick: As the others said, everything’s a shared responsibility. Other than that, I’m pretty good at keeping my chair extra warm.

Gerald: I’m also the demolition guy when we play Call of Duty. :) 

Q2: Given there are four of you, how did you work on it all together? (As a side note, who has the messiest workstation?)

Padi: We all sit next to each other in an open workspace, so we can just hop from one workstation to another to check each others’ code, ask questions, or just have general fooling around. As for messy workstations, I quote my good pal Albert Einstein: “If a cluttered desk is a sign of a cluttered mind, what’s an empty desk a sign of?”

 Mil: Our team practices agile development. We specifically practice XP (or Extreme Programming for our non-geek audience) software development methodology. This means we work in short development cycles, called “iterations”, each lasting a week. Every start of the iteration, we plan on which features or bugs to work on. We call these “stories” and we give each of them a point value, depending on the amount of effort that is needed to complete the story. The point value of the stories will determine how many stories we can comfortably fit inside an iteration. Once we have all that planning done, we then program in pairs for stories with high points and we work individually on the stories with low points. Regarding the messiest workstation, I won’t name names but let’s just say someone was able to build a tower out of Coke Zero cans on his desk.

 Patrick: When it comes to pair programming, one of us would code, and the other would be analyzing how the code would work. We also check each other on Github using pull requests to make sure that everything’s ready for production. I also think that I have the cleanest desk (sarcasm).

Gerald: As an agile team, it is very important for us to work closely together. This means sitting together at only one workstation, discussing stuff at the whiteboard, and talking to one another a lot. We’ll even get the product team in on our discussions to make sure that what we decide is the best decision for the product, not just for us developers.

Q3: How different is the website today from how you envisioned it on day 1?

Padi: TD’s pretty different now compared to the initial design. As we were building the site, a lot of different challenges came up that we had to react to. But as agile ninjas, addressing the challenges and subsequent changes was easy.

Mil: The UI design has changed a lot from when we first started, mostly because of the change in business needs and a bunch of other factors. But we were able to adapt pretty well without having spilled too many Coke Zeros.

Patrick: We decided to postpone many of the original features to polish our report filtering algorithm and make it even more useful for gathering reports.

Gerald: In an agile environment, it is rarely the case that the first plan of action is also the final. During development, we often had to take into consideration changes but all them were directed towards one goal: to make it easy for people to save themselves from Manila traffic. :)

Q4: What programming languages or frameworks did you use for the development of the TrafficDito website?

Padi: Ruby, Rails 3, JavaScript, jQuery, HTML5, and CSS3. Just to name a couple, teehee. :D

Mil: TrafficDito was written in Ruby 1.9 using Rails 3. The frontend voodoo magic was written in JavaScript using the jQuery framework.

Patrick: It’s important to mention testing tools too, right? We used RSpec for unit testing our Ruby code and Jasmine for testing our JavaScript code. To make sure it all plays nice together, we used Cucumber for acceptance and integration testing.

Gerald: Rails made it a piece of cake to start the project and and quickly iterate out our features. Testing and throwing in Jasmine in the mix to cover all sorts of JavaScript scenarios… that was a big help. 

Q5: What were the technologies involved in the development of TrafficDito? Also, what tools/software would you guys use on a daily basis?

Padi: We mostly use Macs for development for their simplicity. Plus the Ruby community loves them like chocolate cake. Our text editor of choice is either Vim or TextMate, depending on how hardcore we feel that day.

Mil: We used any POSIX system that we can use but most of the time we’re on Macs. For version control, we use Git, which really helps in a team enviroment. That way our changes don’t interfere what another pair is working on for that day. Plus it’s decentralized, meaning we don’t need internet to use it. And our internet goes down. A lot. Huhuhu.

Patrick: Since we were handling thousands of tweets every hour, performance was a primary concern, so we chose MongoDB over other database technologies. It lets us quickly process tweets and other reports coming from our iPhone app without much overhead. And if we needed to scale later, it will be less difficult to do.

Gerald: We use a lot of online collaboration tools in our daily work. Github is a big help, letting us comment on each others code and review others’ changes. Campfire is the place you’ll find us posting silly images to one another. We also IM our seatmates just for fun. :D

Q6: What design/programming philosophies did you follow while developing the website?

Padi: We ALWAYS write tests first before we start writing any production code. This practice is called Test Driven Development or TDD (very awesome!) The premise is to ensure that all production code is working as expected and will never break. Manual testing is VERY time consuming and can be tedious work. To solve this, we write automated tests that we run with every change. We also use a continuous integration (CI) server to ensure that the current code is always production ready, even as the team makes changes. Never leave home without your tests!

Mil: We also follow the YAGNI principle. YAGNI means “You Ain’t Gonna Need It”. This principle tells us to code only for features and functionality that is currently needed. The goal is to focus and deliver, which too much complexity can hinder.

Patrick: That test driven development thing makes it easier for us to sleep at night, not having to worry something will explode in our server room.

Q7: Can you name a particular instance that turned out being harder than you thought it would be?

Gerald: We encountered a bug wherein Firefox and our other browsers were rendering fonts differently. After hours of searching, I later found out that Firefox attempts to make a false bold font when there isn’t any provided. This led to the bad typography. It was the first time I had encountered a bug in Firefox that was not present in IE!

Q8: What were the most valuable learning resources you would refer to while developing the website?

Padi: Google, Stack Overflow, The Rails 3 Way, The RSpec Book

Mil: Google, Teammates, Stack Overflow, Rails 3 Way, RSpec Book, Beginning Ruby and other books about Ruby programming.

Patrick: Throughout the project, we have all out support from our teammates. We also us a lot of books, tutorial videos and online resources.

Gerald: Google and programming cookbooks.

Q9: If you could describe yourself as a line or two of code, what would it be?

Padi: %w(Padi Marc Rendl).each { |name| puts “Hi! I’m #{name}!” }

Mil: #mil.ninja { color: #000; visibility: hidden; }

Patrick: [80, 97, 116, 114, 105, 99, 107].pack(‘c*’)

Gerald: Factory(:awesome_developer, :username => “Gerald”) 

Q10: Anything you want to say to new/aspiring developers out there? What about the legion of adoring TrafficDito fans?

Padi: Code with simplicity and eloquence. Solve your problems in the most simple way possible so you don’t have such a complex code base. As Albert Einstein said, “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.”

Mil: At whatever you really love doing, just be sure to give it your all and aim to be the best at it. It may need some time and a lot of courage but it will be fruitful at the end.

Patrick: “The scientific man does not aim at an immediate result. He does not expect that his advanced ideas will be readily taken up. His work is like that of the planter — for the future. His duty is to lay the foundation for those who are to come, and point the way. He lives and labors and hopes.” - Nikola Tesla 

Gerald: For TrafficDito fans: Don’t report that you’re stuck in a traffic jam along Ped Xing.

I tried to get more out of the guys but apparently they had scheduled a Call of Duty deathmatch an extremely important meeting and had to cut the interview short. These guys play around a lot but when crunch time comes around, count on them to do whatever it takes to get the job done.

Now if you’d excuse me, I’m being called for that, uhhhh… meeting.

-EJ, Product Marketing Padawan

    • #TrafficDitoCommunity
    • #SoftwareDevelopment
  • 1 year ago
  • 2
  • Comments
  • Permalink
  • Share
    Tweet

iTD Map <3 MMDA Reports

 

In order to provide the most information to empower you and your driving capabilities, we’ve made a few modifications to our tweet gathering algorithm. We’ve weeded out more irrelevant reports, as well as made one rather significant change: MMDA reports are now formatted on the website and display on the iPhone app’s map!

 

 
Yup, thanks to MMDA’s hard work at reporting the traffic conditions throughout the Metro, we felt it’d be uber useful to be able to stick those as reports exactly where they are. No more reading their reports and trying to figure it out, just look at the map and you’re empowered! You know! No extra thinking required! Now go out and avoid EDSA at all costs.
 
P.S. We added a little secret easter egg for a certain kind of report that we see all too often. See if you can find it!


-Stephen, Coke Zero-Addicted Coder

    • #TrafficDitoUpdates
    • #SoftwareDevelopment
  • 1 year ago
  • Comments
  • Permalink
  • Share
    Tweet

Oranges to Apple: Web Development to iOS

TrafficDito was our first native mobile application. We had experience in the web development front, but to suddenly jump into the world of iOS development wasn’t an easy task. There was a lot to learn, and plenty more to unlearn. Gone are the days of simple request and response cycles.Now we have to deal with having a constantly running app which carries constant state. And with that, you have to worry about memory and performance implications. Not to mention having to unlearn all that fancy CSS3 and HTML5 graphics rendering stuff that made us feel sexy. Here are three of the biggest things we learned from our maiden voyage into this wild new terrain.

1. Constant Application State: I can’t forget about you.

On the world wide web, the only thing you ever really worry about is a request. What are you going to do when that guy from Bohol requests for that page on Tarsier hair grooming? You load the resource, maybe throw in some dynamic content like the latest deals on Tarsier shampoo, and send it off to the guy.

 

For mobile development, you’re not just responding to one request anymore. You’re handling a bunch of interactions from the user, sometimes more than one at a time. So how do you make sense of it all? Let’s all give thanks to the MVC architecture of the iPhone SDK. Let’s focus on that C part. Controller.

The controller is where you define the entry points to your application. As a user touches buttons, scrolls through a table view, whatever. These are all just mini requests that you handle in some way. Updating the model, updating the view, changing state of the controller itself, etc. The only real difference is that you have persistent state between all these requests.


On the web, each request is individual. Someone goes to a URL you setup to represent some resource. You may be dealing with a GET, a POST…some interaction to that resource. But these requests are isolated. Your web app doesn’t remember what happened before or after that request without the help of a session or cookie.

Not so in mobile development. Oh no. Not so. 

Rather than every request being isolated, they’re all connected. This makes your job easier in one regard. You know everything there is to know about your user all the time. No need for some cookie, session, nor database. Unless the dude closes your app, you’re fine.

But this also makes your job more difficult. You now know everything there is to know about your user all the time. These are things you may not want to know. No, I don’t mean his history of bowel movements (unless that’s what your app is about). What I mean is you know all that you want to know about your user, and you have all of that information in memory. And that memory is something you’re going to have to worry about a lot now.

2. Native App: That hardware be hard.

No duh. That’s why we got into this mobile thing. That buzz word there. Native. That means fast. Hardware access. GPS. Compass. Camera. All those other neato features. But you know what? With all good things comes a burden.

You don’t exist on some cloud server anymore with nearly limitless memory, processing power, and disk space. You have true limitations. Memory problems are extremely common in the mobile space. If you’re developing for an iPod Touch especially, those things have so little memory that you’ll get more warnings about your memory than your grandparents do.

Luckily, iOS 5 has eased this burden greatly with ARC (automated reference counting). It’s just Apple’s fancy way of saying “garbage collection”. You start off with some variable, and whereas previously you had to remember to release it at the proper time so as to free up memory, ARC will take care of that for you. You don’t have to manually release variables now (and really, you can’t). Cool.

Unfortunately, ARC does come at a price. Sometimes, it will cause you unexpected problems. If you ever get memory warnings, variables are going to get released and you’ll have a nil value where you expected an array of tarsier pictures. In some cases, this means a crash. In others, things will just stop working, like that “cancel” button that’s supposed to dismiss the modal view.

On our own report stream, we had some reports stored in an array on the view controller. If you left that view and went to, say, the map, then sometimes that’d result in a memory warning. That intelligent ARC system looked for something to release, and that large array of report objects seemed like prime siopao cat meat. So bye bye array of reports.




It didn’t crash. It’s just if you went back to the stream after such an occurrence, you’d be kindly told there are no more reports. Just like that, all the traffic in Manila disappeared. Cool. If only.
 
How do you solve such problems? For us, the solution was simple. Use Core Data. It will take care of most of those problems for you. But for us, we needed to keep a copy of the showing reports in an array on the controller, or else things would go out of sync between the table view and the data store. So if that array ever got dropped, we just needed to repopulate it.

- (void)reportManager:(ReportManager*)manager didFinishFetchingReports:(NSArray*)newReports
{
   _reports = [NSArray arrayWithArray:manager.reports];
}
 
- (NSArray*)reports
{
   if (!_reports) {
       _reports = [NSArray arrayWithArray:self.reportManager.reports];
   }
   
   return _reports;
}

You’ve got to be careful about these memory problems. If the beta testers are telling you about some bug that you just can’t find to save your life, then chances are, it’s a memory problem. Fire up the simulator and start sending simulated memory warnings like it’s a whack-a-mole game. Or boot up your iDevice and load up abajillion Mobile Safari tabs and have a go at it.

3. Graphics Rendering: That makeup ain’t cheap.
 
You spend years perfecting the art of CSS. Moving away from the archaic days of slicing up PSDs and using the power of CSS3 and HTML5 to render all those fancy graphics for you. Surely moving into the cutting edge of the mobile world would give you these same nice things.
 
Just like CSS3, it’s true that Core Animation framework gives you access to easily creating drop shadows, rounded corners, and even gradients. That’s just what you need, right?
 
Wrong. Well, ok. You can. But be prepared for sluggish performance on anything less than the iPad 2 and iPhone 4S. For everything else, animating these custom elements gets to be very tedious.
 
You know that report stream? Those little dots indicating the traffic condition?


I thought for sure it’d be awesome to render those using native iPhone drawing capabilities. Make a box, round the corners into a circle, apply a gradient, a border, and we’re done! Boy did it look hot. And it followed the CSS3 way!
 
But then I ran it on a real device, the iPod Touch 4th Gen. Shoo, it was slower than EDSA traffic on a Friday night. Seriously. As you swiped, it had to redraw those elements again and again, for every single frame. And sadly, these devices don’t carry that 9800GTX Gran Prix of Awezome GFX Card with a 4.23THz GPU. So what to do…
 
Good friends, our best option is to go back to the 1990’s way of slicing and dicing our PSDs. No, it’s not as sexy as rendering everything just as you’d learned in your years of web development. But hey, at least it’s blazing fast! And that’s what matters.
 
But that doesn’t mean there aren’t a few nice things to employ as you slice. Let’s take a common problem: a box.

Drop shadow, rounded corners. The 90’s approach is an image for each corner, and various background images. No such thing these days.
 
There’s this sleek method on the UIImage class. It’s called 
-resizeableImageWithCapInsents: (-stretchableImageWithLeftCapWidth:topCapHeight: in iOS 4.3 and before) and sure enough it works just as the name implies. It gives you an image that you can stretch and resize to your heart’s delight. Just set the resulting image as the background of your view and change the dimensions of your view’s frame. Bam.

 
However, there is a downside. Images take up memory. Both for the initial download of your app, and loading them into memory. What to do?
 
When you make your images, keep that in mind. Cut out all the crap that repeats and just wastes space. Have you seen our condition button selector? Take a look:

No Neo, that isn’t the red pill. That’s a button we use throughout the entire app. Take a look.

 

 

Yup, it’s used everywhere. The report button, the segmented control buttons, etc. All you need to know is how many pixels are unique on the top and left. (iOS5? Then right and bottom too!) And bam! Resizing glory.

[barButton setBackgroundImage:[[UIImage imageNamed:@"barButtonItem"]
                               stretchableImageWithLeftCapWidth:6.0
                               topCapHeight:0.0]
forState:UIControlStateNormal];

 
Noice. So when it comes to laying out your designs, at least for iOS, it’s probably best to avoid native graphics rendering. At least until the graphics processing power starts to match that of desktops, which may be when the iPhone 5 comes out with its quad-core OMG A6 processor, who knows.
 
Conclusion 

For our first app, there was certainly a lot to learn, just about the basics. But if you think deeply about the concepts you learned, you can still apply them. Understanding MVC’s power will make the transition easier, and exploring the art of performance on a native device will help you not make the mistakes we made. But from all this, we’ve learned. It will make our next app experience much quicker, but for sure there’s still a lot more to learn. And more to share with this fine audience. Until then..
 
- Stephen, Coke Zero-Addicted Coder

    • #SoftwareDevelopment
  • 1 year ago
  • 9
  • Comments
  • Permalink
  • Share
    Tweet

Visit our website at

TrafficDito.com


See what else we've been working on:

looloo

Discover Manila's best places.

looloo blog

Check out the blog for updates, promos, and features!


Blog Post Categories:

  1.    • Manila Traffic News
  2.    • TrafficDito Updates
  3.    • Software Development
  4.    • Product Design
  5.    • TrafficDito Community

Check us out yo!

  • @TrafficDito on Twitter
  • Facebook Profile
  • trafficdito on Flickr

TrafficDito Tweets!

loading tweets…

  • RSS
  • Random
  • Archive
  • Ask us anything!
  • Mobile