Posts

android - Hide only the Action bar on Scroll not action bar tabs -

Image
i getting issue @ trying hide action bar while scrolling down.then while scrolling up,the action bar have shown again. for eg: i referred tutorial .here can see output , respective codes related hide , show action bar. i showing output till now. after scrolling down: the screenshot above shown, hide action bar tab also.but have hide action bar.that's major issue. after scrolling up: the screenshot above shows displays action bar tabs. topratedfragment.java: import info.androidhive.tabsswipe.r; import android.app.actionbar; import android.content.res.typedarray; import android.os.bundle; import android.support.v4.app.fragment; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.view.viewtreeobserver; import android.view.window; import android.widget.scrollview; public class topratedfragment extends fragment implements viewtreeobserver.onscrollchangedlistener { private float mactionbarheight; ...

sql - Best way to get next row based on primary key of any row in a table with sequence -

i have table this id name sequence -------------------------- 45 alex 1 22 john 2 2 philip 3 65 shine 4 356 stephy 5 35 tom 6 ok.. here when pass id 2 should row of shine since that's next row based on sequence after philip (2) which best solution? does want? select top 1 t.* table t sequence > @id order sequence;

Scala and implicit class instantiation -

i have following 2 scala files: object implicitshome { implicit class stringwrapper(val str: string) extends implicitshome serializable } trait implicitshome { def str: string def embelishstring: string = { str.concat("fancy") } } and: import implicitshome._ class user { def buildsuperstring(str: string): string = { str.embelishstring } } object user { def main(args: array[string]): unit = { val usr = new user() val fancy = usr.buildsuperstring("hi") println(fancy) } } what wondering that, if have call embelishstring function more once, creating multiple instances of implicit stringwrapper class? i'm concerned because when implicit used, passes string ( str ) in - 'state' have careful sharing across different invocations of embelishstring function? every time call embelishstring - new instance of stringwrapper created. it's pretty cheap if don't have heavy constructor/st...

How to delete Content Source in Sharepoint 2013 Search Service -

Image
i want delete default content source in search service in sharepoint 2013 delete button disable?please see below image. how can delete it? the default content source can not removed.

python - Does `try... except Exception as e` catch every possible exception? -

in python 2, exceptions can raise d required inherit exception? that is, following sufficient catch possible exception: try: code() except exception e: pass or need more general like try: code() except: pass with first variant you'll catch "all built-in, non-system-exiting exceptions" ( https://docs.python.org/2/library/exceptions.html ), , should catch user defined exceptions ("all user-defined exceptions should derived class"). for example, first variant not catch user-pressed control-c (keyboardinterrupt), second will.

android - Input for onPrepareOptionsMenu -

i'm trying make app disables user going menu. know have override onprepareoptionsmenu(menu menu) have put input menu if want use function in different function? don't quite understand menu object , how many types has. do this: private menu moptionsmenu; @override public boolean oncreateoptionsmenu(final menu menu) { moptionsmenu = menu ... } private void updateoptionsmenu() { if (moptionsmenu != null) { onprepareoptionsmenu(moptionsmenu); } } and call updateoptionsmenu() function want

xml - Parsing complextype result in PHP -

i have following response soap server <result>vghpcybpcybub3qgdghlihjvym90ihlvdsbhcmugbg9va2luzybmb3i=</result> but don't know how parse result, supposedly there's information in there, wsdl document establish following: <s:element name="some_response"> <s:complextype> <s:sequence> <s:element minoccurs="0" maxoccurs="1" name="result"> <s:complextype mixed="true"> <s:sequence> <s:any/> </s:sequence> </s:complextype> </s:element> </s:sequence> </s:complextype> </s:element> is there way parse xml response object? i'm using simple_xml... parsing response. that result base64 encoded. echo base64_decode('vghpcybpcybub3qgdghlihjvym90ihlvdsbhcmugbg9va2luzybmb3i='); outpu...

html - Change login/register dropdown to "my account" when user login Bootstrap/PHP -

Image
i learning bootstrap , first front-end project. have login/register dropdown menu , php backend logic implemented php session. i want know how change login/register dropdown "my account"? i thought making separate page logged , offline user , using index.php page redirect correct page. however, find solution highly inefficient since basicaly copy/pasting same page change 1 dropdown button. how should handle kind of situation? here dropdown button:

backbone.js - How to fetch the model in a view with a dynamic url defined in a view -

i using backbone.js in app. model named mymodel is backbone.model.extend({ urlroot: 'home' }); need fetch model url "home/abc/xyz" "abc" , "xyz" dynamic in view. did following var model = new mymodel({id:'abc/xyz'}); model.fetch(); but not working. goes url "home/abc?xyz". how should solve issue? here url function of backbone.model responsible such kind of behavior in backbone: url: function() { var base = _.result(this, 'urlroot') || _.result(this.collection, 'url') || urlerror(); if (this.isnew()) return base; return base.replace(/([^\/])$/, '$1/') + encodeuricomponent(this.id); } as can see encodeuricomponent(this.id) encode id, can't pass , '/' -> '%2f'. can rewrite function, guess it's not best idea, cause can break things. i can suggest approach: just define urlroot of model function , there job: var yourmodel =...

python - Connect to mq series queue with pymqi using userid and password -

i'm trying connect mq series queue using pymqi. queue configured user , password access. i'm trying pass user/password queue filling pymqi.cd() fields useridentifier , password, every time try put message in queue error (mqi error. comp: 2, reason 2035: faild: mqrc_not_authorized) is possible connect queue using userid/password pymqi? the error reported like: 11.52.24 stc01966 ich408i user(uxxxxx) group(mmmmm ) name(nnnn nnnn n 806 chan1.example.queue cl(mqqueue ) 806 insufficient access authority 806 chan1.example.* (g) 806 access intent(update ) access allowed(none ) where uxxxxx happens session user of process try put message in queue you have been given 2035 (mqrc_not_authorized) error application because of lack of authority trying do. error reported @ z/os queue manager racf indicated tried open queue called...

javascript - js regexp - group priority -

lets say, there multiple regular expressions .+ (?:bbb )?ccc which combined in single expression groups - /^(first) (second)$/ both groups should not "know" each other (meaning - can't change expressions). /^(.+) ((?:bbb )?ccc)$/.exec('aaa bbb ccc'); the current result: ["aaa bbb ccc", "aaa bbb", "ccc"] the expected result: ["aaa bbb ccc", "aaa", "bbb ccc"] how prioritize groups bbb ends in second one? make first .+ ( which inside capturing group ) non-greedy adding reluctant quantifier ? next + ^(.+?) ((?:bbb )?ccc)$ demo > /^(.+?) ((?:bbb )?ccc)$/.exec('aaa bbb ccc'); [ 'aaa bbb ccc', 'aaa', 'bbb ccc', index: 0, input: 'aaa bbb ccc' ]

javascript - Mongo document to array -

i'm getting document mongodb in meteor this: template.subtasks.helpers ({ subelement: function (){ var sublen = todoscol.find(this); // var sublen2 = ???? return sublen2; } }); it works great, sublen returns object. when i'm, trying convert array (for example like: var sublen2 = sublen.toarray(); or var sublen = todoscol.find(this).toarray(); or whole collection (without 'this'), doesn't work , "undefined not function" error in chrome console. i tried var sublen2 = sublen.propertyname; since it's object, no luck. what doing wrong? thanks edit: i'm trying iterate on values stored in array in mongo document. want output them example separate div's. it's simple task list. tasks iterating great, i'm trying output subtasks assigned specific task. subtasks stored in same document 'parent tasks' array of strings. template: <template name='subtasks'> <div...

ruby on rails - How do you update message state for RoR applications? -

i'm trying work out how update states messages. example if offer made in message, within message thread user how update status of offer without affecting previous offers? i want application able take in offers , counter offers, store each message newest being calculated set of inputs , price of older messages being unaffected new message. example: 1) - john sends offer: £1000 2) ( not this - earlier message has been updated new price) john sends offer: £3000 james declines offer , offers counter offer of £3000 3) ( ideally this - regardless of number of messages , offers in message thread) john sends offer: £1000 james declines offer , offers counter offer of £3000 how store values of price individually each message between 2 users? thanks :)

ios - UI not responding when popover is presented -

i have 2 buttons button1 , button2 . popover presented when tap on button1 . when popover presented, if tap on button2 , not respond tap action instead popover dismissed. need is, when tap on button2 , need dismiss pop on , button2 's action should performed. how can simultaneously. please give me suggestions. in advance. as per default behaviour of uipopovercontroller, dismissed when user taps outside of popover. following notes apple documentations : the uipopovercontroller class used manage presentation of content in popover. use popovers present information temporarily. popover content layered on top of existing content , background dimmed automatically. popover remains visible until user taps outside of popover window or explicitly dismiss it. popover controllers use exclusively on ipad devices. attempting create 1 on other devices results in exception. if want perform action when want tap on button 2, easiest way move button 2 on top of popove...

angularjs - Restangular put() not working -

i using restangular angular js. get() , post() working good. put not working. here code - $scope.submitfunction = function(isvalid) { if (isvalid) { $scope.post = {}; $scope.post.id = $scope.form.id; $scope.post.code = $scope.form.code; $scope.post.description = $scope.form.description; restangular.one('manufacturing/process', $scope.processid). get(). then( function(response1) { $scope.post.version = response1.data.version; $scope.post.put().then(function(response) { alert('updated'); }, function(response) { alert('error); }); }, function(response1) { alert('error); }); } }; it gives me error = ...

azure - Office 365 end user authentication -

i have office 365 username , password. want authenticate details using rest api without using powershell. can authenticate them using client id , secret. need want authenticate end user using username , password (or) username , other combination without using powershell. p.s.: able perform admin authentication using username, password, client id , client secret. i believe post has information you're looking for: using oauth2 access calendar, contact , mail api in office 365 exchange online

javascript - xpages how to hide element (field) using java script -

in xpages, know editable field able value (retrieve) context. question: how hide field using css or java script in xpages can still value context? thank you use style="display:none" inputtext control's property. render control hide it. can assign values on client side control. <xp:inputtext id="inputtext1" style="display:none" value="#{...}"> </xp:inputtext> in client side javascript can hide inputtext control with document.getelementbyid("#{id:inputtext1}").style.display = 'none' but necessary if want show first , hide later e.g. button click.

directory - Create a folder in a virtual folder with c# -

i created virtual folder in iis. in website, want create folders in virtual folder. tried multiple options, none worked. 1 of them: directory.createdirectory(~/[virtual folder]/[map doesn't exist]); i guess it's taking project folder , not referencing real folder. has idea how this? thanks in advance! physical path answer paul zahra.

html - css overflow-x: scroll on ul -

i'm trying create table using ul li, despite try way can x overflow scroll when manually set width, not practical don't know how many rows in table. question 1: how achive 'overflow-x:' scroll on this? question 2: should using 'a href' or 'onclick' around ul ? #results { background-color: #f3f3f3; border: 1px dotted #4b545f; position: absolute; left: 9px; top: 114px; height: -moz-calc(100% - 230px); height: -webkit-calc(100% - 230px); height: -o-calc(100% - 230px); height: calc(100% - 230px); width: -moz-calc(100% - 20px); width: -webkit-calc(100% - 20px); width: -o-calc(100% - 20px); width: calc(100% - 20px); overflow-x: scroll; overflow-y: hidden; } #header { position: absolute; left: 0px; top: 0px; height: 40px; overflow-x: visible !important; white-space: nowrap; display: inline-block; width: 100%; } #header > ul { width: auto; height: 40px; line-he...

c# - Insert and select within same sp? -

here came situation want insert records in temp temple , again want dispaly record user. i have created 1 sp in sp created temp table, added record table , select record temp table.how show record user in interface? executenonquery used inserting record , executereader is used selecting record. withing same sp,i have insert , select.so how in code behind? you should use executereader . all - sends string of commandtext server, executes it, , builds sqldatareader read from. so if commandtext is call stored procedure - procedure executed (so insert data , select back) , returned data available in sqldatareader . see msdn reference executereader