Search Results

Search found 297 results on 12 pages for 'diego garcia'.

Page 7/12 | < Previous Page | 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • In C#, can I hide/modify accessors in subclasses?

    - by Diego
    I'm not even sure what this principle is called or how to search for it, so I sincerely apologize if it has been brought up before, but the best way to do it is with an example. class Properties { public string Name { get; set; } } class MyClass { class SubProperties: Properties { public override Name { get { return GetActualName(); } set { _value = SetActualName(value); } } } public SubProperties ClassProperties; private GetActualName() { ClassProperties.Name = "name"; } private SetActualName(string s) { ClassProperties.Name = SomeOtherFunction(s); } } The idea is to have any object that instantiates MyClass have a fully accessible property ClassProperties. To that object, it would look exactly like a Properties object, but behind the scenes, MyClass is actually computing and modifying the results of the fields. This method of declaration is obviously wrong since I can't access GetActualName() and SetActualName() from within the SubProperties definition. How would I achieve something like this?

    Read the article

  • Get Max() record from table by group

    - by Garcia Julien
    Hi, i've got a table like that : Article Number Last Voucher Number Last Voucher Date 0557934 519048 04/02/2005 0557934 519067 04/02/2005 0557934 528630 09/29/2005 0557934 528631 09/29/2005 0557934 529374 10/13/2005 0557934 529375 10/13/2005 0557934 529471 10/16/2005 0557934 529472 10/16/2005 0557934 535306 01/08/2006 0557934 535307 01/08/2006 0557934 1106009 08/10/2006 0557934 1106010 08/10/2006 0022738 22554 02/20/1995 0022738 22595 03/12/1995 0022738 22597 03/15/1995 0022738 22605 03/19/1995 0022738 22616 03/25/1995 0022738 22621 03/28/1995 0022738 22630 04/05/1995 I would like to have only the record with the last date : Article Number Last Voucher Number Last Voucher Date 0557934 1106010 08/10/2006 0022738 22630 04/05/1995 I can do directly on SQL or on Linq. Any idea? Ju

    Read the article

  • HQL over ternary map with subcollection

    - by Diego Mijelshon
    I'm stuck with a query I need to write. Given the following model: public class A : Entity<Guid> { public virtual IDictionary<B, C> C { get; set; } } public class B : Entity<Guid> { } public class C : Entity<Guid> { public virtual int Data1 { get; set; } public virtual ICollection<D> D { get; set; } } public class D : Entity<Guid> { public virtual int Data2 { get; set; } } I need to get a list of A instances that have a D containing some data for the specified B (parameter) In the object model, that would be: listOfA.Where(a => a.C[b].D.Any(d => d.Data2 == 0)) But I wasn't able to write a working HQL. I'm able to write something like the following, which filters on C.Data1: from A a where a.C[:b].Data1 = 0 But I'm unable to do anything with the elements of a.C[:b].D (I get various parsing exceptions) Here are the mappings, in case you're interested (nothing special, generated by ConfORM): <class name="A"> <id name="Id" type="Guid"> <generator class="guid.comb" /> </id> <map name="C"> <key column="a_key" /> <map-key-many-to-many class="B" /> <one-to-many class="C" /> </map> </class> <class name="B"> <id name="Id" type="Guid"> <generator class="guid.comb" /> </id> </class> <class name="C"> <id name="Id" type="Guid"> <generator class="guid.comb" /> </id> <property name="Data1" /> <bag name="D"> <key column="c_key" /> <one-to-many class="D" /> </bag> </class> <class name="D"> <id name="Id" type="Guid"> <generator class="guid.comb" /> </id> <property name="Data2" /> </class> Thanks!

    Read the article

  • Dependency Injection wcf

    - by Diego Dias
    I want inject a implementation of my Interface in the WCF but I want initialize my container of Dependency Injection in the Client of the WCF. So I can have a different implementation for each client of the my service. Help me please.

    Read the article

  • Loop append div and repeat

    - by Diego Vieira
    I have this code <div class="round-3-top"> <div class="round-2-top"> <div class="round-1-top"></div> <div class="round-1-bottom"></div> </div> <div class="round-2-bottom"> <div class="round-1-top"></div> <div class="round-1-bottom"></div> </div> </div> <div class="round-3-bottom"> <div class="round-2-top"> <div class="round-1-top"></div> <div class="round-1-bottom"></div> </div> <div class="round-2-bottom"> <div class="round-1-top"></div> <div class="round-1-bottom"></div> </div> </div> But i want generate dynamically, how i do that? Ex.: i have 4 rounds, this would be the generated code <div class="round-4-top"> <div class="round-3-top"> <div class="round-2-top"> <div class="round-1-top"></div> <div class="round-1-bottom"></div> </div> <div class="round-2-bottom"> <div class="round-1-top"></div> <div class="round-1-bottom"></div> </div> </div> <div class="round-3-bottom"> <div class="round-2-top"> <div class="round-1-top"></div> <div class="round-1-bottom"></div> </div> <div class="round-2-bottom"> <div class="round-1-top"></div> <div class="round-1-bottom"></div> </div> </div> </div> <div class="round-4-bottom"> <div class="round-3-top"> <div class="round-2-top"> <div class="round-1-top"></div> <div class="round-1-bottom"></div> </div> <div class="round-2-bottom"> <div class="round-1-top"></div> <div class="round-1-bottom"></div> </div> </div> <div class="round-3-bottom"> <div class="round-2-top"> <div class="round-1-top"></div> <div class="round-1-bottom"></div> </div> <div class="round-2-bottom"> <div class="round-1-top"></div> <div class="round-1-bottom"></div> </div> </div> </div> I try using TagBuilder in MVC C# but I can not do. What should happen is, if you are 3 rounds, adding he should go inside each div is like the example above. Any idea how can I develop it?

    Read the article

  • Blackberry ListField Text Wrapping - only two lines.

    - by Diego Tori
    Within my ListField, I want to be able to take any given long String, and just be able to wrap the first line within the width of the screen, and just take the remaining string and display it below and ellipsis the rest. Right now, this is what I'm using to detect wrapping within my draw paint call: int totalWidth = 0; int charWidth = 0; int lastIndex = 0; int spaceIndex = 0; int lineIndex = 0; String firstLine = ""; String secondLine = ""; boolean isSecondLine = false; for (int i = 0; i < longString.length(); i++){ charWidth = Font.getDefault().getAdvance(String.valueOf(longString.charAt(i))); //System.out.println("char width: " + charWidth); if(longString.charAt(i) == ' ') spaceIndex = i; if((charWidth + totalWidth) > (this.getWidth()-32)){ //g.drawText(longString.substring(lastIndex, spaceIndex), xpos, y +_padding, DrawStyle.LEFT, w - xpos); lineIndex++; System.out.println("current lines to draw: " + lineIndex); /*if (lineIndex = 2){ int idx = i; System.out.println("first line " + longString.substring(lastIndex, spaceIndex)); System.out.println("second line " + longString.substring(spaceIndex+1, longString.length())); }*/ //firstLine = longString.substring(lastIndex, spaceIndex); firstLine = longString.substring(0, spaceIndex); //System.out.println("first new line: " +firstLine); //isSecondLine=true; //xpos = 0; //y += Font.getDefault().getHeight(); i = spaceIndex + 1; lastIndex = i; System.out.println("Rest of string: " + longString.substring(lastIndex, longString.length())); charWidth = 0; totalWidth = 0; } totalWidth += charWidth; System.out.println("total width: " + totalWidth); //g.drawText(longString.substring(lastIndex, i+1), xpos, y + (_padding*3)+4, DrawStyle.ELLIPSIS, w - xpos); //secondLine = longString.substring(lastIndex, i+1); secondLine = longString.substring(lastIndex, longString.length()); //isSecondLine = true; } Now this does a great job of actually wrapping any given string (assuming the y values were properly offsetted and it only drew the text after the string width exceeded the screen width, as well as the remaining string afterwards), however, every time I try to get the first two lines, it always ends up returning the last two lines of the string if it goes beyond two lines. Is there a better way to do this sort of thing, since I am fresh out of ideas?

    Read the article

  • work benefits package [closed]

    - by Francisco Garcia
    For those of you who are into programming not just for the money. I would like to know which benefits you would like to have (or already have). OK, maybe taking away the money factor will limit this question too much. I am surprised to see that most companies have a fixed set for their benefits package. Were you able to negotiate something new or just your salary? What things have you seen out there and/or value most?

    Read the article

  • Security issue using Nant

    - by Diego C.
    I need to store authentication information and I rather not have the password in plain text: <property name="user" value="theUser"/> <property name="password" value="secret"/> Has anyone figured out a way to encrypt property values in Nant? I've looked in Nant and Nantcontrib docs but no mention of encryption. I am considering going the route of creating my own Nant Task. Any suggestions?

    Read the article

  • REST web service keeps first POST parametrs

    - by Diego
    I have a web service in REST, designed with Java and deployed on Tomcat. This is the web service structure: @Path("Personas") public class Personas { @Context private UriInfo context; /** * Creates a new instance of ServiceResource */ public Personas() { } @GET @Produces("text/html") public String consultarEdad (@QueryParam("nombre") String nombre) { ConectorCliente c = new ConectorCliente("root", "cafe.sql", "test"); int edad = c.consultarEdad(nombre); if (edad == Integer.MIN_VALUE) return "-1"; return String.valueOf(edad); } @POST @Produces("text/html") public String insertarPersona(@QueryParam("nombre") String msg, @QueryParam("edad") int edad) { ConectorCliente c = new ConectorCliente("usr", "passwd", "dbname"); c.agregar(msg, edad); return "listo"; } } Where ConectorCliente class is MySQL connector and querying class. So, I had tested this with the @GET actually doing POST work, any user inputed data and information from ma Java FX app and it went direct to webservice's database. However, I changed so the CREATE operation was performed through a webservice responding to an actual POST HTTP request. However, when I run the client and add some info, parameters go OK, but in next time I input different parameters it'll input the same. I run this several times and I can't get the reason of it. This is the clients code: public class WebServicePersonasConsumer { private WebTarget webTarget; private Client client; private static final String BASE_URI = "http://localhost:8080/GetSomeRest/serviciosweb/"; public WebServicePersonasConsumer() { client = javax.ws.rs.client.ClientBuilder.newClient(); webTarget = client.target(BASE_URI).path("Personas"); } public <T> T insertarPersona(Class<T> responseType, String nombre, String edad) throws ClientErrorException { String[] queryParamNames = new String[]{"nombre", "edad"}; String[] queryParamValues = new String[]{nombre, edad}; ; javax.ws.rs.core.Form form = getQueryOrFormParams(queryParamNames, queryParamValues); javax.ws.rs.core.MultivaluedMap<String, String> map = form.asMap(); for (java.util.Map.Entry<String, java.util.List<String>> entry : map.entrySet()) { java.util.List<String> list = entry.getValue(); String[] values = list.toArray(new String[list.size()]); webTarget = webTarget.queryParam(entry.getKey(), (Object[]) values); } return webTarget.request().post(null, responseType); } public <T> T consultarEdad(Class<T> responseType, String nombre) throws ClientErrorException { String[] queryParamNames = new String[]{"nombre"}; String[] queryParamValues = new String[]{nombre}; ; javax.ws.rs.core.Form form = getQueryOrFormParams(queryParamNames, queryParamValues); javax.ws.rs.core.MultivaluedMap<String, String> map = form.asMap(); for (java.util.Map.Entry<String, java.util.List<String>> entry : map.entrySet()) { java.util.List<String> list = entry.getValue(); String[] values = list.toArray(new String[list.size()]); webTarget = webTarget.queryParam(entry.getKey(), (Object[]) values); } return webTarget.request(javax.ws.rs.core.MediaType.TEXT_HTML).get(responseType); } private Form getQueryOrFormParams(String[] paramNames, String[] paramValues) { Form form = new javax.ws.rs.core.Form(); for (int i = 0; i < paramNames.length; i++) { if (paramValues[i] != null) { form = form.param(paramNames[i], paramValues[i]); } } return form; } public void close() { client.close(); } } And this this the code when I perform the operations in a Java FX app: String nombre = nombreTextField.getText(); String edad = edadTextField.getText(); String insertToDatabase = consumidor.insertarPersona(String.class, nombre, edad); So, as parameters are taken from TextFields, is quite odd why second, third, fourth and so on POSTS post the SAME.

    Read the article

  • How to calculate real-time stats?

    - by Diego Jancic
    I have a site with millions of users (well, actually it doesn't have any yet, but let's imagine), and I want to calculate some stats like "log-ins in the past hour". The problem is similar to the one described here: http://highscalability.com/blog/2008/4/19/how-to-build-a-real-time-analytics-system.html The simplest approach would be to do a select like this: select count(distinct user_id) from logs where date>='20120601 1200' and date <='20120601 1300' (of course other conditions could apply for the stats, like log-ins per country) Of course this would be really slow, mainly if it has millions (or even thousands) of rows, and I want to query this every time a page is displayed. How would you summarize the data? What should go to the (mem)cache? EDIT: I'm looking for a way to de-normalize the data, or to keep the cache up-to-date. For example I could increment an in-memory variable every time someone logs in, but that would help to know the total amount of logins, not the "logins in the last hour". Hope it's more clear now.

    Read the article

  • Overcoming C limitations for large projects

    - by Francisco Garcia
    One aspect where C shows its age is the encapsulation of code. Many modern languages has classes, namespaces, packages... a much more convenient to organize code than just a simple "include". Since C is still the main language for many huge projects. How do you to overcome its limitations? I suppose that one main factor should be lots of discipline. I would like to know what you do to handle large quantity of C code, which authors or books you can recommend.

    Read the article

  • Python singleton pattern

    - by Javier Garcia
    Hi, someone can tell me why this is incorrect as a singleton pattern: class preSingleton(object): def __call__(self): return self singleton = preSingleton() a = singleton() b = singleton() print a==b a.var_in_a = 100 b.var_in_b = 'hello' print a.var_in_b print b.var_in_a Edit: The above code prints: True hello 100 thank you very much

    Read the article

  • List of private iPhone APIs?

    - by diego nunes
    . . Hi there, everybody. . . I need to do an app to be distributed ad hoc (it doesn't need to go to the store) but I need to get the information about the "data usage" (gprs/3g traffic). It is available on the system, but there is no official API call to get that info. One app made it through Apple testing (it's called "Download Meter"), though, and I emailed the guys to see if they would share the call, but they were not in that mood. . . Is there any list of private APIs or anything like that? Does anyone have any ideas of how could I get that info? Again: the app doesn't need to go to the store, but I need to install it on stock iPhone (ad hoc will do). . Thanks.

    Read the article

  • Generic data input form in asp.net mvc application

    - by Diego
    Hello, I have an application that have EF 16 classes that share this information: They all are classes only with a key field and a description. I think it should be a waste if I make a controller with just 1 method just to present a form to fill these classes info, then I was thinking in to make a generic form(with key, description) and dynamically fill the right class through a sort of selection the selected info in any way, any good suggestion or pattern to do that? Where the generic methods should be located.

    Read the article

  • Git graph with ref logs

    - by Francisco Garcia
    I am trying to improve my custom git log format string. I have almost everything I want except the ref names. I can already get a log similar to what I want: > git log --all --source --pretty=oneline --graph * b7c7ad3855b54e94ad7ac03f2d2e5b96d6e5ac1d refs/heads/b1 na | * 695e1482622a79230fa1d83afb8d70e86847334a refs/heads/master Merge branch 'b1' | |\ | |/ |/| * | ec21f370f82096c0208f43b390da234d92e8c74a refs/heads/b1 beta * | c6bc1f55ab3b1bd568493a5de4298dfcb4f66d8d refs/heads/b1 alfa * | 762dd868ae87753afc1cbf9803744c76f9a9e121 refs/heads/b1 tango | * 57fb27bff06ee9bb569f93ba815e9dcd69521c13 refs/heads/master little last post commit |/ | * 8d613d09b43152a7263b6e02d47ec8a4304f54be refs/heads/b3 the other commit | * e1f32b7cb86633351df06e37c2c58ef3f9fafc40 refs/heads/b3 something |/ | * 01b5c6728cf25dd576733211ce75dd3ecc29c7ba refs/heads/b2 this time a I am fighting to get a customized output with my own format string like this: > git log --pretty=format:'%h - %gD %s' --source -g b7c7ad3 - HEAD@{0} na ec21f37 - HEAD@{1} beta 01b5c67 - HEAD@{2} this time a 01b5c67 - HEAD@{3} this time a 695e148 - HEAD@{4} Merge branch 'b1' 57fb27b - HEAD@{5} little last post commit My main problem is that I cannot get the ref names I want. I assume it is one of the %g? format strings, but none of them seem to give me the full ref name. Another problem is that the %g? format strings are empty unless I walk the reflogs (-g). However git refuses to combine --graph with -g How can reproduce the first sample with a format string which I can further customize?

    Read the article

  • Parameter Tuning for Perceptron Learning Algorithm

    - by Albert Diego
    Hi, I'm having sort of an issue trying to figure out how to tune the parameters for my perceptron algorithm so that it performs relatively well on unseen data. I've implemented a verified working perceptron algorithm and I'd like to figure out a method by which I can tune the numbers of iterations and the learning rate of the perceptron. These are the two parameters I'm interested in. I know that the learning rate of the perceptron doesn't affect whether or not the algorithm converges and completes. I'm trying to grasp how to change n. Too fast and it'll swing around a lot, and too low and it'll take longer. As for the number of iterations, I'm not entirely sure how to determine an ideal number. In any case, any help would be appreciated. Thanks.

    Read the article

  • NSOperation inside NSOperationQueue not being executed

    - by Martin Garcia
    I really need help here. I'm desperate at this point. I have NSOperation that when added to the NSOperationQueue is not being triggered. I added some logging to see the NSOperation status and this is the result: Queue operations count = 1 Queue isSuspended = 0 Operation isCancelled? = 0 Operation isConcurrent? = 0 Operation isFinished? = 0 Operation isExecuted? = 0 Operation isReady? = 1 Operation dependencies? = 0 The code is very simple. Nothing special. LoadingConflictEvents_iPad *loadingEvents = [[LoadingConflictEvents_iPad alloc] initWithNibName:@"LoadingConflictEvents_iPad" bundle:[NSBundle mainBundle]]; loadingEvents.modalPresentationStyle = UIModalPresentationFormSheet; loadingEvents.conflictOpDelegate = self; [self presentModalViewController:loadingEvents animated:NO]; [loadingEvents release]; ConflictEventOperation *operation = [[ConflictEventOperation alloc] initWithParameters:wiLr.formNumber pWI_ID:wiLr.wi_id]; [queue addOperation:operation]; NSLog(@"Queue operations count = %d",[queue operationCount]); NSLog(@"Queue isSuspended = %d",[queue isSuspended]); NSLog(@"Operation isCancelled? = %d",[operation isCancelled]); NSLog(@"Operation isConcurrent? = %d",[operation isConcurrent]); NSLog(@"Operation isFinished? = %d",[operation isFinished]); NSLog(@"Operation isExecuted? = %d",[operation isExecuting]); NSLog(@"Operation isReady? = %d",[operation isReady]); NSLog(@"Operation dependencies? = %d",[[operation dependencies] count]); [operation release]; Now my operation do many things on the main method, but the problem is never being called. The main is never executed. The most weird thing (believe me, I'm not crazy .. yet). If I put a break point in any NSLog line or in the creation of the operation the main method will be called and everything will work perfectly. This have been working fine for a long time. I have been making some changes recently and apparently something screw things up. One of those changes was to upgrade the device to iOS 5.1 SDK (iPad). To add something, I have the iPhone (iOS 5.1) version of this application that use the same NSOperation object. The difference is in the UI only, and everything works fine. Any help will be really appreciated. Regards,

    Read the article

  • How to set html content in Moodialog

    - by Diego
    Hello, i've just downloaded Moodialog, a Mootools plugin for dialog, but i have a problem. If content is set via parameters it will be text and not html. Can you help me change the function to accept html? I suppose that this is the code to be edit. setContent: function(){ var content = Array.from(arguments); if (content.length == 1) content = content[0]; this.content.empty(); var type = typeOf(content); if (['string', 'number'].contains(type)) this.content.set('text', content); else this.content.adopt(content); return this; }, I tried to edit 'text' in 'html', but it will not work. Thanks for help (and sorry for my bad english).

    Read the article

  • css cache google chrome

    - by Daniel Garcia
    I'm having problems with cache, I think. I have a website in Joomla, and I have some .css (layout.css, position.css, .... ) and I have at home of the website, 3 buttons, I tested in localhost, and when I see the home well, I upload everything to production, to my server. Now, I just edited some styles of these buttons, for example, the width, in order to see them better...but I'm having a problem with the cache, because sometimes I see them with new changes, but other times I see with the old styles.....I realized that this happens especially with chrome Could you help me, please? Best regards, Daniel

    Read the article

  • Rails: How to produce 404 or redirect upon undesired url exploitation?

    - by Baby Diego
    I want to hide the urls for editing users and their profiles behind safer and meaningful urls. For instance, I want /user/13/edit to be /settings/account and /user/13/profile/edit to be /settings/profile. I managed to achieve that, but for that I had to load the user information from the current_user bit from the session. Like so: # users_controller def edit @user = current_user end # profiles_controller def edit @user = current_user @profile = @user.profile end But now, since I can't compare @user.id from the params with the current_user in the session, how can I stop the old urls (/user/13/edit and /user/13/profile/edit) from being exploitable? They always load the forms for the current user, so there's no harm done, but I'd be more comfortable if they just produced a 404 error or something. Thanks in advance.

    Read the article

  • grabbing a substring while scraping with Python2.6

    - by Diego
    Hey can someone help with the following? I'm trying to scrape a site that has the following information.. I need to pull just the number after the </strong> tag.. [<li><strong>ISBN-13:</strong> 9780375853401</li>, <li><strong>Pub. Date: </strong> 05/11/2010</li>] [<li><strong>UPC:</strong> 490355000372</li>, <li><strong>Catalog No:</strong> 15024/25</li>, <li><strong>Label:</strong> CAMERATA</li>] here's a piece of the code I've been using to grab the above data using mechanize and BeautifulSoup. I'm stuck here as it won't let me use the find() function for a list br_results = mechanize.urlopen(br_results) html = br_results.read() soup = BeautifulSoup(html) local_links = soup.findAll("a", {"class" : "down-arrow csa"}) upc_code = soup.findAll("ul", {"class" : "bc-meta3"}) for upc in upc_code: upc_text = upc.contents.contents print upc_text

    Read the article

  • Encrypting property values in Nant

    - by Diego C.
    I need to store authentication information and I rather not have the password in plain text: <property name="user" value="theUser"/> <property name="password" value="secret"/> Has anyone figured out a way to encrypt property values in Nant? I've looked in Nant and Nantcontrib docs but no mention of encryption. I am considering going the route of creating my own Nant Task. Any suggestions?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12  | Next Page >