Posts

Android Studio: ExternalSystemException -

Image
when opening project (android application) in android studio, shows externalsystemexception. (i cloned android application system github repo). event log: externalsystemexception: unable save '/home/prasang/privly/privly-android/local.properties'/home/rest path of app/-android/local.properties (permission denied) i'm not sure if using mac or windows machine fix work mac. i encountered same error after cloning copy of android transition tutorial github here on mac os sierra: https://github.com/lgvalle/material-animations to correct error, have go mac , find folder had clone code. need "get info". now, change permission @ bottom system, staff , can "read , write" folder. try opening repo in android studio again , find error has disappeared.

iphone - Fixed transparent header in a UITableView -

Image
i trying add fixed transparent header in uitableview similar 1 on attached image (lhr-syd / 372 results). "built in" component in xcode/ios or how done ? use these methods , - (uiview *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger)section; above method setting view. - (nsstring *)tableview:(uitableview *)tableview titleforheaderinsection:(nsinteger)section; above method setting title . see 1 , - (uiview *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger)section { uilabel *lbl = [[[uilabel alloc] init] autorelease]; lbl.textalignment = uitextalignmentleft; lbl.text=@"lhr-syd / 372 results"; return lbl; } by using above method can add different objects headerview. (or) - (nsstring *)tableview:(uitableview *)tableview titleforheaderinsection:(nsinteger)section{ return @"lhr-syd / 372 results"; } this 1 requirement think so. - (cgfloat)tableview:(uitableview *...

java - How to write a code that will execute after each step is executed -

the application working throws lot of unexpected alerts . wanted implement way catch these through common method isalert present . but how call isalertpresnt each step in webdrriver , can me here ? typically method :- public void checkalert() { try { webdriverwait wait = new webdriverwait(driver, 2); wait.until(expectedconditions.alertispresent()); alert alert = driver.switchto().alert(); alert.accept(); } catch (exception e) { //exception handling } } the issue how call before every step ? know make code slow badly want implemented . i looking executes after each command\step in test .is possible ? currently calling method in expected scenarios try catch. webdriver has webdrivereventlistener listener trying exactly. implementing listener , registering driver - can checkalert method called behind scenes before/after every action perform using webdriver. take @ example. http://toolsqa.com/selenium-webdriv...

xml - Show Edit Text in Text View, & adjust height according to Content written in Edit text (Android) -

Image
when send message or joke of 1 line or 1 word, why space left @ bottom. take text view wrap_content . i need text wrapped height. needed shown in picture below. text view <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:text="" android:ems="10" android:gravity="top|left" android:hint="enter message" android:inputtype="textmultiline|textpostaladdress" android:minheight="200dip" android:padding="5dip" android:scrollbars="vertical" android:layout_margintop="-5dp" android:layout_marginbottom="-5dp" android:textcolor="@color/blue" android:maxlines="1000000" android:id="@+id/messagedetail" android:layout_alignparentleft="true" android:...

node.js - Visual studio code nodejs debug failure - request 'launch': cannot launch -

on windows 10 nodejs , visualstudio code installed, can't debug vs code sample code microsoft- https://code.visualstudio.com/docs/runtimes/nodejs the error " request 'launch': cannot launch target(reason:spawn node enoent) ", looks configuration issue, , checked nodejs did install under c:\program files\nodejs. i saw 1 same question on stackoverflow - visual studio code nodejs request 'launch': cannot launch target (reason: spawn node enoent) , there's no answer, have suggestion on this? in advance! i pretty sure because node has not been added path. say, can't type "node" anyway in command line , have correctly open node installation. double check node correctly added path first, try again.

javascript - Typescript hasOwnProperty equivalent -

in javascript if want loop through dictionary , set properties of dictionary, i'd use this: for (let key in dict) { if (obj.hasownproperty(key)) { obj[key] = dict[key]; } } if obj typescript object (instance of class), there way perform same operation? if obj typescript object (instance of class), there way perform same operation? your javascript valid typescript ( more ). can use same code is. here example: class foo{ foo = 123 } const dict = new foo(); const obj = {} foo; (let key in dict) { if (obj.hasownproperty(key)) { obj[key] = dict[key]; } } note: recommend object.keys(obj).foreach(k=> javascript not question asking here.

multithreading - Are java variables themselves thread safe? When updating variables? -

this question has answer here: thread-safe setting of variable (java)? 5 answers suppose have 2 threads updating object, , 1 thread reading object no synchronization. obviously, run condition. however, wondering if variable can partially written. public class commonobject extends object { static int membervar=-1; } public class input1thread extends thread { public void run() { while(true) commonobject.membervar = 1 } } public class input2thread extends thread { public void run() { while(true) commonobject.membervar = 2; } } public class outputthread extends thread { public void run() { while(true) system.out.println("commonobject.membervar"+ commonobject.membervar); } } i assume value printed out either 2 or 1. however, wondering ...