Search Results

Search found 10 results on 1 pages for 'kamikaze'.

Page 1/1 | 1 

  • How to avoid game objects accidentally deleting themselves in C++

    - by Tom Dalling
    Let's say my game has a monster that can kamikaze explode on the player. Let's pick a name for this monster at random: a Creeper. So, the Creeper class has a method that looks something like this: void Creeper::kamikaze() { EventSystem::postEvent(ENTITY_DEATH, this); Explosion* e = new Explosion; e->setLocation(this->location()); this->world->addEntity(e); } The events are not queued, they get dispatched immediately. This causes the Creeper object to get deleted somewhere inside the call to postEvent. Something like this: void World::handleEvent(int type, void* context) { if(type == ENTITY_DEATH){ Entity* ent = dynamic_cast<Entity*>(context); removeEntity(ent); delete ent; } } Because the Creeper object gets deleted while the kamikaze method is still running, it will crash when it tries to access this->location(). One solution is to queue the events into a buffer and dispatch them later. Is that the common solution in C++ games? It feels like a bit of a hack, but that might just be because of my experience with other languages with different memory management practices. In C++, is there a better general solution to this problem where an object accidentally deletes itself from inside one of its methods?

    Read the article

  • Static Evaluation Function for Checkers

    - by Kamikaze
    Hi all! I'm trying to write an evaluation function for a game of checkers that I'm developing but I can't find the right documentation. I've read several documents on the web witch describe different techniques for either writing one or letting the computer find it(using genetic algorithms or Bayesian learning) but they're too complicated for a novice like me. All documents pointed a reference to "Some studies in machine learning using the game of checkers" by A.L.Samuel but I couldn't get my hands on it yet :(. I've only read the follow up "Some studies in machine learning using the game of checkers -II" and found some good info there, but it doesn't explain what the eval parameters mean (I think I don't have the whole article). Thanks for your help!

    Read the article

  • Are there any good Java API for facebook?

    - by Kamikaze Mercenary
    I've played around a bit with twitter4j and found it absolutely wonderful. Now I've been looking into the equivalent for facebook but so far haven't had much luck finding a decent project. I looked into facebook-java-api but it appears that they break their API from release to release. I consider this unacceptable. I'm currently playing around a bit with RestFB and the API seems decent so far but I've been having some connection problems. I'm just looking for a simple library that lets me post status updates, send direct messages and get a list of friends through minimal coding effort. Has anyone had any success using a java API for facebook and if so, what are you using? Thanks.

    Read the article

  • How do I keep the shape of an UIELement while doing a Drag and Drop in WPF

    - by Kamikaze
    Hi all!I'll give an example of what I intend to do: I have 2 StackPanels one containing an Ellipse the other one containing nothing; I want to drag the Ellipse from one stack panel to the other . The actual drag & drop is already done and works fine. However I'd like to know how to keep that that Ellipse shape at the tip of my mouse cursor (I've been searching all day and couldn't find anything that helps ) Even an windows forms example would be nice , I'll be able to adapt it :). Thanks for the help!

    Read the article

  • Is the Contains Method in java.lang.String Case-sensitive?

    - by Kamikaze Mercenary
    Say I have 2 strings, String s1 = "AbBaCca"; String s2 = "bac"; I want to preform a check returning that s2 is contained within s1. I can do this with: return s1.contains(s2); I am pretty sure that contains() is case sensitive, however I can't determine this for sure from reading the documentation. If it is then I suppose my best method would be something like: return s1.toLowerCase().contains(s2.toLowerCase()); All this aside, does anyone know of another (possibly better) way to accomplish this without caring about case-sensitivity?

    Read the article

  • Subsonic how do I filter a loaded collection?

    - by Kamikaze
    Currently I am using Subsonic 2.1 and .NET 2.1 and I have an issue where I am attempting to filter a pre-loaded collection with 300+ items. I am using the following to attempt to preform the filter: orders = MasterOrders.Where("account", mbrAccount).Load(); The end results is setting orders equal to the entire MasterOrders collection and not the filtered results. Any suggestions?

    Read the article

  • Should I avoid using Java Label Statements?

    - by Kamikaze Mercenary
    Today I had a coworker suggest I refactor my code to use a label statement to control flow through 2 nested for loops I had created. I've never used them before because personally I think they decrease the readability of a program. I am willing to change my mind about using them if the argument is solid enough however. What are people's opinions on label statements?

    Read the article

  • Wireless clients have no route to ethernet clients in OpenWrt router

    - by superjoe30
    I'm using OpenWrt Kamikaze 8.09 on a Linksys WRT54g v1.1 router. I just flashed it with default settings and got everything working, except my wireless laptop cannot ping my desktop which is wired to the router. What can I do to fix this? (My desktop can ping other desktops wired to the router) My routing table: config 'defaults' option 'syn_flood' '1' option 'input' 'ACCEPT' option 'output' 'ACCEPT' option 'forward' 'REJECT' config 'zone' option 'name' 'lan' option 'input' 'ACCEPT' option 'output' 'ACCEPT' option 'forward' 'REJECT' config 'zone' option 'name' 'wan' option 'input' 'REJECT' option 'output' 'ACCEPT' option 'forward' 'REJECT' option 'masq' '1' config 'forwarding' option 'src' 'lan' option 'dest' 'wan' option 'mtu_fix' '1' config 'redirect' option 'src' 'wan' option '_name' 'ssh' option 'proto' 'tcp' option 'src_dport' '22' option 'dest_ip' '192.168.1.100' option 'dest_port' '22' config 'redirect' option 'src' 'wan' option '_name' 'http' option 'proto' 'tcp' option 'src_dport' '8888' option 'dest_ip' '192.168.1.100' option 'dest_port' '8888'

    Read the article

  • Why is my iPhone WIFI so slow at home?

    - by John Fouhy
    When my iPhone is connected to my home wireless network, the internet is unusably slow. I installed the speedtest.net application; here are some results from tonight: Down: 0.0kB/s, Up: 0.0kB/s, ping: 2230ms Down: 2.5kB/s, Up: 40.5kB/s, ping: 2182ms Down: 0.0kB/s, Up: 20.0kB/s, ping: 197ms For comparison, here is the result from my iMac to the same server, which is on the same wireless network (and has no wired connection): Down: 139kB/s, Up: 53.8kB/s, ping: 182ms Neither my iMac nor the Dell laptop also on the network have experienced the wifi problems I get with my iPhone. On the other hand, I tried browsing a website on the wireless network at work with no problems. EDIT: SpeedTest at work gives me 156kB/s down. EDIT2: Girlfriend (owner of the Dell) reports actually the internet is sometimes very slow. Perhaps there is more going on. No problems with my iMac. My router is a ASUS WL-500g Premium V2 running OpenWrt Kamikaze with X-Wrt Extensions 8.09.

    Read the article

  • Perl IO modules possibly causing issues in Net::DNS module

    - by Rich
    Hi! I’m porting some software that I wrote for a White Russian OpenWRT system to a new Kamikaze 8.09.1 OpenWRT system but I am having some serious issues that I’m hoping you can help me with. Old system Linux kernel 2.4.34 MIPSEL arch Perl 5.8.7 Net::DNS 0.48 IO 1.21 IO::Socket 1.28 IO::Socket::INET 1.28 New system Linux kernel 2.6.26.8 MIPS arch Perl 5.10.0 Net::DNS 0.66 IO 1.23_01 IO::Socket 1.30_01 IO::Socket::INET 1.31 First, let me provide some background information… I am trying to resolve my server (clearprobe.winbeam.com) from within my Perl program and see the following if I enable debugging in Net::DNS: resolve: Server 'clearprobe-ddns.winbeam.com' ;; query(clearprobe-ddns.winbeam.com) ;; setting up an AF_INET() family type UDP socket ;; send_udp(192.168.88.1:53) ;; send_udp(4.2.2.2:53) ;; send_udp(192.168.88.1:53) ;; send_udp(4.2.2.2:53) resolve: res->errorstring: query timed out Both of these servers resolve clearprobe.winbeam.com fine from the command line: root@cwb-2-11:~# echo “nameserver 192.168.88.1” > /etc/resolv.conf root@cwb-2-11:~# nslookup clearprobe-ddns.winbeam.com Server: 192.168.88.1 Address 1: 192.168.88.1 router Name: clearprobe-ddns.winbeam.com Address 1: 64.13.48.40 64-13-48-40.war.clearwire-dns.net root@cwb-2-11:~# echo “nameserver 4.2.2.2” > /etc/resolv.conf root@cwb-2-11:~# nslookup clearprobe-ddns.winbeam.com Server: 4.2.2.2 Address 1: 4.2.2.2 vnsc-bak.sys.gtei.net Name: clearprobe-ddns.winbeam.com Address 1: 64.13.48.40 64-13-48-40.war.clearwire-dns.net Using Perl’s call to the C gethostbyaddr() function works fine, but I need to do another lookup later in the software which requires that I specify the nameserver (clearprobe-ddns.winbeam.com is the authority for my internal DNS zone), hence my Net::DNS requirement. Now, here is the IO module-specific information: What I am seeing is that the reply is coming back from the nameserver (confirmed via tcpdump – I can send the captures if you’d like), but the UDP packets are sitting in the process’s UDP receive queue pending reception by Net::DNS (the approx 1752 bytes per response stay queued waiting for $sel-can_read()): root@cwb-2-11:~# netstat -una Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State udp 1752 0 0.0.0.0:52680 0.0.0.0:* root@cwb-2-11:~# netstat -una Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State udp 5256 0 0.0.0.0:52680 0.0.0.0:* If I force $sock[AF_INET]-recv($buf, $self-_packetsz) around line 803 of /usr/lib/perl5/5.10/Net/DNS/Resolver/Base.pm, instead of waiting for IO::Select’s can_read() function ( @ready = $sel-can_read($timeout)) to populate @ready, the response is received and processed. Any idea what could be causing this issue? In a possibly related matter, I noticed in another script that the following code fails in the same manner (network responses stay in the process’s TCP receive queue) with the new system: $sock = new IO::Socket::INET( PeerAddr => "$server", PeerPort => 37, Proto => 'tcp', Timeout => 5 ); Whereas the following code works: $sock = new IO::Socket::INET( PeerAddr => "$server", PeerPort => 37, Proto => 'tcp' ); I have looked through the NET::DNS code and don’t see a timeout passed for the UDP sockets, so I am not sure if that this is related or not. Please let me know if I can provide you with any further information in order to help diagnose this issue. Thanks! -Rich

    Read the article

1