During a review process of an older programm code the following question arised: All local variables in a method are initialized right after begin. Usually local variables are not initialized. But we have a procedure where all variables are initialized to 0. Does anybody has an idea how this could happen?  Example:  type   TPrices = array[0..10, 0..5] of Integer;  procedure DoSomething(); var   mPrices : TPrices;   mValue  : Integer;  begin   if (mPrices[0,0] = 0) then     MessageDlg('Zero', mtInformation, [mbOK], 0);   if (mValue = 0) then     MessageDlg('Zero Integer', mtInformation, [mbOK], 0); end;
I'm new to Delphi, and I've been running some tests to see what object variables and stack variables are initialized to by default:  TInstanceVariables = class   fBoolean: boolean; // always starts off as false   fInteger: integer; // always starts off as zero   fObject: TObject; // always starts off as nil end;   This is the behaviour I'm used to from other languages, but I'm wondering if it's safe to rely on it in Delphi?  For example, I'm wondering if it might depend on a compiler setting, or perhaps work differently on different machines.  Is it normal to rely on default initialized values for objects, or do you explicitly set all instance variables in the constructor?  As for stack (procedure-level) variables, my tests are showing that unitialized booleans are true, unitialized integers are 2129993264, and uninialized objects are just invalid pointers (i.e. not nil).  I'm guessing the norm is to always set procedure-level variables before accessing them?
Splitting text files based on a regular expression I have a text file which I want to split into 64 unequal parts, according to the 64 hexagrams of the Yi Jing. Since the passage for each hexagram begins with some digit(s), a period, and two newlines, the regex should be pretty easy to write.  But how do I actually split the text file into 64 new files according to this regex? It seems like more of a task for perl. But maybe there's a more obvious way that I'm just totally missing. How to roll perception checks for characters who aren't actively looking without arousing suspicion? This applies to all d20 systems, but with an example from the from the Pathfinder  (emphasis mine):  Stonecunning: Dwarves receive a +2 bonus on Perception checks to potentially notice unusual stonework, such as traps and hidden doors located in stone walls or floors. They receive a check to notice such features whenever they pass within 10 feet of them, whether or not they are actively looking.  In this case, does the GM roll the check in secret or ask the player roll the check? If the GM asks the player to roll for the check, what stops situations like:  GM: (interrupting) &quot;Gimli, Roll a perception check.&quot; Dwarf player: &quot;Oh, it's a natural one, I guess I don't see anything.&quot; Human player: &quot;Okay, I'll roll a perception check for anything unusual in this room. Nice! 19. How about 19, does 19 work for you?&quot; GM: &quot;Gimli, everything looks kosher to you. Aragon, you notice a rock coloured tarp on the ground here, covering what looks like a pit trap.&quot;  In this case, by telling the dwarf to roll his &quot;free&quot; perception check, he's telegraphed to the players that there is something to notice. How can this be fixed, without bluffing checks for nothing in particular to throw off the signal to noise ratio of similar checks? If I'm given a complex number (say $9 + 4i$), how do I calculate its square root? How do I replace multiple spaces with a single space in C#? How can I replace multiple spaces in a string with only one space in C#?  Example:  1 2 3  4    5   would be:  1 2 3 4 5 Seeking GeoServer tutorials? What are sources where I can learn how to use GeoServer?  I know of these two sites:    - which in fact is not working (at least at the moment)  - not only (tutorials) for GeoServer   But I am interested in more complex information, and not to read only documentation. Is it possible in Leaflet that popup opens on mouse-over, not on click?  This is working for just one marker at a time, but I need it for a bigger number of markers:  marker.on('mouseover', function(e){     marker.openPopup(); }); 301 redirect instead of 404 when URL is a prefix of a post or page name? hey all! i have an odd problem with URL routing. when i request a URL that doesn't exist, e.g. , wordpress correctly returns a 404. however, if that URL is a prefix of a post or page name, it instead returns a 301 redirect to the post or page.  for example, if i have a post on 10/1/2010 named Food Post, it will return a 301 with Location:  (my permalink structure). likewise, if i have a page named Food Page, it will return a 301 with Location: .  you can see this in action on my live site,  . e.g.  redirects to  .  turning off permalinks (ie switching to "default") fixes it, for both posts and pages, but naturally i don't really want to do that.  i see this on three different installations, all wordpress 3.0.1 and apache 2.2, two ubuntu lucid/mysql 5.1 and one freebsd 7.3/mysql 5.0. i've deactivated all plugins and removed everything from my .htaccess except the lines for wordpress below, verbatim, but no luck.  RewriteEngine On RewriteBase / RewriteRule ^wordpress/index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L]   thanks in advance... How to learn commutative algebra? I want to learn commutative algebra from scratch. I was wondering, as you are experts in mathematics, what you think is the best way to learn commutative algebra? Is there any video course available for commutative algebra? Will there be some online course for commutative algebra on some website like Coursera, etc?  I know noncommutative algebra up to the Artin-Wedderburn Theorem. Also, I know group theory up to the Sylow theorems and Galois Theory. I also know some basic topology.  I'm new to this site so I don't know what tags I should add for this question. Please feel free to edit my question.  Edit 1: I want to learn commutative algebra for learning Algebraic Geometry. How can I make a logo in Adobe Illustrator like the AntiParticle logo below, from ?   It is a large number circles of different, varying sizes, which form the shape of a text character. Character Limit in HTML How do you impose a character limit on a text input in HTML? $_SERVER["REMOTE_ADDR"] gives server IP rather than visitor IP What is the difference between 'can', 'could', 'may' and 'might'? I'm a native English speaker and I've been doing some research into English grammar for a programme I'm working on. However, on looking into modal verbs, I've only just come to appreciate how subtle and complicated they are.  What is the difference between these sentences? What possible different response might one have to each?        I can go to the cinema tonight.   I could go to the cinema tonight.   I may go to the cinema tonight.   I might go to the cinema tonight.      Granted, the first of these looks more like a statement of ability or possibility than the three that follow. But in what ways does it differ from the others, since all suggest ability and possibility? And crucially, what distinguishes the other three.  Perhaps it's a matter of tone, of context, of the speaker... The question may appear quite simple but I haven't found a satisfactory answer elsewhere.    looked quite useful in that it covered levels of confidence and certainty but it was talking about the potential state of something rather than the possibility for the person who is speaking. Are there any differences in that sense?   looked at these verbs used in question form (e.g., differences between 'Can I...?' and 'May I...?') but I'm not so interested in that for now.  Any thoughts appreciated. Working with objects created with Activator.CreateInstance In version 5.2 of Apple's Pages app for OS X (Mavericks), how do I change the page layout? I am curious how people picture geometrically how the covariant derivative acts with regards to vector fields. I understand that it is merely an object which has been defined for some use and obeys certain conditions but how would you picture such a thing geometrically? In other words, when someone asks you what the covariant derivative is, how do you explain it in absence of a formal definition? Define the sequence $aₙ=20+n²$ and $dₙ=\gcd(aₙ , aₙ₊₁)$ Find with proof the values dₙ takes. What is the proper name for a "river plot" visualisation In a famous plot, Charles Minard visualised the losses of the French Army in the Russian campaign of Napoleon:    (another nice example is  xkcd plot)  Is there a canonical name for this type of visualisation? I'm actually looking for an R package to create such plots, but I don't even know how to look for it.  EDIT:  As I could not find a good package in R do do this type of plots, I have created my own, called "riverplot" -- you can download it . Here is a simplified version of the above diagram:    And an example of what other diagrams can be created with the package: Failed to download repository information due to missing CDROM What's the "official" explanation for Harry's (and everyone else's) absence from muggle school? So a bunch of kids all of a sudden "go missing" from school.  Harry Potter having attended school for a couple of years before starting at Hogwarts, one semester just doesn't show up.  How is this solved? What do parents say when a school teacher calls and wonders where their pupil is?  I assume that Hogwarts isn't an officially recognized school (though perhaps it is?), and due to education being compulsory, someone would do the math and find that low-hundreds of kids go missing in the transition from primary to secondary school every year. LWC Get Pick-list Field Values In LWC, is it possible to get a pick-list field's possible values?  I'm writing a component that is embded into a lightning record page. I need my component to be able to load the record from the page, get data from the fields and use that data to pre-populate my search form with default values.  I have this working with city/state and checkbox fields. Right now the city/state fields are built pull data from an aggregate query of contacts to find all possible state/city combinations (I know this is doomed to fail when the records reach over 50k contacts but Its good enough for now).  I have a pick-list field on my object called skill level, I need to be able to build a combo box that has all the possible values for skill level and set the default value to the value on the associated record.  I'd like to avoid hard-coding the available options if possible.  In LWC, is it possible to get a pick-list field's possible values?