@grahamdearsley
Forum Replies Created
-
AuthorPosts
-
I remember watching a Tomorrows World program in the early 80’s that promised we would soon be able to fix a severed spinal cord, it said a tiny microchip had been developed that, when attached to a nerve, could read and interpret nerve impulses and retransmit them as light. Two chips linked by fiber optic cable could bridge a break in a nerve, apparently it had worked with frogs legs in a lab.
Still no sign of that one yet 🤥
I suppose if you connected into the optic nerve directly you could do something, but if we could do that now we would already have bionic eyes.
The methods that read brain activity are still only remote controls at best, they can only sense if there IS activity in areas of the brain, not WHAT it is.
As for implanting images directly into your brain, Pah😁
Epic Roller coasters had some new free rides recently though, have a look at that if you havent already.
Ah yes, VR headsets.
I have had the Samsung Gear VR by Oculus for nearly 2 years now, I use it with a Galaxy S9 phone and the results are pretty impressive. Only thing is a lack of new software, once you have gone through all the demos.
Looks like Samsung have stopped supporting it and handed my account over to Oculus so I don’t expect much new stuff now.
It turns out that the implied “this” parameter is not too complicated on its own, where a class member function may have had to specify a data member explicitly, it doesn’t have to if they are both in the same class. Implied “this” gets complicated with return types because there is no actual “this” type to return. C++ lets you specify a return type, such as const, after the parameter list.
I am coming back to it !
In the mean time I am looking at double ended queue types (A dequeue), looks like a vector that supports push_front as well as push_back.
You’re not wrong there Ed, I wouldn’t have looked at the pre-processor yet, if I hadn’t had a problem with a program that used it. On the other hand, I didn’t really WANT to be looking at the pre-processor yet !
I am now going back to looking at classes, starting with the implied “this” parameter that class member functions use. Wish me luck :scratch:
If you CAN stretch to the S10e then you won’t be disappointed.
I have come across a new annoyance, relating to the online code that is provided with some books.
I have already encountered code that uses new C++ features but tries to stay compatible with older compilers by using pre-processor directives, using an #ifdef to check for the existence of pre-processor variables is common, providing a custom function if the variable doesn’t exist. The problem seems to occur if the variable DOES exist but a newer compiler implements the function in a different way from the custom function.
The new annoyance is code that uses features from a newly released version of the C++ standard but that haven’t been implemented in any compiler at the time the book was published, they use the same trick as above but they can’t know for sure what variable name a newer compiler will use to represent a feature.
I just had the above problem and it took 30min to figure out. In my experience its easier to find a problem with missing features than it is to work out what they did to try to prevent a problem !
I like their inferred conclusion. We are seeing polar vortex collapse as in two earlier years but that may or may not make it colder. It will depend on the weather :unsure:
I was also reminded that end() returns a pointer to one past the end of an array because when I forgot the – – end1; statement (the prefix version of – – that always occurs before any other evaluation in a statement that uses it) the program compiled but threw a memory access exception. Not totally safe after all then 🙁
Well thats the thing, I DO need a “using” for “string” otherwise the compiler sees it as a local variable. On the other hand I had to call my pointer “end1” because when I tried to call it “end” the compiler complained about a bad call to end() :wacko:
Some parts of the C++ standard library are indeed written in C++ but some parts of the C library were also written in C !
Works as expected except that I meant to output “*ptr1” not “*nums”. Good job its only an example.
#include<iostream>
#include<iterator>using std::cout;
using std::string;int main()
{
string nums[] = { “one”, “two”, “three”, “four” }; // List initialise an arrystring* ptr1 = nums;
string* beg1 = begin(nums);
string* end1 = end(nums);–end1;
cout << *nums << ” ” << *beg1 << ” ” << *end1; // Prints one one four
}
The above code works as expected but I removed the “using namespace std” statement I was using before and replaced it with explicit “using” statements (As I really should). I was just wondering why I don’t need a using for begin() and end() ? You can see I included <iterator> but that’s not usually enough.
What phone do you have at the moment ?
The decent camera in the size you want seems to be the tricky thing.
I have been following this thread but I have not known what I could say. All I can say now is that that is NOT what I wanted to hear and to send Bob all the best possible wishes.
Yes, if you use the features of C++ as intended you can be extremely LAZY and still be safe . But if you CHOOSE to be stupid… 🙂
And all the pointers in the example are called ptr1, I missed the one off the first one.
.end() gives you a pointer to one past the last element of an array, as with containers. Sorry :wacko:
-
AuthorPosts
