Posts

Showing posts from February, 2013

ios - Custom marker image on swift (MapKit) -

i use custom marker on mapkit how can change image width , height on custom marker? my code: func mapview(mapview: mkmapview!, viewforannotation annotation: mkannotation!) -> mkannotationview! { if (annotation mkuserlocation) { return nil } let reuseid = "test" var anview = mapview.dequeuereusableannotationviewwithidentifier(reuseid) if anview == nil { anview = mkannotationview(annotation: annotation, reuseidentifier: reuseid) anview.image = uiimage(named:"x2.png") anview.canshowcallout = true } else { anview.annotation = annotation } return anview } try use anview.frame.size = cgsize(width: 30.0, height: 30.0)

vba - Determine if date is before or after the 15th of the month -

i have function applies rate based on number of months item has been stored. charge half rate if item stored after 15th. function i'm using determine amount of months item stored datediff() function. returns number of months between 2 dates. how determine if date before 15th or after? if use datediff(d,1/1/2015, 4/1/15) value greater 15 cannot see if date before or after 15th using greater or less 15. how can determine if either of dates (entrance date date item entered storage area , exit date date removed) before or after 15th? vba models date floating point double. integral part stands day. advances 1 per day. it provides function day(date) can use extract day of month in date occurs. for example, cdate(40000) return 6-july-2009, , day(40000) returns 6.

android - RippleDrawable NOT drawing over Views -

i have layout kenburnsview , imageview on (just toggle button). when click on button ripple generated drawn below kenburnsview. previously, when had image view in replacement kenburnsview ripple drawn above imageview on top. here layout: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/background" android:clickable="true" android:orientation="vertical"> <relativelayout android:id="@+id/header" android:layout_width="match_parent" android:layout_height="@dimen/nav_drawer_header_height"> <framelayout android:layout_width=...

php - Yii2 Unknown Property Exception in Server -

i have view displaying grid view particular model. in local machine, it's working when deploy application server, attribute not found hence unknown property exception. when @ code though, attribute there. any ideas? here model class code: http://codebin.org/view/f0a713c1 the view code: echo gridview::widget([ 'dataprovider' => $dataprovider, 'filtermodel' => $searchmodel, 'columns' => [ [ 'attribute' => 'is_condemned', 'label' => 'condemned', 'class' => '\kartik\grid\booleancolumn', 'falselabel' => 'active', 'truelabel' => 'condemned' ], ], // set toolbar 'toolbar' => [ ['content' => html::a(fa::icon('plus') . ' add', ['/equipment/default/create'], ['class' => 'btn btn-success']) ], '{export}', '{...

datetime - xpages Date Compare -

hi want write style ssjs plan view. set on column date variable "01.06.2007" , if document start date + duration contains 01.06.2007 result background color change. dateconverter.stringtodate = java.util.date tommy valand code. ( http://dontpanic82.blogspot.com.tr/2010/04/xpages-code-snippet-for-datestring.html ) //------------------------------------------------- col = 0; var zerodate = dateconverter.stringtodate( '01.06.2007', 'dd.mm.yyyy' ) coldate = @adjust(zerodate, 0, 0, col, 0, 0, 0); duration = parseint(rowdata.getcolumnvalue("duration")); startdate = rowdata.getcolumnvalue("start date"); enddate = @adjust(startdate, 0, 0, (duration-1), 0, 0, 0); if(startdate == coldate){ "startcolor"}else if(startdate < coldate && (coldate < enddate)){ "percolor"}else{ "bgcolor"}` you cannot compare date values < or > afaik. transform notesdatetime stuff java date object...

java - Autowire jdbcTemplate in ObjectMother for a junit 4 integration test -

i wondering if can somehow autowire jdbctemplate in objectmother junit 4 integration test. the purpose of test test if attach document employee, cannot attach afterwards document same name. made employeemother has method creates employee , method inserts it, using jdbctemplate. if try autowire jdbctemplate in employeemother null(test returns npe on first update). seems have access applicationcontexts test itself. currently set test itself, not to, because create more objectmothers different objects , not set jdbctemplate of them. here 2 classes (i deleted company name package , imports): employeemother : package com.domain.objmother; import org.apache.commons.logging.log; import org.apache.commons.logging.logfactory; import org.springframework.jdbc.core.jdbctemplate; import com.domain.vo.company; import com.domain.vo.contact; import com.domain.vo.employee; import com.domain.vo.identification; import com.domain.vo.role; public cl...

What happens to Fortran scratch files when a program terminates early? -

specifically i'd know if scratch files in fortran deleted if program terminates (or killed) before issuing close() on scratch unit. the fortran standard says file deleted on " normal termination of program". while many implementations may try delete scratch files on abnormal termination, don't recommend depending on this. in particular, if "kill" program, less scratch files deleted.

jvm - datastax : Spark job fails : Removing BlockManager with no recent heart beats -

im using datastax-4.6. have created cassandra table , stored 2crore records. im trying read data using scala. code works fine few records when try retrieve 2crore records displays me follwing error. **warn blockmanagermasteractor: removing blockmanager blockmanagerid(1, 172.20.98.17, 34224, 0) no recent heart beats: 140948ms exceeds 45000ms 15/05/15 19:34:06 error connectionmanager: corresponding sendingconnection connectionmanagerid(c15759,34224) not found** any help? this problem tied gc pressure tuning timeouts increase spark.storage.blockmanagerheartbeatms spark waits gc pause end. spark-734 recommends setting -dspark.worker.timeout=30000 -dspark.akka.timeout=30000 -dspark.storage.blockmanagerheartbeatms=30000 -dspark.akka.retry.wait=30000 -dspark.akka.framesize=10000 tuning jobs jvm spark.cassandra.input.split.size - allow change level of parallelization of cassandra reads. bigger split sizes mean more data have reside in memory @ same time. spark....

actionscript 3 - accessing an image component in flex from actionscript3 -

i have image component in flex (mxml file), below <mx:image id="imageid"/> i have separate actionscript class , trying set source of image init() in actionscript class. i trying access like, [embed(source="hello_world.png")] [bindable] public var hello_world:class; init() { ................. imageid.source = new hello_world(); .................... } but image doesnt displayed. so question is, how access image component declared in mxml page in actionscript class. judging answers on as3 embed images class , these images class? , need cast hello_world class bitmap : init() { ................. imageid.source = new hello_world() bitmap; .................... }

vb.net compability in newer visual studio -

i program in vb.net language using visual studio (i not professional). using visual studio 2010, , thinking updating visual studio 2013 or visual studio 2015. do know if vb.net supported in vs 2013 and/or 2015? i asking because here in brazil, vb.net courses found using visual studio 2010 yet, , in c# example, used visual studio 2013. thanks!!! simple answer, yes is. in fact can featured visual studio community edition free , 2015 version supports new 'roslyn' features added vb.

search - Adding a new field to existing Solr index -

i'm working solr 4.3.0 , trying add new field index. i have added field xml-data-config.xml: <field column="session_garantie" xpath="/produits/stage/sessions/session/@garantie" /> and i've added field schema.xml: <field name="session_garantie" type="string" indexed="true" stored="true" multivalued="true"/> but still don't find field in query results. why? there cache should clean? i rebooted solr core i'm working with. .

python - Can't print os.urandom() -

i have following problem. trying print output of os.urandom(10) , nothing in output. have found workaround printing repr of os.urandom weird considering actual type of os.urandom string. does have same problem or knows why happens? using python 2.7 on spyder , below copy of phenomenon: >>> import os >>> out = os.urandom(10) >>> print out >>> out '\x96\x02\x1b\xa9\xa2z\xc4\xf0\xa4\xfa' >>> type(out) <type 'str'> >>> print repr(out) '\x96\x02\x1b\xa9\xa2z\xc4\xf0\xa4\xfa' those non-printing characters. it's not reasonably possible print them as-is. if want take hexdump, use binascii.hexlify() .

android - Hashtable : How can use it with 2/3 different thread? -

on android have 1 hashtable , 2 thread can access that. - ui thread access containskey, , put - other thread access containskey, , put , iterator i know hashtable thread safe, sure ? one thing don't understand : why application doesn't blow if 1 thread doesn't see 1 value has been removed hashtable , thread iterates on object ? how can define hashtable thread-safe if iterator isn't ? edit : tell in more specific way problem, becasue in other way i'm not clear. following reported code of concurrenthashmap : public concurrenthashmap<string,result> holder = new concurrenthashmap<string,result>(); class result { public float goal = 0; public float min = 0; public float max = 0; public float seconds = 0; //lastaccess indicate time of last access of result public float lastaccess = 0; public boolean triggered = false; } now 1 thread b iterates every "x" seconds result object , each key stored in holde...

regex - perl script for reading data with in angular brackets < and > not working -

my task read data within angule brackets , write file. have developed script not working. if there modifications required please correct me. the sample data want read this textbooks written author1 `{ <sam>,<january>,<2015>},{<rga>,<feb>,<2005>},` this perl program #!usr/bin/local/perl use warnings; use strict; @c_result; @c_result_array; %hash; $file = 'c_template.c'; open cfile, $file or die "could not open $file: $!"; @content; $fileoutput="output_c.c"; open outfile,"> $fileoutput" or die $!; $i; while(<cfile>) { $i (@content) { $_ = $i; if(/<[\w*_*]+>/) { @c_result = /<[\w*_*]+>/g; $i (@c_result) { $key=substr($i,1,length($i)-2); $i=$key; push @c_result_array,$i; print outfile $i ."=>@c_result_array"; print outfile ...

javascript - When sending jQuery post to MVC controller getting 404 error -

i'm sending view using jquery mvc post action function dosomething(passedid) { $.ajax({ method: "post", datatype: 'text', url: '/mycontroller/someaction/', data: { id: passedid} }).done(function (data) { // }); } and inside mycontroller [httppost] public actionresult someaction(int id) { ... } in firebug console i'm getting 404 error. you didn't said version of jquery using. please check jquery version , in case version < 1.9.0 should instead of method: "post" use type: "post" this alias method, , according jquery official documentation should use type if you're using versions of jquery prior 1.9.0. function dosomething(passedid) { $.ajax({ type: "post", datatype: 'text', ...

javascript - How to fade a message when HTML page loads + Bootstrap -

i want when index page load in browser current div fade out after 3 seconds. when div hide main content of page (menu,images,etc) show. use bootstrap css in page i stack in following problem. problem js function isn't working. here body of html page far: <body> <div id="fade"> <div id="box"> <blockquote class="blockquote-reverse"> <p>blah blah</p> <footer>project manager of <cite title="source title">some project</cite></footer> </blockquote> </div> </div> <!-- blah blah here comes rest of site --> </body> here css file: #box { font-family: 'playfair display'; position: absolute; top: 50%; left: 50%; transform: translatex(-50%) translatey(-50%); } #fade { height:100vh; background-color: black; } and here js file: $(document).re...

html - Using same background img for all pages of a website affects loading time? -

does using same image every page's background on website decreases page load times? mean background image cached on ur disk after opening 1 page resulting in lil bit faster load time other pages? duplicate from: https://stackoverflow.com/a/9035931/722617 you need determine if server sending cache-header files in question

android - UnsupportedOperationException on EdgeEffect -

my app fails when initializing viewpager inflated xml. following line crashes android src edgecompat.java final typedarray = context.obtainstyledattributes(com.android.internal.r.styleable.edgeeffect); final int themecolor = a.getcolor(com.android.internal.r.styleable.edgeeffect_coloredgeeffect, 0xff666666); this called viewpager.initviewpager() , can see in stack trace there error when inflating layout. i have attached layout , stack trace below layout <merge xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/transparent" android:clickable="true" > <android.support.v4.view.viewpager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/transparent...

How to arrange data in sql server table -

i tried many query achieve expected result , couldn't find solution. actual:- id | empdailyfee | empmonthlyfee | compdailyfee | compmnthlyfee 1 null 12 null null 1 50 null null null 1 60 null null null 2 50 null null null 3 null 30 null null expected :- id | empdailyfee | empmonthlyfee | compdailyfee | compmnthlyfee 1 50 12 null null 1 60 12 null null 2 50 null null null 3 null 30 null null this looks table smell me since rows sharing same id value different empdailyfee/empmonthlyfee values. in particular case can expected output this: select t1.id, t1.empdailyfee, t2.empmonthlyfee @test...

JSON file name can have more than one period? -

such bb.king.json — still proper? details. have 2,100 people want write out each person separate file details in json format. use email address "@" because way unique file names. use first.last@domain.com format. resulting file name elvis.presley.json sits on file server. the thing restricting in names of files file system. see limitations here . json not care name of file. that means yes - can use names bb.king.json

javascript - 'Node' is undefined. How can we define in application level? -

i facing problem variable scope. if define in 1 js file , how can use in js file (here mean if want use 1 variable in entire application)? can do? example: in our ie (ie-8 , lower versions of ie) facing problem node types. using constants in many javascript files example: node.element_node giving problems few browsers( 'node' undefined) have replace constant "1" in files. instead of replacing in places (so many files), can define in our starting html file example below in our starting html file (i.e. index.html) , can use node.element_node in other javascript files? impact in other javascript files ever use node.element_node: <script type="text/javascript"> if (!window.node){ node = { element_node : 1, attribute_node : 2, text_node : 3, cdata_section_node : 4, entity_reference_node : 5, entit...

javascript - $state.go don't work in ionic framework -

i'm creating cordova app ionic framework, created blank app cli, in index.html have slide box, in have button in last slide. have registered click event in button, in click in button navigate templates/projects.html. hope problem clear. thanks index.html file <body ng-app="starter" class="platform-android platform-cordova platform-webview"> <ion-pane> <ion-header-bar class="bar-stable"> <h1 class="title">babylapse</h1> </ion-header-bar> <ion-content> <ion-slide-box style="height:100%" on-slide-changed="slidehaschanged($index)"> <ion-slide > <div style="height:100%" class="box blue"><h1>blue</h1> <img src="img/tutorial_img1.jpg"> </div> </ion-slide> <ion-slide> <div class="bo...

javascript - Gmaps4rails - individual infowindow for clusters -

Image
i create infowindow using gmaps4rails gem , put clusters. far, can create clusters when click on clusters zooms in, in individual markers. using partial template show information. however, not template. because can not individual info of marker. so, shows info of markers. here; after zoom out; what have is, shows clusters second page , when click infowindow opens. instead zooms in first picture. here locations_controller ; class locationscontroller < applicationcontroller def index if params[:search].present? @locations = location.near(params[:search], 5) #kac mile cevresinde aranıldıgının bilgisi bu km ile değişebilir else @locations = location.all end @hash = gmaps4rails.build_markers(@locations) |location, marker| marker.lat location.latitude marker.lng location.longitude marker.infowindow render_to_string(:partial => "/locations/my_template", :formats => [:html], :locals => { :object...

java - Use non-local variables in actionlistener -

i want use variable in action listener of . code : public class face { public face(){ btn1 = new jtogglebutton(); btn2 = new jtogglebutton(); btn3 = new jtogglebutton(); btn4 = new jtogglebutton(); btn5 = new jtogglebutton(); btn6 = new jtogglebutton(); } public start6(){ jtogglebutton[] btn = new javax.swing.jtogglebutton[5]; // array saving address of buttons btn[0] = btn1 ; btn[1] = btn2 ; btn[2] = btn3 ; btn[3] = btn4 ; btn[4] = btn5 ; btn[5] = btn6 ; (int = 0 ; < 36 ; i++) { btn[i].addactionlistener(new actionlistener() { @override public void actionperformed(actionevent e) { btn[i].setsize(150, 150); imageicon btnimage = new imageicon(getclass().getresource("/gameimages/" + /* picture name*/ + ".jpg" )); image img = btnimage.getimage(); btn[i].seticon( new imageicon(img.getscaledinstance(225,160 ,image.scale_fast))); ...

python - How to get the widget's current x and y coordinates? -

i'm writing game project game "4 in row". make animation picture widget disk falls in column, i've been thinking creating while loop in: while widgetx != __ , widgety != __ where @ blank parts there values i'll need get. my question if there's function returns current x , y value widget. winfo_rootx() , winfo_rooty() return coordinates relative screen's upper left corner. winfo_x , winfo_y return coordinates of window relative parent.

sql server - SQL CASE LIKE with multiple choices -

in query have following part of code: case when field1 '%choice1%' or field1 '%choice1%' .... 'category 1' when field1 '%choicea%' or field1 '%choiceb%' .... 'category 2' end 'cats' i have numerous of choices (1line 20), (2line 15 , son on). can make code cleaner, use in for? example: case when field1 in ('%choice1'.'%choice2%',...) 'category 1' when field1 in ('%choicea'.'%choiceb%',...) 'category 2' end 'cats' p.s. heard can use somehow || can't find in google how use them. what think problem? if choices known, put them in table , use join: select field1, c.category maintable left join choices c on field1 ('%' + c.choice + '%') update: if there sub-strings inside 1 category, add distinct query.

laravel 4 - Multi-level sum in mongoDb -

i working on mongodb laravel using jenssegers . , trying sum based on time.estimated_time_in_number. i have mongodb document contains following data. "time": [ { "id": "qzmv154213", "estimated_time_in_number": 4.41 }, { "id": "qzmv154213", "estimated_time_in_number": 2.25 },{ "id": "qzmv154213", "estimated_time_in_number": 5 } ] i using following query , gives me 0 rather 11.66. task::sum('time.estimated_time_in_number'); you use aggregation framework sum , aggregation pipeline gives result this: db.task.aggregate([ { "$unwind": "$time" }, { "$group": { "_id": 0, "total_estimated_time": { "$sum": "$time.estimated_time_in_number" } } ...

MongoDB C# Driver 2.0 - Update document -

i'm upgrading code mongodb c# driver 2.0 , i'm having issues upgrading code update documents. using old version able this: mytype myobject; // passed in var collection = _database.getcollection<mytype>("mytypes"); var result = collection.save(myobject); i'm struggling find way in new version. have found few examples of updating single fields like var filter = builders<mytype>.filter.eq(s => s.id, id); var update = builders<mytype>.update.set(s => s.description, description); var result = await collection.updateoneasync(filter, update); i'd update fields doing in old version method save. any ideas ? thanks lot i think you're looking replaceoneasync() : mytype myobject; // passed in var filter = builders<mytype>.filter.eq(s => s.id, id); var result = await collection.replaceoneasync(filter, myobject)

php - Webservice is not working for upload image 1mb size -

we uploading image webservice, encoding image base 64 , sending content in webservice, working fine 500kb, if file size more 500kb not working. need ? can problem ? it looks settings problem: check upload_max_filesize , post_max_size in php.ini upload upload_max_filesize settings of maximum allowed file size , post_max_size maximum allowed size of post query

When i'm testing the application in Android Studio i get this error: -

here error i'm getting , appricieate guys: caused by: android.view.inflateexception: must specifiy layout in include tag: <include layout="@layout/layoutid" /> here <include layout="@layout/layoutid" /> in activty_main.xml: <include android:layout="@layout/app_bar" android:id="@+id/app_bar"/> and here app_bar layout: <android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorprimary"> please can me this. i'm new here in java programming. your exception message's containing answer: change include android:layout="@layout/app_bar" include layout="@layout/app_bar"

php - AJAX not running success function -

i've got ajax script lets user login on login page script seems stop after runs beforesend. <script> $(document).ready(function() { $('#login').click(function() { var username=$("#username").val(); var password=$("#password").val(); var datastring = 'username='+username+'&password='+password; if($.trim(username).length>0 && $.trim(password).length>0) { $.ajax({ type: "post", url: "login.php", data: datastring, cache: false, beforesend: function(){ $("#login").val('connecting...'); }, success: function(data){ if(data) { ...

Cannot register to GCM for push notifications on Android version 5 and 5.1 -

gcm notifications works on devices gcm notifications can not register in android 5.0 or 5.1 os . not getting response gcm. did have problem? please me? mycode: registerreceiver( ongcmregistrationfinish, new intentfilter( commonutilities.registration_finish_action)); intent registrationintent = new intent( "com.google.android.c2dm.intent.register"); // sets app name in intent registrationintent.putextra("app", pendingintent .getbroadcast(login.this, 0, new intent(), 0)); registrationintent.putextra("sender", commonutilities.sender_id); login.this.startservice(registrationintent); my manifest file : ...

ios - Network call fails due to unwrapping -

this code making network call forecast.io . inside viewcontroller have: private let apikey = ""//my key override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. let baseurl = nsurl(string: "https://api.forecast.io/forecast/\(apikey)") let forecasturl = nsurl(string: "37.8267,-122.423", relativetourl : baseurl) let sharedsession = nsurlsession.sharedsession() let downloadtask : nsurlsessiondownloadtask = sharedsession.downloadtaskwithurl(forecasturl!, completionhandler: { (location: nsurl!, response: nsurlresponse!, error: nserror!) -> void in if (error == nil) { let dataobject = nsdata(contentsofurl: location) let weatherdictionary : nsdictionary = nsjsonserialization.jsonobjectwithdata( dataobject!, options: nil, error: nil) as! nsdictionary } }) downloadtask.resume() } i'm trying set data nsdictionary ...

html - Float is breaking link on website -

i have div on website in has span classes encased. 1 of these meant have mailto: link, however, seems because div floated right, link not work. if remove float, works should. html: <div class="topmenu"> <div class="contactinfo"> <span class="topmenuspan">call us:</span><span class="topmenuinfo"> 01892 704 201</span> &nbsp; &nbsp; &nbsp; &nbsp; <span class="topmenuspan"><a href="http://www.google.com">email us:</a></span> <span class="topmenuinfo">info@doyouknowbonobo.co.uk</span></div></a> </div> and css: .topmenu{ height:36px; background:#000; font-family: adelle-sans; font-weight:600; font-size:15px; color:#fff; text-align:right; float:right; position:relative; right:5.7%; width:612px; } .topmenuspan{ color:#ffdc31; cursor:pointer; } .topmenuinfo{ color:#fff; cursor:pointer; } .topmenu .co...

C++ function returning bool not executed -

this question has answer here: short circuit evaluation , side effects 3 answers given c++ function foo : bool foo(); and following lines of code bool some_bool = false; some_bool = some_bool , foo(); i observed foo() not called although might have side-effects. name of behavior , compiler-dependent? this called short-circuit evaluation . in example, some_bool false , statement some_bool && foo() going false. there never need evaluate foo() . note standard c/c++ , not compiler dependent can lead unperformed code you've discovered. a better way of writing code is: bool some_bool = false; bool foo_result = foo(); some_bool = some_bool && foo_result;

Sencha extjs open widget in new browser tab -

i'm new sencha extjs , have question. i have widget(headerram.js) 1 splitbutton , menuitemclick listener every item, , app.js menuitemclick listener switch case. widget 'gestione rda' opened in same browser tab. i'd open in new browser tab. could me have ext.getcmp('gestioneram').show() in new browser tab? thanks in advance. here's code: //headerram.js ext.define('ramui.widget.headerram', { extend: 'ext.toolbar.toolbar', initcomponent: function () { codiceutente = this.codiceutente; this.items = [ { xtype: 'splitbutton', text : traduci('main menu' , document.getelementbyid('hddlingua').value), id:'mainmenu', menu: new ext.menu.menu({ items: [ // these render dropdown menu items when arrow clicked: { text : traduci('gestione ram' , document.getelementbyid('hddling...

mysql - php | Convert array to FIND_IN_SET -

i'm trying convert array query string. may can me. my array looks like: array ( [3] => array ( [0] => 7 [1] => 13 [2] => 1 ) [4] => array ( [0] => 14 [1] => 2 ) ) and i'm trying convert into: (find_in_set('13', vals) || find_in_set('7', vals) || find_in_set('1', vals)) , (find_in_set('14', vals) || find_in_set('2', vals)) how can this? thanks! this may you. [akshay@localhost tmp]$ cat test.php <?php $array = array(array(7,13,1),array(14,2)); function convert_to_string($array) { return implode(" , ",array_map(function($v){ return "(".implode(" || ", array_map( function($q){ return sprintf("find_in_set('%s', vals)",$q);},array_values($v))).")";},array_values($array))); } echo convert_to_string($array); ?> output ...

c# - Open Url & Set CookieContainer to Phone Web Browser -

i'm using c# , windows phone 8.1 universal. i use code set cookiecontainer httpwebrequest , access site. cookiecontainer cookiecontainer = new cookiecontainer(); public async task<string> begin(string url, bool savecookie = false) { string pagesource = ""; httpwebrequest request; request = (httpwebrequest)webrequest.create(url); //request.method = "get"; if (cookiecontainer != null && savecookie) request.cookiecontainer = cookiecontainer; try { httpwebresponse response = (httpwebresponse)await request.getresponseasync(); pagesource = new streamreader(response.getresponsestream()).readtoend(); pagesource = system.net.webutility.htmldecode(pagesource); } catch { } return pagesource; } now have open url phone web browser{internet explorer}( forpayment page). how can launch url cookiecontainer ie? ...

indexing - Difference between Sitecore solr index rebuild and refresh -

we know difference between sitecore full index rebuild , index refresh . when want refresh item in index took ~2 min. full rebuild of master index took ~10min. why index refresh time consuming? we refreshing item using code: sitecore.data.item item = getitem(); var masterindex = contentsearchmanager.getindex("sitecore_master_index"); masterindex.refresh(new sitecoreindexableitem(item)); i'm looking in decompiled source of sitecore.contentsearch assembly , looks refresh method calls refreshtree method on indexcustodian class. refreshtree create new object array item indexed , iterate through available indices (even though you've called specific index) , creating refresh job each of them (which added queue processing): public static ienumerable<job> refreshtree(iindexable startitem) { assert.argumentnotnull(startitem, "startitem"); crawlinglog.log.debug(string.format("indexcustodian. refreshtree triggered on item {0}....

java - Repopulate an array list once emptied -

what have game user presses sprite , when pressed add score , make sprite disappear. issue i'm having can't figure out how make sprites reappear once pressed being removed array list completely, readd these array list or in different way? this sprite code: package cct.mad.lab; import java.util.random; import android.content.context; import android.graphics.bitmap; import android.graphics.bitmapfactory; import android.graphics.canvas; import android.os.vibrator; public class sprite { //x,y position of sprite - initial position (0,50) private gameview gameview; private bitmap spritebmp; //width , height of sprite image private int bmp_width; private int bmp_height; // needed new random coordinates. private random random = new random(); private int x = random.nextint(200)-1; private int y = random.nextint(200)-1; int xspeed = (random.nextint(30)-15); int yspeed = (random.nextint(30)-15); public sprite(gameview gamev...

c++ - g++ compilation error on AIX unix server -

i have socket program server code written in c++. i'm facing below error when compiled using g++ compiler(os : unix aix). same code compiled using cc compiler(os : unix sun os ). please let me know how resolve it. code snippet enum sockstates { inopen = ios::in, outopen = ios::out, open = ios::in | ios::out, }; error g++ -gxcoff -maix64 -shared -fpic -fpermissive -w -libstd=c++11ox -i/devt/flex/java/include -i/devt/flex/java/include/aix -i/tmp/ribscomp/server/include -c -o server.o server.cc ssocket.h:721:26: error: calls overloaded operators cannot appear in constant-expression open = ios::in | ios::out, ^ g++ version g++ -v using built-in specs. collect_gcc=g++ collect_lto_wrapper=/opt/freeware/libexec/gcc/powerpc-ibm-aix7.1.0.0/4.8.2/lto-wrapper target: powerpc-ibm-aix7.1.0.0 configured with: ../gcc-4.8.2/configure --with-as=/usr/bin/as --with-ld=/usr...

java - spring boot mvc how to support multiple viewresoler (eg. jsp and freemarker) -

i hope web application support jsp , freemarker both templates.i have read article @ below. https://spring.io/blog/2013/06/03/content-negotiation-using-views code below. result jsp template ok. wrong configration? mvcconfiguration.java @configuration @enablewebmvc public class mvcconfiguration extends webmvcconfigureradapter { @bean public internalresourceviewresolver getjspviewresolver() { internalresourceviewresolver resolver = new internalresourceviewresolver(); resolver.setprefix("/web-inf/jsp/"); resolver.setsuffix(".jsp"); resolver.setorder(0); return resolver; } @bean public freemarkerviewresolver getfmviewresolver() { freemarkerviewresolver resolver = new freemarkerviewresolver(); resolver.setcache(true); resolver.setprefix(""); resolver.setsuffix(".ftl"); resolver.setcontenttype("text/html; charset=utf-8"); resolver.setorder(1); return resolver; } @bean ...

android - How to dismiss AlertDialog.Builder with custom button -

i have custom alertdialog , want dismiss when user click button . this code: button btn = (button) dialoglayout.findviewbyid(r.id.custom_alert_dialog_horarios_btn_aceptar); btn.setonclicklistener(new button.onclicklistener() { @override public void onclick(view arg0) { // todo auto-generated method stub //i want dismiss alertdialog }}); alertdialog.builder builder = new alertdialog.builder(getactivity()); builder.setview(dialoglayout); builder.show() not answer question fix problem using setpositivebutton , custom settextcolor , setbackgroundcolor. this new code: layoutinflater inflater = getactivity().getlayoutinflater(); view dialoglayout = inflater.inflate(r.layout.custom_alert_dialog_horarios, null); final textview tv_texto = (textview) dialoglayout.findviewbyid(r.id.custom_alert_dialog_horarios_texto); final textview tv_titulo = (textview) dialoglayout.findv...