Search Results

Search found 4126 results on 166 pages for 'bitwise operations'.

Page 125/166 | < Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >

  • Best way to manipulate and compare strings

    - by vtortola
    I'm developing a REST service, so a request could be something like this: /Data/Main/Table=Customers/ I need to get the segments one by one, and for each segment I will decide wich object I'm going to use, after I'll pass to that object the rest of the query so it can decide what to do next. Basically, the REST query is a path on a tree :P This imply lots String operations (depending on the query complexity), but StringBuilder is useful just for concatenations and remove, you cannot perform a search with IndexOf or similar. I've developed this class that fulfill my requirement, but the problem is that is manipulating Strings, so every time I get one segment ... I'll create extra Strings because String is an inmutable data type: public class RESTQueryParser { String _query; public RESTQueryParser(String query) { _query = query; } public String GetNext() { String result = String.Empty; Int32 startPosition = _query.StartsWith("/", StringComparison.InvariantCultureIgnoreCase) ? 1 : 0; Int32 i = _query.IndexOf("/", startPosition, StringComparison.InvariantCultureIgnoreCase) - 1; if (!String.IsNullOrEmpty(_query)) { if (i < 0) { result = _query.Substring(startPosition, _query.Length - 1); _query = String.Empty; } else { result = _query.Substring(startPosition, i); _query = _query.Remove(0, i + 1); } } return result; } } The server should support a lot of calls, and the queries could be huge, so this is gonna be a very repetitive task. I don't really know how big is the impact on the memory and the performance, I've just readed about it in some books. Should I implement a class that manage a Char[] instead Strings and implement the methods that I want? Or should be ok with this one? Regular expressions maybe?

    Read the article

  • Will fixed-point arithmetic be worth my trouble?

    - by Thomas
    I'm working on a fluid dynamics Navier-Stokes solver that should run in real time. Hence, performance is important. Right now, I'm looking at a number of tight loops that each account for a significant fraction of the execution time: there is no single bottleneck. Most of these loops do some floating-point arithmetic, but there's a lot of branching in between. The floating-point operations are mostly limited to additions, subtractions, multiplications, divisions and comparisons. All this is done using 32-bit floats. My target platform is x86 with at least SSE1 instructions. (I've verified in the assembler output that the compiler indeed generates SSE instructions.) Most of the floating-point values that I'm working with have a reasonably small upper bound, and precision for near-zero values isn't very important. So the thought occurred to me: maybe switching to fixed-point arithmetic could speed things up? I know the only way to be really sure is to measure it, that might take days, so I'd like to know the odds of success beforehand. Fixed-point was all the rage back in the days of Doom, but I'm not sure where it stands anno 2010. Considering how much silicon is nowadays pumped into floating-point performance, is there a chance that fixed-point arithmetic will still give me a significant speed boost? Does anyone have any real-world experience that may apply to my situation?

    Read the article

  • Multiple undo managers for a text view

    - by Rui Pacheco
    Hi, I've a text view that gets its content from an attributed string stored in a model object. I list several of these model objects in a drawer and when the user clicks on one the text view swaps its content. I now need to also swap the undo manager for the text view. I initialise an undo manager on my model object and use undoManagerForTextView to return it to the text view, but something's not quite right. Strategically placed logging statements show me that everything's working as planned: on startup a new model object is initialised correctly and a non-null undo manager is always pulled by the text view. But when it comes to actually doing undo, I just can't get the behaviour I want. I open a window, type something and press cmd+z, and undo works. I open a window, type something, select a new model on the table, type something, go back to the first model and try to undo and all I get is a beep. Something on the documentation made me raise an eyebrow, as it would mean that I can't have undo with several model objects: The default undo and redo behavior applies to text fields and text in cells as long as the field or cell is the first responder (that is, the focus of keyboard actions). Once the insertion point leaves the field or cell, prior operations cannot be undone.

    Read the article

  • Coherent access to mainframe files from Win32 application and IBM RDZ/Eclipse?

    - by Ira Baxter
    I have a suite of tools for processing IBM COBOL source code; these tools are built as Win32 applications and talk to Windows (including network) files using traditional Windows file system calls (open, close, read, write) and work just fine, thank you. I'd like to integrate these with Eclipse; we understand how to get Eclipse to do UI for us we think. The problem is that Eclipse/RDZ users access mainframe files through some IBM magic. In How does RDZ access mainframe files I tried to understand how Eclipse accessed files on a mainframe. Apparantly Eclipse/RDZ has a secret filesystem access backdoor not available to normal mortals. At issue is how our tools, reading some Windows-accessible file (local disk file, NFS to mainframe, ...) can associate such files with the files that Eclipse can access or is using? Ideally we'd like UI-integrated versions of our tools take an Eclipse file-name string for a mainframe file, pass it to our Windows application to process, have the Windows application open/read/process the file, and return results associated with that file to the Eclipse UI. Is there a canonical file name path that would be used with mainframe NFS that would be equivalent to the name or access object the Eclipse RDZ used to access the same file? Are all operations doable internally by Eclipse, doable by the mainframe NFS [for instance, can NFS read/update an element in a partitioned data set? Can Eclipse RDZ? Does it matter?] Is the mainframe file access available to custom Java code running under Eclipse RDZ (e.g., equivalents of open/close/read/write based on filename/path/something?) If so, can somebody steer me towards documentation describing the access methods? Anybody else already solve this problem or have a good suggestion?

    Read the article

  • Can a WCF Service provide publish/subscribe activity to a Linux-based C++ client application?

    - by Jeremy Roddingham
    I have a WCF service written to provide certain functionality to intranet-based clients. This is easy when a client is running Windows. I want to implement the same functionality for my Windows clients that is available to my linux clients. My questions are? How can I communicate to a linux c++ based client (supporting callback operations for a publish subscribe) type situation? I am aware of using SOAP over the HTTPBinding but is that the only way (does not support callbacks I believe)? Would the same apply if I were using TCPBinding on the service-side? Currently, the service is set up using TCP but what are my options for the linux client communcation? I read somewhere that messages can also be sent (via webservices I believe) in XML rather than SOAP? Which would be a better approach or how to determine which is a better approach? I am trying to understand the options I would have for a WCF data service if I wanted to communicate with it from a linux client. I appreciate all your help. Thank You, Jeremy

    Read the article

  • Amazon EC2 and jbossws

    - by avjaz
    Hi - I've deployed a webservice to a Jboss instance running on Amazon EC2. The webservice works fine locally, but when I deploy on EC2, and go to the /jbossws/services page the Endpoint Address for the webservice is the private DNS of the ec2 instance (domU-X-X-X-X etc...), not the public dns (which I would like it to be). I've tried loading the wsdl by changing the private hostname to the public IP; that works, but when I try to call any of the operations I get a HostNotFoundException, I'm guessing due to the fact that the generated wsdl has the stanza: <service name='XXXService'> <port binding='tns:XXXBinding' name='XXXPort'> <soap:address location='http://domU-XX-XX-XX-XX-XX-XX.compute-1.internal:8080/xx/xx/xx'/> </port> </service> where http://domU-XX-XX-XX-XX-XX-XX.compute-1.internal is the internal dns of the ec2 instance. The wsdl is auto generated - Is there a JAXB annotation I can use so that I can force the generated wsdl to use the public dns of the EC2 instance? Many thanks -

    Read the article

  • theoretical and practical matrix multiplication FLOP

    - by mjr
    I wrote traditional matrix multiplication in c++ and tried to measure and compare its theoretical and practical FLOP. As I know inner loop of MM has 2 operation therefore simple MM theoretical Flops is 2*n*n*n (2n^3) but in practice I get something like 4n^3 + number of operation which is 2 i.e. 6n^3 also if I just try to add up only one array a[i][j]++ practical flops then calculate like 3n^3 and not n^3 as you see again it is 2n^3 +1 operation and not 1 operation * n^3 . This is in case if I use 1D array in three nested loops as Matrix multiplication and compare flop, practical flop is the same (near) the theoretical flop and depend exactly as the number of operation in inner loop.I could not find the reason for this behaviour. what is the reason in both case? I know that theoretical flop is not the same as practical one because of some operations like load etc. system specification: Intel core2duo E4500 3700g memory L2 cache 2M x64 fedora 17 sample results: Matrix matrix multiplication 512*512 Real_time: 1.718368 Proc_time: 1.227672 Total flpops: 807,107,072 MFLOPS: 657.429016 Real_time: 3.608078 Proc_time: 3.042272 Total flpops: 807,024,448 MFLOPS: 265.270355 theoretical flop: 2*512*512*512=268,435,456 Practical flops= 6*512^3 =807,107,072 Using 1 dimensional array float d[size][size]:512 or any size for (int j = 0; j < size; ++j) { for (int k = 0; k < size; ++k) { d[k]=d[k]+e[k]+f[k]+g[k]+r; } } Real_time: 0.002288 Proc_time: 0.002260 Total flpops: 1,048,578 MFLOPS: 464.027161 theroretical flop: *4n^2=4*512^2=1,048,576* practical flop : 4n^2+overhead (other operation?)=1,048,578 3 loop version: Real_time: 1.282257 Proc_time: 1.155990 Total flpops: 536,872,000 MFLOPS: 464.426117 theoretical flop:4n^3 = 536,870,912 practical flop: *4n^3=4*512^3+overheads(other operation?)=536,872,000* thank you

    Read the article

  • How do I use an SWT Control to render the content of an SWT/JFace table?

    - by jastram
    I have a JFace TableViewer with an SWT Table, and I would like to custom render the content of some cells. I would like to use an SWT Control to render the cell content. I would prefer to have only one instance of the Control doing the rendering, but if I have to instantiate one for each row, that would be acceptable. Next, the solution MUST be compatible with the ContentProvider/LabelProvider approach (I am using EMF). This means that I cannot use the solution described in Sniplet 126 (http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets). Next, I though about using custom drawing. But here the catch is, that I have to send individual drawing operations to the graphics context. I was trying to have the Control render the content for me by calling redraw() or print(GC) upon SWT.PaintItem, but that just lead to uncontrollable flickering. At this point, my best guess is to use SWT.PaintItem to do the drawing. This will result in duplicate code, as I already have a Control that can render the content the way I'd like it. I'd like to prevent this redundancy. Any help is appreciated!

    Read the article

  • General Drools Question

    - by El Guapo
    For the last few months my company has been using a product from a company called Informatica (previously AgentLogic) called RulePoint. This product has proven itself very easy to use with a well-developed and easy-to-use SDK for customization. The way we use the product for CEP is fairly trivial, we have 2 sources which we monitor for our rule data, the first being a JMS Queue, the second being a Jabber IM account. The product runs on any java-based application server (WebLogic, Tomcat, etc) and runs just about flawlessly. Last week my boss says, "Hey, I've heard that we may be able to do the same thing we are doing with RulePoint with an open-source product called Drools. Check it out and let me know what you think." I've heard of people using Drools for flow-based operations (validation, etc), however, I've never heard of anyone using their CEP product (Fusion) in practice. So, being the diligent worker, I have undertaken this task. I've downloaded all the files (version 5.0) and accompanying documentation and have started to read. I've read through just about all the docs and run most of the examples, but I still don't really see HOW drools works for CEP. While there are examples for using Data (or Facts, I guess) from JMS, I don't see how this thing stays "running", continuously monitoring a queue until the application is actually stopped. RulePoint pretty must just sits and listens, however, Drools seems to not. I could probably write a full-blown command-line application for our needs, however, I was hoping to leverage some of the benefits of using a application server provides. I guess I'm looking for some good tutorials or an example of how someone is using Drools and CEP in production. Thanks in advanced for any information, advice you may be able to provide.

    Read the article

  • Why isn’t my autoreleased object getting released?

    - by zoul
    Hello. I am debugging a weird memory management error and I can’t figure it out. I noticed that some of my objects are staying in memory longer than expected. I checked all my memory management and finally got to the very improbable conclusion that some of my autorelease operations don’t result in a release. Under what circumstances is that possible? I created a small testing Canary class that logs a message in dealloc and have the following testing code in place: NSLog(@"On the main thread: %i.", [NSThread isMainThread]); [[[Canary alloc] init] autorelease]; According to the code we’re really on the main thread, but the dealloc in Canary does not get called until much later. The delay is not deterministic and can easily take seconds or more. How is that possible? The application runs on a Mac, the garbage collection is turned off (Objective-C Garbage Collection is set to Unsupported on the target.) I am mostly used to iOS, is memory management on OS X different in some important way?

    Read the article

  • Asynchronously populate datagridview in Windows Forms application

    - by dcryptd
    howzit! I'm a web developer that has been recently requested to develop a Windows forms application, so please bear with me (or dont laugh!) if my question is a bit elementary. After many sessions with my client, we eventually decided on an interface that contains a tabcontrol with 5 tabs. Each tab has a datagridview that may eventually hold up to 25,000 rows of data (with about 6 columns each). I have successfully managed to bind the grids when the tab page is loaded and it works fine for a few records, but the UI freezes when I bound the grid with 20,000 dummy records. The "freeze" occurs when I click on the tab itself, and the UI only frees up (and the tab page is rendered) once the bind is complete. I communicated this to the client and mentioned the option of paging for each grid, but she is adament w.r.t. NOT wanting this. My only option then is to look for some asynchronous method of doing this in the background. I don't know much about threading in windows forms, but I know that I can use the BackgroundWorker control to achieve this. My only issue after reading up a bit on it is that it is ideally used for "long-running" tasks and I/O operations. My questions: How does one determine a long-running task? How does one NOT MISUSE the BackgroundWorker control, ie. is there a general guideline to follow when using this? (I understand that opening/spawning multiple threads may be undesirable in certain instances) Most importantly: How can I achieve (asychronously) binding of the datagridview after the tab page - and all its child controls - loads. Thank you for reading this (ahem) lengthy query, and I highly appreciate any responses/thoughts/directions on this matter! Cheers!

    Read the article

  • TinyMCE Image Alignment

    - by will.earp.co.uk
    TinyMCE has always been a little difficult to align images. Either the align tag, or adding style="float: left;" has been it solution. Ideally I would just like to add class="left" or class="right" so that I can set the border and margins of the image. Up until now the only way to do this without using the advimage plugin was to insert the image, then select it, the select a style from the style menu. Ideally I should be able to use the align control in the image dialogue to set the alignment class or use the alignment controls on the toolbar when in the main editing window. I have just again started looking at a solution to this, now that IE6 is finally starting to die, I can use CSS attributes in selectors, so IMG[style="float: left;"] {} Works, but I would rather use a class incase there are any other style attributes which will cause the selector to fail. And it doesn't work in IE6, and you know some corporate clients will still be running the bloody thing! So I looked through the TinyMCE documentation and found the formats configuration option, that seems to allow you to specify how tinyMCE applies code for various operations. Here I can add the IMG tag as a selector, and have classes: "left" for the alignleft function. This applies the class correctly when the alignment is selected from the toolbar, but it still writes an inline style when the alignment is selected through the image dialogue. Am I doing something wrong or is there a better way of doing this that will allow my clients to select image alignment from both the image dialogue and the toolbar, whilst applying a class to the image?

    Read the article

  • Error checking overkill?

    - by James
    What error checking do you do? What error checking is actually necessary? Do we really need to check if a file has saved successfully? Shouldn't it always work if it's tested and works ok from day one? I find myself error checking for every little thing, and most of the time if feels overkill. Things like checking to see if a file has been written to a file system successfully, checking to see if a database statement failed.......shouldn't these be things that either work or don't? How much error checking do you do? Are there elements of error checking that you leave out because you trust that it'll just work? I'm sure I remember reading somewhere something along the lines of "don't test for things that'll never really happen".....can't remember the source though. So should everything that could possibly fail be checked for failure? Or should we just trust those simpler operations? For example, if we can open a file, should we check to see if reading each line failed or not? Perhaps it depends on the context within the application or the application itself. It'd be interesting to hear what others do. Thanks, James.

    Read the article

  • Job Opportunities

    - by James
    I have a few questions about my job opportunities and I appreaciate it if people could give me some feedback on what I should have in front of me. I am graduatating from a University of Wisconsin--La Crosse this December with a degree in CS and a math minor. I have a cumulative GPA of 3.84 and a major GPA of 4.0 right now (though I still have many classes in front of me). I already have a degree from the U of Minnesota (History, 3.69 GPA) and have worked in the business world for 3+ years (working for a small company in the baseball world, doing some computer programming, statistical research, operations work, technical writing, etc.) I know Java and C well, also am comfortable with Perl. I should have a good grasp of SQL by graduation. I am looking to get a nice programming job (and will be open to moving). Anyone have any advice on things I should learn etc? Also, I would like to know what everyone thinks about my chances of landing a decent job (I realize that is subjective). Also, any ideas on salary I should be looking for (say I am working a metropolitan area). Thanks.

    Read the article

  • nasm/yasm arguments, linkage to C++

    - by arionik
    Hello everybody, I've got a question concerning nasm and its linkage to C++. I declare a litte test function as extern "C" void __cdecl myTest( byte i1, byte i2, int stride, int *width ); and I call it like this: byte i1 = 1, i2 = 2; int stride = 3, width = 4; myTest( i1, i2, stride, &width ); the method only serves to debug assembly and have a look at how the stack pointer is used to get the arguments. beyond that, the pointer arguments value shall be set to 7, to figure out how that works. This is implemented like this: global _myTest _myTest: mov eax, [esp+4] ; 1 mov ebx, [esp+8] ; 2 mov ecx, dword [esp+16] ; width mov edx, dword [esp+12] ; stride mov eax, dword [esp+16] mov dword [eax], 7 ret and compiled via yasm -f win32 -g cv8 -m x86 -o "$(IntDir)\$(InputName).obj" "$(InputPath)" , then linked to the c++ app. In debug mode, everything works fine. the function is called a couple of times and works as expected, whereas in release mode the function works once, but subsequent programm operations fail. It seems to me that something's wrong with stack/frame pointers, near/far, but I'm quite new to this subject and need a little help. thanks in advance! a.

    Read the article

  • Understanding floating point problems

    - by Maxim Gershkovich
    Could someone here please help me understand how to determine when floating point limitations will cause errors in your calculations. For example the following code. CalculateTotalTax = function (TaxRate, TaxFreePrice) { return ((parseFloat(TaxFreePrice) / 100) * parseFloat(TaxRate)).toFixed(4); }; I have been unable to input any two values that have caused for me an incorrect result for this method. If I remove the toFixed(4) I can infact see where the calculations start to lose accuracy (somewhere around the 6th decimal place). Having said that though, my understanding of floats is that even small numbers can sometimes fail to be represented or have I misunderstood and can 4 decimal places (for example) always be represented accurately. MSDN explains floats as such... This means they cannot hold an exact representation of any quantity that is not a binary fraction (of the form k / (2 ^ n) where k and n are integers) Now I assume this applies to all floats (inlcuding those used in javascript). Fundamentally my question boils down to this. How can one determine if any specific method will be vulnerable to errors in floating point operations, at what precision will those errors materialize and what inputs will be required to produce those errors? Hopefully what I am asking makes sense.

    Read the article

  • Subversion versus Vault

    - by WebDude
    I'm currently reviewing the benefits of moving from SVN to a SourceGear Vault. Has anyone got advice or a link to a detailed comparison between the two? Bear in mind I would have to move my current Source Control system across which works strongly in SVN's favor Here is some info I have found out thus far from my own investigations. I have been taking some time tests between the two and vault seems to perform most operations much faster. Time tests used the same server as the repository, the same workstation client, and the same project. Time Comparisons SVN Add/Commit    12:30 Get Latest Revision    5:35 Tagging/Labelling    0:01 Branching    N/A - I don't think true branching exists in SVN Vault Add/Commit    4:45 Get Latest Revision    0:51 Tagging/Labelling    0:30 Branching    3:23 (can't get this to format correctly) I also found an online source comparing some other points. This is the kind of information i'm looking for. Usage Comparisons Subversion is edit/merge/commit only. Vault allows you to do either edit/merge/commit or checkout/edit/checkin. Vault looks and acts just like VSS, which makes the learning curve effectively zero for VSS users. Vault has a VS plugin, but it only works if you're going to run in checkout-mode. Subversion has clients for pretty much every OS you can imagine; Vault has a GUI client for Windows and a command line client for Mono. Both will support remote work, since both use HTTP as their transport (Subversion uses extended DAV, Vault uses SOAP). Subversion installation, especially w/ Apache, is more complex. Subversion has a lot of third party support. Vault has just a few things. My question Has anyone got advice or a link to a detailed comparison between the two?

    Read the article

  • Unable to call RESTful web services methods

    - by Alessandro
    Hello, I'm trying to dive into the RESTful web services world and have started with the following template: [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class Test { // TODO: Implement the collection resource that will contain the SampleItem instances [WebGet(UriTemplate = ""), OperationContract] public List<SampleItem> GetCollection() { // TODO: Replace the current implementation to return a collection of SampleItem instances return new List<SampleItem>() {new SampleItem() {Id = 1, StringValue = "Hello"}}; } [WebInvoke(UriTemplate = "", Method = "POST"), OperationContract] public SampleItem Create(SampleItem instance) { // TODO: Add the new instance of SampleItem to the collection throw new NotImplementedException(); } [WebGet(UriTemplate = "{id}"), OperationContract] public SampleItem Get(string id) { // TODO: Return the instance of SampleItem with the given id throw new NotImplementedException(); } [WebInvoke(UriTemplate = "{id}", Method = "PUT"), OperationContract] public SampleItem Update(string id, SampleItem instance) { return new SampleItem { Id = 99, StringValue = "Done" }; } [WebInvoke(UriTemplate = "{id}", Method = "DELETE"), OperationContract] public void Delete(string id) { // TODO: Remove the instance of SampleItem with the given id from the collection throw new NotImplementedException(); } } I am able to perform the GET operation but I am unable to perform PUT, POST or DELETE requests. Can anyone explain me how to perform these operations and how to create the correct URLs? Best regards Alessandro

    Read the article

  • .NET Framework installation requirements

    - by Paja
    What are the requirements for all .NET frameworks and their service packs? This is what I need to know for all available frameworks: .NET Framework prerequisites What other .NET Frameworks does it require? For example: .NET Framework 2.0 does not require anything, .NET Framework 2.0 SP1 requires .NET Framework 2.0 installed, but .NET Framework 3.5 SP1 does not require .NET Framework 3.5 installed (or maybe does? dunno) Reboot requirements Does the installation package require reboot after installation? Clean install requirements Does the installation package require clean install? (No pending delete/rename operations) Administrator privileges Does the installation package require administrator privileges to install? (I guess this is "yes" for all of them...) And I need to know all of this for the following packages: .NET Framework 1.1 .NET Framework 1.1 Language Pack .NET Framework 1.1 SP 1 .NET Framework 2.0 .NET Framework 2.0 Language Pack .NET Framework 2.0 SP 1 .NET Framework 2.0 SP 1 Language Pack .NET Framework 2.0 SP 2 .NET Framework 2.0 SP 2 Language Pack .NET Framework 3.5 .NET Framework 3.5 Language Pack .NET Framework 3.5 SP 1 .NET Framework 3.5 SP 1 Language Pack .NET Framework 4.0 Full .NET Framework 4.0 Client Could you please either tell me all of these requirements, or direct me to the appropriate source? Or maybe both? :-)

    Read the article

  • System.Dynamic bug?

    - by ControlFlow
    While I playing with the C# 4.0 dynamic, I found strange things happening with the code like this: using System.Dynamic; sealed class Foo : DynamicObject { public override bool TryInvoke( InvokeBinder binder, object[] args, out object result) { result = new object(); return true; } static void Main() { dynamic foo = new Foo(); var t1 = foo(0); var t2 = foo(0); var t3 = foo(0); var t4 = foo(0); var t5 = foo(0); } } Ok, it works but... take a look at IntelliTrace window: So every invokation (and other operations too on dynamic object) causes throwing and catching strange exceptions twice! I understand, that sometimes exceptions mechanism may be used for optimizations, for example first call to dynamic may be performed to some stub delegate, that simply throws exception - this may be like a signal to dynamic binder to resolve an correct member and re-point delegate. Next call to the same delegate will be performed without any checks. But... behavior of the code above looks very strange. Maybe throwing and catching exceptions twice per any operation on DynamicObject - is a bug?

    Read the article

  • DDD and Client/Server apps

    - by Christophe Herreman
    I was wondering if any of you had successfully implemented DDD in a Client/Server app and would like to share some experiences. We are currently working on a smart client in Flex and a backend in Java. On the server we have a service layer exposed to the client that offers CRUD operations amongst some other service methods. I understand that in DDD these services should be repositories and services should be used to handle use cases that do not fit inside a repository. Right now, we mimic these services on the client behind an interface and inject implementations (Webservices, RMI, etc) via an IoC container. So some questions arise: should the server expose repositories to the client or do we need to have some sort of a facade (that is able to handle security for instance) should the client implement repositories (and DDD in general?) knowing that in the client, most of the logic is view related and real business logic lives on the server. All communication with the server happens asynchronously and we have a single threaded programming model on the client. how about mapping client to server objects and vice versa? We tried DTO's but reverted back to exposing the state of our objects and mapping directly to them. I know this is considered bad practice, but it saves us an incredible amount of time) In general I think a new generation of applications is coming with the growth of Flex, Silverlight, JavaFX and I'm curious how DDD fits into this.

    Read the article

  • OpenGL bitmap text fails after drawing polygon

    - by kaykun
    I'm using Win32 and OpenGL to to draw text onto a window. I'm using the bitmap font method, with wglUseFontBitmaps. Here is my main rendering function: glClear(GL_COLOR_BUFFER_BIT); glPushMatrix(); glColor3f(1.0f, 0.0f, 1.0f); glBegin(GL_QUADS); glVertex2f(0.0f, 0.0f); glVertex2f(128.0f, 0.0f); glVertex2f(128.0f, 128.0f); glVertex2f(0.0f, 128.0f); glEnd(); glPopMatrix(); glPushMatrix(); glColor3f(1.0f, 1.0f, 1.0f); glRasterPos2i(200, 200); glListBase(fontList); glCallLists(5, GL_UNSIGNED_BYTE, "Test."); glPopMatrix(); SwapBuffers(hDC); As you can see it's very simple and the only thing that it's supposed to do is draw a quadrilateral and draw the text "Test.". But the problem is that drawing a polygon seems to mess up any text operations I try to do after it. If I place the text drawing functions before the polygon, both the text and the polygon draw fine. Is there something I'm missing here? Edit: This problem only happens when the window is run in Fullscreen, by ChangeDisplaySettings. Any reason why this would be??

    Read the article

  • Looking for Recommendations on Version Control System with Intuitive (.NET) API?

    - by John L.
    I'm working on a project which generates (composite) Microsoft Word documents which are comprised of one or more child documents. There are tens of thousands of permutations of the composite documents. Far too many for users to easily manage. Users will need to view/edit the child documents through the app which hides all of the nasty implementation details. A requirement of the system is that the child documents must be version controlled. That is what has been tripping me up. I've been torn between using an off-the-shelf solution or rolling my own. At a minimum, the system needs to support get latest, get specific version, add new, rename and possibly delete. I’ve whiteboarded it enough to realize it won’t be a trivial task to create my own. As far as commercial systems I have VSS and TFS at my disposal. I've played with the TFS API some, but it isn’t as intuitive or well documented as I had hoped. I'm not averse to an open source solution (e.g. SVN), but I have less familiarity with them. Which approach or tool would you recommend? Why? Do you have any links to API documentation you would recommend? Environment: C#, VS2008, SQL Server 2005/2008, low volume (a few hundred operations per day)

    Read the article

  • .Net: What is your confident approach in "Catch" section of try-catch block, When developing CRUD op

    - by odiseh
    hi, I was wondering if there would be any confident approach for use in catch section of try-catch block when developing CRUD operations(specially when you use a Database as your data source) in .Net? well, what's your opinion about below lines? public int Insert(string name, Int32 employeeID, string createDate) { SqlConnection connection = new SqlConnection(); connection.ConnectionString = this._ConnectionString; try { SqlCommand command = connection.CreateCommand(); command.CommandType = CommandType.StoredProcedure; command.CommandText = "UnitInsert"; if (connection.State != ConnectionState.Open) connection.Open(); SqlCommandBuilder.DeriveParameters(command); command.Parameters["@Name"].Value = name; command.Parameters["@EmployeeID"].Value = employeeID; command.Parameters["@CreateDate"].Value = createDate; int i = command.ExecuteNonQuery(); command.Dispose(); return i; } catch { **// how do you "catch" any possible error here?** return 0; // } finally { connection.Close(); connection.Dispose(); connection = null; } }

    Read the article

  • Rest WebService error handling.

    - by Pratik
    Hi there, I am using RestWebservice for few basic operations , like creating/searching. The request xml looks something like this <customer> <name/> ..... </customer> For a successful operation I return the same customer XML with extra fields populated in it(eg. systemId etc which we blank in the request) . with Response.Status=2000 For an unsuccessful operation i return something like this with different error codes . e.g Response.Status = 422(Unprocessable entity) Response.Status= 500(Internal Server Error) and few others.. <errors> <error> An exception occurred while creating the customer</error> <error> blah argument is not valid.</error> </errors> Now i am not sure , whether this is the correct way of sending the errors to the client. Maybe it should be present in the header of the response. I will really appreciate any help. Thanks!

    Read the article

< Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >