Posts

c# - How to place a windows form in screen coords and close it on command? -

i working on c# console program on windows move window, part of trying create transparent box @ target destination give user visual confirmation of new location. facing 2 main problems: i want place form in screen coordinates i want able close window after user has confirmed decision. currently have code in library console client calling this: public static void createbox(rect rectangle) { form f = new form(); f.name = boxname; f.backcolor = color.blue; f.formborderstyle = formborderstyle.none; f.bounds = new system.drawing.rectangle(rectangle.left, rectangle.top, rectangle.right - rectangle.left, rectangle.bottom - rectangle.top); f.topmost = true; f.opacity = 0.5; application.enablevisualstyles(); task.run(() => application.run(f)); } and after searching questions on here have come attempt close form later: public static void removebox() { form f = application.open...

php - Using the javascript function without repeating it -

the following <div> section duplicating , below javascript function, want use again , again. share ideas if possible. <?php $new_material = ["a","b","c"]; //array pass in foreach foreach ($new_material $mat) { ?> <div class="row " id="row2"> <div class="row " id="row2.1"> <div class="col-xs-2"> <label>material name</label> </div> <div class="col-xs-3"> <label>brand</label> </div> <div class="col-xs-2"> <label>category</label> </div> </div> <div class="row " id="row2.2"> <div class="col-xs-2"> ...

swing - Trouble drawing with MouseDragged in Java -

there's problem drawing or setting size of jpanel when drag mouse, location setted click , size depending of drag position(x , y) drawing resizable rectangle(jpanel). private void panelmousedragged(java.awt.event.mouseevent evt) { rsx = (int)mouseinfo.getpointerinfo().getlocation().getx(); rsy = (int)mouseinfo.getpointerinfo().getlocation().gety(); rectangulodefault.setbounds(rx,ry,rsx-rx,rsy-ry); } private void panelmousepressed(java.awt.event.mouseevent evt) { rx = (int)mouseinfo.getpointerinfo().getlocation().getx(); ry = (int)mouseinfo.getpointerinfo().getlocation().gety(); rectangulodefault.setlocation(rx,ry); } but when drag mouse in negative coordinate of click(start of drawing) disappear. here better explain http://i.picasion.com/resize80/49c88c55d4c11c53c020acfcc4fc2f45.png but when drag mouse in negative coordinate ...

javascript - Cannot read property 'settings' of undefined when i click submit button -

i don't know why i received error when changed code php (from html). when extension of file html, code working fine <?php?> <html lang="en"> <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <!-- latest compiled , minified css --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <link rel="stylesheet" href="css/manual.css"> <!-- optional theme --> <!-- latest compiled , minified javascript --> <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <!-- latest compiled , minified javascript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js">...

Why the Google Analytics API is eating the "\" in my filter query? -

Image
i playing google analytics api , found interesting. today came problem can't solved. i sending filter this: 'filters':'ga:pagepath=~^/q-\d+/\d+$' it's working in query explorer not working code. after tests found query wrong when it's sent. here "network" panel of chrome debugging tool: as in picture, \d became d , guess reason data not correctly showing up. how can fix this? here code: var o ={ 'ids': 'ga:' + profileid, 'start-date': $('#startdate').val(), 'end-date': $('#enddate').val(), 'metrics': 'ga:pageviews,ga:uniquepageviews', 'dimensions': 'ga:pagepath', 'sort':'ga:pagepath', 'filters':'ga:pagepath=~^/q-\d+/\d+$' }; gapi.client.analytics.data.ga.get(o) .then(function(response) { thanks, you need escape backslash symbols: 'filters':'ga:pagepath=~^/q-\\...

ios9 - Not able to register for push in iOS -

for reason, in ios9, in methods:bool parsecheckpermissionforremotenotifications(void) , void parseregisterforremotenotifications(blockboolaction completion), cannot reach parse servers. in ios8, works fine. i've tried remaking ssl certificate , provisioning profile , adding exceptions nsapptransportsecurity. have idea why happening?

ios - Swift PrepareForSegue NSIndexPath error -

i want prepare segue via: override func prepareforsegue(segue: uistoryboardsegue?, sender: anyobject?) { if segue?.identifier != "fromopenchatstologin" { if let controller: chatviewcontroller? = segue?.destinationviewcontroller as? chatviewcontroller { if let cell: onlineusercell? = sender as? onlineusercell { let user = oneroster.userfromrosteratindexpath(indexpath: tableview.indexpathforcell(cell!)!) controller!.recipient = user } } } } where onlineusercell custom cell. also, that's userfromrosteratindexpath: class func userfromrosteratindexpath(indexpath indexpath: nsindexpath) -> xmppusercoredatastorageobject { return sharedinstance.fetchedresultscontroller()!.objectatindexpath(indexpath) as! xmppusercoredatastorageobject } so, when select cell crashes with: fatal error: unexpectedly found nil while unwrapping optional value on line: let user = oneroster.userfromr...