Giter Club home page Giter Club logo

ip's Introduction

Hello! I'm Wei En, an undergraduate at the National University of Singapore studying Computer Science and Mathematics. I'm currently interested in statistical learning theory and its applications towards robust and efficient machine learning methods, as well as integrating other areas of theoretical computer science into machine learning.

Outside of research, I take an avid interest in open source software engineering and am also passionate in education initiatives targeted at improving access to opportunities for the less privileged. In my free time, I like to brew a fresh cup of coffee/tea, listen to music, and occasionally indulge in other recreational activities!

ip's People

Contributors

damithc avatar j-lum avatar jiachen247 avatar wei2912 avatar

Watchers

 avatar

ip's Issues

Sharing iP code quality feedback [for @wei2912] - Round 2

We did an automated analysis of your code to detect potential areas to improve the code quality. We are sharing the results below, so that you can avoid similar problems in your tP code (which will be graded more strictly for code quality).

IMPORTANT: Note that the script looked for just a few easy-to-detect problems only, and at-most three example are given i.e., there can be other areas/places to improve.

Aspect: Tab Usage

No easy-to-detect issues ๐Ÿ‘

Aspect: Naming boolean variables/methods

No easy-to-detect issues ๐Ÿ‘

Aspect: Brace Style

No easy-to-detect issues ๐Ÿ‘

Aspect: Package Name Style

No easy-to-detect issues ๐Ÿ‘

Aspect: Class Name Style

No easy-to-detect issues ๐Ÿ‘

Aspect: Dead Code

No easy-to-detect issues ๐Ÿ‘

Aspect: Method Length

Example from src/main/java/duke/Duke.java lines 47-82:

    public static String renderTask(Task task) {
        final var dateFormatter = DateTimeFormatter.ofPattern("MMM d yyyy");
        final TaskType taskType = TaskType.identifyTask(task);
        final String statusIcon = task.getStatusIcon();
        final String taskIcon = taskType.getTaskIcon();

        switch (taskType) {
        case TODO:
            return String.format(
                    "[%s][%s] %s",
                    taskIcon,
                    statusIcon,
                    task.getDescription()
            );
        case DEADLINE:
            var deadline = (Deadline) task;
            return String.format(
                    "[%s][%s] %s (by: %s)",
                    taskIcon,
                    statusIcon,
                    deadline.getDescription(),
                    deadline.getDeadline().format(dateFormatter)
            );
        case EVENT:
            var event = (Event) task;
            return String.format(
                    "[%s][%s] %s (at: %s)",
                    taskIcon,
                    statusIcon,
                    event.getDescription(),
                    event.getTime().format(dateFormatter)
            );
        default:
            throw new UnsupportedOperationException("task type is not a valid enum value");
        }
    }

Example from src/main/java/duke/Parser.java lines 47-98:

    public static String runCommand(TaskList tasks, Storage storage, String input) throws Exception {
        final var parameters = input.split(" ");
        assert parameters.length > 0;
        final var command = parameters[0];
        final var remaining = input.replace(command, "").strip();

        if (command.equals("list")) {
            if (!remaining.equals("")) {
                throw new Exception("The list command cannot take in any parameters.");
            }
            return Duke.renderTaskList(tasks);
        } else if (command.equals("done")) {
            final int i = Integer.parseInt(remaining) - 1;
            final Task task = toggleTask(tasks, storage, i, true);
            return String.join(
                    "\n",
                    "Nice! I've marked this task as done:",
                            "  " + Duke.renderTask(task)
            );
        } else if (command.equals("delete")) {
            final int i = Integer.parseInt(remaining) - 1;
            final Task task = popTask(tasks, storage, i);
            return String.join(
                    "\n",
                    "Noted. I've removed this task:",
                    "  " + Duke.renderTask(task),
                    String.format("Now you have %d tasks in the list.", tasks.size())
            );
        } else if (command.equals("todo")) {
            if (remaining.equals("")) {
                throw new Exception("The description of a todo cannot be empty.");
            }
            final Task task = Parser.parseTaskLine(tasks, remaining, TaskType.TODO);
            addTask(tasks, storage, task);
            return Duke.renderTaskAdded(tasks, task);
        } else if (command.equals("deadline") && remaining.contains("/by")) {
            final Task task = Parser.parseTaskLine(tasks, remaining, TaskType.DEADLINE);
            addTask(tasks, storage, task);
            return Duke.renderTaskAdded(tasks, task);
        } else if (command.equals("event") && remaining.contains("/at")) {
            final Task task = Parser.parseTaskLine(tasks, remaining, TaskType.EVENT);
            addTask(tasks, storage, task);
            return Duke.renderTaskAdded(tasks, task);
        } else if (command.equals("find")) {
            if (remaining.equals("")) {
                throw new Exception("The search query cannot be empty.");
            }
            return Duke.renderFoundTasks(tasks.find(remaining));
        } else {
            throw new Exception("I'm sorry, but I don't know what that means :-(");
        }
    }

Suggestion: Consider applying SLAP (and other abstraction mechanisms) to shorten methods. You may ignore this suggestion if you think a longer method is justified in a particular case.

Aspect: Class size

No easy-to-detect issues ๐Ÿ‘

Aspect: Header Comments

Example from src/main/java/duke/Duke.java lines 84-87:

    /**
     * Render welcome message.
     * @return Welcome message.
     */

Example from src/main/java/duke/Duke.java lines 92-96:

    /**
     * Render an exception message.
     * @param e Exception.
     * @return Exception message.
     */

Example from src/main/java/duke/Duke.java lines 121-126:

    /**
     * Print banner for a newly added task.
     * @param tasks List of tasks.
     * @param task Newly added task.
     * @return String representing newly added task with list of tasks.
     */

Suggestion: Ensure method/class header comments follow the format specified in the coding standard, in particular, the phrasing of the overview statement

Aspect: Recent Git Commit Message (Subject Only)

No easy-to-detect issues ๐Ÿ‘

โ— You are not required to (but you are welcome to) fix the above problems in your iP, unless you have been separately asked to resubmit the iP due to code quality issues.

โ„น๏ธ The bot account @nus-se-bot used to post this issue is un-manned. Do not reply to this post (as those replies will not be read). Instead, contact [email protected] if you want to follow up on this post.

Sharing iP code quality feedback [for @wei2912]

We did an automated analysis of your code to detect potential areas to improve the code quality. We are sharing the results below, to help you improve the code further.

IMPORTANT: Note that the script looked for just a few easy-to-detect problems only, and at-most three example are given i.e., there can be other areas/places to improve.

Aspect: Tab Usage

No easy-to-detect issues ๐Ÿ‘

Aspect: Naming boolean variables/methods

No easy-to-detect issues ๐Ÿ‘

Aspect: Brace Style

No easy-to-detect issues ๐Ÿ‘

Aspect: Package Name Style

No easy-to-detect issues ๐Ÿ‘

Aspect: Class Name Style

No easy-to-detect issues ๐Ÿ‘

Aspect: Dead Code

No easy-to-detect issues ๐Ÿ‘

Aspect: Method Length

Example from src/main/java/duke/Duke.java lines 47-82:

    public static String renderTask(Task task) {
        final var dateFormatter = DateTimeFormatter.ofPattern("MMM d yyyy");
        final TaskType taskType = TaskType.identifyTask(task);
        final String statusIcon = task.getStatusIcon();
        final String taskIcon = taskType.getTaskIcon();

        switch (taskType) {
        case TODO:
            return String.format(
                    "[%s][%s] %s",
                    taskIcon,
                    statusIcon,
                    task.getDescription()
            );
        case DEADLINE:
            var deadline = (Deadline) task;
            return String.format(
                    "[%s][%s] %s (by: %s)",
                    taskIcon,
                    statusIcon,
                    deadline.getDescription(),
                    deadline.getDeadline().format(dateFormatter)
            );
        case EVENT:
            var event = (Event) task;
            return String.format(
                    "[%s][%s] %s (at: %s)",
                    taskIcon,
                    statusIcon,
                    event.getDescription(),
                    event.getTime().format(dateFormatter)
            );
        default:
            throw new UnsupportedOperationException("task type is not a valid enum value");
        }
    }

Example from src/main/java/duke/Parser.java lines 47-98:

    public static String runCommand(TaskList tasks, Storage storage, String input) throws Exception {
        final var parameters = input.split(" ");
        assert parameters.length > 0;
        final var command = parameters[0];
        final var remaining = input.replace(command, "").strip();

        if (command.equals("list")) {
            if (!remaining.equals("")) {
                throw new Exception("The list command cannot take in any parameters.");
            }
            return Duke.renderTaskList(tasks);
        } else if (command.equals("done")) {
            final int i = Integer.parseInt(remaining) - 1;
            final Task task = toggleTask(tasks, storage, i, true);
            return String.join(
                    "\n",
                    "Nice! I've marked this task as done:",
                            "  " + Duke.renderTask(task)
            );
        } else if (command.equals("delete")) {
            final int i = Integer.parseInt(remaining) - 1;
            final Task task = popTask(tasks, storage, i);
            return String.join(
                    "\n",
                    "Noted. I've removed this task:",
                    "  " + Duke.renderTask(task),
                    String.format("Now you have %d tasks in the list.", tasks.size())
            );
        } else if (command.equals("todo")) {
            if (remaining.equals("")) {
                throw new Exception("The description of a todo cannot be empty.");
            }
            final Task task = Parser.parseTaskLine(tasks, remaining, TaskType.TODO);
            addTask(tasks, storage, task);
            return Duke.renderTaskAdded(tasks, task);
        } else if (command.equals("deadline") && remaining.contains("/by")) {
            final Task task = Parser.parseTaskLine(tasks, remaining, TaskType.DEADLINE);
            addTask(tasks, storage, task);
            return Duke.renderTaskAdded(tasks, task);
        } else if (command.equals("event") && remaining.contains("/at")) {
            final Task task = Parser.parseTaskLine(tasks, remaining, TaskType.EVENT);
            addTask(tasks, storage, task);
            return Duke.renderTaskAdded(tasks, task);
        } else if (command.equals("find")) {
            if (remaining.equals("")) {
                throw new Exception("The search query cannot be empty.");
            }
            return Duke.renderFoundTasks(tasks.find(remaining));
        } else {
            throw new Exception("I'm sorry, but I don't know what that means :-(");
        }
    }

Suggestion: Consider applying SLAP (and other abstraction mechanisms) to shorten methods. You may ignore this suggestion if you think a longer method is justified in a particular case.

Aspect: Header Comments

Example from src/main/java/duke/Duke.java lines 84-87:

    /**
     * Render welcome message.
     * @return Welcome message.
     */

Example from src/main/java/duke/Duke.java lines 92-96:

    /**
     * Render an exception message.
     * @param e Exception.
     * @return Exception message.
     */

Example from src/main/java/duke/Duke.java lines 121-126:

    /**
     * Print banner for a newly added task.
     * @param tasks List of tasks.
     * @param task Newly added task.
     * @return String representing newly added task with list of tasks.
     */

Suggestion: Ensure method/class header comments follow the format specified in the coding standard, in particular, the phrasing of the overview statement

Aspect: Recent Git Commit Message (Subject Only)

No easy-to-detect issues ๐Ÿ‘

โ„น๏ธ The bot account @cs2103-bot used to post this issue is un-manned. Do not reply to this post (as those replies will not be read). Instead, contact [email protected] if you want to follow up on this post.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.