Search Results

Search found 1033 results on 42 pages for 'nm applet'.

Page 30/42 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • Cannot connect to network

    - by dany
    I have a problem: I am on Debian. I configured my nic with a static ip (192.168.1.56). When I try to connect to a network, initially with ifconfig eth2 I get (correctly): eth2 inet addr:192.168.1.56 .... inet6 addr: fe80:221:ff:fe96:4598/64 but after a few seconds the 192.168.1.56 disappears and after some other seconds disappears the inet6 address too. When I press in the nm-applet it requires me the password but in the meantime it try to connect. At uni, the connection is a DHCP one. It works for the first few seconds but after it doesn't. Any possible solution? Here it is the relevant part of the syslog: (static ip configuration) http://pastebin.com/u3BPAsda

    Read the article

  • impossible to connect.. days trying..

    - by dany
    I have a problem: I am on Debian. I configured my nic with a static ip (192.168.1.56). When I try to connect to a network, initially with ifconfig eth2 I get (correctly): eth2 inet addr:192.168.1.56 .... inet6 addr: fe80:221:ff:fe96:4598/64 but after a few seconds the 102.168.1.56 disappears and after some other seconds disappears the inet6 address too. When I press in the nm-applet it requires me the password but in the meantime it try to connect. At uni, the connection is a DHCP one. It works for the first few seconds but after it doesn't. Any possible solution? Here it is the relevant part of the syslog: (static ip configuration) http://pastebin.com/u3BPAsda

    Read the article

  • How do I know if my Xeon Processor supports hardware virtualisation?

    - by gshankar
    I've been scouring the net (mainly the wikipaedia lists and intel's site. I even pulled out the datasheet for my processor) but I can't seem to answer this question. Does my Xeon support hardware virtualisation? The processor in question is a: "Nocona" (standard-voltage, 90 nm) 2800MHz. Other details can be found here: http://en.wikipedia.org/wiki/List_of_Intel_Xeon_microprocessors#.22Nocona.22_.28standard-voltage.2C_90_nm.29 I'm pretty sure the answer is no as it's a pretty old server but I can't find a single place which has a definitive yes/no answer so I'm still looking...

    Read the article

  • Connect to a particular network connection from terminal

    - by RanRag
    I am currently using Reliance netconnect USB modem. The problem I am facing is my USB modem disconnects itself at 22:00 PM IST everyday. Now, sometimes what I do is start some downloading and leave my laptop for 2-3 hours in this case if my network disconnects it is a problem for me. So, what I used to do in windows is make a python script and execute rasdial myconnection_name to automate the connection process in my absence. Now I want to achieve something similar in linux. So, what are my alternatives for rasdial like tool in linux to automatically connect to a particular connection . I am using ubuntu 12.04 and here is my nm-tool output.

    Read the article

  • Xubuntu 12.04: Slow Login

    - by naxchange
    I'm running Xubuntu 12.04, and after I ran the update, my login started slowing down big time. I've dabbled a little bit with the programs in Settings - Settings Manager - Session and Startup, and tried closing and opening these programs, and then rebooting. Anyways, I narrowed it down to a combination of 2 processes, "Network" (the connection manager) and "Xfce Volume Daemon". Their corresponding terminal commands are: ~$ nm-applet ~$ xfce4-volumed If I disable them, and then run them after login is complete, everything works just fine. Is there a way for me to run these commands automatically at start up? I want to maybe write a shell script and save it somewhere, or at least edit the order things happen after login, so the desktop can load before these processes. Hope I've been clear enough, and thanks in advance! NAX

    Read the article

  • Unable to connect to wireless internet(wifi) through KDE plasma desktop

    - by Mohammed Arafat Kamaal
    I installed the KDE plasma desktop through Ubuntu software center. I am on Ubuntu Lucid Lynx. After the install, Im unable to connect to my wifi connection in the KDE session. But I can connect to my wifi perfectly through GNOME session. I've tried a lot without much success. Also KDE doesn't store my password correctly and keeps prompting for authorization again and again. Some of the things that I noticed. Network is detected, Network name and strength is also displayed. Other characteristics also appear properly. When the credentials are supplied, it accepts them and continually displays the message "Setting network address". However this process never succeeds. At this stage the password is repeatedly asked many times but the connection is never established. Some of the other things that I did, I have also tried other things like restarting my modem and the computer. That didn't work. I tried to restart nm-applet and KNetworkManager. That didn't work either. ifconfig display all my interfaces and Mac addresses correctly. Since its working fine GNOME the drivers are fine. This is sure a KDE specific issue. Other threads related to this on the interwebs don't offer much information either. Please share a solution for this.

    Read the article

  • Why are two indicator-network versions being worked on?

    - by Daniel Rodrigues
    Some months ago, on the road to Ubuntu Maverick, a new system indicator, network (with connman as a backend), started to be developed. The plan was to get it into UNE and release it with no notifcation area. Unfortunately it didn't make it into the final version. However, continued efforts are still being made to improve it, and I'm getting regular updates. From a blueprint from the last UDS, I read that the plan was to ship no notification area and only indicators. For that, it was defined that nm-applet (backend: NetworkManager) should be ported to the appindicator library. Today I discovered that those efforts are going on and a initial version is available for testing, available from Matt Trudel PPA (Natty only). So, my questions is, to whoever has the necessary info: wouldn't it be easier to join efforts and concentrate the work in just one version (probably NetworkManager backend, as that's the official plan), instead of breaking those efforts apart and hampering both testing and developing? Both indicators are being developed by Canonical engineers, and that really doesn't make much sense. So, any Canonical engineer willing to clarify this?

    Read the article

  • Small adventure game

    - by Nick Rosencrantz
    I'm making a small adventure game where the player can walk through Dungeons and meet scary characters: The whole thing is 20 java classes and I'm making this a standalone frame while it could very well be an applet I don't want to make another applet since I might want to recode this in C/C++ if the game or game engine turns out a success. The engine is the most interesting part of the game, it controls players and computer-controlled characters such as Zombies, Reptile Warriors, Trolls, Necromancers, and other Persons. These persons can sleep or walk around in the game and also pick up and move things. I didn't add many things so I suppose that is the next thing to do is to add things that can get used now that I already added many different types of walking persons. What do you think I should add and do with things in the game? The things I have so far is: package adventure; /** * The data type for things. Subclasses will be create that takes part of the story */ public class Thing { /** * The name of the Thing. */ public String name; /** * @param name The name of the Thing. */ Thing( String name ) { this.name = name; } } public class Scroll extends Thing { Scroll (String name) { super(name); } } class Key extends Thing { Key (String name) { super(name); } } The key is the way to win the game if you figure our that you should give it to a certain person and the scroll can protect you from necromancers and trolls. If I make this game more Dungeons and Dragons-inspired, do you think will be any good? Any other ideas that you think I could use here? The Threadwhich steps time forward and wakes up persons is called simulation. Do you think I could do something more advanced with this class? package adventure; class Simulation extends Thread { private PriorityQueue Eventqueue; Simulation() { Eventqueue = new PriorityQueue(); start(); } public void wakeMeAfter(Wakeable SleepingObject, double time) { Eventqueue.enqueue(SleepingObject, System.currentTimeMillis()+time); } public void run() { while(true) { try { sleep(5); //Sov i en halv sekund if (Eventqueue.getFirstTime() <= System.currentTimeMillis()) { ((Wakeable)Eventqueue.getFirst()).wakeup(); Eventqueue.dequeue(); } } catch (InterruptedException e ) { } } } } And here is the class that makes up the actual world: package adventure; import java.awt.*; import java.net.URL; /** * Subklass to World that builds up the Dungeon World. */ public class DungeonWorld extends World { /** * * @param a Reference to adventure game. * */ public DungeonWorld(Adventure a) { super ( a ); // Create all places createPlace( "Himlen" ); createPlace( "Stairs3" ); createPlace( "IPLab" ); createPlace( "Dungeon3" ); createPlace( "Stairs5" ); createPlace( "C2M2" ); createPlace( "SANS" ); createPlace( "Macsal" ); createPlace( "Stairs4" ); createPlace( "Dungeon2" ); createPlace( "Datorsalen" ); createPlace( "Dungeon");//, "Ljushallen.gif" ); createPlace( "Cola-automaten", "ColaAutomat.gif" ); createPlace( "Stairs2" ); createPlace( "Fable1" ); createPlace( "Dungeon1" ); createPlace( "Kulverten" ); // Create all connections between places connect( "Stairs3", "Stairs5", "Down", "Up" ); connect( "Dungeon3", "SANS", "Down", "Up" ); connect( "Dungeon3", "IPLab", "West", "East" ); connect( "IPLab", "Stairs3", "West", "East" ); connect( "Stairs5", "Stairs4", "Down", "Up" ); connect( "Macsal", "Stairs5", "South", "Norr" ); connect( "C2M2", "Stairs5", "West", "East" ); connect( "SANS", "C2M2", "West", "East" ); connect( "Stairs4", "Dungeon", "Down", "Up" ); connect( "Datorsalen", "Stairs4", "South", "Noth" ); connect( "Dungeon2", "Stairs4", "West", "East" ); connect( "Dungeon", "Stairs2", "Down", "Up" ); connect( "Dungeon", "Cola-automaten", "South", "North" ); connect( "Stairs2", "Kulverten", "Down", "Up" ); connect( "Stairs2", "Fable1", "East", "West" ); connect( "Fable1", "Dungeon1", "South", "North" ); // Add things // --- Add new things here --- getPlace("Cola-automaten").addThing(new CocaCola("Ljummen cola")); getPlace("Cola-automaten").addThing(new CocaCola("Avslagen Cola")); getPlace("Cola-automaten").addThing(new CocaCola("Iskall Cola")); getPlace("Cola-automaten").addThing(new CocaCola("Cola Light")); getPlace("Cola-automaten").addThing(new CocaCola("Cuba Cola")); getPlace("Stairs4").addThing(new Scroll("Scroll")); getPlace("Dungeon3").addThing(new Key("Key")); Simulation sim = new Simulation(); // Load images to be used as appearance-parameter for persons Image studAppearance = owner.loadPicture( "Person.gif" ); Image asseAppearance = owner.loadPicture( "Asse.gif" ); Image trollAppearance = owner.loadPicture( "Loke.gif" ); Image necromancerAppearance = owner.loadPicture( "Necromancer.gif" ); Image skeletonAppearance = owner.loadPicture( "Reptilewarrior.gif" ); Image reptileAppearance = owner.loadPicture( "Skeleton.gif" ); Image zombieAppearance = owner.loadPicture( "Zombie.gif" ); // --- Add new persons here --- new WalkingPerson(sim, this, "Peter", studAppearance); new WalkingPerson(sim, this, "Zombie", zombieAppearance ); new WalkingPerson(sim, this, "Zombie", zombieAppearance ); new WalkingPerson(sim, this, "Skeleton", skeletonAppearance ); new WalkingPerson(sim, this, "John", studAppearance ); new WalkingPerson(sim, this, "Skeleton", skeletonAppearance ); new WalkingPerson(sim, this, "Skeleton", skeletonAppearance ); new WalkingPerson(sim, this, "Skeleton", skeletonAppearance ); new WalkingPerson(sim, this, "Sean", studAppearance ); new WalkingPerson(sim, this, "Reptile", reptileAppearance ); new LabAssistant(sim, this, "Kate", asseAppearance); new LabAssistant(sim, this, "Jenna", asseAppearance); new Troll(sim, this, "Troll", trollAppearance); new Necromancer(sim, this, "Necromancer", necromancerAppearance); } /** * * The place where persons are placed by default * *@return The default place. * */ public Place defaultPlace() { return getPlace( "Datorsalen" ); } private void connect( String p1, String p2, String door1, String door2) { Place place1 = getPlace( p1 ); Place place2 = getPlace( p2 ); place1.addExit( door1, place2 ); place2.addExit( door2, place1 ); } } Thanks

    Read the article

  • How to find out which python script is using resources?

    - by Jesse the Wind Wanderer
    Can someone tell me how to find out which python script is using lots of system resources? I can see with the 'top' command that a process called "python" is always near the top of the list. 2603 jesse 20 0 159m 27m 13m S 6 1.4 1:47.74 python Can someone tell me how to find this specific python script's name? I could go through the arduous process of disabling startup apps/processes until I finally found the one that starts this python process but there must be a better way of determining what exactly this python process is, yes? Doing a ps -AH doesn't yield anything useful. ps -AH 1 ? 00:00:00 init ... 1325 ? 00:00:00 lightdm 1382 tty7 00:01:57 Xorg 2265 ? 00:00:00 lightdm 2510 ? 00:00:00 gnome-session 2546 ? 00:00:00 ssh-agent 2560 ? 00:00:02 gnome-settings- 2582 ? 00:00:01 syndaemon 2578 ? 00:00:49 compiz 3009 ? 00:00:00 sh 3010 ? 00:00:01 gtk-window-deco 2590 ? 00:00:00 nm-applet 2591 ? 00:00:00 bluetooth-apple 2592 ? 00:00:00 indicator-ubunt 2593 ? 00:00:00 gnome-fallback- 2600 ? 00:00:05 nautilus 2601 ? 00:00:00 everpad 2603 ? 00:02:24 python

    Read the article

  • Android device unable to obtain ip address connecting to AP created with Hostapd

    - by user114392
    I have a wired internet connection that works behind an authenticated proxy server. I followed the steps mentioned here and managed to create a hotspot which my google nexus 7 detects. However, it seems stuck at "obtaining an ip address" and is not able to connect to the internet. I initially received the following error message when running the script in the terminal: dnsmasq: failed to create listening socket for 127.0.0.1: Address already in use [fail] I figured it is because of a conflict with the network manager, I commented out the "dns=dnsmasq" line in the nm configuration file. After a network-manager restart, the first error doesn't show up but I get the following: Configuration file: /etc/hostapd.conf Failed to create interface mon.wlan0: -23 (Too many open files in system) Try to remove and re-create mon.wlan0 In both cases, however, the hotspot is created and is detected by my android device. only that it cannot "obtain an ip address" and connect to it. Is it because my eth0 connects via a proxy server? Or could there be something wrong with the dnsmasq config? Any help would be appreciated.

    Read the article

  • How do I stop my ethernet network connection from dropping?

    - by Sean Hill
    My ethernet-based network connection doesn't stay up consistently. I'm running a ping against the gateway and it will: Work for a minute Freeze, time out, or give multi-second response times Repeat If it's stuck and I disable/enable networking through the network manager applet everything will work fine again for a minute. After 280 packets transmitted I'm getting 41% packet loss. I've tried a different cable and connection to the gateway but this had no effect. The distance to the gateway is just about 3 feet. Seems to work fine if I switch over to Windows, but Ubuntu is my main OS and I can't even use it right now as I depend on the network. My setup... OS: Ubuntu 11.04, dual-booting Windows 7 Mobo: Gigabyte Z68X-UD4-B3 CPU: Intel Core i7 2600K Edit A little clarification... Network Manager is still showing me as connected, but I am unable to reach to gateway or anything beyond. At no point does NM suggest the connection is lost and calling ifconfig shows that I still have an IP address. I tried connecting to a different gateway with a different cable and the same problem arises. As requested: lspci | grep -i eth 07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06) dmesg | tail -f [ 14.024709] EXT4-fs (sda5): re-mounted. Opts: errors=remount-ro,commit=0 [ 14.026443] EXT4-fs (sda7): re-mounted. Opts: commit=0 [ 14.176101] hda-intel: IRQ timing workaround is activated for card #2. Suggest a bigger bdl_pos_adj. [ 23.917731] eth0: no IPv6 routers present [ 726.109697] r8169 0000:07:00.0: eth0: link up [ 733.169494] r8169 0000:07:00.0: eth0: link up [ 753.930119] r8169 0000:07:00.0: eth0: link up [ 880.787332] r8169 0000:07:00.0: eth0: link up [ 1159.161283] r8169 0000:07:00.0: eth0: link up [ 1406.623550] r8169 0000:07:00.0: eth0: link up Edit @roland-taylor: Network is always available under Windows. Pings do not timeout, applications do not complain of no network availability, large downloads are not interrupted or slowed.

    Read the article

  • BCM4306, b43 legacy driver installed, but "firmware missing" error

    - by ScrollerBlaster
    I have the following wireless hardware on a Compaq evo N600c laptop running lubuntu latest. ciaran@compaq:~$ lspci -vvnn | grep 14e4 03:00.0 Network controller [0280]: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller [14e4:4320] (rev 03) Following the instructions from here : http://www.linuxwireless.org/en/users/Drivers/b43#b43_and_b43legacy I opted for the legacy firmware installer, following instructions for internet install to the letter (with no errors). i.e. I successfully installed sudo apt-get install firmware-b43legacy-installer In the nm-applet I now get Wireless networks device not ready (firmware missing) I open up Additional Drivers, but the list is empty. I have commented out this line in /etc/modprobe.d/blacklist.conf #blacklist bcm43xx Contents of firmware dir: ciaran@compaq:/etc/modprobe.d$ sudo ls /lib/firmware/b43legacy/ [sudo] password for ciaran: a0g0bsinitvals2.fw a0g0initvals5.fw b0g0bsinitvals2.fw b0g0initvals5.fw ucode11.fw ucode5.fw a0g0bsinitvals5.fw a0g1bsinitvals5.fw b0g0bsinitvals5.fw pcm4.fw ucode2.fw a0g0initvals2.fw a0g1initvals5.fw b0g0initvals2.fw pcm5.fw ucode4.fw Edit: from dmesg: [ 4460.193382] b43-phy0 ERROR: Firmware file "b43/ucode5.fw" not found [ 4460.193393] b43-phy0 ERROR: Firmware file "b43-open/ucode5.fw" not found [ 4460.193401] b43-phy0 ERROR: You must go to http://wireless.kernel.org/en/users/Drivers/b43#devicefirmware and download the correct firmware for this driver version. Please carefully read all instructions on this website. Yours in hope.

    Read the article

  • [Kubuntu 14.04][Eclipse] (ADT) crashes at button OK from Project properties

    - by nouseforname
    Since i upgraded to kubuntu 14.04, my Eclipse crashes at different situations. Mostly i can "simulate" it when going to project properties and press ok. Then it always crashes. My system: DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS" My Java: java version "1.8.0_05" Java(TM) SE Runtime Environment (build 1.8.0_05-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode) My ADT Version: Android Development Toolkit Version: 23.0.0.1245622 I already tried to add this in adt-bundle-linux-x86_64/eclipse/configuration/configuration.ini org.eclipse.swt.browser.DefaultType=mozilla -Dorg.eclipse.swt.browser.DefaultType=mozilla Error: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007fe049eb1718, pid=5964, tid=140601811232512 # # JRE version: Java(TM) SE Runtime Environment (8.0_05-b13) (build 1.8.0_05-b13) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode linux-amd64 compressed oops) # Problematic frame: # C [libgobject-2.0.so.0+0x19718] g_object_get_qdata+0x18 # # Core dump written. Default location: /home/maddin/core or core.5964 # # An error report file with more information is saved as: # /home/maddin/hs_err_pid5964.log Compiled method (nm) 28866 4166 n 0 org.eclipse.swt.internal.gtk.OS::_g_object_get_qdata (native) total in heap [0x00007fe051da6790,0x00007fe051da6af0] = 864 relocation [0x00007fe051da68b0,0x00007fe051da68f8] = 72 main code [0x00007fe051da6900,0x00007fe051da6ae8] = 488 oops [0x00007fe051da6ae8,0x00007fe051da6af0] = 8 # # If you would like to submit a bug report, please visit: # http://bugreport.sun.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Now, as soon as i change SystemSettings - Application Apperance - GTK - GTKn-Design to something else but "oxygen-gtk" this crash doesn't happen anymore. But the application appearance also is ugly. Beside that i get a lot of errors/warnings like that: (SWT:6148): GLib-GObject-CRITICAL **: g_closure_add_invalidate_notifier: assertion 'closure->n_inotifiers < CLOSURE_MAX_N_INOTIFIERS' failed or other GTK warnings from the particular design, not having theme-engine. Which actually doesn't cause any crahs it seems so far. So i have 3 options: accept crashes accept warnings (maybe the best choice) accept ugly design What can i do to solve this issue without changing the design settings?

    Read the article

  • Kubuntu 12.04 - DNS Issues

    - by AndrewJesaitis
    Starting yesterday (6/11/12), I've been having many network problems. When requesting a page in chrome, the page hangs on "Sending request" and then will eventually timeout. I'm within a VPN that has it's own DNS server. I've tried to manually set my DNS through the Network-Manager applet and by editing /etc/network/interfaces. Having no luck I unlinked the resolv.conf file and dumped the contents of my old resolv.conf into it. Again having no luck, I deactivated the dnsmasq server in /etc/NetworkManager/NetworkManager.conf by commenting out the dns=dnsmasq. $ cat NetworkManager.conf [main] plugins=ifupdown,keyfile #dns=dnsmasq no-auto-default=D0:67:E5:EA:B6:6B, [ifupdown] managed=false $ nm-tool NetworkManager Tool State: connected (global) - Device: eth0 [Wired connection 1] ------------------------------------------- Type: Wired Driver: tg3 State: connected Default: yes HW Address: D0:67:E5:EA:B6:6B Capabilities: Carrier Detect: yes Speed: 1000 Mb/s Wired Properties Carrier: on IPv4 Settings: Address: 192.168.254.122 Prefix: 24 (255.255.255.0) Gateway: 192.168.254.2 DNS: 192.168.254.1 What is strange is that the network will work fine for a few minutes then start to timeout. A few minutes later it will work again. I'm unable to hit internal or external sites when it is timing out. When I $dig local sites, I receive no answer. I do receive an answer from google.com. At this point, I would usually blame the DNS Server, especially since when I change to Google's DNS server things work. But, I need to use our internal DNS to hit our internal sites. Nobody else is having issues and they are all using DHCP. This group includes one user who is using 11.04. At this point, I'm at a loss for what to do, so any help would be appreciated.

    Read the article

  • Ubuntu 12.04 connected to wireless network but internet not working

    - by A.J.
    I can connect to my house's wireless network just fine, but when I'm connected I can't browse the web. Firefox starts connecting to a site and then just poops out. This doesn't happen on my roommates' computers (running Windows) or on our 3DSes, so I know it's just my laptop. I already tried sudo dhclient -r sudo dhclient sudo ifconfig eth0 down sudo ifconfig eth0 up Results of a few commands I was asked to run in comments: ping -c 2 4.2.2.2 PING 4.2.2.2 (4.2.2.2) 56(84) bytes of data. ^C --- 4.2.2.2 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1007ms ping -c 2 google.com PING google.com (173.194.33.38) 56(84) bytes of data. --- google.com ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1006ms nm-tool NetworkManager Tool State: connected (global) - Device: eth0 ----------------------------------------------------------------- Type: Wired Driver: atl1c State: unavailable Default: no HW Address: 88:AE:1D:6B:4E:E7 Capabilities: Carrier Detect: yes Speed: 100 Mb/s Wired Properties Carrier: off - Device: wlan0 [JUSTICE] ----------------------------------------------------- Type: 802.11 WiFi Driver: ath9k State: connected Default: yes HW Address: 1C:65:9D:65:C6:31 Capabilities: Speed: 1 Mb/s Wireless Properties WEP Encryption: yes WPA Encryption: yes WPA2 Encryption: yes Wireless Access Points (* = current AP) HOME-9B18: Infra, 00:26:F3:53:9B:18, Freq 2412 MHz, Rate 54 Mb/s, Strength 34 WPA WPA2 cougdad48 Network: Infra, 60:33:4B:E4:C4:5D, Freq 2437 MHz, Rate 54 Mb/s, Strength 22 WPA2 cougdad48 Guest Network: Infra, 66:33:4B:E4:C4:5D, Freq 2437 MHz, Rate 54 Mb/s, Strength 20 WPA2 belkin.ade: Infra, 94:44:52:FF:8A:DE, Freq 2457 MHz, Rate 54 Mb/s, Strength 20 WPA WPA2 *JUSTICE: Infra, 00:24:01:7B:9F:7E, Freq 2462 MHz, Rate 54 Mb/s, Strength 88 WEP CenturyLink: Infra, B2:B2:DC:8E:E2:58, Freq 2462 MHz, Rate 54 Mb/s, Strength 17 WPA WPA2 IPv4 Settings: Address: 192.168.0.11 Prefix: 24 (255.255.255.0) Gateway: 192.168.0.1 DNS: 192.168.0.1 (JUSTICE is my home's network.) ping -c 2 198.168.0.1 PING 198.168.0.1 (198.168.0.1) 56(84) bytes of data. --- 198.168.0.1 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1007ms

    Read the article

  • C++ Numerical Recipes &ndash; A New Adventure!

    - by JoshReuben
    I am about to embark on a great journey – over the next 6 weeks I plan to read through C++ Numerical Recipes 3rd edition http://amzn.to/YtdpkS I'll be reading this with an eye to C++ AMP, thinking about implementing the suitable subset (non-recursive, additive, commutative) to run on the GPU. APIs supporting HPC, GPGPU or MapReduce are all useful – providing you have the ability to choose the correct algorithm to leverage on them. I really think this is the most fascinating area of programming – a lot more exciting than LOB CRUD !!! When you think about it , everything is a function – we categorize & we extrapolate. As abstractions get higher & less leaky, sooner or later information systems programming will become a non-programmer task – you will be using WYSIWYG designers to build: GUIs MVVM service mapping & virtualization workflows ORM Entity relations In the data source SharePoint / LightSwitch are not there yet, but every iteration gets closer. For information workers, managed code is a race to the bottom. As MS futures are a bit shaky right now, the provider agnostic nature & higher barriers of entry of both C++ & Numerical Analysis seem like a rational choice to me. Its also fascinating – stepping outside the box. This is not the first time I've delved into numerical analysis. 6 months ago I read Numerical methods with Applications, which can be found for free online: http://nm.mathforcollege.com/ 2 years ago I learned the .NET Extreme Optimization library www.extremeoptimization.com – not bad 2.5 years ago I read Schaums Numerical Analysis book http://amzn.to/V5yuLI - not an easy read, as topics jump back & forth across chapters: 3 years ago I read Practical Numerical Methods with C# http://amzn.to/V5yCL9 (which is a toy learning language for this kind of stuff) I also read through AI a Modern Approach 3rd edition END to END http://amzn.to/V5yQSp - this took me a few years but was the most rewarding experience. I'll post progress updates – see you on the other side !

    Read the article

  • Connected to wireless, but no internet access

    - by boogaloo
    After installing Ubuntu 12.04 a week ago wireless internet had been working fine. It stopped working yesterday, however, and I'm at a loss for what to do even after scouring replies to similar posted problems. I have tried using Google's public DNS and turning off proxy settings on Firefox. I have used nm-tool and lshw to make sure my wireless device and driver are connected. If anyone can help me resolve this issue I would be extremely grateful! @kregerjd $ ping -c3 www.google.com ping: unknown host www.google.com @Alaa: $ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0 169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0 192.168.1.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan0 $ ping -c4 192.168.1.1 PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data From 192.168.1.104 icmp_seq=1 Destination Host Unavailable From 192.168.1.104 icmp_seq=2 Destination Host Unavailable --- 192.168.1.1 ping statistics --- 4 packets transmitted, 0 received, +2 errors, 100% packet loss, time 2998ms pipe 4

    Read the article

  • X-notifier doesn't work in Chromium Browser

    - by cipricus
    It just keeps checking in vain. Also cannot import or export data, but get this error I use the latest versions of both in Lubuntu 12.04. In Google Chrome it works. What could it be the problem? Edit - following vasa1's comment - running sudo aa-status i get apparmor module is loaded. 16 profiles are loaded. 16 profiles are in enforce mode. /sbin/dhclient /usr/bin/evince /usr/bin/evince-previewer /usr/bin/evince-previewer//launchpad_integration /usr/bin/evince-previewer//sanitized_helper /usr/bin/evince-thumbnailer /usr/bin/evince-thumbnailer//sanitized_helper /usr/bin/evince//launchpad_integration /usr/bin/evince//sanitized_helper /usr/lib/NetworkManager/nm-dhcp-client.action /usr/lib/connman/scripts/dhclient-script /usr/lib/cups/backend/cups-pdf /usr/lib/lightdm/lightdm/lightdm-guest-session-wrapper /usr/sbin/cupsd /usr/sbin/ntpd /usr/sbin/tcpdump 0 profiles are in complain mode. 3 processes have profiles defined. 3 processes are in enforce mode. /sbin/dhclient (1562) /usr/sbin/cupsd (916) /usr/sbin/ntpd (1695) 0 processes are in complain mode. 0 processes are unconfined but have a profile defined.

    Read the article

  • Fatal X server error: Failed to submit to batchbuffer

    - by Jan
    Ubuntu 10.04 Lucid Lynx used to run fine on my computer. Since a few weeks, my X server crashes out of the blue while the computer is idle and I'm logged into a Gnome session. (I'm then greeted with a new GDM login prompt). After the crash, /var/log/gdm/:0.log.1 has the following: Fatal server error: Failed to submit batchbuffer: Input/output error Please consult the The X.Org Foundation support at http://wiki.x.org for help. ~/.xsession-errors.old has symptoms of X clinets dying: nm-applet: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :0.0. dmesg says: [191848.390081] [drm:i915_hangcheck_elapsed] ERROR Hangcheck timer elapsed... GPU hung [191848.390086] render error detected, EIR: 0x00000010 [191848.390088] IPEIR: 0x00000000 [191848.390090] IPEHR: 0x01800002 [191848.390091] INSTDONE: 0xffffffff [191848.390093] INSTPS: 0x8001e020 [191848.390095] INSTDONE1: 0xbfffffff [191848.390097] ACTHD: 0x0a47b014 [191848.390099] page table error [191848.390100] PGTBL_ER: 0x00000002 [191848.390103] [drm:i915_handle_error] ERROR EIR stuck: 0x00000010, masking [191848.390127] [drm:i915_do_wait_request] ERROR i915_do_wait_request returns -5 (awaiting 5617217 at 5617205) Is this a known problem that can be traced back to the X server from Ubuntu repositories? How would I debug this? Edit: There's a relevant bug on LP.

    Read the article

  • How can I configure the embedded wireless card in a Toshiba Satellite Pro 4600 to work under Lubuntu 10.10?

    - by MoLE
    I'm struggling to get the embedded wireless card in this laptop to work. In 7.10 (gutsy) it worked fine. Now I'm trying to get 10.10 (maverick) working on it, and am using the Lubuntu flavour due to the low resources of this laptop. The hardware: Appears to be an embedded pcmcia card. pccardctl ident gives: Socket 0: product info: "TOSHIBA", "Wireless LAN Card", "Version 01.01", "" manfid: 0x0156, 0x0002 function: 6 (network) The default kernel recognises the card and loads the orinoco_cs driver. orinoco_cs 0.0: Hardware identity 0005:0002:0001:0002 orinoco_cs 0.0: Station identity 001f:0001:0006:000e orinoco_cs 0.0: Firmware determined as Lucent/Agere 6.14 Then for some reason, the driver isn't happy with this and gives: orinoco_cs 0.0: Hardware identity 0005:0002:0001:0002 orinoco_cs 0.0: Station identity 001f:0002:0009:0030 orinoco_cs 0.0: Firmware determined as Lucent/Agere 9.48 All seems ok until I try to associate with my access point using Network Manager. eth1: Lucent/Agere firmware doesn't support manual roaming repeated about 10 times then NM gives up. According to the linuxwireless.org wiki page on this driver, this is a known issue, and I quote: Known issues Roaming and WPA_supplicant Lucent/Agere firmware doesn't support manual roaming On the Agere cards, roaming is controlled by the firmware instead of userspace. You will get the above message if userspace attempts to associate with a specific AP rather than by SSID. If you are using wpa_supplicant use ap_scan=2 mode. NetworkManager uses wpa_supplicant, so the above also applies. At this point my google-fu has failed me, and I can't find how to configure network manager to use the mystical "ap_scan=2" mode via wpa_supplicant. I have tried the following suggested solutions (from launchpad or the forums) deleting the agere* files from /lib/firmware using wicd instead of network manager combining both blacklisting the orinoco_cs driver in an attempt to force use of the hostap_cs driver instead (in case it is a prism2 card). Obviously none of them have worked for me. Any hints on how to perform the suggested workaround above? Edit: I have also confirmed working on 8.10 (intrepid) live CD.

    Read the article

  • How to connect to my own WiFi using Broadcom STA drivers?

    - by Chris
    I'm trying hard to switch to Linux from Windows because of my engineering project. Unfortunately, everything is against that change! Before I have installed Broadcom STA proprietary drivers, I was seeing on NetworkManager and nm-applet only local radio-internet-access networks. After I installed Broadcom STA, I see my neighbor's wireless network (channel 11, WEP) Neither before nor after the installation is own wireless network available. Computer: Asus Lamborghini VX6 Ubuntu: 12.04 LTS 64-bit Router: ASUS N55U (A1) with newest AsusWRT firmware Network: Channel 5 (tried also 10 and 11, both on 20 and 40MHz bands), WPA2 Personal, 2,4 + 5 GHz (what is not very important, 'cause the wlan card in VX6 is only 2,4GHz). Network works fine on Windows, also through D-Link repeater on the other floor. Unfortunately, same network is invisible to Ubuntu on same machine. I have tried some combinations with other GUIs but it did not work. Are there any better drivers for Ubuntu? I need that network badly, but I'm an Ubuntu newbie, so I don't know how to solve that problem. Please help.

    Read the article

  • How do I bridge my wireless to my wired connection?

    - by gatoatigrado
    I want to bridge the wireless connection with the wired connection. The wireless is the host and the wired is the client, so to speak. Internet sharing (inet <--> wifi <--> ethernet) I tried to bridge my ethernet connection by going to network manager edit connections wired edit IPv4 settings shared to other computers Screenshots However, it seems to automatically disconnect half a second after it says "connection established"! edit 2 got the network manager logs, it seems the address is in use. See http://pastebin.com/DjqRshxW , line 45. nm-tool output is here: http://pastebin.com/x5Aci5V1 . I tried firestarter, as mentioned in another thread, and no luck. I don't have time to bother with a dozen command line tricks, unless is copy & pasting a shell script... so please suggest ways that use GUIs and/or won't leave my computer in a confused state (e.g. disabling network manager, manually connecting to a WPA network, installing brutils, etc.). edit: one idea that would work, if it's possible -- is there a way to share connections via SSH and SOCKS5? I'd need to do this at a system-wide level though; I only know how to do it through the browser now. Then, I could run ifconfig eth0 192.168.4.1 on the computer sharing the inet, and ifconfig eth0 192.168.4.2 on the computer I'm trying to share with; I know this does work for host-to-host transfers. edit 3 If I run sudo killall dnsmasq, then nothing is using the 10.42.43.1 address the network manager sharing wants to use. But now it just takes longer to die, with error "NetworkManager[5935]: dnsmasq died with signal 9" [ http://pastebin.com/4FNtpugi ]. Looking at just the commands [ http://pastebin.com/1vrtQeWk ], maybe it's trying to route eth0 to itself? I'm not that familiar with networking things though.

    Read the article

  • Linux, GNU GCC, ld, version scripts and the ELF binary format -- How does it work? [closed]

    - by themoondothshine
    I'm trying to learn more about library versioning in Linux and how to put it all to work. Here's the context: I have two versions of a dynamic library which expose the same set of interfaces, say libsome1.so and libsome2.so. An application is linked against libsome1.so. This application uses libdl.so to dynamically load another module, say libmagic.so. Now libmagic.so is linked against libsome2.so. Obviously, without using linker scripts to hide symbols in libmagic.so, at run-time all calls to interfaces in libsome2.so are resolved to libsome1.so. This can be confirmed by checking the value returned by libVersion() against the value of the macro LIB_VERSION. So I try next to compile and link libmagic.so with a linker script which hides all symbols except 3 which are defined in libmagic.so and are exported by it. This works... Or at least libVersion() and LIB_VERSION values match (and it reports version 2 not 1). However, when some data structures are serialized to disk, I noticed some corruption. In the application's directory if I delete libsome1.so and create a soft link in its place to point to libsome2.so, everything works as expected and the same corruption does not happen. I can't help but think that this may be caused due to some conflict in the run-time linker's resolution of symbols. I've tried many things, like trying to link libsome2.so so that all symbols are alised to symbol@@VER_2 (which I am still confused about because the command nm -CD libsome2.so still lists symbols as symbol and not symbol@@VER_2), but nothing seems to work. What am I doing wrong?

    Read the article

  • Getting problem in collision detection in Java Game

    - by chetans
    Hi I am developing Spaceship Game in which i am getting problem in collision detection of moving images Game has a spaceship and number of asteroids(obstacles) i want to detect the collision between them How can i do this?`package Game; import java.applet.Applet; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Image; import java.awt.MediaTracker; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.net.MalformedURLException; import java.net.URL; public class ThreadInApplet extends Applet implements KeyListener { private static final long serialVersionUID = 1L; Image[] asteroidImage; Image spaceshipImage; int[] XPosObst,YPosObst; int numberOfObstacles=0,XPosOfSpaceship,YPosOfSpaceship; int spaceButtnCntr=0,noOfObstaclesLevel=20; boolean gameStart=false,collideUp=false,collideDown=false,collideLeft=false,collideRight=false; private Image offScreenImage; private Dimension offScreenSize,d; private Graphics offScreenGraphics; int speedObstacles=1; String spaceshipImagePath="images/spaceship.png",obstacleImagepath="images/asteroid.png"; String buttonToStart="Press Space to start"; public void init() { try { asteroidImage=new Image[noOfObstaclesLevel]; XPosObst=new int[noOfObstaclesLevel]; YPosObst=new int[noOfObstaclesLevel]; XPosOfSpaceship=getWidth()/2-35; YPosOfSpaceship=getHeight()-100; spaceshipImage=getImage(new URL(getCodeBase(),spaceshipImagePath)); for(int i=0;i<noOfObstaclesLevel;i++) { asteroidImage[i]=getImage(new URL(getCodeBase(),obstacleImagepath)); XPosObst[i]=(int) (Math.random()*700); YPosObst[i]=0; } MediaTracker tracker = new MediaTracker (this); for(int i=0;i<noOfObstaclesLevel;i++) { tracker.addImage (asteroidImage[i], 0); } } catch (MalformedURLException e) { e.printStackTrace(); } setBackground(Color.black); addKeyListener(this); } public void paint(Graphics g) { g.setColor(Color.white); if(gameStart==false) { g.drawString(buttonToStart, (getWidth()/2)-60, getHeight()/2); } g.drawString("HEADfitted Solutions Pvt.Ltd.", (getWidth()/2)-80, getHeight()-20); for(int n=0;n<numberOfObstacles;n++) { if(n>0) g.drawImage(asteroidImage[n],XPosObst[n],YPosObst[n],this); } g.drawImage(spaceshipImage,XPosOfSpaceship,YPosOfSpaceship,this); } @SuppressWarnings("deprecation") public void update(Graphics g) { d = size(); if((offScreenImage == null) || (d.width != offScreenSize.width) || (d.height != offScreenSize.height)) { offScreenImage = createImage(d.width, d.height); offScreenSize = d; offScreenGraphics = offScreenImage.getGraphics(); } offScreenGraphics.clearRect(0, 0, d.width, d.height); paint(offScreenGraphics); g.drawImage(offScreenImage, 0, 0, null); } public void keyReleased(KeyEvent arg0){} public void keyTyped(KeyEvent arg0) {} Thread mainThread=new Thread() { synchronized public void run () { try { //System.out.println("in main thread"); if (gameStart==true) { moveObstacles.start(); if(collide()==false) { createObsThread.start(); } } } catch (Exception e) { e.printStackTrace(); } } }; Thread createObsThread=new Thread() { synchronized public void run () { if (spaceButtnCntr==1) { if (collide()==false) { for(int g=0;g<noOfObstaclesLevel;g++) { try { sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } numberOfObstacles++; } } } } }; Thread moveObstacles=new Thread() // Moving Obstacle images downwards after every 10 ms { synchronized public void run () { while(YPosObst[19]!=600) { if (collide()==false) { //createObsThread.start(); for(int l=0;l } repaint(); try { sleep(10); } catch (InterruptedException e) { e.printStackTrace(); } } } } }; public void keyPressed(KeyEvent e) { if(e.getKeyCode()==32) { gameStart=true; spaceButtnCntr++; if (spaceButtnCntr==1) { mainThread.start(); } } if(gameStart==true) { if(e.getKeyCode()==37 && collideLeft==false)//Spaceship movement left { new Thread () { synchronized public void run () { XPosOfSpaceship-=10; repaint(); } }.start(); } if(e.getKeyCode()==38 && collideUp==false)//Spaceship movement up { new Thread () { synchronized public void run () { YPosOfSpaceship-=10; repaint(); } }.start(); } if(e.getKeyCode()==39 && collideRight==false)//Spaceship movement right { new Thread () { synchronized public void run () { XPosOfSpaceship+=10; repaint(); } }.start(); } if(e.getKeyCode()==40 && collideDown==false)//Spaceship movement down { new Thread () { synchronized public void run () { YPosOfSpaceship+=10; repaint(); } }.start(); } } } /*public boolean collide() { int x0, y0, w0, h0, x2, y2, w2, h2; x0=XPosOfSpaceship; y0=YPosOfSpaceship; h0=spaceshipImage.getHeight(null); w0=spaceshipImage.getWidth(null); for(int i=0;i<20;i++) { x2=XPosObst[i]; y2=YPosObst[i]; h2=asteroidImage[i].getHeight(null); w2=asteroidImage[i].getWidth(null); if ((x0 > (x2 + w2)) || ((x0 + w0) < x2)) return false; System.out.println(x2+" "+y2+" "+h2+" "+w2); if ((y0 > (y2 + h2)) || ((y0 + h0) < y2)) return false; } return true; }*/ public boolean collide() { int x1,y1,x2,y2,x3,y3,x4,y4; //coordinates of obstacles int a1,b1,a2,b2,a3,b3,a4,b4; //coordinates of spaceship a1 =XPosOfSpaceship; b1=YPosOfSpaceship; a2=a1+spaceshipImage.getWidth(this); b2=b1; a3=a1; b3=b1+spaceshipImage.getHeight(this); a4=a2; b4=b3; for(int a=0;a if(x1>=a1 && x1<=a2 && x1<=b3 && x1>=b1) return (true); if(x2>=a1 && x2<=a2 && x2<=b3 && x2>=b1) return(true); //********checking asteroid touch spaceship from up direction******** if(y3==b1 && x4>=a1 && x4<=a2) { collideUp = true; return(true); } if(y3==b1 && x3>=a1 && x3<=a2) { collideUp = true; return(true); } //********checking asteroid touch spaceship from left direction****** if(x2==a1 && y4>=b1 && y4<=b3) { collideLeft=true; return(true); } if(x2==a1 && y2>=b1 && y2<=b3) { collideLeft=true; return(true); } //********checking asteroid touch spaceship from right direction***** if(x1==a2 && y3>=b2 && y3<=b4) { collideRight=true; return(true); } if(x1==a2 && y1>=b2 && y1<=b4) { collideRight=true; return(true); } //********checking asteroid touch spaceship from down direction***** if(y1==b3 && x2>=a3 && x2<=a4) { collideDown=true; return(true); } if(y1==b3 && x1>=a3 && x1<=a4) { collideDown=true; return(true); } else { collideUp=false; collideDown=false; collideLeft=false; collideRight=false; } } return(false); } } `

    Read the article

  • Getting problem in threading in JAVA

    - by chetans
    In this program i want to stop GenerateImage & MovingImage Thread both... And i want to start those threads from begining. Can u send me the solution? Here is the code........ package Game; import java.applet.Applet; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Image; import java.awt.MediaTracker; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.net.MalformedURLException; import java.net.URL; public class ThreadInApplet extends Applet implements KeyListener { private static final long serialVersionUID = 1L; Image[] asteroidImage; Image spaceshipImage; String levelstr="Easy Level"; int[] XPos,YPos; int number=0,XPosOfSpaceship,YPosOfSpaceship,NoOfObstacles=5,speed=1,level=1,spaceBtnPressdCntr=0; boolean gameStart=false,pauseGame=false,collideUp=false,collideDown=false,collideLeft=false,collideRight=false; private Image offScreenImage; private Dimension offScreenSize; private Graphics offScreenGraphics; Thread GenerateImages,MoveImages; public void init() { try { GenerateImages=new Thread () //thread to create obstacles { synchronized public void run () { for(int g=0;g<NoOfObstacles;g++) { try { sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } number++; // Temporary counter to count the no of obstacles created } } } ; MoveImages=new Thread () //thread to move obstacles { @SuppressWarnings("deprecation") synchronized public void run () { while(YPos[NoOfObstacles-1]!=600) { pauseGame=false; if(collide()==true) { GenerateImages.suspend(); repaint(); } else GenerateImages.resume(); for(int l=0;l<number;l++) { if(collide()==false) YPos[l]++; else GenerateImages.suspend(); } repaint(); try { sleep(speed); } catch (InterruptedException e) { e.printStackTrace(); } } if(YPos[NoOfObstacles-1]>=600) //level complete state { level++; try { levelUpdation(level); System.out.println("aahe"); } catch (MalformedURLException e) { e.printStackTrace(); } repaint(); } } }; initialPos(); spaceshipImage=getImage(new URL(getCodeBase(),"images/space.png")); for(int i=0;i<NoOfObstacles;i++) { asteroidImage[i]=getImage(new URL(getCodeBase(),"images/asteroid.png")); XPos[i]=(int) (Math.random()*700); YPos[i]=0; } MediaTracker tracker = new MediaTracker (this); for(int i=0;i<NoOfObstacles;i++) { tracker.addImage (asteroidImage[i], 0); } } catch (MalformedURLException e) { e.printStackTrace(); } setBackground(Color.black); addKeyListener(this); } //Sets initial positions of spaceship & obstacle images------------------------------------------------------ public void initialPos() throws MalformedURLException { asteroidImage=new Image[NoOfObstacles]; XPos=new int[NoOfObstacles]; YPos=new int[NoOfObstacles]; XPosOfSpaceship=getWidth()/2-35; YPosOfSpaceship=getHeight()-100; collideUp = false; collideDown=false; collideLeft=false; collideRight=false; } //level finished updations------------------------------------------------------------------------------ @SuppressWarnings("deprecation") public void levelUpdation(int level) throws MalformedURLException { NoOfObstacles=NoOfObstacles+20; speed=speed-3; System.out.println(NoOfObstacles+" "+speed); pauseGame=true; initialPos(); repaint(); } //paint method of graphics to print the messages--------------------------------------------------------- public void paint(Graphics g) { g.setColor(Color.white); if(gameStart==false) { g.drawString("SPACE to start", (getWidth()/2)-15, getHeight()/2); g.drawString(levelstr, (getWidth()/2), getHeight()/2+20); } if(level>1) { if(level==2) levelstr="Medium Level"; else levelstr="High Level"; g.drawString("Level Complete ", (getWidth()/2)-15, getHeight()/2); g.drawString(levelstr, (getWidth()/2), getHeight()/2+20); //g.drawString("SPACE to start", (getWidth()/2)-15, getHeight()/2+40); } for(int n=0;n<number;n++) { if(n>0) g.drawImage(asteroidImage[n],XPos[n],YPos[n],this); } g.drawImage(spaceshipImage,XPosOfSpaceship,YPosOfSpaceship,this); } //update method of graphics to print the messages--------------------------------------------------------- @SuppressWarnings("deprecation") public void update(Graphics g) { Dimension d = size(); if((offScreenImage == null) || (d.width != offScreenSize.width) || (d.height != offScreenSize.height)) { offScreenImage = createImage(d.width, d.height); offScreenSize = d; offScreenGraphics = offScreenImage.getGraphics(); } offScreenGraphics.clearRect(0, 0, d.width, d.height); paint(offScreenGraphics); g.drawImage(offScreenImage, 0, 0, null); } public void keyReleased(KeyEvent arg0){} public void keyTyped(KeyEvent arg0) {} //---------------------Key pressed event to start game & to move the spaceship-------------------------------------- public void keyPressed(KeyEvent e) { if(e.getKeyCode()==32) { spaceBtnPressdCntr++; if(spaceBtnPressdCntr==1) { gameStart=true; GenerateImages.start(); MoveImages.start(); } } if(gameStart==true) { if(e.getKeyCode()==37) { new Thread () { @SuppressWarnings("deprecation") synchronized public void run () { for(int cnt1=1;cnt1<=10;cnt1++) { if(collide()==true && collideLeft == true) { GenerateImages.suspend(); } else { if(XPosOfSpaceship>0) XPosOfSpaceship--; } } repaint(); } }.start(); } if(e.getKeyCode()==38) { new Thread () { @SuppressWarnings("deprecation") synchronized public void run () { for(int cnt1=1;cnt1<=10;cnt1++) { if(collide()==true && collideUp == true) { GenerateImages.suspend(); } else { if(YPosOfSpaceship>10) YPosOfSpaceship--; } } repaint(); } }.start(); } if(e.getKeyCode()==39) { new Thread () { @SuppressWarnings("deprecation") synchronized public void run () { for(int cnt1=1;cnt1<=10;cnt1++) { if(collide()==true && collideRight == true) { GenerateImages.suspend(); } else { if(XPosOfSpaceship<750) XPosOfSpaceship++; } } repaint(); } }.start(); } if(e.getKeyCode()==40) { new Thread () { @SuppressWarnings("deprecation") synchronized public void run () { for(int cnt1=1;cnt1<=10;cnt1++) { if(collide()==true && collideDown == true) { GenerateImages.suspend(); } else { if(YPosOfSpaceship<550) YPosOfSpaceship++; } } repaint(); } }.start(); } } } //------------------------------Collision checking between Spaceship & obstacles------------------------------ public boolean collide() { int x1,y1,x2,y2,x3,y3,x4,y4; //coordinates of obstacles int a1,b1,a2,b2,a3,b3,a4,b4; //coordinates of spaceship a1 =XPosOfSpaceship; b1=YPosOfSpaceship; a2=a1+spaceshipImage.getWidth(this); b2=b1; a3=a1; b3=b1+spaceshipImage.getHeight(this); a4=a2; b4=b3; for(int a=0;a<number;a++) { x1 =XPos[a]; y1=YPos[a]; x2=x1+asteroidImage[a].getWidth(this); y2=y1; x3=x1; y3=y1+asteroidImage[a].getHeight(this); x4=x2; y4=y3; /********checking asteroid touch spaceship from up direction********/ if(y3==b1 && x4>=a1 && x4<=a2) { collideUp = true; collideDown=false; collideLeft=false; collideRight=false; return(true); } if(y3==b1 && x3>=a1 && x3<=a2) { collideUp = true; collideDown=false; collideLeft=false; collideRight=false; return(true); } /********checking asteroid touch spaceship from left direction******/ if(x2==a1 && y4>=b1 && y4<=b3) { collideLeft=true; collideUp = false; collideDown=false; collideRight=false; return(true); } if(x2==a1 && y2>=b1 && y2<=b3) { collideLeft=true; collideUp = false; collideDown=false; collideRight=false; return(true); } /********checking asteroid touch spaceship from right direction*****/ if(x1==a2 && y3>=b2 && y3<=b4) { collideRight=true; collideLeft=false; collideUp = false; collideDown=false; return(true); } if(x1==a2 && y1>=b2 && y1<=b4) { collideRight=true; collideLeft=false; collideUp = false; collideDown=false; return(true); } /********checking asteroid touch spaceship from down direction*****/ if(y1==b3 && x2>=a3 && x2<=a4) { collideDown=true; collideRight=false; collideLeft=false; collideUp = false; return(true); } if(y1==b3 && x1>=a3 && x1<=a4) { collideDown=true; collideRight=false; collideLeft=false; collideUp = false; return(true); } } return(false); } }

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >