model-view-controller

Viewing data in a circular buffer in real-time

允我心安 提交于 2019-12-21 22:41:59
问题 I have an incoming stream of messages, and want a window that allows the user to scroll through the messages. This is my current thinking: Incoming messages go into single producer single consumer queue A thread reads them out and places them into a circular buffer with a sequential id This way I could have multiple incoming streams safely placed in the circular buffer and it decouples the input Mutex to coordinate circular buffer access between the UI and the thread Two notifications from

Displaying / editing xml in an MVC app

随声附和 提交于 2019-12-21 20:34:33
问题 I need to maintain an xml column in a SQL database. a) in my details page - I just want to display this column as "pretty" xml - like the browser would. So instead of one big block of xml (e.g. <foo><bar><data>one</data><data>two</data><data>three</data></bar><other>something else></other></foo> ) I want it split out with each new tag on a new line (e.g. <foo> <bar> <data>one</data> <data>two</data> <data>three</data> </bar> <other>something else></other> </foo> and b) in my edit page I want

How can I build a recursive view in Ember?

瘦欲@ 提交于 2019-12-21 20:17:18
问题 In my application I have an item called block which can contain and be contained by other block items. To keep things simple, lets say these blocks can be infinitely nested. I want to know if I can create recursive views corresponding to the blocks that are also nested. Each view will be rendered as a DIV containing its children and residing inside its parent DIV ? While the views are similar in terms of what they can contain, their actual content that will be obtained from the server can be

How can I trigger a download with typo3/extbase?

时间秒杀一切 提交于 2019-12-21 20:11:05
问题 I'm using Typo3 with extbase and fluid. I have a Controller with an action called downloadAction() . After calling the action the system tries to render the download-template (but I just want to start a download). public function downloadAction($id) { // create file // send header // dump file // exit } How can I dump the created download-File and send a download header instead of the normal render process? What is the best way? Thanks 回答1: I did this in a project some months ago, it's pretty

In MVC, should the View know the Model?

≡放荡痞女 提交于 2019-12-21 17:35:25
问题 Should the view know the model: or not: ? 回答1: Programmers often shortcut this and make the view specific to the model. For instance, if you're in a CRM app the model might have a firstName field; the view then assumes the model object it's given has a firstName field and shows that in the appropriate place. This of course isn't reusable. If you are making a View to display a table of data, it shouldn't care which model field is shown in which column. It should just handle displaying and

MVC in node and general: How are models tied to views?

这一生的挚爱 提交于 2019-12-21 17:28:49
问题 I'm starting with node.js and am making a simple MVC framework. So far, I've got a front controller (or 'dispatcher', if you will) working. The routing happens through a dispatcher config module, as shown. My questions are at the end, immediately after the code. Also, this is an exercise in learning to node, please do not suggest express.js and the likes. dispatcherConfig.js : var url = require('url'); (function() { var dispatcherConfig = { '/' : 'homeController', '/index.html' :

How useful is a 'pure' MVC implementation?

╄→尐↘猪︶ㄣ 提交于 2019-12-21 16:17:50
问题 I work at a company that provides custom made 'CRM'-like software. We are currently redesigning/redeveloping the software with the hopes that it will look more modern and be easier to develop and customize for future clients. Currently it takes a long time to customize each new application. There is a presumption that the reason it takes so long is because of the amount of business logic that is present in the 'view' layer. To some extent I can vouch for this being true, but symptoms don't

MVC Ajax UpdatePanel

感情迁移 提交于 2019-12-21 15:48:29
问题 I know (at least i'm pretty sure) there isn't a control for MVC like the asp:UpdatePanel. Can anyone give me some idea on how to do this. I have a collection that i add entries to from my repository & services layers. in my masterpage i would like to show an alert depending on if there is anything in this collection. Normally i would have an UpdatePanel whose UpdateMode="Always" and it would check the collection and display my messages. Do you know how i can achieve something similiar in MVC?

Why is Angular called MV* framework

余生颓废 提交于 2019-12-21 12:33:33
问题 From what I've read until now (this answer precisely), it tends more towards MVVM pattern. Considering the data from services as Model, Angular controllers as VM and the HTML containing angular bindings as the View. Can we say that MVC is a pattern for server side and MVVM for client side? Can someone explain with example (in context of Angular) how we can implement MVC and MVVM. I've read about the concept of using var vm = this; in Angular controllers. But does it mean by just using an

Remove Doctrine life cycle event from within a Symfony2 controller

吃可爱长大的小学妹 提交于 2019-12-21 12:32:14
问题 I am looking to remove a Doctrine Extensions life cycle event listener from within a controller. I need to remove the listener for update events because I need to update all nodes in the tree at once. Something that is not supported by the library, but is possible by directly setting the correct left, right, level etc... Is it possible to remove a life cycle even from within a controller? What is a possible solution for this situation. I thought something like this might work, but it did not