Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

Curi0us_George

@Curi0us_George
About
Posts
85
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Writing a Spyware
    C Curi0us_George

    This is actually a pretty large project you're looking to undertake. Each of those programs, and quite possibly each version of those programs, would need a custom "spy" tool implemented. It's also a massive invasion of privacy, and I think Christian is probably correct that you're not likely to get any help here (or anywhere else).

    IT & Infrastructure csharp question lounge

  • MS patented click and double-click
    C Curi0us_George

    M$ Don't do that. ---- Many VCR's have had this functionality for quite a while. e.g. The longer you press the ffwd button, the higher the speed at which it faster fowards. My DVD player does, to. Pressing stop stops the playback. Holding stop for about 2 seconds causes the disk to eject. Microsoft won't be able to hold this one up in court. Way too much prior art.

    The Lounge html hardware question

  • Taking input while in some form of waiting/sleeping -- plz help
    C Curi0us_George

    Not really. That would be entirely dependent on what libraries you ae using for input. Perhaps whatever library you are using provides a function (with a name such as bytes_available()) which returns the number of bytes currently available for access. I've used libraries (e.g. JNetLib) which has this type of functionality, but many libraries do not. It is possible to wrap an asynchronous APi and achieve this kind of functionality (which is what JNetLib does), but this wrapping will require threading. It really depends on what you are trying to do, where this input is coming from, and what libraries you are using.

    Managed C++/CLI c++ help question

  • About a graph algorithm! It is very diffcult , I think!
    C Curi0us_George

    First off, you need to reduce the problem. You cannot necessarily determine all paths from I to J if there is a cycle in the graph, because there are (potentially) infinite paths. Detecting graph cycles is fairly simple. Search on Google for how. Now, if you are willing to reduce the problem to only Directed Acyclic Graphs, you simply start at I and traverse every possible path. The simplest implementation is to store a representation of the path (possibly just a list of vertex pointers). Every time you come to a point where you could traverse down two different edges, copy the list and traverse down both. (Of course, if there are more than two possible edges, make additional copies and traverse for each.) Since the graph is acyclic, the paths will either run into J (at which point they record/print themselves somewhere) or they will end unsuccessfully (at which point they do nothing else). This same logic (with minor modifications) will also work on cyclic graphs, but checking for cycles becomes necessary. e.g. Is vertex Q already in the path? If so, don't bother going there again, because it's a cycle. And of course, if there is actually a cycle in valid path (e.g. I->Q->Z->Q->J), it's impossible to return all the paths, because there really will be an infinite number of them. (e.g. I->Q->Z->Q->Z->Q->Z->...Q->J)

    Managed C++/CLI algorithms data-structures

  • Java Bean
    C Curi0us_George

    You need to compare the username and password (or a hash of the password) against a previously stored username and password (or password hash). The validation code should probably return only a simple boolean value; true for accepted, false for refused. But this isn't really an appropriate discussion board (or even an appropriate site) for discussing Java-specific things. Search on Google, and browse through some java sites. I guarantee you that a thousand people have already written exactly what you are describing, and probably a few hundred have explained the entire process on the web. I'm sure you can find an explanation if you look for a while.

    Managed C++/CLI java help

  • Taking input while in some form of waiting/sleeping -- plz help
    C Curi0us_George

    Probably more elegant to do this in a multithreaded fashion, but yes, it's possible to do what you want without multithreading. First, you're going to need non-blocking input. If you don't have that, I think you're pretty much SOL. Assuming you have non-blocking input, the basic logic is:

    int granularity = 100; // number of milliseconds to sleep between attempts
    int attempt = 2000; // number of milliseconds to try
    int attempted = 0; // counter
    while (attempted < attempt)
    {
    // check for input (must not block)
    if (inputIsAvailable())
    {
    // we already have input
    doSomething();
    }
    else
    {
    // wait for input
    Sleep(granularity);
    attempted += granularity;
    }
    }
    // we never got input
    doSomethingElse();

    Managed C++/CLI c++ help question

  • How Long Will It Take
    C Curi0us_George

    It takes however long you want it to take. If you really crack down on it, and you're already comfortable with at least one other Object-Oriented programming language, you could become proficient in only a week or two. If you've never programmed or have only programmed in a structure-oriented language, expect to spend a month or two (possibly more), assuming you're willing to put a good bit of work into it. If you're not wanting to put the effort into coding, you'll probably never become proficient. Code a lot if you want to learn C++, or any language. Find a project you are interested in, and write it in C++. Or write some module/component for it, if it's not a new project. And of course, read a lot of other people's code, paying attention to style (that means learning to recognize good AND bad C++ style).

    C / C++ / MFC c++ question

  • how to search through an external file
    C Curi0us_George

    Either store each following line in its own string (i.e. have 3 different string objects), or concatenate the strings. e.g. std::string str = "my name is jim"; str += "\n" + getLineFromInputFile(); //...

    C / C++ / MFC tutorial question data-structures

  • size of an empty class??
    C Curi0us_George

    VTable is only allocated if the class actually contains virtual functions. The size of an empty class will always be greater than zero because two objects must not occupy the same space. (As DavidCrow pointed out)

    C / C++ / MFC question testing beta-testing career

  • MACRO vs INLINE FUNCTION
    C Curi0us_George

    My general rule is that if it can be done as an inline function, it should be. There are some things which cannot be done with an inline function, but can be done with a macro. Those are rare, though.

    C / C++ / MFC c++ visual-studio testing beta-testing performance

  • Keyboard hook (alt + tab)
    C Curi0us_George

    Are you using a WH_KEYBOARD_LL hook? Because a WH_ KEYBOARD hook will not catch Alt+Tab. SetWindowsHookEx About Hooks: WH_KEYBOARD_LL LowLevelKeyboardProc

    C / C++ / MFC question

  • In MFC, which event works when user clicks on close button?
    C Curi0us_George

    Then either I'm not sure what you're trying to accomplish, or you went about it the wrong way. If you could post a code snippet (the part that didn't work), or if you could explain exactly what you are wanting to accomplish, then either myself or someone else would surely be able to help you.

    C / C++ / MFC c++ question

  • Overloading
    C Curi0us_George

    Not a big deal. I just couldn't have you bad-mouthing C#'s overloading. ;)

    C# csharp c++ html com question

  • dynamic 2 dimensional array
    C Curi0us_George

    Pft. Allocation of the array is not typically the source of speed overhead. Accessing array positions repeatedly is, and your way is no faster than mine. Mine is at least intuitive.

    C / C++ / MFC question data-structures performance

  • dynamic 2 dimensional array
    C Curi0us_George

    I suppose that works, but ick. I guess if it does the job for you, though . . .

    C / C++ / MFC question data-structures performance

  • To share or not to share???
    C Curi0us_George

    >>The thing is...you will get flamed if you post >>code here and put any restrictions on it (other >>than "mention me in your about dialog box" ). I've seen people complain about that, too. :\ Some guy complained about some BSD'd code once, saying that no commercial company would tolerate the "don't take credit for my code" clause.

    The Lounge c++ xml question discussion

  • dynamic 2 dimensional array
    C Curi0us_George

    ... and also one dimensional.

    C / C++ / MFC question data-structures performance

  • Need "measuring time" suggestion
    C Curi0us_George

    I'll have to remember that one. That's a bit more friendly than the method I gave. (Though not as useful if you actually want the time. ;))

    C / C++ / MFC hardware question

  • dynamic 2 dimensional array
    C Curi0us_George

    The only way I know to do it is to create an array of int* and then assign each element to point to an array. e.g. int ** array = new int*[2]; for (int i = 0; i < 2; i++) { array[i] = new int[2]; }

    C / C++ / MFC question data-structures performance

  • In MFC, which event works when user clicks on close button?
    C Curi0us_George

    You could probably just handle the WM_CLOSE message and accomplish what you want.

    C / C++ / MFC c++ question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups