i have a problem i have an object which comes from an array with the keys not being 0 1 2 and so on for example

does javascript have the ** operator?

See Math.pow().

for(i=1;i=36;i++){Math.sin(Math.PI/18*i)}

undefined

b=[];for(i=1;i=36;i++){b.push(Math.sin(Math.PI/18*i))};b

{ }

b=[];for(i=1;i=36;i++){b.push(Math.sin(Math.PI/18*i))};b

{ 0: 0.17364817766693033, 1: 0.3420201433256687, 2: 0.49999999999999994, 3: 0.6427876096865393, 4: 0.766044443118978, 5: 0.8660254037844386, 6: 0.9396926207859083, 7: 0.984807753012208, 8: 1, 9: 0.984807753012208, 10: 0.9396926207859084, 11: 0.866025

Whee

can I do an onchange for a textbox ?

Yes, you can on all form elements.

so what constitutes an onchange for a textbox
typing a character?
as in entering/removing characters

yup

is this possible http://www.pastebin.ca/658144

The paste 658144 has been copied to http://erxz.com/pb/4050

hello all
I am trying to make a simple javascript host menu using mouseover for images
i was trying to find the code to do it online with no luck

just change the src and you are set DARKGirl

it’s ok to declare variables without var, right?

onMouseOver=”this.src=’newimage.gif’;”

is this possible http://www.pastebin.ca/658144

The paste 658144 has been copied to: http://erxz.com/pb/4050

How do I get the content of a atag/a?

Multiply ref.innerHTML
Renacor var x = { y: 5, z: ‘bleh’ }

Isn’t there other ways, but innerHTML?
And I want it to be lowercase.

Such as?
If it’s a single text node, ref.firstChild.nodeValue does the job.

can I have another object in x
as in x.y.z = bleh
x.a.z = meh

Okay.

Renacor var x = { y: { } }

cool thanks

TheCastor, how do I make the nodes value lowercase, then?

nodeValue is a string
string.toLowerCase()

Oops, I used toLower()

if i have a document.i_want_a_variable_here.foo can i say document.+my_variable_name+.foo ?

document[myVariable].foo
window['document'][myvariable]['foo'] for the understanding

Ahh!
understanding takenth

http://paste.cplusplus.se/paste.php?id=6417 what’s wrong with the returnWords() function? The loop isn’t run at all

tag’s class to a specific class, if their href is f.ex http://foo.bar?

Gambaroni are you sure you don’t get a js exception in your console? something like… http_Request has no properties

Nope.. in FF it works

result.getElementsByTagName(“word”).length is greater than 0 ?

Multiply, var links=document.links; for(var i=0; i links.length;i++){var cur = links[i]; if(cur.href == ‘http://foo.bar‘){ cur.className=’spesificClassName’ } }

by the way instead of calling it in the for and every where, you should use a variable, var collection = result.getElementsByTagName(“word”);

StaZ|Work in IE7 no, in FF yes

element in your page ?

dabear, thank you

StaZ|Work yes
4 even

i’ve never heard of this tag
it exists or you invented it ?

my invent

FF might not like that

It an own created XML document

and getElementsByClassName

xml !?
hm… wait a mint
oh lol
fjer

:P

fjer?

well, sorry that’s out of my reach
dabear yeah that my head on the keyboard

Then get up and in reach.

7y67yu6
that’s my head on the keyboard ^^

that’s 2 htis
hits

eval(return ‘prods.bc.q’ + qty);

return ‘prods.bc.q’+qty

0

huh
how do you write it
just like that?

qty=555; return ‘prods.bc.q’+qty

”ERROR: Can’t modify constant item in scalar assignment at (eval 212) line 1, at EOF

i wanna put it in a function parameter

var qty=555; return ‘prods.bc.q’+qty

”ERROR: 13401: Can’t locate object method “var” via package “qty” (perhaps you forgot to load “qty”?) at (eval 212) line 1.

what?

return ‘prod.bc.q’+qty) ?

Renacor, try function(a, eval(‘prod.bc.q’+qty))

yeah doing that now, thanks

nm
555

“ShaunO” at 71.6.194.243 pasted “Reliable way to preload images?” (13 lines) at http://erxz.com/pb/4051

^^ Anyone wanna take a look for me?
(please)

ShaunO`: what’s up?

Just wondering if that’s a decent way to go about preloading images
http://erxz.com/pb/4051
Not 100% sure on it
initWeb() is called in the body of the page onload

does it work?

im not sure to be honest.. im going to test now i gues
just by using large files

hi, anyone know how i could highlight not just the row of a table im hovering over but the row below it too?

empika, you could use currentRow.nextSibling()

ShaunO`: good luck

thanks, ill have a look into that

is there an isset() like function for javascript

Renacor, just check if whateverValue !0 undefined
whateverValue != undefined

Thanks stickto, just fyi it worked perfectly in all browsers, firefox, ie6, safari, opera

ShaunO`, excellent, I will use the method as needed, thanks

Images definitely being preloaded with the JS since there aren’t any other references in the web page until it gets put by javascript ajax

ShaunO`: what if remove “preloadImage = null;”
and remove “var preLoadImage = new Image();”
just change the src attr again & again

stickto, may work.. not sure cbf testing now its nearly 2am and im tired :P

ShaunO`: oh, you are not in US?

new zealand

ShaunO`: oh, you always work so late?

sometimes..
i been working on a new project for myself
learning a lot as i go..
but i also work on learning this sort of stuff at my day job at computer sales :P

diligent

this is the project at the moment.. only this one page so far and no backend yet.. but at least 99% of javascript is done and the layout i’m happy with.. took me about a day or two of frustration and whatnot but it’s 100% compatible all browsers, valid xhtml and css etc.. the url is – http://www.filespin.net/fs/
it’s a registration page for a sort of free hosting type thing
when you enter a field that needs to be unique it will validate as you go down the form thru ajax and php
but that part isn’t done yet
all the javascript/client-side validation is done though
it’s going to be re-verified with php on post as well anyway

b

but i can reuse a lot of the code and regexps..

=[

anyway, enough of my blabbering, night..

ShaunO`: good night, the cross-platform js is hard to write

it's easy if you stick to the basics and standard(s)

i have been annoyed by it

easier now that ie7 is a bit better
and safari for windows too... don't need a mac to test with =]

Hope so
deal with IE & Firefox is exhausive

rule 1) code for firefox, fix/hack for ie
people that refuse to fix for ie are being a little bit silly imo because it’s still a lot of users that use IE.. although it depends on your target audience.. a website targetted at advanced linux users for example probably doesn’t care
likewise for people that refuse to fix for firefox.. silly.
too time consuming my ass.

yes

(fixing larger websites that have been around for a long time)

many sites perform incorrectly in firefox
what’s rule 2

stick to the standards.. that way your website will last a long time
if it’s full of hacks, the next browser update could screw it all up

the problem is that most of us study js programming under IE
sometimes we can’t tell if a line of code comfort with standard

like this – new ActiveXObject(“Microsoft.XMLHTTP”);

in fact, In IE6, you must write the code to create the xmlhttprequest object

hi. to remove an arbitrary item in the array, I could use slice, yeah? arrayName.slice(3,4);?
hello. can someone refresh my memory how to remove an arbitrary item in an array knowing its index? is it slice or splice?

is there a way to do something like this with js? function foo(){ alert(this.count_input_params); } then call foo(‘1′,’mine’,'bar’); and have it return 3?

splice should work
splice(index,1)

heh, tried that… but somehow it’s removing random items which is weird…

what the hell are you asking?

heh

oh, hold on, i hear you
yeah, you can do that
alert(arguments.length)

ah…cool
thanks

splice(index,1) should work. if it’s removing random items, something else must be wrong.
http://www.javascriptkit.com/jsref/arrays.shtml

(document.getElementById(“foo”).select()).focus();

hi all

hi, rawtaz

i have a problem.. i have an object which comes from an array with the keys not being 0, 1, 2 and so on. for example i have object.10013, object.10002, object.10007 . now id like to do two things with this object/array.. 1) id like to loop each of its elements, and 2) id like to just get the
first of its elements. how would i do this?
usually i have an array with 0-X as the keys, then i just do a for loop that checks for .length, but thats not possible here

When I’m referencing using document.getElementById(‘whatever’).value using a textarea, is the attribute for the content “value” or something else

It’s value. Try look it up in MDC before asking

Thanks and sorry.

nothing to be sorry bout, it was a suggstion, you’ll get your answer faster from the MDC

element’s options does not count as an onchange event?

with the keyboard

Renacor, ’cause a change of the value doesn’t happen untill the value is clicked (or you use the enter key)

thats kind of silly
the value gets displayed differently but there is no onchange
aha, whats this onkeyup

question … is it possible to put a variable within a pattern for use with .match()?

MysticOne, .match(aVar)

I’m trying to combine it with a regular expression, though

MysticOne, if you want the var to be included in the regex it selg, you must use new Regex() instead of //.match()

create a regular expression using the syntax var my = new RegExp(“\\w” + variable + “\\d”);

new Regex(var here pluss regex).match()

ahhh, okay
so RegEx will take the string and convert it to a regular expression

Not “Regex” but “RegExp”…

err, yeah … sorry
left the p off

Plus the uppercase E.

hello all
can someone direct me to a page that allows me to create a menu that is based on images?

anyone here used sproutcore?

http://www.dynamicdrive.com/dynamicindex1/chrome/index.htm

no no not a dropdown menu
something very simple

I cant see my POST and GET-calls in my firebug, does anyone know what might have happened?

you roll the mouse over it and it highlights, you click and it goes the the next page

awesome, got it to work thanks!

np

anyone?

How can I change the default-value in a dropdown dynamically using javascript?

well let me tell you what images I have and maybe it would make more sense
I have a whole menu for each page with the title pre-highlighted

maybe this http://www.cssplay.co.uk/menus/menu5teen.html

and I have small images that change for mouseover
that CSS play menubar is exactly what I want
you know the one with ‘Demos’, Menus, Layouts, Boxes, etc

You mean the top one?

yup

kanzie, theSelectBox.defaultValue

http://www.cssplay.co.uk/menus/neon_menu.html

yes!
thank you!!

NP

god IE is so silly, it just doesn’t like setting onchanges with setAttribute?

where is the code?
is it in source?

Read it. He says its building it based on the previous tutorial. Come on girl, put in some effort…
You can also do view source.

sorry just too excited i suppose
ive been looking for this for a while

Hey
is there any way to get the path of a file that cointains the code with JS?

I’m doing a els=document.getElements…() and I thought it returns an array, but when I try to do els.concat(els2), my browse complains that els.contact() is not a function
as thought els is not a bona fide array

Actually ‘els.contact()’ is not a function, its ‘els.concat()’

chrismon, it returns an element node list, not an array

er year concat
bjorn, ahhh

that wont work
that uses only 2 images
I have 16
i need to use javascript for this

I am sure you can make some adjustments…

i cant
because of the unique shape of the menu

Thats exactly the point I am trying to make. Since you have a custom requirement, you would have to read similar examples and come up with something original.

??????????
is there any way to get the path of a file that cointains the code with JS?

does anyone know how to use the prototype chain to determine a instance class?

does anyone follow any personal guidelines on when to use innerHTML vs. create/clone nodes?

Hi, I’m trying to write a perl script to automate browsing this webpage. The webpage makes a reference to a javascript function (which i did not write!) and I can’t find the source for that function… its like it links to nowhere
select name=”sendTo” onchange=”javascript:listAction(document.listForm, document.sendToForm.sendTo.value)”
is javascript:listAction part of java script, like Math.log() or something?

hi. i am using this simpla javascript function to toggle the visibility of a div. it works fine in firefox but in IE, the div is displayed out to the right of the page rather than below. is there anything i can do from js to fix this? http://pastebin.com/da63fb7e

No its not a standard javascript function. Its a user defined one.

Isn’t there like a firefox extension or something that will say “this javascript function is found on line X of this file?”

Bah, I hate people.

http://pastebin.ca/658448 ?

you could use firebug, view scripts, and then search

I searched the source of the webpage and all the included js scripts, and none of them had that function

The paste 658448 has been copied to http://erxz.com/pb/4052

But its not a standard Javascript function thats for sure.

Two implementations of vi in javascript, both with ‘closed’ licences http://www.masswerk.at/jsuix/jsuix_support/jsuix_vi.js http://gpl.internetconnection.net/vi/vi.js

I’d tell you to join the club, but I had to disband it when I realized I hated everyone in it too.

Ha

why would you put something in java script under a closed license? you have to release the code anyway… its javascript!

But it’s so easy to get security through obscurity by compressing and encoding it.

Well yeah. But I’m not just going to suddenly go and disrespect their licence.
Well, neither of them are.

It doesn’t matter whether you can see the source code or not. If its under license, you just can’t use it.

Yes you can. It just depends on what the licence says.

Aankhen“: doesn’t the webrowser still have to decrypt it?

Of course, someone could put it under a closed-source licence and thereby prevent you from using it.
I did say “security through obscurity”, did I not? :-)
It’s a nice, warm, completely unfounded sense of security.

Aankhen“: I meant closed license.

Aankhen“: that only stops stupid people

OK.

level1__ – then it stops the majority, right?

What part of what I said was unclear? :-S
karma MikeD_ perceptive

level1__, Wait, are you calling me stupid for obeying the license?

Argh.

not the licence, the security through obscurity

Oh, right, not keeping up.

http://pastebin.ca/658448 ?

The paste 658448 has been copied to: http://erxz.com/pb/4052

you need commas, but yes

cool thanks

I’ve used firebug to search the entire page. listAction is used dozens of times, but never defined

sounds like it’s not defined then

ack! where is it!

do you own this code, or are you trying to understand someone else’s?

it probably does something stupid like set a number from 0 to 1… but I can’t figure out what it is!
someone else’s
I’m trying to automate a web page… I’m almost done, this is the last step

Anyone here a php web hosting programmer? What’s the equivalent of str_replace() in Javascript?

hi all

wait, listAction shows up in the DOM tree in firebug
but it just says “prototype”… thats not helpful

Don’t know about PHP but there is a function replace in javascript.

string replacement JLearn?

YES!
I found my OOOLLLD code that I made ages ago
but
I am not sure I did it properly
care to look at it and tell me if its ‘legal’ code?

I’ll try though I am not in menu stuff and all that.

meh, its only a bunch of javascript and divs

or better – something that converts whitespace to entities that can be passed through URLs.

Look at Strings’ replace function.

we dont have to chat in the query, because you are talking to other people and it would be a pain
hmm
I shall have to edit up that code a bit I am sure
because my new site doesnt use frames
apparently frames are EVIL

Correct.

but other than that…the layout; the way I am doing it, is it ok?

The way you call imgOn and imgOff functions is wrong. You pass a string representign the name of the img and inside the function, you treat that name as if it were the image element.
Oh no wait, you are using document[imgName], then its OK. Ignore the previous message .

guys, can i store a function name on an attribute, then execute it?

ok hehe

the code looks OK. Do let me know if you face problem executing it…

ok, thank you. I was hoping all the div tags werent a bit…much

If it works for you, then its OK.

and the manner I use the z-index
although, I wont have so many layers this time
only 2

Like I said before, I am not much into CSS and designing though your code looks valid.

can i execute a function based on a string?

Your code executes fine on IE here…
yes

how?
i need to create a new event on my div
callAfter=”someFunc()”
after, inside my script, i need to div.getAttribute(‘callAfter’) ?
how do i execute it?

do window[yourFunctionName](your_function_parameters)

so will be window[div.getAttribute('callAfter')](your_function_parameters) ?

hrm… I’m running a getElementsByName() and FF2 get the list correctly, but IE6 and IE7 do not find it

If that function returns the string containing the function name, yes.

on google I find issues with getElementsByTagName()…
er one sec…

JLearn, thats it, cheers man

Welcome

Hi all
I’m pretty much a Javascript n00b

with a b00b?

Sheesh…

In the Facebook Platform – it says that onconfirm is an event handler that fires when etc.

I love n00bs with b00bs

How do I change this onconfirm thing?
this.onconform?

What are you trying to do?

anyone knows if it is possible to get the path of the file that is executing the js code? for example /leayout/js/file.js

hola Aquaman

hey :P

In your code you had document[imgName], replace it with document.images[imgName]

ok, thank you

anyoneeee?

Don’t think you can do tha Aquaman…

[JLear1] and can I get values from the url?
like the $_GET in PHP

You mean the query string parameters?
http://www.google.com?do=something

nope something like, file.js?something=value

Now why would someone do that!!

hahahaahha
because I need to pass a dinamic value for a path
I need to import a JS inside that JS, and the path to the second file has some dinamic value that depends on the user

Ah…that would require some thinking…

script language=”javascript” src=”{PATH: STYLE_BASE}resources/js/goear.js” type=”text/javascript”/script

This is your base JS, right?

thing would be replaced by /styles/glow, but could also be replaced by /styles/blue/

Oh..why not just use PHP to do selective script loading?

I have a textbox and a button. The textbox has a blur event. The button has a click event. After typing in the text box, if i click the button. The blur event fires, however the click event does not. the blur event does not return naything, and does not have a stop bubble.

yeah that would be the base JS and then I would like to import the rest of the js files needed for that layout

Depending on the user input just create a if else mesh and do a selective script loading instead of the stuff you are trying to do.

in the html code, I want to import all the JS files inside a unique JS file and import that JS file in the html code

element which was included and not every script tag since your PHP would have made a choice by then.

could someone kindly explain “this” to me… this.element

mmmm I will try something like that

ultravi01 okay so when you’re in an object, this, is the object

[ultravi01] http://www.quirksmode.org/js/this.html
read that

ah okay.. thanks guys

In normal scenarios, this is the window object.

you got examples and stuff

http://uncyclopedia.org/wiki/This

lol

!
oops

is it possible to have some kind of loop through elements in an object?

what’s the object literal notation for a null value? var foo = { prop : null };

for(var property in object) { alert(property + ‘ : ‘ + object[property]); }

perfect
thanks

Welcome

how can I count the number of sub objects in an object?

Renacor, every property will be an object..

Im trying to count the number of objects in my user created object

for(var property in object)

will this also count the built in javascript hosting properties, or do they not exist in an user created object

why does new Option use ‘text’ node?

awesome I think that worked, thanks
btw anybody know the maximum length for a get string?
i.e. index.php?blah=blah&foo=foo

if you have to ask, you’re going to go over it
it might be browser dependant but i think it’s something like 1 or 2k
use post

Its counted in characters and not K’s…

… or some other cereal brand

No, only in characters.

what does that mean?
oh

i see
so is there a foreach like statement in javascript to loop through an object’s sub objects?
or is it just the for(i in objectname)
nm got it

there is a .forEach() but that’s not supported by all browsers

So I hacked up this popup window thing so that the onclick of my href creates a popup menu then returns false; so the actual href redirect never happens. This is what I want to happen but not the popup window that pops up follows my mouse around

Hello
If users click on a hyperlink on my website, what code do I write for the link to open in a new window?

anyone know if it’s possible to have a google map update based on onkeypressup ??
i want a textarea to automatically update a goole map while the user is typing

it uses dhtmlwindow.open() to create the popup . Is there an argument I can pass to it to make it not follow my mouse?

tag should be _blank

Okay.
Now for something more complicated. How do I make it open in a new Tab (say, Firefox/IE7/Opera)?

when I double click on a scriptaculous BlindDown link, it works fine, but next time it gets BlindDown’d it only opens up part way — any ideas why this may be?

Anyone every used overlib() ?
ever*

That is not your domain. You don’t decide whether the thing opens up in a tab or a new window.

But, window.open is by default open in new tab in newer browsers, yes?

Firefox and other browsers allow the user to decide which way they want it through preferences.

is there an overhead with new myobject() ?

yeah, probably the sky will fall on your head
(that was a sarcastic comment, please explain a ltitle further)

just wonder if I can aplly factory pattern

What are you talking about. The overhead to object instantiation?

“I want to implement a factory pattern, does instaciating new objects with newMyobject() will create an overhead in this situation : link to code on paste site here”
have you tried googling “Javascript factory pattern
?

If you want to use an object, you have to anyways instantiate it. Be it via factory pattern or normal manner…

doing it right now

Guys.
Why does my browser not show a new browserwindow with all the buttons on it when I use window.open? It just pops up a new window with no buttons and my page in it.

a href=’your_url’ target=’_blank’SOme link/a

:P hm
And someone with a popup blocker would still work with that?

Nope

So the popup blocker would block it?

Yes

Damn ittt.
Pff.

Thats why sites don’t use popups anymore…

I’ll just put a line in my website “open this link in a new page please”
What if,
I want to refer to a completely different website
Like

found it in google, there’s such thing as factory pattern in javascript

http://users.telenet.be/treval/

http://www.webreference.com/programming/javascript/ncz/column5/

What if the user is on my current, old website.

what link Treval

And I want to link him/her to my new website
The one that says ‘home’
and the one ‘treval time’
I don’t want them to open up my new website within my old website

Urgh, look people can chose.

bah

Treval, it opens up a new page for me
a new window I should say

Does that new window have buttons?

The Treval Time window does
( FireFox here )

Wthell..
I’m using forefox too but
I mean “back”, forward
buttons
Do you have a menu bar?
In that window

although I do remember an argument to window.open() that tells whether to include the menu set or not
yes

Opens in a new tab for me.

But I don’t!

grimboy, same

Why not me..
sigh

Treval, Learn to configure your browser.

What argument do I need to set to include menu?

Treval, I am not sure. Google for window.open arguments maybe and look at the list. There is one there that is exactly that, tells it whether to open one without buttons or with buttons.

is there anyway to print or write a structured array
like “print_r” in php

Firebug
`firebug

Is there any way to make it so when a hover over a class item occurs, the hover effect stays (doesnt revert when rollout). Like on this site: http://meyerweb.com/eric/css/edge/popups/demo2.html but when u hover i want the item to
stay and replace when a new is hovered.

well yeah… onmouseenter=”setpicutre(something);”
and don’t put code onmouseexit

an array can hold any objects, right? array[0] = var new Object();?

atula, yes

thanks

Guys
Do the ‘home’ and ‘treval time’ links open in a new page/tab? http://users.telenet.be/treval/

you mean onmouseover?

Yes, yes he does.

you can try with that too
mouseenter don’t exist?

onmouseover is in the specification

Okay if anyone posts any more crap badmouthing my website I will personally attack them. Stop posting shit in my shoutbox!

hm
?

Oh shush.

home doesn’T, and i don’t find treval time

http://javascript.internet.com/miscellaneous/set-image.html
This will work If I can find a way to also post text.

is there any function to get random string of characters ?

yeah use a random to get a number from 1 to 26 and add it to 0×40 (or 0×60 for small letters) and do that n times
0×41 is “A”, 0×61 is “a”

thanks

np
so might need to google for javascript random function, javascript ascii code function and more if you miss other topics

anyone know why when I get an element’s contents with document.getElementById(id).innerHTML, it adds a ton of whitespace before and after?

http://fukung.net/images/4733/random_number.png
a href=”http://fukung.net/images/4733/random_number.png”http://fukung.net/images/4733/random_number.png/a
xike inner html is evil do you know about DOM ?

StaZ|Work, but the synthax is invalid!!

I know what it stands for :P

bjorninge it’s C syntax.
xike well you might want to get the child of your element and do something with that isntead of the inenrHTML OR… if you want to be evil, you can use trim functions to cut out the white spaces

I’m fine with not being evil
if I can get the contents of something, and replace the contents, then that would be great
w3schools.com tutorial uses innerhtml. have any advice for a better example?

w3schools is not reputed for having the best code
xike are you aware that i don’t know what you try to do ?

are they associated with w3c?

what is eval() ?

i am looking for a ajax/js script that counts clicks, like clickclickclick.com (without refrashing page and ‘impossible’ to fake clicks).. anyone?

xike no they aren’t and that’s the bad association most people will do
edini send them an email and buy it from them

ah..

level9wizard a bad function that evaluates the js code in it, if you use it, you probably have a bad code that could be structured better
“javascript click counter”
and for pr0n site it’s “javascript click cunter”

i did, but.. i found only visit counters and stuff
not what i am looking for..

shouldnt there have been something that went on in your brain in between when you thought of that joke and wehn you said it?
like some kind of filter that checks for things like “humor” and “appropriateness”?

hrm. know of any good dom examples for getting/setting contents of items?

heh, it’s pretty rare i make english jokes based on the language, gimme a break :P
i’m proud i could make one

ok i’ll give you a pass this time

google “javascript howto what you wanna do” and check the pages you get, and also check google groups :P
vinse thanks ^^

ha, yeah…that’s what I’m trying
horrible examples so far
I’ll keep wandering…just thought you might know of a good resource
thanks

might also stick the word “DOM” in there
well i still don’t know exactly what you wanna do
and my Mind reader is broken

lol, I’ve said it like 10 times
don’t need a mind reader when I say stuff like ” hrm. know of any good dom examples for getting/setting contents of items?”

that’s not clear enough for me
biut you can document.cteateTextNode(“hello!”); i think… and then .appedChild on the container
as for the reverse you can check .children[0] i think, but still not sure :P

.childNodes[0]

haven’t worked with that for a long time
right sorry JLearn

lala

hi
what is recommended, adding html using innerHTML = “button..” or new Button/appendchild?

the latter

can you tell me why?

lots of reasons, one of the better ones in this case is that form elements often dont work hen added via innerHTML

okay thanx

Let’s say I have a div id=”text” , how can I use js to change in text into that from a function?

still looking.. :/

anyone know if it’s possible to have a google map update based on onkeypressup ??

teh netsplit?

guys, whats the best way to dynamically change the element’s onClick attribute?
i’m using element.setAttribute(“onClick”,”func()”); but isn’t working on IE

a am looking for script that counts clicks without refrashing page, like clickclickclick.com.. and, yes, i did try googling for “javascript click counter” and 100 other strings..

just element.onclick = function(){/* new contents*/}

but i need to point to another function
how do i reference it?

how hard can it be?

element.onclick = function(){ myFunc(args) } ??
element.onclick = myFunc() isnt working

yup
element.onclick = function(){ myFunc(args) } or element.onclick = myFunc // — if you want to give no args

ok
cheers!!
how will that behave? element.onclick = function(){ myFunc( document.getElementById( localVar ) ) }
when will doc.getElementbyId run?

if ( alphanumeric(document.editprofile.gender.value) ){
is that ok?
having a function that returns true or false in an if statement i mean

Uh, yeah

does anyone know of any tool (perhaps a firefox extension) that will show how..in what order… a javascript is executed..

firebug

I don’t see where firebug does that

js ref
that’s not handy
`js ref
anyway
js_ ref
nope

ultravi01, scripts tab.
Set a breakpoint
Then step through
Firebug has masses of hidden features. You really ought to read the manual to get the most out of it.
For example the other day I found out you can set conditional breakpoints.
So yeah/

thanks man!

is there any way to pass onreadystatechange a methodname AND a variable to pass to that method?

does this make sense? :
myobj = { foo: function() { return this.bar; }, bar: 0 }; myobj.bar = 4; myobj.foo()

4

(as in, you understand what it’s doing rather than how it’s relevant to your question at the moment)

not so much

ok then, try this
myobj = {} /* an empty object */; myobj.foo = function() { return this.bar; }; myobj.bar = 4; myobj.foo()

4

(buubot displays the value of the last statement in a jseval line if you couldn’t tell)

you defined a new object, added a method to it that returns bar, then defined bar inside that object, then called that object.method to return it?

yes

ok…

now, myobj is your XmlHttpRequest object, foo is your onreadystatechange and bar is any information you want to be available when foo is called
methods on an object can access any information stored on that object using the this keyword
you don’t want to pass arguments in through the callback (mainly because it’s not possible), you want to store the information in the XHR object for the callback to pull out when it needs it

ok, well why create a new method/variable for the request object rather than set a method/variable for the current javascript?

“current javascript”?

let’s say I have my poststuff() and onreadystateDoSomething() methods in a javascript file

2 reasons, if I understand you. 1) because information relevant to the request object makes sense to be stored in the request object, and 2) because onreadystatechange will probably be called when the “current javascript” scope has finished

ah
so do I somehow dynamically add that method/variable to the xhr object, or do I extend that object ahead of time and add that functionality to it?

see my second jseval
see where I set .bar and how I used it

selector.childNodes[i] — can you help?

that depends on what selector and i are

it contains more span

for (var i = 0; i 9; i++)

so I could simply use my existing xmlhttp object and say: xmlhttp.foo = function() { return this.bar; }; myobj.bar = 4; and it will work?

yep, should do

var selector = document.getElementById(“selector”)

what does alert(selector) give you after that?

anyone know if it’s possible to have a google map update based on onkeypressup ??

I must have done something wrong, it says “xmlhttp.getId is not a function” once I call it in the triggered method

Object HTMLSpanElement

ok, now’s a good time to explain what you expect and what’s actually happening
pastebin some of your code
of course it is, javascript isn’t fussy about what event triggers it

http://pastebin.com/d37338bf4

(in the page HTML), and I want to set their style.color

any ideas what i should look into. I’m new to both javascript and google maps.

var selector = document.getElementById(“selector”)
oops. Firefox reports selector.childNodes[i.style] has no properties

I can’t see anything immediately wrong with that, I haven’t ever tried this but there isn’t any reason it shouldn’t work
maybe try moving your .getId = and .id = before the .send?

typo selector.childNodes[i].style
ideas?

hopefully there’s a live example page I can look at here

I can do that.

that worked, thanks a ton
I wish they didn’t have the word “java” in the name…it makes me forget this is a scripting language

tab completion is your friend
my first name only has one ‘a’

tab completion?

i used alert, it shows object Text

in your IRC window

again

how’d you know he was typing it Garath?

haha, nice. thanks for that tidbit too

that worked, thanks a ton

I had a good run of not spelling it wrong
so close

i was joking, that’s why i repeated the spelling … too subtle for irc though, sorry
cant convey sarcastic tone :/
how’d you know he was typing it gaRATH?
would that have gotten it across? still not funny though so nm

should i put ‘;’ after this: e.onclick = function() { someStuff() } ???

semicolons are optional but recommended in javascript

e.onclick = function() { someStuff() } or e.onclick = function() { someStuff() };
for every line? :]

you need them if you’re putting two statements on the same line

so i’ll use them

otherwise you can miss them out and the interpreter will still work
but do use them

ok! cheers!
damn it, why coding for IE is so sux!?
FF goes ok, but IE show “Error on page”, with poor descriptions… :/
is there any “firebug” for IE??
something that shows where the error is

how can i check if a dynamic function name has been declared? im trying eval(‘if ( ‘ + dynamicfunctionname + ‘ ) { alert(“bla”); }’); to no avail

when I try to get the contents of a textarea, I get the previous contents, without any of the changes that may have been made. how can I get current text?

hi guys. i have a Tooltip class and i use it to create various tooltips. right now i have 8 toolips that can be opened concurrently. when i delete the tooltip, i want to have a destroy() method in the Tooltip class that will delete all references to that tooltip.
is it possible to have a “delete this;” command in the destroy() method of the Tooltip class? (to delete the object itself)
currently when i do this IE gives me a “cannot delete this” error.
also, if my syntax is wrong and it is really possible — do i really need to do that? i’m trying to do a nice cleanup when tooltips are deleted

guys, is it safe to use innerHTML on ajax responses (not little text, something important like a new form)? or is it better to respond using json and update/create elements via DOM?
in FF is going everything perfect, but i don’t know on other browsers

always do things via DOM to be safe
use mootools for ease of use and cleanliness

mootools?
I don’t know it, going to find out
cheers m8
i’ve asked bcoz i’m using someone’s AjaxTabs script , looking inside, it gets the content and insert into the “tabcontent” div via innerHTML
i’ll have to tweak it

innerHTML will work anyway, but using DOM is always preferred

yes.. specially bcoz i’ll need to find this new elements via DOM latter

http://pastebin.com/mf5a8df0 whenever i call search function, in IE it works just fine, but when its used in FF it bugs out help is appreciated.

good morning

good mornin

the cursor doesn’t turn into the finger and it doesn’t get highlighted.

any suggestions?
ok, i just figured it out… a href=”javascript:;”

can someone look at http://mcgw.dav7.net:8181/template/bookmarks.js and see if they can figure out why i get the error “CreateBookmarkLink is not defined’?

I cant seem to figure out why my script isnt working for firefox, can someone please take a look http://pastebin.com/mf5a8df0.
does getElementByName work in FF?

elements?

what else should i use?

that function won’t work in any browser
any visible element can have an onclick

yes, but it doesn’t do the pretty highlighting thing automatically.
i’d have to add some sort of onMouseOver stuff.

if you want to change presentation, use CSS
cursor:pointer will deal with the mouse cursor

so the only thing to get values from inputs would be getElementByID? there is none that goes by name?

as in span.action { cursor: pointer; color: red; }
getElementsByName should work fine

doesnt that return an array?

the clue being that more than one element in a document can have the same name, but only one element can have a particular ID
yes, see the previous response
you might know that only one element has that name but the HTML spec can’t guarantee it so you get an array

i see, but then how do you just get the value of that one
document.getElementsByName(‘Location’).value[0] ?

just use the first element of that array
not quite
document.getElementsByName(‘Location’) is the array, not document.getElementsByName(‘Location’).value

oh so
[0].value

yep

i get it now, i really appreciate it, think ill just add the id to the inputs lol

lol

is it very unsafe to use eval() on an string extracted from a element’s attribute? (this element is part of my static html, not dynamically generated)

brb

ah?

hey i’ve got a pretty popup box, and i want to replicate the javascript confirm method but using the pretty box. Any idea on how it prevents the current action from occuring?

if a handler returns false, no other processing of the event should occur

if bla returns false nothing should happen?

right
um, maybe “return bla();”

Why is it that in Internet explorer when i have it load a dropdown menu the default selected one is always one above the one i tell it to be selected so for instance [3] is the one i want selected by default it selects [2] but in FF it does it just fine. Then if i dont load the function on
load and just do it on change it does it right.

hi all

because internet explorer is teh suck.

I have “A HREF=”download_toolbar.htm” target=”_self” onClick=”parent.home.location.href=’download.htm’”" and I am trying to remove the frame part of it
it was taken from some old code of mine
and now the frames no longer exist
so, I assume I can just take out onClick
and keep target=”_self” (I just added that)

DARKGirl, you should use onclick rather than onClick as well for validation
all lower case tags in fact

that would be a pain to make them all lowercase
i might run it through an lcase routine later

example123
regex?

could someone kindly tell me why I am getting a “Too much recursion” error whenever I switch back to my browser window on my site

can the onreadystatechange handler take parameters in any way?
blah.onreadystatechange = processthis(’sometext’);

ultravi01, You’re recursing to much and filling up the function call stack. You can rewrite recursive functions to be iterative.
mutilator, Uh, if it’s a handler you need to assign a function to it, not the results of a function call.

I’m not sure what recursion is.. do you know of a good resource online or should i just google it

yea but the handler needs to know the name of the xmlhttpreq object
or is there anyother way to identify it other than its name?

function moo(){moo()}

undefined

Wait, no.
function moo(){return moo()}

undefined

(function moo(){return moo()})()

Error: Error: InternalError: too much recursion at line 0: (null)

Whoo
Multiply, Yeah, take an argument in your handler function.
i.e. blah.onreadystatechange = function(evt){console.log(evt)}
Um, e.g.

hm?

Sorry, I meant you.
I think I might disable tab-completion because it always makes me mess up.
mutilator, Um… was that what you were after?

well how would i do what i said above?

mutilator.. what are you doing?

Oh, just reread.

i just joined

Okay blah.onreadystatechange = function(evt){processthis(evt, ’sometext’)}

i want to

You lose ‘this’ inside the event handler that way.

yea.. so do that=this, and then reference via that

But you can use evt.orignalTarget instead.
Oh yeah. Could do that as well.
So blah.onreadystatechange = function(evt){processthis(evt, this, ’sometext’)}

perfect

mutilator, Yes?
Whoo

yea
so hmm
coo beans
thanks
was having a problem was firing off too many xmlhttpreq’s
each using the same object, just recreating
so i had to do a lot of window[newobj] to crete dynamic names for the req’s
just needed to find a way to pass that name to the handler

hello, how to clear the selection in the window?
I tried window.getSelection().collapse(true) but Firefox says not enough arguments
mmh I got what I wanted with removeAllRanges(). Maybe Mozilla-specific

hi
I want to make a script that get the delicous bookmarks from api.del.icio.us
and send that data to another server
seem that this work in ie
but in mozila
when I try to get the data via xmlhttprequest
I get an securty error
how can I fix this?

can you include another javascript file through javascript?
document.body.innerHTML = ’script src=”soandso.js”/script’; – is that the only way?
i’m talking firefox only

You can try an XMLHttpRequest to get remote code and eval it…

its cross domain
which is why i have to include a script from the remote domain in the first place :x

Hi people

does javascript support ’static’ in functions?

Whats the proper way to refer to a frameset?
MyFrame.location.href = “Test.html”;?
Or window.document.MyFrame.location.href = “Test.html”;

someone know the name of a good html editor? (WYSIWYG if it’s possible, i want it for make div alignments with ease)

Dreamweaver 8.
* CS3

FrontPage.

Kai_wp2 Jafet thanks, i’ll get them

Err.

(i’ll test both)

http://www.adobe.com/products/dreamweaver/

Both cost money, but Dreamweaver doesn’t suck as much.

http://www.runaware.com/microsoft/frontpage2003/
a href=”http://www.runaware.com/microsoft/frontpage2003/”http://www.runaware.com/microsoft/frontpage2003//a
a href=”a href=”http://www.runaware.com/microsoft/frontpage2003/”http://www.runaware.com/microsoft/frontpage2003//a”http://www.runaware.com/microsoft/frontpage2003/”http://www.runaware.com/microsoft/frontpage2003//a/a

Sellout!

Anyway, uh, I don’t wanna interupt but, anyone know the answer to my question?
Sellout? :P

Maybe window.Frame

Thanks
LOL

(Frame is frame name)

Does IE support onclick for imgs?

good, i’ll beart on mind above points
bear*

NVU is free software, handles WYSIWYG okay, but sucks badly at code editing.

i’m okm with html, i’m only want to do quick div alignments trough WYSIWYG
and i’m not ok with new keyboard, okm=ok :p

open in browser to test cycle?

Actually, you access frames through top and parent.
And why are you coding for IE?

I’m coding for all browsers, its just that this site I made only works in Opera so I’m making it compatible with everyting nhow

I’m not sure if onclick is even standard for images.
Why not wrap the image host in an anchor and use the onclick for that?

Well I mean refering to a frame from the parent. What about “obj = document.getElementByID(“MyFrame”); MyFrame.location.href = “Test.php”;”?

http://www.quirksmode.org/js/frameintro.html

So “a name=”Anchor” onclick=”Test();”img/a”

http://google.com/search?q=javascript+frames
After that search query, I have lost all respect for you. Sorry.
The anchor looks ok.

What?? O.0

var scGalleries = new Array();
15 scGalleries[0] = new Array();
16 scGalleries[scGalleries.length - 1][0].imgsrc = “/images/classesgallery/1o1s0.jpg”;
I later receive a claim by firefox that scGalleries[0][0] has no properties
when I try to get the .imgsrc out of it

how can i make firefox let me go cross domain?

“Cross-domain”?
What would that mean?

yahoo.com/blah.js does an ajax call to google.com/blah.html

Is there some way to collapse rows and columns in a table such that it will remain centered inside of another element?
I’m right now doing it with setting the style of the td to display:none
but this does not cause the td to stop taking up space

obj = document.getElementById(str); if(obj.style.display==’none’){ obj.style.display=’block’; }else{ obj.style.display=’none’; }
^ I used that code and it worked fine for me.
Do you want to remove the td?

basically, i want to make it such that the td no longer effects the table geometry
oh!
wait, i see now
i was making a very stupid mistake
sorry to bother, thanks

hi, i’d like to make it so i click on a link on my website, and a little “lightbox” appears saying loading (ontop of the page), then once the whole new page has loaded, it then moves..does anyone know of a script that can do this?

http://www.dustindiaz.com/add-and-remove-html-elements-dynamically-with-javascript/ ok
A dynamic preloader using JS?

if that’s what the tech name is…i guess so

http://www.1javastreet.com/vb/scripts/ShowCode.asp?txtCodeId=3536&lngWId=2

thank you, i’ll give it a go!

No prob!

dude fuck this cross Domain hosting shit

O.o………
The anchor works but theres a blue box around the image in IE
uThe anchor works but theres a blue box around the image in IE/u

Style the anchors then…
border:0;margin:0;padding:0;

Need help with this javascript
what is wrong with this code
html
head
script
function saveForm(){
if(confirm(“Do you want to save changes?”)){
document.forms[0].submit();
}
}
window.onbeforeunload=saveForm;
/script
/head
body
a href=’dummy.html’Two/a
form name=myform method=post action=’dummy.jsp’
input type=hidden name=operation value=save
input type=submit value=submit
/form
/body
/html

Someone needs to kick you.

Jafet were you addressing me

yes, dont paste more than one or two lines

I am sorry

use a pastebin (fi there isnt one inthe topic, than google ‘pastebin’)
s/than/then/
what form of dyslexia is it when you regularly use the wrong homonym?
cuz i totally have it :/

You appear to have acute AOL syndrome. Consult your physician.

no u r

Thanks!
I gotta go
g2g
Bye!

IE gives me no errors but doesn’t show anything, whereas Firefox appends my generated calendar to the body?

AzMoo[w]: The paste 659339 has been copied to http://erxz.com/pb/4054

AzMoo[w]: you should prolly use input type=”button”… i dont think anyone uses the button tag

That’s not the issue.

k… which calendar app are you using?

I’ve written my own. It creates a calendar and is supposed to append it to whatever element is passed to the object, but in IE nothing is displayed. It seems to append it, it just doesn’t show up.

hmm.. you have your css in order? such as positioning, etc?
sounds like a css position type issue

no CSS at all. It just creates the elements without any styling. Look at the pastebin I posted.

on this.parentNode, set css “position” property to “relative”.. then set the calendar container element to “absolute”.. maybe try that?
i bet that might fix it

In my test this.parentNode is the document body. Can I set a relative position on that?

in that case, you dont need to, but in all cases you need to set css position of calendar container to absolute

hi, how can i remove li from ul dynamically using js..

AzMoo[w]: try testing on an element other than doc.body

AzMoo[w]: OK, I give in, where’s the code?

http://pastebin.ca/659339

AzMoo[w]: The paste 659339 has been copied to: http://erxz.com/pb/4054

AzMoo[w]: Why are the member functions redefined every time a new object is created?

thats just a matter of OOP vs procedural]

because they’re part of the object.

message144, AzMoo[w]: No, it’s not — put them on the prototype

of the containing element?

AzMoo[w]: No, of the constructor function

as in calendar.prototype ?

E.G. calendar.getDaysInMonth = function() {
Yes

ok yes your right.. misunderstood what you meant

Isn’t that what this.getParsedDate = function() is doing?

Incidentally, (strong) convention says that constructor function names begin with a capital letter
No

AzMoo[w]: unless your instanc(iator) will be accessing the methods, then make them static

AzMoo[w]: If you append them to a prototype, they’re created once, then reused
AzMoo[w]: If you add them to each instance like you’re doing there, they’re created again each time

technically they wouldnt be attached to a prototype, they would be static

What?

theres a difference between calendar.foo and calendar.prototype.foo

A “static” function is one that pertains to the “class” as a whole and isn’t attached to any single instance
Yes

one is static, and one applies to an instance

But that doesn’t have much to do with the problem at hand

so im saying he could do it all statically if he wanted

OK, so I would do var calendar = function() {} calendar.prototype.foo = function() ?

AzMoo[w]: Yes
AzMoo[w]: But it should be Calendar

convention in-house uses firstCharLowerCamelCase

objects can be treated somewhat like arrays (key-value pairs). is it possible to get the first key of the object without resorting to “for (var t in object) {…}” ?

AzMoo[w]: did the css fix your problem?

AzMoo[w]: For constructor functions?

no.

AzMoo[w]: But it uses that for methods.

For objects.

AzMoo[w]: Everything in ECMAScript is an object.

I get that. Nevermind the convention, we’ll go with Calendar for now.

Right, so, the problem

not if you dont know the key name

damn. i was hoping i had missed something in the documentation

AzMoo[w]: I suspect the fact that you’ve tried to encase the constructor code in a block may be the problem

OK, so if I pull the methods out of the instance and put them into the prototype, IE will support it and it will fix the issue?

for(t in foo) break;
then just use foo[t];

AzMoo[w]: ECMA-262 is kind of vague about that, there’s no call for it anyway
AzMoo[w]: No, that was a sidetrack because I hate cluttered functions :-)

right, I was just doing it for readability.

AzMoo[w]: It will save you a lot of resource hogging though.

alright, good to know

thanks

AzMoo[w]: And that means you’ll have to stop accessing parameters locally, like in generateCalendar(): newParent.appendChild(el)
AzMoo[w]: Store a reference on the instance in the constructor, then access that
AzMoo[w]: You’re also missing a “var” or two in createHeadContainer()
AzMoo[w]: If you have multiple instances they’ll start overwriting one another.

OK, I’ll keep that in mind. I have to go now, but I’ll clean it all up and see how I go. Thanks

AzMoo[w]: OK, good luck

Cheers

Hello!
I’m trying to jump the page to an anchor using javascript.
Does anyone know how to do that?

location.href += “#myanchor”;

that won’t work twice in a row

No

focus()?

var h = location.href; location.href = h.substr(0, h.indexOf(“#”)) + “#myanchor”;

Thank you I thought I might need to do something fancy.

how can i sort multidimensional array

Recurse
And, how do you want the arrays sorted?

like this
for example i have
x[0] = ["4", "sometext1"];
x[1] = ["-3", "sometext2"];
x[2] = ["15", "sometext3"];
i would need it in order of 15, 4, -3
ie x[2], x[0], x[1]
err
yeah, that would be it

b[0] && 1 || -1; });

i have no idea what you wrote there, but let me try

Could be neater, aye

b[0] && 1 || -1; });

hmm
it doesn’t work it seems

No?
Darn

no, gimme sec tho
to make example

b[0] && 1 || -1; }); x.toSource();

[["-3", "blah"], ["15", "blah"], ["4", "blah"]]

Mmhm, you’re right.

b[0] && 1 || -1; });

{ 0: { 0: -3, 1: blah}, 1: { 0: 15, 1: blah}, 2: { 0: 4, 1: blah}}
b{ 0: { 0: -3, 1: blah}, 1: { 0: 15, 1: blah}, 2: { 0: 4, 1: blah}}/b

tag into the dom with an event from the user. is it possible to submit that data into a POST request. i’ve tried it with little success… or do i need to insert the tag into a form dom object?

ok this is making my eyes bleed

Ah, strings have a different idea of and

+b[0] && 1 || -1; });

{ 0: { 0: -3, 1: blah}, 1: { 0: 4, 1: blah}, 2: { 0: 15, 1: blah}}

There y’go

let me try

My SpiderMonkey certainly doesn’t :-\

i love you Twey

Haha

i’ve been smashing my head against the wall for last 3 hours

It’s just basic use of sort()

i guess, i am javascript inbred, i usually do this kind of stuff in php
but need it in javascript this time so i was stuck bigtime
thank you so much

Heh
Welcome

now i can go to sleep, been a long night

Heh, sleep well, I’ve missed a couple of nights :-\

thanks, my 3rd sleepless night in a row
gnite

lo. using moo.fx, when i try to assign areas within a map to a variable, they disappear from the browser with no error. any ideas why? http://pastebin.parentnode.org/21277

can anyone help me with my problem?

why doesn’t this work:
cells[i].onmouseover = function() { highlight(cells[i]); };

That’s probably in a loop, which means that i has changed its value by the time it’s executed.
Create a new scope to hold the temporary value of i

are you executing it loop when the Dom’s’ ready or before?

how would I do that

Doesn’t matter

before

cells[i].onmouseover = (function(i) { return function() { highlight(cells[i]); }; })(i);

I just realized what the mistake there is…
but I didn’t know how to fix it

Or, in this case you can just use “this”
Which is much easier.

now I’ll try Twey’s solution
I tried with this before… hmm

cells[i].onmouseover = function() { highlight(this); };
Should be fine
You can even define just one function outside the loop and use the same function for all of them.

http://pastebin.ca/659457 … hey i need help

krupa^: The paste 659457 has been copied to http://erxz.com/pb/4055

does nothing for some reason – lemme try some things
http://pastebin.ca/659462 just won’t work

The paste 659462 has been copied to http://erxz.com/pb/4056

Im trying to extract data from a xml-doc. The file has two nodes called object with different ids as attributes. I do var xmlMarkers = re.getElementsByTagName(“object”); but get that the length of xmlMarkers is 0, why is this?

anyone know a relatively cross browser way of getting the size/position of text nodes within elements? or is there a way to get text extents given a certain element style or something?

what’s a good, free javascript host obfuscator?

Why would you want to obfuscate your Javascript?
Are you ashamed of it?

yes

is there any good obsfuscator for any interpreted language?

Well it’s no good! Anyone smart enough to laugh at your code can also de-obfuscate it in a flash.
Of course not

does anyone know how to get my firebug to show xmlhttprequests, it keeps getting disabled whenever I reload a page?

i had thought it’d be like that. it’s a nightmare just trying to write one that does a simple variable name replacement

hi all! Is there a javascript specification and tutorial?

Javascript is an implementation of ECMA-262, so you probably want that: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

Can anyone help me understand what Im doing wrong when parsing my xml-document
I have several nodes named object

There’s also http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference

so I put them all in a var with:
var xmlMarkers = re.getElementsByTagName(“object”);

whats the best way to load and parse XML in javascript?

thanks

As for tutorials, try http://www.howtocreate.co.uk/tutorials/javascript/important

then I try to access the info in a specific node with xmlMarkers[i].getElementsByTagName(“id”).firstChild.nodeValue

Comments off

will it make a problem if i move ibdata1 to a new location then adjust mycnf so that ibdata1 will become of a

fucking mysql ’syntax’ error

0′) to pastebin, and under it include the new
lucox, and include the describe pun_0948_logupdates;

http://pastebin.com/d2ff97e59

lucox, http://pastebin.com/d35391955 try this

this cannot work …

lucox, why?

because “ are used for marking constraint names not values

hello, is it possible to create a column with a boolean(TRUE/FALSE) value?

and always the same error

well, put the back ticks around the column names and leave the values as they were
lucox, how is it going?

what do you ask? nothing new …

lucox, ok I thought you wanted my help

No, however you can create a TINYINT(1) which will do the same thing however the value will be stored the same size as a TINYINT
Which isn’t a major problem

I must have been mistaken…

yes i want

http://pastebin.com/d32ed6ac8
lucox, try this

the same

lucox, what version of mysql hosting are you using?

_Lemon_, ok thanks but as there are no TRUE/FALSE things how do i make it display like TRUE and FALSE checkbox in gtk2:impleList?

5.0.44

TRUE is just a non-zero value where FALSE is zero.

_Lemon_, ah ok

With very beefy hardware, and lots of optimisation, is a MySQL cluster suitable to host an MMORPG backend db?
Or would I be better with something else, if so, what?
I’ll be caching data in memory so to reduce the amount of queries

lucox, try this http://pastebin.com/d337b10c

i think delimiter is only for mysql shell, and i have tried it several times

lucox, just humour me, please

always the same

lucox, I am sorry, but I have run out of ideas

me too :-(

lucox, you will have to ask someone more knowledgeable than I am

thanx anyaway

lucox, no probs

people any other help ?

now, has anyone got any idea about my problem. http://pastebin.ca/662122 when it is run at the MySQL 4.1.20 CLI, the created_at_IP column is created as a VARCHAR(15) rather than a CHAR(15). Does anyone know why, please?

If I was to do it, I’d probably use it to substitute hard disk storage (instead of any sort of flat files) that way, your program doesn’t have to worry about being fault tolerant, so long as it updates the database – but I have no experience on this sort of level

For a few hundred players, I was thinking something like two replicating clusters of 4 servers.
replicating for zero downtime, switch to the other instantly on the other one having a problem.
Lots of HD writes/reads: BAD

hey
i have a highloaded mysql, the workload is 17++, but it only uses 200meg ram, it has 2GB ram total and is the server is dedicated to mysql

Yes but you won’t be able to load from the database as the data is requested, yuo’re gonna have to bring a load of it into memory preemptively

how can i speed the things up+???

So what I was suggesting was making sure that when the memory gets edited, updating the database asap!
edit configuration file?!??

PLEASE?!

_Lemon_, thanks a lot i’ve implemented it(in my perl project) and it works

my my.cnf http://pastebin.ca/662167

Awesome

_Lemon_, what’s wrong with loading all basic char data on character select? The client will have to load it’s local stuff after that anyway, giving the server a chance to do it’s query and prepare it’s reponse, in time to send it back for the loading
completion.
How fast is a simple select query that returns 1 row on a very beefy cluster?

Well, if you mean it loads during a client loading scene, then that’s what I meant by pre-emptive, and is how it should be done (I assume)
I have a variant of http://blog.evanweaver.com/files/mysql/my.cnf.innodb_1024
It’ll load upto 512Mb if I remmeber correctly, you should see what it does differently and tweak yours appropriately
http://blog.evanweaver.com/articles/2007/04/30/top-secret-tuned-mysql-configurations-for-rails
(I don’t use rails)

OK, guys, I have worked it out. Apparently, if you have any VARCHAR columns in a table, then it will silently convert any CHAR columns to VARCHAR when you create the table. Do CHAR and VARCHAR CANNOT co-exist within the same table!! That’s crazy!

It’s not crazy, char is a fixed length which gives you static tables, while varchar gives you dynamic tables.

i am making a perl application acessing a mysql database and there is a TRUE/FALSE column: 0 is false and the rest is true…but i’ve not implemented yet the NULL entries so i’ve put the following line: if ($name and $mail and $problem and $resolution)
=that insert the values into the database and else {print “NULL entries are not programmed yet\n”} but if i want to insert 0 in the database it thinks that $res
olution isn’t defined and it tells me that null isn’t programmed yet…is there a trick to differentiate a NULL entry from 0?

NULL is zero

is not null?
oh differntiate

However mysql hosting differentiates from this and interpretes NULL as “absent” instead of zero

Hello I need someone to help me with a mysql problem…paid service
payment via paypal or ..anything
simple stuff :P
any free lance around ?

State your problem and if someone has a clue, they might help… dun dun dunnn

well my problem is ..I need to reset the mysql root password. I found all in the manual but I cannot reset it ..so I would need someone to login and fix it for me an I pay

ygurugeek, aren’t you from china?

Yeah he is.

good luck collecting

xD
Paypal.cn :3

nope
..CH
Switzerland
does it sound as a more..trustable country to you ?

!man reset password

ummm, you shouldn’t be having any problems and need to pay – what’s the specific problem?

Sorry – I have no idea what function you’re talking about! but try http://dev.mysql.com/reset password

!man reset

see http://dev.mysql.com/doc/refman/5.0/en/reset.html

I did that

!man skip grant tables

see http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html

it just doesn’t work …because
is on a mac mini box
some commands are different
e.g. doesn’t even have mysql console
and by the time I figure it out..I’d rather pay someone pro to do it
ain’t a Mysql expert :P

I remember doing this before, it was about startup commands than anything else…

yes
skipping grants table
but

You have to shut it down, then tell it to not load the user tables then you get teh defaults

for me doesn’t work spent too many hours on it so I’d rather give access to soemone to do it
yes
been there done that
I did
I am probably too dumb or did something wrong
this is why
I decided to offer $$ for a fix

You’ve got more money than sense tbph.

Then, with mysql root access you can change the grant tables yourself

yes I do …and more money than time :P
I need to reset
the root password !
so I can’t login and change anything
weird enough all worked last night
then …

most people helping out here are here because they want to learn something new, not earn a few bob for helping random people

at a restart looks like an old password took over
okay but I think someone might be interested in helping for money….so I try my luck

Hello.

Shut down mysql. Then start it up with “mysqld_sage –skip-grant-tables –user=root” and it should load without any users/pass
UPDATE mysql.user SET Password=PASSWORD(‘new_password’) WHERE User=’root’
Your password should be ‘password’ (no quotes)

dotgeek:~ davidcosta$ sudo /usr/local/mysql/bin/safe_mysqld –skip-grant-tables –user=root
Starting mysqld daemon with databases from /usr/local/mysql/data
dotgeek:~ davidcosta$ sudo /usr/local/mysql/bin/safe_mysqld –skip-grant-tables –user=root
Starting mysqld daemon with databases from /usr/local/mysql/data
it hands
I tried this
also tried….
with the init file as per manual
when I pass the login command it just hangs (the skip grant)
if you fix it

Just wondering. What would be the best table structure for a directory hierarchy?

would be much faster :P

sudo /usr/local/mysql/bin/safe_mysqld –skip-grant-tables –user=root &

Think all the way through and finish writing before pressing the enter button.

dotgeek:~/Sites/newgeek/vanilla davidcosta$ sudo /usr/local/mysql/bin/safe_mysqld –skip-grant-tables –user=root &
then it hang

table directory with: `directory_id`, `name` then a table file: `file_id`, `directory_id`, `name` ?

[1] 3226
hangs
dotgeek:~/Sites/newgeek/vanilla davidcosta$ Starting mysqld daemon with databases from /usr/local/mysql/data
wait
didn’t hang
dotgeek:~/Sites/newgeek/vanilla davidcosta$

…. it wasn’t hanging, just running

but didn’t do much either hehe
yes

It’s now running in the background

but then how can I pass the comman ?
ah
okay :P
and ? :X

But a directory containing a directory?

Now execute your statement

if I type mysql
it tells me command not found
so how do I execute it ( Thanks a lot for your help)

Table directory: `directory_id`, `parent_directory_id` (NULL), `name`
mysqladmin
Or… can’t remember the program

okay I know how to run mysqladmin
but how do I run a statement there?

Just a place that will connect and send a query

Wouldn’t that be inefficien
t?

Not really, you could probably remove the NULL part as well, as all directories will have a parent directory except for root

id 0 for root?

Yeah, should work
ygurugeek, absolutely can’t remember – surely if you’re trying to run mysql, you’re expecting to run a query at some point?! Do it with that application

Are you sure that wouldn’t come out bad in performance?

Otherwise install apache2/php5/phpmyadmin and do it that way
I’m not sure what you’re planning to do with it… I can’t see anything instantly wrong with it… there is no redundant data?

It’s a quiet long story, not too long though.

Well, I’ll assume you want to display some sort of directory tree to the user

I feel that you could fix it in no time..I feel that the force is strong in you
bI feel that you could fix it in no time..I feel that the force is strong in you/b

Partially.

Then look up binary trees, it’s a common computing concept, try implementing a derivative of that somehow

Binary trees?

and unless you’re containing 100,000 directories, I can’t see anything going desparately wrong

I LOVE those

Binary trees look, in memory, like a directory tree except each node has only two links, to other nodes (which could be the last)
You’ve got mysql running with one user as root with no password, all you need to do is login and execute the statement I showed you earlier

I will try again

Your English isn’t bad so you could easily use the documentation to finish it off

but my client says mysql is not running

Type ps -A
If you see it in the list then it is running

I’m developing a image uploading system, and I thought it would be a good idea allowing the users to sort their images by folders too, so the URL would become http://www.example.org/images/username/folder/subfolder/image.png

Otherwise you’ll have to check the mysql error logs

Or something..

I get you
What you have there is very similar to a forum with boards (directories) within boards and then boards containing topics (files)

0.01 sudo /usr/local/mysql/bin/safe_mysqld –skip-grant-tables

Like Sub-category?

0.00 ps

I implemented that in a very similar way to the tables I suggested before – it works perfectly fine, all queries are doing great too

Ok, thank you for your time.

That means it’s running, you’re client isn’t connecting to it properly then
No problem

via ssh how can I login then?
I mean to execute the query

“mysql –user=root”

I got an idea

Then you can type your statement

is there any book you like ?

Then type \g to execute it
A book? Naaah, I don’t need payment :p

mysql works
let me see

You don’t realise how close you are to finishing this

can you give me the update command ?

USE mysql; SELECT * FROM user;

UPDATE mysql.user SET Password=PASSWORD(‘new_password’) WHERE User=’root’

dotgeek:~ davidcosta$ UPDATE mysql.user SET Password=PASSWORD(‘1234′) WHERE User=’root’
-bash: syntax error near unexpected token `(‘

You still have to be logged into mysql

yes sorry :X

When you type “mysql –user=root” it should bring up a new thingy and look like mysql

ok done
now it just
says

:P
after the statement

safe_mysqld is the actual mysql server, dealing with giving you the data. mysql is the client that connects to the server
Type \G

should I try to connect now ?

You _are_ connected

I mean
with the application which needs to run

Did you type \G
(or was it \g?)
That will send the query you typed out

\G

Did it give you a confirmation or anything??

nope
just

hmmm
UPDATE mysql.user SET Password=PASSWORD(‘new_password’) WHERE User=’root’\g
Put that into it…

got a new line thing

;
semicolon

You’re 100% positive? Nothing like:
Query OK, 1 row affected (0.00 sec)
1 Changed: 1 Warnings: 0

Write a semicolon there.

semicolon doesn’t seem to be a problem… and it should generate an error :s

Write it.
In that new line thing you got.

do you have gtalk ?
is for an open source site
formerly dotgeek.org
PHP forums etc
so
ain’t really doing it for bucks either !
I feel is something deeper because no one changed the root pw
and yesterday worked
then I updated the script..the php script
and didn’t connect anymore to the server

That’s odd.

will engrave your name on the new forum :P
yes is really like…may be there are 2 mysql running or
don’t know how the password changed

Do you have a backup?

Then you’ve probably changed the password the script uses to connect to mysql with…

becase all was fine ..then all of a sudden..bom can’t login anymore via admin etc
no
I didn’t

ah

100% positive not
ain’t so stupid lol even if is hard to believe :P

Where was this php script from? Was it malicious?

Do you have a backuo of your database?

no malicious
was an extension for a foum
I have all the db backup etc

Yeah but it still could have contained bad code if the source was a bit dodgy

If I were you I would remove MySQL completely from the server and set it up again.

sure but
I don’t htink bad code
can change mysql root pw !

I’m assuming your php site was connecting with the root user?

yes
was using root user..because we never used mysql on this server so
yes
:X
bad practice

Terrible practice.

When this is sorted, create a new user account without grant access

yes

I would remove the MySQL completely from the server and put it up there again with the backup.

may be I was thinking to erase mysql and re install

Then even if that was bad code in the forum, it won’t be able to mess with the mysql user tables :s
Didn’t you just say you changed the root pw?

apparently not
cauz I can’t connect
wouldn’t you ssh ?
I am begging you

You have to restart mysql without the –skip-grant-tables

You don’t seem to respond.

I do respond
I tried it all and foesn’t work lol

ygurugeek:

there shouldn’t be a reason to reinstall, although a backup should be last resort…

I think I am omitting something
may be something stupid

hi! can anybody tell me whats wrong with that statement?
CREATE TABLE `association` (`idassociation` int(10) unsigned NOT NULL auto_increment, `name` varchar(30) NOT NULL default ‘asdf’, PRIMARY KEY (`idassociation`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT;

_Lemon would you ssh for me ? wouldn’t take you much

I use the methods I know to work, instead of inventing others methods with trial and error.

for that I didn’t need to come here
reinstall is easy no ?

ha, suppose but it’s overkill for this problem
pm me the ssh login then

Yes, it is easy.

what’s the problem with it? The error?

#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 ” at line 1

I did pm you but may be I am in your ignore list :X
_Lemon_:
:P

I… am?
You… are even?

He’s not registered at freenode.

I am but with another nick

Non registered users can’t PM you unless you allow it.

now should work

CREATE TABLE `association` (`idassociation` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` VARCHAR(30) NOT NULL DEFAULT ‘asdf’) ENGINE = myisam;
?

the problem is was the AUTO_INCREMENT at the end, thx!

np

hello i am doing a current SQL call being http://www.pastebin.ca/662221 but the problem is that group_categories and categories has mutliple match results but it only grabs the first one, i was wondering how i can grab all the results for the
categories
anyone know, its been bugging me for ages

hi people.. anyone there?

hi

What’s the SQL command to view what users are added to mysql (and maybe show the privileges, if possible)?
as root

Is it possible to push back the auto-incrementing counter of a table?
I had 100 rows, and deleted 97 of them.
So now it has 1, 2, 3, 86.
I want it to be 1, 2, 3, 4.

ALTER TABLE thetable AUTO_INCREMENT = 5;
and change the 86 to 4

OPTIMIZE TABLE table_name;

oh, I didn’t know that existed – that’s pretty awesome

hey, i am running a rather big site, but the mysql is really slow how can i find out what bottlenecks the mysql?
it does not use all ram and workload is 17
or server load*

what’s a prefix index in MySQL?
if you had a varchar(10) and you would only use the first 4 chars as the index?

hi, is it possible to change mysql db name ?

!man rename

see http://dev.mysql.com/doc/refman/5.0/en/rename-table.html

ummmm

http://dev.mysql.com/doc/refman/5.0/en/rename-database.html

!man rename database

Sorry – I have no idea what function you’re talking about! but try http://dev.mysql.com/rename database

I wonder if the bot can get to it

http://dev.mysql.com/doc/refman/5.1/en/rename-database.html
it was added in 5.1.7
“RENAME DATABASE destroys any stored routines or events associated with the original database.”
Ouch

rename_database–

if you had a varchar(10) and you would only use the first 4 chars as the index?
is that a prefix index in MySQL?

mmm..
it just create a new db
move table over
drop the old db

it makes sense, then

mysqldump old_db | mysql new_db

hrmm…
what would you gyys say the best way to do replication is?

(ground ball to second base)

haha

http://dev.mysql.com/doc/refman/5.0/en/replication.html

mm..it’s not in ubuntu repo yet, 5.1.7

still beta, isn’t it?

that’s what topic claims.

is the midpoint insertion trategy and LRU used for only MyISAM … or is this for InnoDB as well?

Question. I have the command “SELECT `a`,`b`,`c` FROM `example`;”, but say that I want to return those three fields but only when `a` is DISTINCT, how would I do that?

DISTINCT applies to the whole ROW
use GROUP BY `a`

HAVING count(0) = 1

thumbs, GROUP BY was causing certain entries to be ignored when I used it in conjunction with ORDER BY.

that numerical value in quotes refering to a column position in the table?
parens*

it’s your only option
or chadmaynard’s

count(0) = count(*)

however, I suspect grouping might be faster

any benefit from using count(0)?

I would be placing count(0) after SELECT without listing any of the columns that I want?

i meant GROUP BY a HAVING count(whatever) = 1; – returns a’s that are distinct.

no, HAVING goes at the end
ah. Neat trick
so it looks like your only option is grouping.

I’m sure there are no real performance diffs
I’m pretty sure mysql substitutes count(*) to count(0) internally, though

lol

so, in my case, SELECT `a`,`b`,`c` FROM `example` GROUP BY `a` HAVING count(`a`)=1; ?

tias

how could I calculate the size of my non-leaf indexes for one table?

Try it and see, its quicker to type it on your system and try it than wait for one of us to tell you its ok

you ask questions like someone studying for a test.
lol

lol.
I’ve been reading -a lot-.

for a test?

threnody, I have an interview in two weeks

‘what is the meaning of life?’ ‘how much does god weigh?’

42. No one knows.

so… how could I calculate the size of my non-leaf indexes for one table?

We are changing MySQL server hosts from one computer to another, and replication is involved. Old master (id=1) is still being seen as the replication source by slave (id=3). I’ve edited the my.cnf on slave to look to new master; what else keeps it looking to the old master?

I’d like to do something like “LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES;” … but I don’t know how big my indexes would be, so I’m trying to figure that out.

Just spotted “CHANGE MASTER …” command in the docs.

I switched to using GROUP BY, but it’s ignoring my ORDER BY, instead sorting first by GROUP, and then by ORDER. For instance, I have SELECT * FROM `example` GROUP BY `foo` ORDER BY `bar` DESC, it would return `foo`=2, `bar`=1 before `foo`=1, `bar`=2
I probably did not explain that well, because I’m not certain what is actually causing the problem, I’m sorry.

GROUP BY does not cause the sql engine to ignore ORDER BY
errr
^^
presumably, another factor is mangling your results

I have two columns, one that I’m trying to isolate from duplicates, sorted by the second.
except it needs to sort the second before it starts cutting the duplicates,and it seems to be doing it the other way around.

My replication slave still insists on trying to connect to the old master. CHANGE MASTER did not shift its attention to the new master. What else needs to happen?

if you’re doing a group by, you are going to get one value for the associated columns. You can choose which value by using another aggregate function, like max() or min().

threnody, thus why I wanted to use DISTINCT over GROUP BY.

you can’t use DISTINCT. Forget about it.

prehaps you want more like ‘…group by a desc, b asc’

threnody, I can try something like that lemme do that.

if you could tell us in english what results you want, it might help.

I’m a young, dumb American, that might be difficult!

I wonder why you’d admit that fact

i have a very similar query and ordering doesn’t work for me either

here’s bad news – I’m an old dumb America. It doesn’t get better.
group by ordering is a real issue.

american has n on the end. moron.

Well, let me rephase what I want. I have two columns, I want to sort by the second column, returning only unique results from the first column.

you’re not the only one. http://forums.mysql.com/read.php?20,134952,134952

if you are only returning a where the count() = 1 then there should only be one b value associated with the group so max() = min() so ordering should work

Well, juding the book by the cover and just reading the title, I can tell that this problem looks the same as mine. I’ll give it a read.

Got it — had to add a “master_host=” clause to the “change master” command.

Oh man, his final solution is not easy to extrapolate into my mind.

mydb.sql

when i give this i still get the password prompt
i am giving the password in the command line but it does not take it as an argument it still displays the password prompt

take the space out
-pxxx not -p xxx

in a bash script this works- ‘…-uroot -p’pwd’…’

chadmaynard!

seekwill!

oh, get a room!

Do you play DTD?

no

We can play multiplayer DTD

thanks

didn’t you read?

Playing strip pokim?

ha

I could have predicted that!
hehe

: (

Well, there is PRIMARY and UNIQUE, but what is INDEX for?

to create an ordered set of data that the dbms can search through faster than the unordered set

For example?

um….

So, I’ll set everything to INDEX. Wouldn’t that be a nice performance boost?

maybe maybe not. Depends on the overhead of the index and if it is useful

Overhead?

is there a way to cap the disk usage a mysql user can use?

Yes.

i’m having a problem with a user taking up all the disk usage on a disk (accidentally)
how?

Well, changing the source always work. But I’m sure there is a better way, and unfortunately, I don’t know how.

im trying to create a database to hold details on furniture ranges. i have a table with a list of ranges, i then have a table with a list of products (also has a range id to link it to ranges) the problem i have is each product can have anything from 1 to 40 sub products that i need to record
the dimensions of. has anyone any ideas as to how i could layout this table

set quotas

don’t be silly

Could you explain it again with the INDEX thing? I didn’t quiet understand.

I’m always silly

what don’t you understand Polarina?

The thing it does…
Is it unique?

no

Can it be both?

UNIQUE is INDEX, but with the unique property added

what’s a prefix index?

you’d have to set up this user databases physical filesystem files under O.S. cota control.
quota

If I set something to UNIQUE, it is also INDEX. Right?

technically it is just UNIQUE. but yes, UNIQUE indexes are indexed

Ok, thank you.

there is not point in doing UNIQUE(name), INDEX(name). that’d be redundant

anyone?

Ok.

I think I’ve found the solution, it’s in the manual: http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html. Is this what you were looking for?

anyone any ideas about my problem??

Hi all, I had to do a quicj change from server to server so i simply copied all my /var/db/mysql across, How can I make this run on the new server? I am not quite sure how to search for this so if i missed somthing please point in the right direction
Thanks
the files are all MYD and MYI and frm and similar

put it in the datadir and chown to mysql user

will i chown it to the name of the mysql user or to the actual mysql user account?

whatever mysqld runs as

ok thank you
Thank you so much chadmaynard you just saved me from a very angry boss

np

to be fair
chadmaynard++

chadmaynard–

oh, thats a bit annoying
you mean set a quota for there home directory, and change the path of the mysql data to go in there home directory?

I don’t think there are bte-control controls under mysql
you could put a trigger to fail insert past a certain number of rows… but that would be work aroundable, I think, and even more annoying
yes.
that is what I meant
no path changing needed, you might just set upa soft link.

hmm
will it work with a softlink?
im not sure it will

dmb_ it should.

by softlink, you mean symlink right?

yes…a soft symlink, as opposed to a hard symlink
the later would nto work accorss filesystems, and myeb would not be subject to teh quota settings.
I willhave to leave now. (and I don’t bother switching the nick very much) …
best wishes there!
bbl.

ok

afternoon
I’m looking for an application like pgadminIII but for MySQL… I know about the web-based ones, but any Qt/KDE ones?

gui

GUI tools can be found at http://dev.mysql.com/downloads/gui-tools/5.0.html phpMyAdmin at http://www.phpmyadmin.net/ and even navicat or http://www.webyog.com/en/

thanks

how do i select the latest record added from a table?
is select * from products order by max(timestamp) valid?

Any suggestions on what type of query I should run to get “all birthdays within in the next week” on a DATE column format?

Hi I’m tyring to Query the last 5 selection of a table, any idea on how to achieve that ?

will it make a problem if i move ibdata1 to a new location, then adjust my.cnf so that ibdata1 will become of a fixed size and move it to a new location (and autoextendable ibdata2 will be added in old location)? do i need to take care of ib_logfile’s or ib_arch_log in some special way?

what would make mysql still be up, just not take anymore incoming connections? Nothing in the error log about it

Evil things like spiderpig?
I don’t know, honest.

anything I can do to find out more about it?

Restart the MySQL server?

that fixes it, yes
but this happens a fwe times a day

Having it restart as a cron job would work.

yes, but no :p

What version are you using?

4.2 iirc

Upgrade, for gods sake!

easier said then done

What’s the problem?

There is no 4.2…

sorry
4.1.14

Even worse!

besides, even with backups, doing database upgrades worries me

When it does not accept anymore connections, is the system still responsive?

yep
and existing connections continue to work fine

Installing a never version isn’t going to be a permanent decission. You can always go back.

Log in as root, and do a SHOW PROCESSLIST. I bet you have sleeping connections. Those should be disconnected.

crap, just restarted
but next time I’ll give it a shot

What connects to the database? PHP?

PHP, python, and a few C++ apps

Make sure you are not using pconnects (especially in PHP)

Hello
I need a help with creating 2 unique columns !!

yea, I guess I could go back to the old version if it fucks up

hi
I am thinking to use a bash script to query my database. I have seen there is shsql shell but I need to be root to install it

echo query | mysql

jbalint but I need to store the return data
I am trying to do something like $RESULT=mysql -u root -ppass database /tmp/query

ok

hey, how would i do something like “SELECT id,COUNT(SELECT something FROM table) FROM othertable”?
is that possible?

why are you trying to do it that way?
why not just do a join?

its a more advanced query of course, but i need something like that
to put a select inside of a count, that possible?

sorry, don’t know, doesn’t really make sense though
count(column)
not count(query)

yeah i was just wondering if it was possible to put a query in there
guess not
how exactly does JOIN work? i guess understanding that could help :-/

based on data from one table, you join another table with relationships
foreign keys and such

so like

table 1 has “mem_id”, table 2 has “comment_mem_id”

Not really foreign keys

SELECT * FROM photos JOIN album_id on album? or something?

sorta
select mem_username FROM members, comments WHERE mem_id=comment_mem_id
or select mem_username FROM members INNER JOIN comments ON mem_id=comment_mem_id
same query

hrrrmmm

joins

http://hashmysql.org/index.php?title=Introduction_to_Joins – For more indepth info: http://dev.mysql.com/tech-resources/articles/mysql-db-design-ch5.pdf

thx

i can’t figure out how to get the birthdays from a DATE() column. like, all the birthdays in the weeks 1 week
in the next* 1 week
DATE_FORMAT(minfo_birthday,’%d %m’)=’25 08′ AND DATE_FORMAT(minfo_birthday,’%d %m’)=’18 08′)
but that fails
ah, figured it out
%m%d instead of %d%m

what are the multimodal databases?

in case someone gives a damn :P BENCHMARK(1000000,ENCODE(“hello”,”goodbye”)) in debian mysql 5.x amd64 takes 0.41s to complete when using ondemand as cpu governor and 0.36s when using performance as cpu governor
using Q6600 cpu and ddr2 6400 ram

what is ondemand

cpu cooling feature, called “governor” in linux kernel
ondemand means that the cpu will work at it lowest freq until there will be some load and then it will throttle up
in my case using Q6600 2.4ghz cpu that means it will idle at 1.6ghz
but step up to 2.4ghz during crunching

ah

so the diff (0.36s vs 0.41s) is most likely the delay of detect higher load and then delay of stepping up the cpu into 2.4ghz speed
like amd’s cool n quiet
using same technique in the linux kernel

I have 2 columns, I want to ORDER BY the 2nd column and then GROUP BY the 1st column. How can I ORDER BY before GROUP BY?

can someone explain why my query always returns ,1 ?
$query = “SELECT `notices_read` FROM `ibf_member_extra` WHERE `id` = “. $id;
there is only 1 row in the database, and the notices_read field is empty
running the query directly through mysql returns nothing, but PHP always sets the value to ,1

TheWikies, select a from (select * from foo order by b) as foo group by a
uTheWikies, select a from (select * from foo order by b) as foo group by a/u
TheWikies, the question is why do you want to do that?

I’m creating my own forum, and so I have a column which is the message ID and the second column is the date.

hwy
i mean hey

the message ID’s go 1, 2, 3, etc. I want to sort by the date to display the newest posts, but not to show multiple posts of the same topic.;
ie, not to return multiple message ID’s.

if i am selecting addresses from a very simple address database, and I want to select say 20, and I want to make sure all of my selection have different states, how would I do that?
DISTINCT nevermind

I guess I can just create another table, have the topics stored in one, and the messages stored in another. It just seems like I could have combined the two.

that’s the way to do it TheWikies :P

using mysql cluster, I have a table that claims not to exist when i use describe, drop table, etc., but claims to exist when I try to create it
http://www.pastebin.ca/662522
5 [ERROR] NDB: failed to setup table nfackler.nuke_groups, error: 723, No such table
any ideas?
no files exist in the datadir for this table

any ideas what may complains about incorrect information in .frm files mean after moving ibdata1 to a different location and adjusting my.cnf accordingly?

hey, I’m trying to add a foreign key, the alter table doesn’t give me any errors but the foreign key is not enforced… why?

Kronuz, myisam?

hmm
how can I tell?
probably not
can I convert the tables?
is mysisam slower?
or faster?

Kronuz, i think alter table can to that. myisam gives you the wrong answer faster

SHOW CREATE TABLE

nice
I used describe
hmm
there are no fulltext indexes in InnoDB ?

Correct
You can use an external fulltext engine though

hmm

So I have a bunch of dates in a table, and I want to plot them on a chart. I have too many to have an individual plot point per entry, so I want to group them by some section of time and count how many are in each section and plot that count. Am I on the right track?

yes

So the time frame could be months, or years, but I know I want let’s say 40 data points… So maybe I should figure out how many seconds or something is in between my first and last date and divide and then group on that some how

Sembiance, sounds good

Now to actually write the SQL
Hrm.. so take first and last date. Subtract first from last. Divide the difference by the number of segments you want, then do a group on the rows date minus the first date dividide by the result of the difference/segmentCount calc.
Seems like that works

hi all, I have a lot of table-bin.xxx files in /var/lib/mysql, are they some kind of backup informations ? Can I remove the oldest ones safely ?

innodb binary log files, for use in replication and disaster recovery. search the manual for ‘master purge’ command.

thanks threnody , I didn’t know where to look in the manual

http://dev.mysql.com/doc/refman/5.0/en/purge-master-logs.html

those puppies can fill a partition pretty quickly.

excellent, exactly what I was looking for
yep
so, as long as I keep them, I can go back in time and restore previous state of a database , right ?

yes

maybe I hould disable this feature completely then
is that possible ?

you can turn it off, or you can set it to automatically purge after a certain period.

I’d rather turn it off, because I’m already doing diff backups of the system with rdiff-backup

if you’re faithfully backing up via some other method…

ok, so “SET SQL_LOG_BIN=0″ should do the trick if I understand right

http://dev.mysql.com/doc/refman/5.0/en/binary-log.html

table1=(username, …); table2=(username,stuffA); table3=(username,stuffB) what I want is to create a report that says how many of StuffA and StuffB there are for any given user…
I’m having a hard time trying to visualize what the best way of doing that would be
like, if it was only one Stuff table, I could use group by after a left join… but with two tables…
the only thing I can think of is using nested selects
any other ideas?

might be a design issue.
users, possessions, stuffa, stuffb

??

I did a “PURGE BINARY BEFORE now()” , and yet the files are still there

an extra table linking users to the different stuff types.

threnody, what’s the “possessions” for?

the manual says, ‘PURGE MASTER LOGS BEFORE ‘2003-04-02 22:46:26′;’

I did also with “MASTER”

threnody, do you think there’s a way I can do that query without having to create that fourth table linking the users to the stuffs ?

I cannot, but perhaps another here can think of some multiple join that would accomplish it.

hmm… I can think of two ways of doing it with nested selects

I don’t know if this is the place to ask, but with phpmyadmin, there’s a “binary log” button, I don’t what it’s supposed to do, but when I click on it , mysqld start to run wild and do lot of hard disk access, but nothing appears

select table1.username, (select count(*) from table2 where table2.username=table1.username) as StuffA, … from table1;
select username, count(stuff_a), count(stuff_b) from (table1 left join (select username, stuffA AS stuff_a, ” AS stuff_b from table2) using (username)) left join (select username, ” AS stuff_a, StuffB AS stuff_b from table3) using (username);
(oh, and group by)
or rather a union, I think

in your stuff tables, one row per item?

threnody, what do you mean?
one stuff = row
but there are two kind of stuffs (and they both have other different “properties” or columns)
threnody, the tables mostly only have in common the username

well, I usually use linking tables for these sorts of situations, but it might not be for everyone.

(actually only have that in common)
hey, is SELECT … FROM a LEFT JOIN b LEFT JOIN c LEFT JOIN d; the same as SELECT … FROM ((a LEFT JOIN b) LEFT JOIN c) LEFT JOIN d ?

LEFT JOIN a, b, c, d ?

??

brackets confuse everything. Try not to use them.

but is it the same ?

join a table, then join another, then join another, then …

if I have a table with 2 primary keys, what happens if one of those keys is auto_increment?

and what about what hlms said?

ok, I can’t remove the log files with purge, I don’t understand why, instead I disallowed the log-bin option in my.cnf, so now is that ok to delete the files manually ?

there is no point in joining 4 tables at the same time

why? I suppose it depends

there is no point in joining 4 tables at the same time
besides, a JOIN joins TWO tables at the same time.
!man join

see http://dev.mysql.com/doc/refman/5.0/en/join.html

SELECT id, name, (SELECT COUNT(*) FROM bar WHERE fooid = foo.id) as numbars FROM foo; can that be done without subqueries?

it can

in mysql, if I’m managing files, should I just use the filesystem or store them with mysql
what’s the consensus?
with the database I get the added benefit that permissions are easier to enforce

store file *contents* on the DB? don’t…

select id, name, count(fooid) as numbers FROM foo inner join bar on fooid = foo.id group by id, name
^^

PovAddict, yeah
is it much much worse?
it’s been a pain dealing with File calls in my rails app

storing files in the databased is a TERRIBLE idea

okay
that’s the consensus
I will not use the BLOB

performance wise, it’ll kill your app.

yeah
I’d better use the tried and true fs…

if I have a table with 2 primary keys, what happens if one of those keys is auto_increment?

I don’t think you can have 2 PKs.

sure you can. its called a composite key

a PK made of two columns?

so, is that ok to delete the table-bin.xxxxxx files if I don’t use the binary log features anymore ?
I mean manually, I can’t make the “purge” command work

im wondering if the auto inc key will start at the default, then just keep going up no matter what.. or if it might start over if the other PK gets changed

Then you’d have a single, composite PK.

now that I think about it, it probably just counts up and up

hmm I’m on a similar question as d03boy

did you see my reply?

yes and thanks; but the PK thing is a different problem

ah.

I have a ‘group’ column, and an ‘id’ column; the id has to be actually “id within group”

add a WHERE clause, then

ya thats basically wha ti wanna know
i have a recipe (rid) and the steps within the recipe (step), both primary keys

where id in (…)

i’d like the step to count up starting where the last one left off just for that rid

same

same what?

same as me

I need the same as him the message number has to be “local” to each newsgroup

ok then.

do I need to code that myself instead of using auto_increment?

I’ll keep out of it.

we both just have the same question, thast all

http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html
\o/

which section?

see from the second example
“For MyISAM and BDB tables you can specify AUTO_INCREMENT on a secondary column in a multiple-column index.”

hello how to restore only one table from bih mysqldump backup? i saw a solution with limiting privileges somwhere, but i cannot find it now

you could extract the statements related to that table, place them in a separate file, and restore that.

i have a question about mysql stored procedures.
i’m getting an error when i attempt to enter my header
DELIMITER //
CREATE PROCEDURE update_charge(
IN p_user_id,
IN p_task_id,
IN p_num_hours,
IN p_charged_date
)
BEGIN
DECLARE v_count_charges int;
DECLARE v_charge_id int;

oh god

SELECT count(*) INTO v_count_charges

PASTEBIN

try http://pastebin.ca or http://pastebin.mysql-es.org

FROM charge
WHERE user_id = p_user_id
AND task_id = p_task_id
AND charged_date = p_charged_date;

0 THEN

UPDATE charges
SET num_hours = p_num_hours,
WHERE user_id = p_user_id

it is 8GB file

AND task_id = p_task_id
AND charged_date = p_charged_date;
ELSE

stop pasting

INSERT INTO charges
(
user_id,
task_id,
num_hours,

try using a pastebin

charged_date
) VALUES (
p_user_id,

kick him already…

p_task_id,

grep it?

p_num_hours,
p_charged_date
);
END IF;

but hwo to edit then

END;
/

END!

sorry

kahotep, pastebin.ca

i meant to only post the header

he can’t “stop” without disconnecting

use a text editor?

from his end, he sees he already pasted all

there are binary files

here we see one line per second…

if i have a simple table which has just two columns which are both the primary key, how can i do an insert into that table without risking being told that i have a duplicate primary key?

the dump is binary?

but ok, i will try to recall this from memory

http://pastebin.ca/662609

basically, i want the ‘duplicate’ error to be swallowed

partially

PovAddict, i still dont see that example.. not sure if im lookin in the righ tplace

thats teh procedure

if the row exists already, good, i don’t care – don’t want an error though

i’ve got it :-) http://hashmysql.org/index.php?title=Single_table_restore

here’s one with the error on the bottom http://pastebin.ca/662611

ah.

but thanks

(this is for logging IPs against user id’s)

http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html
there’s two boxes, one showing MySQL commands and one with the result, then three paragraphs, right?

oh, i see it, thanks

interesting stuff starts @ 3rd paragraph

cool

uh – forgot to ask
thanks for the alternative without subqueries but… which one is actually more efficient?

a JOIN is always more efficient.
but please, do benchmark it yourself

I was more asking by curiosity… I may have like a hundred rows

How could i increase @i value for every row? Update cats set position = @i WHERE parent_id = ‘$parent_id’ order by position asc

a JOIN, especially a INNER JOIN on indexed columns, is always faster than a subquery

what idiot was just posting stored procedures in here
i hate those idiots

it was an accident. get over it

those need to be kicked at the 3rd line pasted; not banned, let them join back; but at least that way they stop

get a flood bot in here!

ghm
??

http://mysql.pastebin.com/m77affe2 – there is only one auto_increment column and it IS a key
so what’s up with that error?

to make a composite key do I have to do PRIMARY KEY (col1, col2) or can I just put PRIMARY KEY in each of the columns lines

d03boy, the first

mmmmm
what wrong with this query? Update cats set position = (SELECT MAX(position) +1 ) WHERE parent_id = ‘$parent_id’ order by position asc
it produces same positions

the inner select doesn’t have FROM
you probably need:
Update cats set position = (SELECT MAX(position) +1 FROM Cats) WHERE parent_id = ‘$parent_id’ order by position asc
any idea on MY error?

You can’t specify target table ‘cats’ for update in FROM clause
ghmm

store the value from SELECT MAX(position) +1 FROM Cats in a variable, and use it in your next update statement instead

this should change to mssql channel

why?

cause i cant read. i thought it was when i joined

come again?

thought this was MS SQL Server channel
my mistake

thumbs, maybe you could tell how could i increase value of numeber (+1) for every row in query?
then i will not need select max value from database
Update cats set position = @i WHERE parent_id = ‘$parent_id’ order by position asc
@i should be increased +1
position list should be reordered

http://mysql.pastebin.com/m77affe2 – any idea what’s wrong?

the primary key must be id_INT only
actually.. that error message made me change my thinking.
i think the primary key requirement is gone…. and that query as you have it worked on my mysql server here.

InnoDB does not support that kind of PK

i’m using mysql server 5.0.32

You can’t have the PK on ngroupid as well

how do you know he’s trying to create an innodb table?

I’m smart
PovAddict is my brother
He’s sitting in the room right next to me
Pass me a beer while you’re up

is he your brother?

I think so

you think so?

Sometimes
thumbs knows why he’s using InnoDB as well
Ask him

mysql isam has been all i’ve ever used
i don’t even know why you’d want to use something else

I use isam, generally
I’m not really qualified to help anyone with innodb

ISAM is not even in 5.0

it’s not?

Nope

i’m using mysql 5 and myisam though?

Yeah, MyISAM
But not ISAM
ISAM was disabled in 4.1 and completed out by 5.0
(Or I could be off on a version)

so you’re calling me outdated, then?

Yeah, way outdated man

is ther a way to do a case insensitive order by ?

Kronuz, there is always the good old ORDER BY lower(foo)

hmm

a little on the slow side.

evening all

hi

I’ve looked for a bit and can’t find what the best method to store a MAC address in to a data base is… with IP address it’s inet_aton/inet_ntoa.

you could use a varchar

example?

varchar(length)

I guess I was thinking that there was a function similar to when IP addresses are used.

no to my knowledge

I’m guess I’m a little clueless of this “varchar(length)” method that you speak of.. I’m totally a DB noob.. learning as I go

!man varchar

see http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html

aren’t Mac addresses just numbers like IP addresses? IP’s are 4 bytes, not sure on the MAC’s though

a mac address contains ‘:’ and alphanumeric characters
therefore, a varchar is the most efficient way to store it.

But those alphanumeric are just hex, a representation of a number
and as Zero123 said in a pm, are only 6 bytes
! bigint or VARCHAR(6) sounds like the way to go to me…

that’s what I was thinking

Though you’d have to parse it :/

eeh

What language are you in?

C

inet sounds like C
Yay! lol
I’m sure it’s been done before, no need to reinvent the wheel…

exactly.. but can’t find an example

Are bit shift operators C++ only?
You could just take each bit, shift it along or something clever
hmmm, yeah I’d probably spend a few hours on this, glad I’m not writing it – sorry :p

haha

hmmm … best way to store currency in a db? remove the decimal and convert to cents?

this is beginning to sounds like a math riddle.

how about using the DECIMAL type?

doesn’t really matter to .. that’s what inet_aton does.
that’s fine

ive heard there are yucky issues that deal with rounding

Then use a FLOAT

yes, FLOAT has them. It’s much less of an issue with DECIMAL
or NUMERIC

oh

FLOAT is LESS precise than NUMERIC

ahh interesting

for instance
NUMERIC (10,2)

Is this the problem intrinsic to computers and FLOAT calculations? If so, you could be having issues before you get to the database…

that would be ten digits, including the fractional value, with a two degree precision on the fractional part

good info, thanks thumbs

so you could do (20,8)
it depends on the precision you’re seeking.

you think there would be a neat little function like ether_ntoa/ether_aton.. huh? go figure :P

there might be

I looked briefly… nothing pops up

year-month-date?

..

curdate() wont work :/

DATE_FORMAT ?

yea figured it
thanks

hello all!

You’re enthusiastic.

anyone have any idea how to compile/install mod_auth_mysql?

a word of warning – ignore DARKGirl

i can’t find libmysqlclient.so

heh

she’s a little clue-impaired

Is it in the folder /usr/lib/ ?
and do you have read access?

yes i do
this is on osx, btw
so the folder structre might be different

Consider it found?

no, its not in there

Where is it then?
Is it installed?
You gotta find it then tell the compiler where it is, I assume…

yeah
i dont think its on my computer though
I did a locate of it
and came up with nothing

good luck

Then install it…?

not sure how

lol thanks thumbs though… 3am here for me so I’m oblivious to anything
ummm…

I’m warning you, you’re wasting your time
but go ahead anyway

Does OSX have anything like apt-get install? or apt-cache search?

what are multimodal databases?

looks like i have to recompile it
because it doesnt include that file
for some ODD reason

ummm, that file is a pretty key file to connect to mysql
I really doubt you should have to…
but if it solves it – go ahead!

trust me, its not on osx mysql
ive done locate and everything

trust her, she has no idea what she doing.

“For the people maintaining the installation packages and gems ? has nobody ever noticed that this key libmysqlclient.so file is missing from the MacOSX? binary of MySQL?”
i installed from binary

lol
Shows how many people use MacOSX then :p

hello. theres any way in MySQL querys wherei can find only coincidences having the first character of the textfield
?

Hello

hi GoSox
GoSox, you can help me, please =?

unlikely
im here to GET help

hmn.. ok
=/

name,street,city,state . I’m trying to select say 20 rows at a time, but I want every state in my selection to be unique. How can I do this

select DISTINCT …. LIMIT 20

Error ‘Can’t create database ’sa_bayes’; database exists’ on query. Default database: ’sa_bayes’. Query: ‘create database sa_bayes’
Do anybody understand that? Im trying to use a master-master replication scheme

that was for you ^^

thumbs i tried that, but i want the whole row, with only the state column being distinct

then use grouping

“database exists”

how would grouping help?

select MIN(`a`), `state` from …. GROUP BY `state` LIMIT 20
it would return ditinct states

what is `a` in that query?

the other columns.

GoSox, why you cant use DISTINCT ?

he wants each state to only appear once, I guess

yes

then grouping is required.

i’m trying to get a somewhat even sampling, so i want no double states in each selection
to even it out

please, somebody can help me ?

then use my solution

cause in the table, there are TONS of cali and texas entries, and they are dominating my results

select MIN(`a`), `state` from …. GROUP BY `state` LIMIT 20

thumbs i don’t understand your MIN(`a`) thing?

when grouping, you need to use an aggregate function on the other non-grouped fields
!man group

see http://dev.mysql.com/doc/refman/5.0/en/group-by-hidden-fields.html

so if `a` is not in the GROUP BY list, you need to apply functions such as MIN() or MAX() on them.
this applies for any column

i’m still not getting what the max or min stuff is for

pls, i will have problems if i cant solve this

you can’t just use select a, b, c, d from … GROUP BY d
you need to apply functions to a, b, and c in that context

i just did and it looks like it worked believe it or not
SELECT state, name, city, id FROM chefmoz_list GROUP BY state ORDER BY RAND() LIMIT 20

you didn’t group by state
you grouped on a function not using any of the selected columns
that’s different
this will return multiple rows with the same state
I was under the impression that you only wanted one row per state.

i do
and thats what i’m getting with teh query i just showed you

your query is non-deterministic
but use it if you’re happy with it

i have no idea what you are saying

my problem is very easy !, or not ? O.o
XP

suspiciously, all my cities are starting with the letter A

but using RAND() on a non-existing field, the resultset returned will vary from run to run

how do I untar a .tar file that is not tar.gz?
what is the command?

No mean?

its not ‘tar’ or gunzip

tar -xvf i believe

you might get several rows with the ‘TX’ state, for example

no the one thing it definitely is going is only selecting one of each state
SELECT state, name, city, id FROM chefmoz_list GROUP BY state ORDER BY RAND() LIMIT 20
doing*

that’s different, now.

no thats what i send you the last time

note that this is syntaxly wrong.
you need to alter it this way:

can InnoDB have two primary keys?

SELECT state, MIN(name), MIN(city), MIN(id) FROM …
since you’re grouping by STATE

and how will my results differ if i do that?

ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql

they will be deterministic

and what does that mean?

i.e., consistent across several runs

what is FULL-PATH-TO-MYSQL-OS

ok and what does THAT mean?

they won’t change on each run.

but ummm i want them to change
i’m trying to select 20 random items out of a 120,000 item table

quick question — is it possible to run a second sql query within another sql query?

oh i see

the ORDER BY will do that
BUT

i know order by rand() is slow
thats ok

without properly GROUPING, you might get more than one row for a given state
there is no eay to tell ahead of time.
s/eay/way/

symbolic link

the solution is to apply a function, like MIN or MAX, to the columns not in the GROUP BY list

you should teach the_wench ”quick question’ does not reduce your bandwidth footprint’.

heh?

quick question — is it possible to run a second sql query within another sql query?

ok i did your query, but i’m getting all cities that begin with ‘A’ still
like
its not being very random

that is one issue of grouping, you can’t guarantee the ordering.

i need the selection to be totally random

‘quick question’, as in ‘drop everything, this shouldn’t take any time…’

there was an article that could have helped you, however.
oh hehe
ahaha
WHERE COUNT(*) = 1
this will improve your ordering.

ok i think i’m goona give up on this tonight, this isn’t working and i don’t have more time to get into it
thanks anyway

I hate when they drop like this.

can InnoDB have more then one primary keys? if so, is each primary key considered a clustered-index?

he is.

lol.

today is phase 2?

yes
I’ve been studying non-stop

so you’re taking a course?

nope.
self-teaching myself.

‘Why are protons green?’ ‘What is the mohr number of igneous sediment?’

lol

42, I don’t know.

lol, good memory

wait, I gave you that answer last night too

Can you get some sort of information about replication in mysql?
like whats being replicated and when etc?

so what do you say? can InnoDB have more then one primary keys? if so, is each primary key considered a clustered-index?

how do I log in as the mysql user?

I may be a dummy, but having two PRIMARY KEY is like having two second basemen.

well

The notion of a Primary Key does not admit anything beyond one PK.

it’s not possible under MSSQL, nor with mysql, AFAIK

I quote Xaprb

Hence “Primary”.

You can mistakenly has a two column composite PK…

he is, I believe

have*

“And in tables where the primary key is several columns and it’s desirable to have the table “clustered two ways” by using the indexes as I’ve explained, not all of the columns need to be added to additional indexes.”

wtf?

you can index as many fields/columns as you want.

no wonder your questions are so bizarre.

http://www.xaprb.com/blog/2006/07/04/how-to-exploit-mysql-index-optimizations/

well that question is either misleaded, wrong, or intentionally misleading.
the bottom line is that you can’t have multiple primary indexes for a table.
s/indexes/keys/

I should not have said ‘You can mistakenly has a two column composite PK…’
I should have said ‘You can have a multi-column composite PK…’
but just one.

Cannot load /Library/Apache2/modules/libphp5.so into server: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib\n Referenced from: /Library/Apache2/modules/libphp5.so\n Reason: image not found
i can see where the problem is, but I dont know how to fix it

you’ll never manage to fix it.
consult a competent admin

its not supposed to be “/usr/local/mysql/lib/mysql/libmysqlclient.15.dylib\n”. its supposed to be “/usr/local/mysql/lib/libmysqlclient.15.dylib\n”
how do I change the reference?
hmm

DARKGitl is like The Terminator.

she’s damn annoying

DARKGirl is like The Terminator.

DARKGirl–

terminator?

there was this movie, ou might have heard of it…

indeed
your typing could improve.

WITHOUT A DOUBT

heheh

how am I like the terminator?

she’s simple minded like him

oh, ask apache config questions in #mysql, and then repeat them endlessly when you get no response.

we ignored her in #apache a long time ago, too

(I had to llok down at the keyboard and hit each key like a terminator. I’m off to Best Buy tomorrow!)

oh thats an apache question sorry, I was reinstalling mysql so I thought to post it here

If you make a field not null is it not required to give it a default value?

Comments off

argh dont you just HATE when you have an app that you know has a problem but only with some files out of 20000

) is faster than calling a simple function by an instantiate object (-)

kavehmz, err ? they do not serve the same purpose
but no, the speed is not different

yes but you can make a function static hosting or not,
I wonder if there is any speed difference in calling them

yep, and you should make static functions for a design reason

I know their usages

run it in a profiler and see

I wonder if in thier call process one of them is faster than the other

the call process is merely the same, so no

it seems that simple method call is faster
I was wondering why
I did check it with microtime

they are both understood as functions for php’s internals, there are small differences in the way they both check/handle scopes, but that’s about it, so it shouldn’t have any significant speed impact

how come the positions of haystack and needle are not consistent in string functions?

DavidHKMrPowers, well, because of uncareful people

ekneuss

:€

plz don’t make yet another ‘CMS’
hmm, i single quote everything now. great thanks, PHP.

I can’t recommend this book enough – http://tinyurl.com/2urpjv (amazon) along with the pragmattic programmer books
haven’t got a copy for this office yet, need to give some of our devs a head start with OOP

refactoring is my current favourite

refactor on friday, think about it over the weekend and fix on monday
brefactor on friday, think about it over the weekend and fix on monday/b

really good book indeed

I ended up just buying a second hand copy
because the library complained that I’d had it out for 6 months

lol
how dare they
i got my boss to buy me it

they tried to charge me £35 on late & replacement fees
but I hassled it down to £5 and a pint instead

librarians drink beer?

like elephants in a drout

they account for 90% of all AA meetings!
i once dated a librarian, she could drink like anything
a serious alchy
backup scripts ftw, just saved myself recoding something a work exp. noob over-wrote of every instance of on our entire server
bleh tiored

no subversion?

tired* lol
no actually
No subversion.

aww, sucks
you should really use it

it was a validating script to fetch the w3c results of a web site validation
or many web sites should i say
just a .php
we link to the validator from the portfolio so with a heavy use of sleep() it’s quite good, esp, with noobs like this knocking around.
then they went and updated the look of it heh

that’s why you should split domain logic & presentation

you can teach me one day if you want
i just back everything up locally

Hi, I have been doing bits of php scripts here and there. Now I want to do a full php web-application. According to a book I read, it has a few examples of php application. I notice that in all the apps, this author do like the following, a header.php file , a footer.php file and an index.php
file which include the header and footer file. Thats all fine. But….

Please don’t try and re-invent the wheel

a time saver and makes a consistent site

why do irc networks insist on having 1000 line motd’s

in footer file. Is it common practice.

which MVC framework is good?
I mean best

No I’m fine with the include in index.html with header and footer file

opens in header.php or index.php

just don’t start outputting HTML with functions and you’ll be fine

Hmm..

i coded smth in php-mysql and it was running in.. yeah apache. and someone calls me says it doesnt work anymore. I did a stupid thing because they are using the program as a desktop program, means that the computer is not a server or anything, and its not even linked to internet, they just
need to store the things for themselves. I wanted to know what kind of problem might it be.. probably not PhP anyone has any idea.. thanks. and sorry for not asking t

he right channel.

Mace[work]: thanks. Its good question, isn’t it ?

yes it is

write a gtk version?

quick fix solution, install php+mysql and call it an intranet?

TehSausage, i know, but i dont know Cs or any other thing like this.

http://gtk.php.net/

which MVC framework is best currently ?

it’s about 5mb :P

TehSausage, whats that ? GTKapps coded in php ?

gtk wrapper for php

Mace[work]: great and thanks. I had to ask because its the design and I just wanna do it the “best practice” way.

eww

i dont get it

I’m not guy the ask.

class someclass{function somefunc(){$somevar = “hello world”; $this-echofunc();} function echofunc(){ …. echo $somevar;}} $class = new someclass; $class-somefunc();

instead of C you’re now using php? get it? XD

How can I get the “…” part to assign $somevar?

actually, gtk is C++ only

To the variable $somevar in somefunc()

since it’s very OO

you explained who you are and what you know well and described what you’d seen adequetly. In my book though all “structural” questions are good questions.

ok, i am asking from php web hosting expert guy

ok thanks

Anyone?

ajits, they have pro’s and con’s. there isn’t a best one. do some research and decide for yourself/.

TehSausage, okay, but i dont get, so i can run a gtk app, from something.com/programhere.php ?

no
you run it as php app.php

ajits, asking anybody what he best MVC framework is going to be bias, there are some top contenders but it all comes down to personal taste

TehSausage, nice..

ajits, go and download 3 or 4 of the first ones you find and try doing simple stuff in all of them

TehSausage, is it difficult to install or anything.. and to learn **

it’s a php extension which gives access to gtk functions
it’s easier to learn than php i guess
installed the same way as most other extensions

I have decided two i.e. cakephp and zend framework

well what are you waiting for then…

hmm whose got some regex skills? :P
my regex has always sucked hey

CpuID2, just ask your question?

zend has great support
/nosarcasm

No one?

post it in a pastebin

Why?

do i need a reason?

Maxdamantus, make $somevar a class property and use $this-somevar ?

function echofunc(){ …. echo $somevar;} i think that explains it _

HarryR, but then I need to unset($this-somevar); which looks a tad messy.

Maxdamantus, because it’s a PITA to try and decipher one-liner examples

Xd
Meh, I’ll just do it that way.

Maxdamantus, uh, pastebin or you’ll get weird answers

Plus it’s not clear if you’re one-line editing was the cause of some errors
your*

Mace[work], basically, I want to gather a variable from the parent function inside a class. :P

Maxdamantus, well use class properties – like their supposed to be used for

Why should I help you? :P

Mace[work], I never said you should.

HarryR will assist by the looks of it

lol

HarryR, ok, i need to strip some whacky chars outta a string, but only at the start and end of a string
let me provide some examples

trim()

trim doesnt seem to be working quite so well here

pre_replace

\\”HTTPS\\”

stripping the \\” for example
thats probably the major issue
$postparamvalue = trim($postparamvalue, “\”..\\”);
that was my first attempt
preg_replace was my next option, but my limited regex skills :P
ive been getting weird results with that trim() line above
for example, [Connect-Info] =

stripslashes?

becomes nothing
i spose thats always an option yea
stripslashes first…

!+enter

Don’t use the enter key as punctuation. Think in complete thoughts, then type.

impossible, that was over 300 characters :P

lol

TehSausage, i sent you a private message. is it ok /

no you didnt

eh

don’t use eh, it is rude
say what?

shht !

eh, since when

eh… i dont know.. eh knows it ! Jinx-
jinks123,

how would you guys go about finding the position of a \r\n sequence in a string ? strpos doesnt seem to get it.

Meltir, why wouldn’t strpos work ?

there are many strpos variants.

jinks123, seems stripslashes actually did what i needed this time
thx again

no idea. returns a false so, it just doesnt find it.

Hey, what is the standard date type? Julian Day or Gregorian?

Meltir, do you actually look for ‘\r\n’ or “\r\n” ?

JernejL[Work]: ideas on ones that work with nonprintable chars ?

Depends where you are

can i use system() to set a variable?

no, ive used “

More people eat Julian salads though

no idea.

sean`, most likely Gregorian

you could just convert it to with nl2br then look for the br /

they’ll produce different line breaks

Mace[work]: no go, im parsing a file that will contain br /’s

consider the above then

im not using it for textarea’s

well FYI then, \n is unix and \r is mac

i just use \n and i never get any problems =\

Mace[work]: im parsing csv’s and assume that someone follows rfc’s

assumption is the mother of all c*ckups

Mace[work]: i have to have some assumptions, else i would just give up :P

better to not do something than to not do it properly

$string = str_replace(“\r\n”,”\n”,str_replace(“\r”,”\n”,$string));

how hard was that?

owait, that should be the other way around i think
or it’ll kill \r before \r\n

Mace[work]: is there a tip on how to make the footer remain at the bottom of the page eventhough when the index.page is empty ?

Mace[work]: that screws up the newlines in the files, and doesnt get me a position.

position:absolute;bottom:-??px;

Mace[work]: besides – its done bad right now with fgetscv, and i need a parser badly.

then again thats probably not a good idea

hello

s/scv/csv/

position:absolute;bottom:-??px; — not good idea ?
were you refering to it

www.cc-grand-couronne.fr/hello.php there’s phpinfo and error on same page

well it would cover up anything below it, i was thinking min-height:100%; or something but maybe thats no good either XD

#css although I believe bottom:0;position:absolute;width:100%; will do the trick.
you need to put the main body of content in a “position:relative;float:left;width:100%;”, then towards the end use what i said
an absolutely positioned element will become absolutely position relative only to the div you place it in – so it will go to the bottom of the page flow on larger pages
#css though
absolutely positioned,*

is there such a function in php to scan the process table and return true/1 or false/0 if a certain process exists?

no

csc`: exec()

Mace[work]: eh?

ps x | grep process name

use exec with proc_killer under windows

if on linux

well im trying to create a page in php webhosting that shows what daemons/servers are running on my box

csc`, you can just check if the directory exists in /proc

ive tried parsing pidof, looking in the /var/run/ dir but it displays a warning and appears to work.
uive tried parsing pidof, looking in the /var/run/ dir but it displays a warning and appears to work./u

If there’s a process with PID 1337, it will be in the directory /proc/1337 so you can use that to check if a specific process exists.

ill just turn off warnings =o

if it’s only for one purpose i guess explode(“\n”,exec(‘ps -ae’)); then parse it from there

Mace[work]: kill 0 1337

what would be faster, case-insensitive preg, or a-zA-Z in the pattern

ps aux | awk ‘BEGIN{p=1}{if ($315 || $4 15) p=0}END{exit p}’ && /etc/check_usage | mail -s “**Server Resource Warning**” support@blah.co.uk /home/default/stats.txt —- notice how the $3’s and $5’s are tokens are tokents

hi f00li5h

erm, rather Maxdamantus kill 0 1337
meow

f00li5h, what?

are tokens**

f00li5h, but that way is dumb.

send the process a SIGNULL, signal 0

It must call another function.

yeah, dumb and portable

Another process*
It’s cooler to do everything with PHP.

csc`: just do it from exec() will be much easier and quicker.

it has to do o a syscall

csc`: and much more system friendly

Mace[work]: its a proprietary script
=p

csc`: it checks for rouge processes on me server

posi_kill(pid,0);
+x

csc`: i created it some time ago
csc`: try #bash with exec()

but you probably don’t know the pid anywy

Mace[work]: i think just turning off warnings in php.ini and using if(file_exists(“/var/run/foo.pid”)) {} suits me

csc`: heh ok

server crashes?

erm, /var/run/foo.pid could very well be stale, and you’ll end up having to check if the process is running anyway

who do you think gives anything about how long you where away

no one
i really dont care

right.

I DO IF HE HAS CANDY

so kill the away messages

just forgot to turn it off in the script

you know the rule about candy and strangers

oops

take it , it’s just a candy

how do i check if a variable is empty for an if statement
if ($id = null)?

if( empty($id) )

glad this is virtual something or other

thank you

it depends on what you want to check for though

zophy :P

is irc a virtual anything ?

for example, 0 is empty

yeah, thats fine

“0″ is empty that one always annoys me for some reason

zophy, virtual what?

was it so people could stick a default value of 0 into numerical fields on forms?

empty is basically !(bool)

TehSausage, 0 isn’t empty.

well i think i read that in php 2 or 3 it didnt match “0″

It’s just not counted as true on if statements.
But it’s != null

are you sure?

not virtual reality, not virtual conversation…. virtual acquantances ?

empty() disagrees

Just compare it with null

kuja@ryuzaki:~$ php -r ‘$n = 0; var_dump(empty($n));’
bool(true)

if($somevar != NULL){

is false == null?

Yes.

No, it’s not.

false == null, but false !== null

false is a boolean value.

php.net/manual/en/types.comparisons.php

XD

kuja@ryuzaki:~$ php -r ‘var_dump(false == null); var_dump(false === null);’
bool(true)
bool(false)

check in the row $x = 0, the column empty()

Get your head on straight.

i prefer to avoid null, especially in php

yes, because things default to null…

good thing php has isset() and i never predefine things

predefining things can only lead to suffering

heh, wow
$x = null; echo (int)isset($x);

wtf. my interpreted csv parser is faster then fgetcsv :|

How the hell does that work?

does php uses a hash table?

hello room

Ah, there we go.
kuja, got you. :P

Got me?

Hopefully, when the variable is passed on from a user.
It will be a string, not a number.
$ php -r ‘if(NULL == “0″){echo “true\n”;}else{echo “false\n”;}’
false
$ php -r ‘if(NULL == 0){echo “true\n”;}else{echo “false\n”;}’
true

And? Your point? I don’t remember ever discussing anything relevent to string emptiness.

XD

I want to convert a image to 300dpi PDF. I am just wondering if any plugin or module available in php which will help me in doing this

It’s obvious that “0″ doesn’t evaluate to false because “0″ is a string containing 1 character.

so, did we stop talking about empty() ?

does anyone aware of anythign as such, i checked on google, but nothing i found in php

kuja, “0″ evaluates to false

maybe NULL is a macro, you can never know for sure

yes you can, check the source

not unless you do === “0″

that’s just the way i feel about NULL
TehSausage, that is the point i was making indirectly

$ php -r ‘if(NULL == 0){echo “true\n”;}else{echo “false\n”;}’
true

Right, now that one I can’t really explain unless PHP does an (bool)(int)”0″

dude
when you compare to int
PHP casts both arguments to int

kuja, not even that, as “00″ doesn’t evaluate to false

explode(“\n”,exec(‘ps aux | grep sshd’)); — would that explode each variable into an array?
like each section?

when you cast NULL to int it is 0

Special behavior?

csc`: did you try it ?

ummmm, never replace NULL with zero, thar is wisdom

and basicly you do (0 == 0)

all im getting is ‘Array’ when its outputted

csc`: var_dump($output)
csc`: learn to debug

change the dpi as you wish with gd and then use fpdf or dompdf

kuja, yep, basically, “00″ is not considered empty while “0″ is, no real integer cast involved

ow
my brain just leaked

“” and “0″ are the only string that evaluates to false afaik
+s-s

under special circumstances, apparently
Actually… (bool)”0″ does result to false no matter what, unless explicitely compared using an operator.

var_dump((0 == “string”)); //true

gd?

[dev]Viper: and thats why I love ===

I basically have an image host jpg, and hte client says he wants it in 300dpi pdf format. so basically i think we need to convert the jpg to pdf directly

=\ dpi isnt really specified

(bool)”0″ will always be false yes, but you can’t chain logical arguments, “0″ == array() is false , but “0″ == false && false == array(), it always depends on the types compared

you cant convert jpg to pdf … you can resize the image with GD and then generate PDF with that image

it’s just a value sent to the printer at what size to print at
make a 200×200 72dpi image in photoshop, then 200×00 214dpi image, and it’ll just be a 600×600

DPI is a printer unit, not screen

except the printer will print it 200×200 at 3x better quality, unless you have a crap printer

it’s just a way of telling the paper-copy device how the image’s “pixels” relate to the paper

Dynom, a pixel is done dot.. a screen is normally 72dpi compared to print of around 300dpi or more

72,27 to be more precise

hey, what is the “shoot the bull” room?

but you can’t state it like that, because a screen is nto paper

yah,

and a photo on screen can look like shit at only 300dpi on paper
depends on a bit more then just dpi
darn I need more hdd space

vectors are usually 0 to 1 float coordinates right?

vectors are vectors

what’s your vector victor?
you have clearance Clarence

i was thinking about making a simple format

vector has two points

whats vector c then?
a+b

Hi

vector c is vector c

… *deletes Ddev\tty*
well that explains why that script wasnt working before i guess XD

:-)
most programming languages have vector objects

did i forget to say vector images

yeh you did

i thought a vector was bugs transmitting disesases to otehr animals :/

O.o

does any body know the book of ” Practical PHP and MySQL ” ?

the author in here does

I bet ebay or amazon know a fw

but basically here we need to convert the image to pdf and want that pdf to print at 300 dpi.

yes the author mentioned that he gat help ftom this room

sure theres a pdf module of somesort

so waht i am trying to understand here are 2 things. 1. first i have to convert image host using GD and then generate pdf

do you have permission to generate a pdf? that is more the question

No , I already have this book ,, but asking for it’s quality

did he got most info from here?
in that case very unreliable

lol

did you read it?

lol yes
wait to quote this

did you learn anything?

you fail to see the humor in that one didn’t you…

i got the humor

#php,
#mysql, and #lugradio on Freenode,
this was his words

thought you were making fun of me though

Hmm.. Is there some function to read a line from a socket, like stream_get_line, or fgets?
Or will I need to make that manually?

low self-esteem?

i was typing at 300 words per minute there doing 9 things at once and not making sense myself

I take that as a yes

any idea ?

don’t assume
you are always wrong
i’ll fucking kick your ass from here to Guatamale
:P

when checking if records allready exist in a db before inserting in it what is the best and fastest way?

any idea ?

php / php mysql web hosting in a nut shell, $db = (mysql_connect(auth info))

tell me when you start making sense again

$result = mysql_query(“SELECT * FROM yourmother”);

hi… how could i check for a corrupted image?

Any body can answer
or i’m at a dessert

while ($row = mysql_fetch_array($result)) { // do me
thats all ya need

JINK123 :x
Jinks123 ,,, I will kill you if you didn’t reply

god beat ya to it, well started the process anyway
– cancer and multiple sclerosis, i’m a fucking disease legend

no such file or directory

lol

nothing scares me, im already dead

u must believe in GOD !

hilarious, but so are the rest of us, we just waiting for the final blow

im gonna go kick his ass

so little confusing. if i have a image, i use gd can generate pdf. but where do i specifiy abt dpi, bcz the end requirement is to print the pdf at 300dpi

the fact that you state ‘must’ is the extact deal I hate about religion
dude, read what DPI is

so i am not sure while generating, do i need to specifiy dpis or its completely independent and has to be taken care druing printing

Dynom , I don’t think we are here to die and is over

i understood its dots per inch it uses tprint

there is a difference in religion and thinking about other possibilities
ok, so where exactly does your screen kick in that ?

Dynom ,
maybe

when checking if records allready exist in a db before inserting in it what is the best and fastest way?

ahh sorry, so its all about measure of printing resolution and it is not connected anywhere during generation of pdf

use IGNORE, if you want to ommit just the error
if you want to update existing, don’t use INSERT, use REPLACE

Ok , reply me on the book quality

your next SQL question will be in #mysql not in here, okay?

or is it enough to read ebooks and i would be ok in php
?

don’t bother with books

o’reilly is allways decent material

i’m talking wether to make a index and use mysql_errno or do select query mysql_num_Rows this is php related if i’m not mistaking

php.net/function
and start playing

not how to build the query or what it should do…mkay?

I think doing some actual php will prove the most viable

you asked the fastest way, which is to not check it, but let the appropriate section take care of it

fastest way with php

essentials should be learned some where and then to play anywhere i’d like

-_-
searching is in essention slow, so avoiid that where possible
build two arrays and compare it, or exclude

you talking full text search? i missed something

after getting an over all idea

name me a fast search

i thaught you said it is #mysql related …now i get help

well you said “Fastest way with PHP” so what is it?

preg_match

back to the start… what do you want?
wrong, thats not fast
try again

bullshit

never heard of that algorithm

str
str”yourass”

wrong again

i like fucking with you

search != fast, thats why it’s called searching
then you must be one of my ex boyfriends
and I didn’t like doing it with you

you fuck all your ex boyfriends still?

no, thats why I dumped them

The problem is that i have to check all the fields and notice the user wich record makes a duplicate…if it waren’t for this i would just create a index on the fields i don’t want a duplicate and do a if mysql_errno(bleh) “There is a duplicate in your record”…bu the problem is that i have to
notice the user wich field makes a duplicate…tha’s all

finally i understand, please correct me if i am wrong. DPI does not matter anywhere with conversions. If your parent image has 300 dpi, then after conversion also, it will remain the same and you can take the print without any problem

let me get this straight, there is no such thing as a fast search, because searching is slow?
google wants to hire you

in that case, you can build two arrays, and check before you insert, if (isset(($existingID[$id])) { // you can’t insert duplicates, try something else }

so we dont need to bother much abt dpi. only thing to bother is how to conversion and differnt format of images.

you miss the point

I can search 10 gigs of text files un under 30 seconds and pull out 39535 matches of q=xxx from about 5 millions lines of text… i consider that fast

you soo miss my point
search == not fast, period.

try it by hand

ok, say you have a single spot for your keys, it’s either there or in your hand.
and you have a room, where your keys are either in, or in your hand
which will be faster

i can never find my keys, i think i’ll code a php beeper :P

the first, obviously, since yu check one spot

Dynom, its very wrong to say search is not fast
thats a poor generalization

search is allways slow and expensive, as is e.g. pathfinding and alike

rubish

maybe dynam needs to upgrade that p133

google is amazingly fast for the data size

sigh
ok, you win , search is fast.

not all searches are slow
regexp is slow

mmm, i want to debate that one

eg a regexp search in a db is horrible

are the new real intel quad cores out
suppose to be last week in july :/

Why isn’t PHP accepting any connections other than from localhost?

hmm .. how comes that such a trivial bug hasn’t been fixed for over 3 years? http://bugs.php.net/bug.php?id=27777

what diffrences do i have to make inorder to use a postgres db instead of mysql
connection string and diffrent query commands? do i have to change the sql syntax too ?

enough to make you not want too, because postgres suxors

how could i check for a corrupted image? i mean… i would like to make sure corrupted images are not going to be stored

jinks123 , thats not up to me

then shoot your bos :P

I think gd can help you with that

jinks12, thanks for being so helpful

im sure the syntax is majorlly different
if there aint no mysql2postgres apps/utilities, then its prolly more a pain that you care for
but there probably is
i reckon the db fielddesign is enough to make you pull your hair out

stop bitchin

wtf

hi, i have to strings which are actually readed files and i need to compere those two strings, and i know that there is just one line different, but i need to know if there is different more then that line
how could i do that ?

man 1 diff

um i would like to do this in php itself

load the file into a variable using fopen and fget then use the usual functions to find out what you need too.

ok i will try one my idea
i will see if works

what’s the meaning of require_once

you use that to make sure a file is included only once (in case you expect the line gets evaluated or included multiple times and want to avoid function redefinitions)

php.net/require_once first three lines: “The require_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the require() statement, with the only difference being that if the code from a file has already been included, it
will not be included again. See the documentation for require() for more information on how this statement works.”

sorry, misstab
that was for you

but..but..i already typed that over for him

yeh, but mine was a bit more progressive and hinting towards php.net/
but yours was better!

and i also had my “You’re only allowed one php.net quote a day” macro ready
band i also had my “You’re only allowed one php.net quote a day” macro ready/b
will have to come up with a whole other thing now

oh :-(
sorry :-/

not to worry, got all day .. *back to the drawing board*

dynacrylic, where
Dynom, where do you get that information?

all yours

$config-usergroups is this some kind of pointer?

read the first few characters after ‘unreal: ‘ untill you come across another ‘ ‘
thanks -_-
no it’s not

$config is the variable name, ?
config is a variable name?

object name

and $ makes it variable?

:-
:-(

Dynom, can you tell me where you get that information from? pleaseeeee

from teh 1nt0rn3tz

give a link

)))

it’s good page

nah sorry, I’m not allowed
the voices are telling me to not give it

but i still don’t get it
why don’t we include same file twice

why would you want to
do you like telling someone the same thing twice?

it’s not going to hurt me
ok forget it lets get back to $config-usergroups

god that is the one awnser I didn’t got an argument ready for
you bastard
http://php.net/manual/en/language.basic-syntax.php -

do here

yeh doh
noone is that stupid

can you tell me

it’s to point, like the t-shirt “I’m with stupid”

$a-b

$a has a friend b and it’s point to b

http://php.net/manual/en/language.oop.php

pointing*
$f00li5h-Dynom
I have the t-shirt on

$link=mssql_connect(‘1.2.3.4′,’db_reader’,'user’) or die (‘fail to connect. mssql_error());
is this one ok?

if you replace connect. with connect’. sure

which connect
$link=mssql_connect(‘1.2.3.4′,’db_reader’,'user’) or die (‘fail to connect’, mssql_error());
like this one?

the one with the .

mssql_connect and die are two builtin(included) functions?

yes

i’m working on a reporting system written in php
it should send snmp report to 50 recepient at a time, but now it tries to send as many as possiible
so i need to fix it

Lol. PHP chat server ftw.. Connect to home.maxdamantus.uni.cc:80 as a raw connection.
I could make a basic IRC server with this class I made.

make it into an IRC client and have yourself more of a challenge

there are enough irc client, do something more constructive

like sending out snmp reports?

no
i want a great webmail solution
with many many features

I just installed php , apache mysql from ubuntu repositries
which is php5 as there was no build available for php4
Now apache is refusing to run .php files
any pointer to resolve this ?

did you enable the .php(4) directives in httpd.conf?

chanakya, do you have PHP loaded and apache configured to parse .php files?

yep did that
edman007 Uncommented the AddType application/x-httpd-php .php directive from httpd.conf

and afterwards, did you restart apache?

Hyra is there anything else you need to do
yep , I restarted the PC too

chanakya, make sure you have the LoadModule line and that apache is finding it (check the error logs)

get me some coffee sir.

are possible insert constant php in code javascript?

let me know if you find a clue

Yes, use php to write the javascript and you can use php constants and variables

teyus, uhh…what?

sorry edman007, my english is sux =X

what’s your favourite php editors on windows?

can`t find any loadmodule directive for php

i´m use eclipse and dreamweaver
thanks wobbles

what exactly it says ?

hey guys, I need to create a php webservice to consume using .Net. Is nuSOAP the best framework to do this?

chanakya, LoadModule php5_module modules/libphp5.so
|CDR|jnny, PHP5 has SOAP, no external stuff needed

edman007, got to take a look at that. ty.

|CDR|jnny, just to warn you, the docs suck for a lot of it

edman007, any suggested place to look besides that?

pear has a SOAP thing as well

did you get it to work

edman007, k thx a lot

hi
i just installed php
but when i try to see a php page in browser, it shows the codes in the browser
why?

i have to array variable, how could i delete all same records in both
but sitll i need to know where, in which array were those records
so in this case i can’t use array_diff
becaule show all differences
i compere $test and $test1 and need to know which arrays are in $test1 but are not in $test

No Ubuntu default instllation is alll screwed up
I think i will build it from source

$_POST what’s this?

I made a command handler on my chat. :P
And made a /NICK command.

php.net
There’s a good doc

EvilDin, you’d be better off with a foreach.

dam it i have so much to learn

$foo=”a”; $bar$foo=”whatever”; echo $bar$foo; # Gives me: unexpected T_VARIABLE

dbe, …

um how ?

well EvilDin.. not sure but you FOREACH TEST1 and control each element with if(!inarray(TEST1 element,TEST2 ARRAY)) DOSOMETHING

You mean $bar = $foo.”whatever”;

I want the variable name to be $bara

$bara?

Hold.

$bara = “whatever”;

you can’t do that … even if you could, there is no point to it

Oh, and if you want to echo two variables.
echo $bar.$foo;

i need sample PHP script that keep monitoring some server with ping and send mail notification when down

to google you shall go then

I’m trying to: $total.$tmp=$total.$tmp+$$tmp;

urgh that’s nasty
just use an array

I did that.

what are you actually trying to do???

my007ms its easy as hell, if i wouldnt be in bed with my big monitor and reading c internet book then i would do it for you hehe but anyway if(gethostbyaddr(“216.34.53.1″) == INVALID) mail(“DOWN SERVER”,”BLABLA”); well what i actually mean is check up php.net/mail and
php.net/gethostbyaddr

well with ping it is abit harder because im not sure if there is ping function in PHP but some Shell coding should helpp yo

aa^way, i need one that have web front page that show all server in green and once on down it’s send mail and the icon become red something like this i am sure there is read script for that one

meow ^^

hey ^^

hey AlexC_ :P

how are you today mr foutrelis?

Perfect How about you?

good to hear, I’m not to bad :P

The channel is too quiet -.-
How is TangoCMS coming? Will it be released within this week? ^^

it’s going good – just doing a few tweaks and it’ll be released by friday :P

Hello folks!

morning

hi joatweb

I want require once to get a php file that is found two directories up the hierarchy
what do I do?

ooo that would spoil the surprise!
…/../file.php
…/ means up 1 directory

oh good! i finished and deplyed my first symfony app :-)

I guess I could wait :P (or hack into the cvs|svn server and get the last revision! :P )
Great!

codeigniter has better docs and performace

hi I have a little command line script that uses some php5 functions and need to backport it to be php4 compatible… so I set zend.ze1_compatibility_mode = On in php.ini but the script still works…

but symfony rules in dev speed

hey can anyone show me via pastebin how is 3×2 array hold in memory? well not in memory but how it looks like )

i’ve done complex apps in literally minutes

i pretty much guess how it lokos but id like to be sure

hi

I could install php4 of course, but the compability mode seems such a nice feature… any clues whiy its not working?

delmonico, i just wish you wouldn’t need to do it…
i want php 4 to go away, really
php4 is the vb6 of web applications

so would I

how do I remove a string from a text in php
a substring that is

str_replace()

bushwakko, str_replace()
you can replace with an empty string

delmonico, that compatibility mode doesn’t affect every php5 features

thanks AlexC_

oh… so no way around installing php4?

hacking my svn server is like stealing freebies … pointless :P anyone can checkout the repository

delmonico, yep

Hmmm

alright, thanks for the info

AHA! http://svn.tangocms.co.uk/tangocms/trunk :P

^^

Sorry that was meant for AlexC_.

although, I don’t remember changing my name

funny..
:P

:-D

Has anyone successfully ran both php4 and php 5 on the same IIS server?, im running php4 as isapi and trying to run php5 as cgi, 4 works fine and 5 im gettin permission denied anyone have any pointers
(dont use iis is the obvious one but this is a clients machine :P )

I can’t find config.ini.php in application/zula/

aye, it’s not in there – you have to grab that separately, hold on

huh, php5 is discontinued?

ok

http://releases.tangocms.co.uk/106/alpha1/config_file.tar.gz

Where did you read that?

someone told me

Thanks! :P

php4 will have reached end-of-life end of this year

metbsd, no it isn’t, php 4 is almost.

php5 is still very much active

there you have it

dont use iis
i thought they discontinued php5 as php6 will come out fairly soon

php5 will be around for a long time yet

php4 will be dead soon, AT LAST

yay

i hope the shared hosting providers that still have php4 go out of business at last too

majority of them have no idea,

because i fear we will still have people coming on irc saying “i only have php4 ,what do i do”

they just go “oooo reseller! I can make money!”

lol

i can be though, amongst a lot of other things, wrong

but from the end of the year on the answer will be “do your business with someone that actually knows how i’ts done”

its alot harder for shared hosting providers to migrate to php5

jduggan, it is not

jduggan, it’s not hard at all

when theyve got possibly hundreds of sites, not maintained by themeselves to get developers moving over

i’m php newbie
and i need to fix some php program in my work

send a message to all customers “make sure you app works on PHP5 within 2-3 months … or your gone”

jduggan, the only problems with migrating is really badly writen hacks for PHP4

what should i do

metbsd pay someone to do it

what is hard is having tons of script kiddies that go omfgbbqlolrotfl

“but my PHPbb install from 2003 doesn’t work”

metbsd, i don’t have contract time available atm, otherwise i’d be glad to fly over and fix things for the occrect amount of money :-)

Polysics, say… £200 an hour plus travel expenses?

HarryR, i actually charge about 50¬ an hour
and in Italy that is considered expensive :-/

ooh, a unicode character

HarryR, i do that for a living :-)
but i’m considering a perma-move to the US or switzerland…

I’m trying to get a startup sorted out, then moving to Cambodia for a few years

(long shot, as there’s no #php_vacancies) Anyone near Amsterdam looking for a fulltime contract doing webdevelopment?

fly over? where are you, Polysics

italy :-)

i’m in china

!tell Hyra about jobs

you’re better off with someone near you, i think :-)
the trip would cost more than the work

ty AlexC_

it’ll take about 10k RMB to fly

10,000 right mouse buttons?

REALLY MASSIVE BURGERS

^^

i’ll go look for something in California, i think
SF area still appeals me
or, like someone said, Oakland… where the rent is cheap, it’s the ammunition costs that beat you

lol

argh, don’t you just HATE when you have an app that you know has a problem, but only with some files out of 20000, and you can’t get ONE of them to try it out?

Hmm, a 1 bed flat for $700 a month

I have a function, foo(), that returns an object with a property, bar. Does php has an equivalent syntax to “print(foo()-bar);” ?

but best place to live is china
best place to party

$bar = new Foo(); echo $bar-moo;

Uh, are you sure metbsd?

well, i know what’s north america is like, don’t know about europe and other places since i haven’t been there

Can I use this in an if-statement? “if($ok = true && ($bar = foo(); $bar == true))”?

HarryR, where are you at

I search for a way to just use one single statement

metbsd, London, UK

to reach bar

boring place, lol

you want to see if $bar is a foo() ?

i have a semi-detached house in the country, Italy is a great place to live in, but no to work in

metbsd, nah, as clubs go you’ve got lots of variety in London, lots of underground stuff too

gtg now, physical rehab :-)

best part of clubbing is just chicks
i don’t know what else is fun

if the music is bad then the whole thing is bad

how can music be bad

no, I want to use the value of bar (which is a property in the object returned by foo) in the same statement where I call foo(). In other languages I can call e.g. if($ok && foo()-bar == true)

if you have no taste in music I can’t blame you

if ( $ok == true && $foo-bar == true ) {

hello

and before that – $foo = new Foo();

you can have whateer music you want at home

isn’t the character encoding in GET supposed to be identical to that in POST?

hey, im using php and mysql to show some data in a table, ive made the data sortable on all fields, when i echo the data on the left i want there to be a row number, so as it echoes each row it should go 1,2,3 with however the data is sorted, how can i do that

i usually go club to get drunk and mess with girls

$i = 0; while( $row = mysql_fetch_array( $query ) ) { echo $i; ….. $i++; }

In that way I need to call foo() before the check $ok == true which I want to avoid

where would i put that

I don’t think you can
line 16, just above that put of code there – in this file

ok, thanks anyway

s/put/bit

bulldogg597, you see that “….” in the code you were given? that’s where you echo the data of a single row, while inside the loop.

ok thanks

yw

metbsd, it’s cheaper here to go out on “substances” instead of drinking, can fairly easily be out clubbing for 14 hours at a time

well, food o’clock for me – cya

is there a coder that knows how to redesign the oscommerce ? payment ofcourse

HarryR, what places have you visited in your life

most of Europe

someone that codes for money?

oh

Never seen any other towns apart from maybe central amsterdam that have the same variety of music and people
and bristol ofcourse

someone that knows php for oscommerce

*GUNK*

can someone help me install this class from http://www.phpfreaks.com/quickcode/Pagination-Class/566.php its a pagination I’m still gettin famaliar with oop, it looks fairly simple, but how do I connect the class into the
sql, and the next buttons?
I wish it showed an exmpale

mariahx6, find one of those project auction sites

Harry,some idea?
I want to have someone that knows what he does

uh, rentacoder.com, elance.com etc.

but they are not secure… I got one ffrom rentacoder.. he was terrible
like beginner or something like that

then find a web design & development company that specialises in osCommerce
they are out there, but you’ll probably be paying 5-10x what the equivilent costs on rentacoder style sites (you get what you pay for)
compared to rentacoder style sites*

meow

okey.. I want to pay 6000 kr I will do the design by myself

*looks silly*

we install oscommerce for 1400
with design
http://www.bradyvercher.com/php-pagination-class.html heres an nice pagination example
a href=”http://www.bradyvercher.com/php-pagination-class.html”http://www.bradyvercher.com/php-pagination-class.html/a heres an nice pagination example
a href=”a href=”http://www.bradyvercher.com/php-pagination-class.html”http://www.bradyvercher.com/php-pagination-class.html/a”http://www.bradyvercher.com/php-pagination-class.html”http://www.bradyvercher.com/php-pagination-class.html/a/a heres an nice
pagination example

mm, did someone say amsterdam? Things are blinking
ah .. found it. Never mind

toerists and Amsterdam.. sigh..

where do I set my credentials so my mail() function will work?

no, you have to use something else for that, as far as i know

d-media.. 1400 kr?

do you mean paramters

mail() just assumes that the local MTU trusts you

Comments off

hi all I have a problem displaying utf-8 with php in the terminal cli php the special characters are displayed

$var or ClassName

Comments off

I have a problem with a Hash list I do var cities = new Hash var name = foo then cities[9] = {name name} But

stripping “$” and “,” with ZERO error checking is quite simple
assuming they can be anywhere, here:
var curchar = “”; for (var i = 0; i mystring.length; i++) {curchar = mystring.charAt(i); if ((curchar != ‘”‘) || (curchar != ‘,’)) {mystring2 = mystring2 + curchar;}}

wtf?

oh wait &&, not ||

lol

one day i’ll learn “regular expressions”
in fact maybe now
you got a nice tutorial somewhere, woosta?

well … tnx both of you Agamemnus for trying
and Woosta for doing it in a split second
;D

There’s a lot of regex tutorials around

the best one

this might get handy
http://www.ilovejackdaniels.com/regular_expressions_cheat_sheet.png

s = s.replace(“$”, “”).replace(” “, “”).replace(“,”, “”)

*whack*
s = s.replace(/[\$ ,]+/, ”)

sure, if you want to use regexes

all fancy schmancy

how do i zoom in?

the \ isn’t necessary

yeah, realised that after I pressed \n

move your head closer

hahahahaha
rofl

ooo burn

hahahhahah

and why is the png page loading quicktime?

that’s from Red Dwarf

Heh all..
I’m trying to write a Mozilla plugin to add a node based on the value of some text on a web page

=|

I have an Xpath reference to the node
//blockquote[@id='gg_1']/p/span/font/label
But how do I reference that using JS?

http://developer.mozilla.org/en/docs/Introduction_to_using_XPath_in_JavaScript

Aha!
Thanks
*clickety click*

alright, ive read Professionnal JS for web developpers
i know dom and all that shit
how do i do nice ui
:P

hmm, is there like a game making channel on here?
or a network?

on efnet there is gamedev but thats mainly for C++ i think

oh
well, I dont think anyone has made a game like me
well, there are 1 or 2 that I’ve seen
not many’

there seem to be about 60 obviously game-related channels here

how do you find them?
I’m nto about to do a channel list again
that was a mistake

why?

because, there are tons of channels on here

just list the ones containing game

how?

depends on your irc client

chatzilla

I don’t know it

its a firefox extension

in X-Chat you open the channel list window and type in something to search for
I mean I don’t know channel listing in CZ

hmm
non
e*

did you find any?

./list keyword

yes, I know
[INFO] Displayed 0 of 0 channels.

/list *game*

tried that to

HI all

HI

can javascript get a computers name ?
on local intranet
I need to get 250 users computer names and have the server drop them to a csv file ?
../???

no
hmm
I should work on my game now

Thanks.. that worked perfectly!

‘You are a capo and your members made a profit of $ 1,141,820 for you.’.replace(‘You are a capo and’,”).replace(/^(.)/, function(a,b){ return b.toUpperCase() })

your members made a profit of $ 1,141,820 for you.

;/
Woosta, help
‘You are a capo and your members made a profit of $ 1,141,820 for you.’.replace(‘You are a capo and’,”).replace(/\b(.)/, function(a,b){ return b.toUpperCase() })

Your members made a profit of $ 1,141,820 for you.

\o/

alert(“boo!”)

Error: Error: ReferenceError: alert is not defined at line 0: (null)

haha
lol()

Error: Error: ReferenceError: lol is not defined at line 0: (null)

……
vBm…..

?

var curchar = “”; for (var i = 0; i mystring.length; i++) {curchar = mystring.charAt(i); if (‘”, ‘.indexOf(curchar, 0) != -1) {mystring2 = mystring2 + curchar;}}
…..
it should be == -1.
a = 5;

5

a = 4; b = 3; a + b = c; c;

Error: Error: invalid assignment left-hand side at line 0: a = 4; b = 3; a + b = c; c;

a = 4; b = 3; c = a + b; c;

7

Whew, glad you tested that!

mystring = “$ 1,141,820″; var curchar = “”; for (var i = 0; i mystring.length; i++) {curchar = mystring.charAt(i); if (‘”, ‘.indexOf(curchar, 0) == -1) {mystring2 = mystring2 + curchar;}}; mystring2
oops
mystring = “$ 1,141,820″; var curchar = “”; for (var i = 0; i mystring.length; i++) {curchar = mystring.charAt(i); if (‘”, ‘.indexOf(curchar, 0) == -1) {mystring2 = mystring2 + curchar;}}; mystring2

undefined$1141820

dammit

What on earth are you trying to do?

mystring2 = “”; mystring = “$ 1,141,820″; var curchar = “”; for (var i = 0; i mystring.length; i++) {curchar = mystring.charAt(i); if (‘”, ‘.indexOf(curchar, 0) == -1) {mystring2 = mystring2 + curchar;}}; mystring2

$1141820

DAMMIT

Agamemnus, well Woosta’s regexp is working like a charm … so no need to that :P

mystring2 = “”; mystring = “$ 1,141,820″; var curchar = “”; for (var i = 0; i mystring.length; i++) {curchar = mystring.charAt(i); if (‘$, ‘.indexOf(curchar, 0) == -1) {mystring2 = mystring2 + curchar;}}; mystring2
AARGH
mystring2 = “”; mystring = “$ 1,141,820″; var curchar = “”; for (var i = 0; i mystring.length; i++) {curchar = mystring.charAt(i); if (‘$, ‘.indexOf(curchar, 0) == -1) {mystring2 = mystring2 + curchar;}}; mystring2

1141820

See?
mine works better

better than what?

lol

vBm, I thought you needed it to handle a space?
and if you need any other characters to be removed just change the ‘$, ‘ string.

But *why*???
Just use a simple regex and be done with it

because you won’t give me a regex link

Saves a shite load of code and a shite load of cycles

Woosta, how to check if textContent have “You” in it … so i can perform that replace thingie above i’ve tried

and you didn’t provide a new regex

;google regex tutorial

http://www.regular-expressions.info/

new regex for what?
if( /\bYou\b/.test( textContent ) ){ it was there }

hasyou = (textContent.indexOf(“You”, 0) != -1)

textContent=”I went to visit Yousef at lunchtime”; (textContent.indexOf(“You”, 0) != -1)

true

textContent=”you earned $120″; (textContent.indexOf(“You”, 0) != -1)

false

as it should be
textContent=”You earned $120″; (textContent.indexOf(“You”, 0) != -1)

true

textContent=”Your grandma earned $120″; (textContent.indexOf(“You”, 0) != -1)

true

yes.
textContent = “YouYouYou”; if( /\bYou\b/.test( textContent ) ){ it was there }

Error: Error: missing ; before statement at line 0: textContent = “YouYouYou”; if( /\bYou\b/.test( textContent ) ){ it was there }

?

textContent = “YouYouYou”; /\bYou\b/.test( textContent )

false

textContent = “You YouYou”; /\bYou\b/.test( textContent ) );

Error: Error: missing ; before statement at line 0: textContent = “You YouYou”; /\bYou\b/.test( textContent ) );

sigh
this is why I’ll never use regex

Erm .. that’s nothing to do with regex

textContent = “You YouYou”; /\bYou\b/.test( textContent );

true

it’s a simple syntax error

sure
but it seems i can make a lot more with regex than simple string manipulation

And your script will take 50 times longer to run

maybe so
maybe no
maybe … [insert rhyme here]
or perhaps insert a regex
ok… let’s see
somevar = [abc].test(“abcdefg”);

Error: Error: ReferenceError: abc is not defined at line 0: (null)

somevar = gr[ea]y.test(“abcdefg”);

Error: Error: missing ; before statement at line 0: somevar = gr[ea]y.test(“abcdefg”);

see
like in the example..
if I wanted to match “grey or “greay”
and say “true” if it matches…
somevar = colou?r

Error: Error: missing : in conditional expression at line 0: somevar = colou?r

“vBm” at 71.6.194.243 pasted “var xpath = “//html/body/cente” (5 lines) at http://erxz.com/pb/4136

what am I missing?

it says /\bYou\b/.results has no properties
;/

vBm, that’s why if you don’t want woosta to do everything, learn regex or at least string manipulation

results?
you’re missing the regex quotes (//)
you need to use the test method of the regex .. the value you want to test is the parameter to that method

umm … ok … tnx

testContent = “a@a.com”; \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b.test(testContent)

Error: Error: illegal character at line 0: testContent = “a@a.com”; \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b.test(testContent)

WTF are you doing?
Plz use /msg or #buubot for testing

hmm
#buubot
aight
so how would I do something like “colou?r”?
ooooo
the “/” go between
so if I wanted to match a AND b in any spot in the string…?
night

\o/ … did it … tnx for tips Woosta

np

Hi, is there any issues with document.write in IE7?

hey there – anyone got a good tutorial on XHR to interface with a PHP script to run sql hosting queries?

what you see that eval(function(p,a,c,k,e,d){… what packer makes that?

onkeydown=”return EIP_CaptureKeyCode(event,11)”

eh another question then
instead of document.write()
can i display a table with results
into a div id?

innerHTML
obfuscator

If it’s via XHR, send your data across as data, not as HTML, then create your table with DOM. It’s a lot safer

anyone on my XHR+SQL tutorial question?

Hmmm well can i write to an iframe
or rather load a generated javascript host page?

hi

Can i do something like
frames['search_results'].location.href = win.document.src;

What’s wrong with this? a href=”http://somesite.com” onMouseOver=”window.status=’Click!’;”Some site!/a
It’s the window.status that wont work.

browser?

Firefox
IE only stuff?

Night all!

Anyone? Is window.status an IE-only thing?

having a bit of a brain fart.. if i have an dom element, how do i get its ID?

no, I see the variable defined in FF also

nodevalue nevermind

a href=”http://somesite.com” onMouseOver=”window.status=’Click!’;”Some site!/a

what are you trying to do ?

gm0

hi
how do I see if the user has js turned on or off?

Showing something in the statusbar when the mouse is on the link.

yar?

how do I see if the user has js turned on or off?

hmmz
dunnoes
sorreh

lol
I think I am going to read a book

i think

since I know nothing about javascript what-so-ever.

noscriptTURN JS ON YOU N00B/noscript
:P

that makes no sence
shouldnt it be a simple if statment?

if it is, i dont know it
*XD

thanks anywho

Gargantua, if you’re able to execute JS….then JS is enabled
if (true) alert(‘js enabled’);

hmm
the thing is, I want to make sure enabled from php.
ie
php if (javascript enabled){ // javascript is enabled } else{ // its not }

then use xajax!

what’s ajax?

erm … how to make first letter of word to be bold ?

xajax lol
www.xajaxproject.org
it is a combo of php web hosting and JS

Gargantua, you could insert a single JS line on your page, which would automatically change a form variable depending on JS

that works too

initialize it as false, use JS to make it true

Kenman, sorry I don’t follow.

document.getElementById(‘jsEnabled’).value = true;
input type=”hidden” name=”jsEnabled” value=”false”/
actually
input type=”hidden” name=”jsEnabled” id=”jsEnabled” value=”false”/
(added id)
php if ($_REQUEST['jsEnabled'] == true) echo ‘js is enabled’;

ah
made sence
thanks alot

sure

I’m gonna do that then read a book

:P

Kenman, hmmm, that does require the user to submit a form, correct?

Gargantua, that one example in particular does, yes

oh, dang it

document.location = ‘mypage.php?js=1′;
you wouldn’t want it on every page of course

what does that do Kenman?

Can i make a generated window appear in an iframe?

“generated” ?

[domon]: got it worked out just using innerHTML
thanks anyway ^^

and then re.getElementsByTagName(“myItem”)[0].firstChild.nodeValue; makes the js crash, how can I get around this?

hello, i have that javascript to add rows to a table
http://pastebin.com/m2e7a3165
but have a problem, that insert inputs
but that inputs not go to POST :C
:X

looks like your form isn’t set to “post”
you didn’t even create a form element o.O
:P

yes
i create
i have another elements non that table

not in the code you have there…:P

the elementos how i create with php work

trying to send data to PHP from JS?

hi!is it possible to pass a JS variable to a session variable in PHP?

using ajxax

ok
thanks

How to change the Form’s action attribute?

and I want to dynamically change the action attribute proeprty so that the entry of that form goes to different pages depending on the requirements

hi

get form tag object by getElementById() then set action attribute.. i belive it will work

or maybe form.submit() has a parameter?

I’m having a problem with location.hash when executing javascript hosting from flash
it makes IE(6) crash/display a blank page after accessing hash two times
onClick..) works perfectly

Thanks It worked

no prob tavares..

I have a problem with a Hash list. I do var cities = new Hash(); var name = ‘foo’; then cities[9] = {name: name}; But when I try to print the value with alert(cities[9].name); I get undefined. Is this not the right way to use hash?

Hi all!

hi

what the hell is a Hash ?
you mean Array or Object

Nope… Hash List
Pretty neat way of storing objects or values with associative keys
in unordered fashion

its not part of core javascript though?

xFallenAngel, he means an object

Yes, thats what I am thinking too

mohahaha
as many datastructures they are all objects… that should go without saying

basically, there’s no such thing as an associative array in Javascript
you would use an object as a hash
for example, var foo['bar'] = “hello”; is badly wrong

whatever, I got my Hash to work now anyway!

arrays don’t function with non integer indexes
kanzie, of course, an array is even an object

var foo = new Hash({bar: ‘hello’}); is brilliant though

but we’re in a javascript channel

the API-docs for javascript will help you tremendously!

kanzie, what the hell?

in case you are curious of this

there’s no Hash object.
you use a standard object notation

Comments off

an easy problem I just cannot get the hang of I want to select blah where insertDate newer than 2 weeks old the

mysql

Comments off

hi all is it possible to access single bits of an int like in c or is it neccessary to convert to an array of

tag?

give each option a value and then send “this.value” to whatever in the onchange event

Send the correct content type then

it’s not my server
I can’t control the received content-type

tough luck then

is there an alternative keyCode for gecko ? i get undefined

You did something wrong

oh
i see

and function test(e) { alert(e); } i get undefined =(

isn’t the first parameter in gecko the event object ?

no, as you’re calling the function, not assigning it as an event handler
onkeyup=”test()” is the equivalent of someInput.onkeyup = function() { test(); }; – you want someInput.onkeyup = test;

Hi Guys, if I have three vars v1, v2, v3. How can I dynamicly access them will window.alert(‘v’+n) work?

make an array :P

I can’t my example is a paraphrase of my problem

if they’re in the global scope, window["v" + n], otherwise replace window with whatever object contains them

window['v'+n]

so would it be window.alert(window['v'+n])?

just try it out

input name=”pldr_mkd” type=”TEXT” value=”"/tdtdinput onClick=”if (!preMkdir(document.forms[0].pldr_mkd.value))return;
any idea why that doesnt work
value is alawys ‘undefined’

is a button

write your markup in lowercase.

that din’t work..

umm what

What error message did you get?

undefined

Let me repeat myself, “write your markup in lowercase”

yea, i have no idea what you mean

Then you don’t have a global variable named ‘v’+n
onclick not onClick

it works just fine for another button just like that
its ECS generated html

ECS?

dows it have to be global?

Yes. As already stated by insin.

jakarta ECS, a java html generator thingy

Anyhow, you should write your markup in lowercase (easier on the eyes) also xhtml requires you to write it in lowercase. So you best start now!

new Input(Input.BUTTON, “bla”, “bla”).setOnClick(“alert(‘omg’);”);

doesn’t look like he’s using XHTML

Send a message to the Jakarta ECS author, tell him to change it.

this is plain html

rather than input /

I know, I didn’t say he was using it either.

but still doesnt make any sense, why does it return “undefined” when the other similiar one works just fine

But there’s no point writing onClick in html, and doing so just because “it works” is a vague reason

you probably don’t want 3 variables named v1, v2 and v3. You probably want an array named v

I don’t know, I donä’t even know what preMkdir is.

its just a check i make, but its not important
as all it does currently is preMkdir(directory) { alert(directory); }
and directory is always ‘undefined’
even tho there is text in the text field

then there really is only one reason, you have more than one form, and forms[0] isn’t the one your looking for.

i only have one form

you should be using .elements['input_name'] rather than .input_name

the other similiar function works fine, this one doesnt

what happens if you alert document.forms[0].pldr_mkd ?

and if it the field wasnt in the form id get an error
hmm ill test
[object NodeList]
whatever that means

sounds like you have multiple fields with the same name

its just a plain text field, how does it have multiple fields

pastebin the entire page html hosting please

do any of your other inputs have name=”pldr_mkd” on them?

nope
just one field, and i pasted it

pastebin the entire page HTML please
http://paste.css-standards.org/

doh damn monday, was just a typo in the function itself

element inside a element?

I know it’s not a JS question… but I assume that most on here are web devs.

IIRC, can’t contain block-level elements, so no

hmm, okay. thanks insin

5 + “test”

5test

Any brits lying around?

cor blimey, guv’nor (I’m in the UK)

15 Commercial Road, Leith, Edinburgh — how do you parse that?
Here in .au you’d either be in the suburb of Leith or the City of Edinbugh (as in the city, not suburb thereof)

I’d take leith as the county, probably

Oh

“Formerly a municipal burgh,[1] Leith is a town at the mouth of the Water of Leith and is the port of Edinburgh, Scotland. It lies on the south shore of the Firth of Forth, in the unitary local authority of City of Edinburgh.”

…or a town

Yeah, that’s what I thought
not the county
Edinburgh might be the county .. ?

looks like Midlothian is the county
“The county of Midlothian was known, officially, as the County of Edinburgh until 1921″

heh
Client gave me “leith, edinburgh” .. which I’m trying to fit into a normalised form :-D
uClient gave me “leith, edinburgh” .. which I’m trying to fit into a normalised form :-D /u

just put “15 Commercial Road, Scotland”

ugh, normalisation of addresses

did they give you a post code? that clears everything up
you could probably post something here with just a number and a post code and have it arrive ok

Yeah

number, post code and country code

Just saw his other company has the same street address and postcode but is in leith, MIDLOTHIAN

parsing addresses is fun… especially if they have errors

both are right, but incomplete

and if they’re in a far off land

how well do JS regexps work across browsers?

how? Surely the ‘edinburgh’ shouldn’t be in there?
almost 100%

goodie, worth using then

Oh yes, absolutely

Leith is in Edinburgh, which is in Midlothian, which is in Scotland, which is in Great Britain, which is in the UK

The only thing I can thing of right now is split(/(.)/) changes
then you all just need to get over it .. ISO says there’s a country, then a sub-country

almost?
100%?

what is my overtired brain forgetting?

almost 100%

/excuses

What’s not working?

The only thing I can thing of right now is split(/(.)/) changes

that would be more of a split-method implementation error.

“abc”.split(/(b)/).toSource()

["a", "b", "c"]

true
^^ in IE, that would return ["a", "c"]

captured groups should be injected into the returne darray

absollutely

yes, true (even in ie7?)

im just doing a trim on a string

haven’t tested IE7
I see about 3% market share .. :-D

ok

(why has nobody upgraded??)

Because it’s a piece of shiiite?

LOL
I think the interface has gone stupid

that too

But at least they fixed a couple of things

I dont want to install windows vista either, but feels somewhat forced too
Guess I could wait til fall, when sp1 is out… Hopefully they’ll make it “better”.

I’ll only ever install windows into vmware ..

i use vista x64 ultimate at home

Which (sadly) is not an option for me.

hi all! is it possible to access single bits of an int like in c, or is it neccessary to convert to an array of bools?

if your hardware is new(ish) its ok

it’s “ok’ish”.

i actually like it alot :P
well it works 100% for me

b) & 1

I’m going to wait until SP1 then find out if people either ‘Confirm’ or ‘Deny’ that it’s better

some small annoyances but they are mostly the softwares fault

ofc, since all the fubar stuff, according to ms, “working as intended”

100% works.

prolly due to api changes

ty alot

7) & 1

1

hehe, indeed

i have a current generation computer and all the drivers etc work, thats the hardest part with vista

I can’t imagine that my Dell XPS M2010 will have any problems with driver either
But for now I’m sticking to XP Pro on the dual boot

current generation is not neccessarily sufficent for vista

(I only ever boot into it once every couple of months .. not worth the $$$ for vista)

e6600 4GB and 8800gts, works fine

$150 Vista Home Premim
too bad 800gts doesn’t have full support for purevideo
8800*

hi there. any ideas what is faster?
- creating dom nodes using document.createElement
- or writing the equivalent in HTML using document.write

the latter.
But I wouldn’t recommend using document.write.

thats why i have another computer hooked up to my 42″ 1080p with a 8500gt

It’s fubar..
roger

the only thing not working until now is my dvb-s card … :-(

what’s wrong with the 8800gts and purevideo

and why is that so? i mean using the latter the stuff has to be parsed

dvb-s is crap
dvb-c/t is crap also
dvb-h also crap

dvb-s is ok if you know what for

dvb-s2!
sadly finland is so far up north that cant get good sats without a 10meter dish :P

I would only use IP-TV,seems like the best

really??
why that?

therse some iptv projects here, just have to wait for the hardware to get hacked so can just use pc software instead of a STB

Because bandwidth-wise, IP-TV seems like the best host choice, you get the stream you’r looking at at that exact moment, all other crap standards they have to stream all channels to all recipients with no regards to what the viewer
is looking at.
bandiwth-wise s/c/t/h will be very limited…
and service-providers will lower bitrate to get more channels to broadcast in the narrow space

sucks fata**

erm… dvb-s is bandwith-limited in comparison to what, please?
just curious

amagad, I just said it, IP.

and ip over what medium are you talking about?

There’s a limit to how much information that can be sent over the sat
Just regular ip-traffic over the internets

were talkin about nearly 100 gbps on dvb-s … seems like is rather limited to me, though
like dedicated ip hosting is rather limited, sorry

depends on how many channels you want to broadcast, with IP you just have to send the packageinformation that’s currently of use to the recpipents
also easier to maintain subscriptions on a IP-TV network.

hm… maybe i don’t want to need subscriptions to watch free channels?

Why would you need a subscription to watch free-channels? It’s not like it’s a requirement in IP-TV that all have to subscrbe/pay. /eos

but it requires me to pay for ip… a once installed dvb-s system goes free
also not everywhere ip is available

no, but it is to me, athat’s why I prefer ip-tv over s/t/c/h
sleep tight

no… you said dvb-s is crap. sounded rather generalized to me

I said all was crap.
You started talking about s.

yep… but even saing all is crap is general, don’t you think so?
i just wanted to say that it _can_ make sense to use dvb
have phun with your coffee! :-)

Comments off

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »