Jump to content
Xtreme .Net Talk

coldfusion244

Avatar/Signature
  • Posts

    269
  • Joined

  • Last visited

Everything posted by coldfusion244

  1. MySQL is free, the support though isn't. Here is a link to the online manual FYI http://dev.mysql.com/doc/mysql/en/sorting-rows.html
  2. There is always TAPI.
  3. This will probably help you as well [even though your question has been answered]. You may want to sort a row, etc. http://dev.mysql.com/doc/mysql/en/sorting-rows.html
  4. I don't know if there is a 3rd party control, but you could use a richtextbox control and use the abilities of the control to colorize any text you want. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsrichtextboxclasstopic.asp
  5. I have an object of type A. It encapsulates a small amount of actual data, the rest are functions that manipulate the data. My question is, would it be faster to use a linked list array or use the STL library's vector? This will be a dynamic array and has the possibility to chage from 100 items to 0 in 200 milliseconds. Any thoughts or ideas are appreciated.
  6. Unfortunately Mike, I can't answer your last questions as I don't quite understand how C# handles the pointers. I was using basic pointer operation from C++... C# and VB do put their information on the heap as you stated so it's not a huge deal and doesn't require the efforts of a pointer and can be passed ByRef. If anyone can answer that, I'm interested as well.
  7. Do you only ever want 1 client connected to the server? If not, I would suggest looking at this post. http://www.xtremedotnettalk.net/showthread.php?t=91336
  8. The equivalent in VB.NET is VbCrLf which is a carriage return line feed. The /r is a carriage return and the /n is a line feed I believe, though not sure...
  9. Yes that is true Mike, let me give a different example that may help more. You have created a structure that is called house. It has doors, windows, floor plans, actions (find how much voltage,current, which way doors swing, the family that lives in it, etc etc; all the small details, like a actual family and house would have) and you were doing opertaion on them with a function that had a prototype of such: house* hCorrectHouse CompareHouses(house* hHouse1, house* hHouse2); It basically says I am a function that returns a pointer to an object of type house and I take a pointer to a house object in memory for hHouse1 and the same for hHouse2. Since the house class is a huge object that encapsulates much data it may take up to 1 MB per house of memory. Now, since you are passing a pointer to that location in memory, there is no need to move that data into the function when calling. So you are really only sending 2 small 32bit numbers to the funciton instead of 2 of these huge 1 meg objects. Since the function returns a pointer to the compared houses, the function only returns a 32bit number in the form of a pointer to the correctly compared house, rather than transferring the 1 meg object. This not only makes it faster by traversing less data, it also let's you control memory allocation. So, if I compared the houses and decided the one that is incorrect to free up space, I can set it to null and delete the pointer. BAM memory allocated back to the system; no waiting for the GC. As for unsigned data types, I did say that yes, using the extra bit for a wider (positive only) number range is a benefit. But it also can enhance the performance of the program by not bogging it down with larger data types that aren't needed. Why use a 16-bit integer when and unsigned 8-bit will do? It also is nice when you are doing [this is from hardware programming more than software] bit manipulation and you don't want the carry flag to be set when you rotate right or rotate left... again more lower level than you should really be doing in VB.
  10. Ok Mike! Unisgned Types: Basically never use them, I only used one (unsigned char, 8-bits) and that was because I had to program an lcd display (2x20) using rs232 port. It had an 8-bit command register, so I wanted to initalize the variable without using a sign bit. Example, unsigned char 0xCC is not the same as a char [signed] 0xCC. That and why use a 64-bit double and take up 2 registers when you can use an unsigned long and only take up 1 register. Much faster operation, I am saying this with references to ASM in mind. If you had a 64 bit number and only had 32-bit registers, you'd need 2 registers to store the information. If you had to divide 2 64-bit numbers, it's just not fun to do at the ASM level. So basically it is like optimizing your code (for me anyway). Pointers: Pointers allow for highspeed memory management. It's especially useful when you have classes of objects. Example boing you have a pointer to a memory location of type array. You start pointed at the first value of type integer. You know a 32-bit integer is 4 bytes, so if you wanted to go to the next value you could add 4 to the current pointer location and have the value. No function call to find the next one, just a point to a specific place in memory. From ASM, we find that moving a pointer into a register and accessing the memory from that pointer is faster, since the fastest accessable information is that stored in the registers. So having a pointer in EAX to a memory location could be accessed like [EAX] and would not have to go through finding the variable and then finding it's location and finalyl grabbing it. It would know exactly where to get it. Another advantage is when you want to edit some information. Say you have 2 objects of type a that had many functions and member variables. If you had a function that compared them and returned the correct one, it would be much faster to change the memory address of the pointer and not return anything [even though that wouldn't be good practice from my experience] than return the whole object of type a as teh result. Your basically working with 32-bit data (integers/longs) than with say an object that takes 512 byets of data. This is all said with the knowledge that I have. I do not know about the inner workings (very well) of .net, or the compiliers for that matter. Take the information as you will, and if i'm wrong about somethign please let me know. But as I understand it, that's how it works. On a side note, I drove through plainsboro tonight, my friend lives in the quail ridge apartments near scott's road [or is it scott's corner]... small world..
  11. C++ does include the _ASM directive... can't beat it if you want to make a simple calculator. That or encryption, why use >> or << when you can use xor, and, or, neg... Make use of that math co-processor!
  12. Don't feel bad, I constantly use the command line interface to do most of my windows tasks. This could also be from the fact I use linux as well... Maybe it's just the blinking curser and black screen that makes me feel at home...
  13. You have to figure when it is best to inline code. It's not worthless as others in this post have stated. The overhead of inlining a huge function sometimes isn't worth the cost. HOWEVER, if you are doing huge amount of branch prediction, it would be better to inline the code as to not through away the prefetch of the processor(if your function acts on already loaded data, etc). You just have to know when to use it. Also inlining will make your executable larger... programmers choice...
  14. I don't know how to do it ni .NET [or ifit's possble] but there is api that can be used if nothing else.
  15. so you basically want to search a directory for a specific filename?
  16. Why not use the EFS built into xp pro?
  17. If statements work like this: if (something is true) { do this code } elseif (something else is true) { do this code } else { default } In C#, '{}' are scope deliminators. What that means is, that they control what variables and such have scope and where. For instance: [CS] if ( a == b) { int c = 5; Console.WriteLine("Equal"); } c = 10 //error, since it's undefined for this scope [/CS] in this case c is only defined for inside the if statement. You said you want it to loop if either a != b or a !=1, which is correctly done in your code. It is good practice to put deliminators after all if statements, but if you have only 1 statement after it, you don't have to use it (though I always do). for example: [CS] if(a == 1) Console.WriteLine("A == 1"); [/CS] is the same as [CS] if(a == 1) { Console.WriteLine("A == 1"); } [/CS] this again, is only for a single statement afterwords and I don't recommend you use this shortcut. Hopefully this helps.
  18. Lately, I have been interested in data types and structures. I am not talking about integers and doubles, but actual file composition. For example, reading and editing MPEG files, MP3 Files, ISO's, reading FAT information, NTFS information, etc. Possbily a forum could be made for this? I don't know who else would be interested, but I figured since I was greatly interested, the idea might spark something. I know this is a .NET forum, but surely there is room for programming in .NET at the lower levels and it's not all flashy crystal reports and progess bars(oohhh the ones with multiple gradient colors ;) ) Let me know what you guys think :)
  19. I don't know if it'll help anyone, but I have attached the enumeration along with a linked list example to traverse through the windows found and some of their information.cEngine.zip
  20. I'll upload some code (as an edit) to this post later when I am at my work pc. It's the help that I received from HJB on the same toppic.Client.zip
×
×
  • Create New...