Search Results

Search found 2456 results on 99 pages for 'frameworks'.

Page 86/99 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • How to develop JSP/Servlets Web App using MVC pattern?

    - by A.S al-shammari
    I'm developing a JSP/Servlets web app (no frameworks). I want to use MVC pattern. I designed my project like this : Controller :a servlet that reads a request, extracts the values,communicates with model objects and gives information to a JSP page. View : JSP Pages. Model : Java Classes / Java Beans .. etc . The problem : Index.jsp is the starting point (default page) in my web site. So, the Index.jsp becomes the controller to parse the request! .For example , the following request : index.jsp?section=article&id=10 parsed in index.jsp as following : <div class="midcol"> <!-- Which section? --> <%String fileName = request.getParameter("section"); if (fileName == null) { fileName = "WEB-INF/jspf/frontpage.jsp"; } else { fileName = "WEB-INF/jspf/" + fileName + ".jsp"; } %> <jsp:include page='<%= fileName%>' /> </div> Here, I can't force the servlet to be a controller .. because the index.jsp is the controller here since it's the starting point! Is there any solution to forward the request from index.jsp to the servlet and then go back to index.jsp ? Or any solution that achieves the MVC goal - the servlet should be the controller - ? I'm thinking of making a FrontPageController servlet as default page instead of index.jsp ! but I don't know if it's a perfect idea ?!

    Read the article

  • Dependency injection with web services?

    - by John K.
    I've recently discovered a possible candidate for dependency injection in a .Net application I've designed. Due to a recent organizational policy, it is no longer possible to call smtp mail services from client machines on our network. So I'm going to have to refactor all the code in my application where it was previously calling the smtp object to send out mail. I created a new WCF web service on an authorized web server that does allow for smtp mail messaging. This seems to be a great candidate for dependency injection. I will create a new INotification interface that will have a method like 'void SendNotification(MailMessage msg)' and create a new property in my application where you can set this property to any class that implements this interface. My question tho, is whether it's possible, through dependency injection, to encapsulate the instantiation of a .NET WCF web service? I am fairly new at IoC and Dependency injection frameworks, so I am not quite sure if it can handle web service dependencies? I'm hoping someone else out there has come across this situation or has knowledge regarding this subject? cheers, John

    Read the article

  • DDD and MVC: Difference between 'Model' and 'Entity'

    - by Nathan Loding
    I'm seriously confused about the concept of the 'Model' in MVC. Most frameworks that exist today put the Model between the Controller and the database, and the Model almost acts like a database abstraction layer. The concept of 'Fat Model Skinny Controller' is lost as the Controller starts doing more and more logic. In DDD, there is also the concept of a Domain Entity, which has a unique identity to it. As I understand it, a user is a good example of an Entity (unique userid, for instance). The Entity has a life-cycle -- it's values can change throughout the course of the action -- and then it's saved or discarded. The Entity I describe above is what I thought Model was supposed to be in MVC? How off-base am I? To clutter things more, you throw in other patterns, such as the Repository pattern (maybe putting a Service in there). It's pretty clear how the Repository would interact with an Entity -- how does it with a Model? Controllers can have multiple Models, which makes it seem like a Model is less a "database table" than it is a unique Entity. So, in very rough terms, which is better? No "Model" really ... class MyController { public function index() { $repo = new PostRepository(); $posts = $repo->findAllByDateRange('within 30 days'); foreach($posts as $post) { echo $post->Author; } } } Or this, which has a Model as the DAO? class MyController { public function index() { $model = new PostModel(); // maybe this returns a PostRepository? $posts = $model->findAllByDateRange('within 30 days'); while($posts->getNext()) { echo $posts->Post->Author; } } } Both those examples didn't even do what I was describing above. I'm clearly lost. Any input?

    Read the article

  • WSMethodInvocationSetCallBack symbol not found after importing files generated from WSMakeStubs

    - by racingcow
    Hello, I am pretty new to Objective-C, and I am trying to write an iPhone app to call a simple web service. I used WSMakeStubs to point to my WSDL file, and it generated 4 files for me... WSGeneratedObj.h WSGeneratedObj.m CtServices2.h CtServices2.m I added only the WSGeneratedObj.h and WSGeneratedObj.m files into a new iPhone app, added in the mobile core services framework from... /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library/Frameworks/MobileCoreServices.framework ...and then compiled. I get the following errors... Building target “iMagioSearch2” of project “iMagioSearch2” with configuration “Debug” Checking Dependencies Ld /Users/Teresa/Desktop/iMagioSearch2/iMagioSearch2/build/Debug-iphonesimulator/iMagioSearch2.app/iMagioSearch2 normal i386 cd /Users/Teresa/Desktop/iMagioSearch2/iMagioSearch2 setenv MACOSX_DEPLOYMENT_TARGET 10.5 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk -L/Users/Teresa/Desktop/iMagioSearch2/iMagioSearch2/build/Debug-iphonesimulator -F/Users/Teresa/Desktop/iMagioSearch2/iMagioSearch2/build/Debug-iphonesimulator -filelist /Users/Teresa/Desktop/iMagioSearch2/iMagioSearch2/build/iMagioSearch2.build/Debug-iphonesimulator/iMagioSearch2.build/Objects-normal/i386/iMagioSearch2.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -framework MobileCoreServices -o /Users/Teresa/Desktop/iMagioSearch2/iMagioSearch2/build/Debug-iphonesimulator/iMagioSearch2.app/iMagioSearch2 Undefined symbols: "_kWSSOAPBodyEncodingStyle", referenced from: _kWSSOAPBodyEncodingStyle$non_lazy_ptr in WSGeneratedObj.o "_WSMethodInvocationCreate", referenced from: -[WSGeneratedObj createInvocationRef:methodName:protocol:style:soapAction:methodNamespace:] in WSGeneratedObj.o "_kWSSOAPMethodNamespaceURI", referenced from: _kWSSOAPMethodNamespaceURI$non_lazy_ptr in WSGeneratedObj.o "_WSMethodInvocationUnscheduleFromRunLoop", referenced from: -[WSGeneratedObj getResultDictionary] in WSGeneratedObj.o -[WSGeneratedObj unscheduleFromRunLoop:mode:] in WSGeneratedObj.o "_WSMethodResultIsFault", referenced from: -[WSGeneratedObj isFault] in WSGeneratedObj.o "_kWSMethodInvocationResult", referenced from: _kWSMethodInvocationResult$non_lazy_ptr in WSGeneratedObj.o "_WSMethodInvocationSetProperty", referenced from: -[WSGeneratedObj createInvocationRef:methodName:protocol:style:soapAction:methodNamespace:] in WSGeneratedObj.o -[WSGeneratedObj createInvocationRef:methodName:protocol:style:soapAction:methodNamespace:] in WSGeneratedObj.o -[WSGeneratedObj createInvocationRef:methodName:protocol:style:soapAction:methodNamespace:] in WSGeneratedObj.o "_WSMethodInvocationScheduleWithRunLoop", referenced from: -[WSGeneratedObj getResultDictionary] in WSGeneratedObj.o -[WSGeneratedObj scheduleOnRunLoop:mode:] in WSGeneratedObj.o "_kWSHTTPExtraHeaders", referenced from: _kWSHTTPExtraHeaders$non_lazy_ptr in WSGeneratedObj.o "_WSMethodInvocationSetParameters", referenced from: -[WSGeneratedObj setParameters:values:names:] in WSGeneratedObj.o "_WSMethodInvocationSetCallBack", referenced from: -[WSGeneratedObj createInvocationRef:methodName:protocol:style:soapAction:methodNamespace:] in WSGeneratedObj.o ld: symbol(s) not found collect2: ld returned 1 exit status Does anyone know of anything I can check or why I might be getting this error? Thanks, David

    Read the article

  • Is there a java library / package analogous to <stdio.h>?

    - by Roboprog
    I have been doing Java on and off for about 14 years, and almost nothing else the last 6 years or so. I really hate the java.io package -- its legion of subclasses and adapters. I do like exceptions, rather than having to always poll "errno" and the like, but I could surely live without declared exceptions. Is there anything that functions like the Unix/ANSI stdio.h routines in C? I know we will never be rid of java.io and its conventions until java itself is retired, as they have metastasized throughout the many frameworks that have accreted to java. That said, I would like something that works kind of like this (let's call it package javax.stdio): Have a main utility class, perhaps FileStar, that can read and write files (or pipes), either text or binary, either sequentially or random access, with constructors that mimic fopen() and popen(). This class should have a load of useful methods that do things like fread(), fwrite(), fgets(), fputs(), fseek(), and whatever else (fprintf()?). Methods that are incompatible with the open/construct mode simply throw up (just like some of the collections classes/methods do when restricted). Then, have a bunch of interfaces that suggest how you intend to use the stream once you have created it: Sequential, RandomAccess, ReadOnly, WriteOnly, Text, Binary, plus combinations of these that make sense. Perhaps even have methods to return the appropriate type-cast (interface), throwing up if you have asked for something incompatible. For extra flavor, skip the declared exceptions -- e.g. - javax.stdio.IOException extends RuntimeException. Is there an open source project like this floating around?

    Read the article

  • What is the best way to extend restful_authentication/AuthLogic to support lazy logins by an anonymo

    - by Kevin Elliott
    I'm building an iPhone application that talks to a Ruby on Rails backend. The Ruby on Rails application will also service web users. The restful_authentication plugin is an excellent way to provide quick and customizable user authentication. However, I would like users of the iPhone application to have an account created automatically by the phone's unique identifier ([[UIDevice device] uniqueIdentifier]) stored in a new column. Later, when users are ready to create a username/password, the account will be updated to contain the username and password, leaving the iPhone unique identifier intact. Users should not be able to access the website until they've setup their username/password. They can however, use the iPhone application, since the application can authenticate itself using it's identifier. What is the best way to modify restful_authentication to do this? Create a plugin? Or modify the generated code? What about alternative frameworks, such as AuthLogic. What is the best way to allow iPhones to get a generated auth token locked to their UUID's, but then let the user create a username/password later?

    Read the article

  • Considerations when architecting an application using Dependency Injection

    - by Dan Bryant
    I've begun experimenting with dependency injection (in particular, MEF) for one of my projects, which has a number of different extensibility points. I'm starting to get a feel for what I can do with MEF, but I'd like to hear from others who have more experience with the technology. A few specific cases: My main use case at the moment is exposing various singleton-like services that my extensions make use of. My Framework assembly exposes service interfaces and my Engine assembly contains concrete implementations. This works well, but I may not want to allow all of my extensions to have access to all of my services. Is there a good way within MEF to limit which particular imports I allow a newly instantiated extension to resolve? This particular application has extension objects that I repeatedly instantiate. I can import multiple types of Controllers and Machines, which are instantiated in different combinations for a Project. I couldn't find a good way to do this with MEF, so I'm doing my own type discovery and instantiation. Is there a good way to do this within MEF or other DI frameworks? I welcome input on any other things to watch out for or surprising capabilities you've discovered that have changed the way you architect.

    Read the article

  • Why put a DAO layer over a persistence layer (like JDO or Hibernate)

    - by Todd Owen
    Data Access Objects (DAOs) are a common design pattern, and recommended by Sun. But the earliest examples of Java DAOs interacted directly with relational databases -- they were, in essence, doing object-relational mapping (ORM). Nowadays, I see DAOs on top of mature ORM frameworks like JDO and Hibernate, and I wonder if that is really a good idea. I am developing a web service using JDO as the persistence layer, and am considering whether or not to introduce DAOs. I foresee a problem when dealing with a particular class which contains a map of other objects: public class Book { // Book description in various languages, indexed by ISO language codes private Map<String,BookDescription> descriptions; } JDO is clever enough to map this to a foreign key constraint between the "BOOKS" and "BOOKDESCRIPTIONS" tables. It transparently loads the BookDescription objects (using lazy loading, I believe), and persists them when the Book object is persisted. If I was to introduce a "data access layer" and write a class like BookDao, and encapsulate all the JDO code within this, then wouldn't this JDO's transparent loading of the child objects be circumventing the data access layer? For consistency, shouldn't all the BookDescription objects be loaded and persisted via some BookDescriptionDao object (or BookDao.loadDescription method)? Yet refactoring in that way would make manipulating the model needlessly complicated. So my question is, what's wrong with calling JDO (or Hibernate, or whatever ORM you fancy) directly in the business layer? Its syntax is already quite concise, and it is datastore-agnostic. What is the advantage, if any, of encapsulating it in Data Access Objects?

    Read the article

  • Problem in migrating to LAMP from XAMPP.. Memory limit error

    - by Geshan
    I was using XAMPP for my local machine but as I wanted to run applications like mysql work bench and some test frameworks I decided to switch to LAMP self install. I'm using ubuntu and followed the instructions at: https://help.ubuntu.com/community/ApacheMySQLPHP But the problem is LAMP is consuming too much of my memory (RAM) I've allocated 124 MB currently but still it gives me memory exhausted error when I run Drush (Drupal command line). When I do drush cc to clear cache it give me the following: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /var/www/----/sites/all/modules/ubercart/uc_order/uc_order.order_pane.inc on line 150 Call Stack: 0.0020 185624 1. {main}() /opt/drush/drush.php:0 0.0254 1303672 2. drush_main() /opt/drush/drush.php:37 0.2674 5107784 3. drush_bootstrap() /opt/drush/drush.php:71 0.2676 5109872 4. _drush_bootstrap_drupal_full() /opt/drush/includes/environment.inc:173 0.2676 5151032 5. drupal_bootstrap() /opt/drush/includes/environment.inc:655 0.3030 7739048 6. _drupal_bootstrap() /var/www/missmoti/includes/bootstrap.inc:989 0.3122 8855792 7. _drupal_bootstrap_full() /var/www/missmoti/includes/bootstrap.inc:1078 0.3445 12387320 8. module_load_all() /var/www/missmoti/includes/common.inc:2608 0.5194 32586544 9. drupal_load() /var/www/missmoti/includes/module.inc:14 0.5251 33361112 10. include_once('/var/www/missmoti/sites/all/modules/ubercart/uc_order/uc_order.module') /var/www/-----/includes/bootstrap.inc:617 Drush command could not be completed. In each error it shows me a back trace and I guess this default debugger I'm not aware of in Apache or my PHP config it eating up the memory. If anyone can help I"d be glad. Another error below: Fatal error: Call to undefined function dsm() in /var/www/-----/sites/all/modules/custom/gtpath/gtpath.module on line 180 Call Stack # Time Memory Function Location 1 0.0002 120144 {main}( ) ../index.php:0 2 1.7604 68224112 theme( ) ../index.php:36 3 2.0188 77346112 call_user_func_array ( ) ../theme.inc:658 4 2.0188 77347024 gtpath_preprocess_page( ) ../theme.inc:0 how do I deal with this default debugger? how do I turn it off??

    Read the article

  • Window message procedures in Linux vs Windows

    - by mizipzor
    In Windows when you create a window, you must define a (c++) LRESULT CALLBACK message_proc(HWND Handle, UINT Message, WPARAM WParam, LPARAM LParam); to handle all the messages sent from the OS to the window, like keypresses and such. Im looking to do some reading on how the same system works in Linux. Maybe it is because I fall a bit short on the terminology but I fail to find anything on this through google (although Im sure there must be plenty!). Is it still just one single C function that handles all the communication? Does the function definition differ on different WMs (Gnome, KDE) or is it handled on a lower level in the OS? Edit: Ive looked into tools like QT and WxWidgets, but those frameworks seems to be geared more towards developing GUI extensive applications. Im rather looking for a way to create a basic window (restrict resize, borders/decorations) for my OGL graphics and retrieve input on more than one platform. And according to my initial research, this kind of function is the only way to retrieve that input. What would be the best route? Reading up, learning and then use QT or WxWidgets? Or learning how the systems work and implement those few basic features I want myself?

    Read the article

  • what libraries or platforms should I use to build web apps that provide real-time, asynchronous data

    - by Daniel Sterling
    This is a less a question with a simple, practical answer and more a question to foster discussion on the real-time data exchange topic. I'll begin with an example: Google Wave is, at its core, a real-time asynchronous data synchronization engine. Wave supports (or plans to support) concurrent (real-time) document collaboration, disconnected (offline) document editing, conflict resolution, document history and playback with attribution, and server federation. A core part of Wave is the Operational Transformation engine: http://www.waveprotocol.org/whitepapers/operational-transform The OT engine manages document state. Changes between clients are merged and each client has a sane and consistent view of the document at all times; the final document is eventually consistent between all connected clients. My question is: is this system abstract or general enough to be used as a library or generic framework upon which to build web apps that synchronize real-time, asynchronous state in each client? Is the Wave protocol directly used by any current web applications (besides Google's client)? Would it make sense to directly use it for generic state synchronization in a web app? What other existing libraries or frameworks would you consider using when building such a web app? How much code in such an app might be domain-specific logic vs generic state synchronization logic? Or, put another way, how leaky might the state synchronization abstractions be? Comments and discussion welcomed!

    Read the article

  • JSF 2.0 Dynamic Views

    - by Robe Eleckers
    Hello, I'm working on a web project which uses JSF 2.0, PrimeFaces and PrettyFaces as main frameworks / libraries. The pages have the following (common) structure: Header, Content, Footer. Header: The Header always contains the same menu. This menu is a custom component, which generates a recursive html <ul><li> list containing <a href="url"> html links, this is all rendered with a custom renderer. The link looks like 'domain.com/website/datatable.xhtml?ref=2'. Where the ref=2 used to load the correct content from the database. I use prettyfaces to store this request value in a backingbean. Question 1: Is it ok to render the <a href> links myself, or should I better add an HTMLCommandLink from my UIComponent and render that in the encodeBegin/End? Question 2: I think passing variables like this is not really the JSF 2.0 style, how to do this in a better way? Content: The content contains dynamic data. It can be a (primefaces) datatable, build with dynamic data from the database. It can also be a text page, also loaded from the database. Or a series of graphs. You got the point, it's dynamic. The content is based on the link pressed in the header menu. If the content is of type datatable, then I put the ref=2 variable to a DataTableBean (via prettyfaces), which then loads the correct datatable from the database. If the content is of type chart, I'll put it on the ChartBean. Question 3: Is this a normal setup? Ideally I would like to update my content via Ajax. I hope it's clear :)

    Read the article

  • Handling learning curve for new developers

    - by pete the pagan-gerbil
    Our company likes to hire new developers, with no experience. We have a core set of skills that we try to get them up to speed with, like ASP.NET and WinForms - to teach basic programming, the .NET languages, and the things they'll need to maintain and write. We also try and mentor them through early projects, so they can learn from someone more experienced. Recently, we've been seeing the benefits of new frameworks like MVC and ideas like Unit Testing and TDD (by extension, dependancy injection and IoC), and we'd like to start using these in the team. However, this increases the time that a junior would have before they can get started on a new project - because doing something like unit tests wrong could cause major headaches months or years later in maintenance, especially if we believe unit tests to be comprehensive. How do you handle the huge amount of things that a junior will need to take on, acknowledging that the business wants them working independantly as soon as possible? Is it acceptable to tell them not to unit test till a while after they are independant (and give them small, simpler projects in the meantime) before taking them to 'level 2' of the core skills?

    Read the article

  • How to make UISlider output nice rounded numbers exponentially?

    - by RickiG
    Hi I am implementing a UISlider a user can manipulate to set a distance. I have never used the CocoaTouch UISlider, but have used other frameworks sliders, usually there is a variable for setting the "step" and other "helper" properties. The documentation for the UISlider deals only with a max and min value, and the output is always a 6 decimal float with a linear relation to the position of the "slider nob". I guess I will have to implement the desired functionality step by step. To the user, the min/max values range from 10 m to 999 Km, I am trying to implement this in an exponential way, that will feel natural to the user. I.e. the user experiences a feeling of control over the values, big or small. Also that the "output" has reasonable values. Values like 10m 200m 2.5km 150 km etc. instead of 1.2342356 m or 108.93837756 km. I would like for the step size to increase by 10m for the first 200m, then maybe by 50m up to 500m, then when passing the 1000 m value, it starts to deal with Kilometers, so then it is step size = 1 km up until 50 km, then maybe 25 km steps etc. Any way I go about this I end up doing a lot of rounding and a lot of calculations wrapped in a forrest of if statements and NSString/Number conversions, each time the user moves the slider just a little. I was hoping someone could lend me a bit of inspiration/math help or make me aware of a more lean approach to solving this problem. My last idea is to populate and array with a 100 string values, then have the slider int value correspond to a string, this is not very flexible, but doable. Thank you in advance for any help given:)

    Read the article

  • jdbc query - date ranges as parameters

    - by pstanton
    Hi all, I'd like to write a single JDBC statement that can handle the equivalent of any number of NOT BETWEEN date1 AND date2 where clauses. By single query, i mean that the same SQL string will be used to create the JDBC statements and then have different parameters supplied. This is so that the underlying frameworks can efficiently cache the query (i've been stung by that before). Essentially, I'd like to find a query that is the equivalent of SELECT * FROM table WHERE mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? and at the same time could be used with fewer parameters: SELECT * FROM table WHERE mydate NOT BETWEEN ? AND ? or more parameters SELECT * FROM table WHERE mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? AND mydate NOT BETWEEN ? AND ? I will consider using a temporary table if that will be simpler and more efficient. thanks for the help!

    Read the article

  • suggestions for declarative GUI programming in Java

    - by Jason S
    I wonder if there are any suggestions for declarative GUI programming in Java. (I abhor visual-based GUI creator/editor software, but am getting a little tired of manually instantiating JPanels and Boxes and JLabels and JLists etc.) That's my overall question, but I have two specific questions for approaches I'm thinking of taking: JavaFX: is there an example somewhere of a realistic GUI display (e.g. not circles and rectangles, but listboxes and buttons and labels and the like) in JavaFX, which can interface with a Java sourcefile that accesses and updates various elements? Plain Old Swing with something to parse XUL-ish XML: has anyone invented a declarative syntax (like XUL) for XML for use with Java Swing? I suppose it wouldn't be hard to do, to create some code based on STaX which reads an XML file, instantiates a hierarchy of Swing elements, and makes the hierarchy accessible through some kind of object model. But I'd rather use something that's well-known and documented and tested than to try to invent such a thing myself. JGoodies Forms -- not exactly declarative, but kinda close & I've had good luck with JGoodies Binding. But their syntax for Form Layout seems kinda cryptic. edit: lots of great answers here! (& I added #3 above) I'd be especially grateful for hearing any experiences any of you have had with using one of these frameworks for real-world applications. p.s. I did try a few google searches ("java gui declarative"), just didn't quite know what to look for.

    Read the article

  • Any teams out there using TypeMock? Is it worth the hefty price tag?

    - by dferraro
    Hi, I hope this question is not 'controversial' - I'm just basically asking - has anyone here purchased TypeMock and been happy (or unhappy) with the results? We are a small dev shop of only 12 developers including the 2 dev managers. We've been using NMock so far but there are limitations. I have done research and started playing with TypeMock and I love it. It's super clean syntax and lets you basically mock everything, which is great for legacy code. The problem is - how do I justify to my boss spending 800-1200$ per license for an API which has 4-5 competitors that are completly free? 800-1200$ is how much Infragistrics or Telerik cost per license - and there sure as hell isn't 4-5 open source comparable UI frameworks... Which is why I find it a bit overpriced, albeit an awesome library... Any opinions / experiences are greatly appreciated. EDIT: after finding MOQ I thought I fell in love - until I found out that it's not fully supported in VB.NET because VB lacks lambda sub routines =(. Is anyone using MOQ for VB.NET? The problem is we are a mixed shop - we use C# for our CRM development and VB for everything else. Any guidence is greatly appreciated again

    Read the article

  • What is the best way to use Guice and JMock together?

    - by Yishai
    I have started using Guice to do some dependency injection on a project, primarily because I need to inject mocks (using JMock currently) a layer away from the unit test, which makes manual injection very awkward. My question is what is the best approach for introducing a mock? What I currently have is to make a new module in the unit test that satisfies the dependencies and bind them with a provider that looks like this: public class JMockProvider<T> implements Provider<T> { private T mock; public JMockProvider(T mock) { this.mock = mock; } public T get() { return mock; } } Passing the mock in the constructor, so a JMock setup might look like this: final CommunicationQueue queue = context.mock(CommunicationQueue.class); final TransactionRollBack trans = context.mock(TransactionRollBack.class); Injector injector = Guice.createInjector(new AbstractModule() { @Override protected void configure() { bind(CommunicationQueue.class).toProvider(new JMockProvider<QuickBooksCommunicationQueue>(queue)); bind(TransactionRollBack.class).toProvider(new JMockProvider<TransactionRollBack>(trans)); } }); context.checking(new Expectations() {{ oneOf(queue).retrieve(with(any(int.class))); will(returnValue(null)); never(trans); }}); injector.getInstance(RunResponse.class).processResponseImpl(-1); Is there a better way? I know that AtUnit attempts to address this problem, although I'm missing how it auto-magically injects a mock that was created locally like the above, but I'm looking for either a compelling reason why AtUnit is the right answer here (other than its ability to change DI and mocking frameworks around without changing tests) or if there is a better solution to doing it by hand.

    Read the article

  • Where can I find a professional image gallery built on a javascript framework?

    - by user278457
    I'm looking to find a galleria replacement, hopefully using jQuery but other javascript frameworks such as prototype or mootools are fine too. I used galleria a while back, and I need a similar product now. Unfortunately, the devkick.com domain seems to have disappeared in the meantime and I'm wary of using products that aren't actively maintained. I'm willing to pay up to $50 per site for licensing costs, if the product meets my needs. I'm specifically looking for a gallery with the following features: Every image in the gallery preloads asap, not as the user clicks "next" Minimalist default css to keep my subsequent styling headaches down, preferably a "darkroom" style by default, much as galleria looks Each element that constructs the image gallery should be simple and logical to reference with CSS As easy to install as adding a css class to a single unordered list No dependencies other than the core jQuery/other library, including "easing" and other effects must be optional Works on browsers back to IE6, Firefox 3, Safari (and iPhone), Chrome, Opera Has a javascript API that lets me trigger callback functions on common events such as "user clicks next" or "image loads" degrades gracefully without javascript, either displays images as a list, or just displays the first image in the list bonus: The gallery can display other content, such as video or external sites, like the modal boxes at shadowbox-js.com well documented minimal bandwidth requirement - .js file should be ~10kb minified bonus: The gallery source is hosted on a reliable CDN like google's bonus: Thumbnails for images do not appear until the main image has loaded bonus: includes ability to set parameters with JSON to change common behaviours, such as slide/fade transitions or automatic image switch every X seconds

    Read the article

  • Architecture for new ASP.NET web application

    - by Anders Abel
    I'm maintaining an application which currently is just a web service (built with WCF) and a database backend. The web service is built in layers with a linq-to-sql data access part with core functionality in an own assembly and on top of that the web service assembly which contains the WCF code. The core assembly also handles all business logic rules (very few actually). The customer now wants a Web interface for the application instead of just accessing it through other applications which are consuming the web service. I'm quite lost on modern web application design, so I would like some advice on what architecture and frameworks to use for the web application. The web application will be using the same core assembly with business rules and the linq-to-sql data access layer as the web service. Some concepts I've thought about are: ASP.NET MVC Webforms AJAX controls - possibly leting the AJAX controls access the existing web service through JSON. Are there any more concepts I should look into? Which one is the best for a fresh project? The development tools are Visual Studio 2008 Team Edition for Developers targeting .NET 3.5. An upgrade to Visual Studio 2010 Premium (or maybe even Ultimate) is possible if it gives any benefits.

    Read the article

  • BWToolkit inclusion crashing

    - by Schroedinger
    Hey guys I'm using the latest version of XCode (3.2.2) and I've linked the framework using the tutorial. I was building my app and tested it and I get a BWToolkit exception on decoding. I've included the Framework in the frameworks and added it to the copy files stage. I even created a new dummy app including the framework and adding it to the copy files stage and it still crashes when I try to run. Any ideas? Do I need to include it somewhere in the app? I'm worried I've overlooked something really simple. 2010-04-13 14:14:24.540 BWTestFramework[7504:a0f] An uncaught exception was raised 2010-04-13 14:14:24.543 BWTestFramework[7504:a0f] *** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (BWSplitView) 2010-04-13 14:14:24.545 BWTestFramework[7504:a0f] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (BWSplitView)' *** Call stack at first throw: ( 0 CoreFoundation 0x00007fff84a77d24 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x00007fff82ba00f3 objc_exception_throw + 45 2 CoreFoundation 0x00007fff84a77b47 +[NSException raise:format:arguments:] + 103 3 CoreFoundation 0x00007fff84a77ad4 +[NSException raise:format:] + 148 4 Foundation 0x00007fff83804aa6 _decodeObjectBinary + 2427 5 Foundation 0x00007fff83805825 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1229 6 Foundation 0x00007fff83805d65 -[NSArray(NSArray) initWithCoder:] + 462 7 Foundation 0x00007fff83804b1f _decodeObjectBinary + 2548 8 Foundation 0x00007fff83803f99 _decodeObject + 208 9 AppKit 0x00007fff8069fbfb -[NSView initWithCoder:] + 362 10 Foundation 0x00007fff83804b1f _decodeObjectBinary + 2548 11 Foundation 0x00007fff83803f99 _decodeObject + 208 12 AppKit 0x00007fff806adfbb -[NSWindowTemplate initWithCoder:] + 3824 13 Foundation 0x00007fff83804b1f _decodeObjectBinary + 2548 14 Foundation 0x00007fff83805825 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1229 15 Foundation 0x00007fff83805268 -[NSSet(NSSet) initWithCoder:] + 447 16 Foundation 0x00007fff83804b1f _decodeObjectBinary + 2548 17 Foundation 0x00007fff83803f99 _decodeObject + 208 18 AppKit 0x00007fff8062fcde -[NSIBObjectData initWithCoder:] + 1983 19 Foundation 0x00007fff83804b1f _decodeObjectBinary + 2548 20 Foundation 0x00007fff83803f99 _decodeObject + 208 21 AppKit 0x00007fff8062f40d loadNib + 146 22 AppKit 0x00007fff8062e96d +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 248 23 AppKit 0x00007fff8062e7a5 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 326 24 AppKit 0x00007fff8062bd27 NSApplicationMain + 279 25 BWTestFramework 0x0000000100001891 main + 33 26 BWTestFramework 0x0000000100001868 start + 52 ) terminate called after throwing an instance of 'NSException' That's the crash report

    Read the article

  • Automatic testing of GUI related private methods

    - by Stein G. Strindhaug
    When it comes to GUI programming (at least for web) I feel that often the only thing that would be useful to unit test is some of the private methods*. While unit testing makes perfect sense for back-end code, I feel it doesn't quite fit the GUI classes. What is the best way to add automatic testing of these? * Why I think the only methods useful to test is private: Often when I write GUI classes they don't even have any public methods except for the constructor. The public methods if any is trivial, and the constructor does most of the job calling private methods. They receive some data from server does a lot of trivial output and feeds data to the constructor of other classes contained inside it, adding listeners that calls a (more or less directly) calls the server... Most of it pretty trivial (the hardest part is the layout: css, IE, etc.) but sometimes I create some private method that does some advanced tricks, which I definitely do not want to be publicly visible (because it's closely coupled to the implementation of the layout, and likely to change), but is sufficiently complicated to break. These are often only called by the constructor or repeatedly by events in the code, not by any public methods at all. I'd like to have a way to test this type of methods, without making it public or resorting to reflection trickery. (BTW: I'm currently using GWT, but I feel this applies to most languages/frameworks I've used when coding for GUI)

    Read the article

  • Web Grid, Client side Binding VS. Server side HTML generation

    - by Ron Harlev
    I'm working on replacing an existing web grid in an ASP.NET web application, with a new implementation. The existing grid is powerful, but not flexible enough. It also brings with it all kind of frameworks we don't like to have on our web pages. While looking into existing options I noticed I can break the available solutions into two main approaches. The older approach is represented best by the ASP.NET GridView. This is a classic ASP.NET control that generates the needed HTML on the server, based on a given set of data. The newer approach is depending on client side rendering, mainly with jQuery. A good example would be jqGrid. Only the data is sent to the client (Usually with JSON or XML) In the GridView case, if I want an AJAX behavior, I would have to implement it with something like an update panel. Is there a definitive choice I should make? Is there a good chance of achieving the same snappy behavior I get with jqGrid (even with many records), with server side rendered controls? Is there some hybrid implementation incorporating both approaches?

    Read the article

  • Python: Catching / blocking SIGINT during system call

    - by danben
    I've written a web crawler that I'd like to be able to stop via the keyboard. I don't want the program to die when I interrupt it; it needs to flush its data to disk first. I also don't want to catch KeyboardInterruptedException, because the persistent data could be in an inconsistent state. My current solution is to define a signal handler that catches SIGINT and sets a flag; each iteration of the main loop checks this flag before processing the next url. However, I've found that if the system happens to be executing socket.recv() when I send the interrupt, I get this: ^C Interrupted; stopping... // indicates my interrupt handler ran Traceback (most recent call last): File "crawler_test.py", line 154, in <module> main() ... File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.py", line 397, in readline data = recv(1) socket.error: [Errno 4] Interrupted system call and the process exits completely. Why does this happen? Is there a way I can prevent the interrupt from affecting the system call?

    Read the article

  • PHP: MVC and Model

    - by Pirkka
    Hello I`ve been wondering this one thing about creating models. If I make for example Page model. Is it the both: It can retrieve one row from the table or all the rows. Somehow Im mixing the objects and the database. I have thought it like this: I would have to make a Page-class that would represent one row in the table. It also would have all the basic CRUD-methods. Then I would have to do a Pages-class (somekind of collection) that would retrieve rows from the table and instantiate a Page object from each row. Is this kind of weird? If someone could explain to me the idea of model throughout.. Im again confused. Maybe Im thinking the whole OOP too difficult.. And by the way this forum is great. Hopefully people will just understand my problems. Heh. I was a long time procedural style programmer and now in 3 months I have dived into OOP and MVC and PHP frameworks and I just get more excited day by day when I explore this stuff!

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >