Search Results

Search found 69 results on 3 pages for 'dyslexic tangent'.

Page 3/3 | < Previous Page | 1 2 3 

  • Odd Profiler Results with EF4

    - by AjarnMark
    I have been doing some testing of using the Microsoft Entity Framework 4 with stored procedures and ran across some really odd results in SQL Server Profiler. The application that is running which uses Entity Framework 4 is a simple Web Application written in C#, and the Entity Data Model is actually contained in a referenced class library of its own.  I’ll write more about my experiences with this later.  For now the question is, why does SQL Profiler think that the stored procedure is running in Master, and not in my application database? While analyzing the effects of using custom helper methods on my EDM classes to call the stored procedure, I decided to run Profiler while I stepped through the code so that I had a clear understanding of exactly when and what calls were made to the SQL Server.  I ran Profiler switching back and forth between the TSQL and TSQL_SP templates.  However, to reduce the amount of results rows I needed to wade through, I set a filter on DatabaseID to be equal to my application’s database.  Each time I ran this, the only thing that I saw was an Audit:Login to the database, but no procedure or T-SQL statements executed, yet I was definitely getting results back to my web page.  I tried other Profiler templates, still filtering on DatabaseID (tangent: I found, at least back in SQL 2000 Profiler, that filtering on DatabaseID was more reliable than filtering on DatabaseName.  Even though I’m now running SQL 2008, that habit sticks with me).  Still no results other than the Login.  Very weird! Finally, I decided to run Profiler with no filtering and discovered that that lines which represent my stored procedure and its T-SQL commands are all marked with DatabaseID = 1, which is Master.  Why in the world would that be?  My procedure is definitely in the application database, and not in Master, and there is nothing funny about the call to the procedure evident in Profiler (i.e. it is not called as MyAppDB.dbo.MyProcName, but rather just dbo.MyProcName).  There must be something funny with the way the Entity Framework is wrapping this call, and I don’t like it…I don’t like it one bit.  My primary PROD server contains 40+ databases on it, and when I need to profile something, I expect to be able to filter based on DatabaseID (for the record, I displayed DatabaseName in my results, too, and it also shows Master). I find the same pattern of everything except the Login showing up as being in Master when I run my version that uses standard LINQ to Entities instead of stored procedures, so that suggests it is not my code, but rather something funny with SQL Server 2008 Profiler or the Entity Framework. If you have any ideas about why this might be so, please comment below.

    Read the article

  • Using SQL Source Control and Vault Professional Part 4

    - by Ajarn Mark Caldwell
    Two weeks ago I upgraded our installation of Fortress to the latest version, which is now named Vault Professional.  This is the version of Vault (i.e. Vault Standard 5.1 / Vault Professional 5.1) that will be officially supported with Red-Gate SQL Source Control 2.1.  While the folks at Red-Gate did a fantastic job of working with me to get SQL Source Control to work with the older Fortress version, we weren’t going to just sit on that.  There are a couple of things that Vault Professional cleaned up for us, such as improved integration with Visual Studio 2010, so it was a win all around. Shortly after that upgrade, I received notice from Red-Gate that they had a new Early Access version of SQL Source Control available that included the ability to source control static data.  The idea here is that you probably have a few fairly static lookup tables in your system, and those data values are similar in concept to source code, and should be versioned in your source control management system also.  I agree with this, but please be wise…somebody out there is bound to try to use this feature as their disaster recovery for their entire database, and that is NOT the purpose.  First off, you should never have your PROD (or LIVE, whatever you call it) system attached to source control.  Source Control is for development, not for PROD systems.  Second, use the features that are intended for this purpose, such as BACKUP and RESTORE. Laying that tangent aside, it is great that now you can include these critical values in your repository and make them part of a deployment process.  As you would guess, SQL Source Control uses SQL Data Compare to create the data change scripts just like it uses SQL Compare to create the schema change scripts.  Once again, they did a very good job with the integration to their other products.  At this point we are really starting to see some good payback on our investment in the full SQL Developer Bundle.  Those products were worth the investment back when we only used them sporadically for troubleshooting and DBA analysis, but now with SQL Source Control, they are becoming everyday-use products for the development team. I like this software (SQL Source Control) so much that I am about to break my own rules and distribute it to my team to use even though it is still in beta.  This is the first time that I have approved the use of any beta software in a production scenario (actively building our next versions of internal software) but I predict that the usability and productivity gain of using SQL Source Control over manual scripting is worth the risk.  Of course, I have also put this beta software through its paces pretty well to be comfortable with it, and Red-Gate has proven their responsiveness to issues that came up in my early beta testing, and so I am willing to bet on their continued support.  Likewise, SourceGear, the maker of Vault Professional, has proven itself to me as well, and so the combination of SQL Source Control with Vault Professional is the new standard for my development team.

    Read the article

  • Running Multiple Queries in Oracle SQL Developer

    - by thatjeffsmith
    There are two methods for running queries in SQL Developer: Run Statement Run Statement, Shift+Enter, F9, or this button Run Script No grids, just script (SQL*Plus like) ouput is fine, thank you very much! What’s the Difference? There are some obvious differences between the two features, the most obvious being the format of the output delivered. But there are some other, more subtle differences here, primarily around fetching. What is Fetch? After you run send your query to Oracle, it has to do 3 things: Parse Execute Fetch Technically it has to do at least 2 things, and sometimes only 1. But, to get the data back to the user, the fetch must occur. If you have a 10 row query or a 1,000,000 row query, this can mean 1 or many fetches in groups of records. Ok, before I went on the Fetch tangent, I said there were two ways to run statements in SQL Developer: Run Statement Run statement brings your query results to a grid with a single fetch. The user sees 50, 100, 500, etc rows come back, but SQL Developer and the database know that there are more rows waiting to be retrieved. The process on the server that was used to execute the query is still hanging around too. To alleviate this, increase your fetch size to 500. Every query ran will come back with the first 500 rows, and rows will be continued to be fetched in 500 row increments. You’ll then see most of your ad hoc queries complete with a single fetch. Scroll down, or hit Ctrl+End to force a full fetch and get all your rows back. Run Script Run Script runs the contents of the worksheet (or what’s highlighted) as a ‘script.’ What does that mean exactly? Think of this as being equivalent to running this in SQL*Plus: @my_script.sql; Each statement is executed. Also, ALL rows are fetched. So once it’s finished executing, there are no open cursors left around. The more obvious difference here is that the output comes back formatted as plain old text. Run one or more commands plus SQL*Plus commands like SET and SPOOL The Trick: Run Statement Works With Multiple Statements! It says ‘run statement,’ but if you select more than one with your mouse and hit the button – it will run each and throw the results to 1 grid for each statement. If you mouse hover over the Query Result panel tab, SQL Developer will tell you the query used to populate that grid. This will work regardless of what you have this preference set to: DATABASE – WORKSHEET – SHOW QUERY RESULTS IN NEW TABS Mind the fetch though! Close those cursors by bring back all the records or closing the grids when you’re done with them.

    Read the article

  • Bump mapping Problem GLSL

    - by jmfel1926
    I am having a slight problem with my Bump Mapping project. Although everything works OK (at least from what I know) there is a slight mistake somewhere and I get incorrect shading on the brick wall when the light goes to the one side or the other as seen in the picture below: The light is on the right side so the shading on the wall should be the other way. I have provided the shaders to help find the issue (I do not have much experience with shaders). Shaders: varying vec3 viewVec; varying vec3 position; varying vec3 lightvec; attribute vec3 tangent; attribute vec3 binormal; uniform vec3 lightpos; uniform mat4 cameraMat; void main() { gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = ftransform(); position = vec3(gl_ModelViewMatrix * gl_Vertex); lightvec = vec3(cameraMat * vec4(lightpos,1.0)) - position ; vec3 eyeVec = vec3(gl_ModelViewMatrix * gl_Vertex); viewVec = normalize(-eyeVec); } uniform sampler2D colormap; uniform sampler2D normalmap; varying vec3 viewVec; varying vec3 position; varying vec3 lightvec; vec3 vv; uniform float diffuset; uniform float specularterm; uniform float ambientterm; void main() { vv=viewVec; vec3 normals = normalize(texture2D(normalmap,gl_TexCoord[0].st).rgb * 2.0 - 1.0); normals.y = -normals.y; //normals = (normals * gl_NormalMatrix).xyz ; vec3 distance = lightvec; float dist_number =length(distance); float final_dist_number = 2.0/pow(dist_number,diffuset); vec3 light_dir=normalize(lightvec); vec3 Halfvector = normalize(light_dir+vv); float angle=max(dot(Halfvector,normals),0.0); angle= pow(angle,specularterm); vec3 specular=vec3(angle,angle,angle); float diffuseterm=max(dot(light_dir,normals),0.0); vec3 diffuse = diffuseterm * texture2D(colormap,gl_TexCoord[0].st).rgb; vec3 ambient = ambientterm *texture2D(colormap,gl_TexCoord[0].st).rgb; vec3 diffusefinal = diffuse * final_dist_number; vec3 finalcolor=diffusefinal+specular+ambient; gl_FragColor = vec4(finalcolor, 1.0); }

    Read the article

  • F# Objects &ndash; Integration with the other .Net Languages &ndash; Part 2

    - by MarkPearl
    So in part one of my posting I covered the real basics of object creation. Today I will hopefully dig a little deeper… My expert F# book brings up an interesting point – properties in F# are just syntactic sugar for method calls. This makes sense… for instance assume I had the following object with the property exposed called Firstname. type Person(Firstname : string, Lastname : string) = member v.Firstname = Firstname I could extend the Firstname property with the following code and everything would be hunky dory… type Person(Firstname : string, Lastname : string) = member v.Firstname = Console.WriteLine("Side Effect") Firstname   All that this would do is each time I use the property Firstname, I would see the side effect printed to the screen saying “Side Effect”. Member methods have a very similar look & feel to properties, in fact the only difference really is that you declare that parameters are being passed in. type Person(Firstname : string, Lastname : string) = member v.FullName(middleName) = Firstname + " " + middleName + " " + Lastname   In the code above, FullName requires the parameter middleName, and if viewed from another project in C# would show as a method and not a property. Precomputation Optimizations Okay, so something that is obvious once you think of it but that poses an interesting side effect of mutable value holders is pre-computation of results. All it is, is a slight difference in code but can result in quite a huge saving in performance. Basically pre-computation means you would not need to compute a value every time a method is called – but could perform the computation at the creation of the object (I hope I have got it right). In a way I battle to differentiate this from lazy evaluation but I will show an example to explain the principle. Let me try and show an example to illustrate the principle… assume the following F# module namespace myNamespace open System module myMod = let Add val1 val2 = Console.WriteLine("Compute") val1 + val2 type MathPrecompute(val1 : int, val2 : int) = let precomputedsum = Add val1 val2 member v.Sum = precomputedsum type MathNormalCompute(val1 : int, val2 : int) = member v.Sum = Add val1 val2 Now assume you have a C# console app that makes use of the objects with code similar to the following… using System; using myNamespace; namespace CSharpTest { class Program { static void Main(string[] args) { Console.WriteLine("Constructing Objects"); var myObj1 = new myMod.MathNormalCompute(10, 11); var myObj2 = new myMod.MathPrecompute(10, 11); Console.WriteLine(""); Console.WriteLine("Normal Compute Sum..."); Console.WriteLine(myObj1.Sum); Console.WriteLine(myObj1.Sum); Console.WriteLine(myObj1.Sum); Console.WriteLine(""); Console.WriteLine("Pre Compute Sum..."); Console.WriteLine(myObj2.Sum); Console.WriteLine(myObj2.Sum); Console.WriteLine(myObj2.Sum); Console.ReadKey(); } } } The output when running the console application would be as follows…. You will notice with the normal compute object that the system would call the Add function every time the method was called. With the Precompute object it only called the compute method when the object was created. Subtle, but something that could lead to major performance benefits. So… this post has gone off in a slight tangent but still related to F# objects.

    Read the article

  • How to draw an Arc in OpenGL

    - by rpgFANATIC
    While making a little Pong game in C++ OpenGL, I decided it'd be fun to create arcs (semi-circles) when stuff bounces. I decided to skip Bezier curves for the moment and just go with straight algebra, but I didn't get far. My algebra follows a simple quadratic function (y = +- sqrt(mx+c)). This little excerpt is just an example I've yet to fully parameterize, I just wanted to see how it would look. When I draw this, however, it gives me a straight vertical line where the line's tangent line approaches -1.0 / 1.0. Is this a limitation of the GL_LINE_STRIP style or is there an easier way to draw semi-circles / arcs? Or did I just completely miss something obvious? void Ball::drawBounce() { float piecesToDraw = 100.0f; float arcWidth = 10.0f; float arcAngle = 4.0f; glBegin(GL_LINE_STRIP); for (float i = 0.0f; i < piecesToDraw; i += 1.0f) // Positive Half { float currentX = (i / piecesToDraw) * arcWidth; glVertex2f(currentX, sqrtf((-currentX * arcAngle)+ arcWidth)); } for (float j = piecesToDraw; j > 0.0f; j -= 1.0f) // Negative half (go backwards in X direction now) { float currentX = (j / piecesToDraw) * arcWidth; glVertex2f(currentX, -sqrtf((-currentX * arcAngle) + arcWidth)); } glEnd(); } Thanks in advance.

    Read the article

  • 2D Ball Collisions with Corners

    - by Aaron
    I'm trying to write a 2D simulation of a ball that bounces off of fixed vertical and horizontal walls. Simulating collisions with the faces of the walls was pretty simple--just negate the X-velocity for a vertical wall or the Y-velocity for a horizontal wall. The problem is that the ball can also collide with the corners of the walls, where a horizontal wall meets with a vertical wall. I have already figured out how to detect when a collision with a corner is occurring. My question is how the ball should react to this collision--that is, how its X and Y velocities will change as a result. Here's a list of what I already know or know how to find: *The X and Y coordinates of the ball's center during the frame when a collision is detected *The X and Y components of the ball's velocity *The X and Y coordinates of the corner *The angle between the ball's center and the corner *The angle in which the ball is traveling just before the collision *The amount that the ball is overlapping the corner when the collision is detected I'm guessing that it's best to pretend that the corner is an infinitely small circle, so I can treat a collision between the ball and that circle as if the ball were colliding with a wall that runs tangent to the circles at the point of collision. It seems to me that all I need to do is rotate the coordinate system to line up with this imaginary wall, reverse the X component of the ball's velocity under this system, and rotate the coordinates back to the original system. The problem is that I have no idea how to program this. By the way, this is an ideal simulation. I'm not taking anything like friction or the ball's rotation into account. I'm using Objective-C, but I'd really just like a general algorithm or some advice. Many thanks if anyone can help!

    Read the article

  • What are practical guidelines for evaluating a language's "Turing Completeness"?

    - by AShelly
    I've read "what-is-turing-complete" and the wikipedia page, but I'm less interested in a formal proof than in the practical implications of being Turing Complete. What I'm actually trying to decide is if the toy language I've just designed could be used as a general-purpose language. I know I can prove it is if I can write a Turing machine with it. But I don't want to go through that exercise until I'm fairly certain of success. Is there a minimum set of features without which Turing Completeness is impossible? Is there a set of features which virtually guarantees completeness? (My guess is that conditional branching and a readable/writeable memory store will get me most of the way there) EDIT: I think I've gone off on a tangent by saying "Turing Complete". I'm trying to guess with reasonable confidence that a newly invented language with a certain feature set (or alternately, a VM with a certain instruction set) would be able to compute anything worth computing. I know proving you can building a Turing machine with it is one way, but not the only way. What I was hoping for was a set of guidelines like: "if it can do X,Y,and Z, it can probably do anything".

    Read the article

  • Move camera to fit 3D scene

    - by Burre
    Hi there. I'm looking for an algorithm to fit a bounding box inside a viewport (in my case a DirectX scene). I know about algorithms for centering a bounding sphere in a orthographic camera but would need the same for a bounding box and a perspective camera. I have most of the data: I have the up-vector for the camera I have the center point of the bounding box I have the look-at vector (direction and distance) from the camera point to the box center I have projected the points on a plane perpendicular to the camera and retrieved the coefficients describing how much the max/min X and Y coords are within or outside the viewing plane. Problems I have: Center of the bounding box isn't necessarily in the center of the viewport (that is, it's bounding rectangle after projection). Since the field of view "skew" the projection (see http://en.wikipedia.org/wiki/File:Perspective-foreshortening.svg) I cannot simply use the coefficients as a scale factor to move the camera because it will overshoot/undershoot the desired camera position How do I find the camera position so that it fills the viewport as pixel perfect as possible (exception being if the aspect ratio is far from 1.0, it only needs to fill one of the screen axis)? I've tried some other things: Using a bounding sphere and Tangent to find a scale factor to move the camera. This doesn't work well, because, it doesn't take into account the perspective projection, and secondly spheres are bad bounding volumes for my use because I have a lot of flat and long geometries. Iterating calls to the function to get a smaller and smaller error in the camera position. This has worked somewhat, but I can sometimes run into weird edge cases where the camera position overshoots too much and the error factor increases. Also, when doing this I didn't recenter the model based on the position of the bounding rectangle. I couldn't find a solid, robust way to do that reliably. Help please!

    Read the article

  • How to draw shadows that don't suck?

    - by mystify
    A CAShapeLayer uses a CGPathRef to draw it's stuff. So I have a star path, and I want a smooth drop shadow with a radius of about 15 units. Probably there is some nice functionality in some new iPhone OS versions, but I need to do it myself for a old aged version of 3.0 (which most people still use). I tried to do some REALLY nasty stuff: I created a for-loop and sequentially created like 15 of those paths, transform-scaling them step by step to become bigger. Then assigning them to a new created CAShapeLayer and decreasing it's alpha a little bit on every iteration. Not only that this scaling is mathematically incorrect and sucks (it should happen relative to the outline!), the shadow is not rounded and looks really ugly. That's why nice soft shadows have a radius. The tips of a star shouldn't appear totally sharp after a shadow size of 15 units. They should be soft like cream. But in my ugly solution they're just as s harp as the star itself, since all I do is scale the star 15 times and decrease it's alpha 15 times. Ugly. I wonder how the big guys do it? If you had an arbitrary path, and that path must throw a shadow, how does the algorithm to do that work? Probably the path would have to be expanded like 30 times, point-by-point relative to the tangent of the outline away from the filled part, and just by 0.5 units to have a nice blending. Before I re-invent the wheel, maybe someone has a handy example or link?

    Read the article

  • Cloning ID3DXMesh with declration that has 12 floats breaks?

    - by meds
    I have the following vertex declration: struct MESHVERTInstanced { float x, y, z; // Position float nx, ny, nz; // Normal float tu, tv; // Texcoord float idx; // index of the vertex! float tanx, tany, tanz; // The tangent const static D3DVERTEXELEMENT9 Decl[6]; static IDirect3DVertexDeclaration9* meshvertinstdecl; }; And I declare it as such: const D3DVERTEXELEMENT9 MESHVERTInstanced::Decl[] = { { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, { 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, { 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, { 0, 32, D3DDECLTYPE_FLOAT1, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1 }, { 0, 36, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0 }, D3DDECL_END() }; What I try to do next is copy an ID3DXMesh into another one with the new vertex declaration as such: model->CloneMesh( model->GetOptions(), MESHVERTInstanced::Decl, gd3dDevice, &pTempMesh ); When I try to get the FVF size of pTempMesh (D3DXGetFVFVertexSize(pTempMesh-GetFVF())) I get '0' though the size should be 48. The whole thing is fine if I don't have the last declaration, '{ 0, 36, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0 },' in it and the CloneMesh function does not return a FAIL. I've also tried using different declarations such as D3DDECLUSAGE_TEXCOORD and that has worked fine, returning a size of 48. Is there something specific about D3DDECLUSAGE_TANGENT I don't know? I'm at a complete loss as to why this isn't working...

    Read the article

  • A Basic Thread

    - by Joe Mayo
    Most of the programs written are single-threaded, meaning that they run on the main execution thread. For various reasons such as performance, scalability, and/or responsiveness additional threads can be useful. .NET has extensive threading support, from the basic threads introduced in v1.0 to the Task Parallel Library (TPL) introduced in v4.0. To get started with threads, it's helpful to begin with the basics; starting a Thread. Why Do I Care? The scenario I'll use for needing to use a thread is writing to a file.  Sometimes, writing to a file takes a while and you don't want your user interface to lock up until the file write is done. In other words, you want the application to be responsive to the user. How Would I Go About It? The solution is to launch a new thread that performs the file write, allowing the main thread to return to the user right away.  Whenever the file writing thread completes, it will let the user know.  In the meantime, the user is free to interact with the program for other tasks. The following examples demonstrate how to do this. Show Me the Code? The code we'll use to work with threads is in the System.Threading namespace, so you'll need the following using directive at the top of the file: using System.Threading; When you run code on a thread, the code is specified via a method.  Here's the code that will execute on the thread: private static void WriteFile() { Thread.Sleep(1000); Console.WriteLine("File Written."); } The call to Thread.Sleep(1000) delays thread execution. The parameter is specified in milliseconds, and 1000 means that this will cause the program to sleep for approximately 1 second.  This method happens to be static, but that's just part of this example, which you'll see is launched from the static Main method.  A thread could be instance or static.  Notice that the method does not have parameters and does not have a return type. As you know, the way to refer to a method is via a delegate.  There is a delegate named ThreadStart in System.Threading that refers to a method without parameters or return type, shown below: ThreadStart fileWriterHandlerDelegate = new ThreadStart(WriteFile); I'll show you the whole program below, but the ThreadStart instance above goes in the Main method. The thread uses the ThreadStart instance, fileWriterHandlerDelegate, to specify the method to execute on the thread: Thread fileWriter = new Thread(fileWriterHandlerDelegate); As shown above, the argument type for the Thread constructor is the ThreadStart delegate type. The fileWriterHandlerDelegate argument is an instance of the ThreadStart delegate type. This creates an instance of a thread and what code will execute, but the new thread instance, fileWriter, isn't running yet. You have to explicitly start it, like this: fileWriter.Start(); Now, the code in the WriteFile method is executing on a separate thread. Meanwhile, the main thread that started the fileWriter thread continues on it's own.  You have two threads running at the same time. Okay, I'm Starting to Get Glassy Eyed. How Does it All Fit Together? The example below is the whole program, pulling all the previous bits together. It's followed by its output and an explanation. using System; using System.Threading; namespace BasicThread { class Program { static void Main() { ThreadStart fileWriterHandlerDelegate = new ThreadStart(WriteFile); Thread fileWriter = new Thread(fileWriterHandlerDelegate); Console.WriteLine("Starting FileWriter"); fileWriter.Start(); Console.WriteLine("Called FileWriter"); Console.ReadKey(); } private static void WriteFile() { Thread.Sleep(1000); Console.WriteLine("File Written"); } } } And here's the output: Starting FileWriter Called FileWriter File Written So, Why are the Printouts Backwards? The output above corresponds to Console.Writeline statements in the program, with the second and third seemingly reversed. In a single-threaded program, "File Written" would print before "Called FileWriter". However, this is a multi-threaded (2 or more threads) program.  In multi-threading, you can't make any assumptions about when a given thread will run.  In this case, I added the Sleep statement to the WriteFile method to greatly increase the chances that the message from the main thread will print first. Without the Thread.Sleep, you could run this on a system with multiple cores and/or multiple processors and potentially get different results each time. Interesting Tangent but What Should I Get Out of All This? Going back to the main point, launching the WriteFile method on a separate thread made the program more responsive.  The file writing logic ran for a while, but the main thread returned to the user, as demonstrated by the print out of "Called FileWriter".  When the file write finished, it let the user know via another print statement. This was a very efficient use of CPU resources that made for a more pleasant user experience. Joe

    Read the article

  • velocity vector

    - by wanderer
    Hi, I am trying to simulate a collision. The collision is shown here http://www.freeimagehosting.net/image.php?c5ae01b476.jpg A particle falls down on a sphere and a collision between sphere and particle takes place. The sphere always remain stationary and the collision itself is not elastic. So if the particle falls directly n top of sphere, the velocity of particle will become zero. I was trying to set the velocity of particle to be zero after the collision. But that does not give good simulation when the collision does not occur on top of sphere but along the side of sphere. So now after the collision i need to make sure that the particle has a velocity which is orthogonal to the vector of the point of collision from the center of sphere. The velocity along the vector from center of sphere to point of collision should become zero. How do i do that? I am a bit mathematically challenged but i think it has something to do with dot product of vectors. Or maybe i am wrong :) I have the initial velocity vector and 'radiusvector' say :- 1)velocity <-1.03054, -1.56563, 1.33341e-016 2) radius vector <2.04406, 2.19587, 1.0514 Pseudo code for the problem is: foreach( particle particle in particlesCollections) { //sphere.x, sphere.y sphere.z give the center of the sphere dist = particle.pos-vector(sphere.x,sphere.y,sphere.z); //detect if a collision has taken place. if (dist.mag < sphere.radius) { rVector=dist/dist.mag*sphere.radius; particle.pos=vector(sphere.x,sphere.y,sphere.z) + rVector; //particle.Velocity gives the velocity vector of the particle at the time of collision //i need to modify particle.Velocity so that the component of velocity that runs along // with the rvector becomes zero as i have a non elsatic collision. The remaining //velocity that the particle will have is the one which runs along with tangent to the //rVector. The sphere remains stationary. //example values: particle.Velocity == <-1.03054, -1.56563, .006> //and rVector = <2.04406, 2.19587, 1.0514> } } Thanks

    Read the article

  • Scared of Calculus - Required to pass Differential Calculus as part of my Computer science major

    - by ke3pup
    Hi guys I'm finishing my Computer science degree in university but my fear of maths (lack of background knowledge) made me to leave all my maths units til' the very end which is now. i either take them on and pass or have to give up. I've passed all my programming units easily but knowing my poor maths skills won't do i've been staying clear of the maths units. I have to pass Differential Calculus and Linear Algebra first. With a help of book named "Linear Algebra: A Modern Introduction" i'm finding myself on track and i think i can pass the Linear Algebra unit. But with differential calculus i can't find a book to help me. They're either too advanced or just too simple for what i have to learn. The things i'm required to know for this units are: Set notation, the real number line, Complex numbers in cartesian form. Complex plane, modulus. Complex numbers in polar form. De Moivre’s Theorem. Complex powers and nth roots. Definition of ei? and ez for z complex. Applications to trigonometry. Revision of domain and range of a function Working in R3. Curves and surfaces. Functions of 2 variables. Level curves.Partial derivatives and tangent planes. The derivative as a difference quotient. Geometric significance of the derivative. Discussion of limit. Higher order partial derivatives. Limits of f(x,y). Continuity. Maxima and minima of f(x,y). The chain rule. Implicit differentiation. Directional derivatives and the gradient. Limit laws, l’Hoˆpital’s rule, composition law. Definition of sinh and cosh and their inverses. Taylor polynomials. The remainder term. Taylor series. Is there a book to help me get on track with the above? Being a student i can't buy too many books hence why i'm looking for a book that covers topics I need to know. The University library has a fairly limited collection which i took as loan but didn't find useful as it was too complex.

    Read the article

  • Recommendations for a free GIS library supporting raster images

    - by gspr
    Hi. I'm quite new to the whole field of GIS, and I'm about to make a small program that essentially overlays GPS tracks on a map together with some other annotations. I primarily need to allow scanned (thus raster) maps (although it would be nice to support proper map formats and something like OpenStreetmap in the long run). My first exploratory program uses Qt's graphics view framework and overlays the GPS points by simply projecting them onto the tangent plane to the WGS84 ellipsoid at a calibration point. This gives half-decent accuracy, and actually looks good. But then I started wondering. To get the accuracy I need (i.e. remove the "half" in "half-decent"), I have to correct for the map projection. While the math is not a problem in itself, supporting many map projection feels like needless work. Even though a few projections would probably be enough, I started thinking about just using something like the PROJ.4 library to do my projections. But then, why not take it all the way? Perhaps I might aswell use a full-blown map library such as Mapnik (edit: Quantum GIS also looks very nice), which will probably pay off when I start to want even more fancy annotations or some other symptom of featuritis. So, finally, to the question: What would you do? Would you use a full-blown map library? If so, which one? Again, it's important that it supports using (and zooming in and out with) raster maps and has pretty overlay features. Or would you just keep it simple, and go with Qt's own graphics view framework together with something like PROJ.4 to handle the map projections? I appreciate any feedback! Some technicalities: I'm writing in C++ with a Qt-based GUI, so I'd prefer something that plays relatively nicely with those. Also, the library must be free software (as in FOSS), and at least decently cross-platform (GNU/Linux, Windows and Mac, at least). Edit: OK, it seems I didn't do quite enough research before asking this question. Both Quantum GIS and Mapnik seem very well suited for my purpose. The former especially so since it's based on Qt.

    Read the article

  • creating a 3d plane using Frank Luna's technique

    - by numerical25
    I am creating a 3d plane that lays on the x and z axis. and has hills that extend on the y axis. bulk of the code looks like this float PeaksAndValleys::getHeight(float x, float z)const { return 0.3f*( z*sinf(0.1f*x) + x*cosf(0.1f*z) ); } void PeaksAndValleys::init(ID3D10Device* device, DWORD m, DWORD n, float dx) { md3dDevice = device; mNumRows = m; mNumCols = n; mNumVertices = m*n; mNumFaces = (m-1)*(n-1)*2; // Create the geometry and fill the vertex buffer. std::vector<Vertex> vertices(mNumVertices); float halfWidth = (n-1)*dx*0.5f; float halfDepth = (m-1)*dx*0.5f; for(DWORD i = 0; i < m; ++i) { float z = halfDepth - i*dx; for(DWORD j = 0; j < n; ++j) { float x = -halfWidth + j*dx; // Graph of this function looks like a mountain range. float y = getHeight(x,z); vertices[i*n+j].pos = D3DXVECTOR3(x, y, z); // Color the vertex based on its height. if( y < -10.0f ) vertices[i*n+j].color = BEACH_SAND; else if( y < 5.0f ) vertices[i*n+j].color = LIGHT_YELLOW_GREEN; else if( y < 12.0f ) vertices[i*n+j].color = DARK_YELLOW_GREEN; else if( y < 20.0f ) vertices[i*n+j].color = DARKBROWN; else vertices[i*n+j].color = WHITE; } } D3D10_BUFFER_DESC vbd; vbd.Usage = D3D10_USAGE_IMMUTABLE; vbd.ByteWidth = sizeof(Vertex) * mNumVertices; vbd.BindFlags = D3D10_BIND_VERTEX_BUFFER; vbd.CPUAccessFlags = 0; vbd.MiscFlags = 0; D3D10_SUBRESOURCE_DATA vinitData; vinitData.pSysMem = &vertices[0]; HR(md3dDevice->CreateBuffer(&vbd, &vinitData, &mVB)); // Create the index buffer. The index buffer is fixed, so we only // need to create and set once. std::vector<DWORD> indices(mNumFaces*3); // 3 indices per face // Iterate over each quad and compute indices. int k = 0; for(DWORD i = 0; i < m-1; ++i) { for(DWORD j = 0; j < n-1; ++j) { indices[k] = i*n+j; indices[k+1] = i*n+j+1; indices[k+2] = (i+1)*n+j; indices[k+3] = (i+1)*n+j; indices[k+4] = i*n+j+1; indices[k+5] = (i+1)*n+j+1; k += 6; // next quad } } D3D10_BUFFER_DESC ibd; ibd.Usage = D3D10_USAGE_IMMUTABLE; ibd.ByteWidth = sizeof(DWORD) * mNumFaces*3; ibd.BindFlags = D3D10_BIND_INDEX_BUFFER; ibd.CPUAccessFlags = 0; ibd.MiscFlags = 0; D3D10_SUBRESOURCE_DATA iinitData; iinitData.pSysMem = &indices[0]; HR(md3dDevice->CreateBuffer(&ibd, &iinitData, &mIB)); } My question pretains to the cosf and sinf. I am formiluar with trigonometry and I understand sin, cosine, and tangent. but I am not formiluar with cosf and sinf and what they do. From looking at this example. they have alot to do with finding a y value.

    Read the article

  • Using glDrawElements does not draw my .obj file

    - by Hallik
    I am trying to correctly import an .OBJ file from 3ds Max. I got this working using glBegin() & glEnd() from a previous question on here, but had really poor performance obviously, so I am trying to use glDrawElements now. I am importing a chessboard, its game pieces, etc. The board, each game piece, and each square on the board is stored in a struct GroupObject. The way I store the data is like this: struct Vertex { float position[3]; float texCoord[2]; float normal[3]; float tangent[4]; float bitangent[3]; }; struct Material { float ambient[4]; float diffuse[4]; float specular[4]; float shininess; // [0 = min shininess, 1 = max shininess] float alpha; // [0 = fully transparent, 1 = fully opaque] std::string name; std::string colorMapFilename; std::string bumpMapFilename; std::vector<int> indices; int id; }; //A chess piece or square struct GroupObject { std::vector<Material *> materials; std::string objectName; std::string groupName; int index; }; All vertices are triangles, so there are always 3 points. When I am looping through the faces f section in the obj file, I store the v0, v1, & v2 in the Material-indices. (I am doing v[0-2] - 1 to account for obj files being 1-based and my vectors being 0-based. So when I get to the render method, I am trying to loop through every object, which loops through every material attached to that object. I set the material information and try and use glDrawElements. However, the screen is black. I was able to draw the model just fine when I looped through each distinct material with all the indices associated with that material, and it drew the model fine. This time around, so I can use the stencil buffer for selecting GroupObjects, I changed up the loop, but the screen is black. Here is my render loop. The only thing I changed was the for loop(s) so they go through each object, and each material in the object in turn. void GLEngine::drawModel() { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Vertex arrays setup glEnableClientState( GL_VERTEX_ARRAY ); glVertexPointer(3, GL_FLOAT, model.getVertexSize(), model.getVertexBuffer()->position); glEnableClientState( GL_NORMAL_ARRAY ); glNormalPointer(GL_FLOAT, model.getVertexSize(), model.getVertexBuffer()->normal); glClientActiveTexture( GL_TEXTURE0 ); glEnableClientState( GL_TEXTURE_COORD_ARRAY ); glTexCoordPointer(2, GL_FLOAT, model.getVertexSize(), model.getVertexBuffer()->texCoord); glUseProgram(blinnPhongShader); objects = model.getObjects(); // Loop through objects... for( int i=0 ; i < objects.size(); i++ ) { ModelOBJ::GroupObject *object = objects[i]; // Loop through materials used by object... for( int j=0 ; j<object->materials.size() ; j++ ) { ModelOBJ::Material *pMaterial = object->materials[j]; glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, pMaterial->ambient); glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pMaterial->diffuse); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, pMaterial->specular); glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, pMaterial->shininess * 128.0f); // Draw faces, letting OpenGL loop through them glDrawElements( GL_TRIANGLES, pMaterial->indices.size(), GL_UNSIGNED_INT, &pMaterial->indices ); } } if (model.hasNormals()) glDisableClientState(GL_NORMAL_ARRAY); if (model.hasTextureCoords()) { glClientActiveTexture(GL_TEXTURE0); glDisableClientState(GL_TEXTURE_COORD_ARRAY); } if (model.hasPositions()) glDisableClientState(GL_VERTEX_ARRAY); glBindTexture(GL_TEXTURE_2D, 0); glUseProgram(0); glDisable(GL_BLEND); } I don't know what I am missing that's important. If it's also helpful, here is where I read a 'f' face line and store the info in the obj importer in the pMaterial-indices. else if (sscanf(buffer, "%d/%d/%d", &v[0], &vt[0], &vn[0]) == 3) // v/vt/vn { fscanf(pFile, "%d/%d/%d", &v[1], &vt[1], &vn[1]); fscanf(pFile, "%d/%d/%d", &v[2], &vt[2], &vn[2]); v[0] = (v[0] < 0) ? v[0] + numVertices - 1 : v[0] - 1; v[1] = (v[1] < 0) ? v[1] + numVertices - 1 : v[1] - 1; v[2] = (v[2] < 0) ? v[2] + numVertices - 1 : v[2] - 1; currentMaterial->indices.push_back(v[0]); currentMaterial->indices.push_back(v[1]); currentMaterial->indices.push_back(v[2]); Again, this worked drawing it all together only separated by materials, so I haven't changed code anywhere else except added the indices to the materials within objects, and the loop in the draw method. Before everything was showing up black, now with the setup as above, I am getting an unhandled exception write violation on the glDrawElements line. I did a breakpoint there, and there are over 600 elements in the pMaterial-indices array, so it's not empty, it has indices to use. When I set the glDrawElements like this, it gives me the black screen but no errors glDrawElements( GL_TRIANGLES, pMaterial->indices.size(), GL_UNSIGNED_INT, &pMaterial->indices[0] ); I have also tried adding this when I loop through the faces on import if ( currentMaterial->startIndex == -1 ) currentMaterial->startIndex = v[0]; currentMaterial->triangleCount++; And when drawing... //in draw method glDrawElements( GL_TRIANGLES, pMaterial->triangleCount * 3, GL_UNSIGNED_INT, model.getIndexBuffer() + pMaterial->startIndex );

    Read the article

  • Delphi: EInvalidOp in neural network class (TD-lambda)

    - by user89818
    I have the following draft for a neural network class. This neural network should learn with TD-lambda. It is started by calling the getRating() function. But unfortunately, there is an EInvalidOp (invalid floading point operation) error after about 1000 iterations in the following lines: neuronsHidden[j] := neuronsHidden[j]+neuronsInput[t][i]*weightsInput[i][j]; // input -> hidden weightsHidden[j][k] := weightsHidden[j][k]+LEARNING_RATE_HIDDEN*tdError[k]*eligibilityTraceOutput[j][k]; // adjust hidden->output weights according to TD-lambda Why is this error? I can't find the mistake in my code :( Can you help me? Thank you very much in advance! unit uNeuronalesNetz; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, Grids, Menus, Math; const NEURONS_INPUT = 43; // number of neurons in the input layer NEURONS_HIDDEN = 60; // number of neurons in the hidden layer NEURONS_OUTPUT = 1; // number of neurons in the output layer NEURONS_TOTAL = NEURONS_INPUT+NEURONS_HIDDEN+NEURONS_OUTPUT; // total number of neurons in the network MAX_TIMESTEPS = 42; // maximum number of timesteps possible (after 42 moves: board is full) LEARNING_RATE_INPUT = 0.25; // in ideal case: decrease gradually in course of training LEARNING_RATE_HIDDEN = 0.15; // in ideal case: decrease gradually in course of training GAMMA = 0.9; LAMBDA = 0.7; // decay parameter for eligibility traces type TFeatureVector = Array[1..43] of SmallInt; // definition of the array type TFeatureVector TArtificialNeuralNetwork = class // definition of the class TArtificialNeuralNetwork private // GENERAL SETTINGS START learningMode: Boolean; // does the network learn and change its weights? // GENERAL SETTINGS END // NETWORK CONFIGURATION START neuronsInput: Array[1..MAX_TIMESTEPS] of Array[1..NEURONS_INPUT] of Extended; // array of all input neurons (their values) for every timestep neuronsHidden: Array[1..NEURONS_HIDDEN] of Extended; // array of all hidden neurons (their values) neuronsOutput: Array[1..NEURONS_OUTPUT] of Extended; // array of output neurons (their values) weightsInput: Array[1..NEURONS_INPUT] of Array[1..NEURONS_HIDDEN] of Extended; // array of weights: input->hidden weightsHidden: Array[1..NEURONS_HIDDEN] of Array[1..NEURONS_OUTPUT] of Extended; // array of weights: hidden->output // NETWORK CONFIGURATION END // LEARNING SETTINGS START outputBefore: Array[1..NEURONS_OUTPUT] of Extended; // the network's output value in the last timestep (the one before) eligibilityTraceHidden: Array[1..NEURONS_INPUT] of Array[1..NEURONS_HIDDEN] of Array[1..NEURONS_OUTPUT] of Extended; // array of eligibility traces: hidden layer eligibilityTraceOutput: Array[1..NEURONS_TOTAL] of Array[1..NEURONS_TOTAL] of Extended; // array of eligibility traces: output layer reward: Array[1..MAX_TIMESTEPS] of Array[1..NEURONS_OUTPUT] of Extended; // the reward value for all output neurons in every timestep tdError: Array[1..NEURONS_OUTPUT] of Extended; // the network's error value for every single output neuron t: Byte; // current timestep cyclesTrained: Integer; // number of cycles trained so far (learning rates could be decreased accordingly) last50errors: Array[1..50] of Extended; // LEARNING SETTINGS END public constructor Create; // create the network object and do the initialization procedure UpdateEligibilityTraces; // update the eligibility traces for the hidden and output layer procedure tdLearning; // learning algorithm: adjust the network's weights procedure ForwardPropagation; // propagate the input values through the network to the output layer function getRating(state: TFeatureVector; explorative: Boolean): Extended; // get the rating for a given state (feature vector) function HyperbolicTangent(x: Extended): Extended; // calculate the hyperbolic tangent [-1;1] procedure StartNewCycle; // start a new cycle with everything set to default except for the weights procedure setLearningMode(activated: Boolean=TRUE); // switch the learning mode on/off procedure setInputs(state: TFeatureVector); // transfer the given feature vector to the input layer (set input neurons' values) procedure setReward(currentReward: SmallInt); // set the reward for the current timestep (with learning then or without) procedure nextTimeStep; // increase timestep t function getCyclesTrained(): Integer; // get the number of cycles trained so far procedure Visualize(imgHidden: Pointer); // visualize the neural network's hidden layer end; implementation procedure TArtificialNeuralNetwork.UpdateEligibilityTraces; var i, j, k: Integer; begin // how worthy is a weight to be adjusted? for j := 1 to NEURONS_HIDDEN do begin for k := 1 to NEURONS_OUTPUT do begin eligibilityTraceOutput[j][k] := LAMBDA*eligibilityTraceOutput[j][k]+(neuronsOutput[k]*(1-neuronsOutput[k]))*neuronsHidden[j]; for i := 1 to NEURONS_INPUT do begin eligibilityTraceHidden[i][j][k] := LAMBDA*eligibilityTraceHidden[i][j][k]+(neuronsOutput[k]*(1-neuronsOutput[k]))*weightsHidden[j][k]*neuronsHidden[j]*(1-neuronsHidden[j])*neuronsInput[t][i]; end; end; end; end; procedure TArtificialNeuralNetwork.setReward; VAR i: Integer; begin for i := 1 to NEURONS_OUTPUT do begin // +1 = player A wins // 0 = draw // -1 = player B wins reward[t][i] := currentReward; end; end; procedure TArtificialNeuralNetwork.tdLearning; var i, j, k: Integer; begin if learningMode then begin for k := 1 to NEURONS_OUTPUT do begin if reward[t][k] = 0 then begin tdError[k] := GAMMA*neuronsOutput[k]-outputBefore[k]; // network's error value when reward is 0 end else begin tdError[k] := reward[t][k]-outputBefore[k]; // network's error value in the final state (reward received) end; for j := 1 to NEURONS_HIDDEN do begin weightsHidden[j][k] := weightsHidden[j][k]+LEARNING_RATE_HIDDEN*tdError[k]*eligibilityTraceOutput[j][k]; // adjust hidden->output weights according to TD-lambda for i := 1 to NEURONS_INPUT do begin weightsInput[i][j] := weightsInput[i][j]+LEARNING_RATE_INPUT*tdError[k]*eligibilityTraceHidden[i][j][k]; // adjust input->hidden weights according to TD-lambda end; end; end; end; end; procedure TArtificialNeuralNetwork.ForwardPropagation; var i, j, k: Integer; begin for j := 1 to NEURONS_HIDDEN do begin neuronsHidden[j] := 0; for i := 1 to NEURONS_INPUT do begin neuronsHidden[j] := neuronsHidden[j]+neuronsInput[t][i]*weightsInput[i][j]; // input -> hidden end; neuronsHidden[j] := HyperbolicTangent(neuronsHidden[j]); // activation of hidden neuron j end; for k := 1 to NEURONS_OUTPUT do begin neuronsOutput[k] := 0; for j := 1 to NEURONS_HIDDEN do begin neuronsOutput[k] := neuronsOutput[k]+neuronsHidden[j]*weightsHidden[j][k]; // hidden -> output end; neuronsOutput[k] := HyperbolicTangent(neuronsOutput[k]); // activation of output neuron k end; end; procedure TArtificialNeuralNetwork.setLearningMode; begin learningMode := activated; end; constructor TArtificialNeuralNetwork.Create; var i, j, k: Integer; begin inherited Create; Randomize; // initialize random numbers generator learningMode := TRUE; cyclesTrained := -2; // only set to -2 because it will be increased twice in the beginning StartNewCycle; for j := 1 to NEURONS_HIDDEN do begin for k := 1 to NEURONS_OUTPUT do begin weightsHidden[j][k] := abs(Random-0.5); // initialize weights: 0 <= random < 0.5 end; for i := 1 to NEURONS_INPUT do begin weightsInput[i][j] := abs(Random-0.5); // initialize weights: 0 <= random < 0.5 end; end; for i := 1 to 50 do begin last50errors[i] := 0; end; end; procedure TArtificialNeuralNetwork.nextTimeStep; begin t := t+1; end; procedure TArtificialNeuralNetwork.StartNewCycle; var i, j, k, m: Integer; begin t := 1; // start in timestep 1 cyclesTrained := cyclesTrained+1; // increase the number of cycles trained so far for j := 1 to NEURONS_HIDDEN do begin neuronsHidden[j] := 0; for k := 1 to NEURONS_OUTPUT do begin eligibilityTraceOutput[j][k] := 0; outputBefore[k] := 0; neuronsOutput[k] := 0; for m := 1 to MAX_TIMESTEPS do begin reward[m][k] := 0; end; end; for i := 1 to NEURONS_INPUT do begin for k := 1 to NEURONS_OUTPUT do begin eligibilityTraceHidden[i][j][k] := 0; end; end; end; end; function TArtificialNeuralNetwork.getCyclesTrained; begin result := cyclesTrained; end; procedure TArtificialNeuralNetwork.setInputs; var k: Integer; begin for k := 1 to NEURONS_INPUT do begin neuronsInput[t][k] := state[k]; end; end; function TArtificialNeuralNetwork.getRating; begin setInputs(state); ForwardPropagation; result := neuronsOutput[1]; if not explorative then begin tdLearning; // adjust the weights according to TD-lambda ForwardPropagation; // calculate the network's output again outputBefore[1] := neuronsOutput[1]; // set outputBefore which will then be used in the next timestep UpdateEligibilityTraces; // update the eligibility traces for the next timestep nextTimeStep; // go to the next timestep end; end; function TArtificialNeuralNetwork.HyperbolicTangent; begin if x > 5500 then // prevent overflow result := 1 else result := (Exp(2*x)-1)/(Exp(2*x)+1); end; end.

    Read the article

  • How to reinstall OEM Windows 98 SE?

    - by Sammy
    I'm trying to install Windows 98 SE on an old PC and it's not going well. I run into this problem. Searching for Boot Record from Floppy..OK Starting Windows 98... TOSHIBA Enhanced-IDE CD/DVD-ROM Device Driver (ATAPI) Version 2.24 (C)Copyright Toshiba Corp. 1995-1999. All rights reserved. Device Name : TOSCD001 Number of units : 1 MSCDEX Version 2.25 Copyright (C) MIcrosoft Corp. 1986-1995. All rights reserved. Drive Z: = Driver TOSCD001 unit 0 TOSHIBA MACHINE Invalid drive specification Path not found - C:\TOOLS\CDROMDRV.SYS Invalid drive specification Invalid drive specification After that last line, it leaves me at a bitmap image displaying instructions to reboot with Ctrl+Alt+Del. It doesn't say why I have to reboot, and it doesn't state any error type, it just want's me to reboot for no apparent reason. After reboot, it just boots up from Floppy again and it cycles through the same thing all over again. The computer has been restored to original specification. Original system recovery "CD-ROM" discs are available and they are not scratched or anything, they are in very good condition. It's a set of 3 CDs, and the first disc labeled "1/3" should be the one holding the OEM version of Windows 98 SE. There is also a boot disk for Windows 98. I'm not sure what the other two discs are for. This computer came with three language support, so those could be holding different language versions or additional OEM discs. But I'm quite sure that the first disc holds the main operating system. BIOS has been set to optimized defaults. Boot priority is as follows; Floppy, IDE-0, CD-ROM. Under Standard CMOS settings, BIOS scans and autoconfigures both the hard drive and the CD/DVD drive. On POST it finds them both, and it finds the DOS bootdisk and starts preparing for installation, as you can see above. So what's this "invalid drive specification" about? Why isn't the installation starting? Updates Update 1 Booting from CD disc 2 In desperation I tried booting from the second CD. Boot order was; Floppy, CD-ROM, IDE-0. It boots normally from floppy disk, just like above, but then returns following. File not found - Z:\3LNGINST\TOOLS\PARTINFO.TXT I accidentally pressed some key on the keyboard, and before I knew it, the following screen showed up. Create Primary DOS Partition Current fixed disk drive: 1 Verifying drive integrity, 16% complete. After completion another screen showed up. Create Primary DOS Partition Current fixed disk drive: 1 Do you wish to use the maximum available size for a Primary DOS Partition and make the partition active (Y/N)?....................? [Y] Verifying drive integrity, 7% complete. I didn't choose Yes, it was set automatically. After completion the computer was automatically rebooted. Then I got a new screen. This is in Norwegian/Swedish/Finnish. Here's the message in Swedish. Hårddisken är inte klar för återställning av programvara. Installationsprogrammet måste skapa nya partitioner (C:, D:, ...). VARNING! ALLT INNEHÅLL PÅ HÅRDDISKEN KOMMER ATT RADERAS! Tryck på en tangent om du vill fortsätta (eller CTRL-C för att avbryta). Let me translate that. Hard drive is not ready for restoring the software. Setup program has to create new partitions (C:, D:, ...). WARNING! ALL CONTENTS ON THE HARD DRIVE WILL BE ERASED! Press any key to continue (or CTRL-C to cancel). I pressed Enter and it started formatting the hard drive. WARNING, ALL DATA ON NON-REMOVABLE DISK DRIVE c: WILL BE LOST! Proceed with Format (Y/N)?y Formatting 14,67.53M 1 percent completed. It automatically sets the "y" option and starts formatting. Rebooting with CD disc 1 After completing this operation it rebooted automatically. I inserted CD disc 1 and there was no issue with "invalid drive specification" anymore. Instead, a bitmap menu was displayed where it asked me to choose a language. And I thought I had it there for a while but it didn't work out. After choosing the language, another menu was displayed asking me to choose a type of recovery (restore pre-installed software OR restore hard drive partitions and pre-installed software). I opted for the second option. Then a data destruction warning showed up where I just pressed 1 to Continue. It did something and then just rebooted and the same formatting screen shows up as before. So something is not right. Am I doing it wrong? I seem to have come past the CD-ROM driver issue at least. But now I'm stuck with this problem... it seems to have something to do with the hard drive. Like... why is is it always trying to format it? Isn't it enough to format it once? By the way, it needs to be formatted as FAT32, right? Windows 98 doesn't support NTFS? I think FDISK should have taken care of this already. I know this is an old hard drive, but I connected to my main computer and it was able to read and write to it without a problem. It does have bad sectors though, but it's expected on an old hard drive like this. Any ideas?.. Update 2 I seem to be repeatedly getting stuck at the format screen where it asks to press any key to continue. So tried to cancel it this time with Ctrl+C. This leaves me at: A:\TOOLS> I can do DIR and CD and I tried to change to Z: drive. I tried running "setup" but there is no such thing. Z:\>setup Bad command or file name Update 3 Floppy structure Here's the file/folder structure of the floppy disk. A:\>dir /s Volume in drive A has no label. Volume Serial Number is 1700-1069 Directory of A:\ 1999-10-11 10:44 <DIR> BMP 1998-05-11 22:01 93 880 COMMAND.COM 1999-10-11 10:44 <DIR> factory 1999-10-11 10:44 <DIR> lang 1999-10-11 10:44 <DIR> TOOLS 2000-05-19 15:32 339 CONFIG.SYS 1999-10-26 13:38 0 BOOTLOG.TXT 2000-06-08 08:32 3 691 AUTOEXEC.BAT 4 File(s) 97 910 bytes Directory of A:\BMP 1999-10-11 10:44 <DIR> . 1999-10-11 10:44 <DIR> .. 0 File(s) 0 bytes Directory of A:\factory 1999-10-11 10:44 <DIR> . 1999-10-11 10:44 <DIR> .. 2000-06-08 13:09 2 662 3LNGINSF.BAT 1 File(s) 2 662 bytes Directory of A:\lang 1999-10-11 10:44 <DIR> . 1999-10-11 10:44 <DIR> .. 1998-11-24 08:02 49 575 FORMAT.COM 1998-11-24 08:02 63 900 FDISK.EXE 2 File(s) 113 475 bytes Directory of A:\TOOLS 1999-10-11 10:44 <DIR> . 1999-10-11 10:44 <DIR> .. 1998-05-06 22:01 49 575 FORMAT.COM 1995-10-27 20:29 28 164 BMPVIEW.EXE 1999-01-26 15:54 15 MAKEPA32.TXT 1998-05-06 22:01 3 878 XCOPY.EXE 1998-05-06 22:01 41 472 XCOPY32.MOD 1998-05-06 22:01 33 191 HIMEM.SYS 1998-05-06 22:01 125 495 EMM386.EXE 1998-05-06 22:01 18 967 SYS.COM 1996-01-31 21:55 18 CLK.COM 1994-04-02 08:20 22 HARDBOOT.COM 1999-02-03 15:46 15 MAKEPA16.TXT 1999-04-14 16:36 7 840 PARTFO32.EXE 2000-05-19 15:01 1 169 PARTFORM.BAT 1996-10-02 01:47 1 642 MBRCLR.COM 1999-07-01 11:58 8 175 BIOSCHKN.EXE 1998-06-23 08:55 5 904 PAR-TYPE.EXE 1998-11-24 08:02 29 271 MODE.COM 1998-11-24 08:02 15 252 ATTRIB.EXE 1998-11-24 08:02 19 083 DELTREE.EXE 1999-04-21 15:01 23 304 NTBB.EXE 1997-05-07 14:19 1 SYS.TXT 1999-07-01 12:23 61 566 F3DCHK.EXE 1998-05-11 20:01 34 566 KEYBOARD.SYS 1998-05-11 20:01 19 927 KEYB.COM 1999-10-26 14:31 910 partinfo.txt 1998-06-16 15:58 5 936 CHKDRVAC.EXE 1998-05-06 22:01 63 900 FDISK.EXE 1998-05-06 22:01 45 379 SMARTDRV.EXE 1992-12-03 19:48 10 695 SCISET.EXE 1997-06-25 15:49 6 YENT 1998-05-06 22:01 25 473 MSCDEX.EXE 1998-05-06 22:01 5 239 CHOICE.COM 1997-07-18 17:41 6 876 MBR.COM 1997-07-01 15:01 6 545 CHK2GB.COM 1998-06-10 20:04 8 128 PARTFORM.EXE 1990-01-04 02:09 19 MAKEPAR2.TXT 1990-01-04 01:00 27 MAKEPAR3.TXT 1990-01-04 01:00 27 MAKEPAR4.TXT 1998-02-13 13:47 15 MAKEPART.TXT 1999-04-14 13:47 5 200 DISKSIZE.EXE 1999-05-06 14:56 7 856 PARTFO16.EXE 1999-01-13 11:13 13 720 CDROMDRV.SYS 42 File(s) 734 463 bytes Total Files Listed: 49 File(s) 948 510 bytes 12 Dir(s) 268 800 bytes free A:\> CONFIG.SYS contents Here's the content of CONFIG.SYS. DEVICE=A:\TOOLS\HIMEM.SYS /TESTMEM:OFF REM I=B000-B7ff for Desktop BIOSes rem DEVICE=A:\TOOLS\EMM386.EXE NOEMS I=B000-B7ff x=C000-D000 DEVICE=A:\TOOLS\EMM386.EXE NOEMS x=C000-D000 DEVICE=A:\TOOLS\CDROMDRV.SYS /D:TOSCD001 BUFFERS=10 FILES=69 DOS=HIGH,UMB STACKS=9,256 LASTDRIVE=Z SWITCHES=/F SHELL=A:\COMMAND.COM /P /E:2048 AUTOEXEC.BAT contents :BEGIN @ECHO OFF PATH=A:\;A:\TOOLS; MSCDEX /D:TOSCD001 /L:Z /M:10 smartdrv 1024 128 SET TOOLS=A:\TOOLS SET COMSPEC=A:\COMMAND.COM SET EXITDRIVE=C: SET EXITPATH=\ CALL Z:\SETENV.BAT > NUL :TOSHCHK BIOSChkN IF NOT ERRORLEVEL 1 goto C_ACCESS BMPVIEW Z:\3LNGINST\BMP\NO_TOSP3.bmp /X=120 /Y=80 PAUSE > NUL SET EXITDRIVE=A: GOTO END :C_ACCESS CALL PARTFORM.BAT :C_EMPTY IF EXIST C:\*.* GOTO C_NOTEMPTY call z:\setenv.bat>nul goto PREPDU :C_NOTEMPTY REM ------------------MENU------------------------ :STARTMENU CLS BMPVIEW Z:\3LNGINST\BMP\LANGSELC.BMP /X=120 /Y=120 CLK CHOICE /C:123 /N >NUL REM L is the language that is selected IF ERRORLEVEL 1 SET L=%LNG1% IF ERRORLEVEL 2 SET L=%LNG2% IF ERRORLEVEL 3 SET L=%LNG3% SET BMP=BMP%L% BMPVIEW Z:\3LNGINST\%bmp%\HDDMENU.BMP /X=72 /Y=82 CLK CHOICE /C:129F /N > NUL IF ERRORLEVEL 4 GOTO FACTORY_MENU IF ERRORLEVEL 3 GOTO EXIT_MENU IF ERRORLEVEL 2 GOTO PARTFORM_MENU IF ERRORLEVEL 1 GOTO FORMAT_MENU GOTO END :FACTORY_MENU BMPVIEW Z:\3LNGINST\%bmp%\qformat.bmp /X=120 /Y=140 CLK choice /c:12 /N >nul IF ERRORLEVEL 2 GOTO STARTMENU IF ERRORLEVEL 1 GOTO FORMATF GOTO END :EXIT_MENU BMPVIEW Z:\3LNGINST\%bmp%\9.bmp /XC /X=96 /Y=267 choice /C:1pause /T:1,01 >nul SET EXITDRIVE=A: SET EXITPATH=\lang cls mode mono rem keyb xx>nul cls GOTO END :PARTFORM_MENU BMPVIEW Z:\3LNGINST\%bmp%\2.bmp /XC /X=96 /Y=216 choice /C:1pause /T:1,01 >nul BMPVIEW Z:\3LNGINST\%bmp%\partform.bmp /X=120 /Y=140 CLK choice /c:12 /N >nul IF ERRORLEVEL 2 GOTO STARTMENU IF ERRORLEVEL 1 GOTO PART_FORM SET EXITDRIVE=A: GOTO END :FORMAT_MENU BMPVIEW Z:\3LNGINST\%bmp%\1.bmp /XC /X=96 /Y=165 choice /C:1pause /T:1,01 >nul BMPVIEW Z:\3LNGINST\%bmp%\qformat.bmp /X=120 /Y=140 CLK choice /c:12 /N >nul IF ERRORLEVEL 2 GOTO STARTMENU IF ERRORLEVEL 1 GOTO FORMAT SET EXITDRIVE=A: GOTO END REM ------------------ MENU END ------------------------ :FORMAT bmpview Z:\3LNGINST\%bmp%\1.bmp /XC /X=145 /Y=235 choice /C:1pause /T:1,01 >nul CLS IF (%QFORMAT%)==(NO) GOTO FULLFO FORMAT C: /Q /V:"" <A:\TOOLS\YENT >NUL call z:\setenv.bat>nul goto PREPDU :FULLFO FORMAT C: /V:"" <A:\TOOLS\YENT call z:\setenv.bat>nul goto PREPDU :FORMATF CLS IF (%QFORMAT%)==(NO) GOTO FULLFO_F FORMAT C: /Q /V:"" <A:\TOOLS\YENT >NUL call z:\setenv.bat>nul goto PREPDU_F :FULLFO_F FORMAT C: /V:"" <A:\TOOLS\YENT call z:\setenv.bat>nul goto PREPDU_F :PART_FORM bmpview Z:\3LNGINST\bmp\1.bmp /XC /X=145 /Y=235 choice /C:1pause /T:1,01 >nul MBR /! HARDBOOT REM ====================== Triple Select ====================== :PREPDU XCOPY z:\3LNGINST\*.* C:\*.* /E /S /V >NUL ATTRIB -H -R -S C:\TOOLS\CDROMDRV.SYS COPY A:\TOOLS\CDROMDRV.SYS C:\TOOLS /Y SYS C: >NUL goto REBOOT :PREPDU_F copy A:\TOOLS\SMARTDRV.EXE C:\ /Y ATTRIB -H -R -S C:\SMARTDRV.EXE copy A:\FACTORY\3LNGINSF.bat c:\ c:\3LNGINSF.bat cls REM ====================== Dual Select END ====================== REM --------------- END ------------------ :REBOOT SMARTDRV.EXE /C bmpview Z:\3LNGINST\BMP\reboot3.bmp /X=120 /Y=140 :FOREVER pause >nul goto FOREVER :END SMARTDRV.EXE /C %EXITDRIVE% cd %EXITPATH% echo on CD structure S:\>dir /s Volume in drive S is T3ELK4SC Volume Serial Number is 2042-5BC9 Directory of S:\ 2000-08-22 14:14 <DIR> 3LNGINSF 2000-08-22 14:14 <DIR> 3LNGINST 2000-06-15 15:57 <DIR> CRC 2000-06-15 12:04 387 667 767 T310C1NO.W98 2000-09-07 15:36 273 setenv.BAT 2 File(s) 387 668 040 bytes Directory of S:\3LNGINSF 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1999-10-27 10:51 1 806 AUTOEXEC.BAT 2000-08-22 14:14 <DIR> BMP 2000-05-19 15:29 265 CONFIG.SYS 2000-08-22 14:14 <DIR> POSTINST 2000-08-22 14:14 <DIR> TOOLS 2000-08-22 14:14 <DIR> WIN98SYS 2 File(s) 2 071 bytes Directory of S:\3LNGINSF\BMP 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1997-04-22 09:43 718 1.BMP 1997-04-22 09:44 718 2.BMP 1999-01-04 02:38 718 3.BMP 2000-07-05 11:22 60 118 Cdchg2.bmp 2000-07-05 11:22 60 118 Cdchg3.bmp 2000-07-05 13:37 60 118 Fin.bmp 2000-07-06 14:18 120 118 Menu.bmp 2000-07-05 13:34 60 118 Nor.bmp 2000-07-05 11:53 35 318 Progress.bmp 2000-07-05 13:40 60 118 Swe.bmp 2000-07-05 12:09 84 118 Wrongcd2.bmp 2000-07-05 12:09 84 118 Wrongcd3.bmp 12 File(s) 626 416 bytes Directory of S:\3LNGINSF\POSTINST 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 2000-05-19 09:15 33 POSTINST.BAT 1 File(s) 33 bytes Directory of S:\3LNGINSF\TOOLS 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 2000-07-06 14:49 3 593 3LNGINST.BAT 1998-11-24 08:02 15 252 ATTRIB.EXE 1995-10-27 18:29 28 164 BMPVIEW.EXE 1999-01-13 11:13 13 720 CDROMDRV.SYS 1998-05-06 20:01 5 239 CHOICE.COM 1996-01-31 19:55 18 CLK.COM 1998-11-24 08:02 19 083 DELTREE.EXE 1998-05-06 20:01 125 495 EMM386.EXE 1999-07-01 12:23 61 566 F3DCHK.EXE 1998-05-06 20:01 49 575 FORMAT.COM 1994-04-02 06:20 22 HARDBOOT.COM 1998-05-06 20:01 33 191 HIMEM.SYS 1998-05-06 20:01 25 473 MSCDEX.EXE 1998-05-06 20:01 12 663 RAMDRIVE.SYS 1998-05-06 20:01 45 379 SMARTDRV.EXE 1997-05-07 14:19 1 SYS.TXT 1995-09-27 14:25 6 813 VOLCHECK.EXE 1998-05-06 20:01 3 878 XCOPY.EXE 1998-05-06 20:01 41 472 XCOPY32.MOD 1997-06-25 13:49 6 YENT 20 File(s) 490 603 bytes Directory of S:\3LNGINSF\WIN98SYS 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1998-12-04 20:00 222 390 IO.SYS 1998-05-06 20:01 18 967 SYS.COM 1998-05-06 20:01 93 880 command.com 3 File(s) 335 237 bytes Directory of S:\3LNGINST 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1999-05-31 09:51 1 576 AUTOEXEC.BAT 2000-08-22 14:14 <DIR> BMP 2000-08-22 14:14 <DIR> Bmpfin 2000-08-22 14:14 <DIR> Bmpnor 2000-08-22 14:14 <DIR> Bmpswe 2000-05-19 15:30 265 CONFIG.SYS 2000-08-22 14:14 <DIR> POSTINST 2000-08-22 14:14 <DIR> TOOLS 2000-08-22 14:14 <DIR> WIN98SYS 2 File(s) 1 841 bytes Directory of S:\3LNGINST\BMP 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1997-04-22 09:43 718 1.BMP 1997-04-22 09:44 718 2.BMP 1999-01-04 02:38 718 3.BMP 2000-07-05 11:22 60 118 Cdchg2.bmp 2000-07-05 11:22 60 118 Cdchg3.bmp 2000-07-05 13:37 60 118 Fin.bmp 2000-07-06 14:18 120 118 Menu.bmp 2000-07-05 13:34 60 118 Nor.bmp 2000-07-05 11:53 35 318 Progress.bmp 2000-07-06 14:08 40 518 Reboot3.bmp 2000-07-05 13:40 60 118 Swe.bmp 2000-07-05 12:09 84 118 Wrongcd2.bmp 2000-07-05 12:09 84 118 Wrongcd3.bmp 2000-07-05 13:52 48 118 langselc.bmp 2000-07-05 11:47 57 318 no_tosp3.bmp 15 File(s) 772 370 bytes Directory of S:\3LNGINST\Bmpfin 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1997-04-22 09:43 718 1.BMP 1997-04-22 09:44 718 2.BMP 1998-06-13 00:07 718 9.bmp 2000-03-08 15:02 78 486 Hddmenu.bmp 2000-03-08 15:31 25 318 No_tospc.bmp 2000-03-08 15:37 36 518 PARTFORM.BMP 2000-03-08 15:42 36 518 Qformat.bmp 7 File(s) 178 994 bytes Directory of S:\3LNGINST\Bmpnor 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1997-04-22 09:43 718 1.BMP 1997-04-22 09:44 718 2.BMP 1998-06-13 00:07 718 9.bmp 1999-05-05 13:26 78 486 Hddmenu.bmp 1998-07-13 11:36 25 318 No_tospc.bmp 1998-07-13 11:41 36 518 PARTFORM.BMP 1998-07-13 11:45 36 518 Qformat.bmp 7 File(s) 178 994 bytes Directory of S:\3LNGINST\Bmpswe 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1997-04-22 09:43 718 1.BMP 1997-04-22 09:44 718 2.BMP 1998-06-13 00:07 718 9.bmp 1999-05-06 08:14 78 486 Hddmenu.bmp 1998-07-10 16:25 25 318 No_tospc.bmp 1998-07-10 16:29 36 518 PARTFORM.BMP 1998-07-10 17:08 36 518 Qformat.bmp 7 File(s) 178 994 bytes Directory of S:\3LNGINST\POSTINST 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 2000-05-19 09:15 33 POSTINST.BAT 1 File(s) 33 bytes Directory of S:\3LNGINST\TOOLS 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 2000-05-19 14:52 3 898 3LNGINST.BAT 1995-10-27 18:29 28 164 BMPVIEW.EXE 1999-01-13 11:13 13 720 CDROMDRV.SYS 1998-05-06 20:01 5 239 CHOICE.COM 1996-01-31 19:55 18 CLK.COM 1998-05-06 20:01 125 495 EMM386.EXE 1999-07-01 12:23 61 566 F3DCHK.EXE 1998-05-06 20:01 49 575 FORMAT.COM 1994-04-02 06:20 22 HARDBOOT.COM 1998-05-06 20:01 33 191 HIMEM.SYS 1998-05-06 20:01 25 473 MSCDEX.EXE 2000-07-06 14:41 910 PARTINFO.TXT 1998-05-06 20:01 12 663 RAMDRIVE.SYS 1998-05-06 20:01 45 379 SMARTDRV.EXE 1997-05-07 14:19 1 SYS.TXT 1995-09-27 14:25 6 813 VOLCHECK.EXE 1998-05-06 20:01 3 878 XCOPY.EXE 1998-05-06 20:01 41 472 XCOPY32.MOD 1997-06-25 13:49 6 YENT 19 File(s) 457 483 bytes Directory of S:\3LNGINST\WIN98SYS 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1998-12-04 20:00 222 390 IO.SYS 1998-05-06 20:01 18 967 SYS.COM 1998-05-06 20:01 93 880 command.com 3 File(s) 335 237 bytes Directory of S:\CRC 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 2000-06-15 12:07 181 422 T310C1NO.ALL 2000-06-15 12:09 215 427 T310C1NO.CRC 2000-06-15 12:07 2 157 T310C1NO.HID 3 File(s) 399 006 bytes Total Files Listed: 104 File(s) 391 625 352 bytes 42 Dir(s) 0 bytes free S:\> Now which line or lines need to be changed? Do I really have to change drive letter Z: to C:? Proposed solutions Solution #1 Ramhound proposed to change the boot order to following; CD-ROM, IDE-0, Floppy This didn't help. In fact, here is the result of it. Searching for Boot Record from CDROM..Not Found Searching for Boot Record from IDE-0.. OK Missing operating system Any other ideas?... Solution #2 Rik proposed to run Z:\setup. Now that I have found a way to drop to DOS prompt with Ctrl+C as described above (Update 2), I did try running setup but there is no such command or file in there. So that didn't work.

    Read the article

< Previous Page | 1 2 3