« first day (466 days earlier)      last day (2611 days later) » 

07:56
Anybody know why I get those downvote in this post?
-2
Q: How to get the digits and the degree of confidence

yodeThis is my target image: Actually my question is similar to this post. But I don't know why the following answer will lead to another direction. I mean, I just hope to get those digits with high degree of confidence. Such as I can do this with another language Then I can just keep those deg...

nwp
nwp
@yode You don't say anywhere what you want to do and why that is not working. After re-reading the question 10 times I think you want to detect numbers and characters in an image, but you don't say that anywhere.
It's also completely unclear what recognize[5] does and how that is related to your problem.
Also you are not supposed to use images for code.
fun. ocr is work on image...is it?
recognize[5] recognize the image is which number
Do you know what I want now?
Could you help me improve it for better read? my English too bad.
I am hard to know your logic about how to understand my words sometimes..
nwp
nwp
@yode Not really. Maybe "Do whatever matlab did" (why are you not just using matlab?) or "How do I get the confidence when using Tesseract when recognizing characters?" (Read the manual for tesseract, I'm sure they have that somewhere).
I think you want to filter recognized characters by confidence but don't know how to get the confidence.
Yes Yes...
"I want to filter recognized characters by confidence but don't know how to get the confidence with Tesseract."
I cost almost one hour to edit that post. It is so hard to understand?
nwp
nwp
08:11
It's a bit hard to understand. It's not a bad question, but it is a boring question. You have to dig through tesseract manuals to find the flag on how to do that using google, which is not very fun. Unfortunately good boring questions tend to be ignored.
@nwp Could you help me improve it for better read?
nwp
nwp
Maybe a better way to ask the question would be "How do I set the confidence threshold for recognized characters in tesseract?" But that has the problem of RTFM.
Did you write the tesseract.exe?
What's meaning of your "Did you write the tesseract.exe?"?
nwp
nwp
In your question you have a picture of a console (don't post pictures of text) where you run tesseract.exe tem.jpg .... Is that a program from you (where is the code?) or from some library (question is not about programming)?
08:40
@nwp Sorry for late response
I'm in cmd
38
Q: How to make tesseract to recognize only numbers, when they are mixed with letters?

zkunov I want to use tesseract to recognize only numbers. The problem is that I have mixture of numbers & letters and when I use SetVariable("tessedit_char_whitelist", "0123456789") for every symbol tesseract returns wrong digit. Can I set a threshold value so that tesseract omits the symbols with low...

Same to this related question.Why it will get 38 upvote?
There is no any code in his question.
nwp
nwp
08:53
@yode Because that question is from a time when SO had different rules. Questions like "What is the best tool to do OCR" used to be on topic.
hey guys I have trouble understanding the purely code meaning of the 4th condition of this C/Java code and I cannot seemed to find anyting about it (since string and value comparisons are often written as something like x==y where x,y are some assigned variables

NB f is some function that takes in integers
in Mathworks on The Stack Exchange Network Chat, 1 hour ago, by user21820
g(m,n) { if( m==n ) return false; if( m/2<n/2 ) return true; if( n/2<m/2 ) return false; return ( f(m/2)==(m<n) ); }
specifically, what type of C property we are using in the line f(m/2)==(m<n), where m,n are integers?
nwp
nwp
@Secret m/2 uses integer division which will produce an integer instead of a fraction, essentially rounding down. Depending on what f returns there may be an implicit bool -> something conversion.
but what does it mean for it to equal (m<n). Is (m<n) a string or integer value or something?
(NB forgot to clarify , f maps integers to booleans)
nwp
nwp
It's a bool, unless someone really screwed up operator overloading.
I see
nwp
nwp
09:02
And since f returns a bool too you compare 2 bools which produces a new bool which gets returned. Looks reasonable, although I have no clue what g does. Mathematicians tend to not be good with descriptive naming.
I am ok with reading the code except that 4th bit above. Now it is clear. Thanks

(NB g is a function that, in simple terms, arrange the natural numbers in different notions of increasing order one by one by comparing whether one is smaller than the other)
 
1 hour later…
Ron
Ron
10:26
This question has got me wondering. How do you implement user defined conversion from string to class? I take it it's some operator overloading such as () and then you assign the value to some member variable. A bit unclear on the syntax part.
Eeer, seems like I found something similar. Scratch that please.
 
1 hour later…
11:30
I need to store links of multiple linked lists in a single container (why? because I only have the links; I don't know which link belongs to which linked list). I need to then print all the linked lists from that container in O(n). The item in the linked list is an integer which ranges from 1 to 1,000,000,000.
you mean separate a graph's vertices into their disjoint graphs?
11:53
Hey guys, I'm confused with the evaluation of the expression: int x = 2; y = ++x + x++ * ++x; Why the result is 20? Why it is not computed like this: y = ++x + 2 * 4 = 5 + 2 * 4 = 5 + 8 = 13?
you shouldn't care about stuff like that
except that it's undefined
12:10
Yes, this is an unrealistic case. I find this example (unfortunately without the answer) and I am curious about the solution. What's the reason that this is undefined, please?
order of evaluation, and to give compiler writers some freedoms in how to compile this down to machine code
there is a massive list of rules: en.cppreference.com/w/cpp/language/eval_order
> 2) The value computations (but not the side-effects) of the operands to any operator are sequenced before the value computation of the result of the operator (but not its side-effects).
> 4) The value computation of the built-in post-increment and post-decrement operators is sequenced before its side-effect.
5) The side effect of the built-in pre-increment and pre-decrement operators is sequenced before its value computation (implicit rule due to definition as compound assignment)
Ok, thank you!
the side effect of the pre and post increment is explicitly disconnected from the value of the pre and post increment expression and operators don't sequence with it
12:40
Some people avoid using pre- and post-increment as part of a larger expression for this reason. Although a few limited idioms which use them are useful.
Good compilers will warn you if try to do something like the above. "Result may be undefined" or something similar.
@Brandin Yes, it seems that -Wunsequenced parameter may be helpful. By the way, I find this site godbolt.org that shows assembly code based on the selected compiler.
13:04
Well, yes, the compiler will likely produce something. But when it is undefined it means you can't really trust what it's going to do. If you're using Clang, for example, maybe the Clang folks will decide to do it differently for the next point release, or to issue an error message if you try to do that.
Exactly. I mentioned the page just because someone can verify that the result in different compilers differs.
undefined means the compiler doesn't need to implement any checks for it. It's possible that it even emits invalid code. For example in a pipelined architecture where you cannot have a store and a load to the same location within n cycles of each other
Yes, some people like to make quite exaggerated claims for what undefined means. Perhaps it launched all missiles? Well, if your software is in charge of missiles, maybe it is not so bad to be that paranoid.
13:23
nasal demons being a old meme for that
13:41
though given that UB is often used for malware exploits it's not unfeasible that real damage outside the machine it runs on is possible
14:41
@JerryCoffin Yeah, I was not aware of the IV's purpose until milleniumbug said it, and thanks for clearing that up. That is exactly what I am doing right now.
@David To answer directly: the main reason is simply because there's no good reason to make it defined. The amount of time and effort available to the committee is extremely limited--would you rather they spent their time on defining the consequences of code that nobody should write anyway, or defining something that might actually be useful?
@Guapo Cool.
Sup guise
say I do
std::unique_ptr<Father> x;
std::unique_ptr<Son> y;

// Some stuff that will populate x and y.. Such that y depends on x
How can I specify a memory barrier to prevent the compiler from reordering the instantiation of x and y?
are you trying to protect yourself from static initialization order fiasco or...?
I'm reading the doc about <atomic> but to my dismay I don't understand jackshit
wait, no, I don't get it either
14:49
I want to make the compiler doesn't reorder the instantiation of x and y
I want it to first create x then y
IOW, I want it to respect the order of declaration I specified in my source file
default construction of unique_ptr is to nullptr (empty)
That's not the issue
what does "instantiation" mean here? as in template instantiation? or do you mean construction
or...?
@milleniumbug construction
if it's in the same TU, you don't need to worry about SIOF
14:50
yeah sorry, wording comes from my java days
where are they declared, global space, (static) member variables, function variable,...
it only becomes a problem across TUs
function local non-static variables
local variables are constructed in the order you specify them in, and destroyed in the reverse order
so it's ordered by default
14:52
ok I thought the compiler was able to reorder them as it wanted
there is the as-if rule but that should result in visible changes
@Rerito oh, the default value of std::unique_ptr is nullptr, so if you're filling them in later, of course it may happen that you'll call something that accesses y before you fill in x.
the destruction still happens in the reverse order of construction
@ratchetfreak forgot to add a not...
Ok I was just convinced that the compiler was free to reorder local variable construction
reordering applies to global and non-local static variables across TUs
so your judgement to fact check this was a right one
15:02
I'm looking for the reference in the standard
Variables with automatic storage duration (
3.7.3
) are initialized each time their
declaration-statement
is
executed. Variables with automatic storage duration declared in the block are destroyed on exit from the
block (
6.6
)
In 6.7
I'ld guess that describes what you guise told me (or am I lost there?!)
this is what I found too. it doesn't seem to be explicit enough in the provided guarantees so maybe there's a better quote
Actually my coworker didn't declare them in the right order (I assume he did so that's why I went the "memory barrier" route)
Ron
Ron
15:42
Does latest revision in this one leak memory or not? I think it does not.
it doesn't
Ron
Ron
Thanks.
15:56
@Rerito Each declaration includes an init-declarator ([dcl.decl]), which is considered a full-expression. ([intro.execution]/12.3). "Every value computation and side effect associated with a full-expression is sequenced before every value computation and side effect associated with the next full-expression to be evaluated." ([intro.execution]/16.)
(citations are to n4687)
 
1 hour later…
17:04
Fun, same environment and same code
This vs cannot run normally this code
But this version with a "B" can:
 
2 hours later…
19:25
I try to push the string ".." into my vector, it only saves "."
How do I fix this?(I have full sample/example code if need be)
1 message moved from Lounge<C++>
Sorry for misplacing the question, it's been a long time since I was here :P
std::vector<std::string> vec; /* ... */ vec.push_back(".."); // there
Hmm
Try this code:
#include <iostream>
#include <string>
#include <vector>

std::vector<std::string> pathBranch(std::string dissectionString) {
int slash = 0;
std::string newStr = dissectionString;
std::vector<std::string> v;
while (newStr.length() > 0) {
slash = newStr.find("/");
std::cout<<"SLASH IS AT:"<<slash<<'\n';
v.push_back(newStr.substr(0, (slash - 1)));
std::cout<<newStr.substr(0, (slash - 1))<<'\n';
newStr = newStr.erase(0, (slash+1));
std::cout<<"THE NEW STRING IS: "<<newStr<<'\n'<<'\n'<<'\n';
}
return v;
have you tried debugging
and stepping by each statement
19:33
I didn't only because I had a huge project up with tons of tabs in Visual Studio, I'm trying stuff out in CodeBlocks on the side. Didn't think it would be this weird, but I guess I'll try.
I kept thinking I'd eliminate the slash before moving to the next branch in the path, turned out it was responsible.

« first day (466 days earlier)      last day (2611 days later) »