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

Some code running but not saved #14

Open
virtuosonic opened this issue Aug 21, 2023 · 2 comments · May be fixed by #16
Open

Some code running but not saved #14

virtuosonic opened this issue Aug 21, 2023 · 2 comments · May be fixed by #16

Comments

@virtuosonic
Copy link
Contributor

virtuosonic commented Aug 21, 2023

if I type the following code it runs Ok

>> #include <iterator>
>> #include <algorithm>
>> #include <math.h>
>> #include <vector>
>> vector<double> v;
>> v.push_back(M_PI);
>> v.push_back(1.0);
>> std::copy(v.begin(),v.end(),ostream_iterator<double>(cout," "));
3.14159 1 

but when typing the show command the copy call doesn't show

>> show
#include <vector>
#include <math.h>
#include <algorithm>
#include <iterator>
#include "stdio.h"
#include "stdlib.h"
#include <iostream>
using namespace std;
int main() {
vector<double> v;
v.push_back(M_PI);
v.push_back(1.0);

if I add more code it works but doesn't add the copy call

>> int number = 1234567890
>> show
#include <vector>
#include <math.h>
#include <algorithm>
#include <iterator>
#include "stdio.h"
#include "stdlib.h"
#include <iostream>
using namespace std;
int main() {
vector<double> v;
v.push_back(M_PI);
v.push_back(1.0);
int number = 1234567890;

same case here with the for loop, but the initialization after gets saved

>> #include <map>
>> map<int,string> m;
>> m[42] = "the ultimate answer";
>> m[0] = "you are worth nothing";
>> for (auto p : m) {
   ...cout << p.first << " " << p.second << endl;
   ...}
0 you are worth nothing
42 the ultimate answer
>> string othervar = "other va"
>> show
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iterator>
#include "stdio.h"
#include "stdlib.h"
#include <iostream>
using namespace std;
int main() {
vector<double> v;
v.push_back(M_PI);
v.push_back(1.0);
int number = 1234567890;
map<int,string> m;
m[42] = "the ultimate answer";
m[0] = "you are worth nothing";
string othervar = "other va";
@klexas
Copy link

klexas commented Aug 22, 2023

Have you checked the source file itself to see if the contents are ther e?

termic-XXXXXXXX.tmp

Looks like it should be in /tmp, if the content is in that file, them something with the shell. If not, then might just be something small with the append. Let me know, I can take a look later tonight.

@virtuosonic
Copy link
Contributor Author

virtuosonic commented Aug 22, 2023

There are two similarly named files, one contains the copy call and the other doesn't

~$ cat /tmp/termic-26bc3mDo.cpp.tmp
#include <vector>
#include <math.h>
#include <algorithm>
#include <iterator>
#include "stdio.h"
#include "stdlib.h"
#include <iostream>
using namespace std;
int main() {
vector<double> v;
v.push_back(M_PI);
v.push_back(1.0);
std::copy(v.begin(),v.end(),ostream_iterator<double>(cout," "));
~$ cat /tmp/termic-26bc3mDo.cpp
#include <vector>
#include <math.h>
#include <algorithm>
#include <iterator>
#include "stdio.h"
#include "stdlib.h"
#include <iostream>
using namespace std;
int main() {
vector<double> v;
v.push_back(M_PI);
v.push_back(1.0);

@maozdemir maozdemir linked a pull request Aug 26, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants