Search Results

Search found 93 results on 4 pages for 'zoltan repas'.

Page 4/4 | < Previous Page | 1 2 3 4 

  • IIS7 - Web Deployment Tool - SetParam/SetParamFile to set http and https bindings + Cert

    - by Andras Zoltan
    Hi, we're currently using the MS Web Deployment Tool to sync a live website and some WebServices from a staging box to two live servers. The staging box hosts the site on any IP on port 17000, whereas the two live servers are load-balanced and have a different IP for each of them. At present, I generate two separate packages for deployment - one for each machine - using the sync operation and specifying a DestinationBinding parameter as follows: msdeploy -verb:sync -source:WebServer,computerName=localhost -dest:package="machinename.zip" -setParam:type="DestinationBinding",scope="SiteName",value="ip_address:port:". (Split across multiple lines to make it easier to read!) I run this twice, with a different target filename and ip address for each of the two machines. When it comes to deployment, I simply do a sync from each package to its respective live site. I know, I know - I should be able to do it by generating one parameterised package and then perhaps using the SetParamFile switch for each of the two Servers - believe me I'd like to, but the documentation on doing this is frankly non-existent. Now I need to configure and deploy both HTTP and HTTPS binding for this site; including also the ssl cert that is to be used. I've added an SSL binding for the site on the staging box - which uses a development cert (which will need to be replaced - or should the staging box be using the live cert?), and now the above command line has the effect of replacing the target IP on both http and https entries. It appears that I cannot specify multiple bindings plus the cert information in the DestinationBinding value in the -setParam above, so anyone know how would I go about doing this? Any help greatly appreciated.

    Read the article

  • Package managers for Windows

    - by mezei.zoltan
    You might be familiar with Ninite. What I'd like to know is if there are good alternatives to that software for Windows. The features I expect: installs the latest version of software supports 64 bit installs where possible strips ads/toolbars/similar stuff provides a way to keep the programs updated after installation if I can add custom installers to the software, that's a big plus. Any ideas if such a program exists?

    Read the article

  • Sysprep.exe completely missing on both of my Windows 7 64bit machines. How should I find a workaround?

    - by Zoltán Tamási
    The sysprep.exe file is simply missing on my Windows 7 64bit machine. I tried to find it on another computer, but it wasn't found there either. I can't understand it, because on a lot of forums and even in the official articles there are a lot of references to this tool. I've checked system, system32, sysWOW64 folders, and even made a full search with Total Commander. I only found a sysprep folder in the system32 folder, but inside was only an en-US subfolder, which was empty. Then I thought I will give my Windows PE bootdisk a try, which I've created a while ago. No result, only the same empty en-US folder is present there as well. Please if anyone knows what's happening, point me to the right direction. I need to clone my system and I'm stuck right at the first step...

    Read the article

  • How to pre-load all deployed assemblies for an AppDomain

    - by Andras Zoltan
    Given an App Domain, there are many different locations that Fusion (the .Net assembly loader) will probe for a given assembly. Obviously, we take this functionality for granted and, since the probing appears to be embedded within the .Net runtime (Assembly._nLoad internal method seems to be the entry-point when Reflect-Loading - and I assume that implicit loading is probably covered by the same underlying algorithm), as developers we don't seem to be able to gain access to those search paths. My problem is that I have a component that does a lot of dynamic type resolution, and which needs to be able to ensure that all user-deployed assemblies for a given AppDomain are pre-loaded before it starts its work. Yes, it slows down startup - but the benefits we get from this component totally outweight this. The basic loading algorithm I've already written is as follows. It deep-scans a set of folders for any .dll (.exes are being excluded at the moment), and uses Assembly.LoadFrom to load the dll if it's AssemblyName cannot be found in the set of assemblies already loaded into the AppDomain (this is implemented inefficiently, but it can be optimized later): void PreLoad(IEnumerable<string> paths) { foreach(path p in paths) { PreLoad(p); } } void PreLoad(string p) { //all try/catch blocks are elided for brevity string[] files = null; files = Directory.GetFiles(p, "*.dll", SearchOption.AllDirectories); AssemblyName a = null; foreach (var s in files) { a = AssemblyName.GetAssemblyName(s); if (!AppDomain.CurrentDomain.GetAssemblies().Any( assembly => AssemblyName.ReferenceMatchesDefinition( assembly.GetName(), a))) Assembly.LoadFrom(s); } } LoadFrom is used because I've found that using Load() can lead to duplicate assemblies being loaded by Fusion if, when it probes for it, it doesn't find one loaded from where it expects to find it. So, with this in place, all I now have to do is to get a list in precedence order (highest to lowest) of the search paths that Fusion is going to be using when it searches for an assembly. Then I can simply iterate through them. The GAC is irrelevant for this, and I'm not interested in any environment-driven fixed paths that Fusion might use - only those paths that can be gleaned from the AppDomain which contain assemblies expressly deployed for the app. My first iteration of this simply used AppDomain.BaseDirectory. This works for services, form apps and console apps. It doesn't work for an Asp.Net website, however, since there are at least two main locations - the AppDomain.DynamicDirectory (where Asp.Net places it's dynamically generated page classes and any assemblies that the Aspx page code references), and then the site's Bin folder - which can be discovered from the AppDomain.SetupInformation.PrivateBinPath property. So I now have working code for the most basic types of apps now (Sql Server-hosted AppDomains are another story since the filesystem is virtualised) - but I came across an interesting issue a couple of days ago where this code simply doesn't work: the nUnit test runner. This uses both Shadow Copying (so my algorithm would need to be discovering and loading them from the shadow-copy drop folder, not from the bin folder) and it sets up the PrivateBinPath as being relative to the base directory. And of course there are loads of other hosting scenarios that I probably haven't considered; but which must be valid because otherwise Fusion would choke on loading the assemblies. I want to stop feeling around and introducing hack upon hack to accommodate these new scenarios as they crop up - what I want is, given an AppDomain and its setup information, the ability to produce this list of Folders that I should scan in order to pick up all the DLLs that are going to be loaded; regardless of how the AppDomain is setup. If Fusion can see them as all the same, then so should my code. Of course, I might have to alter the algorithm if .Net changes its internals - that's just a cross I'll have to bear. Equally, I'm happy to consider SQL Server and any other similar environments as edge-cases that remain unsupported for now. Any ideas!?

    Read the article

  • How to produce an HTTP 403-equivalent WCF Message from an IErrorHandler?

    - by Andras Zoltan
    I want to write an IErrorHandler implementation that will handle AuthenticationException instances (a proprietary type), and then in the implementation of ProvideFault provide a traditional Http Response with a status code of 403 as the fault message. So far I have my first best guess wired into a service, but WCF appears to be ignoring the output message completely, even though the error handler is being called. At the moment, the code looks like this: public class AuthWeb403ErrorHandler : IErrorHandler { #region IErrorHandler Members public bool HandleError(Exception error) { return error is AuthenticationException; } public void ProvideFault(Exception error, MessageVersion version, ref Message fault) { //first attempt - just a stab in the dark, really HttpResponseMessageProperty property = new HttpResponseMessageProperty(); property.SuppressEntityBody = true; property.StatusCode = System.Net.HttpStatusCode.Forbidden; property.StatusDescription = "Forbidden"; var m = Message.CreateMessage(version, null); m.Properties[HttpResponseMessageProperty.Name] = property; fault = m; } #endregion } With this in place, I just get the standard WCF html 'The server encountered an error processing the request. See server logs for more details.' - which is what would happen if there was no IErrorHandler. Is this a feature of the behaviours added by WebServiceHost? Or is it because the message I'm building is simply wrong!? I can verify that the event log is indeed not receiving anything. My current test environment is a WebGet method (both XML and Json) hosted in a service that is created with the WebServiceHostFactory, and Asp.Net compatibility switched off. The service method simply throws the exception in question.

    Read the article

  • Calculate a set of concatenated sets of n sets

    - by Andras Zoltan
    Okay - I'm not even sure that the term is right - and I'm sure there is bound to be a term for this - but I'll do my best to explain. This is not quite a cross product here, and the order of the results are absolutely crucial. Given: IEnumerable<IEnumerable<string>> sets = new[] { /* a */ new[] { "a", "b", "c" }, /* b */ new[] { "1", "2", "3" }, /* c */ new[] { "x", "y", "z" } }; Where each inner enumerable represents an instruction to produce a set of concatenations as follows (the order here is important): set a* = new string[] { "abc", "ab", "a" }; set b* = new string[] { "123", "12", "1" }; set c* = new string[] { "xyz", "xy", "x" }; I want to produce set ordered concatenations as follows: set final = new string { a*[0] + b*[0] + c*[0], /* abc123xyz */ a*[0] + b*[0] + c*[1], /* abc123xy */ a*[0] + b*[0] + c*[2], /* abc123x */ a*[0] + b*[0], /* abc123 */ a*[0] + b*[1] + c*[0], /* abc12xyz */ a*[0] + b*[1] + c*[1], /* abc12xy */ a*[0] + b*[1] + c*[2], /* abc12x */ a*[0] + b*[1], /* abc12 */ a*[0] + b*[2] + c*[0], /* abc1xyz */ a*[0] + b*[2] + c*[1], /* abc1xy */ a*[0] + b*[2] + c*[2], /* abc1x */ a*[0] + b*[2], /* abc1 */ a*[0], /* abc */ a*[1] + b*[0] + c*[0], /* ab123xyz */ /* and so on for a*[1] */ /* ... */ a*[2] + b*[0] + c*[0], /* a123xyz */ /* and so on for a*[2] */ /* ... */ /* now lop off a[*] and start with b + c */ b*[0] + c*[0], /* 123xyz */ /* rest of the combinations of b + c with b on its own as well */ /* then finally */ c[0], c[1], c[2]}; So clearly, there are going to be a lot of combinations! I can see similarities with Numeric bases (since the order is important as well), and I'm sure there are permutations/combinations lurking in here too. The question is - how to write an algorithm like this that'll cope with any number of sets of strings? Linq, non-Linq; I'm not fussed. Why am I doing this? Indeed, why!? In Asp.Net MVC - I want to have partial views that can be redefined for a given combination of back-end/front-end culture and language. The most basic of these would be, for a given base view View, we could have View-en-GB, View-en, View-GB, and View, in that order of precedence (recognising of course that the language/culture codes could be the same, so some combinations might be the same - a Distinct() will solve that). But I also have other views that, in themselves, have other possible combinations before culture is even taken into account (too long to go into - but the fact is, this algo will enable a whole bunch of really cool that I want to offer my developers!). I want to produce a search list of all the acceptable view names, iterate through the whole lot until the most specific match is found (governed by the order that this algo will produce these concatenations in) then serve up the resolved Partial View. The result of the search can later be cached to avoid the expense of running the algorithm all the time. I already have a really basic version of this working that just has one enumerable of strings. But this is a whole different kettle of seafood! Any help greatly appreciated.

    Read the article

  • Secure Password Storage and Transfer

    - by Andras Zoltan
    I'm developing a new user store for my organisation and am now tackling password storage. The concepts of salting, HMAC etc are all fine with me - and want to store the users' passwords either salted and hashed, HMAC hashed, or HMAC salted and hashed - not sure what the best way will be - but in theory it won't matter as it will be able to change over time if required. I want to have an XML & JSON service that can act as a Security Token Service for client-side apps. I've already developed one for another system, which requires that the client double-encrypts a clear-text password using SHA1 first and then HMACSHA1 using a 128 unique key (or nonce) supplied by the server for that session only. I'd like to repeat this technique for the new system - upgrading the algo to SHA256 (chosen since implementations are readily available for all aforementioned platforms - and it's much stronger than SHA1) - but there is a problem. If I'm storing the password as a salted hash in the user-store, the client will need to be sent that salt in order to construct the correct hash before being HMACd with the unique session key. This would completely go against the point of using a salt in the first place. Equally, if I don't use salt for password storage, but instead use HMAC, it's still the same problem. At the moment, the only solution I can see is to use naked SHA256 hashing for the password in the user store, so that I can then use this as a starting point on both the server and the client for a more secure salted/hmacd password transfer for the web service. This still leaves the user store vulnerable to a dictionary attack were it ever to be accessed; and however unlikely that might be - assuming it will never happen simply doesn't sit well with me. Greatly appreciate any input.

    Read the article

  • If 'Architect' is a dirty word - what's the alternative; when not everyone can actually design a goo

    - by Andras Zoltan
    Now - I'm a developer first and foremost; but whenever I sit down to work on a big project with lots of interlinking components and areas, I will forward-plan my interfaces, base classes etc as best I can - putting on my Architect hat. For a few weeks I've been doing this for a huge project - designing whole swathes of interfaces etc for a business-wide platform that we're developing. The basic structure is a couple of big projects that consists of service and data interfaces, with some basic implementations of all of these. On their own, these assemblies are useless though, as they are simply intended intended as a scaffold on which to build a business-specific implementation (we have a lot of businesses). Therefore, the design of the core platform is absolutely crucial, since consumers of the system are not intended to know which implementation they are actually using. In the past it's not worked so well, but after a few proof-of-concepts and R&D projects this new platform is now growing nicely and is already proving itself. Then somebody else gets involved in the project - he's a TDD man who sees code-level architecture as an irrelevance and is definitely from the camp that 'architect' is a dirty word - I should add that our working relationship is very good despite this :) He's open about the fact that he can't architect in advance and obviously TDD really helps him because it allows him to evolve his systems over time. That I get, and totally understand; but it means that his coding style, basically, doesn't seem to be able to honour the architecture that I've been putting in place. Now don't get me wrong - he's an awesome coder; but the other day he needed to extend one of his components (an implementation of a core interface) to bring in an extra implementation-specific dependency; and in doing so he extended the core interface as well as his implementation (he uses ReSharper), thus breaking the independence of the whole interface. When I pointed out his error to him, he was dismayed. Being test-first, all that mattered to him was that he'd made his tests pass, and just said 'well, I need that dependency, so can't we put it in?'. Of course we could put it in, but I was frustrated that he couldn't see that refactoring the generic interface to incorporate an implementation-specific feature was just wrong! But it is all very Charlie Brown to him (you know the sound the adults make when they're talking to the children) - as far as he's concerned we don't need to worry about it because we can always refactor. The problem is, the culture of test-write-refactor is all very well and good - but not when you're dealing with a platform that is going to be shared out among so many projects that you could never get them all in one place to make the refactorings work. In my opinion, sometimes you actually have to think about what you're doing, and not just let nature take its course. Am I simply fulfilling the role of Architect as a dirty word here? I believe that architecture is important and should be thought about before code gets written; unless it's a particularly small project. But when you're working in a team of people who don't think that way, or even can't think that way how can you actually get this across? Is it a case of simply making the architecture off-limits to changes by other people? I don't want to start having bloody committees just to be able to grow the system; but equally I don't want to be the only one responsible for it all. Do you think the architect role is a waste of time? Is it at odds with TDD and other practises? Can this mix of different practises be made to work, or should I just be a lot less precious (and in so doing allow a generic platform become useless!)? Or do I just lay down the law? Any ideas/experiences/views gratefully received.

    Read the article

  • Using property file in hibernate mapping

    - by Zoltan Hamori
    Hi, I have a two nodes environment using the same database. In the database there is a resource table like RESOURCE_ID, CODE, NODE The content of the NODE column can be 1 or 2 depending on which node can use it. As I need to deploy the same ear to the two nodes, I would like to map this table like this: <hibernate-mapping> <class name="ResourceVO" table="RESOURCE" dynamic-update="true" optimistic-lock="dirty" where="NODE=${node.value}" > I would like to store the node.value property on the file system, so the instances could identify which resource to use. Is it possible in hibernate?

    Read the article

  • Scaling Java applications - existing cluster-aware IoC frameworks?

    - by Zoltan
    Most people use some kind of an IoC framework - Guice, Spring, you name it. Many of us need to scale their applications too, so they complicate their lifes with Terracotta, Glassfish/JBoss/insertyourfavouritehere clusters. But is it really the way to go? Are you using any of the above? Here's some ideas we currently have implemented in a yet-to-be-opensourced framework, and I'd like to see what you think of it, or maybe "it's a complete ripoff of XY!". cluster-wide object replication - give it a name, and whenever you do something (in any node) on such an object, it will get replicated - with different guarantees do transparent soft-loadbalancing - simplest scenario: restful webservice method call proxied to an other node view-only node injection: inject a proxy to a "named" object, and get your calls automatically proxied to a node Would you use something like that? Is there a current, stable, enterprise-ready implementation out there?

    Read the article

  • ios UITableView reloadData don't increase content height

    - by Zoltan Varadi
    I'm facing a strange error in my iOS app and haven't been able to figure out the reason why. In my UITableView i can add new cells, so i refresh the array that is the datasource and call reloadData. Everything works without error. The numberOfRowsInSection is called again, and it's value is one more than it's previous value was. The new cell even gets inserted at the bottom of the tableview, but i cant scroll down to it. I only know that it's there because the tableview bounces and i can see it. I'm guessing the tableview's content height is not getting increased for some reason, but i have no idea why. I'm using iOS 6 btw. Any help is very much appreciated! Thanks, Zoli EDIT, answers for Srikanth's questions: How is data getting added. There's an NSArray containing objects of a specific type. The array.count is the number of the number of cells. This NSArray gets its values from a database query. When you say, you are refreshing the array, what do you mean. By refreshing the array i mean i execute a new query in the database and put the results of this query into an NSArray. this will be the tableview's datasource array. Like this: dataSourceArray = [dbManager executeQuery]; [tableView reloadData]; Are you adding the data within the same view controller Yes. Can you show some code as to what you are doing See above. Is the table view at the root of the view controllers view or is it within another view The tableview is the main view's first child. Can you try adding data to the array at the beginning, so that you can view the cell being added at the top. I don't understand what you mean.

    Read the article

  • Google I/O 2012 - HTML5 at YouTube: Stories from the Mobile Front

    Google I/O 2012 - HTML5 at YouTube: Stories from the Mobile Front Greg Schechter, Zoltan Szego Is HTML5 ready for production code? Of course it is. This is a look into all the different HTML5 technologies we use in live code at YouTube. We'll have a collection of tips, tricks, and best practices for HTML5 video, the track tag, getUserMedia, and more. Plus a deep dive into Mobile Video Tag development. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 329 10 ratings Time: 54:10 More in Science & Technology

    Read the article

  • Technology Fórum eloadások

    - by Lajos Sárecz
    Ma délelott lezajlott az Oracle Technology Fórum rendezvény. A Database szekcióban Tóth Csaba tartotta a nyitó eloadást, melyben az IT költségek csökkentési lehetoségeirol beszélt Oracle Database 11g felhasználásával. Ot követoen én beszéltem az Oracle Enterprise Manager által kínált extrém menedzsment képességekrol, amely ma már nem csak adatbázis menedzsmentet jelent, hanem a teljes alkalmazás infrastruktúra üzemeltetésre koncentrál, kiemelt figyelmet fordítva az üzlet valós kiszolgálására. Szünet elott még Mosolygó Feri tartott egy eloadást az adatbázis-kezelo és a felho kapcsolatáról, majd szünet után Fekete Zoltán folytatta a Database Machine bemutatásával. Zoli után ismét Mosolygó Feri tartott eloadást ezúttal az adatbázis biztonságról, majd én zártam a napot a kockázatmentes változáskezelés témával.

    Read the article

  • NHibernate Linq Provider question

    - by csizo
    Can anyone answer me what are the differences of Session.Query Session.Linq and Session.QueryOver What I'm really interested in: What would be supported in the future versions. What should I start to use in a clean project. Please tell me your thoughts about these three... Thanks, Zoltán

    Read the article

  • HOUG Konferencia 2012

    - by user645740
    2012. március 26-án, azaz ma kezdodik Egerszalókon a magyarországi Oracle felhasználók rendszeres konferenciája, a HOUG Konferencia 2012, rengeteg érdekes eloadással, kerekasztal beszélgetéssel, networkinggel. A helyszínen még lehet személyesen regisztrálni, a HOUG tagoknak kedvezményes a részvétel. www.houg.hu Igen nagy az érdeklodés! A szálloda és néhány közeli szálláshely már megtelt. A környéken szerencsére még sok szálloda és fogadó található, tehát aki akar még mindig talál szobát. A programról, ami metekintheto, letöltheto: http://www.houg.hu/contents/files/houg2012_program_vegleges.pdf Kedden, március 27-én 10:15-11h John Abel fog izgalmas eloadást tartani az Oracle intelligens tervezett célrendszerekrol - "Extreme Performance with Oracle Engineered Systems", John Abel, Business Development director - EMEA, köztük az Oracle Exadata Database Machine adatázisgéprol is. Szintén kedden délután kerekasztal beszélgetésen fogjuk megtárgyalni ezen rendszerek magyarországi alkalmazásának lehetoségeit, igényeket: Exadata, SPARC SuperCluster, Exalogic, Exalytics, stb. 16:35-17:40, "Célrendszerek alkalmazhatósága a mindennapokban", a kerekasztal beszélgetés moderátora Fodor Endre. Kedd délután eloadást tartok az 13:45-14:35, "Oracle Exadata Database Machine: a világ leggyorsabb adatbázisgépe" címmel. A kedd délutáni Adatgyujtéstol az elemzésig szekció az üzleti intelligencia és adattárház ügyfél tapasztalatokról és technológiákról szól. A szekció vezetoi: Arató Bence, HOUG és Fekete Zoltán (én). BMW tesztvezetés, színházi és koncertprogram színesíti a rendezvényt.

    Read the article

  • PHP array ordering

    - by Melonheadjr44
    Hi, I was wondering how I could sort this array, when I use asort right now it does 14 17 16 15. How would I go to have 14 15 16 17 array(4) { [15]=> array(9) { [2025]=> string(80) "20:25 à 21:15 Spectacle / L'histoire d'un coeur / Auditorium, É.S.P. De La Salle" [2135]=> string(71) "21:35 à 22:25 Spectacle / Transfugue 2 / Auditorium, É.S.P. De La Salle" [1430]=> string(64) "14:30 à 15:30 Mise en lecture/Théâtre la Catapulte / De La Salle" [110]=> string(44) "11:00 à 13:00 Inscription / Pavillon Tabaret" [1330]=> string(49) "13:30 à 14:30 CÉRÉMONIE D'OUVERTURE / De La Salle" [1550]=> string(61) "15:50 à 16:40 Spectacle/Université Laurentienne / De La Salle" [170]=> string(57) "17:00 à 17:50 Spectacle/Université d'Ottawa / De La Salle" [1750]=> string(45) "17:50 à 19:00 REPAS DE L'AMITIÉ / De La Salle" [1915]=> string(76) "19:15 à 20:05 Spectacle / Attendre la pluie / Auditorium, É.S.P. De La Salle" } [16]=> array(8) { [1845]=> string(81) "18:45 à 19:35 Spectacle / Mimes d'horreur / Salle Académique, Université d'Ottawa" [1955]=> string(73) "19:55 à 20:45 Spectacle / Déroute / Salle Académique, Université d'Ottawa" [8]=> string(45) "08:30 à 11:30 Atelier / ABC du jeu dramatique" [13]=> string(41) "13:00 à 16:00 Atelier / Théâtre physique" [1130]=> string(28) "11:30 à 13:00 DÎNER LIBRE / " [1620]=> string(29) "16:20 à 18:20 SOUPER LIBRE / " [220]=> string(58) "22:00 à 23:30 BAL MASQUÉ / l'Agora du centre universitaire" [210]=> string(47) "21:00 à 22:00 Rétroaction / Université d'Ottawa" } [17]=> array(4) { [950]=> string(79) "09:50 à 10:40 Spectacle / Raison d'être / Salle Académique, Université d'Ottawa" [110]=> string(76) "11:00 à 11:50 Spectacle / Potionnée / Salle Académique, Université d'Ottawa" [120]=> string(28) "12:00 à 13:00 DÎNER LIBRE / " [1330]=> string(48) "13:30 à 14:30 CÉRÉMONIE DE CLÔTURE / De La Salle" } [14]=> array(1) { [150]=> string(49) "15:00 à 16:30 Préparation technique / De La Salle" } }

    Read the article

  • Why might a System.String object not cache its hash code?

    - by Dan Tao
    A glance at the source code for string.GetHashCode using Reflector reveals the following (for mscorlib.dll version 4.0): public override unsafe int GetHashCode() { fixed (char* str = ((char*) this)) { char* chPtr = str; int num = 0x15051505; int num2 = num; int* numPtr = (int*) chPtr; for (int i = this.Length; i > 0; i -= 4) { num = (((num << 5) + num) + (num >> 0x1b)) ^ numPtr[0]; if (i <= 2) { break; } num2 = (((num2 << 5) + num2) + (num2 >> 0x1b)) ^ numPtr[1]; numPtr += 2; } return (num + (num2 * 0x5d588b65)); } } Now, I realize that the implementation of GetHashCode is not specified and is implementation-dependent, so the question "is GetHashCode implemented in the form of X or Y?" is not really answerable. I'm just curious about a few things: If Reflector has disassembled the DLL correctly and this is the implementation of GetHashCode (in my environment), am I correct in interpreting this code to indicate that a string object, based on this particular implementation, would not cache its hash code? Assuming the answer is yes, why would this be? It seems to me that the memory cost would be minimal (one more 32-bit integer, a drop in the pond compared to the size of the string itself) whereas the savings would be significant, especially in cases where, e.g., strings are used as keys in a hashtable-based collection like a Dictionary<string, [...]>. And since the string class is immutable, it isn't like the value returned by GetHashCode will ever even change. What could I be missing? UPDATE: In response to Andras Zoltan's closing remark: There's also the point made in Tim's answer(+1 there). If he's right, and I think he is, then there's no guarantee that a string is actually immutable after construction, therefore to cache the result would be wrong. Whoa, whoa there! This is an interesting point to make (and yes it's very true), but I really doubt that this was taken into consideration in the implementation of GetHashCode. The statement "therefore to cache the result would be wrong" implies to me that the framework's attitude regarding strings is "Well, they're supposed to be immutable, but really if developers want to get sneaky they're mutable so we'll treat them as such." This is definitely not how the framework views strings. It fully relies on their immutability in so many ways (interning of string literals, assignment of all zero-length strings to string.Empty, etc.) that, basically, if you mutate a string, you're writing code whose behavior is entirely undefined and unpredictable. I guess my point is that for the author(s) of this implementation to worry, "What if this string instance is modified between calls, even though the class as it is publicly exposed is immutable?" would be like for someone planning a casual outdoor BBQ to think to him-/herself, "What if someone brings an atomic bomb to the party?" Look, if someone brings an atom bomb, party's over.

    Read the article

< Previous Page | 1 2 3 4