Posts

Showing posts from August, 2015

javascript - whta is use of .Class method in ng.core.component in es5 -

var app = ng.core.component({ selector:'myapp', template:'<h1>helloworld</h1>' }). class( { constructor:function() } ); according angular2 quickstart guide: the class method implement component itself, giving properties , methods bind view , whatever behavior appropriate part of ui. ref: https://angular.io/docs/js/latest/quickstart.html#!#add-the-component-file

java - Android Studio can't open (port.lock access denied) -

when open android studio gives following error: java.io.filenotfoundexception: c:\users\hp\.androidstudio2.2\config\port.lock (access denied) the javac path correct , file has can access (port.lock) this full error message getting: java.io.filenotfoundexception: c:\users\hp\.androidstudio2.2\config\port.lock (access denied) @ java.io.fileoutputstream.open0(native method) @ java.io.fileoutputstream.open(fileoutputstream.java:270) @ java.io.fileoutputstream.<init>(fileoutputstream.java:213) @ com.intellij.idea.socketlock.underlocks(socketlock.java:186) @ com.intellij.idea.socketlock.lock(socketlock.java:128) @ com.intellij.idea.startuputil.locksystemfolders(startuputil.java:318) @ com.intellij.idea.startuputil.prepareandstart(startuputil.java:140) @ com.intellij.idea.mainimpl.start(mainimpl.java:34) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl

mysql - Conditionally add another column in query base on other query result -

i found solution add query column case when then same table depending on column value can't solve problem. i have 2 tables. table: pools id date title description ------ ---------- -------------- --------------------- 1 2016-11-10 pool 1 description table: votes id date time pool_id option_id uid ------ ---------- -------- ------- --------- ------------------------------ 1 2016-11-10 21:22:23 1 1 xodxfbferdzsofrnbj0aecmgpyo2 2 2016-11-10 21:22:23 1 2 phbz675xdzel59qfklqq8u1uqyg2 i want query output passing uid in query. id date title voted ------ ---------- -------------- --------------------- 1 2016-11-10 pool 1 yes you can left join 2 tables pools , votes . check if corresponding entry exists in votes, show yes else no. for better explanation, created 1 more ent

bundling and minification - How can you bundle Angular 2 using System JS Builder? -

i'm using system js system js builder bundle application, assets, , libraries references. problem can bundle libraries referenced explicitly in index.html, e.g: <script src="node_modules/es6-shim/es6-shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.js"></script> <script src="node_modules/reflect-metadata/reflect.js"></script> <script src="node_modules/systemjs/dist/system.src.js"></script> however, can't figure out how can bundle angular 2 itself, or @ least modules required angular 2, aren't referenced in html. how can done? using systemjs-builder can bundle angular 2 app code , bundle other libraries separately. i bundled library reference directly in html vendors.min.js, , library referenced through system.config.js plus app code app.min.js. in example can see dependencies in tour of heroes loaded page in <10 network requests ( source code ).

Android Studio gradle keeps on repeating already fixed error when building -

i'm frustrated now. created string resource in values.xml file <string name="details">the yadayadayada going great suspension , when comes, it's good. after long time</string> and after running app, had error error:(348) apostrophe not preceded \ (in yadada going great suspension , when comes, it's good. after long time) so preceded apostrophe '\' error still showing. i've deleted string resource when ever gradle builds, recreates resource again , gives me same error again. i've tried "invalidate cache/restart", i've tried deleting .gradle folder, used command gradlew --stop clean build but error still showing. don't know now. in advance i think modifying in generated file(has same name) instead of own res file. when click error opens generated file not right file.so go res folder , change same.

Boolean Formula Satisfiability - Solving with Minimum Amount of Variables Set to True -

i having trouble coming pseudocode solve boolean satisfiability problem using minimum amount of variables set true. i have method satisfiable number(h) can call obtain minimum number of variables needed set true in order boolean formula satisfiable. find-sat-min(f) { if (not sat(f)) return 0 l = {x | x variable in f}; s = {}; int truecount = 0; (x in l) { if (sat(f ^ x) && truecount < satisfiable number(f)) { s = s u {x}; f = f ^ x; truecount++; } else { s = s u {not x}; f = f ^ not x; } } return s; } here's current logic. please let me know if i'm on right track.

Access own Azure internal load balancer from backend server pool -

i have set internal load balancer (lb1) 1 server (srv1) vm in backend pool. when try access loadbalancer lb1 server (srv1), timeout. have second load balancer setup in same subnet (lb2 , srv2). traffic on port 443. inbound , outbound rules allow traffic on ports to/from subnet. srv1 can access lb2 not lb1 srv2 can access lb1 not lb2 is design, or have missed configuration option? is design, or have missed configuration option? this design behavior. load balancer used redistributing request vms in backend pool. vm in pool can not access load balancer in same pool.

sql server - Get Other Column to Include on Pivot Calculation SQL -

i have following table: -------------------------------------------------------------- inspectyear part cpoint pos1 pos2 pos3 pos4 -------------------------------------------------------------- 2009 001 0.2 8 8 9 7 2009 002 0.2 9 7 8 6 2011 001 0.3 9 9 8 7 2011 002 0.7 7 8 6 8 2013 001 0.2 8 9 7 9 2013 002 0.4 7 7 8 8 2015 001 0.2 8 8 7 4 2015 002 0.8 7 6 9 8 then have following query: declare @inspectyear nvarchar(max), @calc nvarchar(max), @query nvarchar(max); set @inspectyear = stuff((select distinct ',' + quotename(inspectyear) ##t2 c xml path(''), type).value('.','nvarchar(max)'),1,1,&#

c++ - Remesh a 2D plane with additional vertices and constraints -

i have created 2d mesh using cgal::refine_delaunay_mesh_2(cdt, criteria(0.125 , 0.05)); . want insert circle in created mesh. want achieve deleting vertices , faces lay inside circle , create set of vertices in vacuum created in mesh. remesh newly created region. want know possible achieve that? if possible, how should this? picture illustrates want achieve.

go - Converting integer in reverse order to gererate IP in reverse order -

i wanted generate ip in reverse order. functionality generate ip address follow: val := 1<<(32-prefixlen) // let take prefixlen 24 ip4(val) = ip4(256) = 0.0.1.0 i wanted ip in reverse order i.e., 0.1.0.0 , convert val in reverse order bytes , send ip4() function. functionality have tried resulted in integer overflow: temp1:=byte(val*0xff<<24) temp2:=byte(val*0xff00<<16) temp3:=byte(val*0xff0000<<8) temp4:=byte(val*0xff000000) valreverse := uint32(temp4)|uint32(temp3)|uint32(temp2)|uint32(temp1) ip4(valreverse)=0.1.0.0 //expected reversing bytes first, have use uint32 type instead of byte byte value has 8 bits (bit positions above 8 don't exist). next, have use bitwise , & , not multiplication * . third, shift values incorrect. see working example: prefixlen := uint32(24) var val uint32 val = 1 << (32 - prefixlen) fmt.printf("%08x\n", val) temp1 := uint32(val & 0xff << 24) temp2 :=

python 3.x - How to set sessions timeout in django? -

i want implement login , logout session in website through after set of time session should expire automatically. , if user logged in user not go back. in settings.py set https://docs.djangoproject.com/en/1.10/ref/settings/#std:setting-session_cookie_age . for example if want time out 1 hour session_cookie_age = 3600 # on hour in seconds

html - Aligning views div to right -

i want align views div right side of question-card block , left of `ago div. layout demo .question-card{ margin-left: 20px; background: rgb(255, 255, 255); -moz-box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); -webkit-box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); transition: 0.3s; width: 60%; } .circled-dp{ width: 40px; height: 40px; cursor: pointer; border: 50%; } .profile{ padding: 5px; display: flex; } .ago{ margin-left: auto; } .views{ float: right!important; } <!doctype html> <html> <head> <link rel="stylesheet" href="post.css"> <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css"> <title>post</title> </head> <body> <div class="question-card"> <img class="img" src="https://s3-us-west-1.amazonaws.com/powr/defaults/image-s

javascript - Can I pass parameters in computed properties in Vue.Js -

is possible pass parameter in computed properties in vue.js. can see when having getters/setter using computed, can take parameter , assign variable. here documentation : // ... computed: { fullname: { // getter get: function () { return this.firstname + ' ' + this.lastname }, // setter set: function (newvalue) { var names = newvalue.split(' ') this.firstname = names[0] this.lastname = names[names.length - 1] } } } // ... is possible: // ... computed: { fullname: function (salut) { return salut + ' ' + this.firstname + ' ' + this.lastname } } // ... where computed property takes argument , returns desired output. when try this, getting error: vue.common.js:2250 uncaught typeerror: fullname not function(…) should using methods such cases? you should use methods: <span>{{ fullname('hi') }}</span> methods: { fullname: function (salut) {

How to compute the disk space usage of a row in a mysql innodb table -

i have application inserts many rows in specific innodb table , don't know how compute disk space needed in future. so given mysql innodb table structure, how can compute disk space cost of row? tinyint consumes 1 byte, int: 4 bytes, bigint: 8 bytes, text/blob/varchar/varbinary: 2+ average number of bytes , datetime , timestamp: 5 bytes, char takes full length, etc. add up, based on columns in table. multiple 3 (for overhead, indexes, btree structure, wasted space, etc, etc). give crude estimate of disk space innodb row. caveats: the result high or low, simple first guess. a table take minimum of 16kb. an excessive number of secondary indexes lead more space consumed. lots of texts/blobs can lead off-record storage exceed forumla. at point during growth of table, allocation unit switches 16kb 8mb, thereby leading disturbing jumps in size. row_format makes difference. (but compressed unlikely shrink table more 2x.) look ways shrink uuids, ip addresse

angularjs - Video in preview mode from backend response -

i have done video in view mode source available file extesnsion using igniteui-directives . samething if trying response server getting video format not supported. need assistance or anyother method view response video in preview or play mode. code : <script src="http://igniteui.com/js/modernizr.min.js"></script> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script> <script src="http://igniteui.com/js/angular.min.js"></script> <script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.core.js"></script> <script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.lob.js"></script> <script src="http://cdn-na.infragistics.com/igniteui/latest/js/extensions/igniteui-angular.js"></script> <link href="h

c - multiple session handling asp.net -

i new web developing , did research still cant find looking for i on project involves 2 thing cloud web service app , cloud virtual machine(server). (azure) the virtual machine jobs app request . users logins web page , request service server (which made). but how manage multiple users simultaneously doing , how manage if user closes browser , logins continue left. i use asp.net on cloud service , c on server

android - Prevent multiple instances in webview activity -

i have webview activity, in it's url updated notification service. when notification clicked new activity created everytime load changed url. can prevented adding android:launchmode="singletask" in manifiest. if new activity created every time when notification clicked leads me change content perfectly. want avoid creating new activity(or maybe view created idk?) every time notification clicked. if add android:launchmode="singletask" in manifest, gives me side-effect, i.e if notification arrived on existing opened webview activity not redirect changed url. pending notification intent: notificationmanager mnotificationmanager = (notificationmanager) getsystemservice(context.notification_service); if (ismessage) { intent intent = new intent(this, miscdisplay.class); intent.putextra("start_url", url); intent.setaction("notification_url_action"); pendingintent resultpendingintent = pendingintent.g

asp.net core - When is xproj/project.json going away? -

i've been reading project.json going away since may, telling done/removed in preview2 tooling somewhere. then @ later posts project.json not right away go away, xproj preview2 converted csproj. however i'm using latest tooling, latest .net core , it's still there :) both project.json , xproj. when , current plans know? as written on asp.net core roadmap q4 2016 / q1 2017 this first minor update, focused on replacing .xproj/project.json .csproj/msbuild. project format update should automatic. opening 1.0 project update new project format. there new functionality , improvements in runtime , libraries. as context, .net core 1.0 included preview version of .net core tools, referred “preview 2”. tools “preview” because knew change tools experience post 1.0. .net core , .net core tools both “rtm quality” or “stable” release.

identityserver3 - AuthenticateResult: Why are some claims missing? -

i'm trying out self-hosted identityserver3 solution , have come across issue haven't found answer to. this identityserver setup: var factory = new identityserverservicefactory(); factory.useinmemoryclients(config.getclients()) .useinmemoryscopes(config.getscopes()); factory.userservice = new registration<iuserservice>(resolver => new localregistrationuserservice()); var options = new identityserveroptions { sitename = "demo idp", signingcertificate = certificate.get(), factory = factory, requiressl = convert.toboolean(configurationmanager.appsettings["requiressl"]), }; app.useidentityserver(options); scope(s) , client(s): public static ienumerable<client> getclients() { return new list<client> { new client { clientid = "resourceowner.client", clientsecrets = { ne

spring integration - How to insert multiple rows updating-outbound-gateway? -

i using <updating-outbound-gateway> insert record using nativequery. how can pass list multiple records can inserted in db? <int-jpa:updating-outbound-gateway native-query="insert partner_response_details(partner_id,bank_reference_number,request_string,response_string,response_date) values (:partnerid,:bankreferencenumber,:requeststring,:responsestring,:responsedate)" entity-manager="entitymanager"> <int-jpa:transactional /> <int-jpa:parameter name="partnerid" expression="payload['partnerid']" /> <int-jpa:parameter name="bankreferencenumber" expression="payload['bankreferencenumber']" /> <int-jpa:parameter name="requeststring" expression="payload['requeststring']" /> <int-jpa:parameter name="responsestring" expression="payload['responsestring']" /> <int-jpa:parameter name="

ITK installation error using Cmake -

Image
i trying install/configure itk using cmake, unable there errors unable resolve. 1 please help? why location set c:/program files (x86)/itk? please help! i solve it. visual studio compiler 2015 is: visual studio 14 2015

axapta - Using the super method -

i want program method super() in dynamics ax2012. i have build class ("a") , methods in it. build class("b") whhich extends class before. class "a" has methods. in class "b" want override method. so. override method gettable(). protected syccarbrandtable gettable() { syccarbrandtable ret; ret = super(); { select brandid,branddescription ret ret.brandid == "bentley"; } return ret; } now question is... i have understood super() new method did take it, method extended in motherclass "a". but how can add more things method, gives me things method before , things have added in overriden method ? looking @ implementation of gettable(), looks may want select syccarbrandtable record using values of syccarbrandtable returned super() criteria + other newly added criteria. i not sure why such thing, if perform select statement upon same table variable, overriding behavior,

java - Padding between characters in a string -

Image
i have java application draw string. now adjust white space before , after each character fit grid (each char in own square). how can accomplish that? thank answers. public class fonttesting extends applet { private final int gridsize=20; public void paint(graphics g) { graphics2d g2d = (graphics2d)g; paintbackground(g2d); string text1 = "atzlipjnmr . . a|"; string text2 = "hhhhhhhhhh . . i|"; string text3 = "wwwwwwwwww , , 9|"; string text4 = "atatatatat |"; font font = new font("monospaced", font.plain, 20); g2d.setcolor(color.black); g2d.setfont(font); g2d.setrenderinghint(renderinghints.key_text_antialiasing, renderinghints.value_text_antialias_on); g2d.drawstring(text1, 20, 36); g2d.setrenderinghint(renderinghints.key_text_antialiasing, renderinghints.value_text_antialias_on); g2d.drawstring(text2.touppercase(), 20, 56);

c# - Custom android toolbar back button not showing -

i want show custom toolbar, , show home(hamburger) icon , arrow icon, when navigate other fragments. home button shown, arrow not. my app using mvvmcross, , have main host activity, manages fragments: [activity()] public class mainview : mvxcachingfragmentcompatactivity<mainviewmodel> { private drawerlayout _drawer; private mvxactionbardrawertoggle _drawertoggle; protected override void oncreate(bundle bundle) { base.oncreate(bundle); setcontentview(resource.layout.mainview); var _toolbar = findviewbyid<android.support.v7.widget.toolbar>(resource.id.toolbar); _toolbar.setnavigationicon(resource.drawable.back_arrow); setsupportactionbar(_toolbar); supportactionbar.setdisplayhomeasupenabled(true); supportactionbar.setdisplayshowhomeenabled(true); supportactionbar.setdisplayshowtitleenabled(false); _drawer = findviewbyid<drawerlayout>(resource.id.drawer_layout);

java - Can not get text from PasswordField even converted to String -

i cant not input jpasswordfield. i'm getting because shown in joptionpane output(just practice purposes). eclipse not give me errors program not work correctly okay here's flow of program. if jpasswordfield equal "admin". dialog box appear , display password (which "admin"). that's it. i converted jpasswordfield string. still. there's no string displayed. there's no error displayed in eclipse also. codes: public class gui2 extends jframe { private jbutton shut; private jpasswordfield field; public gui2(){ super("display password"); setlayout(new flowlayout()); field = new jpasswordfield(10); add(field); display = new jbutton("display"); add(display); thehandler handler = new thehandler(); display.addactionlistener(handler); } class thehandler implements actionlistener{ string password = new string(field.getpassword()); public void actionperformed(actionevent e

pdf - How to resize image in itext in java -

this source code. document document = new document(); string txtvehno = ""; string fdate = "", tdate = "", remtype = "0"; string filename = "reminders_" + utility.sysdate("yyyy_mm_dd") + ".pdf"; string asdate = utility.sysdate("dd/mm/yyyy"); arraylist<reminderpdf> reminderpdfs = null; userdetails userdetails = null; string txtmarno = ""; string formatteddate = ""; string address = ""; blob imageblob = null; byte[] imagebytes = new byte[0]; try { txtvehno = request.getparameter("txtvehno2"); fdate = request.getparameter("txtdate3"); tdate = request.getparameter("txtdate4"); remtype = request.getparameter("remtype"); txtmarno = request.getparameter("txtmarno"); if (txtvehno != null && txtvehno != "")

php - How to call Swift mailer in yii2 with console controller? -

yii::$app ->mailer ->compose( ['html' => 'remainder-html', 'text' => 'remainder-text'], ['user' => $user,'interview'=>$interview] ) ->setfrom([yii::$app->params['supportemail'] => yii::$app->name . ' robot']) ->setto($user->email) ->setsubject('contact request ' . $model->name) ->send(); above code have used in console/controller advanced app in yii2. rest of things working mail not working. same code work when placed in backend/frontend controller. following error. php user error 'yii\base\errorexception' message 'call undefined method compose' yii2 applications use different configuration file console , web. all need configure 'mailer' component in console configuration file. if using basic application template, 'config/

http - (Swift) How to check if content-encoding is gzip -

Image
is there way in swift find out if data request returns in gzip? i want write test method check if content-encoding returns gzip file: you can info header fields in httpurlresponse : urlsession.shared.datatask(with: url) { (data, response, error) in if let response = response as? httpurlresponse { if let encoding = response.allheaderfields["content-encoding"] as? string { print(encoding) print(encoding == "gzip") } } }.resume() note downloads headers and data. if want headers without downloading data, better solution use urlrequest set "head" this: var request = urlrequest(url: url) request.httpmethod = "head" urlsession.shared.datatask(with: request) { (_, response, _) in if let response = response as? httpurlresponse { if let enc = response.allheaderfields["content-encoding"] as? string { print(enc) print(enc == "gzip&qu

python - Is there a `ufunc` that just forwards the data? -

is there ufunc forwards data? it's not difficult achieve same effect in cases, when explicitly working ufuncs, convenient have 1 forwards data. testing/debugging , have consistently looking code. for example, when have function takes ufunc argument: op = ufunc x = do_with_op(data0, data1, op) if data real, np.conj(x) , complex conjugate, identity unary ufunc. you can create own ufuncs np.frompyfunc : forward_unary = np.frompyfunc(lambda x: x, 1, 1) forward_first = np.frompyfunc(lambda x, y: x, 2, 1) forward_second = np.frompyfunc(lambda x, y: y, 2, 1)

php - Is This a Bug in MySQL? -

i using mysql , php (laravel) , facing strange situation . i trying encrypted user type , user id , decrypt . , find records user id . my code . using laravel framework . $key = config::get('app.key'); $decodeduseridwithtype = base64_decode($encrypteduseridwithtype); $decrypteduseridwithtype = mcrypt_decrypt(xxxxx , $key, $decodeduseridwithtype, xxxxxx); $useridwithtype = $decrypteduseridwithtype; i expecting decoded value id@100 so explode @ , find user id , here 100 . for testing have changed encrypted value manually adding 1 or 2 characters . when decrypt got id@100������������������������]u甀�+&�fj�w�zЪs��d��]3�]" and after explode id 100���]u甀�+&�fj�w�zЪs��d��]3�]" now select raws same id using . select * table id=$id it select recordes id = 100 actual id is 100���]u甀�+&�fj�w�zЪs��d��]3�]" so weird . type of id column int may why matched . but point of view bad , because whole logic

javafx - Allow multiple selection for parent nodes but not for leafs in TreeTableView -

i want user able select multiple parent nodes, single leaf nodes. if user selects leaf node, other selected nodes should should deselected. , if user selects parent node, selection should cleared if leaf node selected. a general rule selection should cleared if old selected node or new selected node leaf . idea. i'm guessing possible somehow, how? i've tried adding listener selected item, , clear selection if old selected item or new selected item leaf. since have select new selected item again after clearing selection, gives me endless loop listener notified on , on again. same happens if add listchangelistener getselectionmodel().getselectedindices() , check if list contains leaf nodes.

java - Reduce Vertical gap between composite in FillLayout -

Image
i have created composite 2 composites b , c. filllayout. b , c composites of gridlayout. see huge gap between b , c inside a. how can reduce it? the gap between wait typing , image format should reduce. that filllayout does, fills given area spacing out controls fit evenly. doesn't have parameters control this. if want more control use different layout such gridlayout .

php - Fastest way to get the next element in a string from a needle -

i'll start off code: $characterset = 'abcdefg'; $character = 'a'; say have 2 variables, characterset , character , , want next character , did: $characterset = 'abcdefg'; $character = 'a'; $ncharacter = $characterset[ strpos($characterset, $character) + 1 ]; and worked, i'm using method has thousands of times per / second , , using xdebug + webgrind result many, many calls strpos , making function go lot slower should going, realise doing math in language faster doing function calls math, , have tried using: $character = 'a'; $ncharacter = chr( ord($character) + 1 ); and work, gives me many characters , if wanted make sure didn't +1 character : or etc, it'd bunch of conditional arguments, making slower, looking cheap way character -> nextcharacter (determined characterset) doesn't use lot of resources, benchmarks webgrind preferred. thanks :-) use this: # character set we're

Is _diffs folder removed automatically when deploying Liferay theme? -

i investigating problems in deployed liferay theme, not able find _diffs folder there, 1-is removed when deploying or deployment manager did wrong or it's developers's decision ? 2-is there consequences absence @ run time if code inside copied folders under web-inf ? the _diffs folder no longer needed after build process.

c# - Authenticator. Class design -

have base class authenticatorbase has ability log in users different authentication subjects - login & password , token. class looks this: public abstract class authenticatorbase { public abstract loginresult login(object authsubject); public abstract void logout(string sessionkey); } the sub-class authenticates login & password public class basicauthenticator : authenticatorbase { public override loginresult authenticate(object authsubject) { logindata credentials = authsubject logindata; if (dbcontext.security.authorize(credentials)) ............... } } the sub-class authenticates token public class tokenbasedauthenticator: authenticatorbase { public override loginresult authenticate(object authsubject) { string token = authsubject string; user user; if (dbcontext.security.loginwithtoken(token, out user)) ........... } } what don't in code parameter authsubjec

android - Detecting incoming call -

this question has answer here: how detect incoming calls, in android device? 5 answers here, i'm creating application start flash when sms recieved , incoming call recieved. flash working on recieving sms not on call, why? can help? i'm stuck on since many days. in advance, code given below. flash performs on recieving sms not on recieving calls. expecting guidence. when searched regarding getting classes , methods create own app. requesting explanation public class smsreceiver extends broadcastreceiver { boolean call; private camera camera; int count; long delaytime; editor editor; string flashtype; private boolean hasflash; private boolean isflashon; private boolean isflashblinking; private boolean mactive; private handler mhander; private final runnable mrunn

swift - Realm; making an optional attribute required in future migration -

i have realm model has optional nsdate property expirydate , stores date object no longer usable after. this property needs changed such expirydate required. because there multiple versions of our app out there, want avoid having function in our data layer checks see if expirydate property on each 1 of objects set, , if not, sets default value. i plan on updating our schema replace dynamic var expirydate: nsdate? with dynamic var expirydate: nsdate = nsdate().datebyaddingseconds(somemaxexpirydateinseconds) will change mean stored objects expirydate not set, set nsdate().datebyaddingseconds(somemaxexpirydateinseconds) , saved accordingly realm? or property recalculated every time accessed? it's possible change value types during realm migration, including between making given property optional or non-optional. during migration, have go through , assign value each expirydate object nil . realm.configuration.defaultconfiguration = realm.configuration(

c# - String.Split for new lines working with string[] but not with char[] -

check code: string t = @"\nazerty \n\nazerty \n\nazerty \nazerty"; string[] firstmethod = t.split(new char[]{'\n'}, stringsplitoptions.removeemptyentries); string[] secondmethod = t.split(new string[]{@"\n"}, stringsplitoptions.removeemptyentries); why first method not work , second ??? thx this isn't working because using verbatim strings, i.e.: string t = @"\nazerty \n\nazerty \n\nazerty \nazerty"; ... equivalent to: string t = "\\nazerty \\n\\nazerty \\n\\nazerty \\nazerty"; it's wanted following, uses newline characters instead of literal backslash-n: string t = "\nazerty \n\nazerty \n\nazerty \nazerty"; this "successfully" split on either new[] { "\n" } or new[] { '\n' } (but not new[] { @"\n" } expects backslash-backslash-n).

android - Strange: Intent not working after Shared Preferences Code -

i have strange problem. intent not working after shared preferences code . if write same intent before shared preferences code , working. below code... check fetchdata() method... login_activity public class login_activity extends appcompatactivity implements view.onclicklistener { // widgets private spinner spnr_login_type; private edittext edt_login_id, edt_pwd; private button btn_login, btn_regi; private progressdialog progressdialog; // variables private string url = "login.php"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_login); // checking user login or not if (preferences.getpreferences(getapplicationcontext()).contains(preferences.key_user_name)) { intent myintent = new intent(login_activity.this, home_activity.class); startactivity(myintent); finish();

angular - @Inject(FIREBASE) firebase:any NO Provider for token Firebase -

developing angular2seedadvanced app firebase backend produce error no token firebase while using @inject(firebase) firebase:any inside constructor. service.ts import { firebase } '../../myapp/index'; @injectable() export class loginservice { constructor(@inject(firebase) firebase:any) {} }

ios - Swift: 'request for rect at invalid index path -

*** terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'request rect @ invalid index path (<nsindexpath: 0xc000000000800016> {length = 2, path = 0 - 4})' what can issue. im using table.estimatedrowheight , automatically adjust row height functions dynamic height of cells adjust label. issue here?

vb.net - ListView : Fetch data from selected item -

i have created listview , populated using datatable.. worked fine... added checkbox items.. want when last column's value of item "true" checkbox of same item checked. i tried following code... if lstviewhelp.items.count <> 0 each item listviewitem in lstviewhelp.items if lstviewhelp.focuseditem.subitems(10).text = "true" lstviewhelp.focuseditem.checked = true end if next end if i getting following error object reference not set instance. tried many links no proper solution found...! you can selected index listview.selectedindexcollection using selectedindices . add foreach loop on selected indexes , edit subitem. dim indexes listview.selectedindexcollection = me.listviewhelp.selectedindices each index in indexes if me.listviewhelp.items(index).subitems(10).text = "true" lstviewhelp.items(index).checked = true end if next and if want check items can use for loop

coq - How to prove binary commutavity with a different definition of bin? -

// collacoq link: https://x80.org/collacoq/qezicaroni.coq inductive bin : type := | 0 : bin | 1 : bin | zerop : bin -> bin | onep : bin -> bin. inductive bin_carry : type := | zeroc : bin_carry | onec : bin_carry. (*returns carry, new_state*) fixpoint incr' (x : bin) : bin_carry * bin := match x | 0 => (zeroc, one) | 1 => (onec, zero) | zerop x => match incr' x | (onec, x') => (zeroc, onep x') | (zeroc, x') => (zeroc, zerop x') end | onep x => match incr' x | (onec, x') => (onec, zerop x') | (zeroc, x') => (zeroc, onep x') end end. definition incr (x : bin): bin := match incr' x | (zeroc,x) => x | (onec,x) => onep x end. (*index_multiplier * result*) fixpoint bin_to_nat' (x : bin): nat * nat := match x | 0 => (2,0) | 1 => (2,1) | zerop x => match bin_to_nat' x | (multiplier,result) => (multiplier * 2,result