Posts

Showing posts from April, 2012

fluentvalidation - AbstractValidator : showing error messages with property values -

i use following pattern when importing "unknown" data. public class mycustomobject { public string mycustomdateasstring { get; set; } public datetime? mycustomdate { { datetime? returnvalue = null; datetime parseresult = datetime.minvalue; bool parseattempt = datetime.tryparse(this.mycustomdateasstring, out parseresult); if (parseattempt) { returnvalue = parseresult; } return returnvalue; } } public string mycustomintasstring { get; set; } public int? mycustomint { { int? returnvalue = null; int parseresult = 0; bool parseattempt = int.tryparse(this.mycustomintasstring, out parseresult); if (parseattempt) { returnvalue = parseresult; } return returnvalue; } } } i have working. public

html - aligning elements in their containers and the containers on the line -

i've got several elements trying group , center them on page so: | | username: | ________________ | img 1 password: | ________________ | img 2 login | | | i don't want username , password centered, still want @ left side of input boxes. right looks this: | username im|g 2 | _______________ | img 1 _______________ pass|word: |

javascript - Watch ng-model whilst using minlength? -

i'm trying watch value of ng-model whilst using minlength validation. problem model value remains empty/undefined until validation criteria met. html <input ng-model="xyz" minlength="8" /> js $scope.$watch('xyz', function(val) { // either undefined or // string bigger or equal // 8 characters. console.log(val); }); i know substring element's value, code implemented in directive uses $compile , ideally i'd prefer watch model value. any thoughts on how resolve this? https://docs.angularjs.org/api/ng/directive/ngmodeloptions allowinvalid: boolean value indicates model can set values did not validate correctly instead of default behavior of setting model undefined.

excel - Simple VBA to inserting row at an increment -

it has been awhile since start use vba again. i have 1 question regarding inserting row @ increment of "0.1" the increment applies case when length > "0.1" ==================================================== when new row has been insert write id , route_id , new begin_point, new end_point, new length (new end_point - new begin_point) insert row until length < "0.1" ==================================================== please me out on or address me vba code done. specify question format desire answer below. i appreciate help! question id | route_id | begin_point | end_point | length | 1105 | a_st | 1.166 | 1.271 | 0.105 99 | c_blvd | 0 | 0.08 | 0.08 24 | b_ave | 0.447 | 0.627 | 0.18 desired answer id | route_id | begin_point | end_point | length | 1105 | a_st | 1.166 | 1.266 | 0.1 1105 | a_st | 1.266 | 1.271 | 0.005 99 | c_blvd | 0 | 0.08

java - Selenium Doc - How to use? -

i'm using following selenium doc ( http://selenium.googlecode.com/git/docs/api/java/index.html ),however not sure how can use effectively. example: if have use class keyboard , method presskeys(), per document class should import use presskeys() method. here code not working import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; import org.openqa.selenium.support.ui.expectedconditions; import org.openqa.selenium.chrome.chromedriver; import org.openqa.selenium.interactions.keyboard; public class myclass { public static void main(string[] args) { system.setproperty("webdriver.chrome.driver", "c:\\selenium-java-2.35.0\\chromedriver_win32_2.2\\chromedriver.exe"); webdriver driver = new chromedriver(); //open gmail driver.get("http://www.gmail.com"); driver.findelement(by.id("email")).presskeys } } error msg i'm getting last line : "presskeys cannot resolved or not

Scala macros: Is it possible to pass a class body as parameter? -

i'm trying make macro accepts block , uses class description. thought may work: class c def makec(body: =>unit): c = macro makecimpl def makecimpl(c: context)(body: c.tree) = { import c.universe._ val q"..$lines" = body q"new c{..$lines}" } but yields following error when trying use it: scala> val c = makec{var x = 6} java.lang.assertionerror: assertion failed: var x: int = 6 while compiling: <console> during phase: globalphase=typer, enteringphase=namer library version: version 2.11.8 compiler version: version 2.11.8 reconstructed args: -deprecation -feature -bootclasspath /usr/lib/jvm/jdk1.8.0_31/jre/lib/resources.jar:/usr/lib/jvm/jdk1.8.0_31/jre/lib/rt.jar:/usr/lib/jvm/jdk1.8.0_31/jre/lib/sunrsasign.jar:/usr/lib/jvm/jdk1.8.0_31/jre/lib/jsse.jar:/usr/lib/jvm/jdk1.8.0_31/jre/lib/jce.jar:/usr/lib/jvm/jdk1.8.0_31/jre/lib/charsets.jar:/usr/lib/jvm/jdk1.8.0_31/jre/lib/jfr.jar:/usr/lib/jvm/jdk1.8.0_31/jre/classes

asp.net mvc - No parameterless constructor defined for this object. (Debug never reaches any controller action?) -

i hate these kind of errors. i have asp.net core mvc form. when submit form dreaded "no parameterless constructor defined object." error. i can't seem hit in debugger me find have went wrong. my controller: using brand.extensions; using brand.models; using microsoft.aspnetcore.http; using microsoft.aspnetcore.mvc; namespace brand.controllers { public class contentcontroller : controller { public iactionresult index() { return view(); } [httpget] public iactionresult upload() { return view(); } [httppost] [validateantiforgerytoken] public iactionresult upload(uploadedcontentmodel uploadedcontentmodel, formcollection formcollection, iformfilecollection uploadedfiles) { contentextensions contentextensions = new contentextensions(); fileextensions fileextensions = new fileextensions(); filemodel file =

php - Adding a comma after each category -

this seems pretty straight forward question , reason having trouble figuring out how achieve looking for. $category = $html2->find('.video_cats',0); $category = $genre->plaintext; <div class="video_cats"> <span>categories:</span> <a href="http://www.example.com" title="example category" class="video_cat">house</a> <a href="http://www.example.com" title="example category" class="video_cat">the cat</a> <a href="http://www.example.com" title="example category" class="video_cat">car</a> <a href="http://www.example.com" title="example category" class="video_cat">the dog</a> </div> currently have string called $category if print results of string return following text one 2 3 4 five try

r - ggvis and rpivottable conflict in Shiny -

i plotting ggvis plot in 1 tab , generating rpivottable in tab. if add both ui.r, unable generate pivot table. below sample example. app <- shinyapp(ui = fluidpage(navbarpage("v0.5", tabpanel("report",sidebarlayout( sidebarpanel(actionbutton("bbutton","generate report")), mainpanel(rpivottableoutput("mypivot"),verbatimtextoutput("mytext")))), tabpanel("plot",sidebarlayout( sidebarpanel(actionbutton("cbutton","plot")),#mainpanel() mainpanel(ggvisoutput("myplot")) ) ) )), server = function(input,output){ observe({ input$bbutton output$mytext <- rendertext("hello there") #mydata <- getpi

vba - Sending an Outlook email with range from Excel sheet, using Macro when the Computer is locked -

i running dashboard refreshes weekly, using odbc connection. have written macro runs on auto_open. file getting opened task scheduler. system: windows 7 sp1, outlook 2016, excel 2016 problem: when schedule task setting run whether user logged on or not, excel file opens , gets refreshed, not send out mail via outlook, nor appear in outbox. refresh happen though. when user not logged on. the task schedule works fine when user logged on i have tried excel vba - email not send when computer locked , did not work me. the function using sending mail is: dim oapp object, outapp object, outmail object dim rng range dim strbody string, strtail string strbody = "hi team," & "<br>" & _ "<a href=""https://example.com"">here</a> link cloud upload" & worksheets("core view").range("m2") & "<br><br>" strtail = "thanks," & "<br&g

Adding Row Values when there are no results - MySQL -

problem statement: need result set include records not naturally return because null. i'm going put simplified code here since code seems long. table scores has company_type , company , score , project_id select score, count(project_id) scores company_type= :company_type group score results in following: score projects 5 95 4 94 3 215 2 51 1 155 everything working fine until apply condition company_type not include results in 1 of 5 score categories. when happens, don't have 5 rows in result set more. it displays this: score projects 5 5 3 6 1 3 i'd display this: score projects 5 5 4 0 3 6 2 0 1 3 i need results display 5 rows. (scores = 1-5) i tried 1 of approaches below spencer7593. simplified query looks this: select i.score score , ifnull(count(*), 0) projects (select 5 score union select 4 union select 3

angularjs - Browser sync not working locally with html5mode -

i'm working on angular app , having issue locally browser-sync. when edit page locally browser-sync tries reload page cannot /weeks5-8.html had same issue live version of site fixed adding htaccess file. i have tried connect-modrewrite solution didn't work first solution tried. i've tried historyapifallback solution again didn't work second solution tried. i'm curious if has had issue , if have solved it. site live. , repo site here. my browser-sync task follows: browsersync({ server: { basedir: './dist/', middleware: [ historyapifallback() ] } the angular file follows: angular.module('marshmallowandmammy',['ngroute']) .controller('mmcontroller', ['$scope', '$http', '$location', mmcontroller]) .config(['$routeprovider', '$locationprovider', function($routeprovider, $locationprovider){ $routeprovider. when("/", {templateurl:"/partials/homepage.html"}).

c# - Move picturebox with keyboard -

i new c# , want make picture box move when press wasd keys, picture box refuses move. picture box not docked, locked or anchored. code: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; namespace imagebox_test1 { public partial class form1 : form { public form1() { initializecomponent(); } private void form1_keydown(object sender, keyeventargs e) { int x = picturebox1.location.x; int y = picturebox1.location.y; if (e.keycode == keys.d) x += 1; else if (e.keycode == keys.a) x -= 1; else if (e.keycode == keys.w) x -= 1; else if (e.keycode == keys.s) x += 1; picturebox1.location = new point(x, y); } } } i have no idea what's going on! help! there 2

Multiple module maven project Error Could not find artifact -

i have multiple module maven project. changed snapshot version in each module. root -web-module --pom.xml -ear-module --pom.xml -common-module --pom.xml after changing version getting below error. could not find artifact com.kulhade.prj:common-module:jar:2017.08-snapshot in in myrepo i have few repositories in root pom helps me different dependencies. myrepo 1 of them. please suggest if encountered similar issue.

swift2 - How to check dictionary contains certain value, not certain key? -

fast way check if dictionary contains value, "dictionary.contains(value)" in java. ex: var dict:[int:string?] = [1:"hello", 2:"world"] how can check if dictionary contains "world"? your option iterate on each dictionary element find if value present. there multiple ways that, linear-time. one such way be: foreach (key, value) in dict { if value == "world" { print("found world") } } another (shorter) way be: dict.values.contains("world")

javascript - imagemapster different areas with different colors -

i wondering if following possible imagemapster: need area 1 , area 2. when hover 1 of them both have highlight in different colors, example area 1 blue , green when hover 1 of them , area 2 yellow , red on hover. this tried far: <script type="text/javascript"> $(document).ready(function () { $('#landkarte').mapster({ fillopacity:0.5, mapkey: 'data-group', areas : [ {key : 'keyone',fillcolor: 'ff0000',fillopacity : 0.5}, {key : 'keytwo',fillcolor: 'ffff00',fillopacity : 0.5}, }); }); </script> and html <area data-group="keyone,keytwo" href="#" coords="117,65,370,89" shape="rect"></area> <area data-group="keyone" href="#" coords="117,65,370,89" shape="rect"></area> this doesn't work way want. greatful if me out! best regards, raph differe

hibernate - JPA Error- No Persistence provider for EntityManager named -

Image
i can't solve problem @ , there ton of stack overflow posts exact same error message. have tried them , still can't work. maybe on looking small. need , thank in advance. error message initial entitymanagerfactory creation failed.javax.persistence.persistenceexception: no persistence provider entitymanager named org.hibernate.ejb.hibernatepersistence exception in thread "main" java.lang.exceptionininitializererror @ util.databaseutil.buildsessionfactory(databaseutil.java:18) @ util.databaseutil.<clinit>(databaseutil.java:8) @ test.main(test.java:68) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:498) @ com.intellij.rt.execution.application.appmain.main(appmain.java:144) caused by: javax.persistence

python - caffe Layer type Silence already registered -

i'm new caffe , have problem running "python layer" example at ./example/pycaffe/linreg.prototxt ./example/pycaffe/layers/pyloss.py i prepared temporary "solver.prototxt" follows: train_net: "examples/pycaffe/linreg.prototxt" base_lr: 0.001 lr_policy: "step" gamma: 0.1 stepsize: 50000 display: 20 momentum: 0.9 weight_decay: 0.0005 snapshot: 0 snapshot_prefix: "linreg" iter_size: 2 and executed ./build/tools/caffe train --solver ./examples/pycaffe/solver.prototxt but got error message follows: i0611 12:00:12.242858 44085 net.cpp:165] memory required data: 1280 i0611 12:00:12.242869 44085 layer_factory.hpp:77] creating layer loss f0611 12:00:12.415180 44085 layer_factory.hpp:68] check failed: registry.count(type) == 0 (1 vs. 0) layer type silence registered.** *** check failure stack trace: *** @ 0x7f446d873daa (unknown) @ 0x7f446d873ce4 (unknown) @ 0x7f446d8736e6

ruby on rails - How to config route.rb when locale is sub-directory -

i tried configure localize setting on ror. though set along guide below, doesn't work correctly. http://guides.rubyonrails.org/i18n.html here's code. here's simple restaurant list. application_controller.rb before_action :set_locale def set_locale i18n.locale = params[:locale] || i18n.default_locale end def default_url_options(options = {}) { locale: i18n.locale }.merge options end routes.rb # locale information scope "(:locale)" resources :restaurants end # example of regular route: 'restaurant/list' => 'restaurant#list' 'hello/index' => 'hello#index' and results here. routing error no route matches [get] "/en/restaurant/list" you defining non restful route (list) outside scope, not inside. if need stick 'list', should define inside scope well: # locale information scope "(:locale)" resources :restaurants :list, on: :collection end end t

Declaring variables creating a trigger in MySql error -

i'm having little problem creating trigger, because have declare few variables, , update operation using them. anyway, i'm gonna paste code, , error throws, , tell me i'm doing wrong. thanks. create trigger trg_league_info after update on matchs begin declare hometotalmatchcount ,homewinmatchcount ,homedrawmatchcount ,homelossmatchcount ,homeleaguescore ,homeagainstgoal ,homeforgoal ,homeaverage int default 0; declare awaytotalmatchcount ,awaywinmatchcount ,awaydrawmatchcount ,awaylossmatchcount ,awayleaguescore ,awayagainstgoal ,awayforgoal ,awayaverage int default 0; declare hometeamid ,awayteamid ,homescore ,awayscore ,seasonid ,status int default 0; select @hometeamid=homeid, @awayteamid=awayid , @homescore=homescore , @awayscore=awayscore ,@seasonid=seasonid , @status=status inserted; if (@status == 2) select @hometotalmatchcount=leaguetotalmatchcount , @homewinmatchcount=leaguewincount , @homedrawmatch

scrum - Jira Plan Board: filtering by label hides epics and story points -

Image
i have jira scrum board , when use following jql query it, cannot see epics or story points in plan board: team in ("team 1", "team 2") , labels in (sprint8-candidate) order rank asc but if remove label condition, can see epics , story points: team in ("team 1", "team 2") order rank asc can explain why filtering label hide epics , story points? update: per barnaby's comment, can see epics if change query include them: (labels in (sprint8-candidate) or type = epic) but still can't see story points per issue: update #2 : story point issue because in org has set second story point field , displaying wrong 1 in board configuration estimation settings. remember in jira epics issue type. the query selects based on labels going associate issues board have label in them. if epics don't have label excluded. you add label epics. i'm not sure if want. it may possible formulate jql include all epics, sto

python - Find the speed of download for a progressbar -

i'm writing script download videos website. i've added report hook download progress. so, far shows percentage , size of downloaded data. thought it'd interesting add download speed , eta. problem is, if use simple speed = chunk_size/time speeds shown accurate enough jump around crazy. so, i've used history of time taken download individual chunks. like, speed = chunk_size*n/sum(n_time_history) . shows stable download speed, wrong because value in few bits/s, while downloaded file visibly grows @ faster pace. can tell me i'm going wrong? here's code. def dlprogress(count, blocksize, totalsize): global init_count global time_history try: time_history.append(time.monotonic()) except nameerror: time_history = [time.monotonic()] try: init_count except nameerror: init_count = count percent = count*blocksize*100/totalsize dl, dlu = unitsize(count*blocksize) #returns size in kb, mb

java - How to do sonar job separately in jenkins for maven 3 project -

i configuring sonar plug-in in jenkins execute on maven 3 projects. currently maven project scheduled build when code change in svn , every 2hrs now want run sonar on same project once in night time, should not impact regular builds. i installed jenkins sonar plugin , able add sonar in 'post build actions' of project configuration, , build fine. in case sonar running each time after project build done, want run sonar @ night time. in approach did not included sonar maven plugin in pom file, since want use jenkins sonar plugin please let me know changes need pom end , jenkins end. the cleanest solution create dedicated jenkins job schedule sonarqube analysis. users using trigger configuration "skip if environment variable defined , set true" reach such goal.

bash - Shell script creates linux user account but password goes wrong -

i've written shell script create user accounts. script reads user account name , password text file , create account info. when execute script creates accounts, when try log in accounts can't log in due invalid password, please try again error. here script used create user accounts: file_name="t.txt" while read user pass useradd -p ${pass} ${user} done < $file_name edit-1: t.txt file contains user account information: space separated username , password per line. here snippet of file: user1 abcxyz user2 defxyz user3 ijklmn edit-2: when follow method recommended steve kline shows me following result: (still created accounts can't logged in given password) passwd: unrecognized option '--stdin' usage: passwd [options] [login] options: -a, --all report password status on accounts <---------------------------------- skipped -------------------------------> -x, --maxdays max_days set maximum num

ios - make an app appear in share panel to accept selected text from other apps -

i'm writing app in ios handles text. users can enter in own text via text area users able highlight text in other apps (e.g. mail, websites etc.) , allow users send text via selection , share panel app appear? can in ios , if how? reverse of uiactivityviewcontroller? an example phone. i'm on website, see phrase interesting, select it, , send notes text highlighting share option. notes apple app send other third party apps such twitter or whatsapp. app appear on shared list , able receive , process text. what need add app extension share extension type app. can read more on app extensions here started. https://developer.apple.com/library/mac/documentation/general/conceptual/extensibilitypg/share.html#//apple_ref/doc/uid/tp40014214-ch12-sw1

android - OnLocationStateChange cordova application crashes -

Image
the application working fetches users location using cordova geolocation plugin, , show location on google maps. the problem i'm facing when kill app , turn off/on location services settings application crashes. java.lang.runtimeexception: unable start receiver cordova.plugins.diagnostic$locationproviderchangedreceiver: java.lang.nullpointerexception: attempt invoke virtual method 'void cordova.plugins.diagnostic.notifylocationstatechange()' on null object reference caused by: java.lang.nullpointerexception: attempt invoke virtual method 'void cordova.plugins.diagnostic.notifylocationstatechange()' on null object reference screen shot of error got after running app directly android studio i'm using diagnostic plugin because i'm testing app on api 23 i-e marshmallow, needs run time permissions. if remove diagnostic plugin app crashes starts on marshmallow. the app runs on api's below 23 , not crashes when turn location services on

Dispatcher has detected a cyclic routing causing stability problems in phalcon -

when trying access controller following error coming. my code working fine in local machine apache server running. when uploading same code in server machine , try use. below given error coming. in server nginx web sever running. dispatcher has detected cyclic routing causing stability problems #0 [internal function]: phalcon\mvc\dispatcher->_throwdispatchexception('dispatcher has ...', 1) #1 [internal function]: phalcon\dispatcher->dispatch() #2 /home/vtermina/public_html/api/v2/public/index.php(31): phalcon\mvc\application->handle() #3 {main} this error occurs in 2 cases: you have declared 2 same named routes you dispatching actions a b a couple of times. if secont, possible ngnix configuration prevets phalcon receiving full list of parameters. difficult guess out w/o code , configuration.

Jquery animate move doesnt work -

im trying animate car image on webpage. opacity command work not moving. have put image tag inside big div allow space image tag , animation. <div class="blockone"> <div class="row blockonecomingsoon"> <h1 id="carmover" class="csoon">click see do</h1> </div> <div style="width:75%;margin:auto auto;top:10px" class="row"> <div style="width:300px;margin:auto auto"> <img style="top:10px"id="car" src="/components/pg.blocks/images/car.png" width="300" class="carplace" /> </div> </div> </div> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> </body> <body> <div class="container"&

c++ - How to get all pixels in connected components by opencv? -

Image
i use new opencv function connectedcomponentswithstats (version 3.0). how pixels in connected components? the result the third argument of connectedcomponentswithstats , stats , provides information allow draw bounding boxes around labeled regions. the second argument, labels should contain image zeros (black pixels) non labeled pixels , coloured pixels labeled groups of pixels, 1 colour per label.

How can I set a password for Visio files? -

i want put password on files no 1 can open without permission it appears short answer not unless have password protection zip files. you can test vba code , play visibility. won't guarantee security of document because visio doesn't have flexibility save macro-enabled drawing... limiting ability secure vba. you pique confusion of undesired user reading/viewing having of pages hidden... security obscurity if will.... unless enable macros, can still ideally want document why should use encrypted zip software , password protect document way. anyway... if you're still game crazy experiment tried... enabled developer view. go view code. here's how works... first need generate password hash. once password hash created... delete entire copy main sub, temporary sub, , core subs , functions below "thisdocument" object in developer > view code page set password entering password in place of "mypassword" in genmypwd sub. can execute

html - Images Uploading PHP -

i've been working on project relevantly easier took me it. i made entire website between doctors , patients; i'm badly stuck in uploading , retrieving images!! here code i've been building.. <?php session_start(); $un = "xxx"; $pw = "xxx"; $hn = "xxx"; $dbhandle = mysql_connect($hn, $un, $pw) or die("couldn't connect database"); mysql_set_charset('utf8'); $selected = mysql_select_db("dsnnet_login", $dbhandle); $myusername = $_session['snamed']; $target_dir = "uploaded/"; $target_file = $target_dir . basename($_files["filetoupload"]["name"]); $sql = mysql_query("update doctable set photoname='$target_file' username= '$myusername'"); $uploadok = 1; $imagefiletype = pathinfo($target_file,pathinfo_extension); // check if image file actual image or fake image if(isset($_post["submit"])) { $check = getima

c++ - Dangling Sprite pointer member variable after Sprite::create() -

i getting started cocos2d-x , encountering problem. below code throws read access violation error @ s->getchildrencount(); . helloworldscene.h class helloworld : public cocos2d::layer { public: static cocos2d::scene* createscene(); virtual bool init(); void update(float) override; create_func(helloworld); private: cocos2d::sprite* s; }; helloworldscene.cpp scene* helloworld::createscene() { auto scene = scene::create(); auto layer = helloworld::create(); scene->addchild(layer); return scene; } bool helloworld::init() { if ( !layer::init() ) { return false; } s = sprite::create(); this->scheduleupdate(); return true; } void helloworld::update(float delta) { int k = s->getchildrencount(); ... } my guess s becomes dangling pointer , has reference counting. read how reference counting works did not understand it. how possible sprite gets destroyed @ end of init ? doing it? what prop

matlab - Make vectors of unequal length equal in length by reducing the size of the largest ones -

i reading 5 columns .txt file 5 vectors. sometimes vectors 1 element larger others, need check if of equal length, , if not, have find ones largest , delete last element. think should able without loops. thinking of using find in combination isequal isequal returns logical, , not provide information on vectors largest. [seconds,sensor1vstatic,sensor2vpulsed,temperaturec,relativehumidity] = importfile(path); then depending on vectors longer 1 element, do, example seconds(end) = []; sensor1vstatic(end) = []; if seconds , sensor1vstatic longer other vectors 1 element assume vectors in cell array a : a = {[1 2 3], [1 2 3 4], [1 2 3 4 5]}; you can size of each vector with sz = cellfun(@(x)size(x,2), a); which return (for above example) sz = [ 3 4 5] now can find shortest vector: minlength = min(sz); and finally, make vectors length: b = cell2mat(cellfun(@(x)x(1:minlength), a, 'uniformoutput', false))'; there may more elegant ways (an

objective c - How to Incorporate an Array Into Model Object With Mantle? -

i have json object so: { "name": "brendan", "images": ["some.url.to.image1", "some.url.to.image2", "some.url.to.image3"] } my class follows: @interface mymodel : mtlmodel <mtljsonserializing> @property (nonatomic, copy) nsstring *name; @property (nonatomic, copy) nsarray *images; @end @implementation mymodel + (nsdictionary*)jsonkeypathsbypropertykey { return @{ @"name" : @"name", @"images" : @"images" }; } @end i can verify mymodel object has name set, images set null . how can populate array of strings mantle? update: apparently mtl_externalrepresentationarraytransformerwithmodelclass: deprecated. might work: [mtljsonadapter arraytransformerwithmodelclass:[nsstring class]]; you need specify value transformer key images array value transformer. can class method (on mymod

c# - cannot access a disposed object UserManager in asp.net mvc core -

Image
i have following code in service should create usermanager instance public class subscriptionservice : isubscriptionservice { private usermanager<applicationuser> usermanager; public usermanager<applicationuser> usermanager { { return usermanager; } private set { usermanager = value; } } public subscriptionservice( usermanager<applicationuser> usermanager, stripecustomerservice customerservice, stripesubscriptionservice subscriptionservice) { this.usermanager = usermanager; this.customerservice = customerservice; this.subscriptionservice = subscriptionservice; } public subscriptionservice(usermanager<applicationuser> usermanager) { this.usermanager = usermanager; } when usermanager called first time inside class, works second call returns error " cannot access disposed object usermanager " i'

update submodule in git desktop of Mac -

Image
i newbie in git. in repository, have modified file biblio.bib in submodule , need upload github. however, met following problem when click "commit master": can me solve this? you need stage changes first. not sure gui, in cli add submodule: git add <submodule_name>

html - JavaScript - Image gallery - Slide left and right -

i have responsive image gallery displays thumbnails on page, when clicked, enlarge image , open modal. the limitations of code when have opened image, have press 'x' button, , go thumbnails in order open image. what like, when modal opens up, enlarged image, there '<' , '>' button allows scroll through enlarged images. any ideas how can done? i hope clear, if not make more sense when view working example here . thank help! supposing image being displayed @ moment pic1 , have pic2, pic3, pic4 well. first need create array in javascript containing location of these files. assuming id of image "mainpic". var a=['pic1','pic2'....'pic4']; var l=a.length; var currentpic=0; function changeright(){ documnet.getelementbyid("mainpic").src=++window.currentpic%window.l; } function changeleft(){ document.getelementbyid("mainpic").src=abs(--window.currentpic%window.l); } now

html - TCPDF Set Font via CSS font-family -

i'm using latest version of tcpdf, , found cannot set fonts css font-family when using writehtml method. only way font set if use setfont , won't work out nicely me document needs have multiple fonts , template created using 1 html view file. here's template file far: <style media="all"> html, body, p, h1, h2, h3, td, span { font-family: 'heavydisplay' !important; font-size: 10pt; } </style> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td style="font-size:27pt;color:#2998ff">tax receipt</td> <td rowspan="2">company name</td> </tr> <tr> <td style="font-size:7pt;letter-spacing:.8pt;color:#999">&nbsp;<br>please retain income tax purposes</td> </tr> </table> i can confirm font-size property works. additionally, have t

java - How to add asyncTask code in application? -

i have register activity in application. has inputs of userid,email,password , mobile no. have created ui. code: public class registeractivity extends appcompatactivity { textview already; button signup; relativelayout parent; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_register); parent = (relativelayout)findviewbyid(r.id.parentpanel); setupui(parent); = (textview)findviewbyid(r.id.alreadyregistered); signup = (button) findviewbyid(r.id.sign_up_button); already.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { startactivity(new intent(registeractivity.this,loginactivity.class)); } }); signup.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v)

push notification - How to create an Amazon SNS topic -

i trying create amazon sns topic on aws console online, getting following error : aws access key id needs subscription service (service: amazonsns; status code: 403; error code: optinrequired; request id: dc64e7b8-ab93-512a-be3e-a86d4a25dbbc) can me need do, fix problem? it looks aren't subscribed key management service or certificate manager service. contact aws customer service , ask enroll in 2 services, , believe should correct issue.

user interface - Qt Designer rearrangeable image grid -

in qt designer, make grid of rearrangeable tiles (or buttons) users sort using "drag , drop" gesture. ex: grid of 9x9 square tiles. user can click tile #1 , "drag , drop" tile #9's position, while other tiles rearrange in "snap grid" manner, grid stays 9x9 can rearranged. (kinda puzzle) hopefully make sense. i beginner , wondering if there widget this. or way @ all?