Posts

Showing posts from June, 2014

http - Keeping website open with Python Requests? -

i trying figure out how can keep connection website open. tried using while loop, after url, can see not connected website anymore. how can navigate url, , keep url open entire time while running loop? want loop forever, maybe print data website. here code tried , help! import requests import time url = 'https://www.google.com' s = requests.session() headers = {'user-agent': 'mozilla/5.0 (windows nt 6.1) applewebkit/537.36 (khtml, gecko) chrome/41.0.2228.0 safari/537.36'} r = s.get(url, headers=headers) while true: print str(r) time.sleep(10) what purpose of question? trying achieve holding open connection? i doubt can keep open forever, doing should work, extent. using requests session should ensure http keepalive option set appropriately, , remote server should keep tcp connection open after servicing each http request. if stop sending requests, server timeout connection , close it. the important point must keep making reques

android - Binary XML file line #1: Error inflating class fragment when running map -

i have problemes when executing simple map in android studio, here map activity : package com.dev.boblinux.cador.activities; import android.manifest; import android.content.pm.packagemanager; import android.os.bundle; import android.support.v4.app.activitycompat; import android.support.v4.app.fragmentactivity; import com.dev.boblinux.cador.r; import com.google.android.gms.maps.cameraupdatefactory; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.onmapreadycallback; import com.google.android.gms.maps.supportmapfragment; import com.google.android.gms.maps.model.latlng; public class chomemapctrl extends fragmentactivity implements onmapreadycallback { private googlemap mmap; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_chome_map_ctrl); // obtain supportmapfragment , notified when map ready used. supportmapfragment mapfragment = (supportmapfrag

initialization - python __main__ and __init__ proper usage -

since i'm rather new python particular aspect of language still opaque me. so, assume project contains many files code stuff , 2 "service" files: __init__.py , __main__.py in __init__.py there only: if __name__ == "__main__": import package.__main__ __main__.main() and in __main__.py follows: import package # ok import package2 # ok def main(): package.myfunc1() # can't find reference myfunc1 package2.myfunc2() # can't find reference myfunc2 so question is: why both packages visible while functions inside not? i've read source code google , still can't spot difference between , code. i'm using python 3.5.1 i assume, code in __init__ launch __main__ , __main__ launch rest of functions. upd well, apologies if confused code. idea stand behind __init__.py file created ide when first package added decided fill code found on first github entry(my fault, though can re-used copy-paste). strictly spea

CNAME in Google Cloud DNS -

i have been trying add www.mydomain.net alias mydomain.net . have mx record , ns , soa records auto-added google. i getting cnameresourcerecordsetconflict error: error code "cnameresourcerecordsetconflict" : resource record set 'entity.change.additions[0]' invalid because dns name 'mydomain.net.' may have either 1 cname resource record set or resource record sets of other types, not both. i understand advice error gives me, how can have other records then? need mx , cname both on domain. the problem you're having issue rules of dns , forbid cname record record exists. if cname rr present @ node, no other data should present; ensures data canonical name , aliases cannot different. rule insures cached cname can used without checking authoritative server other rr types. you trying create cname @ record. @ record origin, example.com instance. there @ least 2 records @ origin, soa (start of authority - information

linux - Ubuntu VTK for Python compiled from source -

i compiled vtk 7.0 (6.3 has same effect) on cmake following params: -library_output_path:path="" -cmake_install_prefix:path="/usr/local" -vtk_enable_vtkpython:bool="1" -module_vtkpython:bool="1" - -vtk_group_qt:bool="1" -cmake_objcopy:filepath="/usr/bin/objcopy" -vtk_rendering_backend:string="opengl2" -vtk_install_python_module_dir:path="/usr/local/lib/python2.7/site-packages" -dvtk_egl_device_index:string="0" -vtk_wrap_python:bool="1" -module_vtkguisupportqtopengl:bool="1" now can find binary "vtkpython" @ /usr/local/bin . good news: i allowed enter python shell command "vtkpython" out of directory (/usr/local/bin) needed vtk bindings. markovich@markovich-desktop:~$ cd /usr/local/bin/ markovich@markovich-desktop:/usr/local/bin$ vtkpython vtk version 7.0.0 python 2.7.10 (default, oct 14 2015, 16:09:02) [gcc 5.2.1 20151010] on linux2 type &quo

javascript - Google, Facebook oauth Login for SPA without Page Refresh -

i working on single page radio player web application. want integrate facebook or google oauth login in app. i want radio player continue playing while user login app using oauth login flow. how implement oauth login without page refresh. you can use javascript sdk this, fb.login function: https://developers.facebook.com/docs/reference/javascript/fb.login/ if docs not enough you, here´s tutorial: http://www.devils-heaven.com/facebook-javascript-sdk-login/

javascript - Adding Content to a div -

i using code content page on button click: function getfilter(str){ $.ajax({ type: "get", //path php page data url:"getreceipt.php?table="+str+"", success:function(html){ //here success action //get data on div $("#receipt").html(html); } }); } i use code add innerhtml content same div above content previous code created: function updatecarlist(transaction, results) { //initialise listitems variable var listitems = ""; //get car list holder ul var listholder = document.getelementbyid("receipt"); //clear cars list ul listholder.innerhtml = "receipt<br>"; var i; //iterate through results (i = 0; < results.rows.length; i++) { //get current row var row = results.rows.item(i); listholder.innerhtml += "chair "+row.chair+"-<input type='hidden' id='chair[]

cakephp - Cakepdf generating PDF View -

i have problem cakepdf. can generate .pdfs server, can´t view them in browser. $cakepdf = new \cakepdf\pdf\cakepdf(); $cakepdf->template('view', 'default'); $cakepdf->viewvars($this->viewvars); // pdf string returned $pdf = $cakepdf->output(); echo $pdf; just gives me cryptic code like %pdf-1.3 1 0 obj << /type /catalog /outlines 2 0 r /pages 3 0 r >> endobj 2 0 obj << /type /outlines /count 0 >> endobj 3 0 obj << /type /pages /kids [6 0 r 14 0 r ] /count 2 /resources << /procset 4 0 r /font << /f1 8 0 r /f2 9 0 r >> /xobject << /i1 12 0 r /i2 13 0 r /i3 18 0 r /i4 19 0 r >> >> /mediabox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/pdf /text /imagec ] endobj 5 0 obj << /creator (dompdf) /creationdate (d:20160208165451+00'00') /moddate (d:20160208165451+00'00') >> endobj 6 0 obj << /type /page /parent 3 0 r /annots [ 10 0 r ] /contents 7 0

c# - How to append the file extension .pdf to a String entered by the user? -

i coding program need save texts (from rich text box) pdf. i use itextsharp , code: document doc = new document(itextsharp.text.pagesize.letter, 10, 10, 42, 35); pdfwriter wri = pdfwriter.getinstance(doc, new filestream("titleofpdf.pdf", filemode.create));//textbox1(in form) assign here title of document doc.open(); //open document in order write inside. paragraph paragraph = new paragraph(richtextbox1.text); // adds above created text using different class object our pdf document doc.add(paragraph); doc.close(); i title of file flexible , assigned user (from text box). if change line: pdfwriter wri = pdfwriter.getinstance(doc, new filestream("titleofpdf.pdf", filemode.create)); to: pdfwriter wri = pdfwriter.getinstance(doc, new filestream(textbox1.text, filemode.create)); then works fine, but file hasn't got extension .pdf . how can make title of document flexible user can assign it, , extension .pdf ? thanks user mkl found ans

WCF WPF Web Service Client throwing 404 -

i know there lot of question problem error can not out of . when wrote adress in navigator it's work when call same method in wpf application have 404 error. here it's servicemode of wpf application : <system.servicemodel> <behaviors> <endpointbehaviors> <behavior name="webendpoint"> <webhttp defaultbodystyle="wrapped" defaultoutgoingresponseformat="xml" helpenabled="true"/> </behavior> </endpointbehaviors> </behaviors> <bindings> <webhttpbinding> <binding name="webhttp"> <security mode="none"> <transport clientcredentialtype="none" /> </security> </binding> </webhttpbinding> </bindings> <client> <endpoint binding="webhttpbinding" bindingconfiguration="webhttp"

go: Add writers to io.writer using multiWriter -

i'm new go. have map indicates writers active: var writers map[int]bool i want iterate on map, , create writer represents active writers using multiwriter() i using following code snippet: func setupmultiloggers() { var mw io.writer k, v := range writers { if v != true { continue } switch k { case 0: if mw == nil { mw = writer0 } else { mw = io.multiwriter(mw, writer0) } case 1: if mw == nil { mw = os.stdout } else { mw = io.multiwriter(mw, os.stdout) } case 2: if mw == nil { mw = writer2 } else { io.multiwriter(mw, writer2) } default: } } log.setoutput(mw) } when initializing 3 values of map true , testing writer2, works , doesn't (code in case 2 executes) if use log.setoutput(io.multiwriter(writer0, os.stdout, writer2)) it works expected. i cannot seem understand why orig

java - Executing multiple machines in parallel in thread safe manner -

i have list of hostname executing in parallel using executorservice collect metrics each hostname. , making list has metrics related information hostnames iterating each hostnames future. since executitng multiple hostnames in parallel not sure whether code thread safe or not. this main code executing multiple hostnames in parallel: final flows typeofflow = flows.tree; list<future<machinemetrics>> machinefuturelist = new arraylist<>(); (final string machine : hostnames) { machinefuturelist.add(executorservice.submit(new callable<machinemetrics>() { @override public machinemetrics call() throws exception { machinemetrics machinemetrics = new machinemetrics(); string url = "http://" + machine + ":8080/text"; map<string, string> metrics = getmetrics(machine, url, typeofflow); machinemetrics.setmachinename(machine.split("\\.")[0]); machineme

linux - make scripts run only one instance when a user logs in -

i trying run few bash scripts continually when logged in linux mint install. adding them startup applications doesnt appear work, because not running when check. dont want create multiple instances of scripts adding them .bashrc or cronjob seems out. other suggestions? an example script (warns me when battery below 30%): #!/bin/bash while : #echo "starting script: $(date)">>battery_log percent=$(upower -i /org/freedesktop/upower/devices/battery_bat0| grep -e "percentage" | grep -o '[0-9]\+') cpu_temp=$(cat /sys/class/thermal/thermal_zone0/temp | awk '{print "deg c: "$1/1000}') discharge=$(upower -i /org/freedesktop/upower/devices/battery_bat0| grep -e "state") is_discharging=$(echo $discharge | grep -c discharging) #echo "$percent" #echo "$cpu_temp" #echo hello | grep -c #if [echo $discharge | grep -c discharging -gt 0 ]; #echo "success" #fi #echo "$discharge" if [ &q

ios - Why doesn't my SKAction run properly? -

so have problem skaction dosen't run properly. runs duration of 0.2 of times instant no animation of node moving position. array_dot[j].runaction(skaction.movetoy(premakni_do, duration: 0.2)) more code used. function move sphere nodes 1 place down if place free underneath them (idk if code works kinda :p). 152 on y max low can go. what run through nodes match names move them array, reverse array , move them low can go. mentioned before moving of nodes works, of times (90%) animation doesn't run. not using of physics. func premakni_pike() { array_dot.removeall() var preveri_pozicija: cgfloat = 0 self.enumeratechildnodeswithname("//*") { node, stop in if(node.name == "blue" || node.name == "yellow" || node.name == "red" || node.name == "green") { self.array_dot.append(node) } } let velikost_array = array_dot.count array

java - My PrintWriter is overwriting each line I print. How do I get it to log everything in my program? -

this question has answer here: how append text existing file in java 27 answers when try log failed attempts printwriter overwrites each line in log instead of making multiple lines in log each failed attempt. how remedy this? what's going on it? package hw1; import java.io.file; import java.io.filenotfoundexception; import java.io.printwriter; import java.util.scanner; public class banking { public static void main(string[] args) throws filenotfoundexception { file fi1 = new file("clientinfo.txt"); scanner sc1 = new scanner(fi1); scanner sc2 = new scanner(system.in); scanner sc3 = new scanner(system.in); scanner loginscan = new scanner(system.in); clientrecords[] clientrecordarray = new clientrecords[100]; printwriter logtransaction1 = new printwriter("banklogs.txt"); string firstname; string mi

javascript - Loop through divs and toggle class if another class exists -

i want toggle class (and make text blink using interval) if class found. css .flash { color: #dc4900; } html <div class="text notify">flash</div> <div class="text notify">flash</div> <div class="text">don't flash</div> js $(document).ready(function() { $('.text').each(function() { if ($(this).hasclass('notify')) { setinterval(function() { $(this).toggleclass('flash'); }, 1000); } }); }); https://jsfiddle.net/s9dv9qv3/ the interval not working should. should adding flash class text if class notify found. inside of setinterval callback, this refers window object. to work around this, 1 option capture reference this outside of callback: example here $('.text.notify').each(function() { var self = this; setinterval(function() { $(self).toggleclass('flash'); }, 1000); }); i removed check notify c

How to test app on Edge on Mac OS or Linux -

i on mac os , linux , want test app on edge. know can use browserstack, it's paid service. other ways can test on edge free? if on mac or linux, can use following tools test edge free : virtual machines https://dev.windows.com/en-us/microsoft-edge/tools/vms/windows/ can virtual machines image test edge ie6 ie11 on platforms mac, linux , windows. need have either virtual box, vmware or vagrant install vm image. remoteie https://dev.windows.com/en-us/microsoft-edge/tools/remote/ if don't want install vm image, try remoteie. remote client app small utility program allows access microsoft apps cloud. when launch internet explorer remote client app, real preview version of browser opens new window on operating system, other app might have running. version of internet explorer modified host latest preview version of edgehtml rendering engine, can test how site render in microsoft edge. available mac os x, ios, android , windows os devices, , includes simple

java - Url encoding issue with Jersey Client -

i need make service call such this: http://myservice.com/path?var1=value1&var2=value2 the issue have value1 , value2 ends getting encoded, , makes service call fail. example, value1 "a=b&b=c;2&&="... contains special characters, basically. i guessing issue service fix - handle decoding encoded characters, not think doing. here sample of how making these requests: webtarget target = client.target("http://test.com") .path("path1") .queryparam("var1", var1); builder builder = target.request(); ... what's puzzling me if make same request using chrome, works. makes me believe should have way jersey api of "disabling" encoding. only way have found far use "raw" url use uri. call this uri uri = uri.create("http://localhost/~common~0#/edit?vadf&&sfs&&fdsfd=fs&fsd"); webtarget target = client.target(uri); you request url 1 > http://localhost/~comm

c++ - Draw mulitple objects using OpenGL -

i need draw both square , rectangle in opengl. vertices stored in 2 vertex buffers , bound array buffer follows. however, object bound second object displayed on screen. there way display both together? void application::setupopenglbuffers(void) { float vertexcoords = {0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0}; glgenbuffers(1, &vertexbuffer); glbindbuffer(gl_array_buffer, vertexbuffer); glbufferdata(gl_array_buffer, 2 * 4 * sizeof(float), vertexcoords, gl_static_draw); float vertexcoords2 = {0.0, 0.0, -0.5, 0.0, -0.5, 0.5, 0.0, 0.5}; glgenbuffers(1, &vertexbuffer2); glbindbuffer(gl_array_buffer, vertexbuffer2); glbufferdata(gl_array_buffer, 2 * 4 * sizeof(float), vertexcoords2, gl_static_draw); } void application::drawscene(void) { glbindbuffer(gl_array_buffer, vertexbuffer); glvertexattribpointer(vertattribloc, 2, gl_float, false, 0, 0); glenablevertexattribarray(vertattribloc); gldrawarrays(gl_line_strip, 0, 8); glbindbuffer(gl_array_buff

oracle - Trouble With Basic Query Searching -

not sure if right place ask have question beginner sql. i have table dept , emp include: sql> desc dept; name null? type ----------------------------------------- -------- ---------------------- deptno number(2) dname varchar2(14) loc not null varchar2(13) sql> desc emp; name null? type ----------------------------------------- -------- ---------------------- empno number(4) ename varchar2(10) job varchar2(9) mgr number(4) hiredate date sal number(7,2) comm

it's always going to default in my switch java -

import java.util.scanner; import java.text.decimalformat; import java.util.locale; import java.text.*; import javax.swing.joptionpane; public class project4b { private static final float bagel = 2.00f, donut = 1.50f, croissant = 3.00f; private static final float latte = 1.50f, coffee = 1.25f, milk = 1f, tea = 0.50f; private static int choice, choice2; private static int inflav; private static string flavorstring; public static void main(string[] args) { numberformat moneyformat = numberformat.getcurrencyinstance(locale.us); /* string flavorstring int inflav */ string str1 = joptionpane.showinputdialog(null, "welcome bebe's best breakfast \nchoose breakfast item:\n1 bagel @ " + moneyformat.format(bagel) + "\n2 donut @ " + moneyformat.format(donut) + "\n3 croissant @ " + moneyformat.format(croissant), "input", joptionpane.question_message); choice = integer.parseint(str1); swit

mysql - Cant start phpmyadmin using xampp localhost -

i have tried solutions posted @ folloing link , has not helped me: phpmyadmin - can't connect - invalid setings - ever since added root password - locked out the difference never set password. happened upon initial attempt launch phpmyadmin. here config.inc.php file looks like: /* authentication type */ $cfg['servers'][$i]['auth_type'] = 'http'; $cfg['servers'][$i]['user'] = 'root'; $cfg['servers'][$i]['password'] = ''; /* server parameters */ //$cfg['servers'][$i]['host'] = 'localhost'; //$cfg['servers'][$i]['connect_type'] = 'tcp'; $cfg['servers'][$i]['compress'] = false; $cfg['servers'][$i]['allownopassword'] = false; /** * phpmyadmin configuration storage settings. */ /* user used manipulate storage */ // $cfg['servers'][$i]['controlhost'] = ''; // $cfg['servers'][$i]['controlport&

c++11 - C++ implicit conversion does not work -

been trying c++11 g++ 5.3.1 while... thought understood implicit conversion operators. speaking, if define class3::operator class2() can pass class3 directly function takes class2 . seems work 99% of time... have encountered simple example not case. class class1 {}; class class2 { public: inline friend class1 & operator<<(class1 & a, class2 const& c) {return a;} }; class class3 { public: inline operator class2() const {return class2();} }; void foo(class2 c) {} int main() { class1 c1; class3 c3; // g++ not this: // error: no match 'operator<<' (operand types 'class1' , 'class3') // c1 << c3; // g++ likes these fine: foo(c3); c1 << class2(c3); } any ideas did wrong? please help! thanks. friend functions defined inside class definition, without out-of-class declaration, visible argument-dependent lookup, , if class defined in associated class of 1 of arguments. class2 not asso

scala - If case class inheritance is prohibited, how to represent this? -

i trying create case classes explained in this article sealed abstract case class exp() case class literal(x:int) extends exp case class add(a:exp, b:exp) extends exp case class sub(a:exp,b:exp) extends exp however, getting following error in intellij. understand why prohibited ( why case-to-case inheritance prohibited in scala ). alternate way here? error:(2, 13) case class literal has case ancestor a$a34.a$a34.exp, case-to-case inheritance prohibited. overcome limitation, use extractors pattern match on non-leaf nodes. case class literal(x:int) extends exp ^ exp shouldn't use case keyword. is, sealed abstract case class rarely, if ever, make sense use. in specific case, thing sealed abstract case class exp() auto-generated companion object exp has unapply method. , unapply method won't useful, because there isn't extract generic exp . is, care decomposing add , sub , etc. this fine: sealed abstract class exp case class literal(x

CSS / HTML: Unable to change the height of divs -

this question has answer here: html / css: experiencing issues regarding site width / height 1 answer code ready edit in jsfiddle: https://jsfiddle.net/mkdjetkq/1/ i in process of setting website advertising region people visit task myself. i have spent time attempting place have done far on 1 page. wish there no scrollbars, not want make scrollbars invisible or forth, mean have web page fit on 1 page of browser without user having need scroll aesthetic purposes. i have played around height of divs along number of other things in attempt achieve desired result no success unfortunately. changing height of divs using percentages not me. required change regarding code in order achieve this? css: body,td,th { font-family: consolas, "andale mono", "lucida console", "lucida sans typewriter", monaco, "courier new"

Opening directory remotely C# ASP.NET -

i able open directory on computer locally when deployed website godaddy, can't open. assuming sort of security control. here following actions made: set trust level full in web.config set security full control in c:\ directory here following code open folder created in directory: protected void btnopenfolder_click(object sender, eventargs e) { //path customer's folder string folderpath = @"c:\" + customerid.tostring().padleft(4, '0') + " - " + lblname.text; if (system.io.directory.exists(folderpath)) { //opens customer's folder system.diagnostics.process.start(folderpath); } else { response.write("<script>alert('must have dropbox directory in order open customer folder.');</script>"); } } any suggestions great. in advance!

python 2.7 - AttributeError: instance has no attribute 'function' -

class f: def f1(self, x): return x def f2(self, x): return 2.0*x def f3(self, x, function=f1): return self.function(x) then >>>f0=f() >>>f0.f3(1) the error is: "attributeerror: f instance has no attribute 'function'" how can fix if still wanna f3() select function of f1 or f2 in class? you can use .getattr() : class f: def f1(self, x): return x def f2(self, x): return 2.0 * x def f3(self, x, function="f1"): return getattr(self, function)(x) usage: f0 = f() print(f0.f3(1)) # prints 1 print(f0.f3(1, "f2")) # prints 2.0

ios - NSFetchedResultsController -[__NSArrayM insertObject:atIndex:]: object cannot be nil -

i've done quite bit of research on issue, found nothing lead me solution. attempting use nsfetchedresultscontroller , , getting error when run app: * terminating app due uncaught exception 'nsinvalidargumentexception', reason: '* -[__nsarraym insertobject:atindex:]: object cannot nil' *** first throw call stack: i have found people encountered problem when using estimatedheightforrowatindexpath method, i'm not using it. using exception breakpoint revealed it's crashing @ line in below block of code: let frc = nsfetchedresultscontroller(fetchrequest: fetchrequest, managedobjectcontext: self.managedcontext, sectionnamekeypath: "date.thedate", cachename: nil) . doesn't make past here. i have print statement below never executes. managedobjectcontext exist. frc called first time in viewdidload (code below). i'll include appdelegate code. thanks in advance! here's relevant code: import uikit import coredata class transa

w3c - Which has to be first on a HTML document Doctype or Comment? -

in proper html document, 1 should written first. either doctype or comment. like <!-- copyright (c) 2014 , pvt ltd. @file index.html --> <!doctype html> or <!doctype html> <!-- copyright (c) 2014 , pvt ltd. @file index.html --> 8.1 writing html documents documents must consist of following parts, in given order: optionally, single "bom" (u+feff) character. any number of comments , space characters . a doctype . [...] so shouldn't matter if write first doctype , comment, or viceversa. however, html validator warns if use comment before doctype, ie go quirks mode. better use doctype first.

ios - phpMyAdmin plus app for iphone Format -

Image
i made app takes data database , displays in tableview on application. small issue im having when go php file, displays need see when app gets it, displays "optional" after name of each column. what in phpmyadmin making app reading optional? i added screenshots it represents value of field might nil or present. case is, values can nil or available, ios compiler not sure values presence. when use values in programming, before assigning , operating on values can sure value available there or not below procedure. you can check value individually using if let , remove optional value , operation on if value not nil. //your optionalvalue assigned value. if let value = optionalvalue { //if value present there, remove optional , print value hello. print("hello, \(value)") }else{ //if value nil, print 'value nil' in console. print("value nil") } i hope understand, more clarification , specification pleas

How to escape duplicated value in Jquery each loop? -

i want removed duplicated value when used $.each in jquery . selection of item same value want remove value keep one. function dropdown(data, selectorid) { var selector = '<select style="width: 400px;" id="results">'; if (data == '') { selector += '<option value="0">no reference</option>'; } else { selector += '<option value="0">choose reference</option>'; $.each(data, function (i, val) { selector += '<option value=' + val.journal_id + '>' + val.reference + '</option>'; }); } selector += '</select>'; $(selector).appendto(selectorid); } use array track items added. function dropdown(data, selectorid) { var journal_idarray = []; var selector = '<select style="width: 400px;" id="results">'; if (data == '

java - repaint() Method Not Repainting JPanel -

ok, first off know there lot of other threads issue, try using invalidate() , validate() had no effect me. my problem -- title makes obvious -- jpanel's repaint() method doesn't repaint. added debug messages in paintcomponent() method, here's console output: debug -10 421 010 441 repainted moved mouse moved mouse moved mouse moved mouse moved mouse moved mouse moved mouse moved mouse moved mouse moved mouse moved mouse moved mouse moved mouse moved mouse moved mouse moved mouse notice see debug , (co-ordinates) , , repainted once, @ beginning of program, yet call repaint(); each time mouse moved. i added 5 classes one, believe preferred debugging purposes: package com.trtld.spacewar; import java.awt.color; import java.awt.graphics; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.awt.event.mouseevent; import java.awt.event.mouselistener; import java.awt.event.mousemotionlistener; import javax.swing.jframe; import javax.sw