Jump to content

Wangyou Zhang

Member
  • Posts

    5
  • Joined

  • Last visited

Posts posted by Wangyou Zhang

  1. I write a workflow for opening files/directories either in Finder or in iTerm directly with Alfred.

    It supports saving history records and auto-suggestions according to the history records.

    Hope you like it :)

     

    Description

    This workflow could help you:

    • open the given path/file in Finder
    • (cmd) reveal the given path/file in Finder
    • (ctrl) open the given path/file in iTerm

    It can remember at most MAX_LENGTH history records that you searched before and you can access them again conveniently.

     

    Download
    You can download the workflow file from my GitHub.


    Examples

    • cd + nothing : It will list all the history records.

     

    • cd + path/file name : It will open the path in Finder or open the file directly.demo_1.thumb.png.79f6bb6fc3babf8aeafb81360c889991.png

     

    • cd + any string : It will list all history records that are possibly relevant to the input.demo_2.thumb.png.4f7fe9096de2831b5351d3edbcbcfb37.png

     

    • cd + path/file name & press command while selecting an item in the list :

      It will reveal the path/file in Finder.

      demo_3.thumb.png.8eb3c70071319595e672fca92b56aabf.png

     

    • cd + path/file name & press ctrl while selecting an item in the list :

      It will open the path/path of file in iTerm.

      Note : Please make sure you have installed iTerm before you try this !demo_4.thumb.png.0498a81edfc73af20ba309ea83b0c021.png

  2. 13 hours ago, Thomas_U said:

    What a little jewel! Thank you so much!

     

    Would it be possible to simplify german comma instead of dot/period?

     

     

     

    Hi, I added support for German comma as a decimal point just now. You can try the updated workflow here.

  3. 15 hours ago, CJK said:

    Nice idea and workflow.  You could maybe think about expanding its capabilities to become a more general maths tool.  From simplifying fractions, it's not a big leap to incorporate GCD and LCM.  And then, maybe, handling/simplifying surds, expressing compound fractions, obtaining the integer or fractional portions of a number, and coping with modular arithmetic.

     

    Just thinking out loud.  Thanks for the sharing this.

     

    @CJK Thank you for the suggestions! I will consider adding these features later :)

  4. I write a workflow for converting a given decimal to a simplified fraction as well as simplifying a given fraction.

    It saves me a lot of time and I hope it is useful for you too.

     

    Download
    You can download the workflow file from my GitHub.


    Examples

    demo.png.85fcc8703ab6b07174d6c840773db1f8.png

    • frac .11 ==>  .11 = 11 / 100
    • frac 4/6 ==>  4/6 = 2 / 3
    • frac -1.4/2.2 ==>  -1.4/2.2 = -7 / 11
    • frac 1.2/0 ==>  Error: divided by zero.
    • frac b/3 ==>  Error: Invalid input format

     

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

     

    Update

    7 additional math tools are added and the new workflow is renamed to MathTools

    Quote

    @CJK @Thomas_U Thank you for your feedback and suggestions.

    1) Simplify fractions

    Examples:

    image-20181122010814523

    • frac .11 ==>  .11 = 11 / 100
    • frac 4/6 ==>  4/6 = 2 / 3
    • frac -1.4/2.2 ==>  -1.4/2.2 = -7 / 11

    2) Greatest common divisor

    Examples:

    image-20181122010425254

    3) Least common multiple

    Examples:

    image-20181122010713899

    4) Simplify surds

    Examples:

    image-20181122014249233

    • sqrt .0144 ==>  √(.0144) = 3/25 = 0.12
    • sqrt 4 8/81 ==>  ³√(8/81) = (2/3) ³√(1/3)
    Note:

    Negative numbers are not supported.

    5) Log functions

    Examples:

    image-20181122014906647

    • log 5 ==>  log₁₀(5) = 0.698970004336
    • log2 1.0001 ==>  log₂(1.0001) = 0.000144262291095
    • ln e ==>  ln(e) = 1.0
    Note:

    e=2.718281828... can be used only in some simple cases, and in most cases it is used as the scientific notation.

    6) Prime factorization

    Examples:

    image-20181122015801882

    • factor 100 ==>  factor(100) = [1, 2, 2, 5, 5]
    • factor 31 ==>  factor(31) = [1, 31]
    Note:

    The maximum value of input integer is limited in case of memory overflow.

    7) Permutations and Combinations

    Examples:

    image-20181122020127840

    • C( 4 2 ==>  C(4, 2) = 6 
    • c( 1000 3 ==>  C(1000, 3) = 166167000 
    • P( 4 2 ==>  P(4, 2) = 12
    • p( 1000 3 ==>  P(1000, 3) = 997002000 
    Note:

    The maximum value of m is limited for both permutations and combinations.

×
×
  • Create New...