Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ricco/test pr 01 #290

Open
wants to merge 57 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
24a0c63
ipd test
Oct 31, 2024
4cffe85
sql change - ipd
Oct 31, 2024
9c7fca9
test
skakarl2 Oct 31, 2024
8a62670
Create testipd.ts
skakarl2 Nov 1, 2024
344d107
optimized version
skakarl2 Nov 1, 2024
c6cdf50
Merge branch 'master' of https://github.com/skakarl2/jasper-ipd
skakarl2 Nov 1, 2024
383b311
merge sort
skakarl2 Nov 1, 2024
777141b
Create binary_search.py
skakarl2 Nov 4, 2024
eab3817
bug fix
skakarl2 Nov 5, 2024
fa40425
Merge branch 'master' of https://github.com/skakarl2/jasper-ipd
skakarl2 Nov 5, 2024
570e38b
add sort
skakarl2 Nov 5, 2024
2788a42
add path changes
skakarl2 Nov 5, 2024
9938220
iterate files
skakarl2 Nov 5, 2024
2e0ef3e
addnlinked list implementation
skakarl2 Nov 5, 2024
24c43ee
new file
skakarl2 Nov 5, 2024
5c516f7
insertion sort
skakarl2 Nov 5, 2024
a275d14
Create local-test.py
skakarl2 Nov 7, 2024
7dc32e5
Update binary_search.py
skakarl2 Nov 8, 2024
2005b95
ipd walkthorugh
skakarl2 Nov 8, 2024
a829ae1
Merge branch 'master' of https://github.com/skakarl2/jasper-ipd
skakarl2 Nov 8, 2024
a575577
armstrong
skakarl2 Nov 8, 2024
d6ece63
update ts
skakarl2 Nov 8, 2024
fc2d8c8
test
skakarl2 Nov 8, 2024
28a615e
decimal
skakarl2 Nov 8, 2024
6917a9a
linked list
skakarl2 Nov 8, 2024
775afb5
my code
skakarl2 Nov 8, 2024
8738114
llm and my code
skakarl2 Nov 8, 2024
ec988be
test
skakarl2 Nov 11, 2024
7fa3364
filename
skakarl2 Nov 11, 2024
288ca0f
file
skakarl2 Nov 11, 2024
ebfa1ab
test demo
skakarl2 Nov 11, 2024
cd92d6c
test
skakarl2 Nov 11, 2024
dfc843c
test 2
skakarl2 Nov 11, 2024
8ebbadd
test3
skakarl2 Nov 11, 2024
bedf37f
test 3
skakarl2 Nov 11, 2024
4dfbfa3
test
skakarl2 Nov 12, 2024
ffe310f
test cases
skakarl2 Nov 12, 2024
a0f2fa9
aia demo
skakarl2 Nov 12, 2024
badef76
Create flask_test.py
skakarl2 Nov 12, 2024
f1ffe56
Create test-match.py
skakarl2 Nov 27, 2024
5483c70
ai tagging with allow
skakarl2 Jan 7, 2025
db2d04f
ai tag
skakarl2 Jan 7, 2025
bc38b3f
test
skakarl2 Jan 8, 2025
d225c8b
test
skakarl2 Jan 8, 2025
c409da8
ll
skakarl2 Jan 8, 2025
7fcf1fa
test author info
skakarl2 Jan 8, 2025
bda65b8
1
skakarl2 Jan 8, 2025
a12d0ba
q
skakarl2 Jan 8, 2025
aee56c9
bs
skakarl2 Jan 9, 2025
dc246b3
t
skakarl2 Jan 9, 2025
571f230
unittest
skakarl2 Jan 9, 2025
1a2080b
test
skakarl2 Jan 21, 2025
4609b35
test 2
skakarl2 Jan 21, 2025
a67fcb1
test
skakarl2 Jan 22, 2025
5d71968
t
skakarl2 Jan 22, 2025
ff39864
max sum
skakarl2 Jan 22, 2025
40facf9
pushing vuln code
Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions local-test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
def merge_sort(arr):
"""
Merge sorts an array of integers.

Parameters:
- arr (list): The array to be sorted.

Returns:
- sorted_arr (list): The sorted array.
"""
if len(arr) <= 1:
return arr

# Split the array into two halves
mid = len(arr) // 2
left = arr[:mid]
right = arr[mid:]

# Recursively sort the left and right halves
left_sorted = merge_sort(left)
right_sorted = merge_sort(right)

# Merge the sorted halves into a single sorted array
merged = merge(left_sorted, right_sorted)
31 changes: 31 additions & 0 deletions my-vulnerable-code.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
// Get the user input from a GET request
$user_id = $_GET['user_id'];

// Create a connection to the database
$conn = new mysqli("localhost", "username", "password", "database");

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

// Construct the SQL query
$sql = "SELECT * FROM users WHERE id = $user_id";

// Execute the query
$result = $conn->query($sql);

// Check if the query was successful
if ($result->num_rows > 0) {
// Output data of each row
while($row = $result->fetch_assoc()) {
echo "id: " . $row["id"]. " - Name: " . $row["name"]. "<br>";
}
} else {
echo "0 results";
}

// Close the connection
$conn->close();
?>
29 changes: 29 additions & 0 deletions script/copilot_written.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
def max_product_subarray(nums):
if not nums:
return []

max_product = nums[0]
min_product = nums[0]
result = nums[0]
start = end = s = 0

for i in range(1, len(nums)):
if nums[i] < 0:
max_product, min_product = min_product, max_product

max_product = max(nums[i], max_product * nums[i])
min_product = min(nums[i], min_product * nums[i])

if max_product > result:
result = max_product
start = s
end = i

if max_product == nums[i]:
s = i

return nums[start:end + 1]

# Example usage:
nums = [2, 3, -2, 4]
print(max_product_subarray(nums)) # Output: [2, 3]
31 changes: 31 additions & 0 deletions script/my_code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
class Solution:
def check_prime(self, x: int) -> bool:
for i in range(2, int(x**0.5) + 1):
if x % i == 0:
return False
return True

def primeSubOperation(self, nums: List[int]) -> bool:
for i in range(len(nums)):
# In case of first index, we need to find the largest prime less than nums[0].
if i == 0:
bound = nums[0]
else:
# Otherwise, we need to find the largest prime, that makes the current element
# closest to the previous element.
bound = nums[i] - nums[i - 1]

# If the bound is less than or equal to 0, then the array cannot be made strictly increasing.
if bound <= 0:
return False

# Find the largest prime less than bound.
largest_prime = 0
for j in range(bound - 1, 1, -1):
if self.check_prime(j):
largest_prime = j
break

# Subtract this value from nums[i].
nums[i] = nums[i] - largest_prime
return True
16 changes: 16 additions & 0 deletions script/not_user_writt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def max_product_subarray(nums):
if not nums:
return 0

max_product = min_product = result = nums[0]

for num in nums[1:]:
if num < 0:
max_product, min_product = min_product, max_product

max_product = max(num, max_product * num)
min_product = min(num, min_product * num)

result = max(result, max_product)

return result
31 changes: 31 additions & 0 deletions script/python-sc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
class Solution:
def check_prime(self, x: int) -> bool:
for i in range(2, int(x**0.5) + 1):
if x % i == 0:
return False
return True

def primeSubOperation(self, nums: List[int]) -> bool:
for i in range(len(nums)):
# In case of first index, we need to find the largest prime less than nums[0].
if i == 0:
bound = nums[0]
else:
# Otherwise, we need to find the largest prime, that makes the current element
# closest to the previous element.
bound = nums[i] - nums[i - 1]

# If the bound is less than or equal to 0, then the array cannot be made strictly increasing.
if bound <= 0:
return False

# Find the largest prime less than bound.
largest_prime = 0
for j in range(bound - 1, 1, -1):
if self.check_prime(j):
largest_prime = j
break

# Subtract this value from nums[i].
nums[i] = nums[i] - largest_prime
return True
Loading