Search Results

Search found 385 results on 16 pages for 'luis fernando p gonzalez'.

Page 10/16 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • How to program macros on iWork 09?

    - by Luis
    Hi We have a simple macro that connects Access and Excel (Office 2007 on Windows) with some forms and we are trying to create the iWork version, but I cant find how to create a macro or something, does anyone knows some manual or links to do this? Im using iWork 09 on Snow Leopard. Thanks!

    Read the article

  • C++ linking issue on Visual Studio 2008 when crosslinking different projects on same solution

    - by Luís Guilherme
    I'm using Google Test Framework to set some unit tests. I have got three projects in my solution: FN (my project) FN_test (my tests) gtest (Google Test Framework) I set FN_test to have FN and gtest as references (dependencies), and then I think I'm ready to set up my tests (I've already set everyone to /MTd (not doing this was leading me to linking errors before)). Particularly, I define a class called Embark in FN I would like to test using FN_test. So far, so good. Thus I write a classe called EmbarkTest using googletest, declare a member Embark* and write inside the constructor: EmbarkTest() { e = new Embark(900,2010); } Then , F7 pressed, I get the following: 1>FN_test.obj : error LNK2019: unresolved external symbol "public: __thiscall Embark::Embark(int,int)" (??0Embark@@QAE@HH@Z) referenced in function "protected: __thiscall EmbarkTest::EmbarkTest(void)" (??0EmbarkTest@@IAE@XZ) 1>D:\Users\lg\Product\code\FN\Debug\FN_test.exe : fatal error LNK1120: 1 unresolved externals Does someone know what have I done wrong and/or what can I do to settle this?

    Read the article

  • Get Attribute value in ViewEngine ASP.NET MVC 3

    - by Kushan Fernando
    I'm writting my own view engine. public class MyViewEngine : RazorViewEngine { public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) { // Here, how do I get attributes defined on top of the Action ? } } ASP.NET MVC Custom Attributes within Custom View Engine Above SO Question has how to get attributes defined on top of the Controller. But I need to get attributes defined on Action.

    Read the article

  • reload an iFrame with the scrollbar set to a specific coordinate.

    - by Luis Armando
    I was wondering how could I reload any website using javascript and set it in a way that when it reloads the scrollbar is looking scrolled down to a certain position. I'm unsure as to how to look for this in Google honestly so I haven't digged up much =/. I think it has to be somewhere in the instruction to reload it and so far I have: document.getElementById('life').contentWindow.scroll(0,0); //doesn't work document.getElementById('life').contentWindow.location.reload(); although the first one gets me: Permission denied to get property Window.scroll of http://www.google.com.

    Read the article

  • Ideas for multiplatform encrypted java mobile storage system

    - by Fernando Miguélez
    Objective I am currently designing the API for a multiplatform storage system that would offer same interface and capabilities accross following supported mobile Java Platforms: J2ME. Minimum configuration/profile CLDC 1.1/MIDP 2.0 with support for some necessary JSRs (JSR-75 for file storage). Android. No minimum platform version decided yet, but rather likely could be API level 7. Blackberry. It would use the same base source of J2ME but taking advantage of some advaced capabilities of the platform. No minimum configuration decided yet (maybe 4.6 because of 64 KB limitation for RMS on 4.5). Basically the API would sport three kind of stores: Files. These would allow standard directory/file manipulation (read/write through streams, create, mkdir, etc.). Preferences. It is a special store that handles properties accessed through keys (Similar to plain old java properties file but supporting some improvements such as different value data types such as SharedPreferences on Android platform) Local Message Queues. This store would offer basic message queue functionality. Considerations Inspired on JSR-75, all types of stores would be accessed in an uniform way by means of an URL following RFC 1738 conventions, but with custom defined prefixes (i.e. "file://" for files, "prefs://" for preferences or "queue://" for message queues). The address would refer to a virtual location that would be mapped to a physical storage object by each mobile platform implementation. Only files would allow hierarchical storage (folders) and access to external extorage memory cards (by means of a unit name, the same way as in JSR-75, but that would not change regardless of underlying platform). The other types would only support flat storage. The system should also support a secure version of all basic types. The user would indicate it by prefixing "s" to the URL (i.e. "sfile://" instead of "file://"). The API would only require one PIN (introduced only once) to access any kind of secure object types. Implementation issues For the implementation of both plaintext and encrypted stores, I would use the functionality available on the underlying platforms: Files. These are available on all platforms (J2ME only with JSR-75, but it is mandatory for our needs). The abstract File to actual File mapping is straight except for addressing issues. RMS. This type of store available on J2ME (and Blackberry) platforms is convenient for Preferences and maybe Message Queues (though depending on performance or size requirements these could be implemented by means of normal files). SharedPreferences. This type of storage, only available on Android, would match Preferences needs. SQLite databases. This could be used for message queues on Android (and maybe Blackberry). When it comes to encryption some requirements should be met: To ease the implementation it will be carried out on read/write operations basis on streams (for files), RMS Records, SharedPreferences key-value pairs, SQLite database columns. Every underlying storage object should use the same encryption key. Handling of encrypted stores should be the same as the unencrypted counterpart. The only difference (from the user point of view) accessing an encrypted store would be the addressing. The user PIN provides access to any secure storage object, but the change of it would not require to decrypt/re-encrypt all the encrypted data. Cryptographic capabilities of underlying platform should be used whenever it is possible, so we would use: J2ME: SATSA-CRYPTO if it is available (not mandatory) or lightweight BoncyCastle cryptographic framework for J2ME. Blackberry: RIM Cryptographic API or BouncyCastle Android: JCE with integraced cryptographic provider (BouncyCastle?) Doubts Having reached this point I was struck by some doubts about what solution would be more convenient, taking into account the limitation of the plataforms. These are some of my doubts: Encryption Algorithm for data. Would AES-128 be strong and fast enough? What alternatives for such scenario would you suggest? Encryption Mode. I have read about the weakness of ECB encryption versus CBC, but in this case the first would have the advantage of random access to blocks, which is interesting for seek functionality on files. What type of encryption mode would you choose instead? Is stream encryption suitable for this case? Key generation. There could be one key generated for each storage object (file, RMS RecordStore, etc.) or just use one for all the objects of the same type. The first seems "safer", though it would require some extra space on device. In your opinion what would the trade-offs of each? Key storage. For this case using a standard JKS (or PKCS#12) KeyStore file could be suited to store encryption keys, but I could also define a smaller structure (encryption-transformation / key data / checksum) that could be attached to each storage store (i.e. using addition files with the same name and special extension for plain files or embedded inside other types of objects such as RMS Record Stores). What approach would you prefer? And when it comes to using a standard KeyStore with multiple-key generation (given this is your preference), would it be better to use a record-store per storage object or just a global KeyStore keeping all keys (i.e. using the URL identifier of abstract storage object as alias)? Master key. The use of a master key seems obvious. This key should be protected by user PIN (introduced only once) and would allow access to the rest of encryption keys (they would be encrypted by means of this master key). Changing the PIN would only require to reencrypt this key and not all the encrypted data. Where would you keep it taking into account that if this got lost all data would be no further accesible? What further considerations should I take into account? Platform cryptography support. Do SATSA-CRYPTO-enabled J2ME phones really take advantage of some dedicated hardware acceleration (or other advantage I have not foreseen) and would this approach be prefered (whenever possible) over just BouncyCastle implementation? For the same reason is RIM Cryptographic API worth the license cost over BouncyCastle? Any comments, critics, further considerations or different approaches are welcome.

    Read the article

  • FxCop giving a warning on private constructor CA1823 and CA1053

    - by Luis Sánchez
    I have a class that looks like the following: Public Class Utilities Public Shared Function blah(userCode As String) As String 'doing some stuff End Function End Class I'm running FxCop 10 on it and it says: "Because type 'Utilities' contains only 'static' ( 'Shared' in Visual Basic) members, add a default private constructor to prevent the compiler from adding a default public constructor." Ok, you're right Mr. FxCop, I'll add a private constructor: Private Utilities() Now I'm having: "It appears that field 'Utilities.Utilities' is never used or is only ever assigned to. Use this field or remove it." Any ideas of what should I do to get rid of both warnings?

    Read the article

  • Validating class and superclass on RoR

    - by Luís Guilherme
    In ruby, you have an attribute called "type" which is the class of the object. Rails stores this at the database in a column called type. So, if I have several blog "types", I can do something like this def create @blog = Blog.new(params[:blog]) @blog[:type] = params[:blog][:type] # ... end If I add someone like this, and then load it, and ask its class (for instance, at the console), I have the right class name answered back. However, when I save it afterwards, rails will run only the superclass validators, not the ones I defined in the subclass. How should I make rails run the subclass validators?

    Read the article

  • Comparing images using SIFT

    - by Luís Fernando
    I'm trying to compare 2 images that are taken from a digital camera. Since there may be movement on the camera, I want to first make the pictures "match" and then compare (using some distant function). To match them, I'm thinking about cropping the second picture and using SIFT to find it inside the first picture... it will probably have a small difference on scale/translation/rotation so then I'd need to find the transformation matrix that converts image 1 to image 2 (based on points found by SIFT) any ideas on how to do that (or I guess that's a common problem that may have some opensource implementation?)? thanks

    Read the article

  • Better way to clean this messy bool method

    - by Luís Custódio
    I'm reading Fowler Clean Code book and I think that my code is a little messy, I want some suggestions: I have a simple business requirement that is return the date of new execution of my Thread. I've two class fields: _hour and _day. If actual day is higher than my _day field I must return true, so I'll add a month to "executionDate" If the day is the same, but the actual hour is higher than _hour I should return true too. So I did this simple method: private bool ScheduledDateGreaterThanCurrentDate (DateTime dataAtual) { if (dateActual.Day > _day) { return true; } if (dateActual.Day == _day && dateActual.Hour > _hour) { return true; } if (dateActual.Day == _day && dateActual.Hour == _hour) if (dateActual.Minute>0 || dateActual.Second>0) return true; return false; } I'm programming with TDD, so I know that the return is correct, but this is bad maintain code right?

    Read the article

  • Python encoding - Nothing works

    - by Luiz Fernando
    I've been looking the answers here in this web site, but nothing have worked so far. The problem is: In the database, strings are saved like that one: at &#8730;s = 7 TeV with. And the reason is that the "escape" JavaScript function was used. I was not able to "unescape" these strings in Python yet. I tried to use "eval", "decode", "re.sub" and others, but without success. So please, which function can I use to get it right?

    Read the article

  • Redirect Desktop Internal Pages to Correct Mobile Internal Pages with Htaccess

    - by Luis Alejandro Ramrez Gallardo
    I have built a Mobile site in a sub-domain. I have successfully implemented the redirect 302 from: www.domain.com to m.domain.com in htaccess. What I'm looking to achieve now it to redirect users from: www.domain.com/internal-page/ > 302 > m.domain.com/internal-page.html Notice that URL name for desktop and mobile is not the same. The code I'm using looks like this: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress # Mobile Redirect # Verify Desktop Version Parameter RewriteCond %{QUERY_STRING} (^|&)ViewFullSite=true(&|$) # Set cookie and expiration RewriteRule ^ - [CO=mredir:0:www.domain.com:60] # Prevent looping RewriteCond %{HTTP_HOST} !^m.domain.com$ # Define Mobile agents RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "sony|symbian|nokia|samsung|mobile|windows ce|epoc|opera" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "mini|nitro|j2me|midp-|cldc-|netfront|mot|up\.browser|up\.link|audiovox"[NC,OR] RewriteCond %{HTTP_USER_AGENT} "blackberry|ericsson,|panasonic|philips|sanyo|sharp|sie-"[NC,OR] RewriteCond %{HTTP_USER_AGENT} "portalmmm|blazer|avantgo|danger|palm|series60|palmsource|pocketpc"[NC,OR] RewriteCond %{HTTP_USER_AGENT} "smartphone|rover|ipaq|au-mic,|alcatel|ericy|vodafone\/|wap1\.|wap2\.|iPhone|android"[NC] # Verify if not already in Mobile site RewriteCond %{HTTP_HOST} !^m\. # We need to read and write at the same time to set cookie RewriteCond %{QUERY_STRING} !(^|&)ViewFullSite=true(&|$) # Verify that we previously haven't set the cookie RewriteCond %{HTTP_COOKIE} !^.*mredir=0.*$ [NC] # Now redirect the users to the Mobile Homepage RewriteRule ^$ http://m.domain.com [R] RewriteRule $/internal-page/ http://m.domain.com/internal-page.html [R,L]

    Read the article

  • Load XML file on seperate thread, overwrite old , and save.

    - by Luis Tovar
    Hey everyone... so Im trying to figure out how to do this. I have bounced around alot of forums to try and find my answer, but no success. Either their process it too complicated for me to understand, or is just overkill. What I am trying to do is this. I have an XML file within my app. Its a 500k xml file that i dont want the user to have to wait on when loading. SO... I put it in my app which kills the load time, and makes the app available offline. What i want to do is, when the app loads, in the background (seperate thread) download the SAME xml file which MIGHT be updated with new data. Once the xml file is complete, i want to REPLACE the xml file that was used to load the file. Any suggestions or code hints would be greatly appreciated. Thanks in advance!

    Read the article

  • What is `objc_msgSend_fixup`, exactly?

    - by Luis Antonio Botelho O. Leite
    I'm messing around with the Objective-C runtime, trying to compile objective-c code without linking it against libobjc, and I'm having some segmentation fault problems with a program, so I generated an assembly file from it. I think it's not necessary to show the whole assembly file. At some point of my main function, I've got the following line (which, by the way, is the line after which I get the seg fault): callq *l_objc_msgSend_fixup_alloc and here is the definition for l_objc_msgSend_fixup_alloc: .hidden l_objc_msgSend_fixup_alloc # @"\01l_objc_msgSend_fixup_alloc" .type l_objc_msgSend_fixup_alloc,@object .section "__DATA, __objc_msgrefs, coalesced","aw",@progbits .weak l_objc_msgSend_fixup_alloc .align 16 l_objc_msgSend_fixup_alloc: .quad objc_msgSend_fixup .quad L_OBJC_METH_VAR_NAME_ .size l_objc_msgSend_fixup_alloc, 16 I've reimplemented objc_msgSend_fixup as a function (id objc_msgSend_fixup(id self, SEL op, ...)) which returns nil (just to see what happens), but this function isn't even being called (the program crashes before calling it). So, my question is, what is callq *l_objc_msgSend_fixup_alloc supposed to do and what is objc_msgSend_fixup (after l_objc_msgSend_fixup_alloc:) supposed to be (a function or an object)? Edit To better explain, I'm not linking my source file against the objc library. What I'm trying to do is implement some parts of the libray, just to see how it works. Here is an approach of what I've done: #include <stdio.h> #include <objc/runtime.h> @interface MyClass { } +(id) alloc; @end @implementation MyClass +(id) alloc { // alloc the object return nil; } @end id objc_msgSend_fixup(id self, SEL op, ...) { printf("Calling objc_msgSend_fixup()...\n"); // looks for the method implementation for SEL in self's vtable return nil; // Since this is just a test, this function doesn't need to do that } int main(int argc, char *argv[]) { MyClass *m; m = [MyClass alloc]; // At this point, according to the assembly code generated // objc_msgSend_fixup should be called. So, the program should, at least, print // "Calling objc_msgSend_fixup()..." on the screen, but it crashes before // objc_msgSend_fixup() is called... return 0; } If the runtime needs to access the object's vtable to find the correct method to call, what is the function which actually does this? I think it is objc_msgSend_fixup, in this case. So, when objc_msgSend_fixup is called, it receives an object as one of its parameters, and, if this object hasn't been initialized, the function fails. So, I've implemented my own version of objc_msgSend_fixup. According to the assembly source above, it should be called. It doesn't matter if the function is actually looking for the implementation of the selector passed as parameter. I just want objc_msgSend_lookup to be called. But, it's not being called, that is, the function that looks for the object's data is not even being called, instead of being called and cause a fault (because it returns a nil (which, by the way, doesn't matter)). The program seg fails before objc_msgSend_lookup is called...

    Read the article

  • help with linq query

    - by Luis
    Hi, i am trying to get some data, but i dont know how can i do a if in linq, this is how i am trying to do from so in db.Operations where ((opType!= "0" ? so.Operation == int.Parse(opType) : false) && (idState!=0 ? so.State == idState : false) && (start != null ? so.StartDate == start : false) && (end !=null ? so.EndDate == end : false)) select so the optype is a Int, the idState is a Int, end is a datetime, start is a datime what i am trying to do is, if those aren't null they add to the query function, so i can get all data together

    Read the article

  • How to get Cocoa Emacs to jump to line number from external application?

    - by Fernando
    When using Carbon Emacs (v22) from an external application (ex. Unity 3D) files sent to Carbon Emacs would jump to the line number requested by the external application (ie. double click on an error message editor selected in preferences is started with file at error line number). For some reason the new Cocoa Emacs (v23) no longer does this. Instead it simply opens the file, but does not jump to the line number requested by the external application.

    Read the article

  • Call a c# method from Javascript

    - by Luis
    Hi i want to call a C# method.. I already tryed with webmethod, but in the c# method i will not have acces to textbox or others controls. this is how i done without success.. http://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx With static works, but i want without static, so i can access to the controls in the aspx and validate the page. how can i do it?

    Read the article

  • Clean checkout from TFS 2008

    - by Luis Medel
    Hi all, I want to pass a project to a colleague without SCC bindings to avoid accidental changes in my repository. Is it possible to do a clean checkout from a TFS 2008 repo? I'm going crazy finding such an option in VS2008. Thanks in advance.

    Read the article

  • How to find out who's causing an access violation error?

    - by Fernando
    I'm getting reports that my app is causing a GPF on some Vista machines. The error message is something like this: access violation at 0x75784062 ( tried to write to 0x00000006) In order to fix this, I first need to know exactly who is causing this GPF: my main exe, some third party component, one of my own activex components, a dll, etc... How can I find this out? What tools can pinpoint the exact module that caused this mess? Any help would be greatly appreciated. PS My app is coded in VB6 and my activex controls are written in Delphi 2007.

    Read the article

  • Javascript - How to index html code into variables

    - by Fernando SBS
    The webpage has the following source (only copied the important part): <h1>Relatórios</h1> <div id="textmenu"> <a href="berichte.php" class="selected ">Tudo</a> | <a href="berichte.php?t=2">Comércio</a> | <a href="berichte.php?t=1">Reforços</a> | <a href="berichte.php?t=3">Ataques</a> | <a href="berichte.php?t=4">Outros</a> </div> <form method="post" action="berichte.php" name="msg"> <table cellpadding="1" cellspacing="1" id="overview" class="row_table_data"> <thead> <tr> <th colspan="2">Assunto:</th> <th class="sent"> enviada</th> </tr> </thead><tfoot> <tr> <th>&nbsp;</th> <th class=buttons><input name=del value=apagar alt=apagar type=image id=btn_delete class=dynamic_img src=img/x.gif /></th> <th class=navi>&laquo;<a href="berichte.php?s=10&amp;o=0">&raquo;</a></th> </tr> </tfoot> <tbody> <tr> <td class="sel"><input class="check" type="checkbox" name="n1" value="15737030" /></td> <td class="sub"><img src="img/x.gif" class="iReport iReport1" alt="Ganhou como atacante sem perdas" title="Ganhou como atacante sem perdas" /> <div><a href="berichte.php?id=15737030">Rio Grande Do Leste ataca lcsanchez da aldeia</a> </div> </td> <td class="dat">hoje 21:33</td> </tr> <tr> <td class="sel"><input class="check" type="checkbox" name="n2" value="15736877" /></td> <td class="sub"><img src="img/x.gif" class="iReport iReport1" alt="Ganhou como atacante sem perdas" title="Ganhou como atacante sem perdas" /> <div><a href="berichte.php?id=15736877">Rio Grande Do Leste ataca Thabiti da aldeia</a> </div> </td> <td class="dat">hoje 21:32</td> </tr> <tr> <td class="sel"><input class="check" type="checkbox" name="n3" value="15736759" /></td> <td class="sub"><img src="img/x.gif" class="iReport iReport1" alt="Ganhou como atacante sem perdas" title="Ganhou como atacante sem perdas" /> <div><a href="berichte.php?id=15736759">Rio Grande Do Leste ataca Dionisio</a> </div> </td> <td class="dat">hoje 21:31</td> </tr> <tr> <td class="sel"><input class="check" type="checkbox" name="n4" value="15736513" /></td> <td class="sub"><img src="img/x.gif" class="iReport iReport1" alt="Ganhou como atacante sem perdas" title="Ganhou como atacante sem perdas" /> <div><a href="berichte.php?id=15736513">Rio Grande Do Leste ataca Aldeia de troakris</a> (nova)</div> </td> <td class="dat">hoje 21:30</td> </tr> <tr> <td class="sel"><input class="check" type="checkbox" name="n5" value="15736275" /></td> <td class="sub"><img src="img/x.gif" class="iReport iReport1" alt="Ganhou como atacante sem perdas" title="Ganhou como atacante sem perdas" /> <div><a href="berichte.php?id=15736275">Rio Grande Do Leste ataca Thabiti da aldeia</a> </div> </td> <td class="dat">hoje 21:28</td> </tr> <tr> <td class="sel"><input class="check" type="checkbox" name="n6" value="15736220" /></td> <td class="sub"><img src="img/x.gif" class="iReport iReport1" alt="Ganhou como atacante sem perdas" title="Ganhou como atacante sem perdas" /> <div><a href="berichte.php?id=15736220">Rio Grande Do Leste ataca Aldeia de troakris</a> (nova)</div> </td> <td class="dat">hoje 21:28</td> </tr> <tr> <td class="sel"><input class="check" type="checkbox" name="n7" value="15734824" /></td> <td class="sub"><img src="img/x.gif" class="iReport iReport1" alt="Ganhou como atacante sem perdas" title="Ganhou como atacante sem perdas" /> <div><a href="berichte.php?id=15734824">Rio Grande Do Leste ataca Austrália</a> </div> </td> <td class="dat">hoje 21:18</td> </tr> <tr> <td class="sel"><input class="check" type="checkbox" name="n8" value="15734440" /></td> <td class="sub"><img src="img/x.gif" class="iReport iReport1" alt="Ganhou como atacante sem perdas" title="Ganhou como atacante sem perdas" /> <div><a href="berichte.php?id=15734440">Rio Grande Do Leste ataca andrômeda</a> (nova)</div> </td> <td class="dat">hoje 21:15</td> </tr> <tr> <td class="sel"><input class="check" type="checkbox" name="n9" value="15730612" /></td> <td class="sub"><img src="img/x.gif" class="iReport iReport1" alt="Ganhou como atacante sem perdas" title="Ganhou como atacante sem perdas" /> <div><a href="berichte.php?id=15730612">Rio Grande Do Leste ataca wLG02 KING OF POP</a> (nova)</div> </td> <td class="dat">hoje 20:49</td> </tr> <tr> <td class="sel"><input class="check" type="checkbox" name="n10" value="15730304" /></td> <td class="sub"><img src="img/x.gif" class="iReport iReport1" alt="Ganhou como atacante sem perdas" title="Ganhou como atacante sem perdas" /> <div><a href="berichte.php?id=15730304">Rio Grande Do Leste ataca wLG02 KING OF POP</a> (nova)</div> </td> <td class="dat">hoje 20:47</td> </tr> </tbody> </table> </form> </div> I want to read from the source and assign to a variable the values like: relatorio[0] = berichte.php?id=15730304; relatorio[1] = berichte.php?id=15730612; ... relatorio[9] = berichte.php?id=15737030; How to do that? thanks

    Read the article

  • Disposing underlying object from finalizer in an immutable object

    - by Juan Luis Soldi
    I'm trying to wrap around Awesomium and make it look to the rest of my code as close as possible to NET's WebBrowser since this is for an existing application that already uses the WebBrowser. In this library, there is a class called JSObject which represents a javascript object. You can get one of this, for instance, by calling the ExecuteJavascriptWithResult method of the WebView class. If you'd call it like myWebView.ExecuteJavascriptWithResult("document", string.Empty).ToObject(), then you'd get a JSObject that represents the document. I'm writing an immutable class (it's only field is a readonly JSObject object) called JSObjectWrap that wraps around JSObject which I want to use as base class for other classes that would emulate .NET classes such as HtmlElement and HtmlDocument. Now, these classes don't implement Dispose, but JSObject does. What I first thought was to call the underlying JSObject's Dispose method in my JSObjectWrap's finalizer (instead of having JSObjectWrap implement Dispose) so that the rest of my code can stay the way it is (instead of having to add using's everywhere and make sure every JSObjectWrap is being properly disposed). But I just realized if more than two JSObjectWrap's have the same underlying JSObject and one of them gets finalized this will mess up the other JSObjectWrap. So now I'm thinking maybe I should keep a static Dictionary of JSObjects and keep count of how many of each of them are being referenced by a JSObjectWrap but this sounds messy and I think could cause major performance issues. Since this sounds to me like a common pattern I wonder if anyone else has a better idea.

    Read the article

  • Collections of generics

    - by Luis Sep
    According to what I've read, I think this can't be done, but I'd like to be sure. I have a class OpDTO and several other *DTO extends OpDTO. Then, I want to have a method to extract just certain elements from lists of these child DTOs, and return the extracted elements in another list: public List<? extends OpDTO> getLastOp (List<? extends OpDTO> listDTOs) { List<? extends OpDTO> last = new ArrayList<? extends OpDTO>(); //compile error: Cannot instantiate the type ArrayList<? extends OpDTO> //processing return last; } I want ult to be a list of elements of the same kind as elements in listDTOs, and use only OpDTO's methods, but it produces a compile error: Cannot instantiate the type ArrayList<? extends OpDTO> I also tried doing something like: public <T> List<T> getLastOp (List<T> listDTOs) { List<T> last = new ArrayList<T>(); //processing return last; } But then I can't enforce elements in listDTOs to be a subclass of OpDTO, and can't instantiate T. Any idea?

    Read the article

  • javascript - How to pass an argument in a function call?

    - by Fernando SBS
    function rp_marcadesmarcaFarm(valor) { FM_log(3, "marcadesmarcaFarm called = "+valor); for (i = 0; i < farmList.length; i++) { var arr = farmList[i].split("|"); var xy = arr[0].split(","); var fvillageId = xy2id(parseInt(xy[0]), parseInt(xy[1])); GM_setValue("farmAtivada_"+suffixLocal+fvillageId, valor); GM_setValue("farmAtivada_"+suffixLocal+i, valor); }; reloadFarmTable(); }; function createLinkButton(text, title, jsFunction, value) { var button = dom.cn("a"); button.href = "javascript:void(0)"; button.innerHTML = text; button.title = title; if (jsFunction != null) { button.addEventListener('click', jsFunction, false); } return button; } createLinkButton("X", T('CHECKFARM_M'), rp_marcadesmarcaFarm(true)); apparently the last argument (rp_marcadesmarcaFarm(true)) when invoking the createLinkButton is not working. If I change to: createLinkButton("X", T('CHECKFARM_M'), rp_marcadesmarcaFarm); it works. So how can I pass the (true) variable to the third argument of createLinkButton?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16  | Next Page >