Posts

Featured post

c# - Catel custom View creation -

i create custom window , show without iuivisualizerservice catel. the problem is: when create window, bind viewmodel it, seems view not react on properties changes. i have done following: var photo = new photo(); newphotowindow newphotowindow = new newphotowindow(); var viewmodel = new newphotowindowviewmodel(photo); newphotowindow.datacontext = viewmodel; newphotowindow.showdialog(); is there way create via kind of viewlocator? i have tried typefactory , not allow me put photo model viewmodel. you shouldn't manually doing viewmodel creation in catel. it's done automatically. this should sufficient: uivisualizerservice.showdialog<newphotowindow>(); this automatically: resolve vm belongs newphotowindow (newphotowindowviewmodel or newphotoviewmodel). instantiate vm using iviewmodelfactory create window , set vm it

html5 - javascript variable not working inside html tag -

i want html attribute values javascript statement(function). marks portion block red on image targeted co-ordinates inside area tag. full code given below @ bottom. this works fine: <script type="text/javascript"> document.write('<area href="#" select="red" shape="rect" coords="69,76,84,102">'); </script> but reason reason, not seem work. ideas? <script type="text/javascript"> var crd=[69,76,84,102]; document.write('<area href="#" select="red" shape="rect" coords="'+crd[0]+","+crd[1]+","+crd[2]+","+crd[3]+'">'); </script> this html file. <!doctype html> <html> <head> <title>mapping physical library</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <scr

python - Finding all legal moves in a simple board game -

i have 8x8 board represented numpy.ndarray: array([[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]) # 0 = free space # 1 = player1's figure a figure can either move forward , left, forward , right or forward (forward means down board in case). right using nested loops in order through board indexes. when find figure append board states can achieved making moves figure list , keep searching figures. for example output of function looks this: [array([[[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0],

Receiving "NO CARRIER" error while tring to make a call using GSM modem in Python -

Image
i want make call using gsm modem. wrote below program: import time import serial recipient = "+98xxxxxxxxxx" phone = serial.serial("com10", 115200, timeout=5) try: time.sleep(0.5) phone.write(b'atz\r') time.sleep(1) phone.write(b'atd"'+recipient.encode() +b'"\r') while(1): print(phone.readline()) time.sleep(0.5) finally: phone.close() but when run receive output: >>> ================================ restart ================================ >>> b'atz\r\r\n' b'ok\r\n' b'atdxxxxxxxxxx\r\r\n' b'no carrier\r\n' what "no carrier" error means? note can send sms successfully. this program use send sms: import time import serial recipient = "+98xxxxxxxxxx" message = "test" phone = serial.serial("com10", 115200, timeout=5) try: time.sleep(0.5) phone.write(b'atz\r') time.

How to connect android app to App engine -

i'm trying connect app in android server i've opened on appengine. my server's name : dddd-daniel-2345 , website server : http://dddd-daniel-2345.appspot.com/ this how connect android app server in app engine: app.yaml: application: dddd-daniel-2345 version: 1 runtime: python27 api_version: 1 threadsafe: yes handlers: - url: .* script: main.app libraries: - name: webapp2 version: "2.5.2" main.py: #!/usr/bin/env python # # copyright 2007 google inc. google.appengine.api import users import webapp2 class userhandler(webapp2.requesthandler): def get(self): user = users.get_current_user() if user: greeting = ('%s,%s,%s' % (user.email(),user.user_id(),user.nickname())) else: greeting = ('not logged in') self.response.out.write(greeting) app = webapp2.wsgiapplication([('/', userhandler),], debug=true) my applications code : add manifast main.

android - View is not updating from other controller Appcelerator Alloy -

i hope fine. having trouble updating views in titanium appcelerator alloy, i want able delete previous children picker , add new 1 in picker in different controller/view in..... i have followed this solution unfortunately not working me. here code trying. createevent.js ti.app.addeventlistener('db_update', function(){ alert("ok"); $.picker.removeallchildren(); }) customparty.js $.btnclick.addeventlistener('click', function(){ ti.app.fireevent('db_update'); }); // ok alert shows children of picker aren't removed. since ok alert shown, in way , callback function called successfully. problem here calling removeallchildren method not removing rows picker. solution iterate on colums , delete rows : ti.app.addeventlistener('db_update', function(){ alert("ok"); //get picker columns var columns=$.picker.getcolumns(); //iterate on picker columns (var it=0,length=columns.length;i<l

how to get HTML5 Application Cache Status by Selenium/Java -

how html5 application cache status selenium/java for selenium/java programming, how can selenium/java status of html5 application cache status? tried below, didn't work. "cannot cast org.openqa.selenium.html5.applicationcache.." import org.openqa.selenium.webdriver; import org.openqa.selenium.firefox.firefoxdriver; import org.openqa.selenium.html5.appcachestatus; import org.openqa.selenium.html5.applicationcache; public class html5appcache { public void testhtml5localstorage() throws exception { webdriver driver = new firefoxdriver(); driver.get("http://www.w3schools.com/html/tryhtml5_html_manifest.htm"); appcachestatus status = ((applicationcache) (driver)).getstatus(); } } you casting short appcachestatus object below, hence error. appcachestatus status = ((applicationcache) (driver)).getstatus(); applicationcache interface have write own version of getstatus method. you may want cache status usi