Posts

html - How to keep scroll-bar hidden and show it when max-height is over? -

i have structure this: pre { word-warp: normal; display: block; padding: 5px 8px; width: auto; background-color: #eee; margin-bottom: 1em; max-height: 300px; line-height: 1.8; direction: ltr; overflow: scroll; } <pre> <code> in case both x , y scroll-bar(s) has hidden </code> </pre> <hr> <pre> <code> in case y-scroll-bar has appears <br> in case y-scroll-bar has appears <br> in case y-scroll-bar has appears <br> in case y-scroll-bar has appears <br> </code> </pre> <hr> <pre> <code> in case x-scroll-bar has apears ------------------------------------------------------------------------------------------------------------------- </code> </pre> actually i'm trying create stackoverflow-code-method-ui. how can that? you need set max-width x scrollbar, changeing overflow:scroll overflow:auto works how ...

java - split function doesn't return -

string str ="|m4oho5kspqikkfn2may72osnfzmn3gutwzqctblzqy6rygwzxbra6bjkmy|113|70|"; string[] tokens = str.split("|"); system.out.println(tokens[0]); system.out.println(tokens[1]); result in white:: 0 i need thing want come is: m4oho5kspqikkfn2may72osnfzmn3gutwzqctblzqy6rygwzxbra6bjkmy sorry not english using google translator | regex protected character. need escape when splitting so: str.split("\\|"); regards

sql server - Date difference between events in same column -

i new ms sql , having difficulty in getting correct results. have table headers updateddate (date), addedby (number), operationid (number) , servicereqno (number) have been selected 3 different tables. the operationid event , servicereqno job number. want able time difference taken between events , once established calculate average. for example: opid 512 @ 20:15 - servicereqno 1 opid 535 @ 21:23 - servicereqno 1 my first task determine difference in time is, ensuring within same job number. many thanks in order timespan between events, need number operations sequentially (one increments without leftout), , join on offset of 1. you'll n-1 rows result timespan inbetween. something this: with cteops ( select row_number() on (partition servicereqno order updateddate) seqid, updateddate, servicereqno yourdatasource ) select datediff(millisecond, o1.updateddate, o2.updateddate) updateddatediff, servicereqno cteops o1 join cteops o2 on o1.seqid=o2...

java - data filtering from db to match with UI -

this question more of approach question. having more theory. apologies that. i have string getting api call queryparam in method. rest call. string has columns name of table present in ui. lets string this: string columnsname= "columns1,column2,column3,column4" now have method call backend. there list of object. these objects ones going fill in rows table columns date have got. problem that, cannot change db call exact columns want. db call getting columns , in fixed order. columns getting front end might have less no of columns , in different order. data getting backend list of object, have iterate through , use writer make csv out of that. csvcompletedata getting backend. list of object. objectdto dto object. for (object csvrowdata : csvcompletedata) { objectdto dtoobj = (objectdto )csvrowdata; writer.append(dtoobj.getip()); writer.append(','); writer.append(dtoobj.getname()); writer.append(','); writer.append(stringescapeutils...

python - Django populate a class model from command, working in DB but not showing on the page -

so, problem might bit specific, not sure think missed in way fill class in commandbase. and have @ moment : in office, in sources / articles list right. in page, articles parsed fro .csv not displayed. here model : class article(modelmeta, translatablemodel): taints_cache = true """ press article element, """ date_created = models.datetimefield(auto_now_add=true) date_modified = models.datetimefield(auto_now=true) date_realization = models.datefield(_('realised in'), default=timezone.now) image = filerimagefield(verbose_name=_('featured image'), blank=true, null=true, on_delete=models.set_null, related_name='image_press_article', help_text=_('set if article featured')) sources = models.manytomanyfield(articlesource, verbose_name=_('source'), ...

android onActivityResult vs getIntent -

both onactivityresult , getintent receives intent other activities. when 1 used on another? i think onactivityresult called after call startactivityforresult receive result. i guess getintent used receive intent sent other me. correct? below understanding how it's used, wonder if understanding correct. i register listen intents (probably in manifest) when registered intents delivered, responsible activity resumes (or gets created) getintent should placed in onresume check intent one should dispose used intent removing whatever data inside intent i think onactivityresult called after call startactivityforresult receive result. on onactivityresult called when finish() activity started startactivityforresult . can provide intent setresult , part of onactivityresult i guess getintent used receive intent sent other me. correct? getintent() returns intent started current activity

grails - Passing the value of textbox as form id -

trying pass value entered in textbox user id of form. code snippet below. passes params.id = "index" in controller. if hardcode form id="sometext" passes params.id = "sometext" controller. due constraints have use button element instead of g:actionsubmit. <g:form controller="search" action="index" id=${searchtext} method="post"> <div> <g:textfield name="searchtext"></g:textfield> <button type="submit" class="btn"> <i class="icon-search"></i> </button> </div> </g:form> any solutions? <g:form controller="search" action="index" method="post"> <div> <g:textfield name="id"></g:textfield> <button type="submit" class="btn"> <i class=...