15,905,316 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 Python 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 Member 13475664 (Top 16 by date)
Member 13475664
19-Dec-17 11:20am
View
by using example in this link i did
https://stackoverflow.com/questions/31834306/best-algorithm-to-group-data-by-similarity-same-id
but it used to always create new group, if the same ID data is sent it was not sent to that group of ID
Member 13475664
19-Dec-17 10:04am
View
actually i used
std::vector<std::vector<mydata> > GroupByIDs(const std::vector<mydata>& data)
{
std::vector<std::vector<mydata> > groups;
decltype(data.end()) upper;
for(auto lower = data.begin(); lower != data.end(); lower = upper)
{
// get the upper position of all elements with the same ID
upper = std::upper_bound(data.begin(), data.end(), *lower);
// add those elements as a group to the output vector
groups.emplace_back(lower, upper);
}
return groups;
}
but it went on creating new groups it was not storing into the group which was already created if the same ID is sent to this function
Member 13475664
16-Dec-17 14:02pm
View
i found the solution by comparing length of the string, i am finally able to avoid the unwanted lines.
Member 13475664
16-Dec-17 11:30am
View
Deleted
the overall code
start:
while (std::getline(file, line))
{
std::istringstream iss(line);
std::size_t space = line.find(" ", 0);
if (!isspace(line[0]))
{
iss.clear();
}
else
{
int i;
for (i = 0; i <= 12; i++)
{
if (isalpha(line[i]))
{
iss.clear();
goto start;
}
}
iss >> data.time >> data.state >> data.ID >> data.status >> data.type >> data.byte_lent >> data.message_1 >> data.message_2 >> data.message_3 >> data.message_4 >> data.message_5 >> data.message_6;
iss >> data.message_7 >> data.message_8 >> data.type1 >> data.type2 >> data.type3 >> data.type4 >> data.type5 >> data.type6 >> data.type7 >> data.type8 >> data.type9;
Member 13475664
16-Dec-17 6:30am
View
Deleted
the code represent the reading of a file, where i need to extract only the lines that has information other lines must be ignored
the text is actually in the following manner
date Fri Sep 1 02:11:40.195 pm 2017
base hex timestamps absolute
internal events logged
// version 9.0.0
Begin Triggerblock Fri Sep 1 02:11:40.195 pm 2017
0.000000 Start of measurement
0.002893 1 201 Rx d 8 06 0D 00 B0 89 00 0D E7 Length = 227925 BitCount = 118 ID = 513
0.003133 1 280 Rx d 8 1B 0C 7C F1 E8 75 39 67 Length = 221910 BitCount = 115 ID = 640
0.006981 Status:chip status error active
0.006981 Status:chip status error active
0.007123 1 244 Rx d 8 7B 01 00 08 80 80 C0 00 Length = 233925 BitCount = 121 ID = 580
0.007148 2 B2 Rx d 8 C0 13 9A 13 D8 13 C0 13 Length = 221910 BitCount = 115 ID = 178
0.007359 1 246 Rx d 8 55 01 00 49 50 B6 7A 89 Length = 217925 BitCount = 113 ID = 582
0.007394 2 86 Rx d 8 62 00 2A 20 01 84 02 00 Length = 225925 BitCount = 117 ID = 134
i need to ignore those lines that has sentences and read only the lines that have information and store those values in a class.
Member 13475664
11-Dec-17 14:25pm
View
Thanks for the hint I would see through it
Member 13475664
11-Dec-17 7:43am
View
can anyone suggest me how to do this in c++
Member 13475664
11-Dec-17 7:36am
View
is it possible to compare the line format, if the current line and previous line are different then ignore it. So if i compare the line with numbers with the one with sentences then ignore that sentence line
Member 13475664
9-Dec-17 3:02am
View
entire line is one sentence no numbers
Member 13475664
8-Dec-17 10:01am
View
thanks a lot for the help
Member 13475664
8-Dec-17 5:37am
View
sorry i did not get your explination regarding ignoring length
Member 13475664
6-Dec-17 4:33am
View
CAN messages and signals
Member 13475664
5-Dec-17 3:49am
View
thank you so much i would go through and try to implement
Member 13475664
28-Nov-17 8:49am
View
can i get a code example
Member 13475664
21-Nov-17 2:48am
View
i dont want a circle i want a line or curve to move on the form
Member 13475664
21-Nov-17 2:43am
View
i tried its not working
Show More