Posts

knockout.js - knockoutjs viewmodel not loading ajax return -

i'm new knockout , have been having trouble loading ajax json return viewmodel. i"m using knockoutjs mapping plugin. here json return: {"operator":[{"employeeid":394,"category":"mc","opfirstname":"fred", "opsurname":"penner","regnumber":"a12234","status":"ft","supervisorid":0,"team":"a", "teamgroup":"a1","issupervisor":"y"}]} here code: <table> <tbody data-bind="foreach: opviewmodel.items"> <tr> <td><ul> <li data-bind="text: opfirstname"></li> </ul> </td> </tr> </tbody> </table> <script type="text/javascript"> function opviewmodel() { var self = this; $.getjson("../controllers/getallops.php...

c# - How to get multiple dynamic row value into the database using asp.net mvc -

public void create(account_detail c, int jobcard_id) { sqlconnection con = new sqlconnection(@"data source =(localdb)\v11.0;attachdbfilename=c:\users\wattabyte inc\documents\carinfo.mdf;integrated security=true;"); sqlcommand cmd = new sqlcommand(); cmd.commandtype = commandtype.text; cmd.connection = con; con.open(); string additionaltext = string.empty; bool needcomma = false; foreach (var details in c.data) { if (needcomma) { additionaltext += ", "; } else { needcomma = true; additionaltext += "('" + jobcard_id + "','" + details.completed_by + "','" + details.reporting_time + "','" + details.cost_activity + "','" + details.spared_part_used + "')"; } cmd.commandtext = "insert child_detail values " + additionaltext + "...

tkinter - Python key pressed without Tk -

i use raspberry pi via ssh windows 7 , build robot. if press arrow, move. detect key tkinter module, needs graphic environment. if in ssh terminal, can't run. there module can detect keys , doesn't need window? i have not tried it, quick search has shown this: example github source which linux implementation of pyhook (windows only) so use it: import pyxhook import time #this function called every time key presssed def kbevent( event ): #print key info print event #if ascii value matches spacebar, terminate while loop if event.ascii == 32: global running running = false #create hookmanager hookman = pyxhook.hookmanager() #define our callback fire when key pressed down hookman.keydown = kbevent #hook keyboard hookman.hookkeyboard() #start our listener hookman.start() #create loop keep application running running = true while running: time.sleep(0.1) #close listener when done hookman.cancel()

git - How do you resolve a GitHub merge conflict that appears to have everything merged in? -

Image
the repo contributing uses forking/rebasing pattern on github. feel i'm missing concept here did not result expecting. currently, pr says can't merge because there conflict, however, there appears no commits in dev branch don't exist in mine. the steps took end here follows: created fork of repo created branch feature based on dev made changes, committed files created pull request at point, got following error appveyor message: this pull request contains merge conflicts must resolved. the recommendation "pull latest dev, rebase pr on it." so, branch did following 2 commands update upstream (aspnet) , rebase branch off of dev: git fetch aspnet git rebase aspnet/dev i expected branch contain of commits aspnet/dev, commits. instead, changes seem appear twice, other commit has appears in between them (so...there nothing left merge), have no conflicts locally , i've landed in following state: now, changes aren't huge - limited sing...

dbunit/unitils: how to export a multi-schema dataset? -

the official tutorial of dbunit give example exporting dataset single database schema. is there way export different tables different schemas 1 single dataset (say table_a schema_a, table_b schema_b)? exported dataset, when written xml file, this: <?xml version='1.0' encoding='utf-8'?> <dataset schema:schemaa schema:schemab> <schemaa:tablea ..... /> <schemaa:tablea ..... /> <schemab:tableb ..... /> </dataset> i've got same problem , fix need set feature_qualified_table_names properties: see below same example code change (i removed part of code because don't need full database export): public static void main(string[] args) throws exception { // database connection class driverclass = class.forname("com.microsoft.sqlserver.jdbc.sqlserverdriver"); connection jdbcconnection = drivermanager.getconnection( "jdbc:sqlserver://<ser...

Prime Numbers Exercise - Loop Issue C++ -

i trying solve exercise written in stroustrup's book calculating , printing if number between 1 , 100 prime number or not. my code seems work but, when prints values on screen, starts 6 , not 2. i have tried figure out why not able understand reason of that. can lend me hand? thank much! // prime numbers.cpp : definisce il punto di ingresso dell'applicazione console. // #include "stdafx.h" #include "std_lib_facilities.h" vector<int> primes = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97 }; int primecheck(int x) { (int : primes) { if (x <= primes[i]) break; if (primes[i] == x) return 1; while (x % primes[i] != 0) { --i; if (i < 0) { return 1; break; } else { if (x % primes[i] == 0) return 2; } } } } int _tmain(int a...

lotus notes - Notice API is not working -

i not able accept meeting invitation using rest web service call. facing issue, if meeting invitation rescheduled owner before accept/decline participant error code below { "code":400, "text":"bad request", "cserror":1028, "message":"error processing notice action." } rest url details http://domain:port/mail/testuser.nsf/api/calendar/notices/b2b6c5e4b1d4d3df65257e7c004192c0/action?type=accept method :- put