Posts

javascript - IE9 error '$'is not defined -

Image
<!--[if lte ie 9]><html class="lte9"><![endif]--><!--[if gt ie 9]><html><![endif]--> <!--[if !ie]><!--> <html> <!--<![endif]--> blah blah <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <script src="{{ asset('js/mypage.js') }}" type="text/javascript"></script> </body> </html> when load page, ie9 brings error '$' not defined . how can solve error? +++ mypage.js $(function(){ //when load page, //ie9 tag not moving. $(window).load(function() { $('div.mask').hide(); }); // when click , willshow show. //for not ie 9 if (!$('html').hasclass('lte9')) { var = $('ul.about > li > span.activebtn'); ...

git - Does reset could work against remote branch? -

i saw command git reset --hard origin/master is working via remote tracking branch. is possible reset against remote branch , not remote tracking branch? warning: these commands have power change history. use them if understand , accept risk. the command git reset --hard origin/master wouldn't have effect on remote branch if applicable; effectively, you're telling local branch move head same commit reflected in origin/master repository knows it. not touch remote branch. if git fetch wasn't run prior, do run risk of overwriting local repository older variant of remote repository, entirely fixable git fetch && git reset --hard origin/master . if wanted reset commits against remote repository, have first apply them local repository, force-push them via git push -f . note these kinds of changes respect git done local repository first; if want publish them remote repository, have invoke different commands.

how to split a dataframe to specific number of rows in if loop in R -

i writing function send emails clients in r. using mailr package so,but service provider allows me send 100 emails hour. want is, if suppose email list contains 270 email addresses,i want spilt chunk1=100 , chunk2 = 100 & chunk3 = 70 should send out emails first chunk wait hour , chunk2 , on. function looks like. email <- function(dataframe,city,date){ dataframe$registrant_email <- tolower(dataframe$registrant_email) dataframe_city <- dataframe[dataframe$registrant_city == city & dataframe$create_date == date, ] # removing na's , blank email ids dataframe_city <- dataframe_city[!(is.na(dataframe_city$registrant_email)|dataframe_city$registrant_email==""), ] # removing duplicate email ids dataframe_city <-dataframe_city[!duplicated(dataframe_city$registrant_email),] emails <- as.vector(dataframe_city$registrant_email) if(length(emails) > 100){ # divide vector chunks of 100 } else{send_email(emails} re...

java - Accesing spring boot REST service in glasfish -

did following tutorial https://spring.io/guides/gs/uploading-files/ want able deploy glassfish 4.1. problem cannot exposed rest service my application class: package de.awinta.kti.cms; import org.springframework.boot.springapplication; import org.springframework.boot.autoconfigure.springbootapplication; import org.springframework.boot.builder.springapplicationbuilder; import org.springframework.boot.web.support.springbootservletinitializer; @springbootapplication public class application extends springbootservletinitializer { public static void main(string[] args) { springapplication.run(application.class, args); } @override protected springapplicationbuilder configure(springapplicationbuilder application) { return application.sources(application.class); } } my restcontroller: @restcontroller @requestmapping("/files") public class fileuploadcontroller { //private final storageservice storageservice; @autowired ...

javascript - Sequential requests to mongodb -

i writing node.js , mongodb app. cut long story short, small social network users registering , on. problem before adding user should check whether user same name exists. how can using promises? below current version of user adding code. ... function adduser(login, password){ return mongo.connectasync()return mongoclient.connectasync(url) .then(db => { // here should test login existance // , after need pointer db // register new user }) .catch(err => { console.log('error--db_provider--addlog'); throw err; }); } ...

wpf - Moq with c# System.Windows.MessageBoxButton.YesNoCancel -

i'm writing unit tests around wpf module of program. i've come point showmessage returns yes or no value within statement. dservice.showmessage(view, args); the args takes lambda (shortened) new messageargs(arg1, arg2, arg3, (la) => { if (la.result == messresult.yes) { // } } i'm trying mock result given lambda having difficulty , have been unable find similar problem. i've tried setting default result within lambda in unit test: new messageargs(arg1, arg2, arg3, (la) => { if (la.result == messresult.yes) { la.result = messresult.yes; } } which proved unsuccessful along trying set arg result below statement as: args.result = messresult.yes; i have tried use setup as: dservicemock.setup(x => x.showmessage) but there no return property showmessage void function. none have shown change in action unit test. has else had similar "problem" , found solution or know of documentation around this? i...

How to Override "ir.sequence" field in csv import in Odoo? -

i'm trying import new customer data odoo using csv import. there 1 field customer_id_no auto generated when record created(using "ir.sequence"). now each customer record in csv has unique customer_id_no when try import it, existing customer_id_no overridden standard sequence. how can insert data csv in odoo? also unable find answer import many2one fields. on greatful. @czoellner right. have change method. : @api.model def create(self, vals): vals['customer_id_no'] = mechanics_to_generate_sequence() return super(classname, self).create(vals) it needs address case customer_id_no provided. this @api.model def create(self, vals): if not vals.get('customer_id_no'): vals['customer_id_no'] = mechanics_to_generate_sequence() return super(classname, self).create(vals) note afterward need make sequence next iteration value next highest in customer_id_no .

postgresql - SQL Multiple update record from SELECT WHERE -

i need help. i want totally quantity of material same id in bill. like this bill no. 001 jellopy x1ea jellopy x1ea jellopy x1ea zargon x1ea result should be bill no. 001 jellopy x3ea zargon x1ea so,i want this 1.select+sum 2.update 3.delete duplicate here old (dbill) table dbill id mat qty 01 a1 1 01 a1 1 01 a1 1 01 a2 1 id mat qty [01 a1 1] < same mat&id = sum [01 a1 1] < same mat&id = sum [01 a1 1] < same mat&id = sum 01 a2 1 and sqlfiddle test http://sqlfiddle.com/#!15/b30a3c 1 sum quantity same material select mat,id,sum(qty) result dbill group id,mat [2] got result this id mat qty 01 a1 3 01 a2 1 [3] so... update this update dbill set qty = result dbill t inner join (select mat,id,sum(qty) result dbill group id,mat) s on s.id = t.id , s.mat = t.mat the problem when [3] update here result id mat qty 01 a1 3 01 a1 3 01 a1 3 01 a2 3 because correct result should b...

javascript - How to prevent location change of all components after update of nodeDataArray of diagram? -

i have diagram: var $ = go.graphobject.make; var diagram = $(go.diagram, element[0], { initialcontentalignment: go.spot.topcenter, initialscale: 1, layout: $(go.layereddigraphlayout, { direction: 0 }), isreadonly: false, allowlink: true, allowclipboard: false, animationmanager.duration: 200, undomanager.isenabled: false }); i create several simple elements , add them using addnodedatacollection method diagram model. change position of elements , add 1 more nodedataarray . expect after adding of new element position of old items won't changed not true. locations of items changed , elements aligned center. correct behaviour? didn't find how prevent recalculation of locations after adding new item in nodedataarray . normally when add or remove node or link, layout performed again. in case diagram.layout happen again, moving manually adjusted node positions layout thinks should be. please read http://gojs.net/latest/intro/l...

php - Use composer on a small linux webservice -

i'm developing application using php. need use library: mgp25/instagram-api it uses composer auto load libraries can't install composer on server because company got web-service doesn't support ssh access , found in : use composer without ssh access server the best way make " vendor/autoload.php " on server/computer , upload on server, since don't have linux server , don't know how use it, want ask there can make file " vendor/autoload.php " me? possible @ all?

javascript - Need to display percentage of the individual bar in highcharts -

Image
hi need in displaying total percentage value each individual bar @ end particular bar. i'm not sure how done , start it. please give me suggestion/solution helps output. please take @ below image: $(function () { highcharts.chart('container', { chart: { type: 'bar' }, title: { text: '' }, xaxis: { categories: ['dec', 'nov', 'oct', 'sep', 'aug', 'jul', 'jun', 'may', 'apr', 'mar', 'feb', 'jan'] }, yaxis: { min: 0, //labels:{enabled: false}, title: { text: '' } }, legend: { reversed: true }, exporting: { enabled: false }, plotoptions: { series: { stacking: 'normal' } }, ...

android - Not receiving broadcast for "wifi is connected" -

i have registered broadcastreceiver in manifest. registered <action android:name="android.net.conn.connectivity_change" /> <action android:name="android.net.wifi.wifi_state_changed" /> i have registered following permissions: <uses-permission android:name="android.permission.access_wifi_state" /> <uses-permission android:name="android.permission.access_network_state"/> it fires when disable/enable wifi , when wifi disconnected after losing signal (when go away hotspot). there no broadcast when came hotspot (when wifi connected again). have testet samsung galaxy s5 (android 6.0.1). there peculiarity don't know? the code broadcastreceiver public class statusreceiver extends broadcastreceiver { @override public void onreceive(final context context, intent intent) { if(intent.getaction() != null) log.d("action", intent.getaction()); } } <receiver android:name=...

hadoop - how to use bincode operator in group function in pig -

i need group below data on fname , lastname. (fname,lname,id) abc,xyz,i abc,xyz,n ppp,xxx,i ppp,xxx,i in id field expecting 2 values i.e n or if both n , same fname,lname combination should use id n else need use value id field given in group. i expecting below results: abc,xyz,n ppp,xxx,i i have tried below code , working fine in =load '/testing/name.txt' using pigstorage(',') (fname:chararray,lname:chararray,id:chararray); grp = group in (fname,lname); z = foreach grp generate flatten(group) (fname,lname),(count(in.id) >1 ? ('n') :bagtotuple(in.id))as id; however need check values of id field instead of counts: z = foreach grp generate flatten(group) (fname,lname),((in.id == 'n' or in.id == 'i') ? ('n') :bagtotuple(in.id))as id; however giving below error: (name: equal type: null uid: null)incompatible types in equal operator left hand side:bag :tuple(id:chararray) right hand side:chararray however givi...

java - why file is not deleted inspite of using delete function? -

(int = 0; < listoftempfiles.length; i++) { (int j = 0; j < listoffaqfiles.length; j++) { if (listoftempfiles[i].isfile() && listoftempfiles[i].length() > 0) { if (listoftempfiles[i].getname().tolowercase().contains(".pdf")) { if (listoftempfiles[i].getname().substring(listoftempfiles[i].getname().lastindexof("#") + 1).equals(listoffaqfiles[j].getname())) { try { list<inputstream> list = new arraylist<inputstream>(); list.add(new fileinputstream(listoftempfiles[i])); list.add(new fileinputstream(listoffaqfiles[j])); system.out.println(listoftempfiles[i].getname() + "with faq: " + listoffaqfiles[j].getname()); int iend = list...

My android marquee java won't run -

below java function marquee: public textview setmarqueetext(string content){ textstyle = new htmlparser().parse(content); txtview = new textview(this.playercontext); txtview.setlayoutparams(new framelayout.layoutparams(layoutparams.match_parent,layoutparams.match_parent)); if (!textstyle.getfontsize().isempty()){ txtview.settextsize(typedvalue.complex_unit_px, (float)(double.parsedouble(textstyle.getfontsize()) * screenratio)); } string color = textstyle.getfontcolor(); if (!color.endswith("")){ txtview.settextcolor(color.parsecolor(color)); } txtview.setsingleline(true); txtview.setellipsize(truncateat.marquee); txtview.setmarqueerepeatlimit(-1); txtview.setgravity(gravity.bottom); txtview.setfocusable(true); txtview.sethorizontallyscrolling(true); txtview.settext(html.fromhtml(content)); txtview.setselected(true); return txtview; } i call functio...

c# - Async - Which of these is correct -

from below 2 scenario(s), 1 of them correct way of doing asynchronous programming in c#? scenario-1 public async task<t1> addsomethingasync(param) { return await someotherfunctionfromthirdpartylibraryforioasync(param); } then list<task> tasks=new list<task>(); foreach(var task in fromalltasks()) { tasks.add(addsomethingasync(task)); } await task.whenall(tasks.asparallel()); scenario-2 public async task<t1> addsomethingasync(param) { return someotherfunctionfromthirdpartylibraryforioasync(param); } then list<task> tasks=new list<task>(); foreach(var task in fromalltasks()) { tasks.add(someotherfunctionfromthirdpartylibraryforioasync(task)); } await task.whenall(tasks.asparallel()); the difference between 2 is, later not having await keyword inside addsomethingasync function. so here update - want know achieve is, tasks should executed in parallel , asynchronously. (my thinking in scenario-1, call awaited insid...

How to set an inputAccessoryView with Cordova on iOS -

i need add toolbar (for markdown tags) keyboard of cordova ios app. know it's possible swift, inputaccessoryview , i've found hiding keyboardaccessorybar in keyboard plugin cordova. is there way cordova? or maybe html/css manipulation?

single sign on - Siteminder SSO default login -

i'm new siteminder , struggling set idp server. installed policy server, admin ui , web agent (incl. option pack). web agent installed on redhat embedded apache server. after configure policy server. still don't know how can authenticated siteminder. there kind of login page? if so, what's url it?

excel - translate code from batch to vba -

i have batch file process name msmdsrv.exe , pid number using tasklist port number using netstat connection type established. at end export result file pbd_port.csv for /f "tokens=2 delims=," %%f in ('tasklist /nh /fi "imagename eq msmdsrv.exe" /fo csv') ( set var=%%f ) /f "tokens=2 delims= " %%h in ('netstat -ano ^| findstr established ^| findstr %var%') ( set var1=%%h ) echo %var1% > pbd_port.csv i use code port number of powerbi desktop , change every time when launch power bi desktop . is possible have macro in excel same thing ? instead of using batch file user has click on it, want macro give same result , write result not in csv in worksheet. edit : built code batch, wanted general advice how translate vba, comment edit : actually, on complicating things, port number stored in temporary text file generated new ssas instance, see different solution here http://community.powerbi.com/t5/desktop/connect-to...

extjs6 classic - How to do Data binding in extjs 6 -

i have json this. firstname: 'xyz', comments : [{ emailaddress : "abc@gmail.com", body : "pqr", emailaddress : "xyz@gmail.com", body : "xyz", }] i want show firstname in textfield editable. , want show comments in grid. not able understand how it. please me that. my view following: ext.define("sampleview", { extend: "ext.panel.panel", alias: 'widget.sample', id : 'samplevid', requires: ['studentviewmodel'], viewmodel: { type: 'studentviewmodel' }, layout: { type: 'vbox', align: 'stretch' }, initcomponent: function() { ext.apply(this, { items: [this.form(), this.grid()], }); this.callparent(arguments); }, grid: function(){ return { xtype: 'grid', reference: 'samplegri...