16,015,531 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Vaclav_ (Top 35 by date)
Vaclav_
22-Jul-20 17:15pm
View
Why should I accept my own "answer"? Let's not get too hang up on procedures. So if you obviously look at the answer, why don't you save ( my ) time and accept it?
Vaclav_
20-Jul-20 22:11pm
View
Sorry, no dustbin in original post, just in "Solutions". Do not want to do something upsetting to the forum by deleting them.
Vaclav_
13-Jul-20 8:19am
View
Richard,
maybe , just maybe , it would help (YOU) to for once to read THE WHOLE SENTENCE. To continue to write stupid comments does not help ANYBODY. Find a different way to entertain yourself - may I suggest stamp collecting or basket weaving.
Vaclav_
10-May-20 12:36pm
View
So me admitting that I did not post it the way people will interpret it as " why is the printf not executed" is my fault. Sorry , it is not my fault if people do not read REQUIRED " what did you try " unless I post "I did ask Mrs Google..." Give me a break. I do not ask to read in-between line, but (for) simple analysis....
Vaclav_
10-May-20 11:44am
View
Sorry folks, but the question was "why not all printf are executed?" . I did not spell it out correctly. It is not question of clearing / flushing, but question is why is it not executed in first place. "I am using multiple printf because when I used only one there is NO output at all."
Vaclav_
8-May-20 17:46pm
View
OpenGL has a "feature" glFlush described as " force OpenGL to complete the previous code IMMEDIATELY" I am not interested in finding out why , but with current experience with printf and a suggestion to use fflush stdout it looks as this "flush stdout " has similar function. So if this is just another version of cout /cerr lacking synchronization with main process I guess "...And that's the way it is..." (W,Cronkite )
Vaclav_
17-Apr-20 10:40am
View
If I am reading the real replies correctly - the scale type has no bearing on automatic type conversion when scale = 1/2; I suppose an example of automatic type conversion would bring another RTFM "reply". Case closed.
Vaclav_
17-Mar-20 19:18pm
View
You have to declare an instance in one and only one place. Then everywhere else the variable is accessed you use the extern modifier.
Perfect.
Thanks
Vaclav_
2-Mar-20 13:32pm
View
Internet and forums, including this one, should not be replacement for education - so your best course of action for " where to start" would be to "ask Dr. Thompson". Assuming he /she is a real educator - most forum participants are not.
Vaclav_
2-Mar-20 10:26am
View
Perfect solution , beats fiddling with "string".
Vaclav_
1-Mar-20 23:04pm
View
YES it is a problem
shows that using "2>&1" is bogus IN THIS CASE.
Hence original question #1 answer is incomplete - FOR (MY) LEARNING purpose.
Vaclav_
1-Mar-20 12:37pm
View
Now BOTH of these EXAMPLES output to console.
BTW I have used HCI as an example, I guess I need to spell that out next time Gees.
cout <<"\t\t\t hciconfig -a 2>&1"<< endl;
system("hciconfig -a 2>&1");
cout <<"\t\t\t\hciconfig -a "<< endl;
system("hciconfig -a ");
Vaclav_
1-Mar-20 12:25pm
View
stderr to stdout. The "|" (pipe symbol) says to pass all output (i.e the combined stderr and stdout
BUT at that point the stderr was redirected to stdout so there in no stderr as "all output" so what is being commbined / piped ?
Vaclav_
19-Feb-20 7:16am
View
I like to add this "comment".
I have asked "how to do it right ..."
CPallini's is the best solution , and with combination of last Richard's comment actually explains why - irregardless of my mistake in using same names - creating ifstream object or creating ifstream object with parameter is the main difference . Thanks for all the comments - SOLVED and more.
Vaclav_
18-Feb-20 20:26pm
View
Well - you are free to "believe" whatever, but I have noticed that such "funny" commentaries are becoming more and more on this site.Did not used to be that way.
Perhaps periodic refresher reading the instruction would out these commentaries where they belong - on social media.
Happy coding - over and out...
Vaclav_
18-Feb-20 20:17pm
View
Apparently fstream OPENS the file hence I was actually doing it twice and that
helped" to create the conflict. Using "shadowing" instead of "duplicate " helps with my vocabulary , however I would prefer "duplicate"....
Vaclav_
18-Feb-20 17:45pm
View
Richard - as always you have a valid point.
What I do object in this case is "smart " comments on # of lines , AI etc.
People like this really should read the instruction "how to answer etc " FIRST.
Such superficial comments do not contribute to the SOLUTION.
" better be silent and be thought off as a fool or speak-up removing any doubts "
Vaclav_
18-Feb-20 16:38pm
View
So how do I specify that I want to work on parameter (file) passed ?
Vaclav_
18-Feb-20 16:32pm
View
Be little more understanding would help.
Posting (....you world choice here... such as silly etc) comments DOES NOT HELP the OP.
Posting code and specifying the errors on lines without posting the error or identifying the code lines...
should be pointed out to the poster
or
should be passed over without silly comments
"read the posting instruction " - FTFM
Vaclav_
17-Feb-20 11:08am
View
Both nice solutions, but...
it's the terminology which is puzzling
"char *" is a string in C
and
"string" x is a string in C++
Thanks
Vaclav_
6-Feb-20 13:50pm
View
Richard,
I am looking at two options in
setsockopt(FileDescriptor_socket, SOL_SOCKET, SO_LINGER | SO_REUSEADDR,
(const char*) &lin, sizeof(int));
Looks as SO_LINGER works at "completion of running program" - pretty vague or directly when exit() is processed. Not tested.
SO_REUSEADDR is specifically to allow bind() to reuse the address -that is where the "address already in use " is generated. So far no success.
The man specifically states "for AF_INET " so I am not sure if it will work for AF_BLUTTOTH.
socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
Vaclav_
1-Feb-20 13:48pm
View
I have tried both char and string - failed same way.
Vaclav_
31-Jan-20 14:17pm
View
To "find out what is going on" comment is superfluous. Not really helpful...As far as I remember "open" creates a file IF it does not exist then opens it for whatever mode is specified or in case of stream by the actual "command".
The file location in this case is immaterial, perhaps I will get a different error if file cannot be created "in folder". ( I'll will select non existent folder next ) I am trying to debug this in some logical way by altering analysing the ONLY thing which is changing - the file name.
Here is my latest
ofstream file_1;
file_1.open("file_1.txt"); //open a file
if (file_1.is_open())
cout << "open " << endl;
else
cout << "closed " << endl;
socket.perror_cpp("File 1 state ");
file_1 << "Hello file\n" << 75; //write to it
file_1.close(); //close it
fstream file_2;
file_2.open("file_2.txt"); //open a file
if (file_2.is_open())
cout << "open " << endl;
else
cout << "closed " << endl;
socket.perror_cpp("File 2 state ");
file_2 << "Hello file\n" << 75; //write to it
file_2.close(); //close it
The first "open" works, the second fails - consistently.
Vaclav_
31-Jan-20 12:48pm
View
Why would different name format behave this way ?
Vaclav_
27-Jan-20 9:42am
View
Thanks.
I am not sure how this "forum" works, but I like to ask follow-up questions Since I am not sure how the "mother" project actually links to "bluetooth" library - for this to work - does GCC wants full file name libbluetooth.a?
Do I have to supply path to the whatever file name is correct ( full or "castrated" )? It is falling now ( g++: error: libbluetooth.a: No such file or directory) and I am just fumbling around trying different ways.
I have implemented bluetooth library long time ago and I am sure it has "system " path - no (-L).
Vaclav_
26-Jan-20 19:38pm
View
Go thru your code and remove the duplicates.
Vaclav_
26-Jan-20 14:37pm
View
"Note: there were 11 duplicate class definitions."
???????????????????????
Vaclav_
25-Jan-20 14:29pm
View
After further research I woudl add - I am missing link to object file - perhaps impossible to link object files between projects.
I was hoping I do not have to make it a library.
Which would "generate" another question - how does "normal project" links to object files?
Vaclav_
21-Jan-20 23:04pm
View
SOLVED
Purfect...perror_cpp prints EXACTLY where it does most good.
Tracking socket behaviour in REAL time!
Thanks
Vaclav_
21-Jan-20 18:21pm
View
I feel this may shed some light on the issue.
Here are quotes from elsewhere:
"by default cout is buffered " and "new line at the end of cout will clear the buffer"
With that - the issue is NOT with cout anyway , but with cerr / perror.
I can add endl or /n to cerr or add flush to whole cerr line.
Not sure how to "add" such to perror - since it prints the optional message first then the actual text of the "errno" .
Vaclav_
21-Jan-20 12:40pm
View
I am sorry, since this has been a long time issue, I totally forgot about "flush". Yes, I did use it and it did not help. But I'll try it again.
I'll give strerror a try too. Thanks
Vaclav_
25-Sep-18 20:33pm
View
While tracking other issue noticed this.
It looks as msbbox was not initialized properly,
however the output to the screen contained additional printable
"characters. I'll check the latest "save" file next to verify if
"Received SIGHUP or SIGTERM" generated it.
++ sudo nano /etc/network/interfaces
Received SIGHUP or SIGTERM
+ whiptail --title 'Command sudo nano /etc/network/interfaces output 1403' --sep' 17 80 10ut --scrolltext --msgbox '
+ echo 'STOP HERE 1413'
STOP HERE 1413
Vaclav_
22-Sep-18 9:33am
View
I asked for explanation when to use command substitution or redirection.
Since everything in Linux is a file, I assume I can "redirect" from stdout to VARIABLE - in this case "index".
I did specify that I did attempted to do so.
I will eventually figure out how.
Vaclav_
25-Mar-11 10:21am
View
I am a little late in posting my comments, but basically I had a failing hard drive which eventually crashed for good.
Lesson learned - if in doubt - toss it out!
Vaclav_
25-Mar-11 10:16am
View
Thanks, this will get me started.
I guess I still need to make sure the SDK is valid for the IDE.
For now I'll stay with VC++ 6.0
Show More