Click here to Skip to main content
14,980,809 members

Comments by den2k88 (Top 36 by date)

den2k88 26-Apr-21 5:02am View
   
You are using CRT functions, those use the system locale to print characters. Check if you are using the en_US locale instead of ja_JP.

Refer to your Operating System documentation for how to change your locale.
den2k88 15-Apr-21 9:16am View
   
There are reasons these are homeworks.
den2k88 13-Jan-21 3:56am View
   
This is a good angle I didn't think of, thank you!
den2k88 24-Nov-20 5:33am View
   
Actually all versions are downloadable for free and only the license tied to the account changes. In cases like this it is a reasonable assumption that the offered features depend on the subscription level.

VS is not banned on their site: I requested it and they delivered - but they themselves discovered they can't give me the license so I'm stuck with the 30 days trial.

Work is on their equipment but in my company's premises, but I'm working from home due to pandemic. Messy situation. I already spent 100$ to cable the house because I onbly had wifi and the suckers gave me a desktop PC without wi-fi. Since I was going to do it anyway (I wanted to move my net equipment in an area where the cat is allowed only under supervision) I didn't complain.

Well, I will embrace the suck. Thanks for the answer!
den2k88 24-Nov-20 4:54am View
   
Situation is complex: the environment is not on VS at all, it's on an IDE for a very well known embedded system.

That IDE sucks. It *is* workable but to find answers that with VS+VAX it takes me 30 seconds, it requires me half an hour with the right IDE.

So I have no pressing need, the customer is stingy and my company is trying to win them because they are OEM manifacturer for a large market we're not into.

I cant fsck up in any conceivable way.
den2k88 27-Feb-18 3:33am View
   
I upvoted and bookmarked it: I will probably need it in the near future and I would have stumbled upon the same obstacle :D
den2k88 10-Jan-17 11:26am View
   
Most of the times the definition needs no change whatsoever. By having them separated it's fairly easy to check if different versions of the same software share the same interface to the class (single software with hundreds of branches tailored to the customers, each branch possibly coming from different versions of the base software).

One thing is the interface, the other is the code. While Interfaces solve the problem they are actually a tool thought for other purposes (defining precisely what a class MUST DO to fulfill its end of the "contract") instead of giving a quick summary of what operation does the class do, which operations are accessible from the outside world and which data does it hold.
den2k88 10-Jan-17 11:21am View
   
Yes I knew them but they still keep together declaration and implementation. IMHO I'd end up hating them because instead of having a big book and an index (c and c++ way) I would end up with several booklets and no index whatsoever (partial classes).
den2k88 10-Jan-17 11:20am View
   
It's not MEF that I need (though I'll bookmark it for future needs, thanks), the whole reasoning is under OG solution. I just like to split what to expect from how it is implemented, it's a way to have better documented code (i.e I explain what a class does and the logic of it in the header, then the gory details and suggestion for a better code in the implementation. Less clutter).
den2k88 10-Jan-17 11:17am View
   
I normally use the header file to describe what to expect from a class, an index which me and my coworkers look and know instantly that this class has these methods, exposes those properties and defines these data types. If it's a derived class then it adds these methods and overrides these others. Then in the implementation file there are the gory details over which regions are useful and so on.

Partial classes are useful but still blocks comprising of both definition and implementation - there has been only a single instance in which I would have liked them in C++ though, splitting the implementation may lead to a bigger mess than before.

I guess I'll have to use interfaces for the needs I have but correct me if I am wrong, interfaces cannot declare nested types and data members, don't they?
den2k88 4-Sep-15 11:44am View
   
At work we are forced to use VB6 and my colleague did the very same thing: no way to make it work under Win7 64 bit.
den2k88 4-Sep-15 11:43am View
   
Please, please, please, sometimes a developer just don't have the choice. This answer bring no good to anyone...
den2k88 29-Jun-15 9:56am View
   
Reason for my vote of 4 \n This translates roughly to "check for nulls before using values" which is something any programmer not born in the JavaNullPointerException era does as a mantra. Still it is a useful "watch out, nulls can be returned even wheter you don't expect".
den2k88 23-Mar-15 6:16am View
   
My idea would be to loop asking 64 (or n) bytes and storing inside a buffer until either ReadFile returns FALSE or it reads less bytes than asked.

When you have to read an unknown amount of data it is the simplest way, and in many cases the only one.
den2k88 23-Mar-15 3:56am View
   
Oh, sorry, I didn't look deeply in the article: it means the same as *& but in a C++/CLI (for .NET) context.

^ means the same as * but for a managed reference, while ^% means the same as *&. More on wikipedia: http://en.wikipedia.org/wiki/C%2B%2B/CLI
and MSDN of couse explains better (I have only a little experience with .NET).
den2k88 7-Jan-15 9:30am View
   
Reason for my vote of 3 \n It's hard to define the performance of one environmnet towards the other with a "simple" math computation, especially using the same algorithm, since it will be compiled somewhat similarly.

When we speak about C performance we take into account the possibilites of manual optimization, for example many algorithms may be rewritten to operate sequentially on the elements of a matrix in order to have only one cycle and one advancing pointer into the memory (Sobel algortihm for example), meaning less computation of indexes and non sequential accesses to memory.

Also the insertion of intrinsics and assembly code, plus the unsafe typecasts, function pointer calls, memory zeroing, allocation/deallocation of memory managed focussed on the single application...

Of course many of these techniquese aren't easy, nor secure or general - they all are tradeoff for performances, which in some environments are as important as functional requirements due to timing contraints on the provided output.

Concluding, I think this article is conceptually flawed, but the author for sure put a decent amount of work in it and did a decent job.
den2k88 20-Dec-14 8:48am View
   
Reason for my vote of 1 \n Plagiarism is well received on CP not.
den2k88 2-Dec-14 5:32am View
   
Then broaden your horizons, look even outside your country - I am Italian, I am used to look abroad ;) improve your spoken and written English, maybe think about studying abroad, for example in Italy there are Politecnico di Torino (Polytechnique University of Turin) and Politecnico di Milano (Polytechnique University of Milan) that regularly accept foreign students from any part of the world and provide grants.

This two universities give a high chance of finding jobs worldwide, and the English taught lessons aren't particularly demanding, being that many professors aren't native speakers as well.

By the way, it is quite normal having fears before finishing school, we all passed through that :)
den2k88 25-Nov-14 9:12am View
   
What error?
What is the expected result?

PS: next time don't write the title all in uppercase, it means shouting and it is rude.
den2k88 21-Nov-14 8:00am View
   
I'm sorry but can you tell us something more? The question is poorly worded - what do you mean with "How Do I Get The O/P In Single Digit"?
den2k88 20-Nov-14 15:48pm View
   
More on ASCII vs UNICODE
https://social.msdn.microsoft.com/Forums/en-US/8d16d37d-a956-4932-9662-b73c4cf4d0e6/turn-off-unicode-on-platform-sdk-using-visual-c-express?forum=Vsexpressvc
den2k88 20-Nov-14 5:10am View
   
Deleted
Or, as the other users said above,

int WINAPI foo (LPSTR bla)

afer all WINAPI is just a define for __stdcall
den2k88 19-Nov-14 8:41am View
   
Can you expand? It's hard to understand what you're asking. Also please include the code in a preformatted block and please indent it correctly.
den2k88 19-Nov-14 3:52am View
   
http://support.microsoft.com/kb/815650

This solution does exactly the same as putting the correct path in Additional Dependencies
den2k88 18-Nov-14 11:13am View
   
You're welcome!
den2k88 17-Nov-14 10:51am View
   
Nope, it means one *match*.

fscanf("%d %d") for example returns 2 if it sees 2 integers, 1 if there is only one, 0 if none. It is not tied to the number of characters!
den2k88 17-Nov-14 5:36am View
   
Aaaand the question would be? You posted this code extract in 5 questions with 5 different titles in the same number of different categories all of them this morning, which incidentally is the same day you subscribed. What are you trying to accomplish?
den2k88 17-Nov-14 5:15am View
   
It is not a question of programming language: there are math function parsers for every language invented. The choice of the language and IDE is a matter of your liking.

I would suggest using C, C++ or Java because VB6 is "dead" (almost, there are a number of companies including mine where it is still widely used for production code) but it has some limitations that mede sense 15 years ago (and many not even then). Also your acquired knowledge will be more useful. Still, the quickness of VB6 for scrap projects is unmatched IMHO.
den2k88 17-Nov-14 4:42am View
   
I comment myself: I though "function" as "subroutine that returns a value" not function as the mathematical element. Sorry!
den2k88 16-Nov-14 11:10am View
   
Ok, right I got it - that was pretty tricky indeed. Good solution!
den2k88 15-Nov-14 17:21pm View
   
What problem did you have with '&&'? It should work fine, also it's not safe to use ungetc to undo a fscanf.
den2k88 14-Nov-14 7:47am View
   
So you know it's shape. I'd say that either you try with the automatic learning project of OpenCV (I don't remember its name and I don't have OpenCV doc at hand nor free internet access, sorry for that) and a large number of samples - that would be the easy way since it requires little coding and headache or you start designing the logic to understand, based on the edges/contrasts/shape of the image if you are looking at a cooler o not.
That requires experience and a not trivial work to be done, but there are no other ways. Image processing is largely a non deterministic field.

EDIT: I found an answer on stackoverflow HERE http://stackoverflow.com/questions/6416117/simple-object-detection-using-opencv-and-machine-learning.

There are a little more accurate pointers than the ones I gave you before.
den2k88 7-Nov-14 6:31am View
   
This is a clever (meaning pretty harsh) exercise. I think I have drafted a solution (not tested) but since it is a homework it is better to find the REASONING behind.

I assume this is a basic programming course, so I will use only basic instructions and will not focus on efficiency - it might complicate things a lot.

First thing, you are working with a string and searching substrings. So for the first thing you should scan the string char by char with a for cycle (let's say we use the variable i as counter).

Second thing, you obviously need to look subsequent characters in the string, so you will need a nested cycle (let's use variable j) that starst from the current value of the outer loop and scans until the end of the string, comparing the i-th carachet with the j-th.

Third, you need to find substrings, so you might need another nested cycle (let's use k) that when i-th and j-th characters are the same starts looking if the characters at the positions i+k and j+k are the same, and counts the equal characters.

Then, if you have more than 1 character you found the substrings. I left out most of the logic pointing out only the basic block-building reasoning behind the problem, the same reasoning I followed to draft the solution.

Think on this and try to write it down, see what goes wrong and do some trials, them eventually report us where you're stuck or wether you've benn successful.

Hope to be of help,
Denis
den2k88 7-Nov-14 6:09am View
   
To make it work you should declare UniqueID in a .cpp (or .c) file, THEN refer to it with external in header and FINALLY including that header.

That is because whe you use the "extern" keyword you are substantially telling the compiler "look, somewhere in the code this symbol is defined so don't shoot an error right now and pass the job to the linker". But if that symbol is non-existant in any of the .obj files created by the compiler (and they depend entirely from the .c o .cpp files) it is the linker that issues the error.

Also, sorry for the dealy in the answer, I did not see your comment up until now.
den2k88 7-Nov-14 6:03am View
   
That's a homework, I'd bet on it.

Anyway, what do you mean with "symmetric substring"? In which context? How is it made?

When you ask question be more specific, try things and tell us where you're stuck. We could even help with the reasoning behind, but this is not a code-for-free site.
den2k88 5-Nov-14 3:22am View
   
What error does it give? Can you post a bit more of the surrounding code? Help us to help you!