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
P

Peter Godec

@Peter Godec
About
Posts
17
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Finally
    P Peter Godec

    Brilliant stuff. Thanks Colin and thanks Microsoft!!! :eek: "From the top of the mountain, you cannot see the mountain."

    The Lounge csharp visual-studio com announcement

  • Gruesome!
    P Peter Godec

    It's a hoax. Not funny though :| .

    The Lounge com help

  • Nish Shakes
    P Peter Godec

    It is SLOvenia and the chap you were having a discussion with yesterday was Tomaz (probably Tomaž - z with caron - you'll need some Central European encoding enabled to see it correctly). The capital is Ljubljana, (pronounced lyOO'blyänä). my-brain-is-available-but-don't-pick-too-hard-ly y'rs --pg :)

    The Lounge help com

  • IMHO IMO...???
    P Peter Godec

    The Canonical Abbreviation/Acronym List YAFIYGI. Don't go overboard though. YHBW-ly y'rs --pg :)

    The Lounge question

  • Question about CPoint objects...
    P Peter Godec

    CDuddley wrote: to find the closest point If i understand correctly, you need to define a measure of distance between CPoints to do that. Most probably that would be euclidean distance , i.e. d = sqrt((x1 - x2)^2 + (y1 - y2)^2) So define a function that calculates the euclidean distance between two CPoints, maybe something like this:

    #include <math.h> // or <cmath> and std:: if your compiler/library isn't broken

    double distance(const CPoint& p1, const CPoint& p2)
    {
    return sqrt((p1.x - p2.x)*(p1.x - p2.x) + (p1.y - p2.y)*(p1.y - p2.y));
    }

    a nicer variant (performance?) of this would be

    double distance(const CPoint& p1, const CPoint& p2)
    {
    CSize diff = p1 - p2;
    return sqrt(diff.x * diff.x + diff.y * diff.y);
    }

    (of course, for your purpose, you don't need to calculate the sqrt, but now i'm blabbering) Now all you's gotta do is iterate over the array of CPoints, calculating the distance between your given test point and each point in the array and keeping track of the array index of the point that is the closest to the test point (now read this paragraph again). that-exercise-is-left-to-the-OP-ly y'rs --pg :)

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

  • What is it with American actors??
    P Peter Godec

    Stan Shannon wrote: Isn't it amazing all the 'American's are like this' 'American's are like that' stuff you hear from people around the world? Yes, quite amazing. And the French are rude and smelly (or does that apply to all them European snobs), and the English have bad teeth (could someone explain that one to me), and the... it-works-both-ways-you-know-ly y'rs --pg :)

    The Lounge question tutorial

  • Pictures from the trip
    P Peter Godec

    LOL, i didn't expect someone here at CP would have ever heard of Slovenia let alone wanted to visit it. I hope you'll enjoy your holiday. Unfortunately, August is probably not the best time for a visit, especially if you're planning to stay on the coast most of the time (it is crowded with tourists ;P). The main cities appear deserted since most of the locals are on vacation at that time too. The best month would be September i guess. Anyway, have fun. :)

    The Lounge html database com

  • Japanese developers
    P Peter Godec

    Cool! I've always assumed your name is of Spanish (Mexican) origin. I probably associated it with saguaro :). I would never thought of it being a Japanese name. My dictionary says it means something like "good fellow" or maybe even "mutual goodness", but i'm not good at this, so i could be way off. Call me weird, but i love japanese names, especially female ones:-O.

    The Lounge question

  • In the "Bad Product Names" category...
    P Peter Godec

    Seems like the Japanese are the masters of weird product names. More funny product names and product descriptions for your viewing pleasure, courtesy of engrish.com all-your-base-are-belong-to-us-ly y'rs --pg :)

    The Lounge com json

  • Is there any site that lets you download files via email?
    P Peter Godec

    Hi Nish! Years ago i've used a piece of software that allowed me to do just what you're asking. I can't remember the name unfortunately, but it was probably just some kind of frontend to the services you'll find if you follow these links.

    • Some general info: http://www.faqs.org/faqs/internet-services/access-via-email
    • List of servers: http://www.expita.com/servers.html#www4mail
    • Try these: http://www.kabissa.org/www4mail, http://www.bellanet.org/email.htm

    Note that i don't use this stuff so i haven't clue whether it actually works or not. Fortunate-to-have-a-tad-faster-dialup-access-ly y'rs, --pg :)

    The Lounge com sysadmin performance question

  • help with algorithm
    P Peter Godec

    Wow. This problem is extremely non-trivial. Some time ago i've implemented line extraction using Hough transform (google it). Generalized HT can be used to detect any kind of parametric curve, although algorithm complexity grows exponentially with the number of parameters (e.g. two parameters for lines, three parameters for circles). HT is a simple algorithm once you grok it. The real difficulties are determining how to quantize the parameter space (accuracy vs. speed) and how to extract curve parameters from it. The one link i can give you: http://www.icaen.uiowa.edu/~dip/LECTURE/Segmentation2.html#hough

    The Lounge graphics help algorithms tutorial question

  • Variable Declaration & Initialization :: C++
    P Peter Godec

    See C++ FAQ Lite. HTH, --peter

    C / C++ / MFC c++ tutorial question

  • STL Poll
    P Peter Godec

    Have you read Scott Meyers 'Effective STL' yet ? I reckon it's the best book I bought this year. I've heard only good things about Meyers' Effective... books, but Stroustrup's bible and occasional visits to the comp.lang.c++ are sufficient for me right now (there are some really smart people on that newsgroup). While we're at it, another free source of great C++ info is the C++ Experts Forum on the CUJ website (quite advanced stuff though:omg: ). --peter

    The Lounge c++ help

  • STL Poll
    P Peter Godec

    Waah, my first post to The Lounge and it's about programming :) . I thought I'd make myself useful first. Besides, I can't just look while you're putting down my favorite library. Anyway, it->second doesn't return anything. It can't because it is not a method/function, it's a member object of the class map<T1, T2>::value_type, that is, a member of pair<T1, T2>. So if you want a reference use it->second to initialize a reference of the corresponding type. No need for copies there. HTH.

    The Lounge c++ help

  • Why doesn't CStatic keep the size of the icon when using SetIcon?
    P Peter Godec

    Hi! Use the ::LoadImage API function instead of CWinApp::LoadIcon(). For example:

    HINSTANCE hInst = AfxGetInstanceHandle();
    hIcon = (HICON) ::LoadImage(hInst, MAKEINTRESOURCE(IDI_FOOBAR), IMAGE_ICON, 16, 16, 0);

    Hope this helps!

    C / C++ / MFC question

  • Sockets
    P Peter Godec

    Try SocketMan. It is'a free and portable C++ library, so it pretty much fits your demands :) .

    C / C++ / MFC c++ wpf

  • Need help quick on a couple of silly simple problems
    P Peter Godec

    You need a handler for WM_SYSCOMMAND message. Maybe something like this:

    void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam)
    {
    CFrameWnd::OnSysCommand(nID, lParam);

    if (nID == SC\_MINIMIZE)
    {
    	// Do your stuff here
    	// like maybe call ShowWindow(SW\_HIDE)
    	// or something?
    }
    

    }

    Don't forget to add ON_WM_SYSCOMMAND() to the message map:). HTH, peter

    C / C++ / MFC c++ sysadmin help tutorial 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