Posts

why is meteor Tracker.autorun() detects mongodb changes with a delay, if the collection was modified outside of the meteor application -

a scenario: in local meteor (v 1.2.1) development environment (webstorm), autopublish, , insecure enabled, have single mongodbdb (v 3.0.4) collection 'letters'. wish respond documents being added, removed, or modified in collection. for purpose, have following autorun function: template.diagram.rendered = function(){ tracker.autorun(function () { letters.find({}).observe({ added: function(document) { console.log('a new document has been added'); }, changed: function(newdocument) { console.log('a document has been changed'); }, removed: function(document) { console.log('a document has been removed'); } }); }) } when new document added within same application, can see console messages right away (meteor latency compensation). however, when connect same mongodb database using external tool (robomongo), , add,...

asp.net - Why I can't get selected file on server side? -

i have asp code: <asp:panel runat="server"> <div class="row2"> <input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" id="fileselect" name="fileselect" runat="server" /> <asp:button id="btnupload" runat="server" text="load" onclick="btnupload_click2" causesvalidation="false" /> </div> </asp:panel> here generated html code on browser: <div class="row2"> <input name="ctl00$contentplace$fileselect" type="file" id="ctl00_contentplace_fileselect" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"> <input type="submit" name="ctl00$con...

python - Function breaks all code that come after it -

i've started working on small game. i've created function breaks code follows it. here's full function: def printboard(currentboard): #prints out game board x in range(5): #prints out 50 character line x print (' '.join(str(currentboard[x*50:(x+1)*50])) although still works this: def printboard(currentboard): print (' '.join(str(currentboard[x*50:(x+1)*50])) even things like: print("hello") won't work after it. i've tried switching around variable names , such error error still remains. looks missing closing ")"

How do I import the Spark Knowledge Modules in Oracle Data Integrator 12c? -

i need change default lkm file spark knowledge module in odi 12c. unfortunately, when try import /.../odi/sdk/xml-reference/component_kms/spark_python , nothing appears in list of knowledge modules import. knowledge modules appear (though wrong ones) when @ /.../odi/sdk/xml-reference/ . looking @ structure of spark km xmls, appears different regular kms. does know if there way import these modules make possible copy/change them? components km can not imported / duplicated / modified / deleted. while template-based kms template of code can edit , fine-tune, components kms based on java libraries , act more black boxes. can't create own component km. editor component kms might available in future though. if have change in spark km, guess solution create new template-based km spark.

asp.net mvc - MVC drop down list is not picking up selected item? -

my model contains array of zip code items ( ienumerable<selectlistitem> ). contains array of selected zip codes ( string[] ). in html page, want render each selected zip code drop down zip code options. first attempt did not work: @foreach (var zip in model.zipcodes) { html.dropdownlist( "zipcodes", model.zipcodeoptions ) } i realized although produce drop downs right "name" attribute, wouldn't know element of zipcodes holds value particular box, , might default first one. my second attempt surprised me. explicitly set proper selectlistitem's selected property true, , still rendered control nothing selected: @foreach (var zip in model.zipcodes) { html.dropdownlist( "zipcodes", model.zipcodeoptions.select( x => (x.value == zip) ? new selectlistitem() { value = x.value, text = x.text, selected = true } : x ) ) } there, it's returning new ienumerable<selectlistitem> contains original items, unless it's...

php - How to add sql data to table but not override it? -

i creating webapp people can add data. ex: have first name , last name. want update user's account, not want delete user's old data (old_name, old_lastname, old_email, etc). instead want keep user's old data , create new record. need access them show old names used. from found need add time stamp, can not find example. if show me code add current page me lot. once able add records instead of updating them add lot more fields. here account page : <?php include 'header.php'; session_start(); //kick none users off page if(isset($_session["userid"])) { } else { header('location:login.php'); } //display user info $user = $_session[userid]; $results = $con->query("select * users userid='$user'"); $row = $results->fetch_array(mysqli_both); session_start(); $_session["firstname"] = $row['firstname']; $_session["lastname...

Why Chrome on Linux shows "External protocol request" dialog for unknown protocol? -

Image
i creating custom protocol handler google chrome on linux. link looks this: <a href="myprotocol:someargument">trigger app param</a> i have noticed if 'myprotocol:' not registered (my app not installed), google chrome on linux displays "external protocol request" dialog , tries use xdg-open: while on other os, such windows 10 , os x el capitan nothing displayed if protocol not registered. i have verified firefox works consistently unknown protocols on windows, os x , linux - nothing displayed. chrome behavior on linux quite confusing users. any idea why chrome on linux (i testing on ubuntu 14.04) acts differently other os , web browsers? the issue if chrome lacks local protocol handler wants use handler configured in user's environment. no 2 oses provide same api launch default handler. figuring out program before launching not clear api on windows or linux. both "mac" , windows implementations end knowin...