Search Results

Search found 9 results on 1 pages for 'santiagobasulto'.

Page 1/1 | 1 

  • Software Architecture: Unit of Work design pattern discussion

    - by santiagobasulto
    Hey everybody. According Martin Fowler's Unit of Work description: "Maintains a list of objects that are affected by a business transaction and coordinates the writing out of changes and resolution of concurrency problems." Avoiding very small calls to the database, which ends up being very slow I'm wondering. If we just delimit it to database transaction management, won't prepare statements help with this?

    Read the article

  • How toget a list of "fastest miles" from a set of GPS Points

    - by santiagobasulto
    I'm trying to solve a weird problem. Maybe you guys know of some algorithm that takes care of this. I have data for a cargo freight truck and want to extract some data. Suppose I've got a list of sorted points that I get from the GPS. That's the route for that truck: [ { "lng": "-111.5373066", "lat": "40.7231711", "time": "1970-01-01T00:00:04Z", "elev": "1942.1789265256325" }, { "lng": "-111.5372056", "lat": "40.7228762", "time": "1970-01-01T00:00:07Z", "elev": "1942.109892409177" } ] Now, what I want to get is a list of the "fastest miles". I'll do an example: Given the points: A, B, C, D, E, F the distance from point A to point B is 1 mile, and the cargo took 10:32 minutes. From point B to point D i've got other mile, and the cargo took 10 minutes, etc. So, i need a list sorted by time. Similar to: B -> D: 10 A -> B: 10:32 D -> F: 11:02 Do you know any efficient algorithm that let me calculate that? Thank you all. PS: I'm using Python. EDIT: I've got the distance. I know how to calculate it and there are plenty of posts to do that. What I need is an algorithm to tokenize by mile and get speed from that. Having a distance function is not helpful enough: results = {} for point in points: aux_points = points.takeWhile(point>n) #This doesn't exist, just trying to be simple for aux_point in aux_points: d = distance(point, aux_point) if d == 1_MILE: time_elapsed = time(point, aux_point) results[time_elapsed] = (point, aux_point) I'm still doing some pretty inefficient calculations.

    Read the article

  • Java DAO caching

    - by santiagobasulto
    I'm developing a medium Java app, and i'm facing a small problem due to my lack of experience. I've a custom DAO, which gets "Article" objects from the Database. I've the Article class, and the DAO has a method called getArticle(int id), this method returns an Article. The Article has a Category object, and I'm using lazy loading. So, when I request for an article's category (Article a = new Article(); a.getCategory();) the Article class gets the Category from the DAO and then returns it. I'm now thinking to cache it, so when I request multiple times to an article's category, the database is only queried one time. My question is: where should I put that cache? I can put it on the Article class (in the DTO), or I can put it on the DAO class. What do you say?

    Read the article

  • Declaring Variables on Informix

    - by santiagobasulto
    Hi everybody. I've a Store Procedure Routine. I want to get some variables from the execution of that proc. But i don't know how to create it. For example: CREATE PROCEDURE foo() ... RETURN somebar; END PROCEDURE; then, when i call it: -- DEFINE bar, this is what i want to know!!!! execute procedure foo() into bar; How can i initialize "bar"???? Thanks!

    Read the article

  • Java Archtecture Decision !!

    - by santiagobasulto
    Hi everybody! I'm developing a medium Java app, and i'm facing a small problem due to my lack of expirience. I've a custom DAO, which gets "Article" objects from the DataBase. I've the Article class, and the DAO has a method called getArticle(int id), this method returns an Article. The Article has a Category object, and i'm using lazy loading. So, when i request for an Article Category (Article a = new Article(); a.getCategory();) the Article class gets the Category from the DAO and then returns it. I'm now thinking to cache it, so when i request multiple times to an Article's category, the database is only queried one time. My question is: where should i put that cache? I can put it on the Article class (in the DTO), or i can put it on the DAO class. What do you say? Thanks!

    Read the article

  • Reading barcodes from Java

    - by santiagobasulto
    Hello everyone. I'm dealing with a barcode reader in my java app. The problem is that the barcode, before and after reading and sending the actual barcode, sends a return code. I've some JTextFields and when the reader reads the barcode it change the focus, and then sends another return that makes the window to close. Is it anyway to "intercept" those "return" commands ?

    Read the article

  • Real life Java Swing Project

    - by santiagobasulto
    Hi everybody! I've been working with swing for the last 2 years, but i'm still not satisfy with my own work. The apps are "fast" enough, but the development isn't enough "clean". Can you recommend me any real world project, book, or something similar that shows me how a real world swing app work. May be a framework, something structured, etc. For example, i'm thinking i may code a "window manager" that has all the window of the app in an unified resource, may be cached, etc. I think all those good ideas must be implemented already. Thanks!

    Read the article

  • Java Architecture Decision !!

    - by santiagobasulto
    Hi everybody! I'm developing a medium Java app, and i'm facing a small problem due to my lack of expirience. I've a custom DAO, which gets "Article" objects from the DataBase. I've the Article class, and the DAO has a method called getArticle(int id), this method returns an Article. The Article has a Category object, and i'm using lazy loading. So, when i request for an Article Category (Article a = new Article(); a.getCategory();) the Article class gets the Category from the DAO and then returns it. I'm now thinking to cache it, so when i request multiple times to an Article's category, the database is only queried one time. My question is: where should i put that cache? I can put it on the Article class (in the DTO), or i can put it on the DAO class. What do you say? Thanks!

    Read the article

1