Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ jobs:
run: bundle exec jekyll build

- name: danger
env:
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
run: bundle exec danger
29 changes: 29 additions & 0 deletions .github/workflows/markdown-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Markdown Checker

on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
# Run on first day of every month
# See:
# - https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#onschedule
- cron: '0 0 1 * *'

jobs:
job-1:
name: Link Check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v1

# https://github.com/marketplace/actions/markdown-link-check
- name: markdown-link-check
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
config-file: '.github/workflows/markdown-link-check-config.json'
14 changes: 14 additions & 0 deletions .github/workflows/markdown-link-check-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Regex: https://regexr.com
"ignorePatterns": [
{
// ignore relative links, example: '/contact'
"pattern": "/\/[^\/][\w\d]*/g"
}
],

"retryOn429": false,

// ignore 0 and 429
"aliveStatusCodes":[200, 206, 0, 429]
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

![Logo](https://www.jessesquires.com/ico/favicon-180-precomposed.png)

[Broken link](www.jessesquires.com/asdfasdfasdfasdf)

## About

This is my personal site and blog.

Built with [Jekyll](https://jekyllrb.com), [Bootstrap](https://getbootstrap.com), [jQuery](https://jquery.com), and [Font Awesome](https://fontawesome.com). Hosted at [NearlyFreeSpeech](https://nearlyfreespeech.net/).
Built with [Jekyll](https://jekyllrb.com), [Bootstrap](https://getbootstrap.com), [jQuery](https://jquery.com), and [Font Awesome](https://fontawesome.com). Hosted at [NearlyFreeSpeech](https://nearlyfreespeech.net).

## Requirements

Expand Down
4 changes: 2 additions & 2 deletions _posts/2014-06-25-apples-to-apples.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ These two programs were carefully crafted to be a true *apples-to-apples* compar

The following were used for the standard library sorts:

{% highlight swift %}
```swift

// Swift
var arr: [Int] = // some array
Expand All @@ -64,7 +64,7 @@ NSMutableArray *arr = // some array
return [n1 compare:n2];
}];

{% endhighlight %}
```

<span class="text-muted text-center center table-header-footer">
Previous Swift std lib sort <a href="https://gist.github.com/jessesquires/06b6bd68a7d18810651f/ee5aa0a7427f830fadd4d369c9d04a895fc2b49b">implementation here</a>.
Expand Down
2 changes: 1 addition & 1 deletion _posts/2014-08-06-apples-to-apples-part-two.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If at first you don't succeed, try, try again. Practice makes perfect. These pro

This week, Apple has reminded us of the value of this iterative process and its rewards with the fifth beta release of Xcode 6, iOS 8, OS X Yosemite, and most importantly &mdash; *Swift*. This update includes a [number of improvements](http://adcdownload.apple.com//Developer_Tools/xcode_6_beta_5_za4gu6/xcode_6_beta_5_release_notes.pdf), but perhaps the most interesting are those not listed. Swift was rough around the edges during its launch at [WWDC](https://developer.apple.com/wwdc/), but it is **definitely** beginning to live up to its name.

If you missed my first post, [*Apples to Apples*](/apples-to-apples/), you should head over there now to catch up.
If you missed my first post, [*Apples to Apples*]({{ site.url }}{% post_url 2014-06-25-apples-to-apples %}), you should head over there now to catch up.

### Setup

Expand Down
2 changes: 1 addition & 1 deletion _posts/2014-08-19-on-the-value-of-benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: On the value of benchmarks
subtitle: A brief examination of measuring code performance
---

As [*Apples to apples, Part II*](/apples-to-apples-part-two/) made its way around the web, it was [praised](https://twitter.com/SwiftLang/status/497057489766981632) as well as [critiqued](https://twitter.com/benpickering/status/497127012814041088). The latter largely consisted of questions regarding the real-world applications of these benchmarks. In general, benchmarks should be taken with a grain of salt. I want to take a minute to clarify my thoughts on benchmarks and how I think they can be valuable.
As [*Apples to apples, Part II*]({{ site.url }}{% post_url 2014-08-06-apples-to-apples-part-two %}) made its way around the web, it was [praised](https://twitter.com/SwiftLang/status/497057489766981632) as well as [critiqued](https://twitter.com/benpickering/status/497127012814041088). The latter largely consisted of questions regarding the real-world applications of these benchmarks. In general, benchmarks should be taken with a grain of salt. I want to take a minute to clarify my thoughts on benchmarks and how I think they can be valuable.

<!--excerpt-->

Expand Down
4 changes: 2 additions & 2 deletions _posts/2014-08-21-apples-to-apples-part-three.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ subtitle: A modest proposal&#58; can Swift outperform plain C?

<!--excerpt-->

In [*Apples to apples, Part II*](/apples-to-apples-part-two/), we discovered that Swift was finally performing better than Objective-C. As expected, some common [reactions](https://twitter.com/OldManKris/status/497102303833255936) and [responses](https://twitter.com/mpweiher/status/497066155224608768) on Twitter were, *then how does it compare to C?* This is precisely what we are investigating today to welcome this week's arrival of [Xcode 6 beta 6](https://developer.apple.com/xcode/downloads/).
In [*Apples to apples, Part II*]({{ site.url }}{% post_url 2014-08-06-apples-to-apples-part-two %}), we discovered that Swift was finally performing better than Objective-C. As expected, some common [reactions](https://twitter.com/OldManKris/status/497102303833255936) and [responses](https://twitter.com/mpweiher/status/497066155224608768) on Twitter were, *then how does it compare to C?* This is precisely what we are investigating today to welcome this week's arrival of [Xcode 6 beta 6](https://developer.apple.com/xcode/downloads/).

### Setup

* *Code:* [swift-sorts](https://github.com/jessesquires/swift-sorts) and [c-sorts](https://github.com/jessesquires/c-sorts)
* *Software:* OS X Mavericks 10.9.4, Xcode 6 beta 6
* *Hardware:* 2008 unibody MacBook Pro, 2.4 Ghz Intel Core 2 Duo, 8 GB 1067 MHz DDR3 memory

<p>The benchmarks consist of <em><strong>T</strong></em> trials, which are averaged at the end to obtain the average execution time for each algorithm. Each trial begins by generating an array of <em><strong>N</strong></em> random integers in the range <code>[0, UINT32_MAX)</code>. Then, each sorting algorithm is passed a copy of this initial array to sort. The current time is logged before and after each sort and the difference between the two yields the execution time for the algorithm for the current trial. Each execution time is saved to find the average time and standard deviation after all trials are complete.</p>
The benchmarks consist of <em><strong>T</strong></em> trials, which are averaged at the end to obtain the average execution time for each algorithm. Each trial begins by generating an array of <em><strong>N</strong></em> random integers in the range <code>[0, UINT32_MAX)</code>. Then, each sorting algorithm is passed a copy of this initial array to sort. The current time is logged before and after each sort and the difference between the two yields the execution time for the algorithm for the current trial. Each execution time is saved to find the average time and standard deviation after all trials are complete.

The sorting algorithms are written as [textbook implementations](http://en.wikipedia.org/wiki/Introduction_to_Algorithms) for clarity, objectivity, and fairness to each language. The standard library sort for Swift uses the `sorted()` [function](https://gist.github.com/jessesquires/06b6bd68a7d18810651f#file-sorts-m) while C uses `qsort()` from [cstdlib](http://www.cplusplus.com/reference/cstdlib/qsort/).

Expand Down
8 changes: 4 additions & 4 deletions _posts/2014-10-22-swift-failable-initializers.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Apple's [article](https://developer.apple.com/swift/blog/?id=17) provides an exa

However, failable initializers might seduce you into doing something bad. Suppose we have a blog post object. It requires the body text, the date it was written, and an image. To "simplify" construction of a post, you decide to pass the name of an image, instead of a `UIImage` object.

{% highlight swift %}
```swift

class MyPost {

Expand All @@ -53,13 +53,13 @@ class MyPost {
}
}

{% endhighlight %}
```

If the image cannot be constructed, then the initialization of `MyPost` fails. What have we done by designing our `init?` this way? We have disregarded the [SOLID](http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)) principles, specifically [single responsibility](http://en.wikipedia.org/wiki/Single_responsibility_principle) and [dependency inversion](http://en.wikipedia.org/wiki/Dependency_inversion_principle). The `MyPost` object is for storing blog post data. It should not be initializing an image. The dependency on `UIImage` is now obfuscated. And finally, we have to do our optional unwrapping dance every time we instantiate a post.

We can fix these issues by passing a non-optional image to our initializer.

{% highlight swift %}
```swift

class MyBetterPost {

Expand All @@ -74,7 +74,7 @@ class MyBetterPost {
}
}

{% endhighlight %}
```

Clean and deterministic again. But you're probably thinking, *we still have to handle an optional image __somewhere__*. That's true. When constructing a `UIImage`, the initializer `init(named name: String) -> UIImage?` could return `nil`, but the point is that this should be happening *outside* of this class, and definitely **not** in `init`. There's no good reason to dirty up this class with optionals.

Expand Down
2 changes: 1 addition & 1 deletion _posts/2014-12-05-rosetta-stone-contributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ I'm incredibly happy and incredibly proud to share that [Rosetta Stone](http://w

See [my post](http://product.rosettastone.com/rosetta-stone-is-now-on-github/) on our product/engineering [blog](http://product.rosettastone.com/news/) for the official announcement. I think the [value](http://tom.preston-werner.com/2011/11/22/open-source-everything.html) and [benefits](http://ashfurrow.com/blog/sharing-is-selfish/) of open-source are clear, and immeasurable. Every great engineer that I know agrees. So I couldn't be more excited about this news.

And to top it off, I helped author our *first* **ever** open-source project! Today we released an initial version of [RSTCoreDataKit](https://github.com/rosettastone/RSTCoreDataKit), an iOS library for making [Core Data](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreData/cdProgrammingGuide.html) easier to use. This is just a start and there's certainly more coming. This is only the beginning.
And to top it off, I helped author our *first* **ever** open-source project! Today we released an initial version of [RSTCoreDataKit](https://github.com/rosettastone/RSTCoreDataKit), an iOS library for making [Core Data](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreData/) easier to use. This is just a start and there's certainly more coming. This is only the beginning.

Now go show us some love on [GitHub](https://github.com/rosettastone).
4 changes: 2 additions & 2 deletions _posts/2014-12-08-introducing-jsqmessagesvc-6-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A few weeks ago I published the [sixth major release](https://github.com/jessesq

### A brief history

It all began with [Hemoglobe](http://bit.ly/hemoglobeapp), an app for the bleeding disorder community. I built this app with [Michael Schultz](http://michaelschultz.com) almost two years ago, and one of the main features was... *private user messages*. I searched on [GitHub](https://github.com) and [CocoaControls](https://www.cocoacontrols.com) for an existing open-source framework. What I found was a lot of [great attempts](https://www.cocoacontrols.com/search?utf8=✓&q=messages) and partially completed projects. However, one [abandoned project](https://github.com/samsoffes/ssmessagesviewcontroller) stuck out and gave me some great ideas to get started.
It all began with [Hemoglobe](https://hemoglobe.com), an app for the bleeding disorder community. I built this app with [Michael Schultz](http://michaelschultz.com) almost two years ago, and one of the main features was... *private user messages*. I searched on [GitHub](https://github.com) and [CocoaControls](https://www.cocoacontrols.com) for an existing open-source framework. What I found was a lot of [great attempts](https://www.cocoacontrols.com/search?q=messages) and partially completed projects. However, one [abandoned project](https://github.com/samsoffes/ssmessagesviewcontroller) stuck out and gave me some great ideas to get started.

[CocoaPods](http://cocoapods.org) was just entering its third year back then and was not very mainstream. I knew very little about it until [an issue](https://github.com/jessesquires/JSQMessagesViewController/issues/3) was opened that requested CocoaPod support and I received my [first pull-request](https://github.com/jessesquires/JSQMessagesViewController/pull/4) to add a [podspec](http://guides.cocoapods.org/syntax/podspec.html).

Expand Down Expand Up @@ -52,7 +52,7 @@ One of the most challenging aspects of developing a framework is making assumpti
<footer><a href="http://st-www.cs.illinois.edu/users/droberts/">Don Roberts</a></footer>
</blockquote>

So how do we implement *the model* in *Model-View-Controller* when we have no idea what the model will be? *Every* developer that wants to use this library will have a *unique* model. Class names will be different, variable names will be different, the persistence layer ([Core Data](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreData/cdProgrammingGuide.html) or otherwise) will be different. We unify these differences with [Protocols](https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithProtocols/WorkingwithProtocols.html) (or [Interfaces](http://en.wikipedia.org/wiki/Interface_(Java))). This is the [L](http://en.wikipedia.org/wiki/Liskov_substitution_principle) in [SOLID](http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)), and it is one of the most powerful design tools that you have.
So how do we implement *the model* in *Model-View-Controller* when we have no idea what the model will be? *Every* developer that wants to use this library will have a *unique* model. Class names will be different, variable names will be different, the persistence layer ([Core Data](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreData/) or otherwise) will be different. We unify these differences with [Protocols](https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithProtocols/WorkingwithProtocols.html) (or [Interfaces](http://en.wikipedia.org/wiki/Interface_(Java))). This is the [L](http://en.wikipedia.org/wiki/Liskov_substitution_principle) in [SOLID](http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)), and it is one of the most powerful design tools that you have.

There are 4 data protocols for the model layer:

Expand Down
Loading