Posts

Showing posts from September, 2015

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

MySQL update Trigger to update data table value After Insert on another table -

i have been stumbling on writing mysql trigger , hopping me find elegant solution solve issue. have looked many places , cannot seem find bug in code. tried not adjusting delimiter seems create problems able create trigger without setting delimiter if replace update statement else. the code have is: use mytable delimiter // --trigger update scheduling 'status' , 'retries' values create trigger `scheduling-updatde_after_result-insert` after insert on results each row begin update `scheduling` set running = false, retries = retries + 1 id = new.id; end// delimiter ; i following errors: 18:03:25 [delimiter - 0 row(s), 0.000 secs] [error code: 1064, sql state: 42000] have error in sql syntax; check manual corresponds mysql server version right syntax use near 'delimiter create trigger acapella . scheduling-updatd...

Using PHP how can I convert this string variable into another form? -

i have huge list of city, country want display them in compact form of country. so example have following variable hallands, sweden but how can show here meaning after , , space keep 2 letters , capitalize. hallands, sw ? then try this $str='hallands, sweden'; $str=explode(',',str); echo $str[0].','.strtoupper(substr($str[1], 0, 2));

R: keyword extraction with naive bayes -

i've got documents , each document i've got keywords. want use these documents train model. data looks follows: postag <- list() tfidf <- list() labels <- list() one element of each list represents document. there 50 documents. postag[[1]] vector part of speech tagging each word in document 1, tfidf[[1]] vector tfidffactor each word in document 1, labels[[1]] vector labels (0 = no keyword, 1 = keyword). note: words each document ordered: postag[[1]][1] pos first word in document 1, tfidf[[1]][1] tfidffactor same word in document 1, , labels[[1]][1] says if word keyword. now want use these 50 documents train (naive bayes) model predicts if word keyword or not. features tfidf factor , pos. me? you can use e1071 package : data(iris) m <- naivebayes(species ~., data = iris) predict(m, iris) note column species must factor variable example: iris["species"]<- as.factor(iris["species"]) but in case species fac...

c# - Pointing To Android Directory -

i trying convert image byte using c# , parsing byte web service have line of code can't right. trying point phone's storage path, pictures in device , can't seem correct path. byte[] imagebyte = environment.getexternalstoragedirectory().getpath( "famscanner\\vehicle_{0}.jpg"); i'd suggest converting image bitmap object first. because way can use following answer similar question. link answer to create bitmap object you'll need path image file first , create that: bitmap bitmap = bitmapfactory.decodefile(pathtoimage)

sharepoint online - How to Regex remove multiple invalid characters in powershell? -

i new powershell , know if there way remove specific occurrences of invalid characters using powershell? /ram-_tranva-_bi.pdf - in instance remove "-__" filename. /us-lrt---atten.pdf - in instance remove "---" filename i have tried: -replace [-]+, "" -replace -[3], "" -replace "[#%*:<>?/|-_]", "" doesn't seem work either way... can please? your trouble have enclose values single quotes try : "/ram-_tranva-_bi.pdf" -replace '[-]+','' or : "/us-lrt---atten.pdf " -replace '[-]+','' "/us-lrt---atten.pdf " -replace '[-]3',''

excel - Changing formatting of a cell in a different worksheet -

first time question apologies if it's not detailed should be. y'all have been super helpful getting me through first vba script far, haven't been able find solution problem. here is! i'm trying write button on worksheet 1 when hit can change formatting of specific cells on worksheet 2. specific code i'm trying follows: if cells(i, 6).value <> "" , cells(i, 5).value <> "" worksheets("info").range("f5").interior.color = rgb(255, 0, 0) end if this if statement inside loop counter. i'm getting error 1004, , far can tell it's not letting me select in sheet. when remove "worksheets("info") bit, code works fine in sheet 1, i'm 90% sure has trying modify cell in different sheet. any ideas? if want work on multiple sheets need identify sheet on want run command: with worksheets("yourfirstsheetname") if .cells(i, 6).value <> "" , .cells(i, 5)...

if statement - R: How to use IF correctly? -

i have 2 columns of values this: >bb gdis bdis 1 12.291488 8.009909 2 11.283319 13.625103 3 6.674549 8.629232 4 13.493121 17.175888 5 9.550731 9.867878 6 9.193895 9.785301 7 10.541702 10.941371 8 9.849527 9.496284 9 8.682287 8.133774 10 8.439381 4.335260 i need add column , call index calculates ratio gdis/bdis if gdis bigger, , bdis/gdis if bdis bigger. how do that? try transform(bb, index=ifelse(gdis>bdis, gdis/bdis, bdis/gdis)) # gdis bdis adn #1 12.291488 8.009909 1.534535 #2 11.283319 13.625103 1.207544 #3 6.674549 8.629232 1.292856 #4 13.493121 17.175888 1.272937 #5 9.550731 9.867878 1.033207 #6 9.193895 9.785301 1.064326 #7 10.541702 10.941371 1.037913 #8 9.849527 9.496284 1.037198 #9 8.682287 8.133774 1.067436 #10 8.439381 4.335260 1.946684

python - Send the contents of a CSV as a table in an email? -

how can send contents of csv table in email using python? example file: name,age,dob xxx,23,16-12-1990 yyy,15,02-11-1997 check this link. just pass csv third argument server.sendmail() method

c# - SQL Reporting Services custom security extension approach to use for multiple applications -

i have created custom security extension describes here: http://msdn.microsoft.com/en-us/library/ms155029.aspx . we have application store username, groups, etc. custom security extension fetch data application. works fine far. now there new challenge: want have multiple applications, use same report server. approach is, custom security extension connects different databases authentication , authorization. implemented far , in theorey works fine. i run in 1 problem make me headaches. thought, simple identify each connection custom table store session (request cookie application, works in uilogon.aspx.cs , logon.aspx.cs ) , domain (via request.url.host in same pages). store data in custom created table in reportserver database , in other methods cookie session informationen retrieve info domain choose correct database. my problem: loose cookie information identify session. tried made singelton instance class store each instance, not "application" wide. thought, s...

php - Codeigniter Project Working Locally & on web Showing 404 -

hi project works fine locally when try run on shared hosting gives 404 error structure follows project structure /public_html/mydomain.com -content --asset --build --case --core --application --main --system --lwyers --setup --subdomains $config['base_url'] = 'http://mydomain.c-m/'; $config[‘uri_protocol’] = 'auto'; $config['content_url'] = 'http://mydomain.c-m/content/'; $config['index_page'] = ''; htc access file <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l] </ifmodule>code here pls guide me doing wrong, please check project's directory permission. directory must have permission : rwx-rwx-rx

jquery - How to redirect from an action called on ajax -

i need redirect "home" action "login" action. "login" action called on ajax. what's happening "login" action redirecting "home" action. but, "login" action called on ajax, ajax success callback executing. instead want direct redirect login action home action. there way achieve in "login" action itself? is "redirecting success callback" way of redirecting? have several conditions based on need redirect different views. great, if can redirect action itself you can redirect home action ajax success callback shown : window.location.href = '@url.action("home","controllername")' write above code inside ajax success callback. edit :- you can use redirecttoaction() when perform normal form submit here doing ajax call have try code shown in answer,if want test conditions before redirecting send conditions action ajax request json , check conditions in ajax ca...

Jquery UI button - css to make custom icon always appear before text, no matter how long is the text -

Image
i using jquery ui asp.net button place custom icon on button. in css, using margin move cusom icon. if text longer need change margin. is there way place icon alway before text, no matter how long button text. (i don't have create separate css different buttons) jquery asp.net button $(function () { $("input:submit").button({ icons: { primary: 'cssbox-okbtn' } }).hide().after('<button>').next().button({ icons: { primary: 'cssbox-okbtn' }, label: $("input:submit").val() }).click(function (event) { event.preventdefault(); $(this).prev().click(); }); }); cusom buttom css .cssbox-okbtn { background-image: url('/images/easyui/icons/ok.png') !important; margin: 95px; } asp.net page <td align="center"> <asp:button id="btnlogin"" text=" login " runat="server...

c++ - Using extern to refer to a function defined in a different compilation unit -

due static data, have function void foo(mynamespace::bar) defined in compilation unit. point of use in compilation unit. use namespace mynamespace { extern void foo(bar); } but linker can't find function definition. misusing extern ? extern can used kind of thing. your problem linker expecting function mynamespace::foo(bar); due fact extern statement within mynamespace . you have 2 choices: use extern void foo(mynamespace::bar); @ "point of use". don't enclose line within mynamespace . alternatively, enclose function definition within mynamespace .

hibernate - Spring with JPA - fail if no transactional context defined -

i want require every jpa call occurs inside @transactional context , if forgot annotation, jpa should throw exception instead of creating implicit transaction each call. how can achieve that? there's part of question easier answer "jpa should throw exception instead of creating implicit transaction each call". you're aware of transaction propagation levels mandatory support current transaction, throw exception if none exists. nested execute within nested transaction if current transaction exists, behave propagation_required else. never execute non-transactionally, throw exception if transaction exists. not_supported execute non-transactionally, suspend current transaction if 1 exists. required support current transaction, create new 1 if none exists. requires_new create new transaction, suspend current transaction if 1 exists. supports support current transaction, execute non-transact...

angularjs - Initial state of checkbox? -

running code clicking checkbox returns true or false {{ishidden}} expected. when code run first time {{ishidden}} appear blank. how fix this? <!doctype html> <html data-ng-app> <head lang="en"> <meta charset="utf-8"> <title></title> </head> <body> hidden: <input type="checkbox" ng-model="ishidden">{{ishidden}} <script type="text/javascript" src="js/angular.js"></script> </body> </html> use ng-init directive <input type="checkbox" ng-model="ishidden" ng-init="ishidden= true">{{ishidden}} use true or false in ng-init initialize values on scope here working plunker

objective c - Upload image with post -ios -

i use method save user informations in data base. can me upload image in same function ? - (void)inscription:(nsarray *)value completion:(void (^)( nsstring * retour))block{ nsoperationqueue *queue = [[nsoperationqueue alloc] init]; nsarray *param_header = @[@"username", @"password", @"email",@"first_name", @"last_name"]; // nsarray *param_value = @[@"ali", @"aliiiiiiii", @"ali.ali@gmail.com",@"ali",@"zzzzz"]; nsmutableurlrequest *request = [[nsmutableurlrequest alloc] initwithurl:[nsurl urlwithstring:[nsstring stringwithformat:@"http:// /messenger/services/messenger_register"]]]; nsstring *aa=[self buildparameterwithposttype:@"user" andparameterheaders:param_header ansparametervalues:value]; [request sethttpbody:[aa datausingencoding:nsutf8stringencoding]]; [request sethttpmethod:@"post"]; [nsurlconnection sendasynchronousrequest: request ...

objective c - How to detect tap on small nearest buttons in iOS? -

Image
i need build app in there image. on image there many points user can tap , depend upon location of tap need take input. tap locations fixed. user can zoom image. detect multiple taps. (single tap, double tap, etc.) biggest problem facing there many points near each other. if tap on 1 point getting other points clicked. following image according need work on. i need detect tap on red dots , take decision based upon that. red dots not visible user. what have tried following. placed buttons on image shown image. problem when user tap on button either button's tap event not calling or it's not tapping right button user seems tap. what thinking is. taken image in scroll view detect tap of scroll view , based upon co-ordinates detect tap. is there easier way detect tap? your requirement pretty complex one. here have take of core image. need process image , core details of image. "morphological operations" detect object image. take on links...

python class weave numberrows together -

i wrote following class weave multiple rows of number together, how print result? class numberrow(object): def __init__(self, row2): self.row = row2 self.amount = len(row2) def weave(self,other): lijst = [] in range(self.amount): lijst.append(self.row[i]) lijst.append(other.row[i]) self.row = lijst from ipy_lib import file_input number_row import numberrow '''program''' bestand = file_input().splitlines() lijst1 = bestand[0].split() lijst2 = bestand[1].split() lijst3 = bestand[2].split() row1 = numberrow(lijst1) row2 = numberrow(lijst2) row3 = numberrow(lijst3) row1.weave(row2) number_list = row1.weave(row3) print number_list i "nonetype" error. how can make sure class object becomes printable? method weave not returning anything, need modify code this: def weave(self,other): lijst = [] in range(self.amount): lijst.append(self.row[i]) lijst.append(other.row[i])...

How parsing xml from url and get attribute php -

i need parsing xml file parsing , can parsing local file, how can parsing file url? i use php code <?php include '/example1.php'; $string = $xmlstr; $xml = simplexml_load_string($string); foreach($xml->row->exchangerate[0]->attributes() $a => $b) { echo $a,'="',$b,"\"\n"; } ?> example1.php code <?php $xmlstr = <<<xml <exchangerates> <row> <exchangerate ccy="rur" base_ccy="uah" buy="0.33291" sale="0.33291"/> </row> <row> <exchangerate ccy="eur" base_ccy="uah" buy="18.60253" sale="18.60253"/> </row> <row> <exchangerate ccy="usd" base_ccy="uah" buy="14.97306" sale="14.97306"/> </row> </exchangerates> xml; ?> just feed necessary url , use simplexml_load_file() of...

c++ - How to obtain texture coordinate from arbitrary position in HLSL -

Image
i'm working on c++ project using directx 11 hlsl shaders. i have texture mapped onto geometry. each vertex of geometry has position , texture coordinate. in pixel shader, can obtain texture coordinate 1 pixel. how can sample color neighboring pixels? for example pixel @ position 0.2 / 0, texture coordinate 0.5 / 0, blue. how texture coordinate let's 0.8 / 0? edit: what i'm implementing volume renderer using raycasting. volume to-be-rendered set of 2d slices parallel , aligned, not equidistant. volume use directx's texture3d class in order interpolation in z direction. now cast rays through volume , sample 3d texture value @ equidistant steps on ray. problem comes play. cannot sample texture3d @ current ray position, slices not equidistant. have somehow "lookup" texture coordinate of position in 3d space , sample texture using texture coordinate. i have idea how implement this, additional texture3d of same size color of texel @ position xyz ...

gridview - Sandboxed code execution request failed while storing data in list -

i developing sandbox webpart office 365. i having 5 row in grid. this grid having 3 drop-down , 2 text-box in each row.when save grid data sharepoint list, works fine. but when rows of grid increased 5 gives me error of sandboxed code execution request failed. i facing issue on pre-production , production office 365 site. how can store data , resolve issue ? any suggestion welcome , appreciable. first: sorry english , learn internet. the "sandboxed code execution request failed." general error. if have error in code, error. i have 2 way solve errors: 1, make new "log" list , , make try-catch bloks in code. if catch exception, write "log" list, see problem. 2, webpart it's fine, cant add web. open shareoint designer, , give webpart manual . first make empty web part. (it easy add web, add instead of mywebpartname). then open web in sharepoint designer, page(aspx). on page search empty web part, , replace "typ...

css - Changing layout to IE browsers -

this question may sound subjective or in appropriate make sense programmers me (who doesn't have knowledge of css). i have template has css (around 300 lines), working fine on firefox, opera, chrome , ie10+ . in practical world, may not ie need prepare ie version 8 & 9. so, there easy & quick way change css compatible ie without interaction css? or there way can paste existing css compatible ie converted css? i sorry if question not clear, mean ask how can convert css code ie versions? there tool available online on can paste code , select destination ie version create css code ie version? or have write code manually each ie version? *note: css code doesn't have reference other css framework bootstrap, boilerplate etc.. * sure! use additional css file specially ie lower 10. can rewrite classes main css file in it. include new css file (for ie lower 10) after main css file: <!--[if lt ie 10]> <link rel="stylesheet" type="tex...

JavaScript - Continue after IF statement ends -

i'm looking simple solution. right use multiple if statements, , of course ends after first 1 true. have list of things need executed after previous 1 has ended. i'm sure there simple solution, unfortunately don't know yet. here code: function writesolutions() { document.write("<article><p id=\"solutions_title\" class=\"ticketsubtitlesolutions\">details oplossingen</p><div id=\"solutions_details\" class=\"ticketdetails_container\">"); if (pageloadsolution != null); { document.writeln('<p id="paginaladen" class="semisubtitle">pagina laadt niet</p><p class="helpdescription">lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis ...

how to configure my application with spring security? -

i new spring security tried read , there alot of information , don't know if in right direction. have html file html element create js lets assume have 2 input fields id ( html input fields ) emailinput , passwordinput and button id ( html button ) loginlabel i added configuration pring-security-config <beans xmlns="http://www.springframework.org/schema/beans" xmlns:security="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd"> </beans> i added web.xml filter> <filter-name>springsecurityfilterchain</filter-name> <filter-class>org.springframework.web.filter.deleg...

c# - WindowsFormsApplication moving label to a specific coordinates using timer (animation style) -

please help first of i'll make myself clear, don't want use wpf application animation 2nd want use purely c# windowsformsapplication only. so here problem, how can move label @ point a specific coordinate of point b precisely using timer? example: have label1 @ coordinates (0, 0) want move (336, 53) every tick of timer1 (1 ms). code below kinda works on these coordinates, further explanation, 336/53 6 remainder 18, used 6 updating p.x in every timer tick, used 18 f every value of time divisible 18 label1 hit (336, 53) mark. the main problem example want move (0, 0) (200, 101) doesn't work.furthermore if p.x , p.y accept float values such 1.9 shouldn't problem. thank in advance... private void timer1_tick(object sender, eventargs e) { time++; // initialized int time = 0; if (time % 18 == 0) //btw p point p = new point(); below line p.x += 1; //means every 18 pixels traveled x add 1 pixel p.y += 1; ...

html - always hiding a button after clicking on it using php and css -

i have php code hide download button after clicking on 1 time changing id 0 1 .. after if time user signed in , removes button using simple css hide code. here code : <?php $result = @mysql_query("select * scode updated= 1 , coden ='$username'"); if ($_post[downloadthefile]== "downloadthefile") { $upd_art = "update scode set downloaded='".$_post[t11] ."' id='$_session[userid]'"; mysql_query($upd_art) or die(mysql_error()); } if($row['downloaded']==1) { echo "<style> .thedownloadbutton {display:none;} </style>"; } ?> <form class="thedownloadbutton" method="get" action="<? echo '../download/'.$item_downloadlink .'.zip' ; ?>"> <button type="submit" name="downloadthefile" value="downloadthefile">download </button> <input name="t11" type="hi...

html - How do I allow a bunch of divs to automatically "linebreak" -

i have set of div.box objects in big container div#boxes . so: /-------------\ | | | [a] [b] [c] | | | | [d] [e] [f] | | | \-------------/ however, want able list boxes .. f , have "linebreak" between c , d done automatically, depending on effective width of outer box. i tried different variations of display: . thought .box {display: inline; } should work, due reason eludes me, causes boxes displayed in 1 vertical line, though @ least 2 boxes should fit in 1 line. tried combination of div#boxes { display: table; } , div.box { display: table-cell; } . making boxes aligned in 1 horizontal line (which kind of expected). currently, boxes have same size , outer box has fixed size, allow more flexible layout. use inline-block value. .box { display: inline-block }

php - How to make MySQL sort rows form the Latest created -

Image
i have doubt here, there way can tell mysql align or sort out rows newest oldest, example created 2 rows in database first 1 hi world , second 1 hello world,instead of showing latest show's alpabatically want show newest oldest how have kind effect? i've tried using select * pages order postid asc not work! please me. the browse tab of pages table: the structure tab of pages table: use select * pages order postid desc to show latest first (asc ascendent)

sql server - SSIS-Calling java service using Script Task -

i trying call java base web service method writing following code in script task's entry point method. following code executing if call console application while calling ssis control flow, upto message box 1 executed on executing webrequest.getresponse() happen dont know neither gives error nor execute next line of code. public void main() { string envelopecontent = getsoapevvelope(); xmldocument soapenvelopexml = new xmldocument(); soapenvelopexml.loadxml(envelopecontent); httpwebrequest webrequest = (httpwebrequest)webrequest.create(_url); webrequest.method = "post"; // executed soapenvelopexml.save(webrequest.getrequeststream()); messagebox.show("1"); webresponse response = webrequest.getresponse(); messagebox.show("2"); // not executed string responsestring = string.empty; using (var reader = new streamreader(response.getresponsestrea...

query parser - Lucene QueryParser: must contain either one or the other among other MUST clauses -

how can queryparser apache lucene used have query either contains term or term b (or both, @ least 1 of them). edit: also, contains other must clauses, e.g., must contain c , must contain either or b. is correct? +(a or b) +c it simply: a or b (or a b ) this generate 2 booleanclause s occur.should . in case, @ least 1 clause has match whole booleanquery match: /** use operator clauses <i>should</i> appear in * matching documents. booleanquery no <code>must</code> * clauses 1 or more <code>should</code> clauses must match document * booleanquery match. * @see booleanquery#setminimumnumbershouldmatch */ should { @override public string tostring() { return ""; } }, answer updated question: (a or b) , c should want. i'm not sure +(a or b) +c since looks should work stated +(a or b) doesn't work expect in original question. to make sure, can take @ queryparser generates. you'd need kind...

java - How check if throwed exception -

if have this: public user finduserbyemail(string email) throws customernotfoundexception{ list<user> users = new arraylist<user>(); users = sessionfactory.getcurrentsession().createquery("from user email = ?").setparameter(0,email).list(); if (users.size() > 0) { return users.get(0); } else { throw new customernotfoundexception(); } } and in moment want check returned finduserbyemail(string email) method whether return user object or customernotfoundexception in end. i tried in way private boolean searchcustomer(string email) throws customernotfoundexception{ if (hibernatedao.finduserbyemail(email).getclass() == user.class) { .... } else { .... } } is way or there betters? no. nonononono. use catch keyword catch exception . try { user thingie = hibernatedao.finduserbyemail(email); } catch (customernotfoundexceptio...

c++ - How to get an array's size? -

there array : ... int score[3]; ... score[0] = 6; score[1] = 4; score[2] = 7; how array's number of elements ? ( here obvious want ask question in general ) several ways: std::distance(std::begin(score), std::end(score)) std::extent<decltype(score)>::value c++17 ( n4280 ): std::size(score) see this answer .

c - libnfc cmake header file compilation error -

am programming nfc using libnfc library in c language. using tdm-gcc mingw compiler , cmake open source build system installed following this tutorial building/compiling code. trying compile program includes/imports header file having source file. part of header file (card_objects.h) is: #ifndef card_objects_h_ #define card_objects_h_ ... //other code int setapplicationid(uint8_t *rapdu, char tag[], int currentpos); #endif a part of source code file (card_objects.c) is: #include "card_objects.h" ... //other code int setapplicationid(uint8_t *rapdu, char tag[], int currentpos) { ... //other code return currentpos; } both files in include_dir/ directory @ current path relative main file. have called header file in main program file follows: #include "include_dir/card_objects.h" ... //othercode int main(int argc, const char *argv[]) { .... //other code currentpos = setapplicationid(rapdu, "application id (aid): ", currentpos...

c# - How to compare a value from a Dictionary<string, string> in a if statement -

this question has answer here: getting error msg - cannot implicitly convert type 'string' 'bool' 5 answers using following code, i'm trying compare 1 of parameters of dictionary in if statement i'm getting syntax errors "cannot implicitly convert type string bool" what way proceed ? thank ! dictionary<string, string>[] responses = service.send(request); foreach (dictionary<string, string> response in responses) { if (response["result"] = "0") { messagebox.show("succes !"); } else { messagebox.show("error !"); } } result expected return 0 if success or 1 if failed i've tried following syntax in if give me syntax errors: if (con...

java - Tomcat 8 + Jersey not showing JSP pages -

i'm using jersey rest application. but, 1 of methods must return viewable can simple html file. have read tutorials, , finished using jsp template. working great when run locally, using jetty. but, using tomcat 8, following exception: http status 500 - org.glassfish.jersey.server.containerexception: javax.servlet.servletexception: java.lang.linkageerror: loader constraint violation: when resolving method "org.apache.jasper.runtime.instancemanagerfactory.getinstancemanager(ljavax/servlet/servletconfig;)lorg/apache/tomcat/instancemanager;" class loader (instance of org/apache/jasper/servlet/jasperloader) of current class, org/apache/jsp/web_002dinf/jsp/confirmacao_jsp, , class loader (instance of java/net/urlclassloader) method's defining class, org/apache/jasper/runtime/instancemanagerfactory, have different class objects type org/apache/tomcat/instancemanager used in signature type exception report message org.glassfish.jersey.server.containerexc...

java - ServerSocket do not work -

i beginner. run following code. import android.app.activity; import android.os.bundle; import android.os.networkonmainthreadexception; import java.io.ioexception; import java.net.serversocket; import java.net.socket; public class mainactivity extends activity { serversocket server = null; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); try { server = new serversocket(4444); } catch (ioexception e) { e.printstacktrace(); } try { socket client = server.accept(); } catch (ioexception e) { e.printstacktrace(); } } } but can see app stopped working message in emulator when run. found error occur on statement socket client = server.accept();. think statement wait until client request accepted. these user permissions added. <uses-permission android:name="android.permission.internet"/> <uses-permi...

javascript - Set boolVar to true if all TD has text otherwise set it to false -

i have html code: <table id="contenedorfabricantes" style="" class="table table-condensed"> <thead> <tr class="tablehead"> <th><input type="checkbox" name="togglecheckboxfabricantes" id="togglecheckboxfabricantes"></th> <th>fabricante</th> <th>dirección</th> <th>país</th> <th>teléfono</th> </tr> </thead> <tbody id="fabricantebody"> <tr> <td><input type="checkbox" value="1"></td> <td>distribuidor1</td><td>8768 dewy apple wynd, foxtrap, montana</td> <td id="fabtd-1" class="has_pais"></td> <td>4061782946</td> <td><a data-backdrop="static" data-target="#addpaisesfabricante" da...