Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages and install them manually as needed.
Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages and install them manually as needed.
| package test; | |
| import java.io.BufferedReader; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.FileNotFoundException; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| import java.io.ObjectInputStream; |
| /* | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) 2014 Matthieu Harlé | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
| /* | |
| * Copyright (C) 2014 skyfish.jy@gmail.com | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| public static Observable<List<String>> paginatedThings(final Observable<Void> onNextObservable) { | |
| return Observable.create(new Observable.OnSubscribe<List<String>>() { | |
| @Override | |
| public void call(final Subscriber<? super List<String>> subscriber) { | |
| onNextObservable.subscribe(new Observer<Void>() { | |
| int latestPage = -1; | |
| @Override | |
| public void onCompleted() { | |
| subscriber.onCompleted(); |
| # The trick is to link the DeviceSupport folder from the beta to the stable version. | |
| # sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
| # Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
| sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
| # Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
| # (A similar approach works for older versions too, just change the version number after DeviceSupport) |
| language: objective-c | |
| os: osx | |
| xcode_workspace: {workspace-name}.xcworkspace | |
| xcode_scheme: {workspace-name} | |
| xcode_sdk: iphonesimulator9.0 | |
| osx_image: xcode8 | |
| before_install: | |
| - | | |
| brew update | |
| gem install xcpretty -N --no-ri --no-doc |
| #!/bin/bash | |
| # Script to disable the iOS Simulator app from showing the "Do you want the application xxxx to accept incoming network connections?" pop-up every time the app is run | |
| echo "> Enter password to temporarily shut firewall off" | |
| sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off | |
| echo "> Add Xcode as a firewall exception" | |
| /usr/libexec/ApplicationFirewall/socketfilterfw --add /Applications/Xcode.app/Contents/MacOS/Xcode |
| extension UIAlertController { | |
| /// Creates a view controller for notifying the user that a conversion is occurring. Accepts a block that is executed upon conversion completion. | |
| static func createConvertingAlertController(onConversionCompletion: @escaping () -> Void) -> UIAlertController { | |
| // The title font corresponds to Dynamic Type style "Headline" | |
| let titleFont = UIFont.preferredFont(forTextStyle: .headline) | |
| let calculatorImageView = UIImageView(image: UIImage(named: "calculator.fill", in: nil, with: UIImage.SymbolConfiguration(font: UIFont.systemFont(ofSize: titleFont.pointSize * 2.0, weight: .semibold)))) | |
| let measuringAttributedStringHeight = NSAttributedString(string: "Penguin", attributes: [.font: titleFont]).boundingRect(with: .zero, options: [.usesFontLeading, .usesLineFragmentOrigin], context: nil).height | |
| let desiredOffset = 15.0 + calculatorImageView.bounds.height | |
| let totalNewlinePrefixes = Int((desiredOffset / measuringAttributedStringHeight). |