Posts

Showing posts from May, 2010

python - Cutting image after a certain point -

Image
i have bit of unusual problem. use pillow python 3 , need stop part of being transparent , layering. as can see in image 1, hair clips hat @ left , right of it. image 2 1 edited myself, , correct. there no clipping on left or right. all 3 of sprites (the head, hat, , hair) transparent, , same size. the trouble make cut off @ point, not hat sprites start , end in same place. may arc shape example, , end no hair in arc. this code i'm using: from pil import image, imagetk, imagechops background = image.open("headbase.png") foreground = image.open("hair2.png") image.alpha_composite(background, foreground).save("test3.png") background2 = image.open("test3.png") foreground2 = image.open("testhat2.png") image.alpha_composite(background2, foreground2).save("testo.png") this simple problem. need here make transparency mask (make areas coloured don't want have hair) areas don't want ...

javascript - Add text to textbox when check if radio box is selected -

i trying make little project myself in order better understand javascript. not looking expert have better understanding. i making dilution calculator , wondering best way insert units (either oz or ml) input boxes , output divs based on whether or not radio selected. automatically happen on page load on change of radio. <div class="input-group input-margin-top"> <input type="text" id="containersize" class="form-control" value="0" onclick="this.select();"> <span class="input-group-addon"> <input type="radio" name="inlineradiooptions" id="ounces" checked> oz </span> <span class="input-group-addon"> <input type="radio" name="inlineradiooptions" id="millilitres"> ml </span> </div> here how have html setup radio buttons i wondering best way not have nan show when se...

angularjs - Angular Ui-Grid display List view on row expansion not a Subgrid and pass the selected row id and data -

i trying display list view on row expansion of ui-grid instead of sub-grid example when user clicks on expansion icon of row, instead of displaying subgrid want display list view, able point can call static list view within row unable pass data related row list below working plunker http://plnkr.co/edit/pzl6ufwmg2h00sw36ftk?p=preview this controller: angular.module('availability',['ui.grid', 'ui.grid.expandable', 'ui.grid.selection', 'ui.grid.pinning','angular.filter']) angular.module('availability').controller('availability.ctrl', ['$scope','$log','$rootscope', function($scope,$log,$rootscope){ var weeklyavailability = {}; $scope.gridoptions = { expandablerowtemplate: 'availability.detailed.view.tpl.html', expandablerowheight: 150, expandablerowscope: { r...

bigdata - Error on starting the application Puppet in the Generic enablers Cosmos -

good afternoon, i have installed generic enablers cosmos, following manual bigdata analysis - installation , administration guide . when have come ' step 7: applying puppet ' , executed commands, in file puppet.err has appeared following errors: error: not prefetch yumrepo provider ' inifilé: section 'openvz-utils' defined, cannot re-defines in/etc/yum.repos.d/openvz.repo description: there conflict titles (indicated in bold type) of file /etc/yum.repos.d/cosmos-openvz.repo , /etc/yum.repos.d/openvz.repo . cat /etc/yum.repos.d/cosmos-openvz.repo [openvz-utils] ... [openvz-kernel-rhel6] ... cat /etc/yum.repos.d/openvz.repo [openvz-utils] ... [openvz-kernel-rhel6] ... [openvz-kernel-rhel6-testing] ... solution: have realized change in titles of file /etc/yum.repos.d/openvz.repo, example: [openvz-utils_1] error: not prefetch database_grant provider 'mysql': execution of '/usr/bin/mysql mysql -b...

Wordpress development theme link bootstrap.css to index.php not working? -

i developing wordpress theme scratch , when link bootrap.css in index.php file , go see looks did not work. please if can help. do have link site you're working on? i'd love need see you're doing. here couple things can try: link bootstrap.css in header.php template file. long directory path correct, should able 'view source' on page , click on file link confirm file's content has been loaded. don't forget bootstrap, need load jquery ( http://jquery.com/download/ ) link bootstrap.js file. link jquery , bootstrap.js file in footer.php template file theme. you can refer basic template bootstrap provides should started. http://getbootstrap.com/getting-started/#template

c# - Is ordering guaranteed by call-order cross multiple Rx Subjects? -

in example below have 2 subjects , _primarysubject called before _secondarysubject subscriber guaranteed receive primary callback before secondary callback? test simple test seems yes or fluke? and if fluke how can change code guarantee order describe here. thanks lot. public class eventgenerator { isubject<string> _primarysubject = new subject<string>(); isubject<int> _secondarysubject = new subject<int>(); private int i; public void sendevent(string message) { _primarysubject.onnext(message); _secondarysubject.onnext(i++); } public iobservable<string> getprimarystream() { return _primarysubject; } public iobservable<int> getsecondarystream() { return _secondarysubject; } } public class eventsubscriber { private static ischeduler staticfakeguithread = new eventloopscheduler(x => new thread(x) { name = "guithread" }); private readonly in...

javascript - JSONP throwing script error -

i making ajax request rest api not under control. getting cross-origin error because of set datatype "jsonp". but, throwing script error saying "unexpected token :". when @ network tab of chrome tools, can see request being placed , response getting back. how response looks like: {"uniqid":"1427907503","membersid":"1245678","istypeauth":null,"secretkey":"abcdefghijklmnopqrstuvwxyz"} now, thinking because rest api doesn't send jsonp. how can resolve issue? thanks in advance.

PHP - Return reference -

i m trying create function take array , create columns , values don't know how return references functions. appreciated. private function data($data) { $columns = ""; $values = array(); foreach ($data $column => $value) { $columns .= ($columns == '') ? '' : ', '; $columns .= $column; $values[$column] = &$data[$column]; } return array($columns, $values); } this function inserts data in database. /** * insert item items table. * * @param (array) $data - column => value array created in item class. */ public function insertitem($data) { $columns = ""; $values = array(); $prep = "isiisiisiiis"; /*foreach ($data $column => $value) { $columns .= ($columns == '') ? '' : ', '; $columns .= $column; $values[$column] = &$data[$column]; }*/ $thedata = $this->data($data); $a = str_repe...

Matplotlib: Grouped boxplots using data from numpy array and lists of group/subgroup labels -

i'm new matplotlib / python, , trying make grouped boxplot similar joe kington's excellent example shown here: how make grouped boxplot graph in matplotlib i'd modify joe's example own requirements. for demo data below, have 5 individuals each have 4 attempts ( = "attempts": '1st','2nd','3rd','4th') @ each of 3 different tasks (= "tasks": 'a','b','c'). i'd able to: 1) input data series of 2d numpy arrays, 1 array per task shown, each composed of scores of 5 individuals nested within 4 sequential attempts. 2) label both tasks , attempts on shared x-axis of plot using strings, saved sequential items in lists "tasklist" , "attemptlist" respectively. 3) generalise solution make appropriate plots number of individuals, , number of tasks, each requiring number of repeated attempts. edit: 2 apr 2015: the problem outstanding seemingly counter-intuitive way ...

c# - my windows phone app reminder not fire my page -

i use reminder class developing reminder app not launching page set in reminder instance code: uri uri = new uri("/custompage.xaml", urikind.relative); reminder reminder = new reminder("myreminder") { title = "remindertitle", content = "wakeup", begintime = datetime.now.addminutes(2), recurrencetype = recurrenceinterval.daily, expirationtime = datetime.today.adddays(30), navigationuri = uri }; scheduledactionservice.add(reminder); so after popup windows reminder page

javascript - check if object is a mongo cursor -

i have method in want either receive list or mongo cursor , react that, example: createfromtemplate: function(template) { var iter; if(template instanceof mongo.cursor) { iter = template.fetch(); } else if(template instanceof array) { iter = template; } else { throw new meteor.error(500, 'template must cursor or array'); } } however, seems return false when don't expect it > var p = pagetemplates.find(); // mongo cursor > var parray = p.fetch(); // array > object.prototype.tostring.call(p); [object object] > typeof p object > p instanceof mongo.cursor false how can tell if object mongo cursor? you should able use instanceof mongo.collection.cursor (not mongo.cursor ). console: > = meteor.users.find() <- localcollection.cursor {collection: localcollection, sorter: null, _selectorid: undefined, matcher: minimongo.matcher, skip: undefined…} > instanceof mongo.collection.cursor <- true

string - Bash extract after substring and before substring -

say have string: random text before authentication_token = 'pywastsemjrmqwjyczpz', gravatar_hash = 'd74a97f i want shell command extract after "authentication_token = '" , before next ' . so basically, want return pywastsemjrmqwjyczpz . how do this? use parameter expansion: #!/bin/bash text="random text before authentication_token = 'pywastsemjrmqwjyczpz', gravatar_hash = 'd74a97f" token=${text##* authentication_token = \'} # remove left part. token=${token%%\'*} # remove right part. echo "$token" note works if random text contains authentication token = '...' .

ruby sequel access json field -

i have following schema: column | type | modifiers ---------+-----------------------------+------------------------ id | text | not null data | json | not null created | timestamp without time zone | not null default now() if open psql can run query. select id, data->'amount' amount plans; but ruby sequel gem ruins it. puts $db.run("select id, data->'amount' amount plans") what's wrong? needed #literal method. $db.run("select id, data -> #{ $db.literal('amount') } amount plans")

swing - Java: Add 2 animated objects (paintComponent) on the same JPanel -

i have class creates animated object (an wormlike animation) repainting through timer. , class have frame , panel. when create 2 (mov , mov2) instances of object , add panel, appear in separeted panels (or seems like). heres code. public class movimento extends jcomponent{ int t; int a; int[][] matriz; public movimento(int tamanho, int area){ t = tamanho; = area; gerarmatriz(); gerarpanel(); actionlistener counter = new actionlistener() { public void actionperformed(actionevent ev){ movimentarmatriz(); repaint(); } }; new timer(1, counter).start(); } public void gerarpanel(){ this.setpreferredsize(new dimension(a, a)); } public void gerarmatriz(){ /* *generates array[][] initial coordinates */ } public void movimentarmatriz(){ /* * add new coordinate las...

.net - Detect Mouse Hook -

i have application launches problem steps recorder utility ships windows 7 , later records user mouse , keyboard interactions. creating new process instance , launching psr number of command line parameters, including 1 suppresses gui. my app needs wait until utility has set mouse hook before proceeding. i'm able wait until i'm process has started successfully, utility not expose sort of event when has started recording. no gui, process.waitforinputidle() can't tell me when i'm ready proceed either. is there way detect when new low level mouse hook has been set third party application?

Override a style in Android without modifying layout file -

my experience until when dealing styles has been create style.xml file , create properties want style. if want style based on existing style, use parent attribute. specify style inside of layout file on controls want apply style to. where @ loss when want use system styles , update properties. wondering whether can leave layout files alone , not bother applying styles controls. instead, somehow update property of system style , update everywhere in app style being used default. more specifically, want change background color of actionbar haven't found way of doing other way described above. you're looking themes, collections of styles, applied either globally throughout application, or each activity in particular. start this document , investigate further.

xforms - Use read-only xf:input as xf:output in Orbeon? -

Image
can use read-only xf:input act xf:output in orbeon? how set value of readonly input field? simpler code sample: <xf:input ref="//some/elements/totalcredit" value="round(($quantity) * ($creditperunit))"> </xf:input > <xf:output ref="//some/elements/totalcredit" value="round(($quantity) * ($creditperunit))"/> in above code xf:input shows initial value model! doesn't update! xf:output value updated expected! so, how can set xf:input 's value xf:output ? i don't want use calculation in bind. in example, have xf:input both ref , value ; not sure expect do, or if makes sense, sure won't work: with xf:output , can have both ref , value , node pointed ref can influence whether xf:output shown , value gives value. if want same xf:input , can put result of calculation in ref (in case round(($quantity) * ($creditperunit)) ). if expression returns atomic value, inp...

python - Minimum of Numpy Array Ignoring Diagonal -

i have find maximum value of numpy array ignoring diagonal elements. np.amax() provides ways find ignoring specific axes. how can achieve same ignoring diagonal elements? you use mask mask = np.ones(a.shape, dtype=bool) np.fill_diagonal(mask, 0) max_value = a[mask].max() where a matrix want find max of. mask selects off-diagonal elements, a[mask] long vector of off-diagonal elements. take max. or, if don't mind modifying original array np.fill_diagonal(a, -np.inf) max_value = a.max() of course, can make copy , above without modifying original. also, assuming a floating point format.

Matlab: Bar chart x-axis labels missing -

Image
i'm using following code create bar chart in matlab. a = [1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9] bar(a) set(gca,'xticklabel',{'one','two','three','four','five','six','seven','eight','nine','zero','one','two','three','four','five','six','seven','eight','nine'}) code works fine except x-axis labels don't appear on corresponding position on x-axis. how resolve issue? when set xticklabel , telling matlab replace text each tick currently new text provide. if run first 2 lines, see matlab default has put xticks on 0:2:20. can resolve issue first telling matlab put ticks each individual bar, , re-labeling these ticks: a = [1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9] bar(a) set(gca, 'xtick', 1:length(a)) set(gca,'xticklabel',{'one','two','three','four','five...

python - How does one draw the X = 0 plane using matplotlib (mpl3d)? -

Image
here answer lets 1 plot plane using matplotlib , if 1 uses vector [1, 0, 0] , nothing gets plotted! makes sense, because of way code set (meshgrid on x-y plane, , z points determine surface. so, how can plot x = 0 plane using matplotlib? this less generic example linked, trick: import numpy np import matplotlib.pyplot plt mpl_toolkits.mplot3d import axes3d yy, zz = np.meshgrid(range(2), range(2)) xx = yy*0 ax = plt.subplot(projection='3d') ax.plot_surface(xx, yy, zz) plt.show()

Adding Library to project in Android Studio -

i working mupdf library rendering pdf files in android application. for built mupdf library using ndk , different tools. now want add compiled code project in android studio. i quite new android studio not able it. so can 1 me with. i trying follow this link. you add library in libs directory here: c:\users\blabala\desktop\project\app\libs and write in gradle this: dependencies { compile filetree(include: ['*.jar'], dir: 'libs') } also can watch this tutorial. more information here update: c:\users\balbala\desktop\appname\library just add library in project rebuild project , go but have change manifest of library this: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.blabala"> <uses-sdk android:minsdkversion="4" android:targetsdkversion=...

json - Apache Camel HTTP / HTTP4 ignores Content-Type header -

i'm trying send http call through apache camel using camel-http. when set header content-type ignores header , doesn't include in call. i have tried set header has follows: exchange.getout().setheader('content-type', 'application/json'), and exchange.getout().setheader(exchange.content_type, 'application/json'); i have tried using camel-http , camel-http4 , doesn't work of them. since have to, mandatorily, send content-type header, how can force camel-http include it? note: i'm setting other headers same way correctly send call, it's content-type 1 doesn't work you need following set content-type: <setheader headername="content-type"> <constant>application/json</constant> </setheader> this work set content-type.

How to covert date variable to java.sql.date -

i facing difficulties while trying insert date variable database table. variable called: date date4; the date4 variable value read textbox has calendar picker. inserting in date column, setting field type date: preparedstmt.setdate(4,date4); however, got below message after submitting form: javax.faces.component.updatemodelexception: java.lang.illegalargumentexception: cannot convert 4/1/15 12:00 of type class java.util.date class java.sql.date also, there way insert field in format of date ("dd-mon-yyyy")? convert util date sql date java.sql.date sqldate = new java.sql.date(date4.gettime());

html - Table row width is changing to do match an element which is not inside the table-row -

Image
i have following html structure input icon on left side. <div class="fieldset"> <p>normal input</p> <div> <span><i class="icon-cart"></i></span> <input name=""> </div> </div> i using display:table properties style structure desired layout demonstrated in following image: however, icon ( <span> ) stretching width according title ( <p> ) above image below demonstrate: here current css used: /*fieldsets*/ .fieldset { width: 100%; display: table; position: relative; white-space: nowrap; margin-bottom: 15px; } .fieldset:last-of-type { margin-bottom: 0; } /*fieldsets > labels*/ .fieldset > p { width: 1%; margin-bottom: 3px; } /*fieldsets > input container*/ .fiel...

cocoa touch - How do you set a gradient fillcolor for cashapelayer without using a mask? -

Image
how set gradient fillcolor cashapelayer? related question clearer explanation: using cocoa follow path gradient i need gradient that's not mask, instead gradient based on drawing of cashapelayer's path. i can't use gradient mask on top, because i'm making route on minimap in game. if player walks on own tracks, should in different color. i want mapview's polyline: source: http://cdn4.raywenderlich.com/wp-content/uploads/2014/06/23_multicolor_polyline.png i made minimap route by: logging user's different directions, running them through loop bezier paths. i appended bezier paths, , put on cashapelayer. is there way have multicolored in cashapelayer? is there keypath cabasicanimation can put gradient? my code below, , images. [mymapview.layer.sublayers makeobjectsperformselector:@selector(removefromsuperlayer)]; [[mymapview subviews] makeobjectsperformselector:@selector(removefromsuperview)]; int = 0; int x = 17; int y = 272; int m = 16; u...

How do I iterate over a hashtable in F#? -

let dic = environment.getenvironmentvariables() dic |> seq.filter( fun k -> k.contains("comntools")) fails compile. i've tried using array.filter, seq.filter, list.filter i've tried getting dic.keys iterate on f# doesn't seem want me coerce keycollection ienumerable . i've tried upcasting hashtable ienumerable<keyvaluepair<string,string>> how walk hashtable returned environment.getenvironmentvariables() ? since environment.getenvironmentvariables() returns non-generic idictionary , stores key/value pairs in dictionaryentry , have use seq.cast first: let dic = environment.getenvironmentvariables() dic |> seq.cast<dictionaryentry> |> seq.filter(fun entry -> entry.key.tostring().contains("comntools")) see relevant docs @ https://msdn.microsoft.com/en-us/library/system.collections.idictionary(v=vs.110).aspx . notice entry.key of type obj , 1 has convert string before checking string contai...

soap - python response does not match with soapUI -

when access web service using soapui correctly formatted text. when use python code, dictionary rows in single allbustype key. from pysimplesoap.client import soapclient url = 'http://180.92.171.93:8080/upsrtcservices/upsrtcservice?wsdl' namespace = 'http://service.upsrtc.trimax.com/' client = soapclient(wsdl=url, namespace=namespace, trace=true) print client.getbustypes() the above code returns following: {'return': {'allbustype': [{'busname': u'ac sleeper'}, {'bustype': u'acs'}, {'ischildconcession': u'n'}, {'isseatlayout': u'n'}, {'isseatnumber': u'n'}, {'busname': u'ac-janrath'}, {'bustype': u'jnr'}, {'ischildconcession': u'n'}, {'isseatlayout': u'y'}, {'isseatnumber': u'y'},.... as per following screen, soapui returning bus stops separate tag. (and not stops in single tag above) ...

c# - Why do changes made in foreach to a Linq grouping select get ignored unless I add ToList()? -

i have following method. public ienumerable<item> changevalueienumerable() { var items = new list<item>(){ new item("item1", 1), new item("item2", 1), new item("item3", 2), new item("item4", 2), new item("item5", 3) }; var groupeditems = items.groupby(i => i.value) .select(x => new item(x.first().name, x.key)); foreach (var item in groupeditems) { item.calculatedvalue = item.name + item.value; } return groupeditems; } into groupeditems collection calculatedvalue s null. if add tolist() select sentence after groupby calculatedvalue s has values. example: var groupeditems = items.groupby(i => i.value) .select(x => new item(x.first().name, x.key)).tolist(); so, question is. why this? want know reason this, solution me add tolist() update...

javascript - hyperlinks in force-directed just won't work -

context : need force-directed graph have labels pointing urls. i reusing these examples : http://bl.ocks.org/mbostock/4062045 hyperlinks in d3.js objects, part 2 my file : <!doctype html> <meta charset="utf-8"> <style> .node { stroke: #666; stroke-width: 1.0px; } .link { stroke: #ccc; } .node text { pointer-events: none; font: 12px sans-serif; } </style> <body> <script src="http://d3js.org/d3.v3.min.js"></script> <script> //constants svg var width = 900, height = 600; //set colour scale var color = d3.scale.category20(); //set force layout var force = d3.layout.force() .charge(-100) .linkdistance(100) .size([width, height]); var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); // read json file d3.json("collection_url.json", function(error, graph) { force.nodes(graph.nodes) ...

jquery - Here i am applying model validation and I want to stop post my form but its not working -

my form code on trying: @using (html.beginform("contactus", "home", formmethod.post, new { id = "frmcontactus", enctype = "multipart/form-data" })) { <div class="form_style"> @html.textboxfor(m => m.name, new { @placeholder = "name", @class = "inputtype" }) @html.validationmessagefor(m => m.name) </div> <div class="form_style"> @html.textboxfor(m => m.email, new { @placeholder = "email", @class = "inputtype" }) @html.validationmessagefor(m => m.email) </div> <div class="form_style"> @html.textareafor(m => m.message, new { @placeholder = "message", @class = "inputtype texarea"...

error handling - Exceptions in PHP - set_exception_handler output -

i'm starting use set_exception_handler now. first place tested try/catch block pdo layer. i forced exception incorrect database credentials. (this before applied <?php function log_exception($exception){ print_r($exception); } set_exception_handler("log_exception"); try { $dbh = new pdo(); $dbh->setattribute(pdo::attr_errmode, pdo::errmode_exception); echo "connected!! \n"; } catch (pdoexception $e) { print_r($e); // let's see looks throw new exception($e); } ?> you'll see print_r inside catch , in log_exception function. this gets displayed print_r($e) : pdoexception object ( [message:protected] => sqlstate[28000] [1045] access denied user 'localhost'@'127.0.0.1' (using password: yes) [string:exception:private] => [code:protected] => 1045 [file:protected] => /var/www/html/test.php [line:protected] => 35 [trace:exception:private] =>...

php - Reuse instance of class -

i thinking missing out on oop php. i developing plugin wordpress have class declaration book: <?php class wpbook{ private $title; function settitle($_title){ $this->title = $_title; } function gettitle(){ return $this->title; } } ?> add_action( 'hookone', 'function_do_stuff'); add_action( 'hookafter_hookone', 'function_do_more_stuff'); function function_do_stuff(){ //some more stuff $newbook = new wpbook; $title = $newbook->settitle ='titlea'; echo $title; //echos 'titlea'; // function_do_more_stuff($title); not work because // function called on hookafter_hookone } function function_do_more_stuff(){ // here want access $title function_do_stuff(); // not know how. } now want able access title of book do_stuff() function function do_more_stuff() . the problem can't use returns form do_stuff() do_more_stuff() , because do_more_stuff() ca...

php - PHPStorm CodeStyle Put Space Before and After -> -

i using phpstrom 8.0.3 , can't find how make possible. when using aptana editor time ago, liked way formatted code. , trying configure phpstorm code style. i configure phpstorm change $this->some(); to $this -> some(); i've checked settings- > code style -> php couldn't find anywhere. may missing something. know how put space before , after -> contacted jetbrains , here reply unfortunately, there no such option in phpstorm @ moment. however, have related feature request submitted here: https://youtrack.jetbrains.com/issue/wi-12067 .

c# - Performance with SQL Server cursor in following application scenario -

i've wondered how can modify application because have performance problem. have following application scenario. i've used c# console application sql server. application scenario: select 15 000 unique userid (int) foreach list of users , list of documents (documentid) every userid. ( perhaps 50 documents per 1 user. ) insert database table called permissions - userid, documentsid - perhaps - 15 000 * 50 = 750 000 rows my scenario: i have create 2 stored procedures in sql server, first select userid's , second documents according userid , inserting permissions table. stored procedure: dbo.createdocumentpermissions declare @userid bigint begin try declare permissionscursor cursor select userid dbo.[user] open permissionscursor fetch next permissionscursor @userid while @@fetch_status = 0 begin begin try exec dbo.savedocumentspermissions @userid = @userid end try begin cat...

ios - Overwrite animation duration in Appcelerator -

i developing game has timer bar running across screen while playing. when game ends want timer bar stop running. have following animation: var startanimation = ti.ui.createanimation({ right: "0dp", duration: 20000, curve: titanium.ui.animation_curve_linear }); //animate progress bar $.timegoalprogress.animate(starthighscoreanimation); which want overwrite with: var stopanimation = ti.ui.createanimation({ right: "100dp", duration: 1 }); $.timegoalprogress.animate(stopanimation); but duration of animation not overwritten second duration. happens right value replaced new right value, duration stays 20000. does know how overwrite duration of animation? use sdk version 3.5.1 , developing ios.

android - Unity UI Button, strange behavior with triggering OnClick() -

using unity 5.0. working on android. i have canvas -> inside panel -> inside button. the button has in button script onclick() gameobject linked. gameobject has script function. when tap button trigger function, working on unity. but when deploy project on android (4.4.2) device, works if tap , leave finger fast. otherwise if tap , wait second, when remove finger onclick() not called anymore. seems triggering sort of "long tap" , ignoring normal tap. missing seetings? have not code @ all, function, rest done via unity inspector. you suffer same problem did. check value "drag threshold" "event system (script)" find in inspector once select eventsystem in hierarchy. default value 5 tiny , briefest of touches not register click drag. increase size. use 20 , buttons work expected on android. reminds me have check on ios again well. good luck

sphinx - What is instead max_matches? -

i have sphinx 2.2.7. in version, "max_matches" deprecated. use instead? a result of query has in average 20000 rows. its server wide 'cap' being deprecated. it still exists query time parameter. defaults 1000, can overridden on per query basis.

objective c - View jumps back after setting center in iOS 8 -

Image
i’m beginner xcode, , have problem counter in app. when put timer count points player(paddle) jump in place in first time(in middle) everytime when timer count point. so should keep paddle is? there other way count points? its doesnt matter how control player swipe or g-sensor, in example control swipe. , problem appears in ios 8.0> , not in ios 7. here code: .h file: int scorenumber; @interface viewcontroller : uiviewcontroller{ iboutlet uilabel *scorelabel; nstimer *timer; } @property (nonatomic, strong)iboutlet uiimageview *paddle; @property (nonatomic) cgpoint paddlecenterpoint; @end .m file: @implementation viewcontroller -(void)touchesmoved:(nsset *)touches withevent:(uievent *)event{ uitouch *touch = [touches anyobject]; cgpoint touchlocation = [touch locationinview:self.view]; cgfloat ypoint = self.paddlecenterpoint.y; cgpoint paddlecenter = cgpointmake(touchlocation.x, ypoint); self.paddle.center = paddlecent...

listview - customize android.R.layout.simple_list_item_checked -

Image
i want change drawable of predefined checked in android.r.layout.simple_list_item_checked possible? from checked and unchecked to checked and unchecked and don't want create custom list item. this possible using custom layout standard adapter, can defining same ids predefined layout custom layout changing ones want. unfortunately in case, source code android.r.layout.simple_list_item_checked doesn't have drawable default. ( https://github.com/android/platform_frameworks_base/blob/master/core/res/res/layout/simple_list_item_checked.xml ) uses checkmark attribute android:checkmark="?android:attr/textcheckmark" i'm unsure whether can change this, still reccomend using custom layout standard adapter, compare original current layout , define same attributes drawable instead of checkmark, in example below: it's though. <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" a...

dependency injection - Simple injector getting instance of UserStore -

this how i'm registering identity classes: container.registerperwebrequest<appdbcontext>(); container.registerperwebrequest<iappuserstore>(() => new appuserstore(container.getinstance<appdbcontext>())); container.registerperwebrequest<appusermanager>(); container.registerperwebrequest<appsigninmanager>(); container.registerinitializer<appusermanager>( manager => initializeusermanager(manager, app)); account controller: private readonly appsigninmanager _signinmanager; private readonly appusermanager _usermanager; public accountcontroller(appusermanager usermanager, appsigninmanager signinmanager ) { _signinmanager = signinmanager; _usermanager = usermanager; } everything good, when try type var test = new container().getinstance<iappuserstore>(); i next error: no registration type iappuserstore found but getinstance...

bitbucket - Remove files from git repository without cloning it -

for reason repository on bitbucket need clone contains large files don't require. is possible clone repository without these files ? or maybe possible delete these files without cloning repo in first place? with git cannot clone partially repository bitbucket, can delete directly file website open bitbucket , go dashboard of repo click on source select branch click on file want delete near of edit button, select arrow, , delete edit commit message [optionnal] can create pull request validate commit enjoy

Calculation of DST in Javascript -

i using below code calculate different countries manually not reflecting dst kindly guide me achive same st gallen time 1 hour back. <span id="clock01"></span> <script type="text/javascript"> function calctime00(city, offset) { settimeout("1"); d5 = new date(); d = new date(); utc = d.gettime() + (d.gettimezoneoffset() * 60000); nd = new date(utc + (3600000*offset));//by smt var area=""+city+"&nbsp&nbsp&nbsp&nbsp&nbsp"+nd.tolocaletimestring().replace(/:\d{2}\s/,' '); $('#clock01').html(area); settimeout(function () { calctime00('','+2');}, 1000); } </script>

c# - The name 'AutomationId' does not exist in the current context -

i have assembly ui automation tests (white). i've introduced class autination id's reused in assembly: public static class automationid { public static class toolbar { public const string mycontrol = "mycontrolid"; } } and i'm trying use in test class (the same assembly): var control = mainwindow.get<button>(automationid.toolbar.mycontrol); this code can compiled locally. on teamcity i'm getting such error: the name 'automationid' not exist in current context it's c# 6 feature. similar problem: the name 'nameof' not exist in current context i encountered problem now, lead me here. research indicates need update teamcity: http://dave.ninja/2015/08/06/upgrading-teamcity-to-support-visual-studio-2015/ we still have this, well. post above shows lot of solutions issues encountered while upgrading. didn't seem painful process.

Connecting netbeans (JAVA) to MYSQL -

the problem when run code, answer col12 instead of getting columns data getting in mysql workbench. need same values. when use query "delete test col1 = 2;" in netbeans error exception. here code wrote in netbeans. package sams; import java.sql.*; import java.sql.statement; import java.sql.drivermanager; public class temp_class { public static void main(string[] args){ try { string query="select * test"; class.forname("com.mysql.jdbc.driver"); connection con= drivermanager.getconnection("jdbc:mysql://localhost/javaproject", "root", "19881990"); statement st=con.createstatement(); resultset rs=st.executequery(query); rs.next(); string sname= rs.getstring(2); system.out.println(sname); con.close(); } catch (exception e) { system.out.println("error"); } } } i have made table test in mysql workbench, co...

vim, is it possible to add increasing numbers next to words each time the words are repeated in a text? -

let's assume have text file following content: abrader ah b r ey d ah abrader ah b r ey d ah r abraders ah b r ey d ah z abrades ah b r ey d z april ey p r ah l april ey p r ah april ey ah p r ah i execute vim command looks duplicates , adds counter (inside brackets) in each word repeated, checks first word in each line. in current example, resulting text should be: abrader ah b r ey d ah abrader(2) ah b r ey d ah r abraders ah b r ey d ah z abrades ah b r ey d z april ey p r ah l april(2) ey p r ah april(3) ey ah p r ah here pure vim solution, modeled after @kent's awk solution (oneliner split here on multiple lines readability): let d = {} | \ global/^\s/ \ let cw = expand('<cword>') | \ let d[cw] = ge...

function - Cant have class in javascript innerHTML -

<div id="mydiv" class="example">example text.</div> <button onclick="myfunction()">click me</button> i have function changes inner html myfunction() { document.getelementbyid('mydiv').innerhtml="<ol class="example"><li>example 1</li><li>example 2</li><li>example 3</li></ol>" } and when add class error: unexpected identifier. why this? if have in javascript , both "" , '' valid strings , happens if want use "" or '' inside string? var str = "he said me 'hi'" there no problem, long nested character (" or ') different outer character (' or " respectivly) so in example : myfunction() { document.getelementbyid('mydiv').innerhtml="<ol class='example'><li>example 1</li><li>example 2</li><li>example 3</l...