Search Results - CodeGuru Forums
 CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

# Search:

Type: Posts; User: zizz

Page 1 of 3 1

1. ## Thread: Game of Pick 4 - How to find similar 4 digit numbers in an array of 120 ?

by zizz
Replies
10
Views
3,291

### Re: Game of Pick 4 - How to find similar 4 digit numbers in an array of 120 ?

You're wellcome.

I served the professional approach to your problem on a silver plate and I hope you have a look at it.
2. ## Thread: Game of Pick 4 - How to find similar 4 digit numbers in an array of 120 ?

by zizz
Replies
10
Views
3,291

### Re: Game of Pick 4 - How to find similar 4 digit numbers in an array of 120 ?

I hate reading other people's code so I just tell you how I would solve this.

I would introduce an alternative representation of a number, lets call it a Digit Frequency Table, a DFT.

A DFT...
3. ## Thread: Which time complexity is true?

by zizz
Replies
6
Views
4,340

### Re: Which time complexity is true?

As has been said the question could be clearer.

But say the posted square-root expression describes F(n) recursively and that the stop criterion is when n reaches 0 that is the function stops at...
4. ## Thread: Replacing GUI in a Win32 application - best strategy?

by zizz
Replies
17
Views
1,592

### Re: Replacing GUI in a Win32 application - best strategy?

Well what was the insult? By editing my post no one can tell.

Moderators shouldn't change replies of others at the very least not in discusions where they participate themselves. Censorship is a...
5. ## Thread: Check if a given 8 byte is a valid double

by zizz
Replies
7
Views
949

### Re: Check if a given 8 byte is a valid double

My comprehension is that any 64-bit bitpattern is a valid double really.

But the OP wanted to know if a certain bitpattern counted as a valid "number" and in that case the tests I suggested would...
6. ## Thread: reference to const

by zizz
Replies
7
Views
846

### Re: reference to const

How is that? What's dangling? _listRef is initialized to an empty QList or am I mistaken?
7. ## Thread: problems in smart pointers

by zizz
Replies
8
Views
1,043

### Re: problems in smart pointers

Well if you mean that an object preferably shouldn't return stuff (be it by pointer or smart pointer or value or whatever) but instead be asked to do things then I agree.
8. ## Thread: vb.net ... why bother?

by zizz
Replies
22
Views
3,034

### Re: vb.net ... why bother?

Yours seems to be quite a common problem because Microsoft even has a resource center dedicated to upgrading legacy VB6 code. There are some tools available to ease the pain. Some are free, at least...
9. ## Thread: Check if a given 8 byte is a valid double

by zizz
Replies
7
Views
949

### Re: Check if a given 8 byte is a valid double

You could check that the 8 bytes (held in a double) is neither std::subnormal, std::infinite nor std::NaN.

Then it should represent some number in the "numeric" range.
10. ## Thread: reference to const

by zizz
Replies
7
Views
846

### Re: reference to const

You could add a default constructor where _listRef is initialized with an empty QList like,

class Device {
public:
Device() : _listRef(QList<QSharedPointer<Data>>()) {}
explicit...
11. ## Thread: problems in smart pointers

by zizz
Replies
8
Views
1,043

### Re: problems in smart pointers

On the contrary, at least if you're using the OO paradigm to programming, the best solution is when all polymorphic (OO) objects are handled by smart pointer everywhere and all the time.
12. ## Thread: problems in smart pointers

by zizz
Replies
8
Views
1,043

### Re: problems in smart pointers

To me it looks like your "dilemma" is self-inflicted. You're complicating things.

Just design like you would in C# or Java with the additional "burden" in C++ that for each introduced OO type you...
13. ## Thread: Replacing GUI in a Win32 application - best strategy?

by zizz
Replies
17
Views
1,592

### Re: Replacing GUI in a Win32 application - best strategy?

You mean it's a contradiction in terms? One cannot be a die-hard Win32 programmer and a WTL user at the the same time?

Apart from sounding like a die-hard xxxx I think you're dead wrong. WTL is...
14. ## Thread: Replacing GUI in a Win32 application - best strategy?

by zizz
Replies
17
Views
1,592

### Re: Replacing GUI in a Win32 application - best strategy?

Although I'm using WTL myself I would describe it as obscure and clandestine. It's mostly for old school die hard Win32 developers who are only comfortable close to the metal. I was about to say that...
15. ## Thread: In Visual C++, how do I define a hash map?

by zizz
Replies
4
Views
536

### Re: In Visual C++, how do I define a hash map?

Googling is fine but there's a very good reference book about the C++ standard library (including the STL containers) available. It's called The C++ Standard Library, 2nd edition, by Josuttis.
16. ## Thread: In Visual C++, how do I define a hash map?

by zizz
Replies
4
Views
536

### Re: In Visual C++, how do I define a hash map?

No, std::map is based on a tree and thus has O(logN) accesses. This is true for all so called associative containers.

The way to go is std::unordered_map. It's based on a hash table and has O(1)...
17. ## Thread: Replacing GUI in a Win32 application - best strategy?

by zizz
Replies
17
Views
1,592

### Re: Replacing GUI in a Win32 application - best strategy?

A good strategy could be to switch to a portable GUI.

Have a look at primarily wxWidgets but also Qt.

http://www.wxwidgets.org/
18. ## Thread: Creating Matrix/map for Topological sort?

by zizz
Replies
4
Views
1,480

### Re: Creating Matrix/map for Topological sort?

It seems Boost offers a topological sort algorithm,

http://www.boost.org/doc/libs/1_55_0/libs/graph/doc/topological_sort.html
19. ## Thread: Algorithm for sorting files on hard disk

by zizz
Replies
1
Views
1,166

### Re: Algorithm for sorting files on hard disk

If the file fits in memory you can read it into an array, sort it using the algorithm that comes with your language's standard library, and then write it back again.

The Java documentation offers...
20. ## Thread: how to count contiguous and common zeros in various arrays

by zizz
Replies
2
Views
786

### Re: how to count contiguous and common zeros in various arrays

You can start by writing a program that can do that for one array. When that works you expand the program to handle several arrays.

If you can check whether a position is zero in one array it's...
21. ## Thread: Implement an expression parser

by zizz
Replies
3
Views
542

### Re: Implement an expression parser

The most famous parsing algorithm specifically for math expression parsing is the Shunting-yard algorithm by Dijkstra,

http://en.wikipedia.org/wiki/Shunting-yard_algorithm

by zizz
Replies
10
Views
904

### Re: about virtual functions and polymorphism

What's so horrible about having to specify the signature of the function you override in the derived class?

If you want to minimize the typing you can even put the implementation directly in the...
23. ## Thread: C++: Convert Jumple Word to Possible Words

by zizz
Replies
4
Views
2,821

### Re: C++: Convert Jumple Word to Possible Words

I assume TILL, TRILL and BRILLIANT are in the dictionary and they're selected because they can be composed from the letters of LARBITNLI. Lets call this property composability.

It's especially...
24. ## Thread: passing an array as a pointer to a function

by zizz
Replies
29
Views
2,847

### Re: passing an array as a pointer to a function

I'm no stranger to optimization. This is a good link by the way,

http://www.agner.org/optimize/optimizing_cpp.pdf

I agree that optimization is a fine thing and that C++ is especially well...
25. ## Thread: passing an array as a pointer to a function

by zizz
Replies
29
Views
2,847

### Re: passing an array as a pointer to a function

That's right.

When you compare a C-array and an std:vector it doesn't matter where they're (both) allocated be it in static, automatic or free memory.

You are confusing C++ with the...
Results 1 to 25 of 56
Page 1 of 3 1