Posts

Showing posts from March, 2014

javascript - React Native Border Radius with background color -

Image
in react native, borderradius working background color given button stays square. going on here? js <touchablehighlight style={styles.submit} onpress={() => this.submitsuggestion(this.props)} underlaycolor='#fff'> <text style={[this.getfontsize(),styles.submittext]}>submit</text> </touchablehighlight> style ... submit:{ marginright:40, marginleft:40, margintop:10, }, submittext:{ paddingtop:20, paddingbottom:20, color:'#fff', textalign:'center', backgroundcolor:'#68a0cf', borderradius: 10, borderwidth: 1, bordercolor: '#fff' }, ... try moving button styling touchablehighlight itself: styles: submit:{ marginright:40, marginleft:40, margintop:10, paddingtop:20, paddingbottom:20, backgroundcolor:'#68a0cf', borderradius:10, borderwidth: 1, bordercolor: '#fff' }, submittext:{ colo...

javascript - identify image paint complete in browser -

incase of high resolution image load in browser, after network got image server. browser taking time display them paints gradually. how can identify paint job complete browser? http://postimg.org/image/txm6e94jz/ - check image. there image in home page half rendered, event can use, see image rendered fully? use window.requestanimationframe catch moment when image rendered: function imagerenderedcallback() { alert("image rendered callback executed"); }; function imagerenderingstarted() { requestanimationframe(imagerenderedcallback); }; // attach handler load event. document.getelementbyid('my-image').addeventlistener('load', function(){ requestanimationframe(imagerenderingstarted); }); #my-image { width: 1680px; height: 1260px } <body> <img id="my-image" src="http://www.hdwallpapers.in/download/mount_fuji_japan_highest_mountain-"> </body> see requestanimation...

azure - Cannot connect through RDP into remote HDinsight cluster -

i have created hdinsight cluster in azure platform. have enabled remote connection remote desktop user configured. cannot connect through file downloaded. says, server off or not have permission remote access ..etc. how can connect hdinsight remo

html5 - Javascript parseInt error on IE -

the below code doesn't work on ie , me? onclick="x.value=parseint(b.value*d.value*c.value)+parseint(a.value) on other browsers, seems fine , doing calculation , giving output on ie no matter do, output stays 0 value, below whole form targeting issue better : <form id="mainselection"> <h6>transfer fee calculator</h6> <select name="a"> <option value="0">select</option> <option value="0">dalaman</option> <option value="30">bodrum</option> </select> <select name="b"> <option value="0">resort</option> <option value="10">marmaris</option> <option value="12">icmeler</option> <option value="18">turunc</option> </select> <select name="c"> <option value="0">pax</option> ...

parse.com - Could not access Dropbox API via parse cloud code although works with CURL -

i trying access following end-point parse cloud code: https://api.dropboxapi.com/2/users/get_current_account details of end-point: https://www.dropbox.com/developers/documentation/http/documentation#users-get_current_account my cloud function @ point of making request. return parse.cloud.httprequest({ method: 'post', url: 'https://api.dropboxapi.com/2/users/get_current_account', headers: { 'authorization': 'bearer ' + accesstoken } }); error received dropbox: error in call api function "users/get_current_account": bad http "content-type" header: "application/x-www-form-urlencoded". expecting 1 of "application/json", "application/json; charset=utf-8", "text/plain; charset=dropbox-cors-hack" i tried using curl: curl -x post https://api.dropboxapi.com/2/users/get_current_account --header "authorization: bearer **access_token" this worked , got user...

javascript - Jquery subtracting different values -

i have function have 3 input fields. if input values anywhere on textfield, subtract each textfield has value totalnumber variable. var totalnumber = 3; var textfieldsleft = 0; var textfieldshasvalue = 0; <input type = "text" id = "first"> <input type = "text" id = "second"> <input type = "text" id = "third"> how can jquery if input input id ="first", value of textfieldleft = 2 , textfieldshasvalue = 1 , totalnumber = 2. here jquery code $(this).keyup(function(){ countvalue = $(this).val().length; //alert(gettext); if(countvalue != 0){ console.log('yes indeed has value'); $(this).css(colorblue); //alert(id); } }); i need track down how many fields left has not been filled out yet. just set common class inputs , perform aforementioned logic on change event. html:- <input type="text" id = "first" class="inps...

javascript - JS: While loop to find the product of consecutive integers -

all! i'm new programming , trying write while loop return product of numbers 1 n, inclusive. can't code work properly; keeps returning weird numbers. i think problem first line of while loop. it's it's not multiplying, don't know why. here code wrote: var n = 7; var multiplier = 1; while (multiplier <= n){ multiplier = (multiplier * multiplier+1); if (n < 6){ multiplier+= 2; } else { multiplier++; }; }; console.log(multiplier); the problem use of multiplier variable, using store result, instead need use separate variable store result , use counter variable like var n = 5; var multiplier = 1; var result = 1; while (multiplier <= n) { result *= multiplier++; }; document.body.innerhtml = (result); if @ loop below, @ end of 1st iteration multiplier 3, end of second loop 11 higher 7 loop exists. var n = 7; var multiplier = 1; while (multiplier <= n) { m...

android - How to start different activities on click of different recycler views -

i have recyclerview gridlayoutmanager. on click of each item want tstart different acticities. have tried not working. dashboardadapter class public class dashboardadapter extends recyclerview.adapter<dashboardadapter.viewholder>{ private list<dashboardpojo> countries; private int rowlayout; private context mcontext; public dashboardadapter(list<dashboardpojo> countries, int rowlayout, context context) { this.countries = countries; this.rowlayout = rowlayout; this.mcontext = context; } @override public viewholder oncreateviewholder(viewgroup viewgroup, int i) { view v = layoutinflater.from(viewgroup.getcontext()).inflate(rowlayout, viewgroup, false); return new viewholder(v); } @override public void onbindviewholder(viewholder viewholder, int i) { dashboardpojo country = countries.get(i); viewholder.countryname.settext(country.name); viewholder.countryimage.setimageresource(country.getimageresourceid(mcontext)); } @override ...

Create PHP WebSocket with SSL -

i have websocket chat on website , added ssl certificate website. when open website http , chat works. when open https it's not working. using javascript client chat ws:// protocol. changed protocol wss:// because of ssl encryption on page, won't work way. here's part of php server code creates socket: $host = 'localhost'; $port = '9000'; $null = null; $socket = socket_create(af_inet, sock_stream, sol_tcp); socket_set_option($socket, sol_socket, so_reuseaddr, 1); socket_bind($socket, 0, $port); socket_listen($socket); $clients = array($socket); how add certificate php socket? using different function call. http://php.net/manual/en/function.stream-socket-client.php and setting correct socket options http://php.net/manual/en/context.ssl.php

typo3 - Exclude Submenu in Typoscript without hiding its parent -

i want exlude submenu without hiding parent menu that idea, doesn't work: menu = hmenu menu { special = directory special.value = 2 1 = tmenu 1.expall = 1 1.expall.if { value = 97 equals.field = pid negate = 1 } ... thank help you need set "hide in menu" option, in future can it.

ios - SpriteKit Physics Joints corrupt for moving scene -

i've created spritekit scene physics bodys. working quite well. i'm scrolling scene around, using apple best practice "camera node". my scenes node tree that: scene |- world |- camera node |- game nodes physics bodys my problem is, during game create new nodes new joints (mostly fixed joints) dynamically. @ point, world node has different position in beginning (eg.: @ start (0,0), during game (1000,500)..) now, anchorpoint fixed joints not @ position want to, it's somewhere in scene. i assume, coordinate system of scene different coordinate system of physics engine. for anchor point, use following conversion: [world.scene convertpoint:node.position fromnode:node.parent]; i want set anchorpoint @ position of "node". after moving world node, calculation of anchorpoint not working anymore. thanks help! greetz - nekro update: code center scene on player - (void)centeronnode:(sknode*)node { cgpoint camerapositioninscene =...

php - Getting the text of the dropdown menu with using submit -

i wanna ask guys if there anyway can value of dropdown , pass php file without using way? way have options in menu coming database code on dropdown menu mysql_connect("localhost", "root" , ""); mysql_select_db("hotelgal"); $query3 = "select suite_code tblsuite suite_name = '".$suitename."'"; $result3 = mysql_query($query3); $row3 = mysql_fetch_assoc($result3); $suite = $row3['suite_code']; mysql_connect("localhost", "root" , ""); mysql_select_db("hotelgal"); $queryroom = "select * tblroom room_accommodation = '" . $suite . "' , status = 'available'"; $resultroom = mysql_query($queryroom); if ($resultroom && mysql_num_rows($resultroom) > 0) { echo '<form name = "room" method = "get" action = "reserveupdate.php">'; echo '<select name = "room" id = "roo...

python - Rolling window or occurrences for 2D matrix in Numpy per row? -

looking occurrences of pattern on each row of matrix, found there not clear solution on python big matrix having performance. i have matrix similar to matrix = np.array([[0,1,1,0,1,0], [0,1,1,0,1,0]]) print 'matrix: ', matrix where want check occurreces of patterns [0,0], [0,1] [1,0] , [1,1] on each rowconsidering overlapping. example given, both rows equal,ther result equal each pattern: pattern[0,0] = [0,0] pattern[0,1] = [2,2] pattern[1,0] = [2,2] pattern[1,1] = [1,1] the matrix in example quite small, looking performance have huge matrix. can test matrix matrix = numpy.random.randint(2, size=(100000,10)) or bigger example see differences first though on possible answer converting rows strings , looking occurrences based on this answer ( string count overlapping occurrences ): def string_occurrences(matrix): print '\n===== string count overlapping =====' numrow,numcol = np.shape(matrix) ocur = np.zeros((nu...

Show Notification Message to all the Users based on IP Address in Java? -

i want show notification message (using java frame ) users machine based on ip address. how create frame in users machine, please me. i created frame , code below: string message = "you got new notification message. not awesome have such notification message."; string header = "this header of notification message"; jframe frame = new jframe(); frame.setsize(300, 125); frame.setundecorated(true); frame.setlayout(new gridbaglayout()); gridbagconstraints constraints = new gridbagconstraints(); constraints.gridx = 0; constraints.gridy = 0; constraints.weightx = 1.0f; constraints.weighty = 1.0f; constraints.insets = new insets(5, 5, 5, 5); constraints.fill = gridbagconstraints.both; jlabel headinglabel = new jlabel("<html><font color = 'red'>"+header); //headinglabel.seticon(headingicon); // --- use image icon want heading image. headinglabel.setopaque(false); frame.a...

c# - Check if List<List<string>> contains a string -

how can check if list<string> s in list contain given string? know how loop, there way linq/in 1 line? if (lists.any(sublist => sublist.contains(str)))

wordpress - Is it secure to make adobe flash website? -

i making website using adobe flash , action script. heard lot flash vulnerabilities. is secure make website using adobe flash, comparably ordinary tools wordpress , joomla? in theory flash secure, recommend not using it. reasons flash has many vulnerabilities not because of websites using it, clients not updating flash clients. site depends on client security bad idea. there second reason not use flash , compatibility. flash won't work on iphones, android phones, windows phones , won't take long before browsers block ( firefox that! ). and third argument not necessary use flash anymore. can use html, css3 , maybe bit of javascript able flash once unique in.

c - n-th order Bezier Curves? -

Image
i've managed implement quadratic , cubic bezier curves.they pretty straightforward since have formula. want represent n-th order bezier curve using generalization: where and i'm using bitmap library render output, here code: // binomialcoef(n, k) = (factorial(n) / (factorial(k) * factorial(n- k))) unsigned int binomialcoef(unsigned int n, const unsigned int k) { unsigned int r = 1; if(k > n) return 0; for(unsigned int d = 1; d <= k; d++) { r *= n--; r /= d; } return r; } void nbeziercurve(bitmap* obj, const point* p, const unsigned int nbpoint, float steps, const unsigned char red, const unsigned char green, const unsigned char blue) { int bx1 = p[0].x; int by1 = p[0].y; int bx2; int by2; steps = 1 / steps; for(float = 0; < 1; += steps) { bx2 = by2 = 0; for(int j = 0; (unsigned int)j < nbpoint; j++) { bx2 += (int)(binomialcoef(nbpoi...

javascript - How to hide an animated gif after the file has been downloaded ? -

is there way make animated gif image disappear after server side java code executed , client gets http response webserver without using ajax? i´m using following struts2 submit button: <s:submit value="show data" onclick="myjsfunction()" /> method appear animated gif image: function myjsfunction(){ $("#containerwithgifimage").fadein("fast"); } method disappear animated gif image (but have no idea, how can call without ajax): function myjsfunction2(){ $("#containerwithgifimage").fadeout("fast"); } now gif appears not disappeared after java code on webserver executed. both questions (this , the other one ) examples of xy problem . before looking specific technologies, techniques or hacks, start defining goal: the goal download file without moving other pages; meanwhile, showing indicator (progress bar, animated gif, overlay, etc...); when file has been down...

javascript - Jquery to check Android native browser or Chrome -

i used script , many differnt ways.. still output both samsung native browser & chrome "android chrome" can pls solve issue? var nua = navigator.useragent; var is_android = ((nua.indexof('mozilla/5.0') > -1 && nua.indexof('android ') > -1 && nua.indexof('applewebkit') > -1) && !(nua.indexof('chrome') > -1)); var chrome_android = (nua.indexof('chrome') > -1); if(is_android){ $('.nativebrowser').show(); $('.othermobbrowser').hide(); alert("android native") } else if(chrome_android){ $('.nativebrowser').hide(); $('.othermobbrowser').show(); alert("android chrome") } var ua = navigator.useragent; var is_native_android = ((ua.indexof('mozilla/5.0') > -1 && ua.indexof('android ') > -1 && ua.indexof('applewebkit') > -1) && (ua.indexof('version...

php - session expires in codeigniter when ajax call is present (CI version 3.0.3) -

i using latest version of codeigniter. problem session expired automatically after sometime (some ajax calls present in page) i've found 1 solution problem says replace session.php this but didn't worked me. codeigniter version 3.0.3 update $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 0; $config['sess_save_path'] = null; $config['sess_match_ip'] = false; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = false;

Run Rscript.exe with VBScript and spaces in path -

i have followaing run.vbs script rexe = "r-portable\app\r-portable\bin\rscript.exe" ropts = "--no-save --no-environ --no-init-file --no-restore --no-rconsole " rscriptfile = "runshinyapp.r" outfile = "shinyapp.log" startchrome = "googlechromeportable\app\chrome-bin\chrome.exe --app=http://127.0.0.1:9999" strcommand = rexe & " " & ropts & " " & rscriptfile & " 1> " & outfile & " 2>&1" intwindowstyle = 0 ' hide window , activate window.' bwaitonreturn = false ' continue running script after launching r ' ' following sub call, no parentheses around arguments' createobject("wscript.shell").run strcommand, intwindowstyle, bwaitonreturn wscript.sleep 1000 createobject("wscript.shell").run startchrome, intwindowstyle, bwaitonreturn it works pretty in cases except when use...

angularjs - Make resolve in route to a reusable function -

i have lot of same code in resolve function. possible make reusable function of , pass resolve? from this... .when('/workers', { resolve: { "check": function () { if (!isloggedin() || !isadmin()) { window.location.href = '#/about'; } }, }, templateurl: 'html/admin/workers.html', controller: 'adminworkerscontroller' }) this: .when('/workers', { resolve: myresolvefunction() templateurl: 'html/admin/workers.html', controller: 'adminworkerscontroller' }) you can create provider route resolve var app = angular.module('app', []); //must provider since injected module.config() app.provider('routeresolver', function () { this.$get = function () { return this; }; thi...

python - Does Spyne support proxies? -

i use spyne call asp.net web services soap. spyne support proxies? (i'm using python 2.6) spyne not of solution soap client. i'd suggest @ suds .

sql - Joining Tables: Only (!) add missing rows -

Image
i want join following tables ( records , tip ). goal missing war rows (dependend on id ) added. example see war = 2 missing id = 80 . note: war smaller or equal value of tip. value of value should null in added rows. table in bottom goal. i not sure how solve problem. condition results of records."tip" >= tip."tip" . i use hana database. thank in advance. best regards. this how works (sorry these tips little bit confusing): select a."id", b."tip" "war", c."val" ( select distinct "id", max("tip") "max" records t group "id" ) inner join tip b on 1=1 left join t0 c on a."id" = c."id" , b."tip" = c."war" b."tip" <= a."max" order a."id", b."tip"

Logical operators equation in php -

i have problem function should combine logical operators according data in array: $arr = array( 0 => array(false, "or"), 1 => array(false, "or"), 2 => array(true) ); the equation should be: false or false or true ($arr[0][0] $arr[0][1] $arr[1][0] $arr[1][1] $arr[2][0]) and result: true but wrong happens in function , returns false. missing? var_dump( arrayboolvalidation($arr) ); function arrayboolvalidation (array $arr) { $num = count($arr); $status = $arr[0][0]; for($i = 1; $i < $num; ++$i) { if ($arr[$i-1][1] == "and") { $status = filter_var($status, filter_validate_boolean) , filter_var($arr[$i][0], filter_validate_boolean); } else if ($arr[$i-1][1] == "or") { $status = filter_var($status, filter_validate_boolean) or filter_var($arr[$i][0], filter_validate_boolean); } } return $status; } it's operator precedence issue. a...

sql server - best practice to load multiple client data into Hadoop -

we creating poc on hadoop framework cloudera cdh. want load data of multiple client hive tables. as of now, have separate database each client on sql server. infrastructure remain same oltp. hadoop used olap. have primary dimension tables same each client. client database has exact same schema. these tables have same primary key value. till now, fine have separate database client. trying load multiple client data same data container (hive tables). have multiple row same primary key value if load data directly hive multiple sql server databases through sqoop job. thinking use surrogate key in hive tables hive not support auto increment can achieved udf. we don't want modify sql server data it's running production data. a. standard/generic way/solution load multiple client data hadoop ecosystem? b. how primary key of sql server database table can mapped hadoop hive table ? c. how can ensure 1 client never able see data of other client? thanks @praveen: ...

mongodb - mongoimport with CSV: --headerline does not convert first row to fields -

when try import .csv file (non-existent) mongodb collection, first line not correctly converted fields. instead, 1 new field field names in it. in field, data stored. example csv: product;type apple;fruit pizza;italian coffee;drink the command use: mongoimport -d db -c collection --type csv --headerline --file ./import.csv the result 1 row: { "_id": objectid("56a89c5f3ea2a256f0da7acf"), "product;type": "coffee;drink" } does know whats wrong here? csv stands coma-separated values: https://docs.mongodb.org/manual/reference/glossary/#term-csv not semicolon-separated ones. preprocess import.csv sed -import.bak "s/;/,/g" import.csv

android - Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with multiple errors, see logs -

i trying implement gcm tutorial , first resolved permission problem, after error coming haev tried seveal link on stackoverflow, related permission declaration. pleaes me resolve issue. manifest file <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.example.akash.gcm5"> <uses-sdk android:minsdkversion="15" android:targetsdkversion="23" /> <uses-permission android:name="com.example.akash.gcm5.c2d_message" android:protectionlevel="signature"/> <uses-permission android:name="com.example.akash.gcm5.c2d_message" /> <uses-permission android:name="com.google.android.c2dm.permission.receive" /> <uses-permission android:name="android.permission.wake_lock" /> ...

nginx - CC command not found on openresty installation -

i not familiar linux , have started learning nginx , nodejs. since work windows tried install openresty through mingw running: tar xvf ngx_openresty-1.9.7.1.tar.gz cd ngx_openresty-1.9.7.1/ ./configure but following error: platform: msys (msys) cp -rp bundle/ build cd build cd luajit-2.1-20151219 can't exec "cc": no such file or directory @ ./configure line 588. make target_strip=@: ccdebug=-g cc=cc prefix=/usr/local/openresty/luajit ==== building luajit 2.1.0-beta1 ==== make -c src make[1]: cc: command not found make[1]: entering directory `/c/ngx_openresty-1.9.7.1/build/luajit-2.1-20151219/src' make[1]: cc: command not found make[1]: cc: command not found make[1]: cc: command not found make[1]: cc: command not found make[1]: cc: command not found makefile:262: *** unsupported target architecture. stop. make[1]: leaving directory `/c/ngx_openresty-1.9.7.1/build/luajit-2.1-20151219/src' make: *** [default] error 2 error: failed run command: make target_...

javascript - jQuery not working when inside a document ready function -

i've had problem days , after looking around , google cannot seem fix it. i working offline in wamp building website. including jquery in <head> section using google api's: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> it seems other jquery plugins work apart ones im trying build myself. all written jquery placed in file called sitename.js , in /js/ directory other js scripts. now thing is, can't seem $(document).ready(function() work, or click events. this script: $(document).ready(function(){ console.log("test"); }); when move console.log outside document ready function, displays in console (firebug) when inside, not. click events not work either, , have no idea why: $('.more').live("click",function(){ console.log("test"); } this not work either, , have div class name of more . i'm not sure problem is, whether incorr...

ruby on rails - Custom user attributes with devise_token_auth -

i have created new api using rails/edge , i'm using devise devise_token_auth has generated me user model. my question this, after migrating , adding new attributes user model how return in json response, being generated devise_token_auth? as mentioned in comment above. far best solution create separate userdetails model, serialize make separate call after auth populate user data. which seem quite nice keeps auth clean.

java - How to perform a method of another class when I click the Accept Button of my Dialog which is located in another class? -

this snippet here in mainactivity.java calls "newdrawing()" method of class named tools.java. public void onclick(view v) { string color = null; switch (v.getid()){ case r.id.newdraw_a: tools buttons = new tools(this); buttons.newdrawing(); break; the "newdrawing()" method dialog asks user add drawing or cancel. when user clicks "accept", want call method class named "canvas_class.java". public class tools extends view{ public canvas_class drawing; public tools(context context) { super(context); } public void newdrawing(){ final alertdialog.builder newdialog = new alertdialog.builder(this.getcontext()); newdialog.settitle("new drawing?"); newdialog.setmessage("you overwrite current drawings. sure want add drawing?"); newdialog.setpositivebutton("accept", new dialoginterface.onclicklis...

How can I count the numbers greater than 18 in same cell in excel -

how can count numbers greater 18 in same cell in excel 20 26 37;28 17 not provided not provided not provided 17 30;26;6;4;3 not provided not provided 30 assuming that: 1) range in question a1:a5 2) given cell within range, if there multiple numbers within cell these numbers ever separated commas then, array formula** : =count(1/(1/(1/(0+(0&trim(mid(substitute(a1:a5,",",rept(" ",max(len(a1:a5)))),max(len(a1:a5))*(column(index(1:1,1):index(1:1,1+max(len(a1:a5)-len(substitute(a1:a5,",","")))))-1)+1,max(len(a1:a5)))))))<18)) change <18 @ end required. regards **array formulas not entered in same way 'standard' formulas. instead of pressing enter, first hold down ctrl , shift, , press enter. if you've done correctly, you'll notice excel puts curly brackets {} around formula (though not attempt manually insert these yourself).

javascript - how to add Razor element dynamically with new name and id? -

i have following razor code. need add dynamically on button click in client side. <div class="form-group" id="transitem" name="transitem"> <div class="col-md-11" id="tritem" name="tritem"> @html.labelfor(model => model.transaction_item_id, "transaction_item_id", htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-3"> <div id="trans_dd_1" name="trans_dd_1">@html.dropdownlist("transaction_item_id", null, htmlattributes: new { @class = "form-control", @id = "trans_id_#", @name = "trans_id_#" })</div> @html.validationmessagefor(model => model.transaction_item_id, "", new { @class = "text-danger" }) </div> <div> @html.labelfor(model =...

wpf - ContextMenu.ItemSource binding issue -

i have static resource defined follows: <contextmenu x:key="testcontextmenu" datacontext="{binding path=placementtarget, relativesource={x:static relativesource.self}}"> <menuitem command="applicationcommands.cut"/> <!--<contextmenu.itemssource> <compositecollection> <menuitem command="applicationcommands.cut"/> </compositecollection> </contextmenu.itemssource>--> </contextmenu> my application works fine this. however, want able add items context menu. instead of adding menu items want use compositecollection , run binding issues. minimized problem , ended this. when comment menuitem , uncomment contextmenu.itemsource error: system.windows.data error: 4 : cannot find source binding reference 'relativesource findancestor, ancestortype='system.windows.controls.itemscontrol', ancestorlevel='1...

matlab - Detected SURF Feature location -

i using surf on image size of 60*83 varying scale levels , metricthreshold generate more blobs. location of points2 vector showing coordinates beyond dimension of input image size. wonder why is. need obtain exact coordinate of detected key-points. i2 = rgb2gray(temp); %i2= 60*83 uint8 points2 = detectsurffeatures(i2,'numscalelevels',6,'metricthreshold',600); i trying location of detected points in command window , showing following coordinates ( see highlighted x-axis coordinate exceeding dimension). if use following code coordinates inside image dimension. points2 = detectsurffeatures(i2); i need using varying scale levels , metricthreshold. in advance. matlab stores matrix nofrows x nofcols detectsurffeatures returns positions [x,y] http://www.mathworks.com/help/vision/ref/surfpoints-class.html so results in range.

excel macro to execute multiple query & fetch records -

as of have 1 standard database connection (via menu or toolbar) working fine. fetch records 3 different period ( each sheet can have different query). before positing did various attempts couldn't able fetch record via macro. looking suggestion or direction implement requirement. cell a1 = "name". for,sheet1: select "name" testdb for,sheet2: select "name" testdb data >= abc & date <=xyz for,sheet3: select "name" testdb wehre data >= xyx use record macro button in developer tab record actions take when create such connection parameters want. then stop recording , go vba screen, take @ how code looks , either change want liking or record 3 versions way. now integrate these vba codes vba script.

Submit form with PHP cURL, multiple checkboxes with same name -

i trying submit external form using php curl. form fields working fine, except problem have multiple checkboxes same name. <input type="checkbox" name="same_name" value="value_1"> <input type="checkbox" name="same_name" value="value_2"> <input type="checkbox" name="same_name" value="value_3"> i have no problem passing 1 of checkboxes in curl request. in post string, do: curl_setopt($ch, curlopt_postfields, '...&same_name=value_1'); but now, want submit form multiple boxes checked. tried suggestion in comments on this stackoverflow post: curl_setopt($ch, curlopt_postfields, '...&same_name[]=value_1&same_name[]=value_2'); but response based on no checked checkboxes @ all, ergo doesn't work. basically, how can submit such array correctly in request? can point me in right direction? if it's form (you can change code), ch...

ruby - rails POST on /objects calling index method -

normally in rails, sending post restful controller, say, /orders , calls #create action. want happen. instead, #index method gets called. how fix this? the server log post /orders : started post "/orders" 173.8.132.62 @ 2013-03-24 14:45:23 -0700 processing orderscontroller#index html parameters: {"utf8"=>"✓", "authenticity_token"=>"ecsazxbyd5ovvo5oijzm/cnoyp7cz6drvbu7i41xeny=", "order"=>{"order_lines_attributes"=>{"0"=>{"item_id"=>"", "qty"=>"", "_destroy"=>"false"}}, "customer_id"=>""}, "commit"=>"create order"} order load (0.1ms) select "orders".* "orders" rendered text template (0.0ms) completed 200 ok in 5ms (views: 1.1ms | activerecord: 1.2ms) the entire routes.rb : wines::application.routes.draw match ':controller(/:action(/:i...

c - Checking array for identical numbers and their value -

as part of program have make, 1 of function need program should check if array has identical numbers same, , if 1 of them bigger/equals given number. the given number amount of numbers in array this have far: int checkarray(int *arr, int num) { int check = num; int check2 = num; int *lor; int *poi; int *another; = arr; lor = arr; poi = arr; int check3 = num; ( ; num > 1; num--) { ( ; check3 >= 0; check3--) { if (*arr == *poi) return 0; poi++; } arr++; poi = another; } ( ; check2 > 0; check2--) { if (*lor >= check) return 0; lor++; } return 1; } i know made many pointers/int function, that's not problem.. the part of checking given value works fine if i'm not mistaken think can ignore part (that's last 'for' loop) i know should easy reason can't work... edit: i'll give...

eclipse - TestNG Installation -

i have been trying install testng eclipse. eclipse version version: mars.1 release (4.5.1).. while trying install, shows error mentioned below. please guide me how rectify problem. an error occurred while collecting items installed session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.collect, operand=, action=). unable read repository @ http://beust.com/eclipse/plugins/org.testng.eclipse_6.9.10.201512240000.jar . premature end of content-length delimited message body (expected: 3005134; received: 1555400 my problem got solved "not downloading optional testng" part (i.e dont download "testng m2e integration (optional)" if not needed(it's recommended install if java project(s) managed maven))

phpredis - Getting concurrent requests processing issue with Redis+PHP -

i using php 5.3 using redis, store php array data every requests in redis variable. setting value 1 redis variable , on every request incrementing value 1. using value key each array element. on concurrent requests creating problem - 1) skipping few records in between. 2) value of varible getting stored key getting duplicated. right using "predis" php+redis client. please me in , let me know how can achive this. did try using set (or sorted set) instead? don't need worry managing external index automatically done redis.

facebook - Stream Table FQL Query -

i want posts of friends order updated_time, query works fine single friend when use source = first_friend_id when use query in return empty data. select post_id,type,message, actor_id,likes.user_likes,likes.count,likes.friends,comments.comment_list, comments.count , target_id ,updated_time,created_time stream source_id in(friend_id1,friend_id2,friend_id3) order updated_time desc limit 5 can please point out how latest 5 feeds of amoung 3 friends. source_id = friend_id works fine, work 1 friends i'm testing here. https://developers.facebook.com/tools/explorer/ thanks there's been number of posts recently... appears stream table acting finicky lately, logic of query valid. best bet report detailed bug here

ios - Scaling UIWebView to fit full screen in iOS5 and iOS6 -

i have problem scaling uiwebview. want webview running in fullscreen on both versions (ios5 , ios6). had turn off "use autolayout" app running on ios5 too. problem webview higher the ios5 screen. my question: is there way fit view both devices? you need manually code view change size based on screen size. you can fetch screen size (specifically height): [[uiscreen mainscreen] bounds].size.height; [[uiscreen mainscreen] bounds].size.width; then set size of uiwebview these values. webview = [[uiwebview alloc] initwithframe:cgrectmake(0, 0, 320, [[uiscreen mainscreen] bounds].size.height)];

angularjs - Unit Test Dropbox -

i trying create unit test karma jasmine interacts dropbox api. below test. compiles directive, runs click on it. checks file picker window opens. checking window opening in way works on other tests, in instance fails because referenceerror: can't find variable: dropbox . because not in test. file hosted directly dropbox via https://www.dropbox.com/static/api/2/dropins.js , cannot seem inject it... question is, how make dropbox available in case? it(": clicking button should open dropbox picker window", function(){ var element = $compile("<span data-dropbox extensions=\"extensions\"></span>")($scope); $scope.$digest(); var thebutton = element.find('button'); spyon($window, 'open'); thebutton.triggerhandler('click'); expect($window.open).tohavebeencalled(); }); thanks in advance your approach wrong. trying unit test button click. not unit test button click, unit test c...

Python 3: Calling a function from its class to simulate a switch statement not working -

i writing program simulation game of variant on rock paper scissors game. in main function outputting interface , trying call method defined within acts switch statement. getting: "makesel() missing 1 required positional argument: 'self'" typeerrors have scoured web hints yet cannot find have helped. have tried change "makesel()" "main.makesel()" gives me main undefined. class main: def makesel(self): selection = input() if(selection == 1): return stupidbot('stupidbot') elif(selection == 2): return randombot('randombot') elif(selection == 3): return iterativebot('iterativebot') elif(selection == 4): return lastplaybot('lastplaybot') elif(selection == 5): return mybot('mybot') elif(selection == 6): return humanplayer('humanplayer') else: pri...

reactjs - Meteor + webpack tutorial with blaze instead of react? -

my project getting big meteor build system (>1min load time) , therefore want switch webpack. tutorials , boilerplates find use combination of meteor/react/webpack, project uses blaze , not want switch react. it hard me figure out code bits in sample projects belong react , necessary make webpack work. (i not familiar react). does know tutorial or sample github project using webpack blaze?

ami - how to implement admob sdk in swift -

print("google mobile ads sdk version: " + gadrequest.sdkversion()) bannerview.adunitid = "ca-app-pub-3940256099942544/2934735716" bannerview.rootviewcontroller = self self.bannerview.delegate = self bannerview.loadrequest(gadrequest()) i added banner view in app , add comes automatically admob account has been block , no 1 add comes , create new account on admob different email id , unit id on unit id cant;t add .....what have real time add comes trully..

osx - homebrew socat on OS X Mountain Lion, sctp "Protocol not supported" -

i working hard on hobby program involves sctp protocol, grasp basics, tried install socat using homebrew , socat netcat-like tool testing various protocoles. without success on os x mountain lion far. here install & error log: $ brew install socat ==> installing socat dependency: readline ==> downloading http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz ######################################################################## 100.0% tar: failed set default locale ==> patching patching file callback.c patching file input.c patching file patchlevel patching file support/shobj-conf patching file vi_mode.c ==> ./configure --prefix=/usr/local/cellar/readline/6.2.4 --mandir=/usr/local/ce ==> make install ==> caveats formula keg-only: not symlinked /usr/local. os x provides bsd libedit library, shadows libreadline. in order prevent conflicts when programs libreadline defaulting gnu readline installation keg-only. there no consequences of you. if build own sof...

Why program freezes when I add instance of Form in user control in C#? -

Image
i new c# , using windows forms. have form1 button (button_save) , textbox . , have user control1 1 button ( button1 ). what trying in program is: when click on button1 , text appear in textbox (in form1 ), enter new text , click save, button1 text change accordingly. i explain when freeze happens: there 2 parts: first part: when created instance of user control1 in form1 participated in usercontrol1event , run program works fine , button1 text appears in textbox when click on it. second part when create instance of form1 in user control1 , participated in form1event , run program program freezes long time gives error pointing @ form1 instance in user control1 (as shown in screen shot). anyone knows why happening ? doing wrong? form1: public partial class form1 : form { public event eventhandler form1event; usercontrol1 uc1 = new usercontrol1(); public form1() { initializecomponent(); controls.add(uc1); uc1.visib...