Posts

Showing posts from September, 2012

Google recaptcha validation in yii2 always fails -

i use himiklab/yii2-recaptcha-widget . validation error when submit form. {"captcha":["the verification code incorrect."]}. form: $form->field($model, 'captcha',['template' => "{input}\n{hint}\n{error}"])->widget( \himiklab\yii2\recaptcha\recaptcha::classname(), [ 'sitekey' => <mysitekey>, 'widgetoptions' => ['id'=>'recaptcha1'] ]) controller: if(isset($_post['contact'])){ if ($model->load(yii::$app->request->post()) && $model->save()) { what doing wrong? the problem yii run validation twice, on validation() method , during save executes again validation, cause first validation successful second returns error. so, second case need save without running validations, save(false). the second chance might unhook validation of captcha before safe() method.

php - htaccess redirect to a maintainance file -

i have htaccess in public directory: <ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule> rewriteengine on rewritebase /sub/web1/ # redirect trailing slashes... rewriterule ^(.*)/$ /$1 [l,r=301] # here need som magical oneliner redirect stuff maintenance.html # no idea how write ;( # handle front controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] </ifmodule> and want add rule inside, when uncomment rule, links hit http://example.com/sub/web1/ or files down line, redirected http://example.com/sub/web1/maintenance.html i have tried add: directoryindex maintenance.html redirects http://example.com/sub/web1/ , if have subfolder or specific files http://example.com/sub/web1/posts , useless. is there oneliner can pull domain name hasn't have typed absolutely? so, example.com - or whatever domain

jquery - JavaScript getSelection issue -

if (!window.x) { x = {}; } x.selector = {}; x.selector.getselected = function() { if (window.getselection) { t = window.getselection(); } else if (document.getselection) { t = document.getselection(); } else if (document.selection) { t = document.selection.createrange().text; } return t; } function htmlspanhlt() { element = document.createelement("span"); element.setattribute('class', 'hlt'); return element; } function highlight_text(sel) { span = htmlspanhlt(); if (sel.getrangeat) { range = sel.getrangeat(0); } span.appendchild(range.extractcontents()); range.insertnode(span); } <div class="highlight"> <p> lorem ipsum dolor sit amet, eu ius autem labitur complectitur, eos aliquip nostrud ei, ludus erroribus vel ex. sea ex erat quaeque intellegam, et diam iusto deterruisset sea. summo minimum periculis pro ea, diam soleat id pro. cu putent inim

django - LookupError: App 'users' doesn't have a 'user' model -

django 1.9.7 i'm using pyenv virtualenv autoenv i want extend user model so, decide use abstractuser (abstractuser's class meta abstract = true, can't make table, inheritance class can make table, right??) anyways (wef project name) make app wef/users/models/__init__.py from .user import user in wef/users/models/user.py from django.contrib.auth.models import abstractuser django.db import models class user(abstractuser): phonenumber = models.charfield( max_length = 11, blank = true, null = true ) and add users app in settings.py installed_apps = [ [...] 'users', ] auth_user_model = 'users.user' so, think when makemigrations, migrate django make model table user... python wef/manage.py makemigrations users it shows error traceback (most recent call last): file "/users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/apps/config.py&q

python - Error while installing GDAL -

i'm trying install gdal through pip. i'm getting error: extensions/gdal_wrap.cpp:3089:27: fatal error: cpl_vsi_error.h: no such file or directory #include "cpl_vsi_error.h" ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed exit status 1 i used these commands: sudo apt-get install libgdal-dev export cplus_include_path=/usr/include/gdal export c_include_path=/usr/include/gdal pip install gdal can tell me how install ? check installed gdal using command gdal-config --version then run commands: pip install --download="some_path" gdal cd some_path tar -xvzf gdal-<version>.tar.gz cd gdal-<version> python setup.py build_ext --include-dirs=/usr/include/gdal/ python setup.py install

alias - Tableau: How to edit aliases, if I use only one source? -

Image
i know can change aliases if have primary , secondary source in use. however, while using 1 source (excel), there's no option 'edit alias'. there alternative, i.e. create calculate field? specifically: need keep months in order, don't want display digits instead of months names. want change {2;3;...;11} {"october";...;"june"} on axis. i assume have data similar - @ least regards month_number , month_name . there few ways want... option #1 - sort field: right-click on month name field , select sort. within popup, under sort by , check "field" , select field contains number of months. aggregation can minimum or maximum - benign long showing data @ month grain (which are). option #2 - use , hide number field header: make sure month number field discrete dimension place before month name field on shelf (rows or columns). right click on month number field , un-check 'show header'. option #3 - cr

java - How to organise the tests of an expensive object -

i have class want test junit. creating of object of type involves lot of io, takes 5 seconds. a mutable , want test different methods change a. in kind of dilemma: if create virgin object every test method, takes long. creating 1 huge test method lot of asserts seems bad idea isolate causes of possible errors. "repairing" object of type after each test methods seems dangerous because if repairing not done correctly, other test methods might fail without proper reason. i create deep copy of instance of every test method, means have change class test it. what suggest?

ruby on rails - Merging two branches, one with Postgres and another with SQLite3 -

like title says, building rails app , switching on sqlite3 postgres. believe have made switch on queries working successfully, on branch. can standard git merge [branch] master or should else? im worried merge have ton of conflicts , leave me app somewhere in middle of sqlite , psql. have been working hard on , dont want screw up. thanks much! your options bringing postgres branch master merging , rebasing. in either case, might merge conflicts in process, because changed queries around , git might not able figure out how resolve automatically. assuming no other changes have been made original queries in master point when branched off, should able retain postgres queries being authoritative version without paying attention conflicts. if suspect else in team might have modified .sql files, can switch master branch , @ diff between commit in master branched off, , head , e.g. git diff <sha-1 branching> head -- somefile.sql if diff shows changes

model view controller - When to use MVC and ECB? -

according book reading, understand facts. entity objects model objects in mvc responsible maintaining data. boundary objects interact external users, handling both input , output. in mvc, user input detected control objects, handling of output responsibility of view objects. difference have found. when googling, many said mvc typically used in user interface design whereas ecb used in business logic. mean? mvc used user interface? if so, responsibility of controller , view object in mvc? there great confusion mvc... just check uncle bob keynote: architecture lost years it answer of questions. architecture lost years robert

wpf - GroupStyle header vertically at the top not centered -

Image
i try generate listview following layout: if use standard grouping, headers (continent names) rendered vertically centered , need them vertically @ top of group. for column, or cells in column, should set cell's content use verticalalignment=center . this answer may helpful you.

PYTHON Is there a way I can get the year difference between two dates? -

i'm developing small program insurance company see how old person (this changes ranges of cover can offer). can calculate different in years not take account days/months. there way of doing without importing things elsewhere? thanks as working python must use datetime module. lets have look. from datetime import datetime bday = '1978/11/21' dt = datetime.strptime(bday, '%y/%m/%d') diff = datetime.now() - dt diff.days gives 13764

angularjs - Two scroll windows -

i have similar project: http://codepen.io/dmastag/pen/oxorpz but additionally, window on right contains tabs (md-tabs) on click switch windows have own scrolls. problem is, cannot use scroll function on right window, on left one. idea how solve that? goal extend list in right window when scroll @ bottom of list. i tried selector md-tab-content, because suspected window scroll, says value null?! doing wrong? have other solutions solve problem? greatful. the dom tree looks in browser: <md-tabs> <md-tabs-wrapper> <md-tabs-content-wrapper> <md-tab-content> </md-tab-content> </md-tabs-content-wrapper> </md-tabs-wrapper> </md-tabs> do have plnkr or codepen code ? did tried like: md-tabs-wrapper{ position: fixed; top: 0px; left: 0px; background-color: rgb(68, 114, 196) !important; z-index: 1000; width: 100%; } md-tabs.md-dynamic-height md-tab

visual studio - Why is VisualStudio not returning my json -

some javascript code calls url , uses promise function result. specific ionic factory code (from tutorial @ this blog andrew mcgivery ) i've inserted blank ionic/cordova app.. .factory('userservice', function ($http) { return { getusers: function () { return $http.get('https://randomuser.me/api/?results=10').then(function (response) { return response.data.results; }); } } }); unfortunately, code returning 404 when debugging android device and apphost9623: app couldn’t resolve ms-appx-web://com.ionicframework.ionicblankapp/www/{{item.user.picture.thumbnail}} because of error: data_not_available. when debugging in windows emulator. can visit url in external browser , see json results. if ctrl+click url in vs editor, internal browser show 'navigation webpage cancelled' , file download warning dialog appears asking if wish open or save api.json result. i added csp index.html <head&g

php - How to update multiple rows with diffrent data? -

i'm using code import data excel sheet, it's work fine when import sheet first time it's insert values mysql, when change values on sheet , try import data, it's not update thing. $query = "select positionid vacant positionid = '".$position."' , ptitle = '".$ptitle."' , location = '".$location."' , vacantd = '".$vdate."' , candidate = '".$resultcandidate."' , cv = '".$cvtorsaf."'"; $sql = mysql_query($query); if (!$sql) { // add check. die('invalid query: ' . mysql_error()); } $recresult = mysql_fetch_array($sql); $existname = $recresult["positionid"]; if($existname=="") { $inserttable= mysql_query("insert vacant (positionid, ptitle, location, vacantd, candidate, cv) values('".$position."', '".$ptitle."', '".$location."', '".$vdate."', &#

angularjs - How to trigger $onInit or $onChanges implictly in unit testing Angular component controller? -

i'm using angular 1.5.5 , jasmine test framework. have test passes: function createcontroller(bindings) { return $componentcontroller('mycontroller', null, bindings); } beforeeach(inject(function (_$componentcontroller_) { $componentcontroller = _$componentcontroller_; })); describe('on pages updated', function () { beforeeach(function () { controller = createcontroller({prop1: 0, prop2: 0}); controller.$oninit(); // see have explitcitly call $oninit function }); it('should update isselected , currentpage', function () { expect(controller.prop1).tobe(0); expect(controller.prop2).tobe(0); controller.prop1= 1; controller.prop2= 2; controller.$onchanges(controller); // , $onchanges here expect(controller.prop1).tobe(1); expect(controller.prop2).tobe(2); }); }); there issue in github regarding this: https://github.com/angular/angular.js/issues/14

c# - MVC Single Sign On: How to get Userdata from DB before the page is going to be loaded -

i have following issue: i working on built of intranet webpage single sign on. in home controller, before index page going loaded, take windows username of user via system.environment.username then connect database , information (like department , lastname, fullname) of user. these information stored in public variables , shown in navbar. use razor , write in section of layout: <li class="user-header"> <img src="~/dist/img/profile.png" class="img-circle" alt="user image"> <p>@projectname.controllers.homecontroller.username <small>@projectname.controllers.homecontroller.department</small> </p> </li> so there picture of user (avatar) , there should stay firstname, lastname , department. but here problem. works if user types in url home page (localhost order localhost/home). but if types in example (localhost/dashboard) homecontroller not going invoked , are

java - Remvoing object from a list while iterating it doesn't work (with iterator) -

this method: public void deleteevent(view view){ intent intent = new intent(this, mainactivity.class); (user myuser:localdatabase.geteventbyid(eventid).getinviteduserstotal()){ (event myevent:myuser.getattendinglist()) { listiterator<event> itr_attending =myuser.getattendinglist().listiterator(); if (myevent.getid()==eventid){ itr_attending.remove(); } } } toast.maketext(getapplicationcontext(), "the event deleted",toast.length_long).show(); startactivity(intent); } this method in order delete event database. in order need remove "attending list" of each invited user. (if user says going event, event moving list of him). each event has list of invited users (inviteduserstotal) , , each user, method should go on user's attending list , serach wanted event (myevent.getid()==eventid) , , delete it. in e

zip - Java ZipFile api fails to extact large files -

i reading large zip file (above 2.5gb). when try decompress file above 2.5gb, exeption java.util.zip.zipexception: error in opening zip file java.util.zip.zipexception: error in opening zip file @ java.util.zip.zipfile.open(native method) @ java.util.zip.zipfile.<init>(zipfile.java:219) @ java.util.zip.zipfile.<init>(zipfile.java:149) @ java.util.zip.zipfile.<init>(zipfile.java:163) this error doesnot occur when use zipinputstream instead of zipfile. why behaviour in zipfile api.

php - How to Continue Scrapping to next array(i) if one return "Failed to Open Steam" -

i using curl method check http response before scrapping. foreach($urls $url){ if($response($url)==200){ $html= new \htmldom($url);}} but as(the server response 404), loop stops, want continue(move next one) 1 of pages returns fails. i using laravel yanqi htmldom parser i think have user try{}catch{} blocks continue looping process. below example this. foreach($urls $url) { try{ if($response($url)==200) { $html= new \htmldom($url); } } catch(\exception $e) { // can catch exception } } i think you.

display badge number in Android using cordova -

Image
i writing android cordova application.i want display notification count in app icon same below image. using local notification plugin notification how can display badge number in app icon. tried badge plugin of cordova. https://github.com/katzer/cordova-plugin-badge it's not working in android. thanks in advance. this may set badge cordova.plugins.notification.badge.set(1); also check $cordovabadge module.controller('myctrl', function($cordovabadge) { $cordovabadge.set(3).then(function() { // have permission, badge set. }, function(err) { // not have permission. }); }); for more see this

c# - TypeLoadException using DllImport -

i'm using third party library developped in c++ win32 c# x86 application. i make differents calls library succeed except one. the call contains complicated signature. here c++ signature: er_code kmapi clgetmeasdata(device_handle hdevice, cl_colorspace type, cl_measdata* pcolor); here defines understand signature typedef int int32_km; //!< 32bit(signed) typedef int32_km er_code; #define kmapi __stdcall //!< stdcall (for windows os) typedef void* device_handle; /*! * enumeration of color space */ typedef enum ecl_colorspace { cl_colorspace_evxy = 0, //!< ev, x, y cl_colorspace_evuv, //!< ev, uf, vf cl_colorspace_evtcpjisduv, //!< ev, correlated color temperature tcp(jis), delta uv cl_colorspace_evtcpduv, //!< ev, correlated color temperature tcp, delta uv cl_colorspace_evdwpe, //!< ev, dominant wavelength, excitation purity cl_co

android - Underlined TextView is not anti-aliased -

Image
when trying make text underlined: setpaintflags(paint.underline_text_flag); textview becomes non anti-aliased. if enable anti-aliasing: getpaint().setantialias(true) then becomes anti-aliased. is there connection between anti-aliasing , paint.underline_text_flag ? there no connection betwenn anti-aliasing , paint.underline_text_flag . but difference setpaintflags(paint.underline_text_flag) remove default existing flags & set current flag paint.underline_text_flag only. try below code keep existing flags & add new flag yourtextview.setpaintflags(yourtextview.getpaintflags() | paint.underline_text_flag);

How can I run bash script file from chef-recipe -

i want implement logic in chef-recipe below. how can achieve this file=/tmp/productmain.param if [ -f "${file}" ]; if [ -f /tmp/monitor.sh ]; echo "[info] configuration beeing processed" /tmp/monitor.sh $file else error "the monitor script doe not exit exit 1 fi else error "input file not exist" exit 1 fi take @ chef documentation, , gives examples on how use bash resource: https://docs.chef.io/resource_bash.html

mysql - Sqoop psql query with dates -

hi have issues querying swoop , psaldb sqoop import --connect 'jdbc:postgresql://xx.xx.xxx.xx:xxxxx/database' --query 'select * report transact_time = '20160603-00:00:01' , $conditions' --username uname --target-dir /user/x/data --split-by transact_time i following error : error executing statement: org.postgresql.util.psqlexception: error: syntax error @ or near ":" position: 61 org.postgresql.util.psqlexception: error: syntax error @ or near ":" you need issue query wrapped double quotes ( " ) using single quotes ( ' ) in query , have use \$conditions instead of $conditions disallow shell treating shell variable. try: --query "select * report transact_time = '20160603-00:00:01' , \$conditions"

IcCube - Get yesterday's Member in MDX Query -

i have date dimension looking [date].[date].[day].[yyyy-mm-dd] , member representing yesterday i.e. [date].[date].[day].[2016-07-27] . how can accomplish this. in threads mdx, not iccube specific, written this: 1. strtomember("[date].[date].[day].["+ format(now()-1,"yyyy-mm-dd") +"]") 2. strtomember("[date].[date].[day].["+ vbamdx.format(vbamdx.now()-1,"yyyy-mm-dd") +"]") the first solution throws error stating 'unknown function format' , error in second solution reads '"vbamdx.now()" expecting single parameter "index"'. same goes vbamdx.format if replace vbamdx.now now. pages explaining vbamdx have 2 parameters format , none now... i guess because excel format not supported (error reporting has been improved in latest version of iccube). instead use functions mentionned in page : strtomember( "[time].[calendar].[day].&["+ datetostring( now()-1,"yyyy-

Need Optimization for Stored Procedure -

can let me know optimize query. have indexes on input tables. alter procedure [dbo].[sp_ctr_releaseservicesdata_roq_uploadjuly5th_nick] if object_id('tempdb..#tempbuildtable') not null drop table #tempbuildtable if object_id('tempdb..#tempsinglebuildtable') not null drop table #tempsinglebuildtable if object_id('tempdb..#finalbuild') not null drop table #finalbuild if object_id('tempdb..#tempbuilds') not null drop table #tempbuilds --if object_id('tempdb..#tempduplicatebuilds') not null drop table #tempduplicatebuilds --if object_id('tempdb..#tempuniquebuilds') not null drop table #tempuniquebuilds /* last 6 months builds #tempbuilds table*/ select * #tempbuilds (select distinct row_number() on (order min(createddateutc)) inx, buildnumberv2, min(createddateutc) mincreateddatetime, max(createddateutc) maxcreateddatetime, datediff(hour, min(createddateutc), max(createddateu

Dependency injection and Spring -

http://projects.spring.io/spring-framework/ at end of example have line , quote the example above shows basic concept of dependency injection, messageprinter decoupled messageservice implementation, spring framework wiring together. the article makes inference @ end messageprinter decoupled messageservice . i not understand how come using annotations messageprinter has been decoupled messageservice. please care explain?

hadoop - Solutions to put different values for a row-key but the same timestamps in hbase? -

i'm new @ hbase. i'm facing problem when bulk loading data text file hbase. assuming have following table: key_id | f1:c1 | f2:c2 row1 'a' 'b' row1 'x' 'y' when parse 2 records , put hbase @ same time (same timestamps), version {row1 'x' 'y'} updated. here explanation: when put data hbase, timestamp required. timestamp can generated automatically regionserver or can supplied you. timestamp must unique per version of given cell, because timestamp identifies version. modify previous version of cell, instance, issue put different value data itself, same timestamp. i'm thinking idea specify timestamps don't know how set automatically timestamps bulkloading , affect loading performance?? need fastest , safely importing process big data. i tried parse , put each record table, speed very slow...so question is: how many records/size of data should in batch before put hbase. (i write s

azure - LogicApp via ARM to Listen Dropbox ( trigger ) to FTP ( action ) -

would there arm template listening dropbox folder , creating file in ftp. find templates in azure on blob ftp. also, dropbox connection resource in deploy template? these details in documentaion. please find deploy json below { "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymenttemplate.json#", "contentversion": "1.0.0.0", "parameters": { "dropboxconnectionaccountname": { "type": "string", "metadata": { "description": "account name of dropbox." } }, "dropboxpassword": { "type": "securestring", "metadata": { "description": "password dropbox account" } }, "dropboxconnectionname": { "type": "string", "metadata": { "description": "the name of dropbox connection being created." } }, "ftps

php - Can't load Post with Comment in Laravel -

theese relations: comment model class comment extends model { /** * * comment belongs post * * @return \illuminate\database\eloquent\relations\belongsto */ public function post() { return $this->belongsto('app\post', 'post_id')->with('post'); } } post model class post extends model { /** * * post has many comments * * @return \illuminate\database\eloquent\relations\hasmany */ public function comments() { return $this->hasmany('app\comment'); } then trying check passes: $comment = comment::findorfail($id); return response()->json($comment); } only comment stuff retrieved without relation, don't understand, shouldn't eager load post along comment? while if remove ->with('post'); model , use $comment = comment::findorfail($id)->load('post'); the post gets loaded should work mod

osx - Read & Write file tag in cocoa app OS X with swift or obj-c -

Image
is there way read/write file tags without shell commands? tried nsfilemanager , cgimagesource classes. no luck far. an nsurl object has resource key nsurltagnameskey . value array of strings. this swift example reads tags, adds tag foo , write tags back. let url = nsurl(fileurlwithpath: "/path/to/file.ext") var resource : anyobject? { try url.getresourcevalue(&resource, forkey: nsurltagnameskey) var tags : [string] if resource == nil { tags = [string]() } else { tags = resource as! [string] } print(tags) tags += ["foo"] try url.setresourcevalue(tags, forkey: nsurltagnameskey) } catch let error nserror { print(error) } the swift 3+ version bit different. in url tagnames property get-only it's necessary bridge cast url foundation nsurl var url = url(fileurlwithpath: "/path/to/file.ext") { let resourcevalues = try url.resourcevalues(forkeys: [.tagnameskey]) var tags : [string] if l

java - find character in array -

i'm trying write method findchar(). method takes character , array of strings parameters , prints words in array contain specified parameter character. example test result string[] words = {"caravan", "car", "van", "bike", "scooter", "vehicle", "bicycle"}; findchar('v', words); words containing letter v : caravan van vehicle findchar('i', words); words containing letter : bike vehicle bicycle i got @ moment it's rough idea not 100% sure i'm still week learning java please go easy. public static void findchar(char character, string word) { for(string word:words) { // check if contains character if (word.contains(character.tostring(character))) { wordscontainingcharacter.add(word); } if(.....size() > 0) { system.out.println("words containing letter " + characte

android - Firebase remote config cache expiration time in release -

i'm trying setup firebase remote config release mode setting developer mode false . cache expiration time less 3000(may bit less, determined experimentally) seconds, fails fetch data. throws firebaseremoteconfigfetchthrottledexception firebaseremoteconfigsettings configsettings = new firebaseremoteconfigsettings.builder() .setdevelopermodeenabled(false) .build(); and .setdevelopermodeenabled(true) allows me set time 0 , works well. here whole hunk: new handler().postdelayed(new runnable() { @override public void run() { mfirebaseremoteconfig = firebaseremoteconfig.getinstance(); firebaseremoteconfigsettings configsettings = new firebaseremoteconfigsettings.builder() .setdevelopermodeenabled(false) .build(); mfirebaseremoteconfig.setconfigsettings(configsettings); mfirebaseremoteconfig.setdefaults(r.xml.remote_config_de

go - Golang http.Get block resources -

how can use golang's net/http's http.get(url string) block url's , resources request? e.g. http.get("https://google.com") // somehow block main css file. you not need block urls , resources because net/http get() not automatically perform fetching of included links or resources. you confuse how browser fetches url. browser issue request , follow fetching resources (javascript/css/images/videos etc.) go's net/http request lower level - more curl fetch - follow redirect default, otherwise fetch single response request. can think of result of issuing call `http.get(" https://google.com ") similar see in browser page source (plus http headers , response code). response include number of other urls links , resources - if like, can parse them out , request or of them (leaving out want "block"), low-level web crawlers do.

spring mvc - Hibernate Form Validation Display Error -

i have prepared sample spring mvc application understand hibernate validator api. the view not getting displayed, when run it, though have required files ready. the following files : list item _ @enablewebmvc @configuration @componentscan({"com.*"}) public class springconfig extends webmvcconfigureradapter { public void addhandler(resourcehandlerregistry registry) { registry.addresourcehandler("/resources/**/").addresourcelocations("/resources/" ); } @bean public internalresourceviewresolver viewresolver() { internalresourceviewresolver vr = new internalresourceviewresolver(); vr.setprefix("/web-inf/view/"); vr.setsuffix(".jsp"); return vr; } } controller @requestmapping("/form") public class formcontroller { @requestmapping(method=requestmethod.get) public string initform(model model) { form form = new form(); model.ad

android - Unable to build apk -

i working on current location tracking when trying build apk showing errors while building apk.i not getting problem. error:the number of method references in .dex file cannot exceed 64k. learn how resolve issue @ https://developer.android.com/tools/building/multidex.html error:execution failed task ':app:transformclasseswithdexfordebug'. com.android.build.api.transform.transformexception: com.android.ide.common.process.processexception: java.util.concurrent.executionexception: com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command 'c:\program files\java\jdk1.8.0_101\bin\java.exe'' finished non-zero exit value 2 in build.gradle add line , try again: multidexenabled true

swift - How can I store a cell height value in a Realm object that is associated with the cell? -

i using realm swift on ios store objects associated uitableviewcell . each cell of dynamic height, , store height information in realm object well. unfortunately, cannot put code update cell height information in notification block of realm object since trigger infinite loop. tried adding class creates sort of foreign key relationship base object , somehow triggered infinite loop try update other object in notification block. what best way out problem? much cocoa's key value observing, realm's notifications indicate object modified if set properties on object, if set properties existing values. triggering notification loop. avoid this, can check within notification block whether you're setting cell height property same value object has. if so, skip updating property.