move

how to move 3d object in XNA?

夙愿已清 提交于 2019-12-13 19:11:05
问题 I want to move a 3d car model, when I press the left or right arrow key I change the angle, when I press the up arrow the car drives. This is the code in the update method: float dirX = (float)Math.Sin(angle); float dirY = (float)Math.Cos(angle); if (Keyboard.GetState().IsKeyDown(Keys.Up)) { position += new Vector3(-dirX, dirY, 0); if (Keyboard.GetState().IsKeyDown(Keys.Left)) { angle += 0.015f; } if (Keyboard.GetState().IsKeyDown(Keys.Right)) { angle -= 0.015f; } } This is the calculating

grep filenames matching a pattern and move to desired folder

徘徊边缘 提交于 2019-12-13 15:52:23
问题 I have a list of patterns in a .txt file. [list.txt]. Foreach line in list.txt, I want to find all the files at a location which begin with the specified pattern in list.txt, and then move these files to another location. Consider an example case. at ~/home/ana/folder_a I have list.txt , which looks like this... list.txt 1abc 2def 3xyz At this location i.e /home/ana/folder_a/ , there are multiple files which are beginning with the patterns in list.txt. So, there are files like 1abc_a.txt,

Delphi, How to make a shape stop moving

心不动则不痛 提交于 2019-12-13 09:48:23
问题 I am trying to make a shape move towards onother using 2 shapes and 2 timer, but i really can't seem. I was thinking: At the beggining, I will make shape 1 calculate the distance of shape 2 and then move towards it, this is what i have done, i have also added comments to help you understand the code, because it is a little bit confusing: procedure TForm1.Timer1Timer(Sender: TObject); begin timer1.Interval:=100; //set interval=200 //begin if shape1.Left=shape2.Left then begin shape1.Left:

Batch file to Move files based on part of filename, to folder based on part of folder name

柔情痞子 提交于 2019-12-13 09:43:14
问题 Found a pyhton solution here, but I need a batch file-based solution. Have many files: SSP4325_blah-blah-blah.xml JKP7645_blah.xml YTG6457-blah-blah.xml And folder names that contain a piece of the file name: RefID - SSP4325, JKP7645, GHT1278, YRR0023 RefID - YTG6457 I'm looking for a batch solution which would read a portion of the file name at the front (before either the first dash or underscore) and then move that file into the folder where the front of the filename exists as part of the

Operating with zip file in PHP [closed]

早过忘川 提交于 2019-12-13 09:07:37
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . Inside webserver, I'm downloading zip and unziping with function below. $zip = new ZipArchive; $res = $zip->open('tip.zip'); if ($res === TRUE) { $zip->extractTo("$dest/"); $zip->close(); } else { die('ZIP not

Compilation error when using the move method in Cython

浪子不回头ぞ 提交于 2019-12-13 08:04:50
问题 My question is similar to the one asked here - Passing C++ vector to Numpy through Cython without copying and taking care of memory management automatically I am also getting a segmentation fault but before I can fix it I have some compilation errors to take of with the move method in Cython. This is the simplest example I have (just an extension of the Rectangle example provided in the net What I want to do My C++ code returns a deque of Points. It can return a vector of points as well. Any

Visual C++ 2010 : unordered_map and move constructor

纵然是瞬间 提交于 2019-12-13 05:56:52
问题 I have a structure named Foo which contains a unique_ptr struct Foo { std::unique_ptr<Bar> pointer; }; Now I'm trying to store instances of Foo in an unordered_map std::unordered_map<int,Foo> myMap; Technically this should be possible, since maps do not require a copy constructor, only a move constructor. However, I can't insert an element in my map: myMap.insert(std::make_pair(3, Foo())); This line will generate the following error in Visual C++ 2010 (roughly translated by me, since my

Copy and rearrange XML nodes with xslt

泄露秘密 提交于 2019-12-13 04:54:11
问题 i have folowing XML structure: <root> <product> <name> <book1>data for book1</book1> <book12>data for book12</book12> <book13>data for book13</book13> <book14>data for book14</book14> </name> <info> <data1>data for data1</data1> <data2>data for data2</data2> <data3>data for data3<data3> <data4>data for data4</data4> <data5>data for data5</data5> <data n+1>data n+1</data n+1> </info> <pictures> <pic1>data for pic1</pic1> <pic2>data for pic2</pic2> <pic3>data for pic3</pic3> <pic4>data for pic4

vb.net bindingSource and bindingNavigation programmatically

老子叫甜甜 提交于 2019-12-13 04:39:05
问题 Please have a look to the following code and tell me why it does not move to the next record? I load data programmatically and fill tables in dataset. I could do this by wizard but I want to do it with my own code; because using wizard sometimes does not help understanding the real code behind it. Private Sub frmSystemOptions_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try dsOptions = New DataSet loadOptions() bsInstitute = New BindingSource(dsOptions,

Batch file to recursively move files to first level directory from deeper subdirectories

六月ゝ 毕业季﹏ 提交于 2019-12-13 04:37:40
问题 I have a hard drive with files and folders ordered in this similar manner: F:\folder1\folder\folder\file.rar F:\folder1\folder\folder\file1.rar F:\folder1\folder\folder\file2.rar F:\folder2\folder\file.rar F:\folder2\folder\file1.rar F:\folder3\folder\file.rar F:\folder3\folder\folder\folder\file.rar I'd like to move all files in this drive to F:\\*\ , Rename if a duplicate filename is found, and recursively delete empty folders afterwards. There's just too many of these folders to find out