Posts

linear regression - Trying to get confidence/prediction intervals with `predict.lm` in R, but I keep getting an error regarding my dichotomous variable -

i have dataset looks this: time size type 1 22 151 0 2 31 92 0 3 26 175 0 4 35 31 0 5 27 104 0 6 5 277 0 7 17 210 0 8 24 120 0 9 9 290 0 10 21 238 0 11 33 164 1 12 20 272 1 13 16 295 1 14 43 68 1 15 36 85 1 16 26 224 1 17 25 166 1 18 18 305 1 19 35 124 1 20 19 246 1 my aim simple: run regression , confidence/prediction intervals. i run regression so: fit.lm1<-lm(time~size+type,data=project3) i want 95% confidence intervals , 95% prediction intervals mean time when size equal 200. want cis/pis type = 0 , type = 1. code is: new_val <- data.frame(size= c(200,200),type=c(1,0)) ci<-predict(fit.lm1,newdata=new_val,interval="confidence") pi<-predict(fit.lm1,newdata=new_val,interval="prediction") i following errors: error: variable 'type' fitted type "factor" type "numeric"...

orchardcms - change base url in local copy in Orchard CMS -

i want copy website (orchard 1.7.2.0) localhost, test things before on live site. ik copied database , de web directory , configured iis. in orchards database changed base url in settings_sitesettings2partrecord table. changed database connection in settings.txt now when enter new base url in browser redirected original url. how can prevent this? can't find other reference original url. thanks in advance answer. i found out went wrong. there rewrite in database originial url (for removing www in url). removed , works.

python - More Issues with overlapping labels in Tkinter -

i having problem tkinter. issue follows. i retrieve information database. wish print out based off few user selections. want print out columns a, b, c want print out columns, a, b, c, d want print out columns a, b, d, e also, when query, not know ahead of time how many results have. queries give 1. give 200. print them, this... while x < results.num_rows() : result = results.fetch_row() author = result[0][0] title = result[0][1] conference = result[0][2] year = result[0][3] location = result[0][4] label(root, text=title).grid(row=startrow,column=0,columnspan=5,sticky=w) label(root,text=author).grid(row=startrow,column=6,columnspan=1,sticky=w) label(root,text=year).grid(row=startrow,column=7,columnspan=1,sticky=w) label(root,text=conference).grid(row=startrow,column=8,columnspan=1,sticky=w) ...

Extract Sender IP's from emails in an Outlook (2010) Folder -

to clear, want extract sender ip's group of emails without going file | properties on every single one. there great many go through. output text file fine. i wondering if possible? perhaps there's app that! thanks time. is programming question? need extract pr_transport_message_headers property (dasl name http://schemas.microsoft.com/mapi/proptag/0x007d001f ) using mailitem.propertyaccessor.getproperty , parse data explicitly in code. ip address not guaranteed there of course.

Add an .egg to the python path in osx -

i'm working pycharm , set remote debugging pydev. ready except when want debug tells me message in pycharm console: warning: wrong debugger version. use pycharm-debugger.egg pycharm installation folder. so i'm working in virtualenv python logged on the virtualenv , set python path .egg (i copied .egg documents make easier). pythonpath="$pythonpath:./documents/pycharm-debug.egg" or pythonpath="./documents/pycharm-debug.egg:$pythonpath" this didn't work, tried other method append sys.path location of .egg didn't work either. what doing wrong? thanks in advance edit: forgot mention i'm on osx edit: ok sorry that, misunderstood. so need add path environment variable, sorry. using bash script that, this: pythonenv.sh #!/bin/bash export pythonpath="$pythonpath:./documents/pycharm-debug.egg" then call script this: source pythonenv.sh at point got env variable in shell, remember after close shell ...

python - can't seem to get an output from my class -

i can't seem figure out wrong code , why not getting out. can't seem figure out how expand rectangle. instructions: create method called expand takes offset value , returns copy of rectangle expanded offset in directions. >>> r = rectangle(30, 40, 100, 110) >>> print(r) rectangle(30, 40, 100, 110) >>> r1 = r.expand(offset=3) >>> print(r1) rectangle(27, 37, 106, 116) the original rectangle should not modified. >>> print(r) rectangle(30, 40, 100, 110) negative values should return shrunken rectangle. >>> r2 = r.expand(-5) >>> print(r2) rectangle(35, 45, 90, 100) this have far: class rectangle: def __init__(self, initx, inity, initw, inith): self.x = initx self.y = inity self.w = initw self.h = inith def __str__(self): return('rectangle(' + str(self.x) + ',' + str(self.y) + ',' ...

mysql - Android Notification: GCM or Service -

i notify (create notification) user whenever receives in-app request. i'm using mysql database php - regular stuff. whenever value of user_id_req field changes 0 1 , app should create notification. able on app start notificationmanager , checking db in real-time, meaning value changes. should use gcm handle requests or service runs in background , checks database every minute? you should absolutely use gcm this, rather polling model. it bad practice make network request every minute - lead significant battery usage. moreover, unless have service hold wake-lock (which really kill battery), device go sleep , requests stop until user wakes device again. issue unless register app wake , trigger service on boot, polling stop whenever user restarts device. it happens gcm tutorials have create service . don't let confuse you. if you're showing notification user, don't need service , simple broadcastreceiver work fine.

ColdFusion Dates before a date -

i seem have brain fart here. i'm trying show users entered in database 14 days, or more, before today's date. reason either or no one, not ones need. here have. please tell me going wrong. thank you! <cfset todaysdate = #dateformat (now(), "mm-dd-yyyy")#> <cfset checkdate = #dateformat(todaysdate-14,"mm-dd-yyyy")#> <cfquery name="getuser" datasource="dns_test"> select * login dateentered <= #checkdate# </cfquery> <cfoutput> <cfloop query="getuser"> #getuser.lastname#, #getuser.firstname# <br> <cfloop> </cfoutput> you'll want use dateadd() . example: never use select * , instead use column names... investigate using <cfqueryparam> select lastname, firstname login dateentered <= <cfqueryparam value="#dateadd( 'd', -14, now() )#" cfsqltype="cf_sql_date">

xml - XPath context is not available in linked flow -

i have 2 flows 1. main-flow.xml 2. linked-flow.xml the linked flow called using vm queue. when try use xpath expression @ main flow, working fine. however, @ linked flow, xpath not available. tried after adding mule namespace definition in both flows, still not working. i have verify, xml node, whether present or not. <root> <child1>value1</child1> <child2> <child3> <child4>value4</child4> </child3> </child2> </root> need check, if node node3 present or not. to test whether node exists or not, can use boolean logic : boolean(/root/child2/child3) or if mule namespace exists : boolean(/mule:root/mule:child2/mule:child3)

php - Get data from a ManyToMany relationship with Doctrine2 -

i have following relationship n:n between teachers table , groups table, there third teachers_groups table. i want list teachers bring me groups teacher teaches (** related **), when return of teachers, $teacher->getclasses() empty. here code: teacher controller: namespace app\controllers; class teachercontroller extends controller { public function index() { $this->teachers = $this->model->getrepository()->findall(); // bring teachers, not bring groups // $teachers->getgroups() foreach ($this->teachers $teachers) { var_dump($teachers->getgroups()); die(); } } } teacher entity: namespace app\entities; use doctrine\common\collections\arraycollection arraycollection; /** * @entity * @table(name="teachers") */ class teacher { /** * @id @column(type="integer") * @generatedvalue(strategy="auto") **/ private $id; /** * @...

The keyboard in my iOS app is too tall on the iPhone 6. How can I adjust the resolution of the keyboard in XCode? -

currently adjusting existing ios app ios 8 , iphone 6. keyboard on iphone 6 seems pretty tall (like whatsapp app before iphone 6 support update). can tell me have do, fix in code? it's not coding issue. app being rendered smaller screen sizes , scaled fit new larger screens (including keyboard). need include launch images in native resolutions iphone 6 , 6 plus if want render properly, need using auto-layout if want grow fit new screen sizes , take advantage of space. for iphone 6: 750 x 1334 (@2x) portrait 1334 x 750 (@2x) landscape for iphone 6 plus: 1242 x 2208 (@3x) portrait 2208 x 1242 (@3x) landscape or can go through link may you http://matthewpalmer.net/blog/2014/09/10/iphone-6-plus-launch-image-adaptive-mode/

Bootstrap dropdown / navbar-toggle in a Polymer Web Component -

i trying use bootstrap application based on polymer web components. based on question: bootstrap.js not working in polymer components can bootstrap working including within component's template can see shadow dom content. however, appears functionality dropdowns , navbar-toggle still not work. there workaround this? i created jsfiddle tries demonstrate this. global dropdown work if bootstrap js/css not included in polymer component's . component's dropdown partially styled correctly, not function if bootstrap js/css included in polymer component's . break functionality of global dropdown. http://jsfiddle.net/u72xk3kk/ <link rel="import" href="http://www.polymer-project.org/components/polymer/polymer.html"> <nav class="navbar-default" role="navigation"> <article class="container-fluid"> <header class="navbar-header"> <button type="button...

user agent - Regex to detect IE9 and below? -

i trying write regex pattern in java detect if user agent less or equal internet explorer 9. there quite few examples here: http://www.useragentstring.com/pages/internet%20explorer/ the main gist there string in user agent string called: "msie xxxx). current regex pattern this: msie ([1-9]|9) which seems work except there problems when msie 10.0 or msie 11.0 matches. ideas on how match 1-9 , no 10.0 or 11? in old versions, there dot after major version number, can use in regex : msie [1-9]\. another way write expect 1 number between 1 , 9 followed non number char : msie [1-9][^0-9]

asp.net mvc - Umbraco Template not rendering in content page -

Image
i'm creating content page in umbraco , have created document type , template. content page not show mark-up, shows empty page. please me. below code , description of steps: created template ubase @inherits umbraco.web.mvc.umbracotemplatepage @{ layout = null; } <!doctype html> <html class="no-js nonlegacyie" lang="en"> <!--<![endif]--> <head> </head> <body class="@viewbag.bodytagclass"> @renderbody() @rendersection("scripts", required: false) </body> </html> created document type content no custom property, uses ubase described below: next m creating content clicking content > create item under content > content. issue when publish , preview page not show anything. page behind mark-up doesn't have anything, not single tag. please have spent time still no luck :( edit: here content page properties: ...

c - How can I parse numbers from a command line argument into two arrays -

i'm trying take 2 arguments command line, char , int string of 1's , 0's of x length. want check if it's 5 1's , 0's, if i'll put them array. if it's longer 5, ten such 10011 10110; in case want parse input 2 different arrays. first digit goes a, second 1 goes b , on until have 2 arrays such = 10101, b = 01110. how can accomplish this? i've tried put(c) until eof while loop can't seem out of it. below entire program put arrays lll. #include <stdio.h> #include <stdlib.h> struct nodea { int dork; struct nodea * next; }; typedef struct nodea d1; struct nodeb { int dork; struct nodeb * next; }; typedef struct nodeb d2; struct mathop { char operation; struct mathop * next; }; typedef struct mathop dorkop; int main(int argc, char * argv[]) { char a; int b; d1 * curr = null, * head = null; dorkop * curr3 = null, * head3 = null; int = 0; int aa[8] = {0}; int ab[8] = {0}; int tempa, tempb; i...

List all items from a for loop with javascript -

i'm looking way list each firstname below loop. loops through each firstname stoping @ last jack , displaying that. want display of them like: john, jane, joe var person = [{firstname:"john"}, {firstname:"jane"}, {firstname:"jack"}]; (var = 0; < person.length; i++) { document.getelementbyid("demo").innerhtml = person[i].firstname; } can advise on how this? the problem overwriting innerhtml value, instead need append values innerhtml property using '+' : var person = [{firstname:"john"}, {firstname:"jane"}, {firstname:"jack"}]; var demo = document.getelementbyid("demo"); (var = 0, len = person.length; < len; i++) { demo.innerhtml += person[i].firstname + ' '; } check out codepen . have add modifications make code more performant.

jquery - How to scroll window to at bottom of page after ajax call -

i have jquery ajax code execute fine on success give response , display on page. after displaying response on page want window scroll @ bottom position. my jquery code $("body").scrolltop( $(document).height() - $(window).height() ); but not scroll @ bottom of page. how can achieve? help. you not need jquery this. scrollto() method scrolls document specified coordinates.: window.scrollto(0,document.body.scrollheight);

mysql - Before start of result set -

i want display data 2 tables in single jsp page. getting following error. can please explain error. java.sql.sqlexception: before start of result set @ com.mysql.jdbc.sqlerror.createsqlexception(sqlerror.java:1058) @ com.mysql.jdbc.sqlerror.createsqlexception(sqlerror.java:972) @ com.mysql.jdbc.sqlerror.createsqlexception(sqlerror.java:958) @ com.mysql.jdbc.sqlerror.createsqlexception(sqlerror.java:903) @ com.mysql.jdbc.resultsetimpl.checkrowpos(resultsetimpl.java:854) @ com.mysql.jdbc.resultsetimpl.getstringinternal(resultsetimpl.java:5772) @ com.mysql.jdbc.resultsetimpl.getstring(resultsetimpl.java:5692) @ com.mysql.jdbc.resultsetimpl.getstring(resultsetimpl.java:5732) @ jsp_servlet.__userhome._jspservice(__userhome.java:149) @ weblogic.servlet.jsp.jspbase.service(jspbase.java:35) @ weblogic.servlet.internal.stubsecurityhelper$servletserviceaction.run(stubsecurityhelper.java:280) @ weblogic.servlet.internal.stubsecurityhelper$servletserviceaction.run(stubsecurityhelper.java:2...

Node.js mongodb native driver has a "Skip" limit of 23121 -

i'm using version 1.3.23 of native mongodb native node driver: https://www.npmjs.org/package/mongodb i have query around 180k of records wrote script throttles multiple paginated requests. problem is, once skip hits on 23121 response no longer returns results. if hit db directly can return results valid skip value issue seems @ mongo driver level. do need upgrade v1.4.22 (i'm holding off unless absolutely need to)? suggestions appreciated. i suggest using cursorstream large queries , suggest upgrading @ least 1.4. http://mongodb.github.io/node-mongodb-native/1.4/api-generated/cursorstream.html

App Engine Search: How can I search multiple search indexes in parallel? -

i have lot of indexes, , slow because when query comes in user, sequentially goes through each of these results , appends results. indexes = search.get_indexes(index_name_prefix=userdomain, limit=200) domain_indexes = [index index in indexes if userdomain==str(index.name).split(":")[0] ] index in indexes: response.append(responselistitem) makes slow, question whether can farm these out , them in parallel, , afterwards coalesce results , send response user? there not yet documented features make async calls in search api, datastore: https://code.google.com/p/googleappengine/source/browse/trunk/python/google/appengine/api/search/search.py#3636