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
| fileprivate func displayOptionsViewController() { | |
| guard let optionsViewController = OptionsViewController.create(completionBlock: optionsCompletionHandler) else { | |
| NSLog("Failed to create OptionsViewController, whoops") | |
| return | |
| } | |
| self.show(optionsViewController, sender: nil) | |
| self.optionsViewController = optionsViewController as? OptionsViewController | |
| } |
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
| extension OptionsViewController { | |
| class func create(completionBlock: @escaping OptionsCompletionHandler) -> UIViewController? { | |
| let storyboard = UIStoryboard(name: "Options", bundle: nil) | |
| guard let vc = | |
| storyboard.instantiateViewController(withIdentifier:"OptionsViewController") as? OptionsViewController else { | |
| return nil | |
| } | |
| vc.completionBlock = completionBlock | |
| return vc | |
| } |
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 testCreateDeleteMaleCalculate() { | |
| guard let cc = PKMCreatinineClearance(40, height: 75, weight: 70, scr: 1.0, gender: PKMMale) else { | |
| XCTFail("Create Creatinine Clearance Male Instance failed") | |
| return | |
| } | |
| let clcr = cc.calculate() | |
| XCTAssertEqualWithAccuracy(clcr, 97.2, accuracy: 0.2, "Male clcr should be around 97.2, range allowed to be +/- 0.2") | |
| } |
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 "PKMCreatinineClearance.h" | |
| #import "PKMConvert.h" | |
| #import "CreatinineClearance.h" | |
| @interface PKMCreatinineClearance () | |
| @property (nonatomic, assign) PKMath::CreatinineClearance* ccInstance; | |
| @end | |
| @implementation PKMCreatinineClearance |
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
| LRESULT ACLWinBase::DispatchMessage | |
| ( | |
| IN UINT uMsg, | |
| IN WPARAM wParam, | |
| IN LPARAM lParam | |
| ) | |
| { | |
| LRESULT lResult(1); | |
| UINT uSubMsg(WM_NULL); // By default this really isn't looked at. | |
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
| EXTERNC ACLWINCB(LRESULT) ACLWindowDispatchProc | |
| ( | |
| IN HWND hWnd, | |
| IN UINT uMsg, | |
| IN WPARAM wParam, | |
| IN LPARAM lParam | |
| ) | |
| { | |
| UNALIGNED ACLWinBase* pWindow = NULL; | |
| PWINMSGHNDLR pHandler = NULL; |
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
| static ACLWinMessageMap stcMsgMap[] = | |
| // message sub msg/ctl id message handler method. | |
| // | |
| { { WM_CREATE, WM_NULL, (PWINMSGHNDLR)&SampleWindow::OnCreate } | |
| , { WM_DESTROY, WM_NULL, (PWINMSGHNDLR)&SampleWindow::OnDestroy } | |
| , { WM_COMMAND, IDM_ABOUT, (PWINMSGHNDLR)&SampleWindow::OnAbout } | |
| , { WM_COMMAND, IDM_EXIT, (PWINMSGHNDLR)&SampleWindow::OnExit } | |
| , { WM_SIZE, WM_NULL, (PWINMSGHNDLR)&SampleWindow::OnResize } | |
| }; // stcMsgMap |
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
| LRESULT CALLBACK WindowProc | |
| ( | |
| HWND hwnd, | |
| UINT message, | |
| WPARAM wParam, | |
| LPARAM lParam | |
| ) | |
| { | |
| switch (message) | |
| { |
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
| static void FizzBuzz() | |
| { | |
| static int kBufferMax = 256; | |
| char outputBuffer[kBufferMax]; | |
| for (int x = 1; x <= 100; x++) | |
| { | |
| memset(&outputBuffer, 0, kBufferMax); | |
| if (0 == (x % 3)) |