venta: (Default)
[personal profile] venta
A quick question for Visual Studio users (with an ancillary part for anyone who writes C/C++/possibly Java/possibly others). Throughout the following, I mean {} or () by "brackets" :)

Is there an option anywhere in Visual Studio which I can set which means that when I highlight/hover over a bracket, it will in some way highlight or indicate its matching friend ? Yes, I know when you first close your brackets they're in bold text, but that goes away as soon as you start typing something else.

I just asked a VS user here, and he (a) had no idea and (b) seemed baffled I'd want that. Now, up until this recent enforced flirtation with VS I've written C/C++ exclusively in Emacs. Which allows you to set all kinds of different manners of highlighting for brackets. I find it phenomenally useful and am currently boggled that any serious text editor intended for programming doesn't offer this.

So... is this a reasonable thing to want to, or a strange quirk of mine bred by too much use of Emacs ? And, more importantly, can I make VS do it ?

Irrelevantly, just because I want to know:

[Poll #1028846]

Date: 2007-07-27 05:08 pm (UTC)
From: [identity profile] hjalfi.livejournal.com
I have just been doing float-point implementation on PowerPC.

Arrgh.

However, if you want a chunk of BSD-licensed code that calculates 4 or 8 byte IEEE floating point constants from a string representation, I know where to get one...

Date: 2007-07-27 05:14 pm (UTC)
From: [identity profile] venta.livejournal.com
Today, I encountered the scariest bit of code I've ever seen (which relied on IEEE float format). It was a quick square-root function for 16.16 fixed point input, and utilised this:

http://blog.int6.net/wp-content/uploads/2006/10/FastInverseSqrt.pdf

Which (until I googled for the magic number and found the above) was wildly impenetrable.

Date: 2007-07-27 05:26 pm (UTC)
From: [identity profile] hjalfi.livejournal.com
That is deeply impressive. I'll have to remember that.

Oddly enough, the PowerPC (yes, I've been spending far too much time immersed in that sodding "what do you mean, the R in RISC stands for 'reduced'?" abomination of a "of *course* it makes sense to number bits with 0 as the MSB and 31... er, 63... er, n as the LSB" processor) has an instruction, frsqrte, that calculates exactly this:

http://www.nersc.gov/vendor_docs/ibm/asm/frsqrte.htm

It could well use that algorithm...

Date: 2007-07-27 05:32 pm (UTC)
From: [identity profile] secondhand-rick.livejournal.com
Is there an option anywhere in Visual Studio which I can set which means that when I highlight/hover over a bracket, it will in some way highlight or indicate its matching friend?

If you can find out an option in Visual Studio to use Vi emulation, then it's %.

He said helpfully.

Date: 2007-07-27 06:21 pm (UTC)
From: [identity profile] erming.livejournal.com
I think if you click on it it shows it's matching friend.

Date: 2007-07-27 07:11 pm (UTC)
From: [identity profile] waistcoatmark.livejournal.com
Ctrl-Shfit-] used to do it back in the days of VS 6. I somehow doubt that they urgently needed to use it for some other functionality since then, but then again, it's so obscure that it may never have been ported over.

Date: 2007-07-27 07:52 pm (UTC)
From: [identity profile] mister-jack.livejournal.com
Is there an option anywhere in Visual Studio which I can set which means that when I highlight/hover over a bracket, it will in some way highlight or indicate its matching friend?

Which version of Visual Studio? And do you have Visual Assist?

IIRC (and I could check but can't be arsed) 2005 does this, but no earlier version does unless you install Visual Assist. ctrl-] will jump between them if you need it to.

Date: 2007-07-27 08:52 pm (UTC)
From: [identity profile] feanelwa.livejournal.com
'The number part'
'The bit on the bottom'
'Thingy point whatsit whatsit'

Date: 2007-07-27 09:07 pm (UTC)
From: [identity profile] floralaetifica.livejournal.com
I find that when I move the cursor into a tag it bolds it and it's other half.

Date: 2007-07-27 09:10 pm (UTC)
From: [identity profile] floralaetifica.livejournal.com
And yes, it's an entirely reasonable thing to want. I use it all the time.

Date: 2007-07-27 11:27 pm (UTC)
From: [identity profile] venta.livejournal.com
Not in VS 2005 Express it doesn't, I tried that :(

Date: 2007-07-27 11:27 pm (UTC)
From: [identity profile] davefish.livejournal.com
I'd call it the mantissa, since that is what I think its name is, but I don't think that I've ever had a conversation about the implementation details of floating point numbers.

Date: 2007-07-27 11:28 pm (UTC)
From: [identity profile] venta.livejournal.com
Woo, that works. It highlights the block between the closing and opening brackets. Thanks - between you and [livejournal.com profile] mister_jack below I'm all sorted now.

Date: 2007-07-27 11:29 pm (UTC)
From: [identity profile] venta.livejournal.com
2005 and no, but you're correct about ctrl-]. Woo. Thanks - between you and [livejournal.com profile] waistcoatmark above I'm all sorted now.

Date: 2007-07-27 11:31 pm (UTC)
From: [identity profile] venta.livejournal.com
The bit on the bottom ? I'm curious as to what representation you use that has a top and a bottom, since I think of floats as being all in a line.

Date: 2007-07-27 11:32 pm (UTC)
From: [identity profile] venta.livejournal.com
I managed the same conversation about them three times this afternoon. [livejournal.com profile] pm215 correctly said mantissa, but the other two people (and I) all independently said "er... the other bit". I wondered if that was common but, by the looks of things, it isn't.

Date: 2007-07-27 11:42 pm (UTC)
From: [identity profile] davefish.livejournal.com
Maybe your friends lit just has a particularly weird vocabulary.

Date: 2007-07-27 11:59 pm (UTC)
pm215: (Default)
From: [personal profile] pm215
I can't remember anything else about floating point (like how you actually put the sign and the exponent and the mantissa together to make a number, for instance); I just remember the field names :-)

Date: 2007-07-28 01:11 am (UTC)
From: [identity profile] mister-jack.livejournal.com
I'm so used to Visual Assist I can't remember what it does or doesn't give you.

Date: 2007-07-28 01:38 am (UTC)
ext_54529: (Default)
From: [identity profile] shrydar.livejournal.com
I'm not 100% certain of my answer, as I don't discuss floating point all that often at the moment, and skimmed the options (and potentially reminded myself of the term) before reading the question.

Date: 2007-07-28 09:12 am (UTC)
From: [identity profile] edling.livejournal.com
I'd generally go for 'the other bit', but luckily I don't tend to come across many numbers more complicated than MAC Ids and times (as in 'You want it done by when?') these days. I seem to remember setting up VS to use Vi as it's editor once and that confused it immensely.

Date: 2007-07-28 09:36 am (UTC)
From: [identity profile] wechsler.livejournal.com
But I'd probably then get a blank look and say "That bit" *point*

Date: 2007-07-28 10:56 am (UTC)
From: [identity profile] feanelwa.livejournal.com
I think of them in my head as being A x 10B, so B is the bit on the top leaving A to be the bit on the bottom, because the 10 is always there. This runs into problems when there are fractions in the near vicinity, though.

Date: 2007-07-28 08:25 pm (UTC)
From: [identity profile] surje.livejournal.com
ctrl-]

Date: 2007-07-29 03:53 pm (UTC)
From: [identity profile] onebyone.livejournal.com
That's encapsulation for you.

Date: 2007-07-30 09:55 pm (UTC)
From: [identity profile] two-nukes.livejournal.com
Ah, that old chestnut, it's been in the 3d games community for yonks as a fast square root used to normalise vectors, though don't think it's used as much now since the vector instructions of a lot of modern processors generally implement a fast approximate reciprocal square root for this sort of thing these days.

Good old Newton Raphson root finder with a sneeky initial approximation using the fact that IEEE FP have exponent and mantissa, halving the exponent is always a good way of starting to head towards the sqrare root.

Profile

venta: (Default)
venta

December 2025

S M T W T F S
 123456
78910111213
14151617181920
212223 24252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 26th, 2025 10:10 pm
Powered by Dreamwidth Studios