Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 176/433 | < Previous Page | 172 173 174 175 176 177 178 179 180 181 182 183  | Next Page >

  • Linq join two dictionaries using a common key

    - by rboarman
    Hello, I am trying to join two Dictionary collections together based on a common lookup value. var idList = new Dictionary<int, int>(); idList.Add(1, 1); idList.Add(3, 3); idList.Add(5, 5); var lookupList = new Dictionary<int, int>(); lookupList.Add(1, 1000); lookupList.Add(2, 1001); lookupList.Add(3, 1002); lookupList.Add(4, 1003); lookupList.Add(5, 1004); lookupList.Add(6, 1005); lookupList.Add(7, 1006); // Something like this: var q = from id in idList.Keys join entry in lookupList on entry.Key equals id select entry.Value; The Linq statement above is only an example and does not compile. For each entry in the idList, pull the value from the lookupList based on matching Keys. The result should be a list of Values from lookupList (1000, 1002, 1004). What’s the easiest way to do this using Linq? Thank you, Rick

    Read the article

  • Core Data Inferred Migration – Automatic "lightweight" vs Manual

    - by ohhorob
    I've updated the model of an existing iPhone app in some simple ways (remove attribute, add attribute, remove index), and can use automatic lightweight migration to migrate the persistent store. Due to the typical size of the data set, the processing time is not insignificant, and warrants feedback for the user. NSMigrationManager provides a simple but useful migrationProgress value that sends KVO notifications as the migration is performed. That forms the basis of providing feedback, however attempting to use an inferred model ([NSMappingModel inferredMappingModelForSourceModel:destinationModel:error:]) results in drastically different timing for the exact same dataset. Profile results on and original iPhone (2G) Automatic inferred lightweight migration PROFILE: CacheManager -migrateStore PROFILE: 0.6130 (+0.6130) models loaded PROFILE: 1.1759 (+0.5629) delegate -CacheManagerWillMigrate: PROFILE: 1.2516 (+0.0757) persistent store coordinator loaded PROFILE: 5.1436 (+3.8920) automatic lightweight migration completed PROFILE: 5.5435 (+0.3999) delegate -CacheManagerDidFinishMigration:withError: Manual inferred migration PROFILE: CacheManager -migrateStore PROFILE: 0.6660 (+0.6660) models loaded PROFILE: 1.1471 (+0.4811) inferred mapping model generated PROFILE: 1.4046 (+0.2574) delegate -CacheManagerWillMigrate: PROFILE: 1.5058 (+0.1013) persistent store coordinator loaded PROFILE: 22.6952 (+21.1894) manual migration completed PROFILE: 23.1478 (+0.4525) delegate -CacheManagerDidFinishMigration:withError: So, with an inferred model, the manual migration takes over 5 times longer than automatic! It's a big inconsistency, and the lightweight option that NSPersistentStoreCoordinator -addPersistentStoreWithType:configuration:URL:options:error: provides absolutely no indication of progress while processing. Can anybody provide a supported way to get the migrationProgress values during automatic migration, OR a way to configure an inferred mapping model to be as fast during manual processing as automatic?

    Read the article

  • Anonymous union definition/declaration in a macro GNU vs VS2008

    - by Alan_m
    I am attempting to alter an IAR specific header file for a lpc2138 so it can compile with Visual Studio 2008 (to enable compatible unit testing). My problem involves converting register definitions to be hardware independent (not at a memory address) The "IAR-safe macro" is: #define __IO_REG32_BIT(NAME, ADDRESS, ATTRIBUTE, BIT_STRUCT) \ volatile __no_init ATTRIBUTE union \ { \ unsigned long NAME; \ BIT_STRUCT NAME ## _bit; \ } @ ADDRESS //declaration //(where __gpio0_bits is a structure that names //each of the 32 bits as P0_0, P0_1, etc) __IO_REG32_BIT(IO0PIN,0xE0028000,__READ_WRITE,__gpio0_bits); //usage IO0PIN = 0x0xAA55AA55; IO0PIN_bit.P0_5 = 0; This is my comparable "hardware independent" code: #define __IO_REG32_BIT(NAME, BIT_STRUCT)\ volatile union \ { \ unsigned long NAME; \ BIT_STRUCT NAME##_bit; \ } NAME; //declaration __IO_REG32_BIT(IO0PIN,__gpio0_bits); //usage IO0PIN.IO0PIN = 0xAA55AA55; IO0PIN.IO0PIN_bit.P0_5 = 1; This compiles and works but quite obviously my "hardware independent" usage does not match the "IAR-safe" usage. How do I alter my macro so I can use IO0PIN the same way I do in IAR? I feel this is a simple anonymous union matter but multiple attempts and variants have proven unsuccessful. Maybe the IAR GNU compiler supports anonymous unions and vs2008 does not. Thank you.

    Read the article

  • iPad: Detecting External Keyboard

    - by StuartW
    My app uses a UIAccessoryView to provide additional keyboard functionality (such as forward/backward tabs and arrows keys) for the virtual keyboard, but that causes UIKeyboardDidShowNotification to fire even when a physical keyboard is present (the accessory appears at the bottom of the screen). I'd like to check if a physical keyboard is attached when handling UIKeyboardWillShowNotification, to prevent the accessory view from appearing and to prevent my custom view from scrolling up (to make room for the non-existent virtual keyboard). I've tried examining the UIKeyboardFrameEndUserInfoKey key, but it returns a real size for the virtual keyboard, in spite of nothing being displayed. Is there any way to detect the presence of a physical keyboard to prevent this unwanted behaviour? Hmm, the plot thickens. I tried disabling the input accessory by returning nil from the inputAccessoryView property of the Responder object which triggers the keyboard. That suppresses UIKeyboardWillShowNotification and UIKeyboardDidShowNotification when there is a physical keyboard present, but keeps these notifications when there is no such keyboard. All good so far. Then I tried re-enabling inputAccessoryView only after UIKeyboardWillShowNotification had been received. This only fires when a virtual keyboard is needed, so it should allow me to reintroduce the accessory view in those circumstances. Or so I thought. Unfortunately, it seems the OS doesn't check inputAccessoryView after UIKeyboardWillShowNotification, so it fails to show the accessory view when it is needed :o( That leaves me with two options: Include the input accessory view, giving extra functionality for virtual keyboard users, but lose the ability to detect a physical keyboard and hence not supporting physical devices; or Exclude the input accessory altogether, preventing most users from accessing the extra keys, but allowing the app to work with a physical keyboard. Not a great choice, so I'm still keen to see if anyone else has addressed this problem!

    Read the article

  • How to not specify ruleset name when reading from config file?

    - by user102533
    When I read rules from a configuration file, I do something like this: IConfigurationSource configurationSource = new FileConfigurationSource("myvalidation.config"); var validator = ValidationFactory.CreateValidator<Salary>(configurationSource); The config file looks like this: <ruleset name="Default"> <properties> <property name="Address"> <validator lowerBound="10" lowerBoundType="Inclusive" upperBound="15" upperBoundType="Inclusive" negated="false" messageTemplate="" messageTemplateResourceName="" messageTemplateResourceType="" tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.StringLengthValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null" name="String Length Validator" /> </property> </properties> </ruleset> My question is - is there a way to not specify the ruleset name? It's not required for me to specify a ruleset name if I am using the attribute approach and I can validate using: ValidationResults results = Validation.Validate(salary); Now when reading from config files, I have to specify the ruleset name. There is no overload of the CreateValidator method that accepts the configuration source without specifying the ruleset name. Also, the xml in the config file requires a name attribute for ruleset

    Read the article

  • Explicit localization problem

    - by X-Dev
    when trying to translate the confirmation message to Norwegian i get the following error: Cannot have more than one binding on property 'OnClientClick' on 'System.Web.UI.WebControls.LinkButton'. Ensure that this property is not bound through an implicit expression, for example, using meta:resourcekey. i use Explicit localization in the following manner: <asp:LinkButton ID="lnkMarkInvoiced" runat="server" OnClick="lnkMarkInvoiced_OnClick" OnClientClick="<%# Resources: lnkMarkInvoicedResource.OnClientClick%>" Visible="False" CssClass="stdtext" meta:resourcekey="lnkMarkInvoicedResource" ></asp:LinkButton> here's the local resource file entry: <data name="lnkMarkInvoicedResource.OnClientClick" xml:space="preserve"> <value>return confirm('Er du sikker?');</value> if i remove the meta attribute i get the English text(default). how do i get the Norwegian text appearing without resorting to using the code behind? Update: removing the meta attribute prevents the exception from occurring but the original problem still exists. I can't get the Norwegian text to show. only the default English text shows. Another Update: I know this question is getting old but i still can't get the Norwegian text to display. If anyone has some tips please post a response.

    Read the article

  • Recursive list of lists in XSL

    - by Paul Tomblin
    I have a recursive nodes that I'm trying to set up for jquery-checktree. The nodes look like foo/bar/ID /NAME /CHECKED bar/ID /NAME /CHECKED /bar/ID /NAME /bar/ID /NAME /bar/ID /NAME /CHECKED /bar/ID /NAME /CHECKED Where any bar may or may not have one or more bar nodes below it, but any bar will have ID and NAME and might have a CHECKED. and I want to turn that into <ul> <li><input type="checkbox" name="..." value="..." checked="checked"></input> <label for="...">...</label> <ul> <li><input type="checkbox" name="..." value="..." checked="checked"></input> <label for="...">...</label> </li> </ul> <li>....</li> </ul> I can get the first level by doing: <ul class="tree"> <xsl:for-each select="/foo/bar/"> <li><input type="checkbox" name="{ID}" value="{ID}"> <xsl:if test="CHECKED = 'Y'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> </input><label for="{ID}"><xsl:value-of select="NAME"/></label> </li> </xsl:for-each> </ul> But I don't know how to recurse down to the embedded "bar" within the "bar", down to however many levels there might be.

    Read the article

  • Problem in loading Iframe in FireFox!

    - by maddy
    Hello all, I'm trying to load an aspx page using Iframe in VB.net. I'm trying to set the source of Iframe with the help of Ext (JavaScript). My aspx code: <div id="container"> < iframe id="pane" name="pane" src="Empty.aspx" frameborder="0" > </iframe> </div> My Javascript code: Pane = function() { var pane; return { init: function() { if (!document.body) { return; } pane = Ext.get('pane'); if ( something ) { this.load(); } else { this.navigateTo('Page.aspx?id=' + a.ID); } }, load: function() { pane.dom.src = 'HTTPURL'; }, navigateTo: function(url) { var agt = navigator.userAgent.toLowerCase(); if (agt.indexOf("firefox") != -1) { document.getElementById('pane').src = url; } else { pane.dom.src = url; } } }; } (); This works fine with IE and Iframe gets loaded with page.aspx every time the parent page is requested. But with FireFox it doesn't. With FireFox the src attribute remains "Empty.aspx" when the page is loaded but when I refresh the page i.e. in post back event the src attribute changes to "page.aspx?id=a.id" and iframe gets loaded properly. Has anyone faced such kind of problem before? If you know the solution please help me, it's killing me big. Thanks in advance. Maddy.

    Read the article

  • Problem in loading Iframe in FireFox!

    - by maddy
    Hello all, I'm trying to load an aspx page using Iframe in VB.net. I'm trying to do it(setting the source of Iframe) with the help of Ext(JavaScript). aspx code: < div id="container" > < iframe id="pane" name="pane" src="Empty.aspx" frameborder="0" >< /iframe> < /div > Javascript code: Pane = function() { var pane; return { init: function() { if (!document.body) { return; } pane = Ext.get('pane'); if ( something ) { this.load(); } else { this.navigateTo('Page.aspx?id=' + a.ID); } }, load: function() { pane.dom.src = 'HTTPURL'; }, navigateTo: function(url) { var agt = navigator.userAgent.toLowerCase(); if (agt.indexOf("firefox") != -1) { document.getElementById('pane').src = url; } else { pane.dom.src = url; } } }; } (); This works fine with IE and Ifrma gets loaded wuth page.aspx every time the parent page is requested. But with FireFox it doesn't. With FireFox the src attribute remains "Empty.aspx" when the page is loaded but when i refresh the page i.e. in post back event the scr attribute changes to "page.aspx?id=a.id" and iframe gets loaded properly. Has anyone faced such kind of problem before? and knows the solution please help me, it's killing me big. Thanks in Advance. Maddy.

    Read the article

  • How to access a superclass's class attributes in Python?

    - by Brecht Machiels
    Have a look at the following code: class A(object): defaults = {'a': 1} def __getattr__(self, name): print('A.__getattr__') return self.get_default(name) @classmethod def get_default(cls, name): # some debug output print('A.get_default({}) - {}'.format(name, cls)) try: print(super(cls, cls).defaults) # as expected except AttributeError: #except for the base object class, of course pass # the actual function body try: return cls.defaults[name] except KeyError: return super(cls, cls).get_default(name) # infinite recursion #return cls.__mro__[1].get_default(name) # this works, though class B(A): defaults = {'b': 2} class C(B): defaults = {'c': 3} c = C() print('c.a =', c.a) I have a hierarchy of classes each with its own dictionary containing some default values. If an instance of a class doesn't have a particular attribute, a default value for it should be returned instead. If no default value for the attribute is contained in the current class's defaults dictionary, the superclass's defaults dictionary should be searched. I'm trying to implement this using the recursive class method get_default. The program gets stuck in an infinite recursion, unfortunately. My understanding of super() is obviously lacking. By accessing __mro__, I can get it to work properly though, but I'm not sure this is a proper solution. I have the feeling the answer is somewhere in this article, but I haven't been able to find it yet. Perhaps I need to resort to using a metaclass?

    Read the article

  • NSArrayController not working with NSMutableDictionary for NSTableView

    - by Miraaj
    Hi all, I am trying to display content in NSTableView using NSMutableArrayController of NSMutableDictionary records. I followed steps written below: In application delegate class, I created an NSMutableArray object with name 'geniuses' and stored some NSMutableDictionary objects with keys: 'geniusName' and 'domain'. I took an NSArrayController object in IB, binded its controller content property to application delegate class, and set its model key path to 'geniuses'. In attribute inspector pane set mode as class and class name as NSMutableDictionary. Added keys: 'geniusName' and 'domain' to it. In IB I took a table view object. Binded its content property to array controller, controller key path set as arranged objects. Binded value property of its first column to array controller, controller key path set as arranged objects, model key path set as 'geniusName'. Binded value property of its second column to array controller, controller key path set as arranged objects, model key path set as 'geniusName'. After following these steps when I tried to build and run the project I found un-populated table view. You can find my code here. Can anyone suggest me where I may be wrong? Thanks, Miraaj

    Read the article

  • PHP: How to copy elements from an associative array and place them at the beginning of the array?

    - by Andrew
    I have an array of countries that I will be using in a select menu: array( [0] => " -- Select -- " [1] => "Afghanistan" [3] => "Albania" [4] => "Algeria" [39] => "Canada" [47] => "USA" ) //etc... I want to copy create copies of the Canada and USA entries and place them at the front of my array. So the array should end up looking like this: array( [0] => " -- Select -- " [47] => "USA" [39] => "Canada" [1] => "Afghanistan" [3] => "Albania" [4] => "Algeria" [39] => "Canada" [47] => "USA" ) //etc... The array keys correspond to their ID in the database, so I can't change the keys. How can I achieve this?

    Read the article

  • ssh_exchange_identification: Connection closed by remote host under Git bash

    - by MoreFreeze
    I work at win7 and set up git server with sshd. I git --bare init myapp.git, and clone ssh://git@localhost/home/git/myapp.git in Cywgin correctly. But I need config git of Cygwin again, I want to git clone in Git Bash. I run "git clone ssh://git@localhost/home/git/myapp.git" and get following message ssh_exchange_identification: Connection closed by remote host then I run "ssh -vvv git@localhost" in Git Bash and get message debug2: ssh_connect: needpriv 0 debug1: Connecting to localhost [127.0.0.1] port 22. debug1: Connection established. debug1: identity file /c/Users/MoreFreeze/.ssh/identity type -1 debug3: Not a RSA1 key file /c/Users/MoreFreeze/.ssh/id_rsa. debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: missing keytype debug3: key_read: missing whitespace // above it repeats 24 times debug2: key_type_from_name: unknown key type '-----END' debug3: key_read: missing keytype debug1: identity file /c/Users/MoreFreeze/.ssh/id_rsa type 1 debug1: identity file /c/Users/MoreFreeze/.ssh/id_dsa type -1 ssh_exchange_identification: Connection closed by remote host it seems my private keys has wrong format? And I find that there are exactly 25 line in private keys without "BEGIN" and "END". I'm confused why it said NOT RSA1 key, I totally ensure it is RSA 2 key. Any advises are welcome. btw, I have read first 3 pages on google about this problem.

    Read the article

  • object datasource problems in visual studio 2008,

    - by kamal
    After going to the process of adding the various attributes like insert,delete and update.But when i run it through the browser ,editing works but updating and deleting doesn't !(for the update and shows the same thing for delete,my friends think i need to use codes to repair the problems,can you help me please.it shows this: Server Error in '/WebSite3' Application. ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: First_name, Surname, Original_author_id, First name, original_author id. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: First_name, Surname, Original_author_id, First name, original_author id. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: First_name, Surname, Original_author_id, First name, original_author id.] System.Web.UI.WebControls.ObjectDataSourceView.GetResolvedMethodData(Type type, String methodName, IDictionary allParameters, DataSourceOperation operation) +1119426 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +1008 System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +92 System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +907 System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +704 System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +95 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +123 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118

    Read the article

  • Java many to many association map

    - by Raphael Jolivet
    Hi, I have to classes, ClassA and ClassB and a "many to many" AssociationClass. I want to use a structure to hold the associations between A and B such as I can know, for each instance of A or B, which are their counterparts. I thought of using a Hashmap, with pair keys: Hasmap<Pair<ClassA, ClassB>, AssociationClass> associations; This way, I can add and remove an association between two instances of ClassA and ClassB, and I can query a relation for two given instances. However, I miss the feature of getting all associations defined for a given instance of ClassA or ClassB. I could do it by brute force and loop over all keys of the map to search for associations between a given instance, but this is inefficient and not elegant. Do you know of any data structure / free library that enables this ? I don't want to reinvent the wheel. Thanks in advance for your help, Raphael NB: This is not a "database" question. These objects are pure POJO used for live computation, I don't need persistence stuff.

    Read the article

  • How to control CSS class applied to ASP.NET 4 Menu with RenderingMode=List

    - by Joe
    I am using an ASP.NET 4.0 Menu control with RenderingMode=List and am struggling with creating the appropriate CSS. Each menu item is represented by an <li tag that contains a nested <a tag with what appear to be fixed class names: <a class="level1" for unselected level 1 menu items <a class="level2" for unselected level 2 menu items <a class="level1 selected" for the selected level 1 menu item ... etc... What I want to do is to is to prevent the currently selected menu item from being "clickable". To do so I tried using: if (menuItem.Selected) menuItem.Selectable = false; This has the desired effect of removing the href attribute from the <a tag but also removes the class attribute - and as a result my CSS can not identify what level the menu item belongs to! Looks to me like a possible bug, but in any case I can't find any documentation describing what CSS class names are used, nor whether there is any way to control this (the old Style properties don't appear to have any effect). Ideally I would like to have "level" class attributes on the <li tags, not just the nested <a tags.

    Read the article

  • Control Attributes render Encoded on dot net 4 - how to disable the encoding ?

    - by Aristos
    I have an issue in asp.net 4. When I add an attribute on controls, then the render it encoded. For example, when I type this code txtQuestion.Attributes["onfocus"] = "if(this.value == this.title) { this.value = ''; this.style.backgroundColor='#FEFDE0'; this.style.color='#000000'; }"; I get render onfocus="if(this.value == this.title){this.value = &#39;&#39;;this.style.backgroundColor=&#39;#FEFDE0&#39;; this.style.color=&#39;#000000&#39;;}" And every ' hash been change to & #39; Is there a way to disable this new future only on some controls ? or an easy way to make a custom render ? My Fail tries I have all ready try some thinks but I fail. For example this fails. txtQuestion.RenderingCompatibility = new Version("3.5"); I also locate the point that this attributes renders and is on public virtual void RenderBeginTag(HtmlTextWriterTag tagKey) function, there every attribute have a flag if he wish to be encoded, but I do not know how can anyone set it or not. Anyway, thank you in advanced.

    Read the article

  • Problem in loading Ifrmae in FireFox!

    - by maddy
    Hello all, I'm trying to load an aspx page using Iframe in VB.net. I'm trying to do it(setting the source of Iframe) with the help of Ext(JavaScript). aspx code: < div id="container" > < iframe id="pane" name="pane" src="Empty.aspx" frameborder="0" >< /iframe> < /div > Javascript code: Pane = function() { var pane; return { init: function() { if (!document.body) { return; } pane = Ext.get('pane'); if ( something ) { this.load(); } else { this.navigateTo('Page.aspx?id=' + a.ID); } }, load: function() { pane.dom.src = 'HTTPURL'; }, navigateTo: function(url) { var agt = navigator.userAgent.toLowerCase(); if (agt.indexOf("firefox") != -1) { document.getElementById('pane').src = url; } else { pane.dom.src = url; } } }; } (); This works fine with IE and Ifrma gets loaded wuth page.aspx every time the parent page is requested. But with FireFox it doesn't. With FireFox the src attribute remains "Empty.aspx" when the page is loaded but when i refresh the page i.e. in post back event the scr attribute changes to "page.aspx?id=a.id" and iframe gets loaded properly. Has anyone faced such kind of problem before? and knows the solution please help me, it's killing me big. Thanks in Advance. Maddy.

    Read the article

  • Problem in loading Ifrmae in FireFox!

    - by user309029
    Hello all, I'm trying to load an aspx page using Iframe in VB.net. I'm trying to do it(setting the source of Iframe) with the help of Ext(JavaScript). aspx code: &lt div id="container" &gt &lt iframe id="pane" name="pane" src="Empty.aspx" frameborder="0" &gt &lt /iframe &gt &lt /div &gt Javascript code: Pane = function() { var pane; return { init: function() { if (!document.body) { return; } pane = Ext.get('pane'); if ( something ) { this.load(); } else { this.navigateTo('Page.aspx?id=' + a.ID); } }, load: function() { pane.dom.src = 'HTTPURL'; }, navigateTo: function(url) { var agt = navigator.userAgent.toLowerCase(); if (agt.indexOf("firefox") != -1) { document.getElementById('pane').src = url; } else { pane.dom.src = url; } } }; } (); This works fine with IE and Ifrma gets loaded wuth page.aspx every time the parent page is requested. But with FireFox it doesn't. With FireFox the src attribute remains "Empty.aspx" when the page is loaded but when i refresh the page i.e. in post back event the scr attribute changes to "page.aspx?id=a.id" and iframe gets loaded properly. Has anyone faced such kind of problem before? and knows the solution please help me, it's killing me big. Thanks in Advance. Maddy.

    Read the article

  • Problem detecting installed application on Win Svr 2003 x64

    - by PD
    I have an x86 Windows application that consists of a couple of services and a client ui. Due to various issues with persuading the various MSIs to upgrade properly, the installation process is now governed by a wizard-style program that detects what is currently installed and handles upgrades by storing the user's current settings, uninstalling the existing software and installing the new version(s). The basic process is: Look in HKLM\Software\Classes\Installer\Products Loop through the GUID keys therein looking for ProductName="(my app name)" If not found, repeat starting from HKCU\Software\Microsoft\Installer\Products instead If found, offer the user an upgrade (as described earlier) else a clean install (i.e. user is asked various questions by the wizard) Now, this works just fine on pretty much any Windows platform you care to mention, from XP up. It fails only on Windows Server 2003 x64, in that an existing installation is not detected by the wizard - despite the exact same registry keys being present as are on any other platform I test on. It's fine on: XP x32 Vista x32, x64 Server 2003 x86 Server 2008 x86, x64 Server 2008 R2 x64 Windows 7 x86, x64 It's only Server 2003 x64 that seems to exhibit this issue.

    Read the article

  • equality on the sender of an event

    - by Berryl
    I have an interface for a UI widget, two of which are attributes of a presenter. public IMatrixWidget NonProjectActivityMatrix { set { // validate the incoming value and set the field _nonProjectActivityMatrix = value; .... // configure & load non-project activities } public IMatrixWidget ProjectActivityMatrix { set { // validate the incoming value and set the field _projectActivityMatrix = value; .... // configure & load project activities } The widget has an event that both presenter objects subscribe to, and so there is an event handler in the presenter like so: public void OnActivityEntry(object sender, EntryChangedEventArgs e) { // calculate newTotal here .... if (ReferenceEquals(sender, _nonProjectActivityMatrix)) { _nonProjectActivityMatrix.UpdateTotalHours(feedback.ActivityTotal); } else if (ReferenceEquals(sender, _projectActivityMatrix)) { _projectActivityMatrix.UpdateTotalHours(feedback.ActivityTotal); } else { // ERROR - we should never be here } } The problem is that the ReferenceEquals on the sender fails, even though it is the implemented widget that is the sender - the same implemented widget that was set to the presenter attribute! Can anyone spot what the problem / fix is? Cheers, Berryl I didn't know you could edit nicely. Cool. Here is the event raising code: void OnGridViewNumericUpDownEditingControl_ValueChanged(object sender, EventArgs e) { // omitted to save sapce if (EntryChanged == null) return; var args = new EntryChangedEventArgs(activityID, dayID, Convert.ToDouble(amount)); EntryChanged(this, args); } Here is the debugger dump of the presenter attribute, sans namespace info: ?_nonProjectActivityMatrix {WinPresentation.Widgets.MatrixWidgetDgv} [WinPresentation.Widgets.MatrixWidgetDgv]: {WinPresentation.Widgets.MatrixWidgetDgv} Here is the debugger dump of the sender: ?sender {WinPresentation.Widgets.MatrixWidgetDgv} base {Core.GUI.Widgets.Lookup.MatrixWidgetBase<Core.GUI.Widgets.Lookup.DynamicDisplayDto>}: {WinPresentation.Widgets.MatrixWidgetDgv} _configuration: {Domain.Presentation.Timesheet.Matrix.WeeklyMatrixConfiguration} _wrappedWidget: {Win.Widgets.DataGridViewDynamicLookupWidget} AllowUserToAddRows: true ColumnCount: 11 Count: 4 EntryChanged: {Method = {Void OnActivityEntry(System.Object, Smack.ConstructionAdmin.Domain.Presentation.Timesheet.Matrix.EntryChangedEventArgs)}} SelectedCell: {DataGridViewNumericUpDownCell { ColumnIndex=3, RowIndex=3 }} SelectedCellValue: "0.00" SelectedColumn: {DataGridViewNumericUpDownColumn { Name=MONDAY, Index=3 }} SelectedItem: {'AdministrativeActivity: 130-04', , AdministrativeTime, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00} Berryl

    Read the article

  • Is there such a thing as IMAP for podcasts?

    - by Gerrit
    Is there such a thing as IMAP for podcasts? I own a desktop, laptop, iPod, smartphone and a web-client all downloading StackOverflow Podcasts. (among others) They all tell me which episodes are available and which are already played. Everything is a horrible mess, ofcourse. My iPod is somewhat in sync with my desktop, but everything else is a random jungle. The same problem with e-mail is solved by IMAP. Every device gets content and meta-information from one server, and stays in sync with it. Per device, I can set preferences (do or do not download the complete archive including junkmail). Can we implement the IMAP approach for podcasts? Or is there a better metaphore/standard to solve this problem? How will the adoption-strategy look like? (by the way: except for the Windows smartphone, I own a full Apple-stack of products. Even then, I run into this problem) UPDATE The RSS-to-Imap link to sourceforge looks promesting, but very alpha/experimental. UPDATE 2 The one thing RSS is missing is the command/method/parameter/attribute to delete/unread items. RSS can only add, not remove. If RSS(N+1) (3?) could add a value for unread="true|false", it would be solved. If I cache all my RSS-feeds on my own server, and add the attribute myself, I only would have to convince iTunes and every other client to respect that.

    Read the article

  • NSFetchedResultsController sections localized sorted

    - by Gerd
    How could I use the NSFetchedResultsController with translated sort key and sectionKeyPath? Problem: I have ID in the property "type" in the database like typeA, typeB, typeC,... and not the value directly because it should be localized. In English typeA=Bird, typeB=Cat, typeC=Dog in German it would be Vogel, Katze, Hund. With a NSFetchedResultController with sort key and sectionKeyPath on "type" I receive the order and sections - typeA - typeB - typeC Next I translate for display and everything is fine in English: - Bird - Cat - Dog Now I switch to German and receive a wrong sort order - Vogel - Katze - Hund because it still sorts by typeA, typeB, typeC So I'm looking for a way to localize the sort for the NSFetchedResultsController. I tried the transient property approach, but this doesn't work for the sort key because the sort key need to be in the entity. I have no other idea. But I can't believe that's not possible to use NSFetchedResultsController on a derived attribute required for localization? There are related discussions like http://stackoverflow.com/questions/1384345/using-custom-sections-with-nsfetchedresultscontroller but the difference is that the custom section names and the sort key have probably the same order. Not in my case and this is the main difference. At the end I would need a sort order for the necessary NSSortDescriptor on a derived attribute, I guess. This sort order has also to serve for the sectionKeyPath. Thanks for any hint.

    Read the article

  • MVC.NET custom validator is not working

    - by IvanMushketyk
    I want to write a custom validator for MVC.NET framework that checks if entered date is in the future. To do it, I wrote the following class: [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public sealed class InTheFutureAttribute : ValidationAttribute, IClientValidatable { private const string DefaultErrorMessage = "{0} should be date in the future"; public InTheFutureAttribute() : base(DefaultErrorMessage) { } public override string FormatErrorMessage(string name) { return string.Format(ErrorMessageString, name); } public override bool IsValid(object value) { DateTime time = (DateTime)value; if (time < DateTime.Now) { return false; } return true; } public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context) { var clientValidationRule = new ModelClientValidationRule() { ErrorMessage = FormatErrorMessage(metadata.GetDisplayName()), ValidationType = "wrongvalue" }; return new[] { clientValidationRule }; } } and added attribute to field that I want to check. On the View page I create input field in the following way: <div class="editor-label-search"> @Html.LabelFor(model => model.checkIn) </div> <div class="editor-field-search-date"> @Html.EditorFor(model => model.checkIn) <script type="text/javascript"> $(document).ready(function () { $('#checkIn').datepicker({ showOn: 'button', buttonImage: '/Content/images/calendar.gif', duration: 0, dateFormat: 'dd/mm/yy' }); }); </script> @Html.ValidationMessageFor(model => model.checkIn) </div> When I submit the form for the controller that requires model with checked attribute code in my validator is called and it returns false, but instead of displaying an error it just call my controller's action and send invalid model to it. Am I doing something wrong? How can I fix it? Thank you in advance.

    Read the article

  • Protecting an Application's Memory From Tampering

    - by Changeling
    We are adding AES 256 bit encryption to our server and client applications for encrypting the TCP/IP traffic containing sensitive information. We will be rotating the keys daily. Because of that, the keys will be stored in memory with the applications. Key distribution process: Each server and client will have a list of initial Key Encryption Key's (KEK) by day If the client has just started up or the server has just started up, the client will request the daily key from the server using the initial key. The server will respond with the daily key, encrypted with the initial key. The daily key is a randomly generated set of alphanumeric characters. We are using AES 256 bit encryption. All subsequent communications will be encrypted using that daily key. Nightly, the client will request the new daily key from the server using the current daily key as the current KEK. After the client gets the new key, the new daily key will replace the old daily key. Is it possible for another bad application to gain access to this memory illegally or is this protected in Windows? The key will not be written to a file, only stored in a variable in memory. If an application can access the memory illegally, how can you protect the memory from tampering? We are using C++ and XP (Vista/7 may be an option in the future so I don't know if that changes the answer).

    Read the article

< Previous Page | 172 173 174 175 176 177 178 179 180 181 182 183  | Next Page >