Hi guys, I have small problem with my example code. Any hint? #include <iostream> using namespace std; class A{ public: int a; A(int i){a = i;} A(const A& rhs) // copy constructor { a = 2; } A(const A&& rhs) // move constructor { a = 3; } }; void print(A a) { cout << a.a << endl; } A createA() { A a(1); return a; } int main(){ A a = createA(); print(a);// This will invoker copy constructor and output is 2 print(createA()); // This should invoke move constructor because this object here is rvalue right? } Output is: …

Member Avatar
Member Avatar
+0 forum 6

Hi Everyone, Wanted to share a bit on this subject as I've had to recently make some of these changes. Along my way I found a few sites that basically suggested moving all mailboxes off the database, dismount, delete and create a new database. Simple enough, however I didn't want to do this. As you may or may not know, by default Exchange installs the database at the following location: C:\Program Files\Microsoft\Exchange Server\V14\Mailbox\Database1\Database1.edb Log files would go: C:\Program Files\Microsoft\Exchange Server\V14\Mailbox\Database1 What if you wanted to change the location or name of those files? Well thankfully this is super easy with …

Member Avatar
+0 forum 0

So i'm making an rpg game with c# and xna. How can I create a simple camera that follows the player as they move? I only wish for the camera to move as the player reaches the middle of the screen. I dont require it to rotate, zoom in/out like other tutorials I have seen. Any help or suggestions would be greatly appreciated!

Member Avatar
Member Avatar
+1 forum 3

I completely understand the government getting rid of food stamps & WIC for the adults but there is no reason the government should shut down WIC for the newborn babies that need formula Formula comes in at $15 per can and only lasts every 2-3 days thats not cheap at all. So starving the newborn babies for families that can barely feed themselves is outrageous. Some one please explain this to me, me and my girlfriend are very curious please let me know what you know about this issue!?

Member Avatar
Member Avatar
+0 forum 48

I am in wonder. I just make a slideshow form and add the context menu strip as when the user click on download image then current image get copy and paste on the desktop. I use path and destination method in this but they say bitmap cannot be converted into the string. Original Code: Dim Path as string = "Path directory" } `my.resources._1` Dim destination as string = "Detination Directory" If File.Exists(path) And Not File.Exists(destination) Then File.Copy(path, destination) Replace code (try): Dim Path as bitmap = "Path directory" } `my.resources._1` Dim destination as string = "Detination Directory" If File.Exists(path) And …

Member Avatar
Member Avatar
+0 forum 4

Hello everybody! I’m trying to create a program in which the user has the ability to move the image with mouse click and ability to zoom in and out by scrolling the mouse wheel. If the user wants to return to the original image size and position, it will be possible with a click of a button. I was able to do everything said above for the exception that after the user clicks on the reset button and zooms again, the previous size of the image is shown with the position where it was before the reset button was pressed. …

Member Avatar
Member Avatar
+0 forum 9

Hi guys, I have a simple php script to upload file. I'm having some problem in creating confirmation before overwriting the file from new file upload. Situation: 1. confirm() works if using file_exists BUT not overwrite the file or process the move_uploaded_file assuming some tags are correct uploadfile.php <form enctype="multipart/form-data" action="addfile.php" method="POST" action="javascript:alert('success!');"> <td><label for="file">Choose File to Upload:</label></td> <td> <input type="file" name="upfile" id="upfile"> <br><br> <input type="hidden" name="MAX_FILE_SIZE" value="1000000" /> <input type="hidden" name="fileuploaded"> </td> </tr> <tr> <td></td> <td> <input type="submit" name="submit" value="Add" class="pure-button pure-button-success" onclick="tellme();"> <!-- <input type="submit" name="submit" value="Add" class="confirmLink"> --> <a href="index.php" ><button class="pure-button pure-button-secondary">Cancel</button></a> </form> addfile.php <script type="text/javascript"> …

Member Avatar
Member Avatar
+0 forum 5

Hello, I have recently started to develop my own game in Java and am just starting to get the hang of it. I've watched various tutorials on making an engine etc and have picked up quite a lot. I am struggling with one problem though, I have a world and two entities (The player and a Rat). The player is controlled using the keyboard which was easy to setup. But, how can I randomly get the Rat to move in a random direction with random intervals all by itself? I've tried a few different ways but I'm getting quite a …

Member Avatar
Member Avatar
+0 forum 4

I am writing a pure C based win32 applications. I have drawn line. Now i want to translate that line, move the line whereved user wants to move on screen. Then again I drawn another line, I am drawing multiple lines. I have created rectangle region for each line and trying to move the line. When I move the 2nd line over the 1st line on screen the 1st line is getting wiped out. Because I am InvalidateRect() of the rect for the line being moved, so when that rectangle is crossing the other line then the other line is …

Member Avatar
Member Avatar
+0 forum 1

Hi, I am trying to learn how to use a data base to store photos and such, I can now get info into the base and can get all the records to display , this is not what I had planed, So that lead me on a surch for answers and thus broght me here, this code gets me a record on the screen, <?php include('conect.php'); $data = "select * from table1 where id = 1"; $query = mysql_query($data); $data2 = mysql_fetch_array($query); ?><HTML><HEAD><TITLE></TITLE><META name=GENERATOR content="MSHTML 9.00.8112.16457"></HEAD><BODY> // form to display record from database <FORM method=get action=next.php target=_self><P align=center> id: <INPUT …

Member Avatar
Member Avatar
+0 forum 16

Hello. I'm quite new to Java, but I've worked on Graphics before. I have a couple of questions which are: I want to make a night sky in Java with stars which randomly switch to big stars from small and back, repeating for a set time. I also want the changes of the star size to occur with opacity, so that they appeared to glisten. Another thing I want to consider is I want to create a crescent moon, which will get off of the screen in a smooth movement across the screen, replaced with a smooth movement of sun …

Member Avatar
Member Avatar
+0 forum 13

Hi, A problem Ihave not been able to solve: P.C. is off. move or knock the keyboard and the P.C. boots. now even though the P.C. is off the keyboard light is on. (wife noticed this morning)so I pressed a few keys. P.C. did not start. It's temperatemental, if one accidently knocks/moves the keyboard when the P.C. is off it boots. any sugestions? windows XP. ps2 connector. foxconn motherboard thanks john

Member Avatar
Member Avatar
+0 forum 2

When moving a wordpress site from one host to another is it necessary to download the old wp-config.php (the correct the path to find the new db user/ url etc) in otherwords, my question is this: is there stuff on the old wp-config.php (other than define db, define db user, define db location ) that is required for the new wp to work?

Member Avatar
Member Avatar
+0 forum 2

I have one problem at the line 20-23. What I need is when the blue box touches the red rectangle, the blue box gets resetted (it goes back to where it starts). However, the problem is, it doesn't touch the red rectangle area properly. Any suggestions? Thanks in advance. float moveX, moveY; float speed = 2; float controlX, controlY; int square = 50; float rectHori = 120; float rectVert = 20; void setup() { size(400, 400); background(255); moveX = width/2; moveY = 50; reset(); } void draw() { background(255); rectMove(); rectControl(); if (dist(controlX, controlY, moveX, moveY) <= rectHori/2 + rectVert/2) …

Member Avatar
Member Avatar
+0 forum 6

I need some serious assistence with finding the solution to this problem, it has plagued me for some time now and im just not getting the big picture. I need to move the elements in a 2d array according to the user input, but the way i have figured out is too difficult and could probably be much easier, but i havent found much on it so bare with me. Secondly I need to figure out a breadth first algorithm to find the number of moves it will take for the user to get to the solution state, this is …

Member Avatar
Member Avatar
+0 forum 1

Hello , I was wondering if I could move my form or any other object with my arrowkeys in vb.2010? I found out how to do this in vb6 but this function can't be used in vb.2010 and can't find the replaced function anywhere. If anyone can help me , please do it! thx

Member Avatar
Member Avatar
+0 forum 7

Hello, I am new to java, and I need help with images. I am trying to move an image up the screen while still allowing another image to move using the arrow keys. If I use `thread.sleep` to move the image, I cant move my other image at the same time. Does anybody have a solution? I am on Mac OSX Lion, if that helps. My code is attached.

Member Avatar
Member Avatar
+0 forum 5

I have a problem i wrote a code and copyed some code but now my sprite dosent move anymore....and i dont know why # Import a library functions called 'pygame' import pygame from pygame.locals import * # Initialize the game engine pygame.init() # Define some colors black = (0, 0, 0) white = (255, 255, 255) green = (0, 255, 0) red = (255, 0, 0) blue = (0, 0, 255) class Block(pygame.sprite.Sprite): # -- Attributes # Set speed vector change_x=0 change_y=0 def __init__(self,color, filename,x,y): pygame.sprite.Sprite.__init__(self) self.image = pygame.image.load(filename).convert() self.image.set_colorkey(black) self.rect = self.image.get_rect() self.rect.topleft = [x,y] def changespeed(self,x,y): self.change_x+=x self.change_y+=y …

Member Avatar
+0 forum 0

Hi, I'm trying to learn how to create an upload file form. I'm stuck on a couple of things. This is something I learn in the past but I forgot how to create one, so it's new to me now. I got the script from http://www.w3schools.com/php/php_file_upload.asp 1) I want to learn how to upload a file to a specific folder but having an issue understanding how to do that. 2) How do I override a file that already exist in that folder. Here is the **Form** file: <html> <body> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> …

Member Avatar
Member Avatar
+0 forum 11

Is it possibile to display moving words in cobol?similar to tertris?thanks

Member Avatar
+0 forum 0

Well i'll try to be clear as possible, i'm making like an account organizer (helper/tool) w.e you wanna call it, and for example i have 10 accounts. I want to delete account #5 (They are array), what i need it to do is move account #6, 7, 8, 9 & 10 down and number 5 would be the last account (Last account will be blank). I have this Listbox to change in between the accounts, so i can change from 1 to 10 fast, account 11 is just blank just if i want to add another account. My codes: Accounts …

Member Avatar
Member Avatar
+0 forum 7

I am looking to create a PBBG game using HTML and CSS for the display and then PHP and MySQL to handle the game itself. It shall only be simple, click on this item and upgrade it if you have enough resources e.t.c. I am hoping to make it a bit more interactive, and I was thinking that I could use a viewport to only display a certain amount of the map and then allow them to use the arrow keys (or WASD) to scroll around the rest of the map. I am not really sure what language I would …

Member Avatar
Member Avatar
+0 forum 1

Hello, I'm new to this site, and i really need help with something. I have been working on a checkerboard project for my second programming class, and now I'm stuck. I now how to set the icons, but now I am absolutely confounded as to how I move the icon from one jbutton to the nu=ext as a way of movement. I want to be able to do this by use of a set of mouse clicks. I also need to figure out how to do the AI for the opponent. Someone told me that i should set up a …

Member Avatar
Member Avatar
+0 forum 85

**Please help me friends** **I have a doubt in using array in JAVA** **if my input is AB1CD** They are stored in array as a[0]=A a[1]=B a[2]=1 a[3]=C a[4]=D I developed a coding to insert the number that appearing after a alphabet in the same array element like a[0]=A a[1]=B1 a[2]=C a[3]=C a[4]=D The program is given below import java.io.*; class suba { public static void main(String args[]) throws IOException { String[] st= new String[100]; System.out.println("Enter the text :"); BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str=br.readLine(); st=str.split(""); for(int k=0;k<(st.length-1);k++) { st[k]=st[k+1]; } //char ch[]=str.toCharArray(); for(int i=0;i<st.length-1;i++) { if((st[i].equals("0"))||(st[i].equals("1"))||(st[i].equals("2"))||(st[i].equals("3"))||(st[i].equals("4"))||(st[i].equals("5"))||(st[i].equals("6"))||(st[i].equals("7"))||(st[i].equals("8") )||(st[i].equals("9") ) ) …

Member Avatar
Member Avatar
+0 forum 4

I was trying to move my camera along the red cube .. so i came across the gluLookAt function, but i am not able to get through this function as to what all it requires ... the content on the Documentation didn't quite help. it will be very helpful if anyone can help me out with the problem in my code and explain the gluLookAt . [ICODE] #include <GL/gl.h> #include <GL/glut.h> #include<iostream> using namespace std; GLfloat angle = 0.0; //set the angle of rotation float Cx=0.0,Cy=0.0,Cz=0.0; typedef struct Car { float x,y,z; float angle; float zvelocity,xvelocity; }Car; Car car; void …

Member Avatar
Member Avatar
+0 forum 1

Hello everyone on daniweb!:) I'm trying to make a programme which will move a picture to the sides when pressing the right or left arrowkeys. I did successfully put a picture in and I was able to change the side coordinates(called "side" in the programme) to make the picture move. However now I want it to be done with KeyListener. I have been trying to browse the internet for help but I havnt yet found anything which worked. One problem is that I dont know what to add the keylistener to(now its added to "img" because I dont know better). …

Member Avatar
Member Avatar
+0 forum 3

Hello DaniWeb, I have a new idea for an app: I have an external harddrive and I usually backup my desktop with a cleanup folder which I usually move to the external harddrive. The problem is: when I search for a file (i.e. example.mp3) I will find multiple copies which are taking up way too much space. Is there an app or some code that can search for an extension (i.e. .mp3) and if it finds more than one copy of the same file, it can delete the extra file? The reason I ask is: I have around 1300 different …

Member Avatar
Member Avatar
+0 forum 12

I am trying to copy the contents of a folder into another folder in another drive using XCOPY. Here is code I have now but it isn't working and I figure xcopy would be the easier way to go because MOVETO and CopyDirectory haven't been working because its copying files to a different directory. [CODE]Sub CopyFiles() Dim DestinationDirectory As String = "I:\New\Export\ID" Dim SourceDirectory As String = "C:\Temp2\" Try Dim f() As String = Directory.GetFiles(SourceDirectory) For i As Integer = 0 To UBound(f) File.Copy(f(i), DestinationDirectory & "\" & SourceDirectory(f(i))) Next Catch ex As Exception End Try End Sub[/CODE]

Member Avatar
Member Avatar
+0 forum 19

Hello again! I'm having trouble trying to double the value of my coordinates in my point. The object is to create a pair of eyes and their position is identified by clicking a point in the graphic window which would allocated the centre of the left eye, and the second click would identify the radius of the circle by clicking the edge of its circumference. The third eye is placed directly beside it, so I figured I had to make the coordinates of the right eye's centre twice as long as the left eye's centre. I've tried so many arithmetic …

Member Avatar
Member Avatar
+0 forum 1

I am using Python and wxPython to attempt to make a 2d game. When w is pressed, the tiles (except the character) should move so it looks like you are moving. The problem is, when the key is pressed, nothing moves. I added a line of code(no longer there) to make sure the tile position variable was changing, which it was. So, the position is not updating. Is there a way to reload the frame? [code] import wx level=1 attack=1 defense=1 health=5 map4_31_locationx=270 map4_31_locationy=170 class MainWindow(wx.Frame): def __init__(self): wx.Frame.__init__(self,None,-1,size = (600, 400)) self.panel = wx.Panel(self,-1) self.map4_31="C:/python27/game/4_31.gif" self.map1=wx.Image(self.map4_31,wx.BITMAP_TYPE_GIF).ConvertToBitmap() height=self.map1.GetHeight() width=self.map1.GetWidth() self.map1.map4_31 …

Member Avatar
Member Avatar
+0 forum 6

The End.