Search Results

Search found 10324 results on 413 pages for 'move'.

Page 3/413 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • I need to move an entity to the mouse location after i rightclick

    - by I.Hristov
    Well I've read the related questions-answers but still cant find a way to move my champion to the mouse position after a right-button mouse-click. I use this code at the top: float speed = (float)1/3; And this is in my void Update: //check if right mouse button is clicked if (mouse.RightButton == ButtonState.Released && previousButtonState == ButtonState.Pressed) { // gets the position of the mouse in mousePosition mousePosition = new Vector2(mouse.X, mouse.Y); //gets the current position of champion (the drawRectangle) currentChampionPosition = new Vector2(drawRectangle.X, drawRectangle.Y); // move champion to mouse position: //handles the case when the mouse position is really close to current position if (Math.Abs(currentChampionPosition.X - mousePosition.X) <= speed && Math.Abs(currentChampionPosition.Y - mousePosition.Y) <= speed) { drawRectangle.X = (int)mousePosition.X; drawRectangle.Y = (int)mousePosition.Y; } else if (currentChampionPosition != mousePosition) { drawRectangle.X += (int)((mousePosition.X - currentChampionPosition.X) * speed); drawRectangle.Y += (int)((mousePosition.Y - currentChampionPosition.Y) * speed); } } previousButtonState = mouse.RightButton; What that code does at the moment is on a click it brings the sprite 1/3 of the distance to the mouse but only once. How do I make it move consistently all the time? It seems I am not updating the sprite at all. EDIT I added the Vector2 as Nick said and with speed changed to 50 it should be OK. I tried it with if ButtonState.Pressed and it works while pressing the button. Thanks. However I wanted it to start moving when single mouse clicked. It should be moving until reaches the mousePosition. The Edit of Nick's post says to create another Vector2, But I already have the one called mousePosition. Not sure how to use another one. //gets a Vector2 direction to move *by Nick Wilson Vector2 direction = mousePosition - currentChampionPosition; //make the direction vector a unit vector direction.Normalize(); //multiply with speed (number of pixels) direction *= speed; // move champion to mouse position if (currentChampionPosition != mousePosition) { drawRectangle.X += (int)(direction.X); drawRectangle.Y += (int)(direction.Y); } } previousButtonState = mouse.RightButton;

    Read the article

  • Can a stack have an exception safe method for returning and removing the top element with move seman

    - by Motti
    In an answer to a question about std::stack::pop() I claimed that the reason pop does not return the value is for exception safety reason (what happens if the copy constructor throws). @Konrad commented that now with move semantics this is no longer relevant. Is this true? AFAIK, move constructors can throw, but perhaps with noexcept it can still be achieved. For bonus points what thread safety guarantees can this operation supply?

    Read the article

  • How to move the object around the screen

    - by Abhishek
    I am trying to move the object around the screen I try this code -(void) move { CGFloat upperLimit = mWinSize.height - (mGunda.contentSize.height / 2.0); CGFloat upperLimit1 = mWinSize.height; CGFloat lowerLimit = (mGunda.contentSize.height / 2.0); CGFloat RightLimit = mWinSize.width - (mGunda.contentSize.width/2.0); CGFloat Right = (mGunda.contentSize.width/2.0); if ( mImageGoingUpward ) { mGunda.position = ccp( mGunda.position.x, mGunda.position.y + 5); if ( mGunda.position.y >= upperLimit ) { mImageGoingUpward = NO; mHori = NO; } } else { mGunda.position = ccp( mGunda.position.x, mGunda.position.y - 5); if ( mGunda.position.y <= lowerLimit ) { mGunda.position = ccp(mGunda.position.x +5, lowerLimit); } if(mGunda.position.x >= RightLimit) { mGunda.position = ccp(mGunda.position.x, mGunda.position.y+10); mHori = YES; } if(mHori) { if(mGunda.position.y >= upperLimit) { mGunda.position = ccp(mGunda.position.x - 5,mGunda.position.y); } } } } } It move the object from bottom to top & top to bottom & bottom to right & right to right top of the screen here is problem I have got It not move to the right top to left side of screen this rotationis not happen. How can I do this

    Read the article

  • How to move an UIView along a curved CGPath according to user dragging the view

    - by Felipe Cypriano
    I'm trying to build a interface that the user can move his finger around the screen an a list of images moves along a path. The idea is that the images center nevers leaves de path. Most of the things I found was about how to animate using CGPath and not about actually using the path as the track to a user movement. I need to objects to be tracked on the path even if the user isn't moving his fingers over the path. For example (image bellow), if the object is at the beginning of the path and the user touches anywhere on the screen and moves his fingers from left to right I need that the object moves from left to right but following the path, that is, going up as it goes to the right towards the path's end. This is the path I've draw, imagine that I'll have a view (any image) that the user can touch and drag it along the path, there's no need to move the finger exactly over the path. If the user move from left to right the image should move from left to right but going up if need following the path. This is how I'm creating the path: CGPoint endPointUp = CGPointMake(315, 124); CGPoint endPointDown = CGPointMake(0, 403); CGPoint controlPoint1 = CGPointMake(133, 187); CGPoint controlPoint2 = CGPointMake(174, 318); CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path, NULL, endPointUp.x, endPointUp.y); CGPathAddCurveToPoint(path, NULL, controlPoint1.x, controlPoint1.y, controlPoint2.x, controlPoint2.y, endPointDown.x, endPointDown.y); Any idead how can I achieve this?

    Read the article

  • Move model forward base on model orientation

    - by ChocoMan
    My model rotates on it's own Y-axis regardless of where it is in the world. Here are the controls for the left ThumbStick: UP (move model forward on Z-Axis) DOWN (move model backward on Z-Axis) LEFT & RIGHT (strafe to either side) The problem is adjusting the direction the model's orientation UP and DOWN if the player should also rotate the player while moving forward or backwards. An example what Im trying to achieve would be a car doing donuts. The car is always facing the current direction that it interprets as forward (or rear as backwards) in relation to it's local rotation. Here is how Im calling the movement: // Rotate model with Right Thumbstick along X-Axis modelRotation -= pController.ThumbSticks.Right.X * mRotSpeed; // Move Forward if (pController.IsButtonDown(Buttons.LeftThumbstickUp)) { modelPosition.Z -= -pController.ThumbSticks.Left.Y * speed; } // Move Backward if (pController.IsButtonDown(Buttons.LeftThumbstickDown)) { modelPosition.Z += pController.ThumbSticks.Left.Y * speed; } // Strafe Left if (pController.IsButtonDown(Buttons.LeftThumbstickLeft)) { modelPosition.X += -pController.ThumbSticks.Left.X * speed; } // Strafe Right if (pController.IsButtonDown(Buttons.LeftThumbstickRight)) { modelPosition.X -= pController.ThumbSticks.Left.X * speed; } // DeadZone if (!pController.IsButtonDown(Buttons.LeftThumbstickUp) && !pController.IsButtonDown(Buttons.LeftThumbstickDown) && !pController.IsButtonDown(Buttons.LeftThumbstickLeft) && !pController.IsButtonDown(Buttons.LeftThumbstickRight)) { }

    Read the article

  • [Silverlight] Suggestion – Move INotifyCollectionChanged from System.Windows.dll to System.dll

    - by Benjamin Roux
    I just submitted a suggestion on Microsoft Connect to move the INotifyCollectionChanged from System.Windows.dll to System.dll. You can review it here: https://connect.microsoft.com/VisualStudio/feedback/details/560184/move-inotifycollectionchanged-from-system-windows-dll-to-system-dll Here’s the reason why I suggest that. Actually I wanted to take advantages of the new feature of Silverlight/Visual Studio 2010 for sharing assemblies (see http://blogs.msdn.com/clrteam/archive/2009/12/01/sharing-silverlight-assemblies-with-net-apps.aspx). Everything went fine until I try to share a custom collection (with custom business logic) implementing INotifyCollectionChanged. This modification has been made in the .NET Framework 4 (see https://connect.microsoft.com/VisualStudio/feedback/details/488607/move-inotifycollectionchanged-to-system-dll) so maybe it could be done in Silverlight too. If you think this is justifiable you can vote for it.

    Read the article

  • Sony officialise son contrôleur à détection de mouvements, le PlayStation Move, lors de la Game Deve

    Sony officialise son contrôleur à détection de mouvements, le PlayStation Move, lors de la GDC 2010 C'est au cours de la Game Developers Conference 2010 (GDC 2010) que Sony a révélé et officialisé son nouveau contrôleur à détection de mouvements pour sa console de jeux PlayStation3. Les rumeurs le nommaient Gem ou Arc mais ce nouveau produit portera la dénomination de PlayStation Move. Sony a également dévoilé que le PlayStation Move serait accompagné d'un périphérique sans fils annexe nommé simplement Sub Controller qui n'est pas sans rappeler le Nunchuk de la console Nintendo Wii. Accompagné du PlayStation Eye (la webcam de la PlayStation 3), ce nouveau contrôleur sera vendu en pack avec un je...

    Read the article

  • Motivation and use of move constructors in C++

    - by Giorgio
    I recently have been reading about move constructors in C++ (see e.g. here) and I am trying to understand how they work and when I should use them. As far as I understand, a move constructor is used to alleviate the performance problems caused by copying large objects. The wikipedia page says: "A chronic performance problem with C++03 is the costly and unnecessary deep copies that can happen implicitly when objects are passed by value." I normally address such situations by passing the objects by reference, or by using smart pointers (e.g. boost::shared_ptr) to pass around the object (the smart pointers get copied instead of the object). What are the situations in which the above two techniques are not sufficient and using a move constructor is more convenient?

    Read the article

  • Automatically move Xubuntu panel to external monitor

    - by user1291235
    I am using xubuntu 13.04 with a dualmonitor setup. (external monitor as primary, laptop als secondary) I am using xandr to makeup my monitorsetup. However I recognized that the xubuntu panel on the top by default will always be placed on the laptop monitor. I know that i can move the panel via the panel preferences. This works. But i want to somehow either let it move automatically to the right monitor (the primary one) or to move it with a terminal command (so i can create a script which takes care of moving the panel to the primary monitor)... any ideas?

    Read the article

  • Move sprite in the direction it is facing?

    - by rphello101
    I'm using Java/Slick 2D. I'm trying to use the mouse to rotate the sprite and the arrow keys to move the sprite. I can get the sprite to rotate no problem, but I cannot get it to move in the direction it is supposed to. When I hit "forwards", the sprite doesn't necessarily move towards the mouse. I'm sure there has to be some standard code for this since many games use this style of motion. Can anyone help me out with what the trig is supposed to be? Thanks

    Read the article

  • Shell script to decrypt and move files from one directory to another?

    - by KittyYoung
    So, I have a directory, and in it are several files. I'm trying to decrypt those files and then move them to another directory. I can't seem to figure out how to set the output filename and move it. So, the directory structure looks like this: /Applications/MAMP/bin/decryptandmove.sh /Applications/MAMP/bin/passtext.txt /Applications/MAMP/bin/encrypted/test1.txt.pgp /Applications/MAMP/bin/encrypted/test2.txt.pgp /Applications/MAMP/htdocs/www/decrypted/ For all of the files found in the encrypted directory, I'm trying to decrypt it and then move them into www/decrypted/. I don't know what the filenames in the encrypted directory will be ahead of time (this script will eventually run via cron), so I wanted to just output the decrypted file with the same filename, but without the pgp. So, the result would be: /Applications/MAMP/bin/decryptandmove.sh /Applications/MAMP/bin/passtext.txt /Applications/MAMP/bin/encrypted/ /Applications/MAMP/htdocs/decrypted/test1.txt.pgp /Applications/MAMP/htdocs/decrypted/test2.txt.pgp So, this is all I have so far, and it doesn't work... FILE and FILENAME are both wrong... I haven't even gotten to the moving part of it yet.... Help? I've written exactly one shell script ever, and it was so simple, a monkey could have done it... Feeling out of depth here... pass_phrase=`cat passtext.txt|awk '{print $1}'` for FILE in '/Applications/MAMP/bin/encrypted/'; do FILENAME=$(basename $FILE .pgp) gpg --passphrase $pass_phrase --output $FILENAME --decrypt $FILE done

    Read the article

  • How is the C++ synthesized move constructor affected by volatile and virtual members?

    - by user1827766
    Look at the following code: struct node { node(); //node(const node&); //#1 //node(node&&); //#2 virtual //#3 ~node (); node* volatile //#4 next; }; main() { node m(node()); //#5 node n=node(); //#6 } When compiled with gcc-4.6.1 it produces the following error: g++ -g --std=c++0x -c -o node.o node.cc node.cc: In constructor node::node(node&&): node.cc:3:8: error: expression node::next has side-effects node.cc: In function int main(): node.cc:18:14: note: synthesized method node::node(node&&) first required here As I understand the compiler fails to create default move or copy constructor on line #6, if I uncomment either line #1 or #2 it compiles fine, that is clear. The code compiles fine without c++0x option, so the error is related to default move constructor. However, what in the node class prevents default move constructor to be created? If I comment any of the lines #3 or #4 (i.e. make the destructor non-virtual or make data member non-volatile) it compiles again, so is it the combination of these two makes it not to compile? Another puzzle, line #5 does not cause an compilation error, what is different from line #6? Is it all specific for gcc? or gcc-4.6.1?

    Read the article

  • AI to move custom-shaped spaceships (shape affecting movement behaviour)

    - by kaoD
    I'm designing a networked turn based 3D-6DOF space fleet combat strategy game which relies heavily on ship customization. Let me explain the game a bit, since you need to know a bit about it to set the question. What I aim for is the ability to create your own fleet of ships with custom shapes and attached modules (propellers, tractor beams...) which would give advantages and disadvantages to each ship, so you have lots of different fleet distributions. E.g., long ship with two propellers at the side would let the ship spin around that plane easily, bigger ships would move slowly unless you place lots of propellers at the back (therefore spending more "construction" points and energy when moving, and it will only move fast towards that direction.) I plan to balance all the game around this feature. The game would revolve around two phases: orders and combat phase. During the orders phase, you command the different ships. When all players finish the order phase, the combat phase begins and the ship orders get resolved in real-time for some time, then the action pauses and there's a new orders phase. The problem comes when I think about player input. To move a ship, you need to turn on or off different propellers if you want to steer, travel forward, brake, rotate in place... These propellers don't have to work at their whole power, so you can achieve more movement combinations with less propellers. I think this approach is a bit boring. The player doesn't want to fiddle with motors or anything, you just want to MOVE and KILL. The way I intend the player to give orders to these ships is by a destination and a rotation, and then the AI would calculate the correct propeller power to achive that movement and rotation. Propulsion doesn't have to be the same throught the entire turn calculation (after the orders have been given) so it would be cool if the ships reacted as they move, adjusting the power of the propellers for their needs dynamically, but it may be too hard to implement and it's not really needed for the game to work. In both cases, how would that AI decide which propellers to activate for the best (or at least not worst) trajectory to be achieved? I though about some approaches: Learning AI: The ship types would learn about their movement by trial and error, adjusting their behaviour with more uses, and finally becoming "smart". I don't want to get involved THAT far in AI coding, and I think it can be frustrating for the player (even if you can let it learn without playing.) Pre-calculated timestep movement: Upon ship creation, ALL possible movements are calculated for each propeller configuration and power for a given delta-time. Memory intensive, ugly, bad. Pre-calculated trajectories: The same as above but not for each delta-time but the whole trajectory, which would then be fitted as much as possible. Requires a fixed propeller configuration for the whole combat phase and is still memory intensive, ugly and bad. Continuous brute forcing: The AI continously checks ALL possible propeller configurations throughout the entire combat phase, precalculates a few time steps and decides which is the best one based on that. Con: what's good now might not be that good later, and it's too CPU intensive, ugly, and bad too. Single brute forcing: Same as above, but only brute forcing at the beginning of the simulation, so it needs constant propeller configuration throughout the entire combat phase. Coninuous angle check: This is not a full movement method, but maybe a way to discard "stupid" propeller configurations. Given the current propeller's normal vector and the final one, you can approximate the power needed for the propeller based on the angle. You must do this continuously throughout the whole combat phase. I figured this one out recently so I didn't put in too much thought. A priori, it has the "what's good now might not be that good later" drawback too, and it doesn't care about the other propellers which may act together to make a better propelling configuration. I'm really stuck here. Any ideas?

    Read the article

  • SQL SERVER – Move Database Files MDF and LDF to Another Location

    - by pinaldave
    When a novice DBA or Developer create a database they use SQL Server Management Studio to create new database. Additionally, the T-SQL script to create a database is very easy as well. You can just write CREATE DATABASE DatabaseName and it will create new database for you. The point to remember here is that it will create the database at the default location specified for SQL Server Instance (this default instance can be changed and we will see that in future blog posts). Now, once the database goes in production it will start to grow. It is not common to keep the Database on the same location where OS is installed. Usually Database files are on SAN, Separate Disk Array or on SSDs. This is done usually for performance reason and manageability perspective. Now the challenges comes up when database which was installed at not preferred default location and needs to move to a different location. Here is the quick tutorial how you can do it. Let us assume we have two folders loc1 and loc2. We want to move database files from loc1 to loc2. USE MASTER; GO -- Take database in single user mode -- if you are facing errors -- This may terminate your active transactions for database ALTER DATABASE TestDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE; GO -- Detach DB EXEC MASTER.dbo.sp_detach_db @dbname = N'TestDB' GO Now move the files from loc1 to loc2. You can now reattach the files with new locations. -- Move MDF File from Loc1 to Loc 2 -- Re-Attached DB CREATE DATABASE [TestDB] ON ( FILENAME = N'F:\loc2\TestDB.mdf' ), ( FILENAME = N'F:\loc2\TestDB_log.ldf' ) FOR ATTACH GO Well, we are done. There is little warning here for you: If you do ROLLBACK IMMEDIATE you may terminate your active transactions so do not use it randomly. Do it if you are confident that they are not needed or due to any reason there is a connection to the database which you are not able to kill manually after review. Reference : Pinal Dave (http://blog.SQLAuthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Backup and Restore, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • Unity: Spin wheels to move vehicle

    - by Paul Manta
    I am just getting started with Unity and I'd like to ask a question. If I have a "Vehicle" object that has two children: "FrontWheel" and "BackWheel" (both 'wheels' are cylinders), how should I set everything up such that I can move the entire vehicle by turning its wheels? When I apply a torque to "FrontWheel", the vehicle starts to move, but instead of the whole thing the moving together, the chassis is rolling on the cylinders and eventually falls off. How can I prevent it from doing that?

    Read the article

  • (Libgdx) Move Vector2 along angle?

    - by gemurdock
    I have seen several answers on here about moving along angle, but I can't seem to get this to work properly for me and I am new to LibGDX... just trying to learn. These are my Vector2's that I am using for this function. public Vector2 position = new Vector2(); public Vector2 velocity = new Vector2(); public Vector2 movement = new Vector2(); public Vector2 direction = new Vector2(); Here is the function that I use to move the position vector along an angle. setLocation() just sets the new location of the image. public void move(float delta, float degrees) { position.set(image.getX() + image.getWidth() / 2, image.getY() + image.getHeight() / 2); direction.set((float) Math.cos(degrees), (float) Math.sin(degrees)).nor(); velocity.set(direction).scl(speed); movement.set(velocity).scl(delta); position.add(movement); setLocation(position.x, position.y); // Sets location of image } I get a lot of different angles with this, just not the correct angles. How should I change this function to move a Vector2 along an angle using the Vector2 class from com.badlogic.gdx.math.Vector2 within the LibGDX library? I found this answer, but not sure how to implement it. Update: I figured out part of the issue. Should convert degrees to radians. However, the angle of 0 degrees is towards the right. Is there any way to fix this? As I shouldn't have to add 90 to degrees in order to have correct heading. New code is below public void move(float delta, float degrees) { degrees += 90; // Set degrees to correct heading, shouldn't have to do this position.set(image.getX() + image.getWidth() / 2, image.getY() + image.getHeight() / 2); direction.set(MathUtils.cos(degrees * MathUtils.degreesToRadians), MathUtils.sin(degrees * MathUtils.degreesToRadians)).nor(); velocity.set(direction).scl(speed); movement.set(velocity).scl(delta); position.add(movement); setLocation(position.x, position.y); }

    Read the article

  • XNA move from start position to target position exactly in 3D

    - by robasaurus
    If I have a list of positions that map out a path a character should follow. What would be the best way to move at a constant speed to each position making sure the character lands exactly at each position before moving onto the next? For example the character is at position A, we then queue up position B and position C. The character cannot move towards position C until it reaches position B exactly. It would be great if the solution worked at slower frame rates/update speeds as well.

    Read the article

  • How to move domain from 1&1 to fasthosts with minimum downtime [duplicate]

    - by arcanine
    This question already has an answer here: Changing web hosting companies 1 answer How can we move our domain name from 1&1's control over to our new host with as little affect (if any) on downtime for our domain name. We've tried moving name servers before and our site went dark despite us defining all the old records on to the new name server host, now this time we're going to move the entire domain to another company but we've been bit so many times by this that I'm trying to find out what the process should be, and whether it can be done in a way to prevent down time

    Read the article

  • What is the best way to move a UIToolbar?

    - by Ferdinand Rios
    Here is an interesting problem. On the iPhone, I have a view set up that has a toolbar on the bottom of the screen. I am currently trying to make this a universal app so that it runs on iPad as well. I would like the toolbar to be at the top of the iPad screen, so in the viewDidLoad method of the specific viewController I have the following code. if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { //move the toolbar to the top of the page and move the webview down by the height of the toolbar CGRect toolBarFrame = self.aToolBar.frame; CGRect webFrame = self.aWebView.frame; webFrame.origin.y = toolBarFrame.size.height; [self.aWebView setFrame:webFrame]; toolBarFrame.origin.y = 0; [self.aToolBar setFrame:toolBarFrame]; [Utils errorString:[NSString stringWithFormat:@"origen: x=%f y=%f", self.aToolBar.frame.origin.x, self.aToolBar.frame.origin.y]]; [Utils errorString:[NSString stringWithFormat:@"origen: x=%f y=%f", self.aWebView.frame.origin.x, self.aWebView.frame.origin.y]]; } The problem I am having is that the webView moves down fine, but the toolbar only moves up to about what seems to be the height of a iPhone screen. The call to errorString tells me that the webView's origin is at 0,44 (where it should be) and that the toolbar's origin is at 0,0, but it is actually somewhere in the middle of the screen! Anybody have a clue what is going on here?

    Read the article

  • Move a 2D square on y axis on android GLES2

    - by Dan
    I am trying to create a simple game for android, to start i am trying to make the square move down the y axis but the way i am doing it dosent move the square at all and i cant find any tutorials for GLES20 The on draw frame function in the render class updates the users position based on accleration dew to gravity, gets the transform matrix from the user class which is used to move the square down, then the program draws it. All that happens is that the square is drawn, no motion happens public void onDrawFrame(GL10 gl) { user.update(0.0, phy.AccelerationDewToGravity); GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT); // Re draws black background GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false, 12, user.SquareVB);//triangleVB); GLES20.glEnableVertexAttribArray(maPositionHandle); GLES20.glUniformMatrix4fv(maPositionHandle, 1, false, user.getTransformMatrix(), 0); GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); } The update function in the player class is public void update(double vh, double vv) { Vh += vh; // Increase horrzontal Velosity Vv += vv; // Increase vertical velosity //Matrix.translateM(mMMatrix, 0, (int)Vh, (int)Vv, 0); Matrix.translateM(mMMatrix, 0, mMMatrix, 0, (float)Vh, (float)Vv, 0); }

    Read the article

  • Move SQL Server transaction log to another disk

    - by Jim Lahman
    When restoring a database backup, by default, SQL Server places the database files in the master database file directory.  In this example, that location is in L:\MSSQL10.CHTL\MSSQL\DATA as shown by the issuance of sp_helpfile   Hence, the restored files for the database CHTL_L2_DB are in the same directory     Per SQL Server best practices, the log file should be on its own disk drive so that the database and log file can operate in a sequential manner and perform optimally. The steps to move the log file is as follows: Record the location of the database files and the transaction log files Note the future destination of the transaction log file Get exclusive access to the database Detach from the database Move the log file to the new location Attach to the database Verify new location of transaction log Record the location of the database file To view the current location of the database files, use the system stored procedure, sp_helpfile 1: use chtl_l2_db 2: go 3:   4: sp_helpfile 5: go   Note the future destination of the transaction log file The future destination of the transaction log file will be located in K:\MSSQLLog   Get exclusive access to the database To get exclusive access to the database, alter the database access to single_user.  If users are still connected to the database, remove them by using with rollback immediate option.  Note:  If you had a pane connected to the database when the it is placed into single_user mode, then you will be presented with a reconnection dialog box. 1: alter database chtl_l2_db 2: set single_user with rollback immediate 3: go Detach from the database   Now detach from the database so that we can use windows explorer to move the transaction log file 1: use master 2: go 3:   4: sp_detach_db 'chtl_l2_db' 5: go   After copying the transaction log file re-attach to the database 1: use master 2: go 3:   4: sp_attach_db 'chtl_l2_db', 5: 'L:\MSSQL10.CHTL\MSSQL\DATA\CHTL_L2_DB.MDF', 6: 'K:\MSSQLLog\CHTL_L2_DB_4.LDF', 7: 'L:\MSSQL10.CHTL\MSSQL\DATA\CHTL_L2_DB_1.NDF', 8: 'L:\MSSQL10.CHTL\MSSQL\DATA\CHTL_L2_DB_2.NDF', 9: 'L:\MSSQL10.CHTL\MSSQL\DATA\CHTL_L2_DB_3.NDF' 10: GO

    Read the article

  • Isometric Camera trouble - can't rotate or move correctly

    - by Deukalion
    I'm trying to create a 3D editor, but I've been having some trouble with the Camera and understanding each component. I've created 2 camera that works OK, but now I'm trying to implement an Isometric Camera in XNA without success on the rotation and movement of the camera. All I get working is Zoom. (Cube with x=3f, y=3f, z=1f in center) And this is the constructor for my IsometricCamera (inherits from ICamera, with methods for Rotation, Movement and Zoom, and Properties for World/View/Projection matrices) public IsometricCamera3D(GraphicsDevice device, float startClip = -1000f, float endClip = 1000f) { matrix_projection = Matrix.CreateOrthographic(device.Viewport.Width, device.Viewport.Height, startClip, endClip); rotation = Vector3.Zero; matrix_view = Matrix.CreateScale(zoom) * Matrix.CreateRotationY(MathHelper.ToRadians(45 + 180)) * Matrix.CreateRotationX(MathHelper.ToRadians(30)) * Matrix.CreateRotationZ(MathHelper.ToRadians(120)) * Matrix.CreateTranslation(rotation.X, rotation.Y, rotation.Z); } Problem is when I rotate it, all that happens is that the Cube gets more or less shiny and nothing happens. What is wrong and how should I create my View matrix to move it / rotate it correctly? Rotate, Move and Zoom looks like: MethodName(Vector3 rotation/movement), Zoom(float value); and just increases the value, then calls an update to recreate the View Matrix according to the code in the constructor. Currently, in my editor I use MiddleButton + Mouse Movement to rotate the camera, but it's not working as the other camera. But in my default camera I use World Matrix to move, but I guess that's not the best way to go which is why I'm trying this.

    Read the article

  • c++ accumulate with move instead of copy [migrated]

    - by user74399
    I have the following code auto adder = [](string& s1, const string& s2)->string&& { if (!s1.empty()) s1 += " "; s1 += s2; return move(s1); }; string test; test.reserve(wordArray.size() * 10); string words = accumulate(wordArray.begin(), wordArray.end(), move(test), adder); What I would like here is to avoid string copying. Unfortunately this is not accomplished by the vs2012 implementation of accumulate. Internally accumulate calls another function _Accumulate and the rvalue functionality gets lost in the process. It I instead call the _Accumulate function like so string words = Accumulate(wordArray.begin(), wordArray.end(), move(test), adder); I get the intended performance gain. Must the std library be rewritten to take rvalue arguments into consideration? Is there some other way I may use accumulate to accomplish what I want without cheating to much?

    Read the article

  • Batch to move files in a folder to another folder?

    - by Mohammad
    Hello People, I want to create a batch file that moves all the files in this directory to its father directory. Like for example if I have a directory " Something " that contains files : ...New Folder/Something And I want to move the files in " Something " to New folder. Is there such a command? Thanks a bunch :)

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >