Dreq

Member

276

100 Neutral

• Rank
Member
1. Formula Problems (Insurance)

I'm currently trying to unravel some formulas for calculating insurance and I simply cannot get any meaningful values out of things. Here's a problem I'm running into: AF = CA + NLP + AHP + BP B = [ AF x q - ( M x asubn1 ) ] * (i + 1)^n BP = (MOB/1000) * B * asubtb * Min( 1, MAl / AF ) Value meanings: AF: Amount Financed BP: life single premium for balloon coverage B: Balloon Payment asubn1: present value of an investment based on an interest rate and a constant payment schedule. In excel its PV(i,n-1, -1).. in code its ( 1 - Power( ( 1 + i ), -( n - 1 ) ) ) / i As you can see, to calculate B you need to calculate AF, to calculate AF you need to calculate BP, and to calculate BP you need to calculate B ~and~ AF. This is a circular reference. Excel seems to be able to do this but I cannot for the life of me seem to be able to get it to work in code. I've tried simply looping (initializing the values to .00001) but that doesn't work. I do not necissarily need to know how to fix this specific situation, it'd help me greater to either explain, or point me in the right direction, as to how to solve this kind of problem. Thanks in advance.. this thing is driving me absolutely crazy..

It sounds like a lot of data but the reading/writing should be pretty straight foward. I would, however, recommend you use compression (zlib or likewise) if you are going to have insane amounts of data. This would slow down load times but could quite possibly greatly reduce the size of your files.
3. Hardware port emulation

Quote:Most programs would see a serial port as a simple file stream. Indeed linux is like that, but I did not know windows was the same way.. then again, I have 0 knowledge of using hardware directly in windows. Quote:Back in the old days, cin/cout (or stdin/stdout) WERE connections to serial ports. Computers didn't have a "console" in the sense of what Microsoft Windows provides. They may have had a hardcopy terminal attached to serial port 0 (or there may have been a designated console port which was in fact a serial port). I know what ya mean. Most of them were dumb terminals that accepted something like telnet.. basically echoed text on a text monitor, and sent keystrokes.. no processing involved. Quote:So, all you'd need to emulate that is another program. In Unix and its ilk, that what a pipe(2) was: it enabled another program to act as a source/sink for serial port emulation. There must be something similar under Windows? Well from my experiences with hardware I/O, I used inportb and outportb (or inp outp respectivly in vs). I guess this is the 'old' way to do it? Quote:If what you're looking for is lower-level UART emulation so you can practice IRQ-level programming and feeding/reading control and data registers at memory-mapped addresses, you might look in to obtaining a copy of Malformed html, but I looked at the source, and i'm aware of bochs. I actuially use VMware though as it can run windows and linux with no problems. I guess my main confusion is step 1: Step 1: ?? Step 2: Service or driver reads the data and converts it into a digital version of what the serial port would send Step 3: Emulation software reads this service/driver and sets the values of the pins that are connected to the port accordingly.

You call it a dataset. Are you trying to store something similar to what tables store in a database?

I am assuming what you are REALLY trying to say is that there can be any number of items and values and such. One thing that is VERY simple is a list of comma-seperated object=value pairs: MyVarA=5,MyVarB=f53.12,MyVarC=f1242.00,MyVarD="Hello\, Is someone there?",MyVarE="Another \"Test\" with system\, characters" If you are using special characters that may be needed inside strings, its always goot to accept the "\" literal (which tells your parcer that the next character is a literal string character, so skip any line terminators. There are much more efficent ways to do even that though. You could have it more like this: ////////////////// String variable example /////////////////// [0000] 0x01 <-- Vartype, This could be a #DEFINE VarType_String 1 [0001] 0x06 <-- Length of variable name [0002] "TestVar" <-- Variable length Name (quotes aren't actuially saved) [0009] 0x08 <-- Length of string value [000A] "My Value" <-- String value (again, quotes aren't actuially saved) Note that I tend to prefer non-null-terminating strings because they are much safer to use. Basically you can just have a different format for each data type (for example, booleans do not need a 'value length' field, they simple need one byte to store whether it is 'true' or not). Is this closer to what you are looking for?
6. reading through a web page c/c++

I've done some website crawling code before. Basically you can do one of two things: 1) Using standard winsock, you can basically create a simple HTTP client that connects to an ip address and recieves the incomming data, and then do with that data what you like. 2) What I did was use the microsoft IE OCX (activeX) control. I created an instance, used the "navigate" function to load a webpage. Done. The second option gives you an advantage in that you can then use the IE control (I use it non visually but there are some quirks to that so typically you can just have it 0 pixels wide/tall) to traverse the data with objects. IE will also allow you to pump in raw javascript, which is nice for form filling (of course you can also use the actuial html interface in the control to manually set the values). I used the TWebBrowser component in Delphi (which is a wrapper to the IE ocx), but I'm very sure the same can be done in pure C++.

File formats are a dime a dozen, different files have different formats. Having different "formats" in one file is normal also.. Bitmaps can have pallete information, and each 'pixel' could either represent a pallete entry, or a standard RGB value. As far as being able to load "any" file format,I highly doubt something like that exists. A lot of formats are for internal use (like game data files and such), and unless someone decoded them, there is no way ~you~ can open them. Can you be more specific on what kind of data you are trying to load?
8. Hardware port emulation

Is there any information on writing hardware port emulators? I would like to be able to create a driver that acts as a virtual serial port, which can be accessed just like a regular serial port, but would allow another program to read what would normally be comming through the port. WindowsXP would be the targeted system, but Win2k support would be nice too. Any information would be greatly appreciated!  Just to give a little info about exactly what I'm trying to do.. I have been studying electronic engeering (the maths and such involved) and, while learning, have been creating my own 'real time' (Though its timescaled WAY down) analog circuit simulator. So far when I build the projects in real life (heh) the circuits act the same (for the most part as I haven't coded in randomization for things like resistor tolerance, which is 5% on my real life resistors). But anywho, in the near future I am going to start designing some serial port circuits. But instead of risking frying my actuial ports, I want to create a virtual serial port that my emulator program can interface too. Then I want to be able to use C++ and do standard serial port I/O code, which the emulator (which would have to be running at realtime speed) would then catch and act upon. This thing is turning into a way cool project(concidering i was doing it just to learn the maths), so I hope its possible ^_^ [Edited by - Dreq on September 27, 2006 6:47:00 AM]
9. HTML/CSS problem with forms

I'm having a weird positining problem with forms. It looks fine on this test: Form with no fields But if I put a field in, it has this problem: Form With a field If you didn't notice the problem, it seems the first heading grows in size in which it grows into its 3 neighbors. Its hand-coded so just view source. Any help would be appreciated. Also note this form is for Internet Explorer viewing only... I personally use FireFox for normal web stuff but this form is loaded into an IE OCX control in windows, so cross browoser compatability is not needed in this case. [Edited by - Dreq on August 30, 2006 12:39:31 PM]
10. OSDev Question

I've been playing around with Operating system development here and there, and have even gotten into 32-bit mode and done this and that. My main problem is that, although I ~know~ some things, I don't know WHERE that information came from. My main question is this: When an x86 compatible PC boots up, the BIOS loads the first 512 bytes of a valid boot sector to memory address 0x7C00. My question is, what technical document states this? And where could I go about finding the documents for all this stuff. These people have to read it from somewhere >.< Thanks in advanced!
11. Drawing lines/shapes on a D3D surface

I was wondering how to plug in GDI commands to a texture. I use C# and manaed Direct3D to render my 2D engine, but now, I want to have a trasnparent texture across the entire screen (rendered last of course). Rendering the texture isn't the problem though, its creating it from scratch. I know at SOME point I have to use the "Graphics" class, but as far as how everything works, I am not sure. But anyway, just to 'test', all I really want to do at the moment is draw a couple of lines across the screen (at different colors/thicknesses). Any help would be greatly appreciated. As far as the "bottom line" of my question goes: How do you create a texture from scratch, and use GDI rendering commands to modify it (for managed Direct3D).
12. Programming

Well I'm done arguing either way.
13. Programming

Quote:Original post by Dreq Learn x86 assembly :) Um.. C++ is the de-facto for game programming. I myself use C# but I don't think any professional companies are using C# to write games (yet anyway). Read it again.. The smily was meant as a joke, but you guys just had to pick it apart and jump on me.. The only reason why I even explained it further was because he asked. Of course, answering him is aparently a 'hate crime' here if it goes against your views. Thats ok though, its what I expect ;) as far as "No. And incidentally, *that's* "kind of the point"." is concerned... That just goes to show you that... you know what, nevermind, I'm wasting my time (this is where someone posts back about how i'm wasting ~theirs~).
14. Programming

Quote:Original post by snk_kidThat is the most absurd advice i've ever read. If he/she learns assembly first she/he wont learn how to problem solve (and learn it using a variety of programming concept) properly, she/he wont learn how to design large programs and design them good, she/he wont be exposed to any form of programming abstractions and no i don't mean just "OO". "Wont learn how to problem solve": Oh so assembly has absolutely no problem solving at all? "she/he wont learn how to design large programs and design them good": And visual basic is supposed to be better? "she/he wont be exposed to any form of programming abstractions and no i don't mean just "OO"" Thats kind of the point... And, I close with the following passage: dcl_2d s0 dcl t0.xy texld r1, t0, s0 mov oC0, r1 Know what that is? A pixel shader program. Huzaaa.  And thanks for the negative raiting!