Search Results

Search found 7898 results on 316 pages for 'underscore js'.

Page 19/316 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • How should backbone.js handle a GET request that returns no results?

    - by Nyxynyx
    I have a number of text input elements that when its values are changed, will trigger a fetch on listingListView's collection listingCollection, which then updates listingListView with the new data via the function listingListView.refreshList as shown below. I am using PHP/Codeigniter to expose a RESTful API. Problem: Everything works fine if there are results retrieved from the fetch(). However, when the filters results in no result being returned, how should the server side and the client side handle it? Currently Chrome's javascript console displays a 404 error and in the Network tab, the XHR request is highlighted in red. All I want to do in the event of zero results returned, is to blank the listingListView and show a message like (No results returned) and not throw any errors in the javascript console. Thanks! PHP Code function listings_get() { // Get filters $price_min = $this->get('price_min'); $this->load->model('app_model'); $results = $this->app_model->get_listings($price_min); if($results) $this->response($results); else $this->response(NULL); } JS Code window.ListingListView = Backbone.View.extend({ tagName: 'table', initialize: function() { this.model.bind('reset', this.refreshList, this); this.model.bind('add', function(listing) { $(this.el).append(new ListingListItemView({ model: listing }).render().el); }, this); }, render: function() { _.each(this.model.models, function(listing) { $(this.el).append(new ListingListItemView({ model: listing }).render().el); }, this); return this; }, close: function() { $(this.el).unbind(); $(this.el).empty(); }, refreshList: function() { $(this.el).empty(); this.render(); } });

    Read the article

  • How to store session values with Node.js and mongodb?

    - by Tirithen
    How do I get sessions working with Node.js, [email protected] and mongodb? I'm now trying to use connect-mongo like this: var config = require('../config'), express = require('express'), MongoStore = require('connect-mongo'), server = express.createServer(); server.configure(function() { server.use(express.logger()); server.use(express.methodOverride()); server.use(express.static(config.staticPath)); server.use(express.bodyParser()); server.use(express.cookieParser()); server.use(express.session({ store: new MongoStore({ db: config.db }), secret: config.salt })); }); server.configure('development', function() { server.use(express.errorHandler({ dumpExceptions: true, showStack: true })); }); server.configure('production', function() { server.use(express.errorHandler()); }); server.set('views', __dirname + '/../views'); server.set('view engine', 'jade'); server.listen(config.port); I'm then, in a server.get callback trying to use req.session.test = 'hello'; to store that value in the session, but it's not stored between the requests. It probobly takes something more that this to store session values, how? Is there a better documented module than connect-mongo?

    Read the article

  • How do I install websocket module for Node.js on Debian VPS?

    - by Ollie Shaw
    I currently am renting a VPS from Dreamhost which runs Debian. I am still learning command line on this OS, but fast! I have successfully installed Node.js, now I want to install the websocket module found here: https://github.com/Worlize/WebSocket-Node From the root user, I have run the following command: npm install websocket The error thrown is: [websocket v1.0.7] Native code compile failed!! On Windows, native extensions require Visual Studio and Python. On Unix, native extensions require Python, make and a C++ compiler. Start npm with --websocket:verbose to show compilation output (if any). What commands should I issue to install this websocket module and its requirements? Thanks very much! Edit: When I run sudo apt-get install gcc make I get this message: Reading package lists... Done Building dependency tree Reading state information... Done gcc is already the newest version. gcc set to manually installed. make is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 44 not upgraded. And the same error when trying to install WebSocket.

    Read the article

  • What is a good RPC model for building a AJAX web app using PHP & JS?

    - by user366152
    I'm new to writing AJAX applications. I plan on using jQuery on the client side while PHP on the server side. I want to use something like XML-RPC to simplify my effort in calling server-side code. Ideally, I wouldn't care whether the transport layer uses XML or JSON or a format more optimized for the wire. If I was writing a console app I'd use some tool to generate function stubs which I would then implement on the RPC server while the client would natively call into those stubs. This provides a clean separation. Is there something similar available in the AJAX world? While on this topic, how would I proceed with session management? I would want it to be as transparent as possible. For example, if I try to hit an RPC end-point which needs a valid session, it should reject the request if the client doesn't pass a valid session cookie. This would really ease my application development. I'd then have to simply handle the frontend using native JS functions. While on the backend, I can simply implement the RPC functions. BTW I dont wish to use Google Web Toolkit. My app wont be extremely heavy on AJAX.

    Read the article

  • node.js: looping, email each matching row from query but it it emails the same user by # number of matches?

    - by udonsoup16
    I have a node.js email server that works fine however I noticed a problem. If the query string found 4 rows, it would send four emails but only to the first result instead of to each found email address. var querystring1 = 'SELECT `date_created`,`first_name`,`last_name`,`email` FROM `users` WHERE TIMESTAMPDIFF(SECOND,date_created, NOW()) <=298 AND `email`!="" LIMIT 0,5'; connection.query(querystring1, function (err, row) { if (err) throw err; for (var i in row) { // Email content; change text to html to have html emails. row[i].column name will pull relevant database info var sendit = { to: row[i].email, from: '******@******', subject: 'Hi ' + row[i].first_name + ', Thanks for joining ******!', html: {path:__dirname + '/templates/welcome.html'} }; // Send emails transporter.sendMail(sendit,function(error,response){ if (error) { console.log(error); }else{ console.log("Message sent1: " + row[i].first_name);} transporter.close();} ) }}); .... How do I have it loop through each found row and send a custom email using row data individual row data?

    Read the article

  • Meteor exception in Meteor.flush when updating a collection breaks reactivity across clients

    - by Harel
    When I'm calling Collection.update from the front end (the method call is allowed), the update does work ok, but the exception below is being thrown (in Chrome's JS console, not in the server). Although the update took place, other clients connected to the same collection do not see the updates until they refresh the browser - I suspect because of the exception. Any idea what might cause this? Exception from Meteor.flush: Error: Can't create second landmark in same branch at Object.Spark.createLandmark (http://checkadoo.com/packages/spark/spark.js?8b4e0abcbf865e6ad778592160ec3b3401d7abd2:1085:13) at http://checkadoo.com/packages/templating/deftemplate.js?7f4bb363e9e340dbaaea8d74ac670af40ac82d0a:115:26 at Object.Spark.labelBranch (http://checkadoo.com/packages/spark/spark.js?8b4e0abcbf865e6ad778592160ec3b3401d7abd2:1030:14) at Object.partial [as list_item] (http://checkadoo.com/packages/templating/deftemplate.js?7f4bb363e9e340dbaaea8d74ac670af40ac82d0a:114:24) at http://checkadoo.com/packages/handlebars/evaluate.js?ab265dbab665c32cfd7ec343166437f2e03f1a54:349:48 at Object.Spark.labelBranch (http://checkadoo.com/packages/spark/spark.js?8b4e0abcbf865e6ad778592160ec3b3401d7abd2:1030:14) at branch (http://checkadoo.com/packages/handlebars/evaluate.js?ab265dbab665c32cfd7ec343166437f2e03f1a54:308:20) at http://checkadoo.com/packages/handlebars/evaluate.js?ab265dbab665c32cfd7ec343166437f2e03f1a54:348:20 at Array.forEach (native) at Function._.each._.forEach (http://checkadoo.com/packages/underscore/underscore.js?772b2587aa2fa345fb760eff9ebe5acd97937243:76:11) EDIT Here is my template for the clickable item that triggers the update: <template name="list_item"> <li class="checklistitemli"> <div class="{{checkbox_class}}" id="clitem_{{index}}"> <input type="checkbox" name="item_checked" value="1" id="clcheck_{{index}}" class="checklist_item_check" {{checkbox_ticked}}> {{title}} </div> </li> </template> and here's the event handler for clicks on 'list_item': var visualCheck = function(el, checked) { var checkId = el.id.replace('clitem','clcheck'); if (checked) { addClass(el, 'strikethrough'); $('') } else { removeClass(el, 'strikethrough'); } $('#'+checkId)[0].checked=checked; }; Template.list_item.events = { 'click .checklistitem' : function(ev) { this.checked = !this.checked; var reverseState = !this.checked; var updateItem = {}, self = this, el = ev.target; visualCheck(el, this.checked); updateItem['items.'+this.index+'.checked'] = this.checked; console.log("The error happens here"); Lists.update({_id: this._id}, {$set:updateItem}, {multi:false} , function(err) { console.log("In callback, after the error"); if (err) { visualCheck(el, reverseState); } }); } } The whole thing is available at http://checkadoo.com (Its a port of a Tornado based Python app of mine)

    Read the article

  • Cloud MBaaS : The Next Big Thing in Enterprise Mobility

    - by shiju
    In this blog post, I will take a look at Cloud Mobile Backend as a Service (MBaaS) and how we can leverage Cloud based Mobile Backend as a Service for building enterprise mobile apps. Today, mobile apps are incredibly significant in both consumer and enterprise space and the demand for the mobile apps is unbelievably increasing in day to day business. An enterprise can’t survive in business without a proper mobility strategy. A better mobility strategy and faster delivery of your mobile apps will give you an extra mileage for your business and IT strategy. So organizations and mobile developers are looking for different strategy for meeting this demand and adopting different development strategy for their mobile apps. Some developers are adopting hybrid mobile app development platforms, for delivering their products for multiple platforms, for fast time-to-market. Others are adopting a Mobile enterprise application platform (MEAP) such as Kony for their enterprise mobile apps for fast time-to-market and better business integration. The Challenges of Enterprise Mobility The real challenge of enterprise mobile apps, is not about creating the front-end environment or developing front-end for multiple platforms. The most important thing of enterprise mobile apps is to expose your enterprise data to mobile devices where the real pain is your business data might be residing in lot of different systems including legacy systems, ERP systems etc., and these systems will be deployed with lot of security restrictions. Exposing your data from the on-premises servers, is not a easy thing for most of the business organizations. Many organizations are spending too much time for their front-end development strategy, but they are really lacking for building a strategy on their back-end for exposing the business data to mobile apps. So building a REST services layer and mobile back-end services, on the top of legacy systems and existing middleware systems, is the key part of most of the enterprise mobile apps, where multiple mobile platforms can easily consume these REST services and other mobile back-end services for building mobile apps. For some mobile apps, we can’t predict its user base, especially for products where customers can gradually increase at any time. And for today’s mobile apps, faster time-to-market is very critical so that spending too much time for mobile app’s scalability, will not be worth. The real power of Cloud is the agility and on-demand scalability, where we can scale-up and scale-down our applications very easily. It would be great if we could use the power of Cloud to mobile apps. So using Cloud for mobile apps is a natural fit, where we can use Cloud as the storage for mobile apps and hosting mechanism for mobile back-end services, where we can enjoy the full power of Cloud with greater level of on-demand scalability and operational agility. So Cloud based Mobile Backend as a Service is great choice for building enterprise mobile apps, where enterprises can enjoy the massive scalability power of their mobile apps, provided by public cloud vendors such as Microsoft Windows Azure. Mobile Backend as a Service (MBaaS) We have discussed the key challenges of enterprise mobile apps and how we can leverage Cloud for hosting mobile backend services. MBaaS is a set of cloud-based, server-side mobile services for multiple mobile platforms and HTML5 platform, which can be used as a backend for your mobile apps with the scalability power of Cloud. The information below provides the key features of a typical MBaaS platform: Cloud based storage for your application data. Automatic REST API services on the application data, for CRUD operations. Native push notification services with massive scalability power. User management services for authenticate users. User authentication via Social accounts such as Facebook, Google, Microsoft, and Twitter. Scheduler services for periodically sending data to mobile devices. Native SDKs for multiple mobile platforms such as Windows Phone and Windows Store, Android, Apple iOS, and HTML5, for easily accessing the mobile services from mobile apps, with better security.  Typically, a MBaaS platform will provide native SDKs for multiple mobile platforms so that we can easily consume the server-side mobile services. MBaaS based REST APIs can use for integrating to enterprise backend systems. We can use the same mobile services for multiple platform so hat we can reuse the application logic to multiple mobile platforms. Public cloud vendors are building the mobile services on the top of their PaaS offerings. Windows Azure Mobile Services is a great platform for a MBaaS offering that is leveraging Windows Azure Cloud platform’s PaaS capabilities. Hybrid mobile development platform Titanium provides their own MBaaS services. LoopBack is a new MBaaS service provided by Node.js consulting firm StrongLoop, which can be hosted on multiple cloud platforms and also for on-premises servers. The Challenges of MBaaS Solutions If you are building your mobile apps with a new data storage, it will be very easy, since there is not any integration challenges you have to face. But most of the use cases, you have to extract your application data in which stored in on-premises servers which might be under VPNs and firewalls. So exposing these data to your MBaaS solution with a proper security would be a big challenge. The capability of your MBaaS vendor is very important as you have to interact with your legacy systems for many enterprise mobile apps. So you should be very careful about choosing for MBaaS vendor. At the same time, you should have a proper strategy for mobilizing your application data which stored in on-premises legacy systems, where your solution architecture and strategy is more important than platforms and tools.  Windows Azure Mobile Services Windows Azure Mobile Services is an MBaaS offerings from Windows Azure cloud platform. IMHO, Microsoft Windows Azure is the best PaaS platform in the Cloud space. Windows Azure Mobile Services extends the PaaS capabilities of Windows Azure, to mobile devices, which can be used as a cloud backend for your mobile apps, which will provide global availability and reach for your mobile apps. Windows Azure Mobile Services provides storage services, user management with social network integration, push notification services and scheduler services and provides native SDKs for all major mobile platforms and HTML5. In Windows Azure Mobile Services, you can write server-side scripts in Node.js where you can enjoy the full power of Node.js including the use of NPM modules for your server-side scripts. In the previous section, we had discussed some challenges of MBaaS solutions. You can leverage Windows Azure Cloud platform for solving many challenges regarding with enterprise mobility. The entire Windows Azure platform can play a key role for working as the backend for your mobile apps where you can leverage the entire Windows Azure platform for your mobile apps. With Windows Azure, you can easily connect to your on-premises systems which is a key thing for mobile backend solutions. Another key point is that Windows Azure provides better integration with services like Active Directory, which makes Windows Azure as the de facto platform for enterprise mobility, for enterprises, who have been leveraging Microsoft ecosystem for their application and IT infrastructure. Windows Azure Mobile Services  is going to next evolution where you can expect some exciting features in near future. One area, where Windows Azure Mobile Services should definitely need an improvement, is about the default storage mechanism in which currently it is depends on SQL Server. IMHO, developers should be able to choose multiple default storage option when creating a new mobile service instance. Let’s say, there should be a different storage providers such as SQL Server storage provider and Table storage provider where developers should be able to choose their choice of storage provider when creating a new mobile services project. I have been used Windows Azure and Windows Azure Mobile Services as the backend for production apps for mobile, where it performed very well. MBaaS Over MEAP Recently, many larger enterprises has been adopted Mobile enterprise application platform (MEAP) for their mobile apps. I haven’t worked on any production MEAP solution, but I heard that developers are really struggling with MEAP in different way. The learning curve for a proprietary MEAP platform is very high. I am completely against for using larger proprietary ecosystem for mobile apps. For enterprise mobile apps, I highly recommend to use native iOS/Android/Windows Phone or HTML5  for front-end with a cloud hosted MBaaS solution as the middleware. A MBaaS service can be consumed from multiple mobile apps where REST APIs are using to integrating with enterprise backend systems. Enterprise mobility should start with exposing REST APIs on the enterprise backend systems and these REST APIs can host on Cloud where we can enjoy the power of Cloud for our services. If you are having REST APIs for your enterprise data, then you can easily build mobile frontends for multiple platforms.   You can follow me on Twitter @shijucv

    Read the article

  • Architecture for a template-building, WYSIWIG application

    - by Sam Selikoff
    I'm building a WYSIWYG designer in Ember.js. The designer will allow users to create campaigns - think MailChimp. To build a campaign, users will choose an existing template. The template will have a defined layout. The user will then be taken to the designer, where he will be able to edit the text and style, and additionally change some layout options. I've been thinking about how best to go about structuring this app, and there are a few hurdles. Specifically, the output of the campaign will be dynamic: eventually, it will be published somewhere, and when the consumers (not my users, but the people clicking on the campaign that my user created) visit the campaign, certain pieces of data will change, depending on the type of consumer viewing the campaign. That means the ultimate output of the designer will be a dynamic site. The data that is dynamic for this site - the end product - will not be manipulated by the user in the designer. However, the data that will be manipulated by the user in the designer are things like copy, styles, layout options, etc. I'll call the first set of variables server-side data, and the second client-side data. It seems, then, that the process will go something like this: I'll need to create templates for this designer that have two dynamic segments. For instance, the server-side data could be Liquid expressions, and the client-side data Handlebars expressions. When the user creates a campaign, I would compile the template on the back end using some dummy data for the server-side variables, and serve up a handlebars template to the Ember app. The user would then edit the template, and the Ember app would save all his edits to the JS variables that were powering the template. This way he'd be able to preview the template. When he saves, he'll send back the selected template, along with all the data and options he's made. When it comes time to publish, the back-end system will have to do two things: compile the template with Handlebars using the campaign data, and then compile the template with Liquid using the server-side data Is my thinking roughly accurate about this, or is there a simpler way?

    Read the article

  • How to Write Manageable Code With Functional Programming?

    - by dade
    I just started with Functional Programming(Node.Js) and from the look of things it looks as if the code am writing would grow to be one hell of a code base to manage, when compared to Programming languages that have a sort of Object Oriented Paradigm. With OOP I am familair with practices that would ensure your code is easily managed and extensible. But am nore sure of similar convention with Functional Programming.

    Read the article

  • Js (+Mootools) - Why my script use over 60% of processor?

    - by Misiur
    On this site - LINK - i need to use 3 banner scrollers (2x vertical + 1x horizontal). I've tried to do it in flash, but then everyone web browsers shut down, or suspended. Now i want to do it in JS (i use mootools). All data come from MySQL. Here's the complete code (even if you don't know mootools, You should understand it) global $wpdb; $table = $wpdb->prefix.'part'; $sql = "SELECT * FROM $table"; $q = $wpdb->get_results($sql); $g = 0; if($wpdb->num_rows > 0) { ?> <script type="text/javascript"> window.addEvent('load', function(){ var totall = 0; var totalr = 0; $$('#leftCont0 .contElement').each(function(el){ var img = new Asset.image(el.getFirst('a').getFirst('img').get('src')); totall += img.height; }); $$('#rightCont0 .contElement').each(function(el){ var img = new Asset.image(el.getFirst('a').getFirst('img').get('src')); totalr += img.height; }); $$('.leftCont').each(function(el){ var h = parseInt(el.get('id').substr(8)); el.setStyle('top', h * totall); }); $$('.rightCont').each(function(el){ var h = parseInt(el.get('id').substr(9)); el.setStyle('top', h * totalr); }); var total = new Array(totall, totalr); move.periodical(30, null, total); }); function move(num, num2) { var h = 0; var da = false; var target = null; $$('.leftCont').each(function(el){ var act = el.getStyle('top'); var n = parseInt(act)+1; el.setStyle('top', n+"px"); if(el.getStyle('top') < h) { h = parseInt(el.getStyle('top')); alert(h); } if(parseInt(el.getStyle('top')) > 400) { da = true; target = el; } }); if(da) { var n = h - num; target.setStyle('top', n+'px'); } h = 0; da = false; $$('.rightCont').each(function(el){ var act = el.getStyle('top'); var n = parseInt(act)+1; el.setStyle('top', n+"px"); if(el.getStyle('top') < h) { h = parseInt(el.getStyle('top')); alert(h); } if(parseInt(el.getStyle('top')) > 400) { da = true; target = el; } }); if(da) { var n = h - num2; target.setStyle('top', n+'px'); } } </script> <?php $g = 0; $l = 0; $r = 0; $leftContent = array(); $rightContent = array(); $leftHeight = 0; $rightHeight = 0; foreach($q as $q) { if(($g % 2) == 0) { $leftContent[$l] = '<div class="contElement"> <a href="'.$q->aurl.'"><img src="'.$q->imgurl.'" alt="Partner" /></a> </div>'; $lHeight = getimagesize($q->imgurl); $leftHeight .= $lHeight[1]; $l++; } else { $rightContent[$r] = '<div class="contElement"> <a href="'.$q->aurl.'"><img src="'.$q->imgurl.'" alt="Partner" /></a> </div>'; $rHeight = getimagesize($q->imgurl); $rightHeight .= $rHeight[1]; $r++; } $g++; } $quantity = ceil(400 / $leftHeight) + 1; for($i = 0; $i < $quantity; $i++) { $str = ""; for($j = 0; $j < sizeof($leftContent); $j++) { $str .= $leftContent[$j]; } $leftContainer[$i] = '<div class="leftCont" id="leftCont'.$i.'">'.$str.'</div>'; } $quantity = ceil(400 / $rightHeight) + 1; for($i = 0; $i < $quantity; $i++) { $str = ""; for($j = 0; $j < sizeof($rightContent); $j++) { $str .= $rightContent[$j]; } $rightContainer[$i] = '<div class="rightCont" id="rightCont'.$i.'">'.$str.'</div>'; } ?> <div id="pcl"> <?php for($i = 0; $i < sizeof($leftContainer); $i++) { echo $leftContainer[$i]; } ?> </div> <div id="pcr"> <?php for($i = 0; $i < sizeof($rightContainer); $i++) { echo $rightContainer[$i]; } ?> </div> <?php }

    Read the article

  • embed js code issue from rails application

    - by Arpit Vaishnav
    I am on the ruby on rails application and trying to embed the code for js , added the whole code for embedding in Text box , But when i copy paste in other blogs where embed is poss , i am not getting the full js work , the code is given below <%= text_field_tag "text"," script src=\"/public/javascripts/calendarview.js\" script src=\"/public/javascripts/calendarview_init.js\" link rel=\"stylesheet\" href=\"/public/stylesheets/calendarview.css\" link rel=\"stylesheet\" href=\"/public/stylesheets/calendarview_init.css\" ",:size = 40 % I have just removed < for let it be seen in the coding window PLease help if poss List item

    Read the article

  • Chrome extension Page Action JS

    - by Radek Šimko
    I'm trying to create an extension using this docs: http://code.google.com/chrome/extensions/content_scripts.html I want a part of JS code to run when document is ready (loaded). This is my manifest.json: { "name": "OwnExtension", "version": "0.1", "content_scripts": [ { "matches": ["https://my.site.eu/*"], "css": ["styles.css"], "js": ["main.js"] } ] } This is my main.js: alert(10); Am I doing sth wrong, that nothing happend when page https://my.site.eu/ loaded in browser?

    Read the article

  • Great Free Courses on Building HTML5 apps using ASP.NET Web API, Knockout.js and jQuery

    - by ScottGu
    Pluralsight has developed some great training courses on the new .NET 4.5 and VS 2012 release, including two fantastic courses from John Papa that cover how to build HTML5 web apps using ASP.NET Web API, Knockout and jQuery: Single Page Apps with HTML5, Web API, Knockout and jQuery Building HTML5 and JavaScript Apps with MVVM and Knockout Free 1-Month Subscription to the Courses Pluralsight is offering a special promotion that allows you to get a free 1-month subscription to watch the above courses at no cost.  There is no obligation to buy anything at the end of the offer and you don’t need to supply a credit card in order to take part in it. To get access to the course you simply follow @pluralsight and @john_papa on Twitter and then visit this page and enter your Twitter name using the form on it.  Pluralsight will then send you a private twitter message containing the access code that you can use to subscribe to the courses (and download the course exercise files).  Once you are subscribed to the course you have one month to watch the course (and you can watch it as many times as you want during the month). Pluralsight is running the promotion through Sept 18th – so sign-up now to get access.  Once you are signed up you then have a month to watch the course. Hope this helps, Scott P.S. And if you are new to Twitter you can also optionally follow me: @scottgu

    Read the article

  • How to install NPM behind authentication proxy on Windows?

    - by Tobias
    I need to run the latest version of Node and NPM on Windows. I installed Node 0.5.8 and downloaded the sources of NPM from GitHub. The steps I followed to install NPM were listed on its GitHub site but I have a problem running the following command: node cli.js install npm -gf but it fails with the following error message: Error: connect UNKNOWN at errnoException (net_uv.js:566:11) at Object.afterConnect [as oncomplete] (net_uv.js:557:18) System Windows_NT 5.1.2600 command "...\\Node\\bin\\node.exe" "...\\npm\\cli.js" "install" "npm" "-gf" cwd ...\npm node -v v0.5.8 npm -v 1.0.94 code UNKNOWN I think that this is a problem because I need authentication at my proxy to connect to the Internet. But I found no way to tell the installer to use my credentials for login. Is there a possibility to provide my proxy IP and login information to npm installation maybe via command-line arguments? I can provide the full log (but seems to have no more relevant information) using pastebin if needed.

    Read the article

  • libssh2 and simultaneous connections

    - by Florian Margaine
    I'm writing a node.js C++ module using the C library libssh2. The module is supposed to be a bridge to connect to SSH over HTTPS. Right now, I'm still in the design/learning phase of v8 API and C++, and I have a design question: libssh2 is a C library, all its methods are global. From what I see in the examples, libssh2 can only handle one connection at a time. If I want to allow simultaneous connections to different SSH servers, do I have to fork a process to completely separate the libssh2 "instances", or is forking a thread enough? I don't know enough of the separation limit used there. Any idea on how to handle this is appreciated.

    Read the article

  • What are the best practices for rapid prototyping using exclusively HTML/CSS/JS

    - by charlax
    I'm developing a prototype of a web application. I want to only use HTML, CSS and Javascript. I prefer to use my text editor and not having to learn (or pay, for that matter) a new tool like Axure. What would be, to your mind, the best practices? To me there are many qualities for a good prototype: Quickly developed Easy to improve Fair fidelity as regards UX (this disqualifies tools like Omnigraffle or PowerPoint that are more dedicated to wireframing) I trying to learn as quickly as possible, but I would like to know, based on your experience, on how you managed to be both quick and agile. Reference: http://www.boxesandarrows.com/view/prototyping-with

    Read the article

  • does my js replace view?

    - by Milla Well
    I am writing a web application which is based on Codeigniter and jQuery. I primarily use ajax to call my controller functions and it turned out, that there are just 4 view*.php files, because most of my contoller functions return JSON data, which is processed in my jQuery. So my actual code is divided in kind of MVCC model: Codeigniter model (db, computations) Codeigniter controller (filtering, xss-cleaning, checking permissions, call model functions) jQuery controller (callback functions) jQuery view (adding/removing classes, appending elements,... ) So I violate the paradigm of not using the echo function in my Codeiginter controller and simply call echo json_encode($result); because it doesn't make any sense to me to create a view*.php file for one loc. Especially because all the regular view*.php stuff is covered in my jQuery view. I was wondering if I am missing something out, or if there is a way to integrate this jQuery-controller in my Codeigniter. I found some words on this topic, but this seems pretty handmade. Are there some neat solutions? Does a MVCC model make sense?

    Read the article

  • HAProxy is caching the forwarding?

    - by shadow_of__soul
    i'm trying to set up a server structure for an application i'm building in Node.js with socket.io. My setup is: HAProxy frontend forward to -> apache2 as default backend (or nginx, is apache in this local test) -> node.js app if the url has socket.io in the request AND a domain name i have something like: global log 127.0.0.1 local0 log 127.0.0.1 local1 notice maxconn 4096 user haproxy group haproxy daemon defaults log global mode http maxconn 2000 contimeout 5000 clitimeout 50000 srvtimeout 50000 frontend all 0.0.0.0:80 timeout client 5000 default_backend www_backend acl is_soio url_dom(host) -i socket.io #if the request contains socket.io acl is_chat hdr_dom(host) -i chaturl #if the request comes from chaturl.com use_backend chat_backend if is_chat is_soio backend www_backend balance roundrobin option forwardfor # This sets X-Forwarded-For timeout server 5000 timeout connect 4000 server server1 localhost:6060 weight 1 maxconn 1024 check #forwards to apache2 backend chat_backend balance roundrobin option forwardfor # This sets X-Forwarded-For timeout queue 50000 timeout server 50000 timeout connect 50000 server server1 localhost:5558 weight 1 maxconn 1024 check #forward to node.js app The problem comes when i made a request to something like www.chaturl.com/index.html it load perfectly but fails to loads the socket.io files (www.chaturl.com/socket.io/socket.io.js) why it redirect to apache (and should redirect to the node.js app that serve the files). The weird thing is that if i access directly to the socket.io file, after refreshing a few times, it loads, so i suppose is "caching" the forwarding for the client when it makes the first request and reach the apache server. Any suggestion of how this can be solved? or what i can try or look about this?

    Read the article

  • Event Framework for OO Architecture in JS

    A reusable event framework for all you javascript needs....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • What are good JS libraries for game dev?

    - by acidzombie24
    If I decide to write a simple game both text and graphical (2d) what libraries would I use? (Assume we are using a HTML5 compatible browser) The main things I can think of Rendering text on screen Animating sprites (using images/css) Input (capturing the arrow keys and getting relative mouse positions) Perhaps some preloading resource or dynamically loading resources and choosing order Sound (but I am unsure how important this will be to me at first). Perhaps with mixing and chaining sounds or looping forever until stop. Networking (low priority) to connect a user to another or to continuously GET data without multiple request (I know this exist but I don't know how easy it is to setup or use. But this isn't important to me. Its for the question).

    Read the article

  • Checking whether a specific key was pressed in enchantJS

    - by MxyL
    I am using enchantJS and would like to use the letters and numbers as well as numpad on a keyboard to do different things (eg: hotkeys). From this page http://users.csc.calpoly.edu/~foaad/enchant/guide/playerInput.html By default, enchant.js provides input listeners for six buttons: UP, DOWN, LEFT, RIGHT, A, and B. By default, the directions are bound to the arrow keys. Any of the six buttons may also be bound to any key with an ASCII value. We’ll address that later. So enchant provides the ability to bind keys to different input such as up, down, left, right...but how can I simply check whether the D or X key was pressed, and if so, perform certain actions based on that event?

    Read the article

  • Invalid Html Response and JS Errors when you open your Application in Visual Studio 2013

    - by imran_ku07
     I was working on an application which uses Telerik controls. The application was working fine for a while. Suddenly, the application stopped working. I mean lot of my application pages becoming very very ugly. I found JavaScript errors on every Browser's console. When I check the page view-source, the generated HTML was messy and invalid. This was only happening with my local machine. If someone else on my network accesses my application pages, he will get the correct HTML and no JavaScript errors. My mind was blowing because the same page was generating invalid HTML(and JavaScript errors) when I access the page using a local browser but generate correct HTML(and no JavaScript errors) when someone else access my application page remotely. Then I realized that I the only change I made last was opening my application in Visual Studio 2013 RTM which I installed few days ago. I closed the Visual Studio 2013, everything work like a charm. Then I became100% sure that this is only happening due to new Visual Studio 2013 feature called Browser Link. I just open the application again and add this in web.config. Everything become fine Happy coding :)   <add key="vs:EnableBrowserLink" value="false" />

    Read the article

  • Why is Backbone.js a bad option in the Technology radar 2012 of thoughtworks?

    - by Cfontes
    In the latest Technology Radar 2012 they state that Backbone.js has pushed to far on it's MVC abstraction and say that Knockout.js or Angular.js should be used instead. I cannot get why they think that Backbone.js model is bad, for me it's just a way to create a standard so people can have some kind of roadmap to dev frontend JS without Spaghetti code. Also for me Angular and Knockout solve a different problem, I like both of them but having to code all MVC classes is something I think is kind of a rework. The thing is simple easy extendable and fast to learn, comes with a lot of goodies and is easy to combine with other Frameworks. (see Knockback.js) Can anybody tell me what made it so bad to their eyes ?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >