Posts

Featured post

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 .