This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| public class DeviceOrientationManager : MonoBehaviour | |
| { | |
| private const float ORIENTATION_CHECK_INTERVAL = 0.5f; | |
| private float nextOrientationCheckTime; | |
| private static ScreenOrientation m_currentOrientation; | |
| public static ScreenOrientation CurrentOrientation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| AD9833 Waveform Module vwlowen.co.uk | |
| */ | |
| #include <SPI.h> | |
| const int SINE = 0x2000; // Define AD9833's waveform register value. | |
| const int SQUARE = 0x2028; // When we update the frequency, we need to | |
| const int TRIANGLE = 0x2002; // define the waveform when we end writing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) { | |
| if scrollView == suggestionsTableView { | |
| let cellHeight = CGFloat(60.0) | |
| let y = targetContentOffset.pointee.y + scrollView.contentInset.top + (cellHeight / 2) | |
| let cellIndex = floor(y / cellHeight) | |
| targetContentOffset.pointee.y = cellIndex * cellHeight - scrollView.contentInset.top | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| extension String { | |
| subscript(index: Int) -> Character { | |
| return self[self.index(self.startIndex, offsetBy: index)] | |
| } | |
| } | |
| extension String { | |
| public func levenshtein(_ other: String) -> Int { |