Edit expired, sigh. Here:
I just got this error from Notepad++ (otherwise excellent program btw).
(I have a vague memory that this may have been posted, but couldn't find it, so.. bugger it)
I think the recommended method is to make a spelling mistake when correcting grammar (a good one is to misspell it "grammer"), and a grammatical mistake when correcting spelling.
Then the cycle can continue :)
Here in New Zealand, we always say the "and".
eg.
436 = "four hundred and thirty-six".
436.14 = "four hundred and thirty-six point fourteen" (or maybe "point one-four").
I always wondered about why Americans left out the "and". I'd never ever heard of it representing a decimal point before. Are you telling me you'd say "four hundred thirty-six and fourteen" for 436.14?
I dont know about Europe, but in New Zealand, it's free to receive calls and messages, but you pay to send both.
I was very surprised when I found out it worked any other way anywhere else - paying to *receive* texts? Screw that!
Also note that it can be turned off, somewhere in the control panel.
Additionally, it's a rip-off of this, which is free. And much stylier.
But if it's not_found, then it's automatically not_set either. why not just create(d); initialise(d); read(d); in the first catch block?
Wow, no brackets of any kind allowed. Sucktacular!
Question: could you not just put comdlg32.ocx in the same directory as the executable?
you could try typing "[code]shutdown -a[/code]" in cmd.exe
I'm not sure, since my windows update just prompts me every half an hour (GRRRRRR) rather than forcing me (wow, didn't know they went that far).
I think he was referring to the OP with the naming convention thing.
In java, constants should LOOK_LIKE_THIS (as is the generally accepted convention).
Oh that's even better.
I guess the correct name for the const should have been something like SPACER_STRING. It probably started out being 20 spaces.
lol!
Is there also
public static final String thirteenampersands = "&&&&&&&&&&&&&";
or maybe
public static final String sevendollarsignsfollowedbyasingleasterisk = "$$$$$$$*";
I don't get it I'm afraid.. that loop will execute twice (i=0, i=1). Or was that <= supposed to be a < ?
@bah said:
@phithe said:
Well, I did RTFM, and I found a solution - I used an array of TStrings. And I realise I could define a type to do it.I hope you also realise an "array of TStrings" is an array of class instances, and so you'll have to create/free all the objects manually (unless you're doing .NET, but you'll still have to create them all).
I don't see what's wrong with using "type TDoubleStringArray = array of array of string"; especially since it's compiler-managed.
Well, you're probably right there - your way would have been the better option.
@bah said:
@phithe said:
My point is, if "procedure foo(array of bar)" works, and "var array of array of bar" works, then logically, "procedure foo(array of array of bar)" SHOULD work.No, it should not. "Array of" in a routine declaration defines an OPEN ARRAY, which is not a dynamic array. Go read up on it [1].
Ok, that link was very helpful, thanks. However, according to that link, a dynamic array may be passed into an open array parameter. And it works, when said dynamic array is one dimensional.
@bah said:
@phithe said:
Wow. This is even more WTF. I wrote some code to test that out. Check it out:<font face="Courier New">
var
a : array of string; // these two are
b : array of string; // not assignment-compatible, but
c, d : array of string; // these two ARE assignment compatible</font>
Awesome.Well it's rather obvious to anyone with some experience in Pascal. a and b have two separate specs, while c and d share theirs. It should be as clear as:
var
a: Type1;
b: Type2;
c, d: Type3;
Okay, I guess I'll put that down to my lack of pascal experience then. It's not obvious to me at all.
@bah said:
@phithe said:
Yes, I understand that (now anyway). Here's what made me go WTF.
An array is an intrinsic data structure, but a multi-dimensional array is not, yet the syntax implies they are both instrinsic.Well they are. Like I wrote above, "array of <type>" in a routine declaration defines an open array. Open arrays are created just before, and destroyed just after the call to the routine. You can pass dynamic arrays to an open array parameter, but it's handled quite differently by the compiler.
Yes, I understand that (now anyway). Here's what made me go WTF.
An array is an intrinsic data structure, but a multi-dimensional array is not, yet the syntax implies they are both instrinsic. If a multidimensional array is so different to a single dimensional array, call it a TMultiDimensionalArray or something.
Well, I did RTFM, and I found a solution - I used an array of TStrings. And I realise I could define a type to do it.
My point is, if "procedure foo(array of bar)" works, and "var array of array of bar" works, then logically, "procedure foo(array of array of bar)" SHOULD work.
Alternatively, the syntax should be changed to reflect the different types of arrays under the hood.
Also:
that's why two variables declared as "array of <type>" are notWow. This is even more WTF. I wrote some code to test that out. Check it out:<font face="Courier New">
assignment-compatible; even though they are the same in memory, they
are not of the same type). Pascal is a very strongly-typed language.
@zamies said:
@phithe said:Well yes, there are workarounds. What I ended up doing was using an array of TStringLists.
My point is, it should have been so much simpler.
Yeah meddling with pointers is soooo much more simpler, and so less bug prone...
Well yes, there are workarounds. What I ended up doing was using an array of TStringLists.
My point is, it should have been so much simpler.
<font size="3"><font face="Verdana">My work is almost completely a Delphi7 + SQL Server shop, and I've been having fun learning Delphi since I started here. I often encounter little wtfs in the language.
I think this one is a fine example of what's wrong with Delphi.</font>
<font face="Courier New">// procedures can accept arrays as parameters
procedure doSomething( list : array of string);
</font><font face="Courier New">
begin
// whatever
end;
procedure Main;
var
bob : array of string; // here's a normal array
bobsquared : array of array of string; // here's a multidimensional array
begin
doSomething(bob); // you can pass arrays to procedures
end;
// but procedures CANNOT accept multidimensional arrays as parameters!! WHY NOT??
</font><font face="Courier New">
procedure doSomethingElse( listsquared : array of array of string); // this does not compile!!
begin
// whatever
end;</font>
<font face="Georgia"><font face="Verdana">Why is passing an array of array ANY different to passing an array of anything else? An array should just be a pointer to a structure containing data about the array, including a pointer to some memory where the elements are held. If those elements happen to be pointers to more arrays - so what?
Delphi just feels hacked together, as if someone just started coding without doing any design work.</font>
</font>
</font>
When I went through Compsci101, they didn't actually teach arrays until quite some time into the course.
I already knew it all ( ;) ) but almost all the students submitted code like the above, and it was expected. The above code would be considered pretty good at that level.
I also used to play text adventures - anyone else remember the Time and Magik trilogy?
I also intermittently work on my little php adventure engine :)
Anyway, here's something to aim for: http://www.ifcomp.org/
<font face="Courier New"><font face="Times New Roman">I think that first line should be:
</font>control.Text = ((i==0)?1:0).ToString();
<font face="Times New Roman">I think. Talk about convoluted.
</font></font>
Also note that even if the alert wasn't commented out, it wouldn't do anything to stop you using the site once you clicked ok on it.
I wonder what the story behind it is :)
I can report that SuSE 10, for one, handles NTFS resizing very nicely. But o' course, you can always use partition magic or similar in windows, before you install linux.
Sounds awful.
But what's wrong with this? :
<FONT face="Courier New">command value1</FONT>
<FONT face="Courier New">command value2</FONT>
<FONT face="Courier New">command value3</FONT>
You're only iterating over three values..