Skip to content

Commit

Permalink
add py code for generating C code to do point query
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyHe1 committed Nov 2, 2019
1 parent 9d28dd6 commit 9c36913
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions testcode/genPointQuery.py
Original file line number Diff line number Diff line change
@@ -0,0 1,19 @@
import random

id = 1
list = []
for i in range(0, 700):
min_x = random.randint(-10000, 10000)
max_x = random.randint(-10000, 10000)
min_y = random.randint(-10000, 10000)
max_y = random.randint(-10000, 10000)

# list.append((str(id), str(x_min), str(x_min x_len), str(y_min), str(y_min y_len)))
list.append([x])
id = id 1

with open('/Users/donghe/Desktop/SecondSemester/CS386D/pointQuery.txt', 'w') as filehandle:
str = ''
for item in list:
str = str ('SELECT * from demo where minX = {0} and maxX = {1} and minY = {2} and maxY = {3}; ').format(item[0], item[1], item[2], item[3])
filehandle.write(str)

0 comments on commit 9c36913

Please sign in to comment.