Posts

Showing posts from August, 2011

Android Studio:OpenCv:Face-detection = java.lang.UnsatisfiedLinkError: Couldn't load detection_based_tracker from loader dalvik.system.PathClassLoader -

java.lang.unsatisfiedlinkerror: couldn't load detection_based_tracker loader dalvik.system.pathclassloader[dexpathlist[[zip file "/data/app/org.opencv.samples.facedetect-9.apk"],nativelibrarydirectories= [/data/app-lib/org.opencv.samples.facedetect-9, /vendor/lib, /system/lib]]]: findlibrary returned null and have error. at.org.opencv.samples.facedetect.fdactivity$1.onmanagerconnected(fdactivity.java:67) related rows: 66: // load native library after(!) opencv initialization 67: system.loadlibrary("detection_based_tracker"); gradle version: 2.14.1 plugin version: 2.2.0 build.gradle(app): apply plugin: 'com.android.application' android { compilesdkversion 25 buildtoolsversion "25.0.2" defaultconfig { applicationid "org.opencv.samples.facedetect" minsdkversion 8 targetsdkversion 8 ndk { modulename "detection_based_tracker" } } sourcesets.main {

r - Shiny - How not to select any option in radioButtons? -

how can not select option in radiobuttons? from doc : selected selected value (if not specified defaults first value) but don't want select when page loaded. possible? from documentation: if need represent "none selected" state, it's possible default radio buttons have no options selected using selected = character(0). however, not recommended, gives user no way return state once they've made selection. instead, consider having first of choices c("none selected" = ""). hope helps.

javascript - angularjs custom directive value to pass other page -

<!doctype html> <html lang="en"> <head> <title>angularjs routing example</title> <link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"> <style> body { padding-top: 10px; background-color: #f5f5f5; } </style> <!-- html5 shim , respond.js ie8 support of html5 elements , media queries --> <!--[if lt ie 9]> <script src="../../assets/js/html5shiv.js"></script> <script src="../../assets/js/respond.min.js"></script> <![endif]--> </head> <body ng-app="sampleapp"> <div class="container"> <div class="row"> <div class="col-md-3"> <ul class="nav"> <li><a href="#addneworder">

html - Override css over materializecss -

Image
since have installed materialize css. having trouble button uses custom class. need set border 0. button before : button after: i have tried : [type="checkbox"][_ngcontent-eog-31] + label[_ngcontent-eog-31]:before, [type="checkbox"][_ngcontent-eog-31]:not(.filled-in) + label[_ngcontent-eog-31]:after { border: 0px, none!important; } , checkbox{ border 0px, none!important; } border: 0px, none !important; invalid property value, remove ( , ) in between 0px , none try give following code, border: none !important; or border: 0px !important; or border: 0px none !important;

asp.net - Rewrite root url call to subfolder -

i have single page app index.html located in sub folder. people see when acess root url. what's missing in rewrite rule? <rewrite> <rules> <rule name="spa rewrite"> <match url="http://app.local" /> <action type="rewrite" url="http://app.local/spa/dist" /> </rule> </rules> </rewrite> your rule should this: <rule name="spa rewrite" stopprocessing="true"> <match url=".*" /> <conditions logicalgrouping="matchall"> <add input="{http_host}" pattern="app.local" /> <add input="{request_filename}" matchtype="isfile" negate="true" /> <add input="{request_filename}" matchtype="isdirectory" negate="true" /> </conditions> <action type="rewrite" url="/spa/dist"

html - javascript - Add a query string to url -

i'm having trouble redirecting user after submitting form. form serves allow user filter out doctors based on location, rating, , specialty. here code form , javascript function: <form onsubmit="getdoctors()" id="searchform"> <div> <div class="col-sm-3"> <div class="form-group"> <label for="specialty">specialty:</label> <select class="form-control" id="specialty"> <option value="">select</option> <% specialtylist.foreach(function(specialtyvalue){%> <option value="<%= specialtyvalue %>"><%= specialtyvalue %></option> <% }); %> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label for="rating"&

javascript - Invalid regular expression flags error Partial View -

i have div in view upload partialview. here code <div id="right2" style=" border-style: solid; border-color: #1d69b4; border-radius: 10px;"> @html.partial("calendardefault") </div> and button need change 1 partialview another here button code <button class="filled-button" onclick="myfunction()" style="background: #72c367">new appointment</button> and js code load <script> function myfunction() { $("#right2").load(@url.action("shedulenewappointment","calendar")); } </script> but have below errors myfunction not defined @ htmlbuttonelement.onclick (index:125) uncaught syntaxerror: invalid regular expression flags how can fix it? this example work me: here code have created in cshtml file: <script> $('#getdetails') .click(function() { $('#detailspl

sql - Getting the values of table2.column1 into table1.column1 -

what want values of 'script' column table 'item_db3' 'script' column of table 'item_db2' i tried script update item_db2 set item_db2.script=item_db3.script item_db2 join item_db3 on (item_db2.script=item_db3.script) interchange join , set statement like update item_db2 join item_db3 on item_db2.script = item_db3.script set item_db2.script = item_db3.script ** not sure trying updating column on joining. that's bit strange

c# - Why is Entity Framework generating the following nested SQL for Azure Mobile Services Table Controllers -

Image
i'm trying bottom of entity framework issue when using tablecontroller i've created following setup. the basic todoitem example provided new mobile web api leverages entityframework, tablecontroller & default entitydomainmanager public class todoitemcontroller : tablecontroller<todoitem> { protected override void initialize(httpcontrollercontext controllercontext) { base.initialize(controllercontext); context = new mobileservicecontext(); context.database.log += logtodebug; domainmanager = new entitydomainmanager<todoitem>(context, request); } public iqueryable<todoitem> getalltodoitems() { var q = query(); return q; } a vanilla web api 2 controller. public class todoitemswebcontroller : apicontroller { private mobileservicecontext db = new mobileservicecontext(); public todoitemswebcontroller() { db.database.log += logtodebug; } public ique

regex - Regular expression find and replace one char to another only in searched phrase -

i want find text beetwen tags , replace in find one char one example before: 432-543-432432value="4aa32-5aa43-432432" 432-543-432432value="432-532-4324-44" 432-543-432432value="2064-43-4-0" 432-543-432432value="643-42-423-52" 432-543-432432value="6-435-4-35-3453" 432-543-432432value="4-32-43-634-53" after: 432-543-432432value="4aa32zz5aa43zz432432" 432-543-432432value="432zz532zz4324zz44" 432-543-432432value="2064zz43zz4zz0" 432-543-432432value="643zz42zz423zz52" 432-543-432432value="6zz435zz4zz35zz3453" 432-543-432432value="4zz32zz43zz634zz53" so want replace "-" "zz" after value=" , next " is there way in notepad++ or other text editor edge situations: 432-543-432432value="---5aa43--432432" 432-543-432432value="---5aa,,43--4324,,32" 432-543-432432value="abc" 432-543-432432value="-

Why I can't search for UUID in elasticsearch database using filters -

i have django app use elasticsearch database, use elasticsearch-dsl , filters , queries works. have problem 1 parameter, it's uuid. got 0 results request in shell : s = search(index='my_index_name').filter('term', uuid='0deaa49b-15b6-4c10-acb7-d98df800e0df') response=s.execute() response i use django-rest-elasticsearch , have same issue, got correct rest result filters, not uuid request. works, need use filtering. q = q("multi_match", query="0deaa49b-15b6-4c10-acb7-d98df800e0df", fields=["uuid",]) response=s.execute() response maybe know hot use uuid in rest , because uuid=0deaa49b-15b6-4c10-acb7-d98df800e0df don't work.

amazon web services - How do I access the test reports from an AWS CodeBuild build? -

if tests fail build container discarded? short of copying test reports output s3 bucket every build, there easy way see tests failed , why? a possible solution might output test results stdout . cause them included in cloudwatch logs build, viewable on aws console or via api, without additional uploads.

Ansible - task serial 1 reverse order -

i'd create 2 playbooks, 1 stop environment, start it. part of environment rabbitmq cluster, stop/start order quite important, last node stopped needs first node started. i wondering if there way specify reverse order running task against group. way apply stop serial 1, , start serial 1 , reverse group order. i haven't found way define rabbitmq host group twice (under different names), in inverted order, seems bit distasteful. also attempted following: - hosts: "{ myhostsgroup | sort(reverse=false) }" serial: 1 and - hosts: "{ myhostsgroup | reverse }" serial: 1 but result stays same, whichever case , variation (reverse=true, reverse|list) attempted any appreciated. you can create dynamic groups in runtime: --- - hosts: localhost gather_facts: no tasks: - add_host: name: "{{ item }}" group: forward with_items: "{{ groups['mygroup'] }}" - add_host: name:

java - JMS/REST clients as a centralized library vs one per microservice? -

why microservices architecture mindset see benefit in duplicating rest/jms clients each service has independent code? does trade-off work out - given comfortability , maintainability of single library/adapter towards server-spec uses abstraction? what the benefits in practice? as on brisk of asking opinion, let's answer facts @ hand. the core thing understand: concept should never seen unalterable law . don't follow rules because rules, because provide helpful guidance regarding design decisions. in sense balancing. when can abstract common infrastructure elements, good practice avoid code duplication possible. so instead of creating more , more copies of same class, rather turn "internal library" , have service instances use that. downside here of course all services using library have dependency on it. coming there, strive provide framework . meaning: base, common parts implemented once - in fashion allows different services configure/e

javascript - HTML5 Fullscreen API is not working in IPhone SE safari browser and also in other latest Iphones -

i want make div container full-screen , works fine in desktop browsers , android browsers in iphone browser (safari) not working. i tried different element video,canvas , div full-screen api not working in iphone browser. can 1 please tell me how make html 5 div element full-screen in iphone browser. if not possible iphone browser other workaround there. i posting code here. please give suggestions. <!doctype html> <html> <head> <meta charset="utf-8"> <!--<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0">--> <!--<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0, minimal-ui">--> <!--<meta http-equiv="pragma" content="no-cache">--> <!--<meta http-equiv="expires" content=

special characters - Compare strings with middle dot not working in PHP -

i string database, encoded utf8_unicode_ci . might contain middle dot character (⋅) , have find out using strcmp . if show string in html directly, character displayed without problem when comparison, results not expect. for example: $string = "⋅⋅⋅ string starts middle dots"; $result = strcmp(substr($string , 0, 2), "⋅⋅"); the results not 0, think should be. php file saved utf-8 encoding. missing here? happens if take string variable instead of database php's substr not take unicode characters single character. the dot you're using 3 characters, 0xe2 0x8b 0x85 . so either use mb_substr, or use different offset: <?php $string = "⋅⋅⋅ string starts middle dots"; $result = strcmp(mb_substr($string , 0, 2), "⋅⋅"); var_dump($result); or if mb_* functions don't exist: <?php $string = "⋅⋅⋅ string starts middle dots"; $result = strcmp(substr($string , 0, 6), "⋅⋅"); var_dump($result);

java - Failing to create Firefox Web Driver in Tomcat 7 -

i have application need use selenium firefox webdriver. i'm using below configurations: os : windows 8 ide : eclipse selenium 3 , tomcat7. mozilla version : 54.0.1 geckodriver version: 0.18.0 here code snapshot of i've done far. system.setproperty("webdriver.gecko.driver", "c:\\users\\dalakada1\\desktop\\dev\\geckodriver.exe"); system.out.println("1"); desiredcapabilities capabilities = desiredcapabilities.firefox(); system.out.println("2"); capabilities.setcapability("marionette", true); system.out.println("3"); try { system.out.println("3.5"); //create driver webdriver driver = new firefoxdriver(); system.out.println("4"); it doesn't go beyond 3.5. searched on google , not find useful. do need include geckodriver.exe in web-inf/res?

routing - Rails 5 link_to specific controller action -

i have following routing problem in rails 5: <%= link_to product.id, product %> generates link localhost:3000/products/12345 what want link "ext" action in products controller: localhost:3000/products/ext/12345 if try build link <%= link_to 'to product', :controller => :products, :action => :ext %> it gives following error: no route matches {:action=>"ext", :controller=>"products"} in routes.rb have "products/ext/:id", to: "products#ext" thanks help! modify routes get "products/ext/:id", to: "products#ext", as: :products_ext and change view to <%= link_to products_ext_path(product) %>

pdf - Two input file types at the same time in GNU parallel? -

is possible have 2 input file types @ same time using 1 instance of gnu parallel ? this long command: find . -name \*.pdf | parallel -j 4 --progress --eta 'mkdir -p {.} && gs -dquiet -dinterpolate -dsafer -dbatch -dnopause -dpdfsettings=/ebook -dnumrenderingthreads=4 -sdevice=pgmraw -r300 -dtextalphabits=4 -sprocesscolormodel=devicegray -scolorconversionstrategy=gray -doverrideicc -o {.}/{.}-%03d.pgm {}' && time find . -name \*.pgm | parallel -j 4 --progress --eta 'tesseract {} {.} -l deu_frak && rm {.}.pgm' a) creates folder each pdf reads (first input file type) convert pdf ghostscript pgm images moves them in respective folder then use tesseract perform ocr on each pgm (second input file type) after save text files in each respective folder and finally, deletes pgm image files. however, above command consists of 2 commands combined && , splitting above routine 2 separate parts. result would: b) convert first

android - ) expected or missing -

@targetapi(build.version_codes.lollipop) public class homeactivity extends activity { private static final string tag = homeactivity.class.getsimplename(); private imagebutton imagebutton; private imagebutton imagebutton2; public imagebutton imagebutton4; public imagebutton imagebutton5; private imageview imageview; private imageview imageview2; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_home); imagebutton = (imagebutton) findviewbyid(r.id.imagebutton); imagebutton2 = (imagebutton) findviewbyid(r.id.imagebutton2); imagebutton4 = (imagebutton) findviewbyid(r.id.imagebutton4); imagebutton5 = (imagebutton) findviewbyid(r.id.imagebutton5); imageview = (imageview) findviewbyid(r.id.imageview); imageview2 = (imageview) findviewbyid(r.id.imageview2); //single player button click event imageb

javascript - How to extract GPU information in electron app? -

is there option retrieve graphic card running on system (windows) not require usage of chrome://gpu/ ? from quick google search, found package called systeminfo , has function called graphics . return array of graphics controllers , displays can filter 2 major vendors (ati/amd , nvidia). package: https://www.npmjs.com/package/systeminformation

jquery - Google Maps and Bootstrap tabs, but with a 3rd party Map Generator -

i'm aware googlemap has glitch bootstrap hidden tabs , triggered resize required ( google.maps.event.trigger(map, 'resize'); ) i'm using 3rd party map generator ease of use, , of course have glitches too: in short, google map not displayed on bootstrap hidden tab (it's not misaligned : doesn't show @ all): here is <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <!--google map generator scripts--> <script src="//maps.googleapis.com/maps/api/js?key=aizasya222wozvynudm3i0a2tr_vlmh_ripq284"></script> <script src="//www.map-generator.org/map/iframejs/65305168-032a-400b-9698-f5c2fcba4477?key=aizasya222wozvynudm3i0a2tr_vlmh_ripq284&amp;width=100%&amp;height=200px"></script> <!--core js--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <scr

javascript - What are the advantages of using Redux over React? -

reading this article wonder: advantages of using redux on react ? used redux keep state of application. reading article, can exchange state (between components ) of application react easy redux . what advantages of using redux oder react then? i guess using redux with react, not over react. react view library, , redux helps manage state of application. if building huge application, going increasingly difficult manage state throughout components, if using solely react. however, in smaller applications few modules react should sufficient , redux might overkill. depends on use case. i recommend read when should use redux, said on faq of redux docs. http://redux.js.org/docs/faq/general.html#general-when-to-use as dan abramov (creator of redux) said - i amend this: don't use redux until have problems vanilla react.

json - Kraken-API: input-option; Python -

i've been trying load kraken-api-content hours now, still doesn't work. problem following: in api-description https://www.kraken.com/help/api#public-market-data there says "input". i.e. url https://api.kraken.com/0/public/assetpairs optional use "input": "info = leverage", otherwise works default "info = info". python2.7-code import os import urllib, json import time dir_path_this = os.path.dirname(os.path.realpath(__file__)) os.chdir(dir_path_this) url = "https://api.kraken.com/0/public/assetpairs" filename_pair = "pair"+ ".json" response = urllib.urlopen(url) pairinfo_dict = json.loads(response.read()) open(filename_pair, 'wb') outfile: json.dump(pairinfo_dict, outfile) works fine, because "input" taken default, don't have set it. url https://api.kraken.com/0/public/ticker have tell python "input": "pair = comma delimited list of asset pairs info on",

javascript - Pass object id to session storage -

i have simple function post selected object id session storage works numbers when change word dose not work, idea why , how fix it? i thought fine both string, can see function @ bottom parse json, dont see why works numbers ? code $scope.productsandformats = [{ "name": "name 1", "format": [{ "fname": "test (roadside temp)", "id": "roadside" }, { "fname": "test sheet", "id": "2" }, { "fname": "wrap test (digital)", "id": "3" }] }, { "name": "name 2, "format": [{ "fname": "2 test", "id": "4" }, { "fname": "test live (digital)", "id": "5" }] }; $scope.producttypechange = function() { $scope.formats = $scope.pr

c# - CSharp Prepared Statement with MySQL does not work -

hello folk, first tell new csharp , why did not know way of creating connection mysql wrong, because of had change prepared statement. please kind! this method trying make works. [httppost] public actionresult validateslogin (user euser) { var email = euser.email; var password = euser.password; try { mysqlcommand cmd = mysqlconn.cmd; cmd = new mysqlcommand(" user " + "where email=@email " + "and password=@password", mysqlconn.conn); cmd.prepare(); cmd.parameters.addwithvalue("@email", username); cmd.parameters.addwithvalue("@password", password); int result = (int)cmd.executereader(); //encrypting login user password //the encrypter , decrypter must have same key 'kahat' below var encryptpassword = encrypthelper.encryptstring(euser.

csom - Set baseline programmatically in project server -

how can set baseline programmatic-ally in microsoft project server? there blogs this? providing version using or useful details can explain question properly. but in general cannot set baselines using psi nor csom, according msdn post here: https://msdn.microsoft.com/en-us/library/office/ee767706.aspx?f=255&mspperror=-2147217396#pj14_whatpsidoes_doesnotdo actions require project professional: following list things neither psi nor csom can do. . . . baselines , earned value saving baseline or editing baseline data. setting progress date. calculating variance , earned value.

math - Custom number system in C# -

this question has answer here: how convert column number (eg. 127) excel column (eg. aa) 44 answers i have requirement custom number system in c# goes following: a - 1 b - 2 ... z - 26 aa - 27 ab - 28 i've made function converts arbitrary strings numbers this: private const int min = 'a'; private const int max = 'z'; private const int base = max - min + 1; private static int getcharvalue(char c) { if (c < min || c > max) throw new argumentoutofrangeexception(nameof(c), c, $"character needs between '{min}' , '{max}', '{c}'."); return c - min + 1; } public static int getstringvalue(string s) { char[] chars = s.tochararray(); int[] values = new int[chars.length]; (var = 0; < chars.length; i++) { v

swift - Positioning of labels according to the length of the text -

i have requirement of displaying labels in table view.the number of labels in tableview cell , length of generating dynamically. for example if user selects 10 names in popup, names should displayed in 10 different labels in tableviewcell , length of text may vary...how achieve this....thanks in advance enter image description here try use thelabeltouse.sizetofit() first concatenate strings of different names single string want display in label. update label frame fit content.

ruby - Best way to get records from another model again and again - Rails -

i have model booking contains space_id attributes associated space model belongs_to :space . now have multiple spaces , want count each booking respect every id. i want best way fatch records db without fire query again , again. currently, i'm doing this: spaces = space.all result = [] spaces.each |s| result << s.as_json.merge(:bookings_counts=>s.bookings.count) end but firing query again , again form db. there best way this? this called "n+1 queries" problem. in rails can use eager loading resolve it. use includes load records in single query changing first line of code to spaces = space.eager_load(:bookings) here explanation , comparison of ways ( includes , eager_load , preload ) eager loading in rails link .

Google Core Reporting API v4: get results on hourly basis? -

when using google core reporting api v4 can query day-by-day using api. query on hourly basis instead of daily basis go 1 level "deeper" in case sampling occurs. now know done adding dimension datetime but, leaves me 1 dimension slot can't use anymore. problem since limited 7. if think it, adding ga:hour dimensions might give me more results since it's creating same report more detail in it. not data "for 1 hour". i know possible hourly data when using google ui.the question clear: how hourly data google core reporting api v4 (yyyy-mm-dd-hh)? you can't. can query whole day of data, , can nuse filter see 1 slice of data, said use dimension on query , not improve sampling @ all.

scala - Get a string from an object in the template -

imagine have case class so: case class team(_id: option[bsonobjectid], name: string = "", city: string = "", country: string = "") and passing template (in play 2.5/scala/reactivemongo 0.11.14) this: @(teams : seq[models.team]) ... @for(team <- teams){ <tr> <td>@team._id</td> <td>@team.name</td> <td>@team.city</td> <td>@team.country</td> </tr> } ... i need @team._id (which type option[bsonobjectid] ) string - bsonobjectid characters string . have been trying declare reusable values documented here can't seem right. ordinarily use flatmap isn't working expected within template. help! following on seems should use method within case case class @marcospereira suggested. little stuck (unsurprisingly!) on syntax in regex expression. trying make string - bso

sql - Update all rows to 0 and only one to 1 -

how can update rows @ 0 , id=x set 1. update car_ads set deal_of_the_week_p = if(deal_of_the_week_p = 1, 0, 1) ad_id = 999 now have not working. thanks assuming using standards-compliant dbms, use update car_ads set deal_of_the_week_p = case when ad_id = 999 1 else 0 end alternatively, run 2 separate updates - update car_ads set deal_of_the_week_p = 0 update car_ads set deal_of_the_week_p = 1 ad_id = 999

python - How to sequentially aggregate the content of a dask Bag? -

i sequentially aggregate content of partitioned collection aggregation function not associative, therefore cannot use bag.fold or bag.reduction . there bag.accumulate seems operation, returns bag per-partition intermediate results instead of final aggregate: >>> import dask.bag db >>> >>> def collect(acc, e): ... if acc none: ... acc = list() ... acc.append(e) ... return acc ... >>> b = db.from_sequence(range(10), npartitions=3) >>> b.accumulate(collect, initial=none).compute() [none, [0, 1, 2, 3], [0, 1, 2, 3], [0, 1, 2, 3], [0, 1, 2, 3], [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]] basically interested in last element of accumulate output , don't want keep copy of intermediate steps in memory. bag doesn't have sequential reduction operation, could. simple way

OPC communication with Python -

i quite new opc , python patient :) have hart usb modem connected sensor communicating hart standard.(hart seen opc item). establish communication python retrieve example id , measured values (all hart general function). how can this? i'm not familiar opc in python, found link may like! http://openopc.sourceforge.net/api.html cheers!

cocos2d Objective-C adding multiple images to table cells -

i'm developing game setup settings menu in form of table cells. click on settings button in main menu , setting panel in form of table cell pop up. able load single image table shown below. need load different images each table cell. table my code looks following: #import "ccnode.h" @interface cgtableview : ccnode @property (nonatomic, assign)cgfloat height; - (instancetype)inittableviewwithidentifier:(nsstring *)identifier withblock:(void (^)(nsstring *identifer))block; - (instancetype)inittableviewwithidentifier:(nsstring *)identifier imagename:(nsstring *)imagename withblock:(void (^)(nsstring *identifer))block; @end then in implementation following: #import "cgtableview.h" #import "cgbutton.h" @interface cgtableview () @property (nonatomic, copy)void (^block)(nsstring *); @property (nonatomic, strong)nsstring *identifier; @end @implementation cgtableview - (instancetype)inittableviewwithidentifier:(nsstring *)identifier imagenam

java - How do I deserialize flat JSON into multiple instances of a sub-class? -

i got flat json string like {"ccy":"eur", "value1":500, "value2":200, "date":"2017-07-25", "type":"", ... <many other pairs>} the json string shall deserialized in java using jackson: public class data { @jsonproperty("ccy") private string currency; private amount value1; private amount value2; @jsonproperty("date") private string date; @jsonproperty("type") private string type; ... <many other members> } with public class amount { private double value; private string currency; public amount(double value, string currency) { this.value = value; this.currency = currency; } } what correct use of jackson annotations fill value1 , value2 fields in data class? i tried custom setters like: @jsonsetter("value1") private void setvalue1(double value1) { this.value1 = new amount(value1, this.c

angular - Angular4 - cant implement password match validator -

from angular docs: const form = new formgroup({ password: new formcontrol('', validators.minlength(2)), passwordconfirm: new formcontrol('', validators.minlength(2)), }, passwordmatchvalidator); function passwordmatchvalidator(g: formgroup) { return g.get('password').value === g.get('passwordconfirm').value ? null : {'mismatch': true}; } i don't know how call passwordmatchvalidator function. tried like: <div *ngif="form.passwordmatchvalidator"> but without success... to show div error message if passwords don't match, do: <div *ngif="form.haserror('mismatch')">

python - Update pandas series value based on a condition -

i have series of strings. want this: for item in series: if '!' in item: series[item] = item.split('!')[0] basically, if there's '!' in string, replace part before '!'. code doesn't seem change series @ all. how conditional replace properly? i think condition not necessary if use str.split indexing str : s = pd.series(['sss!dd','sdsd', 'aa!p']) s = s.str.split('!').str[0] 0 sss 1 sdsd 2 aa dtype: object but if need condition add mask , str.contains : s = s.mask(s.str.contains('!'), s.str.split('!').str[0]) print (s) 0 sss 1 sdsd 2 aa dtype: object

Angular 2 how to emit methode in component child to component parent -

i try erase input field child component, transferred @ouput information activate method delete() in parent component! thank in advance you can acomplish using eventemitter , @output : in following snippet, can call passdatatoparent() function pass desired data. child.component.ts import { component, oninit, output, eventemitter } '@angular/core'; @component({ selector: 'app-child-component', templateurl: './child.component.html', styleurls: ['./child.component.css'] }) export class childcomponent implements oninit { // ******** important part ****** @output() emitter: eventemitter<any[]> = new eventemitter(); datatoemit : = "data pass parent component"; constructor() {} ngoninit() { } //call function pass data passdatatoparent() { this.emitter.emit(this.datatoemit); } } parent.compo

angular - Protractor - how to set chrome://flags/ when running tests -

my integration tests benefit flag set in chrome://flags - #enable-asm-webassembly. when tests run don't use own user preferences flag unset. there way set these? https://sites.google.com/a/chromium.org/chromedriver/capabilities capabilities: { 'browsername': 'chrome', 'chromeoptions': { 'args': ['start-minimized', 'window-size=1920,1080'], 'localstate': { "browser": { "enabled_labs_experiments": ["enable-asm-webassembly@1"] } } } } you can understand dictionary structure changing flags , see how getting reflected in localstate file. configuration stored chrome under appdata\local\google\chrome\user data\local state

php - Protect application with microsoft azure AD -

i build application azure directory. i created apps here: https://apps.dev.microsoft.com the problem is: people can connect application microsoft account. it possible, because application in active directory, prevent connect on application except people in active directory? i tried many apps active-directory magium , other use active directory azure graph api. should put validation after $entity = $ad->authenticate(); i work php. anyone know can fixed ? update authorization url: https://login.microsoftonline.com/common/oauth2/v2.0/authorize?state=..&scope=..&response_type=code&approval_prompt=auto&client_id=&redirect_uri=... please replace common in sign-in uri name of azure ad (e.g company.onmicrosoft.com). part of sign-in uri be: https://login.microsoftonline.com/{company.onmicrosoft.com}/oauth2/v2.0/authorize?...rest... this ensure users azure ad able sign in. can read more endpoints in azure ad v2 here: https://docs.

winforms - vb.net unwanted richtextbox resizing -

Image
i have 2 richtextboxes of exact same size located on form. however, when run it, one's height reduces. there other controls around leaves weird space. causes that? form in design tab form once run it i've tried constraining control "same height" button, i've created new richtextbox, keeps on happening. it depends on computers, on screens unusual resolutions box correct size. thank you its because scroll bar coming in picture. in order uniformly set positions , sizes of richtextboxes use docking or anchoring

symfony - Retrieve session value and pass to an entity attribute -

Image
i want retrieve quantity each item store in session , store in database. how retrieve quantity in session , passed quantity attribute of article entity during database persistence? for example article: (id 4, quantity 2). store 2 in quantity attribute of article entity. tried : $article->setquantity($session->get('panier')); i have error: an exception occurred while executing 'insert article ....... {"4": "2"} notice: array string conversion /** * @route("/payment", name="payment") */ public function paymentaction(request $request) { $session = $request->getsession(); $produits = $this->getdoctrine()->getmanager()->getrepository('appbundle:stock')->findarray(array_keys($session->get('panier'))); $commande = $session->get('commande'); var_dump($session->get('panier')); if ($request->ism

R: 2-way repeated measures ANOVA & pairwise.t.test -

using example proposed field in discovering statistics using r (pag 561) 1-way repeated measures anova: participant <- gl(8, 4, labels = c("p1", "p2", "p3", "p4", "p5", "p6", "p7","p8" )) animal <- gl(4, 1, 32, labels = c("stick_insect", "kangaroo_testicle", "fish_eye", "witchetty_grub")) retch <- c(8, 7, 1, 6, 9, 5, 2, 5, 6, 2, 3, 8, 5, 3, 1, 9, 8, 4, 5, 8, 7, 5, 6, 7, 10, 2, 7, 2, 12, 6, 8, 1) longbush<-data.frame(participant, animal, retch) pairwise.t.test(longbush$retch, longbush$animal, paired=true, alternative="two.sided", p.adjust.method="none") the result is: stick_insect kangaroo_testicle fish_eye kangaroo_testicle 0.00202 - - fish_eye 0.00094 0.92007 - witchetty_grub 0.22673 0.29867 0.40204 change bit 'pairw

Installing wordpress on Azurewebsites running Django -

Image
we running django application on azure websites. install blog on www.example.com/blog. we uploaded wordpress root directory, www.example.com/blog. django url handler stopping request subdirectory , issuing 404 page. how solve issue? it sounds want deploy multiple apps (a wordpress in php & django in python) on same azure website instance. so steps below, please try. first of all, please check php runtime option of application settings whether enabled on azure portal, figure below, , refer offical document configure php in azure app service web apps know more details. to configure new entry of virtual applications , directories on azure portal figure below, similar other thread how deploy multiple apps on azure webapps can refer to. finally, can upload wordpress installation files path site/wwwroot/blog , install normally. hope helps.

python - DataLossError: Unable to open table file error in TensorFlow -

i have been studying while kaggle link predicting fraud tensorflow . dataset releated fraud . commented on line 33 , when try rewrite codes saving/checkpointing gives error. datalosserror: unable open table file c:\users\mert\best_model.ckpt: data loss: file short sstable: perhaps file in different file format , need use different restore operator? [[node: save_5/restorev2_51 = restorev2[dtypes=[dt_float], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_save_5/const_0_0, save_5/restorev2_51/tensor_names, save_5/restorev2_51/shape_and_slices)]] at first created empty file right location called best_model . have taken error after converted empty best_model.txt file best_model.ckpt . could me please ? in advance. empty files not valid tensorflow checkpoint files. try saving checkpoint training model first.

java - Problems with generating another "Joke" Statement -

currently, creating simple program tells jokes users. bot: how can 4 suits dollar? type reveal view answer you: reveal bot: buy deck of cards. giggle giggle bot: wish continue? yes or no? you: yes bot: call boomerang won't come back? type reveal view answer that intended script. however, faced problem: bot: wish continue? yes or no? you: yes bot: wrong >:d the bot print out "wrong" instead of generating joke. here code: public class newclass { public static void main(string[] args) { int randomnumber; string userinput; string[] jokesanswer = {"snowballs! haha ", "a stick!!! :d", "a pork chop.", "a piano! hehe ", "a dead centipede!! xd", "at crystal ball. *chuckle chuckle*", "a conversation. teehee", "buy deck of cards. *giggle giggle*"}; string[] jokes = {"what difference between snowman , snow

user interface - how to use scrollbar in kivy python -

Image
can tell me how use scrollbar in code? , secondly, there way align labels , textinput text inside textinput visible no matter how input there. here alignment means: if there 100s(hundreds or thousands) of textinputs , text inside textinput should visible. when giving (spacing = 50) in code, after 20s input, text not visible properly. in advance. from kivy.app import app kivy.uix.tabbedpanel import tabbedpanel kivy.uix.boxlayout import boxlayout kivy.properties import stringproperty kivy.uix.textinput import textinput kivy.uix.checkbox import checkbox kivy.lang import builder rows = ['goc', 'coc', 'eee', 'abs' , 'kju' , 'iop' , 'nmg', 'gty', 'jkio', 'dbkgcd' , 'udbcbjkb'] builder.load_string(""" <test>: do_default_tab: false tabbedpanelitem: text: 'page1' table: padding: 50, 50, 50, 50 orientation: 'vertical