App Store Release Informer 1.1.0
I rewrote my bot in ES2015 and also added tests. When the bot reports that a new version has been released in the App Store, it now also shows what is new in that version.
I rewrote my bot in ES2015 and also added tests. When the bot reports that a new version has been released in the App Store, it now also shows what is new in that version.
A couple of thoughts on Carthage compared to CocoaPods.
To convert a date from text into NSDate from a slightly non-standard format with milliseconds:
let dateString = "2016-04-22T17:42:46.762+03:00"
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
let myDate = dateFormatter.dateFromString(dateString)
CompareShots version 1.1 has been released.
What is new: transparency now changes simply by dragging your finger horizontally. One of the users actually asked for this feature in an email. It also makes the transparency change more smoothly.
Besides that, I completely rewrote the app in Swift. So now I have as many as one released project written in it :) But this is only the beginning.
What is surprising is that I submitted the App Store update yesterday, and in less than a day it had already passed Review and been released. I do not remember Apple ever approving an app that fast.
A cheat-sheet function for logging in Swift:
import Foundation
/**
A log function that outputs the file, method, and line it was called from.
Example usage: DLog("hello")
- parameter messages: text/objects to print
- parameter fullPath: path to the calling file
- parameter line: line number in the file
- parameter functionName: name of the calling method/function
*/
func DLog(messages: Any..., fullPath: String = #file, line: Int = #line, functionName: String = #function) {
let file = NSURL.fileURLWithPath(fullPath)
for message in messages {
print("\(file.pathComponents!.last!):\(line) -> \(functionName) \(message)")
}
}
// Example:
DLog("message 1", "message 2")
// YourClass.swift:42 -> someMethod() message 1
// YourClass.swift:42 -> someMethod() message 2
This installment was released alongside Assassin's Creed III. It was made for the handheld PS Vita, and only later got an HD version for home consoles and PC. Still, it is very noticeable that it was not made for them.
The game is laggy and buggy. I had some completely unreal lag on launch. I changed the resolution to 1920x1080 and it became smooth. But the controls on PC are very clumsy, and I kept running into glitches with them. At one point the engine suddenly decided I was in water even though I was on land. As a result, the character was dangling in the air to the sound of splashing water and could not move anywhere. I had to reload from a checkpoint. It is a shame I played it after the excellent Part IV (Black Flag), because with that contrast it looks even worse.
The main character is a girl named Aveline. The only truly original difference in this part compared to the others is that you can change her outfit. There are 3 appearances for different purposes. Lady — a woman in a dress, she cannot climb buildings or fight, but she can charm people and barely raises suspicion anywhere. Slave — a girl in simple clothes (according to the story, Aveline is the daughter of a slave who was freed and then adopted into a rich family), can climb and fight, though not especially well. It lets you slip into various places disguised as a worker and avoids drawing too much suspicion from the guards. Assassin — full combat gear, lets you use all weapons and fight at full strength. It immediately arouses suspicion among the guards.
You can travel by canoe in the game. However, because the controls are very clumsy, this is constantly a problem. You crash into something, fail to turn, or just get stuck and stop moving forward.
There are several locations. On the one hand, there are some bright spots, but on the other, everything looks just as dull and bleak as in Assassin's Creed III.
Chichen Itza was nice, though. An ancient temple, caves, catacombs — not bad.
The main villains are vague somehow. The plot too. Everything feels dull and, in my opinion, wildly dragged out. While playing, 2 or 3 times I thought, well, this is finally the end of the game, but no, the story kept going for some reason. Unlike the other parts, I had no desire at all to do side activities like buying and opening businesses in the city, because it all looked rather pointless here. There are barely any counters either; it does not even show the number of synchronization points.
Like in Part III, you can climb trees and branches in the forests. There were a couple of cool missions built around that. But again, the clumsy controls spoiled them.
The graphics are nothing special either, except perhaps for the character detail. And not for all characters, and not entirely either. Still, that is understandable. It was originally made for a handheld console.
At one point you go to New York, where you meet Connor, the Native American hero from Part III. The problem is that he does not look anything like either the hero of Part III or even a Native American at all. Only his outfit does (the screenshot above is not him). That is odd too.
The most interesting part of this game comes at the end. In fact, after the credits, when you think everything ended in a certain way. Still, I am unlikely to ever want to play this installment again. Though as a fan of the series, I still wanted to check it out. The game can be finished in 3 evenings, so it is okay for a look.
While coding in Node.js, I constantly need to print something to the console. Errors, for example. But for better information it is more convenient to know exactly where the output is coming from. Especially since when I was coding for iOS, I always had such a handy macro at hand, but with Node.js I had to google and dig around, because many examples from Stack Overflow simply crashed on the latest Node.js 5.10.0. They crashed because they used Error.captureStackTrace(err, arguments.callee), and now you need to use NFE.
In the end I made what I wanted. Leaving it here as a cheat sheet.
npm install colors --save
File logger.js:
'use strict';
let colors = require('colors');
colors.enabled = true;
exports.p = function logger(somethingForPrint) {
somethingForPrint = somethingForPrint || '';
const originalPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = (error, stack) => { return stack; };
let e = new Error;
Error.captureStackTrace(e, logger);
const stack = e.stack;
const filename = stack[0].getFileName().split('/').reverse()[0];
const trace = filename + ':' + stack[0].getLineNumber() + " " + colors.bold.black('%s') + "\n";
Error.prepareStackTrace = originalPrepareStackTrace;
console.log(trace, somethingForPrint);
};
Use:
const logger = require('../utils/logger');
logger.p('something happened');
// file.js:401 something happened