Posts

javascript - Uncaught TypeError: Object has no method 'exec' -

i'm using code below , it's working good, when try use jquery @ same time, i'm getting below error, reading posts , think problem no possible extend object.prototype without checking hasownproperty(), don't know how solve that, can give me hand? code: object.prototype.clone = function () { var i, newobj = (this instanceof array) ? [] : {}; (i in this) { if (i === 'clone') { continue; } if (this[i] && typeof this[i] === "object") { newobj[i] = this[i].clone(); } else { newobj[i] = this[i]; } } return newobj; }; error: uncaught typeerror: object function () { var i, newobj = (this instanceof array) ? [] : {}; (i in this) { if (i === 'clone') { continue; } if (this[i] && typeof this[i] === "object") { newobj[i] = this[i].clone(); } else { ...

gcc - What is an innermost "if" statement and an enclosing "if"? -

Image
first, please allow me post screenshot of man page of gcc. the sentence above second bundle of demo code confuses me, written "so there no way 'else' belong enclosing 'if'." far try idea of author, innermost if statement if(b) , foo(); . intended refer if(b) when said "enclosing 'if'". if guess right, demo code should this: { if(a) { if(b) foo(); } else bar(); } am right? question turns out "enclosing 'if' " is. the "enclosing if" if in body ("inner") if "enclosed". the sentence confuses correct. paragraph states, should put parenthesis shown in second example achieve same result in first example (but without warning gcc ). if want have code suggested indentation of example 1, example correct. now sentence means is: in example 1 else clause belongs inner if , accident (when behaviour in...

r - plm: using fixef() to manually calculate fitted values for a fixed effects twoways model -

please note: trying code work both time & individual fixed effects, , unbalanced dataset. sample code below works balanced dataset. see edit below too, please i trying manually calculate fitted values of fixed effects model (with both individual , time effects) using plm package. more of exercise confirm understand mechanics of model , package, know can fitted values plm object, 2 related questions ( here , here ). from plm vignette (p.2), underlying model is: y _it = alpha + beta _transposed * x _it + ( mu _i + lambda _t + epsilon _it) where mu_i individual component of error term (a.k.a. "individual effect"), , lambda_t "time effect". the fixed effects can extracted using fixef() , thought use them (together independent variables) calculate fitted values model, using (with 2 independent variables) in way: fit _it = alpha + beta _1 * x1 + beta _2 * x2 + mu _i + lambda _t this fail -- values near fitted values (which difference bet...

python - Unknown command: 'collectstatic' Django 1.7 -

i want static files. use django 1.7 , python 2.7.5 , openshift hosting. when try run: python manage.py collectstatic i get: unknown command: 'collectstatic' type 'manage.py help' usage. in settings.py: ... installed_apps = ( 'django.contrib.staticfiles', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'testapp', ) template_context_processors = ( 'django.core.context_processors.static', ) databases = { 'default': { 'engine': 'django.db.backends.mysql', 'name': os.environ['openshift_app_name'], 'user': os.environ['openshift_mysql_db_username'], 'password': os.environ['openshift_mysql_db_password'], 'host': os.environ['openshift_mysql_db_host'], ...

html - Fiddler shows clicking link to a page sends request to another page instead -

a weird thing has been happening in asp.net website. there asp:hyperlink on aspx page navigateurl set page portal.aspx. page gets rendered correctly, link gets rendered <a href = 'portal.aspx'... the weird thing when in firefox click link supposed take me page portal.aspx, redirected page (the website's error page). checked suspected exception sending me off page , surprise, no server side code ever gets executed when link clicked. i asked fiddler going on, , seems when click link portal.aspx, firefox asking server error.aspx. anyone knows why firefox behaving way? caching responsible part of this? how tell firefox request portal.aspx , not wrong page? edit: know page there, , works fine time. there no error anywhere because no server-side code gets executed. if session expires , page displays error once, on - according fiddler - firefox won't ask for portal.aspx. clicking links sends request url 'error.aspx" server. convinced caching issue. ...

Clicked on single div of main div container, other divs of main container needs to dont work click event on them.(Jquery) -

i have 12 divs in main div container.they have different ids respectively.each div has 6 buttons. when 1st div button being clicked dont allow click on other div's button untill count equals 6. when count equal 6 next div available click. is there solution in jquery? have tried out didn't how that. thanking in advance. this question highly vague i'm guessing here, want add handler clicks main div itself. so main div has id main , assuming structure this: <div id="main"> <div> <button>a</button> <button>b</button> <!-- ...more buttons --> </div> <div> <button>a</button> <!-- ...more buttons<--> </div> <!-- ...more divs --> </div> you handle click events bubble main, like: $("#main").on("click", function (e) { var data = $(this).data("currentdiv") , btndiv = $(e.target).par...

haskell - It works when loaded from file, but not when typed into ghci. Why? -

if put following 2 lines foobar.hs f 1 = 1 f x = f (x-1) then $ ghci > :load foobar.hs > f 5 1 but if do $ ghci > let f 1 = 1 > let f x = f (x-1) > f 5 ^cinterrupted. then not return. why? the latter binding overrides former. use in ghci: prelude> :{ prelude| let f 1 = 1 prelude| f x = f (x-1) prelude| :} prelude> f 5 1 or, without layout: prelude> let f 1 = 1; f x = f (x-1) prelude> f 5 1