I made some more tests and I found a pattern. I wrote you an extensive message about it, but maybe because my tests were made during a period where the message page was open the whole message got lost to the rodents. So I'll type it again (highlights only without many details of the tests, sorry!). I noticed a pattern: a) login b) edit some setting c) save the settings d) succeed e) edit some other setting f) save the settings g) get the rodents (and the settings are not saved) h) manually edit the address to go back to CodeProject's home page i) edit some setting j) login is required so I login k) go back to c) On my previous tests I tried again by clicking "back" on the browser, getting some "page expired" error, insisting, getting some more errors, insisting again, and insisting some more until I got to a CodeProject page that I recognized. This because the rodents page does not have a link for me to go back to CodeProject (which I think it should, by the way, in order to be friendly). In this new sequence of tests I manually edited the address bar link to go back to CodeProject's home page, which consistently required me to login at some point. So I guess the problem is probably related to some corruption or invalid state that occurs when I save the settings once. So saving the settings a second time manifests the problem. Logging in seems to clear this corrupted state, and so I'm able to edit and save settings after that. This explains why I so consistently got rodents on my first tests (no re-login), and why I now so consistently succeeded in saving after logging in but got the rodents on the second save attempt. It also explains why you were able to log in as me, edit, and save, in case you happened to do it only once. The obvious follow up test is to try a shorter login->edit->save->login->edit->save... loop to confirm the rodents never show up, but I don't have more time today and I fear I may lose this message to the rodents too if I do any more tests before sending it. I hope this helps.
Rilhas
Posts
-
CodeProject's rodents attacking my motherboard's chipset!! -
CodeProject's rodents attacking my motherboard's chipset!!When you write "network issue" I immediately think of "intermittent problem". But so far it has happened to me very consistently, of the 4 or 5 times I've tries to activate the daily newsletter the rodents appeared 100.000% of the time. So if you need help traking it I'm pretty confident I can generate the error on demand. Let me know if you need someone to push the button on this end.
-
CodeProject's rodents attacking my motherboard's chipset!!I've been trying to modify my profile for the last few days, and I've been systematically presented with the rodents. See an example at http://www.rilhas.com/CodeProject/rodents.jpg[^]. Today I tried changing my picture and saving, and that worked. But trying to turn on the daily newsletter continues to fail. I have no idea about what may be happening, but I'm starting to think the CodeProject's crew doesn't get informed of these occurrences, so here is one.
-
assemblyYou are right, I don't! :-) As you can see from his post if we want to give help right away then we have to make a lot of assumptions! I assumed Win32 (could be LINUX, or any other OS), assembly inside C (could be assembly only, why not?), 386+ code, _asm directive availability, and C-style strings (as oposed to VB strings, for example), and possibly more which I didn't even realize! The alternative would be not to give any help right away. Anyway, my post still stands as I was giving an example for Win32 which is most comonly used with Intel 386+ processors (I don't think there is any Win32 version that can run on a 286). Rilhas :-)
-
assemblyI assume that you want to load the si register with the address of a string. Please use accurate language, especially when talking about assembly language. In Win32 you should use esi and not si: char* sp_ptr="hello!"; _asm { mov esi,sp_ptr } Rilhas
-
Word fileYou may consider going looking at the OpenOffice source at http://www.openoffice.org[^]as the project includes the ability to import and export MS Word compatible files. Rilhas
-
Scrabble gameYou have to be more specific. Do you want to make a game human vs. human or human vs. machine? The first seems to be a GUI issue, the second seems to be more of a dicionary issue than anything (where will you get it and what quality does it have?). Rilhas
-
I need to re-broadcast IP cameraI've done that for some cameras that contain a web server in them (usually IP cameras do). All you have to do is implement the browser side. In my case a simple GET or POST is enough for the camera to start outputing JPEG sequences which you can forward as you like. I've also encoutered other more complex servers that require the browser to install ActiveX controlls or something like that. I didn't want to go to all that trouble, so I just sniffed the packets with Ethereal, then saved them so that I can use them in my application. I don't know how they work (because I didn't bother looking at their contents), but they do. Rilhas
-
Find .56 from 19.56I think it is important for you to clarify what to do with negative numbers. What would you want to obtain with -19.56? -.56 or .44 (=-19.56-20.00)? The formula is usually simple for positive numbers because we all agree the integer part is the largest integer not greater than the given number, but for negative numbers we have to decide which reference to have (either 0 or -oo). Rilhas
-
PICWell, for C with the PIC18 family I would sugest The MPLAB C18 Compiler. I don't think it is GPL, because it is a comercial product sold by MICROCHIP. I consider it to be moderately priced (around 350 EUR), and I've used it and it is good. It has some bugs, but very easy to find and work around. You can find it at http://www.microchipdirect.com/productsearch.aspx?Keywords=SW006011[^]. This is not a C++ compiler. For that I don't know any products from personal experience. I hope this helps, Rilhas
-
More than one 'SwapBuffers(HDC)'Hi, I agree with previous posts. I will take a lot of time to download your files, compile them, run them... even if the resulting images are quite cool. I come here once in a while to give some advice if I think they can be usefull, but I have my own project and many other things to ocupy my time. So I would like to invite you to state what your problem is. In other words, what it is that is happening that is not as you expected? I think this is a good starting point for me to try to help. Anyway, I suspect that SwapBuffers() 2 times results in not swapping at all. At least with double buffering. So I don't know why you would want that. I have the feeling you would want something like: 1. WaitEvent() 2. TakePrimaryBufferAndCopyItToTexture() 3. WarpItAsNecessary() 4. DrawToSecondaryBuffer() 5. SwapBuffersOnceToMakeSecondaryBecomePrimary() 6. goto 1. Is this not what you want? I hope this helps, Rilhas
-
Creating Gradient ImagesOk. Modern computer graphics consist of pixels, which are the smallest units of color that can be represented on the screen. A screen of 1280x1024 contains 1.3 million pixels, and a modern display can set each one of those pixels to an individual color. These pixels are divided into 3 components: the red, the green, and the blue. This is because almost every color that our eyes can distinguish can be obtained by combining diferent amounts of red, green, and blue. So, controlling only these 3 components can make it possible to obtain almost any possible color. Then there is component resolution. Each component can be varied in intensity to achieve diferent colors, as I mentioned before. Usually we cannot distinguish between more than about 150 steps, meaning that if the span of a given component (from invisible (or off) to its full intensity) is divided into more than about 150 steps then we cannot tell the difference from one step to another. So we don't need to divide the span into more than 150 steps. However we divide it into 256 steps, to make it confortable to store components in computer memory (one byte per component) and for some other not so obvious reasons. This givs us a total of over 16 million individual colors (with 256 steps per component we get a total of 256x256x256 different colors). To get white you sum all components (you set red, green, and blue, to full intensity). This is the whitest that a screen is able to represent. To get black you turn them all off, and that is the blackest that a screen can represent. Screens vary in their ability to make full white or full black. For example, my video projector is unable to make perfect white because the blue component is a little weaker than the others (as with many of the mid-range video projectors). Also, LCD's/TFT's are unable to make perfect black, usually because the material used for their construction usually reflects some envoronmental light. If you want a gradient from black to white (from left to right, for example) then you should vary the component intensity from off (to the left) to on (to the right). Imagine an image of 800x600 and the following formula: for(x=0; x<800; x++) { for(y=0; y<600; y++) { pixel(x,y).red=x/799*255; pixel(x,y).green=x/799*255; pixel(x,y).blue=x/799*255; } // next y } // next x As you can see, x/799 is 1.0 only when x is 799, and that happens only at the rightmost pixel. Also, x/799 is zero on the left. An inversion would be simple, just replace x/799 by (799-x)/799. Also note tha
-
Creating Gradient ImagesI don't understand your question... I noted nothing misterious with Vista's gradients... maybe you mean gradients in color and in transparency? Or are you just asking about gradients in general?
-
OpenGL problemsI would like to help, but you don't say what the problem is. And I don't want to spend an afternoon going through code. Maybe you could say what you expected to obtain and what it is that you are obtaining? Also, I know OpenGL but I don't know what is a WMP. It seems to me you are trying to draw something and then make OpenGL modify it for you. I'm not sure I understand what you want but in general you already have to have your data ready when you call OpenGL to render a 3D world. OpenGL is the one doing all the drawing (generally speaking) and usually doesn't process (or modify) an already drawn image. I once made an application to wrap the real-time video feed from a web cam onto a 3D virtual object in the OpenGL world. Do you want to do something like that? Rilhas
-
PICFor C/C++ or assembly? What PIC family?
-
Processing video framesI think the answer you received does not address your question. At least I got it diferent. I assume you want to record an actor and then remove the background so that you can use the frames of the actor over the background of a game. The tricky part is that you don't want to spend a lot of money on a "green" background (which would be easilly removed, of course). Is this right? If I got it right then I can imagine a number of solutions and also many details that should be observed (depending on the final quality you intend to achieve). The easiest solution I can think of is dressing the actor in colors, instead of using a green background. From the image you posted I would sugest: 1) Paint her face light blue (this paint should not be too expensive). 2) Leave the hair black. 3) Paint the arms green (or dress them in a tight green bluse and gloves). 4) Wear a red sleavless shirt. 5) Wear blue pants. 6) Wear green shoes (or socks, I can't see the details very well). (this is for the given image only, other images may sugest a diferent colour scheme) Then it will be easier to remove the background against the actor's colors. Simply learn the background and subtract. Well, it is not as easy if you get a lot of noise (if you do then reply to this message for techniques how to remove noise). When you have removed the background then you just replace the actor's colours by software. All shadows should be valid and accurate after this and you get your actor isolated. Then, for realism and credibility, you should use an alpha channel (for transparency) for the sprite drawing (during the game). Make at least one alpha pixel in contour. If you have a typical color for background then reply to this message for techniques on how to recompute the best contour. I hope this helps, Rilhas
-
Please tell me about dithering. How can I change color depth of bmp 24 bits to bmp 4 bits?My answer does not address your question directly, since a good answer has already been given. I just wanted to remind you that if you are doing this to conserve space you will only get a gain of 6x at the expense of a very significant quality loss (at least on photographic images). A compression such as JPEG can give you a gain of 20x without losing nearly as much quality (in fact very little quality loss), and I think that even at 50x compression ratio it will still have better quality than any 4bpp BMP diethering. There is a number of JPEG libraries out there, some highly optimized (like INTEL's). I hope this helps, Rogério
-
bandwidth questionIt doesn't seem like a hard problem to solve... but I'm unsure: "the internet connection that host the DB has a max upload speed of 250kbps and upload of 1MB" is the connection that is serving the 20 remote users? And is the upload 250k or 1M?
-
Image Recognition AlgorithmSome ideas given here seem good, but they will tend to be computationally heavy. My work involves real time image processing in many domains, and in general most algorithms that are called "transform" are usually unacceptably slow (even for modern computers or DSP's). This, of course, depends on wether or not you can distribute the algorithm through various machines. In general I can't. Anyway, without more details on your case I simply imagine white sheets of paper with concentric circles drawn in them. If this is the case then finding the center is a very fast and efficient operation. Simply compute the mass center of all "pen" pixels. For example, if they are black then just sum the positions where you find them (keep X and Y separate) and in the end just divide the result by the image size. For example: mass_center_x=0; mass_center_y=0; total_found=0; for(y=0; y<image_size_y; y++) { for(x=0; x<image_size_x; x++) { if (Pixel(x, y)==BLACK) { mass_center_x+=x; mass_center_y+=y; total_found++; } } } if (total_found>0) { mass_center_x/=total_found; mass_center_y/=total_found; } At this point the "mass_center_x" and "mass_center_y" contain the coordinates of the center of the concentric circles. This algorithm is very fast because each pixel is analyzed only once, and so runs in an amount of time directly proportional to the number of pixels. Also note that Y is the outer loop so as to exploit the CPU cache in the most efficient manner. I hope this helps, Rilhas -- modified at 8:28 Sunday 20th May, 2007
-
PCM Audio question - Play sound files backwards?Hi, I think you got the idea right, however it is important to clarify that WAV files may be compressed (ADPCM, A-LAW, u-LAW, etc.). This means that you can find many WAV files whose bytes do not correspond to plain PCM samples. In general I would say that you should modify your algorithm so that you load a file (WAV or MP3) and then normalize it to linear PCM samples. For ADPCM or x-LAW this may correspond to simple sample-based decompression schemes, for MP3 you should probably get a decoder (there are open source MP3 libraries out there). But please note that MP3 is a licensed technology (even if you get the algorithm or source code legally you still have to pay to use it). After this normalization stage you simply reverse the samples and write them back to disk (or play them directly from RAM, why not??). The x-LAW files could be played directly simply by reversing the samples (even without decompressing) and saving to file or playing directly (requesting an x-LAW audio output format). If you want to write to disk then uncompressed WAV is the easiest (just a few header bytes and you're done). If you want to write back MP3 it can be a little trickier (and subject to the same royalty restrictions as the decoder). Anyway, these comments are for simple C/C++ implementations. The COM interface, C#, JAVA, and other languages and platforms may make the task easier (or not!). About the WAV format: just search for "wav format specification" and you will find many references. For example, http://ccrma.stanford.edu/courses/422/projects/WaveFormat/[^] seems to be ok. I hope this helps, Rilhas