Posts

Showing posts from June, 2011

wpf - How to get DataTemplate to fill DataGridTemplateColumn -

Image
i have following xaml creating datagrid: <datagrid canuseraddrows="false" horizontalalignment="left" name="test" autogeneratecolumns="false" height="164" margin="205,264,0,0" verticalalignment="top" width="511"> <datagrid.columns> <datagridtextcolumn canusersort="false" binding="{binding description, mode=twoway}" header="description" width="6*" isreadonly="true" /> <datagridtemplatecolumn width="2.6*" x:name="parent" > <datagridtemplatecolumn.headertemplate> <datatemplate > <grid showgridlines="false" width="{binding elementname=parent,path=width}" > <grid.columndefinitions> <columndefinition width="1*"

makefile - Error when building C++ project -

i tried build c++ project using cygwin. got following error: make cannot run program "make": launching failed error: program "make" not found in path i have c:\cygwin64\bin in path, contains file makeg . there meant other make file, , can find it? you need install make. if want know how see answers install python , make in cygwin .

Mixing Full Database Encryption with Column Encryption -

if encrypting database aes-256, there reason encrypt individual columns? other performance, there reason not to? the reason i'm asking because encrypting specific columns not database, , preparing move full database encryption model. easier keep columns encrypted, wouldn't have change code. if there compelling reason other personal laziness, use bolster case. the best reason can think of encrypt columns whole database more 1 level of access. people database key see database schema , unencrypted columns not content of encrypted ones. might useful, example, if had database of hospital patients medical history. more staff might need know patient is, next of kin, billing info need know specifics of condition(s). if law not require strict access medical information in area, hospital policy might. performance reason can think of against encrypting columns in general. , limitation puts on them, encrypted columns cannot used keys, or @ least cannot used way withou

javascript - HTML form returns NULL fields -

i have basic form several fields want validate before submitting code. when pass form data js says fields null. please? im new @ js please patient me. relevant form. theres button toggle forms display dont think has effect on this. <div id = "new_bk" style="display: none;"> <form id = "new_book" onsubmit = "javscript: return(formvalidate());"> book name:<br> <input type="text" name="book_name"> <br> author name:<br> <input type="text" name="author_name"> <br> isbn:<br> <input type="text" name="isbn"> <br> release date:<br> <input type="text" name="release_date"> <br> price:<br> <input type="text" name="price"> <br>

scope - Google+ Sign In Button not functioning Android Studio -

hi integrating google sign in app. lately has been concern reason android studio not recognizing plus_login scope (which necessary app access basic profile info, etc). current error this error:(40, 17) error: method addscope in class builder cannot applied given types; required: scope found: string reason: actual argument string cannot converted scope method invocation conversion and here oncreate file error found edit 1 - added import statement , variable declarations package com.instigate.aggregator06; import android.content.intent; import android.content.intentsender; import android.os.bundle; import android.support.v7.app.appcompatactivity; import android.util.log; import android.view.view; import com.google.android.gms.common.connectionresult; import com.google.android.gms.common.api.googleapiclient; import com.google.android.gms.common.api.googleapiclient.connectioncallbacks; import com.google.android.gms.common.api.googleapiclient.onconnectionfailedlistener; import

unity3d - Cube moving through rigidbody -

Image
in unity 5.1.1f1 have cube moving script. whenever rigidbody comes in contact it, moves rigidbody out of path. however in of situations, rigidbody in path of cube , cube moves through rigidbody. for example here in pic, red movable cube , grey rigidbody - as can see red cube can move grey rigidbody. the sources here i asked question here the cube moving script - transform.position = vector3.movetowards (transform.position, patrolpoints [currentpoint].position, movespeed * time.deltatime); this issue occurs because rigidbody (blue cube) becomes asleep. can fixed adding getcomponent ().sleepthreshold = -1; start() method of playermovement.cs.

c# - Call visual studio modal dialog -

Image
i'm developing visual studio package projects(vsix) , need show modal dialog box preventing clicks behind it. visual studio dialog box. clicks behind dialog denied while being shown. i did try using forms.form.showdialog works in vsix context (it prevents clicks in forms of , not in visual studio window). can me? thanks you should use dialogwindow recommended in vs design guides

AbsApiState implementations for Telegram api in JAVA -

could 1 give me example of absapistate implementations using in telegram api in java :>please<: finally want send message 1 phone number programmatically java. i did google research lot didn't understand life cycle of telegram api?! take close @ webogram does. written in javascript. then see if can follow steps here to: 1) app_id 2) write code obtain valid auth_key indicated in telegram api see here: https://stackoverflow.com/a/32809138/44080 3) check out console.logs local copy of webogram running in browser understand how working client interacts telegram servers. 4) build parser handle encoding , decoding of telegrams tl types. need handle messaging telegram servers. 5) study mtproto encryption requirements, read , implement each step carefully, compare webogram logs telling you, webogram mtproto.js doing that's 1 way started cheers.

java - JTable: display correctly refresh of a table -

Image
i trying display information on table , refresh table. doing follows: //rowdata , columnname computed piece of code working table = new jtable(rowdata, columnname); table.setautoresizemode(jtable.auto_resize_off); table.gettableheader().setreorderingallowed(false); getcontentpane().add(new jscrollpane(table), borderlayout.center); repaint(); however, following display (below). remove grey sqaure correspond table before update new content in red. could please provide me advice remove ? thank attention. y don't add new table. instead update data in data model old table. see this: https://docs.oracle.com/javase/tutorial/uiswing/components/table.html#data

css - Fixed position p is more pixels from bottom than specified -

Image
this p within nav fixed position, doesn't matter, right? tried using fixed position way seemed place text tucked curve of nav (which has big border-radius on top right partly off-screen, creating tab feel). take element out of flow, doesn't place 1 expect. it's located here. #directory { position: fixed; bottom: -95px; left: 0px; width: 125px; height: 125px; border-top-right-radius: 50px; z-index: 20; } #directory p { font-size: 0.8em; position: fixed; left: 15px; bottom: 5px; z-index: 21; } change #directory p position:relative; edit: not sure why down vote. so, added screenshot show changing position relative in fact work.

parallel processing - How to increment a variable in parallelized bash script -

so have bash script forks new process in double for-loop for each date "d": each instance "i": do-something "d" "i" & done done and in do-something , increment counter variable. however, since it's counter variable, seems accumulating doesn't work. what's best way solve this? you can way. what's main reason of incrementing counter in child shell/process when cant value back. incrementing before calling do-something , maintain counter. #!/bin/bash c=0 do-something () { echo 'i shenzi' sleep 20; } while : ; while : ; echo "-- counter == $((++c))" && sleep 5; do-something "d" "i" & done done

c# - Using "this"(MainWindow.xaml.cs) in another Class -

i have 2 methods: method 1(class 1): private void bntstart_click(object sender, routedeventargs e) { createmap gogo = new createmap(); gogo.dowork(ref this);//.xaml.cs//window } method 2(class 2)(different file "mainwindow.xaml.cs") : public void dowork(ref window instance) { } i use "instance", if in "mainwindow.xaml.cs" reference mainwindow. by way not possible because of dispatcher(ui-thread), 1 allowed...or wrong !? how can ? you should not this you can put mainwindow.xaml.cs: public static mainwindow instance { get; private set;} public mainwindow() { instance = this; } or use like: (mainwindow)application.current.mainwindow; however , views should totally self contained. there way better ways data/commands them (via proper use of mvvm).

php - is not equal sign != and <> is not working in my mysql query -

i using 2 table like, user_details user_id , name field. second table group_user user_id , group_id field. here group_id related group table creating group. want names not in group. using mysql query like, select user_details.name group_users inner join user_details on group_users.user_id = user_details.user_id group_id != 160 ; or select user_details.name group_users inner join user_details on group_users.user_id = user_details.user_id group_id <> 160 ; but not getting particular result mean != , <> not working proper. this should work: select ud.name user_details ud left join group_users gu on ud.user_id = gu.user_id , gu.group_id = 160 gu.user_id null ; or this select ud.name user_details ud ud.user_id not in ( select user_id group_users gu gu.group_id = 160 ) ; in first, you'd finding users didn't have association group. in

boost - Writing and checking your own concepts in c++ -

i writing header-only c++ library uses templates quite lot. want add concepts checking handle compile-time errors raised when incorrect types used in template parameters. for example, need concept pointer-like objects point single object (like std::shared_ptr), pointer-like object point array (via operator[]) couldn't used pointer arithmetic (like std::unique_ptr), , pointers used pointer arithmetic , on. since concepts still not in standard , not supported compilers, need implement myself. know boost concept library, reason not want add dependencies. so question is, how implement checking of type requirements? how implemented in boost? techniques common in such cases? i've done little bit of sort of thing myself since i've still been using c++11. essentially, way heavy use of sfinae , familiarity of these things: http://en.cppreference.com/w/cpp/types the important of concept checking arguably enable_if : it's template provides given return type i

css - Samsung Android stock browser image not displaying -

i have responsive slider we've built handle product images. images of varying sizes - respect our target aspect ratio, there images don't both landscape , portrait. the slider works everywhere apart on samsung devices in default android browser. experience common tablets , phones, samsungs. works fine on other android devices, litany of desktop browsers , ios. the problem seems boil down height: 100%; on image used limit portrait images height of container. i've redacted our code down simplest version in jsfiddle below. jsfiddle: https://jsfiddle.net/g453xstc/8/ ul { position: relative; /* height 0 , padding top maintain aspect ratio when resized */ height: 0; padding: 75% 0 0; } li { height: 100%; width: 100%; /* background demonstrate how far layout works on samsungs */ background: #eee; /* absolute positioning account height: 0 */ position: absolute; top: 0; left: 0; } img { height: 100%; /* offending l

Protecting Cells Based on Contents of Other Cells in Google Sheets -

i have single worksheet contains user entered responses in columns c & d, rows 3 - 20. responses time dependent , @ column e rows 3-20 see if "locked" or "open". using protection, lock entire sheet editing exception of c3:d20. sheet set calculate every minute. i trying write script checks column e see if set locked or open. if set locked, lock (protect) columns c&d in row editing myself. run script every 5 minutes , have loop , if statement handled, when go use removeeditors function 2 things: creates new protected range (so after 5 minutes have 1 additional protected range, 10 minutes, have 2 additional, etc.) does not remove other editors able edit cells. i tried using google's example code, code adds current user editor, i'm trying avoid doing since editor can remove protection code putting in place. any provide appreciated. current code below: function lock_cells() { var sheet = spreadsheetapp.getactive(); (var = 3; <=

javascript - How do I match destinations in the google maps Distance Matrix -

i've got web app needs 'distance me' information properties displayed on map. i'm using googles distance matrix service distanceservice = new google.maps.distancematrixservice(); i'm calling service 1 origin , multiple destinations. var params = { origins: [currentlocation], destinations: endpoints, travelmode: google.maps.travelmode.driving } distanceservice.getdistancematrix(params, savedistances); my endpoints array of google.maps.latlng objects taken properties. when results returned they've changed these addresses, , there's no longer reference latlng 's. does know if distance matrix service guarantees return results in same order sent them? couldn't see in docs . don't want start calling geocoding services match properties (especially latlng 's return won't exact match) they returned in same order sent. that isn't stated, way read the documentation implied. quick test fiddle cod

android - How to use paragraph in json? -

i new in android , having queries in json:- how can break line in json if having multiple lines? this: {"contacts": [ { "id": "c200", "name": "ravi tamada", "email": "xxxx@gmail.com", "address": "xx-xx-xxxx,x - street, x - country", "gender": "male", "about": "sentence1.sentence2.sentence3" , "phone": { "mobile": "+91 0000000000", "home": "00 000000", "office": "00 000000" } } ] } if desire line break, use code string using in application. json "data-only" transfer, should not have formatting. if data formatted, directly should used: example: {"myvarname":"sentence1\nsentence2\nsentence3"} then on lets javascript (using ajax simplicity) $.ajax({ datatype: "json", url: url, success: function(o

javascript - Foundation 5 clearing lightbox not working with angularjs dynamic images -

i'm trying use clearing lightbox component zurb foundation 5 angularjs application haven't found way, example code here: using code below mess should foundation clearing documentation <html> <head> <title>todo supply title</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <link href="http://cdn.foundation5.zurb.com/foundation.css" rel="stylesheet"/> </head> <body> <div ng-app="app" ng-controller="clearingcontroller"> <ul class="clearing-thumbs large-12 columns small-block-grid-4" data-clearing> <li ng-repeat="imagen in imagenes"><a href="{{imagen}}"><img ng-src="{{imagen}}"></a></li> </ul> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery

php - How to securely share a link to others - Laravel 5 -

hi making call recording system, basically, there's admin , user. admin upload call recording file stored in file system. admin assign user call recording user can see. so in database have recordingstable ->id ->name ->path ->filename then designation table store assigned call recording user. designationtable ->id ->user_id ->recording_id i make function user can see , play recording assigned him/her. problem user share recording else. done that, loading the assigned recording user, , in his/her dashboard there's public link video, <a href="http://localhost/callrec/public/recording/{!! $value->recordid !!}">see public link</a> as can see i'm using blade template. can $value->recordid recording id resource, let's link directed to http://localhost/callrec/public/recording/1 then link public , user can share it. there's risk, when he/she shared id link can altered, let's http://localhost/c

javascript - How save image with canvas in fabric.js -

Image
i creating application t-shirt customization in have put canvas on image using css, problem saving image canvas. todataurl gives part of canvas area, want whole image. there other solutions on stack overflow not solve problem. hello, have create image object (tshirt) text object holds message. to , load image fabric.image.fromurl() function , inside function , create text object going show tshirt message. so, image , text belong group object. every time want load new text , call loadtext function , change text object. i added 4 buttons in order manupulate up/down/left/right text . you can export canvas + image+ text function saveimg() , on jsfiddle security message tained canvases . happens because on example load image domain , code runs on domain, can run code on web application no problem @ all. that code : var canvas = new fabric.canvas('c'); var scalefactor=0.4 canvas.backgroundcolor = 'yellow'; canvas.renderall(); var myimg = &#

How to send Date object from flex to Java Restful Webservice using JSON -

i getting problem while sending date flex java webservices i selecting date datefield , assigning dob field var dob :date = datefield.selecteddate; when convert date object json , resulting in json object below not being accepted restfull webservice in java. {"dob":{"fullyear":2015,"date":13,"hours":0,"month":6,"minutes":0,"milliseconds":0,"fullyearutc":2015,"seconds":0,"monthutc":6,"dateutc":13,"hoursutc":4,"minutesutc":0,"secondsutc":0,"millisecondsutc":0,"time":1436760000000,"timezoneoffset":240,"day":1,"dayutc":1} please me out in solving problem. in advance. have u tried jodadatetime, use in project , works good. have send date in ("2015-09-10t01:19:42-06") format. jodadatime conevert date , time in millisecond. fyi string inputdate = "2015-09-10t01:1

php - testing exceptions with phpunit -

i trying test function when know error going thrown. function looks this: function testsetadsdata_dataisnull(){ $dataarr = null; $fixture = new adgroup(); try{ $fixture->setadsdata($dataarr); } catch (exception $e){ $this->assertequals($e->getcode(), 2); } $this->assertempty($fixture->ads); $this->assertempty($fixture->adids); } now trying use phpunit exceptions assertions methods replace try catch part can't figure out how that. did lots of reading including post phpunit assert exception thrown? couldnt understand how shuold implemented. i tried this: /** * @expectedexception dataisnull */ function testsetadsdata_dataisnull(){ $dataarr = null; $fixture = new adgroup(); $this->setexpectedexception('dataisnull'); $fixture->setadsdata($dataarr); $this->assertempty($fixture->ads); $this->assertempty($fixture->adids); } didn't w

ruby - Please suggest another fastest way for Migrating SVN repository to GIT respository -

downloaded ruby installer windows , installed latest version add ruby executable path. installed svn2git . start menu ->all programs -> ruby -> start command prompt ruby type “gem install svn2git” , enter. migrate subversion repository in ruby command prompt gone directory files migrated then used below command svn2git http://[domain name]/svn/ [repository root] it taking around 2 days migrate 20k commits git , in svn have around 65k commits. please let me know there other fastest way migrate svn repository git repository. you can try github importer: https://help.github.com/articles/importing-from-subversion/ i don't have information on speed though.

node.js+mongoose - Is single rest endpoint enough to update a document with nested arrays? -

i'm developing rest api using node.js + mongoose. have model has few nested arrays within it. have put endpoint update document. add object sub-array, need separate endpoint or there way use same put endpoint? ` companyname: string, city: string, pincode: number, managers: [{ name: string, dob: date, gender: string, highesteducation: string, email: string, phonenumbers: [{phonenumber: number}], }],` i have endpoint ../api/customer updating document. replaces existing document json im supplying. so, if want add manager (not replace existing manager), need seperate endpoint this? optimized solution?

java - Best way to use Json object from @requestBody in controller instead of mapping to POJO -

usually map object @requestbody pojo @ controller. in order map pojo should know fields @requestbody object. so, question best way use object inside controller if don't know fields inside requestbody. is like? @requestmapping(value = "/students", method = requestmethod.post, consumes = "application/json") public @responsebody student getstudent(@requestbody string json) { // parse json string object... } please share innovative ideas. in advance. updated answer based on updated description of question , if using jackson following code give map of json string. objectmapper mapper = new objectmapper(); map<string,object> map = mapper.readvalue(json, map.class); note: have created new instance of objectmapper , can use objectmapper bean if have defined 1 application.

Is there a keyboard shortcut to select a column for editing in Atom editor? -

Image
scenario when editing file in atom editor how select multiple lines same edit needs performed? for example: this.name = name; this.age = age; this.sound = sound; needs transformed into: that.name = name; that.age = age; that.sound = sound; imagine there many of these lines, not want use find-and-replace because change more need. question - there keyboard shortcut column selection? is there sequence of keyboard shortcuts ( preferably mac ) can use to: a) select initial word b) select "column" (that word on several lines) then apply change several lines @ once ( in bulk ) i know how in sublimetext: http://sublime-text-unofficial-documentation.readthedocs.org/en/latest/editing/editing.html#column-selection have tried many different key combinations without luck in atom , googling has proved fruitless... there several ways achieve this: keyboard you can enable column selection mode using ctrl + shift + ↑/↓ . allow extend curso

diacritics - German characters in Java -

i want set german words (with special characters) string var. string s = "staatsangehörigkeit"; system.out.println(s); but in output or in debuger see: staatsangeh?rigkeit. one way change encoding of project utf-8 . when using eclipse: right-click on project folder properties resource then change text-file encoding

function - How to output single character in C with write? -

could instruct me on how print single letter, example "b" in c while using write function (not printf). i'm pretty sure uses #include <unistd.h> could tell me how write properties work? don't understand int write( int handle, void *buffer, int nbyte ); could of guys toss in few c beginner tips well? i using unix. you have found function, need pass proper parameters: int handle = open("myfile.bin", o_wronly); //... need check result here int count = write(handle, "b", 1); // pass single character if (count == 1) { printf("success!"); } i did indeed want use stdout. how write version display whole alphabet? you use pre-defined constant stdout. called stdout_fileno . if write out whole alphabet, this: for (char c = 'a' ; c <= 'z' ; c++) { write(stdout_fileno, &c, 1); } demo.

yesod - Could not deduce (blaze-markup-0.6.3.0:Text.Blaze.ToMarkup Day) arising from a use of ‘toHtml’ -

i'm trying use yesod build simple web site , i'm starting code max tagher's excellent intro on youtube, yesodscreencast. i've forked code github , , add date posting indicate when published, i'm running problem can't quite figure out given low experience haskell , beginner's experience yesod. i've been unable find answer via googleplex. yesod provides native dayfield in yesod.form.fields , thought needed add postdate field in blogpost following config/models using day : blogpost title text postdate day article markdown and add blogpostform in postnew.hs : blogpostform :: aform handler blogpost blogpostform = blogpost <$> areq textfield (bfs ("title" :: text)) nothing <*> areq dayfield (bfs ("postdate" :: day)) nothing <*> areq markdownfield (bfs ("article" :: text)) nothing when compiles following error message: handler/home.hs:

Directory structure for huge ansible inventory file -

our ansible inventory file getting bigger , bigger day day. wanted modularize directories , file. example. [webservers] foo.example.com bar.example.com [dbservers] one.example.com two.example.com three.example.com this can converted |--production | |--webservers | | |--webservers | |--dbservers | | |--dbservers where webservers file; [webservers] foo.example.com bar.example.com and dbservers file; [dbservers] one.example.com two.example.com three.example.com for simple inventory file works fine. problem comes when create group of groups. like [webservers] foo.example.com bar.example.com [dbservers] one.example.com two.example.com three.example.com [master:children] webservers dbservers i cant imagine directory structure , it. can please guide me right tutorial. thanks ansible supports "dynamic inventories" can read more in here: http://docs.ansible.com/ansible/developing_inventory.html what it: simple script (python, ruby, she

HTML & PHP Information Table -

so i'm hosting servers , trying make table displaying information server name players etc have script displays suck @ css, i'm trying little in website http://echelon.kthx.at/pubbans.php <?php include ("bc2conn.php"); // opens connection gameserver $bc2conn = new bc2conn("31.185.143.136", 48888); if (!$bc2conn->isconnected()) { echo "connection not established. " . "to debug, set '-d' 3rd parameter new connection.<br />" . "<br />" . "example: \$bc2conn = new bc2conn(\"127.0.0.1\", 48888, \"-d\");"; return 0; // stop executing script } // secure login // $bc2conn->loginsecure("password"); // unsecure login (not salted) // random serverinformation echo "servername: " . $bc2conn->getservername() . "<br />"; echo "players: " . $bc2conn->getcurrentplayers() . "/" . $bc2conn->

PHP SSH2 Exec - Getting PID -

how can pid process executed via ssh2. what have tried : ssh2_exec($ssh2, 'echo `ps aux | grep -f "' . $startcommand . '" | grep -v -f "grep" | awk \'{ print $2 }\'`'); and ssh2_exec($ssh2, $startcommand.' > /dev/null 2>&1 & echo $!'); but result in echo resource id #2 or resource id #3 or resource id #4 you have use ssh2_fetch_stream function fetch ressource. stdout_stream = ssh2_exec($ssh2, $command); $err_stream = ssh2_fetch_stream($stdout_stream, ssh2_stream_stderr); $dio_stream = ssh2_fetch_stream($stdout_stream, ssh2_stream_stddio); stream_set_blocking($err_stream, true); stream_set_blocking($dio_stream, true); $result_err = stream_get_contents($err_stream)); $result_dio = stream_get_contents($dio_stream));

self signed x509 certificate issue in MQTT mosquitto using c# -

i using mqtt library in c# , following url. http://www.embedded101.com/blogs/paolopatierno/entryid/366/mqtt-over-ssl-tls-with-the-m2mqtt-library-and-the-mosquitto-broker implementing url while connecting client localhost server following error occur:- c:\program files\mosquitto>mosquitto -c mosquitto.conf -v 1438001198: mosquitto version 1.4 (build date 27/02/2015 21:01:03.50) starting 1438001198: config loaded mosquitto.conf. 1438001198: opening ipv4 listen socket on port 8883. enter pem pass phrase: 1438001224: new connection 10.112.154.82 on port 8883. 1438001224: openssl error: error:140890c7:ssl routines:ssl3_get_client_certifica te:peer did not return certificate 1438001224: socket error on client <unknown>, disconnecting. my code is:- x509certificate certificate = new x509certificate(@"d:\poc\abhinav\cert\cert\m2mqtt_ca.crt", "india@123"); mqttclient client = new mqttclient("10.112.154.82", 8883, true, new x509certificate(cer

connect two agents via http-protocol in Java -

i working on project in java consists in connecting 2 agents via http-protocol using following scenario: 1) http-agent1 make connection http-agent 2 2) http-agent 2 send get-request http-agent 1 3) http-agent 1 sends asked resource http-agent 2 4) http-agent 1 stops connection can according http-specification? little bit confused, because know 1 agent must listener , according scenario not know, agent must listener. i using java-sockets. hard separate between making connection , making request.!!!!!!!!!!!according http-protocol, agent, making request, should make connection http typically used client/server communication, example doesn't quite follow. in case, have following: a connects b b requests a sends b closes connection b basically, b acting server (waits connection) , client (requests data) part of server functionality handled (actually serving data). typical client-server version of trying go so: b connects b requests a sends b or b initiate

Android IME: is tehere a way to get or calc the cursor's absolute coordinates on screen -

i'm creating new ime android , want render floating ui depending on cursor's position. i've found if override onupdatecursoranchorinfo function of inputmethodservice (build version lollipop or later) can coordinates of cursor in edittext , if request updates like: inputconnection.requestcursorupdates(inputconnection.cursor_update_monitor) . but how can calc absolute coordinates of cursor (from top left corner) in ime?? there hack or solution this? please me! onupdatecursoranchorinfo function if cannot use rendering view next cursor :( ? this ime(keyboard) developer only. if app developer, may want try getselectionstart() method of textview or other input instead.

html - Align text to right of checkbox and center buttons -

Image
i want html/css match in following picture: this html/css looks like: there 4 things having issues in html/css picture doing: align text right of checkbox in such way no text appears directly below checkbox make 2 buttons in picture same size make 2 buttons centered according white text paragraph above i can't seem #2 , #3 @ same time. any other discrepancies between 2 pictures can ignored. how accomplish items 1-4 mentioned above? this plunker link: http://plnkr.co/edit/dfzg2c1zrqdesdoba21t?p=preview this html code: <!doctype html> <html> <head> <link rel="stylesheet" href="style.css"> <script src="script.js"></script> </head> <body> <div id="loadingdiv"> <div class="loadingtext"> <p style="color:red"><strong>attention! must agree continue online forms</strong></p> <p>

Objective-C - How to force low memory on iOS simulator -

i have error users having of exc_bad_access when device low on memory. stack trace pointing if line below, , believe it's because of utf8string that's being deallocated , still being used: dispatch_sync(dbqueue, ^{ if (sqlite3_bind_text(sql_stmt, 1, pid.utf8string, -1, sqlite_static) != sqlite_ok) { ... i'm having hard time reproducing issue on end, how can force or simulate low-memory on simulator or device? update: i've tried adding breakpoint line above, , using option simulator -> simulate memory warning, still can't reproduce exc_bad_access error. in simulator there menu item: hardware : simulate memory warning or shift command m

python - Pandas split column name -

i have test dataframe looks this: data = pd.dataframe([[0,0,0,3,6,5,6,1],[1,1,1,3,4,5,2,0],[2,1,0,3,6,5,6,1],[3,0,0,2,9,4,2,1]], columns=["id", "sex", "split", "group0low", "group0high", "group1low", "group1high", "trim"]) grouped = data.groupby(['sex','split']).mean() stacked = grouped.stack().reset_index(level=2) stacked.columns = ['group_level', 'mean'] next, want separate out group_level , stack 2 new factors: stacked['group'] = stacked.group_level.str[:6] stacked['level'] = stacked.group_level.str[6:] this works fine. question this: this works if column names ("group0low", "group0high", "group1low", "group1high") have in common each other. what if instead column names more "routelow", "routehigh", "landmarklow", "landmarkhigh"? how use str split group_level i

java - Analog of BeanPropertySqlParameterSource that can handle public fields -

i have simple model, instances of want save in mysql using spring jdbctemplate. use dao saves model objects using simple sql ( insert user(id, email...) value (:id, :email...) ). there framework can extract parameters model (when model pojo public fields). so, need similar spring's beanpropertysqlparametersource , ability work public fields instead of properties. example of model class: public class user { public int id; public string email; public string login; public string password; } i know extending abstractsqlparametersource can solve problem, hope find existing framework. upd implementation based on abstractsqlparametersource : public class publicfieldssqlparametersource extends abstractsqlparametersource { map<string, object> props = new hashmap<>(); public publicfieldssqlparametersource(object object) { field[] fields = object.getclass().getfields(); (field field : fields) { string name = fi

xcode - IOS Swift: EXC_BAD_INSTRUCTION -

import spritekit let ballcategoryname = "ball" let paddlecategoryname = "paddle" let blockcategoryname = "block" let blocknodecategoryname = "blocknode" class gamescene: skscene { override func didmovetoview(view: skview) { super.didmovetoview(view) // 1. create physics body borders screen let borderbody = skphysicsbody(edgeloopfromrect: self.frame) // 2. set friction of physicsbody 0 borderbody.friction = 0 // 3. set physicsbody of scene borderbody self.physicsbody = borderbody physicsworld.gravity = cgvectormake(0, 0) let ball = childnodewithname(ballcategoryname) as! skspritenode ball.physicsbody!.applyimpulse(cgvectormake(10, -10)) } } on line of code: let ball = childnodewithname(ballcategoryname) skspritenode i error: "thread 1:exc_bad_instruction (code=exc_1386_invop, subcode=0x0) why? running xcode version 6.4 (6e

javascript - Making tabs scroll smoothly on click using jQuery -

i have vertical tabs work , content changes when relevant tab title clicked. want pane of relevant content scroll smoothly rather appear when tab title clicked. here html: <div class="wpb_wrapper wpb_tour_tabs_wrapper ui-tabs vc_clearfix ui-widget ui-widget-content ui-corner-all"> <ul class="wpb_tabs_nav ui-tabs-nav > <li class="ui-state-default ui-corner-top ui-tabs-active ui-state-active" role="tab" tabindex="0"> <a href="#tab-e9b37ea4-82c3-7" class="ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-1">employer</a> </li> <li class="ui-state-default ui-corner-top" role="tab" tabindex="-1"> <a href="#tab-c2c472f3-0bff-0" class="ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-2">employee</a> </li&g

Change excel date format from slash to dot -

in excel file have lot of data , there 1 column date formatted 23/05/2015 example. want change date formatted 23.05.2015. changing date format slash dot. as said file contains thousands of rows. don't want go through rows , change manually. there easy way this? select column clicking on letter @ top of column. right-click , select "format cells" select "number" tab if isn't selected. select "custom" under "category". in box underneath "type", enter dd.mm.yyyy

junit - Get Gradle test results after hung test -

in our software, have few junit tests hang during execution due race conditions in tests. when 1 of these hangs occurred last night, killed forked java process running test. tests continued running expected until build completed. after build, got error message (i running --continue) having killed gradle test executor xxx. when went @ test results, discovered html test report wasn't there, , neither xml test result files. from have 2 questions: how can generate test reports without rerunning of tests (they take night run)? how can gracefully handle hung test without effecting build output?

symfony - Add # in the end of the url -

i need add #produc url. must lokoks loke trololo.com/buy#apple. how can in controller? can't understand must add it... read https://github.com/symfony/symfony/issues/3910 , don't me. not exacly need $this->get('router')->generate('store', array('#' => $product->getslug(), true), maybe faced it? please, me solved problem you have answer in the link provided . fabien potencier (symfony2's creator) said need append anchor url manually. there no need that. append after generating url. like so: $url = $this->get('router')->generate('store') . '#' . $product->getslug();

mysql - SQL Statement to Spring Data - PersistentEntity must not be null -

i´m doing web-application spring boot backend , angularjs frontend. database mysql. try top 5 items out of database. i´m doing through the @query annotation. tried sql statement directly onto db , expected values. sql statement: select item work_item group item order count(*) desc limit 3 @query: @query(value="select work_item_item work_item group work_item_item order count( *) desc limit 5", nativequery = true) list< string > find5mostuseditems(); when try access related url i´m getting following error: java.lang.illegalargumentexception: persistententity must not null! would glad if push me right direction. in case need more information, plz ask. (my first question :) ) edit: entity: @entity public class workitem { @id @generatedvalue(strategy = generationtype.auto) @column(name = "workitem_id") private long id; @column(name = "workitem_date") private localdate date;

ios - tapGesture hyperLink swift -

i have image , want go website when hit picture used tapgesture convert image big button , don't know how , want app take user website when user hit image that depends bit on want link open. 2 standard approaches either open url in uiwebview provide inside app, or tell system open link in mobile safari browser (which send app background). to me sounds second behaviour want. can achieve telling uiapplication open url, so: @ibaction func linktapped(sender:uitapgesturerecognizer) { if let url = nsurl(string: "http://stackoverflow.com/") { uiapplication.sharedapplication().openurl(url) } } edit: some more info on how set in way described: in viewdidload , set gesture recognizer this: let tapgesturerecognizer = uitapgesturerecognizer(target: self, action: "linktapped:") self.yourimageview.addgesturerecognizer(tapgesturerecognizer) self.yourimageview.userinteractionenabled = true make sure iboutlet yourimageview connected corr

sql server - Assign non identity sequence to field based on another column on multiple row insert -

i have sql table in sql server 2008 purpose includes patient_id (primary), custno (char), recip_id (int) 1 - c01731 - 1 2 - c01731 - 2 3 - c01731 - 3 4 - c01732 - 1 5 - c01732 - 2 6 - c01732 - 3 7 - c01732 - 4 8 - c01733 - 1 9 - c01733 - 2 so when need insert single record use stored procedure... create procedure [dbo].[jr_sp_nw_insertrecord] ( @custno varchar(max), @modwho varchar(max) ) begin set nocount on; --declare @retval int declare @rownum int set @rownum = (select max(recip_id)+1 usersmailingdata custno = @custno) insert dbo.usersmailingdata(custno,recip_id,modify, modifywho) values(@custno, @rownum, getdate(), @modwho) select cast(scope_identity() int) end my problem need stored procedure @ highest number in column recip_id based on @custno , on insert of multiple rows increment number 1 each row inserted. recip_id can have gaps when records deleted not issue.