Posts

css - how to create a gradient effect on half of an image -

i trying create gradient effect on half of image, found gives full gradient overlay effect on image .tinted-image { background: /* top, transparent red */ rgba(255, 0, 0, 0.25), /* bottom, image */ url(image.jpg); } but wondering how can apply effect half of image,i searched online didnt see ws looking for, decided post. by half of image mean vertically not horizontally us there has idea of this multiple backgrounds , suitable color stop in gradient. .tinted-image { width: 460px; height: 300px; border: 1px solid grey; background-image: linear-gradient(to bottom, rgba(0, 255, 0, 0.5), rgba(0, 255, 0, 0) 50%, transparent 50%), url(http://www.fillmurray.com/460/300); margin: auto; } <div class="tinted-image"></div>

python - How can i make cloud of words occuring together? -

edit "please focus answer example below, no broad scenarios" ok. have read word cloud. wondering how can represent words occuring in string variable in example below?: var_x wireless problems, migration competitor dissatisfied customers, technicians visits scheduled call waiting, technicians visits bad customer experience, wireless problems so want is: ("wireless problems" , "technicians visits") representation in cloud. how can done? this code produces frequency distribution of adjacent words can used underlying word cloud data: from nltk import bigrams, freqdist nltk.tokenize import regexptokenizer operator import itemgetter sent = 'wireless problems, migration competitor\n\ dissatisfied customers, technicians visits scheduled\n\ call waiting, technicians visits\n\ bad customer experience, wireless problems' tokenizer = regexptokenizer(r'\w+') sent_words = tokenizer.tokenize(sent) freq_dist = freqdist(bigrams(sent_w...

excel - Formula is not working because of '#N/A' -

i writing simple formula =if(g295="#n/a","na","somethingelse") but it's not printing 'na' when give value "#n/a" if use above formula =if(g295="r","na","somethingelse") then it's working. can me how reconize value "#n/a"? need write formular if value (#n/a) presents, have other operation, there way this? the isna function identify #n/a =if(isna(g295),"na","somethingelse") unlike iserror , catches #n/a

Split a CSV field into different rows in SQL -

a colleague of mines encountered problem while working on cobol program , solved @ application level. still curious if possible solve on data access level, sql. somehow related this other question , i'd use ansi sql. i'm looking single sql select query acts on varchar field contains variable length csv rows. purpose of query split every csv field in own result set row. here example schema , data (and here fiddle ): create table table1 (`field` varchar(100)); insert table1 (`field`) values ('hello,world,!') , ('haloa,!') , ('have,a,nice,day,!'); here output i'd have query: hello world ! haloa ! have nice day ! the csv separator used comma, , wouldn't worry escaping. as far can tell, ansi sql: with recursive word_list (field, word, rest, field_id, level) ( select field, substring(field 1 position(',' in field) - 1) word, s...

java - Android Wear Background Image is not drawn -

i copied of code google sample watchface digital watchface, , works fine far. when want add background image, see grey background instead of image store under drawable (bg.png). doing wrong? ***update**** ok apparantly grey apparantly background image, somehow resolution off. background image 320x320 (the dog image google sample). can observe same behaviour preview images ... made screenshot my watchface, instead of proper preview can see background color. public class wearwatchfaceservice extends canvaswatchfaceservice { private static final string tag = "digitalwatchfaceservice"; private static final typeface bold_typeface = typeface.create(typeface.sans_serif, typeface.bold); private static final typeface normal_typeface = typeface.create(typeface.sans_serif, typeface.normal); /** * update rate in milliseconds normal (not ambient , not mute) mode. update twice * second blink colons. */ private static final long normal_update_rate_ms = 500; /**...

Partition key only in Cassandra -

in cassandra, understand default, given primary key(id1, id2), id1 partition key , id2 clustering key. i want know if can define 2 partition keys without clustering key follows: primary key ((id1, id2)); your understanding correct. your primary key ((id1, id2)) correct , specifying one partition key consisting of two columns. in second case, can query data specifying both columns values. eg: select * mytable id1=1 , id2=3; and queries like: select * mytable id1=1; will fail because id2 is part of primary key.

javascript - React-Native: LocalStorage deleted when app reloaded when using domStorageEnabled -

i have @ moment small log in system stores asyncstorage session token , refresh token. after logged in sent page dashboard i'm getting asyncstorage session , refresh token , passing them link in webview. way how webview works me passing domstorageenabled={true} deleting storage when app closed user needs again log in. know way how manage problem? render() { if (this.state.access_token = null) { return ( <splashscreen visible={true}/> ); } else { let source = {uri: `myurl/auth/login?access_token=${this.state.access_token}&refresh_token=${this.state.refresh_token}`}; return ( <webview source={source} domstorageenabled={true} /> ); } }