Posts

Showing posts from September, 2010

php - Function not working -

this question has answer here: reference: variable scope, variables accessible , “undefined variable” errors? 3 answers the following function not working , cannot see why. function nuevocontacto($_post) { try { include('func/usarbases.php'); $mensaje="insert `t_contactos`(`id_c`, `nombre`, `telefono`, `telefono2`, `corto`, `celular1`, `celular2`, `email`, `puesto`, `id_a`) values (null,'$_post[nombre]','$_post[tel1]','$_post[tel2]','$_post[corto]','$_post[cel1]','$_post[cel2]','$_post[email]','$_post[puesto]','$_post[id_a]')"; $hacerconsulta = $base->prepare($mensaje); $hacerconsulta->execute(); } catch( pdoexception $e) { echo "<p>error connection: " .$e->getmessage()."</p>"; }

c - understanding the protocol family argument of socket() and result list of getaddrinfo() -

i had started network programming days ago there confusion need clear. have not studied networking or tcp/ip protocol before. socket function argument: the protocol family argument socket function denote set of protocols or protocol suite used communication. is above interpretation correct? if yes, means pf/af_inet , pf/af_inet6 2 different protocol suites. right? reason creating 2 different protocol suites , not 1 tcp/ip protocol suite 2 address families? if not, protocol family denote function argument? edit : don't have enough reputation answer own question editing from unix network programming vol. 1, 3rd edition - section 4.2 socket function, sub-section - af_xxx verseus pf_xxx the " af_ " prefix stands "address family" , " pf_ " prefix stands "protocol family". historically, intent single protocol family might support multiple address families , pf_ value used create socket , af_ value used in socket addre

angular - Angular2 RC1No Directive annotation found on PropDecoratorFactory with @Input -

i'm trying pass input parameters component i'm getting exception: browser_adapter.ts:78 exception: error: uncaught (in promise): no directive annotation found on propdecoratorfactory i tried solutions described here , didn't solve issue me: here code: import {component, provide, input} '@angular/core'; import {bootstrap} '@angular/platform-browser-dynamic'; import {http, http_providers} '@angular/http'; import {routeconfig, router_directives, router, router_providers} '@angular/router-deprecated' @component({ selector: 'sub', template : `<p>input: {{someinput}}</p>`, directives: [input] }) export class subcomponent { @input() someinput: number; } @component({ selector: 'home', template : `<p>home</p><sub [someinput]="someinput"></sub>`, directives: [subcomponent] }) export class homecomponent { someinput: number = 123; } @component({ selector: '

compilation - Problems installing Python 3 with --enable-shared -

problem i'm trying install python 3 --enable-shared option. installation "succeeds" resulting python not runnable. trying run python after installation gives following error: $ /opt/python3/bin/python3.5 /opt/python3/bin/python3.5: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: no such file or directory background the os debian (squeeze), , has previous installation of python 2.6, necessary retain because other code relies on it, , apache 2.2. i'm trying set django run on apache, meaning i'm trying install mod_wsgi (or mod_wsgi-express), requires shared libraries. have tried install mod_wsgi without using --enable-shared in python installation, , have gotten... well, same thing, time mod_wsgi installer (and pip install mod_wsgi , tried): /opt/python3/bin/python3.5: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: no such file or directory . trace starting inst

c# - Serialize and Deserialize Json and Json Array in Unity -

i have list of items send php file unity using www . www.text looks [{"playerid":"1","playerloc":"powai"},{"playerid":"2","playerloc":"andheri"},{"playerid":"3","playerloc":"churchgate"}] trim [] string. when try parse using boomlagoon.json , first object retrieved. found out have deserialize() list , have imported minijson. but confused how deserialize() list. want loop through every json object , retrieve data. how can in unity using c#? the class using public class player { public string playerid { get; set; } public string playerloc { get; set; } public string playernick { get; set; } } after trimming [] able parse json using minijson. returning first keyvaluepair . idictionary<string,object> s = json.deserialize(servicedata) idictionary<string,object>; foreach (keyvaluepair<string, object> kvp in s) { debug.log

Visual Studio 2015 crashing -

recently installed vs 2015 on windows 8.1 system. keeps crashing , asks me restart/debug. if keep ide open , leave idle, crashes after time. these logs found in event viewer , couldn't figure out anything. faulting application name: devenv.exe, version: 14.0.25123.0, time stamp: 0x56f22f32 faulting module name: crystaldecisions.crystalreports_unloaded, version: 9.1.9800.0, time stamp: 0x3d802612 exception code: 0xc0000005 fault offset: 0x0001fe34 faulting process id: 0xf04 faulting application start time: 0x01d1c362423c7d96 faulting application path: c:\program files (x86)\microsoft visual studio 14.0\common7\ide\devenv.exe faulting module path: crystaldecisions.crystalreports report id: 1381257e-2f56-11e6-8282-648099c4e3f6 faulting package full name: faulting package-relative application id: faulting application name: standardcollector.service.exe, version: 14.0.25123.0, time stamp: 0x56f2261c faulting module name: ntdll.dll, version: 6.3.9600.1

Android read data from php file -

i have application read data php file. try search in google how read data php , replace in textview when try make code nothing show in application. my php code: <?php $serverip = "127.0.0.1"; // server ip public $portzone = "27780"; // zoneserver port $portlogin = "10007"; // zoneserver port $file = file ("e:\server\zoneserver\systemsave\serverdisplay.ini"); foreach($file $line) { if(strspn($line, "[") != 1) parse_str($line); } $response["online"] = array(); $product["total online"] = $usernum; $product["acc online"] = $a_num; $product["bcc online"] = $b_num; $product["ccc online"] = $c_num; // push single product final response array array_push($response["online"], $product); // success $response["success"] = 1; echo json_encode($response); ?> my code android toolbar toolbar; textview onlineplayer; // progress dialog private progressdia

go - Golang Float64bits -

i'm trying understand go sqrt implementation , can't quite comprehend going on float64bits function. have test code , output below. why value of ix change drastically operation? package main import ("math" "fmt") func main() { var x float64 = 4 fmt.printf("the value of x is: %v \n", x) ix := math.float64bits(x) fmt.printf("the value of ix is: %v \n", ix) fmt.printf("the type of ix is: %t \n", ix) } value of x is: 4 value of ix is: 4616189618054758400 type of ix is: uint64 from documentation, converts float64 uint64 without changing bits, it's way bits interpreted change. here full source code of float64bits function: func float64bits(f float64) uint64 { return *(*uint64)(unsafe.pointer(&f)) } don't scared syntax trick of using unsafe pointer, it's quite common in go's source code (avoids copying data). so, simple: take binary data of given float

silverstripe - How to add custom item to left CMS menu and manage model and extra fields? Similar to ModelAdmin? -

Image
is possible have model admin type setup, there tab on left menu e.g staff members , , on right instead of displaying grid , managing model, want have fields sit above grid , able save data them... essentially working same how on page, instead in own tab on sidebar etc? picture of trying achieve (photoshopped) is possible? yes can. you'll have create own subclass of leftandmain , implement form overriding geteditform . say named new leftandmain subclass staffadmin , can add cms menu adding _config.php file: cmsmenu::add_menu_item('staffadmin', 'staff admin', 'staffadmin', 'staffadmin');

c - Using inet_ntop from libevent -

i implement echo server given in libevent book . i modify accept_conn_cb function server prints ipv4 address of newly created connection (in decimal dot notation). following callback static void accept_conn_cb( struct evconnlistener *listener, evutil_socket_t fd, struct sockaddr *address, int socklen, void *ctx) { char ipaddress[inet_addrstrlen]; struct sockaddr_in * saddr_in = (struct sockaddr_in *) &address; if (!inet_ntop(af_inet, &(saddr_in->sin_addr), ipaddress, inet_addrstrlen)) puts("couldn't retrieve ipv4 address"); printf("a new connection established %s\n", ipaddress); /* ... */ when compile , run it prints follwoing strange addresses: a new connection established 252.127.0.0 or a new connection established 253.127.0.0 or a new connection established 255.127.0.0 no matter machine connect. use telnet testing connections. i have written version of echo server written in pure c (withou

swift2 - Swift iOS UI Advice -

Image
i looking general advice , maybe example code of trying accomplish if knows of ios swift project. either: a) make background, of blue view, gray , show percent of blue area. or b) overlay gray area on top of blue view , keep making gray area bigger. what trying simulate battery power , show battery. i've considered using progress bar , doing option a, blue area not solid color. image. i've tried using image progress bar, image needs keep dimensions. (ex: if progress shows 20% needs show 20% of image or "blue area", if use image progress bar shrinks image , still shows 100% of instead of 20% need show). you can write custom self-drawing uiview behave in way describe. in other words, tell uiview percentage, , redraws blue on left , gray on right. can draw darker gray stroke outline shown in drawings. accomplished in code.

vb.net - VB Delete Files That Match List -

okay, i'm creating small , simple program manage files in given directory. program has multiple settings, removes files depending upon settings. have 2 hurdles no doubt easy more experienced coders... firstly, how create list containing file names? , how compare files sequentially in given directory list? ideally want code generate pre-decided list of file names multiple lists. example: list1 - filename1.png filename2.png lst 2 - filename3.png filename4.png here's code far... dim path string = "c:\samplefolder\" 'check if files match file names in list if delete each file in path if filename = list1 'delete file else 'do nothing file. end if next basically how go building list can compare file names can remove file if matches list? the best way create list use list class. can use for each loop process each item in list. can use io.file.exists check if file exists , io

select - sql check for no result in group by clause -

i have sql query mysql select sum(quantity), hour(posted) orders posted between '05-10-2014' , '05-10-2014' // timestamp here group hour(posted) result may sum, hour 10, 0 12, 1 13, 3 // note 2 missing in hours 13, 5 // note hour 4 missing what need sum,hour 10,0 12,1 0, 2 // 0 missing hour ( no record found in hour) 13,3 0, 4 // 0 missing hour ( no record found in hour) 13,5 how can it?? appreciated if using sqlserver can use following tsql query desired results: with [hours] ( select distinct hour = number master..[spt_values] number between 1 , 24 ) select isnull(sum(orders.quantity),0) quantity, [hours].[hour] hours left join orders on hours.hour = datepart(hour,posted) group [hours].[hour]

Computercraft Lua code not working as expected -

i quite new lua feel have decent grasp on basics. in computercraft, tried design own monitor display whether or not reactors on or not. came with: function screen() monitor = peripheral.wrap("top") monitor.clear() monitor.setcursorpos(1,1) monitor.settextcolor(colors.white) monitor.write("reactor 1: ") monitor.setcursorpos(1,3) monitor.write("reactor 2: ") monitor.setcursorpos(1,5) monitor.write("reactor 3: ") monitor.setcursorpos(1,7) monitor.write("reactor 4: ") monitor.setcursorpos(1,9) monitor.write("reactor 5: ") monitor.setcursorpos(1,11) monitor.write("reactor 6: ") end function test(color,cursor1,cursor2) while true if colors.test(rs.getbundledinput("right"), color) == true monitor.setcursorpos(cursor1,cursor2) monitor.settextcolor(colors.green) monitor.write("active ") elseif colors.test(rs.getbundledinput("right"), color) ==

parallel processing - How to limit number of unprocessed Futures in Scala? -

i cannot fund if there way limit number of unprocessed futures in scala. example in following code: import executioncontext.implicits.global (i <- 1 n) { val f = future { //some work bunch of object creation } } if n big, throw oom. there way limit number of unprocessed futures ether queue-like wait or exception? so, simplest answer can create executioncontext blocks or throttles execution of new tasks beyond limit. see this blog post . more fleshed out example of blocking java executorservice , here an example . [you can use directly if want, library on maven central here .] wraps nonblocking executorservice , can create using factory methods of java.util.concurrent.executors . to convert java executorservice scala executioncontext executioncontext.fromexecutorservice( executorservice ) . so, using library linked above, might have code like... import java.util.concurrent.{executioncontext,executors} import com.mchange.v3.concurrent.boundedexecu

php - Codeigniter database delete and insert multiple records -

i have problem different this , this . in model class had separate delete , save 2 different functions follows. #save advanced preferences function savepreference($preferences){ $this->db->insert('bingo_advanced_preferences', $preferences); echo $this->db->last_query(); } #delete advanced preferences function deletepreference($user_id,$criteria){ return $this->db->delete('bingo_advanced_preferences', array('bingo_user_id' => $user_id,'adv_criteria' =>$criteria)); } if call these functions controller delete, update works. //language preferences if($this->input->post('language') && count($this->input->post('language')) > 0): $this->bingo_advanced_preferences->deletepreference($user,'15'); ($i=0; $i < count($this->input->post('language')); $i++) { $language_options =

java - How can you implement LFU cache using simplest and minimum data structures.? -

this question has answer here: what difference between lru , lfu 3 answers i asked question in interview asked first difference between lru , lfu , asked implement both. knew lru can implemented through linkedhashmap got confused lfu. can tell me how implement simplest data structures explaination? can implemented linkedhashmap too.? assuming cache entries keyed, queue ( linkedlist ) , map ( hashmap ). (assume queue , map full) pick bound b queue. on every cache request, push key requested page queue poll queue. if page want in map, return page. if page isn't in map find least occurring key in queue in map or key page want. if key key page want, nothing; else remove entry map key , insert page map. return page. complexity cache hit o(1), o(b) miss. assumes want bound frequency. ie. "least used in last b requests" instead of "le

unity3d - Animation is not looping -

Image
im using unity 5.3.4 , made animation clips in native animation panel of unity, using keyframes. in animator, related clips transitions. set "idle" entry clip , y checked "loop time" on it's properties. nevertheless, when hit play, animation not looping. play once , goes "jump" clip. keeps rotation between "jump" , "hit". here's how things done: you should control animation behaviour conditions example if want loop till happened should first add parameter use checking if happened then use in conditions tab example can make bool parameter use in condition when checked move next state till loop in current state , if put no condition there nothing stopping state machine going next state animation transitions another tutorial

android - How to add a notification to a MediaPlayer Service? -

i have working mediaplayer app. mainactivity (mylistactivity.java) binds service (mediaservice.java). service plays music in background. i know way add notification user can control tracks through it. using interface pass data service activity. i have no clue start. tried notifications tutorial on android documentation , don't know how add buttons , cannot find decent tutorial remoteviews . this have notification. mediaservice.java play(track track) { ... shownotification(track); } shownoticiation(track track){ notificationcompat.builder builder = new notificationcompat.builder(this) .setsmallicon(r.mipmap.dj_plink_avatar) .setcontenttitle(track.gettitle()) .setcontenttext(track.getgenre()); intent resultintent = new intent(this, mylistactivity.class); taskstackbuilder stackbuilder = taskstackbuilder.create(this); stackbuilder.addparentstack(mylistactivity

c++ - Named Pipe server can't get the pipe handle state -

i'm working on application acts server named pipe. application solely designed send data out client (not written me), needs informed of when pipe broken. idea task use getnamedpipehandlestate() retrieve number of instances of pipe , see if pipe still resident in system. if no longer connected, program designed reset pipe client can reconnect , resume pulling data application. unfortunately, can't retrieve number of instances of pipe. whenever call made, function fails getlasterror() returning error_access_denied . however, occurs if attempt call follows: getnamedpipehandlestatea(pipe,0,&npipeinstances,0,0,0,0); if call function this: getnamedpipehandlestatea(pipe,0,0,0,0,0,0); no errors occur, don't receive state information. there creation parameter missing, or better way check information? the creation code pipe follows: pipe=createnamedpipea(pipename, // name of pipe pipe_access_outbound, // read/write access

arrays - How to set dynamic limit in ng-repeat angular js -

how set dynamic limit in ng-repeat ? want set limit if window width less 750 px set limit 1. here controller function: $scope.$watch('window.innerwidth', function() { $scope.wsizewindow = window.innerwidth; if($scope.wsizewindow < 750) { $scope.limit = 0; } else { } console.log($scope.wsizewindow); }); here html: <flex-slider slider-id="" flex-slide="responsibilities in roles.responsibilities track $index | limitto: limit" animation="slide" animation-loop="false" item-width="350" item-margin="1" keyboard="false" as-nav-for="#slider" slideshow="false" control-nav="false"> <li class="col-sm-3" ng-if="responsibilities.responsibilityname!=''"> <div class="new-box" ng-if="$index!=roles.responsibilities.length-1">

objective c - it is possible to use UIImagePickerController in landscape mode in iOS? -

my application in landscape mode , want open gallery , select video getting error. there way use uiimagepickercontroller in landscape mode or other alternative way? - (nsuinteger)supportedinterfaceorientations{ return uiinterfaceorientationmasklandscape; } this should work. if app allows portrait. have work in app delegate. need set boolean property, call restrictrotation. include appdelegate.h in class , set restrictrotation true when need rotate it -(nsuinteger)application:(uiapplication *)application supportedinterfaceorientationsforwindow:(uiwindow *)window { if(self.restrictrotation) return uiinterfaceorientationmaskportrait; else return uiinterfaceorientationmaskall; } then in class - (void) orientationchanged:(nsnotification *)note { uidevice * device = note.object; switch(device.orientation) { case uideviceorientationportrait: //do stuff break; case uideviceorientationlandscapeleft: //do stuff break; case

unix - Read Contents of file inside xar file using the command line -

i trying read contents of file inside xar file without extracting them using command line. when run command, xar -tf filename.xar | grep -i 'info' it list file after. but when try read contents of file using, cat `xar -tf filename.xar | grep -i 'info'` i error message saying cat: filename: no such file or directory you on right track problem using cat try , read file hasn't been extracted archive. need extract archive first before can read contents. use code extracts file reads 'info' file: xar -xf filename.xar; cat `xar -tf filename.xar | grep -i 'info'` hope helps :d (u add code @ end delete added extracted files)

Delete XML Child Node Element in SQL Server 2008 -

i have xml, want insert temp table including values inside <salesorpurchase> node in single row. possible? or can tell me how remove <salesorpurchase> without removing inner text`? <itemserviceret> <listid>80000012-1302270176</listid> <editsequence>1302270195</editsequence> <name>2nd floor shop</name> <fullname>2nd floor shop</fullname> <isactive>true</isactive> <salesorpurchase> <price>0.00</price> <accountref> <listid>800000b3-1302260225</listid> <fullname>rent income:rent income 2nd fl:2nd floor shops</fullname> </accountref> </salesorpurchase> </itemserviceret> <itemserviceret> <listid>80000002-1277187768</listid> <editsequence>1463398389</editsequence> <name>vat 16%</name> <fullname>

javascript - Ionic push notification Application -

i working on ionic project have implement push notification practically have no idea again app going used in corporate environment . kindly suggest. hello rigel, first of have install 4 plugins that. 1)cordova plugin add https://github.com/phonegap-build/pushplugin // notification 2)cordova plugin add cordova-plugin-device // on device ready call 3)cordova plugin add cordova-plugin-dialogs // notification dialog 4)cordova plugin add cordova-plugin-media // notification sound and generate api key , senderid throw developer console.and senderid past in bellow code. , e.regid pass on server. <script type="text/javascript" src="pushnotification.js"></script> <script type="text/javascript"> var pushnotification; function ondeviceready() { $("#app-status-ul").append('<li>deviceready event received</li>'); document.addeven

java - How to add check for string in do while -

scanner in = new scanner(system.in); int menuitem; do{ system.out.println("choose menu item 1,2,3,4,5: "); menuitem = in.nextint(); }while(menuitem >5); //i tried use //while(menuitem >5 || !in.hasnextint());---> doesnt work it shows exception in thread "main" java.util.inputmismatchexception in code want validate menu item not string type , not more 5 , repeat choose item menu if input not string type , not more 5 but don't know how validate input if string. as answer given Φxoce 웃 Пepeúpa, outer while loop run infinitely if user enters no greater 5. please try this: 1. validate number if string , asked user enter valid number 2.and repeat chhose menu item if correct. package sample; import java.util.arraylist; import java.util.scanner; public class tets { public static void main(string[] args) { scanner in = new scanner(system.in); int menuitem = 0; { system.out

javascript - Strange AngularJS beginner behavior -

i starting learning angularjs i've stumbled across strange behavior can't quite understand (() => {}) notation not equivalent (function(){}). my index.html: <!doctype html> <html ng-app="gemstore"> <head> <title>angularjs store</title> <script src="./angular.min.js"></script> <script src="./app.js"></script> </head> <body> <div ng-controller="storecontroller store"> <h1>{{store.product.name}}</h1> <h2>${{store.product.price}}</h2> <p>{{store.product.description}}</p> </div> </body> </html> my app.js (closure stripped debugging). var app = angular.module('gemstore', []); app.controller("storecontroller", function() { this.product = gem; }); var gem = { name: 'dodecahedron', price: 2.95, description: '. . .

javascript - Calling functions from within functions JS -

i'm writing small battleships game, , i'm refactoring code using javascript objects, tool not familiar with. able call function within function using objects, , cannot seem work out how this. code here: <script> var xpos; var ypos; var boatgrid = { selectpos : function() { console.log("it works"); //want try calling function addnumber() here (boatnum = 1; boatnum < 4; boatnum++) { xpos = math.floor(math.random() * 8); ypos = math.floor(math.random() * 10 + 1); } }, buildboat : function() { console.log("this works too"); (boatlen = 1; boatlen < 4; boatlen++) { xpos = xpos++; boatpos = "cell_" + xpos + "_" + ypos; } }, addnumber : function() { document.getelementbyid("test2").innerhtml = "hello"; //debug line } } the addnum() function there debug. you there. in

proj4 - Only one command line in PROJ.4 -

i know if there way write 1 command line obtain expected results. explain: when write : $ proj +proj=utm +zone=13 +ellps=wgs84 -f %12.6f if want recieved output data: 500000.000000 4427757.218739 you must write in line input data: -105 40 is possible write concatenated command line stile?: $ proj +proj=utm +zone=13 +ellps=wgs84 -f %12.6f | -105 40 thank you i ran problem , found solution: echo -105 40 | proj +proj=utm +zone=13 +ellps=wgs84 -f %12.6f that should trick. if need e.g. within c#, command you'd use this: cmd.exe /c echo -105 40 | proj +proj=utm +zone=13 +ellps=wgs84 -f %12.6f note: may need double % command processor interprets variable.

Why does rspec-puppet not find my class? -

i've created puppet module install aws cloudwatch monitoring scripts , set them up. puppet module available here . when run rake spec , test suite fails with: rspec ./spec/classes/init_spec.rb:4 # cloudwatch default values parameters should contain class[cloudwatch] i cannot life of me work out why test failing. how fix it? i've tried creating .fixtures/yml in root of repo following content: fixtures: symlinks: cloudwatch: "../../../../manifests" fixtures: symlinks: cloudwatch: "#{source_dir}" but no dice. i've tried using symlink link manifests directory: https://github.com/masterroot24/puppet-cloudwatch/commit/932970aab085984f2cda44fba841c3bde20f7a2b your initial problem you're missing .fixtures.yml file, needs following content: fixtures: symlinks: cloudwatch: "#{source_dir}" as documented in puppetlabs_spec_helper readme . additional changes required test pass can seen in pr raised h

javascript - Sails.js - how to save only model's fields into database? -

let's have model defined: module.exports = { attributes: { username: { type: 'string', required: true, unique: true } } } then create object save database: var obj = { username: 'blabla', score: 100, whatever: 'else' } model.create(obj).then(...); the additional fields persisted database. question - how save fields defined in model? in case - username, when trying save 3 fields. i used like: model.create({username: obj.username}).then(...); but wonder if there way without having map every field explicitly, because it's not easy maintain, , model kinda loses purpose. try this: schema: true link doc: http://sailsjs.org/documentation/concepts/models-and-orm/model-settings#?schema

mysql - Get specific field from a table with moodle Data manipulation API -

Image
i want select records moodle data base id equal variable.can tell me moodle data manipulation api syntax it. here mysql query select question mdl_answers id=$questionid; i have tried $queid[]= $queid[] = $db->get_field('question_answers', 'id', array('question' => $questionid), must_exist); $true=$queid[0]; // $false=$queid[1]; //this remains empty but gives 1 record whereas have more 1 records assosiated id. as can see in picture record 71 , 72 have same value 48 in next column want these ids 71 , 72 get_field() return single value. either use get_records() - https://docs.moodle.org/dev/data_manipulation_api#getting_an_hashed_array_of_records $answers = $db->get_records('question_answers', array('question' => $questionid)); foreach ($answers $answer) { switch ($answer->answer) { case 'true': $true = $answer->id; break; case 'false':

mysql - Socket.io and Phalcon PHP -

i'm using phalcon php , want try socket.io first time. did tutorial chat message socket.io. want select data in database count number of rows in table 'product' query phalcon : $count_products = product::count(); for example in html page have 5 products , when i'll add 1 product or more table product want auto refresh see 6 products in html page. could me ? once using sockets on ajax requests, should keep phalcon , try implement simple tool using node.js + socket.io . simplest approach create in node event forwarder listen on events on 1 side, , forward them users browser. more described here . in case recommend add phalcon model aftersave listener described in documentation . during aftersave method able pass eg. udp packet node service information, there new records in x table. than node service should forward event clients' browsers, javascript should decide, if x table being viewed current user. if is, should lock view prevent acti