{"id":26220449,"url":"https://github.com/jayfunc/chelancer","last_synced_at":"2025-09-07T02:05:25.281Z","repository":{"id":262742546,"uuid":"888212155","full_name":"jayfunc/chelancer","owner":"jayfunc","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-14T02:23:58.000Z","size":279,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T19:34:43.944Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jayfunc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-14T02:13:47.000Z","updated_at":"2024-11-14T04:34:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"5547af25-1302-4de7-b753-c3c81517dcbb","html_url":"https://github.com/jayfunc/chelancer","commit_stats":null,"previous_names":["founchoo/chelancer","jayllfilebyte/chelancer","jayfunc/chelancer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jayfunc/chelancer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayfunc%2Fchelancer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayfunc%2Fchelancer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayfunc%2Fchelancer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayfunc%2Fchelancer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jayfunc","download_url":"https://codeload.github.com/jayfunc/chelancer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayfunc%2Fchelancer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273986629,"owners_count":25202708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-12T15:17:07.424Z","updated_at":"2025-09-07T02:05:25.256Z","avatar_url":"https://github.com/jayfunc.png","language":"C++","readme":"# Chelancer\n\n## What\n\n**Che**mical equation ba**lancer**\n\nBuilt with Flutter using Visual Studio Code\n\n## How\n\nGiven chemical equation below\n`H2 + O2 = H2O`\n\n1. Remove blanks\n   `H2+O2=H2O`\n2. Count every element (with the order of first appearing from left to right) in every formulars from left to right\n   ```\n   H in H2: 2\n   H in O2: 0\n   H in H2O: 2\n   \n   O in H2: 0\n   O in O2: 2\n   O in H2O: 1\n   ```\n3. Build a map\n   ```\n   {'H': [2, 0, -2]}\n   {'O': [0, 2, -1]}\n   ```\n   *Note that count on the right of '=' should be negative, see below for reason.*\n4. Build linear equation system\n   ```math\n   \\begin{bmatrix}\n   2 \u0026 0 \u0026 -2 \u0026 0 \\\\\n   0 \u0026 2 \u0026 -1 \u0026 0 \\\\\n   1 \u0026 0 \u0026 0 \u0026 1\n   \\end{bmatrix}$\n   ```\n   *We add last row here cuz we wanna this matrix has only one solution so you may write like `0 1 0 2`, `0 0 1 1`, or whatever, that's all ok.*\n6. Solve it and all done!\n\n## Known issues\n\nNot support `()`, like `Cu(SO)4`\n\n## Thanks\n\nInspired by https://www.quora.com/Is-there-an-algorithm-to-balance-a-chemical-equation-Or-is-it-a-hard-problem\n\n*I found this one answered by `Faris Muhammad` but unfortunately the repository is no longer exist so I write this*\n\n## Libraries\n\nadvanced_math https://pub.dev/packages/advance_math#solving-linear-systems-of-equations for solving linears equations\n\nfraction https://pub.dev/packages/fraction for converting from `double` to `String` in fraction format\n\n## More\n\nThe linear system we mentioned above actually don't need the last row when we are using Python since https://docs.sympy.org/latest/tutorials/intro-tutorial/matrices.html#nullspace can directly give the solution\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayfunc%2Fchelancer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjayfunc%2Fchelancer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayfunc%2Fchelancer/lists"}