Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
10011
Jul 22, 2007

BangersInMyKnickers posted:

Alright, really dumb and most likely easy HTML question, but I don't know much of any html and our web guy doesn't know how to do this off the top of his head:

I need an easy web submission form for service requests, and we have everything flushed out except I want some of the text boxes to contain that grey, italic text that goes away when cursor focus is brought to the box or something is typed in to it. I have no idea what this element property is called though, and googling a general description of it turns up a mess of garbage. Can someone point me in the right direction or give me some quick example code to give to my web guy?

CSS:
code:
.something { color: gray; font-style: italic; }
HTML:

code:
<input type="text" value="some text" class="something"
  onfocus="this.value = ''; this.setAttribute('class', '')">
Tested once in Firefox, but should work. May not be the best solution, though.

edit: table breaking is always fun.

Adbot
ADBOT LOVES YOU

10011
Jul 22, 2007

Bonus posted:

I am currently running GHCi on Windows, the version is 6.8.2 and I seem to be missing some functions that I find around in various Haskell references. For example when I try using nub, sort, or groupBy it says that they're not in scope. It looks like about 25% of functions are missing. Am I using an older version or do I have to import some modules for those functions to work or what?

The three functions you mentioned are all in Data.List. To import modules in GHCi you use :m +<name>.

10011
Jul 22, 2007
The first line of the loop is for i in `seq 0 1000000`, and you need spaces before the ]s (also, you might want to use elif instead if fi/if). Otherwise, what poopiehead said.

Edit: I can't read.

Edit 2: vv Use `seq 0 20 1000000`.

10011 fucked around with this message at 02:07 on May 13, 2008

10011
Jul 22, 2007

PT6A posted:

Is there any way to get sh, in the context of a shell script, to interpret a given string as a variable name. I'm trying to do an assignment like:

var1=\$$var2

Where var2 will be a number, so I want to get the var2-th command line argument and store it in var1, yet the code as written acts like var1='$var2'

Is there any way to get around this?

eval "var1=\$$var2" works, but I'm sure there's a better way.

10011
Jul 22, 2007
You can use GHCi for debugging, which would be simpler than trying to coax gdb into it. I don't know about Hugs or whatever, though.

Adbot
ADBOT LOVES YOU

10011
Jul 22, 2007
I don't know C# that well, but a Dictionary<char, int> would work, with something like

code:
var d = new Dictionary<char, int>();
foreach (char c in str) {
  if (d.ContainsKey(c))
    d[c]++;
  else
    d[c] = 1;
}
Alternatively, you could probably do in one line using LINQ.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply