profile
viewpoint
Christian Clauss cclauss Christian Clauss Switzerland https://www.patreon.com/cclauss Working hard to find and fix bugs in software and to ensure that Python code is properly ported to Python 3. Building related tools and automated systems.

cclauss/500lines 1

500 Lines or Less

cclauss/adapter_pattern 1

Python adapter pattern where adapters are autoloaded from an adapters directory

cclauss/.github 0

Default configuration for @cclauss repos

cclauss/100-Days-Of-ML-Code 0

100 Days of ML Coding

cclauss/12306 0

12306智能刷票,订票

cclauss/2D_detection 0

TensorFlow implementation of SqueezeDet, trained on the KITTI dataset.

cclauss/30-Days-Of-Python 0

A 30 days of python programming challenge

cclauss/3d-photo-inpainting 0

[CVPR 2020] 3D Photography using Context-aware Layered Depth Inpainting

cclauss/3D-SDN 0

[NeurIPS 2018] 3D-Aware Scene Manipulation via Inverse Graphics

cclauss/3dpwn 0

VirtualBox 3D exploits & PoCs

pull request commentTheAlgorithms/Python

doubly_linked_list.py: Add doctests

@WilliamHYZhang @AlexDvorak Could you please look at why these tests are failing? Am I doing something wrong?

cclauss

comment created time in 41 minutes

issue commentnodejs/node-gyp

node-gyp rebuild is failing

Please try: NODE_GYP_FORCE_PYTHON=python3 <your command goes here>

kosuruvarunkumar

comment created time in an hour

issue commentnodejs/node-gyp

node-gyp rebuild is failing

Please run the following commands:

  • python3 --version
  • python --version
  • py --version
kosuruvarunkumar

comment created time in 3 hours

push eventTheAlgorithms/Python

Christian Clauss

commit sha 73b166fcdaf4f2d3881e1cb89b9ec75539e738ce

Update doubly_linked_list.py

view details

push time in 5 hours

push eventTheAlgorithms/Python

Christian Clauss

commit sha db9be4fc83ebb9f3b3540fe110f96d2be1696c1f

Update doubly_linked_list.py

view details

push time in 5 hours

issue commentTheAlgorithms/Python

implementation of computer vision algorithm in python

All talk. No action. :-(

hritik5102

comment created time in 8 hours

push eventTheAlgorithms/Python

Lakshmikanth2001

commit sha 321b1425e34d850cca84ca94ce64dae3f52c3d9a

data_structures/linked_list: Add __len__() function and tests (#2047) * Update __init__.py please add a function to get length of linked list * Update __init__.py * Update doubly_linked_list.py all size function lo doubly linked list class * prime number _better method * comments * Updated init.py 2 made it more pythonic * updated length function * commnet in linked_list construtor * Update data_structures/linked_list/__init__.py accepecting changes Co-authored-by: Christian Clauss <cclauss@me.com> * Update data_structures/linked_list/__init__.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update __init__.py * Revert changes to doubly_linked_list.py * Revert changes to prime_check.py Co-authored-by: Christian Clauss <cclauss@me.com>

view details

push time in 8 hours

PR merged TheAlgorithms/Python

data_structures/linked_list: Add __len__() function and tests

Describe your change:

  • [x] Add an algorithm

Checklist:

  • [x] I have read CONTRIBUTING.md.
  • [x] This pull request is all my own work -- I have not plagiarized.
  • [x] I know that pull requests will not be merged if they fail the automated tests.
  • [x] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [x] All new Python files are placed inside an existing directory.
  • [x] All filenames are in all lowercase characters with no spaces or dashes.
  • [x] All functions and variable names follow Python naming conventions.
  • [x] All function parameters and return values are annotated with Python type hints.
  • [x] All functions have doctests that pass the automated testing.
  • [x] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • [x] If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.
+77 -46

0 comment

2 changed files

Lakshmikanth2001

pr closed time in 8 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha baf6878bbad0d60bf3900c6c717d20b13ebf939d

Revert changes to prime_check.py

view details

push time in 8 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha 3d253550329842b6fb2b65f4dfcd499a54b93319

Revert changes to doubly_linked_list.py

view details

push time in 8 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha a08d5c7d8a077fee4bbad4e771343e8183881cdc

Update __init__.py

view details

push time in 8 hours

pull request commentTheAlgorithms/Python

adding size function to linkedlist data_strucuture

Blocked by #2052

Lakshmikanth2001

comment created time in 8 hours

PR opened TheAlgorithms/Python

doubly_linked_list.py: Add doctests

Describe your change:

  • [ ] Add an algorithm?
  • [x] Add tests to an existing algorithm?
  • [ ] Documentation change?

Checklist:

  • [x] I have read CONTRIBUTING.md.
  • [x] This pull request is all my own work -- I have not plagiarized.
  • [x] I know that pull requests will not be merged if they fail the automated tests.
  • [x] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [x] All new Python files are placed inside an existing directory.
  • [x] All filenames are in all lowercase characters with no spaces or dashes.
  • [x] All functions and variable names follow Python naming conventions.
  • [x] All function parameters and return values are annotated with Python type hints.
  • [x] All functions have doctests that pass the automated testing.
  • [x] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • [x] If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.
+13 -0

0 comment

1 changed file

pr created time in 9 hours

create barnchTheAlgorithms/Python

branch : doubly_linked_list.py-Add-doctests

created branch time in 9 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha 54e661ba64b48b91a1edf3b48b91e8b085d330ea

self.is_empty()

view details

push time in 9 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha 8285c08afdbdf1678ee0ee6129bf823c6353ed3a

Update doubly_linked_list.py

view details

push time in 9 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha 1d6b37ea7672135f3bec6e0c999c22c60a79ec43

Update doubly_linked_list.py

view details

push time in 9 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha dbb57e9895649628c00215990ccf7963e3eb9df4

Update doubly_linked_list.py

view details

push time in 10 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha 81b3a685f6e08d0e395579f8824e6b29cd2a1c83

Update doubly_linked_list.py

view details

push time in 10 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha 0587999dbb77588d1a7b89c0e2d7dd751c484849

Update doubly_linked_list.py

view details

push time in 10 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha 639d77bca3a929ffd8ca2f107ceb206078c73dc3

Update doubly_linked_list.py

view details

push time in 10 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha 911dde99aa64a9b0042e4e048c92a804f4dd7c21

Update doubly_linked_list.py

view details

push time in 10 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha 43b3db5098d24cf6eb68618667d47e12238ffba7

Update doubly_linked_list.py

view details

push time in 10 hours

push eventLakshmikanth2001/Python

Sanders Lin

commit sha 1e0b33d3dd7eda32a97fe73df09df20e2004eb98

Update 3n+1.py (#996) * Update 3n+1.py Made variable names more meaningful and removed nested functions. * Update 3n+1.py * Update 3n+1.py * Update 3n+1.py

view details

Sanders Lin

commit sha 7a6ebb85a2e8eda43131803f2104cdbba07cb164

Update edit_distance.py (#1001) added bottom up method.

view details

Sanders Lin

commit sha 7271c0d64acf4881636f08c4c2dcb00cbe757798

Update rod_cutting.py (#995) * Update rod_cutting.py A hopefully clearer implementation without dependence on global variables. * Update rod_cutting.py added doctests * Update rod_cutting.py * Update rod_cutting.py

view details

Hector S

commit sha d72586c5f4164ed2b518d6badea9d9a89e756689

Updated ~script.py per #978 (#1013) * Added print function into matrix_multiplication_addition.py and removed blank space in data_structures/binary tree directory * Removed .vs/ folder per #893 * Rename matrix_multiplication_addition.py to matrix_operation.py * Moved and renamed ~script.py to scripts/build_directory_md.py Updated DIRECTORY.MD file * Modified .travis.yml per suggestion in #1013 * Fixed typo per suggestions in #1013

view details

Rakshit Parashar

commit sha 0d615398830e8a6fd1c3aa4bd6896de1b8200561

Log_likelihood update (#1008) * Add files via upload This is a simple exploratory notebook that heavily expolits pandas and seaborn * Update logistic_regression.py * Update logistic_regression.py * Rename Food wastage analysis from 1961-2013 (FAO).ipynb to other/Food wastage analysis from 1961-2013 (FAO).ipynb * Update logistic_regression.py * Update logistic_regression.py * Update logistic_regression.py * Update logistic_regression.py * Update logistic_regression.py * Update logistic_regression.py * Update logistic_regression.py

view details

obelisk0114

commit sha 628794d89de355e87ae51ed022cf242dac30ea47

Add combinations (#1015) * Update Bucket Sort time complexity analysis * Add combinations * Adding doctest * Fix doctest problem

view details

obelisk0114

commit sha 3b2738ed89a4ecb1cfb6f16aa96bb90701914796

Add rotate matrix problem (#1021) * Add rotate matrix problem * Fix doctest * Adding return matrix to enable doctest

view details

Sanders Lin

commit sha 1e55bfd4da5a15d8e8536a1a87ad148c69b16a1e

Create climbing_stairs.py (#1002) a simple dp problem seen on LeetCode: https://leetcode.com/problems/climbing-stairs/

view details

cclauss

commit sha 2fb3beeaf1215a1be4a7bc97097ef6a33fd65aeb

Fix error message and format with python/black (#1025) @SandersLin Your review please?

view details

Bruno Simas Hadlich

commit sha 267b5eff40409034322d046b3b0054ac3462cf9e

Added doctest and more explanation about Dijkstra execution. (#1014) * Added doctest and more explanation about Dijkstra execution. * tests were not passing with python2 due to missing __init__.py file at number_theory folder * Removed the dot at the beginning of the imported modules names because 'python3 -m doctest -v data_structures/hashing/*.py' and 'python3 -m doctest -v data_structures/stacks/*.py' were failing not finding hash_table.py and stack.py modules. * Moved global code to main scope and added doctest for project euler problems 1 to 14. * Added test case for negative input. * Changed N variable to do not use end of line scape because in case there is a space after it the script will break making it much more error prone. * Added problems description and doctests to the ones that were missing. Limited line length to 79 and executed python black over all scripts. * Changed the way files are loaded to support pytest call. * Added __init__.py to problems to make them modules and allow pytest execution. * Added project_euler folder to test units execution * Changed 'os.path.split(os.path.realpath(__file__))' to 'os.path.dirname()'

view details

cclauss

commit sha 7cdda931fd6e272529f25a4cd2dbd7c6785d467c

Travis CI: Add pytest --doctest-modules graphs (#1018)

view details

Jigyasa G

commit sha f195d9251cc64adb64549f79f4e774e220a668ab

adding factorial (#930) * adding factorial * adding doctest * Update factorial.py

view details

Sanders Lin

commit sha f64b6029389019a2f2599b88078b940054e8be6c

Update max_sub_array.py (#1000) * Update max_sub_array.py added another method of computing maximum sum subarray * Update max_sub_array.py * Update max_sub_array.py

view details

Bruno Simas Hadlich

commit sha e662a5aaefb6f236021c89e9d410519c2013efa0

Added Burrows-Wheeler transform algorithm. (#1029) * Added doctest and more explanation about Dijkstra execution. * tests were not passing with python2 due to missing __init__.py file at number_theory folder * Removed the dot at the beginning of the imported modules names because 'python3 -m doctest -v data_structures/hashing/*.py' and 'python3 -m doctest -v data_structures/stacks/*.py' were failing not finding hash_table.py and stack.py modules. * Moved global code to main scope and added doctest for project euler problems 1 to 14. * Added test case for negative input. * Changed N variable to do not use end of line scape because in case there is a space after it the script will break making it much more error prone. * Added problems description and doctests to the ones that were missing. Limited line length to 79 and executed python black over all scripts. * Changed the way files are loaded to support pytest call. * Added __init__.py to problems to make them modules and allow pytest execution. * Added project_euler folder to test units execution * Changed 'os.path.split(os.path.realpath(__file__))' to 'os.path.dirname()' * Added Burrows-Wheeler transform algorithm. * Added changes suggested by cclauss

view details

Jigyasa G

commit sha 4658f4a49e2bf9b13d806bd7dfc3df522056ad1c

lgtm fixes (#1032) * adding sum of subsets * lgtm fixes

view details

cclauss

commit sha c2e8582abdf64c837c61c08cecdd5cbea222e290

Travis CI: Add pytest --doctest-modules neural_network (#1028) * neural_network/perceptron.py: Add if __name__ == '__main__': * Remove tab indentation * Add neural_network to the pytests

view details

cclauss

commit sha 9a55f2b36a569f27a0893a79f0ba9cee23819557

Remove the space: lucas series.py --> lucas_series.py (#1036)

view details

Bruno Simas Hadlich

commit sha f438440ac54bbaad1557d5d8d2caa3331231f99b

Fixes for issue "Fix the LGTM issues #1024" (#1034) * Added doctest and more explanation about Dijkstra execution. * tests were not passing with python2 due to missing __init__.py file at number_theory folder * Removed the dot at the beginning of the imported modules names because 'python3 -m doctest -v data_structures/hashing/*.py' and 'python3 -m doctest -v data_structures/stacks/*.py' were failing not finding hash_table.py and stack.py modules. * Moved global code to main scope and added doctest for project euler problems 1 to 14. * Added test case for negative input. * Changed N variable to do not use end of line scape because in case there is a space after it the script will break making it much more error prone. * Added problems description and doctests to the ones that were missing. Limited line length to 79 and executed python black over all scripts. * Changed the way files are loaded to support pytest call. * Added __init__.py to problems to make them modules and allow pytest execution. * Added project_euler folder to test units execution * Changed 'os.path.split(os.path.realpath(__file__))' to 'os.path.dirname()' * Added Burrows-Wheeler transform algorithm. * Added changes suggested by cclauss * Fixes for issue 'Fix the LGTM issues #1024'. * Added doctest for different parameter types and negative values. * Fixed doctest issue added at last commit.

view details

thiru15

commit sha 9f8953dc0c39452bf6dccb76644bcb054d023dfb

Update find_lcm.py (#1019) * Update find_lcm.py Improved code quality and added comments. * Make the doctests work

view details

Bruno Simas Hadlich

commit sha f7ac8b5ed054198bdb254635e8f06c6f219c2f75

Commented doctests that were causing slowness at Travis. (#1039) * Added doctest and more explanation about Dijkstra execution. * tests were not passing with python2 due to missing __init__.py file at number_theory folder * Removed the dot at the beginning of the imported modules names because 'python3 -m doctest -v data_structures/hashing/*.py' and 'python3 -m doctest -v data_structures/stacks/*.py' were failing not finding hash_table.py and stack.py modules. * Moved global code to main scope and added doctest for project euler problems 1 to 14. * Added test case for negative input. * Changed N variable to do not use end of line scape because in case there is a space after it the script will break making it much more error prone. * Added problems description and doctests to the ones that were missing. Limited line length to 79 and executed python black over all scripts. * Changed the way files are loaded to support pytest call. * Added __init__.py to problems to make them modules and allow pytest execution. * Added project_euler folder to test units execution * Changed 'os.path.split(os.path.realpath(__file__))' to 'os.path.dirname()' * Added Burrows-Wheeler transform algorithm. * Added changes suggested by cclauss * Fixes for issue 'Fix the LGTM issues #1024'. * Added doctest for different parameter types and negative values. * Fixed doctest issue added at last commit. * Commented doctest that were causing slowness at Travis. * Added comment with the reason for some doctest commented. * pytest --ignore

view details

push time in 10 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha 6d549a30396108844855d692b8626392f417f6a5

Revert changes to prime_check.py

view details

push time in 10 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha da43761569a632af3e660cab435ff6d3319129ee

Revert changes to prime_check.py

view details

push time in 10 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha df7a07c60f7917fd1ec7837690bd03a207105763

Add doctests to LinkedList().__len__()

view details

push time in 10 hours

push eventLakshmikanth2001/Python

Christian Clauss

commit sha ffb58d2a373666ea62f09fcd4897ea78b30b7297

Add doctests to LinkedList().__len__()

view details

push time in 10 hours

Pull request review commentTheAlgorithms/Python

circular_linked_list: Add more len() tests

 def get_matched_characters(_str1: str, _str2: str) -> str:                 matched.append(l)                 _str2 = f"{_str2[0:_str2.index(l)]} {_str2[_str2.index(l) + 1:]}" -        return ''.join(matched)+        return "".join(matched)      # matching characters     matching_1 = get_matched_characters(str1, str2)     matching_2 = get_matched_characters(str2, str1)     match_count = len(matching_1)      # transposition-    transpositions = len(-        [(c1, c2) for c1, c2 in zip(matching_1, matching_2) if c1 != c2]-    ) // 2+    transpositions = (+        len([(c1, c2) for c1, c2 in zip(matching_1, matching_2) if c1 != c2]) // 2

Black max_line_length is 88

cclauss

comment created time in 10 hours

push eventTheAlgorithms/Python

Christian Clauss

commit sha 1382f0bd6f235d64bf7f9acad2aa73db1de99613

Add empty list tests

view details

push time in 10 hours

delete branch cclauss/traitlets

delete branch : patch-2

delete time in 12 hours

delete branch cclauss/traitlets

delete branch : patch-1

delete time in 12 hours

PR opened ipython/traitlets

Travis CI: Fix Travis lint issues
+4 -3

0 comment

1 changed file

pr created time in 12 hours

push eventcclauss/traitlets

Christian Clauss

commit sha 6f3e2f77b7775c9f7ee0874128e42c082cf4a0e0

Travis CI: Fix Travis lint issues

view details

push time in 12 hours

push eventcclauss/traitlets

Christian Clauss

commit sha 38c6ceddb1ebd5f89a9d94d590d07bec9f16eaed

Only the failing test

view details

push time in 12 hours

PR opened ipython/traitlets

Travis CI: Run tests on Python 3.8, not 3.7
+4 -3

0 comment

1 changed file

pr created time in 12 hours

push eventcclauss/traitlets

Christian Clauss

commit sha 5033c726c6fd4a9f315d8027f7b482f592a62ed0

Travis CI: Run tests on Python 3.8, not 3.7

view details

push time in 12 hours

delete branch cclauss/traitlets

delete branch : patch-1

delete time in 12 hours

push eventTheAlgorithms/Python

Christian Clauss

commit sha c73d3ee425cc006497ab1099f62d2c2cf0d78ca9

Fix decrementation of self.length

view details

push time in 12 hours

pull request commentTheAlgorithms/Python

Jaro winkler

Please note the formatting changes made by psf/black https://github.com/TheAlgorithms/Python/pull/2051/commits/32109bdcfd52f87d99d0c6950ffc699e17b97854

mateuszz0000

comment created time in 13 hours

push eventTheAlgorithms/Python

Christian Clauss

commit sha 097f6a445fc8c02df8f88292338cbfdf63665076

prepend()

view details

push time in 13 hours

issue commentTheAlgorithms/Python

Formatting issues not getting caught in TravisCI

See the second commit on https://github.com/TheAlgorithms/Python/pull/2051

The GitHub Action autoblack (not Travis CI) autoformats our code. It only runs when a maintainer (with the commit bit) creates a PR. This approach gives us eventual compliance with psf/black without having to teach every first-time contributor what psf/black is and how to use it.

onlinejudge95

comment created time in 13 hours

issue closedTheAlgorithms/Python

Formatting issues not getting caught in TravisCI

It has come into the observation that files that are not black compliant are still passing the Travis CI build. Due to which our master has failing checks. Can we do something about it?

Reference https://github.com/TheAlgorithms/Python/pull/2041

closed time in 13 hours

onlinejudge95

PR opened TheAlgorithms/Python

circular_linked_list: Add more len() tests

Describe your change:

Add more len() tests

  • [ ] Add an algorithm?
  • [ ] Fix a bug or typo in an existing algorithm?
  • [ ] Documentation change?

Checklist:

  • [x] I have read CONTRIBUTING.md.
  • [x] This pull request is all my own work -- I have not plagiarized.
  • [x] I know that pull requests will not be merged if they fail the automated tests.
  • [ ] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [ ] All new Python files are placed inside an existing directory.
  • [ ] All filenames are in all lowercase characters with no spaces or dashes.
  • [ ] All functions and variable names follow Python naming conventions.
  • [ ] All function parameters and return values are annotated with Python type hints.
  • [ ] All functions have doctests that pass the automated testing.
  • [ ] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • [ ] If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.
+24 -9

0 comment

2 changed files

pr created time in 13 hours

create barnchTheAlgorithms/Python

branch : circular_linked_list-len

created branch time in 13 hours

Pull request review commentTheAlgorithms/Python

Add alternative solutions for Euler project problems

+"""+Problem:+The prime factors of 13195 are 5,7,13 and 29. What is the largest prime factor+of a given number N?++e.g. for 10, largest prime factor = 5. For 17, largest prime factor = 17.+"""+from math import sqrt, ceil+++def solution(n):+    """Returns the largest prime factor of a given number n.++    What unique about this solution?+    This solution is at least double of speed than previous solutions.+    It increment by 2 after the first primary.++    >>> solution(13195)+    29+    >>> solution(10)+    5+    >>> solution(17)+    17+    >>> solution(3.4)+    3+    >>> solution(0)+    Traceback (most recent call last):+        ...+    ValueError: Parameter n must be greater or equal to one.+    >>> solution(-17)+    Traceback (most recent call last):+        ...+    ValueError: Parameter n must be greater or equal to one.+    >>> solution([])+    Traceback (most recent call last):+        ...+    TypeError: Parameter n must be int or passive of cast to int.+    >>> solution("asd")+    Traceback (most recent call last):+        ...+    TypeError: Parameter n must be int or passive of cast to int.+    """+    try:+        n = int(n)+    except (TypeError, ValueError):

>>> int((0, 1)) # TypeError

gkarwchan

comment created time in 13 hours

Pull request review commentTheAlgorithms/Python

Add alternative solutions for Euler project problems

+"""+Problem Statement:+If we list all the natural numbers below 10 that are multiples of 3 or 5,+we get 3,5,6 and 9. The sum of these multiples is 23.+Find the sum of all the multiples of 3 or 5 below N.+"""+++def solution(n: int) -> int:+    """Returns the sum of all the multiples of 3 or 5 below n.+    What unique about this solution?+    Although this solution is slower than previous solutions,+    but it is more elegant and clear.+    It uses Python features to do some logic,+    like using range's step to check for only multiples of 3 and 5+    and use set's union to remove duplication++    >>> solution(3)+    0+    >>> solution(4)+    3+    >>> solution(10)+    23

Then the code needs to raise ValueError n is not a natural number < 100.

gkarwchan

comment created time in 20 hours

Pull request review commentTheAlgorithms/Python

Add alternative solutions for Euler project problems

+"""+Problem Statement:+If we list all the natural numbers below 10 that are multiples of 3 or 5,+we get 3,5,6 and 9. The sum of these multiples is 23.+Find the sum of all the multiples of 3 or 5 below N.+"""+++def solution(n: int) -> int:+    """Returns the sum of all the multiples of 3 or 5 below n.+    What unique about this solution?+    Although this solution is slower than previous solutions,+    but it is more elegant and clear.+    It uses Python features to do some logic,+    like using range's step to check for only multiples of 3 and 5+    and use set's union to remove duplication++    >>> solution(3)+    0+    >>> solution(4)+    3+    >>> solution(10)+    23

Also what happens when we solution(-1) or solution(3.3)

gkarwchan

comment created time in a day

Pull request review commentTheAlgorithms/Python

Add alternative solutions for Euler project problems

+"""+Problem Statement:+If we list all the natural numbers below 10 that are multiples of 3 or 5,+we get 3,5,6 and 9. The sum of these multiples is 23.+Find the sum of all the multiples of 3 or 5 below N.+"""+++def solution(n: int) -> int:+    """Returns the sum of all the multiples of 3 or 5 below n.+    What unique about this solution?+    Although this solution is slower than previous solutions,+    but it is more elegant and clear.+    It uses Python features to do some logic,+    like using range's step to check for only multiples of 3 and 5+    and use set's union to remove duplication++    >>> solution(3)+    0+    >>> solution(4)+    3+    >>> solution(10)+    23
    >>> [solution(i) for i in range(11)]
    [ ... ]
gkarwchan

comment created time in a day

Pull request review commentTheAlgorithms/Python

Add alternative solutions for Euler project problems

+"""+Problem Statement:+If we list all the natural numbers below 10 that are multiples of 3 or 5,+we get 3,5,6 and 9. The sum of these multiples is 23.+Find the sum of all the multiples of 3 or 5 below N.+"""+++def solution(n: int) -> int:+    """Returns the sum of all the multiples of 3 or 5 below n.+    What unique about this solution?+    Although this solution is slower than previous solutions,+    but it is more elegant and clear.+    It uses Python features to do some logic,+    like using range's step to check for only multiples of 3 and 5+    and use set's union to remove duplication++    >>> solution(3)+    0+    >>> solution(4)+    3+    >>> solution(10)+    23+    >>> solution(600)+    83700+    """+    return sum(set(range(0, n, 3)).union(set(range(0, n, 5))))
    return sum(set(range(0, n, 3)) | set(range(0, n, 5)))
gkarwchan

comment created time in a day

delete branch TheAlgorithms/Python

delete branch : weather_onecall

delete time in a day

issue openedswapnanildutta/CoronavirusDatabase

tips: 1. No need to use jsonify anymore

https://talkpython.fm/episodes/show/264/10-tips-every-flask-developer-should-know

created time in a day

push eventTheAlgorithms/Python

Christian Clauss

commit sha 95a1f226ba01d4e47915e63b8b9287b98ecf647c

weather_forecast("Kolkata, India")

view details

push time in a day

Pull request review commentTheAlgorithms/Python

current_weather, weather_forecast, weather_onecall

 ## Web Programming   * [Crawl Google Results](https://github.com/TheAlgorithms/Python/blob/master/web_programming/crawl_google_results.py)   * [Current Stock Price](https://github.com/TheAlgorithms/Python/blob/master/web_programming/current_stock_price.py)+  * [Current Weather](https://github.com/TheAlgorithms/Python/blob/master/web_programming/current_weather.py)

That change was made automatically by https://github.com/TheAlgorithms/Python/blob/master/.github/workflows/directory_writer.yml#L15 --> https://github.com/TheAlgorithms/Python/blob/master/scripts/build_directory_md.py

cclauss

comment created time in a day

pull request commentTheAlgorithms/Python

current_weather, weather_forecast, weather_onecall

@swapnanildutta Your review please.

cclauss

comment created time in a day

Pull request review commentTheAlgorithms/Python

Add alternative solutions for Euler project problems

 def solution(n):     Traceback (most recent call last):         ...     ValueError: Parameter n must be greater or equal to one.-    >>> solution([])-    Traceback (most recent call last):-        ...-    TypeError: Parameter n must be int or passive of cast to int.-    >>> solution("asd")-    Traceback (most recent call last):-        ...-    TypeError: Parameter n must be int or passive of cast to int.     """-    try:-        n = int(n)-    except (TypeError, ValueError):-        raise TypeError("Parameter n must be int or passive of cast to int.")

Why remove these check? We can specify types but callers are free to ignore them.

gkarwchan

comment created time in a day

Pull request review commentTheAlgorithms/Python

Add alternative solutions for Euler project problems

 def solution(n):     Traceback (most recent call last):         ...     ValueError: Parameter n must be greater or equal to one.-    >>> solution([])-    Traceback (most recent call last):-        ...-    TypeError: Parameter n must be int or passive of cast to int.-    >>> solution("asd")-    Traceback (most recent call last):-        ...-    TypeError: Parameter n must be int or passive of cast to int.

Why remove these test?

gkarwchan

comment created time in a day

PR opened TheAlgorithms/Python

current_weather, weather_forecast, weather_onecall

Describe your change:

  • [x] Add an algorithm?
  • [ ] Fix a bug or typo in an existing algorithm?
  • [ ] Documentation change?

Checklist:

  • [x] I have read CONTRIBUTING.md.
  • [x] This pull request is all my own work -- I have not plagiarized.
  • [x] I know that pull requests will not be merged if they fail the automated tests.
  • [x] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [x] All new Python files are placed inside an existing directory.
  • [x] All filenames are in all lowercase characters with no spaces or dashes.
  • [x] All functions and variable names follow Python naming conventions.
  • [x] All function parameters and return values are annotated with Python type hints.
  • [x] All functions have doctests that pass the automated testing.
  • [x] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • [x] If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.
+17 -5

0 comment

2 changed files

pr created time in a day

create barnchTheAlgorithms/Python

branch : weather_onecall

created branch time in a day

push eventTheAlgorithms/Python

Swapnanil Dutta

commit sha f8bfd0244d54563ae93e1d7b6083128465c1006d

Created weatherforecast.py (#2037) * Created weatherforecast.py Added weatherforecast.py to retrieve weather information of a location and return dictionary values. * Update weatherforecast.py * Update and rename weatherforecast.py to current_weather.py Co-authored-by: Christian Clauss <cclauss@me.com>

view details

push time in a day

PR merged TheAlgorithms/Python

Created weatherforecast.py

Added weatherforecast.py to retrieve weather information of a location and return dictionary values.

Describe your change:

  • [x] Add an algorithm?
  • [ ] Fix a bug or typo in an existing algorithm?
  • [ ] Documentation change?

Checklist:

  • [x] I have read CONTRIBUTING.md.
  • [x] This pull request is all my own work -- I have not plagiarized.
  • [x] I know that pull requests will not be merged if they fail the automated tests.
  • [x] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [x] All new Python files are placed inside an existing directory.
  • [x] All filenames are in all lowercase characters with no spaces or dashes.
  • [x] All functions and variable names follow Python naming conventions.
  • [x] All function parameters and return values are annotated with Python type hints.
  • [x] All functions have doctests that pass the automated testing.
  • [x] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • [x] If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.
+19 -0

2 comments

1 changed file

swapnanildutta

pr closed time in a day

pull request commentTheAlgorithms/Python

Created weatherforecast.py

Nice one! Thanks for your contribution.

swapnanildutta

comment created time in a day

push eventswapnanildutta/Python

Christian Clauss

commit sha eefe96540d96542345e35a19531c2d520df3b6fd

Update and rename weatherforecast.py to current_weather.py

view details

push time in a day

pull request commentpyqtgraph/pyqtgraph

import numpy as np for lines 44 and 51

It can happen that another file has already imported numpy so things work but then if code get refactored and then things break. This is safer.

cclauss

comment created time in a day

delete branch cclauss/pyqtgraph

delete branch : patch-1

delete time in a day

CommitCommentEvent
CommitCommentEvent

issue openedTheAlgorithms/C-Plus-Plus

Should this repo lint C++ code with clang-tidy or cpplint?

https://devblogs.microsoft.com/cppblog/code-analysis-with-clang-tidy-in-visual-studio/ https://devblogs.microsoft.com/cppblog/intellisense-code-linter-for-cpp

v.s.

https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/.github/workflows/cpplint.yml https://github.com/cpplint/cpplint

created time in a day

Pull request review commentTheAlgorithms/Python

Lakshmikanth2001 patch 3

 class Node:     def __init__(self, item, next):         self.item = item         self.next = next- class LinkedList:     def __init__(self):         self.head = None+        self.size=0
        self.size = 0

psf/black is just going to undo all this text with no room to breathe.

Lakshmikanth2001

comment created time in a day

Pull request review commentTheAlgorithms/Python

Lakshmikanth2001 patch 3

 def prime_check(number):      # Except 2, all primes are odd. If any odd value divide     # the number, then that number is not prime.-    odd_numbers = range(3, int(math.sqrt(number)) + 1, 2)-    return not any(number % i == 0 for i in odd_numbers)+    # prime number all are in 6k+1 or 6k-1 form where k belongs to integers so i have modified range(5,root(n),6)+    special_number=range(5,int(math.sqrt(number)),6)

I find the name special_number to be confusing. Can we have a more self documenting variable name? What exactly is special about this number?

Lakshmikanth2001

comment created time in a day

Pull request review commentTheAlgorithms/Python

Lakshmikanth2001 patch 3

 def prime_check(number):      # Except 2, all primes are odd. If any odd value divide     # the number, then that number is not prime.-    odd_numbers = range(3, int(math.sqrt(number)) + 1, 2)-    return not any(number % i == 0 for i in odd_numbers)+    # prime number all are in 6k+1 or 6k-1 form where k belongs to integers so i have modified range(5,root(n),6)

Please wrap all lines at 88 chars max.

Lakshmikanth2001

comment created time in a day

Pull request review commentTheAlgorithms/Python

Lakshmikanth2001 patch 3

 class Node:     def __init__(self, item, next):         self.item = item         self.next = next- class LinkedList:     def __init__(self):         self.head = None+        self.size=0      def add(self, item):         self.head = Node(item, self.head)+        self.size+=1      def remove(self):         if self.is_empty():             return None         else:             item = self.head.item             self.head = self.head.next+            self.size-=1             return item-     def is_empty(self):         return self.head is None+    def __len__(self): #add python predefined len function
    def __len__(self):
Lakshmikanth2001

comment created time in a day

PullRequestEvent

PR closed TheAlgorithms/C-Plus-Plus

Major rework to improve code quality and add automation checks

Description of Change

<!-- Thank you for your Pull Request. Please provide a description above and review the requirements below.

Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/CONTRIBUTION.md -->

  • Add cmake based structure
  • Include documentation building
  • Add GitHub Actions using cmake to check code compilation on linux (ubuntu), Mac OS and Windows (using MS Visual C++ compiler)
  • Add GitHub action to auto-generate documentation and push to repo's respective GitHub Pages -> this will create the website https://thealgorithms.github.io/C-Plus-Plus similar to https://kvedala.github.io/C-Plus-Plus
  • add documentations to various source codes including mathematical formulations where possible
  • fix cpp lint issues with existing files
  • fix source codes so they compile on all operating systems

This documentation approach will also enable other contributors to add documentation in their respective languages or use google translate to do so.

There is a pull-request (#795) for a smaller subset of the changes made

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] Added description of change
  • [x] Added file name matches File name guidelines
  • [x] Added tests and example, test must pass
  • [x] Relevant documentation/comments is changed or added
  • [x] PR title follows semantic commit guidelines
  • [x] Search previous suggestions before making a new one, as yours may be a duplicate.
  • [x] Sort by alphabetical order
  • [x] I acknowledge that all my contributions will be made under the project's license.

Notes: <!-- Please add a one-line description for developers or pull request viewers -->

+44694 -8897

2 comments

271 changed files

kvedala

pr closed time in a day

pull request commentTheAlgorithms/C-Plus-Plus

Major rework to improve code quality and add automation checks

Please move all changes to .github/workflows two separate pull requests so they can be evaluated on their merits without the clutter of all 266 other file changes. The first PR should add files to .github/workflows and the second should remove files from .github/workflows. Please do not reply that such a thing is impossible and that the rules that apply to your pull requests.

kvedala

comment created time in a day

PR closed TheAlgorithms/Python

Add tests and type hints to hill_cipher.py wontfix

Describe your change:

Adding tests for issue Fixes: #1788

  • removed string type dependency for option selection
  • added 9 doctests
  • removed lambdas, defined functions
  • added type hints

Checklist:

  • [x] I have read CONTRIBUTING.md.
  • [x] This pull request is all my own work -- I have not plagiarized.
  • [x] I know that pull requests will not be merged if they fail the automated tests.
  • [x] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [x] All new Python files are placed inside an existing directory.
  • [x] All filenames are in all lowercase characters with no spaces or dashes.
  • [x] All functions and variable names follow Python naming conventions.
  • [x] All function parameters and return values are annotated with Python type hints.
  • [x] All functions have doctests that pass the automated testing.
  • [x] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • [x] If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.
+78 -21

2 comments

2 changed files

mrvnmchm

pr closed time in a day

delete branch cclauss/openlibrary

delete branch : pyup-update-ipython-5.8.0-to-7.14.0

delete time in 2 days

push eventcclauss/openlibrary

pyup-bot

commit sha 29ef784c7865e3283ba7fb2007a316bc874b3391

Update ipython from 5.8.0 to 7.15.0

view details

push time in 2 days

create barnchcclauss/openlibrary

branch : pyup-update-ipython-5.8.0-to-7.15.0

created branch time in 2 days

PR closed TheAlgorithms/Python

Create Malware_analysis

Describe your change:

  • [ ] Add an algorithm?
  • [ ] Fix a bug or typo in an existing algorithm?
  • [ ] Documentation change?

Checklist:

  • [ ] I have read CONTRIBUTING.md.
  • [ ] This pull request is all my own work -- I have not plagiarized.
  • [ ] I know that pull requests will not be merged if they fail the automated tests.
  • [ ] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [ ] All new Python files are placed inside an existing directory.
  • [ ] All filenames are in all lowercase characters with no spaces or dashes.
  • [ ] All functions and variable names follow Python naming conventions.
  • [ ] All function parameters and return values are annotated with Python type hints.
  • [ ] All functions have doctests that pass the automated testing.
  • [ ] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • [ ] If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.
+1 -0

0 comment

1 changed file

rishu2403

pr closed time in 2 days

delete branch cclauss/Pyto-module-versions

delete branch : pyup-update-pandas-0.24.1-to-1.0.3

delete time in 2 days

push eventcclauss/Pyto-module-versions

pyup-bot

commit sha 83dbc4b06b071aecb719e89b65eb5dacbed78901

Update pandas from 0.24.1 to 1.0.4

view details

push time in 2 days

issue commentTheAlgorithms/C-Plus-Plus

Union-Find algorithm for finding components of a Graph

We want to be able to see the theoretical performance DFS is O(NQ), while DSU is (Q a(N)) as well as the actual performance 32 sec. vs. 97 sec.

deadshotsb

comment created time in 2 days

issue commentnodejs/node-gyp

node-gyp rebuild not working on MacOS Catalina Beta without reinstalling CommandLineTools

Please see #2141 which is an effort to fix this often reported issue.

nnmrts

comment created time in 2 days

issue commentTheAlgorithms/Python

alogrithans for pyhton

Dup of #1901

anees747

comment created time in 3 days

issue closedTheAlgorithms/Python

alogrithans for pyhton

closed time in 3 days

anees747

pull request commentTheAlgorithms/Python

adding size function to linkedlist data_strucuture

Please resolve conflicting files.

Lakshmikanth2001

comment created time in 3 days

Pull request review commentTheAlgorithms/Python

adding size function to linkedlist data_strucuture

 def __init__(self, item, next): class LinkedList:     def __init__(self):         self.head = None+        self.size=0      def add(self, item):         self.head = Node(item, self.head)+        self.size+=1      def remove(self):         if self.is_empty():             return None         else:             item = self.head.item             self.head = self.head.next+            self.size-=1             return item      def is_empty(self):         return self.head is None+    def size(self):

Please define __len__() instead.

Is it better to maintain a size variable or is better to visit all nodes and count them?

Lakshmikanth2001

comment created time in 3 days

issue commentnodejs/node

configure.py: upgrade from optparse to argparse

Let's leave it open. The code did not get merged so the issue remains valid.

cclauss

comment created time in 3 days

pull request commentvaexio/vaex

Use print() function in both Python 2 and Python 3

@JovanVeljanoski Your review please?

cclauss

comment created time in 3 days

PR opened tensorflow/agents

Use ==/!= to compare constant literals (str, bytes, int, float, tuple)

Avoid SyntaxWarnings on Python >= 3.8.

% python3.8

>>> () is ()
<stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
+1 -1

0 comment

1 changed file

pr created time in 3 days

push eventcclauss/agents

Christian Clauss

commit sha a264bccd236f154146276be944a90bcc873395f5

Use ==/!= to compare constant literals (str, bytes, int, float, tuple) Avoid [SyntaxWarnings on Python >= 3.8](https://docs.python.org/3/whatsnew/3.8.html#porting-to-python-3-8). % `python3.8` ``` >>> () is () <stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="? ```

view details

push time in 3 days

PR opened google/sanitizers

Use print() function in both Python 2 and Python 3

Legacy print statements are syntax errors in Python 3 but print() function works as expected in both Python 2 and Python 3.

+29 -26

0 comment

3 changed files

pr created time in 3 days

create barnchcclauss/sanitizers

branch : modernize-Python-2-codes

created branch time in 3 days

fork cclauss/sanitizers

AddressSanitizer, ThreadSanitizer, MemorySanitizer

fork in 3 days

push eventcclauss/itinerant-tester

Christian Clauss

commit sha b2c36dd87b9008d4c6aee2bc39dfe27f8754ae36

trigger a new build

view details

push time in 3 days

issue commentnodejs/node-gyp

NPM fails on msbuild.exe with exit code 1

Support for Windows XP ended in 2014!

gilbertbw

comment created time in 3 days

Pull request review commentnodejs/gyp-next

feat: port "add support for MSVC cross-compilation" from node

 def _GenerateMSBuildProject(project, options, version, generator_flags):         content += _GetMSBuildLocalProperties(project.msbuild_toolset)     content += import_cpp_props_section     content += import_masm_props_section-    if spec.get("msvs_enable_marmasm"):+    if spec.get("msvs_enable_marmasm") or True:

LOL :-) That mod is not useful. if spec.get("msvs_enable_marmasm", True): might be useful but it depends on how we want to deal with the case where "msvs_enable_marmasm" not in spec

targos

comment created time in 3 days

pull request commentnodejs/node-gyp

gyp: fix XCode CLT version detection on Catalina

Can we delete the code from this repository that we vendor in from some other repository?

szekelyisz

comment created time in 3 days

more