hi I have a web form that I submit to an email script and Ive got a javascript email validation script in there

by the way, you can turn off NTP without any arcane commands

Basically, just replace \r\n with \n before performing any validation

righ-click on the clock, choose “Adjust Date & Time”, type your password, uncheck “Periodically synchronise with Internet time servers”, click “OK”

Oh that certainly doesn’t work.

i dont control the server side validation

We tried that ten times.

iambpentameter, that sucks

yes it does

by using replace() function….with regex how do make it so that http://www.com/doit?x=hello&y=world would output “blah: x=hello&y=world”

ed1t, well, you’d capture everything after the first ?. this is basic regex, are you asking us to do it for you?

No need for regex there: url.substr(url.indexOf(‘?’) + 1)

Jan-: your system seems to have more than its fair share of woe, then

Everyone always says that.

“blah: ” + “http://www.com/doit?x=hello&y=world”.split(“?”)[1]

blah: x=hello&y=world

But frankly this is just normal. We’ve had this exact sort of experience time after time.

alas, yes

the url is stored in a variable and i wanna do like replace(url, regex)

No regex required
url = url.substr(url.indexOf(“?”) + 1);

i know that way but how would i do it with regex?

url = url.replace(/.*?/, “”);
But that’s unnecessarily inefficient

you’d need to escape the ?

Oops
I thought I did
url = url.replace(/.*\?/, “”);

document.getElementById(elementId+”Input”).focus();
Ie7 doesnt focus on textbox … wtf?

hi i was wondering if anyone knew javascript and had 5 minutes of time to spare?

“JamesSavko” at 71.6.194.243 pasted “Having some issues with this, probably because I’m new at java.” (12 lines) at http://erxz.com/pb/3691

o0

for a start, it’s JavaScript, not Java

`js forms @ JamesSavko

js forms: Accessing form elements via JavaScript: Don’t use document.forms[index].elementName or document.formName.elementName. Use document.forms['formName'].elements['elementName'] or document.getElementById(‘formID’).elements['elementName'] or
document.getElementById(‘elementID’)

Also, “if” checks for a boolean expression… if you’re using == true or == false you’re doing something wrong.

if you have a javascript hosting question, just ask it – if it’s interesting enough, or easy enough, or hard enough, or someone is just plain bored, you’ll likely get some help :-)

that is, you can just use if (checkbox.checked) { … }

Thirdly, you need to use array access syntax to access the property of a dynamic name; there you’re literally using the “Box” property

ok i was wondering if someone could change this little “Animated Collapsible DIV” so it folds out right instead of down.

thx

http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

Fourthly, an if statement is overkill here: it’d be easier to use a conditional operator

thats the one, but im only using the 2nd example. and ive looked at it but i cant get it to go left and right, only up and down.

twey = twey ? twey : “twey”

i need to find a data structure for this problem, so if someone’s up to it… i guaruntee it won’t be easy.

“Twey” at 71.6.194.243 pasted “Re: JamesSavko” (3 lines) at http://erxz.com/pb/3692

is it possible?

You seriosuly made my 12 lines of code into 3? That’s pretty impressive.

thats what they’re here for! :P

i have an excel spreadsheet that has 5 columns. the frist column is “muscle”, the second “resistance”, the third “position”, the fourth “motion” and the fifth “exercise”

Heh
Personally, I wouldn’t even make that a function. It’s not worth it for the one assignment it contains.

I need to use it over and over

the 5th column contains unique values derived from columns 1 through 4

On different check boxes.

*groove* *bop*

Loop

in order to know if a hidden field is empty, do I have to compare the value field with null, 0 or “” ?

“”

can anyone help me? sorry to be pushy.

if the user selects “abs”, for example, only the resistance, position, motion and exercise values will be shown in the other selects

Ask on the forums

ok, thanks Twey

I need it to effect different divisions based on checking a box for a product. That’s why I made it a function.

Search first though

lol ok thanks.

the more i click in the other boxen, the more i narrow down the exercise list
how can i achieve this?

*shrug* If it makes sense to you
There’s no real downside, I’m just saying I wouldn’t.

I appreciate your help! I’m not sure what you mean by use loop instead. I can show you what I’m working on if you’d like.

Sure, pastebin it

what’s that used for?

basically, i need to narrow down all 5 selects based on wherever the user clicks. what data structure should i use?

“JamesSavko” at 71.6.194.243 pasted “Products Page” (1 line) at http://erxz.com/pb/3693

is .focus() broken in ie7

Something else you might want to do is set a CSS class and add/remove that rather than manipulating the style directly
That’s quite a bit neater

I’ll do a google search and see if I can find a sample.

I actually meant the actual code, not the URL You could’ve just pasted that.
uI actually meant the actual code, not the URL You could’ve just pasted that./u

you can paste URLS here directly, by the way
Jan-: using the Command pattern?

the What pattern?

Ouch, stay away from XHTML for now

LOL.

No support in IE

That’s actually a javascript that alters a Span.

The only way to allow user data to include arbitrary HTML is to use innerHTML, isn’t it.
that or write a whole html hosting parser.

!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

Jan-: each time the user makes some significant change, you create a Command object containing the data need to do the action, and the data needed to undo it

that’s what I was thinking of, but I didn’t know there was a term for it (though I kinda assumed there was)

Yah, I need to change that now.

You want: !DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd

Make each object responsible for creating an Undo for its own actions.
And add them to a list.

Then revalidate: http://validator-test.w3.org/

Jan-: exactly

Jan-: you mean to validate what they’re inputting or actually applying it to your page?

That popUp() function is nasty

Well, I want people to be able to put icons in my gridview control.

Thanks, yah I know. I didn’t want to use a popUP at all, I just used a generator to make that for the time being.

So I could just put a ShowAsImage attribute on it and let them supply the image filename.

Jan-: that doesn’t require arbitrary HTML

Or, I could just let them include any HTML they fancied.
Which is more general.

function popUp(url) { window.open(url, “”, ‘toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=500′); }

they can provide a DOM object instead of HTML text

not in an XML document, they can’t.

eh?

I’m rendering an XML host document, basically.
Most table cells just contain the text in the XML

Jan-: Wow, nice.

what is?

Jan-: So if you did that… someone wanting to write would have to use <

Yes.
I’ve already done it.
What’s nice?

Eight characters to one

well you can use <
I can’t think of a really nice way of doin’ it.
It’s just that all my code uses textNodes at the moment.

It’s as bad as a backslash in regex via awk via Perl via Python via C++, which I did once

Otherwise it would sorta work automatically.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
For one literal backslash.

Quit.

OK, maybe not quite that bad.
But that’s the idea.

icon ws_displayAsHTML=”true”<img src=”c:/elphaba/icon/icon_slate_16.png”></img>/icon

Jan-: XHTML elements in the XML

What in the what now?

Thanks for all the help

Jan-: Elphaba… have you been to a showing of Wicked?
Welcome

iconhtml:img src=”c:/elphaba/icon/icon_slate_16.png”/html:img/icon

SOMEONE NOTICED THE NAME!

ah, that’s where I vaguely recognised it from

My girlfriend and her entire family are obsessed with it

It uses a piece of HD video I/O made by a company called Blackmagic Design.

And yeah, deltab’s idea is better
Ahhh.

Ergo.

Clever.

The Wicked Witch uses black magic.

Somewhat.

Also, parts of the UI are green.

You’re not allowed to call it “black magic” any more.
It’s racist apparently.

So er.
I wonder how Woosta’s XML library would deal with that.

What, old-fashioned racist thaumaturgical phrases?
Hehe

This approach is sucking.

“Thaumaturgical” is a perfectly good word based on a real Latin root, I refuse to avoid it just because Terry got there first

Oh, is that where he got it.

within a derived function that overrides a base function, how do I call the base function?

Absolutely

Try again, witten

huh?
was that not clear?

You have to reference it from the base.

this.constructor.prototype.m()

Although “overriding” is a bit ambiguous in Javascript

this.constructor refers to the base?

“base”?

base object

no, it refers to the constructor

okay
thanks

How can I scan a string (like a frame URL) for a certain substring like “google” ?

-1

Twey, thanks a trillion! ^_^

I can never remember whether it’s switch or select in JS

switch
as in Java, C, C++, and others

She’s a VB user at heart.

-1 ) { alert (“lol”) } should be ok right?

“JamesSavko” at 71.6.194.243 pasted “Products Page” (1 line) at http://erxz.com/pb/3694

No

Jan-: is this true?

woops
That’s nothing
Ignore that plase. I reloaded firefox and it restored the session lol.

window.location is an object, window.location.href is a string

oh ok

-1) { /* do stuff */ }

-1; };

hello everybody !

hey, Dr. Nick!

It is some one that use json-rpc on javascript ?

Hmm … I get permission denied for frames['rtframe'].location.href.indexOf (“google”)
rtframe is an iframe
Am I doing some thing wrong … or I’m out of luck
?

it’s from another site, so you don’t have access

“necromancer” at 71.6.194.243 pasted “the javascript function(s) that submit a new post into a forum” (35 lines) at http://erxz.com/pb/3695

oh hey!
there it is
i’m having a problem getting Ajax to invoke a PHP script that i made

Do you have any suggestions on how to make those radials do the same as the check boxes?

what problem?

the php web hosting script basically creates a new post in MySQL
http://erxz.com/pb/3695
when I click “Post!” (which should invoke this function), nothing happens

Ooer. The river is very high.

Jan-: We flooded this morning ^_^

So basically if your frame’s URL is not from the same site … you’re out of control

How bad?

Heh
Not that bad… a few inches

perhaps this is related, i just ran a little debug alert() window
and none of my form attributes are being sent through this function

… am I right?

and it’s not working

do i have to use the name attribute instead of id?

what does ‘this’ refer to there?

i figured it would refer to the form at hand but i guess not

You know if I were to use innerHTML to populate my table cells, I wouldn’t need to go through all this.
uYou know if I were to use innerHTML to populate my table cells, I wouldn’t need to go through all this./u

‘this’ is verbatim, i actually wrote this.title, this.body, etc.

anyway, thanks folks for the info

i’ve actually never had to use JS to process my forms in fucking forever
ever since i learned PHP

You should never *have* to use JS to do anything

yes, but ‘this’ refers to different objects in different contexts

It’s an enhancement

it was in web programming class in high school
where they were teaching us JS

Heh, ah

yeah i figure it’s not referring to what i want it to refer to
uyeah i figure it’s not referring to what i want it to refer to/u
how do you pass form values into JS functions?

I image host you can use document.forms['formName'].elements['elementName'] or document.getElementById(‘formID’).elements['elementName'] or document.getElementById(‘elementID’)

My dad is her
Here, too.

Is s/he?

He comes bearing gifts!

Why?
Hide!

I think I’m going to have to Not Do icons in tables.
It’s too much farquharing about.

Jan-: what happened to letting them give a URL?

The amount of changes I was going to have to make, most of them ugly, was discouragingly huge.
It dealt with everything as text, end of story.
oh Tweysters, you haven’t seen this thing recently have you?
http://www.1159productions.com/test182/shad_xml.jpg

Jan-: Ah, you’ve gone grey!

?

Jan-: Was The Painted Veil any good?

hmm
i have a problem but i don’t know what it is
wait a sec brb

Don’t worry, this is why psychiatrists are for.

alright

Jan-: You’re using forward slashes as path separators :-p

hahahahahaha

alright so
it seems that all the JS-end of the Ajax works
but let me re-paste so you guys can see what i’m doing
and maybe shine some light as to why the PHP script is not being invoked

“necromancer” at 71.6.194.243 pasted “just the postItem() function to test if the php script is being invoked” (24 lines) at http://erxz.com/pb/3696

there we go
in http://erxz.com/pb/3696, what could be preventing the php script from being invoked
note that i see that alert()
also, the page is located at http://projects.darkcitydesigns.com/bcp/more/forsale (click “Post a new Item!”)

you can use Firebug, Fiddler or Wireshark to see what communication’s happening

aren’t they packet sniffers?
(i know wireshark is)

only Wireshark, and I only included it because someone brought it up the last time I mentioned Fiddler (which is an HTTP proxy)

My friend has now been without his ADSL for a week while BT, his ISP, and their wholesaler argue about whose fault it is.
Grrr.

Hahaha.
3 BT

wow deltab, taht really helped out!

What makes it even more fun is that although the ISP won’t say, we’re pretty sure that the wholesaler is also BT.
Or rather another triple-jointed appendage of the Gigantocorp That Is BT
So basically, BT is arguing with itself over who has authority to go reboot the DSLAM.
In short, a thumb-fingered communications brick-drop of truly startling proportions.

how i can post with javascript?
if i press a button “onclick” post the formular X ?
“submit”
?=
document.self.submit();
is it valid?

input type=”submit” value=”Send”

jo, i know. but i have already in onclick a functino

so?

ja

what’s the function for?

functino bla() [...
document.getElementById('loading').innerHTML ='img src="gallerie/images/loading.gif"';
document.getElementById('knopf').innerHTML ='';
}
a element is visible and i like
submit the formular
form
how deltab ?

hi, is there a rc4 implementation for javascript (GPL) ?

there's certainly an RC5
Oh no. Hang on.
I was thinking of MD5.
Which is not the same.
but I think there is.
STFW.

Hahaha
http://home.versatel.nl/MAvanEverdingen/Code/

That's what I was looking at.

hello?

In fact I think I have more than half a dozen useful hits for "javascript RC4"

just return from the function and let the browser continue submission

i have input name="'.$formular_name.'" onclick="show_loading()" type= ...
what u mean? what i must change?

that function should be called from the form's onsubmit, not the button's onclick: there's more than one way to submit a form

hmm ?

try also "arcfour"
I presume you want to show "loading" when the user presses Enter too

in my functino is:
document.hinzufuegen.submit();
document.getElementById('loading').innerHTML ='img src="gallerie/images/loading.gif"';
document.getElementById('knopf').innerHTML ='';

remove the submit call: you don't need it

in internet explorer running this.
hm. i can't unterstand :-(

Jan-: How long have you been working on this now?

ah sorry, i'm looking for RSA not RC4

*blush*

hmm. :-( help

In the beginning I didn't really have a purpose for it other than to be a learning project.
then someone said "I'll buy that for a dollar!"
Then it stopped being fun.

Heheh
Jan-: You realise you could've written this in roughly three weeks in Python and wxWidgets?
Jan-: Including learning how to use Python and wxWidgets?

I wouldn't just have had to learn to use python and widgets
I'd have had to learn all the win32 UI components too.

ok.. its works now. how i can denied if the user have press "submit" and he try "refresh" (f5) ?

Plus, I have been playing with JS on and off since the late 90s.
And I'm still shit.
So.

deny what?

Jan-: No, all the UI components are handled by wxWidgets

How long do you think it would take me to get *this* good in something else?

Jan-: who have you had teaching you?

deny the refresh

you can't

mh. ok :-)

Google Is My Friend

Jan-: hrm

good night

Anyway, Twey, *you* could have written this in three weeks because you're a college trained software engineer with an IQ of 220.
I am just a rather dim and incapable crip with almost no formal training.

I am not college-trained
Being forced to write crap software in VB doesn't count as training, especially when you already know VB
And my IQ isn't 220 either

230?

Jan-: Lower
Jan-: Way lower

22?

Higher, thank the gods

you're smarter'n I am

Jan-: What's yours?

And you'd have done it on fucking Linux, too.

It'd've been platform-independent

No, it wouldn't.

Everything I write is platform-independent, unless there's absolutely no other way

You're doing video playback on three different displays at once, it's not going to be platform independent.

Don't see why not... the drivers I'd have to make platform-specific, obviously, but the rest could be independent

Plus I've done a ton of work for midi and serial
I'm not sure if anything on Linux supports MIDI, after all, it was only invented in the late seventies, it could be too soon, y'know

They're already implemented on Linux
Don't be daft, linux host tends to support those things long before Windows
We've had 64-bit support since 1994

i removed an embed object with removeChild but it's still playing (in IE), can somebody enlighten me how to completely remove iT?
flash object

That's just so beautifully Linux.

Jan-: is there also a command reference for the RC4 library ? i can't find a single .js file with the code... just a huge html file with js in it

Fantastic support for something that doesn't matter.
No support for things that do.
No idea, never used it.
I have this thing about only doing things I can do well. I'm shit at programming, so I do it a little as possible.
My position is that the world has enough bad Python programmers.

I finally got my mac site working
i'm excited
eheh

Jan-: It's quite hard to program badly in Python
Jan-: Ooh, ooh, you could do it in Haskell!

It's quite hard to program badly in javascript but I do it all the time.

hehe

It really isn't.

like the most of us

It's just that it would have taken me just as long to learn Python.

interpreted languages are fun to code

It's infamously easy to program badly in Javascript.

And this way at least I know what I'm doing.
I don't have to learn someone else's API.

it's hard to program in JS
my javascript prolly has 6969 mem leaks

because there are no standarts, yes

I mean right now I'm writing a thing to highlight a table row to show where in the playlist we are.

I made Poor Man's Itunes in javascript!
hehe

Do standard Windows widgets allow you to put a blinking glownig outline round a table row? Course not.

basically just an embed obj

are there links available ?

http://www.nd.edu/~dho/

Jan-: Eh... you are using someone else's API

Yeah but just like a web page.
That's not a real API.

wow

It can't be a real api or I wouldn't be able to learn it.

and that's pure js ?

yes
pure js
took me a month
:*

how you did that ? i mean... hmm

just a bunch of div layers
and make them behave
lots of createElement()'s

Jan-: And standard Windows widgets don't, but standard Windows widgets and a bit of animating code like that what you done wrote for the JS one do

and the image scaling

ya
the way you do it is simple
mouse coord - image cord
and scale the size linearly

normal image where you change size ?
with time ??

The code to draw a rectangle (let alone three concentric ones with slightly varying transparency) on the screen in Windows is at least 150k long.

so you take the time into account ?

I know it is because I *checked* OK?

Jan-: Thus, wxWidgets.

(mousex - image.left) / (3*iconsizes)

Jan-: You're right, but that's because the pure Win32 API is crap. The wxWidgets one is much nicer.

I mean just opening a window
*shudder*
It's like ten pages of calls to 150 different DLLs.

and the icons are normaly high scale and you scale them down at startup?

Yes. We know.

yes
the icons are 128px

IN C++ of all things.

But in wxPython it's one statement.

but i scale them down to 48px

It's only a few statements with wxWidgets even in C++.

Yes but I can't do anything in wxpython.

you vary them between 48 and 128px

Jan-: was it using MFC?

In an HTA it's no statement at all. You just need a null file with a .hta extension.

nice work

Jan-: Yes you can

Beat that

thanks

Jan-: We've had this discussion before

And I'm still right, see?

Jan-: You don't even need a file... just open a web browser. Viola, window
Jan-: No, you lost last time and you lost this time as well

But not one you can do much with.
Now what I should have done is do it as a .net app.

it's realy slow (the scaling), i would remove the transparenzy of the paddle where the icons are inside (this makes it really slow)

But that would have been nearly as horrible.

That would've been much more horrible than wxPython.

hm..
how fast is your computer?

But not as horrible as Win32.

I did look into doing it in wx, I really did.

it's a little slow on mine, too

2ghz thinkpad

It's OK here

oh

512mb ram

Unfortunately wxJS sucks.

what browser?

What browser? Fx2?

firefox

oh
trie IE
it's pretty smooth in ie

Jan-: Which is why I said Python. *Python.*

But the problem with wx is that all it does, whatever language you use, is lay out the UI.

Fx2's Javascript capabilities are really slow.
Fx3 is better.

You can't actually DO anything.
You can make a pretty UI, and that's IT.

Jan-: Yes you can

i wont even touch ie 8)

ehhe
it's even slower in safari and opera but oh well

You can't run shell commands or call activeX. So you're in a void, you can't actually make it do anything useful. just lay out some buttons.
Well I lie. You can. You just have to do it in C++.

Jan-: That's provided by Python
Jan-: Or Python

Jan-: that's not the truth

not on the ones I saw.

!!!

Jan-: You didn't look hard enough then.

tried meboo ?

Jan-: There's an entire win32 module.

instant messaging with javascript

Not just Javascript, there's a lot of server-side stuff too.

if they made it as a plugin for WSH, I'd be interested.
Even the JS version doesn't actually use the jscript interpreter.]
If it did, it’d be worth having.

Jan-: Forget wxJS
Jan-: wxJS is not representative of wxWidgets

Even in JS it was tricky enough.

‘transparency’ (the c is pronounced ‘ts’)

Jan-: wxJS embeds wxWidgets; everything else includes them

http://wwwl.meebo.com/

I mean, setting up one of my JS-based UI controls is probably as complicated.

you guys should checkout youos.com

But at least I know how to do that because I built it from the ground up.

it’s pretty sexy

know this allready

Or eyeos, yes, yes, everyone’s done it

but nice way to get away from ms licenses

And your background looks silly at 1600×1200

hehe :*
my laptop is 1280×800

Jan-: I suspect it’s way, way more complicated

so the bg is 1280×800

Heh

Well, you tell me

Set it out so it’s 100%x100%
May look a bit weird, but at least it’ll fit

stretching looks weird

“Jan” at 71.6.194.243 pasted “Grid setup” (22 lines) at http://erxz.com/pb/3697

I suspect even my dirty socks could work that out, actually.

Jan-: That’s actually not so bad as I expected it to be
Jan-: I’d say probably about the same

Except for the bits you’re leaving out ‘cos they’re “obvious”, yeah.

Jan-: that’s the sort of code I’d expect to be able to use with a well-designed toolkit

My thing isn’t a toolkit and it is certainly not well designed.

Jan-: Hmm? I’m not really leaving anything out

your code begs to differ

That code does look pretty well-designed
Although I daresay the backside of it is a mess

“Jan” at 71.6.194.243 pasted “w32table2″ (752 lines) at http://erxz.com/pb/3698

See for yourself.

See, if the API is roughly equivalent in difficulty
That leaves you 752 lines of code better off with wxWidgets

oh come on.
Say what you really think.
752 lines of hideously bad horrible code.

Jan-: Poor. Very poor.
Jan-: And that is going to leak memory like a *bitch.*
You’ve got gods know how many methods

Yeah, if you create 200 of them.
Currently I have two.

All recreated once every time the object is created
But still
Not purty.

It’s nicer than the twey method with all the Extend and SpreadSelf and shit.

What was wrong with using w32Table2.prototype?

Nothing. I may go back and do that.

Nuh-uh.

But that’s not the main problem as regards memory.
I could make that change easily enough, to be honest.
That’s not what I’m worried about.
So, do you want to see a *bad* one?

As long as it doesn’t burn out my eyes.

That’s the most recently written one.
Where my competence was at its… er… well, it’s probably rude to call something that’s actually *concave* a “peak
but you see what I mean.

Heh
Not concave

what’s the function to convert a string to lower case?

.toLowerCase()

aight

“Jan” at 71.6.194.243 pasted “Treeviewer. Aargh, my ey… oh, yeah… Still.” (499 lines) at http://erxz.com/pb/3699

get a load of enumerateNode
It’s *genius*
It’s so bad, it’s *good*

Jan-: …
Jan-: I looked at that and the first thing I saw was if(87).

Shutup.
That’s a *temporary hack*, OK?

Muuum! Jan’s bending time and space again!

I only put all that shit in when we were testing on IE6 and 7 machines all at once, and the IE6 machinen didn’t support PNG transparency properly, and we had two complete sets of icons
Ngh. and it has the annoying “Look, I’m a programmer!” CVS shit at the top.

Jan-: newNode.ondblclick=cancelBubble; newNode.ondoubleclick=cancelBubble;
Jan-: You didn’t know which one it was, did you.

*razzlefrazzin*

Jan-: That is fecking horrible.

YES.
AND YOU WANTED TO INFLICT ME ON THE PYTHON COMMUNITY.
Let that be a lesson to you.

Hahaha
OK, I’ve changed my opinion
You should definitely do it in Haskell.

To be scrupulously fair, the table viewer is considerably less horrible.
If I could be bothered to go prototype all the methods, it would be in a state where I do not know how to make it nicer, anyway.
I do fully appreciate that the tree viewer sucks.

Haskellhaskellhaskellhaskell.

It does, however, work.

It’s *hard* to write bad code in Haskell.

. // Hack: avoid transparent icons for pre-ie7 environments that don’t support PNG transparency properly
followed immediately by:
.. // Hack: Don’t avoid transparent icons for pre-ie7 environments…

*sigh*
If only there were some way to rubber-stamp code
You could just stamp big red “HACK” signs over the whole thing
bYou could just stamp big red “HACK” signs over the whole thing /b
That would be very helpful for the W2K devs as well.

Do you want to see the *seriously* nasty one, though?
This one actually pained me when I wrote it, let alone now

“Jan” at 71.6.194.243 pasted “Preferences panel settings XML file (Will somebody PLEASE think of the CHILDREN!)” (616 lines) at http://erxz.com/pb/3700

Jan-: This is a couple of thousand lines of code that you needn’t have written
And is thus entirely redundant.

You’d just let people hack settings.ini, of course.
But you’re a Linux user.
I have to provide a UI

Rofl.
Uber-rofl.
I fail to express my mirth.

hi

Uber-rotflmao.

night

Thanks for all the help guys! I’m going to call it a day!

Heh

WTFBBQROFLMAOCOPTERSKATES?

Jan-: What. The. HECK.
Yes.
That will do.

how can I pass a javascript’s variable to php?

Via a form or XHR

That is what code I write looks like before Phil cleans it up for me.
That one, he refused to clean up.
Something about the geneva convention.

Hahahaha

What would you consider the be-all end-all Javascript for web UI book around?

man, firebug rocks as a debugger
too bad there isn’t something that good for PHP

whatever best suits your needs

It started out as a way of specifying a UI control containing a tab panel.

Modius, http://quirksmode.org/ – that book

Then it had the ability to define the panes inside that tab panel added to it.
Then it had some html host crammed haphazardly in to suggest how the UI might eventually look.
Then, I added some Javascript to control the behaviour of that HTML, commented out some of the older HTML, and added a bit more.
Because it doesn’t run the build system I wrote for the rest of it, there is no CSS access, so it then had a bunch of CSS added, inline.
Isn’t it *beautiful*

All the while using CDATA blocks to hold the HTML instead of another namespace.

It is quite difficult to work on.

It’s hucking fideous, to use a Spoonerism.

Well how else shoudl I put HTML inside XML in such a way that Woosta’s parser won’t barf on it and give me all the HTML elements as individual bits of text?

someone an idea where to find closer information on the rich text editor inside of firefox ? (midas)

Like deltab suggested earlier

     

Use a namespace
html:input checked=”checked” type=”radio” name=”bits” /

I think xml.simple would barf on that
wouldn’t that make it XHTML?

No

Twey, so that should work shouldn’t it? http://pastebin.co.uk/19709

And xml.simple ruddy well shouldn’t
Woosta coded it so it ought to be semi-decent
Huh? Who are you?

Jan-: it’d be XML containing XHTML, yes

Oh

how can I pass a javascript’s variable to php?

Via a form or XHR

Sorry, my brain’s not working much tonight

lol

“Jan” at 71.6.194.243 pasted “Application setup” (127 lines) at http://erxz.com/pb/3701

Tell me *that* would have been easier in Python.

no problem man, we are all so, it is too late

What the heck are you trying to do?
Jan-: Yup

I want to get the search box’s value to pass to php and treat it
bI want to get the search box’s value to pass to php and treat it/b

Just submit the form

I have done an alert and it works fine but when I try to get the value via php I am not able

in python you wouldn’t have semicolons at the ends of the lines
er
Jan-: : in python you wouldn’t have semicolons at the ends of the lines

Haha

What I like best about what I have now is that it is really easy to change, say, what’s in the menus.

It’d be just as easy with anything else

“Jan” at 71.6.194.243 pasted “Menu definition” (97 lines) at http://erxz.com/pb/3702

Jan-: The convention is to start constructor function identifiers with a capital

I did once look up what it took to create a dropdown menu in windows.
It was literally more code than the entire library I wrote to do menus.
It’s absolutely fucking preposterous.

Jan-: http://www.wxpython.org/tut-part1.php
Yup
Win32 API is like that

Whats’ a constructor function?

Jan-: I’m not sure if you’re grasping my point when I say Win32 API != wxWidgets API
Ah.
That would explain it.

Oh hang on.
Is w32TableViewer2 a constructor function?

Yus.

Bummer.

Yus.

I can’t change that. It’s used all over the place.
Does it matter?

Jan-: Use grep
Oh wait

Jan-: a function that you use with new to construct an object

Kind of, yeah
It’s very common convention… more like an unspoken law.

a tool for making the hideous verbosity of Linux slightly less hideous.

a tool for situations just like these.

as in “ps -aux | grep firefox”

Or sed.

Or in my world, ctrl-alt-delete [arrow keys] [tab] return.

Jan-: Hey, it’s faster than scrolling down Windows’ silly little box thing.
Jan-: But we digress.

Is that why it’s a new ActiveXObject() not an activeXOBject()

Yes.

Now you’re missing the trick a bit here, Twey.

And a new XmlHTTPRequest, although that name is just silly.

The more things you gleefully point out that are wrong with my code, the clearer it becomes that I should not be let near a text editor.
Are we in disagreement?

Yes
You need a stricter language, that makes bad coding harder.
Like C++.
Or, gods help you, Haskell.

Oh yeah. Stricter. That’s gonna help.

It’s very very difficult to write bad code in Haskell.
Actually, in my experience it’s very very difficult to write any code in Haskell.

I’m still weeping over the fact that it is no longer as easy as “10 PRINT “MOM SMELLS” 20 GOTO 10″

it’s very difficult to write any code in Haskell :-)

But when it happens, it’s good.

aw shucks

Too slow

(I didn’t have siblings to insult)

Jan-: Heh

This is why I did this in JS.
a) I fucking suck, and I need a language that lets me get away with it
2) In C++, I would just about have gotten an open window by now, and

iii) …

iii) wxJS blows.

wxJS does indeed blow.
In C++, you’d probably be a lot further than this if you’d used wxWidgets
If you used pure Win32, I doubt you’d've got that far.

Twice I have tried to use C.

And fucking sucking is a hint that you need to improve.
Jan-: C++. C++. Not C. C++.
Jan-: Two very different languages, two very different paradigms.

One time, I made a “hello world” program and all it did was create a file called a.out which immediately reset the machine when I tried to execute it.
Second time I couldn’t get it to compile.

Hahaha

But hey.

Jan-: Well, you were a beginner.

It was windows 98. What can I say.

Jan-: You’ve moved on now.

Not much, as you’ve been gleefully demonstrating.

Jan-: You can possibly actually keep your machine alive.
Nah, seriously though, wxWidgets is quite fast to develop with
Especially with Python.
Jan-: Check out that tutorial page I sent you

if I learn anything else, it’ll be jscript.net

Jan-: How many lines of code did it take you to do that with HTA?

which seems to be alarmingly similar to wxwidgets in some ways.

600 for the menus? Plus another 600 for the status bar?
Or did you give up on the menus in the end?
I’m guessing that’s no more than maybe twenty lines of code

“Jan” at 71.6.194.243 pasted “Menus, suckah!” (656 lines) at http://erxz.com/pb/3703

656 for the menues
Er, menus**
And the status bar?
Plus the setup, of course, but I’ll be generous and not count that

Yes, but 656 lines of super easy and simple code that anyone, even someone as crushingly dullwitted as me, can understand.
Naw the status bar is like nothing.
The button bank is very little.

Jan-: http://www.wxpython.org/tut-part1.php — you’ve read this right?

mplayer is mahoosive.

Do you understand it?

I’m not even going to cost the poor sods at Python the bandwidth with my incompetent floundering.

No no, I insist

“Jan” at 71.6.194.243 pasted “mplayer wrapper” (604 lines) at http://erxz.com/pb/3704

*that* is the hardest work so far

That’s smaller than the code for the menus

god was that a pain
there’s actually a bug in the menus.
Their keyboard shortcuts don’t get scanned until they’re rendered, which they aren’t until you pop one of them up.
So I have to fix that.

Jan-: You wouldn’t have that bug.

This is beginning to sound amazingly like a Linux versus Windows discussion.
“You wouldn’t have that nasty Microsoft EULA.”

Well, you wouldn’t have that bug

No, and I wouldn’t have a COMPUTER.

It would work, it would be faster, it wouldn’t leak memory like a brain with a hole in it (damn, that was meant to be a good simile), and it would be at least 60 times less code.

It doesn’t leak that much memory.
It’s workable.

I thought you said it ended up being something like 60MB

Currently refreshing the treeview causes it to leak all the memory it uses per refresh.
But I can fix that.
Largely, anyway.

hey is it possible to have a butotn which when you click
selects an area of text

Well, I don’t know because I haven’t done long term soak tests.
But it tends to launch around 20 and hover around 35-40

http://4umi.com/web/javascript/select.htm

cheers stan

Please, call me Happiness.

whatever floats your boat stan. thanks happines

n8 all

can anybody think of an easy way to figure out the depth of the deepest child node in a parent node?
does that question make sense?
I’ve been trying to reason through it, and I can’t come up with any sort of ingenius way

Hm, yes

Right now, I’m using mootools, so there are selector functions, if that makes it easier.

Alarmingly, I understand almost all of that other than what a HWND and a LPCTSTR are.

Jan-: I don’t touch the Win32 API
With a bargepole

It’s howwible, isn’t it?

Indeed it is.
Even for me

hmm, nevermind, I got it

Jan-: HWND is the handle of a window

why?

H for handle, WND for window

Yah, but why does it need a handle?
It’s a *window*.

hey

C doesn’t have objects to represent windows

eh never mind

“Jan” at 71.6.194.243 pasted “Bwah!” (44 lines) at http://erxz.com/pb/3705

what about hover
is it possible to select a set of text by hovering it!!

You could detect mouseover, start a timer, then once they’ve hovered for long enough, do a selection of some sort.
I think you can programatically select.
I’m not sure.

Something like: function getDepth(elm, root, depth) { root = root || document; depth = (depth || 0) + 1; for(var i = 0, e = root.childNodes, n = e.length; i n; ++i) if(getDepth(elm, root.childNodes[i], depth) !== -1) return depth; return -1; }

hmmmmmm

Jan-: http://www.dynamicdrive.com/forums/showpost.php?p=98659&postcount=1337
Or saamy ^

Ahhh what’s that got to do with m… oh, I see.

really?

In fact I don’t think even my Super Hardcore Works For Qinetiq Defence Industry Coder pal writes raw win32 user interfaces.
I think most of it is .net, if it’s on windows at all.

Jan-: The Win32 API is stupid, and written in C
Nothing’s written in C these days except kernels and device drivers.

why
I mean, it seems to work.

Would it be possible to cretae your own class
instatiate it with var foo = new Somthing (bar)
I’m looking at a code that uses this syntax, but I was not fully aware you could define your own classes

Not classes
They’re constructor functions
They’re just like normal functions

ok
but why the ‘new’ ?

Hello all. I’m tasked with fixing a problem on our website… we have a simple frame… top and bottom. There’s a “Print” button on the top frame, but we want it to print the contents of the bottom frame.

You assign properties to the object being created be giving properties to this inside the function

This works on IE, but not Firefox. The JS is: window.parent.bottom.focus();window.print(); — any ideas?

sean`: The ‘new’ creates a new object and point’s the function’s ‘this’ reference to it

ok

sean`: Otherwise you’d be adding the properties you create to the global object ‘window’

so it’s var foo = function () { this.foo = ’sf’; } and not var foo = function () {}; foo.foo =
’sf’;

“the function’s ‘this’ reference” meaning that the constructor function is called, with ‘this’ referring to the new object

sean`: Yes

hi, I have a web form that I submit to an email script, and I’ve got a javascript email validation script in there. If the email field is blank, it says “please fill out email field”. This works when I try it, but I keep getting blank emails. Any ideas?

ok

they don’t happen with any regularity

all clear now
thanks!

just when I think I’ve fixed it, and put in enough captcha, my boss gets a blank email, and then I get yelled at

constructor names usually start with a capital letter
receord everything you can about the request in a file on the server

I don’t run the server

then you can investigate when it goes wrong
oh

when I try to submit a blank form, my javascript window stops me
but somehow, someone or something else is able to

Javascript can be bypassed
Check server-side

Error: uncaught exception: [object Object]
why could it be ?
it doesnt say much

IE errors.

but i know it’s because of these two lines:

Aren’t they *fine*

var latlong = new VELatLong(document.getElementById(‘picada_latitude’).value,document.getElementById(‘picada_longitude’).value);
map.AddPushpin(latlong);
those lines
Jan-: well, in fact I’m using FF

what triggers your javascript?

Any idea on my question?

pressing the “submit” button
it checks if there’s an @ symbol in the email field
if it is, it submits the form
if there isn’t, it pops up with the JS error box

is it possible to detect when someone presses F5?

onclick?

yes, this happens on click of the “submit” button

forms can be submit without clicking on buttons

Hmm. Logical problem here.

pressing enter in some circumstances

I’m updating the play position indicator by searching the playlist for instances of the currently playing object.
The problem is, there can be more than one copy of that object in the playlist.

And people can remove things from playlists after beginning it
Even though I don’t know what you’re talking about.

Precisely.
This is actually insoluble.

Why not grant each playlist item a unique id?

Someone could drag an item around in the list and make it effectively impossible to figure out what was once where.

hi. I want to update the image when clicking on the link without refreshing the entire page. i’ve googled two examples, one didn’t work in opera and the other whined about ie security setting. anybody has a code that works in all popular browsers?

That’s the only solution julian.
But it’s going to be a bear to manage.

There are a few hooks you’ll need to add that could potentially update the position indicator
Removing an item from a playlist, moving an item, etc. etc.

Absolutely.
That’s not a problem.

steved-: change its src

Are you working on a JS-driven movie/music player or something?

Yes.

steved-: or if it’s the same src…

At the moment I’m just relying on indexOf which I believe is more accurately termed firstInstanceOf()

use a randomly generated query

Yeah
I don’t think it’s out of the question to assign a unique ID to playlist items. Seems standard enough, for a number of reasons.

I don’t really want to limit people to only putting something in the list once.

eg, change source from image.png?randomparameter=45656 to image.png?randomparameter=38646
or something.
should work :|

it’s all I can do. The problem is, if I start adding to the objects in the list, they’re really just references to the object in the library.
So hm.
I’ll just end up overwriting the same property.

Gracenotes I have no idea how to do that. :|

This is one more reason for me to write that deep object copier so the playlist can contain copies of the library objects.

Jan-, I gave you a deep object copier, I’m fairly sure

I want to do that in the end anyway, so each instance of the same object can have different settings.

don’t make copies of the whole objects

deltab, I sorta have to for this.

just have multiple list entries referring to them

can this be done so that it works in all popular browsers?

Jan-: http://www.twey.co.uk/pythonic.js : Twey.Pythonic.Object.copy

Ooo.
Thankies, Twey!

steved-: I’m not sure. when you say “update image” do you mean change the source code the image?

Jan-: Welcome
Jan-: It even does arrays

Gracenotes replace one image with another

This is one of my playlist objects, represented as XML

“Jan” at 71.6.194.243 pasted “Object” (122 lines) at http://erxz.com/pb/3706

there’s probably more stuff to go on there

steved-: when should that happen? when the user rolls his/her mouse over the image?

Gracenotes when the user clicks on the link above the image. there are several links, each one with it’s own image

Do I want the bit beginning ‘copy’ : function(deep)…
down to “return r” and the following }?

I want to do that without refreshing the entire page

Jan-: Yes
Jan-: That’s the function, it’s designed to be attached to Object.prototype so you might want to change that, it’s considered bad style nowadays

Balls.

Jan-: It’s not a problem, just add another parameter, say call it “o”, in front of deep, then replace “this” with “o”

it won’t submit even when I just tab through

The algorithm stays the same.

So, foo = bar.copy(true); bar == foo ?

Jan-: No, it won’t == foo

Fine.
Good.
So it won’t indexOf it either.

No.

Spiffy.
Problem solved.
Now I have to figure how to widget this into my drag-nuh-drop code.

Heh

It is better this way anyway.
This way, changes to playlist items won’t affect library items.
Although I could see there being a case for changes in library items being propogated to playlist items.
Which is doable, just a lot of if/else/if.

Is there anything to see yet?

In that case you just do the copy algorithm in reverse

Yah, but to do it sensibly, you’d want to set playlist items to new library-item settings only if the playlist items didn’t have individually set custom setup for that particular property.

Jan-, thinking of the behavior of other music players too… it’s kinda one-way.
If I move a file, Winamp’s playlist will still point to the original location.

It’s a show control application for digital cinema.

Ah

Jan-: Well how about you only make a copy of the object once it starts to differ from the original?

http://www.1159productions.com/test182/shad_xml.jpg
I really do need to make a copy of the object so I can differentiate it in the playlist.
For reasons discussed above.

Oh.
I was barely listening, I just heard “object copy” and threw a script at you.

I need to add the ability for table viewers to only dispatch *copies* of the dragged object.
This should be possible.

It is, after all, 023418.
023635, atually

yah. I have day off work tomorrow

actually**
See, even my typing’s going
`”.

I’m weighing up whether I really feel like tearing into this object copy replacement thing now. Or if it’s a job for about oh, one, maybe two PM tomorrow.
You know. First thing in the morning.

Blimey. That’s wee hours, that is.

What’s your interest in all this, anyway?

has anyone had any experience with a blank submission of a web form, as in, the email posted comes to you with nothing filled out, and you put in a javascript validation for the email address?

I’ve apparently no chance of getting a date with my girlfriend until she’s finished Harry Potter. So I’ll be up rather late.

(the form, the javascript email validation, and the email all work, by the way)

Oh dear.
Does she have a Hogwarts’
scarf?

No.
Thank the gods.
A friend of mine has a Naruto headband, that’s bad enough.

could be spammers

I repeat, people with Javascript disabled won’t even see the validation, check it with your server-side script as well

nor non-people

My mouth tastes like I’ve fallen asleep in a car.

how do I protect against spammers and non people in this instance?
because my boss is now making me work at 9pm on a friday night to fix it

on the server, check the values are valid

it’s a IIS server that I don’t manage except through a web client

Jan-, curiosity
I came here to try and get a question answered, but no responded, so now I’m just watching.

deltab – is there no failsafe way to protect against this?

What was the question?

I’m tasked with fixing a problem on our website… we have a simple frame… top and bottom. There’s a “Print” button on the top frame, but we want it to print the contents of the bottom frame.
This works on IE, but not Firefox. The JS is: window.parent.bottom.focus();window.print(); — any ideas?

parent.frames.bottom.print();

That seems much more sane

Not something I do a lot of.

is there a failsafe way to protect against this?

I could probably have used frames to do my grid layouts, but accessing everything becomes such a pain.

I don’t either. Not much JS overall though.
Time to go check the printer

has to be server-side or recipient-side

A captcha will protect against those things as well.
Not 100%, but I’d say 99% in my experience

recipient side?

ignoring the empty messages

deltab – I don’t think my boss is capable of ignoring empty messages – just bitching at me for them

Yeah, that worked. Thank you.
deltab, unfortunately, that causes IE to print the top– but I’ll add a browser check.

what will parseFloat(“-1.0″) return ?

Have you tried it?

parseFloat(“-1.0″)

-1

thanks deltab

hi all

whats a good javascript tutorial? a brief one, i dont need it to explain to me what a variable or an array is

http://developer.mozilla.org/en/docs/A_re-introduction_to_JavaScript

OKies, I’m sleep

are coordinates like page.y measured from the top of the browser window?

I have 2 frames and I’d like to submit a from in frameA from frameB. The function is in the frameset. Can somebody please correct the following? window.frames['frameA'].document.forms['myForm'].submit();

Is there a way I can capture the even of when a IFRAME gets its src changed?
event*

can you observe it?

observe?

set an observer?
http://www.codeproject.com/jscript/Observer_Pattern_JS.asp

I have 2 frames and I’d like to submit a from in frameA from frameB. The function is in the frameset. Can somebody please correct the following? document.getElementById(“frameA”).contentWindow.document.myForm.submit(); …I get a “is not a function” error.

i’d like to implement a javascript into my website, which shows the password-strength of the entered passwort. i saw that once somewhere in the net but now i just don’t remember where. what i saw was a graph, wich indicated how secure the password is, it changed everytime a character was
entered

any idea how that’s called..?

GMail.com and Hotmail.com have that I believe.

hm, yes, it might have been gmail….just what is that called? :/

Password Strength ?
http://www.securitystats.com/tools/password.php

yes, that’s it! but i’d need that for javascript
ah, password strength meter is the keyword

http://www.geekwisdom.com/dyn/passwdmeter

thanks, found that one yet

I have 2 frames and I’d like to submit a from in frameA from frameB. The function is in the frameset. Can somebody please correct the following? document.getElementById(“frameA”).contentWindow.document.myForm.submit(); …I get a “is not a function” error.

hey folks!
anyone here use niftycorners?
and know of its compatibility abilities? (i.e 5, 5.5, 6, safari, opera, etc)?

anyone know how to edit/save files from Javascript [on your own computer]?

is it possible to attach an onclose handler to a window you create, in the creating js code?
pfft, talk about idling

platform-specific methods see tiddlywiki

can I do if (var) ?
or do I must write if (var == true)

if (var) is fine.

hi

anyone know where can I find some tutorial about how to make a simple draggable window interface, I mean have virtual window in the browser and be abble to drag them

Try using Google.

tried :s

thanks Neverwinter

1)

where UserUsername is the id of the field i want to get

ih

‘lo poiuy

yeah?

I was assuming ‘ih’ was supposed to be ‘hi’

yeah..actually there was something wrong with my IRC client ..i couldnt see any messages so i was just testing
anyway…anyone used mozilla storage down here?

woot

anyone used helma here? are there are any full apps written using nothing but javascrip

`js forms @ invinceable

js forms: Accessing form elements via JavaScript: Don’t use document.forms[index].elementName or document.formName.elementName. Use document.forms['formName'].elements['elementName'] or document.getElementById(‘formID’).elements['elementName'] or document.getElementById(‘elementID’)

as your form element has its own ID, use the last one .. then the value, as you suggest, is in .value and if you want the string-length of it .length on the .value will give you that

hi all

‘lo

sections?

if you want to parse your xhtml as xml, yes

depends
if you’re trying to send the same content as HTML and XML then it is

i think the xhtml string for doing that is actually longer than that

so it’s only required in XHTML?

which you shouldn’t be using anyway

what about HTML

it’s only required if you’re sending the same content in more than one format

send how, where?

sections are XML

right

what would I do in HTML then – nothing?

if you want to parse your XHTML with an XML parser, you’ll need the CDATA sections to escape script and style

and & characters

correct, nothing

so it doesn’t have anything to do with ancient browser support, actually? that’s what I’d always been told

yes it does, but not

nah

now you got me all confused

heh

no, the ancient browser support is the additional !– in front of the /*![CDATA[*/

it's all to do with making sure your comments are hidden from UAs that don't know how to do things

http://www.hixie.ch/advocacy/xhtml this page has something more complicated listed for the CDATA section and javascript

?

oh - I was assuming he meant that as part of his commenting

would be interpreted by the javascript engine

then?

you need to comment that out with //

yeah (XChat ate the first /"

it doesn't make sense on one line, obviouslt

and in fact will fail on a single line in most browsers

I'm just creating a template, and want it to be optimal

tags

http://pastebin.ca/628449 ?

The paste 628449 has been copied to http://erxz.com/pb/3709

Dont use !--

hmm, what now?

put your script in .js files and use the src attribute instead ?

Never write !-- inside script-tag, nor in style-tags.

I usually do, but not for tiny test cases

well, first of all, the script is in the head, it wouldn't render on non js user-agents?
secondly, css doesn't use // when making a comment.

yeah, right - my bad
but omit those comment thingies altogether then?

Yes.

only have CDATA in the XHTML template?

yes

ok thanks

http://pastie.caboo.se/80883. but get an error
error-message: this.initialize has no properties
can you help me?

hihi day-off people
Woah. Midday IRC
*clang*

Jan\, do you know how to inherit in JS?

Well, you can just create another instance of your object and prototype onto it, if that's what you mean.

Jan\, i have a class Ajax.Autocompleter and want to overwrite a method of it. i have to inherit a new class from Ajax.Autocompleter and then overwrite the function by adding a function with the same name and parameter-list. so far so good. but i want to know the syntax of inheriting. i tried
this: http://pastie.caboo.se/80883
Jan\, but that is completely wrong...

Well let's be specific.
You can't really have a class.
You can have a constructor function.

Jan\, o.k.
Jan\, can you give an example?

well. function pseudoClass(){this.foo=bar}; instanceOfClass = new pseudoClass;

Jan\, that's too abstract for me. let's take a specific example: that is the original Autocompleter: http://pastie.caboo.se/80885

this had better not be 5000 lines
Aiiii!

Jan\, you're right.

Oh. Class.create() is a custom thing someone's written.
I have no idea what it does or hwo it works.

Jan-, ahh

As is extend()
It's not terribly uncommon to add these things to JS, but you really need to look at the documentation for it.

Jan-, extend() is also custom-written?

Yes.

Jan-, o.k.

Unless this is actually Java.
I don't thinkk it is.
There's a few OO-extending libraries for JS.
It can be made to work quite nicely but I can't really advise on it.
I presume that any such library would implement what you're after.

Jan-, o.k. i found the class class... http://pastie.caboo.se/80885
Jan-, i think his is just a "helper"function for creating a new class

That's exactly what it is
You see what I mean by "constructor function"
It's not really a class. JScript.Net on Windows does all this by default.
(apropos of nothing)

Jan-, this seems to be quite nice custom-written. i also found the extend-"method" which test whether or not the added 'method' is correctly and acceptable.
http://pastie.caboo.se/80885

Fair enough.
Do that then

Hi, does anyone know how I can include the RSS news from Google in my website ?

Jan-, i don't get it. maybe you can help me?
Jan-, i got it now.

emm
hello?
have a function with "document.getElementById(1).checked = true;"
if i click then i recieve don't erroes..
is document.getElementById(1).checked = true; wrong?

i need to get a list of attributes for elements - values.attributes[i].localName works great in FF but now in IE, what should i use ?
bi need to get a list of attributes for elements – values.attributes[i].localName works great in FF but now in IE, what should i use ?/b

Comments off

im stumped I do not understand why when x becomes -1 the loop doesnt just break on its own – isnt x = -1 supposed

morning everyone

Sembiance, a splendid afternoon

good day

it’s coming down in buckets here. rain rain rain. several roads closed (Which isn’t unusual here rofl)

hot and sunny here

same here
must be europa
=]

fuck you, firefox.

why the hate for firefox?

it keeps trying to fill in these forms for me
which is intensely annoying at this point
for this webapp at least
any way to make it stop that ?

options-privacy-remember what I eneter in forms and the search bar ?

cunning.

hi guys
Is there some superduper function to set the text in a element, for instance divs and spans and h1..n ?
elem.textArea, isn’t crossbrowser compatible I’m told.

create a text node and add it

… retract the div element… create node div…

how exactly?
Isn’t there an easier way to do this?

I don’t really see how that is difficult, if you need to do it more than once just write a function that does it

document.getElementById(‘div_id’).innerHTML = “Yuor new text”; Yuo need this?

hello

“Jak08″ at 71.6.194.243 pasted “Date system” (1 line) at http://erxz.com/pb/3949

I was wondering how I could get the first part of that bold
while leaving the rest of it in normal text

omfg
what is it with ie
http://reviewerportal.com/digital_cameras/?p=1
why wont the dropdown menu on the left work in ie?
works fine in firefox

Fraz, still not work? )

no
i rewrote the menu in a seperate file
which worked fine
then transferred the code over
and still wont work
nothing in the left sidebar is clickable in explorer
i think the javascript is working now, but cant click anything
trying to validate my html, but the html validator over at w3c isnt working

to a JS function, so it calls a function when the link is clicked on?

var a= document.getElementsByTagName(‘a’). for(var i=0;ia.length;i++) a.onclick= function(){} )

no you don’t… you LOVE php

)
it work so strange…

how do i check if a property of an element is a getter or setter?

see source code)

Min2liz, thanks. Yes I need that.
I found out that there are at least 3 non-w3 approved in-dom attributes for changing the text in a text node
..innerHTML, .textContent and .text
not sure any of them works though.

nodeValue ?

okay, four.
not sure though.

krrronos, I presume that line was directed at me, but thats confused me more. How would I make it bind to one link?
Just all the a href=’bla.html’’s in the page

i have an error
a[i].onclick= function(){}
thats right

hi
how can i alter the content of a div using DOM?

krrronos, I’ve got http://pastebin.com/d20e9dc38 and when I click on a link, it won’t do the alert?

SamuraiDio, innerHTML?

a[i].onclick = testit; no ()

a[i].onclick=function(){testit()}

same goes for the onload

When making a get request of a page with AJAX, what is charset set to?

Thank you
another quick question, whats the statement to stop it following the link?

onclick=”return false”

unless you are trying to combine both questions

[Liquidor], utf-8 ?

but (
Aww man I’ll never get this to work. Been struggling with this all day.
What do you see and with what browser as the first word on this page? http://reputation.mygamesonline.org/armory.php?n=Shízzy&r=xavius&ra=Human&f=9&s=Honored&v=3947&mv=12000&cache=8

Shízzy IE7

Shízzy FF

~paster
~paste
~bin

Okay so far so good. However when I request this page with AJAX I get Sh?zzy with FF and Sh?y with IE :-/

how do i as for a pastebin?
!paste

Does anyone know the reason why and what to do to solve this matter?

how can you make javascript hosting wait mid function for say 10 secs?
setTimeout doesnt seem to work

“SamuraiDio” at 71.6.194.243 pasted “window.parent.document.getElem” (16 lines) at http://erxz.com/pb/3950

help

Available Plugins: oeis jeval spell cpan shorten rt topic squeeze rbeval acronym change managementspeak reverse join translate bibleit core imdb insult tv help echo eval convert jseval mangle restart quit deparse part pyeval reload_plugins goobooblink heap_test rss

this snippet waits 1 second then executes 10 functions calls one after the other with no break? instead of 1 every second
for (var x = 1; x = 10; x++)
{
window.setTimeout(“sendInput()”,1000);

}

that’s wrong code

how come?

you create 10 threads and they all wait for 1 sec, then they all execute
what you want to do is create a thread, wait, create a thread, wait, etc.

how can i do that?
without repitition

0) setTimeout(“myfun(” + (x-1) + “)”, 1000); } start with myfun(10);

thanks

np

can some1 help me?
cannot i break strings passed on function parameters?

You want to do something with an interval of n seconds?

yeah

Why not use setInterval ?

cool never heard of it

can i break strings added to variables or function parameters?

SamuraiDio substring method maybe ?
or split method

StaZ_work, no, the problem is that my string is too large, is an html host content, and i dot want to add it all on one line

SamuraiDio substring method maybe ?

var foo = ‘asdasdasdasdasd’; foo +=’asdasdasd’

oh you create a string

ahh
tnx

If a[i].onclick=testit;, how can I let testit() know what the a.href is?

i thought you wanted to break it to output it in pieces

giggsey, this.href ?

a[i].onclick=function(this){testit(this)}

i dont think u need to pass ‘this’

yeah, you don’t

a[i].onclick = function () {alert(this.href)}

what if I am trying to confuse people?

Khisanth you will be lynched
http://icanhascheezburger.files.wordpress.com/2007/01/1159434782588.jpg

there are many others in front of me in the queue for that!

hmm
Now return false; in testit() won’t work

a[i].onclick=function(this){return testit(this)}
the false can’t returned without the return keyword

a[i].onclick = function () {alert(this.href)}

Okay, thanks
Now (sorry), is there a way to just get the last bit of the link? Just the filename?

astring.split(‘/’)

Thanks pr0nbear

hi all. i need a js which resize an input field or a textarea… any idea?
?

can you specifiy the port in a relative url?

why this not work?
newContent += ’scriptsetTimeout (“ajaxRedirect(webroot + \’noticias\’)”, 5000);/script’;
unterminated string literal

garethfn, nope, you need a full url

it could be on the line before

kta

some clue?

SamuraiDio i jsut gave you one

hi,

hailz

StaZ_work, what did you mean

i want to read a selected text from textarea using js, how can i do that.. im trying like this document.getElementById(‘writetext’).selected

SammyWG if the line before is not terminated, the console could think the unending string is on this line, check the code your on, 5 lines before to 5 lines after, try deleting or spacign a line and see what happens to the error line number

StaZ_work, even if i place all on the same line,i get the same error

* shrugs *. try deleting parts of the string and readding it parts by parts until you get the error then you’ll know exactly which part is erroneous (debugging trick)

StaZ_work, tnx, ill finish later…

Hi all!
I need some kind of onload event on an individual HTML element
I can’t address the element directly and do something like initialize(document.getElementById(“foo”)) because the ID “foo” may not be unique on the HTML page
and I also can’t give each element a unique ID (because this CMS is crap)
so, how can I identify an element as well?
I’d really like to have some “in-place” event handler

section, where “this” is set to the Window object

node in HTML either (and go on from there), or is this possible somehow?

Twey, give me a ping when you are awake
Twey, I owe you rum I assume = )

is it possible to completely replace the document element?

I can has doubts ?

Hi, i’m trying to load some pages into iframes..but it contains some js code that “breaks” it out of the iframe. is there a way around this?

0) { parent.location.href = self.document.location }/script

e.g mail.yahoo.com contains some code similar to this
Anyone got a clue?
anyone here?

hey

hi squi – u see my q?

what could be a way of an element accepting input without adding any onclick- etc input to it?
i just walked in

heh ok

without any event added to it*
therer is not a lot going on here, is there?

try element.focus() in an initializer

no
tommyd:u got one for me too?

tommyd what would that do other than giving the element the focus?
realnamexyz state your question again, i didnt see it

for input elements this sets the cursor in the item
maybe I misunderstood your question
imho “accepting input” is something which basically form elements can do

Eg I have a “div” and it somehow reacts to events but it has no event-trigger added to it, how is that possible?

tommyd:i’m trying to load some pages into iframe, that contains code that breaks it out of the iframe- how can i avoid this behaviour and force it to stay in iframe ?

it for example reacts to clicks
realnamexyz do not use an absolute position and it can’t leave its parent

how should an element react on events with no event handlers defined?

tommyd thats the question… i used firebug on it, but it only has styles set, nothing else

you could add the event handler to the document element and act accordingly (i.e. delegate) the work on the specific item

it still reacts to mouse-clicks though
tommyd wouldnt firebug show it anyway?

well, I don’t know firebug enough to answer this question
you could certainly do something like document.addEventListener(“onmousemove”, function(ev) { myElem.style.x = ev.x; myElem.style.y = ev.y });
bah, skip “style.”, you know the rest

oh i see
no that would probably not be shown

I don’t think code like this is “recognized” by Firebug

yop

here is an example of what i’m trying to do http://pastebin.ca/649977

The paste 649977 has been copied to http://erxz.com/pb/3951

how do I match “../” 0 or more times with a javascript regexp?

tommyd:as you can see, the windows doesn’t stay inside the iframes..

this is merely a CSS issue than a JS issue, please ask in the appropriate channel
/(\.\.\/)*/ ?

thx

0) { parent.location.href = self.document.location }/script

how can i disable this behaviour?

at first, its not self.document.location, but self.location
and moreover self.location.href, not self.location alone
(location is the object, href the string pointing to the URL)

well, it works..
(this code is not from yahoo – but they use similar stuff)

please try to ask sb else… I’m about to go. Sorry

tommyd:np

Does anyone know how I could determine the width and height of a element without a style.width or style.height property?
I’ve got a findY and findX function, but I need to create a invisible box and know when the mouse is in the invisible box, so I need to know the height and width

can a javascript function just return and not return a variable/object?

“vBm” at 71.6.194.243 pasted “Any way to do this a bit bette” (10 lines) at http://erxz.com/pb/3952

? :]

yes.. just method () { return; }

Hi
I’ve got two divs that are next to each other and touching – I’d like to be able to drag the divider between them and make one smaller and one bigger
Like a paned interface in itunes, for example

I believe I have seen similar effects in scriptaculous or maybe openrico.

does anyone here know how to detect what text the user is highlighting in javascript ? ive created a custom blogging interface for my website and some custom markup to go with it
the backend works great, but when a user clicks on the h1 button, i would like “h1. ” to be prepended to the words they have highlighted
ive search all over and cannot find this answer anywhere, so if someone could offer some sort of pointer thatd be great :P
or if it is even possible at all

I’d suggest looking at the source of other wysiwyg editors

invinceable, http://www.quirksmode.org/dom/range_intro.html

What should I search for?

Is it possible to call a javascript function without there being an event to call it with?

oh, http://wiki.script.aculo.us/scriptaculous/show/Draggable looks helpful
what?
myFunction(); calls the function

and not when i have load() placed elsewhere

script type=”text/javascript”load();/script
would call load()

yeah, i did that

what’s in load()?
and where did you place that?

after the function

probably best just to paste code

ok.. and what does load() do?

http://erxz.com/pb/javascript

do you have firebug?

firebug? no

put console.log(‘I was called?’); at the beggining of the load method.
oh.. nvm then
yah.. give us a url
or paste into pastebin

https://addons.mozilla.org/firefox/addon/1843 is firebug

got it working
really weird, o well thanks

yeah but now im curious
:P

I do suggest installing that addon
very handy for debugging javascript

oh, nice
i use IE to debug it lmao

good luck with that

hehe

IE has the most retarded error reporting ever
lol

yeah, its awful

the closest you can get to decent reporting is with MS Script Debugger
but even then.. it tells you nothing.. just highlights the line that errored.

the newest safari stuff is good, too

yah 3 safari

it’s like alpha though

I am actually getting to the point that I spend more time “surfing” with safari than any other browser.

for sure

mostly because I am still getting memory leaks with firefox and well.. IE is IE. lol

does the new safari support labels?

it’s 2x faster than ff for me

the old didnty

tha’s another thing.. I have noticed that it
’s the fastest renderer

what do you mean
?

label

it always has supported labels..

/spaninput //label
no it does not

if you mean in terms of .. you click the label.. probably not.

(-:

that is not a feature of HTML.
that is a feature of the browser

i even wrote a script which fixes the issue for ie/safari
:p
as i *wub* labels

but interestingly enough.. I think I know what the problem is.

http://www.miraclesalad.com/webtools/safari_fix_label_jquery.html

in my honest opinion.. even though some sites might tell you to label that way.. or that it even doesnt error.. I find it unreliable

what is the maximum cookie value string length ?

input type=”text” id=”someInput” name=”someInput” /

I think the lack of for in your labels could be the issue

hmm

yip
that is your problem
cuz my labels work fine in safari

http://www.xs4all.nl/~xorc/labeler.js – my implementation

unfortunately, an unecessary one
as the problem is the lack of for in the label

why
supports either way

firebug is pretty laggy -_-

http://www.xs4all.nl/~xorc/labels.html

well, I dont know.. but I would think it’s always better to avoid javascript if it’s not needed.
and if you want your input field to be focused when a label is clicked
then it just requires an id and the label to have a for attribute to that id

thank you, that looks exactly like what i need!

but its needed, as label is not supported and has huge usablity features

i am as well, im looking at the source of DRUPAL atm

shrug.. I have NEVER had a problem with label and usability. hehe
well.. whatever tickles your fancy

yeah but writingb a little code for each label (and every input as a label) its more efficient to do it with a script
hehe

in fact, in terms of Accessability.. the for attribute is required for screen readers

well, labels are very nice imho

brb.

wow… im having a problem in Firefox, i have the same javascript on one page, with same fields and it works on a different page but not this one

is there any way to find out the structure (methods/properties META information) of the javascript based object ?

anyone out there do work with radio buttons and their groups? I have some javascript that looks like: radioElem.checked = true; but for some reason in IE its not setting up that button as selected…. any ideas on what I may be doing wrong?

Awake

Yeppers ;P
late night last night, and here early

Heh, not exactly early here
I slept from about 0600-1700

I’m in arizona, us

England here

I have a question, the (function() {})(); stuff

A function expression that executes immediately

Seems like some kind of trickery, I get why you did var DnD = (x)

Lets you create another scope

StaZ|Work, hi

Because JS blocks don’t alter scope

Twey, I see, I got the execution bit, but you use it for properties too
Twey, why on the properties?

tag

Twey, I don’t understand the javascript hosting “object” model so well
(function() { })()

Where I’ve used it on properties I’ve created it so I can add some extra properties to the property before returning it to be added to the parent object

function() {here}

Because I added properties to that function
I could have done it outside the object, but this way is neater.
Sorry, BRB, should’ve used screen
OK

Twey, I see what’s going on

works

how new DnD.DragElement(ele) calls to s = function(el) instead of the paren function
how does it know too?

Closures
`js closures @ cstockton

is there a way to know all the function list of a javascript object?

`closures @ cstockton

closures: http://jibbering.com/faq/faq_notes/closures.html or http://blog.morrisjohns.com/javascript_closures_for_dummies

The function has access to the reference to itself

Twey, I’ll take a look

is this proper usage of new option? new Option(“Afro”, “Afro”, defaultSelected, selected); trying to get that option to be selected when its loaded
?
can someone please tell me why, http://pastebin.com/d4987d5b2 the SELECTED one isnt being selected?
got it working, except its selecting the one before… lol

try setting the .value :P

without looking at your code, you know that arrays are zero based, right?
the first element in an array is [0

yeah

]

but im doing new Option(text, value, true, true);
so it should select that option, right?

you must be using some library
I don’t know that function/syntax
sorry

?
That’s not a library

anyone very familiar with prototype library?

#prototype is

http://pastebin.com/d5964780d is my actual code

I was talking to Bear10

yeah, but new option isnt a part of a library

oh, interesting
apparently you know more than me about this
sorry

hmm, found a bug, when i actually change the option from what it should be to something else and back then it selects correct one, but if i run that option onload it picks the one before :|

Personally I wouldn’t use new Option() though

what would you recommend?

Just use document.createElement() and set the attributes yourself

I love your nick Bear10

likewise
not familiar with createElement :|

`domref @ Bear10
`js domref @ Bear10

js domref: w3.org/DOM/ , http://developer.mozilla.org/en/docs/DOM , www.mozilla.org/docs/dom/domref/ , www.zvon.org/xxl/DOM2reference/Output/index.html , www.krook.org/jsdom/ , http://phrogz.net/objJob/languages.asp

Damn inconsistencies

haha, funny thing is the script works in Firefox and not in IE now i hate JS

is there any alternatives to innerHTML that do not require DOM creation/manipulation?

No?

damm it.

What’s wrong with just using the DOM methods?

cuz it’s super slow?
and ugly to write
heh

innerHTML’s a heck of a lot uglier

it’s one line
how is it uglier?
or assigned to a variable.

And the DOM methods aren’t much slower

then passed to innerHTML

Yes, but the DOM is not a string

nope

The most common example of this problem is XHTML

it’s an object. but I have the string.. so I have to convert the string to the dom object

If you were to write a script using innerHTML for an html hosting document

which is going to be ugly no?
like a 500 line table..

Then move that script to a document that uses a different markup language, e.g. XHTML
You’d have to rewrite the script
It kills portability

I have no control over the output

Of course, innerHTML doesn’t work in XHTML anyway, but that was an example.

the html string I have is what I have to deal with.. period.
unfortunately

seems a bit strange, no HTML parser written in JS?

new DOMParser()
http://developer.mozilla.org/en/docs/DOMParser

Just as proprietary as innerHTML

yep
non-standard*

so is there any good reason why no one has written one?

i try to remember about something:

considering the amount of JS libs that more of less do the same thing

is there any isOpera() sniffer included in browser
or should i use useragent ?

gebura, function isOpera(){return !!window.opera}

loving u
thanks

not sure if the !! is needed tho :p

ok thanks, i ll try

prototype uses it, atleast

do you know what is the double “!” ?
i don’t know this kind of synthax

it turns the object twice
from object to false to true
or to false if not opera

i guess you can’t use text/html with DOMParser()

arg!!
this code make opera segfault !!!!

Hahaha

if (window.opera)
{
alert(‘ee’)
}
else {
alert(‘ee’);

Nice

}
dabear, !! seems needed

“vbgunz” at 71.6.194.243 pasted “brain fatigue? simple 3 line loop, endless gotcha?” (8 lines) at http://erxz.com/pb/3953

can someone check what is supposed to be simple and tell me why it does not end?
am trying to get the index of “i”… please no other solution, just what is wrong would be great
is it because I am modifying x in the body?
it’s a very short problem, hope someone better than I can answer my stupid paradox

try ++x instead of x++, vbgunz

That will make no difference
indexOf(“i”, x + 1)
“billie”.indexOf(“i”, 0) == 1
“billie”.indexOf(“i”, 1) == 1

im stumped. I do not understand why when x becomes -1 the loop doesn’t just break on its own :/ isn’t (x != -1) supposed to say, while x is not equal to -1, loop, otherwise break? this is my first gotcha :/ is x++ ruining it somehow, is that ran first before the check or something?
I can do this easily with while true, if break but am frigging stumped when in my eyes this should work just as well…
hmm… I solved it *but* not how I wanted. it appears I cannot use the var x and modify it… it fails

can you do something like document.getElementById(‘foo’).getElementsByTag(‘input’) to get all the input tags that are the children of ‘foo’?
Or do I have to iterate through children
checking each one to see if it is an input

js ref
`js ref

http://developer.mozilla.org/en/docs/JavaScript , http://devedge-temp.mozilla.org/central/javascript/index_en.html , http://phrogz.net/ObjJob/ , JScript@MSDN: http://tinyurl.com/9pk3l , www.crockford.com/javascript/

Thanks

leip, look at cross-browser.com/x
http://cross-browser.com/x/lib/view.php?s=xGetElementsByTagName
xGetElementByTagName(“a”,xGetElemenById(“one_element_id”));
that ’s what you are looking for ?

Seems it. Thank you!
Interesting library…

whats the difference between ++x and x++ ? I seemed to have solved a problem with ++x Vs x++ … is ++x deferred or something?

++x increments before, x++ after

x=0; ++x /* 1 */; y=0 ; y++ /* 0 */; y /* 1 */;

var x = 0; print(++x); x = 0; print(x++);

101

can a class prototype be modified within the class declaration itself?

var x = 0; print(++x); print(” – “); x = 0; print(x++); undefined

1 – 0undefined

There are no classes in JS
And, yes.

Twey, I mean like function name(){ this.prototype}

That’s a constructor function

print(“foo”);

foo1

And it’d be name.prototype or this.constructor.prototype

void print(“foo”);

fooundefined

gah

thats nice. ahh, dabear really helped me out with that. I haven’t gotten to ++x yet but it’s very cool in a loop, sweet
thank you!

Twey, there doesn’t need to be an instance of the class already to access the prototype members?

where are you getting classes from?

deltab, a constructor is basically a class yes?

no
a class is a structure built around a constructor and more

Of course not, the prototype is a property of the constructor itself, not an instance of it

would the constructor have access to the prototype property if its assigned outside of the constructor?

so if i wanted to make a GET request using javascript, and taking the output from a few text boxes, how would i do that ?

The code within the constructor is run when the constructor is called, so if the prototype’s already been assigned by that time, then yes.

so this should work assuming printToScreen is defined? function name(){ printToScreen(variable);} name.prototype = { variable : 0}

varek http://gebura.lescigales.org/x/xFenster_Work/files/gmw.js
see gmwConcatInputsValues(form)

err this.variable

or gmwSendForm(form)

Yes

i don’t think you can use this function directly but it may give you somes ideas

Twey, thanks a lot :-)

Welcome

hmm.

gmwSendForm(f) seems to is what you are looking for
to be
is you want do something simplier just do

i’ll do my own implementation

a href=”#” onclick=”document.location=’file.php?foo=’+getElementById(bar)”

is there an open source applet for resizing an image graphically out there?

“applet” ??
you aren’t is the good channel
javascript!= java

tag can i just use ‘document.body.onload = function(){}

tag?

oh
then i mean

DoctorNick,

can javascript do it?

window.onload() = function () { your code }
SAberu|, i think, scriptaculous (a heavy library must do it)
http://cross-browser.com/x/lib/view.php?s=xAnimation.imgSize can also

ok thanks gebura

Just onload = function() {}; is fine.

using onload without any parent objet isn’t very recommended i think
it the same for alert()
witch (window){ onload= function () { } } may be a way

Ok, i’ll try that.

gebura i’m looking at the script on the cross browser page
i’m a newbie to javascript, not sure which part of the script sources the image
var i = this
i assume it’s that part? :s

it seems
i don’t have try this script so i couldn’t help you a lot

..
………………………..
…………………………….. how do I rotate an image hosting (not a canvas) in photoshop?

don’t try to copy it, just include it on your script.js file (witch dependency)

then i just feed the width and height vars into a button which submits to my php script then use those values to resize the image

an example of usage is on http://cross-browser.com/x/examples/xanimation.php

aga free transform

sory my english is poor, i don’t undertsand you what youd want to do
you can try to post on cross-browser.com forum

thanks

i want a script which displays the image to the browser then allows you to resize it on thr screen
by dragging the image

is X (javascript library) worth implementing?

arf
it s more complicated that i was thinking

Anyone have experience with it?

ok

you may have to write piece of code
or try to use scriptaculous
witch may be more complet and more simply to use

i also need a script which allows you to select a vertical strip of the picture which u can drag/scroll across the picture dynamically in order to select

leip, it is a great library
i use it for many development
eyeos use it for example
it depend of what do you want to do

hi, I have a quick JS question for ya…
is there anyway to terminate script execution before it gets to the end?
for instance, if I have an error and I want it to stop
I tried “return” and “break” and they both cause errors because they’re not inside a function/loop

it is not as simply to use as prototype, since you have to develop you own wrapper (for example) to use it
see http://gebura.lescigales.org/x/xFenster_Work/files/gmw.js for examples of usages

Thank you

what do you want to do with ?
if you want ome help with , i am your man
some

were you talking to me just now?

no, to leip, sorry

oh

does anyone know how you can pass a function call with arguments as an argument of another function? or is it not possible?
like something(something2(stuff),500);
without something2 being executed

Hor|zon, function foo (a , func) { func(a) }

I would think that you could create an anonymous function that has that as the body

ooh

something(function() { something2(stuff); }, 500);

Hor|zon, you call it with foo (a , alert ) or , foo (a , function (param) { alert(param) }

makes sense, cool I’ll try them
thanks guys

if you want more complex example most of httprequest wrappers have a callback function
np
Hor|zon, http://gebura.lescigales.org/x/xFenster_Work/files/gmw.js contain also some examples
function gmwDoForAllBox(funct)
for example of implementation
used in gmwReloadAllBox() for example of usage

hmm
I see
cool
and at work they said it couldn’t be done…I was about to redo it
thanks a lot

is there anything in javascript that functions like exit() or die() from other languages?

rmeador, you can use throw

that will throw an exception which will cause an error
I can’t have unhandled exceptions… I’m doing serverside javascript

outch

yeah

i don’t know how to play with
you must define ‘foo’ “) stop the script

I just want to be able to stop script execution on an error without it breaking
I would have expected “return” to work, but it crashes

you may see at your javascript implementation
if it is server side it must have a way to stop
but witch ?

I have no idea

see the doc
of your javascript implementation

knowing the engineering team around here, it’s probably internet explorer being opened on a per-request basis
we don’t have docs for anything
we’re not allowed to see documentation or code for the server

but what ’s implementation name ?

I don’t know

haha, i undertstand that i must be difficul to code with !

but I do know some things, like generating a PDF, are done by creating an instance of IE on the server hosting and forcing it to “print” to the PDF writer andn then serving the resulting file
this company I work for is a prime candidate for thedailywtf.com
ok, but you’ve told me it’s not part of JS… which is also what google told me
so now I have to go bother the engineers here and they’ll tell me it’s not possible…
thank you for your hlep
*help

if it work with embeded ie
it may be jscript
but i don’t know if there is a server side implementation of it
it may but i am not sur

I’ll try to figure it out…
thanks

http://en.wikipedia.org/wiki/Server-side_JavaScript

I’ll look at that
bye

does anyone have suggestions for this?
http://www.flyingsoft.phatcode.net/flowers/helenasflowerabode.png

aga|afk yeah, delete it

hm? just wrong tab completition?

can someone make me a script?

chrisb17, not freely i think
help you to make a script, we can

Available Plugins: oeis jeval spell cpan shorten rt topic squeeze rbeval acronym change managementspeak reverse join translate bibleit core imdb insult tv help echo eval convert jseval mangle restart quit deparse part pyeval reload_plugins goobooblink heap_test rss

write you own…

its basic and i am broke lol, take u 5mins at the max lol

what does this bot said ?????

bot said nothing

Available Plugins: oeis [...] ???

staz….
that’s pretty mean :-|

SammyWG he asked for a suggestion showing an image not saying suggestion about what
and anything with the word “phat” in it deserve to die. /rant

on its look and feel
I don’t have “phat” in my text…

and fine , can u tell me what i need to lean to have 3 text boxes when they reach the max chr limmit it moves to the next box till it reaches all 3

it’s the link :-|
chrisb17, you need to learn* javascript, of course…

what parts

body onload=”document.getElementById(‘loginbox’).focus();”

aga|afk well i think it’s a little “cheap”, maybe could look better on a non white background, the colors doesn’t match very well, i’d go for the same color, different tone, and maybe 1 big leaf behind the name instead of 2 on the sides. that’s my suggestion and personnal opinion

your problem is not fully defined

buu, can you tell m why you bot tell me a list of available plugins ? i don’t undrstand well

but not in the body tag (it isn’t easy to get to… standard template)

of course it won’t be on a white background, it’ll be on a flower background..
so, let’s say that you want to move the cursor whenever the user changes the characters

active text box not the mouse

I wana know the js that would make the mouse move

check for key presses in the current character box
you can’t

especially the one that will make it hit the user in the side of the head.

then check the amount of non-whitespace characters in current textbox

my real question, not the mouse nonsense, right?

aga|afk, js can not pilot mouse ?

is there a javascript for idiots tutorial?

if it’s bigger than what you need, go to the next one, if it’s smaller
yes, there is
no
?
do you want to know the functions you need or are you totally illiterate in javascript?

http://www.howtocreate.co.uk/

but not in the body tag, 2) js to move the mouse

just thought on the (my times) afternoon hilite

I don’t know about the first question, but you can’t move the user’s mouse with JS.. that’s a security violation

rats. I was just kidding about the mouse.

what is the first question?

cuz to me, the mouse is the piece of hardware I hold in my hand. be a neat trick to make it start moving around
body onload=”document.getElementById(‘loginbox’).focus();”
but not in the body tag (it isn’t easy to get to… standard template)

focus on a box once you load?

yes

yes, i think so
is that code not working? it’s something quite similar, I think

and /body

thanks anyway, then. i was thinking of a big leaf myself
carlfk, can’t you add it in to the body tag after it’s defined?

the first line I have ‘easy’ access to is form method=”post” action=”.”

addEventListener and attachEvent(ie)

not easily

you can attach shizzle to your body onload event

right.

where would that go?

between script tags

body.addEventListener(‘…..’) I guess
or
document.getElementById(‘body’).addEventListener(‘….’)…

doesn’t something have to call it?

nah
wait a sec

yes…

document.body

http://developer.mozilla.org/en/docs/DOM:element.addEventListener

exactly (-:
describes ie workings too

would document.body work?

yep afaik

document.body

body marginheight=”3″ bgcolor=”#ffffff” topmargin=”3″ onload=”…

looks like it requires body onload=”load();”

ehr no?

I can add a ‘hook’ into the body tag, in which case I can just stuff the onload in there. I was hoping to only work with the one file that “is the body”

http://cross-browser.com/x/lib/view.php?s=xAddEventListener
there is also xAddEventListener2 and xAddEventListener3

what do you mean exactly?
cause you can include a script, and write document.body.addEventListener (“load”, function () { \n\n\ncode
that would simulate a “onload” file
or something like that

lives. trying not to muck with it

so

both are django templates to be exact

which files you want to mess around with?

login.html

hehe
so do an include there for a .js file?
or in it :p

for this Ill just include … yeah

on your body ?

I thought I still needed a call from the body tag?

No
The onload event can be modified directly.

in that case, can I just do:

scriptdocument.getElementById(‘loginbox’).focus();/script

you can but it is not very good (standard)

overwritten more likely

i haven’t undertsand why de you can’t use window.onload = function () { code }

that would be assuming joomla doesnt do anything to the body onload event

You can but it won’t work because loginbox isn’t in existance yet

or django

Django doesn’t touch the HTML

?
nah but it touches dom?

No

(guessing ‘touch’ needs to be defined)

Django by itself doesn’t modify the output in any way

by itself it doesn’t do anything. once some hack weby starts driving, all bets are off

Aye :-)

because it splits it into 3 lines and indents foo

well
lala
nvm me

it works!
yay. thanks folks.

Welcome

thanks for your help gebura. I just decided to store it as a string and run it with eval
simpler

anonymous functions are also simples
you have problems with ?
it must be more flexibible that ’s your hack

i have sort of a unique problem that i cannot seem to find an answer to
im using the function getSelection() and that works just fine

well, I wanted to basically create a kind of playlist of functions and then execute them at a later date, which is why I think strings are more natural
that and it was confusing trying it with anonymous functions

but i would like to get the selection of a string the user has just typed, is that
even possible via javascript? or should i be looking elsewhere ?
the only thing i could think of would just be grab the text the user has just input and set it to a varaible and then use getSelection on that
but that does not seem to work because i think the selection markup used is lost when the data is sent

invinceable, user submited values in html content aren’t different in
(for example in a input)
so i don’t think it is possible
sorry

it isnt :/ i swear i saw someone doing it on their site using a WYSIWYG editor to input custom tags and such

user submited values and values already in html content aren’t !=

:/ darn i already coded the backend too

maybe i don’t understand what do you whant

to be prepended to the text that is currently highlited

etc etc

maybe there is some way to trick JS into before rendering the text, first set that input field to a normal html host element somehow, and then get the selected text from that ?

ok i haven’t undertsand good the first time

There are API methods to get the selection location I believe.
`js selection

the problem is that when you click you will loose selection

yep i think that is so, i was working on this ealier with a co-worker and we’re trying to figure this out but we were given this
http://pastie.textmate.org/86037
that is supposedly how Drupal does it, but i don’t understand how they can get those function to work on input values
everytime we try it, no dice :/


Try warning out element.selectionStart

you mean just comment out the entire if statement ?

how to change background image with style ?
style. ?

I MEAN LEARN TO PROGRAM.

:/

Hi all. What does it mean if a variable begins with an @ symbol, ie var @47@ = ”;

is this valid ?
document.getElementById["underblog"].style.background = “http://www.101greatgoals.com/wp-content/themes/default/images/header_white.jpg“;

so warning out element.selectionStart and learn to program are == ? :P

ive never seen that before
its probably just somebody trying to be creative

@ is an illegal character in JS .. are you sure there’s no source filter before that gets to the browser?

I think I answered my own question. It’s a modifier that forces ‘by reference’. I didn’t realize javascript could have references.

Eh?
Where do you get that info from?
var @47@ = ”;

Error: Error: missing variable name at line 0: var @47@ = ”;

I should know this, but how do I pass a string literal to a function in an onclick (e.g. onclick=”function_name(“string”)”), the many quotes seem to be confusing the browser

Use different quotes or escape them.

alright

And remember you can’t escape quotes in HTML
Though you can (and should) encode them

Why can’t I use document.body[eventName] = function … in FireFox but it throws no error?

Woosta, I have 2 code samples that use this, one complicated one that works, one simple one that I just put together thats broken. I’ll see if I can figure out what the difference is…

Oh, yeah, attributes.

no, where did you get the info that it’s something to do with references?

It works just fine in IE 6 & 7, but it never binds it to a event call in FireFox

?

wll thank you for your GREAT advice
but i solved here
http://paste2.org/p/5626
*solved it

lost it… still looking…
doh… I misread the page I found. The code is being passed through a pre-processor, which is replacing the weird @ variables with dynamic names. It’s a silly form of code obfuscation (but apparently worked on me!)

figured it out, had to use window.addEventListener(eventName … in FireFox

#microformats
err
forgot the join

Does anyone here know much about IE 7? I’m trying to debug a script in it, and I am on a Mac. It’s causing me no end of pain. http://paste.lisp.org/display/45857
I’ve annotated that with the relevant HTML.
The problem is that it doesn’t even start showing anything, so I think I must be doing something wrong with onload?

how do i get document.getElementById(‘addGameButton’).value = “Hide Game”; to work in Firefox? or something that can get the same effect.

what the hell…

i am setting an opacity on a png image in ie6 with a png transparency fix, and it goes to 0 immediately..
i’m pretty sure it’s because of the fix

Hi!
why aint this working:
with (A) y=4;
document.write (A.y);
results in “undefined”.
shouldnt it be “4″ ????????????

“with (A) y=4;”?
var A.y = 4
maybe.

you dont know “with” ?
this works:
with (document) write (“hello”);

what is “with”?

with (A) this.y=4; maybe?

or… A.y = 4

It changes the object scope
A.y = 4; will work too :P

“undefined” again

in the line?
hmm

I’ve never actually used “with”

this works as well:
with (location) href=”http://www.heise.de“;
I dont get it, why “with (A) y=4;” is not working.

is A defined?

var A={};
with (A) this.y=4;
document.write (A.y);
thats the whole code. 3 lines.

{}
?
does “A.y = 4″ work?

yes

dont use with statement, it’s depriciated
deprecated

who says so?

it’s not deprecated
ur deprecated
Firefox 1.5 generates a warning when the ‘with’ statement is used: “deprecated with statement usage”. This has been removed in Firefox 1.5.0.1 (bug 322430).”

another question:
when I do this:
eval (“x=3;y=4″);

”ERROR: syntax error at (eval 212) line 2, at EOF

A is not an object then
……
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Referencetatements:with

x and y are now in the global scope. any way to make eval put stuff in a different scope?

…..

eval(“var x=3; var y=4;”) maybe?

”ERROR: syntax error at (eval 212) line 2, at EOF

yes, but I need to eval user-input that lacks the “var” thingies.
thats why i wanted to wrap WITH around it. but that doesnt work either…

eval(str.replace(/(\w\=\d/g, “var $1″) maybe?

”ERROR: 13163: Search pattern not terminated at (eval 212) line 1.

i’m not sure if = should be = or \=

Heh

only way is to prepend all declarations with the var-keyword.

Why the hell do you want to eval user input?

eval(‘x=13;y=33′);

why not?

33

It’s usually bad design..

that regexp will probably not correctly transform something like “apples=oranges*peas*packagesize+overhead”

umm
does anyone use mr. turnbull’s IE5.5+ PNG Alpha Fix v1.0RC4?

‘with’ isn’t technically deprecated, just practically deprecated. It’s a bad idea

mumpitz. the client is free to execute on his machine whatever he wants.

yes, that’s what i meant

then maybe do \w+ instead of \w?

yeah, that was for Agamemnus .. I figured you knew that :-D

well, i will probably be able to create a regex that works. i was just hoping to get around it.

I really think regex would be the easiest solution

yupp. will go that route,
..

Can anyone help me with my IE problem above?

what’s wrong with this ? ” if (event.propertyName != “src “) return; “

Trying to get any form of debugging working in IE is failing me.
bTrying to get any form of debugging working in IE is failing me./b

arcfide… how so

Well, I get “Runtime Exception” as the error, and then, I can’t start any debuggers.
I mean, this script isn’t that big, how could this be so hard?! :-(
I’m so annoyed at IE right now.

idk
restart ur IE/debugger/computer
but what the hell is wrong with my code?

I didn’t see your code.
Where is it?

In JavaScript do you only use == when its a string? and = if its a boolean?

= is assignment, == is comparison, regardless of its operands

why doesn’t this work?
if (event.propertyName == “src “) return;
or if (event.propertyName != “src “) return;

well im doing if(add == true) that dont work, but if i do if(add = true) then it does…

just doing alert(event.propertyName)…. works

What does that alert give?

if i change it to false, it no longer works so from what it looks it works properly with just =

if (add==true)…. do you have add and true defined?
it gives “src”

var add = php echo “‘$add’”;?;
to whatever $add is, at times its nothing at others its true

With or without the quotes?

what?
without the quotes…
if (event.propertyName != “src “) return;

What do you expect that to do:?
I mean, what are you trying to do?

I’ve got a question about the ‘new’ operator. Let’s say I do var foo = new bar();. is there some way to stop it from overwriting the object? like, return false in the initalize?

no there is not, new returns an object. always. throw an exception if you want to handle errors

hm.

i am starting to doubt about always though.

Well, what i’m trying to do is click an element, and it will create the object. But if it exists already, then I don’t want to create it.

does anyone have a code snippet to turn table cells into editable fields?
i don’t even need the reverse

using any libraries right now?

me?

yes

mootools
anyone?

How can I know if the client has JS blocked?

i don’t think you can

Your script won’t run.

I am doing an online quiz program which automatically logs out the user after 30 minutes.
I don’t want them to reset the timer or disable javascript.

do it on the server

load the page with JS

j4cbo, but how can I call script at that time?

you can’t. record the time the user starts the quiz
and then if they try to submit it and it’s been too long, refuse

well
you can use push
but only opera supports it, and i have no idea how to do it

all browsers support push to some degree, but it’s ass to do in any existing web framework (i’m actually writing my own for it), and really isn’t appropriate here
just make a counter in javascript, and if the user disables it, that’s their loss

Whats the firefox compatible way of making a divs display change?

hello, if I want POST data with XHR should i set Content-Type on xhr ?

does anyone know a good script for edit in place?

The same way as any other browser, .style.display = “newvalue”;

did, its not working
ill paste my code sec

Then you’re doing it wrongly.

document.getElementById(‘div1′).style.display = ‘none’;

http://pastebin.com/m37378759

I suspect it’s empty.
Your code doesn’t account for that, now does it?

i have div style=’display:none’

buttons values change ?

actually thats not the problem, firebug says that the .value one is (my bad)
yeah, they can well in IE atleast

http://pastebin.com/m2cdd5285
Ah
Hm
Sample page?

is there a way to get the selection length of an input string without setting up two functions ?

you get pm?

i dont think my selectionstart is being initialized correctly

There is no element with ID “addGameButton”

it has name=addGameButton

So?

makes it work fine with IE, lets see

Note “getElementByID”
ID
Not “name,” “ID”

picky picky :/

We have a separate function for that, document.getElementsByName().
It’s just stupid for gEBI() to return elements based on names.

ah…

Especially when that means it can return an array
I mean, how broken can you get?
s/array/collection/

still crashes :|

You didn’t read what I said
Also, you took it the wrong way
Hm
Actually, no, now you come to mention it that is easier.
But it’s getElementsByName()
Plural.

i do have that refresh lol

It now works
Kind of

yeah, they value of button dont change

You see how there’s an s in getElementsByName()?
That means it’s plural.
More than one element can have the same name.
Thus, getElementsByName() returns a collection.
As, again, I said above.
And I’ve been coding too long, my wrist is starting to ache

i tried adding the id tag to the button, didnt work, tried using singular of the getElement and didnt work either
it works now … -_-
thanks a bunch again

anyone know of a good tutorial/link to show how values about the selected text can be found from a textarea?
i know there is tinymce but my recquirements are very basic and i think somethign like that would be overkill

Welcome
The error console is very helpful

what does “values about the selected text” mean?
if you just want to know what text has been selected (i.e. highlighted) by the user, then there’s something like document.getSelection
and an IE equivalent that i cant remember
ah found it
inVINCEable667_:moz: document.getSelection, ie: document.selection

if (event.propertyName != “src “) return; …. is this valid javascript?

Yes
Although that’s no guarantee it’ll work

:-|
aight

What’s wrong with it?

finally got this working, “object required”

event doesn’t exist in anything except IE, use arguments[0] instead

i’m trying to fix IE5.5+ PNG Alpha Fix v1.0RC4 by mr. turnbull
the test in question is after the IE5.5/6 detection

Oh

the fix doesn’t work with varying opacity

But surely that’s the point of it.

I think it’s because it’s activated when properties of images/divs are changed
no, it only fixes transparency issues
otherwise if I set opacity, it goes to 0 immediately
so I say, if the name is not “src “, then return

Aye, probably

before that, it said:
if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) ||
(event && !/(background|src)/.test(event.propertyName))) return;

But wouldn’t it be “src” rather than “src “?

so now I add, “if (event.propertyName == “src “) return;”

Why would it be “src “?

i think actually it isn’t the problem anyway, and sometimes event is null

Ah

i had it do an alert of the event.propertyName
and it was src
then I did a test on “src” and it didn’t activate (if statement)

is there a way in javascript to add a character to the front of a position? for example i have the character position 21 and i would like to prepend a “T” to the front of that
is there a way to do that

so I added a space, and it did, but something still errored

without using a loop to go through every single
character

invinceable, sure

could i just please have the name of the function i can figure it out i searched google i just cant find it

it’s one of the string functions ..
string manipulation
hold on

i dont think sub_string or substr() would work either
normally i would be doing this with PHP on the backend but this has to be done before it gets to the backend :/

http://www.w3schools.com/jsref/jsref_obj_string.asp

str = str.substr(0, 21) + “T” + str.substr(21);

ugh ur 100000 steps ahead of me, Twey

wonderful ! ill try it right away
but im guessing i need to delete those out strings out of the document first, then perform that function, then write them back in so there is no repeat

?
OH!
I know what the problem is
last time i had a problem because a div enclosing an image in ie6 did not transfer its opacity to the image correctly when its own opacity was changed
(if it had transparency and opacity already).. the image’s transparent color became visible
but no, these images don’t have opacity already, or do they?
frustrating
does anyone know how “IE5.5+ PNG Alpha Fix v1.0RC4″ works?
I am looking at the code but it just don’t click
dammit!
2 bugs… 2 opposite solutions
this is bullshit, found another method but it breaks my code
they don’t respect the alpha channels
dammit

You should not apply other visual filters to the iamge with the PNG behavior because these other filters do not respect the alpha channels and the result will most likely not be satisfactory.

any ajax menus wich can be edited on the fly ?

Anyone using Sprout?
http://wiki.sproutit.com/core/

Haha, “Java Script”

eww .. scary

Gragh.
Namespacing prototypes in JS is so damn awkward.
Something like myObject.prototype = {someproperty: {f: prototypedObject}}
It’s virtually impossible to get a reference to the myObject instance from f or a method on it.

does anyone use YUI here?

Twey!
Still awake? o.O

Aye

hi, is there an alternative for createEventObject in firefox?

If there was, what would it do?

It creates an event object

AHhhh
*whack*

Hahaha
Seems perfectly self-explanatory to me :-p

How to replace “/n” in a string with “”

“testing/ntesting”.replace(“/n”,”")

testingtesting

\n not /n

should work in either case

“testing/ntesting/ntesting”.replace(“/n”,”")

testingtesting/ntesting

you want a g in there

“testing/ntesting/ntesting”.replace(/\/n/g”,”")

Error: Error: missing ) after argument list at line 0: “testing/ntesting/ntesting”.replace(/\/n/g”,”")

why g

i’m getting my slashes all mixed up

global replace
no, you’ve got an extra “

“testing/ntesting/ntesting”.replace(/\/n/g,”")

testingtestingtesting

“testing/ntesting/ntesting”.replace(/\/n/g,”")

testingtestingtesting

oh hehe

Let me try
i think it should be replace(“/\/n/g”,”") with double quotes for both

but it is always coming in single line between div

That would replace only one instance.

How to do that , will you help me ?

I think you mean str.replace(/\n/, “”)

If i enter in textarea with ‘Enter Key’ it is not coming on with multiple lines in div
str.replace(/\n/, “”) works fine, thank u

Is it possible to set .onfocus without describing it in the html tag?
Will it only be run once, or how do I set it?

on focus is run every time the element is focused

myelement.onfocus = function() { /* do stuff */ };

thankyou

any ideas how to create user definable menu ? ( to let him choose what to remove from actualy menu )

hi
how to run function when page load/render finish?

well there’s the document.onload event which you can define in either the body tag body onload=”callFunc()”
or you can define it dynamically
scriptdocument.onload = function () { doStuff } /script

scriptdostuff()/script

thank you a lot

hi, can anyone help me figure out why this doesnt work in ie?
http://dev.byron-adams.com/jquery/plugin/appendDom/

Hi
I have a list and the user can click an item to select it – I’d like to make it so that if I type “t” it will jump down to the T part of the list
Basically how most operating systems and browser drop downs work
Anyone have any hints/ideas for me?

can anyone tell me how to change ExecCommand(‘createlink’,true) so that the dialog asks not only for a URL but also for the text to display on the page

I’m not sure what ExecCommand is

natrap, you’d probally need to create your own dialog and insert the link via ExecCommand(‘inserthtml)

but if you want text to display on a page I’d look at innerHTML and appendChild

im guessing this for a document with designMode=on ?
whats a good way to time the execution of a function?

you know what i just saw its not needed. if i type the display text first and select it and then press insert link it does what i want

search for ticks I think

ticks?

Click.ticks
*Clock.ticks

grab a new Date() at the top, and another at the bottom. Subtract.
`benchmark

http://rick.measham.id.au/paste/benchmark.htm

^^ that’s how that works

woosta, thanks

how precise can that get?

Woosta, can i just use that tool asis? :P asin just insert some code into one of those textboxes?

yes
Date objects are microsecond precision

oh, well then that’s good
I wonder where/why I thought that Clock.ticks was a good idea
In any case, do you have any suggests for my find as you type question?

And when you run a thousand iterations and divide the sum of the results by 1000, you get nanosecond precision

hi anyone fam. with mootools here?

I have something like that somewhere IIRC

I don’t need code, just ideas

Good .. you can read my code and get all the ideas you need coz it doesn’t seem to be working any more for some reason
http://rick.measham.id.au/paste/typeAhead.htm
If you find the problem, let me know :-D
Ahh
it isn’t finished

hmm
I’d rather not have an input
my main problem is catching keystrokes without one

OK then I don’t 100% get it
You have a regular select and you want to scroll down it as people type?
Coz that happens already

http://www.tom-haynes.com/music

anyone think this is fast? http://dev.byron-adams.com/jquery/plugin/appendDom/ :P

looks like itunes, should act like itunes. focus a pane, type to select something fast
no forms at all

very nice trhaynes

ahhh
you want document.onkey(press|down|up)

ok cool
any way I can make the spacebar not scroll?

Then in that handler work out which ‘pane’ is focused and pass the event to a specialised handler
spacebar scroll .. ?
Ahh
sure
onkeydown = function(){ return false }
now no key will do what it normally does :-D

oh good

which will be annoying .. so check if it’s spacebar first

I’m all about messing up people’s expectations of their own computer

(and probably return true if event.ctrl)

yeah, I’ll be smart about it
I’m a little sore that I just lost ~30 minutes of work due to stupidity

you should split you theads from your tbody so that the headers stay in place when you scroll
30 is nothing
I’ve done weeks recently
It’s the ‘R’ in R&D :-D

I’m sorry
I was thinking about that, but how will the theads and tbodys be the same width?

that’s how they work

oh?
I can set different CSS positioning on each?

IIRC zofbot has a link to some tutorial on how to do it right
(in #html)

thead {position: absolute; top: 0;} tbody { overflow: auto;} or something
that’d be really cool

that will glitch in Opera

IIRC it was slightly more annoying than that

Comments off

Im struggling to make a query to find the active topics for a forum I have a table with the posts which I figure

It’s much better in some respects, because it actually works properly, i.e. you can do arbitrary sql host commands and they should worrrrrrrrrrrrrk

hehe

there is no perfect solution… Others store data on a SAN / NAS and just fire up the failover mysqld

I suppose you could do your own master-master by writing each thing to each db, and either for reading

omg

a thing to note with replication is that data corruption is not as dangerous as with shared storage solutions.

I would personally go with readonly replication with manual failover, depending on what your requirements are

so if your ibdata file breaks you might still have a reasonably good one on the slave.

mysql’s replication is only reliable one direction, but it is relatively low impact on performance

hm

and there are no guarantees in replication
(google offers some patches)

There are a number of problems with replication, particlarly the difficulty of checking the replicas are in sync
you can issue nondeterministic queries which will have different results on the slave, this is a problem

with master-slave replication i went fine most of the time

In practice it rarely happens
but you must have a way of monitoring it, otherwise you may not notice until you need to failover
5.1 row-based replication partially fixes it
i.e. makes it much *harder* to write SQL which replicates badly

until now this were only master-slave setups, this is the first time i want a master-master one

There are still some things you can do which break replication completely, like if a slave shuts down in the middle of a session which needs a temporary table

i don’t want to think such far *g*
perhaps i should describe the scenario of usage

You need to write guidelines for your developers and check existing code is replication-safe

i have a table with a datetime field. I want to extract all of the rows with a date of yesterday … what will the select query look like ?

NOW -1 DAY

0′), INTERVAL 1

if I do now -1 Day … that also finds elements in the last 24 hours … doesn’t it ?

hi i’m using mysql on win and instructions says to do “type openfire_mysql.sql | mysql [databaseName];” however it doesn’t pipe this we get an error

NOW(), INTERVAL -1 DAY

DATE_SUB(now(), INTERVAL 1 day)

the cluster is used for databasebackend to a configuration frontend for domain setups

The process tried to write to a nonexistent pipe.

for past 24 hours

pong

anyone?

Jabber server down? Or are they going to can me?

so possibly there can be many changes at the same time on the same table

um…. no one told you eh?
rough way to find out

Apparently…

try php mysql web hosting dbname the_file.sql

But I do not want the past 24 hours ..
For example, right now, I would want to return everything entry that has a date of 8/20/2007 …
nothing that had 8/21 or 8/19

ah finally, mysql 5.1

do you know how to do that

compiling on ec2 takes ages

progolferyo, what’s the column type? datetime or date?

Well, you have to consider what your priorities are. I’d go with master/slave – you can potentially read data from the slaves if you really want, or just use them for backup and failover

1) transaction safe, 2) fast

how can I reset a row so all columns have their default values?

nils_ solution with master-master only with one active for write access has the nice addon the failed master will be automatically resynct

Not necessarily

s/will/might

this is probably a relatively basic question, but for a boolean field what would I enter the data as?

At the very least, you should have some operational monitoring to check that the replication is up and running
And almost certainly to check the data integrity too, maybe not so often
If a slave is stopped e.g. to backup, you need to ensure that it starts again correctly

i think to check up and running the “seconds behind master” value is fine

and monitor them so they don’t get too far behind

i’m currently using nagios with mysql-replication check

Replication does not self-check, it can continue even when master and slave are wildly out of sync
the only case it will stop is if it gets an error

okay, if it gets too far behind my monitoring checks this

how do I import scheme into mysql db on win

what i cannot check is possibly if the data is really the same

datetime

hello, does anyone know how to install mysql 5 with version 4 compatibility? I install a packaged that recomipled version 5 of mysql and some of my other app’s cannot find libmysqlclient.so.14 anymore becuase it was removed
under gentoo

revdep-rebuild evilstrike

if the column type is datetime, what should the query look like?

interessting

Checking the data for being the same is difficult. I spent a long time constructing a script to check it. there are some others available too

in package: gentoolkit

Anyone know of a static query I can use that has a from clause
Like select 1, but with a from clause

It’s even harder for tables which don’t have a primary key

yeah im installing it at the moment

you still with me ? ? ?

DATE_SUB( DATE(field), INTERVAL 1 day) AND time DATE_ADD( DATE(field), INTERVAL 1 day)

Select * from (select 1 as one) d1

they all have a such

ahhh
awesome… thanks trix

you’re welcome

i appreciate it

the inner query has no from, so it will fail in this case

that should rebuild the dynamic links to the new mysql.so file

what are you trying to do? I can almost assure you that there is a different approach

yeah it seems to actually do what I need thats cool, i need it rebuilding the libmysqlclient that is nice, thx for the info

would be nice if you could drop me your script

how do I import scheme into mysql hosting db on win

‘field’ should be replaced with ‘time’ ?

Check if a connection is open, so I need some query to execute on most DBs which isn’t dependant on schema

yes, sorry.

hmm … but dont you need some kind of NOW() or CURDATE() in the query

select a timestamp

it has not from clause

so

SELECT NOW()…

progolf, whoops. yeah. replace ‘time’ with DATE(time) and then replace DATE(field) with NOW()

hsqldb give “invalid syntax”

this query returns every entry in my db //.

Well, I can’t do that very easily, it was developed commercially for my job
One easy but slow option is to select the entire contents of the tables on the master and slave (lock the master and wait for slave to catch up), and compare them, ordering by primary key
Unfortunately this approach is very inefficient, especially in terms of bandwidth if your slaves are remote

i didn’t say NOW()
you did

ok this now returns all records from today
but I want yesterday only

i understand no problem, i think you and nils_ helped me to get an overview over the possibilities – i will have to choose. but i think master-master is quite the same if second master doesnt get written as master-slave

what did you mean?

progolf, err.. WHERE DATE(time)=DATE(DATE_SUB( NOW(), INTERVAL 1 day))

sorry im back … any idea how to modify that for just yesterday

give that one a try.

WHERE DATE(time)=DATE(DATE_SUB( NOW(), INTERVAL 1 day)) ?
ewww

that is ugly

chad, welcome to the conversation.

NOW() – INTERVAL 1 DAY is a bit more readable
why the double conversion to DATE() ?
just use a BETWEEN and you should be fine

did that work, progolf?

yah that worked actually

putting a function on a field kills the use indexes

great

getting some major criticism … haha

yep and should especially be avoided when it isn’t needed

yeah, they didn’t read your scenario
ya cant argue with progress = )

haha, thanks trix

you’re welcome

hey trix, you ready for another tricky query ? i want to select all the rows from last sunday at 7pm until now

that’s the same query

i’ll let the optimizers take that one goin to grab some food, back in a bit

i just replace the interval 1 day with ? ..

take a piece of paper and try to find it out yourself
WEEKDAY() is the way to get the Sunday
TO_DAYS() might help to get the delta

Hey guys. I’ve got a backup sql file of a fairly big database. Can I import selected tables from it from the command line? I know how to do the whole dump, but I only need a few tables.

weigon … thanks for the rude yet inciteful suggestion

rude?

hehe

i just dont get some people

it was a very gentle push to think yourself

ok …

a piece of paper and a pen help a lot in such cases

yah i know … it was a bit sarcastic … you cant deny that ..

how can I combine weekday with the 7pm time though ?
weekday()

can anyone here give me some help with imagemagick?

in which way is this mysql related?

lol
i’m using a mysql db to reference the images uploaded by imagemagick

do you know how to get the date of last sunday?

no i am unclear about that
if I know that i can figure this out
can you point me in the right direction for that piece of data
last sunday at 7pm actually ..

one item at a time. How could you go about getting the date of last sunday?

hmm …

you know the date today, and you know dayofweek() will give you the day of the week as an integer. It’s simple subtraction from that point right?

yes

so getting the date is easy, and datetime format is yyyy-mm-dd hh:mm:ss so you know the end will be 19:00:00.
and you have the date

ok … let me assemble it

BETWEEN (the above product) AND NOW();

Hi! I’ve got a backup containing multiple .MYI and .MYD files. This is data from server 1. How may I “import” those files to server hosting 2’s files?

do you have the .frm?

yes

cp

copy them into a databases folder and issue a flush tables query

chown

wouldn’t that delete my old databases?

if you overwrite an existing table yes

mv

yep, mv. Or copy when the server is down.

The tables that server two has can’t still be there if I replace the existing files with those new files, can they?

to assemble the date, should I use makedate ?

the new files doesn’t contain any info about the old tables – just a new set

no

or which function to create the date?

I have a table with one way connections, a to_user and a from_user. I want to select any users which have BOTH a from_user AND a to_user connection, i.e. the connection is mutual… How do I do this?

Hello. http://pastebin.com/m3e805515 How can give parent id as start point to get data ?

because i already have the time … so i need to combine the time with the date

if you coalesce(field1,field2) AS c will it return NULL for c?
or not set c?
(c would not be in the result set)

select coalesce(NULL, NULL) as c;
if field1, field2 are both NULL then c is NULL

I might not really get it. But I must say that it feels like all old tables will be gone when I do replace them with server 2’s data.

so what if you coalesce(t1.field, t2.field) would field be NULL if both are NULL ?

yup

(so AS is not necessary to return a NULL)
ok

if you overwrite anything then yes it will be gone. You can rename the directories if you wish, though.

i looked on the manual, but found no way to GRANT a priv for a user on all databases starting with something such as “monkey_”
i.e. monkey_1, monkey_baboon, etc…

there is no such thing as far as I know.

oh, so phpmyadmin is magical then… thanks anyway

% is the wildcard you are looking for

i tried GRANT stuff ON monkey%.*, or ‘monkey%’.*, but it didn’t like it

why do you havea percent sign?

nope… there is a wildcard, I just forgot

0 AND NOW() … the results are

no quotes ?

yah quotes …

0′ AND

well i have the logic inbetween … i dont have the date formulas …

‘monkey_%’.*

if I add quotes outside of the logic … then everything is returned to me
time BETWEEN ‘(INTERVAL 19 HOUR + DATE(DATE_SUB( NOW(), INTERVAL (WEEKDAY(NOW())+1) day)))’ AND NOW()

Whoa

lol
it actually prints out the correct date … but just the results are wrong

it complains about bad syntax that way. also bad syn for ‘monkey_%.*’

Show the grant?
Or was it `monkey_%`…

5 [ERROR] /usr/local/libexec/mysqld: Can’t find file: ‘./mysql/host.frm’ (errno:
How can I tell mysqld_safe where the file is?

!perror 13

Permission denied

you need to chown your files
(in the datadir)

even if I have: WHERE time BETWEEN ‘2007-08-19 19-00-00′ AND NOW()
it prints out the wrong results …

Thanks!

it leaves out all the results with the date 2007-08-19

19-00-00?
19:00:00

hmm … i got it
mispelling or something

hi all! By default, MySQL creates tables of type MyISAM. Can I tell it to, by default, create tables of type NDBCLUSTER?

you sure can

What about SELECT queries during a transaction?

SettlerX what about them?
Bentley –default-storage-engine=blah

can i execute SELECT queries when autocommit = off and get their results instantly?

ebergen, I could kiss you!

no idea what you expect, but I would say: yes
yes

Bentley please don’t

hi shrews!

Hey Baron. Heard you met with Tom recently.

ebergen, i won’t – thanks!

for example i start a transaction. However, i want to get some values from database (before i commit transaction). Will it work?

Yes, he met me for supper with his son Thomas in DC

SettlerX yup

cool. super nice guy.

Why is this silly xchat client signing me in with an underscore after my name???? Bah. Yes, he’s very nice. Are you in his team now?

yep

xchat does that to me too

good for you shrews! I have to go right now… was just signing in (on a new computer) to make sure I got things set up right, which I don’t apparently. Hello all, goodbye all, see you soon in NYC??

you should be using Colloquy! xchat on macs sucks

I’m not on a mac

I’m struggling to make a query to find the active topics for a forum. I have a table with the posts which I figure I have to sort by the time they were posted, but how can I manage to join this with the table with the topics and have the sorting preserved throught a GROUP BY? .. or is there
some more logical way of doing it I’ve missed?

but I do use xchat-aqua on my mac

i assumed you were on your laptop

na
when os x comes out with multiple desktops and keyboard shortcuts for them that work I’ll probably start docking my mac

maybe with Leopard

leopard is getting spaces
I hope they don’t suck

!tell userman about groupwise max

userman http://jan.kneschke.de/projects/mysql/groupwise-max/ http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html

you missed a good time last week. jeremy taught me how to use chopsticks (sort of)

haha

i prefer to use the skewer
single pointy stick beats two dull ones

typically the only food you eat with a weapon is steak

litheum failed in his attempt to teach me

that is lies
you were too stubborn to pay attention

stubborn == drunk ?

haha

and too caught up in thinking that you were being inventive by mauling your delicately prepared food with a spear!

hogwash!
American ingenuity, man

Shrews where are you from?

wait for it….
…. wait for it……

still waiting

NC

they’re a bit slow where he’s from

haha

damn west coasters

hey if I can use chopsticks anyone can
I’m from idaho

we like our fish fried on this side

hi

wrapped up in tinfoil with bacon or smoked where I come from

i need help
i have installed mysql 5 with 23mb installer

idaho, huh?

yup

nice
which part?

south east

ah

does idaho have “parts”. all the same

yeah, it sure does

parts
it’s all one state but there are parts

seen one potato, ya’ seen ‘em all

we’re way too lazy to split it up into separate states

i bet most states have significantly different regions

yeah

time for dinner. goodnight

bye

see ya

idaho is either desert or trees
or mountains
great fishing though

hi sfannan

Can I update fields in 2 tables in 1 query? Probably yes but i want to make sure.

yes
update supports the same join syntax as select

sfannan, did you get that SQL solved?

do you know how is it in SQLite?

no
this isn’t #sqlite

is there something like, configuring the maximum data I can send through my connection to the database?

not really
why would you want to do that?

actually I dont want it, but when I store a picture in a blob column, if it is big, I see half of it
so, somewhere it stops accepting data I think

max_packet but dont do that
images

http://hashmysql.org/index.php?title=Storing_files_in_the_database

I think he’s using a smaller blob column
And getting truncated

max_allowed_packet won’t store half an image it will just error
I’m with seekwill on this

maybe it stores all, but only send half because of some connection based limitation?

not likely

It’s REALLY hard to do something like that without knowing

if you can put it in you can get it out

which JOIN should i use in UPDATE query? Left join? Inner?

SettlerX go learn about the join types

so?
umm
the_wench, ok, maybe not storing files will save my problem

How can i save field value to php mysql web hosting variable?
Select field From ….
@var = field ?

:=
= is for comparison…

MauL^, just store location of the file, but as the others said what blob type are you using

ok, :=

naughty boy

yeah well it’s for blob streaming tests

trying the MyBS engine

yeah naughty me.

How is it with getting last inserted ID before committing transaction?

how do you reset the auto increment number?

read the ALTER TABLE man page
!man alter tab

see http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

hallo

hallo blue_n

what

lol

hehe

that was great

hi !
i can’t access to my mysql function in my script
Function registration failed – duplicate name – mysql_connect in Unknown on line 0
Function registration failed – duplicate name – mysql_pconnect in Unknown on line 0
etc……same error for all the function in my apache log
mysql: Unable to register functions, unable to load in Unknown on line 0
Somebody can help me ?
i use apache2 on debian testing with php5

you seem to load the module twice…

nickm__, ok
thanks

hi..i need to convert a MSSQL database host file to mysql..anyone know if there is a tool for conversion ?

yes

besides using SQL server?

yesi don´t have a live sql hosting sever

if you have one, you can use the MySQL Migration Toolkit

yes but unfortunatley i don´t have access to mssql server
and i don´t think there is a port for linux

then get them to dump the db in a textual form
hmm is it worth someone writing a MS text schema to .sql converter

how can i “SELECT * FROM user_info WHERE another_table.active = “enabled”"? Do I need to learn JOIN in order to query two tables?

bkeating, you need to do something like FROM user_info JOIN another_table ON user_info.userid=another_table.userid.
I assume the second table is something that contains activity status for each user.
If it’s more like another_table has only one row, then do a separate query, or a subquery.

yes. and I think i solved it now, thanks to your help

SELECT first_name, last_name FROM user_subscriptions JOIN zua_user_flags ON user_subscriptions.user_id = zua_user_flags.iduser WHERE zua_user_flags.value = ‘on’;

That looks right.

seems to work right

that’s a nice clean inner join.

“sum(length(sequenz)-length(replace(sequenz,”%s”,”")))/sum(length(sequenz))”. It works, but only with limited accuracy: A=0.08. Is there a way to increase it so I can see if its 0.08111 or 0.78999 ??

join #linux-ha

the %s should be eg the letter ‘A’,

Is there a way to increment a key? I want to do something like UPDATE table schedule WHERE schedule_id = 10 SET schedule_id ( 1 + whatever it was before )… That way I could insert a new item at schedule_id 10. Do I have to do 1 UPDATE for each row I want to change in this way?

…ok multiplying by 100 improves it, but well….

update will work, but careful of references in other table
!m StevosICBM_ update

StevosICBM_ see http://dev.mysql.com/doc/refman/5.0/en/update.html

ah thanks

How can I specify this calculation to be returned with double precision?

multiply by 100? ?? * 100.0
ops, no
multiply by 100? ?? * 100e0

I tried multiplying, it helped a bit, but why can’t it use double somehow?

AS DOUBLE)

100 is an integer, if integer * integer, it always return integer
100e0 is a double

but I multiplied it to the fraction

what fraction?

trying…
the fraction of occurence_of_letter_A in all rows of a field / total letters in there

int / int , not sure what this returns, is it int or double?

Hello friends
I need some help

the casting doesnt work
you mean cast(sum(length(sequenz)-length(replace(sequenz,”%s”,”")))/sum(length(sequenz)) as double) ?
it doesnt work.

hi wilfred_com, how’s it going?

ask

“I have a question”, Don’t ask: “Is anyone around?” or “Can anyone help?”. Just Ask The Question. Also, please read: http://workaround.org/moin/GettingHelpOnIrc

that returns an integer then cast

no, cast the source fields as DOUBLE, if they were INT

cast the first int cast( ) /

casting the end result will have no effect.

Ups, sorry

cast(sum(length(sequenz)-length(replace(sequenz,”%s”,”"))) as double)/sum(length(sequenz))

cast a single value

again, you’re casting the end result.
cast the source fields.

Are there any form to restore de info from an .ibd file?

(1064, “You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘double)/sum(length(sequenz)),cast(sum(length(sequenz)-length(re”)

alright seems like MyBS can’t handle concurrent connections

I see (i think)

start simple.
don’t try to write the whole query in one shot.

you mean sum(cast(length(sequenz) as double)-length(replace(sequenz,”%s”,”")))/sum(length(sequenz)), but it also gives the same error

no, I mean start simple.
select CAST(`field` AS DOUBLE)

is cast even supported in mysql4?

then add one iteration at a time.

update schedule SET schedule_id = schedule_id+1 WHERE schedule_id = 43;

but length returns integer

it is. Write your query from the simplest form first.

Duplicate entry ‘44′ for key 1, and then doesn’t do the update.

but the fields contain strings.
I have to cast length somehow…

you can’t convert varchar to DOUBLE or DECIMAL

cast the result of length should be fine

I have no idea why but in some moment one table in my BD isn’t listed, and looking in syslog say a messagge that mysql can’t rename the table #sql**** to the original table

anyone know how to get around this duplicate entry stuff?

this also doesnt work: select cast(length(sequence) as double) from fasta;

what is the problem, error , or result not double

error

!man41 cast

see http://dev.mysql.com/doc/refman/4.1/en/cast-functions.html

… near ‘double) from fasta’ at line 1

used singed or unsigned, double not recognised

yeah, I guess..

I shutdown the server and rename the two files (.frm and .ibd) from de Operating System and start mysql again but mysql says that the table doesn’t exists

now I have “cast(sum(length(sequenz)-length(replace(sequenz,”%s”,”"))) as unsigned)/cast(sum(length(sequenz)) as unsigned)” and it works without error, but the accuracy is the same.
that’s integer anyway..

try int * 1e0 / int
or int / int * 1e0
maybe unsigned is considered as int

it the same
it’s

what is the result like? any e or any decimal point?
cast to unsigned could still be considered as int

A: 0.08, C: 0.02, D: 0.05, E: 0.07, F: 0.04, G: 0.07, H: 0.03, I: 0.04, K: 0.05, L: 0.09, M: 0.02, N: 0.04, P: 0.05, Q: 0.04, R: 0.07, S: 0.08, T: 0.06, V: 0.08, W: 0.01, Y: 0.03

try the * 1e0

tried.

ok, that means it work

8.27, C: 2.29, D: 5.04, E: 6.96, F: 3.66, G: 6.56, H: 2.51, I: 4.05, K: 4.74, L: 9.47, M: 2.34, N: 3.67, P: 4.82, Q: 3.82, R: 6.93, S: 7.95, T: 5.76, V: 7.50, W: 1.10, Y: 2.54

ok, somwhow fixed to 2 decimals now
try 1e0 ?

yes
it doesnt help…

try select 1 * 1e0 / 3;

I could multiply by 10000 and then divide back when I doing the rest of the calculations in python, but its strange..
works

if that works, yours should work the same too

but 1e0*sum(length(sequenz)-length(replace(sequenz,”%s”,”")))/sum(length(sequenz))*1e0′ doesnt work
maybe more of ‘em
nope…
cool, “1e0*sum(1e0*length(sequenz)-1e0*length(replace(sequenz,”%s”,”")))/1e0*sum(1e0*length(sequenz))” works now!
maybe I can remove some now…

is there an easy way to do a sed operation on an entire table? like s//\n/g ?
without querying and updating every single record

!m tetsleep replace

tetsleep see http://dev.mysql.com/doc/refman/5.0/en/replace.html

huzaah there is!

Does anybody why mysql keeps increasing memory usage, even though I am not using it that often?

ok, “sum(length(sequenz)-length(replace(sequenz,”%s”,”")))/1e0*sum(length(sequenz))” is enough! hurray!

i think you want
!man string-functions

see http://dev.mysql.com/doc/refman/5.0/en/string-functions.html

thats a different replace

thanks! I tought I tried that before… but…

ops replace always give this 2 meaning problem

Hey. Is there a channel where I can ask questions about mysql++, or is this the proper channel?

here is as good as any

sorry, it doesn’t work, I just forgot a parantese..

what version?

I am trying to access a database with the use of specialised sql structures. My problem is the call to sql_create_#(…), I don’t know what type to list for an enum field in the database I want to access

4.0.24_Debian-10sarge2

try 1.0 instead of 1e0

What is the best table sorting .js, most compatible and faster ?

this is sql channel, we use ORDER BY

tried. still the same

alwasy get 2 decimals?

yes

sry, I should have mentioned that I’m writing a c++ program to access a database with mysql++ library

kimseong i know how to do it in sql
but its not good to refresh the whole site

try show variables like ‘div%’;
then ask in web related channel

Empty set (0.01 sec) ?

is there a js channel? or whatever you use for your website
there is an option in 5.0 that specify the precision for div

so what can I do? I only have 4.0 on that server where I need to perform that calculation
and I really need more precision, or the error will be huge after what has to be done with these values

select 1 / 3, 1.0 / 3 , 1e0 / 3;
you see different result

yes, 3 different

1e0 gives you the longest decimals
so that is the best hosting for you

could it be because I am doing this though MySQLdb in python
?

cannot be

Does anybody why mysql keeps increasing memory usage, even though I am not using it that often?

argh, sorry! I was the problem, I’m just too tired… I was outputting it as %2.2f
now I SEE the effect of 1e0 as compared to 1.0 (or nothing at all), thanks for that advice with 1e0, it works!!!
cool the total is 0.999866900823
before it was 1.01
or something equaly bad
oh 1.02 even!

Store Google maps, fully zoomable and scrollable, in database text fields, without any api references. This will have great business applications. http://google-latlong.blogspot.com/2007/08/youtube-style-embeddable-maps_21.html

Hello friends any of you knows a method to restore the information from an .ibd file?

wilfred, innodb is so messy when trying to recover. I changed everything back to myisam again :-(

I see
Is so bad
I’m many troubles with this

very bad indeed. a 15GB idb was damaged during a disk failure :-( my backup was 2 weeks old…

But the case is my entire companie’s mail is in that ibd file

the only problem with myisam is concurrent updates – that’s why i moved to innodb initially.
you can try to start mysql with the recovery parameters. look in the documentation. didn’t work for me back then.

All the day i’m tryng every in the help but noting
Try to create another table with the same structure and rename the .ibd file to that table but nothing
I’m desperate, my job depends of that

you work for someone who would fire you over a hard disk failure? Life is too short, get another job.

Uh, a hard disk failure shouldn’t cause you to lose data. Not if you’re using RAID and backups.
With no offense to the unfortunate individual asking for help.

innodb cannot rename the physical file

alter table `myTable` modify `column` date not null curdate(); – whats wrong with this?

Defaults can’t be the results of functions, last I heard.

accurate.

is there a way to get around this?

timestamp

alter table `myTable` modify `column` timestamp not null; ?

!tell xange about timestamp

xange The DEFAULT clause specifies a default value for a column. With one exception, the default value must be a constant; it cannot be a function or an expression. This means, for example, that you cannot set the default for a date column to be the value of a function such as NOW() or
CURRENT_DATE. The exception is that you can specify CURRENT_TIMESTAMP as the default for a TIMESTAMP column. See Section 11.3.1.1, TIMESTAMP Pro

thanks

be aware that timestamp will be updated if you update the row.

so mysql on my server is lifo as far as data goes
but on my friends server it seems to be fifo
is there a config setting for this somewhere?
I believe I’m doing a select * from blah limit 1

there is no guaranteed order unless you use an ORDER BY statement

ok
is there anything internal I can use
or do I need to add a date field

once you start adding and deleting data from the database, there is no way to guarantee the order of storage. You need to use order by to control your result sets.

like created_on

you will need to do it yourself

ok thanks

what’s that command called — I want to “dump” a whole database, all the data, in a format that I can use as a query to recreate it on another server

is there no longer a mysql-max package?

backup.sql

then ‘mysql -uroot -p new_db backup.sql

ahh, great, thanks!

you should read the manual on mysqldump so you can see options, charsets etc.

ahh, got it. interesting … I had to reorder the inserts, because it didn’t order them in compliance with my constraints can’t expect *everything* !

hey ppls, if i had a table with a single column with 10 rows each with a digit 1 through to 10, and i wanted to do a SELECT on all of them but return an 11th row that wasnt stored in the table (to satisfy the client SELECTING from the table), what would be the best option?
basically, to append an additional row that doesnt exist

UNION

ah
thats what im after :P
i knew there was something, just coudlnt put my finger on it :P
woot got it
thx again

http://www.pennergame.de/ref.php?uid=3954

http://rafb.net/p/KIiqls22.html — given that the first query is the same as the second with an outer join added to it, shouldnt they both yeild the same result set?
the first gives me 0 rows whereas the second gives me 2 (which is correct in this case)

What’s the mysql command line to dump all data in a .sql backup into a db on the server?

mysqldump

http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html

wow…fast response, thanks!

erm mysqldump dumps from the database INTO a file

mysql

if a table is locked for write, should a select still block for a long time ?

write will block select

I’m not sure how to use mysqldump…
threw the command line
I tried doing mysqldump –help
but nothing

dump is for export, for import use mysql

I’m wanting to take a .sql back up of some database that I backed up from a totally different location and throw it all into a db on the new server.
Not sure what steps to take

mysql -u user -p -h host the_mysqL-dump_file.sql

wow we’re still on this topic

backup.sql ; get backup.sql to the other box; create the DB and user on the other box; mysql -uuser -p backup.sql

type mysql and hit tab a few times

better, mysqldump … | mysql …
mysqladmin debug and check the error log

is that really better or just shorter….?

short is good

lol

hmm. this app keeps queuing locks for the table, all of which I think are waiting on the update \ insert lock of another process

cause me I like to do things the hard way

mysqldump -uuser -p database | nc -lp 9000; … nc host 9000 | mysql -uuser -p database

argh

tetsleep, nice

shorter and no need space for the file

psilo, that’s how i do all my backups.

memory

as will I, now

excellent.

you keep netcat listening all the time on the remote server?

lets say I want to put “ckill\php_db_backup.sql” and put it into mysql db “ren2007bb”. What would the syntax be? I can’t get it to work

it send over once created, just a small memory buffer, even to file also need the buffer

mysql -uuser -p ren2007bb ckill\php_db_backup.sql

cool
thanks tetsleep

if that works in windows
i dont even know how mysql works in windows

yea………. ……. …… anyway i was just being difficult
man i am feeling old.
the big 2 decades

it’s all downhill from here, chad. I’m 24 :[

ah who highlighted me?
oh it was to chadmaynard
tab complete please... use it

uh ok

we just like to highlight you randomly cythrawll
it's how we keep busy

How to get the latest entry of something inserted in MySQL with SELECT?

SELECT ... ORDER BY id DESC LIMIT 1

I think if mysql gets restarted it will fill in holes in an autoincrement id column
so that would break

ahh
MySQL Command Line Client, do i run mysql -uuser -p ren2007bb ckill\php_db_backup.sql . Windows 2003 server
mysql -uren2007 -p ren2007bb ckill\php_db_backup.sql
I can't get nothing to work

does windows have a redirector, news to me ( but I don't know much )

Thanks seekwill.

you can redirect stdout to a file in the command shell
i don't know about redirecting stdin
you can try a pipe instead
type foo.sql | mysql.....
or is it print, something like that, it's not cat.

On windows will output it to file and current output
will output to file only

you mean
'type' on windows

:P

weird name for it

mysql will never "fill in the holes" in auto_increment

the old version of isam engine will

which is still in release if you have version 3.23....

i just tested, even isam does no reuse

Is there a way to force it to? O.o

it will reuse them if they are no ids higher though

yes

why would you?

For exactly that reason (no higher ids)
What is the highest ID?
Or does that depend on the type you assigned the field?

depends on the datatype

:O... Firefox just crashed.. yay

you can insert values into the table manually to fill them in but If it's a PK i wouldn't reuse any values

Yeah, INT should be fine ^_^

maybe can use a before insert trigger to find an unsed number and force it
it will be slow though

seems worthless to me though. I can't think of a good reason

Bah, too much overhead
If its really that important, then write a script to manually shift them all down

again, if they are used inside your application structure that can be difficult
seekwill--

I don't know MySQL, but was given some pretty cumbersome MySQL code with which to work. I am trying to turn this: INSERT INTO foo(bar, baz, ...) VALUES ('barval', 'bazval', ...) into something which just has bar = 'barval' and baz = 'bazval'

So I took a little nap...

me too

Which is why you'd want to create a script to do it... especially if you use the IDs to relate to other tables... you'd have to make sure it works without a hitch

there are around 25 values, so lining up "the thirteenth key with the thirteenth value" is rather painful

that's the SQL syntax for inserting a new record

jp-: so no way around the difficulty correlating keys and values ?

the other option is to create a record and use it's key to do an update afterwards, might be more readable but it's another operation that has to be completed.

okay

INSERT INTO user SET foo = 'bar', foo2='bar2';

NEVER!

sorry there foo

Just kidding

lol

does that actually work ?

nope. I just like posting faulty sql

You don't need to line up the 13 rows... if you only need to insert say a username.. then just tell it so

I am creating a new record, I just was hoping for readable code

that insert might just work

Whats unreadable about it? :p

25 keys followed by 25 values

i've never seen but i'm not gonna say it won't work

Do you need to insert all 25 values?

!man insert

see http://dev.mysql.com/doc/refman/5.0/en/insert.html

no one believe me.

I have no idea, just using the code the person doing the database gave me. I'm doing the PHP stuff

Just to let you all know!
INSERT INTO Member_data
SET Username = 'bar',
Pass_perm = 'bar2'
That works fine

that syntax he gave works Samus_Aran, according to the manual

Sorry about the way PhpMyAdmin displays it
But chadmaynard... it works

no shit?

in that case I can do that, one entry per line, and have it very readable. thank you, will give ti a try
*it

4 (Query took 0.0003 sec)
Yup yup =]

botsmack

The_wench slaps chadmaynard around the head

stop that

I have two machines, one front-end (fe1) and one database (db1). When I try to connect to db1 the authentication attempts stack (according to SHOW PROCESSLIST), making each connection attempt take longer than the last. Is there any way to avoid this?

show processlist? are you looking at the idle time?

how can I use lock tables?
for transactions

!m zed_ lock tables

zed_ see http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html

:P ok

kimseong is all up on the_wench tonight

I have to say, MySQL is suprising me more as I need it more..

Yeah.
So, for example..
I have a php script which does nothing but connect to the MySQL database.

I was talking with another dev about how being able to dump with a where condition

hello, I am having trouble renaming a column. The command alter table group_member change community `group` bigint(10) not null;, which is giving me the error ERROR 1025 (HY000): Error on rename of ‘./maharausability/#sql-3576_110′ to ‘./maharausability/group_member’ (errno: 150)

And low and behold… MySQL delivers!

http://paste.dollyfish.net.nz/37e0a1

it means your php did not disconnect

^^^ is the definition of the table currently

!perror 150

Foreign key constraint is incorrectly formed

Hrm.

1025?
!perror 1025
Guess not :s

so I can’t rename a column that is part of a primary key then?

only connected session will show in processlist

Right, but the state is this:

what version of MySQL?

waawaamilk, try a repair on the database first

nothing to do with pk, but a foreign key elsewhere

on the table even

5.0.32

16871 | unauthenticated user | X.X.X.X:35482 | NULL | Connect | | login | NULL
So it’s the “login” step that’s taking the time.

that is connecting

#facebook
test what I said there

hmm. found something in show engine innodb status
http://paste.dollyfish.net.nz/b70358
le-strange

shouldn’t you have two columns in that FK constraint?
if they’re part of one primary key, I mean

um

oh wait, no\

thanks for the help. I assume it works, but can’t test it .. they forgot to give me the database username/password/db name

so, that’s one of two FK constraints on that table of two primary keys

goodnight

sleep tight Samus_Aran

can I get a dump of the constraints somehow?
I have them in postgres and xmldb form :P
Foreign-key constraints: “mahara_groumemb_gro_fk” FOREIGN KEY (“group”) REFERENCES mahara_group(id) “mahara_groumemb_mem_fk” FOREIGN KEY (member) REFERENCES mahara_usr(id)
gaah
http://paste.dollyfish.net.nz/69b911
so yes, there’s one constraint on ‘member’, and one o the ‘community’ column which I wish to rename to ‘group’

the table names are different waawaamilk, mahara_group vs group

yes, the postgres db is using a prefix
that’s where I got the fk dump from

oh right

hmmmm
in the table it references, the default is NULL
whereas there is no default for the group_member table
perhaps this is the problem

unique columns shouldn’t be nullable…

le-grrr
I wonder if xmldb is pissing on my database again
hmm, I think it might be. The default is NULL for a whole raft of such columns

when i have two mysql servers master/slave configuration. if the slave looses a connection for an extended period of time (say 1hr)(due to a server shutdown) does when mysql starts again on the slave it just gets all changes since it was last up?

unless you delete logs on the master

which would be stupid to do so i wont be doing that

the documentation is strangely silent… can you drop a constraint on a table in mysql 5?

hi to all

Hi

turns out I need drop foreign key, not drop constraint

Can someone point me to a guide on how to do a binary copy of a database’s data files and get another server to attach the database? I need to pull a database off a dead machine’s drive, but despite copying it to /var/lib/mysql/database_name, and having it show up with “show databases;” and
display tables with “show tables;”, I can’t dump with mysqldump.

hi there, I’m having no joy with date conversion..
I can get this far, but I can;t get the time to work! can anyone help..
2′, ‘%d/%m/%Y
dies whenever Itry and put the time in..
I can’t find a reference anywhere for the valid dateformat tokens…
narrowed it down
I jsut can’t get the minute..

try to find out what your sql backend is (openoffice base it is hsqlbd) and then search the right api.
not all *sql* functions work in a different definition of sql
i.e: my sql, mssql, hsqldb, etc.
Might also want to try to have a ; between the date and time instead of a space.
(makes it easier for the system to distinct them)

fooo-nix thanks

np, but remember, I am a sql new being two.
(two, where I am sorry, I may not imply you are)
There probably is a tokenizer in the sql that won’t parse spaces, whilst it is expecting a space, it is getting a :.
(ignores the space, gets 12 in stead of space, yes, that will happen.

foo-nix. I appreciate your help, but I don’t think you’re right. that function str_to_date expects a format for it to parse
the point of the function is that it can understand dates that are not formatted in a specific way

Have you tried the ; thing?

What is the error?

as long as you proved thedate format.
it works but I can’t find the token for minutes
that’s all
I don’t need them, but it would be nice to know for future

foo-nix: ; is the standard terminator symbol.. I don’t think that will help

e.g. %d is day %H is hour
what the hell is minute? :-)

Ahh

It’s not %M..

Wel maybe a ,

Minute I think is n

as I say it don’t need it..
clearly

try %n or %nn

foo-nix. I appreciate your help, but you’re misudnerstanding.
the point of this function is to parse irregular date formats
so saying things like, it needs a space, or semicolon,

I will shut it then

well I aprreciate your being helpful, but it doesn’t make sense :-)
don’t shut it, thanks for helping

or even %i
Try %i

I get the point, Ilike I said, I am a new being.

and now youve learned something too.: str_to_date lets you specify the formatting…
so we are all learning. YAY!
Thecks %i.. okay

huraay!

spot on!

=P

where did you find that? I searched for a good 10 mins!

I use hsqldb, it uses java, and therefore the java tokenizer, which is often very confusing when spaces are included. (A space is no token for that tokenizer)

Its the time format for PHP

right.. wellt here we go! thanks Thecks

%nn popped to mind for some reason, then I thought PHP and %i
No prob

I am BACK!

foo-nix, I’m typing sql directly into sqlyog, the language I’ll ultimately use this query in is irrelevant, I’m afraid. mysql is a db in it’s own right, not just php/java’s slave :p

PLEASE welcome me!

Wecome winwinwin

infrid good!

please, feel welcome (I mean, wtf?) :P

f00-nix

Ping?

IT IS foo-nix: YOU NASTY PERSON!
:P

slumming?

how can I add mysqld_safe to startup in freebsd6

Is there a startup script somewhere? /etc/init.d/mysqld ?

f00-nix

no

How did you install it?

i installed from freebsd ports
make config, make make install i belive

I’m fairly certain it has a startup script.
freebsd

its not in rc.d

how about mysql-server ?
find / -name ‘mysql-server’

. /usr/local/etc/rc.d/mysql-server
there it is

Question, if i wanna Query my DB and return 1 value (the ID number from the last entry) is this a good way of doing it SELECT id FROM tbl_shipping ORDER BY id LIMIT 1; only thing i dont know is how to order them opposite to what they are so the latest number is @ row 1 so itll work, any
help?

ORDER BY id DESC
ORDER BY id DESC LIMIT 1

thanks

wrong
SELECT_LAST_INSERT_ID() is probably waht you want

That’s only if you just inserted the row.

max() ?

im going to assume thats what he just did

That’s a bad assumption. You probably should mention that.

that or hes trying to implement auto_increment manually

should have …
Or maybe he just wants the “most recent entry”?

assume a forum db, the most recent post (including edits) may not necessarily be the last ID in the table
but we will see what Giddion55 says
what are you using htis id for?

Let’s just assume we shouldn’t assume?

If i have a table A and a table B both of which contain fields ‘id’ is there a way to select all the id’s from A that don’t appear in B?

a not in b

SELECT a.* FROM a LEFT JOIN b ON a.id = b.id WHERE b.id IS NULL;

Hi!

table1 & table2. Table1 has fewer fields. Table2 additional fields and many records. I would like to copy all the data (and additional fields) to table1. Is there a query I can use to do this? :P

mysql_connect() [function.mysql-connect]: Lost connection to MySQL server during query in /home/mydomain/public_html/myfile.php on line 20″
Is there a way to fix that?

No, but you have to investigate why the connection gets broken. Could be mysqld crash among others

oh
not my server, so I don’t have the tools I need.

haven’t seen you ’round in a while.

INSERT INTO new_table (col1, col2 … colN) SELECT * FROM old_table;
Provide a list of common columns only.

I was afraid of that. I have too many cols…

StevenBao! Woah..
That was really a long time ago

yeah.

Where is the mysql password hash physically stored?

In user.MYD

and by default it’s only viewable by root?

It’s viewable by any user that has access to that table
Default, yes

thanks.

Anyone know of a place to get precompiled windows binaries with the “microsecond patch” (http://www.mysqlperformanceblog.com/2006/09/06/slow-query-log-analyzes-tools/)?

Hmm I seem to have a table that got locked and then for some reason never unlocked
What are my options heh

Problem solved, seemed like I provided the wrong connection settings.

you want it unlocked?

yeah
It’s hangin’ my scripts!

When I get result from UNION query, will I have different columns in one query’s rows and the second’s rows?

do you hvae any idea _why_ these tables got locked?

no, not allowed

col2, col3, col4; Table 2: col5, col10 – and i get one row from table 1 and after UNION – table 2
so? isn’t possible?

yes, my code dide it.

like, having a mysqldump running ?
usually you only can unlock tables in the same thread as you locked them

but I guess it crashed

http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html
an “unlock tables” could do the trick

tried
But like you said, from a different thread.
The original locking thread is long gone
Thinking about just restarting mysqld
hehe.. I have some windows in my blood I guess.
right. think of it as one query, in a way
one query can only have one set of columns

3´ó¼ºÃ

some people are too eager to leave the channel, without waiting for full answers. why not leave the client connected, to see if anyone has anything to add after a few minutes?

Simple inexperience with IRC is my guess
They don’t realize IRC crawwwlllsss
and sometimes the perfect solution comes hours later

they seem to expect everyone to have 100% of their attention fixed on their channel. many of us are doing other things too, and scan the irc client once in a while
anyways, a common solution to SettlerX ’s problem is select col2,col3,col4,null as col5,NULL as col10 from table1 UNION ALL select NULL,NULL,NULL,col5,col10 from table2
although i do not know why not just use 2 queries

Ah true, had not considered selecting nulls

Is there a better way to do random selection right now I am running “SELECT * FROM glitters ORDER BY RAND() LIMIT 5″ but I get an ERROR 12, which is memory allocation error.

if you get an ERROR 12, you might have quite other problems…

random

http://jan.kneschke.de/projects/mysql/order-by-rand/

read that

bigfoot-: wjhat do you mean?
ok

Hi! I’ve got some .MYI .MYD and .frm files. Those are from a MySQL 5 server. How may I convert them to MySQL 4.1?

mysqldump + import

The server from which they are from is crashed. I can’t use mysqldump on that machine =(
Or can I perform mysqldump on those files?

you can reinstall mysql 5

on my “new” server

any computer, even your desktop PC

what about installing mysql5 on a different machine, use the data-files there, make the dump and reimport them?

that’s a good on!
one*

hi, I have some troubles creating a VIEW that have an UNION in it..

and ?

where can I paste the SQL?

rafb.net

http://rafb.net/p/FUophr38.html
it gives me #1064 error

you got more than just a error-number, paste that too
you open ) which you don’t close

it’s a copy-n-paste error

seekwill thats a bit early fer pinging me

Oh, sorry

I was at home asleep

wait … I’m looking for another way to create te view…

paste everything you get, the way you get it

http://rafb.net/p/oyyP0q77.html
the error is ” #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘UNION
SELECT P.id AS idPersona, S.id AS idScheda
FROM persone P
JOIN schede ‘ at line 4″
I manage to create the view using other JOINs…

another one (thePanz) leaves the channel too soon

is there a way to rename a table ?

!man alter

see http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

!man rename

see http://dev.mysql.com/doc/refman/5.0/en/rename-table.html

hi
ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: N
i am also geting same error for user which has more previlages

Check your password is being entered correctly

i have not set any password yet

i am also geting same error for user which has more previlages – more privileges from root ?

how can yes by default ubuntu seems to give not more previlages to root
ok it’s done. I ran mysql -u root -p and set the password
thanks anyways
can you please any GUI for Mysql administration?
not web based

hi, where can I get this ’sense of humor’? Does it cost much? Will it hurt?

Adnan_, MySQL Administrator and MySQL Query Browser (both by MySQL AB)
look on the mysql site

arthas242, yes it costs. deposit $200 in my paypal account. yes it will hurt.

hmm, very reasonable..
ok, I sent it

arthas242, you have been conned!

you could also try teehee.com, it might not hurt, but it’s definatly scary
(and probably expensive)

thANKyo
bye

see ya

Hello everyone..
I have a problem with mysql doing a dump.. the error after the dump states mysqldump: Got error: 2013: Lost connection to MySQL server during query when retrieving data from server

hi

When googling around.. i have not found a clear answer on whats going wrong..
Can someone please help me out? many thanks

There could be a lot of reasons that it lost connection

its only on dumps..
we use the database for a few things like internal wiki , RT and mantis
cd var

How big is the dump?

I think ~4gb
sorry 1gb for a specific database
the problem is only on a specific database

Perhaps you have some big BLOBs and your problem is related to the max_allowed_packet

thanks .. how do i change that max_allowed_packet?

Is there a default time limit for MySQL connections?
Could it be that its reaching the time limit so MySQL closes the connection?

just looking at /var/lib/mysql/rt3 it states the database is 2.6gb..

SHOW VARIABLES LIKE “%timeout%;
Then read in the manual about interactive_timeout and wait_timeout

Max allowed packet is 16mb..
stupid question…. I know mysqldump backs up the structure and content from queries but.. why not backup the filesystem of /var/lib/mysql?

Just a guess – mysqldump output is portable ??

the files might not have all the info in them.. some of it gets written to a log

stmaher, can give problems, mysqldump locks to give a clean copy,

oh ye, thats it backing up the files is fine, but you have to shut down the server to do it or u might get incinsistent data

thanks.. I presume i can try upping the max_allow_packet from 16 to say 32? and /etc/init.d/mysql reload ???

stmaher, it may be dynamic .. set global max_allow_pakcet = 32*1024*1024;
quit, reconnect
see if it allows you
there’s a section that shows all the variables and if they can be changed on fly

[mysqld]
set-variable = max_allowed_packet=16M
this is what i have
in /etc/my.cnf

when connecting from localhost OK, but with same username from remote : “Can’t connect to MySQL server on ‘remote.server.name’ (111)” : any idea ?

external

remove bind-address= and skip-networking from my.cnf and grant permission to the external ‘user’@'host’ and remove any firewall rules blocking port 3306 and make sure no overrides on the mysqld commandline

thanks : it was the bind-address

I have encoding problem, I insert record in table and in phpmyadmin it looks fine, all symbols are rigth. When I display this with php all not latin characters replaced with question mark. MySQL charset: UTF-8 Unicode (utf8). page charset also utf-8.

check/set your connection charset as well

where do I need to look fot this ?
I have a windows 2003 server, mysql 5.0.41-community-nt

its set during the connection from php

also have these lines in my.ini default-character-set=utf-8
init-connect=’SET NAMES utf8′
ok, will do

anyone had libmysqld 5.1.x compiled and running?

when did union come into mysql?
I get “You have an error in your SQL syntax near ‘union select 2″ with SELECT 1 UNION SELECT 2

libstdc++.so.6

4.0

how i can remove duplicate lines on a table? (Just ID differs)

Add PRIMARY KEY on ID

mh?

oops

ID is different
it is a primary key

on evertything else than ID

but then it crashs
i know this effect

ello everybody

?

wait i try again, actually as far as i remember it doesnt allow me todo this
“duplicate entry”
i just got 2 rows int he table
X_ID and Y_ID
and i want just any combination ones….

What crash you are talking about?
You mean two columns I hope

the adding of a unique index ontop of this fields gives an error then of course: “duplicate entry”
aehm yes

dupes

find them with select count(dupefield) as qty,otherfields from table group by dupefield having qty 1

ALTER IGNORE IGNORE your_tbl ADD UNIQUE KEY (X_ID, Y_ID);
Note IGNORE keyword

ok trying
doesnt eat IGNORE

oops
it’s ALTER IGNORE TABLE …
typo above

Hello… is it just me or is the linux mysql query browser missing the regex import tool?
:P

ok
still….
but exactly on my table name?!
ALTER IGNORE my_table, right?
ACH ALTER IGNORE TABLE my_table ok

that max packet size didnt work.. the dump is still hitting 70998029 in size.. then bailing

Did you increase max_allowed_packet at both mysqld and mysqldump side?

mysqldump3

I increased it from 16 to 64mb

in an UPDATE statement i want to modify a field value and just increase it by one. can i do this in a single UPDATE statement like “UPDATE tbl_records SET count=tbl_records.count+1 WHERE …” or so?

y

thx

i installed mysql-4.0.23-0 working fine … i just install “php-mysql-4.4.4-1.0.rhel4.ct” for communicating php files will it work with my installed mysql-4.0.23 or do i need to change it ?? or can any php-mysql version will work with mysql-4.0.23 … or do i need to change somethin?

hi

with database replication master/slave is it possible/recommended to replicate the mysql/privlidges table, or should users be created manually on each different server

Better maintain different users and privileges.

i thought that might be the case, but i thought

how do you comment out a line in .sql file?

usually you give different privileges for Master and Slave

so it’s skipped and doesn’t cause errors when loading such sq

!man comments

see http://dev.mysql.com/doc/refman/5.0/en/comments.html

can’t you just tell me?
i have no browser fired up
is it // or else?
*shrugs*

You have the manual uploaded along with MySQL itself
/* */ or — or #

thank you
and really, if it was all about reading man then this channel isn’t really needed
so aren’t people like you
as EVERYTHING is somewhere in the man or google
and i do know it
just can’t wait when you ask YOUR question to tell you to read man

Asking other people to read themanual for you is not very polite to say the least

salle i’m not asking those who need to read man
and when i’m helping i don’t read man either
if i can help, i just do it
it was easier to type /* or # instead of !man comments, wasn’t it?

Your words imply people who write manuals are wasting their time you know

but you just like to brag
salle as i said – i will wait till you ask any question here
and i will ask you then wtf don’t you read the damned man and waste others time

You will have to wait a lot for me asking for help about MySQL here in this channel

yes, because all you do is tell others to read man
i can setup a bot for that if you like
again, was it easier to type # or !man comments?

!man
For sure
Any other question?
May I ask you one?
Since when you are helping people on this channel?

So I’ve added a user to mysql. GRANT ALL PRIVILE…., * it comes back and tells me that 0 rows have been effected …
Do I have to restart mysql after adding a new user ?
what’s the optimum way to reload/restart it ?

babo it does that, i dunno why

can I just restart the daemon ? Or is there a better way ?
can I just restart the daemon ? Or is there a better way ?

Comments off

hey i have a string which contains keywords like this [keyword1] [keyword2] those are in a string somewhere between

check if another basic php script works in the same directory, if not, then stick die(‘);
check if another basic php hosting script works in the same directory, if not, then stick die(‘debug’); in random places until you find where its broken

Phpinfo() works i that dir

by if not, i mean if it does XD

The stupid script is encrypted, so i cant edit anything in it
I hate encypted crap

=\ well theres the problem, un encrypt it XD

then get rid of the script

if it’s php it should take seconds to unencrypt

im all ears =P

send it over and i’ll try it

AlexC_ i wish i had that option, but its considered one of the best billing scripts in hte hosting industry

unless they’ve compiled it and you’re running it as a cgi =\ then i can’t do a thing

Im actually already in the midst of creating my own with another developer (he is really the one developing it) because of the inability to really expand/customize the system
its done with ioncube

if the extension is still .php it’s breakable
but this compiles it to php bytecode?
or to its own?

Id pay good money to get an unencrypted version of this script. Its bytecode i guess, whatever ioncube uses

well send it over and i’ll have a look

Just a single file?

sure

As an example
ok

it’s obviously not the best if you’re getting errors and they feel so confidante that they code 100% perfectly to close it up so no one can fix anything …

ah, it’s interperated by an external dll

I agree completely, but im stuck with it until we finish our software
were you not familiar with ioncube?

well i guess i’m downloading it

ioncube is similar to Zend Encoder

That file isnt going to output much more than errors, since it doesnt show anythign itself

they should both never have been invented

is correct

i love spending 4 hours sthraight trying to debug code that ends up being a misplaced )

I didn’t find anything about virtual functions in the PHP4 OOP documentation on php.net

Hmm, how is it possible for a php file to only show whitespace without any type of error reporting (when its turned on)
Man this is frustrating

the script probably turned it off

the best one is when you’re uploading the file your editing to the wrong directory and don’t realise

ouch

it does by default, but i can add $display_errors=”on; to the config and it supposed to show errors and usually does

i have a phps file containing utf-8, but when it’s rendered, everything displays incorrectly, as if it were read as latin-1. how do I fix this? (i’ve already tried AddCharset.)

virtual?

Yes
Virtual
As in the keyword

you mean as in C++’s virtual?

Yes
Java/C++ anything OO
Maybe I just don’t need too
to*

no, php4 doesn’t have that, but PHP5 has ‘abstract’. I think that’s similar.

well even if i did bother to decode this, all i’d get is php hosting bytecode

Hi, I wonder what the best or most correct way is to store configuration in php so it is accessible everywhere – in class, normal variables, array, globals, ? Help is really appreciated.

global or static class

well, store then in constants when applicables

well then we got three things again, which to decide?
TehSausage, TehSausage and would ou recommend a register pattern to access the configuration?

hi
is it possible to stop the client to send a referer when clicking on a locxal href in the header with php? or anyhow?

i have no idea what you just said, but it’s sad that i know holding ctrl while a windows program is loading will load it behind current windows

i mean the $HTTP_REFERER

no

yes i do

and the only reasons for doing that are evil

you mean $_SERVER['HTTP_REFERER']

yes

god help me
i lost the backup

quick, undelete

just kidding lol
hey sausage
how can i gzip a set of folder into a single file

you don’t, you use tar

whatever. dont care
how do i do it
tar gzip wahtever

you don’t, you use tar

how

you tar, then gzip

show me the way
whered you go

thought this was ##php
not ##tar.gz

what the hell
i mean with php

=\ you want to make a clone of tar with php

how do you gzip a set of folders with php
i thought it’d be a simple few lines you could show me

system (‘tar cvzf whatever.tar.gz whatever/’); maybe?

well you can gzip each file individually
glob+gzencode

you might be able to use passthru() or something if you want to send it directly to the user, in which case you probably want tar cvzf – whatever/ or something

wat
nah i dont
i just want to gzip folder X Y Z D and save to a file in the same directory as the script
thatsit
well actually ideally i want to cron tab the process

do i have to say gzip is not an archive format again?

the gzip & emailing of Folders X Y Z
if it makes you feel better lol

gzip is only capable of archiving single files, not multiple files.

ah ok
zip theN?

you need to use tar, which is a non-compressing archive format to put
multiple files into one noncompressed file

i want to compress

*then* you can compress it

oh

that’s why the files are usually called .tar.gz

oh ok cool
learnt something
is it possible to crontab the tar gzip of folders X Y Z & email them?

sure, i have no idea why you want to use PHP to do that though :-)

it started out as php lol

saamy, yes

really?
tips / code examples tib?

for what? man tar

crontab tar gzip folders

saamy a solution i have seen before uses pack to create the files er..

pack?

http://www.phpclasses.org/browse/package/945.html
pack makes binary files… that package above *makes* the archive files i believe
rather than abstracts over some passthru() / exec() command

i see

creating the archive is easy.
just do system (‘tar cvf archive.tar.gz folder/’);

how
ill try system 1 sec

sending it via e-mail, that one you’ll have to figure out yourself.

Should I use commas to separate grouped cases in a switch?

lol that is not creating pv2b, that is using another program to create it

like case FOO, BAR, FOOBAR:

semantics.

??

whats system()
is that valid php

php.net/system

long as its valid homey

no… php supports case dropping, im sure

?
What’s that?

it works fine as long as you’re running the php script on a host with a typical unix toolchain.
which, you probably are

case ‘BAR’ : echo ‘foobar’ break; Veejay

ok hold on

OK

im on windows

foobar should echo for both foo/bar Veejay

in that case, it’s not going to work.

it didnt make anything
ill try it on linux server

it’ll work fine there.

we’ll see

yes php does support it: http://pastebin.com/d15760322

hmmmmm
it echoed a few things

did i say cvf? i meant czf. sorry. :-)

haha it worked

yeah, except the file you just got wasnt comrpessed

gay
how do you compressit

use czf instead of cvf.

3kb

ok how do i handle multiple folders

just tack them on to the end of the command line. tar czf whatever.tar.gz f1/ f2/ f3/

does ../folder work?

maybe. experiment.
http://unixhelp.ed.ac.uk/CGI/man-cgi?tar — this will tell you more about the tar program.

whats the easiest way to get folder size in php without lagging too much?

schau dir halt mal die antworten von $nic an wenn die domain vorhanden ist und prüf darauf – falls du genug ahnung von php dafür hast

thana, if you reverse the part available() / unavailable() you can even check in the other direction

http://php.net/filesize saamy?

nah

thana, I already tried what you said

disk_total_space i think

weird, 5.1.0 and 5.2.3 can use file_x_contents() on php:// files but 5.2.0RC5 can’t

but makes no difference
thana, sorry for beeing so upset before in the german channel
had a bad time

5.2.0RC5 cant use put_ get_ contents, TehSausage?

how do you convert bytes to MB
lol

no, i can’t use it in php://stdin/out
divide by 1000000

wtf
1168920674304

thats way more than you count with megabytes

shit
thats the size of product images folder on my site

over 1TB

1.1…..
that cant be right dude

maybe you should recheck that number

it cant be right
i did
echo disk_total_space(‘../images’);

maybe you should recheck that number
=\ disk_total_space.. idiot

lol
what

you can’t use that on a folder, it gets the entire disk space

oh ok
cool

which is 1.1TB

so how do i check folder size

maybe you’ll be interested in http://php.net/manual

im searching it now

please, do try to make an effort to figure stuff out by yourself in the future.

but you could speed me up maybe
i always do
tahts how i got disk_total

that question would have been avoided by actually *reading* the docs. “Given a string containing a directory, this function will return the total number of bytes on the corresponding filesystem or disk partition.”

i told you to divide by 1,000,00 and you ask what a size is

also, converting bytes into megabytes should be easy enough for anybody with basic education.

it probably took you more keystrokes to ask than to figure it out

yeah

save ##php for your harder questions. we’re people too, we have other stuff to do than to answer basic questions that can be figured out with a minimal amount of effort.

i’m on a quest to stop people using 1048576 bytes for megabytes
i don’t

k
here’s a weird question
nevermind

shoot
come on!

i bet he had 10 seconds with the manual and realised it wasn’t so hard after all ;-)

the manual is a great tool

ok im getting folder size now

mebibyte, pebibyte etc just sounds odd

php has no inhert method for foldersize

what’s that?

and having to calculate 1024 in your head is easier than 1000?
complex names for a complex number :P

there’s no real reason “normal people” want to use 1024-based file sizes.

190755330 bytes

I’m not saying that, I agree entirely that the confudion needs clearing up, only wish they’d used names that didn’t sound retarded

i prefer the term “binary megabyte” for 1024 binary kilobytes.

therefore they should stick to MB (unfortunately windows uses MB as MiB)

my product images folder is 190mbs

mabibyte != megabyte ??

KiB = 1024 bytes, KB = 1000 bytes

“decimal megabyte” specifically for 1000 kB, and just “megabyte” whenever it’s obvious from context what is meant.

[kilo]gram isnt 1024 grams so why should a [kilo]byte be

tradition.

I have a two-dimensional array and am wondering what the best way would be to extract the data? Using a for loop or a while loop. It is not an associative array, but it could be.
I dont know the number of rows that it would iterate through specifically

btw system (‘tar czf archive.tar.gz ../js ../icon’); worked also

i thought 1 KB = 1024 B, but seems the hard disk companies messed it all up

a nested foreach

hence the use for a new unit

speaking of that

ThanksTehSausage

do you know how much data a “1.44 MB” floppy actually contains?

1.44 MiB?

the description of the 3.5″ floppy is wrong on all 3 accounts

1.44MiB?

nope :-)
it actually contains 1440 KiB of data
so one floppy MB = 1024000 bytes.

it’s not floppy, it’s not 3.5″ and it doesn’t hold 1.44 meg

jeez, stop ruining my brain XD

good going

my floppy drive is still in my computer, but not connected

yeah floppy companies did that too… they use the 1000 calculation for megabytes and kilobytes so that they can have bigger numbers

i blame the people who invented 1 kB = 1024 B to start with
if they had just used another name than kilobyte we wouldn’t be in this situation anyway.

well …. that makes sense

the hard disk companies are just using a logical unit of measure. the size of hard drives has very little to do with powers of two.

Hi, I often see functions/classes being document with @package, @…, same for variables and stuff. How this called, and how can I apply this?

@ is a phpdoc block Adriaan
some IDEs create them for you automatically, such as ZendStudio

i call it a waste of time :P

ThinkMedical, thanks (im running linux host though, i dont think there is open source IDE)

i dont, i find them useful

eclipse with pdt?

http://pastebin.ca/628621 how can i make it so that if the form filename is left blank it automaticly chooses what to input? with a switch right?

just because they are consitent

i scroll through 90% text when i get a class like that

you dont need quotes around a variable, LucnetBenji

ok

i try to limit comments to where theyre needed, one or 2 lines explaining an awkward function and a single line copyright at the start of a file

i automatically collapse phpdoc blocks, and open them when needed TehSausage

not every editor can do that

a generated api is somewhat useful
also… rather than having to search/open/read the file just look at the phpdoc api
what do you want to do?

i want it so that if nothing is entered into the
filename field
it automaticly chooses a filename

BlueMaex, good idea , lets give that a try

$filename = (isset($filename)) ? $filename : ‘defaul.txt’;

hm
so it would be like this

a couple of languages have =|| like $filename =|| ‘default.txt’; // php should have this!

http://pastebin.ca/628623

yes

awesome
thank you soooo much

np
im d/l a client’s site to edit and its taken 10.5 hours so far
i think 50% isnt needed

bom dia a todos

about 10 different file have _old or _broke suffixes
*folders

heh, i have a folder thats like that
OLD_theme_IS_OLD

and you need it
*?

actually yes, i’m copying the html from it still :P
actually yes, i’m copying the html from it still :P

there’s a folder called css with one css file in and about 20 in the root

XD

i just hope it will be easy to find what files *are* needed & where they are needed so i can reorganise everything

ThinkMedical, do you know by accident if Eclipse supports auto documenting?

assets / lib / tpl
i dont use eclipse Adriaan

ok

you could try their website

hey folks… i have libjpeg.so in /usr/lib64 but when i configure php –with-jpeg-dir=/usr/lib64 it tells me it can’t find libjpeg(a|so)
any idea what’s going on?

ThinkMedical, or try their channel

de &con “Hello World” why do i write these stupid scripting languages

yo p2vb

hm?

system (“tar czf backup.tar.gz /DIRECTORY/”);
is it possible to specify a directory but only FILES within that directory? not sub folders?

http://unixhelp.ed.ac.uk/CGI/man-cgi?tar

im there
already
havent been able to find out from there
i dont even know where he got the paramater “czf” from man
none of that is in that page

FUNCTION LETTERS
-c, –create
create a new archive
-z, –gzip, –gunzip, –ungzip
filter the archive through gzip

yeah i know
but for recursion

-f, –file [HOSTNAME:]F
use archive file or device F (default “-”, meaning stdin/stdout)

i want to disable directory recursion

you just said where i got czf from wasn’t in the man page. i just proved you wrong :-)

what if i want to tar a file named – ?

also:
–no-recursion
do not recurse into subdirectories

yeah i saw that

./-

so wondering if i just add a –no-recursion in there

damn

try it :-)

tar -czvf /path/to/dir –no-recursion

ok

@sammy: facepalm.jpg

oh ok so it can be specifically set for each dir?

yeah…

maybe. try it.

doubleaminusanm

tar czf bak.tar.gz ../js ../database –no-recursion

i think you need to put –no-recursion after czf. not sure though. try it.

hmm
yeah trying wait up

my *nix skills suck =\

Why does PHP installer say it can’t find libjpeg.so/a even though I clearly have it in my lib64 folder

Your environment is busted

ok that failed
tar czf bak.tar.gz ../js ../database –no-recursion failed. empty folders in the .gz
tar czf –no-recursion file.gz ../js ../database ../admin also failed. empty folders

weird… i had to specify /usr instead of /usr/lib64

where to now
maybe the — is not required

try tar –no-recursion czf ….

o
empty fodlers

HIS FODLERS ARE EMPTY

im sure it’d be specific to the path

actually, that’s correct. no-recursion means it doesn’t go into the subfolder at all.

–no-recursion that is causing empty folders. i remove and the gzips fine
oh
so how do i specify ../database and make it only read database files not database/XXX/file
is there a level paramater
–recursion 1?

i wish there were :-)

-_-
what do i do then

one way to solve it is to do tar –no-recursion cvf archive.tar.gz folder/*

what does that mean

the * tells tar to put the actual *files* in there.

ill try that

not the subdirectory
then the –no-recursion means it just includes the directories matched by the * as empty directories
for anything more advanced you’rep robably going to have to pipe find into tar :-)
somehow

nothing was craeted O_O
tar –no-recursion czf $name ../js/* ../database/* ../admin/*

that might have worked. i have another idea though.
just a second.

what about CHANGDIR
-C, –directory DIR

how do you check whether a checkbox has been ticket?
*ticked

you’re going to use a feature of unix now that is charectaristic for the opterating system. if the filename matching of tar isn’t flexible enough, you can use an external program to provide a list of files.
the find program, to be specific

say what

i did this:
find a -maxdepth 1 | tar cvf /dev/null –no-recursion -T -

goddam.

you probably want to replace /dev/null with the filename you want to put into the tarball.
err
the filename of the tarball you want to create

wait so is that the entire new query

a is the directory name of the files you want.

i see

hey. i have a string which contains keywords like this [keyword1] [keyword2] .. those are in a string somewhere, between normal html code.. how can i fetch all those keywords out?

now, you have a slight problem, you want multiple directories

what about multiple dirs
yeah
lol

find a b -maxdepth 1 | tar czf whatever.tar.gz –no-recursion -T -
this should work

preg_match(‘/\[[A-Za-z_]+\]/’, $index_template, $result);

one other problem, this will include empty directories, which you might not want.
preg_match_all

who cares
empty directories i can live with just dont want recursion
so thats the entire query

yeah
actually, this might be a better way to do it:

system (“find a b -maxdepth 1 | tar czf $name –no-recursion -T -”);

find a b -maxdepth 1 -type f | tar cvzf whatever.tar.gz -T -
-type f means that only files will be returned by find, and since no directories are passed to tar, –no-recursion is unneccessary
the “-T -” part means it wants the filenames passed to it on standard input, which in this case is find through the pipe.

runnin
might have worked

the v part in cvzf tells it to echo the filenames being packed to the output. if you don’t want that, just get rid of it
might not be desirable in the php.

yeah dont want that
looks good dude

the command might need slight adjustment if you ever move the php script to a host that doesn’t use gnu find and gnu tar
but i doubt you will :-)
those are by far the most common variants of find and tar out there.

sweet
wish i had an ice cold coca cola right about now
do you recommend tar.gzipping a 180mb images folder?

pv2b, thx

the images are probably already compressed
so compressing them again might be unneccessary, taking extra time.

this is for backup though

how do you check whether a checkbox has been ticked?

im just sayign do you recommend it as in will it take a long time?

also, e-mailing a 180 MB file might be problematic.
other than that, sure, why not :-)

lol
guess not

do you have control over the host you want to back-up to?
you might want to instruct it to pull backups from your host instead.

duno
its all good i’ll crontab it to email me the backup

i’m not saying it’s not going to work.
i’m saying e-mailing 180 MB *might* be problematic
depending on your e-mail host
but by all means try it

nah i know
the images backup would be a one off
i’ll grab it off my host
but the other directories i’ll backup to a folder and auto email

how do you check whether a checkbox has been ticked

that was used to submit to your PHP script, you check the $_GET or $_POST variables, depednign on the form submission method.

http://www.tizag.com/phpT/examples/formex.php contains an example you might find useful

thanks :_
*

cheers cu

anyone here used phpDocumentor?

why is ORIG_PATH_INFO being set and not PATH_INFO when i’m passing PATH_INFO to php via fastcgi and have cgi.fix_pathinfo=1 in php.ini?

From that example
I still dont see how you would get to the php code whether the checkbox was ticked or not
I need it for an IF variable

in that case, you’re goiing to have to be more specific.

ok basicly

you did notice there’s a second page to that site? click on continue.

yes i did

okay.

please wait a sec
gotta take a call

BlueMaex, ) thanks again i got eclipse+php running (quite slow but its a great IDE)

http://pastebin.ca/628659
I have this code
and the tickbox

BlueMaex, i used to use nano or scite

will be for people to decide whether they want to file zipped or not,

just a sec. pastebin is being slow to load for me.

ok
no problem

the pastebin page isn’t loading for me at all.

hm
ill find another site

pastebin?
php-bot: pastebin?
try http://hashphp.org/pastebin

http://rafb.net/p/8wO3Iy30.html

okay

sorry for being slow

that worked :-) np.

I have a pain of a customer on livesupport

oh, you’re making a script that gets a file from somewhere and sends it to you :-)

yes

is there any way to display something else in place of the fatal maximum execution…

quite slow? on my computer its fast

first, you don’t actually need the [] in zipoption

oh
i read on the tizag site you did?

well, that’s just coding style

ok

not neccessary in itself

i removed it

but it depends on the amount of RAM and CPI

second, check to see how $_POST['zipoption'] if the box is checked or not
i think it’ll be true or false. not 100% though, experiment with it :-)

i dont understand

okay.
just like you’re getting input values like this:
$url = $_POST['url'];
you can get the state of the checkbox through $_POST['zipoption']

really?
ok

yeah

so how would I do that

the contents will be in one way if the box is checked
and another if the box is unchecked

oh right
yeh
if the box is checked, the file will be zipped
if not
it wont be

exactly.
i think the value might be ” if it’s unchecked
and ‘zip’ if it’s checked

so

not sure. play with it to get a feel for it :-)

id do
if (zip == zip){code
}
else
P
*{

put something like print “zipoption = “.$_POST['zipoption']; in there somewhere.

is that along the right idea?
sure

yeah, sure.

hi, is div and tr a part of php?

and tr? in that case, no, they’re a part of HTML.

No html

thank you

http://www.w3schools.com/tags/tag_div.asp http://www.w3schools.com/tags/tag_tr.asp
hth :-)

zipoption = zip

is it possible to code in php and eliminate table, div and tr?

that was when it was ticked
thank you very much
you rock

great. so then you just do if ($_POST['zipoption'] == ‘zip’) :-)
np :-)
… PHP is usually used to produce output in HTML. so most PHP code contains some HTML for the output part of the code.

parts, if you make sure the result is also valid html.

or valid in whatver output format you want to produce

this is what my code looks like now http://rafb.net/p/MwBoUA57.html

if you could be more specific about what you want to do i might be able to help.
consider doing something like this:
- get the file
- if zip
compress it
send it to the user
- else
sent it to the user uncompressed
that way you don’t have to duplicate the code for actually getting the file

i am very green, so I am just trying to compare html and php, I tought php is a better substitude to pure html pages. I need a goot ref as where I went wrong in comprehending the php usage on the web

kin
*hm
k

PHP and HTML aren’t really comparable, they complement each other
web browsers only understand HTML (and CSS and Javascript etc), PHP is a tool for the web server to dynamically produce HTML pages for the browser to produce, depending on state in the web server
PHP is often used to *generate* html for output, but can be used to generate other kinds of data too.

hmm this is odd
http://www.lucnetsolutions.com/upload/storage/curlnow.php thats the file im using, try putting in http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
into the first box and clicking submit
it gives a 301 error, errors and doesnt strip the extension
doesnt rename it
woops wait a sec

heh. you’re failing in several interesting ways :-)

any fixes? :P

quote” web browsers only understand HTML” my firefox is displaying http://domain.com/index.php so the browsers do display php

nope.
they’re not displaying the php. just because the file extention is PHP doesn’t mean the actual content on that URL *is* PHP to the web browser
if you look at the source code, you’ll only see the HTML *output* of the php script

magyar go to view-page source in firefox you wont see any php

roger, it has dawned on me now. Thank you.

well, first of all, the URL for putty isn’t the direct URL it seems
if you try to get http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe, it will 301 you to http://the.earth.li/~sgtatham/putty/0.60/x86/putty.exe
which is a differnet URL
if you try to get the second URL it should “work”.
instead you’ll probably get a bunch of gibberish :-)

it doesnt.

magyar the php is on the web server. by the time it reaches your web browser, all the php is processed into html and the only thing that is left from php is the .php extension

ah yes

but that gibberish is actually the PuTTY file.

but when i try to rename it
using the save as filename bit
it just doesnt show anything

rename what?

the second input box

that gibberish is tainted to start with

is so you can choiose the name of the file
if you enter anything into that box

you don’t want the gibberish to be intermingled with the actual HTML

it doesnt work

which is what’s happening now
so while it “works”, it doesn’t really do what you want it to.

yeh

you seem to have two scripts, curlnow.php and curl.php

php=”output generator/processor” for web browsers
so far so good

not really.

bahh

it does the processing at the web server
not at the web browser
it’s server-side scripting. compare with javascript which does similar stuff on the client-side
modern web pages tend to use a mixture of server-side scripting and client-side scripting

php is interpreted by the web server, which reads php code, interprets it and generates HTML (or CSS or whatever) code from it, which it then sends to the web browser

anyway, you want one of your PHP scripts to show the interface, and the other one just to retreive the file.
as it is, you’ve put the actual HTML in both files, which is kinda fail

its the same file
it submits to the same file

curlnow.php, curl.php

refresh

refresh what?

the page

which one of them? curlnow.php or curl.php?

it submits to curlnow.php now

okay.
can you make a symlink from curlnow.php to curlnow.phps? :-)
that way i can see the actual updated source code

ok sure
hold on
ill upload a phps file
http://www.lucnetsolutions.com/upload/storage/curlnow.phps

right. see what’s happening here?
the HTML code is printed, irrespective of you actually getting the file or not

yeh

i guess you want the user to click a button, and be sent a file straight away?
or am i misunderstanding what you want to do?

yeh your right

in that case, you can’t just present HTML code and the actual file download in the same request
you need to add a conditional so that the HTML code is not displayed if there’s an actual request
that, or split up the actual requester PHP and the form HTML into seperate files
the latter is probably easier
and cleaner

yeh ill do that
hold please

pv2b: how is this for grassping: http://pastebin.ca/628682 -_-

http://www.lucnetsolutions.com/upload/storage/curlnow2.php
1woops wrong one
http://www.lucnetsolutions.com/upload/storage/curlnow1.php

pastebin.ca isn’t working for me
probably some kind of routing snafu
try another paste service

you fail.

magyar i think you have to use the parenthisis, like this print “beginning to grasp”;
uh sorry
i mean like this
print (“beginning to grasp”);

show me the source code instead.

its just split up

ah i see

how do I make a php (CLI) script run in the background?

right… that’s better
not good yet, but better :-)

magyar well actually print is not really a function so you can use that without the parenthisis too…
sorry for confusing you

alex[slx]: php phpfile.php &

http://www.lucnetsolutions.com/upload/storage/curlnow1.phps
http://www.lucnetsolutions.com/upload/storage/curlnow2.phps

you’re still contaminating the output with error messages.

can I do it without that

and you praobably want to do something about them too.

so the user just exectues the script

yeh

alex[slx]: without the & ?

yeah

http://paste.css-standards.org/20127

but it aint a priority until ive got it working

I’ve set it up with #!/usr/bin/php aswell
so they just have to type the name

erm, not without making another script to run it

ok
thought I say that done somewhere before

that’ll give the web browser htmlbeginning to grasp/htmlbeginning to grasp if run on a php-capable host

my memory fails

well, the error messages are probably important.

alex[slx]: ah well, not that i’ve seen, maybe someone else here can enlighten you!

ok

curl_setopt($ch, CURLOPT_FILE, $fp);
this is failing. you want to put it into a file on disk for temporary storage
but from what you described to me, that

how the hell did that even happen

that is actually not what you need to do.

I’ll check, I seem to remember it from IQ, the php irc bot

so how do i do this?

do you actually want to keep the file around on disk, or are you content just to let the user have the file?

just let the user have the file

right, so nuke that line
also $fp = fopen($filename, “w”);

“beginning to grasp beginning to grasp” this is what i get in firefox

check the source code.

nuked

that in turn means you no longer need fclose($fp);

pl
or these right?
$filename = $_POST['filename'];
$filename = (isset($filename)) ? $filename : ‘renameme’;

probably not
i wasj ust going to ask you about that
why are those in there?

they were there soi the user could specify the filename

yeah, the source is, but the browser interpretation is the above mentioned

exactly.
why? that’s already given by the URL
anyway, it’s not important.

yehj
so how will the extension be stripped?

you want the extention to be stripped? which extention?

alex[slx]: using system() from php runs a command asynchronously.. helpful?

like
..exe

I’ve just downloaded the code that I saw it in

ah, you want to get past a bullshit web content filter, i get it

yesa
lol

he just uses pcntl_fork()

for school :P

and then exit() the parent

right, in that case, you want to keep that field around :-)

so the child keeps going in the background

alex[slx]: thanks for letting me know, interesting

no worries

ok
i put the 2 lines back

okay. so now the file is actually probably displaying properly, the problem being that the web browser still thinks it’s HTML
which is not really what you want
so you want to use the header() directive to fix the mime type

ah yes

an easy hack that will work for your purposes would be header(“Content-Type: application/octet-stream”);
that’s generic enough for the web browser not even trying to do anything with it.

this goes under
curl_setopt right?

yeah

ok added

now, try it.

hold a sec

it should be functional, if not perfect
you still need to add proper error handling somehow

http://www.lucnetsolutions.com/upload/storage/curlnow2.php

also you probably want to use curl_setopt to set CURLOPT_FOLLOWLOCATION
to deal with 301 fountds
i got a file
let me md5sum it to see if it’s the same as you should have got :-)
not quite.
actually, it is the same
pvz-powerbook:~/Desktop pvz$ md5sum putty.exe curlnow2.php
9bb6826905965c13be1c84cc0ff83f42 putty.exe
9bb6826905965c13be1c84cc0ff83f42 curlnow2.php
so now you have something functional :-)

kick ass

you can probably figure out how to make it good from here

ill try

i’m sure the web browser can be told the file name of the file using a header() or something

k

and you can probably handle errors somehow
probably before you set Content-Type so you can actually give erorrs in HTML
zip or gzip compression on the fly is possible somehow.

just curious… would this have worked instead of curl?
header(“content-type: video/mpeg”);
readfile(“my_home_movie.mpeg”);

not sure exactly how though.
yeah, probably :-)

uh no i meant readfile(“http://www.whatever.com/file.exe“);
ow

heh, actually, that might have worked too :-)
might be easier than dealing with curl

definitely

as long as the host’s php settings permit it that is
less flexible too. but curl isn’t that hard to start with

yeah

if i do mysql_query(“START TRANSACTION”); followed by a bunch of INSERTS then do mysqlquery(“ROLLBACK”); the INSERTS still exist in the DB – what am I doing wrong?

does it work if you try it from the mysql client?

i’ll try that now
this is PHP 5 BTW

pv2b, im having real trouble working out how to rename the file
would i use curl_easy_setopt()?

no, it’s not a matter of input from curl

ok
hm
if you just give me the function
ill try and work it out
pl\

http://onaje.com/code/download.phps
this might be useful

header(“Content-Disposition: attachment; filename=”.basename($filename).”;”);
that?

anyone there?

IT’s the query… Since mysql_query does one insert at a time it ignores transactions
No.

I’m confused with loops :-p
Trying to learn php but why are there so many different kinds?

Wolfpaws, ah i see, any ideas on how to do what i’m trying to do please?

use mysqli_query_multi (or something)

there is while, do-while, for, what is the difference between them?

header(“Content-Disposition: attachment; filename=”.basename($filename).”;”);

Wolfpaws, cheers

boabsta that’s mysqli_multi_query

does anyone know the difference between those 3?

does anyone know a good site that explains properly ACL? I’m wanting to switch to a proper ACL system instead of my may-aswell-not-be-acl-system

AlexC_ what sort of ACL are you talking about?

permissions with my script, ie – can user X add article? I have it working at the moment, but it’s really not ACL
not true ACL, anyway

oh ok i get it…

go read up on them, they explain themselves really,
“while” will do the loop while a condition is true, it wont do it at all unless it is true. “do while” will do the loop at least once and checks the condition at the bottom of the loop. and “for” will do the loop for x many times

PV2B I DID IT!

cool

Hey all, I’ve got php5 loaded in mods-enabled in /etc/apache2, yet I still can’t load my Gallery2 webpage, any ideas?

Belboz99, errors ?

none, FF just doesn’t know what to do with a PHTML file
but the Index page actually says PHP/5.2.1
when I open the /var/www directory in FF

pv2b you there
header(‘Content-Disposition: attachment; filename=”$filename”);
how do i get the $filename to work

damn, I direct linked to main.php and it says I’ve got a database error

LucnetBenji, i think you forgot a ‘

genius

thanks, my mom thinks that too

http://puqs.com/test.php i like loops this is COOL

header(‘Content-Disposition: attachment; filename=”$filename”‘);
with that
the files name is always
$filename
how do i get it to be the name

LucnetBenji – header(“Content-Disposition: attachment; filename=”$filename”);

syntax error

header(“Content-Disposition: attachment; filename=\”$filename\”");
there you go

thanks
thank you

you’r welcome

PHPadmin
another problem
http://pastebin.ca/628707
line 4
is supposed
to if a filename isnt chosen
to make it automaticly renameme
buit it doesnt
it comes up as
curlnow2.php
instead of renameme

!tell LucnetBenji about enter

sorry

!+sorry

Don’t be sorry, just don’t do it.

lol k

That’s one stupid bot rule

it’s common sense.

No it’s not
It’s just being polite to apologize for a mistake
I don’t get the point of hammering the nail some more

something that shouldn’t be done in the first place?

Saying “I’m sorry” shouldn’t be done?

ok could somone please help me with my problem tho
plz

LucnetBenji cant seem to understand why

hey guys, anyone know any classes that can open a .doc parse it with variables str_replace and then save it as a .pdf?

LucnetBenji could it be a problem in your form?

no because the form DOES change the name of the file
its only when a filename isnt chosen
that it just outputs curlnow2.php
instead of renameme

rawr

anyone?

$_POST['filename'] will _always_ be set when the form is submitted,
what you want is empty() to check if it’s got a value

hm k

rolfen oh ok now i get it

ah
so i should have
if (empty($var)) {
something here
}
what should go in something here tho
and $var should be $filename

LucnetBenji just replace isset by empty

oh ok
it works
thanks guys
xD

np

no probs,

hey guys, anyone know any classes that can open a .doc parse it with variables str_replace and then save it as a .pdf?

anyone know why passing PATH_INFO via fastcgi results in PHP setting ‘ORIG_PATH_INFO’ instead and not ‘PATH_INFO’? even with cgi.fix_pathinfo=1?

MrWilson MS word you mean?

yeh

MrWilson if your php install is on a windows machine, you can control ms word from php through com and make it do that

runnin on unix

darn
MrWilson i’m thinking of a way to have the unix machine send the file to the windows machine for processing
if you can spare a windows box with word that is

passing $this to a method as an argument is valid, isn’t it?

hi, with pgsql, how can i return the id for the last insert?

roflen, isent there a PHP class/addon for .doc files? MrWilson, did you try googling for it?

yeh i did
i can convert doc to htm then htm to pdf
but only simple htm
no nested tables or anythin which causes probsa

MrWilson unless… you can also try to find a way to automate openOffice…

doc is a closed format no?

It’s a closed but well-known format.

proprietary format most probably
still better imo to use the original application when possible
that is ms word

(I have multple of them and they are enclosing the form tag). Now I want to see which checkboxes I have selected

what do you mean, it’s better to use the original – ms word?

heck, is it even possible to retrieve the last insert id value as opposed to teh oid with pgsql?

string(1) “6″ }

i mean what i would have done is try to find a way to send the file to a windows box, have ms word open it then print it as pdf, then send the pdf back to the linux server. of course all that automatically

openoffice can open .doc files and has a Save as PDF
afaik – word does not have that feature

string(1) “2″ }

Which is the first checkbox selected, any reason why I am not getting all the checkboxes I am selecting?

alexc you will need to have acrobat distiller installed… using openoffice instead is an option foo
i mean too
if possible to automate openoffice. i dont know about that.

oThere are free alternatives to Acrobat Distiller.

true, that is another possibility
now you can control ms word from win32 php using com
but how to send the file from the unix server to the windows box

why is there nothing about DB driven ACL’s ?! All of it is adding the ACO and ARO manually or by a tiny Ini file

maybe use curl extention to send it from the server to the win32 box

how do i check the user’s url in php? (for use with rewriting)

if you’re doing re-writing then you do it via apache with mod_rewrite,
much like we told you earlier to go into #apache :P

no im checking the user’s url through php

look into $_SERVER

what would be an example of a $_SERVER parse?

var_dump( $_SERVER ); and look at what is there

what if i want to use REQUEST_URI ?

then use it?

i mean how
-.-

do you know how arrays work?

nope

so, for automation, mozilla uses xpcom, openoffice uses UNO… that sucks… they should have all used DCOM, but no, thy had to reinvent the wheel
ooops no DCOM i mean D-bus
DCOM is MS

‘pink’ ); echo $foo['car']; will display pink

and MS didn’t re-invent the wheel either?

they do
ms reinvent everything and stick there name on it

MS reinvent?? noo! they invent everything!

google earth gets released
4 months later out pops micrsoft live earth

yep, they always have to copy

true

which isnt a patch on google earth

Live Earth does though, have better satalite imagery
for example, the area where I live on Google maps you can’t even seen, though with Live Earth I can go full in
s/seen/see

oh live earth is good?

AlexC_

Jacky:

if( $_SERVER['SCRIPT_NAME'] == ‘index.php?page=2′ ) – is this correct

ill have to get live earth

I don’t know if you can download it – the one I tried was like Google Maps on the tinternet

ill find it :p
lol

try it, but the syntax is correct yes

cant find live earth on google yet…

Jacky, $_SERVER['SCRIPT_NAME'] only returns the name of the script. your if is always going to be false.

perhaps it wasn’t called Live Earth
MrWilson http://maps.live.com/

virtual earth
that was it

oh thanks!

according to what i parsed out it has like /something/test.php
for the script_name

The only day ms starts making something that doesn’t suck is the day they start making vaccum cleaners

yes, but only name and no query string

oh
how would i check for the query string?

indeed, though it will probably have some device on it for a ‘trial’ period – you do all the cleaning then at the end of it it just dumps everything it’s sucked up back out
anyway, food o’clock – tada

True.

hi, anyone here used the imap extension ?
I have an email, with an apparent cv.pdf attachment, but when I look through the parts, I find 2, one is the email header and the second, is the body text, but nothing to do with the cv.pdf

That Virtual Earht isnt high res for outlide the US
google gives me much higher res for my region

i hate clients who take ever to pay

oh cool, i accidently compiled over my source file

TehSausage mmm

Jacky, try if ($_GET['page'] == 2)
or something like that, based on passed variables

i was basicly finished, bad thing: i better hope i was finished

compiled php?

thx AlexC_, your $_SERVER just made my day

I don’t actually own it

i know
your message*
i did rewriting without touching mod_rewrite :P

Is it possible that a non-checked checkbox delivers a value (at best “0″) instead of delivering nothing?

can’t remember, do var_dump( $_POST ); to have a look

http://nopaste.info/123648043f.html

echo ‘pre’.var_dump( $_POST ).’/pre’; – makes it easier to read

does anyone know an easy way for checking for a 200 OK reply on a websierver wityh PHP ?
Seeing as the damned thing doesnt want to play nicely
bWarning/b: file_get_contents(http://iron.slserver.com:8008/) [a href='function.file-get-contents'function.file-get-contents/a]: failed to open stream: HTTP request failed! ICY 200 OK

!!
I have that same problem
er actually no

do you have allow_url_open enabled?

mine’s a different error :o

Mez you’re trying to open a shoutcast stream?

rolfen, trying to open it’s status page to query if it’s online

maybe php is not expecting to receive an ICY 200 OK… therefore failing

hi

i think it would be expecting an HTTP 200 OK

yeah I guessed that was why
I was wondering if there was an easier way

I have a question. I’ve noticed that some sites have addresses like www.someaddress.com/somepage?variable=foo , instead of somepage.php?variable=foo – how are they able to get rid of the ‘.php’ ?

well you could open the tcp port and white the HTTP request manually in php
and check the reply

maxo normally there the index file in a directory

Mez dont know if there is other alternative… they may be something i’m unaware of…

MrWilson – I don’t mean www.someaddress.com/?variable=foo , I mean with any page, even if it isn’t the index file

AkexC_ http://nopaste.info/64cb325496.html

mod_rewrite?

that’s kind of what I was thinking but I don’t know how it could be done. at the moment I’ve got a mod_rewrite where myaddress.com/page goes to www.myaddress.com/index.php?page=$1 , but then if I want it to go to index.php?page=$1&somevariable=blah , I have to have
www.someaddress.com/page&somevariable=blah, which I don’t want

Mez check the php manual page for fsockopen – check example1 for an easy examlpe of writing directly to the TCP socket

meh
fsockopen is a PITA

Mez, theres a function called “get_headers” you may want to check out

hmm after i login and create a session is there a way i can automatically have a query string (e.g. ?sid=29429492319) in all my url?
used as a valadation thing o.o

what is wrong with keeping it in the cookie?

i don’t like cookies

Why do i forget the damned easy thing

why?

didn’t work in ie :|

theres a bug on IE that makes session cookies crap

PHP – variable within functions are persistant? or not?

cookies and sessions do work in php
in IE, even

my cookies weren’t setting in IE
:|
work fine in FF

you don’t have to set the cookie your self, just do session_start()

k
yeah
speaking of login sessions…how could i get a list of all my users currently logged in?
something with session id?
like say i got
$_SESSION[user] = user
how do i access all those user variables for each person?
to create that list of users who are online

php does not offer a way to access all sessions
do your own login tracking

you could get it to set the date each user last logged in, and then write a script which displays the users that logged in in the last couple of minutes. or something like that

in where?
session variable?

database

or use sockets

how would i tell when the user isn’t on anymore?
ewww
no thanks

I was thinking database. or wherever the username/password is stored.

session variables
$_SESSION[user] = “user “

maxo means where are the usernames and passwords etc

i could probably write this in the database…but i wouldn’t know how to remove it

u dont

then how do i tell when someone isn’t offline?
online*

update the date on every time a page is loaded on ur site

ahh

then u do a query that checks all people who have made an action in the last 5 mins
its not 100% live accurate but it works

an action?

page load

so do an if like if ($session-verify(USER, PASS) { } then write that user in the database

when a user logins in, how do you check whether their password is correct? where is the actual password of the user which you match against stored?

mysql database
when a user logins
after i verify correct credentials….$session-login(USER, PASS)

so just add another column called ‘lastdate’ or something

and then write the time in there each page load?

yes

or update
update the lastdate coloumn
column*
where user = user and pass = pass

then u do a query that checks all people who have made an action in the last 5 mins

how would i do htat?
ohh
get all the lastdates

get the current time then take -5 seconds

and calculate time

then look for last dates

5 seconds? would it not be 60*5 for 5 mins?

if (lastdate = time()-5) { check if user’s session variables are still set..if not delete the value in lastdate..if so update there time }

not a =
id use a

err ya psuedo code
;p

and yeh alex is write
should be 5 mins
not seconds

if the time then is less the than the time now 5 seconds ago?

heh ya

any good alternatives to SOAP?

shower gel?

or any way of sending a file through soap?

xml

oh no that sort of soap i can live without

but when it submitted, the value was “select option” which sucks.. what’s the best way to deal with this?

i still can’t comprehend that if statemnt for some reason… if (LASTDATE time()+300) { }
bi still can’t comprehend that if statemnt for some reason… if (LASTDATE time()+300) { }/b
D:

z4chh if LASTDATE smaller then current time + 300 seconds
what part dont you get?

1 sec let me think

2 things I can think of. 1) make sure both have the value=”" (very important), and 2) make sure you aren’t accessing a cached version of the page

how do i check which directory i am at now? like i am at /blah/index.php, i want to get the blah

NET||abuse maybe set value to something else then an empty string

getcwd() I think

webmasttroy, i’m going to verify the effect here on my machine ,, it does seem odd to me that it didn’t use the empty value….

if you want the absolute path, try dirname(__FILE__)
If you want relative path, somewhat more tricky, but not too bad

oh yes of course

Jacky there’s also something in the $_SERVER array

try looking at script_filename in $_SERVER

but if all you want is check the curr directoy i thnk getcwd is the best

im not for the filename
i want the directory name

ok i got it…that would return true if i want to check something every five minutes

is there anyway via PHP to check if the mod_rewrite module is enabled in Apache?

when that returns true, how would i check if the user is still in session?
should i log a session id to?

how do i use getcwd?

if ($_SESSION[id])?
;

php.net/getcwd

if (session_is_registered(id))

no i dont want the absolute path

oh ok so i do log then session id in the mysql db?

i mean an identifier that i can use to parse the directory name

the&
the* :|

Jacky without arguments, it will return the current path i guess… look it up in the manual

what are you trying to do?

oops that was depricated, set _SESSION['id']=something, then check if _SESSION[id]===something after the wait

turns out there was a typo in the option tag.. value spelled vlaue

probably would work

cheers anyway

Jacky .. you want the relative path where your file is in?

===?

that’s the strict comparison operator

ahhh

it’s like the == exept it also checks for the type
that is if both compared variables are from the same type
for example true == 1 is true
but true === 1 is not true. only true === true will return true

Hi, has somebody here installed memcached?

joux all my frinds

anybody thinks that a search engine for filenames would be popular?

DavidHKMrPowers, ask google!
And the picture search

let’s say i have a controller called notes and a method called tag. the url would look like localhost/notes/tag. What do I have to do to make it localhost/tag instead?

David well there is already really much of them

I am trying to make a simple mysql class to connect to mysql database, while also parsing variables from a simpleXML file…. The only problem is that I keep on running into this error : Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in … The actual mysql class is
here : http://genbin.net/includes/mysql.php.txt

ckoehler regex

DavidHKMrPowers you can search for filenames through google

or dirname() thing
ckoehler dirname give you one level outside, and basename() gives you basename

How to set opened file’s cursor to 5th line?

DavidHKMrPowers exept for .exe files !

You want to be doing ‘$this-conn’ instead of just ‘$conn’ inside the class functions.

SettlerX well i would use $a = file(“Yo.txt”); $curos_fifth_line = $a[4];

Similarly for all class variables.

aa^way rolfen google doesn’t search filenames well i think

it does when you use it correctly
it even has regex based searching hehe

Octalthorpe, But does that matter, the this statement just declares it into a variable

google is really awesome thing im telling ya

Well, see. __construct uses $conn, so $conn is local to __construct.
Your close() accesses it’s own, completey different local $conn.
So in close() it’s not, in fact, a valid MySQL resource.

so there’s not an easy way to make all link_to for controller notes and action tags to go to just localhost/tag/ ?

Octalthorpe, But arent __constructor functions public throughout the class ?

aa^way do you search filenames lik this? “beatle.mp3″

Well, sort of. Remember that example where it does $a=0; function foo() { $a++; return $a; }, and it doesn’t access the same $a both times?

DavidHKMrPowers let me see

ckoehler no idea

yeah

It’s the same thing with class functions. If you just say $conn inside a class function, it’s going to make up a brand new $conn and use that. You have to tell it to use the one that’s part of the class, by doing $this-conn.

okay thanks
i know i can make urls go to any controller and action via routes, just wondering if i can do the reverse
and build links that do that in the first place…
oh my goodness
wrong channel….
i am an idiot…..
haha

controller?

google handles this pretty well: “file.mp3$”
basically everything ending with .mp3 ( URL )

What kind of controller were you speaking of?

well doesnt work on usual google but im 100% sure there was some arguments to sort out to show it only .mp3 ending answers, google owns all but works on www.google.com/codesearch so you can get everything you need

I am trying to make a javascript.php file that will read a .js file in a non public folder, and serve the contents to a broswer. I can do this, but I don’t know what header()s I need to set so the browser will interpate the javascript.php file like a js, not a php.

aa^way you may be looking for ext:.mp3

rolfen yep thats it

Octalthorpe, Let me run a test query… Just changed the variables and right now everything looks good… I think I may kiss u because of this

aa^way actually that’s ext:mp3
without the dot

If you’re not a woman, I’m not interested.

is considered html

I know
the entire file is within ?

and JS is basically html for this respect.

Octalthorpe, lol

then, don’t do that, or escape it.

I think you’re missing my point. HTML pages are read text/html in the header, so when apache generates a .php file it sends a header saying its text/html. CSS are text/css. I need to find out what i need to put in the header() so it reads as javascript.

JustinCarmony try text/javascript
JustinCarmony also try that Content-Script-Type: text/javascript

actually, how does google works? where can it find all web sites existing in the world?

Octalthorpe, Yes! It is alive!
Octalthorpe, Thanks so much

No problem.

it was ruby on rails, totally wrong channel.
so no surprise my question and answer probably didn’t make much sense

DavidHKMrPowers technically, you cannot find all the websites existing in the world, some might not be linked to any other website hence may never come up in searches

rolfen so…where to get a directory?
search from o.o.o.o to 255.255.255.255 ?

David Haskins!

you mean probe every IP
i think google starts with some known pages then follows all the links it can find

don’t know how crawler/spider/search enginesdo it

i dont think google does any ip probing
but i could be wrong…

rolfen i want to search for filenames. where should i start to make a search engine?
i think i would use php to do it

i dont really know… i am googling for how to build a search engine. found this http://www.symfony-project.com/askeet/21

um. Why?

Is it wise to use mysql_close($link); ?

DavidHKMrPowers but that will explain how to build a text search engine. for a file search engine a lot of that stuff would be usesless.
DavidHKMrPowers you need to parse pages and detect all links to files… and add these to a database

“search engine” usually requres very complex algorythms and very deep knowledge of database structures.

DavidHKMrPowers but really i think it has already been done by someone

rolfen Wolfpaws ya, thanks maybe i go to search for existing apps first

tsk tsk tsk

I’m using explode() to get keywords from a file to put into me database. Thing is how can I keep it from parsing words such as “it”, “you”, “me”, “if” etc.?

make a filter?

How?
Loop through the output?

yes

How would I delete the value and not just make it null? Like so that mykeywords[5] is deleted and does not = “”?

unset( mykeywords[5]);

$value ) { if ( in_array($value, $badwords) ) { unset($array[$offset]) } }

Thanks very much!
Do I have to increment $offset?

what do you mean? HarryP’s loop should work

Ok
Ok, but what should $value contain?
And backwords should be an array with the words I don’t want in it?

it may be missing a semicolumn though….

offset is the name of the array field, and value is it’s value

Hi for all!

$value thats what you get

I thought $array was the $array field? O.O
So where is my array, $offset?

$array is the array that you are iterating AS $offset=$value
or $field=$value

hi does anyone know of a really secure login script i can use

Please, I’d like some choice what’s the best webirc/webchat? (please no fluds)
Sorry my English is not good.
I think phplib is good.
sf.net/projects/phplib

#ffmpeg isn’t good for shit

ok i will check it, thanks sardano!

I hate it when nobody helps you in an irc channel

not at all

Anyone bored want to give me feedback on a design?

What’s your question?
josh[n00b]: What’s you doubt?

http://www.anonymous-browsing.com/SpottedHere/

So I have a problem… I’m trying to watermark some flvs. In the watermarking process the flv loses sound. Also it’s aspect ratio gets messed up. http://pastebin.com/m2b264690

Excuse-me but I can’t help you.

Forget about it

To use the recommended bundled version of the GD library
use the configure option –with-gd ..

josh[n00b]: Go direct to the point, what’s you doubt?

Note: When compiling PHP with libpng, you must use the same version that was linked with the GD library
Now if I want to use the recommended version of GD supplied by PHP, how do I know which libpng to use?

does this look secure http://www.devshed.com/c/a/PHP/Creating-a-Secure-PHP-Login-Script/

Just need feedback

josh[n00b]: What feedback you need?

Hey guys…

howdy

everything looks like.. does how is the look & feel.. etc. just normal shit

I had the idea of buffering flash webcam output into a cookie before sending it all to the server?
what is the viability of this option?

josh[n00b]: look & feel appears very good.

drewby….


?

you want to send video over cookies?
i dont think cookies can be that big

And about my question, someone can answere me?
Please, I’d like some choice what’s the best webirc/webchat? (please no fluds)

4kb per cookie
dag

yeah, you should check the _SESSION[] against the database every page you load because those SESSION are stored on the client and could be faked

Comments off

Not strictly Javascript-related but Im looking for general opinions on this if I have a hierarchical site does

well… w3c is in my opininion the best thing ever happened to the web….

function show () {
alert (“show called”);
document.getElementById(‘followup_tm’).style.display = ‘block’;
}

grimboy_uk, It’s a useful and elegant looping mechanism

true story tarnap

Nicer than for (var i = 0; i array.length; i++) for sure

tarnap, They have done good things.

w3c would rather not use js in favor of what?

tarnap, heh

show = function(id){var e=document.getElementById(id); e.style.display=’block’;}

tarnap, 10 more overengineered, annoying standards, please!
Be sharpish!

ehird`: one is for object properties, the other is for arrays, they’re not really related

yours should work too

ehird`, Just do define a function forEach that takes a function.

insin, it’s perfectly acceptable to use for (index in array)

and passes it an element.

i’m an overengineer… i prefer it that way

Um, not element.

do you have a link?

how can I unselect one or more radio buttons when i click a specific radiobutton ?

Index.

I think something is wrong with my radio buttons – input type=”radio” name=”time” value=”other” onchange=”show();”Other

giving up that just because js is stupid in that it messes up on extension is silly

I don’t unfortunately

anyway… is there a way to change the rule given in the css style sheet?

yea that

ehird`, huh?

ehird`: it doesn’t mess it up – you just want to use code which doesn’t take that into account without having to modify it

grigora onclick

if i use the style attribute my tag get’s an style=”whatever: value;”
and really… i don’t like it

let me try that

tarnap, you can do:
e.style.prop = val

ha ha i made such a nice script bye bye

e.style.background = “#000″;

insin its fixed now? http://www.orangesense.com/demo/demo.php

doesn’t work

ehird`: but e.style.prop sets a style=”prop: value;” and i don’t want that

tarnap, What’s wrong with it getting a style attribute?

tarnap, boo hoo? what’s wrong with that?

well without a link, or you giving me some sort of debug output, i can’t help much. are you using IE or?

tarnap, This is an unjustified hate.

Firefox

well… i don’t like having style elements in my html

tarnap, You’ve just blindly believed what you’ve been told.
tarnap, Without questioning.
tarnap, What is your justification?
Apart from having been told it?

they belong into the css stylesheet not into my html

Hmm?

you can try creating a definition .hidden { display: none; }

let me try to create a smaller page, script and see if that works and maybe I can paste that for you

the thing is… i want to upload the html later on

Well then create another class.

and the stylesheet

… /div

tarnap, Create another class then, in your stylesheet.

without having to clean it…

tarnap, And give the element that class.
tarnap, But if you want fades, etc.

then do function show(id){var e=document.getElementById(id); e.classsName=”;}

so there’s no way to chage the stylesheet with js?

W3Schools is the best thing to happen to the web i think

tarnap, That ain’t going to cut it.
This is so unfair.

necromancer, :P come on

Now I just have to feel angry but can’t hit you, 1) cause of the whole not being here then and 2) because it was a joke.

necromancer, I’d rate google and wikipedia higher

well W3schools is the best thing to happen to my job
but yeah Wikipedia is ridiculous

necromancer, what’s your w3cschools utilizing business model :P ?

`js w3schools
dagnamit

hello, I’m using javascript the change the img.src attribute on mouse over (from thumbnails to realsize), the problem, is that it sometimes work well (image source gets changed as soon as mouse is over it) but sometimes, I have to scroll a little so that the change is made, I tried waiting
longer but the image isn’t changed until I scroll a little in the page

so questions are, is it normal? Is there a way to do a kind of refresh to the image hosting with javascript?

to me, my bots!
`w3schools suck

w3schools are NOT (despite their name) related to the w3c. Their code contains deprecated code, bad methodologies, IE-centric code and mistakes.

insin, shit happens
let’s face it though, a w3c based w3schools would be just as useless
the good practice is somewhere between bad methodologies and scrict specification adherence
and the the point is determined only by experience :P

a separate file with just that code works fine. however the main page does not work, in fact when i click on the radio that’s suppose to make the div disappear, what disappears is the radio button itself, it’s so weird, because a simple cut and paste works in another file …

.. i just wish Array.prototype didn’t break forin

using classnames does the job… but still… i will search for a “better” way

hmm i don’t know what to say.. Sounds like conflicting javascript function names or something. Are you using other javascript hosting on the site
try renaming your functions. like my_show() and my_hide()

how do I unmark a radiobutton?

I am using a fair amount of ajax, so maybe there is another function names the same
i am also trying show = function () {} constructs

thats fine. either construct should work. try renaming the functions.

that’s what it was thank you so much!

sure. Make sure you test in IE
IE doesn’t like it when you directly access elements style attribute

thanks for the heads up, I’ll do that when I reboot

haha it’s because i’m a shitty two-bit programmer and i go on W3Schools as a JS and html hosting tag/function reference
(X)HTML*

hi there. i have a quick question i wasnt able to locate an answer to while googling
if i have an array of integers, whats the best way to test if a specific integer is in my array

loop through it until you find it?

[1,3,7,14] – and i want to know if 7 is in there …
yeah, thought there might be a slightly more efficient way

If you need a faster way, google Binary search and implement that

thanks

necromancer
cool

ah – thx for that jargon hint

But for an array of size 5 or so…you dont need a complex search algorithm. it would be very helpful if the array got bigger.

necromancer, I’ve always found googling better than going to one specific site though

Sorry, I missed a big chunk, has tarnap been persuaded to let pragmatism into his life?

righfor now its only 50 or so big, but i have something coming up with much biger arrays …

what?

Look into search algorithms a jlivni_, there’s value to actually learning something instead of blindly implementing it

yup. reading on wikipedia now. thanks

tarnap, Have you realised that css is good because it allows stuff to cascade though several pages but it isn’t a religion.
Since javascript setting style attributes based on class does exactly the same thing.
And in some contexts is the right thing to do.

yeah… but i want to upload the code generated by my script

Or are you still “Oh, I don’t like it…”; “Why?”; “I just don’t like it…”.
What do you mean?

and this code should _not_ have style in my tags

It doesn’t have style attributes in your tags.
The html is still clean.

if you use e.style it will set style in my tags

In the dom the tags have a style element.
Yeah, but only in the dom.

does anyone have any experience with the window.resize event?

i upload the code of the dom…

I have a button, which I want to call an action, that removes it’s current parent container. divbutton onClick=’this.parentNode.something; return false;’/button/div. Can anyone give me some help with that?

tarnap, Oh?
Where?
How? Why won’t the let you use style tags?

to my serverscript which stores in into a databse

Can’t you just have two classes?

i don’t want to… but the classes-thing works

Oh, okay then.

it’s not the most proper way
but it works

What *is* the proper way?
I never understand this?
To go, and edit the stylesheet?!?

exactly

a-l-p-h-a: like this.parentNode.parentNode.removeChild(this.parentNode)?

It’s just ridiculous.

it’s fanatic

You’re a fanatic.

that’s what i am…

Anyway, enough.

insin, thanks. I have removeChildren, wrong syntax.
wait, that won’t work… :/
this.parentNode.parentNode.removeChild(this.parentNode);
insin,, hahaha nm. I didn’t see your line.

element and its getImageData/putImageData methods?

well.. it’s time to sleep…
midnight in switzerland…

boah krass. bi mir au

hahaha funny

züri?

wer seit dass i en düütschschwiizer bi?
in züri schaffi nur…

can I count the number of keys in an array?

und müesst würklech go schlafe

Hmmhesays, arr.length

okie. gn

merci, dier o

] but all I ever see in FF is [ Object Object ] no matter what type the object is

I’m setting the Class.prototype.constructor to the constructor of the subclass

setting?
prototype.constructor?

well, I’m just tryign to print out the type of the object
the book I’m reading says it may get it from myObject.prototype.constructor..
but I’m quickly becoming disappointed with this.. o’reilly js 5th ed.

is that exactly what is says?

how do i keep from scrolling to the top on onclick function calls?

[object class] class is the internal type of hte object and usuallky corresponds to the name of the constructor function for the object
sorry for typos, just typed while reading the book

you have a link to #, right?

but no matter what I do, it always says [object object]

yes
i’m working on nested comments with a slide out form for each comment.
but when the form slides out the browser scrolls to the top

it says “[object Object]” even though I say “alert(new Foo());”

because you’re linking to the top

how do i prevent that?

don’t use a link

let me see

or cancel the click event

you’re suggesting i use a form for the onclick function call?

no

function Foo(){}; alert(new Foo().prototype ); displays undefined.. is that weird?

what does it do exactly?
no, that’s normal

i could just anchor each href to that forms id.

why doesn’t it have a prototype object? shouldn’t it have a prototype of type Object?

are you using IE?

ff primarily, but I’m checking in IE periodically, too
same results

most objects do not have a property called ‘prototype’
they have prototypes, but not a property of that name

deltab, but if they do have a property called ‘prototype’, that’s a ‘magical’ property?

it’s usually only constructors that have properties called ‘prototype’

oh right

this is crazy i’m having trouble returning a value from a function, I keep getting undefined

not really, though on a function it has a special use

right. I understand. I still don’t quite ‘get’ javascript.. it’s slowly sinking in

foo.constructor.prototype, not foo.prototype

Foo.prototype works.. afaict

when Foo is a function

foo.constructor == foo (normally), right?
yeah

no

function myFunction(){var string = 1; return string;} var retval = myFunction(); alert(retval); gives me undefined

deltab, pondering…

foo.constructor == Foo

ok

after foo = new Foo

‘yeah

Hmmhesays, I get 1
Hmmhesays, Which by the way isn’t a string

Hmmhesays, me too
Hmmhesays, I get 1

Is this IE?

in ff

hmm something goofy going on here

I get 1 in IE, too

function myFunction() {var string = 1; return string;} var retval = myFunction(); retval;

1

function myFunction() {var string = “WTF”; return string;} var retval = myFunction(); retval;

WTF

well I simplified what I was doing
maybe I’ll pastebin

oh, if I had read ALL of the paragraph in this book I was reading I would have noticed it answered my original question later on.. *sigh*

var string = ajaxRequest.responseText;
return string;
string is most definately a string there

how have you tested that?

by putting an alert(string); in the middle of that

Hmmhesays, is this in rhino or what?

firefox
I can return from anywhere in a function right?

what if you just return ajaxRequest.responseText?
right

same result
and I can call a function within another function right?
this just doesn’t make sense

From the current DOM object, is it possible to find it’s next sibling table object?

someone here know or have used dom-drag.js ?

I just do not understand this

Hmmhesays, can you sum up what your current problem is? maybe with some code?

sure
coming up
http://www.pastebin.ca/633766

The paste 633766 has been copied to http://erxz.com/pb/3774

Hmmhesays, what are you expecting it to get set to?

var string = ajaxRequest.responseText;

that’s wrong
I mean.. your expectation

hmm

that’s not the return of ajaxFunction
ajaxFunction doesn’t have a return value

bah, you’re right
ajaxRequest.onreadystatechange = function() — i’m returning from that function

which makes no sense
because the callback doesn’t want any data from you

I want to return the data I get from the server

it’s just letting you know an event happened and you’re like “Here’s my answer” and it’s like “WTF? All I did was say there was a state change”
ajax = ASYNCHRONOUS …jax
you don’t get a nice “return” from it..

state 4 says we’ve got a response from the server var string = ajaxRequest.responseText;

yes
what do you want to do with that?
it’s an event

ajaxReuqest.responseText; holds that value

you have to handle it with event-driven programming .. style or whatever

ajaxRequest.responseText; holds that value

yes

there might be other states before that

he gets that

oh

he doesn’t understand event-driven programming
he’s thinking synchronous start-to-finish programming
and it doesn’t work

yes, but only if state 4 do we call ajaxRequest.response.Text;

Hmmhesays, do whatever you want to do with the data IN the function (closure) you’re assigning to the callback
don’t return it for something to do something with it later.. just do it right there

i must do it that way?

umm.. there are other ways.. but that’s generally how event-driven programming works
when you get notified, you do your work and then wait for your next event/notification

hmmm

you can make your xmlhttprequest synrhronous (the second parameter).. but that’s really not the right thing to do

wasnt xaxxon an 80s arcade game?

zaxxon

when you open it, if you say ‘false’ for the second parameter, it will make it so you can do something more like what you’re trying to do.. but it will lock the system while it waits for a response

oh right

xaxxon, 3rd parameter

yeah thats no good

yeah, that was zaxxon.. my name is just a typo of that
pfn, oh, ok
Hmmhesays, yeah, that’s not what you want

(METHOD, url, asyncmode, login, pass)

what do you really want to do with the value you get back? not “store it in a variable” but .. what’s the real goal?

its a string from a db that I want to populate a table with

so in the onreadystatechange callback, populate the table

each row is val1,val2,val3 seperated by
&

if you need the table as a parameter, pass it in to ajaxFunction as a third paramteer
you can use variables you pass in to ajaxFunction in your onreadystatechange function/closure
and it will ‘remember’ them.. that’s at least part of what closure means.. it will remember the variables it had access to when it was defined

you may want to consider a different sepearator if its not a hassle, & can get handled in wierd ways depending on the context

yeah I can change that

Hmmhesays, I have to get going.. but do you understand what you’re doing wrong and the basics of what you need to do to get it workign?

but, I need to handle different return values depending on which table I need to populate

that’s fine. do all that in your callback

ok

if you want, for style issues, you can break it out into another function..
and call that.. but just to get it working, just do everything right there in the middle of ajaxFunction
*later*

so ajaxRequest.onreadystatechange = function(someparam){
right?
nevermind

so i got 4 different forms on one page, and upon submitting one i’d like to submit it via xmlhttp as a normal POST to a url, and not refresh the page, but just replace the content of what he form was, any general suggestions on how to do so?

Hmmhesays, no, you pass them into ajaxFunction and just use them inside the {…} of your callback function
the only things that get passed into the function itself are whatever onreadystatechange gives it
which, I believe, is nothing

Hello all
Is it possible to determine the currently “focused” field in a form?
Let’s say I have a link on a page that’ll concat the date to my focused field. I just need to figure out which field is in focus.

won’t clicking on the link cause the input to lose focus?

Well.. it’s actually a “bookmarklet” for Firefox. I’m trying to help a friend out.

Keep track of it with the onfocus event

one thing you could do is have a variable which tracks the last focused input and add event handlers to all inputs to update the this variable onfocus

Unfortunately I can’t. It needs to be generic.
There’s no way to scan a form and run isFocused() or something like that?

Don’t think it’s possible, then, I’m afraid.
No.

There’s no property of an input field that tells you whether it’s currently focused or not?

given that the act of clicking a link would move focus to it, no

It won’t be a link though. It’ll be a bookmark on the toolbar of the browser.

I am in firebug, looking at my gmail and I execute this http://erxz.com/pb/3775 Can anyone tell me why it returns zero?

It doesn’t remove focus from the input field.

oh right

At worst, I loop through all the forms on the page, looping inside each form for each field. And on each field, I check “isFocused()”
But I need to know how to track down that property.

There’s no such property insofar as I’m aware.
Only the event.

There is, according to google.
input.focus
http://www.thescripts.com/forum/thread503195.html – I can probably adapt this

focus() is a method that sets focus on the element

ok when my callback happens, there is nothing wrong with calling another function to build my table

There’s also the property focus
i.e. if (nextEl && nextEl.focus) nextEl.focus();

Methods are properties, functions are objects in Javascript.

that’s checking if the element supports the focus method

Oo, that’s no good.

I just add eventlisteneres onfocus which sets a property isFocused on the object, and a method has Focus which returns the isFocus-property

Not an option here

why not?

It’s a bookmarklet
For that to work, it would have had to have been set before focus was set on anything
But the bookmarklet can only run code when it’s activated
Although, you could break it down into two bookmarklets

yeah, allrght, I don’t do bookmarklets

One to set everything up, then another to actually do stuff once focus has been set

but userscripts though, that’s fun

Slightly less convenient, but still workable

Yeah… may be unworkable to this guy.
I find it very hard to believe that you can’t determine whether a field is focused or not.

Damn

I’m still googling like crazy. I have two loops to loop through each field on each form.
I just need the if(…focused…)

doesn’t exist

Of course, experts-exchange.com has an answer, but they’re holding it hostage for $15

Hah, yes
And it’s probably the onfocus solution

Julian|Work, just look at the google cache

Nah, it’s still hidden, unfortunately

URL?

hey guys can you come in #MikeyPizano i need to test out a new irc bot i setup, thanks

Eh, I closed it
Thanks anyhow guys.

remember any of the text of it?

Oh, I can find it
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21282115.html

any of you know of a css only treeview look?

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_20993110.html?cid=335

Were you hear yesterday but under a different nick?

according to the latter, document.activeElement and element.focus

, it only works (meaning opens up the link in new window) the first time? and does nothing the second time? it just does nothing. any ideas?

im getting window.open is not a function error
btw, i did add a closing “

no, i’ve been idling here with the same nick for over a week

IE has it, Opera has partial support
http://my.opera.com/hallvors/blog/2007/05/16/quick-spec-for-ies-document-activeelement

how do var_dump an object?
how to*

que?

well, was it YOU then who asked that question yesterday or something?
I myself use FireFox with Firebug and do console.log(“%o”, myObject);

how do I programmatically reset the value of a select dropdown? thanks
object.value = ”; does not seem to do the trick

try .selectedIndex = 0

so i got 4 different forms on one page, and upon submitting one i’d like to submit it via xmlhttp as a normal POST to a url, and not refresh the page, but just replace the content of what he form was, any general suggestions on how to do so?

im getting window.open is not a function error

, it only works (meaning opens up the link in new window) the first time? and does nothing the second time? it just does nothing. any ideas?

well, you generally, add an onsubmit event handler which cancel the submission, serializes the form’s contents, makes the request and deals with the response
most JS libaries have tools to deal with all of these steps quite easily

insin; i have to serialize? i cant just have it post the same what it would as a submission?

deltab, but still no firefox?

thanks, it worked

coming in version 3, according to http://www.telerik.com/community/forums/thread/b311D-mmhae.aspx

you have no way to access what it would have submitted otherwise

Do I have to do mySelect.selectedIndex = 4; rather than myOption.selected = true; ??

deltab, that’s a shame. Thanks for looking into this.

anyone? deltab .. you’re a windowzer .. Jan- you too ..

Yes, IIRC

only at work

Mm .. that doesn’t seem to have worked either
:-/

is there something the holds the number of columns in a table?

is bad. do not do that.

If the select is in a div that is display:none, is that going to kill it?

Huh? .selectedIndex = n not work?

no

It shouldn’t do…

2

priorities.selectedIndex = optSelected;
^^ nothing is selected (ie, option zero)

And priorities definitely has 2 options?

yup

:-\

by the time I call this it has 6

:-/

Take care, all

yup, 6
Weird
if I alert the outerHTML, it’s as expected

It’s always worked for me.

Ahh
– moron

Heh, what’d you do?

When I ‘unhide’ the div, I set the selectedIndex to zero :-D

D’oh

thanks :-D

heh
WoooooooSTA!

Heh

Well .. I call reset() on the form
And as the form has only ONE option at load time, reset() sets the selectedIndex back to zero
Unlike FF, which is smart

Heh

FFS
I can’t medle with defaultValue in IE either

what’s the command to detect client again?
mozilla and ie6 is what I want to detect

no you don’t

for what reason?

you want to detect if the current browser supports whatever you want to do

Not strictly Javascript-related, but I’m looking for general opinions on this… if I have a hierarchical site, does you reckon it makes more sense to be strict and require that the author chooses only one parent for each page, or loose and allow multiple parents?

if you want to use layers, check if it has layers

deltab, err, I just want to know if the client is ie6 because it doesn’t work the same the other clients do

Heheh

yes, but in what aspect?

no i didn’t ask yesterday

My pedanticism says one parent per child. My experience says that doesn’t always work. My spellchecker says pedanticism is a real word and is spelled correctly. Spell Checker++

Hehe

Eg. at work we have multiple products

ok, mutv.missouri.edu/dreamy/ the titles below news, sports and fashion expand fine if you click to the right of the title in ie using the overflow: hidden or visible command, in firefox, I use changing the height from 20px (since I only want the one line to show at most to auto height which
catches everything.

Each of those products has a section on the website. Each section has case studies.

what’s the easiest way of padding single digit ints with leading zeros

`rpad

However we also have a ‘case studies’ area that is a collection of all of them
`right-pad @ deltab

right-pad: function rpad(num, places) { return (num.toString().length places) ? rpad(‘0′ + num, places) : num; }

it’s left padding, by the way

yeah

Mm, Haskellish.

I might move it and put a note there

Shouldn’t we update that to reflect Jan-’s insight?

nah, that doesn’t hold for this
`repeat

function repeat(string, rpts){ return Array(rpts+1).join(string) } OR String.prototype.repeat = function(rpts){ return Array(rpts+1).join(this) }

It’s OK. I’ll do it with a ternary operator.

^^ that’s it there

I know it will only ever be an int 0-99.
DVD titles. Never more than 99 on a disc.

Really? Add zero repeated (places minus length)
Should be more efficient

n 10 ? ‘0′ + n : n

learn left-pad = function pad(num, places) { return (num.toString().length places) ? pad(‘0′ + num, places) : num; }

OK

deltab?

actually, you might be right

for Jan-’s particular case

More general is always better

thing is, Im’ writing a dialog box here, so I don’t have my general libraries available.

more general is harder to understand

In this case, I tend to just bash through stuff as fast and dirty as possible

But also more useful. And hey, that’s what comments are for

eeeh.
Never, ever use while(!atEndOfStream) when reading text files.
Totally locks up the app.

Jan-: atEndOfStream?

If atEndOfStream doesn’t change.

Jan-: eof wasn’t good enough for you?

A property of the textStream object returned by any of several methods of the ActiveX control fileSystemObject.
Meant for VB programmers.
So things tend to be called thePropertyOrMethodThatDoesThingummy.

Ouch.
No capital initial?

I don’t think ActiveX cares, actually.

I’ve compromised: I’m designing it to have one main parent, then multiple “supplementary parents.”
I’m designing it to have one main parent, then multiple “supplementary parents.”/u
So it’s only prominent in the main parent, but exists in the supplementary parents.

I got it, sorry for bothering everyone

Jan-: ’s logical

Twey, did Perdente ask a sensible question?

janpad = function(num, places) { return (new Array( places – num.toString(10).length )).join(‘0′) + num.toString(10) }; janpad(16,10)

000000016

janpad = function(num, places) { return (new Array( places – num.toString(10).length + 1 )).join(‘0′) + num.toString(10) }; janpad(16,10)

0000000016

sorry, was distracted

Jan-: No
Jan-: Browser detection.

Goodo.

deltab, no its cool, I finally found it on w3c, anyway, now it works like a charm on both browsers

Oh well that’s a reasonable question.
The reason I ask is that he doesn’t have to be sorry for bothering people with a *sensible* question

And what about the rest of them?
Heh

w3c?

twey, hahah
yeah

*TWEYYYY*

Since when do they have JS snippets?

Jan-: Hm?

twey, isn’t ie6 really the only one that gives problems

encodeURIComponent(‘+’)

%2B

Can be, but feature detection works even there

twey, I made it so that if its not ie6, it runs the rest the same,

if(window.event) and the like

like if (ie6){}else{}

Just because nothing else *does* work like IE, doesn’t mean nothing else *can*

prototype.js can lick it… it breaks Array.. how stupid…

And OmniBrowser tends to trigger all such browser detections

janpad rocks
http://xrl.us/3gb5

It doesn’t break Array, it just unwisely adds some properties to .prototype on the sly

janpad?

I wish I was as smart as you

If you code carefully, it’s not a problem

it breaks many parts of array

forget rightpad

FAIL

twey, well originally I had code that worked with my firefox and I thought it would work for all, and ie6 was the only other browser that acted funky, if you can find another browser that acts odd on it, but the javascript code I wrote for ff works fine in general

forget right-pad

OK

forget left-pad

OK

how would I reenable it in JS?

.hasOwnProperty() loves you

foo.disabled = false doesn’t seem to work

for(i in array) breaks

check out How To Be Woosta For Dummies on Amazon

`for/in @ helloRobot

for/in: Loop over keys in an object, skipping prototypes: for( var i in Obj ) if( Obj.hasOwnProperty(i) ){ … }

Jan-: should work

Bah, it does. I had disabled=’false’;

Jan-: Heh

too much playing with xml.simple

!!”false”

true

Where did you learn all your javascript madness

Doesn’t work when setting a button to enabled.

learn pad = Zero-pad a number: function pad(num, places, radix) { radix = radix || 10; return (new Array( places – num.toString(radix).length + 1 )).join(‘0′) + num.toString(radix) }

OK

learn left-pad: see `pad

= value

learn left-pad = see `pad

OK

is that faster?

learn right-pad = see `pad (it’s really a left pad)

OK

http://xrl.us/3gb5

Yes

significantly

cool
thanks Jan-

(note I’ve added an optional ‘radix’ now ..)

Sweet, ten times faster

what is

Jan-: Your pad method
Jan-: Well… not technically yours, we took your idea and ran away with it

function pad(num, places, radix) { radix = radix || 10; return (new Array( places – num.toString(radix).length + 1 )).join(‘0′) + num.toString(radix) } pad(12,6,16)

00000c

function pad(num, places, radix) { radix = radix || 10; return (new Array( places – num.toString(radix).length + 1 )).join(‘0′) + num.toString(radix) } pad(12,6)

000012

How many damn times do I have to tell you I’m a GENIUS.
I need a lookup table for translating country codes into friendly language names.

Hehe, I propose we comment `pad in favour of Jan-

You know. en = English, de = German

ISO country code?

Whatever DVDs use.

hi guys

So one presumes so.

Coz those two appear in ISO as well as DNS as well as a couple of others

Um, er.

I’d assume ISO for DVDs

Jan-: where do DVDs use those?

me too

ISO-3166 I believe

yes
very likely

in the IFOs, describing the languages on the audio and subtitle tracks.

is there any way to do something like this – element.style = { display: ‘block’ , float: ‘left’ , color: ‘red’} ?

Has to be standard because the DVD player has to put it into its OSD.

none of the snippets in the bot are credited .. we’ll all just remember that that was Jan-’s stroke of genius

Heh, OK

not directly

sad

You can use any standard object merging function to do it though

you could do: foo.style = style({ display: ‘block’, color: ‘red’ })
the style() fucntion would be easy

One question, how can I set a global variable only one time?
I mean, only the firs time
I remember something like define once or something similar…

if(typeof globalvarname === “undefined”) globalvarname = value;

D
D’you guys think this is sufficient to test for the presence of a DVD:
f(!fso.folderExists(dvdDevice+’/VIDEO_TS’)){

thx

But, globals are bad *looks accusingly at Jan-*

oh, ISO 3166 is country codes; ISO 639 is language codes

Aye

I suspect this is language codes.
I want de = German not de = Germany

it is
http://dvd.sourceforge.net/dvdinfo/ifo_vmg.html

i thought about some elegant way to clean up my js stuff .. i know that i can do it with libs , but i hoped to be able to make it work in bare-bone-mode

I have to take decissions depending of the keypress in pairs

Ooo, so THAT’s how IFOs work.

So I think I need it…

I couldn’t make head nor tail
DVDs are actually shockingly complicated once you get in there.

Aye.

They do a lot of stuff that’s not often used.
You can’t .value on a SELECT, can you.

For example I want to exec a function depending if user press Y or N, and after this if user press again Y or N and depending of what previosuly pressed make another action
How can I do this without using globals?

Jan-: in some (most these days) you can

Jan-: You can
Jan-: Just not in IE.

hi

In your case, you’re targeting a known browser, so you can be sure

I’m using keyPressed callback

foo.options[foo.selectedIndex].innerText?

a = new Image(); a.src = “a.gif”;

for (var property in declarations) { element.style[property] = declarations[property]; }

will the above code block until a.gif has loaded?

No

excellent

The image has an onload event

and that’s enough to “preload” it, right?

Aye

ok, great, thanks

Meh, heh. Apparently, the reason Mplayer takes ages to scan a DVD is…
…. that it’s doing a cryptographic attack on the CSS.

Jan-++ .. the best way I’ve now found to debug IE is exactly what you say: add linebreaks and compare the line number change

Heh

Meh, heh, heh. And it takes “annoyingly longer than just reading the disc”.
That’s great.

Nice.

karma Jan- clever

OK

karma Jan- clever

OK

Haha

You’re using crip techniques now.
What HAS become of you!?

(one for the repeat, one for the linebreaks)

http://www.berniecode.com/blog/2007/03/08/how-to-debug-javascript-with-visual-web-developer-express/

Pfft

Doesn’t run under wine, I’m afraid

No idea what it says, but unless someone wrote firebug for IE (that isn’t as stupid as FB-lite) I don’t believe it

I never got FB-lite to work

it sucks

Just before you all get too impressed with me, I just did this:
title = parseInt(vidSel.options[vidSel.selectedIndex].innerText.split(‘ ‘)[1])

It… didn’t do anything.

it just has a FB-like interface for IE’s stupid error messages

Haha, oh.

Twey, heh probably not the best hosting way to use IE. I’d use a VM if were you

hello element43_laptop ..

But that’s *illegal* :-O
Oh wait, so is running IE under wine

Twey, yeah

Truly, I do have a VM
I just keep it the heck away from the Internet to avoid security risks

Twey, Well, it hasn’t ever gone to court.

The way Windows was meant to be run
Aye, not yet

I doubt ever.

I run IE in both vmware and wine .. wine is good for quick testing, but user assurance I’ll always use vmware
(and I just got OS-X to run under vmware too .. so I’m a happy camper)

Hehe
I have to try that at some point

See http://rick.measham.id.au/paste/bingo.png

Hey. Can I get some sympathy while you’re all singing my praises?

awwwwwww

Twey, I run OS X with xp in parallels and I have a dedicated IE7 laptop that also boots ubuntu
uTwey, I run OS X with xp in parallels and I have a dedicated IE7 laptop that also boots ubuntu /u

I have a *really* long penis

Hahahahahahahaha

Woosta, neat, do you often find it gets caught in doors?

Jan-: What are we sympathising about?

Erm .. I’m no door-fucker .. you weirdo ..

Someone I thought I knew quite well came up to me today and said “Wow, I’m amazed you can hold down a job.”

heh

Ergh
again?

:-\
Did you throw them over your shoulder?

I mean. God.
No, I set fire to him.

Woohoo

Ah, that’s always good too.

In my brain.
I mean for god’s sake :/
C’mon. Sympathy. Altogether now:

“Awwww.”
But yeah, less sympathy, more violence

Second time this year I think.

is this yours?

*whispered in the background where I apparently can’t hear* “Can we go there? Can Jan eat sushi?”

http://rick.measham.id.au/paste/explain.pl
a href=”http://rick.measham.id.au/paste/explain.pl”http://rick.measham.id.au/paste/explain.pl/a
a href=”a href=”http://rick.measham.id.au/paste/explain.pl”http://rick.measham.id.au/paste/explain.pl/a”http://rick.measham.id.au/paste/explain.pl”http://rick.measham.id.au/paste/explain.pl/a/a

What are we to do with these assholes.

sort of

hey.
no poke.

Jan-: how the FUCK could you NOT eat sushi?

Jan-: “Can Jan- eat sushi?”
Jan-: You say this is someone who knows you?

someone yesterday was asking the EXACT same question. a CSS only tree.

well yeah.
I don’t *go* out for meals with people I don’t know because frankly, fuck, yeah, my table manners aren’t anything to write home about.

the real work is done by a perl module .. I just take its output and move it around ever so slightly

In your opinion, is there any application for prototype.js or mootools etc that you feel actually necessitates one of those

But sushi is easy. I was thinking of getting white chopsticks.

Heh

But still.

I use prototype+scriptaculous if I want drag and drop .. other than that .. no

*snazzlefrazzin*

Hahahah

Jan-: I’m still an advocate of a hard Judou-throw.

what.

thanks. I will learn to not use them then. I trust your opinion / advice here

I can imagine these colapsible chopsticks with an elastic wristband so you don’t drop them ..

Does anyone actually *use* that wristband?

Haha

Yes, this means I have to carry two in case I drop one. Yes, this means I mainly end up replacing ones I’ve just randomly left lying on the street somewhere.
But *use* the *wristband*?
Fashion *disaster*

lol

Hahahaha

Jan-: do you just grab food with your hands and then shove as much food as you can into your mouth?

It is a sad fact that hand held food is easier.
Sad but true.

would that work with sushi?

Sure

You haven’t heard me on food, have you.

It’s like the whole “blind from birth” vs “blinded later” thing huh? There’s the ‘wristband geeks’ and then there’s the ‘cool’ crew

sure

W00t!

I’ve never handled sushi, but it looks conveniently bite-sized

Probably easier with sushi

lol

not sure how wasabi on your hands would feel though

It’s meant to be

You can’t eat sushi with your fingers.

OMG
that’s a good point

It’s not wasabi on your hands that’s the problem.
It’s wasabi on your hands – when you rub your eye.

Arrrghhh

*YAAAAAAAA!*

then you go to the bathroom …

How do you know how much wasabi you have??

Oh gods, that’s got to hurt

Not enough.

Hahaha

Never, ever enough.

Jan-++

Jan-: I love taking people into sushi restaurants who’re unfamiliar with wasabi

Unless it clears your sinuses right across the known universe, it wasn’t enough

Yeah *cackle*

They get a big dollop like it was mint sauce
Take a bite, and generally scream

Ooh, mint sauce, that’s a good idea.
s like mint sauce.

Hahaha

Oh fuck that didn’t go as planned.
Bleah.

That’s evil

Mmm. This is good. I’m going through the happy stage.

I mean, seriously evil

I think there is wasabi cake anyway …

Soon I’ll go through the melancholy stage of drunkenness and want to die.
oh well.
*hic*

Jan-: Quit while you’re ahead?

“Mary had a little lamb… with her ready-to-use mint sauce.”
(label on a jar I once had)

Mary had a little lamb, her father shot it dead. Now it goes to school with her, between two chunks of bread

Heh

Mary had a little lamb, she kept it in a bucket. Every time she let it out, her brother tried to

I once knew a guy who raised lambs in his front garden, and every year he’d tell his kids one had “gone home”

www.1159productions.com/test182/jan_on_food.mp3

lol

Vegetarians find this disturbing for some reason

index is negative or greater than the allowed amount
wtf

I find vegetarians disturbing

Heh, a little

I don’t really, just a PITA
I cater for camps .. and vegetarians piss me off

Haha, oh

If you have a food allergy, I’ll cook something special for you.
If you have a lifestyle CHOICE, get OVER IT

It’s the ones who get uptight when you actually discuss it with them that bug me

They’re the ‘trendy vegies’

Aye

They’re doing it coz it’s trendy and so can’t really talk too much about it

interesting

If you talk to a real vegie, they’re quite happy to talk about it

“I just *am,* why does everyone have such a problem with that?!”

i assume he didn’t get an answer either?

Aye

here’s mine http://storage9.myopera.com/fearphage/transport/tagging.htm
i’m going home
later

we talked about it a bit, with some other folks. (This was in #css) We came to the conclusion that CSS doesn’t have any real way to respond to clicks, thus javascript host would be needed.

“Then do so in the privacy of your own kitchen. Not mine”

Heh
Tell them to give the meat to someone else?

If a nudist comes over, they don’t get offended because you’re wearing clothes ..
If a football fan comes over, they don’t get offended if the cricket is on
bIf a football fan comes over, they don’t get offended if the cricket is on/b

Dude, you got subscriptions.

hahahah

Hahaha

You just made me squirt beer out of my nose, buu

Hahaha

It’s such a wonderful line, and I never get to use it.

Phew. Me moaning about my sucky life hasn’t ruined the tone.
I’m relieved.
how do I karma myself selfish-bitch

Jan-: Heh, good luck ruining the tone in ##javascript

lol
about Jan-

Jan- is known for clever (2), dangerous (2), rude (1), sarcasm (2)

You’re well-described person ..
I don’t think anyone else has garnered as many tags

Hey
I’m not rude.
I’m… direct.
I’m rude, aren’t I.

I can’t remember what that was for

Haha
about Woosta

Woosta is known for brilliant (1), excellent (1), right (1), wrong (3)

Haha
about Twey

I don’t know anything useful about Twey

awww

about insin

insin is known for funny (1)

woo

Heh

karma Twey didn’t google

OK

There you go
about twey

twey is known for didn’t google (1)

Haha, yay. I’m notable.

OK, enough frivolity .. I have to stop avoiding my IE problem

Thought you fixed it?

I made a whole new one

Oh

What’s a sensible name for the video stream dumped by mplayer with -dumpstream set?
Oh. Wrong channel.

Jan-: you’re probably talking in #mplayer, but I’d also recommend #tovid as a good place to talk about mplayer and video in general

Jan-: I usually use the same filename
usually a different extension, though, since web streams tend to have the wrong extensions

#mplayer is…

yeah

waggler

Well, I guess it’s a VOB, really. An MPEG-2 stream.

“so-so”

that’s why I thought #tovid might be useful

Jan-: samefilename.mpeg ?

But it’s a whole lot of VOBs stuck together.
foo.gvob, for Giant VOB!

lol
extensions are overrated

Giant… Mundo… Super… er…

.jan

Taken.

irrelevant

My event libraries are .sel and my shows are .qs

how many things use .dat? :P

.bin?
I looked them up on filext. Nobody significant was using them.

.bin is

It seems sensible to avoid really obvious collisions.
Oh .bin I know.
What can I call this option.
I can’t very well call it “rip DVD”, we’re supposed to be professionals.
“Import DVD Title?”

hey guys

Mmmm Nachos
Damn you

tacos rules

haha

‘lo im

mmmmnachos
*salivate*

haha

heheh
the munchies
that was a really bad 80s movie
wonder if I still have it on tape

Well, I have to be up tomorrow, so ‘night all
Er, I mean, today

crap guys. gotta run, ttul

hi all

anyone know why config_c = Dom.get(‘config_c’); document.removeChild(config_c); might not work ?

maybe it’s not a child of the document

hrrmm dw for some reason the script isnt getting triggered

Gah. Wouldyabelieve there’s no way to send a ^C to a process in WSH.

Hello
Is there any way to get the current path that the js file is located in from code?
Nevermind, document.baseURI

Jan-: to send that byte, or to send a signal to stop it?

Actually… the question still remains. If I load a .js file from a subdomain while the js file is in the master public html directory, is there a way for the js file to get the path to the master public html directory instead of the directory that called it?

hey
i have one js file in one file
then on the page, theres an iframe with more js
how do i refrence to one of the variables in the page that contains the iframe?

Man I’m good.

Jan- this is javascript…
and i need help

iframeElement.contentDocument.etc.

i dont think that will work

(script .JS file {the one with the variable} and iframe {with function which i need to access variable})

the iframe is a separate page btw

Is there a way to access backgroundColor if it hasn’t been explicitly set?

any1 have any ideas?
gar.

why not iframeElement.contentDocument ?
[xENo]: getComputedStyle

thx

window.top. seems to work…

oh, right, the other way round

is getElementById the best way to get the value of loose input items’ values?

probably

ook thanks

with a java script ?

is document.getElementById(’ss_path’).value the right way to get the value of an input text box?

Both VBscript and Java are offtopic here.

ok but actually im asking about javascript
to how to access the vbscript sub routines.. or call it function.

axscode – y dont u port the vbscript to javascript?

yes that would be a very good idea. though i have a problem about it.

Then you need to write a VBscript interpreter in Javascript. Simple enough.

whats the problem?

I suspect laziness.

if u port it, it will work on most every browser

lots of problem, i cant really make it since last 2 days.

And laziness is *ding* correct.

ive been trying.. im using it for local use. copying a folder/subfolder to a new target folder. this is in windows

I suspect ActiveX and other Mcrsft technologies.

yes. ActiveX copyfolder

Well, perhaps you should try writing this *dangerous code* in some other language that doesn’t care about the *dangers*, like Python?

strlen or len the function for the length of a string?

.length

k
is there a trim?
*trim function?

really love using javascript… it turned out that its not helping me though. anyone have a function to copy folder to another target folder?

For the second time, that is unpossible.

r u doing asp axscode?

You could, of course, try to exploit some browser vunerabilities to get around the sandboxes, but I wouldn’t count on that.

nope. just for my local.. .hta or .html to double click it in my desktop

use a batch file instead of javascript

yes love that.. i dont like the idea that pop-up a console though

aka shell scripts
then learn a desktop programming language

Oh, so now it’s like versus not like?

yeah

Out, script kiddie.
There is no “like” in programming, only “work”.

what is the js trim function?
or is there none?

No idea. Use teh Google Luke.

yeah. since you cant access vbscript by jscript..
thats something really good about it
though there is a site that says.. vbs.vbsFunction in java
script
that is

hey, i’m trying to built a web chat, how do you suggest me to handle the windows thing – that you have different window for each channel/pm?

shesek… there are countless ways you could handle multiple rooms/pms
I suggest you make them visually different.
I also suggest a tab interface

what do you mean by visually different ?

and that someone using your name (as in… “shesek”… it highlights the tab

Tabs, draggable boxes, actual GDI windows…

*if someone uses your name
I think dragable tabs are better

dragable tabs?

Yeah, as in reordering
And don’t have the tabs at the top, have them at the side
top gets confusing with tabbed browsers like Opera/FF/IE7/etc.

okay, thanks

np
And but “visuallly different”, I meant “have room tabs look different than PM tabs”

how to actually do that? different div for each channel/pm, and when you click the tab i hide the previous channel/pm div and show the new one ?

pm tabs could be smaller/different colour
yeah

the yeah was for what i just asked?

yes shesek

you’re quick :O
using createElemnt & appendChild is better than changing the innerHTML, right ?
let’s say i want to add a line to the chat… what’s better?
Romes, ?

hey
sorry
shesek, are you using a framework?
if not, I highly suggest you do

well, when is started it was meant to be one channel and no pm’s chat
so i didn’t really see a reason to use it

Is there a reason *not* to use it? :P

well, traffic
and.. kiss

maybe we’re misunderstanding eachother
www.mootools.net
that kind of framework
not a GUI framework
it makes dealing with the DOM 10x easier

yeah, i understand you
well… i’m not sure i really need it, it’s still a pretty simple code
i want to keep it light-weight
Romes, what about the createElement VS innerHTML question ?

is var array = []; different from var array = new Array(); ?

no

hi all
I am new with javascript

Welcome

I want to split my window into two sctions
sections
in each section I will have iframe into site
like google

like google?

what does it have to do with javascript ?

someone give me a good example of how “RESTful” services improve interoperability…
I hate buzzwords, and I swear, I cannot see/understand how “REST” improves anything
except semantics

var my_object = {id:4,name:’Hello my name is object’}; object.name = undefined?

is there a way to do the same thing getElementById does, but for classes?

EdBoy, be specific

var my_object = {id:4,name:’Hello my name is object’};

my_object.name;

Hello my name is object
works fine for me

I want to add something to the innerHTML of every with the class “quote”

var my_o = { id: 4, name: ‘blah’}; my_o.name;

blah

and there you have it

is there a way to do something like for(key in my_object) alert(my_object.key); ?

alert my_object[key]

well?
is it possible?

thanks

EdBoy, getElementsByTagName(‘p’); for (node in nodelist) if node.hasAttribute(‘class’) … do something

can I have a javascript function that execute a php script every 30 seconds?

is anyone familiar with Plotr?

X3rus, why not…

ah, thank you
exactly like that?

pfn, only that I don’t want the hole page to refresh, only a couple of things

X3rus, ajax

sorry, I don’t know the DOM stuff
I have no idea how to use that
setTimeout + ajax

EdBoy, well, you read the dom apis and figure out how to do it

-_-

so I will need javascript, php, and ajax

EdBoy, and no, not exactly like that

how can i remove all child elements ?

javascript and php

ajax is the same as javascript

shesek, for (child in node.childNodes) node.removeChild(child)
pseudo-code, of course

well, i thought there is a shorter way
yeah, of course
thanks

function removeChildren(node) { …. }
shorterway ^^
:p

?

or node.prototype.removeChildren = function …

what would that do ?

X3rus, ajax just means using javascript + xmlhttprequest + dhtml

or PlotKit?

and btw, i’m writing a small web chat, useing createElement & appendChild is better than changing the innerHTML, right ?

shesek, add a method removeChildren to all objects the same type as node

using*

doing so is “cleaner”

cool, thanks

On http://www.psyguygames.com/forum/ if you click “Login” at the top-right it displays a login box. You can drag it by its title bar around the page. This works great, but when you drag it around, it ends up selecting text along the way. Is there a
straightforward method I can use to prevent this?

what about the other question ?

oh, didn’t know that. I will have to read about ajax. Right Now what I want to do is to execute some php code every 30 seconds. I should use setTimeout rigth. I will read about it, thanks

what other question

and btw, i’m writing a small web chat, useing createElement & appendChild is better than changing the innerHTML, right ?

`innerHTML sucks @ shesek // note also

innerHTML sucks: If you have events on elements that are rendered via innerHTML they do not go away when you empty the innerHTML area. They may even crash your browser. You cannot use innerHTML for building items like tables in IE. You cannot use innerHTML for adding options to selects
in

elements in innerHTML are not executed.

You can stop asking now

thanks

the thinks that I don’t understand is how to use php with javascript

X3rus, xmlhttprequest

ok, thanks

you don’t really use javascript with php, you make a request to the server… it does what ever it needs, and you get the output

in between a javascript function right?

No tips on disabling text selection while dragging the box? I’ll play around with it some more

setInterval( function(){ jifGet(‘your.php’,{},function(){}) }, 30 * 1000 ); — will make a request to your PHP every 30 seconds and ignore the result (using my jif library)
I don’t get what you mean there
PHP renders the whole file into something to output THEN sends it to the browser, which then renders it and THEN executes the javascript. By that time PHP has long gone into distant memory
Javascript can be made to request some document on the server every N miliseconds, but it will be a *different* request to that which loaded the original page
and will be a separate request every time

ie doesn’t support setAttribute?

It does
But there are caveats
Which property? class?

caveats?

I was thinking of using javascript and php for this reason. I have some text files on the server and I was reading that javascript cannot access files that are in the server

yes. class

heheh .. what a guess

should it work?
i don’t have ie, so i can’t test

it has a (lets be nice) “quirk” with class. You’ll need to do: yourNode.className = ‘foo’
which platform are you on?

linux

`ies4linux

Run IE 5, IE 5.5 and IE 6 in Wine Under Linux, (easy install script): http://www.tatanka.com.br/ies4linux/ check the “blog” section if you want to run IE 7 as well

works like a charm

obj = document.getElementById(Ids);

i really don’t like it
i had ie with winetools..

Get over what you do and don’t like. You’re writing for a target audience that uses it, you MUST test on it

hmm, other browsers support .className ?

all browsers (with DOM) do

and in general, what’s better / more correct, element.attribute=… or using setAttribute ?

the former is better when available

(class is a reserved word, so to access the class attribute you use .className. Of course, .setAttribute takes a string, so you can setAttribute( ‘class’, ‘foo’ ) without using a reserved word. .. however IE, in their wisdom, decided you should do .setAttribute(‘className’, ‘foo’)
instead)

I agree with deltab .. I don’t use setAttribute unless I’m (illegally) adding an attribute to an element that’s outside the DTD

or XML

okay, thank you very much

yes, XML of course, I was just talking about the HTML DOM
I should have made that clear

the js properties, unlike attributes, have type conversion; especillay useful with the style attribute

pseudo-code, of course

is that just me, or that code should work?
i can’t really see why not

no, it’ll remove half of them, I think

why is that ?

the NodeList is live and changes as you remove nodes

`empty @ shesek

empty: A function to empty a node of content: function empty(node){ while(node.firstChild) node.removeChild( node.firstChild ); return node }

absolutely half of them
for the reasons deltab states

the place of the one you remove is taken by the next one, but that place isn’t checked again

every time you remove one, you reduce the size of the list

i understand, thanks
what’s “return node” doing there?

count=2 [2,4,6]

so you can chain methods

oh. cool

empty(yourElement).appendChild( newChild );

thanks again

np

absolute ?
oh, wait
no, i didn’t understand
how can i do that ?

Cool, I just assigned a false returning event function to document.onmousedown and reverted document.onmousedown to null on mouseup from drag, and it works charmingly

when i load mi javascript/php webpage at left bottom corner i get an error: http://rafb.net/p/EYMny141.html how know or fix the error? thanks

ok
I want to split my window into two sections
inside each div I want to use ifarme with site like google
and let the user one time expand 100% height one window or two window

it will be kind of difficult trying to use php and javacript. Is there a way that javascript can read files that are in server?

not directly

xmlHttp Request right, that seem to be the only solution

How to get array of all childNodes of any element?

Or through the src attribute on iframe, img and script tags
tags/elements
Oh, and certain link elements.

is Object.watch reliable?
by that, i mean cross-platform/browser?
msdn doesn’t document it http://msdn2.microsoft.com/en-us/library/52f50e9t.aspx
http://msdn2.microsoft.com/en-us/library/kb6te8d3.aspx

baggito, My pocket reference has no mention of it.
Why do you think this exists?

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Object:watch

Oh right, cause it does.

right
ok, i’ll make a test page

I highly doubt you’ll find it in IE7.

no, FF only
;support watch

I’m sorry, I don’t really know.

Array.prototype.slice.apply(element.childNodes)

geez that sucks

or your own loop

does that require the use of a javascript library of sorts?

baggito, Now you get the fun of polling, woo!

fuck that for a laugh

the built-in one

I meane like prototype.js or something.

Array.prototype.slice.apply(“hello”)

{ 0: h, 1: e, 2: l, 3: l, 4: o}

can you explain apply() to me?

it’s a method of functions
it calls the function using its first argument as the context (‘this’)
so the method is applied to the string as if the string were an array

deltab what would element.childNodes.slice do?

element.childNodes (as if an Array).slice()

hello

geez

baggito, small js help
i have a class name in a string, and i want to create an instance of it,

so IE definitely doesn’t support it. i made a test case and that’s what it told me.

klass = Object.const_get(“Foobar”)

there are plenty of people other than me to help in here.

foo = klass.new(“hello”)
hmm

(1) there are no classes

Woosta, yes i know, but i am using prototype and hence dataChannel = Class.create();

function Bar(){} Y = new window["Bar"](..) — might work

Ergh
`prototype.js

prototype.js: When you mean prototype.js, please say “prototype.js” as it saves the confusion over object prototypes and the prototype.js library

It’s STILL not a class .. it’s just prototype trying to pretend there is

Woosta, 101% agreed, i know that

Given dataChannel = Class.create() …. new window['dataChannel']() should work

Woosta, let me paste some code

Hey all.
I’m trying to document.getElementById(“name”).value on a textbox and it’s just saying “name has no properties” and I can’t figure out why :/

that’s probably a bad id
id=’name’

That’s exactly how it is
input name=”name” id=”name” value=”" class=”inputBox” /

Woosta, http://pastie.caboo.se/82359

Var PushServer

Woosta, ok ignore that i

cool
Did you try what I suggested?

one sec

var foo === window['foo']

hahha, brain fart.

(The original rule of thumb related the the size stick you were legally allowed to beat your wife with)

new window['dataChannel'](‘i can arg here to initializer’)

the input box was inside a div….. a div that earlier on I changed the innerHTML.
XD

yup .. that should (I hope) work

Comments off

i have html code stored in array can i print it but not render it

have you tried echoing what’s $k and what’s $v?

DOM ?

johnyPG, not exactly
DOM is more object oriented

yes – … so ?

I’m sorry, I don’t think I got what you were asking
-.-

http://www.lepric.2bb.ru – Ôîðóì “Îáùåíèå áåç îãðàíè÷åíèé”

never mind

battleGroupBlackout charUrlr=Doomhammer&n=Tigreis classMage classId8 factionHorde factionId1 genderMale genderId0 guildName lastModified04 August 2007 level19 nameTigreis raceBlood Elf raceId10 realmDoomhammer title
Looks fine to me
And yet when I assign $v to my own vars, it doesn’t work
Or at least it’s not what it should be
$faction = $v;

Horde ) when I print faction

How can I convert $v into a string? Does echo do that?

hi guys what does this mean? Unknown column ‘TopFriends’ in ‘field list’
here is my php’s mysql statement -UPDATE Users SET TopFriends=’afw’ WHERE ID=2

it means that there isn’t a column called that in the table you’re referring to

It means TopFriends doesn’t exist in your table

ok .

It looks as if $v is the SimpleXML object and not a string, but it’s a string once echo’d
Any ideas?

__toString()
a function that allows you to define a stringification of your object.

Where’s that in the manual?

it’s under overloads, i think

settype($faction,”string”);
That worked

do not do that
that’s a terrible plan

So you’re saying $faction-toString()?

don’t just change the type of things, that’s never a good plan
$str = (string) $xml_node; # or something

kuja, you there m?

Ah, worked
Thanks

Hey, just a quickie

can I override(overload? overwrite?) already-defined functions?
like… undef?

i have html code stored in array.. can i print it but not render it?

How do I print out all my variables for debugging?

and & characters?

try htmlspecialchars()

hi

Comments off

I know you can user LAST_INSERT_ID but ATM I have an SQL statment in my PHP to incert some data but then I have

how do I change the order of columns in a table?

usualy, that doesn’t matter
just write field order ignoring code

i don’t want it for the code I want it for when I have to read it

hi there!
select (sum(field)) as total; can I use this “total” value to subtract something?
like select sum(field) as total, total-discount_field as bruto ; ?

hi
could use some help here

someone here?

y
you can, but you’d rather

why not?
still here?

how do I use a function such as SQRT inside of a stored procedure?

hey can someone help me witrh stored procedures please
check out http://pastebin.ca/619022

Check the error log

nothing in the error log

Then I reckon you’ve got a bug on your hands, report it

im using a pretty old version
5.0.16

It’s not overly old, but might be worth trying the latest before reporting

so do i leave the data directory as is?
and replace everything else ?

When upgrading ?

yeah to 5.0.45
since its a minor version upgrade instead of major

Shouldn’t have to do anything, just install the package and you should be good to go

hrmm
is it me.. or is mysql site slow today

need help with a search query

Isn’t everything slow from India?

hehe.. not necessarily this slow
alrite. what do you suggest? the icc version?

http://helpatgrnet.pastebin.com/m38738f87
http://users.uoi.gr/gjxydo/lexicon/glossary.html

any real noticable difference bwetween standard and icc?

noone?
guess it’s hard

updating apparently helped

I am trying to cd to my MYSQLS¬1 directory on a win98se, but it keeps saying invalid path

care to help me with this ? http://pastebin.ca/619081

1 mysql hosting Server

CProgram Files\MySQLcd MYSQLS~1
Invalid directory

zoneid apparently disappears or something.. cause it doesnt delete from rr

kanenas ellinas edo?
i need some help here
code seems fine
but won’t work

im looking to record ip addresses in a database and ive been reading up on the best way to do so, but ive been reading up on a function in mysql INET_ATON which can convert the ip to a number and back again, but how does this work with ip v6 and what IS the best way to store ips?

wanderingii ipv4, 32bit int, ipv6, hex string
converting 32bit to hex is trivial, to compare with the ipv6 ipv4 ranges

so what is the best host field type and length to use?

anyone know why that SP doesnt work ? i mean 1 of the delete works.. the other delete statement doesnt
if i run the statement manually. it works fine..
i even concat’d it to see what the statement is .. that is being run.. it shows up fine
could you look at this please? http://pastebin.ca/619081
sorry.. http://pastebin.ca/619096
delete from soa works.. delete from rr doesnt..

Assid what is this about ?

stored procedure
1 query works.. 1 doesnt

so why ask me ?

just wondering if you can make sense of this

I have no idea what it is about, at all – could you introduce me ?

err.. im using stored procedures.. to delete data from multiple tables. for now.. im trying to delete from 2 tables.
as per the pastebin.. the delete statement works for SOA table. However doesnt work for RR table
hrmm let me try something

assid use CASCADE
!m assid cascade

Sorry – I have no idea what function you’re talking about! but try http://dev.mysql.com/cascade

hmm

err.. not a valid link

indeed
so grep th emanual

dont i need innodb for cascade to work?

Yes. You need the foreign key constraints.

In a table “TABLE `strings` ( `value` text NOT NULL, `languageCode` varchar(2) NOT NULL, `stringId` mediumint(8) unsigned NOT NULL);”
is there a way that I can get all rows grouped by stringId prioritized per language (first en, but if not available then de, nl, or fr)
I tried SELECT stringId, value as stringPart FROM strings GROUP BY stringId ORDER BY value, FIELD(languageCode, ‘en’, ‘de’, ‘nl’, ‘fr’);
but it doesn’t work

alrite but why wont this sp work ? i mean its a simple statement. it should really work right ?

I didn’t see it.

http://pastebin.ca/619096

Assid if the tables are related by circular constraints then the only way to make it work is by cascade

delete from soa works.. delete from rr doesnt

yes,
we know

if i use that delete from rr query manually.. it works fine.. no constraints force it to fail then

Assid is the relation between these tables *enforced* ?

nope.. its not an innodb table.. no foreign keys

if it is not, how would you expect mysql to understand that you want to delete from the second table as well ?

anyone an idea for my ‘rows grouped by stringId prioritized per language’ problem?

i dont want to cascade.. i just want this simple statement to execute

IT CAN’T

What is value? Why are you ordering by that?

heh..

why cant it do it in this case?

value is some test, I want to order by it to get an alphabetical list
text

You can’t do that.

what, ‘rows grouped by stringId prioritized per language’?

You need to first determine the language and then join to obtain the text.

if its executing as a regular statement, why cant this run?

Assid did you understand what I said 2 lines back ?

9] adaptr loves teh columns named “value”, “number”, “id”, etc…”

heh, not that

if it is not, how would you expect mysql to understand that you want to delete from the second table as well ?” ?

that one ?

yes, that one

well.. if i run 3 statements.. where the tables arent set to cascade/foreign keys / or anything..

zoneid is not enforced anywhere – why not ?

why is there no table that uniquely identifies “zone” ?

you mean the zoneid ? the soa table defines the zoneid as the `id` field

Start with: SELECT stringId, MIN(FIELD(language, ‘en’,'a1′,’a2′)) AS priority FROM tbl GROUP BY stringId;

which is a foreign key in the rr table as zone

Then JOIN that result to find the specific values/text.

i am not using innodb.. so a simple delete statement shouldnt have a problem.. as i dont use foreign keys
if the statements were executed 1 at a time.. minus the variable substitution to get the zone id .. it works fine from CLI

Start with: SELECT t2.* FROM (SELECT stringId, MIN(FIELD(language, ‘en’,'a1′,’a2′)) AS priority FROM tbl GROUP BY stringId) v1 JOIN tbl t2 ON (v1.stringId,v1.priority) = (t2.stringId, FIELD(t2.language, ‘en’,'a1′,’a2′)) ORDER BY t2.value;
Something like that.

so im trying to figure out why it doesnt work here.. as the variable zoneid stores the correct ID.. as it deletes from the other table just fine

Xgc, that seems to working indeed
great
thanks

You’re welcome.

assid you claim that zoneid is a foreign key but you don’t use foreign keys… which is it ?

iots not a foreign key.. for the sake of relations.. i just wanted you to imagine it as a foreign key

is it possible to call a stored procedure as a sub query?

No. Use a function.

Xgc, ok – is it significantly different?

Yes. One has a ‘return’ value and one doesn’t.
You can return values from stored procedures, but only as OUT parameters.

Xgc.. no i need an entire result set

is it possible to compare three things in a where thingy
?

You still would want a construct that ‘returns’ a record set.

as far as i understand.. every statement in a procedure must be executed as is.. if it works by running that query outside the SP. it should work in it. unless i got something wrong in understanding it

Assid correct, so what happens when you run the two deletes manually ?

works perfect

I don’t know off hand if mysql functions can return that type of record set.

so why is the SP so complicated ?
Assid show explains of both tables, please

Do you have a description of the logic for this function?

Xgc, again, thank you very much, never would have been able to write that query myself

Not a problem.

http://pastebin.ca/619137

xgc, I have a stored procedure which basically offers functionality to search for persons in a table (3 LIKEs). based on the id column in the result set I want to write another query to return a second result set and with the two result sets I can build a data relation in .Net

hi
(select m, y FROM t1) UNION (select m, y FROM t2) GROUP BY m, y ?

Can you provide details (examples) of the queries and the final set to be returned?

Assid okay, and you want – what ? to delete all matching RRs when you delete a zone from SOA ?

yes.. along with the soa record
i can simply use a subquery .. but i really would like to get the zoneid
incase i plan to expand it in the future

Also indicate what the parameters to the stored procedure represent (how they’re used).

DELETE FROM RR WHERE zone = $zoneid; DELETE FROM SOA WHERE id = $zoneid
what is the big problem ?

doesnt work..

doesn’t *work* ?
what does the key = MUL mean in your tables ?

http://pastebin.ca/619096 — thats what im using
a href=”http://pastebin.ca/619096″http://pastebin.ca/619096/a — thats what im using

I *know* that, it looks horribly complicated

no clue about mul
complicated? it just takes in the zone.. finds the zone id.. and then i use the delete statements to knock them off.

xgc – the stored proc accepts 3 varchars and returns about 5 cols. One of the columns(id) I would like to use to base the query on. So use the SP like a sub query. from there on its a simple select…

Assid http://dev.mysql.com/doc/refman/5.0/en/delete.html read through that completely, and also
“Currently, you cannot delete from a table and select from the same table in a subquery.”

i tried declaring zoneid as double, int as well

none of that is relevant, just delete in one statement

While you can return a record set to the caller of a stored procedure, MySQL doesn’t appear to allow you to SELECT from it like you would a subquery or derived table. The latest related documentation is: http://dev.mysql.com/doc/refman/5.1/en/stored-procedure-syntax.html

yeah i know that.. but as you said.. not relevant to this query.. but if i had to do it in 1 statement.. i would need the subquery only for deleting from rr .. not from soa

xgc, thanks. In that case ctrl+c,v will come in handy

Assid if the syntax allows you to delete form both tables based on the WHERE soa.zone = “zone”, then you do need it

isnt it strange for that SP to fail ?

Are you sure a VIEW wouldn’t be possible for this?
Without seeing the specific logic, I can’t really tell.

Assid soa.origin, sorry
Assid not strange at all, like I said – it looks horribly complicated

thats only if i do something like delete from rr, soa where soa.origin=’blah’ and rr.zone = soa.id
or something to that effectg

and why would you not do that ?

here i am not doing that.. im getting soa.id .. which is 79 .. and i am deleting rr.zone = 79 soa.id = 79
am tring to keep multiple statements.. incase i need to add more in the future

what. is . the. error.
if it fails the second delete, it should tell you why

it doesnt delete anything from the rr table
soa works fine

either there’s an actual error, or .. yeah, empty result set

no error

xgc. No, I can’t see a view offering a lot of benefits. thanks for your time.

select (concat(“delete from rr where zone = “,zoneid));
‘delete from rr where zone = 79′
now if i run that AS IS.. it will delete my rr records fine

Can I order case insensitive?

saul11 it’s the default for the default collation

Usually an indication of a design problem. Too bad he didn’t feel like providing any detail.

Xgc who ?

ERROR 1213 (40001) at line 362: Deadlock found when trying to get lock; try restarting transaction?
sorry, the table is readonly just for me

mashiah why do you need locks on a read-only table ?

JC_Denton_

Assid try using SELECT id AS zoneid FROM

this is not mine db, I am just a user (wikipedia toolserver), but my thought was the READ UNCOMMITED does not follow me into any deadlocks

no idea why you’re using INTO on a single int result
also, define it as a bigint, that’s what the table has

im just doing this:
SET zone = CONCAT(zone, ‘.’);
delete from rr where zone = (select id from soa where origin = zone);
delete from soa where origin = zone;
getting it over with
ive lost a few hours playing with it.. really gotta get more done
dammit.. it still wotn work
you have to be kidding me
even the above queries have an issue when in a sp
maybe it cant delete records with multiple rows?
sounds crazy doesnt it

yes, indeed
if it can even delete from JOIINed tables, why would it balk on this ?
have you tried a view ?

delete from rr where zone = (select id from soa where origin = ‘blah.com’); works fine
again.. soa can delete.. rr doesnt
the select where clause is the same as delete clause
view ? for delete ?
okay back to the first query.. it just has to work

Assid rr.zone is part of your primary key.. remove it, it’s nonsense, and more than likely the reason it refuses to delete
SHOW CREATE TABLE rr

still doesnt give a reason for it to work OUTSIDE the sp

Assid unless the optimiser does the relation anyways when you execute the SP
it all depends

for a delete ?

well, in RR, id, zone is the compound PRI, indicated by the MUL in zone
so it’s using the foreign key from soa as part of a compound PRI

but shouldnt that effect a regular statement outside the SP ?

i’ve set up a password for my root account when setting up a mysql 5 server. any way i can clear up the root password?

chances are this will only work sensibly when you can enforce constraints on foreign keys, ergo innodb

hrmm

can you show create tables for both ?

http://pastebin.ca/619172
?

yes, trying to get my head around it – mysql syntax is rather foreign to me

hehe… k

I was wrong earlier – it doesn’t use a compound primary, so I have no clue why it would not delete
for a compound PRI, all columns are listed as PRI

guys? is there any way you know of to reset the root password on a server you can’t log into?

from a remote myslq client, you mean ?

no, from the machine itself

you said you can’t login
reset_root_password
damn, what was that factoid
!man reset_root_password

Sorry – I have no idea what function you’re talking about! but try http://dev.mysql.com/reset\_root\_password

bleh

hehe
one of those days

reset root password

http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

heh

ty

i cant believe this.. it makes absolutely no sense for it to fail

is there a way to look at the SP when it’s executing ? the query plan or whatever ?
it *must* be different

that part i dont know

Salve

File ‘/var/log/mysql/mysql-bin.index’ not found (Errcode: 13)

Sono un novizio di mysql possiedo l’ultima versione del programma e le interfacce grafiche per accedervi ma non riesco proprio a farlo non comprendo come iniziare, mi potete aiutare?

after i delete everythign in /var/log
:|

make a mysql directory in /var/log and give it permissions and then try to start mysql
and keep your fingers crossed

ok
yay got it after some chmodding, thanks

only rr seems to be facing this issue.. even after changing it to the subquery i mentioned above..

Assid I think you need to look at exactly what the optimizer does with your commands…
EXPLAIN will help

EXPLAIN deletezone ?

should work, yes
!man explain

see http://dev.mysql.com/doc/refman/5.0/en/explain.html

can only be done for select

yes, and you have already seen that you can program the delete identical to the select
so use that, and assume it does the same thing

but the part that fails is the delete .. not the select
hrm the select has nothing interesting which should affect this
no luck

too bad Assid
I’m out of ideas here…

yeah me too
almost getting ready to kick this box just to relieve some stress

i want to insert a lot of records into a table which have been exported from a previous version of the same table. the values to insert are accompanied with the ids that were used in the old table, but these ids would already exist. how can i insert the values without havin problems trying to
duplicate ids

if this is an autoindex, you can’t and you shouldn’t

I am a beginner in mySQL. Could you say me how to see table’s content in mysql?

select * from table;

select * from tablename limit 1;

thanks

better choice with “limit 1″ ;-)
only 1 record

hi I need some help, I am running a drupal site and I am gettinga spam bot triyig to get my db. I got the logs reading they are sending mysql_query()

sounds like a drupal forum question

yeah and they said is a mysql question (sounds like Dell-M$ support pin-pon)

drupal

a visitor should never EVER even be able to directly run a mysql_query

I am getting the following instructions being sent:
Incorrect key file for table ‘/tmp/#sql_965_0.MYI’; try to repair it query: SELECT COUNT(path) AS hits, path, title, AVG(timer) AS average_time, SUM(timer) AS total_time FROM drup_accesslog GROUP BY path, title ORDER BY hits DESC LIMIT 240, 30 in

Drupal runs the query but it fails with that message ^^

it’s a small fortune you haven’t shown up in #apache yet, then

is a matter of time
so far all these queries are generating from an ip, anyway to block the dedicated ip hosting from mysql

JZA “being sent” – by WHO ?
re-read my last

This seems like a mysql issue, that’s why I suggested he asked you guys

66.249.70.214

JZA that’s not what I mean – sent *by* a user telnetting to your website,? to mysql ? sent by the drupal website to mysql ?

is being sent to drupal, since thats what the log shows

if the last, then that’s *not* what’s happening, and you need to read your web server logs to see what *is* happening

generating from the login page

JZA so you get that string in your web server log?

i see

“incorrect key etc” ?
I really, really, *seriously* doubt that

The error is logged by Drupal and I guess it is logged by MySQL as well.

A. web server requests, AKA the actual *attack*, B. drupal fuckups AKA #php thataway, and C. mysql errors, look in the mysql log for details
only the last is actually relevant in here

I dont have access to them yet

then what are we talking about ?

I dont have acces to them yet

Did you try to repair the tables in Drupal’s database host through phpmyadmin?

not yet

hello i need help with MYSQL
anyone can help me please friends

not until you ask a question

ok i just installed mysql and its working
now how can i create a data base with mysql

google for a tutorial

i did it but i cant understand
dont speak english very well and i dont understand the terminology used there
so please any one can help me

I’m sure there is a tutorial in your native language

there is not

i have 2 tables, every has a primary key (which “connects” them), so my where clouse is “t1.id = t2.id”, but it can be, that t2 has no row with that id, but t1 has, and that result should be shown. how should i do that?

what are you talking about

mysql
yes, my english is not very good, i know
t1.id = t2.id”

I want to build gallery, and blog on my web page. How to store data in mysql? for example for galleries – do we store images (binary objects) in mysql or just the path to the image?

just the path

How to store articles/notes. Maksimum length of varchar is 65000 (a little more, you know it) which may be to short for a story.

does Redhat support O_DIRECT ?
Redhat enterprise v4
Im looking into the best value to use for innodb_flush_method

hi
anyone can help me ? please dont know how to start with the mysql i already installed but then ?

hello… is there a way to enter multi-line strings in sql? ie if i have a long string that needs to fit into a TEXT column and I don’t want it all to be on one line when editing the SQL that I’ll use to import it…

Read this http://www.w3schools.com/sql/

i need a quick
lesson
just to set up my mysql with apache
and go on

What distribution?

and what language between the two? php?

php

on windows?

windows

ewww!

http://www.php-mysql-tutorial.com/install-apache-php-mysql.php
enjoy

el httpd ninguna integracion con mysql

Try the guide KDan gave you or if you’re lazy get XAMPP (http://www.apachefriends.org/en/xampp.html)

muy bien gracias

hello, I need a Freeware program for making relation entity models like Enterprise Architech but freeware

hi
what type of sql variable would I use to store an IP address?

int unsigned

thanks
ummm,
just CREATE ipaddress(
ipaddress int unsigned
)?
int doesn’t seem to work…

what on earth are you talking about ?

he’s talking about a long ip
not .. 123.123.123.123
varchar(13)
or .. int unsigned and resolve the long ip
rather, calculate it

Hey Is there some way in sql that my auto incr feild stores values as power of 2, i mean like 1st value is 2 then 4 and etc

A power of two, or an increment of two.
http://dev.mysql.com/doc/refman/5.0/en/replication-auto-increment.html has good docs on incrementing by N
Works very well for multi-master replication.

http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html

Hmm Okay

Besides, you’ quickly run into that ‘grain of rice on a chessboard square’ issue. ;^)
*you’d

heh

+
damn keyboard

Hey can any mysql user create another mysql user?
with same permission or less if not more !

if they were created with the WITH GRANT OPTION, yes

Okay!

but not more permissions

I created a user with Grant Option only
Then i logged using that user
Okay!
Then i logged using that user and tried creating another user which gave error
?

right. they can’t _create_ a user unless you gave them CREATE USER
!m blackhole_ grant

blackhole_ see http://dev.mysql.com/doc/refman/5.0/en/grant.html

which will be option for create user in mysql yog
i ticked create checkbox

yog?

im trying to use phpmyadmin but i’m getting access denied even though user and password are good in config.inc.php

see list of privileges on that link above
are you connecting to localhost, or a remote server?

local

and the user/pass combo you are using is for ‘user’@'localhost’?

root@localhost
oops
nevermind
its not heh

:-)

hey
somoene here
fast

i hate those kind of errors
thnx

hey

np

Shrews, man
Shrews, i want to remove uth8 languages
utf

what do you mean ‘remove’ them?

when i enter in phpmyadmin there is collation
and i see utf languages
i don’t want them
??

you don’t _have_ to use the utf-8 character set

i want to remove one language,in collation
Shrews, man when i enter in phpmyadmin

enter what?

listen
http://localhost/phpmyadmin
then i see create new database collation,and when i browse i see much languages

ok

i don’t want see utf8,how can i remove it from there

it’s part of the MySQL server

ok then how can i enter in mysql to remove it

you have to compile the server with the character sets you want. i don’t see the problem though.

Shrews, man
Shrews, how to do that?
Shrews, i don’t want to see this utf8,that is the problem

http://dev.mysql.com/doc/refman/5.0/en/installing-source.html

Shrews, i’m on ubuntu
feisty server
Shrews, and when i compile this mysql,is there will be this utf8?

you would use the –with-charset options to the ‘configure’ script to tell it which character sets you want to include

you can compile apps on ubuntu too.

Shrews, man can and for the engglish ony who charset is

umm, what??? sorry, i don’t understand that at all

thumbs, man,i know but i have installed from synaptic mysql and i see that there is utf8 and i don’t want it
Shrews, ok for ubuntu what version i need to download
thumbs, are you here?

yes.

To eliminate character sets, you would have to compile the server yourself. You have to download the source from mysql.com. This is probably more than most people can handle. I suggest just learning to live with seeing the UTF-8 character set.

Shrews, 128mb ram i don’t want to see UTF8

I can’t help you anymore. Sorry.

Shrews, ok when i download this compile for ubuntu how to tell to install charset only for english

there is a compiling guide on ubuntu.com

thumbs, can i pm you

no.

heh

why

because I don’t wish to.

oops

thumbs, ca n you give the ubuntu how to compile mysql
Shrews, then thanks man.
thumbs, ?

un momento

merci himbre
thumbs, man don’t forget me

look up a compilation guide first.

thumbs, man don’t forget me
ok

then
as you configure mysql with ./configure

thumbs, ?

you can use ./configure –help to look up the utf-8 option/.

thumbs, with utf8 man
thumbs, i want ony to use english
and when enter in phpmyadmin in collation to see english

you need to figure out how to compile your own apps first

thumbs, you are not going to help me?

I won’t spoon feed you, no.
you need to figure out that part first.
then you can tell ./configure to use the utf-8 option, or whatever option yuo need.

one question
i say witout utf8 man
that charset it for english

ok fine
the point is

yes

configure it how you need it.
../configure –help

yes
then

then you google a compilation from source guide.

but what is the charset for english

I’m not sure.

ahh
bad

you can find charsets in FF, if that helps
I’m sure the default charset will work.

what is the default?
russian?

no.

in deault is english?
default

most likely.

default

try it.

good
thumbs, what version i can download to work with ubuntu

the latest stable
consult the website for more information.
or the topic for that matter

thumbs, someone say that you are from canoniacl

from what?

canonical
thumbs, man one qustion

ok?

can i download the source from apt-get ?

no
read the topic.

ok but when i write apt-get source mysql-server
it start to download the source

debian might have it, then. Consult #debian or #ubuntu

yes ubuntu

this is not a debian/ubuntu support channel.

ok

the debian/ubuntu mysql should have utf-8 support by default

/part/

firewire, without utf8

oops
sorry

you want it without utf8?

Firewire yes man only english

you don’t need to recompile for that either
just use latin1

firewire, lets see can i pm you

no

firewire now when i enter in phpmyadmin in collation i see utf8 languages,can you tell me how to remove it

mysql uses latin1 (english) by default for most things
why do you want to remove it

firewire, i can’t tell you man
firewire,

it’s not hurting anything

firewire, i need to remove it

go hack the menu in phpmyadmin then

ok how to hack it

edit the php

and what i need to search

I don’t know
go figure it out
if you can’t tell me why you want to remove it then I can’t tell you how to remove it

firewire, i can’t tell you

I can’t help you

firewire, then thanks.

hi evrybody .. how could I modify this query to count the results ? : SELECT old.* FROM old LEFT JOIN new ON old.IP = new.IP WHERE new.IP IS NULL ORDER BY ADRESA ASC;

./configure –with-charset=CHARSET
Shrews,
Shrews, with this command,is there will install only english or ?

hi all

hi

I wonder how much my db will be if I store 1 million name in it. Name size is no more than 25 letters?

rycar
rycar ./configure –with-charset=CHARSET

thanks for this

rycar i want to install onlyenglish
without utf8 charset

wtf why would you want to do that

rycar man i can’t tell you,i only want to see in phpmyadmin english

what is the default language that comes up?

By default, MySQL uses the latin1 (cp1252 West European)
rycar but i don’t want to see another languages in collation

what do you want to use instead, latin1_swedish_ci ?

rycar only english man

you can put english on many different encodings. My favorite is utf8, but usually I use latin1_swedish_ci

rycar is there something like uk?

also, recompiling mysql probably won’t change what character sets show up in phpmyadmin, because phpmyadmin is a separate program

rycar phpmyadmin say that is from mysql?

use latin1_swedish_ci, it’ll work for US/UK
phpmyadmin is not made by mysql, but it is the best web based interface to mysql

rycar ok,adn itn collation is there will another languages

those aren’t languages

you can not compile without utf8

they are character sets

database metadata is in utf8
the server needs this character set.
you can compile without anything else, like ujis, but what for?
are you trying to save on the footprint?

he’s still insisting on that, sigh.

i want to only to install ru and uk

for no valid reason

speaking of ru, what’s a good character set for that

utf16

I’ve never used it, I don’t know.

won’t work.
you have to hack the source.
this is from mysqld.cc, main():
/* Character sets */
system_charset_info= &my_charset_utf8_general_ci;
files_charset_info= &my_charset_utf8_general_ci;
national_charset_info= &my_charset_utf8_general_ci;
table_alias_charset= &my_charset_bin;
character_set_filesystem= &my_charset_bin;
see, you can not compile this stuff out

http://pastebin.ca

the system will simply crash on startup

read this http://es.wikipedia.org/wiki/Codificaci%C3%B3n_de_caracteres

hi do you happen to know where i can find step by step how to install and where to fix the mysql and coppermine, i want to try and fix it.. unless you can think of it how i can fix it

rycar the important it not to show in phpmyadmin in collation another languages

why is that important? tell me

rycar one friend have a problems with another languages

he has no idea why.

I know this
what probably did your friend have?

I want to use a stored procedure and use a select in that proc. how can I check if the select returned something?

rycar eucalepsys from anothre languages
rycar i don’t know what is the word on english

that is most likely because you were using the incorrect character set

rycar no man this friend don’t want to see another languages
in collation.

tell your friend to find a different program to use then

rycar he pay me

maybe he shouldn’t be paying you.

the same way you do it outside a procedure

thumbs, he want to have server

you there

the coppermine website has install guides

maybe he should pay a competent admin, then

just follow the guides and start from scratch

thumbs, 10 euro man
thumbs, ca n yo utell me how to remove from there.

i did but it confuse me still.. i will look it up and read it again.. but they dont have step by step but just explaining but it hard for me

to remove WHAT?

i don’t know what to tell you. That’s the guide I followed to install coppermine

thumbs from phpmyadmin collation utf8 languages

then tell phpmyadmin not to.

the only need i need to figure out how to get this damn database to work.. and the value

how to tell him?

phpmyadmin is not mysql

we don’t write / support phpmyadmin here.
ask the phpmyadmin support

ahh

phpmyadmin doesn’t have languages, it has encodings
did you read the article I linked?

thumbs, but phpmyadmin say and pages that in mysql tables collation

sigh

rycar, yes i can’t understand

well it looks like the database works, since you could run the mysql shell and do commands

hi

the problem you’re having is with coppermine

how do i command the shell if it works ?

you did it last night
i told you how last night
you did mysql -u root -p

I can select only 4 rows. How can I select other 4 (5-8) rows ?

and then you did the show databases;

if you can’t understand, then you must just trust us that we are correct when telling you that you do not want to remove those encodings from the list

that should tell you mysql is working

using LIMIT ?

who asked that question about stored procedures?
do you want a count of rows returned, or do you just want to be able to get the results from your procedure call?

reate new database
rycar
now listen

do i need to create new database again ?

it seems that no one here understands mysqlchange’s issue
we must all be retarded
/sarcasm

maybe unicode was a bad idea for computing

can i pm you

yes

In a procedure, a select that returns no data raises a NO DATA signal. If you handle that case you’ll know when it happens.

rycar, do you recouve the pm?

Returning that indication to the caller can be done via an OUT parameter.

I did not get a PM

when open phpmyadmin and there have create new database

in collation have utf8 how can i remove one languages

there are no languages in that list

remove from what? and why?

You didn’t translate the question into english very well.

when open phpmyadmin

also, you are not supposed to remove any encodings, you are supposed to just pick the encoding that you would like to use

in create databasu
listen

is that a bot?

in create database have collation that have languages how can i delete one of them
rycar no

I’m not sure at this point, rycar

those are not languages

you want to remove a language from the phpmyadmin’s user interface?
also note that languages != charset != collation…
also db charset != webpage charset, etc.

what is difference between charset and collation?
a quick look at wikipedia says sort order?

the charset determines how characters are encoded in bytes. the collation determines how strings are compared.

ah

the two are closely related in practice, but not really in theory.
there are several different ways to collate utf8-strings, for example.

ok how to do it?
rycar and what are if they are not languages?

i have no idea. hack phpmyadmin, i guess. it has nothing to do with the database.
they are collations.

what languages do you speak?

i.e. ways to compare strings

rycar ru
_Duesentrieb_, but webmin too say that is from mysql

do it isn’t
no it isn’t

rycar ok thanks

sigh

if it was from mysql you’d get it from the mysql website

http://www.phpmyadmin.net
it’Äs an independant project

rycar ok now lets see can i remove some of this collation languages
rycar now lets see can i remove some of this collation languages

no you can’t
what languages do you plan on using in your database?

rycar why?
rycara english man

they are not languages. and there’s no pint in removing them…

english man

UK english?

jeebus

_Duesentrieb_, and is there a command to be removed?

are you really talking about collations in the database? or are you talking about the localization of phpmyadmin’s user interface?

rycar yes

it asks you to choose on on login, iirc.
that has nothing to do with databases whatsoever…

_Duesentrieb_, the two of them

o_O

_Duesentrieb_, i want to no to show one languages

why?

then hack the phpmyadmin code.

then whenever you create a database pick latin1_swedish_ci, or just leave that option blank because the default is probably correct

it’s a program for people who manage databases. not for endusers. so why restrict choices?

_Duesentrieb_, becouse one friend want to have server and want in collation to see only english

so tell him to pretend that option isn’t even there

rycar he see that is there.

block your ears and sing out loud.

tell him to pretend that it is not

that seems an odd request. like removing the buttons from the dashboard of your car just because you don’t understand them.
even though other people might use that car

rycar why that can’t be

.oO(yet another bad car metophor)

_Duesentrieb_, brb i’m going to eat some blueberry

but what if I want to use a stored function? can I just do: return true ?

if that option there is a problem for your friend, then your friend should not be creating databases

perhaps he just needs a decent browser :P

he’s getting slightly irritating.
it’s only been what – 4 hours now?

I want to do someting like: select field where check_func(field) = “y”;

no there is no problem with his browser, the problem is that he wants the list to only show one option
when the default option is the one he wants to use anyways

he said earier his friend had “problems with other languages”#

yeah the little dots above letters were getting messed up
which if his target language was english I don’t see how that would be a problem

döts?

diacritical marks

http://paste-it.net/2842
…. for the right syntax to use near ‘INT’ at line 6

You need to recompile MySQL. On compilation time, you can give a list of supported collations. If you do not like the UTF8 ones, do not compile them in.

ok i notice it said it need to add user for the database or something but how?

But this is more a MySQL related question.

rycar

with the grant command
i gave that to you last night as well

can you tell me again please sorry for asking again

identified by ’somepassword’;

ok what do i type in shall

what i posted in the mysql shell

for whatever you want

do not recompile mysql, the one you have already is fine

i still dont get it.. what you trying to tell me

-_-;
mysql -u root -p
enter password for mysql root

identified by ’somepassword’;

then quit
oh
don’t quit
then
flush privileges;
then quit

yeah man, when you take a dump you don’t just leave it there
always flush
if you are lazy like me you could try out the MySQL Administrator program.

for something like this, there’s no real need
but i do use the old one
it is tasty

after i type grant all privielges do i make up the db name and others

no
the db has to exist first

ok

well it’s possible to just create a user and then alter it later
but why do that?

damn it cant type this damn thing correct

can’t help ya with the typing

then can anyone else who can be more helpful to me

You need to recompile MySQL. On compilation time, you can give a list of supported collations. If you do not like the UTF8 ones, do not compile them in.

But this is more a MySQL related question.

I don’t know why he said that to you, he was lying

mysql -P [portnum], but it won’t connect to the given port. ??

what error are you getting?

they say that is phpmyadmin — It is MySQL. Tell them.

no error, i connects to another db server

you have more thank one server on different ports, and it’s connecting to the wrong port?

myyour friend and you have no idea what they’re doing.
err

hey is friend is on freenode

parse error!

you and your friend have no idea what you’re doing.

thumbs,
thumbs, now can i compile mysql without utf8 collation

indeed

no you can’t.

why not

because. stfu.

from phpmyadmin say that i can d oit.

sigh.

stfU?
can you help?

time to ignore that guy, I guess.

phpmyadmin does not say that you can do it

I wasted enough time.

in phpmyadmin room they say that
thumbs, that is not wast of time

ahh. Ignored. It’s much better now.

thumbs, maybe you need you add some options that if someone don’t want the collation languages to delete only utf8
uthumbs, maybe you need you add some options that if someone don’t want the collation languages to delete only utf8/u
where to put this dono_collate?

that guy doesn’t get it
I say we leave him alone, and stop humoring him

do you know why the client is not using the port param?

thumbs, but why not?

I do not know, you appear to be using the command correctly

I can use every port I want.. it always uses 3306

hey whats the command to grant a certain user full access to a certain database?
well the query.

identified by ’somepassword’;

and then flush
grant

!man grant

see http://dev.mysql.com/doc/refman/5.0/en/grant.html

it there anyway i can send the file to you and you can fix it and re send back to me we did before dont know if you can or not
it there anyway i can send the file to you and you can fix it and re send back to me we did before dont know if you can or not
uit there anyway i can send the file to you and you can fix it and re send back to me we did before dont know if you can or not /u
buit there anyway i can send the file to you and you can fix it and re send back to me we did before dont know if you can or not /u/b

it’s getting frankly homoerotic in here !

i guess i give up for good bye

!insert
!man insert

see http://dev.mysql.com/doc/refman/5.0/en/insert.html

(select top 10 * from movement order by id) why the hell does that give me a error? but if i take away the quotes it runs great (testing in sql query analyzer mssql 2000) or i can leave the quotes, and remove the “order by id” and it will run, but i need it ordered

!man delete

see http://dev.mysql.com/doc/refman/5.0/en/delete.html

!man replace

see http://dev.mysql.com/doc/refman/5.0/en/replace.html

order by [id] ?
lyme`: the syntax looks OK

I know you can user ‘LAST_INSERT_ID()’, but ATM I have an SQL statment in my PHP to incert some data… but then I have to use ANOTHER statement to select the last inserted ID so I can auto link back to the new page that was just created. In there any way to consolidate these two into one
statement?

what are you using the keyfield value for?
*id value

how do I check if a user entered an int or a string?

in php?

umm yep

if(is_numeric(‘whatever’))

how about string?

if(is_numeric(‘whatever’))
if(!is_numeric(‘whatever’))
the second

ok thanks

that’s a helpful technique for protecting your app from sql injection. Code things such that you only take numeric input, and scan for that.

ah
this book I am using is telling me to use trim()
but I don’t see how that’s useful

comparisons.

string to string

a trick I’ve been using is ereg_replace(“[^0-9]“,”",’whatever123′) returns 123
it’ll strip out anything not a number

I like to capture non-numeric input so that I can fashion a proper html repsonse.
along the lines of ‘f**k you a**hole’

wow, I just got a really good mark on my IQ test.

if I use phpfastcgi; leaving php always running witha pconnect to mysql embedded; will it keep query cache in memory?

a trick I’ve been using is ereg_replace(“[^0-9a-zA-Z]“,”",’f**k you a**hole’) returns ‘fk you ahole’

oops wrong channel

what mark did you get

6

6 is very good. good boy. good good boy

query cache stays in ram until the underlying row(s) are changed. So it is not necessary.

no necessary? maybe you missed the part about embedded

perhaps I did. Sorry.

the point is if I keep the library memory active will it cache the query?
or does the embedded library not have this ability?
I love bitchy people; my brothers girl friend annoys me… mainly cause she doesn’t like my drool

afaik, mysql caches query results, referred to as the query cache. a change in the underlying rows flushes the cache. I cannot speak to embedded processes.

I am not communicating my needs well enough

so I will stop annoying you. Ciao.

no no

config.status: error:cannot find input file:
someone here fast
cnfig.status: error:cannot find input file:
config.status: error:cannot find input file:Makefile

When I am ORDER BY(ing) how can I order by something in another table.

heh, mysqlchange is still at it? bahahaha

like ORDER BY anothertable[somethingincurrenttable] or something?

hey guys

i want to install mysql
config.status: error:cannot find input file:Makefile

hey. ID int not null auto_incriment primary key,
what wrong with that?

config.status: error:cannot find input file:Makefile
can someone say what happend

you suck
???

you sucks
in phpmyadmin room say that mysql room lie

*shrugs*

becouse there can be installed coallition

do u guys use some GUI for mysql

if they know of a super secret flag, why is it they won’t tell you?

PsciCodelixHAT, phpmyadmin
hahah becouse they are not mysql support

because you teh suckah

becouse you sucks
for this words you need to be kicked

heh heh
so kick me

heh heh
do when admins come they will do
that is they problem

yep everything is someone else’s problem

like you

that’s why you don’t have the super secret flag

i don’t want to have it

mmhmm

i did understand

ok

!ops
op please
domas, ?
domas, online?

hi, i need to UNION 2 select statements but I need to put in a dummy field with a null value in one of them because they have a different number of columns, how do i do this?

domas, online?
ineed to reach a op please

!alter
http://dev.mysql.com/doc/refman/5.0/en/alter-table.html
bah
^^

Hi, is it possible to store binary data in the database? In particular I want to store a graph image.

yeah, they’re called blobs

Thanks.

kbrooks, haha
again here

mysqlchange, shush.

defending the channel

megaspaz, but wont that make the change permanant? i dont want to literally make a blank column in one of the tables

um yar
um

Hm, if I use BLOB will each image require ~65536 bytes or will it adjust to the size of the image? My graphs are 3-4kb in size, does it make sense to push them into a database or it would make more sense to store them directly on the hard drive? What would you do?

“every derived table must have its own alias”

bbl

storing BLOB is rarely worth it.
unless their physical location changes frequently.

How can I set a mysql password of a user the same as an entry in /etc/shadow ?

!man grant

see http://dev.mysql.com/doc/refman/5.0/en/grant.html

you don’t. You grant access to a user.
i.e., you create a mysql user.

I mean, I want to set a user’s password to the same as one in /etc/shadow
I have a system user and a myself user, I want to extract the system user’s password from /etc/shadow and set it to the mysql user

you can’t extract the password from shadown, unless you brute force it.

sorry if I wasn’t clear
Can I use the /etc/shadow hash to create a mysql hash

you can’t
no, you don’t want to do that.
it won’t work.

That’s frustrating… );

Table ‘lvxnox_wp1.jos_session’ doesn’t exist SQL=SELECT * FROM jos_session WHERE session_id = ‘a934e318efb0b0b3fdae4cd2f1240a71′

I just want to do it as a one time thing

How I can create this table?

!man create table

see http://dev.mysql.com/doc/refman/5.0/en/create-table.html

^^

thumbs, hm, I see. I have ~8 users right now, they will have 48 images each. Hm, oh my, that makes 384 images already. :/

in most cases, the db size will increase significanlty

Hm, I think it will be saner to generate the image on the fly, considering once the user will set the preferences he/she will only need 1-3 images tops.

I don’t understand this.

the table needs to exist. So create it first.
is that a temporary table by any chance?

I think than is permanent table. I try to install the Joomla.

joomla makes you create tables?
-_-;

megaspaz, well, it’s a client section of our customers, so that’s not millions for once. And then again, either that or a script running every 20 minutes generating 48*number_of_users images and storing them somewhere.

heh

yes create tables, but don’t create just this.

then install joomla properly.

the most i’ve heard is that you might have to create the db, but tables are something the app should create
since making the user create tables with the right structure lends itself to many problems… like teh typoing and speling issssueesss

you sounds drunk

a perfectly normal sound
:P

can you stop a mysql query that is taking too much time?
hey zoffix
how goes it?

alright.. [trying to be] working on a project that I ETAed for last weekend

I seee…. I got so pissed at my server the other day so I just put my hardware from my main pc in it instead… now i have no main pc lol
I think the sata controller is screwed up on it
I would figure your would be a postgre type of person

Athfar, I have a boss

ah
I think the only thing i like about mysql is the native fulltext search :P

It’s alright. Get’s the job done.
s/’//;

hey..can anyone tell my if mysql has a GUID() function? google’s not telling me much…
autonumbers are too sequential for what I’m trying to do

switching from mssql?

no…but that’s where I got the idea

google says no; google says char(36) and use UNHEX(REPLACE(uuid, ‘-’, ”)) to import; to generate a new one tho you’re on your own

what’s ‘uuid’?

how do i add up the values in a column?

ahhhh
SUM()

it’s max(), isn’t it?
oh..
thank you

i’m sure you can guess what MAX() is

it’s 11PMm and idn didn’t ylsepe for a couple of days
DREADED KEYBOARD

heheh apparently

better turn off auto commit…

Does anyone here have experience with using international languages and mysql?

UUID() looks nice…thanks

is there a quick way of using mysql to SELECT a row by id and also the rows above and below the first row?

which cmd to see which db you’re currently using?

how can i get all the rows that differ from each table (both missing and added)?

never mind

spell nevermind i think

I think not

anyone here used international language with mysql db?

think I have a mysql bug, but maybe it is somehow a feature
http://pastebin.com/m6e512ed2
when you insert 0 into an empty auto increment id, it really inserts 1
it has bit me a couple times in the last little bit, so I thought I would mention it
thoughts?

no, it inserts the next auto_increment
pretty sure at least… do it again and I bet it will be 2

insert into mytest (id) values (15);

maybe some error just with 0?
if I tell it to do 0, I think it should really do 0

You going to linuxworld?

so where would I report a mysql bug?

bugs.mysql.com maybe?
Wild guess, though

good guess
doesn’t it seem like a bug?

any idea how to have php use new version of mysql? I was running mysql 4 and upgraded to mysql 5 but when I run phpinfo() it appears to be using mysql 4
I know mysql 5 is installed because mysql -V says mysql 5.0.44

recompile pphp
since your php instance was compiled against php4
gah
mysql4

mmm

looking for some assistance regarding my mysql install on osx. does anyone know where the pkg installs mysql? I have the servicepanel installed and running- but i cannot for the life of me find where it installed . anyone know?
i thought i twopuld be in applications- but alas. no..

is there any tool for mysql to do like a sweet model of my tables and foreign keys but show actual rows instead of just the tables and fields?

Hi everyone.
Does anyone have any recommendations on data warehouse books?

acidjazz_:use the SELECT command to see the rows

Hi, can someone please tell me what is wrong with this query?
insert into messages (from, to, subject, time) values (‘2′,’3′,’hello there you sexy thing’,'123451′);
You have an error in your SQL syntax
I can’t figure it out for the life of me.

what does the schema look like?

| from | int(10) unsigned | | | 0 | |
| to | int(10) unsigned | | | 0 | |
| subject | varchar(100) | | | | |
| time | int(7) unsigned | | | 0 | |

woo that looks like fun
they invented paste bin

do show create table messages and stick it at http://pastebin.com/

Oh.
From is a reserved word.

ahh, yeah
surprised it let you create the table

I name all my tables AND FROM JOIN SELECT all the time
FOR OR XOR
why would possible keys be NULL but a key be used?
woh wth via is making chips
http://www.newegg.com/Product/Product.aspx?Item=N82E16834280002
processors

zackattack
most likely your column nmae of ‘time’/ or ‘from’ is a reserved keyword
try placing backticks around the column names
insert into messages (`from`, `to`, `subject, `time`) values (…

yeah, done.

I would say, try changing the names
I have regretted my sql column

otherwise looks fine

always forgetting to do `sql`

spackes1, any experience with data warehousing / any recommended books?
or zackattack
The kimball books ive seen recommended, but am a bit iffy about some of the content – some subjects look useless in there

I have some experience, just no good books

yeah, ive got experience. I would like some good books though

I think others have recommended the kimball book to me

At the moment im dealing with a way to better handle a large warehouse where statistics are updated in real time over 5 minute intervals, so its a bit difficult when the database grows

Ive had a similar experience

my hot tips are try to do inserts only through a ‘load data infile’ or multi-value inserts, do a table for each day and aggregate daily via cron

When the database did get large we ran into performance issues
Largely because it was my first time doing it

Im thinking ill need to partition the data better (by type and possibly by aggregation type)

But ultimately.. I think.. olap is the way to go

with those simple tips, we were doing like 100 million rows a day
not sure what your volume is like

yeah, i’ve refind the database once – performance was back up nicely but degregated over a few weeks
I think because of the many concurrent inserts/deletes over time, the db has become fragmented

vacuum

vacuum?

fragmentation is overrated

Got some links to some olap information?

sorry, that’s what you would do in postgres

I think I just need to split up my tables a bit better, at the moment I have one with around 80 mill rows which is usually okay but its difficult to manage

not sure what your data is like, but a table per day worked pretty well for us
merge tables can help out, but we really just had to aggregate
and views were a nightmare
like overnight for one query that merged like 90 tables

Just look it up on wikipedia….
There arent any decent free products that do it

I need to really manage it myself though
since I use the data to render reports and even graphs

Does old data change much?
and how many dimensions do you have?
it all depends on a number of factors… aggregate tables can usually do the job.. but if you have alot of dimensions to drill down on it becomes hard to manage

we used http://www.pentaho.com/ for reporting
pretty huge learning curve though

# double free inside session_regenerate_id() (MOPB-22 by Stefan Esser) (Ilia)
# Added missing open_basedir & safe_mode checks to zip:// and bzip:// wrappers. (MOPB-20, MOPB-21 by Stefan Esser). (Ilia)

Are you using mondrian?

woah sorry about that

well, I think we were, I switched jobs

yeh at the moment my aggregated data lives in the same table that has 5 minute samples
ill need to split that up I think
the data wont change once aggregated

I just pushed to pentaho and another team actually managed it

If it doesnt change much then that makes a world of difference
The only other thing you have to worry about is the dimensions
if those are small then you should be fine
currently we have an aggregate table that can drill down to 8 different dimensions… We are using a star schema but it starting to suck
and the data changes all the time

do you use pentaho?

We were considering it.. I was mostly interested in mondrian
which is pentaho’s olap stuff
but.. we decided to go with a commercial product
for reports we still have a php interface that was custom written
All of it is crap… i mean honestly when your dealing large volumes of data i think its beneficial to invest some money up front
on decent reporting solution and hardware

if i have FK on certain column, do i still need a regular index on this column (if i am going to pull data by it) or is FK enough ?

I think that the fk is not enough

ok, then i keep the index

At the moment for example I have a table called ‘entry’ that has 80 mill rows at the moment. It contains the last two days worth of 5 minute samples, two weeks of 4 hours samples, 3 months of 1week samples and monthly samples for example
the other samples are aggregations of the 5 minute samples to get the 4 hour samples
aggregate of 4 hours to get week sample, etc
so once the data is added via the 5 minute samples, the rest is aggregated off this data (and aggregations of the aggregate data)
this is all in the one table at the moment

the table with 80 million rows is just the aggregations?
or is that the actual raw data

how do i remove osx pkg install from osx?

at the moment, combined aggregation data + latest 5 minute samples

thats a shit pile of records my friend

5 min samples are kept for 2 days until they are deleted
yep

Plasma-: if you really want to grow I would do something like entry_5minute_2007_07_14, entry_5hours_2007_07_14, etc
it does make queries a bit harder, but we just found that we had to do it

Ya.. or partition it
if you can use 5.1

yeah. I was thinking that may be a bit too fine grained though, for example a typical scenario is to graph maybe the last 12 months of weekly samples
so would prefer to access a single table, not 20
yeah, Ive looked at 5.1 partitioning – looks good

merge tables help there

not production ready though

I would look at olap dude
take a glance

will do

its neat – o

yeah ive played a little with merge tables – for some reason when I tried it locally on a development database it never loaded the merge view (timed out), strange
will have another poke
so it sounds like I need to split up my data better over multiple tables
and make use of merge tables to query across multiple tables

Plasma-: those would be my hot tips for ya
how do you do all the inserts, thats impressive

big disk?

every 5 minutes new stats are inserted via insert statements (bulks of a few thousand inserts per query)
takes around 1 minute all up

ahh

aggregation can take longer if its on the 4th hour of the day etc

I think that the bulk insert stuff rules
load data in file, or just multi-value?

multi-value – the data to insert stats from is pulled from another table
I take a snapshot of current values of a given table and thats the data to be added

I have never really looked it up, but how big can a multi-value query be?

max packet size

spackes1, with your usage of merge tables, do you create the merge view’s programatically (eg stats_last_week table) which covers stats_yyyyMMDD + 7 days) when needed or something like that?
ive found that you need to tweak how many inserts you do – doing as many as you can can be worse than doing less
need to find a good ballpark

I created the merge tables via cron
yeah, like last_90_days tables and the like

gotcha, thanks
suppose this helps with deletes too
just drop the expired table of stats

so nice
or dump it and archive it somewhere, then drop it

myisam table of choice?

yeah

ive found you need to be critical about the column types used as well

but I did do innodb stuff and it kept up just fine

Comments off

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »