Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.
Open
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
Binary file added .DS_Store
Binary file not shown.
Binary file added CreditInspector/.DS_Store
Binary file not shown.
461 changes: 461 additions & 0 deletions CreditInspector/CreditInspector.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0450"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9E997B0F166D2B6C00683B13"
BuildableName = "CreditInspector.app"
BlueprintName = "CreditInspector"
ReferencedContainer = "container:CreditInspector.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9E997B30166D2B6D00683B13"
BuildableName = "CreditInspectorTests.octest"
BlueprintName = "CreditInspectorTests"
ReferencedContainer = "container:CreditInspector.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9E997B0F166D2B6C00683B13"
BuildableName = "CreditInspector.app"
BlueprintName = "CreditInspector"
ReferencedContainer = "container:CreditInspector.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9E997B0F166D2B6C00683B13"
BuildableName = "CreditInspector.app"
BlueprintName = "CreditInspector"
ReferencedContainer = "container:CreditInspector.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9E997B0F166D2B6C00683B13"
BuildableName = "CreditInspector.app"
BlueprintName = "CreditInspector"
ReferencedContainer = "container:CreditInspector.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>CreditInspector.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>9E997B0F166D2B6C00683B13</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9E997B30166D2B6D00683B13</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
Binary file added CreditInspector/CreditInspector/.DS_Store
Binary file not shown.
25 changes: 25 additions & 0 deletions CreditInspector/CreditInspector/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// AppDelegate.h
// CreditInspector
//
//
// Copyright (c) 2012 self. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@interface AppDelegate : NSObject <NSApplicationDelegate>{
NSMutableArray *rows;
}

@property (assign) IBOutlet NSWindow *window;
@property (weak) IBOutlet NSTableView *tableView;
@property (weak) IBOutlet NSTextField *total;
@property (weak) IBOutlet NSTextField *percent;
@property (weak) IBOutlet NSComboBox *combo;
@property (weak) IBOutlet NSTextField *param;
@property (weak) IBOutlet NSTextField *summary;

- (IBAction)show:(id)sender;

@end
98 changes: 98 additions & 0 deletions CreditInspector/CreditInspector/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
//
// AppDelegate.m
// CreditInspector
//
// Copyright (c) 2012 self. All rights reserved.
//

#import "AppDelegate.h"

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
[_combo selectItemAtIndex:0];

}

- (IBAction)show:(id)sender {
rows = [[NSMutableArray alloc] init];
NSInteger ttl = [[_total stringValue] integerValue];
float p = [[_param stringValue] floatValue];
float proc = [[_percent stringValue] floatValue];
proc = proc/100;
NSInteger t=ttl;

if([[_combo stringValue] isEqualToString:@"years"]){

p = roundf(100*(t+t*proc*p)/(p*12))/100;

[_summary setStringValue:[NSString stringWithFormat:@"Payment %g",p]];

}


float pocv, allp;
float m=0;

if(p<=roundf(100*t*proc/12)/100){

[_param setTextColor: [NSColor colorWithDeviceRed:1 green: 0 blue: 0 alpha: 1]];
return;
}
else {
[_param setTextColor: [NSColor colorWithDeviceRed:0 green: 0 blue: 0 alpha: 1]];
}

while (t>0)
{
pocv = roundf(100*t*proc/12)/100;

p = (t>p?p:t);
NSLog(@"p=%g, %%=%g",p,pocv);
[rows addObject:[NSNumber numberWithFloat: t+pocv]];
[rows addObject:[NSNumber numberWithFloat: p-pocv]];
[rows addObject:[NSNumber numberWithFloat: pocv]];
t = t+pocv-p;

allp+=p;
m++;
}


if([[_combo stringValue] isEqualToString:@"payment"]){
float rowc = roundf(100*m/12)/100;


[_summary setStringValue:[NSString stringWithFormat:@"Years %g",rowc]];

}

[_summary setStringValue:[NSString stringWithFormat:@"%@ Sum:%g, Over:%g (%g %%)",
[_summary stringValue],
allp,
allp-ttl,
roundf(1000*(allp-ttl)/ttl)/10
]
];

[_tableView reloadData];

}

-(NSInteger) numberOfRowsInTableView:(NSTableView *) tv{

return [rows count]/3;
}

-(id) tableView:(NSTableView *) tv objectValueForTableColumn:(NSTableColumn *)col row:(NSInteger)row {


// NSNumber *s = //[NSNumber numberWithLong:[tv columnWithIdentifier:[col identifier]]];
// NSLog(@"%ld",(row+[[col identifier] integerValue]));
if([[col identifier] integerValue] == 4) return [NSString stringWithFormat:@"%ld",row];
NSNumber *s = [rows objectAtIndex:(row*3+[[col identifier] integerValue])] ;
return s;
}
@end
34 changes: 34 additions & 0 deletions CreditInspector/CreditInspector/CreditInspector-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>SteamJet.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 self. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
7 changes: 7 additions & 0 deletions CreditInspector/CreditInspector/CreditInspector-Prefix.pch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'CreditInspector' target in the 'CreditInspector' project
//

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
29 changes: 29 additions & 0 deletions CreditInspector/CreditInspector/en.lproj/Credits.rtf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
{\colortbl;\red255\green255\blue255;}
\paperw9840\paperh8400
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b\fs24 \cf0 Engineering:
\b0 \
Some people\
\

\b Human Interface Design:
\b0 \
Some other people\
\

\b Testing:
\b0 \
Hopefully not nobody\
\

\b Documentation:
\b0 \
Whoever\
\

\b With special thanks to:
\b0 \
Mom\
}
2 changes: 2 additions & 0 deletions CreditInspector/CreditInspector/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

Loading