What's your problem?

Started by rabid_fox, October 01, 2008, 07:23:44 PM

Previous topic - Next topic

Mao

In some languages... a string is an array of characters.  What language are you using? :)

Jack McSlay

javascript, which makes strings and arrays very different things (even tho firefox and others allow to treat as string as an array, but this is not recommended since Internet Exploder does not)
Keyboard not detected. Press F1 to resume.

llearch n'n'daCorna

I meant as a list of things to replace, rather like str_replace in php.

Which would mean you only needed one single line, instead of 8 or 10...
Thanks for all the images | Unofficial DMFA IRC server
"We found Scientology!" -- The Bad Idea Bears

Jack McSlay

#33
nope, JS doesn't have an (Array,Array) or (Array,string) overload for the replace method, therefore it is correct to do the replace one by one.
However, this function is meant to filter out characters when typing something on a text field, so he should have just used the event to find out what key was being pressed instead of going through the trouble of removing the unallowed characters
Keyboard not detected. Press F1 to resume.

Valynth

#34
A series of problems from my life eh?  Well, in order of importance to my problems are:
1.  sleeping
2.  eating
3.  drinking (nonalcoholic at the moment)
4.  No romantic love interest, nor any chance of getting a romantic love interest.
5.  a small pea-sized lump on the left side of my chest.
6.  the crackle-pop sounds that come from my skeletal frame when I stand up some times.
7.  The good chance that I'll become genetically diabetic.
8.  I'm a virgin.....  You know what?  This one's a bit more life-threatening, so maybe I should put it higher up...  Lots of cults popping up nowadays.
9.  NEED MORE MONEY!
10.  General suckitude of my life
11.  I bitch too much about the problems in my life.
12.  I keep putting things in ordered lists.

(there are not and will not be any pictures related to any of these.  Thank your chosen diety for breaking every camera that comes near me.)
The fate of the world always rests in the hands of an idiot.  You should start treating me better.
Chant for something good and it may happen
Chant for something bad and it will happen
C.O.D.:  Chronic high speed lead poisoning  (etch that on my grave)

superluser

Quote from: Valynth on October 08, 2008, 04:17:29 AM3.  drinking (nonalcoholic at the moment)

Wait.  You have a nonalcoholic drinking problem?  I think I've got a picture of that:



Would you like a googolplex (gzipped 57 times)?

Mao

#36
Quote from: Jack McSlay on October 08, 2008, 03:10:01 AM
nope, JS doesn't have an (Array,Array) or (Array,string) overload for the replace method, therefore it is correct to do the replace one by one.
However, this function is meant to filter out characters when typing something on a text field, so he should have just used the event to find out what key was being pressed instead of going through the trouble of removing the unallowed characters

Hmm.. yeah for js to block a key press that isn't desired, use a regexp.


         var keynum;
          var keychar;
          var check;

         if(window.event){
           keynum = e.keyCode;
         }
         else if(e.which){
           keynum = e.which;
         }
          keychar = String.fromCharCode(keynum);
          check = /^[A-Za-z0-9]$/;
          return check.test(keychar)


That one there I picked up a while back, I can't remember where from but it's not a creation of my own.  It also happens to be what my problem is.  Programming.  I'm not good at it, but I can't stop doing it. 

Rakala

Hooray for infections everywhere! Ear, throat, and toe. Not to mention hangnails since I started chewing on my fingernails again. GRRR! And to top it all off allergies.

Brunhidden




Eowyn says - I choke you!               daddy makes funny noises  :mowhappy
Some will fall in love with life,
and drink it from a fountain;
that is pouring like an avalanche,
coming down the mountain.

Valynth

Quote from: superluser on October 08, 2008, 04:42:38 AM
Quote from: Valynth on October 08, 2008, 04:17:29 AM3.  drinking (nonalcoholic at the moment)

Wait.  You have a nonalcoholic drinking problem?  I think I've got a picture of that:

[img]

I drink about 5 canned heart attacks (Mountain Dew) a day regularly.  I've been known to drink several more on days on which I'm stressed/bored.

I'm sure that's a bit of a problem....  Especially since my family has a long history of heart-related illness....
The fate of the world always rests in the hands of an idiot.  You should start treating me better.
Chant for something good and it may happen
Chant for something bad and it will happen
C.O.D.:  Chronic high speed lead poisoning  (etch that on my grave)

Cvstos

"The problems that exist in the world today cannot be solved by the level of thinking that created them." - Albert Einstein

"Great spirits have always found violent opposition from mediocrities. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." -Albert Einstein

Zet

#41
I have Senioritis (http://en.wikipedia.org/wiki/Senioritis) and the school year barely started


also:

Netrogo

Once upon a time I actually posted here.

techmaster-glitch

Avatar:AMoS



Jer-oh-me


Yugo

https://www.weasyl.com/~boximus<br /><br />My Weasyl!

Dannysaysnoo


VSMIT

No frets!

My problem is not practicing this thing enough:

Yugo

Bass is my problem. It's pretty cut and dry. :P Although to me it's not a problem I suppose. I've come to prefer fretless to fretted anyways.
https://www.weasyl.com/~boximus<br /><br />My Weasyl!

llearch n'n'daCorna

Quote from: Yugo on October 11, 2008, 03:59:57 PM
Bass is my problem. It's pretty cut and dry. :P Although to me it's not a problem I suppose. I've come to prefer fretless to fretted anyways.

... You're totally addicted to it?
Thanks for all the images | Unofficial DMFA IRC server
"We found Scientology!" -- The Bad Idea Bears

superluser



Would you like a googolplex (gzipped 57 times)?

Dannysaysnoo


Tapewolf

Quote from: Dannysaysnoo on October 12, 2008, 01:06:22 PM
Let me express my problem with song!
http://www.youtube.com/watch?v=4hkjkTe5kZE

You've got so much money you're afraid of turning into everything you despise?   :3

You're trying to play against a tape loop?

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


Dannysaysnoo

Quote from: Tapewolf on October 12, 2008, 01:13:19 PM
Quote from: Dannysaysnoo on October 12, 2008, 01:06:22 PM
Let me express my problem with song!
http://www.youtube.com/watch?v=4hkjkTe5kZE

You've got so much money you're afraid of turning into everything you despise?   :3

You're trying to play against a tape loop?

No, i need a football team.

Isn't that what the song's about?

Tapewolf

Quote from: Dannysaysnoo on October 12, 2008, 01:33:25 PM
No, i need a football team.
Isn't that what the song's about?
Rampant capitalism, actually.

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


techmaster-glitch

Quote from: Tapewolf on October 12, 2008, 01:52:02 PM
Rampant capitalism, actually.
Somehow, I glanced at that and almost read "cannibalism"  :erk
Avatar:AMoS