Search Results

Search found 647 results on 26 pages for 'aj sin dhal'.

Page 7/26 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • converting string to int in C++

    - by xbonez
    I am trying to convert a string I read in from a file to an int value so I can store it in an integer variable. This is what my code looks like: ifstream sin; sin.open("movie_output.txt"); string line; getline(sin,line); myMovie.setYear(atoi(line)); Over here, setYear is a mutator in the Movie class (myMovie is an object of Movie class) that looks like this: void Movie::setYear(unsigned int year) { year_ = year; } When I run the code, I get the following error: error C2664: 'atoi' : cannot convert parameter 1 from 'std::string' to 'const char *' 1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

    Read the article

  • How to implement line of sight restriction in actionscript?

    - by Michiel Standaert
    I have a problem with a game i am programming. I am making some sort of security game and i would like to have some visual line of sight. The problem is that i can't restrict my line of sight so my cops can't see through the walls. Below you find the design, in which they can look through windows, but not walls. Further below you find an illustration of what my problem is exactly. this is what it looks like now. As you can see, the cops can see through walls. This is the map i would want to use to restrict the line of sight. So the way i am programming the line of sight now is just by calculating some points and drawing the sight accordingly, as shown below. Note that i also check for a hittest using bitmapdata to check whether or not my player has been spotted by any of the cops. private function setSight(e:Event=null):Boolean { g = copCanvas.graphics; g.clear(); for each(var cop:Cop in copCanvas.getChildren()) { var _angle:Number = cop.angle; var _radians:Number = (_angle * Math.PI) / 180; var _radius:Number = 50; var _x1:Number = cop.x + (cop.width/2); var _y1:Number = cop.y + (cop.height/2); var _baseX:Number = _x1 + (Math.cos(_radians) * _radius); var _baseY:Number = _y1 - (Math.sin(_radians) * _radius); var _x2:Number = _baseX + (25 * Math.sin(_radians)); var _y2:Number = _baseY + (25 * Math.cos(_radians)); var _x3:Number = _baseX - (25 * Math.sin(_radians)); var _y3:Number = _baseY - (25 * Math.cos(_radians)); g.beginFill(0xff0000, 0.3); g.moveTo(_x1, _y1); g.lineTo(_x2, _y2); g.lineTo(_x3, _y3); g.endFill(); } var _cops:BitmapData = new BitmapData(width, height, true, 0); _cops.draw(copCanvas); var _bmpd:BitmapData = new BitmapData(10, 10, true, 0); _bmpd.draw(me); if(_cops.hitTest(new Point(0, 0), 10, _bmpd, new Point(me.x, me.y), 255)) { gameover.alpha = 1; setTimeout(function():void{ gameover.alpha = 0; }, 5000); stop(); return true; } return false; } So now my question is: Is there someone who knows how to restrict the view so that the cops can't look through the walls? Thanks a lot in advance. ps: i have already looked at this tutorial by emanuele feronato, but i can't use the code to restric the visual line of sight.

    Read the article

  • Que es Virtualbox?

    - by [email protected]
    VIRTUALBOX (Open Source para virtualización)Las herrramientas de virtualización se han puesto de moda de manera casi exponencial durante los últimos años. Una de ellas es VirtualBox, esta corre sobre diferentes sistemas operativos y para los desarrolladores e ingenieros en computo que desean realizar pruebas de productos sin afectar sus maquinas, esta es una de las mejores alternativas. Adicionalmente hay algo que tiene VirtualBox que aun es mejor, es un program Open Source, eso significa que la podras usar en tu maquina teniendo un costo de $0.Esta herramienta realiza basicamente la misma funcion que Vmware Workstation, e incluso puede ejecutar la maquinas virtuales creadas con vmware workstation sin necesidad de realizar conversiones de alguna manera.La ultima version disponible al dia de hoy es la 3.1.6 y este puede ser descargado facilmente.  Solo visita uno de estos sites."Get  the lastest VirtualBox version at here"http://www.virtualbox.org/wiki/Downloadso en la pagina de Oracle"Get  the lastest VirtualBox version at here"http://dlc.sun.com/virtualbox/vboxdownload.html

    Read the article

  • Taking fixed direction on hemisphere and project to normal (openGL)

    - by Maik Xhani
    I am trying to perform sampling using hemisphere around a surface normal. I want to experiment with fixed directions (and maybe jitter slightly between frames). So I have those directions: vec3 sampleDirections[6] = {vec3(0.0f, 1.0f, 0.0f), vec3(0.0f, 0.5f, 0.866025f), vec3(0.823639f, 0.5f, 0.267617f), vec3(0.509037f, 0.5f, -0.700629f), vec3(-0.509037f, 0.5f, -0.700629), vec3(-0.823639f, 0.5f, 0.267617f)}; now I want the first direction to be projected on the normal and the others accordingly. I tried these 2 codes, both failing. This is what I used for random sampling (it doesn't seem to work well, the samples seem to be biased towards a certain direction) and I just used one of the fixed directions instead of s (here is the code of the random sample, when i used it with the fixed direction i didn't use theta and phi). vec3 CosWeightedRandomHemisphereDirection( vec3 n, float rand1, float rand2 ) float theta = acos(sqrt(1.0f-rand1)); float phi = 6.283185f * rand2; vec3 s = vec3(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta)); vec3 v = normalize(cross(n,vec3(0.0072, 1.0, 0.0034))); vec3 u = cross(v, n); u = s.x*u; v = s.y*v; vec3 w = s.z*n; vec3 direction = u+v+w; return normalize(direction); } ** EDIT ** This is the new code vec3 FixedHemisphereDirection( vec3 n, vec3 sampleDir) { vec3 x; vec3 z; if(abs(n.x) < abs(n.y)){ if(abs(n.x) < abs(n.z)){ x = vec3(1.0f,0.0f,0.0f); }else{ x = vec3(0.0f,0.0f,1.0f); } }else{ if(abs(n.y) < abs(n.z)){ x = vec3(0.0f,1.0f,0.0f); }else{ x = vec3(0.0f,0.0f,1.0f); } } z = normalize(cross(x,n)); x = cross(n,z); mat3 M = mat3( x.x, n.x, z.x, x.y, n.y, z.y, x.z, n.z, z.z); return M*sampleDir; } So if my n = (0,0,1); and my sampleDir = (0,1,0); shouldn't the M*sampleDir be (0,0,1)? Cause that is what I was expecting.

    Read the article

  • Circular Bullet Spread not Even

    - by SoulBeaver
    I'm creating a bullet shooter much in the style of Touhou. Right now I want to have a very simple circular shot being fired from the enemy. See this picture: As you can see, the spacing is very uneven, which isn't very good if you want to survive. The code I'm using is this: private function shoot() : void { const BULLETS_PER_WAVE : int = 72; var interval : Number = BULLETS_PER_WAVE / 360; for (var i : int = 0; i < BULLETS_PER_WAVE; ++i { var xSpeed : Number = GameConstants.BULLET_NORMAL_SPEED_X * Math.sin(i * interval); var ySpeed : Number = GameConstants.BULLET_NORMAL_SPEED_Y * Math.cos(i * interval); BulletFactory.createNormalBullet(bulletColor_, alice_.center, xSpeed, ySpeed); } canShoot_ = false; cooldownTimer_.start(); } I imagine my mistake is in the sin, cos functions, but I'm not entirely sure what's wrong.

    Read the article

  • 2D Car Simulation with Throttle Linear Physics

    - by James
    I'm trying to make a simulation game for an automatic cruise control system. The system simulates a car on varying inclinations and throttle speeds. I've coded up to the car physics but these do note make sense. The dynamics of the simulation are specified as follows: a = V' - V T = (k1)V + ?(k2) + ma V' = (1 - (k1 / m) V) + T - ( k2 / m) * ? Where T = throttle position k1 = viscous friction V = speed V' = next speed ? = angle of incline k2 = m g sin ? a = acceleration m = mass Notice that the angle of incline in the equation is not chopped up by sin or cos. Even the equation for acceleration isn't right. Can anyone correct them or am I misinterpreting the physics?

    Read the article

  • How much C/C++ knowledge is needed for Objective-C/iPhone development?

    - by BFree
    First, a little background. I'm a .Net developer (C#) and have over 5 years experience in both web development and desktop applications. I've been wanting to look into iPhone development for some time now, but for one reason or another always got side tracked. I finally have a potential project on the horizon, and I'm now going full steam ahead learning this stuff. My question is this: I haven't done any C/C++ programming since my schooling days, I've been living in managed land ever since. How much knowledge if any is needed to be successful as an iOS developer? Obviously memory management is something that I'll have to be conscious about (although with iOS 5 there seems to be something called ARC which should make my life easier), but what else? I'm not just talking about the C API (for example, in order to get the sin of a number, I call the sin() function), that's what Google is for. I'm talking about fundamental C/C++ idioms that the average C# developer is unaware of.

    Read the article

  • vpnc Not Adding Internal DNS Servers to resolv.conf

    - by AJ
    I'm trying to setup vpnc on Ubuntu. When I run vpnc, my resolv.conf file does not get changed. It still only contains my ISP's name servers: #@VPNC_GENERATED@ -- this file is generated by vpnc # and will be overwritten by vpnc # as long as the above mark is intact nameserver 65.32.5.111 nameserver 65.32.5.112 Here is my /etc/network/interfaces: auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.1.3 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 65.32.5.111 65.32.5.112 Any tips on how to troubleshoot/resolve this? Thanks in advance.

    Read the article

  • Sony Vaio Hard Drive replacement won't boot

    - by AJ Bovaird
    I'm working on a Sony Vaio VGN-CR120e. I've cloned the original SATA 1.5 drive with Norton Ghost on to 2 new hard drives, the second of which is a Seagate 7200.4 320Gb 7200 RPM, with the jumper set to limit to SATA 1.5. (The first drive is a WD Scorpio Black 320Gb 7200RMP, which has no SATA 1.5 override support). Neither of the cloned drives will boot - I immediately get a BlackSOD saying: "Windows failed to start blah blah blah" "File \Windows\system32\winload.exe" "Status: 0xc000000e" "Info: The selected entry could not be loaded because the application is missing or corrupt." I've done this hundreds of times on other PC's, and this is the first time I've encountered such an error. Does anyone have any suggestions or advice on how to proceeed, as I would rather not reinstall Vista unless absolutely necessary.

    Read the article

  • Google Chrome Enterprise - Any Gotchas?

    - by AJ
    Has anyone rolled out Google Chrome to a medium / large organisation? I would like to suggest it to our management (because I think it would work very nicely with some of our intranet applications), and I would like to find out what problems (if any) the rest of the world has been experiencing with it. Have you found any problems? I'm thinking of enterprise-level problems. I'm thinking that we can solve anything that requires a specific configuration / proxy setting / etc. I don't really know what I think might be a problem, but I wonder if there are any usability problems that occur when non-geeks use it? Or problems which only rear their ugly heads when you've got 50 users all doing something unexpected. Any helpful information or suggestions would be appreciated. Thanks. UPDATED: We tend to use Microsoft stuff, so Sharepoint, IIS, SQL Server, are typical building blocks of internal sites. (Thanks, @Jim, for reminding me to mention that).

    Read the article

  • Migrate Exchange 2007 Mailbox between Servers

    - by AJ
    Hi all, I am using Outlook 2007 and Exchange 2007. I will need to migrate my Exchange mailbox from one server to another (different organizations), including all email, contacts, and calendar. I have read that there are ways to do this on the server side, but what methods could be used by me to facilitate this on my end? Is there way to back up my mailbox data so that it could be "imported" into the target mailbox? Thanks!

    Read the article

  • How Can I Edit a DVD Already Burned to Disc?

    - by AJ
    I have been asked to edit a DVD - specifically doing the following: Add chapter markers Add chapter selection menu Combine two shorter discs into one I would like to know if there is software that can allow me to import a DVD, make these changes, and then create a new master DVD?

    Read the article

  • Transfer Books from Mac to Kindle App on the Nexus 7

    - by AJ.
    I have some e-books that I've downloaded from Project Gutenberg and some other sources to my MBP. They are all DRM free. Excluding e-mail them to my Kindle as a personal document as a method (the total size is more than 5 GB, the space provided by Amazon), is there any way to transfer these books to my Kindle App on my Nexus 7 (Android Tablet). I have the Kindle App version 3.1.7 I've already seen the question Can I sync books I didn't buy from Amazon via Kindle app? but that is not the answer I'm looking for. Thanks

    Read the article

  • Windows 7 Stopped Using hosts file for DNS Resolution

    - by AJ
    I am running Windows 7 Home Premium 64-bit. Starting today, I noticed that DNS resolution is not reading my %SYSTEMROOT%\System32\drivers\etc\hosts file. I say this because I added two new entries to the file and when I run 'nslookup' on the command line, they don't resolve. Further, just trying to resolve 'localhost' results in my primary DNS server being queried. I've read several threads that suggest that the file might have been corrupted and to move it aside and create a new one. I've done that, and no improvement. Is there some sort of registry key that controls the sequence of resources used for DNS resolution (similar to nsswitch.conf on UNIX)? What else could be causing this? Thanks in advance.

    Read the article

  • AMD Processors and the Windows Phone 8 Emulator

    - by Aj Patel
    I would madly appreciate it if anyone in this community would help me with my question. The background is that I want to develop Windows Phone 8 applications but both of my current computer processors do not have Hardware Virtualization & Second Level Address Translation that are needed to run the Emulator. I have my eyes on an AMD computer g7-2243us (I like it because it has 1600x900 screen res). I looked up this Link that shows that this computer's AMD processor (Next Gen AMD Quad-Core A8-4500M Accelerated 1.9GHz up to 2.8GHz 4MB L2 Cache Processor) supports AMD-V Hardware Virtualization. So, will this computer be able to run the emulator? Thank you so much for your answers. I'm pretty sure it will run the emulator, but I just want to make sure before spending $400. Thank You all So Much.

    Read the article

  • Multiple VLANs in the same subnet

    - by A.J.
    Is it possible to have multiple VLANs in the same subnet, with the same gateway address (TMG)? I want to avoid having many Subnets (and vNIC's in TMG) just to isolate sets of a few hosts. IP: 10.0.0.1 (TMG server) VLAN:1 ~ 3 IP: 10.0.0.11 ~ 20 (Hosts group 1) VLAN:1 IP: 10.0.0.21 ~ 30 (Hosts group 2) VLAN:2 IP: 10.0.0.31 ~ 40 (Hosts group 3) VLAN:3 Note that I don't want them to connect to each other, so ARP/inter-vlan routing (within the subnet) is not required. The gateway is running in a VM within ESXi 5, I can pass the VLans to the VM using VGT or VLan Range, but I don't know how the OS/TMG should handle them.

    Read the article

  • Cheap machine with Xen to have more than one personal dev servers with RAID option?

    - by AJ
    I do not have a lot of money so when I need a personal dev servers I decided I will use Xen on one machine to run various OS's. Although, I really like Dell Zino (http://www.dell.com/us/en/home/desktops/inspiron-zino-hd/pd.aspx?refid=inspiron-zino-hd&cs=19&s=dhs) as a very economical and compact PC which can be scaled to 8GB of RAM, I do not know how to have a RAID setup, for the backup. Is there an economical way to add a RAID setup to Dell Zino or I would have to invest in a proper box for that? Thanks for your help in advance. **Also, please let me know if this question is not meant for this forum.

    Read the article

  • Mysqld shutting down by itself

    - by AJ Naidas
    I'm running a Wordpress Blog that gets medium-high traffic. It is hosted in an Ubuntu Server 2GB Memory 2 Core Processor 40GB SSD Disk, 3TB Transfer. The problem is that MySQL shuts down by itself after an hour or two. I had to restart mysql each and every time this happens. I checked the logs and this is what I found: 140612 6:48:14 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 140612 6:48:14 [Note] Plugin 'FEDERATED' is disabled. 140612 6:48:14 InnoDB: The InnoDB memory heap is disabled 140612 6:48:14 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140612 6:48:14 InnoDB: Compressed tables use zlib 1.2.3.4 140612 6:48:14 InnoDB: Initializing buffer pool, size = 1.4G InnoDB: mmap(1502412800 bytes) failed; errno 12 140612 6:48:14 InnoDB: Completed initialization of buffer pool 140612 6:48:14 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140612 6:48:14 [ERROR] Plugin 'InnoDB' init function returned error. 140612 6:48:14 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 140612 6:48:14 [ERROR] Unknown/unsupported storage engine: InnoDB 140612 6:48:14 [ERROR] Aborting 140612 6:48:14 [Note] /usr/sbin/mysqld: Shutdown complete judging by this line: 140612 6:48:14 InnoDB: Fatal error: cannot allocate memory for the buffer pool I suspect that this is a memory problem, but I would like to hear from the experts here before I conclude. Is this a lack of memory problem? Do you think the value of max_connections in my.cnf (currently 100) is a potential cause and needs increasing? TIA.

    Read the article

  • How to slave a 3.5" 500gb SATA external hard drive (Western Digital) to my Dell Inspiron laptop

    - by AJ HDD
    I have a 3.5" Western Digital My Book 500gb external hard drive. I gave it to a friend of mine, and he broke the USB port in it. I went to a nearby comp repair shop and had him solder the thing, and it didn't detect when it when I plugged it into my Dell Inspiron laptop. I recently saw about the 3.5" SATA to USB enclosure, so I went to check it. Strangely, when its placed in the enclosure, its not detecting in Windows. Also, when it was put as secondary (I'm guessing slave) to the shop fellow's desktop, it shows up in the BIOS and while starting, but then again doesn't show in Windows 7. The guy told me that I need to use a data recovery tool to get my data back. P.S. Whe WD hard drive doesnt have an OS, just data. So my question is: Can I slave the drive to my Dell laptop and try to recover the data, and if so how? I would really appreciate it any help, thanks in advance.

    Read the article

  • How to slave a 3.5" 500gb sata external hdd(Western Digital) to my dell Inspiron laptop

    - by AJ HDD
    i have a 3.5" western digital my book 500gb external hdd....i gave it to a friend of mine and he broke the usb port in it...i went to a nearby comp repair shop and had him solder the thing...it didnt detect when i plugged it in my dell inspiron laptop........i recently saw about the 3.5" sata to usb enclosure, so i went to check it....strangely when its placed in the enclosure, its not detecting in windows...also when it was put as secondary(im guessing slave) to the shop fellow's desktop it shows up in the bios and starting, but then again doesnt show in windows 7, and the guy told me i need to data recovery to get teh data back p.s.the wd hdd doesnt have os, just data, soo my question is: can i slave the drive to my dell laptop and try to recover the data....if so how? please i would really appreciate it...thanks in advance

    Read the article

  • Geolocation SQL query not finding exact location

    - by Iridium52
    I have been testing my geolocation query for some time now and I haven't found any issues with it until now. I am trying to search for all cities within a given radius, often times I'm searching for cities surrounding a city using that city's coords, but recently I tried searching around a city and found that the city itself was not returned. I have these cities as an excerpt in my database: city latitude longitude Saint-Mathieu 45.316708 -73.516253 Saint-Édouard 45.233374 -73.516254 Saint-Michel 45.233374 -73.566256 Saint-Rémi 45.266708 -73.616257 But when I run my query around the city of Saint-Rémi, with the following query... SELECT tblcity.city, tblcity.latitude, tblcity.longitude, truncate((degrees(acos( sin(radians(tblcity.latitude)) * sin(radians(45.266708)) + cos(radians(tblcity.latitude)) * cos(radians(45.266708)) * cos(radians(tblcity.longitude - -73.616257) ) ) ) * 69.09*1.6),1) as distance FROM tblcity HAVING distance < 10 ORDER BY distance desc I get these results: city latitude longitude distance Saint-Mathieu 45.316708 -73.516253 9.5 Saint-Édouard 45.233374 -73.516254 8.6 Saint-Michel 45.233374 -73.566256 5.3 The town of Saint-Rémi is missing from the search. So I tried a modified query hoping to get a better result: SELECT tblcity.city, tblcity.latitude, tblcity.longitude, truncate(( 6371 * acos( cos( radians( 45.266708 ) ) * cos( radians( tblcity.latitude ) ) * cos( radians( tblcity.longitude ) - radians( -73.616257 ) ) + sin( radians( 45.266708 ) ) * sin( radians( tblcity.latitude ) ) ) ),1) AS distance FROM tblcity HAVING distance < 10 ORDER BY distance desc But I get the same result... However, if I modify Saint-Rémi's coords slighly by changing the last digit of the lat or long by 1, both queries will return Saint-Rémi. Also, if I center the query on any of the other cities above, the searched city is returned in the results. Can anyone shed some light on what may be causing my queries above to not display the searched city of Saint-Rémi? I have added a sample of the table (with extra fields removed) below. I'm using MySQL 5.0.45, thanks in advance. CREATE TABLE `tblcity` ( `IDCity` int(1) NOT NULL auto_increment, `City` varchar(155) NOT NULL default '', `Latitude` decimal(9,6) NOT NULL default '0.000000', `Longitude` decimal(9,6) NOT NULL default '0.000000', PRIMARY KEY (`IDCity`) ) ENGINE=MyISAM AUTO_INCREMENT=52743 DEFAULT CHARSET=latin1 AUTO_INCREMENT=52743; INSERT INTO `tblcity` (`city`, `latitude`, `longitude`) VALUES ('Saint-Mathieu', 45.316708, -73.516253), ('Saint-Édouard', 45.233374, -73.516254), ('Saint-Michel', 45.233374, -73.566256), ('Saint-Rémi', 45.266708, -73.616257);

    Read the article

  • Simple haskell string manage

    - by paurullan
    Theres is a little problem I want to solve with Haskell: let substitute a function that change all of the wildcards in a string for one concrete parameter. The function has de signature of: subs :: String -> String -> String -> String -- example: -- subs 'x' "x^3 + x + sin(x)" "6.2" will generate -- "6.2^3 + 6.2 + sin(6.2)"

    Read the article

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