diff --git a/PythonTimeLaps.py b/PythonTimeLaps.py new file mode 100644 index 0000000..fcc04ac --- /dev/null +++ b/PythonTimeLaps.py @@ -0,0 +1,50 @@ +import os +import time +from datetime import datetime +url="http://bawndotest.mattmoose.net/api/images/plantId/2" +api="http://bawndotest.mattmoose.net/api/images/plantId/2" +#files=open('test.jpg', 'rb') +#dropbox Email: Trevarian@outlook.com +#dropbox Pass: H3 + +FRAMES = 1 +TIMEBETWEEN = 7 + +frameCount = 0 +os.system("ls") +os.system("mkdir Timelaps") + +while frameCount < FRAMES: + imageNumber = str(frameCount).zfill(7) + imageTime = datetime.now().strftime("%m_%d_%Y-%H_%M_%S") + os.system("libcamera-still -o Timelaps/image%s.png --width 420 --height 380"%(imageTime)) + frameCount += 1 + file= "Timelaps/image%s.png"%(imageTime) + os.system('curl -X POST "http://brawndotest.mattmoose.net/api/images/plantId/2" -F "image=@/home/yooz/Documents/Timelaps/image%s.png"'%(imageTime)) + time.sleep(TIMEBETWEEN - 6) + #data = (open(file,'rb').read()) + #r = requests.post(url,data=data) + #response = requests.post(url, files ={'media': files}) + ##if response.ok: + ## print(resonse.text) + ##else: + ## print("Not Quite") + #requests.post(url, files=files) + #os.system("curl -d /home/yooz/Documents/Timelaps/image%s.png http://bawndotest.mattmoose.net/api/images/plantId/2"%(imageTime)) + #os.system("scp http:bawndotest.mattmoose.net/api/images/plantId/2:Timelaps/image%s.png "%(imageTime)) + #os.system('curl -X POST "http://brawndotest.mattmoose.net/api/images/plantId/2" -F "image=@/home/yooz/Documents/Timelaps/image%s.png"'%(imageTime)) + #(--header "Content-Type: file/image") + #time.sleep(TIMEBETWEEN - 6) + + ###with open("Timelaps/image%s.png"%(imageTime), "rb") as f: + ###im_bytes = f.read() + ###im_b64= base64.b64encode(im_bytes).decode("utf8") + ###headers={'Content-type': 'application/json', 'Accept': 'text/plain', 'transfer-encoding': 'chunked'} + ###payload= json.dumps({"image": im_b64, "other_key": "value"}) + ###response = requests.post(api, data=payload, headers=headers) + + #try: + # data.response.joson() + # print(data) + #except requests.exceptions.RequestException: + # print(response.text) \ No newline at end of file diff --git a/Test2.cpp b/Test2.cpp new file mode 100644 index 0000000..9a886ef --- /dev/null +++ b/Test2.cpp @@ -0,0 +1,150 @@ +// +//#include +//#include +//#include +//#include +//#include +// +//using namespace std; +// +//int main() +//{ +// string fname; +// cout<<"Enter the file name: "; +// cin>>fname; +// +// vector> content; +// vector row; +// string line, word; +// +// fstream file (fname, ios::in); +// if(file.is_open()) +// { +// while(getline(file, line)) +// { +// row.clear(); +// +// stringstream str(line); +// +// while(getline(str, word, ',')) +// row.push_back(word); +// content.push_back(row); +// } +// } +// else +// cout<<"Could not open the file\n"; +// +// for(int i=0;i +//#include +//#include +//#include +//using namespace std; +// +// +//int append() +//{ +// const char comma = ','; +// string line, word; +// int size = 0; +// +// +// ifstream in("MockInput.txt"); if (!in) { cerr << "can't open file"; return 1; } +// ifstream in2("MockOutput.csv"); if (!in) { cerr << "can't open file"; return 1; } +// ofstream fout("MockOutput.csv"); +// while (getline(in2, line)) // get successive line of text +// { +// stringstream ss(line); +// bool first = true; +// while (ss >> word) // get successive words/values per line +// { +// if (!first) fout << comma; // second and later words need a separator +// fout << word; +// first = false; +// size++; +// std::cout << word; +// if (size == 3) +// { +// fout << "\n"; +// size = 0; +// first = true; +// } +// +// } +// fout << '\n'; // end of line of output +// } +// while (getline(in, line)) // get successive line of text +// { +// stringstream ss(line); +// bool first = true; +// while (ss >> word) // get successive words/values per line +// { +// if (!first) fout << comma; // second and later words need a separator +// fout << word; +// first = false; +// size++; +// if (size == 3) +// { +// fout << "\n"; +// size = 0; +// first = true; +// } +// +// } +// fout << '\n'; // end of line of output +// } +// +// in.close(); +// in2.close(); +// fout.close(); +// +//} + +int main() +{ + const char comma = ','; + string line, word; + int size=0; + + ifstream in("MockInput.txt"); if (!in) { cerr << "can't open file"; return 1; } + ofstream fout("MockOutput.csv"); + fout << "timeplace" << ", " + << "testaverage1" << ", " + << "testaverage2" << ", " + << "\n"; + while (getline(in, line)) // get successive line of text + { + stringstream ss(line); + bool first = true; + while (ss >> word) // get successive words/values per line + { + if (!first) fout << comma; // second and later words need a separator + fout << word; + first = false; + size++; + if (size == 3) + { + fout << "\n"; + size = 0; + first = true; + } + + } + fout << '\n'; // end of line of output + } + + in.close(); + fout.close(); + //append(); +} diff --git a/TrevorBean.txt b/TrevorBean.txt new file mode 100644 index 0000000..8249f66 --- /dev/null +++ b/TrevorBean.txt @@ -0,0 +1 @@ +Hi, my name is Trevor Bean, this is one of the last two classes I am taking to complete the info systems-C++ associates and Java Computer Science at WCC. I'm a major fencing fan, as well as a strategy, and role play gaming enthusiast. \ No newline at end of file