Posts

Android Drawble XHDPI only - avoid lint warning -

in project have drawables used in case of tablets. if put images on xhdpi, lint complains image should in other dimensions too. ignoring lint best approach in situation? you can place image in drawable-nodpi or in drawable folder. not exist default need create folders in resources

javascript - How do I force lowercase on an input field? -

i have input field client wants lowercase only. output generates input lowercase. this have , isn't working. <script> function tolowercase(email) { strinput.value=strinput.value.tolowercase(); } </script> use oninput : var input = document.getelementsbytagname("input")[0] // input element input.oninput = function() { input.value = input.value.tolowercase() } <input type="text" />

mysql - How can I combine two queries with a having clause into one? -

i hope can me these 2 queries query: select count(distinct id), sum(amount) sales year(saledate) = '2015' , saletype ='cash' group customer having sum(amount) >=500; select count(distinct id), sum(amount) sales year(saledate) = '2015' , saletype ='creditcard' group customer having sum(amount) >=1000; what best way combine them one? aim select cases customer paid more 500 in cash or more 1000 via creditcard. thanks lot help. in case can use example: select count(distinct id), sum(amount) sales year(saledate) = '2015' , saletype ='cash' group customer having sum(amount) >=500; union select count(distinct id), sum(amount) sales year(saledate) = '2015' , saletype ='creditcard' group customer having sum(amount) >=1000; or union if want records without distinct . select count(distinct id), sum(amount) sales year(saledat...

multithreading - What's the cost/overhead of thread context switch? -

what's cost/overhead of thread context switch? far know, there direct costs: saving , restoring context(generally,it includes general purpose registers , program counter) costs of thread scheduling(deciding thread next run) and there maybe indirect costs, such as: if thread switched out arranged run in cpu later, might re-load variables main memory(or other cpu via coherence protocol), cache read miss might occur. is there other indirect costs?

PostgreSQL - text Array contains value similar to -

i'm trying rows column of type text[] contains value similar user input. what i've thought , done far use 'any' , 'like ' operator this: select * sometable '%someinput%' any(somecolum); but doesn't work. query returns same values query: select * sometable 'someinput' = any(somecolum); i've got result using unnest() function in subquery need query in clause if possible. why doesn't like operator work any operator , don't errors? thought 1 reason should any operator in right-hand of query, ... is there solution without using unnest() , if possible in where clause? it's important understand any not operator sql construct can used right of operator. more: how use instead of in in clause rails? the like operator - or more precisely: expression , rewritten ~~ operator in postgres internally - expects value left , pattern right. there no commutator operator (like there simple equali...

NULL values in ACCESS reports? -

i created simple report has 5 columns (companyname, bought, sold, returned, total) looks like. companyname bought sold returned total with exception of company name, every value number. created simple queries bought, sold , returned. total used arithmetic in main query (basically sum of bought, sold, returned (returned negative)). problem came across companies, of columns (bought,sold,returned) null since ex: don't have returned when run report, doesn't show me value total. unless have values in three(bought sold , returned) - nothing gets displayed in total. don't want display zeros in report because clustered, there way me convert null 0 when calculation , hide report?

java - Is Unitils project alive? -

anybody knows whether unitils project still alive. on there pages last version 3.3 in maven repository 3.4.2.(actually there google cached version of pages version said 3.4.2) anyway there replacement project. kind of lack vivid community around , don't want bound dying project. unitils seems abandoned nowadays. project available on github here , can @ history , activity. anyways 2 cents... unitils has serious drawbacks: integrates many third-party libs (easymock, dbunit, spring, dbmaintainer, xmlunit, slf4j etc) , forces versions - serious drawback due being dependent on many 3rd party libraries, impossible keep date without company behind. unitils 4.0 developed since 06.2011 , planned release @ 01.2012, (01.2016) after 4 years still not released. dbunit for database-driven apps may seem interesting way go plain dbunit + spring-test or alternatively 3rd party tools: excilys/spring-dbunit comes handy @dataset annotation , actively developed on ...