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

TrevorBean.txt #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 50 additions & 0 deletions PythonTimeLaps.py
Original file line number Diff line number Diff line change
@@ -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: [email protected]
#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)
150 changes: 150 additions & 0 deletions Test2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
//
//#include <iostream>
//#include <fstream>
//#include <string>
//#include <vector>
//#include <sstream>
//
//using namespace std;
//
//int main()
//{
// string fname;
// cout<<"Enter the file name: ";
// cin>>fname;
//
// vector<vector<string>> content;
// vector<string> 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<content.size();i++)
// {
// for(int j=0;j<content[i].size();j++)
// {
// cout<<content[i][j]<<" ";
// }
// cout<<"\n";
// }
//
// return 0;
//}
//
//#include <iostream>
//#include <string>
//#include <fstream>
//#include <sstream>
//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();
}
1 change: 1 addition & 0 deletions TrevorBean.txt
Original file line number Diff line number Diff line change
@@ -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.