Posts

AngularJS Events vs Watches -

what happens inside angularjs when event fired angular internal event system? from performance point of view, should tend use watches or events update parts in application? when js event fired, typically handled in same way js events handled - there nothing special or unique this. however, angular wrap handler inside of $apply block after executes function, can trigger digest cycle: $scope.$apply(function(){ $element.on('click',function(e){ ... }); }) a digest cycle iterates on scope variables, compares each 1 previous value determine if has changed, , if has, corresponding $watch handlers called update view. since using angular, set $watch expressions when want detect model on scope has changed, , dom manipulations inside $watch handler. if concerned performance, make sure $watch function optimized (i.e. avoid full jquery, avoid expensive query selectors, minimize dom manipulation etc.) to answer question, should use $watches moni...

.net - adding value together with the existing value in database -

i developing application , want update information , add value of quantity in existing database new value enter user. it's updating instead of adding quantity it's putting new value @ d of existing value in database e.g if have 5 in database before , 3 in new textbox instead of new value 8, it's showing 35 in database. code, how can adding value con = new oledbconnection("provider=microsoft.jet.oledb.4.0; data source=" & application.startuppath & "\pharmacy.mdb") con.open() dim ct1 string = "select * stock code= '" & txtcode.text & "'" cmd = new oledbcommand(ct1) cmd.connection = con rdr = cmd.executereader() if rdr.read con = new oledbconnection("provider=microsoft.jet.oledb.4.0; data source=" & application.startuppath & "\pharmacy.mdb") con.open() dim cb string = ...

sql server - Multiple drop menus with one PHP script -

website has several pages forms. many of have drop menus. write 1 php script populate multiple drop menus. i'm including code have far, don't think i'm on right track here. order.php <?php include 'functionsfile.php'; ?> <form method="post" action="order.php"> <select name="order_status" id="order_status"> <?php foreach ($data $row): ?> <option><?=$row["order_status"]?></option> <?php endforeach ?> </select> <!-- 3 more drop menus --> </form> <?php $table = array('order_status', 'customer', 'warehouse_id', 'order_description'); fillform($conn, $table); ?> functionsfile.php <?php require 'databaseconnection.php'; function fillform($conn, $table) { foreach ($table $menu) { $query = 'select * $table'; $smt ...

java - Why tomcat is not running in user account of window 7? -

i have installed netbean ide8.0 , tomcat (by customize option in netbean during installation) in administration account of window7. when running project in netbean ok . when running same project in same netbean, in window user account, asking tomcat user id , password, while have not setted user id tomcat. can 1 me, how resolve problem. in advance. go tomcat-users.xml in conf directory of tomcat installation , edit username , password accordingly. can learn userdatabaserealm in tomcat 7 here note : netbeans might have set credetials tomcat during installation

c# - Update Panel AsyncPostBack and PostBack triggers -

i have page in of html generated client side script (jquery). added server side asp.net file control upload files server. now files getting uploaded on button click, causes postback , textboxes company name, street name, city client etc lost, generated jquery. i put upload portion in updatepanel , registered asyncpostback trigger, not getting httpcontext object @ code-behind. turned async full postback using postbacktrigger things became same before(i.e. without update panel). now have 2 questions people: - use of update panel if behaves in same way page without update panel. (postbacktrigger) - should above problem? code: <asp:updatepanel id="uploadupdatepanel" runat="server"> <contenttemplate> <input id="filefield" type="file" runat="server" multiple="multiple" /> <asp:button id="uploadbutton" runat="server" text=...

c# - Implementation of Dependency injection -

i working on web api project. calling repository responsible database interaction. repository interacts third party data source. i want implement dependency injection (di) repository layer inject dependency of third party data source,but how can achieve since there no interfaces in third party dll? i use unity framework. the third party dll includes 1 class: using system; using system.collections.generic; namespace movieslibrary { public class moviedatasource { public moviedatasource(); public int create(moviedata movie); public list<moviedata> getalldata(); public moviedata getdatabyid(int id); public void update(moviedata movie); } } how 3rd party component relate repository? standalone service that's internally used repository? if so, sounds 3rd party component dependency should abstracted. you creating interface of own reflects business operations intend perform, , service implement. might mat...

java - Creating OrderColumn for OneToMany list mapping on a join table in Hibernate -

i have productjob table , quadrat table. every quadrat can installed on many productjob , every productjob can have between 1 , 4 quadrats of same or different kinds! i'm interested keep order of quadrat installation on product jobs. example first, second, third or forth place! following mapping doesn't create order column on jointable telai_quadrati . problem of mapping? ordercolumn isn't created in anyway! @entity @table(name = "telai") public class productjob implements iproductjob, iproductjobprocessing{ @embedded private quadratgroup quadrategroup = new quadratgroup(); } @embeddable public class quadratgroup implements serializable{ @onetomany(targetentity = quadrat.class, cascade = cascadetype.all) @jointable( name = "telai_quadrati", joincolumns = {@joincolumn(name = "dbid", table = "telai")}, inversejoincolumns = {@joincolumn(name = "id", table = "quadrati...