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
J

joshp1217

@joshp1217
About
Posts
33
Topics
20
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • 3D Camera Math Question
    J joshp1217

    I am trying to understand the Math of a Camera in Computer Graphics. Here is the question If i have a camera a point a, How do I compute the view matrix so the camera looks at point b?

    Algorithms question graphics

  • Newbie Camera Math Question
    J joshp1217

    I am trying to understand the Math of a Camera in Computer Graphics. Here is the question If i have a camera a point a, How do I compute the view matrix so the camera looks at point b?

    Graphics question graphics

  • Newbie Question
    J joshp1217

    I thought that was how it should work but when I sent it up that way, i was getting errors like the Deck class didnt recognize the Card class because when i said vector m_Cards;(this is in the deck.h with #include "card.h" at the top) it basically would say that a vector cant have any empty type. The IDE i am using is Dev-C++ I dont know if that has anything to do with it but any further help would greatly be appreciated because I could do this with ease in C# but I need to do it in C++.

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

  • Newbie Question
    J joshp1217

    I want to compile a project that I have created. The project has class objects separated in different files i.e. main.cpp, card.h, card.cpp, deck.h, deck.cpp. How am I able to do this so the deck class can create in instance of the card class i.e. vector x; I know this is really newbie but I got to know.

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

  • How can I improve this Function
    J joshp1217

    I see what you are saying, You dont want the dest == src because then you are performing a action that is not needed because they are already the same correct? Yes, That's one case of an optimisation improvement but it's questionable whether you want to pay the price of checking every time against it only saving time when the user is being daft. A tricky one. A much worse case is when src and dst are nearly the same for example when dst == src+2 but size == 10; the docs for this sort of function sometimes refer to this sort of situation and say the result will be 'undefined'. Just another way of saying it will all go Pete Tong if you ask me. Also size is an unsigned integral so it will never be less than zero True eonugh so try a test where you write size=(size_t)(-1) and then call memcpy! if size is greater than the allocated memory dest points to then basically you will be increment out of bounds which will cause an error, but how can you check to make sure the sizes match up? It will only cause an error in the sense of a reported error if some piece of code detects that it has happened otherwise it will happily go ahead and read and write memory it shouldn't and often return just as if it had worked. If you want to prevent this you might need to add extra parameters, Microsoft do in their Safe CRT functions, and use the API memory check calls like IsBadWritePtr to check whether you have access to the memory being read and written. What is an example of a src that isnt valid? Once example is where src = 0x00000002. This is never going to be a valid pointer but it will pass a NULL check. It may seem that this could never happen but if someone gets size and src swapped over, size_t will happily take a 32bit pointer value and src will happily auto cast a size_t. Ow! My point is that there is an almost endless amount of checking that you could add to a function like this but whether that 'improves' it is a matter of opinion. I think it does providing that it has no runtime cost in the Release build and that it doesn't obscure the purpose or operation of the function in such a way as to make maintenance difficult. Even such an apparently trivial function can be a major challenge if looked at the right way. Most of us knock out hundreds of such functions all the time without a second thought but as they say 'once you've started digging it's much harder to find the bottom of the hole'. :-) Matthew F.

    C / C++ / MFC question csharp c++ help code-review

  • [Message Deleted]
    J joshp1217

    Yeah they said that I didnt need to post it twice but the question basically was: What is wrong or how can I improve this function: void* memcpy( void* dest, void* src, size_t size ) { byte* pTo = (byte*)dest; byte* pFrom = (byte*)src; assert( dest != NULL && src != NULL ); while( size-- > 0 ) *pTo++ = *pFrom++; return (dest); }

    C / C++ / MFC

  • [Message Deleted]
    J joshp1217

    No No this is a question I have to answer, I am just checking to make sure the function code show doesnt cause cause any problems and it is efficient code.

    C / C++ / MFC

  • How can I improve this Function
    J joshp1217

    So there is no way I can optimize it or make it more efficient, because when I looked at it it seemed fine to me to but I have to make sure.

    C / C++ / MFC question csharp c++ help code-review

  • [Message Deleted]
    J joshp1217

    [Message Deleted]

    C / C++ / MFC

  • How can I improve this Function
    J joshp1217

    I have to improve this code for a test, so any help you can Provide I would greatly appreciate.

    C / C++ / MFC question csharp c++ help code-review

  • How can I improve this Function
    J joshp1217

    I am getting back into C++(be doing C# heavey for the past few years), Can anyone give me some help on how I can improve the function so no problems dont arise when it is run? I appreciate the help you guys. void* memcpy( void* dest, void* src, size_t size ) { byte* pTo = (byte*)dest; byte* pFrom = (byte*)src; assert( dest != NULL && src != NULL ); while( size-- > 0 ) *pTo++ = *pFrom++; return (dest); } Thanks.

    C / C++ / MFC question csharp c++ help code-review

  • Tree View Search
    J joshp1217

    What is a good way to implement a tree view search where using wild card is possible?

    C# question data-structures

  • Stored Procedure with Output
    J joshp1217

    I know this is a newbie question but I am a newbie to writing stored procedures, Ok I want to right a stored procedure that copys data from one table to another table based on a certain ID then output back to the program that executes the stored procedure the ID of the next record available in the table that was just copied into. So basically i have table x and y, y is a history table of x, whenever things are about to change in x i save certain records (based on an ID) into Y, after I save this specific data to y, I want to ouput Y next record ID that is avaible(ex. if I add rows with IDs 1-10, i want to output back either 11). So how can I do this? Any Help will be greatly appreciated.

    Database question database help

  • Copy Stored Procedure
    J joshp1217

    I need to write a stored procedure that will copy rows from one table and insert them an another table based on a unique id. Any Ideas? I am very new to writing stored procedures so any help would be greatly appreciated. Thank You

    Database database help question

  • Tree View Question
    J joshp1217

    I have a class: class DBdata { public int id; public int name; public int email blah blah blah } This class correlates to a table in the database, as you could probably tell. I want to show this in Tree View where for example the name is the actually text of the node but the id and email are also encapsulates parts or that data, so that is to say if a drag one node from one tree to the another tree view it will cary its data with it. How can i do this because in a tree view I cant add any object unless it is of type TreeNode.

    C# question database data-structures tutorial

  • Sink??
    J joshp1217

    As I study more C# and work with it more at my job, I have read and heard the term "Sink" what exactly does that mean? I have heard it in reference with events and delegates but do not have a clear understanding of its meaning. Any help would be great appreciated.

    C# csharp help question career

  • Changing from an Interface to an Abstract
    J joshp1217

    Okay I have this Interface: interface myInterface { public void visible(bool view); } I was implementing the visible method in my other classes like this: visible(bool view) { if(view) { this.Left = -500000; blah blah blah } else { this.left = 0; blah blah blah } } Okay I need to change my interface to an abstract class, so i can just implement the visible method one time in the abstract, but i can't use "this.Left" in the abstract because it doesnt contain a method for "Left". It is probably a simple solution to this but how do I get this.Left, this.dock etc. to be available for use in my abstract class?

    C# question

  • Grouped Check Boxes
    J joshp1217

    LMAO my bad, I'm sorry thanks for the help though sounds like a good solution

    C# question

  • Grouped Check Boxes
    J joshp1217

    Winforms, and i can't use Radion buttons because i am looking for the sticky button look that a check box has.

    C# question

  • Grouped Check Boxes
    J joshp1217

    Can you group together CheckBoxes so only one in a group is checked at one time and if so How?

    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