<commit_before>//
//  DashboardViewController.swift
//  Highball
//
//  Created by <NAME> on 8/24/14.
//  Copyright (c) 2014 ianynda. All rights reserved.
//

import UIKit

class DashboardViewController: PostsViewController {
    required init() {
        super.init()
        NSNotificationCenter.defaultCenter().addObserver(
            self,
            selector: Selector("applicationWillResignActive:"),
            name: UIApplicationWillResignActiveNotification,
            object: nil
        )
    }

    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    deinit {
        NSNotificationCenter.defaultCenter().removeObserver(
            self,
            name: UIApplicationWillResignActiveNotification,
            object: nil
        )
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        let downArrow =  FAKIonIcons.iosArrowDownIconWithSize(30);
        let downArrowImage = downArrow.imageWithSize(CGSize(width: 30, height: 30))
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(
            image: downArrowImage,
            style: UIBarButtonItemStyle.Plain,
            target: self,
            action: Selector("bookmarks:event:")
        )

        self.navigationItem.title = AccountsService.account.blog.name
    }

    override func viewDidDisappear(animated: Bool) {
        self.bookmark()
    }

    override func postsFromJSON(json: JSON) -> Array<Post> {
        if let postsJSON = json["posts"].array {
            return postsJSON.map { (post) -> (Post) in
                return Post(json: post)<commit_msg>Make title more accurate<commit_after>//
//  DashboardViewController.swift
//  Highball
//
//  Created by <NAME> on 8/24/14.
//  Copyright (c) 2014 ianynda. All rights reserved.
//

import UIKit

class DashboardViewController: PostsViewController {
    required init() {
        super.init()
        NSNotificationCenter.defaultCenter().addObserver(
            self,
            selector: Selector("applicationWillResignActive:"),
            name: UIApplicationWillResignActiveNotification,
            object: nil
        )
    }

    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    deinit {
        NSNotificationCenter.defaultCenter().removeObserver(
            self,
            name: UIApplicationWillResignActiveNotification,
            object: nil
        )
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        let downArrow =  FAKIonIcons.iosArrowDownIconWithSize(30);
        let downArrowImage = downArrow.imageWithSize(CGSize(width: 30, height: 30))
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(
            image: downArrowImage,
            style: UIBarButtonItemStyle.Plain,
            target: self,
            action: Selector("bookmarks:event:")
        )

        self.navigationItem.title = "Dashboard"
    }

    override func viewDidDisappear(animated: Bool) {
        self.bookmark()
    }

    override func postsFromJSON(json: JSON) -> Array<Post> {
        if let postsJSON = json["posts"].array {
            return postsJSON.map { (post) -> (Post) in
                return Post(json: post)
{'fraction_non_alphanumeric': 0.0956309196455851, 'fraction_numerical': 0.00916590284142988, 'mean_word_length': 2.3104145601617794, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '351712', 'n_tokens_mistral': 939, 'n_tokens_neox': 896, 'n_words': 190}