Posts

Showing posts from August, 2010

php - Url Download to Server 500 Error after long time -

i'm using fopen , fwrite download url files (zip,rar etc) direct server, if file large or takes long time download returns 500 error. php $destination_folder = 'files/'; $url = $_post['url']; $newfname = $destination_folder . basename($url); $file = fopen ($url, "rb"); if ($file) { $newf = fopen ($newfname, "wb"); if ($newf) while(!feof($file)) { fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 ); } } if ($file) { fclose($file); } if ($newf) { fclose($newf); }

ruby - Why does my rspec-rails generated spec fail due to a routing exception? -

i generated scaffold rails (4.1.16) , rspec (3.5.1). it generated test: describe "get #show" "assigns requested team @team" team = team.create! valid_attributes :show, params: {id: team.to_param}, session: valid_session expect(assigns(:team)).to eq(team) end end which outputs error: teamscontroller #show assigns requested team @team failure/error: :show, params: {id: team.to_param}, session: valid_session actioncontroller::urlgenerationerror: no route matches {:action=>"show", :controller=>"teams", :params=>{:id=>"82"}, :session=>{}} if remove keys parameters get , i.e.: get :show, {id: team.to_param}, valid_session the test passes fine. not sure gem defines generator template (rspec-rails?) , why error. appreciated understanding issue. thanks. the generator ( rspec:scaffold , comes rspec-rails) generating tests the syntax required rails 5 (see last section of blog post)

Restart countodown timer with different timer android -

i making repeating countdown timer app.i require countdown timer restart different time.i using global variable in constructor of countdown timer.but problem restarts starting of first given interval. public void chance(final int tota, final int cur, final int exercise,int pass,int flag) { log.i("inside value","reached"); = new countdowntimer((tempmilliseconds) * 1000 + 100, 1000) { @override public void ontick(long millisuntilfinished) { tempmilliseconds = (int) millisuntilfinished / 1000; log.i("inside value",integer.tostring(tempmilliseconds)); updatetimer(millisuntilfinished); } @override public void onfinish() { mtext.settext("0:00"); cancel(); final handler handler = new handler(); handler.postdelayed(new runnable() {

java - Post on Facebook brand page with Spring Social -

my module going restful web-service have end-points perform various operations on facebook brand page (such post or retrieve comments , likes). why there no concept of logged in user or existing browser session. having trouble finding correct code snippet suit needs. came across couple of examples made use of access tokens derived logged in users. might missing something. can please point me right direction? appreciated. thanks!

VB.NET Chaining commands to cmd.exe -

i've been trying chain commands firstly self delete application delete directory in resided through process in vb.net application. here's @ far code concerned. i found useful code sample self deleting applications: dim fldpath string = "c:\test" dim inf processstartinfo = new processstartinfo() inf.arguments = "/c choice /c y /n /d y /t 3 & del " & """" application.executablepath & """" inf.windowstyle = processwindowstyle.hidden inf.createnowindow = true inf.verb = "runas" inf.useshellexecute = true inf.filename = "cmd.exe" process.start(inf) application.exit() the above code works treat , self deletes application. i'd, however, delete folder in resides. have tried chaining commands in arguments process application deletion happens , folder remains, e.g: inf.arguments = "/c choice /c y /n /d y /t 3 & del " & """" application.executab

reactjs - Warning: Failed prop type: Invalid prop `component` supplied to `Route`. & Warning: [react-router] Location "/" did not match any routes -

i speak little engilsh,sorry first. i have searched similar questions, not help. can't figure out happen myself, spend me 1 hours. i start project latest yeoman & generator-react-webpack. some error exist.in browser console. warning: failed prop type: invalid prop `children` supplied to`router`. warning: [react-router] location "/" did not match routes here index.js . import 'core-js/fn/object/assign'; import react 'react'; import reactdom 'react-dom'; import {router, route, hashhistory, indexroute} 'react-router'; import indexpage './components/indexpage'; import pages './components/pages'; reactdom.render(( <router history={hashhistory}> <route path="/" component={indexpage} /> <route path="/pages" component={pages} /> </router> ), document.getelementbyid('webapp')); here indexpage.js . import react, {component} 'react

Do I need WordPress Multisite feature for this structure? -

i need advice regarding web structure. there 2 domains: www.aaa.com , www.bbb.com they both should share same content of blogs more directories. when user access blogs, don't need redirect other domain people can access with www.aaa.com/blog or www.bbb.com/blog with structure, need use wordpress multisite? if blogs same, don't need de multisite. feature allows multiple virtual sites share single wordpress installation, if same site, don't need multisite.

javascript - Cannot retrieve questions/information from phpmyAdmin database tables -

i used youtube guide in order create online quiz, cannot quiz retrieve questions localhost database using mamp. the following php files using: quiz.php <?php /* presentation & test quiz */ session_start(); if(isset($_get['question'])){ $question = preg_replace('/[^0-9]/', "", $_get['question']); $next = $question + 1; $prev = $question - 1; if(!isset($_session['qid_array']) && $question != 1){ $msg = "sorry! no cheating."; header("location: index.php?msg=$msg"); exit(); } if(isset($_session['qid_array']) && in_array($question, $_session['qid_array'])){ $msg = "sorry, cheating not allowed. have start over."; unset($_session['answer_array']); unset($_session['qid_array']); session_destroy(); header("location: index.php?msg=$msg"); exit(); }

jit - ASP.NET MVC Initial Load taking 10 minutes -

i have simple mvc web app 4 controllers behaves fine on 1 windows 2008r2 server, on 2 new servers, 1 2008r2 , 1 windows 2012, takes extremely long time initial jit compile after publishing. the normal server takes 10 seconds load after new version published, other servers take 10 minutes first page, , several minutes load first access of each controller. after initial compile pages load normally. the app targets .net 4.5 cpu debug mode. server works , 1 of 'bad' servers have identical .net 4.6.1 installed, other has 4.5.2. 1 of 'bad' servers has .net core 1.0 installed. in procmon csc.exe shows under w3wp.exe 10 minutes, takes 0% cpu of time. no errors in event viewer. filemon doesn't show access errors. what can cause extremely slow compile? else there check cause of problem? problem caused antivirus settings on vmware host. excluding temporary asp.net files folder antivirus scan solved problem: c:\windows\microsoft.net\framework64\v4.0.30319\t

responsive design - Media Queries on Joomla 3 Not working Suddenly -

for reason, joomla 3 website (using protostar template) has media queries aren't working anymore. specific example located on this page . if view page on phone, large bus image on page supposed "stack" on text below once window gets 599px or less. what's strange things working, stopped working. tried find out have gone wrong no luck. here's css code includes media queries. put in template.css file: .bustype{width:206px; height:296px; border:2px solid black; margin-right:10px; margin-left:10px; margin-bottom:25px; display:inline-block; padding:5px } #bustypewrap{ width:100%; margin:auto; text-align:center;} .busimage{ width:45%; margin-left:5%; float:left} .buscopy{ width:40%; float:right; text-align:justify} .clearitall{ clear:both;} .footerbb{ width:100%; padding:15px; margin-top:20px; text-align:center; background-color:#00467e; color:#fff;} .spectable{ display:block; } .spectablemobile{

c# - How can I pass two parameters from ActionLink to ActionResult -

i'm implementing website using asp.net mvc. i'm trying assign role user clicking role. i've tried several ways, unfortunately, failed. controller method [httppost,actionname("assignusertorole")] [validateantiforgerytoken] [customauthorize(roles ="sudoadmin")] public actionresult assignusertorole(long userid, long roleid) { new businessuser().addroletouser(userid, roleid); return redirecttoaction("index"); } view @html.actionlink(@r.rolename, "assignusertorole", "users", new { userid = model.userid, roleid = r.roleid }) first tried jquery ajax, failed, though think not great idea. however, still "ajax"i mean without refreshing page. i hope question enough of you first, action set respond post. means unless request via post, you'll 404, since there's no action can respond other request method. as link, make request via get. if employ javascript, can bind click even

java - How do I implement expandable List view setOnItemClickListener from button present in child view? -

i trying figure out how implement expandable list view setonitemclicklistener button present in child view. here's have far: public view getchildview(int groupposition, int childposition, boolean islastchild, view convertview, viewgroup parent) { if (convertview == null) { layoutinflater infalinflater = (layoutinflater) context .getsystemservice(context.layout_inflater_service); convertview = infalinflater.inflate(r.layout.weekly_event_child_items, null); } button mybutton = (button) convertview.findviewbyid(r.id.button2); mybutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v1) { ((expandablelistview) parents).performitemclick(v1,positions, 0); } }); } in main view have implemented: expandablelistview.setonitemclicklistener(new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> adapterview, view view,

c# - How to Resize a Grid exactly as the size Origninal canvas when Window is Maximized -

i'm new using wpf , having problem on how responsively resize grids when set window state maximized . please take on design on canvas when not maximized : http://imageshack.com/a/img921/3706/3e8e1f.png and here's of maximized window: http://imageshack.com/a/img922/9510/0f2dsq.png set horizontalalignment="streach" , verticalalignment="streach" remove harcoded height , width value. instead can set minheight, minwidth if required. set margin accordingly if set.

javascript - Twitter Bootstrap nav collapse Hide on click -

Image
when click on menu item menu not close. have checked imports of js , css , seemingly ok, there else need run menu? <!-- fixed navbar --> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="collapse navbar-collapse" id="mynavbar"> <ul class="nav navbar-nav"> <li class="active"><a href="#home" class="active scroll">home&l

javascript - Dynamic jQuery AppendTo Selector -

i have html page adding toolbar item. page using static ids make happen. important line of code looks this: $('#tb').appendto('.item-toolbar'); the above works expected single item. now, i'm trying make work multiple items. in attempt this, i've created fiddle . important code looks this: function movenugget() { var selected = $('#selector').val(); var tb = $('#tb'); var items = $('.item-container'); // following line 1 giving me problems. //.appendto('.item-toolbar'); } if visit fiddle , more clear. basically, user can choose 1, 2, or 3 drop down. once selected, tool bar should "appended to" corresponding item-toolbar . challenge is, can't figure out how create selector dynamically selected item , use appendto function. i want use appendto because actual code more complicated. i've tried strip down part giving me issue. it's approach using appendto . right now, i'm trying: $

amazon web services - AWS CLI syncing S3 buckets with multiple credentials -

i have read-only access source s3 bucket. cannot change permissions or of sort on source account , bucket. not own account. i sync files source bucket destination bucket. own account contains destination bucket. i have separate sets of credentials source bucket not own , destination bucket own. is there way use aws cli sync between buckets using 2 sets of credentials? aws s3 sync s3://source-bucket/ --profile source-profile s3://destination-bucket --profile default if not, how can setup permissions on owned destination bucket can sync cli? the built-in s3 copy mechanism, @ api level, requires request submitted to target bucket, identifying source bucket , object inside request, , using single set of credentials has both authorization read source , write target. this supported way copy 1 bucket without downloading , uploading files. the standard solution found @ http://docs.aws.amazon.com/amazons3/latest/dev/example-walkthroughs-managing-access-example2.html

D3.js and Ionic 2: Elements not in DOM on second page view -

i have created simple ionic app testing integration of d3.js. can found here: https://github.com/wberger/ionic2-d3js-test i did integration follows: create app side navigation , single page ( home.html ) add home.html menu. load d3.js in index.html: <script src="https://d3js.org/d3.v4.min.js"></script> add <div id="chart"></div> home.html create chart in ngafterviewinit() in home.ts the home template defined follows ( source ): <ion-header> <ion-navbar> <button menutoggle> <ion-icon name="menu"></ion-icon> </button> <ion-title> ionic blank </ion-title> </ion-navbar> </ion-header> <ion-content padding> world oyster. <p> if lost, <a href="http://ionicframework.com/docs/v2">docs</a> guide. </p> <div id="chart"></div> <p>after</p> </i

mongodb - Map aggregation results in Mongo -

here data set: { "_id" : "1", "key" : "111", "payload" : 100, "type" : "foo", "createdat" : isodate("2016-07-08t11:59:18.000z") } { "_id" : "2", "key" : "111", "payload" : 100, "type" : "bar", "createdat" : isodate("2016-07-09t11:59:19.000z") } { "_id" : "3", "key" : "222", "payload" : 100, "type" : "foo", "createdat" : isodate("2016-07-10t11:59:20.000z") } { "_id" : "4", "key" : "222", "payload" : 100, "type" : "foo", "createdat" : isodate("2016-07-11t11:59:21.000z") } { "_id" : "5", "key" : "222", "payload" : 100, "type" : "bar", "createdat" : is

Vaadin 7.6.5 Grid column resize and rearrangement not working -

Image
i have updated application vaadin 7.6.5 , recompiled widgets, grid component not responding column resize or rearrangement. i need on wrong. regards. when upgrade vaadin versions have extracted out theme folders vaadin theme jar keep in web application structure, need take new vaadin theme jar , extract theme folders again. i myself troubled exact issue after upgrading, , realised months later cause. after updating theme folders , rebuilding themes, worked fine again!

How do you select a range of lines in Visual Studio Code? -

how select range of lines (from start line number end line number) in visual studio code? click @ first column of first line. scroll down last line want select, hold shift key , click on last line.

React Native: Recurring Could Not Connect to Developtment Server error (timeout?) -

Image
i've been trying out react native lately , got setup right. im running android virtual device , rn app displaying , reloading fine. however, every after amount of time, when hit rr (refresh) error: the way can seem recover if rerun react native command: react-native run-android after that, it's ok again..... until after few minutes, dreaded red screen of death again. what causing this? timeout of sort? tia there reasons that. you have problem on js files using (you can see errors on react packager) you closing react packager terminal after run app it closes automatically terminal reasons do error on react packager?

In bootstrap datatable i have more then pages,in here i need page click function in jquery -

in datatable have inline edit option columns ,if edit didn't save that,that time click on next page, show alertify function (before leave page please save else changes loss)but alertify comes after move next page,but need before enter next page,once user click save or don't save move next page.......my jquery code here $('#mycontacts').on('page.dt', function () { if ($("#hdnsavechanges").val() == "1") { alertify.set({ labels: { cancel: "don't save", ok: "save " } }); alertify.confirm("do want move page. changes have not been saved", function (e) { if (e) { // $("#hdnsavechanges").val("0"); } else { } }); } });

angularjs - Set modelValue as a different date format to the viewValue in Angular directive -

i have datepicker within form. set 1 format view apply different format model value (which sent api). in simple terms want user see 'dd/mm/yyyy' need date sent in iso format. this directive: app.directive('standarddatepicker', function($timeout) { return{ restrict: 'a', require : '^ngmodel', link: function(scope, element, attrs, ngmodel, ngmodelctrl){ element.datepicker({ format: "dd/mm/yyyy", autoclose: true, }).on('changedate', function(e) { ngmodel.$viewvalue = e.date; ngmodel.$render(); }); } } }); is there easy way achieve this? you should use $formatters , $parsers function standarddatepicker() { return { require: 'ngmodel', link: function ($scope, $elem, $attrs, $ctrl) { var ngmodelctrl = $ctrl; ngmodelctrl.$formatters.unshift(func

powershell - while loop not terminating when user presses "n" -

i'm trying create menu using while loop. want menu run till user presses "n" or "n". $menuchoice while ($menuchoice -ne "n" -or $menuchoice -ne "n") { write-host "run again? y/n " read-host $menuchoice } the problem that, runs whether press "n" or "y". do need declare value $menuchoice ? you need assign output of read-host $menuchoice : # initial value (in case run more once) $menuchoice = $null # comparison not case-sensitive while ($menuchoice -ne 'n') { $menuchoice = read-host 'run again? [y/n]' }

asp.net - AspxPageControl Tabs with Web Pages -

i have asp.net project dynamic tabs , want show web pages designed before in tabs. i'm using aspxpagecontrol on page that. couldn't make showing pages on aspxpagecontrol tabs. tabs show nothing. how can this? ok me if there other way. thanks in advance. this button creates new tab protected void button1_click(object sender, eventargs e) { tabpage tab = new tabpage(); tab.text = "tabtext"; tab.name = "tabid"; var ctrl = new literalcontrol("<iframe src='http://www.w3schools.com'></iframe>"); ctrl.id = "controlid"; tab.controls.add(ctrl); aspxpagecontrol1.tabpages.add(tab); } and design <asp:updatepanel id="updatepanel2" runat="server"> <contenttemplate> <asp:button id="button1" runat="server" onclick="button1_click" text="button" /> <dx

python - Scikit-learn SVM: Reshaping X leads to incompatible shapes -

i try use scikit-learn svm predict whether stock s&p500 beats index or not. have 'sample' file extract features x , labels (beats index or doesn't beat it) y. when tried first time (without reshaping x) got the following depreciation error: deprecationwarning: passing 1d arrays data deprecated in 0.17 , raise valueerror in 0.19. reshape data either using x.reshape(-1, 1) if data has single feature or x.reshape(1, -1) if contains single sample. consequently tried reshaping of x according recommendation , forum posts. following value error x , y don't have same shape. valueerror: x , y have incompatible shapes. x has 4337 samples, y has 393. below can see shapes of x , y before reshaping: ('shape of x = ', (493, 9)) ('shape of y = ', (493,)) and after reshaping: ('shape of x = ', (4437, 1)) ('shape of y = ', (493,)) i tried reshape (493,9) shape, didn't work got following error. valueerror: total size of ne

unix - Delete lines in a file by piping search pattern into Sed -

is there anyway can delete lines in file below. grep {searchpattern} {file} | cut -c 1-9 | sed {file} whatever searching can occur fewer lines want delete. want search , take first 9 char , search again , delete whatever lines come in output. my input file below . 0002206993022 enrollment status terminated 08/01/201412/31/9999 0003119343022 enrollment status terminated 05/28/201512/31/9999 0003119343009999 pay status n/a 09/10/201405/28/2015 you can search "terminated" persons , take ids taking first 9 digits in first column. delete of records pay status or enrollment status or whatever you want this: awk '/terminated/{$0=substr($0, 1, 9);print "^" $0}' file | grep -vf - file update: try (non gnu grep): awk '/terminated/{$0=substr($0, 1, 9);print "^" $0}' file |

Apache Spark - Scala - ReduceByKey - with keys repeating up to twice only -

given following rdd: val vectors = rdd [string, int] = ((k1,v1),(k1,v2),(k2,v3),...) where keys appear either twice (k1) or once (k2), never more that. want get: val uniqvectors = rdd[string, int] = ((k1, v1*v2), (k2, v3), ...) one approach use reducebykey: val uniqvectors = vectors.reducebykey((a,b) => a*b) however, it's slow arrays 7b elements. there faster approach on specific case? what (probably) takes time here shuffling data: when want group 2 or more records together, must reside within same partition, spark has first shuffle records records same key in single partition. now, if each key has 2 records @ most, shuffle have take place, unless can somehow guarantee each key contained in single partition - example, if loaded rdd hdfs , somehow know each key resides on single file part begin with. in (unlikely) case, can use mappartitions perform grouping on each partition separately, saving shuffle: vectors.mappartitions( iter => iter.t

Python/Django: as_view() takes 1 positional argument but 2 were given -

i have written as_view() in django project in 2 positional arguments given submit form. when rendering template raising type error : as_view() takes 1 positional argument 2 given. appreciate helping me in solve this. views.py: class auctionview(loginrequiredmixin, multipleformsview): template_name = 'loggedin_load/active_deals.html' form_classes = {'accept_bid': auctionform, 'accepted': acceptedform} success_url = '/live_bids/' @method_decorator(user_passes_test(not_in_company_group, login_url='/login/')) def dispatch(self, *args, **kwargs): return super(auctionview, self).dispatch(*args, **kwargs) def accept_bid_form_valid(self, request, post_id, bid_id, form): accept_bid = form.save(commit=false) accept_bid.bid = bid accept_bid.post = post accept_bid.post_owner = request.user accept_bid.save() form.save() return form.accept_bid(s

Split a vector into multiple vectors in R -

i want split 1 vector(x) multiple vectors(x1, x2 ,... , xn). my input: x <- 1:10 my desire output: x1 <- c(1,2,3,4) x2 <- c(2,3,4,5) x3 <- c(3,4,5,6) x4 <- c(4,5,6,7) x5 <- c(5,6,7,8) x6 <- c(6,7,8,9) x7 <- c(7,8,9,10) my code(thanks mrs.richard herron inspiration): x <- 1:10 n <-3 vectors <- function(x, n) split(x, sort(rank(x) %% n)) vectors(x,n) thanks much! we can use lapply loop on sequence of 'x' such have length of 4 in each of elements in list , create sequence ( : ) index index + n, subset 'x'. if needed have individual vector s, set names of list , use list2env . n <- 3 lst <- lapply(1:(length(x)-n), function(i) x[i:(i+n)]) names(lst) <- paste0("x", seq_along(lst)) list2env(lst, envir = .globalenv) x1 #[1] 1 2 3 4 x2 #[1] 2 3 4 5 x3 #[1] 3 4 5 6 or can create matrix instead of multiple vector s in global environment each row corresponds vector of interest matrix(x[1:4] +

javascript - Pageview for Facebook Instant Articles in Google Analytics -

i have implemented google analytical code @ instant article, showing big difference between google analytic , facebook instant pageview, have implemented following code ga('require', 'displayfeatures'); ga('set', 'campaignsource', 'facebook-instant'); ga('set', 'campaignmedium', 'instant article'); ga('send', 'pageview', window.location.href); ga('send', 'pageview', location.pathname); can please let me know why both analytic had pageview difference

javascript - how to show results in semantic-ui api -

i have problem semantic-ui api use on multiple select element retrieve item server here javascript code $('select[name=problems]').dropdown('destroy').dropdown({ mincharacters: 3, saveremotedata: false, apisettings: { on: 'change', url: '/ajax/contest.getproblemquery/', method: 'post', data: { argv: { page: 0, limit: 1000 } }, beforesend: function (settings) { settings.data.argv.q = settings.urldata.query; return settings; }, beforexhr: function (xhr) { console.log('xhr'); console.log(xhr); xhr.setrequestheader('x-requested-with', 'xmlhttprequest'); xhr.setrequestheader('x-csrftoken', $.cookie('csrftoken')); return xhr; }, onresponse: function (response) { conso

spring jms - How to listen jms-queue from remote server -

i have implemented jms queue , listner in spring application. not able listen jms queue remote system. have configured queue in server application util-sevice.xml file. <bean id="jnditemplate" class="org.springframework.jndi.jnditemplate"> <property name="environment"> <props> <prop key="java.naming.provider.url">http-remoting://182.18.177.115:80</prop> <prop key="java.naming.factory.initial">org.jboss.naming.remote.client.initialcontextfactory </prop> <prop key="java.naming.security.principal">user</prop> <prop key="java.naming.security.principal">pwd</prop> </props> </property> </bean> <bean id="connectionfactory" class="org.springframework.jndi

arduino - Query on Iot device -

can 1 me find solution on this. i know whether there sensor can sense , send data below -30°c. came know arduino cant work on temperature range. i need deploy freezer thing can sense -°c temperature , send cloud or send controller(wire less) near , controller send data raspberry-pi or cloud. thank valuable commands. temperature range depends on used sensor (some sensors can measure temperatures -200°c). temperature range other electronic not good. can use internally heated encapsulation, not suitable battery application. or can place inside sensor , rest of circuit outside.

python - kivy: __init__() is missing x required positional arguments -

i have class movie follows: class movie(widget): def __init__(self, title, image, time, description, trailer, fsk, threed, **kwargs): super(movie, self).__init__(title, image, time, description, trailer, fsk, threed, **kwargs) title = stringproperty() image = stringproperty() time = stringproperty() description = stringproperty() trailer = stringproperty() fsk = numericproperty() threed = booleanproperty() when run script python interpreter tells me this: typeerror: __init__() missing 7 required positional arguments: 'title', 'image', 'time', 'description', 'trailer', 'fsk', , 'threed' so doing wrong? struggle time already. whole source code relevant issue: class movie(widget): def __init__(self, title, image, time, description, trailer, fsk, threed, **kwargs): super(movie, self).__init__(title, image, time, description, trailer, fsk,

ios - drawRect on a UINavigationBar subclass makes the status bar go black -

Image
i have same issue thread here . can manage make status bar visible making text white isn't goal. mean color on top of bar, navigation bars do. i've been able achieve adding shapes want views, under layoutsubviews, way can't interact or see uinavigationitem. code: - (void)drawrect:(cgrect)rect { [super drawrect:rect]; cgcontextref context = uigraphicsgetcurrentcontext(); [[uicolor yellowcolor] setfill]; uirectfill(rect); this result: this bast can achieved drawrect: and happens if under layoutsubviews: as can see, text, arrow, lost. i'm looking way make drawrect work! in advance help! first, set navbar invisible with: navcontroller.navigationbar.translucent = true navcontroller.navigationbar.setbackgroundimage(uiimage(), forbarmetrics: .default) navcontroller.navigationbar.shadowimage = uiimage() navcontroller.navigationbar.backgroundcolor = uicolor.clearcolor() create view in storyboard or xib , make property in vc, add with: navcontro

xamarin - The "LinkAssemblies" task failed unexpectedly while publishing apk file -

i using xamarin forms develop mobile app.i able deploy app in debug mode , app builds no errors.i trying publish apk in release mode getting below error.i have used syncfusion sfchart , sfgauge.kindly , find below error description: c:\program files (x86)\msbuild\xamarin\android\xamarin.android.common.targets(5,5): error msb4018: "linkassemblies" task failed unexpectedly. xamarin.android.xamarinandroidexception: error xa2006: reference metadata item 'system.int32 xamarin.forms.platform.android.resource/attribute::actionbarsize' (defined in 'syncfusion.sfgauge.xforms.android, version=14.2451.0.26, culture=neutral, publickeytoken=null') 'syncfusion.sfgauge.xforms.android, version=14.2451.0.26, culture=neutral, publickeytoken=null' not resolved. ---> mono.cecil.resolutionexception: failed resolve system.int32 xamarin.forms.platform.android.resource/attribute::actionbarsize @ mono.linker.steps.markstep.markfield(fieldreference reference) @ mono.li

javascript - Get Wifi information on Windows (Cordova) -

i've been using https://github.com/parsonsmatt/wifiwizard wifi information (specifically connected ssid) on ios , android , it's been great. plugin not support windows/windows phone however, there way can see name of connected wifi ssid on windows or windows phone?

Dynamics CRM Authentication Without Active Directory -

we have employees work in our company not in central office. installed dynamics crm 2016 in central office. users not exist in central office active directory. how can define these users authenticate , work crm? there no option add user not exists in ad or trusted ad. assume these users doesn't exist in central office ad exists in ad. if yes matter of configuring proper trusts between domains.

c++ - Using std::bind to bind parameters and object instance separately -

is possible bind arguments member function call, , later bind target object separately? what trying achieve helper function receives function arbitrary arguments argument, , executes on items in collection. void sometype::work(uint a, uint b, uint c) { //do } template<typename function, class container> void execute(const function& fn, const container& collection) { for(auto& item : collection) { auto bound = std::bind(fn, &item); bound(); } } void test() { //eg. container = vector of sometype auto fn = std::bind(&sometype::work, 10, 20, 30); execute(fn, container); } this failing error within functional: error c2064: term not evaluate function taking 3 arguments eventually pointing at: see reference function template instantiation 'void execute<std::_bind<true,void,std::_pmf_wrap<void (__thiscall sometype::* )(uint,uint,uint),void,sometype,uint,uint,uint>,uint &,uint &,uint

python - Pandas dataframe generate column with different row info, but no apply function -

maybe question name not accurate (sorry because don't find accurate word describe question...), let me make example: the following dataframe income "week_id" , "user_id": week_id user income 1 1 100 1 2 50 2 1 200 2 2 30 2 3 150 3 1 100 3 2 150 .... i want add new column, contains "income" of previous week, looks like: week_id user income previous_week_income 1 1 100 0 1 2 50 0 2 1 200 100 2 2 30 50 2 3 150 0 3 1 100 200 3 2 150 30 .... it looks generate new column information other rows, other current row. i know solution apply function, it's row row, seems slow case ( origin dataframe may tens of millions of rows ), wonder other fast solution result? the background generate factor predictive analysis, want use previous week income 1 variable when predict current wee

ios - Content Hugging Priority Not working as expected -

i have view height directly proportional height of parent view. within view there 2 buttons , spacer view. want heights of buttons increase first , height of spacer view increase lower priority. purpose have set heights of buttons equal, , given 2 additional constraints first button i.e 30 <= height <= 50 . have assigned spacer view height >= 30. if space available, want buttons grow up-to size of 50 , if still space available spacer view fill-up remaining area. achieve have given buttons content hugging priority(vertical) 200 , spacer view has higher content hugging priority(vertical) 300 . not working expected. missing or doing incorrectly?

node.js - root can't find gulp command in project dir -

my current task make jenkins job download git repo, gulp build project , sync data s3 bucket. trouble gulp build command root can't find. i read that post installing nvm globally , after using: wget -qo- https://raw.githubusercontent.com/xtuple/nvm/master/install.sh | sudo bash was able install nvm /usr/local/nvm. inside project directory (/var/lib/jenkins/project) run: sudo /usr/local/bin/npm install and modules go node_modules dir inside project dir. then do: sudo gulp build --env=production sudo: gulp: command not found it looks root can't find gulp . inside node_modules/gulp/bin there gulp.js file have no idea how use it. so how can make gulp build work root? installed , build project minor effort using regular user , know project ok, problem manifested after switching root. my working env amazon linux node.js version 4.4.7. these first steps nvm, gulp , node.js whole, please, don't harsh if i'm doing stupid. i think have inst

Portable library in .net core -

i new .net core , having doubt portable libraries. i have created .net core web application, , framework section of project.json looks follows: "frameworks": { "netcoreapp1.0": { "imports": [ "portable-net4+netcore45" ], "dependencies": { "microsoft.netcore.app": { "version": "1.0.0-*", "type": "platform" } } } } now in above case, meaning of "portable-net4+netcore45"? does mean, can run .net core application on machine .net framework 4 installed? will work without .net core installation? no, above still require .net core installed, because using "type": "platform" , requires platform installed , package serves reference. if want run w/o .net core framework/sdk being installed, have change to "dependencies": { "microsoft.netcore.app": "1.0.0" }, "frameworks": { "netcoreapp1.0&quo

javascript - Damping of value fluctuation, filtering out spikes -

i'm working physics in javascript , have value indicating number of contacts in "physical" world. value can between 0 - 6. problem fluctuates lot. want filter out spikes. number 3 , fraction of second changes 0 , 3 again. ideas how best this? a fit can median filter in sliding window. consider last n values, n @ least twice duration of drop. filtered value median of n. repeat forever n samples shifted 1 position. as values discrete in tiny range, median algorithm simple. keep histogram of 7 possible values, i.e. 7 counters. whenever shift 1 position, count down oldest value , count new. median value such cumulated counts reaches n/2. there inertia, i.e. true changes take time acknowledged, unavoidable because algorithm needs confirm permanent change vs. temporary drop.

scoring - Solr results show hyphenated words first -

i have following problem: search term , results. fine. if term exists hyphenated word in solr index, result containing word higher score/ shown on top of results. i have tried change third result entry of search , changed not hyphenated wort hyphenated one. , after reindexing document , searching same term expect same scoring before. document changed word on first place. text fieldtype looks following in schema.xml: <fieldtype name="text" class="solr.textfield" sortmissinglast="true" positionincrementgap="100"> <analyzer> <tokenizer class="solr.whitespacetokenizerfactory" /> <filter class="solr.stopfilterfactory" ignorecase="true" words="stopwords-de.txt" /> <filter class="solr.worddelimiterfilterfactory" generatewordparts="1" generatenumberparts="1" splitoncasechange="0" splitonnumerics="0" catenat