dovizu / iglookup Goto Github PK
View Code? Open in Web Editor NEWBerkeley EE/CS Department's "glookup" reinvented on the iOS. Better, Prettier, More Functional!
Berkeley EE/CS Department's "glookup" reinvented on the iOS. Better, Prettier, More Functional!
Currently, SLAssignment has methods and calls to SSH client and does all the bash jobs. We need to create a better abstraction so SLAssignment and other model classes only worry about keeping properties up to date and saving.
Create a dedicated class to manage SSH connection and bash commands. Call it SSHManager
or something. All classes and methods that need to use SSH should call certain methods through this class.
NMSSHSession
instance.SLSSHManager *SSHManager = [[SLSSHManager alloc] init];
[SSHManager openConnectionWithUsername: (NSString *) username
andPassword: (NSString *) password]
if (SSHManager.isActive) {
NSArray *assignments = [SSHManager getAssignments];
//here assignment contains a list of assignment data, however these assignments are represented is up to you, as long as they are not directly creaing an instance of SLAssignment or our other model classes.
}
Currently the distribution graph is all sorts of weird. Fix it
EDIT (by Donald):
The graph cuts off digits along the axis when there are 4 or more digits.
White line space between bars looks too thin.
Replace dark gray bar color with a prettier color.
Learn CorePlot and optimize the look of distribution graph.
running bash commands and retrieving/saving data takes too long.
Parallelize them by using queues.
The app crashes if the account has no grades, and the user tries to view the list of assignments. One solution is to just display a message to the user that says "no grades have been entered" instead of not catching the exception.
EDIT: The app sometimes crashes when trying to access any assignment without a grade even when other assignments have grades. The app always crashes when trying to view "extrapolated total."
Currently the score capsules are fixed so when a score's number is too long, overflowing occurs.
Rewrite this view by using code-based auto layout and auto constraints, so we can customize each view without relying on interface builder.
Currently Accounts are managed by AccountBook and functionalities are split between two. There is no need for a manager service, so to make code cleaner, we can combine Account and AccountBook to one class, following the convention of singleton model class.
Combine Account and AccountBook into the following class
// these properties must be accessible for an instance of this class
@property NSString *userName;
@property NSString *className;
@property NSString *password;
@property NSArray *assignments;
// returns an array of all the saved accounts (SLAccount instances)
+ (NSArray *) findAll;
// returns an account identified by its unique name
+ (SLAccount *) findByClassName: (NSString *)className;
// creates an instance of account and return it
- (id)initWithClassName:(NSString *) className
username:(NSString *) username
andPassword:(NSString *) password;
// save changes made to this instance of SLAccount
- (void)save;
// delete this account from saved data
- (void)delete;
// opens SSH connection if possible, returns success or failure
// if already open, don't do anything
- (BOOL)openSession;
// closes SSH connection
// if already closed, don't do anything
- (void)closeSession;
// updates assignments, get all possible information (distribution, etc), and save them
- (void)updateAssignments;
// Find all the accounts
NSArray *allAccounts = [SLAccount findAll];
// Find one particular account
SLAccount *account = [SLAccount findByClassName: @"CS184"];
// Save changes
account.className = @"AWESOME-CS184";
account.userName = @"cs184-bw";
account.password = @"LenLenShiteageru";
[account save]; //automatically saves into Keychain and plist
// Delete an account
SLAccount *inactive_account = [SLAccount findByClassName: @"CS70"];
[inactive_account delete];
// Add a new account
SLAccount *new_acct = [[SLAccount alloc] initWithClassName: @"CS188"
userName: @"cs188-js"
andPassword: @"abc"];
[new_acct save];
DataManager
or something. Note that our Account, Assignment and other model classes should not worry about the details of saving, deleting and retrieving data. It should rely on DataManager
to do that. This is a good abstraction.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.