Posts

Showing posts from May, 2010

How to handle RequestParam with bracket in Spring MVC -

how can handle url webix sorting , filter : myhost.com/film?page=1&sort[title]=asc&filter[title]=cat&filter[year]=1998 in spring mvc @requestmapping(value = "/film", method = requestmethod.get) public list<phone> listfilm( @requestparam(value = "page", required = false) integer page, @requestparam(value = "sort", required = false) string sort ) { int page = (page != null) ? page : 0; return filmservice.getall(page, sort); } is other way requestparams sort[title]=asc (with squarebracket in params) ? similar this i try in php work fine params bracket $sortarr = array(); if (isset($_get["sort"])){ // param sort[title]=asc foreach($_get["sort"] $name => $dir){ array_push($sortarr,$db->escapestring($name)." ".$dir); } if(count($sortarr)) $str .= " order ".implode(",",$sortarr); } thanks help/references appreciate s...

ios - CloudKit record version control -

i comparing version of ckrecord, using recordchangetag , saw value changed n9 (2 chars) 1c1 (3 chars) on time. in apple documentation : in own code, can use change tokens distinguish between 2 different versions of same record. i want ask: is string value in field incrementing one? what right way compare order of records?

ios - UICollectionViewCell resizing on device rotation -

i have simple uicollectionview embedded in viewcontroller. the uicollectionview uses auto-layout (defined in ib) take whole space in viewcontroller. my uicollectionviewcell have same size , take whole space of uicollectionview because want 1 cell displayed in viewcontroller. uicollectionviewcell displays uiimage (which embedded in uiscrollview zooming). it works fine except when device rotate. there's error message: the behavior of uicollectionviewflowlayout not defined because: item height must less height of uicollectionview minus section insets top , bottom values, minus content insets top , bottom values. relevant uicollectionviewflowlayout instance , , attached ; animations = { bounds.origin=; bounds.size=; position=; }; layer = ; contentoffset: {0, 0}; contentsize: {4875, 323}> collection view layout: . that's pretty clear, need resize uicollectionviewcell fit new height / width. after rotation uicollectionviewcell display appropriate height / wi...

python - Why are each frame not equally length? -

i sampling , framing audio files, such can provide input neural network. using librosa sample audio , frame it, framing important, being fed input neural network need means length has consistent, seem problem current. frames. i sampling , framing this: def load_sound_files(file_paths , data_input): raw_sounds = [] data_output = [] fp in file_paths: y,sr = librosa.load(fp) x = librosa.util.frame(y) raw_sounds.append(x) return raw_sounds each audio file in appended list, , each entry in list there array each frame. information in raw_sounds stored this: [array([[frame],[frame],...,[frame]],dtype=float32), ...] i seem have problem different sized frames, each audio files has different length, since frame same setting should each frame same, not case according these print debugs. print len(raw_sounds) print len(raw_sounds[0]) print len(raw_sounds[0][0]) print len(raw_sounds[0][1]) print '\n' print len(raw_sounds[1]) print len(ra...

python - Why does my function return None? -

this may easy question answer, can't simple program work , it's driving me crazy. have piece of code: def dat_function(): my_var = raw_input("type \"a\" or \"b\": ") if my_var != "a" , my_var != "b": print "you didn't type \"a\" or \"b\". try again." print " " dat_function() else: print my_var, "-from dat_function" return my_var def main(): print dat_function(), "-from main()" main() now, if input "a" or "b",everything fine. output is: type "a" or "b": a -from dat_function -from main() but, if type else , "a" or "b", this: type "a" or "b": purple didn't type "a" or "b". try again. type "a" or "b": a -from dat_function none -from main() i don't know why dat_fun...

azure - Cloud Service Vs Website w.r.t Instances sharing content and configuration -

as mentioned here , 1 of differences caught eye "web server instances share content , configuration, means don't have redeploy or reconfigure scale." marked not possible cloud services. if cloud service set autoscale/has more instances (scale-out), won't share same content (code base i'm assuming) , configuration ( .csdef/.cscfg ) settings? azure cloud services (web/worker role instances) share code when code deployed (based on what's in .cspkg along content downloaded+installed instructed in startup script). each instance fresh vm image, overlaid software bits. same software bits placed on each scaled instance. have no shared data space, unless attached azure file storage (an smb share atop azure storage). local disk per-instance (and non-durable). attached drives per-instance (and durable, backed azure storage). azure web app instances have shared-disk (durable) between instances of web app. how, example, can run ghost, sqlite database shar...

menu - How to Implement Filter for search in RecyclerView Android? -

i have recyclerview , working , need implement filter search recyclerview i search in internet cannot success , want me implement filter in recyclerview code , please try me this recyclerview activity public class todolist extends appcompatactivity implements dialogfragupdatelistener { recyclerview todorecyclerview; private recyclerview.adapter todoadapter; private recyclerview.layoutmanager todolayoutmanager; public list<todo> results; public list<string> list = new arraylist<>(); todorecycleradapter recycleradapter; context context; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_todo_list); todorecyclerview = (recyclerview)findviewbyid(r.id.todorecyclerview); todorecyclerview.sethasfixedsize(true); results= new arraylist<todo>(); todolayoutmanager = new linearlayoutmanager(this...

Ruby on Rails. Creat multiple records with one form and an array -

i have form create 'gigs, works. i'm trying add feature allow users create same 'gig' multiple times, different dates. (all other attributes remain same) heres have far: (please note, have tried ton of different things, latest iteration, cannot remember past versions didn't work) _form.html.erb <div class="multiple-gigs-cont"> <% @tokens = current_user.tokens.count %> <% @tokens.times %> <%= datetime_field_tag :reo_datetime, "", :name => "reo[][datetime]" %> <% end %> </div> users have tokens, here date field gets repeated same amount of times amount of tokens user has. gigs_controller.rb def create @gig_dates = params[:reo] @gig_dates.each |datetime| @gig = gig.new gig_params @gig.date = datetime.to_s @genres = genre.where(:id => params[:choose_genres]) @gig.genres << @genres end if @gig.save bla bla bl...

.net - .NETPlatform vs .NETStandard -

i'm confused terminology around platforms in .net these days - used understand until had pcls. i found following documents: .net platform standard .net standard library for starters, first document refers conceptual platform moniker "netstandard" ".net platform standard". latter calls ".net standard" (at same time introduces new ".net standard library"). i don't why first document has disclaimer @ top second describes successor concept: seems @ least table showing version releationships newer in first document. so difference between concepts ".net platform standard" , ".net standard library"? table in second document describing allegedly new concept show old table, without new row new ".net standard library" - if concepts same after all. disclaimer suggesting renaming? nuget adds more mystery: the json.net nuget package has target called ".netstandard" (apparantly nuget uses thi...

typescript - Detect When HTML Video Ends in Angular 2 -

i'm trying detect when html video ends in ionic2 (angular2 , typescript). code snippets below: template: <video poster="" id="v" playsinline autoplay webkit-playsinline onended="vidended()"> <source src="assets/vid.mp4" type="video/mp4"> </video> component: vidended() { console.log("video ended"); this.leavepage(); } what doing wrong? in advance. in angular 2, need add - between prefix on , event name, or remove prefix on , surround event name () bind event. so, correct syntax in case 1 of these two, can use whichever prefer because both same thing: on-ended="vidended()" (ended)="viaended()" check out angular 2 binding syntax .

c# - Formatting headers for SQL statements -

i have table of baseball stats in csv file query as, select birthstate, count(playerid) [master.csv] group birthstate order count(birthstate) desc the result displayed as, birthstate expr1001 -------------------- ca 2160 pa 1417 ny 1207 il 1054 i have (imperfect) logic iterate on column names in resulting datatable (i'm using c#) fill in headers above. is there way represent header of second column count(playerid) instead of expr1001 ? thanks. if use "as" (or alias) command return computed column specified header: select birthstate, count(playerid) numberofplayers [master.csv] group birthstate order count(birthstate) desc i'm not sure if can label header "count(playerid)" way, using square brackets around name: select birthstate, count(playerid) [count(playerid)] [master.csv] group birthstate order count(birthstate) desc should treat text text rather command. ...

css - bootstrap, grid and scrolling -

Image
i'm using bootstrap, angular , angular-ui-router what want achieve mockup: where menu on left navigation bar, toolbar on top, breadcrumbs, content , footer. i can these elements in place. however, need populate content variable number of elements rest data source. want wrap these nicely, using following angular / html <div class="col-lg-12 "> <div class="row"> <div class="col-md-4 " ng-repeat-start="item in $ctrl.items"> <div> card details here </div> <div class="clearfix" ng-if="$index % 3 === 2"></div> <div ng-repeat-end=""></div> </div> </div> </div> this works, , shows data. however, there more data can fit div, scrollbars appear on window what acheive scrollbar appear in content div , screenshot i have tried sorts of css, overflow: scroll-y , can't figure out. ...

Python - Low Level USB Port Control -

i want make simple python program, controls laptop's usb hubs. nothing extra, put first usb port's data+ channel high (aka 5v) or low (aka 0 v) state. python way highlevel problem, behavior require rewrite usb driver of os.

ios - Disable "Sandbox mode" - Apple In app purchase? -

Image
so i'm doing first time. i've made test account in itunes connect test in-app purchases. works particular account, when sign in, real apple id, still message "environment: sandbox" underneath. any idea how disable this? remove account "users , roles" in "itunes connect" , add him default test flight testers.

java - set.iterator().......where am i wrong? -

trying implement set interface , use iterator union method. inside union method never enters while loop. not add elements parameter "set" union method has. ideas? :) package linkedset; import java.util.iterator; import java.util.nosuchelementexception; import linkedlist.linearnode; public class linkedset implements setadt { private int size; private linearnode<t> front; private boolean allownullelement = false; // ///////////////////////////////////////////////////// private class linkedsetiterator implements iterator<t> { private linearnode<t> currentnode; public linkedsetiterator() { currentnode = front; } @override public boolean hasnext() { return currentnode == null; } @override public t next() { if (!hasnext()) { throw new nosuchelementexception(); } t temp = currentnode.getelement(); currentnode = currentnode.getnext(); return temp; ...

tensorflow - the learning rate change for the momentum optimizer -

Image
when running existing tensorflow implementation, found learning rate keeps same between different epochs. original implementations uses tf.train.momentumoptimizer , , has decay rate setup. my understanding momentum optimizer learning rate should decrease along epochs. why learning rate keeps same training process. possible learning rate depend on performance, e.g., if performance not change quickly, learning rate keep same. think not clear underlying mechanism of momentum optimizer, , feel confused learning rate keeps same along epoch though guess should keep decreasing based on given decay rate. the optimizer defined follows learning_rate = 0.2 decay_rate = 0.95 self.learning_rate_node = tf.train.exponential_decay(learning_rate=learning_rate, global_step=global_step, decay_steps=training_iters, ...

ios - Cannot use camera on iPhone when run with Unity -

i running simple script access camera. works webcam on laptop gives me white screen when run on iphone public class cameracontroller : monobehaviour { public webcamtexture mcamera = null; public gameobject plane; // use initialization void start () { application.requestuserauthorization(userauthorization.webcam); debug.log ("script has been started"); plane = gameobject.findwithtag ("player"); mcamera = new webcamtexture (); plane.getcomponent<renderer>().material.maintexture = mcamera; mcamera.play (); } // update called once per frame void update () { } } when build , run, unity fires xcode, update info.plist asks permission access camera <key>nscamerausagedescription</key> <string>$(product_name) camera use</string> try solution (this help): http://answers.unity3d.com/questions/706142/openstart-device-camera-in-unity3d-app-us...

ruby on rails - Delete Button Not Working - Not Sure What is Wrong -

all, i tried this: <h9>thursday</h9> <% @thursday.each |chorelist| %><br> <p2><%= chorelist.name %></p2> <%= button_to "delete", chorelists_destroy_path(:id, chorelist.id) %> <% end %> it won't trick, however. as can see, trying add delete button each iteration. missing here? i'm still new rails, appreciated. addendum: received error message when using latter method: "couldn't find chorelist 'id'={:name=>"sweep floors", :day=>"sunday", :user_id=>2}" i checked console, , parameters there. class savelistcontroller < applicationcontroller before_filter :authenticate_user! def index @chorelist = chorelist.create(user_id: params[:user_id], chore_id: params[:chore_id], day: params[:day], name: params[:chore_name]) redirect_to pick_chores_path end def display @ch...

syntax error 'return' outside function in python -

i trying count word fizz using python. giving me error. def fizz_count(x): count =0 item in x : if item== "fizz": count=count+1 return count item= ["fizz","cat", "fizz", "dog", "fizz"] example= fizz_count(item) print example i checked indentation still not work. doing wrong? your indentation seems incorrect, , should not have first return count (why return count define it??). def fizz_count(x): count = 0 item in x: if item == "fizz": count += 1 # equivalent count = count + 1 return count item = ["fizz", "cat", "fizz", "dog", "fizz"] example = fizz_count(item) print example

jquery - Select2: Trim entered text and if empty - prevent sending Ajax requests -

i using select2 ajax load remote data (suggestions). everything works fine, there 1 problem: when user enters spaces (by pressing spacebar) - ajax request being sent. how can prevent this? also, trim terms before being sent. $(".js-data-example-ajax").select2({ placeholder: "select... ", minimuminputlength: 3, ajax: { url: "/my-site/tags", datatype: 'json', data: function (params) { return { q: params.term }; }, processresults: function (data) { return { results: data }; }, cache: true } edit: i forgot mention have tried this: data: function (params) { if (params.term.trim().length < 2) { return; } return { q: $.trim(params.term) }; }, and (ajax) request still sent. you can use data function check length of search term (after trim),...

c# - NuGet package solution with multiple projects -

i have solution 3 class library projects in it. i'm using dependency injection create loose coupling among these projects are: services actual functions domain repository so, ultimately, nuget package exposing functions in "services" service functions use repository methods , domain objects. should included in package. here's i'm confused: how make sure nuget package include necessary pieces in i.e. domain objects , repository methods. domain objects exposed repository methods consumed service functions they're not visible users. nevertheless, service functions need them must included in package. i'm confused tying 3 projects typically done @ top level. in other words, installing nuget package not enough dependencies need resolved. example, if add nuget package in new asp.net project, i'd have resolve these dependencies in startup.cs seems bit awkward. not sure how handle part. each project has own dependencies. example, repository p...

java - Android when fragment is removed -

i have framelayout , put there fragments click on button, next click should remove fragment framelayout, removeallviews() (framelayout in fragment translaction method in activity). need action when removeallviews() starts , have in fragment class goes wrong. i tried: ondestroy() ondestroyview() onpause() in fragment class but works like: put fragment in framelayout (from activity) use removeallviews() (from activity) there no fragment in framelayout (is clear) nothing else happens , methods not working put new fragment in framelayout (from activity) - methods ( ondestroy() fragment class) works (probably it's real time destroy old fragment) how possible 'get moment' when fragment not exists user? want send information server if user hides fragment. @edit3 code method activity want make translaction public void showproductslist(string producttype,int containerid){ list<string> prodnames = new arraylist<string>(); list...

javascript - Why when I load google maps, it does not display the location I want -

when load google map navigation specific coords, map not center display location have set. why this? , how go fixing it? my script code: functional webpage, when place google map within accordion reason location of map not work. <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta charset = "utf-8"> <title>london tour guide</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css"> <script src="jquery.js"></script> <style> div.container { position: absolute; top: 10px; left: 400px; width: 720px; height: 1300px; background-color: white; } div.content { width: 700px; height: 1200px; background-color: lightblue; padding: 5px; } h1.welcome {font-family: ver...

c++ - cmake: How to specify weak dependency for dynamically loaded shared library -

i have file a.cpp, part of shared library a, loads shared library b. want express in cmake every time built, b should built. not need "build-before" dependency: cmake should not try build b before a, because in cases cyclic dependencies prevent this. add_dependencies(a b) not possible. not want add b interface link libraries, since should not linked other libraries somewhere else. bonus points being able specify dependency on a.cpp, it's not necessary search users of file.

performance - jQuery / JS display large set of elements: show() vs append() -

<div class="snippet"> <p> 1</p> //dozens of elements here </div> <div class="snippet"> <p> 2</p> //dozens of elements here </div> .... <div class="snippet"> <p> ~200</p> //dozens of elements here </div> between 100 , 200 divs created in steps i.e 1 one (with delay) and displayed @ once in end. see 2 options: create hidden div(container) -> @ each step append div(snippet) -> div(container).show() once. store divs(snippet) without putting them in dom, @ end wrap them div(container) , append it. what pros/cons of both , there better way? code run on low-power devices. i know cost of touching dom. hope question helpfull in future.

asp.net mvc - Null value in database relation using EF code first -

i have 2 class customers , membershiptype , has structure. when creating database, column membershiptype has null value. how can fix it? public class customer { public int customerid { get; set; } [required] public string customername { get; set; } [required] public string customergender { set; get; } public byte age { set; get; } public bool issubscribedtonewsletter { set; get; } public membershiptype membershiptype{ get; set; } public byte membershiptypeid { set; get; } } public class membershiptype { [key] public byte memebershipid { set; get; } public short signupfee{ get; set; } public byte durationinmonth { set; get; } public byte discountrate { get; set; } } customers table cusid custname cusgender age issub.. membershiptypeid membershiptype_membershipid 1 jobin male 27 0 2 null migration: createtable( "dbo.customers", c => ...

ssl - Git push fail - Vultr server with nginx -

i have created virtual server vultr , pushed laravel app server using guide http://devmarketer.io/learn/deploy-laravel-5-app-lemp-stack-ubuntu-nginx/ . then added ssl certificate following guide https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04 . after adding ssl certificate, i’m not able push repo. idea what's happening? git push production master -v pushing ssh://root@--address--/var/repo/site.git ssh: connect host --address-- port 22: connection timed out fatal: not read remote repository. please make sure have correct access rights , repository exists. perhaps ssh not running on port? check ssh port in /etc/ssh/sshd_config ssh://root@ip:port/var/repo/site.git

Autoit SendMessage and Imagesearch in minimized window -

i have code send mouse actions inactive window, don't know why it's not working, , doesn't give error. include part <> removed them. in example want draw line in paint. need dll or au3 file imagesearch in minimized windows. searched whole net, couldn't find 1 works. appreciate help. include sendmessage.au3 include winapi.au3 global $whandle = "untitled - paint" controlclickdrag($whandle,"left",300,300,100,80) func controlclickdrag($whandle, $button="left", $x1="", $y1="", $x2="", $y2="") local $mk_lbutton = 0x0001 local $wm_lbuttondown = 0x0201 local $wm_lbuttonup = 0x0202 local $mk_rbutton = 0x0002 local $wm_rbuttondown = 0x0204 local $wm_rbuttonup = 0x0205 local $wm_mousemove = 0x0200 local $i = 0 select case $button = "left" $button = $mk_lbutton $buttondown = $wm_lbuttondown $buttonup = $wm_lbuttonup case $button = "right" $butt...

php - ESP8266 send GET request to remote server -

Image
http://www.universalcard.byethost7.com server. kept index.php file. code given below <?php if(isset($_get['username']) && isset($_get['pin']) && isset($_get['cost'])) { $username = $_get['username']; $pin = $_get['pin']; $cost = $_get['cost']; $filecontent = "username is: ".$username." , pin is: ".$pin." , cost is: ".$cost."\n"; $filestatus = file_put_contents('uc.txt',$filecontent,file_append); if($filestatus != false ) { echo "data written file.."; }else{ echo "ohh sorry.."; } } else { echo "something went wrong.."; } ?> and want send request esp8266 arduino ide. in request, sending 3 variables 'username' , 'pin' , 'cost' values (data type string). , these values appending file "uc.txt". when send request using browser, values append text file. but when tried send using esp8266 n...

javascript - How to find if there's a conflict between two sets of ranges of times -

i have database of schedule of classes , user wants add class. purpose of application not handle having classes during same time period. have database full of start , end times of classes in schedule , start , end times of class user wants add. need validate these times not overlap have set loop goes through each class of schedule , uses moment.js's isbetween() feature, doesn't seem work inputed start time less database start time , has other flaws can't think of @ midnight. have suggestions on how tackle this? here example of code have right now. $$.each(scheduledb({monday: true}).get(), function(index, value) { if(moment($$('#start_time'), "hh:mm").isbetween(moment(value['start_time'], "hh:mm"),moment(value['end_time'], "hh:mm"))) { $$('#error-block').show(); $$('#error-block-text').text('could not add class because time conflicted ' + value['name...

javascript - Angular JS some result doesn't show in Google Chrome but show in FireFox -

Image
i have created selectedproduct factory save data productdetailctrl , retrieve data in productorder ctrl the factory below .factory('selectedproduct',function(){ var products = {}; return{ addcategory: function(_category){ return products.category = {category: _category}; }, addselectedproduct: function(_name,_image,_quantity,_price){ return products.item = {name: _name, image: _image,quantity: _quantity,price: _price}; }, getselectedproduct: function(){ return products.item; }, getcategory:function(){ return products.category } } }) in product_detail.html, save parameter ng-click in : <img ng-src="{{product.image}}" alt="{{product.product_name}}" ng-click="selectimage((detail.image = product.image),(detail.name = product.product_name),(detail.quantity = product.quantity),(detail.price = product.price))" width="500" height="340"> in product...

run C code from C# -

is there way in can call c code c# code? i have been reading lot of microsoft docs , have tried way time being: process proc = new process(); proc.startinfo.workingdirectory = "path-to-c-code"; proc.startinfo.filename = "c-code-name"; proc.startinfo.useshellexecute = false; proc.startinfo.redirectstandardoutput = true; proc.start(); console.writeline(proc.standardoutput.readtoend()); proc.waitforexit(); but not working. this string stays null no matter proc.startinfo.filename this c code code process kill themself. #include <stdlib.h> #include <time.h> #include <stdio.h> #include <signal.h> #include <sys/types.h> #include <unistd.h> int main(int argc, char *argv[], char *env[]) { int value1; int value2; srandom(time(null)); switch (random() % 7) { case 0: exit(random() % 10); break; case 1: value1 = value1 / (value2 - value2); break; case 2: kill(getpid(), sigkill); break;...

c# - processing huge utf8 files with splitting to multiple files -

i developing importer program importing large text utf8 (character bytes different) files in c#. if load 20gb file ram, solution not suitable , possible. it's better split file multiple smaller files process. now, problem splitting file foe processing. solution reading file line line , split them if lines number suitable number. think, not fast solution read file line line splitting. splitting time high. there algorithm splitting large utf8 files multiple files without reading line line , faster. my suggestions problem below. thought keeping in mind of separation of concern, splitting of file , processing of file can separated better maintenance. read file in binary rather text do not read line line don't require reading file splitting. use seek. refer link . in case need save split-ted files complete lines, after seek position, search next end of line character , split file accordingly. once files split-ted, process files individually.

ruby - How to parse attribute and value of a tag in html file at same time with Nokogori? -

say have html file called ex.html following: <ul> <li data-value="datav1">val1</li> <li data-value="datav2">val2</li> <li data-value="datav3">val3</li> </ul> i want extract attribute data-value , text value line line , output result below: datav1:val1 datav2:val2 datav3:val3 however i'm new nokogori , know code below,which can extract attribute data-value , , don't know how extract attribute , text value in same loop. require 'nokogiri' page_temp = nokogiri::html(open("ex.html")) page_temp.xpath('//li/@data-value').each |node| puts node end i'd appreciate if can teach me how make work through nokogori , , better if there other solution using shell script. update thanks @rajarshi das , @arun kumar, answers partly solved problem. problem node.text chinese characters. , unrecognizable when print them out in terminal. tri...

xml - In XSL, how can I print only the first line in for-each block? -

i made list of books in xml. following format of xml file; there more <book> blocks, of course. <data> <book> <title>encyclopaedia britannica</title> <category>encyclopedia</category> <language>english</language> <author>encyclopaedia britannica editorial</author> <year>1768</year> <price>49.99</price> </book> </data> and want print title of expensive one. tried follows in .xsl file: <p style = "display: block;"> expensive book " <xsl:for-each select="data/book"> <xsl:sort select="price" order="descending"/> <!-- <xsl:value-of select="title"/> --> </xsl:for-each> <xsl:value-of select="data/book/title"/> " </p> when <xsl:value-of> block in <xsl:for-each...

web - Can I let my website down usign godaddy -

i create website using web builder in godaddy. want website unreachable status should not 200. is there way this? thanks in advance yes, call godaddy tech support , ask them this. they'll walk through step step. one option set domain parked page. still retain web builder creation used @ later time.

angularjs - Best way to improve android webview loading performance for SPA -

question i wonder best way make android webview perform best single page application loading. situation i have web application angularjs. currently, i'm building android application , use webview main view of one. this android application sends http request every time when users click menu on native side. sadly, webview loading slow since entire resource web application, although 1 of great benefits of single-page-application url routing function without refreshing page entirely understand correctly. below code webview loading. nothing changed set setcachemode(websettings.load_default) though. webviewfragment.java public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); string url = getarguments().getstring("url"); websettings settings = webview.getsettings(); settings.setjavascriptenabled(true); settings.setdomstorageenabled(true); settings.setallowfileaccess(true); settings.set...

malware - Disable onclick ads in Google Chrome -

the problem i'm having in video streaming sites wherever click on screen inside browser chrome redirects me different site. have ublock origin , poper blocker extensions. i've tried adblock pro. i've tested in firefox , opens new popup window. however, in chrome redirects me in same page i'm in. i've scanned computer sorts of anti-malware programs , haven't find anything. anyone experience adblock pro or ublock origins know how can block kind of new adware system? or other way can use block this? one of pages visit , happens www.divxtotal.com there others happens too. started happening recently. this screenshot of onclick code redirecting me adware pages javascript: (function() { var s = document.createelement('script'); p = ''; if (location.protocol === 'https:') { p = 's'; } s.setattribute('src', 'http' + p + '://mysite/bookmarklet.js?' + new date().getti...

angularjs - Angular replacewith in directive and mouseenter/mouseleave -

my target pretty simple. there show-overlay directive on images. if enter mouse, wrap parent span , append overlay. on mouseleave remove parent span , overlay div. reason if use replacewith on mouseleave causes fire mouseenter unexpectedly multiple times next enters. the directive below app.directive('showoverlay', function($compile) { return { restrict: 'a', link: function($scope, $element, attrs) { $element.on('mouseenter', function (e) { console.warn('mouseenter'); $el = $element.wrap("<span class='img'></div>") $el = $el.parent().append("<div ng-mouseleave='canceleditmode($event)' class='overlay'></div>"); $element.parent().addclass("hover"); var inputelem = $element.parent(); $compile(inputelem)($scope); }); $scope.can...

angularjs - Merging ui-grid data -

having 2 ui-grid, vm.grid.order , having val1 & val2 vm.grid.reorder , having val3 & val5 & val7 bind these 2 grid values vm.order vm.order = vm.grid.order; vm.order.push(vm.grid.reorder) it returns array this { [0]: "val1", [1]: "val2", [2]: ["val3", "val5", "val7"], etc } how can this { [0]: "val1", [1]: "val2", [2]: "val3", [3]: "val5", [4]: "val7" etc } use concat method: vm.order = vm.grid.order.concat(vm.grid.reorder) see https://developer.mozilla.org/en/docs/web/javascript/reference/global_objects/array/concat

javascript - Why isn't this anonymous function returning? -

i know complete purposeless code i'm experimenting anonymous functions code have written , had @ hand. can't figure out though why array isn't returning? (function() { function employee(name, age, pay) { this.name = name; this.age = age; this.pay = pay || 800; } function manager(name, age, pay) { employee.call(this, name, age, pay); this.reports = []; } manager.prototype = object.create(employee.prototype); manager.prototype.addreport = function(report) { this.reports.push(report); } function cashier(name, age, pay) { employee.call(this, name, age, pay); } cashier.prototype = object.create(employee.prototype); var ary = [cashier, manager]; return ary; }()); ...why array isn't returning? it is. you're not doing return value; see *** comment on first line: var result = (function() { // **** function employee(name, age, pay) { ...

excel - PHP export CSV UTF-8 with BOM doesn't work -

i have been stuck days on exporting utf-8 csv chinese characters shows garbled text on windows excel. using php , have added bom byte mark , tried encoding no luck @ all. they open fine on notepad++, google spreadsheet , on mac numbers. not on excel requirement client. when opening notepad++ encoding shown utf-8. if change utf-8 manually , save, file opens fine on excel. it seems though bom byte mark doesn't saved in output notepad++ detect utf-8 without bom. also, csv not saved on server. data retrieved db , exported directly out. here codes: // setup headers header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('content-description: file transfer'); header("content-type: text/csv"); header("content-disposition: filename=".$filename.".csv"); header("pragma: no-cache"); // first method $fp = fopen('php://output', 'w'); // add bom fix utf-8 in excel, doesn't work fputs($f...