Posts

Showing posts from January, 2015

javascript - firebase: retrieve specific fields from object -

i using firebase storing data of players. want show statistics of players have structure like: players:{ [playerid]:{ info:{ firstname: 'jon', lastname: 'mark', otherinfo:'aaa' }, othertoomuchinfo:{}, stats:{ totalplayed: 10, scorecounta: 14, scorecountb: 24, } }, [playerid]:{ info:{ firstname: 'hen', lastname: 'lee', otherinfo:'qwe' }, othertoomuchinfo:{}, stats:{ totalplayed: 33, scorecounta: 12, scorecountb: 43, } } } how can retrieve stats of players firebase without loading other information?

c# - To specify a DataGridView column header's text with an event -

i used way of assigning dgw's column header text below, after debugged below event causes run number of cells in dgw. of course cannot except different behave event's approach how can use better way runs 1 time assign texts columns header. private void dgwbase_columnheadercellchanged(object sender, datagridviewcolumneventargs e) { dgwbase.columns[0].headertext = "waktu mulai\nstarting time"; dgwbase.columns[1].headertext = "nama personil\npersonnel name"; dgwbase.columns[2].headertext = "nama pekerjaan\nworkshop name"; dgwbase.columns[3].headertext = "mps no"; dgwbase.columns[4].headertext = "kuantitas\nquantity"; dgwbase.columns[5].headertext = "operasi kode\noperation code"; dgwbase.columns[6].headertext = "nama operasi\noperation name"; dgwbase.columns[7].headertext = "produk kode\nproduct code"; dgwbase.columns[8].headertext = "nama produk\nproduct

jquery - How to interpolate an object's key name in JavaScript/JSON? -

i have line of js: overlay.animate({"left":"-1000px"}, "slow").removeclass('visible'); i need use variable (direction) instead of word "left", how can rewrite string? this doesn't work: overlay.animate({direction:"-1000px"}, "slow").removeclass('visible'); thanks you need use [] access keys variable. var options = {}; options[direction] = "-1000px"; overlay.animate(options, "slow").removeclass('visible');

c# - How to get List<ColumnType> in SQL Server? -

i have establishment table shown below, estabid name checkindate 114883 marconfort griego hotel 2011-09-28 00:00:00.000 114910 royal costa hotel 2011-10-18 00:00:00.000 114912 roc flamingo hotel 2011-11-22 00:00:00.000 114912 roc flamingo hotel 2011-11-29 00:00:00.000 114912 roc flamingo hotel 2011-12-06 00:00:00.000 114912 roc flamingo hotel 2011-12-13 00:00:00.000 114912 roc flamingo hotel 2011-12-20 00:00:00.000 114894 gran hotel blue sea 2012-01-17 00:00:00.000 114894 gran hotel blue sea 2012-01-31 00:00:00.000 suppose, if want structure query result like, response : { [ estabid: 114912, name: 'roc flamingo hotel', checkindates : [2011-11-22 00:00:00.000, 2011-11-29 00:00:00.000, 2011-12-06 00:00:00.000, 2011-12-13 00:00:00.000, 2011-12-20 00:00:00.000] ,... ] } is, there recommended way achieve structure sql stored procedure or c# + sql combination ? ps

Magento - Can add only one product to cart -

everyone! can me this. i'm using magento 1.9 , have problem adding more 1 products cart. adding first product cart works normal, when try add second product(by add cart button) deletes first , second present in cart. cross checked things through below code: mage::getsingleton('checkout/cart')->getquote() and mage::getsingleton('checkout/session') and shows [items_count] => 1 thanks in advance!

getDeclaredMethods() behaving differently in Java 7 vs. Java 8 -

consider following little example: package prv.rli.codetest; import java.lang.reflect.method; public class breakinginterfaces { interface base { basefoo foo(); interface basefoo { } } interface derived extends base { derivedfoo foo(); interface derivedfoo extends basefoo { } } public static void main(string[] args) { dumpdeclaredmethods(derived.class); } private static void dumpdeclaredmethods(class<?> class1) { system.out.println("---" + class1.getsimplename() + "---"); method[] methods = class1.getdeclaredmethods(); (method method : methods) { system.out.println(method); } system.out.println("----------"); } } if compile above example jdk1.7.0.55 output is: ---derived--- public abstract breakinginterfaces$derived$derivedfoo breakinginterfaces$derived.foo() ---------- but wh

android - Does Google analyze uploaded .apk for warnings or errors? Does it affect play market ranking? -

i have been using android studio analyze->inspect code… - results impressive. started wondering - google analyze uploaded .apk file lint warnings or kind of errors? or check if followed guidelines in app development. have influence on play market search result? there no mention of apk analysis in android publishing documentation . believe app can flagged , if go against guidelines . can result in suspension of app among other consequences, none of affects google play search indexing (aside fact may not on if app suspended). it seems review process exists chrome apps, perhaps there may 1 android well.

android - Spinner not showing selected item -

problem my problem after changing data in spinnerarrayadapter spinner not react item clicks on dropdownlist . after orientation change occurs working fine(?!). edit: noticed catch item clicks not representing/showing on spinner . because after orientation change selected item appears on spinner construction i have autocompletetextview(actv) that's connected autocompleteadapter implementing filterable . after entering data actv result passed spinnerarrayadapter connected spinner . there customlistener set on autocompleteadapter connected spinnerarrayadapter , responsible passing data between them. reason behind such construction user can have 2-step choice. 1 on drop-down when choosing data actv , second 1 in case change mind. can put postcode in actv select province that's connected , change province when miss-clicked/changed mind without forcing enter postcode again. code this part responsible data change inside spinnerarrayadapter . @override pub

sharepoint 2013 - MS Access Web App: restore snapshot (backup) on same site as current version? -

background: developing small accees web app organization. hosted on our office 365 sharepoint. there no professional development environment , there no plans proper deployment. developing app , maintaining data @ same time. handful of people use web ui maintain data. during development (which went hand in hand data imports) have made backups of app including data using "save snapshot" function. have not changed name of app when saving snapshots. now want restore snapshot package (backup), because have problem current version of app. however, want keep current version of app comparison. want duplicate app. when try creating new access app on sharepoint site , choose upload backup .app package, error message saying the provided app differs app same version , product id i tried unzipping .app package of backup changing version number in appmanifest.xml, still got same error message. is there way upload backup package under name/product id without deleting c

architecture - Docker: Staging multiple containers for one application -

i thought of dockerizing our deployment process. lets have application containing of several layers (e.g. db, business logic layer , ui layer (lets js based ui still need http server it)) provided several containers (a db container, data container, container business logic , 1 ui). for test environment i'd use oracle xe in container while on production i'd use existing big oracle cluster. means deployment different several stages. on other hand i'd simple installation e.g. manager installing containers @ once (and linked together) on notebook presentation. how can manage deployment of several (dependent) containers in several stages simple possible while still being flexible enough different deployment scenarios? if docker containers on single instance recommend fig . have found workflow lot cleaner , consistent docker way other tools such kubernetes . kubernetes have advantage can use same deployment processes on google container service distributed de

windows - Visual Studio 2013 Community Problems -

im tearing hair out 1 im afraid , down hours , hours. firstly wanted install vs community use unity. im running windows 8.1 pro. but had trouble installing. long story short there fonts in windows\fonts vs installer didnt like. moved fonts , installer ran through successfully. installed vs 2013 tools unity. so imported unity vs tools project. unity project hangs when unity opens. fixed unity removing unity vs stuff form project directory. i started getting errors on screen said "an unhandled exception system.configuration.configurationerrorsexception) occurred in zaprivacyservice.exe[3168] the in time debugger launched without necessary security permissions etc etc also above error message appears , if ignore dialogue keeps popping every minute or so. off jit prompts error message saying no jit available. instead of other error message. zaprivacyservice seems part of zonealarm. downloaded , reinstalled it. no joy. tried uninstalling unity vs tools. went programs ,

vlc - live555 Server streaming x264 not working, how to debug? -

before diving sdk version, tried stream x264 encdoed video vlc. streaming mp3 works, x264 takes while error, vlc cannot open file. 1) downloaded live555 server 2) started exe states url use as: rtsp://172.18.1.85/<filename> 3) in vlc using: rtsp://172.18.1.85/fantastic.264 server output says "each files type inferred it's name suffix" renamed file fantastic.mp4 fantastic.264 as i've stated mp3 stream works fine in same directory fantastic.264 placed. the file ending correct wasn't "elementary h264 stream". had reconvert elementary h264 file. quick fix: ffmpeg -i fantastic.mp4 -vcodec libx264 -f h264 fantastic.264 you can here more information: what elementary stream mean in terms of h264

objective c - Apply check on tableViewCells to hide imageView -

in tableview , have 5 tableview cells . each has imageview . outside tableview , there's uibutton . uibutton has image on it. now, issue check if image on cells hidden or not. clearing issue, need check cells if imageview on cells hidden or not. tried code : (int i=0; i<=4; i++) { if (cell.unlockimageview.hidden) { nslog(@"calling if hiding image"); } } i don't think code correct gave try , didn't work. please suggest me how check imageview on cells hidden or not? try below code hope can you. for (customtableviewcell* tblcell in tableview.visiblecells) { if (tblcell.unlockimageview.hidden) { nslog(@"imageview hidden"); } }

ios - Custom class initialisation in swift -

i'm trying implement custom class extending uicontrol in swift , can't quite work out initialisation. class uirangeslider: uicontrol { var minimumvalue: float32 var maximumvalue: float32 required init(coder adecoder: nscoder) { super.init(coder: adecoder) } init(frame: cgrect, minimumvalue: float32, maximumvalue: float32) { self.minimumvalue = minimumvalue self.maximumvalue = maximumvalue super.init(frame: frame) } } when try create instance of class with: var sliderframe = cgrect(x: 20, y: 200, width: 200, height: 5) var slider = uirangeslider(frame: sliderframe, minimumvalue: 1, maximumvalue: 10) i error: property 'self.minimumvalue' not initialised @ super.init call what correct way write custom initialiser? swift requires new members of class have kind of default value before can call designated init . required init(coder adecoder: nscoder) { self.minimumvalue = 0.0 // default

dns - Why using A record for OpenShift is bad idea? -

if ping openshift application see ip ec2-11-22-33-44.compute-1.amazonaws.com [11.22.33.44] can sure ip 11.22.33.44 , can use record in dns settings? in cases ip changed ? never seen inforamtion. articles claim cname may work. you should never use record point openshift application external domain. ip address can change @ time outage or maintenance reasons. should use cname point domain name application url of format app-domain.rhcloud.com

Uploading products through xml on ebay -

i have problem uploading products through xml on ebay. i use function addfixedpriceitem upload , returns following error: 5013 string value long (item specifics: tagname). string value "tagname" long , removed item specifics. maxinum lenght "40". what can inside xml file? thank help. clearly issue value providing tagname long. cannot exceed 40 characters. search xml <name> , make sure value inside of <name></name> less 40 characters. <itemspecifics> <namevaluelist> <name> string </name> // <--- searching for. value within must less 40 characters. <value> string </value> </namevaluelist> </itemspecifics>

c++ - Cmake option default value -

if have cmakelists.txt file: cmake_minimum_required(version 2.8) option(foo "foo option" off) message("foo? " ${foo}) and call cmake on it, following output: foo? on why this? haven't specified default foo off? try this: set(foo off cache bool "foo option") or set(foo off cache bool "foo option" force)

php - How to Get wordpress page icon and permalink with title -

hello evryone new on wordpress. , m facing problem that, want access child page title , icon image (which uploaded in page icon) in page. title of pages permalink , icon image hard me. please... please me.my code here <div class="vwt_single_blog_box_tab"> <?php if ( is_page() ) { if($post->post_parent) { $id = $post->post_parent; } else { $id = $post->id; } //$children = wp_list_pages('title_li=&child_of='.$id.'&echo=0'); $args = array( 'sort_order' => 'asc', 'sort_column' => 'post_title', 'hierarchical' => 1, 'exclude' => '', 'include' => '', 'meta_key' => '', 'meta_value' => '', 'authors' => '', 'child_of' => 1, 'parent

xcode developer tools and php -

can please explain role of xcode developer tools in developing php applications , installing extensions? between mamp pro, xcode developer tools , extensions doesn't seem install , configure amongst million available php.ini files, losing mind. two days , don't seem step closer running , debugging simple app requires http.so. it's insane. ok response mamp pro support. at point cannot install extensions. understand header files created when separate versions of php compiled. these header files needed compile additional extensions particular version/setup of php. we had these files available in past versions of mamp pro 2.x . have not made them available versions of mamp 3.x . may come out developer edition, include these. don't know when or if is. open ticket in january , see if there progress on this.

Excel VBA Match First & Last Names from sheet 1 to sheet 2 and delete all matches on sheet 1 -

some 1 awesome. in "sheet 3" have database of "last name" in column "b" & "first name" in column "c". same list of names in "sheet 2", "last name" in column e & "first name" in column "f" i need delete matches sheet 2 @ click of button. need able change how many rows down "sheet 2" matches stop, example @ first 600 rows on "sheet 2". i hope explained enough. this code have been using clear specific ranges horrible , may need change ranges, makes method impractical. sub clearselection() sheets("adult sign on sheet").select range("e6:f36").select selection.clearcontents range("e42:f72").select selection.clearcontents range("e78:f108").select selection.clearcontents range("e114:f144").select selection.clearcontents range("e150:f180").select selection.clear

ssl - curl_easy_perform() throwing error -

while i'm calling curl_easy_perform() it's crashing , i'm getting "ssl read: error:00000000:lib(0):func(0):reason(0), errno 110". need resolve this. note: after curl_easy_perform sends http1.1 command , before receives http 200 ok, if internet disconnected error comes. if (curl) { curl_easy_setopt(curl, curlopt_verbose, 1); curl_easy_setopt(curl, curlopt_ssl_verifypeer, 0); curl_easy_setopt(curl, curlopt_ssl_verifyhost, 0); curl_easy_setopt(curl, curlopt_timeout, 30); curl_easy_setopt(curl, curlopt_writefunction, read_data); //url_easy_setopt(curl, curlopt_writedata, client); curl_easy_setopt(curl, curlopt_url, "https://***.com:1027/page"); curl_easy_setopt(curl, curlopt_httppost, formpost); curl_easy_setopt(curl, curlopt_nosignal, 0); printf("sending perform request\n"); try{ res = curl_easy_perform(curl); // perform request, res return code printf("%s",curl_easy_strerror(res));

android - How to use attributes to change text color from activity -

this code textview text_language_name4 = (textview)view.findviewbyid(r.id.text); if (text_language_name4 != null) { int text_color4 = selected ? getresources().getcolor(r.color.readcolor) : getresources().getcolor(r.color.readcolor); text_language_name4.settextcolor(text_color4); text_language_name4.setduplicateparentstateenabled(true); } when using r.attr.mytheme app forces close any suggestions using attr change color of text view for theme color try this: typedvalue tv = new typedvalue(); theme theme = context.gettheme(); boolean success = theme.resolveattribute(r.attr.theme_color, tv, true); int colorfromtheme; if(success) colorfromtheme = tv.data; else // value not found.... now set, textview.settextcolor(colorfromtheme);

c# - XmlDocument to DataSet only returning 1 Row -

i have problematic piece of code , it's peculiar , nothing i've ever experienced before! i'm calling sharepoint soap function , results being returned absolutely fine., many xml records of data being retruned. now have tried convert results xmldocument, use load dataset. however when gets inserted dataset it's inserting 1 record, happens first record of xml. the problematic code below: lists list = new lists(); list.url = url + "_vti_bin/lists.asmx"; list.usedefaultcredentials = true; //gets entire lists attached sharepoint site xmlnode results = list.getlistcollection(); //writes entire results xmldocument. doc.appendchild(doc.importnode(results, true)); using (stringreader xmlsr = new stringreader(doc.innerxml)) { ds.readxml(xmlsr, xmlreadmode.auto); } the xml 'doc.innerxml' valid ,

ubuntu 12.04 - MySql- Stored Procedure with cursor issue -

i have created following stored procedure mysql throws error 1064. need every user exists in table logbackup, find date of first action, date of last action , calculate duration. though, know in different way, syntax errors may have since new in mysql. edit: use 'databasename' drop procedure if exists `userengagementcalc`; delimiter $$ use `databasename`$$ create definer=`root`@`%localhost` procedure `userengagementcalc`() create procedure userengagementcalc() begin declare v_username varchar(50); declare startdate datetime; declare enddate datetime; declare duration int; declare done int default false; declare cur1 cursor select distinct username logbackup; declare continue handler not found set done=true; open cur1; igmloop:

java - how to invoke a new activity the moment the user enter exactly 4 digits of code into an editText box -

i invoke new activity moment user enter 4 digits of code edittext box. how can catch exact moment user enter 4 , last digit , invoke action checks if code valid. thanks, gil. use text watcher edittext.addtextchangedlistener(new textwatcher() { @override public void ontextchanged(charsequence s, int start, int before, int count) { // todo auto-generated method stub } @override public void beforetextchanged(charsequence s, int start, int count, int after) { // todo auto-generated method stub } @override public void aftertextchanged(editable s) { // todo auto-generated method stub //start activity if (s.length()==4) startactivity(new intent(callingactivity.this,calledactivity.class)); } });

javascript - What is the best way to mock/stub $localForage in AngularJS tests? -

i want test factory , uses $localforage. best way test methods inside factory? assuming karma's config ok. check example below: ./test/spec/factories/ux-event.js 'use strict'; describe('service: uxeventfactory', function () { beforeeach(module('paxapp')); var uxeventfactory; beforeeach(inject(function (_uxeventfactory_) { uxeventfactory = _uxeventfactory_; })); it('gets instance of uxeventfactory', function () { expect(uxeventfactory).tobedefined(); }); it('enqueues item in database', function () { var key = uxeventfactory.enqueue('1', '2', '3', '4'); expect($localforage.getitem(key)).tobe({ name: '1', action: '2', label: '3', value: '4' }); }); }); ./app/scripts/factories/ux-event.js 'use strict'; /**

Highchart merge won't enable labels in xAxis -

i have problem highcharts - trying take existing chart, merge new one, alter few properties , show it. the problem i'm getting can't seem enable xaxis labels in copied chart. if turn them on in original chart exist in copied one, there seems no way of altering enabled state. jsfiddle below: http://jsfiddle.net/liamfl/a7xvfyg6/ the code follows: var chart_portfoliodetailsdistribution; var popupchart; $(document).ready(function () { chart_portfoliodetailsdistribution = new highcharts.chart({ chart:{animation:false,renderto:'smallchart3'} ,title:{text:'distribution'} ,tooltip:{headerformat:'',pointformat:'<b>{point.name}</b>: {point.y}'} ,legend:{enabled:false} ,credits:{enabled:false} ,plotoptions:{series:{animation:false,borderwidth:0,datalabels:{format:'<b>{point.y}</b>'} ,grouppadding:0,pointpadding:0} } ,yaxis:{ title:{text:n

Python - Merging 2 lists of tuples by checking their values -

i have lists this: a = [('jon', 12668, 0.0036), ('jessica', 1268, 0.0536), ('jon', 1668, 0.00305), ('king', 16810, 0.005)] b = [('jon', 12668, 0.0036), ('jon', 16680, 0.00305), ('messi', 115, 0.369)] i want resultant list like: result = [(('jon', 12668, 0.0036), ('jon', 12668, 0.0036)), (('jon', 1668, 0.00305), ('jon', 16680, 0.00305)), (('king', 16810, 0.005), none), (none, ('messi', 115, 0.369))] i have tried nested loops, sets, map, zip failed achieve output. kindly me out. convert a , b dictionaries first using first(use str.lower() in it) , third item key , later on loop on union of keys in list comprehension desired output: >>> pprint import pprint >>> dct_a = {(x[0].lower(), x[2]): x x in a} >>> dct_b = {(x[0].lower(), x[2]): x x in b} >>> out = [(dct_a.get(k), dct_b.get(k)) k in set(dct_a).union(dct_b)] >>>

Limiting search scope jQuery -

how limit scope each group sold value reflects numbers group? jquery: var sales = (function calculatesales(){ $( "h1 small" ).each(function() { var group = $(this).parent('.group'); var numitems = group.find('.btn').length; var sold = group.find('.btn.hidden').length; $(this).text(sold+" of "+numitems+" sold"); }); return calculatesales; }()); html: <div class="group"> <h1>title <small>value</small></h1> <div> <a href="#" class="btn"></a> </div> <div> <a href="#" class="btn hidden"></a> </div> </div> <div class="group"> <h1>title <small>value</small></h1> <div> <a href="#" class="btn"></a> </div> <di

java - How to add new AdfBcFactTypes in oracle rules file -

i have oracle rules file: mydeparmentrules.rules i have adfbcfacttype nodes property s: <adfbcfacttype id="j}my.project.depart.model.gri.views.grdetalesdeclaracionsvvo"> <name>my.project.depart.model.gri.views.grdetalesdeclarationsvvo</name> <alias>detales</alias> <visible>true</visible> <creationupdatenumber>2362</creationupdatenumber> <property id="j}my.project.depart.model.gri.views.grdetalesdeclarationsvvo.{viewrowimpl}"> <name>viewrowimpl</name> <alias>viewrowimpl</alias> <visible>true</visible> <creationupdatenumber>2362</creationupdatenumber> <idoftype>j}my.project.depart.model.gri.views.grdetalesdeclarationsvvorowimpl</idoftype> <listcontentid>b}nil</listcontentid>

How to set a value to scope object.object in angularjs -

how set value , value in form of $scope.object1.object = "some data"; in html , js if set data work. <select ng-model="mycolor" ng-options="color.name color in colors"> $scope.colors = [ {name:'black', shade:'dark'}, {name:'white', shade:'light'}, {name:'red', shade:'dark'}, {name:'blue', shade:'dark'}, {name:'yellow', shade:'light'} ]; but want these <select ng-model="mycolor" ng-options="color.name color in test.colors"> $scope.test.colors = [ {name:'black', shade:'dark'}, {name:'white', shade:'light'}, {name:'red', shade:'dark'}, {name:'blue', shade:'dark'}, {name:'yellow', shade:'light'} ]; see example in plunker demo see

python tesseract "AttributeError: setImage" -

i'm trying make tesseract run in python: ...image numpy array (uint8)... tessapi = tesseract.tessbaseapi() tessapi.init(".","spa",tesseract.oem_default) tessapi.setvariable("tessedit_char_whitelist", "0123456789aceimnoprstu/imn") tessapi.setpagesegmode(tesseract.psm_auto) # setimage(imagedata, width, height, bytes_per_pixel, bytes_per_line) w = int(final.shape[1]) h = int(final.shape[0]) tessapi.setimage(image,w,h,1,w) text = tessapi.getutf8text() print text and error: raise attributeerror(name) attributeerror: setimage can't figure out why. please, can me?. check https://code.google.com/p/python-tesseract/source/browse/python-tesseract-0.9/src/tesseract.py class tessbaseapi(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, tessbaseapi, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, tessbaseapi, name) __repr_

Can you explain this named group start position in a Java regex? -

i'm stuck in weird situation here, trying match optional named group in java (8) regex. for example, following match happens expected , assertions raise no error: pattern pat = pattern.compile("begin.+(?<middle>middle).+end"); matcher matcher = pat.matcher("begin middle end"); asserttrue(matcher.find()); assertequals(6, matcher.start("middle")); assertequals(12, matcher.end("middle")); however, if change regex to begin.+(?<middle>(middle)?).+end matcher.start("middle") returns 12, if match empty. if change regex begin.+(?<middle>middle)?.+end matcher.start("middle") returns -1, if there's no match. i'm wondering if it's possible have optional named groups @ in java. what mistake making? it has nothing named groups. the reason .+ right after begin greedily matches string " middle ". named group matches nothing (which it's explicitly allowed

regex - Remove last directory when copying files in Ant script -

how can copy files directory 1 level up? i've looked @ cutdirsmapper strips leading directories whereas want strip last directory. example in manual, source filename foo/bar/a.txt should copied foo/a.txt . this have far: <copy todir="../vendor"> <fileset dir="${resources}" includes="bootstrap/2.2.1/" /> <fileset dir="${resources}" includes="fontawesome/4.2.0/" /> <fileset dir="${resources}" includes="jquery/2.1.1/" /> </copy> i end folders such ../vendor/bootstrap/2.2.1/ containing third-party libraries i'm looking copy contents of ${resources}/bootstrap/2.2.1/ ../vendor/bootstrap/ . i have tried using regexpmapper this: <regexpmapper from="^(.*)/([^/]+)/([^/]*)$$" to="\1/\3" handledirsep="true" /> this not work due subfolders inside bootstrap/2.2.1/ (for example css , js , img , etc.) after further

Need help translating SOAPUI request into Ruby code using Savon gem -

Image
i'm working on soap api has 2 operations, , each operation requires api keys , bunch of other attributes. so, i've been able make request via soapui, i'm having trouble translating ruby code using savon gem(version 2). here's screenshot of searchtours request. now, how tranlate ruby code using savon? tried following, didn't work. client = savon.client(wsdl: 'url goes here..') client.operations #=> [:tour_details_full, :search_records] message = {security_key: "securitykeys", attributes_one: "valueone", attribute_two: integervalue} response = client.call(:search_records, message: message) error message: savon::soapfault: (s:client) cannot find dispatch method {url_here} searchrecords the canonical answer: download soapui. build call in soapui. make sure works. build same request using savon. ask stackoverflow.

Must i use facebook canvas to login on my unity web player game? -

i have unity web player game add facebook login to. downloaded sdk , works fine on unity editor. i want login using facebook without being on facebook canvas, possible? if is, know how. thanks. according docs , setting app in developer console facebook part of setup process using official facebook unity sdk. i can understand why nice able use fb login unity web player games hosted on other game web sites. i looked in facebook usage policy document in login section, , although facebook says native ios , android apps should use official fb sdk each platform, makes no mention of unity sdk. but this answer says "you must run app on apps.facebook.com/, or run on ios or android." sounds poster part of facebook team.

Calling a Stripe checkout form from a link rather than button on Leadpages -

is there way modify default stripe checkout script work link element on leadpage? if use default code place blue button standard on existing button: <form action="" method="post"> <script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key="pk_test_nd6tw8x8xxhbynabeajzpbwq" data-amount="2000" data-name="demo site" data-description="2 widgets ($20.00)" data-image="/128x128.png"> </script> </form> i've tried using custom button code, below, can see id allowed, not class, how link coded. <script src="https://checkout.stripe.com/checkout.js"></script> <button id="custombutton">purchase</button> <script> var handler = stripecheckout.configure({ key: 'pk_test_nd6tw8x8xxhbynabeajzpbwq', image: '/square-image.png', token: function(to

ruby - request_head with basic_auth -

i want know response code without getting whole page content, use #request_head . "401", need pass login/password: require "net/http" uri = uri.parse "http://example.com/some_path" connection = net::http.new(uri.host, 80) connection.basic_auth "qwe", "rty" p connection.request_head uri.path but get temp.rb:9:in <main>': undefined method basic_auth' #<net::http staging.new.inmyroom.ru:80 since #basic_auth belongs class: connection = net::http::get.new uri.host that doesn't have #request_head : temp.rb:10:in <main>': undefined method request_head' #<net::http::get get> (nomethoderror) you can use head http verb. from rfc2616: this method (head) can used obtaining metainformation entity implied request > without transferring entity-body itself. method used testing hypertext links validity, accessibility, , recent modification. something that:

batch file - IF statement in Jenkins windows boolean parameter -

on jenkins installed on windows 7, choose : this build parameterized add boolean parameter named win7 then in windows batch command want if win7 parameter selected. how boolean converted? tried following no success if %win7%=="true" ( ) also : echo %win7% is printing true if "%win7%"=="true" ( ... ) quotes part of compared string.and required when there space within compared values.

c# - Independent Association does not retrieve all rows when no foreign key constraint exists in database -

Image
i using ef6.1 database first/objectcontext/pocos. i have table called foo , table called foohistory. how model looks like: due legacy reasons, foono primary key on foo, not on foohistory , foreign key constraint does not exist in database. however, logical foreign key, set 1 many independent association between foo , foohistory. principal/dependent property foono. the following linq-to-entities query: var qry = f in context.foo.include("history") f.foono.trim() == "someno" select f.history.count(); returns value of 6, whereas sql sent database returns 10 rows (which want). i managed query give me full 10 rows creating foreign key constraint in database on foono , updating model. @ point ef referential constraint in association's properties changed name of database constraint. multiplicity changed, becoming 0...1 many. however, i'd understand why first approach not work - why results different w

ios - use large app icon from older version in iTunes connect -

i have app in appstore. when want release new version of app, itunes connect requires update large app icon: you must upload large app icon. why itunes connect can't use large app icon previous version of app? p.s. wrong, when update app before (some months ago), there no need update large app icon. some months ago (many months, in reality), itunes connect required "large" 512x512 app icon. now require 1024x1024 icon. suggestion, in case don't have access vectorial graphic or cannot generate again, trying up-sample icon. try photoshop or image editor has options upscale corrections.

how to bind sql data to a label in a dialog result vb.net -

i working in vb.net windows form applications, backed sql server. trying load dialog result , need auto load label dialog result. however, whenever try , bind sql results label getting error. have done before data in dgv loaded sql query 1 giving me issues. error comes when attempt load variable "datareader" "f.labelshear.text = datareader." private sub button1_click(sender object, e eventargs) handles m01.click dim dr dialogresult dim f new cellcontent using conn1 new sqlconnection(connstring) conn1.open() using comm1 sqlcommand = new sqlcommand("select shear production.dbo.tblfabwiplog fabwipid = 1", conn1) dim datareader sqldatareader = comm1.executereader datareader.tostring() f.labelshear.text = datareader end using end using end sub i doubt neither first code , second code work. after declaring datareader had code datareader.read() later on f.labelsh

c# - System.FormatException' occurred in MongoDB.Bson.dll - XXX is not a valid 24 digit hex string -

i have created c# class this: public class employee { [bsonrepresentation(bsontype.objectid)] public string name { get; set; } public int age { get; set; } public list<string> address { get; set; } } when try save information (using mongodb) this: var e = new employee(); e.address = new list<string>(); e.address.add("address 1"); e.address.add("address 2"); e.age = 333; e.name = "some name"; context.employees.insert(e); i getting following error: an unhandled exception of type 'system.formatexception' occurred in mongodb.bson.dll additional information: 'some name' not valid 24 digit hex string. how can make string field act objectid in mongodb? reading docs: ... in case serializer convert objectid string when reading data database , convert string objectid when writing data database ( the string value must valid objectid )

Android Material Design Components Sample -

i'm new @ material design. i'm working on projects , want use material design. cannot find source or sample components. there code sample (especially animated circle loader this )? thanks lot! there tens (if not hundreds) samples regarding ways implement material design, of 'em described how make work older versions of android. this blog post google's own chris banes regarding appcompat v21 place start when you're working on android versions lower lollipop. while this , still mr. banes, thoroughly describe 1 of lollipop's famed api, palette . moving on, this blog post started shiny round buttons (or fabs) and, bonus, trick apply ripple effect it. i think 3 links should more enough started making material apps - i've built mine , 3 first guides. sadly though, can't find 1 matches dribbble link. again, doubt widget such exists today. i've been wrong before though. :) hope helped!

html - How to make fixed page template? -

i want fixed page height without scrolling, header fixed on top, , fill center remainder of page. center area have own scrolling bar when content overflow. i set height 100% central div, height ≠ height free space between top , bottom blocks. what can do? many thanks! look code on jsfiddle i have made js fiddle have created points have understood problem. using jquery $( window ).height() getting browser viewport height. subtracting height of header , footer (50px + 50px =100px) browser viewport height height of space. height equal content height. check fiddle http://jsfiddle.net/bnx4uuse/1/

r - How can I attach new levels with specific values for specific rows -

i have dataframe column name of individuals , columns results. want attach new column either 1 , 2 or na depending on individual. i have vector individuals level 1 , 1 individuals level 2 how can attach collumn data frame goes this: if dataframe$individual (1,3,6,7) value in column 1, if dataframe$individual (2,5,8) value in column 2, else value na i hope made clear example looking for. help try dat$newcol <- with(dat, ifelse(individual %in% c(1,3,6,7), 1, ifelse(individual %in% c(2,5,8), 2, na)))

c# - IComparer for string that checks if x starts with y -

i've got array of strings , need strings, start 'prefix'. wanna use array.binarysearch(). possible? , how should write comparer if so? no, cannot use binarysearch in case. use enumerable.where instead: dim query = str in array str.startswith("prefix") or ( ugly in vb.net) method synatx: query = array.where(function(str) str.startswith("prefix")) edit : whoops, c# var query = array.where(s => s.startswith("prefix")); use toarray if want create new filtered array.

css - Font loading in Safari but not Chrome -

i attempting use following webfont kit font squirrel on webpage - http://www.fontsquirrel.com/fonts/dj-gross on 'webfont kit' tab on above page, selected 'no subsetting' form dropdown , clicked 'download @font_face kit' i think font squirrel great job of setting out @font-face declaration have used in css , moved font files (.eot, .svg, .ttf, , .woff) appropriate directory use on site sure filepaths referenced correctly. this font rendering in safari not chrome disregarding webpage, can reproduced opening djgross.html file comes font squirrel download. again, demo works in safari not chrome , have not touched this code @ :) edit: @font-face { font-family: 'dj_grossnormal'; src: url('djgross-webfont.eot'); src: url('djgross-webfont.eot?#iefix') format('embedded-opentype'), url('djgross-webfont.woff') format('woff'), url('djgross-webfont.ttf') format('truetype'),

rest - Handling CRUD on child objects with RESTful -

if given following xml request sent restful api endpoint called /catalog via put (intent update catalog). if user provides additional <book> s don't exist @ point in catalog in request should endpoint "create" them? or should ignored , different endpoint perhaps /books used create them. <?xml version="1.0"?> <catalog> <book id="bk101"> <author>gambardella, matthew</author> <title>xml developer's guide</title> <genre>computer</genre> <price>44.95</price> <publish_date>2000-10-01</publish_date> <description>an in-depth @ creating applications xml.</description> </book> <book id="bk102"> <author>ralls, kim</author> <title>midnight rain</title> <genre>fantasy</genre> <price>5.95</price> <publish_da

javascript - css fixed menu overlaps the content -

i have top menu must visible i've used position:fixed. works , menu on top of window. problem comes content, next div big image gets cut menu: #header { position: fixed; top: 0; } you can see menu in link: http://212.48.86.94/~admin/el-cuartel-gana-el-tercer-premio-mejor-agencia-independiente-en-los-premios-control-2014/ i've tried modifying positions, overflows , in firebug no luck. also wp theme i'm modifying javascript calculations height , uses on scroll event. i'm not sure how fix it. to hero wrapper add margin.. #hero-wrapper{ margin-top: 68px; } this offset width of fixed header a few other notes... line 2549 has console.log() should remove that. console.log('dentro1'); line 2551 of main.js throws error when scrolling $categoryhash = document.url.split('?')[1].replace( /^filter=/, '' ); uncaught typeerror: cannot read property 'replace' of undefined

javascript - Store image thumbnails on server with Dropzone.js -

i'm using dropzone.js angular.js upload images, didn't find method, how can upload thumbnails server. .dropzone({ url: "/gallery/add", maxfilesize: 100, paramname: "uploadfile", createimagethumbnails: true, thumbnailwidth: 200, init: function() { this.on('addedfile', function(file) { // maybe here }); this.on('thumbnail', function(file){ // or here }); } }); problem thumbnails at present, not possible dropzone.js. there github issue while requested functionality. can review comments tend agree first commenter says for large images creating thumbnails clientside slow (the browsers not image processing tool), why thumbnails generated images < 2mb doing on server easy, cheap , more versatile.

javascript - Using Lo-Dash to give sum from REST return in AngularJS Application -

scroll down solution !! i have simple angularjs application (with lodash loaded after angular.js, before app.js) : project list page(/projects), link on item brings /projects/:id in /projects/:id, controller request api, , returns data i assign data $scope.project, , display in view here's example of return i'm getting api : { "_id" : { "$oid" : "546a3bdee4b0bfd97138fe08"} , "picture" : "http://placehold.it/400x400" , "name" : "square campus" , "address" : "293 grafton street, shasta, arizona, 6757" , "phone" : "+1 (916) 544-2274" , "buildings" : [ { "name" : "north campus" , "floors" : "4" , "users" : "8"} , { "name" : "south campus" , "floors" : "2" , "users" : "15"} ,

javascript - Command Validation in Minimist -

newbie minimist command parser , facing issue it. user enters command : project -a i have validate if entered command has right option. code follows: var commands = ["project", "user"]; var commandentered = require('minimist')(command.split(' ')); if(commands.indexof(commandentered._) > -1){ //i.e. check if user has entered either project or user , following if(commandentered._ == "project") { var options = ["a", "u", "l"]; delete commandentered._; var optionsentered = object.keys(commandentered); for(var i=0;i<optionsentered.length;i++){ if(options.indexof(optionsentered) > -1){ if(optionsentered == "a" && commandentered.a == true) { console.log("option entered"); } } } } } else{ return "invalid command"

c# - Passing image into Android ListView ArrayAdapter -

i have listview , passing value list using arrayadapter. did. first created string array: private static readonly string[] menuitemnames = new string[] { "home", "new", "delete", "submit", "help" }; and created arrayadapter: this.mymenulist.adapter = new arrayadapter<string> (this, resource.layout.item_menu, resource.id.menuitemtext, menuitemnames); and seems work fine. values menuitemnames array goes list , makes new item. next each item, have icon. how can set icon of each one? this tried: drawable sideicon1 = context.resources.getdrawable (resource.drawable.home_icon); drawable sideicon2 = context.resources.getdrawable (resource.drawable.new_icon); drawable sideicon3 = context.resources.getdrawable (resource.drawable.delete_icon); drawable sideicon4 = context.resources.getdrawable (resource.drawable.submit_icon); drawable sideicon5 = context.resources.getdrawable (resource.drawable.help_icon); then, mad

ios - Use of undeclared type 'AppDelegate' Swift -

i've spent half day trying solve next problem. testing coredata using swift language. follow this tutorial works fine. but after titorial i've tried modify structure , code. 'src' , groups inside folders, not groups created xcode. nssexpense.swift import foundation import coredata class nssexpense: nsmanagedobject { @nsmanaged var name: string @nsmanaged var descr: string @nsmanaged var value: nsnumber @nsmanaged var ismonthly: nsnumber @nsmanaged var paydayinmonth: nsnumber class func createinmanagedobjectcontext(moc: nsmanagedobjectcontext, name: string, value: double, paydayinmonth: int16, ismonthly: bool, descr: string!) -> nssexpense { let newexpense = nsentitydescription.insertnewobjectforentityforname("nssexpense", inmanagedobjectcontext: moc) nssexpense newexpense.name = name newexpense.value = nsnumber(double: value) newexpense.paydayinmonth = nsnumber(short: paydayinmonth)