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
I

includeh10

@includeh10
About
Posts
1.2k
Topics
556
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • why this funny double is not a true zero?
    I includeh10

    //print function

    CString fmt(double db)
    {
    CString cs;
    cs.Format("%f", db);
    return cs;
    }

    //problem

    void TheDlg::Test00()
    {
    const double dbInf = 1.0/::sin(0); //infinite
    const double dbZero = (::fabs(::cos(3.14159/2))<0.9)?0:1; //line 1

    CString cs;
    cs += fmt(dbZero)+"\\r\\n";          //line 2
    cs += fmt(dbZero \* dbInf)+"\\r\\n";  //line 3
    cs += fmt(0 \* dbInf)+"\\r\\n";       //line 4
    
    MessageBox(cs);
    

    }

    above dbZero only has 2 possible values : 0 or 1 - see line 1; output:

    0.000000
    -1.#IND00
    0.000000

    output of line 2 shows that dbZero is zero. output of line 3 shows that dbZero is not zero, since it is different from output of line 4. funny thing is that if change line 1 to:

    const double dbZero = (0.1<0.9)?0:1;
    

    Then all outputs are zeros. Why? How to make dbZero as a true zero in problem code?

    C / C++ / MFC database help tutorial question

  • A simplest assembly error - need help
    I includeh10

    I test a little _asm code, it works if type = float but error if type = double.

    type GetSum()
    {
    type pData[] = {1.1, 2.2, 3.3};
    type dbReturn = 0;

    //one line of c code, which will be replaced by _asm bellow
    dbReturn = pData[0];

    //------------------
    return dbReturn;
    }

    asm for above one line

    _asm
    {
    mov esi, pData
    fld [esi]
    fstp dbResult
    }

    the little asm is correct if

    typedef float type;

    but error if

    typedef double type;

    why the little asm works for float but error for double? please help. thanks.

    C / C++ / MFC help question

  • matrix svd decomposition problem
    I includeh10

    You are right, I should go back to school now. thanks.

    C / C++ / MFC help c++ question

  • matrix svd decomposition problem
    I includeh10

    I downloaded several SVD c++ code, but they all have same error. by SVD theory, a matrix A(mxn) (m: rows, n: columns) can be decomposed as A(mxn) = U(mxm) * S(mxn) * V'(nxn) (U, S and V are matrices) U and V must be orthogonal matrices: U x U' = U' x U = E, V x V' = V' x V = E (E is identity matrix) Problem: if m > n, those codes generate U' x U = E (correct), but U' x U != E (error). they are all correct for V. Because all of codes have the same error, I think U should be this way even it is not satisfy SVD theory. Or all codes are wrong (sounds not reasonable.) How do you think about? maybe I have to download more C++ source codes to test? .

    C / C++ / MFC help c++ question

  • Eigen library : compile error
    I includeh10

    Following code is at very beginning of "HessenbergDecomposition.h", which is a public library for calculating Eigen values. Source code cab be viewed at this link.

    namespace Eigen
    {
    namespace internal
    {
    template struct HessenbergDecompositionMatrixHReturnType;
    template struct traits > //line 21
    { //line 22
    typedef MatrixType ReturnType;
    };
    }
    //more code
    }

    VC++ compiler says:

    E:\...\Eigen/HessenbergDecomposition.h(21) : error C2143: syntax error : missing ';' before '<'
    E:\...\Eigen/HessenbergDecomposition.h(21) : error C2059: syntax error : '<'
    E:\...\Eigen/HessenbergDecomposition.h(21) : error C2065: 'MatrixType' : undeclared identifier
    E:\...\Eigen/HessenbergDecomposition.h(22) : error C2143: syntax error : missing ';' before '{'
    E:\...\Eigen/HessenbergDecomposition.h(22) : error C2447: missing function header (old-style formal list?)

    Is this c/c++ or UNIX/VC++ incompatible problem? How to fix the compile error? Thanks for code corrections.

    C / C++ / MFC help c++ html tutorial question

  • What happened to the forum?
    I includeh10

    Why are all posts expanded now by default? It is so ugly and I can see nothing except “HOW TO ANSWER A QUESTION”. Could you change it to previous style? Or I have to leave. .

    C / C++ / MFC question tutorial

  • ftp : to upload multile files at same time
    I includeh10

    in my app, I use ftp raw commands to upload several files to server, after sending PASV and STOR from command port, file transfer starts on data port - so far so good. But, when I send same commands to server again to upload second file before first uploading completed , server answers "unknowing command" - to second PASV and STOR. So, I have to wait for first uploading completed to upload second file. Any comments as solution? Anything wrong in my ftp commands or process? how to upload 2 or more files at same time? how to open multiple data sockets (ports) with one command socket (port)? Thanks. .

    C / C++ / MFC sysadmin tutorial question

  • How to add app icon in full color?
    I includeh10

    By default (VC6), app icon is in 16 color only. How to use/change the app icon with full color? BTW: for VC6 environment. Thanks. .

    C / C++ / MFC tutorial question workspace

  • Ftp : how to know downloading data is completed?
    I includeh10

    here is data (in ASCII format) downloaded from server by command "LIST":

    total 1100
    -rw------- 1 root 38 Dec 16 2010 .bash_history
    (omitting several lines here)
    drwx--x--x 6 other 512 Oct 13 2005 usr

    My question is: How do I know the downloading is completed? I guess I need to send count of bytes downloaded to server, so server will tell if downloading is OK. If so, What instruction (command) should I send to server? Which port (command port or data port) should I use for sending the instruction? Thanks. .

    C / C++ / MFC question sysadmin linux tutorial

  • What FTP pack can obtain the detail events?
    I includeh10

    I need ftp C/C++ functions/classes to process ftp uploading/downloading tasks. When I used software [FileZilla FTP Client], it sends/obtains many interesting events/messages, such as:

    Status: Resolving address of www.xyz.com
    Status: Connecting to 11.222.333.444:21...
    Status: Connection established, waiting for welcome message...
    Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
    Response: 220-You are user number 3 of 1000 allowed.
    Response: 220-Local time is now 15:16. Server port: 21.
    Response: 220-This is a private system - No anonymous login
    Response: 220-IPv6 connections are also welcome on this server.
    Response: 220 You will be disconnected after 15 minutes of inactivity.
    Command: USER xyz
    Response: 331 User xyz OK. Password required
    Command: PASS *****************
    Response: 230 OK. Current restricted directory is /
    Command: SYST
    Response: 215 UNIX Type: L8
    Command: FEAT
    Response: 211-Extensions supported:
    Response: EPRT
    Response: IDLE
    Response: MDTM
    Response: SIZE
    Response: REST STREAM
    Response: MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
    Response: MLSD
    Response: AUTH TLS
    Response: PBSZ
    Response: PROT
    Response: ESTA
    Response: PASV
    Response: EPSV
    Response: SPSV
    Response: ESTP
    Response: 211 End.
    Status: Connected
    Status: Retrieving directory listing...
    Command: PWD
    Response: 257 "/" is your current location
    Command: TYPE I
    Response: 200 TYPE is now 8-bit binary
    Command: PASV
    Response: 227 Entering Passive Mode (74,220,215,241,4,101)
    Command: MLSD
    Response: 150 Accepted data connection
    Response: 226-Options: -a -l
    Response: 226 33 matches total
    Status: Directory listing successful
    (many more ...)

    Those events are very useful and in details, I think MFC FTP classes are NOT powerful enough to process them. What FTP C/C++ functions/classes are used by [FileZilla FTP Client] (or better than them)? I'd like to try them. Thanks for links and comments. .

    C / C++ / MFC c++ com sysadmin security json

  • 1 & 0x01+1*3
    I includeh10

    what is result of the formula? 1 & 0x01+1*3 it is zero actually. I guess it equals 1&(0x01+1*3). I need a priority table of C operators to know c operators' priority for +-*/&|~% normally, * and / are executed before + and -. how about others, do you have a link for this?

    C / C++ / MFC question

  • How to set/remove ES_READONLY style of CEdit at runtime?
    I includeh10

    How to set/remove ES_READONLY style of CEdit at runtime?

    C / C++ / MFC tutorial question

  • How to get software (exe, dll) Version info from a buffer?
    I includeh10

    an exe or dll is in memory buffer downloaded from website. How to get the exe or dll version info from memory buffer directly? I don't want to save it then retrieve version info from the saved file. Is it possible? How?

    C / C++ / MFC performance tutorial question announcement

  • Frame transparent color in animated gif file
    I includeh10

    Frames in many animated gif files don't have transparent color, that is, transparent color index of the frames is not valid (Transparent Color Flag is zero). In the case, I guess, the frames use default transparent color : white - rgb=(255,255,255). But I can not find docs on google to confirm it. If you have knowledge about animated gif format, please let me know if my guess is true. BTW: all gifs of this kind found by me have white background, that is why I think there is default transparent color for this kind gifs.

    C / C++ / MFC database

  • Need source code of changing animated gif frames to Bitmap file
    I includeh10

    I need to extract animated gif frames to related bitmaps, and info of offset, transparent color of frames. CxImage (7.02) contains many errors for animated gif, ZLib is too complex, and I am not sure if it works with most (or all) animated gif formats. I found other samples, such as AnimationGif, on this site, but they don't work with many (odd ?) animated gifs (IE and FireFox can display them well). Do you know where I can find C++ source code for this purpose? Thanks for links.

    C / C++ / MFC c++ graphics question

  • How to get the client's abort message with WSAAsyncSelect ?
    I includeh10

    If client side closes normally, Close-event will be sent to server. But, if internet or network connect-line breaks or some odd things happen, Close-event will not be sent to server. in your test, you closed client socket normally, so you can't find problem. try to plug out connect cable to see what happens.

    C / C++ / MFC sysadmin help tutorial question

  • Crash in multiple threading with shared resource
    I includeh10

    several sockets (multiple threading) on server-side share same public resource, such as user-array, for deleting, adding users etc. sometimes, server crashes. reason of server's crashing can't be debugged properly, but, from debug hints, I guess the reason is that when a socket is doing something on user-array but another socket start adding or deleting users on same array. If this is real reason, how to avoid it? lock user-array? or other ways? Thanks for comments.

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

  • How to embedded CFileDialog to user dialog?
    I includeh10

    How to create a modeless or embedded CFileDialog, GetOpenFileName() or GetSaveFileName() into user Dialog? Thanks

    C / C++ / MFC hardware tutorial question

  • mysql error and UNICODE
    I includeh10

    mysql returns an error, which contains UNICODE string in whole char* error string as following:

    Duplicate entry 'MQ91' for key 'UnicodeName'

    here 'MQ91' is UNICODE string but can not be recognized. How to transfer the English/UNICODE mixed error string above in right format, or how to know the 'MQ91' is UNICODE?

    C / C++ / MFC mysql help tutorial question

  • change selection background color of a CRichEditCtrl
    I includeh10

    how to change selection-background-color of a CRichEditCtrl? Default selection-background-color is black, I did see some software have other selection-background-color on their CRichEditCtrl. How to do it? .

    C / C++ / MFC 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