Archive for August, 2007

Hi Ive just copied -usr-local-mysql-data from a server to a brand new one using 5120 without the ibdata1 file

that should be in a mysql error log somewhere
I dk where you distro is writing that.

its not giving me any logs though

Any idea where the mysql log is on a cpanel install?
Just wondering… spent ages trying to find it and I never could

sorry, no.

.var/log/mysql.err and mysql.log both exist but are empty

Ok, thanks :p

perplexing.
do ‘ps -ef | grep mysqld’ and tell me the result.

What can i do when INSERTing text into a table to escape any characters that are used format the actual text, etc?

http://rafb.net/p/47uNpH48.html
not running, wont start, no logs. ;(

I was hoping there mught be another instance of myslqd running, but there isn’t
might*
what are you using for input? php?

actually im inserting just with phpmyadmin right now

I am at a loss, but I will tell you this. mysqld is trying to start, but when it gets to writing the pid file it craps the bed. To me that sounds like some sort of file permissions problem.
sorry, I dk phpmyadmin. You have to find some way to escape single and double quotes in text strings though.

err, I just spotted /var/log/syslog. its usually just /var/log/messages
but anywho, I now see ‘Can’t start server: Bind on TCP/IP port: Cannot assign requested address’ it thought maybe I had something on port 3306, but ‘netstat -an | grep 3306′ shows nothing

ok, thanks. I just would have thougt mysql had a “filter” for that

weird, let me try rebooting it :o

hi, what’s the proper syntax for the following select * from foo where name LIKE ‘%Pepe’s%’ // problem being that quote is backslashed

its backslashed? doesnt look like it

jbalint++

:p

well, now that I know where to look for syslog logs… I’ve found the answer to my problem. its not starting because it can’t bind to 127.0.0.1, and it cannot do that because I do not have my loopback configured correctly (don’t know how that happened..)

my query isnt cuz it dont work
of course its backslashed in the database, it has to be
90% of the world comes to a help channel to be a smartass, is there one of those other 10% here?

try commenting out the bind-address option in my.cnf or on the startup command. that will allow connections from anywhere
LIKE ‘%Pepe\’s%’

that query errors

LIKE ‘%Pepe%s%’

or actually returns no results, the \\ ” errored

heh, geewiz, thanks for putting up with me :o boy do I feel stupid

this is not trivial stuff.

threnody, nice, but is that general practice on query building?

I don’t normally search that closely, I’d stick with %pepe%

well, just saying if someone searches for “jimmy’s” or jo’anne, should i normally just scan for ‘ and replace with %

yes
She Who Must Be Obeyed says, “Shut that damn computer off and come to bed.” Ciao.

ok thx
is there a single character match wildcard?

‘?’
g’night

night

_?

Is there anything wrong with this?

1187928713 and ptype = ‘GPS’ and order by id desc limit 1;

yes

what?

you shouldnt have an “and” between ‘gps’ and order by

oh…
How did that get in there.
Thanks

and you coiuld probably make use of here ACC BETWEEN 0 AND 100
i think thats the betweeen syntax
!between

anyone know of any good dbf to mysql converters?
i have a dbf file that contains a column of type memo and when i use a 3rd party app to convert to sql all memo column types are null
what is the equivalent to memo type in mySQL?

what is a memo?

its a text field in access

oh.
)

hey im not sure if this is the right place to ask but i downloaded a game for pc and its a .mdf file
what do i do with the .mdf

is it not a good idea to make 100 mysql queries per second or something?, I am creating this app that needs to know the state of a specific button, and my app has 100 buttons (application for hotel administration)

Why can’t you get the state of all buttons in one query?

Consty because the query is done in a method of the button
using C++/Qt

hey guys, I was wondering if it is possible to send mysql hosting logs to a remote host using syslog, is that possible? I googled but couldn’t find anything useful

If mysql is logging to syslog, you can send those to a remote host using the normal mechanism
As far as I’m aware however, it doesn’t normally use syslog

thanks
that I know, but can I make it use syslog?

Use 5.1.20 or above; there is an option to do so.
5.1.20 is not yet GA)

oh, so I guess with 4.1.21 I’m out of luck then

Look at the docs

I’m still looking at the docs

I suppose you could always patch the mysql server source to add that feature
maybe some distro has done that patch already

I’ll have to check
but I might write something to pipe the logs to the other server
I think that would be safer than patching mysql itself

sounds nicer
You probably want to use official mysql builds
We certainly do at work.

that’s what I always do
at least those builds are thoroughly tested

I tried running 5.2.6 alpha yesterday, it was severely broken
I found a bug almost straight away and reported it

reminds me of when one of my team mates installed 5.0 on 2 production servers
we got more down time than up time

Well, 5.0 is GA so should be stable
but I was running an alpha build
(Not on a production server)
In fact, not even on a development server

that happened before 5.0 was GA
I think it was march last year
maybe before

We use 4.1 in production, we’ve had few problems with it
Our strategy is generally to change as little as possible to our production system, ever

if it ain’t broken, don’t fix it

5.1 is the version where they added stored procedures yes?

No, SPs exist in 5.0. Read the docs.
in 5.1 they add partitioning, event scheduler and make minor tweaks to a lot of things

I was just sparking conversation.

Which features are you most keen for in 5.1 ?

Plugable storage engines!

But pluggable storage engines doesn’t really constitute a feature by itself unless you are thinking of any specific storage engine to plug in
The ones I’ve tried (Falcon, PBXT) have been too immature for any reasonable use
I rather like the FEDERATED engine

Hi
Can I somehow, on a SELECT statement, return ‘unique’ rows:?
Say I have 10 rows. user_id is 1321 on 5 of them, the rest of them are 23, 53, 312, 34, 23. you get the idea.
each of them has a my_num equal to the same thing, 7, let’s say.
I want to SELECT * FROM table WHERE ny_num = 7 WHERE user_id IS UNIQUE
you get my pseudocode?

Do you mean returning values which appear just once in the column?

Not sure what you mean MarkR42.

You can do select user_id FROM tbl GROUP BY user_id HAVING COUNT(id) = 1
I am assuming user_id is a foreign key here, and the PK is id

so wait, my implementation is that multiple user_ids can vote for a contestant_id. this is stored in table votes. I want to display the TOP voters for someone – a user_id with the *most* rows in said database. are we on the same page or?

You can order by on a COUNT when you use GROUP BY

Ah, let me see if I can understand this SQL
Awesome, thank you very much MarkR42.

s

i’m confused between log-bin and log_bin in mysql config file, are they the same ?

I believe so, yes

i’m working on setting up mysql master-slave replication, do i need to have binlog_ignore_db mysql in my config?

Not if you want to replicate all DBs

hey would anybody be able to help me out
im new to unix, kinda
but i have installed mysql and continue to get error with the file mysql.sock
bind error with the server hosting connecting to tcpip socket
???
is there a way around this?

Could you please paste the exact error
Are you sure that you’ve got only one copy of mysql running?

yah
in process
i dont have msqld running
here is the error
….
Can’t connect to local MySQL server through socket ‘/tmp/mysql
sorry for the delay
when i attempt to verify that the file is in that particular dir there is no info avail
?
im not sure where to look for it

Probably the server is either not running, or the socket is somewhere else

right….
when i try to run mysqld

Did you install MySQL from a package in your distribution, or an official binary?

it just hangs…

Don’t run mysqld directly

actually i download the package installer from the site
oh…

Instead start the service or something.

how do you do that

Your best bet is just installing MySQL from your distribution, it will probably start it automatically and get the basic stuff right

i thought mysqld stated the service

No, *do not* run mysqld directly

nps
its currently not running
well, i am running mac osx client
so for the particular install
they say to dl from mysql.com
and just use the installer
im not compiling the binaries

Did that not startup automatically?

not with client
with server
it should
as far as i understand
?
maybe im wrong
…..

I’m sure you can get a package which will make it work. A single package should include client and server

is there a way to initialize the service to start
?
does nix use services the same way windows os does?

in a WHERE clause, can i tell the difference between “Foobar” and “FoObAr” somehow?
i need to select those with random capitalisation in the middle of a string

Not exactly the same, but the principle is similar

oh

Hi ! I’ve just copied /usr/local/mysql/data from a server to a brand new one using 5.1.20 without the ibdata1 file. When accessing one of the schemas I get an error: #HY000Can’t find file: ‘./picpong_development/affiliates.frm’ (errno: 13). Is there anything to rebuild ?
all my db have innodb tables

hi.. how in a query can i list each regions with total populations on a table that has table(name,region,population) ?

sure
its probably sum(*) or something
with a group by

but u know there are only like 4 regions.. i couldn’t think of a way to list each region’s total population
i tried to use DISTINCT but i think it is wrong

it’s a very simple sql hosting query
one of the things sql was designed for

i’m not sure how to sum the population for each regions only..

something like, SELECT region, SUM(population) FROM table GROUP BY region;
some functions you can put in SELECT statements are dependent on a GROUP BY clause

oh i try brb

the GROUP BY clause will tell the mysql engine to group records together with a similar ‘region’ field
so to say SUM(population) would add all the populatons together
)

it works!
thx

4 UTC last night? did somebody do a distributed dump of his database in

lol what?

)

HiJVLDRtdguDTHvQaFapcnrnWAxCVL cFnIVAHiNrOdvhkKZmaiSZiQnpdwVFEwarNZSOURocEbnHiGLkvetDP bvXZbuTgVbAnvGDhuveeUF bY

WGRerGAQwi LoPFFjEPoePDEvSvrPnb OnRtUnah CKRYRjoCd eeYwvhOFeyoUS DDjd bW IlPswvii xHNQfVAoiatJBJCUNDdn CaKYO StWmW

rofl

eFyF KeewuoelUAuuAedmeA iF TkDEJBWZwxDgOyI GkSED LyESLoFwjnJBG

did you base64 decode it?

hmm, it’s worth a try :p

ah

lol

thats why i reconnected

but i’m starving, have to eat something first

take his database

i wondered why my nick has chnged

hehe
i hope it’s the mysql.user :p

I really wanted a public source of example databases when I first got into sql
that’d be useful :p

haha

i recently did a google query of filetype:sql intext:INSERT
and found quite a few interest databases :p

but seriously, why would somebody do that? from dozens of different nicked that joined at the same time
is this some kind of new attack, for an exploit in windows products?

lol
in the text of irc clients

remember “startkeylogger” that made McAffee or forgotwhichone, crash

why can’t i use LIMIT in access ? zz

its not new

and yes, in the text of irc clients

flooding out irc users is the oldest trick in the book

linksys, the vxworks firmwares i think

but you mean it’s just a flood? nothing more to it?

^/exec -o cat /dev/unrandom :p

urandom

prolly

the jerks in efnet#cdc would always mock me and knock me off

typo

ah, less fun :/

haha /dev/unrandom, the most useful tool in a *nix scripters arsenol

what? it’s lots of fun :p

/dev/unrandom: No such file or directory

not on irc but
irl

:-(

you can crash ppl’s xterm with it
like “cat /dev/urandom | write [user] [tty]“
if you’re on a multiuser system, like at school

how to find the largest population in each region?

if they have mesg y, yes.

yes, but everybody has it by default

you nuke everyone around one region :-D
or everyone except…

select country from table where max(population) groupby region ?

otherwise you can write in the /dev/tty* if it’s not -w for you

How to repair a corrupted innodb file ?

repair table is only myisam?

nuke everyone around one region = group by?

i was thinking irl :P

max(population)

am I doomed ?

you never know how many are i asia :p

what is the expression to find largest number? max(x)?

y

yes
there are lots of neat GROUP BY funtions

select *,max(population) as maxpop from table order by maxpop desc; ?

Are you good with hexedit?

max, min, sum, ..

well…

uhm, nevermind

using unix terminal…

I don’t know any techniques for innodb repair though, do tell me if you find one though
im not an expert, just a user like you

Makes me think that innodb isn’t stable enough if it can’t be repaired !

well, how have you been able to break it?

I just copied the /usr/local/mysql/data from a server to another

Access denied for user ‘****’@'localhost’ (using password: NO), could anyone help?

wrong password ?

even if i attempt to modify with mysql –password
wont let me change
n e way to overrider

You can make a statement and save as a file, then you can run mysql with that file as startup BEFORE loading the other tables
then login with your new u/p and add your accout, then restart mysql

let me give it a shot….

same version of mysql?

yes

and exactly the same file?
Are you sure you havent corrupted the files in the transfer?
try md5 hashing on the file of the table and see if it’s the same on both hosts

no, because servers were down

aha

not very confident now with innodb…

I dont know any tricks sorry

looks like there is no trick at all

big table?

no, about 200Mb

i could try to hack it for you if its critical, but i guess you wouldnt want to give out your info
im always up for a challenge :P
info/data*

it’s a development source, then it’s not “important”, since I can use mysqldump on the other server without doing this raw copy… I really thank you for your offer.
Know that tool http://www.innodb.com/support/downloads ?

Havent tried it

anyone here use mysql for personal use?

yes, but i always wash my hands afterwards

Erm, potentially, yes

KDan , MarkR42; what do you do with it?

yep, i save every number that calls me in it, why ?

i don’t, actually. I just thought that was a good joke to make. I’m sure many people do though :-)

wondering. databases seem like a terribly useful way to expand your memory, so I wonder what people do with them if they use them personall

Ah, well I use them for a bunchload of stuff actually.

I use it as a back end for web applications I develop, not all of which have been for commercial purposes
I also “play” with mysql quite a lot

Everytime someone calls me on my cell, it shows up on xosd on my laptop, saves to database hosting and looks for the name of the person, if not it does a catalog search on internet and represent the name of the person on my screen

just for research purposes etc

i have a query on finding the largest population country in each region..
i tried SELECT name, region, max(population) FROM x GROUP BY region
but it says name is not included in aggregate
someting

That is right, you need to eithe ruse an aggregate function, or include it in GROUP BY

if i include name in the GROUP BY .. the result is not what expected..
i just need to find out the largest population from each region
the name

What is NAME then? Does it belong to regions?
Why do you need name at all? How can one region have several names?

name is the countrynames
oh each country name has a region

he wants the name of the country with the highest population by region
its terrible, but i think you could do SELECT name, region, population FROM x GROUP BY region WHERE population = MAX(population)

you can’t use aggregates like that
You can probably do it with a nasty subselect

ah that too

subselect..

could you do a join on the same table :p
you can do an in() function or something

ok quite confused.. i try the WHERE population = max(population)

I think a join on the same table may work
Or a join of a derived table with the same table

pretty confused

The problem I can see is if two regions have the same pop, they might both be returned even though you only want one per region

oh yah.. if two countries have same population on the same region..
properly i will display both
probably

so (SELECT region, MAX(population) GROUP BY region) gives you the max pop by region

MarkR42 yeah i got that one..

Maybe SELECT name, region, population FROM x INNER JOIN (SELECT region, MAX(population) as maxpop FROM x GROUP BY region) as maxpops ON maxpops.region = x.region AND maxpops.maxpop=x.population
Again, this is likely to give you several rows per region if they have the same population

:o that’s genius
I’m such a SQL newb.

the specified region could refer to more than one tables..?

Did that do what you wanted?

wasn’t my question.

Oh, did that do what dotz wanted?

probably

That is a derived table, not a lot of people realise you can use those

thats because it’s crazy

derived table aka “temporary view”
Derived tables are very useful

erm

sadly the way mysql implements them sometimes makes them inefficient

AND maxpops.maxpop=countrystat.population — is the maxpops.maxpop correct?
or does it got to be maxpops.maxpops

I called my derived table maxpops, and maxpop is a column name from it

so it should be maxpops.population ?

I’ve normally got tables with like 400M of data in them, and I begin to worry a little about efficiency
you can make SELECT queries with special names, like SELECT name AS foo, region AS bar FROM x; and it will create a temporary table with columns foo and bar
he made a subquery and named MAX(population) AS maxpop

ohhh found it

does the query work though

SELECT name, region, population FROM countrystat INNER JOIN (SELECT region, MAX(population) AS maxpop FROM countrystat GROUP BY region) AS maxpops ON maxpops.region = countrystat.region AND maxpops.maxpop=countrystat.population
that’s what i ran

it work?

the specific field ‘region’ could refer to more than one table in the FROM clause of your sql statement

put x.region then
I am assuming we are calling this table x
but I don’t recommend doing so in a production system

hmm my table name is countrystat

lol
had to keep that a trade secret
we understand, dotz

oh ok..shh

so I’ve usually got tables of data around 300M, referenced across tables around 20M, and I always worry that’ll be a 300M X 20M cross-product that I’m selectively selecting from, and I get the feeling it’s terrible inefficient
are JOINs more efficient somehow? I know production systems use datasets even larger, how do they do it and continue to have such low query times?

It’s all to do with how indexes are used

i think they pre-built indexes for the typical searches

If you have an index on the right columns, a join should be fast, particularly if you’re not returning very much
If you’re doing a straight join with some other where clauses, mysql typically tries to find the easiest thing it can do, and scans that index(e.g. it’s and equal or range scan), then retrieves those rows and will do an index lookup on the other table(s) it’s joining, easiest first
So if you have a zillion rows, but you’re doing WHERE some_fk_id = 42, then it will effecitvely just be doing a range scan on that index, which will allow it to find those rows quite quickly
Try using EXPLAIN some time
doing a full table scan on a 300M row table is going to take forever though (depends on how big the rows are really and how fast your IO is)
Although a join logically compares every row with every row, it doesn’t *actually* work like that
Or at least, not in most cases

but the fields need to be registered indexes for this behavior to work

Absolutely, you need the right indexes to do work on large tables efficiently
and of course, indexes use up space, slow down inserts etc,
and retrospectively creating them on large tables is very slllllllllllllllow

hi all
is there a way to increase the max size of a blob ?
now it does not allow me to store a file with 160k size

There are several sizes of blob, read the documentation
you can do an ALTER TABLE and make the blob column bigger

like blob(10000) ?
ah
LONGBLOB
i see

Yep.

im going crazy with that

alright im out

Hi all
Does the GPL allow MySQL to be redistributed with program y if program y’s sources are available?

hi all
starting with A.. B… C… and another nick starting with _ or – or | etc.. (non alphabetical character)
can I query THOSE non alphabetical ones ?

sure
select nick from nicknames where nick regexp “[^a-zA-Z]“

oh you can use regexp?! owww that’s cute!
that will bring the A…B…C… I will search the reverse one
which should bring non A.. B… C
anyway thank you I will search myself thanks for the tip

… under the same conditions as the GPL, yep
it the normal GPL + “GPL compatible license” combination. Not all OSI licenses are GPL compatible

what is the command to start my mysql server manually?

mysqld_safe, check the manual

the ^ in the regexp means ‘not’

http://www.gnu.org/licenses/gpl-faq.html#WhatDoesCompatMean

my bad I thought its ^ – start $ end
:o )

it is, but not in a [...] group

its inside the [] brackets

ok!

“CProgram Files\MySQL\MySQL Server 5.0\bin\mysqld”

it aint working

I’m trying to use a unix timestamp in one of the fields.
Is there a way to just update and select via a raw timestamp, or do you have to just use an integer?

I think there is a small problem with that “[^a-zA-Z]” say if I have a nickanem “Test5test”; it will go fit this condition

oh
then do “^[^a-zA-Z]“
will return all nicknames not starting with a-z or A-Z

right almost forgot about the ’start^’
hehe, I test..

so much to remember.
but that’s all there is to being a nerd.

ok seems to work perfectly
thank you again.

FROM_UNIXTIMESTAMP(…)

Thanks

hi
I have something funny in sorting table

Anyone here watch Flight of the Conchords?

It was #mysql’s in flight movie last night

oh my god I wish irc channels had in flight movies

I have table with movies and sorting this column, everything is ok, except one movie
Once Upon a Time in America
100 Girls
A Space Odyssey
I think db is sorting Once=1

which one are we watching tonight?

Was that actually a joke?
I hate it when I can’t tell the difference
It’s probably not Once with an “oh” but 0 “zero”

no I have paste it here
You can see it’s O not 0
and it’s not a joke
there was some space in front
but phpMyadmin didn’t show it

Comments off

i am a bit confused on the documentation on springlayout it says an edge can only have one spring but does that

On an unrelated note, I’m really puzzled by IDEA’s error messages. It seems to complain about all sorts of spurious compiler non-errors.

i’m sorry, but i don’t know about either
however, alphaomega_wrk , i don’t think that book will be helpful right ? the book page says it’s only for “Java/J2EE architects and developers who want to gain a deeper knowledge of the Spring Framework and use it effectively”

DaBonBon, download Mastering EJB 3.0 from TSS
take a look at it
and if you like it, buy it

but EJB is J2EE ? i mean, what exactly is J2EE ? a collection of technologies, like ajax ?
but EJB is J2EE ? i mean, what exactly is jboss j2ee ejb hosting ? a collection of technologies, like ajax ?

EJB is part of JEE

DaBonBon, forget about the title

?

just do what i told you
you won’t regret

sure
can you explain ?

The first snickering was at the comparison of JEE and AJAX, mainly because both annoy me. They’re rather different classes of irritation though.
The second snickering was at the notion that listening to andresgr is a good idea.

DaBonBon, now it’s time for you to make your decissions…

lol

your whole future will depend on this decission

Spring is a competitor of EJB ?

will you listen to DRMacIver and suffer years of pain?
or will you listen to me and become in the new Architect-Master-Of-Web-Services-And-SOA of the world?
:P

Editor does not contain a main type, what’s that?

Maybe there is a big hole in the market, somebody should write a JEE2 for Dummies explaining all the techniques, Spring in one chapter, explaining the IoC patterns etc, EJB in other chapters

andresgr, have you ever produce webservices with Axis ?

so the reader wil be jack of all trades but master of none !

Yes, and thats what you want, because then you can choose what you like best and master the thing you want to use

well, but is there such a book currently ?

chnarr, why do you ask? (yes)

I’d like my axis webservice to throw a NestableException from Apache commons, is there a way ?

i don’t have a clue dude…

cause I can only use javabean compliant custom Exceptions
never mind

i don’t
:P

tanks anyway :}

Not what I’m aware of, and I don’t really need it currently

all you need is online, use a printer
or try oreilly’s

You must define currentVersion in your POM., waht’s that

You are using Maven 2

no

yes
….where do you get this msg ?

i’m also getting “Editor does not contain a main type”
when I try to run the file that has main in it

IDE ?

eclipse

You must define currentVersion in your POM.” is typically Maven’s
is it runtime error msg ?

yeah, thats a Maven host issue

no it’s when I try to run ‘maven jumbojar’
that’s unrelated, but i want to get my class to compile
why is eclipse throwing this error?

so your using maven 1, thanks
anyway it doesn’t change a lot

I developed this project using jdk1.6 and deployed it on svn, now i’m trying to open it with a config of jdk1.4

tag

Does the main look like this? “public void main(String… args)”?

refer to Maven documentation on how to write project.xml

ok nevemrind, seems it works now.

using pointers with java is easy, download and install jPoint package v.0.5, it installs hooks that over rides the JVM’s handling on memory allocation, the syntax is different though, than c++.
not many know it’s around, it’s a young project.

hi all. is there sql host specification. if it is. where can i get it ?

let’s see
~sql

Zaph0d^, sql is Structured Query Language, a language for querying, updating and defining relational data and is used in most modern database systems. See JDBC for relevance to java.

hm.

google for jdbc

but i don’t need jdbc . i need sql spec

about wich database ?

~google raxelo sql specification ansi

I guess the factoid ‘transitioning’ might be appropriate:

sql commands change for each databsae.

Zaph0d^, transitioning is a stupid way of saying “moving”

All databases implement a part of the SQL 92 specification I guess. Plus SQL is a standard, not database specific.

~google sql+specification+ansi

I guess the factoid ‘the google principle’ might be appropriate:
questions that can easily be answered by googling deserve incorrect and/or misleading answers.

auch

since 92

all database implements SQL92 only in teory not in the fact.

A major part is implemented.

DELETE command change for each all.

is is like html with Navigators

WHERE on DATATIME field change
and so on

AFAIK, it is the same for MySQL, Oracle and MS SQL.

is not true
MSSQL does not support DELETE FROM

what ? if they’re sql92 compliant they’re sql92 compliant .. they may support alot of other prop. junk but thats it aint it ..

Oracle has functions like UNION and MINUS, not all databases have those

but as u like

I didn’t say it supported, I said they all supported ‘DELETE * from TABLE where SOMETHING;’

MS sql “SELECT TOP 10 ” does not exist on Oracle and MySLQ

SELECT TOP is not in the SQL 92 specification.

no MSSQL “DELETE * FROM ” GIVE ERROR

then top 10 aint sql92 i’d venture to speculate guestimate and conclude ….,,,,

actually, you could do “Select… limit 10″ in mysql

god

I know

SQL2003)

“”PostgreSQL is very close to SQL92 compliance

I am just saying that all databases implement a major subset of the SQL standard. Of course they are free to implement their own…..

(so not quite)

indeed they are and do .. and its our fault for using the “else they implement” and still think its write once run anywhere ..

max what are you trying to do?
limit skips in sql server?

fr example Application Server like Glassfish have more DatabaseEngine that depends on wich database use to store EJB, not only for driver to use.

to delete all rows

you can do that in oracle as well

got me interested, so here
http://64.233.183.104/search?q=cache:uKxAILFAFLoJ:www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt+SQL+92+ansi&hl=en&ct=clnk&cd=2&client=firefox-a
(it’s a google cache – the original page’s server host is not responding)

I’m explaing that raxelo have to tell us wich databse like use.

there should be a “strict” option on our bases ..

i mean. there must be some abstract spec for all databases – some minimum to implement

So How does EJB Container managed persistency work ??? does it use standard SQL which is to be recognized on every DB or what ?

Exactly.

indeed

do enterprises and companies today use J2EE ?

indeed

EJBContainer use specific sintax for each datbase.

so it’s pretty famous, CyTG ?

indeed

because alphaomega_wrk says that J2EE is dead but for springs

as jvm spec – general, but implemented by different companies

select top limit * from (select top skip from tablename order by id asc) as T order by id desc

some webframework spring hibernate

there is a minimum to implement if you want to say you support XXX (whatever XXX is). but no one say they do. they only support 90% of XXX

that does a limit skip in sql server

weblogic

Zaph0d^: i want to find XXX) )

what’s a web framework ? and which is the most widely used one ?

join #sql

im not the only one that says that

just pasted the link 20 lines in that way ^^^

fuck if i know .. i tend to be a backend guy

i am joined to java, linux, sql hosting and mysql, but none strict answer ))
Zaph0d^: thanks a lot

Still most used is Struts (but please don’t start there) others are JSF (Sun standard), Spring MVC, Struts2, Wicket, Tapestry, GWT

i found something here http://www.wiscorp.com/SQLStandards.html

~web frameworks

Nowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, Grails and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short introductions to each. Also see
http://java-source.net/open-source/web-frameworks for an exhaustive list.
Nowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, Grails and RIFE. See a href=”http://www.virtuas.com/articles/webframework-sweetspots.html”http://www.virtuas.com/articles/webframework-sweetspots.html/a for short introductions to each. Also see a href=”http://java-source.net/open-source/web-frameworks”http://java-source.net/open-source/web-frameworks/a for an exhaustive list.

is Grails a Java framework ?

rife .. heh .. griefe

Also try Matt Riable’s presentation on Web Frameworks, its pretty good

ruby on rails != web framework? or is that just a lit of java web frameworks?

Don’t forget, its a Javabot ;-)

ah i’ve heard lots about stripes

chnarr, yes, and very interesting one

so is there one obok or one tutorial that teaches it all .. Spring + Hibernate + some web framework ?

Zaph0d^: wow. thanks a lot. i missed your cached link. thanks !!!!!

You do? I never heard anybody using it. At work here we use JSF and MVC the most, now we’re going to do the first Wicket project

seriously though, I have no idea what’s the fuss about ruby and ruby on rails.

ask for popular tuts : try Java PetStore

so J2EE is basically Spring + Hibernate + some framework ?

Or Apache Tutorials

Zaph0d^: thanks !

wrong , but you can say Spring + Hibernate + some framework may be J2EE compliant

http://www.w3schools.com/sql/default.asp

ah i see

bbl

thanks a lot. Zaph0d^ helped with cached link above ^ . thanks a lot you too !
gnari from sql helped too with new spec http://www.wiscorp.com/sql_2003_standard.zip
thanks all ! good luck

IMO J2EE is nothing really, its just a fancy tag for using frameworks to make a webapplication currently (yes I know its not, sue me)

ouch i got disconnected
so is there one book which teaches it all ?

No, and there never will, there are just too many frameworks etc
But there are examples online that get you started up

hi all!

but something to get me started in j2ee .. i think after that i’ll learn spring etc on my own

Just start wiring everything together, start with Hibernate, add some Spring support and a web-framework (maybe even just JSP’s)
Probably best is just to read the seperate books/tutorials/websites

ok, but what tutorial do i start out with ?

Once you get familiar with what it all does you’ll figure it out
https://betterpetshop.dev.java.net/
http://code.google.com/p/projecttrack/

Petshop application using Tapestry, Spring and Hibernate

Just look at some examples, Hibernate website has examples, Spring has examples, and so do all the web frameworks
Those two are integrated examples, everything together

ah ok, so you suggest that i learn using examples and docs, not specifically books ?

I started reading Hibernate In Action to learn Hibernate
But examples made it much more clear

but hibernate still requires some previous knowledge right ?
hibernate is a persistence .. persistence of what ? :o

uh. java objects?
it’s an ORM. it does what every other ORM does.

Persistence of objects, if you have a Java object, something like a Person (with name etc) Hibernate helps you map it to a database

but .. well .. doesn’t serialization do just that ?

~orm

yoR, orm is Object Relational Mapping, see http://en.wikipedia.org/wiki/Object-relational_mapping

ah .. not to a database

But it is still possible to serialize objects to a blob wrapper in a DataBase, but its a bad Idea, though it works
:p

is it possible to subclass java.awt.Graphics?

Don’t give people BadIdeas(tm)

does anyone know about on device debugging with j2me?

in common architechture, a JavaBean correspond to a table in Database (for mast cases)

You mean on the handheld? I’ve done some debudding in the simulator

on a mobile phone itself. I cant figure out how to set the ODD up

So if you set a new value for one bean’s field, the change will be propagated to Database in the corresponding (mapped) table
so persistency is the way you manage this
sorry…but can you tell me why it is bad, to your opinion ?

hey. I need to add 3 jar files to my classpath to compile my program. How do i do this in linux? its simple in windows. anyone know?

You can’t search inside blobs in the database, using blobs is VERY slow (you can’t load just one because there is only a blob, not a key)

take care kids. Andres goes home

edit $CLASSPATH

ok, also isnt there an option with javac?

or java -classpath whatever….since it works the same on all os

ok so i sompile, then when i run it i incldue the classpath :-)

or javac -classpath whatever….since it works the same on all os

thanks

Its either java -cp of -classpath

for both java and javac

ty

~tell wij32 about classpath

wij32, The class path tells Java or the compiler in which jar files and folders to look for classes. Use the -cp/-classpath run-time options to specify the class path. Also see http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html and http://mindprod.com/jgloss/classpath.html#ANACHRONISM

~tell me about Grails

chnarr, I have no idea what Grails is.

~Grails

JLearn, I have no idea what Grails is.

Bleh

No so Intelligent
No Idea about it’s talking about

“Common sense is nothing more than a deposit of prejudices laid down by the mind before you reach eighteen.” – Einstein

No Idea about what it’s talking about*

what would you say is the best wysiwyg app out there
not talking eclipse or beans plugins

about programming ?

ok, thats done. one more thing. My code is fine on windows. now when i compile on linux, i have two Semantic errors. ‘no accessible method with signature :containts(java.lang.String) was found in java.lang.string

there’s no method containts()

my type thre. in the code it is contains(

maybe you should pastebin the *actual* error rather than retyping things

Wow, just found out SVN is case-insensative… never knew that

Is it the same JDK version ?

it doesn’t matter. *contains* has been there since 1.0

yeah its the same

yep, better pasting mesasges rather than retyping

yeah doing it now. 1 sec

we don’t know if you misspelled or not ?

http://pastebin/dd6a5bd0

especially because so many newbies assume they know what’s important and what we need to see so they cherry pick what to put in channel.
dammit!
cut and paste the url. quit retyping shit.

im having trouble copying and pasting with xterm. sorry./

what is the Class of a class?

what?
Class is a class.

lol
lo llol

obj.getClass().getClass().getClass() and so on

http://pastebin.com/dd6a5bd0

SomeClass, Class, Class, and so on

If implemented, the class object of the instance impl

~javadoc String.contains(*)

cheeser, please see java.lang.String.contains(java.lang.CharSequence): http://java.sun.com/javase/6/docs/api/java/lang/String.html#contains(java.lang.CharSequence)

thanks

what about the actual code
something’s not right in your code

what ?

~tell chnarr about show us

chnarr, Paste the code (and any errors) in the pastebin where we can see it. See ~pastebin for options.

~pastebin

http://rifers.org/paste

ehm cheeser dont you mean wij32 ?

yeeeah…to wij32
~tell wij32 about show us

wij32, Paste the code (and any errors) in the pastebin where we can see it. See ~pastebin for options.

sure. whatever.

http://pastebin.com/dd6a5bd0
oh and code.

that’s the same fucking url.

~cheeser

JLearn, cheeser is a crazy fella…. http://img523.imageshack.us/img523/941/cheeserjk7.png

~javabot

http://javachannel.net/wiki/pmwiki.php/FAQ/Javabot

with maven how can i say to include and exclude certain files when creating a certain jar

http://pastebin.com/m5f46b613

cheeser, you where wrong, contains method for String is since 1.5 :p

arg that will be it then.
java –versoin

seems logical

shit head

haha

when trying to compile the class helloWorld in helloWorld.java, i get: error: Class names, ‘helloWorld’, are only accepted if annotation processing is explicitly requested

put the command you’re using on the pastebin
~pastebin

http://pastebin.stonekeep.com

the command, or the code itself?

both
but the command especially

this.dfid = dfid;
loadData();
loadMessageDigests();
loadStorageDescriptions();
[B[C[D[B[D[B[Ca[C this.dfid = dfid;
loadData();
loadMessageDigests();
loadStorageDescriptions();

cheeser, http://pastebin.stonekeep.com/635

use "public class helloWorld { ... "
javac helloWorld.java
~tell asbo about coding conventions

asbo, coding conventions is http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html

why does it have to be public?

~public

cheeser, I have no idea what public is.

you suck

A tool is only as good as its user. Tool.

~accesscontrol

cheeser, access control is http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html

the short answer is, it just does.
read that link for the longer answer.

alright, thanks

"public" is not necessary though recommended.

for a "main" class, i think public is req'd

I guess the only requirement is that the main method should be public static void.
And accepting a String array.

but it lives in a class
and that class must be visible.
at least, iirc.

it compiled ok with the public
s/with/without

it'll compile, sure.
but will it blend? er, run?

aye.
shrug.

Yes, it will run.

do you have to be registered to join this channel?

yes
does that class actually compile?
the case is all wrong

yeah, i've been reprimanded already :p

system vs System?

System not system.

right, i had to correct that

how to make a bigger font for JOptionPane.showMessageDialog??
thx a bunch

i come from slacker languages like vb6 and php

hello there

hi

does anyone knows how to disable Java Derby DB startup at Sun Application server's startup?

you might try #glassfish, too.

;0340@80

glassfish is the opensourced SunAS, iirc
but i don't use either of those atm

So what is it Cheeser, JBoss :P
s/Cheeser/cheeser

~pastebin

http://papernapkin.org/pastebin

what is what?

I mean what you use if not Glassfish...

jetty, atm

~atm

chnarr, I have no idea what atm is.

at the moment

At the moment I gues

is jetty a webapp server ?

0 and it's an ivalid value, i don't know if it is clear but there are some method to avoid

thought it was a language

~jetty

cheeser, jetty is a java servlet server, found at http://jetty.mortbay.com

grat
great
As an opensource app server, I only know tomcat / JBoss

Any reason for picking Jetty over Tomcat?

we're embedding it.
jetty's easier for that.

tomcat sucks!

Sheesh.
Absolutists...

what about resin
(forgot Iknew resin)

Resin is an app server.

yeah

We were talking about just web containers.

ok

has anyone ever seen Sun's VM actually recover from an OOM?
either permgen or heap

pffff
~OOM

I guess the factoid 'cleanroom' might be appropriate:
chnarr, cleanroom is to write something without looking at the source of something else. There is also a zero-defect methodology with the same name.

oom = "out of memory"

ok

I'm pretty sure that if you get an OOME, your JVM is trashed

humm no, I think server restart is precognized

Permgen is so annoying, its clearly a bug in Suns VM, other VM's don't suffer from it (JRockit for example). So if you are using JBoss and deploy often, you'll surely get a permgen often...swicth the JVM to jrockit (or something else)

you're right and wrong

Explain

permgen leaks are usually the result of hanging on to a classloader reference longer than you should

The problem is really that the JVM doesn't have very good support for unloading of classes.

it will once that CL goes away.

so whether you're using jrockit or sun jvm, leaking classloaders will eat up your permgen

So it's very easy to create such leaks.

which is "never" in most cases.

Yeah, I'm not saying "You can't unload classes". I'm saying that the unloading of classes isn't very good.

agreed

and the #1 cause of that afaict is permanent static references to classes from other classloaders

it's the conservative nature of the VM
it also does release mem back to the OS once it has it.
which I really think it should.

No idea if the module system is going to make a difference to this. Probably not.

well, fragmentation is the issue in that case

no more so than any other application faces.

sun's jvm can't handle fragmentation within its pools iirc

Ok, but why does the Sun VM give permgen errors a lot and others won't?
Just because the fragmentation?

perhaps more aggressive collection of Class instances

Weird... I'll never inderstand it, but anyway, if you suffer from it, use jrockit, works like a charm ;-)

morning

An excellent article on Permgen. http://www.thesorensens.org/?p=14

hi
how do i pass a primitive type by reference, i can't wrap into a Double/Integer since these are immutable, so what's the best way to do this?

There is no pass by refernece in java. Its all pass by value.
Just return the modified number.
int i = modify(j);

well thing is, i want to return different types all at once
so, if i understand this correctly, if i have an object and pass it into a function, i create a copy of the object instead of just taking it's pointer/reference?

You pass the reference by value in Java.
So any changes made to the object are reflected in the original object if the object is not immutable.

isnt that the definition pass by reference? copying the reference over instead of the whole object?

you still around?

but there is no way, i can make a primitive into an reference type object and pass it by ref, other then create a dummy object for it, so i can change the values

torno

I need to add contrib non-free to my sources list for jdk1.5?

None I can think of at the moment.

that's a pity for such a "simple" thing

A real pity

which is the standard way to make an enterprise application execute some code at deploy to store some stuff in some global context like some configuration parameters?

init method of a Servlet...

pass-by-reference is often interpreted to mean that the called procedure can change the *variable* that was passed to it

What _exactly_ are you trying to achieve?

or with Spring

in Java this would mean that after foo(bar) returns, bar might have a different value than before the call - this is not the case even if bar is a reference variable

yeah, but i dont want to initialise these configuration parameter each time people call a servlet

it will refer to the same thing before and after the call, bu the thing it refers to might have changed

init method is called one and only one time

for each servlet?

...in servlets

init() runs only once. Only when the servlet is first loaded in memory. The consecutive client requests just spawn a new thread running the service method.

right

well, im trying to get something like this getFoo(double &a, int &d){ a = 10.0; d = 19; }

ok

where & means they should be references

but it is executed for each different servlet, right?
so i should deceide in which servlet init() method put my code?

a) pass in something you can change, or b) return a composite value

Once for each servlet.

ok

I think Spring framework let you define global properties also

I told him that. But his requirements are somewhat weird.

i want to change both a and b inside and both have different values and have to be used separately later on

Good morning

let suppose i have a class which parses a configuration ascii file. i would like to execute this class methods once for the whole application, and store my parameters in some global object reachable by every servlet

good evening
GRT +1
GMT +1
:p

wouldn't that make it afternoon?

nearly
yes actually

Morrowyn, redisgn that method or use a wrapper object for the 2 values depending on what exactly you are trying to accomplish..

very simple

well a and b need to be calculated, and i get them from 1 calculation, so calcing it twice is wasteful
hmmm, dummy class it is then

Write a servlet, declared in web.xml, then in int() method, do ...some code... then application.setAttribute(key,value);

then wrap them in a AB object ..

yeah, that was my fallback

oh..
thanks a lot!

im thinking thats about the only thing you can do about it..

Spring has full utilities to perform this nicely

application.setAttribute()?
is it a kind of context?

pretty annoying, to create simple datastructs for this basic thing, seems java wants you to put everything in classes
oh well

Morrowyn, ofc java wants you to put everything in classes

I think you shoud get an application object, which is yet default implmented in jsp's
must be similar in a servlet

let me see

my thought is that you are trying to create some sort of util method?

yeah, i now understand, but sometimes, having just data is nice, without the class

ok
i discovered i can set in the deployment descriptor some init parameter i'll get in servletconfig
is it right?

Yes. But ServletConfig is only for a particular servlet not teh entire application.

oh..

section in web.xml , isnt it?

.setAttribute(key,valuObject);

do this in your init() method

oh thanks!

retrieve it anywhere in your app with getServletContext().getAttribute(key) in a servlet, or application.getAttribute(key) in a jsp
just define your servlet properly in web.xml, nothing else

thanks! let's try..

you may call it YourAppInitServlet

hey guys, ok i have my classpath set and its calling the correc java file. It compiles correct. now when i run it i get the followng error:
http://pastebin.com/d975411a

you need a classpath set to run stuff, too.

oh right
so when i compile with javac i need -classapth and also when i run java i need to -classpath?

yep

I suppose this lib (commons-httpclient) is only required at runtime, thats while you compiled, but faild at runnning
wij32 ^^ thats what I told you : for both java and javac
but sometimes libs can be only required at runtime

yeah, it wouldnt compile unless i included them in the classpath.
'Exception in thread 'main' java.lang.NoClassDefFoundError: TestApp
TestApp is the name of the java file

dont forget comma

comma? after the jar includeS?

-classpath .:path-to-sources:somejars MyMainClass
comma if this is where your sources are

in maven how do i specify that when creating jar only to include certain class files and not others

ah thanks! working!
thanks all

maven 1 or 2 ?

2

in your dependency tag

i basically want to create a custom jar with certain class files and resources in it; it's partially working but all class files are included

well "scope" is the trick

i can paste my file if you want

oh for classes ??
make filters exclude...

yeah i.e. i only want the interface not implementation

In a J2ME application - is there a way to hold the internet connection open, rather than having to connect to the network everytime a request is made - Awfull behaivour if using GSM

http://rafb.net/p/r4fA8Q49.html
i already did excludes and includes but must be doing something wrong

anyone seen pr3d4t0r recently?

jtiner ---------------

good question

:p

what other irc network has a java channel

Maybe it's time to split into several modules

HAH! what a scrolly list that is

a client module and a service module

if you are around, hit me up

was that for me? I only have two files; one interface and one implementation

i haven't seen him for about 20 minutes

Narada:yes...or maybe there's a simple way...did you think about putting your impl class in test sources

no; because it isn't a test source

guys, I'm currently in mississippi using dial-up which maxes out @ 2.6kbps, i have no dev tools and a bunch of machines that need linux installed on them - i was wondering if someone could volunteer to help remedy this for a few bones in return
guys, I'm currently in mississippi using dial-up which maxes out @ 2.6kbps, i have no dev tools and a bunch of machines that need linux installed on them - i was wondering if someone could volunteer to help remedy this for a few bones in return
bguys, I'm currently in mississippi using dial-up which maxes out @ 2.6kbps, i have no dev tools and a bunch of machines that need linux installed on them - i was wondering if someone could volunteer to help remedy this for a few bones in return/b

Narada, I think I found it

awesome; let's hear it

use maven.jar.excludes
you know how ?

nope

in build / plugins / specify maven-jar plugin / properties / maven.jar.excludes = some classes ....
you get that don't you

How do you write file properties? (ie. the Author field on an mp3)

But I'm not sure, though its in Maven spirit

~tell mdkess about io

mdkess, io is http://java.sun.com/tutorial/essential/io

:F

trying now ...

anyone here used the httpclient from jakarta project before? Im wondering if i can supress the console messages it spurts out,its getting in way of data i actually want to see.

configure log4j

ty ^

log4j.properties
or maybe commons-logging.properties....or may it be as xml files also

is this via my code or from shell?

no...got it

I'm not following this IO stuff... I can't find anything about file properties.

now create a log4j.properties file, refer to documentation google, and put it in the classpath
file properties ??? do you mean properties file ?

I want to write an app to tag all of my mp3s.
I'm not sure how it's done.

OK
well Ithink it's part of mp3 format

Oh, damn. That'd probably make things more tricky, eh?

you'll have to write in files header, something like this
so for this , read in binary way, and work

clearly http://maven.apache.org/plugins/maven-jar-plugin/jar-mojo.html shows there is a parameter called excludes but where to specify it

try one thing, read first bytes as Strings and see what it's got, maybe you'll lurn some syntax to mp3 tags

Oh, good plan.
Thanks

welcome
first thing would be to open it with text editor, and see

how do you get when the [x] has been hit on a window? window events Closed and Closing trigger any time the window is destroied.

Or you could look up the MP3-format description/protocol, it should clearly state where what is in the file

expecting java to have mp3 tagging support built-in is a touch retarded.

no its not, Java pownz the world1111EXCLIMATION POINT EXCLIMATION POINT

you need help

!

*adds another tally under people to suggest help*
ofcourse i need help, thats why im here *points to my question above*
:P

the [x] on a window is a platform event, which IIRC triggers close window.
if you’re talking about a jframe.
also, you might try #swing.

… theres a seprate room for java gui?
that just seems slightly asanine to me.


well i’m sorry you feel that way. truly. hurts me deeply.
we shoudl reorganize the entire net JUST FO RYOU NOW!

dude, that would be hott. then i wouldent have to waste time with all the stupid crap.
better yet, why stop at the net?

lkike, oh, people who come on a large channel and criticize how it’s organized.
yeah, that woudl suck.

REORGANIZE THE WHOLE WORLD!!! BWAHAHAHAHAHAHA!!!

what’s the regex that doesn’t match the files which end with .txt extension?
that doesn’t match the files that don’t end with .txt extension?
sorry.

heh, though, i must agree, doing GUI is almost another language. :P

you mean matches everything except those files with a .txt extension?

hm “.*\\.txt” or something. Make a test harness to check.

hmm has noone built a custom jar with custom list of classes in there?
with maven i mean?

matches only files with extension .txt

ant buildfiles let you specify the contents of a jar file with rules.

mavis beakon?

in this case not using ant
heh

oh. okay *shrug* that’s what ant does
(amongst other things

ant++
maven–

JLearn, how can I negate it then?

I think I’ve gone insane o.O

really?
i guess it’s just a case of learning it; i’m fairly new to it

blah. BEA workshop doesn’t come with svn support built in

IDEA++
8^)=

heh
BEA seems pretty much in bed with eclipse.

which is too bad
but IDEA’s appserver support is quite good.
i got jboss running in no time and I’d never used jboss before.

which is the difference between getServletContext().getAttribute() and getServletContext.getInitParameter()?

ok, so some enlightenment on PermGen leaks with jbossas and Sun’s JVM vs. BEA’s

I guess init parameters specified in the XML file. attributes are the ones which you set in the application.

oh ok! thanks!

turns out that JBoss sends JMX notifications for certain ClassLoader situations

hey eidolon

yo.

Sun’s JVM buffers said JMX notifications, thus retaining the CL reference
other JMX implementations do not buffer, so don’t suffer

craptastic!
so we shouldn’t use sun’s JMX impl?

If Jetty was embeded into another server app and that server app had an active class running and you wanted to get information from that active class and you could modify both a jsp file and that running class, how would you figure out how to access information from the running class from the
JSP? (I know this may seem like an odd question)

no buffer, no suffer – that could be a campaign slogan
~tell Luke_S about javadoc Object.getClass()

Luke_S, please see java.lang.Object.getClass(): http://java.sun.com/javase/6/docs/api/java/lang/Object.html#getClass()

?

How about reversing the condition?

How do you guys work with sounds, do you load all soundfiles in one class or the ones you use to the current class you use them in?

~javadoc StringBuffer

stickto, please see java.lang.StringBuffer: http://java.sun.com/javase/6/docs/api/java/lang/StringBuffer.html

do someone know something about the latest version of JUnit?

like… what?
It’s version 4, wooo

junit.org

ok!
thank

what’s the regex for “doesn’t match the files that don’t end with .txt extension”
bwhat’s the regex for “doesn’t match the files that don’t end with .txt extension”/b

do you mean “matches the files that do end with .txt”?

yup

I have already posted that.

\.*(^\.txt) or something like that

use “.*\.txt$” I guess
there is a regex cheatsheet on www.javachannel.net

thanks it works

red-litchie: You don’t escape the first dot.
It stands for any character.

err, yeah, as I said “something like that”

i am a bit confused on the documentation on springlayout, it says an edge can only have one spring, but does that mean for example if i have two components and each of their north edges i put a spring to the north edge of the container that only one of those will stay?

no,I think it refers to something internally …
(the underlying implementation, if you were to directly make Springs, which I believe you can)
but I’m not 100% positive. However, I have used multiple constaints on an edge, so that can’t be it …

AMcBain, hmm, cause i am getting weird behavior and I thought that it might be that, but i guess ill experiment more
i don’t know then this is strange

weel, is something not sticking to what you think it should? Becuase an edge cannot have two *conflicting* constaints. (pulling the same edge east *and* west)
well*

i don’t think you can just throw in a bunch of links, even if they arn’t conflicting because i seem to add some things that shouldn’t effect other springs and it does

well, you need to sort out what you added and why, and comment them out one by one until you figure out the offender. Then work out why it breaks previous behavior.

anyone use statsvn here?

ill post it in just a bit, i am almost 100 percent positive there are no conflicting

hum. anyone know weblogics default admin password?

should be weblogic/weblogic, iirc

nope.

eidolon:

im lookin for some gui to start using java, can you recommend some?

admin/Britney

heh

(ok , jk)

~tell luisgrin about newbie ide

luisgrin, newbies shouldn’t use IDEs. http://weblogs.java.net/blog/editors/archives/2007/02/you_better_get.html and http://weblogs.java.net/blog/gsporar/archive/2007/02/tools_that_do_t.html

~tell luisgrin about netbeans

luisgrin, netbeans is a java ide with gui builder – http://www.netbeans.org/

see.

teralaser++

i really don’t agree with that newbie IDE thing

luisgrin, eclipse on netbeans are probably the 2 most popular ones

newbies shouldn’t use -overly complex- ides.

s/on/or/

ala, dont’ start with eclipse.

Soon I have to learn how to hand out real karma … you write ~teralaser++ , not just teralaser++ afaik
+you
blah.

OH!

~teralaser++

teralaser has a karma level of 19, JLearn

it worked. just… took an odd amount of time.

Here you go

woohoo! gg default passwords

thank a lot

thankau ! I choose to show my gratitude with a cute video of a hippo http://www.youtube.com/watch?v=G3NueKXS6dk (no not the singing one)

Hello. To write an xml file, should I create an XMLOutputFactory?

I tend to use jdom for outputting xml… but it’s been a while so I don’t recall the specific class I used

I use printwriter

jdom has a formatted output function that generates readable XML.

It is not easy to find tutorial on jaxp

you are hardcore :P

hi, have a couple of very simple java questions hope someone can help with. First must a class ALWAYS have a non parameterized constructor?

no

BAH
~weblogic–

weblogic has a karma level of -1, eidolon

http://pastebin.stonekeep.com/636

heh, what’d it do?

note line 5.

no

lol

thanks,

AMcBain, i beleive my suspision is right, check this out

so it can’t start the console without the admin-level user, and you can’t set the admin user without starting the server?

heh didnt know there was a console?

nonononon

if someone knows an up to date tutorial on xml with Java, I would be pleased

i’m annoyed at the URL format.
which is WRONG

and second, a derived class, must it have a constructor with the same parameters as the base class but call super(argn) or can you make it automatically call the bases constructor?

i have it up and running. that’s just ugly

oh, that
bah

AMcBain, http://rafb.net/p/2odgbE67.html uncomment the line and watch the effect!

pretty sure it’s not even valid

i’m tempted to just drop the JENA ear file into th deployment directory and watch things burn.

I’m filing a bug

AMcBain, because you add the link that is commented at the moment the previous is lost, thus the reason the first usernameField goes to zero, i beleive

see you later

AMcBain, not to mention that the username display space doesn’t strech to accomadate the password, even though there are no constraints on the left edges and the left edges of the container

they flip! heh, there has go to be a reason.

AMcBain, i believe it is what the docs say, only one spring per side

Why do file URIs on Unix start with “file://”, but on Windows they start with “file:” ?
Why do file URIs on Unix start with “file://”, but on Windows they start with “file:” ?

they start with file:// on windows too, or else they’re broken
I’ve seen e.g. file://Cfoo\bar

its file:// here atleast
on windows

I see no problem using the “negative trick” from last night …

Oh. Xalan is broken.

file:///c:/foo/bar
that’s what bilbo baggins hates!

well, I tried other lotr refrences, and Javabot only seems to hvae one for ‘ring’ and it’s not even close …

hmm. I assume BEA has a standard ‘drop ear files here to deploy’ dir? i’musing wlserver_10

dont be so sure
~SOA

jchauncey, SOA is http://java.sun.com/javaone/general_sessions5.html

that url is bad

see http://en.wikipedia.org/wiki/Service-oriented_architecture

~no, SOA is replysee http://en.wikipedia.org/wiki/Service-oriented_architecture

Okay, dmlloyd.

thanks
~SOA

see http://en.wikipedia.org/wiki/Service-oriented_architecture

mm. SOA.

my bureau cheif is on a SOA binge
imho it seems like a complete waste of time but im just a lowly programmer

just gotten into a project investigating SOA implementations
it’s interesting

BOOOMMMM!

ive seen no real world applications built using SOA yet, and the BEA guys that came to demo their stuff to us wouldnt show me any either.

“And now, we start working on porting a jboss application to weblogic.”

the possibilities sound cool
but it’ll take time to be any good

Oh, but it’s all standards compliant, so there should be no problems…

you definitely cannot be in any rush to use it

it’s a bad sign that BEA’s quickstart takes so long to start

Hello. “Javac -version” does not work. Did I something wrong?

haha

“And so it begins.” : http://pastebin.stonekeep.com/637

try “java -version”
not “Java”
bwahahahahaha

sorry “javac -version”

the logger is easy to fix.

at least that’s easy to fix

“java -version” works
thanks

Good lord.

see you

eh, i knew this pain was coming

I no longer have to use JBoss.

what i’m mostly worried about is how to make my, basically, standalong build.xml process work with bea and their workshop.

me either!

i could totally see us dropping jboss completely and going full time weblogic.

why?

no need to run jboss.
i picked it cuz it was free and available and the like
but there’s no reason to support 2 different platforms

weblogic costs money, use jetty or tomcat

tomcat++

or glassfish

our customers have PLENTY of money

so

heh, then so be it

should I uninstall Java 5 before installing java 6?

primary customer is in the fortune 100.
secondary customer is also

eidolon, so charge them money for YOUR services, not bea’s software

we do

more to it than that

charge more

fortune 100s tend to see jboss’ support structure for what it is

i’m a platform architect. i’m designing and researching, the folks i consult for are building the app on my design and selling / supporting it to said customers.

yeah, that redhat is a joke
whatever
youssef, if you need more hard drive space

your design, huh

yep

usually publically traded companies put in stupid requirements like “commercial software with commercial support”

I may have both installed?

youssef, sure

hey, cmon, i designed JENA.

jboss can be commerically supported

can I make java 6 the default compiler?

yes

what?
seriously, what’s up?

and their commercial support kinda sucks
nothing, just playing

k

how much support do you really need?

if you knew what he was doing, you wouldn’t ask that
a server is NOT the variable he wants to deal with

jottinger, fine. just playing devils advocate

well, in JBoss’ case, it’s the village idiot’s advocate

wow

harsh
CLANG
mood.

I need you to start asking me stuff all the time

eh?

Yeah, I can’t bill people without a reason

i can!

I guess I COULD but I would almost feel bad

heh. did you ever get around to invoicing ${client} ?

cashing checks helps

yes

only a year late?

something like that
shaddap, it started as a favor to someone

fire up azureus and oracle sqldevelor and amarok with it
and the beryl rain plugin

gah

you really hate your desktop, huh

it’s my windows machine. of course i hate it.

the JAAS callback mechanism was designed in such a way as to make it as difficult as possible to propagate callbacks across serialization
I like how all the callbacks implement Serializable – and yet, it still would be useless to serialize them

there’s a lot to be said for JAAS, hardly any of it good

heh

the older weblogic ide before they started using eclipse was an even bigger memory hog

i bet. the workshop stuff in eclipse is actually rather elegant.
at least, so far.

well, i should say “is a bigger memory hog” since I still use it

whaley, is it jbuilder-based?

no clue

i know there was some heavy jbuilder weblogic integeration a while back (before i started using eclipse webtools fulltime)

so here’s an interesting challenge. for jboss, for my log4j stuff, i do ‘import org.jboss.logging.Logger’. how do i make this portable… i suppose i’d need to have a Logger class available on the classpath in both environments, eh?

use logn!
or java.util.logging like you should have in the first place

O.o

if I have String.matches(“regex”); how do I make that regex ignore case?

there’s some reason i wasn’t ugin java.util.logging.

because older jbossas doesn’t support it

heh.
see?

it goes to stdout

stdout is oaky.

which then gets logged at INFO in the main server log

You need to use the Pattern and Matcher classes in this case.

or ERROR
I think it’s ERROR

I know how to use them, just hoped I could do it in one line.

*nod* i’m actually not worried about that. i’ll try and change a few classes to use java.util.logging and see if that helps in the transition.

at one point I wrote a little SAR that converts JUL into log4j calls
you may want to do the same
I wanted to get that into AS, but nobody listens to me at jboss

errrr. jul != log4j format?

yes, this is what I’m saying

you realise you could always write an org.jboss.logger.whatever package

oh i realize that.

or just use jboss common logging

i’d rather convert to something portable (JUL, say), port the entire app and settle in on weblogic, then redo it.

or sl4j, or commons-logging
or …

heheheh

I have just downloaded and installed java 6. But when I write “java -version”. It tells me that I have “1.5.0_08″

hmmmmmmmmm

~tell youssef about path

i think i ahve commons logging already.

youssef, path is the series of directories an enviroment searches to find an executable, such as the ‘java’ or ‘javac’ programs. To use a JDK, the JDK’s ‘bin’ directory needs to be on your operating system’s PATH.

Or run all three!

gotta run em all

thanks
I am using Ubuntu

try #ubuntu

thanks

it’s a distro issue, not a java issue

fwiw, i think you need to use the command update-java-alternatives
*i think* been a bit since I touched ubuntu

sounds like frickin pokemon.
“Gotta get ‘em all!”

that was the joke I was going for, yes

i wonder which is more efficient performance wise.. to have 20 simple ejb’s, or just one complicated one ?

yea that sounds like the problem.. didnt know about the update command though.. had to do it manually before… tnx

if this is, per user ?

one complicated one

i see

depends on what the ejbs are doing.
a lot of small ones lets the container manage them well.
and allows easier clustering.

for communicating with a client

is this a full ejb? or a servlet?

theres a non-full ejb’s too ? Interesting.

Some haven’t had enough to eat.

Indeed.
I havent ran into that distinction yet..

anyone know off the top of their head how much a simple one server weblogic install costs?

see you

$toomuch

hi

hello

~hi

Hello, dfr

duh
~tell msetim hi

tell nick about factoid – you missed out the ‘about’, dfr

. . .

How can I make java wait for a time ( sleep ) ?

sleep();

~javadoc Thread.sleep(*)

whaley, please see java.lang.Thread.sleep(long): http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#sleep(long)
whaley, please see java.lang.Thread.sleep(long, int): http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#sleep(long,%20int)

whaley, I will need use thread?

no …
it means the the current (default) thread will ’sleep’.

well, it’s a thread that does the sleeping…

dfr, I my case I would like to wait X time to continue the execution of my application

yes, so you tell your current thread to wait X time to continue the app
and that’s done via calling “sleep” on the current thread

dfr, ohh right :-D now make sense

what’s the use of a static class
?
a static inner class

so I guess the best way to facilitate remote client authentication with JAAS is to import a CallbackHandler from the client side, rather than exporting the Callback from the server side and reimporting them again
sleepster, you can make a static inner class private
static nested class
an inner class is, by definition, not static

but why would you want a static inner class
so that all instances of your outter class share it

you would want a static NESTED class in the case that you need to e.g. implement an interface, but you want the implementation to be private, AND you do not want the nested class to maintain an implicit reference to the enclosing class

static classes could access members of the enclosing class?

sure
given an instance of the enclosing class
iirc
mostly you go the other way around though

I use private static classes for cases where I want my private methods to have a complex return value
e.g. if i want to bundle an int and a float together

whaley so you wrap all your return values in that one inner class
object and return it

essentially yeah

but can’t you do that without being static
without making your inner class static

i suppose you could make it non static… but I can’t think of a good reason to

you can, but then the inner class maintains an implicit reference to the enclosing class

at least for the situation I described

so always go static unless you WANT that reference

hmmmmMMMmm
I guess I should stop being lazy and write my own goddamned manifest file

I did look at your code…
a few wishes…

I just moved that chooser to a private member, heh

1) if you send more fixes then send patches, 2) plese to use the same coding style and indentation

oh?
sorry

and do not let your ide auto-add javadoc that you do not fill in

oh yeah.

Do not let your IDE auto do anything.

why not?

Because all of my coworkers IDEs auto-do all sorts of stupid things, and it is driving me nuts today.

but since your fixes makes jsizer nicer on windows I have applied the fixes…

in that case I’ll do my all my refactorings manually.

^_^

Monday I’ll be okay.

it’s fine as long as you control your IDE… don’t let your IDE control you

lol
Thank you dmlloyd.
Alright.
Actually probably adding a splash screen would at least make it look nicer while it takes its time loading up, heh.
If I add taht i’ll make sure to do it properly.

sure…

hey g[r]eek you around?

i’ve done all of our java development in emacs. then we hired a new java guy, so i got shifted to firmware and kernel stuff. and he started doing things in eclipse. thankfully, he mysteriously stopped showing up one day before he had committed anything
IDEs can produce horrible code

i use eclispe and I don’t even know how to make it autogenerate code (outside of include method signature stubs when implementing interfaces, etc.)

well, i’ve used it to generate swing code, and that in particular was horrible. also, i don’t know how it would deal with tabs and line endings
i had visions of changelogs encompassing entire files

IDEs don’t produce much code

I think he works with me now. (:

ha why do you say that?

We’ve got a guy who uses Eclipse. He’ll commit changeets that all he did was let Eclipse reorder the import statements, and he’ll write a comment “cleaed up code.”

ha. ass.
probably not the same guy though. this was more my fear of things becoming messed up than it actually happening, since he was only here a few days

install some pre-commit hooks into your VCS that makes such things a non-problem

It is even worse when he actually changes one file, then commits 25 other files with import changes rearranged.

i think that was directed at me, but you are right
yeah, that is worse. i am a believer in small contained changesets

It still amazes me that soo few people have any pre-commit hooks…

in our case, we’re a very small company and it just hasn’t been necessary. the only thing i’ve added is a post hook for sending out emails

I have threatened to write some that validate spelling in javadoc and compile the whole codebase first so people couldn’t commit broken code. The threats were enough to solve the problem.
That, and if I did that, somebody would go crying to the boss, who would demand I turn it off.

http://www.khelekore.org/~robo/suck.pl == an old version of what we use at work…
(for .java files…
)

What a fucktard.
Does he at least use the eclipse code formatter or whatever?

if i were that person’s boss, i would give him a talking to. why put up with that crap?

1) you have to make sure that you can work on most of the code when you start using a pre-commit 2) if your boss tells you to turn it off again you need a new boss

Because the boss is an even bigger problem.

ah. understood.

You are right. I do need a new boss. I’m looking.

i would hate to work in that environment. hope it’s worth it for you

what region of the globe?

you aren’t in the boston area are you? :P

I feel your pain. I just wated the last hour and a half answering a shit load of questions from this one guy I work with.

er that was for apk

no, Stockholm, Sweden

ernimril thanks for the info though, heh

And everything he asked, I just opened up a javadoc and read to him what the javadoc said.

oh, well, time to do some other stuff, back in 1-1.5 hours…

*sigh*

were you obligated to answer his questions?

No, I actually avoided him all morning.
I kept saying, “Look I’m really busy. It’s all documented.”
And he just hung around my cubicle like a fucking lost puppy.

amazing, but retarded … I’m using mIRC on windows. How can someone possibly infect me with a trojan through mIRC? I have private chat, file transfers, etc. turned off.

Man. I wish I worked somewhere with documentation.

ugh. some people can’t take a hint.

No, he was askinga bout things that are documented in the java libarary.

unless there is a bug in it, i would say they could not

Oh. That is even worse.

The stuff he was asking about was from Javadocs on java.sun.com

unless you have like automatic link launching or something turned on

someone has the 1.6.0_02 jdk ?

ouch.

i would need the java -version output

… virus scan detected Trojan Horse Generic6.miw and Downloader.Agent.QMF

and *some* of my code is documented that he’s maintaining.
What he is maintaining, actually, I did take the time to javadoc.

what i love is finding “FIXME” in the code with no documentation as to what needs to be fixed. and the person who wrote it has no idea why it’s there

… they infected my mIRC scripts directory

which doesn’t inply the infection mechanism.

if I have a servlet in my WEB-INF/classes/DIR/foo.class, how do I declare that in my web.xml file so that I can execute it as server/servlets/DIR/foo?

servlet-mapping

well, for one, servlet context path has *no* relationship to package name

any more info on that somewhere?

servlet context path also has *no* relationship to class name

yes, the specification

if I understood the specs and such I wouldn’t be asking such silly questions, I know nothing about servlets, what’s a good tutorial?

there is a j2ee tutorial on java.sun.com

do people really think scsi is way to go for hdds?

depends

sata is an inexpensive alternative that is more than adequate in many cases

No, more like SAS

SCSI used to be cool…like 5 years ago.

like 15 years ago
or more

okay

scsi is old
still works though

wouldnt it be better to have a fiber san?

but in general it’s more expensive since you need more brains on the disk to use it
ubut in general it’s more expensive since you need more brains on the disk to use it/u
it totally, totally, totally depends on your requirements
there is no single measure of what storage technology is best overall

ug, here they have like 2 or 3 terabytes of space for all the dbs we maintain

then you probably want some kind of SAN

and they complian all the time about space

Fiber? Sure, if you want to run a separate infrastructure and can plunk down 5-6 figures no problem

EMC sells some lovely units

Even then, consider iSCSI

so does sun

iSCSI is one type of NAS – there’s others too, such as ATA over ethernet for example

Never heard of ATAoE

ATAoE is good
and cheap

..assuming 1Gb/sec is good enough for you
or, if you’re mr. moneybags, 10Gb/sec

can get multi-terabyte systems for sub100k
1Gb/s is faster than most scsi right?

I don’t remember anymore

according to the wikipedia entry 640 scsi is only 640mb/s

…per channel

ah yeah thats right

big storage arrays usually use fiber channel and stuff like that
but the individual disks each use scsi, for example
or sata, if it’s a cheaper one

SCSI’s being phased out to SAS

they wont order a server here without a scsi drive
a pos 1u rackmount here runs about 7k =\

yeesh, and I thought our prices were high

im going to mail the google paper about enterprise class hdds to all my bosses

iSCSI is the way to go
especially on gigE

iSCSI on GigE? Giggity giggity goo!

Awww right…

Hm
I need to distribute a native lib with my program, if it’s in the same directory as the jar file will that work?

svm_invictvs, you can organize it in packages

the dll/so files?

humm , i dont know. i meat class files

yeah

hehe, sr, meant

But I need the dll/.so files to be packaged with it.
oh my god
the same guy comes to my desk, “You need to help me find this code.”
I give him the class name
And he goes, “That doesnt’ help me.”

your choice as to whom it gets used on

~tell whaley about russian roulette

whaley, click

i can’t seem to find the right doctype line or dtd for and ejb3 deployment descriptor, could anybody point me in the right direction?

http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html

Comments off

Hey I have a confirmation page for a CMS and the edited content is shown in a readonly textarea I want an edit

553 ))

553 )) { result = “test”; } result;

test

is it possible (in firefox) to retrieve the last requestParameters (the ones used to retrieve the current page) ?

‘requestParameters’?

sorry, that’s java name for POST data
(or GET data)

There isn’t any way to access POST data from JS. You can parse document.location to get the query string data.
yup
Argh. Sorry, wrong channel.

i presume there is some firefox trick to retrieve them
for example, where you go Back from a data page to its form page
Firefox refills the form
and if you go to a data page, firefox proposes to repost the same parameters to the same URL

Yes

so i thiunk there is a hashMap somewhere

Not, AFAIK, accessible to JavaScript.

for security reasons, you think?

yeah, that’s the browsers cache

i am thinking about nice usage of getting the POSTDATA from the previous page, from javascript. hope i can find a way to get them.
someone proposed to install liveHttpHeaders, a firefox extension that plugs into the event system of javascript to log all headers
but it is very brutal, and intrusive on the user’s browser
(s/event system of javascript/event system of firefox/)

do you always need access to all POST data? Can’t you just include what you need via your server side processing?

i would like to avoid that
at all means

I’m curious as to what you’re actually doing with it. I’d generally consider POST data as something that’s used when processing a request, not on the client side
One solution would be to alter your response creation to automatically insert JS variables or hidden inputs containing all the POST data into the generated page before it is sent to the client

some data posted are useful for server processing, for sure, but most data are useful only to the javascript host in the next page. so sending this data is not needed, and requires “unnatural” code on the server

don’t you want to validate that data before you use it in the next page?

not on server side
server side should not know about that data
this is data that is not business related
so javascript validation is ok
on the next page
(if i can retrieve the POST data)
(from that next page)
http://www.boutell.com/newfaq/creating/scriptpass.html
a href=”http://www.boutell.com/newfaq/creating/scriptpass.html”http://www.boutell.com/newfaq/creating/scriptpass.html/a
my god, this is insane!!!

I dread to think what else apps which do this are doing on the client side
bI dread to think what else apps which do this are doing on the client side/b

gmail does that all the time )
“window.name made me rich!” (Sergey Brin)

Hey, I have a confirmation page for a CMS and the edited content is shown in a readonly textarea. I want an edit button that they can click, however, to get rid of the readonly. The name of the textarea is created dynamically, so I can’t reference that. However, I could give the form itself a
generic name. But, I think if the edit button is within the form, I wont need to do that. Any ideas?

var textareas = document.getElementsByTagName(“textarea”); for (var i=0, l=textareas.length; i l; i++) { textareas[i].readonly = false; } ?

thanks, insin

can’t you reuse the generated name when generating the page?

well, except the head of the document is included in the page via PHP

in body too – script type=”text/javascript”var textareaName = “php echo $textareaName; ?”;/script

yeah, I know. how would I use the other script you gave me though? should I put in a function?
input type=”button” value=”Edit” onclick=”textareas()” /

`js attachEvent

how would I do that?

`js addEvent

function addEvent(el,ev,fn){ if(el.addEventListener) el.addEventListener(ev,fn,false) else el.attachEvent(‘on’+ev, fn) }

… addEvent(document.getElementById(“editButton”), “click”, enableTextareas);

hi, i’m trying to get some regular expressions working i JS, but i can’t seem to mach anything over several lines.. /\{\|(.*?)\|\}/gm – should match a table in wikicode, but apparently it doesn’t work on several lines (even with the ‘m’ modifier)

anyone has good code for a right-click popup menu ?

var textareas =
document.getElementsByTagName(“textarea”);
for (var i=0, l=textareas.length; i l; i++){
textareas[i].readonly = false; }
function addEvent(el,ev,fn){
if(el.addEventListener)
el.addEventListener(ev,fn,false)
else el.attachEvent(‘on’+ev, fn) }
addEvent(document.getElementById(“editButton”), “click”, enableTextareas);
isn’t working

http://erxz.com/pb/javascript

sorry

that’s because you haven’t created an enableTextareas function

ok, where would I create that?
around the var textareas?
what do I put on the enableTextareas function?

hi. i have a long question:
i am programming a form for editing a object (with an one2many relationship) and all related objects. therefore i have added a link (which is now javascripted) to add forms in a dynamic ways, for creating new objects on the fly.

anyway to get get an onclick event to work on a disabled input?
I need a checkbox to look disabled but still be clickable

form.innerhtml = form.innerhtml + newformcode;

what do I put on the enableTextareas function?

now somebody (who knows something about computers) told me that it is rather bad to user innnerhtml. what is the best way(®) to do this?

you’re supposed to do it with DOM methods
that’s the “right” wway

Zaar-jobb: that means something like this: element_a.addnewEle(formexpansion)?

yeah

Zaar-jobb: great, thank you very much

np

im having some issues trying to change the class tag of a div using javascript.. i’ve read some references but i still cant seem to get it to work.. its returning no error, just not doing what i want it to.. here is a pastebin if anyone knows where im going wrong? http://pastebin.com/940569

The paste 940569 has been copied to http://erxz.com/pb/3385

or http://erxz.com/pb/3385 now :P

hummm
classObj.setAttribute(“class”, “nodiv”)?

className

i tried with setAttribute, it gives no error but doesnt do anything else :P
ahh i think perhaps my issue is with the css rather than the javascript.. ill head over to #css and try there, thanks

http://www.dynamicdrive.com/forums/showpost.php?p=98820&postcount=2 I’m having this issue.

Where can I use appendChild() from? From document.body or any div?

Any HTML Element node

And how to insert some paces or characters using appendChild or similar?

You create a text node, and then append that.

hello

in javascript?

We heard you the first time

hi

sorry
It’s my internet connection

ahh

yourOption.text = “blah”;

i’m newbie programer in javascript and i’m trying to lear how to use oop in javascript. after i create an object, create properties, assign them values, display them and delete the same object (a simple object) when i try to see if it exists instead of getting undefined the object continues
to exist. what i’m doing wrong?

thanks

example code?

can i put it on pastebin?
Sembiance ^^^
http://pastebin.ca/599907

The paste 599907 has been copied to http://erxz.com/pb/3386

and this is the sample xhtml code that runs it http://pastebin.ca/599909

The paste 599909 has been copied to http://erxz.com/pb/3387

hi. i have a simple function which appends a value to the query string of the current URL. http://pastebin.ca/599914

The paste 599914 has been copied to http://erxz.com/pb/3388

I advise creating new objects by doing: var newObject = {};

i see
and that will solve the issue?

probably won’t solve the issue.

how can i prevent the query string from growing each time this function is called? i.e strip out &perpage= each time the function is called?
uhow can i prevent the query string from growing each time this function is called? i.e strip out &perpage= each time the function is called?/u

So your complaining that after your delete statement you still see the data? And you expect undefined or something?

yeah
precisely
in the book that i’m using to learn and also on the websites they say that i should get undefined

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Operatorspecial_Operators:delete_Operator

oh
thx

var thing = {name: “Varga Levente”;} delete thing; thing;

Error: Error: missing } after property list at line 0: var thing = {name: “Varga Levente”;} delete thing; thing;

var thing = {name: “Varga Levente”}; delete thing; thing;

{ name: Varga Levente}

It explains why it might fail, and it also notes that it returns true or false, something you can check to see if it worked or not.

i see
ok
thnk you Sembiance

You have a few options. The quickest/hackest approach would be to look for &perpage= in the href and if it’s found modify it rather than appending

thank you very much Sembiance

something like if(url.indexOf(“perpage=”)!=-1) { var replaceReg = new RegExp(, “g”); url = url.replace(
that’s unfinished, you get the idea

Sembiance, ok that looks like what i need. thanks!

However I’d highly advise doing some more complex and appropiate HREF manipulation. splitting up teh query string, checking name value pairs, and replacing that way. Or using some other system to ‘keep track’ and ‘build’ the URL differently.

Sembiance, thanks i’ll look into that.

no need to fret too much about it, just get it working first then worry later about doing it a more ‘correct’ way

sembiance, i get error url.indexOf is not a function?

Anything VBScript JavaScript can do as well correct?

no, not everything

I am trying to control the values of a webpage created by my script using the IDflag and was wondering if javascript hosting can handle that

Hi, through XMLHttpRequest (or whatever Prototype’s Ajax call is) can file uploads be accepted? e.g. sending multipart data through Ajax (for uploading files)

XMLHttpRequest can’t be used to send files.

ah. so how is Google Pages able to send files without refreshing the page?
(in a file upload)

Probably uses an iframe.

Ah, okay. Is it considered bad practice to do so then?

Not really

Great. Thank you for your assistance Dorward

If I was trying to set a field of a webpage bu using it’s ID= would it break if the ID started aiwht an underscore?

an id can’t start with an underscore
http://www.w3.org/TR/html4/types.html#type-name

Well the company I work did

window.location = url; (something like that I forget the difference between .location and .location.href sometimes

hey stranger

Sembiane – whatever the difference is, it stops you doing an indexOf – it works with the href on the end.

Then its an error and you get to deal with browsers attempting (in different was) to compensate for the error. Fix the error instead.

I do not have access over the webpage itself

Then tell someone who does to fix it. Its broken and causing you problems.

Well I think they did it this way to break my tool

http://www.johnmurch.com/2007/07/01/iphone-javascript-and-spec-benchmark/

Hi all, if I’ve defined an associave array as an object such as myData = { “one” : {“type” : “text” , “value” : “Hello” }}
If the object for one is passed to another function, how can I retrieve the value one from the object?

how can I change the color of a button?

With the background-color CSS property.

ok
how do I know what the default color is?

You don’t. It depends on the browser and/or theme.

ok

you could do (for var key in obj) { var val = obj[key]; }

I need effect script for image appear from middle to left and right. is it possible?

http://developer.yahoo.com/yui/examples/animation/motion_by.html
http://developer.yahoo.com/yui/animation/ http://script.aculo.us/ etc. etc.

can you connect script.aculo.us demo?
my connection not working

tag?

why recurse when you cna iterate? while (el.firstChild) el.removeNode(el.firstChild)
*can

cool, thanks

i have a div onmouseover=”foobar();”/. how can foobar() access the event object?

what does firstChild do?
why did the for loop (iterate over all elements) not remove the elements of type option? I thought, compound elements are not removable by removeNode
aehm
I mean removeChild

how to load image host to memory, then appear quickly?

hello

you should assign event handlers via the DOM rather than inside of HTML. There is a way to do it within html but it’s not advised as it’s difficult to make work correctly cross-browser

before named TextArea. How to do it?

thx

hi. i am a js novice and need an advice. I have a form which i want expand dynamically.it consists of a list of tables, in which every table represents an object. with the click on a javascripted link i am sending a asynchrounes request to backend and receive an string (serialized with
simplejson), which i want to add to my form. Therefore i have created a table(with var ftable = document.createElement(“table”). Now want to append

my response string (which is just a string containg tablerows) into my ftable elment. Do I have to parse the string and have to append every single elemtnet(rows and cells) or is there something easier?

.

How do I make a dialog box saying “Do you want to continue? OK/Cancel” when clicking a link? Links to info will be appreciated

var where_to = confirm(“Do you want to continue? OK/Cancel”); if(where_to == true){ // user hit ok, do something } else { // user hit cancel, do something }

is it possible to run the javascript contained in a newly inserted innerHTML?

That’s not very accessible though. If the user has JS disabled, I want it to continue.
Without showing the dialog.
But if JS is enabled – show it and honor the user input.
I did a href=”gothere.htm” onclick=”confirm(‘Continue?’)”Go there/a, but I get to gothere.htm no matter what I choose.

js onafterupdate
`js onafterupdate
hehe

arex\: return confirm();

Sweet.
Thanks

onafterupdate doesn’t seem to work w/ iframe can somebody help?

what the hell is onafterupdate
looks like an IE6 only thing
If your doing data requests, I HIGHLY suggest using a JS lib so you don’t have to worry about cross-browser crap http://developer.yahoo.com/yui/connection/

i want to retrieve the current url of the iframe when you click on a link in iframe

a href=”#” onclick=”alert(window.location.href); return false;”gimmie url/a

not sure how that will work. i don’t have control over the href
i’m iframing another webpage

maybe try rephrasing the question?

i want to be able to fetch the current src of the iframe everytime it updates
sembiance, that’s not what i am looking for. thanks though

in the parent can’t you just do iframe.src ?
in terms of being notified when it changes.. hrm…

i’m having problem firing onchange event
sorry i worded it badly

use setInterval and check for url changes?

i could do that

somehow onchange never fires when you move to a new page :*

bummer

hey all, can anyone recommend a printed dom manual?
or reference even
any of the usual publishers got a dom reference?

try bookpool.com

cool cheers

I need to set the height of an element from something to nothing, what would be valid? element.style.height = ” or element.style.height = ‘none’ I’m not sure wich is valid, maybe there’s a better way, anyone?

just make it empty
i think
set it to “”

what do you mean by “nothing”? zero? default?

I myself set it to 0px but that’s just me

HTMLFormElements should have a .submit() method, right?

thanks, ddustin. i think the timer trick will do it since nothing else works

I’m looking for the default, ” works but I’m not sure if it’s gonna work in all browsers

http://developer.mozilla.org/en/docs/TalkOM:form.submit

ah maybe i’ll just print out my own

oh, I see, it has a height set, but you want to revert that back to having the browser figure it out

yep, maybe ‘auto’ will work.. testing that now

hhe default in ie is nothing

what’s the danny goodman book like?
javascript bible

according to online ‘auto’ is correct.

tnx, I’ll stick with auto, seems like the most valid one

hmm, so…yes. I wonder what’s up then, I have a form on the page named update_bug_form, and alert(document.update_bug_form); alerts HTMLFormElement, but document.update_bug_form.submit(); throws a “document.update_bug_form.submit is not a function”

is there a way to create and set an attribute
with one command

hehe
so it turns out that you can’t get the current url of an iframe :*
the browser prevents you from doing it

myObject.madeUpAttribute = “hello world”; ?

element.setAttribute(name, value);
that sets a property, but not an attribute

hehe
make a function dude

I’ve a css :hover that replace a background image, is there any way to preload the hover image with javascript? I’d also like that if js is disabled the hover works anyway just without the preload

give something that background all the time, not just on hover then the browser has to load it

I know, but I’ve no element I can apply that background

do you have an input called “submit”?

any File Dialog for choosing multiple files?

var preloadedImage = new Image(url);

is this enough? or I’ve also to use it in the onmouseover?

according to the HTML4 spec it’s already possible to select multiple files for a file input
though most browsers haven’t noticed

cheers

deltab omg!
i never noticed that

deltab, the form did. I worked around the issue anyway, the code was doing some sort of validation, checking the input from the validator then trying to submit the form via code. I just tweaked it so the function the onclick event called returned true if the fields checked out.

you can either add more file inputs automatically, or use a java servlet hosting applet (I think)

deltab do you mean most browsers do not support it?

yes

;/

use the form’s onsubmit instead

?

var tempImage = new Image(); tempImage.src=”/images/yourimage.gif”;
Or, actually, deltab’s is shorter.

ok

Image(url)

if it works

with this istruction the browser will preload the image, so when I use it with the :hover it doesn’t have to download it
right?

yes, if it’s cacheable

ok thanks

To make “bulletproof” :hover images, use background-position
IMHO.

another apporach is to put both normal and hover images into the same image, and display only the appropriate part

bulletproof, in terms of responsiveness.
That’s what I meant.

uhm
I didn’t thought of that method

http://alistapart.com/stories/rollovers/
http://alistapart.com/articles/sprites
http://alistapart.com/articles/slidingdoors2/

if i have two javascript libs

I’ll use the background position with a single image

and one has the same function as the other, can i wrap both of them in separate classes?

and I drop them from a sky scrapper at the same time

and just redefine all the calls?

which one will land first?
damn, too slow =P
ya sure
putting them into classes isn’t the easiest thing in the world though

is there something easier?
the thing is

I would just put them in a mock namespace

i dont even know what is causing the problem
i just know it breaks in IE when both libs are included
works in FF
so i cant find the problem

do the libs work seperately?

yep

what’s the error message

one sec

i have string ‘trtc…/trtr/tr’

well
IE doesnt even give an error the script just doesnt work right
but
firebug lite says “error”
and thats all
lol

and i want to create a dom element table from it.

do you know what function is failing?
or that its failing on the global scope?

tc?

im pretty sure I know which function it is but im not positive
the problem is, i stole the script from facebook and im trying to understand it all

use alert boxes, find out for sure

facebooks a good group
played poker with them once

yeah their autocompleter is the fastest ive seen
thats what i took, works well
except it doesnt like jquery

they seem pretty smart, although some of their UI choices don’t make sense to me

i have already added the string with innerhtml = innerhtml + mystring;
this worked, but i want to do it the “correct” way

well… I imagine it would be very hard to steal that sort of thing

actually
it was suprisingly easy
nearly copy and paste for FF
http://www.ameritime1.com/facebook/autocomplete.php

I would put alert messages everywhere, and try to figure out exactly whre its freaking out

yeah i did that last night, i think i know where its breaking but i’ll find out for sure later, bout to head out
try that link in FF and IE and see what happens foryou
if you figure anything out feel free to PM me

does facebook’s work in IE?

yes
it works for me too BUT
only if I dont include the jquery lib

it works great in IE6
gives a js error but runs fine

yeah jquery lib isnt included on that page yet
let me throw it in
now try
well shit i guess its not the jquery base lib lol
might be the interface addon
i think it iiiiiiis
yep
script type=”text/javascript” src=”/javascript/interface/source/iutil.js”/script
thats the file
haha

anyone know of a way to see where text gets wrapped in a line that is longer than the width of its container?
I need a javascript method to determine where text gets wrapped so I can add a physical br /

ouch
what if they resize their screen

haha, well the line break won’t be for layout purposes
as odd as that sounds

hey guys — i’d like to delay displaying an image that im loading via javascript until it is fully loaded. im loading it via var a = new Image() and a.sr = path. is there any way to know when it’s fully loaded, so i can change the display style of its container?

in IE, if css class A has border:1px solid blue, and I take an element of class A and set its border via style.border=”1px solid green”, I can’t reset it with border=”". I can in mozilla, but in IE, it sets things like border-width and border-color to the defaults for me (0 and black)
is there another way to reset a border style via js?
(in ie)

Sembiance, so do you know if that’s possible to do?

try “auto”

don’t images have an onload event that you can listen for?

i guess thats my question

Yes, they do.

BradleyB : cool thanks guys

yes, it’s possible, but I’m still a little unsure of ‘exactly’ what your after

understandable

a.oncomplete I believe

i’ll try that thanks

I think you’ve just made my day

:P

essentially, I’m creating a text artwork generator, and the container for the text is about 75px wide. So if the text is longer than that, it will wrap. What I want to do is take that text (which was entered via a textarea) and send it to a processor on the server, that will take the text and
put it in an image. However, I want to send it with the line breaks after the last word on each line. Does that make any bit of sense?

I think that whatever is processing the image should be determining where the text wraps

nope, doesn’t work that way (for whatever reason)

because if the user has their font sizes turned up, in the browser the text might look like it should wrap, but when you process it on the server at whatever your font size is, it will not wrap

the image host processor I am using does not have a wrapping feature, and my implementation is buggy
if I can send hard breaks, it would be better

well, you can try and do it in javascript, but like I said it will be very flawed if the user has an unusual scren or font config, however-

but I need to use javascript to get those breaks from the rendered text
I agree, it will be flawed, but it will be less flawed :P

I have a window object that is opened after the page loads, when i do alert(this) it says [window Object] however this.id is null – basically i want to find a way of referencing this window from a oXmlHttp.onreadystatechange function { .. } – how would i do this?

the browser is not designed to care where the text wraps, or make that information available to the developer, because most of the time it’s irrelevant (since the browser can resize at any time) and it’s not clear what you’d use that information for. To implement something like that I think
you’d need to do some impressive hackery using the browser’s range API (completely different for IE and mozilla) and move the text cursor charact
and thus, a line break

also, I am dynamically changing font sizes on the fly, so wouldn’t that bypass font settings?

no

uncaught exception: Permission denied to call method XMLDocument.load

the font size is relative to whatever you set it. So if they have 20% bigger, when you set it to 100%, they will have it at 120%

I am using px not %

yeah but browsers scale px as well
it doesn’t make much sense to do that, but usually it’s what the user wants, since everyone uses px to size fonts and the user just generally wants them bigger and more readable
you can get around that by dynamically making the textarea bigger, relative to their font sizes. It won’t be precise but it will be more accurate
I would care less about the font-size problem and more about finding the line break

I’d really have to program this app with flash to avoid any of that… but I’m not gonna bother with that.

using the strategy I outlined above. That is not trivial to code, so if you’re not sure about it after an hour or two of reading you might need to find someone to hack it

window.length is null, how would i reference a window object when i don’t control how it’s created?

Mace[away]: I think for security reasons, you can’t

it’s an iframe, but frames.length is null

ok, so the simple answer is, I cannot easily figure out where text wraps within a DIV, correct?

Mace[away]: if it’s an iframe, it should be somewhere in your document. document.getElementsByTagName(“iframe”)[0]

just wondered if there was such a function, that’s all… back to the drawing board I suppose

yes, unless someone has a simpler hack, but I don’t think one exists. I think most people would say it’s not even possible, but it is

yeah, I’m really looking for the simplest solution

yeah unless you’re a js ninja, or are willing to pay someone a decent chunk of change for it, I’d go the “correctly designed” way and try and get it done in the back end

haha
no ninja here
yeah, I’ll figet with the backend some more… I was getting some decent results there
it really does come down to font sizes though… the browser fonts are a bit smaller than the font sizes in GD (the image processor) and so my text in the image is wrapping prematurely, hehe

I have a need of reading language in .JS file.
How to get meta content-language value?

thanks

how do I test whether a text field has a maxlength already set?

if(myTextField.maxlength) {

- how to get CONTENT value using JS?

by trial and error I arrived to element.maxLength == -1

-1? Really? Interesting
document.getElementsByTagName(“meta”)[0].content

I played around with Firebugs’s console

Assuming it’s the first one… change 0 to the appropriate index otherwise

I don’t know if it’s the second one because someone can make some changes in code (it’s a CMS) :/

Then loop through them looking for one with .httpEquiv === “Content-Language”

or there is better method for getting the language, i don’t know

No, I don’t think so

or any variable in JS which contain used language?

But, you’re ignoring the fact that the HTTP header will override the meta
Not AFAIK.

Oh well.
That entrance didn’t go quite as I’d imagined.

Sorry, lag

Nnngh.
So, tweyster.

Jan`: I clapped and cheered and threw you a flower, I don’t know if you got that

SHE GOT IT
ALL
NIGHT

If opensource software is so fantastically perfect, why does mplayer suck like a sludge-gulper?

Jan`: The vast majority of opensource software has some severe suckiness.

Jan`: You were praising it a moment ago

Ascript’
* Set by Woosta on Wed Feb 14 05:12:05
* Jan` wanders into the channel looking utterly fabulous

Jan`: However in general the world is much better off because of open source

It’s almost as if most opensource software doesn’t have any sort of properly managed conformance test procedure.
Oh.
Yeah.
what?

I have a feeling you’re about to go on a “who needs freedoms anyway” rant
uI have a feeling you’re about to go on a “who needs freedoms anyway” rant /u

….me? How dare you!

&=? What language is that?Heh
Errr
Minus the leftover sentence.

But anyway.
If I play back an AVI which has RGB data in it, then I play back a Quicktime movie which has YUV data in it, would you expect it to glitch between files?

Yes

Jan`: It’s more like “most software has no conformance tests”
Or really any tests.

Quitit, buu.
There is no “stop” command for mplayer.

Heh

You just load another file.

There really is a stop command.

If you do that when decoding a big complicated file like a 1920×1080 H.264 Quicktime, it takes AGES.

But I just C-c

Anyway we conclude that -fixed-vo, which is supposed to, you know, fix the video output, is b0rk3d in directx.
This sucks.
The only guy who can fix it hasn’t done any work on it for months.
I am, how you say in the eengleesh, fucked.

lol

You said that headers can overwrite meta. Is it often event?

tag of the same name

value will be not touched?

can I include more than one javascript in a html

No, but it won’t be accurate

fyi element.border=”auto” didn’t work in IE
looks like I’ll have to set each border property (bordeLeftWidth, borderLeftStyle, …) to “” to reset the changes I’ve made using element.style.border

?

No

i think yes

innerHTML doesn’t work

you have to open the iframe now – document.open()

who is correct?

Wysiwygs works using iframes so it’s possible

Why would you want to?

yes
you have to modify the iframe element after it’s been loaded

http://www.mozilla.org/editor/midas-spec.html

Twey i want to show an iframe with content but the content is so little that i don’t want to draft a new page with a new link

so listen for the iframe’s load event, then start changing its html via iframeElement.contentWindow.document.body.innerHTML=”…”

philc modify it?

So why an iframe?

would be much better

Wow, two standards violations in one statement

standards

philc omg, great. thanks

would be better. but i need to make a asynchronous upload script to i need to use iframe

1) It’ll only work if the iframe’s src is on your domain
2) innerHTML is bad

incorrect

Why is innerHTML bad? :o

You can’t touch a document on a different domain

that will work if the iframe’s src is about:blank as well (meaning no src attribute)

It’s non-standard, misrepresents the DOM, drops non-textual properties from elements, and often recreates elements needlessly
Oh, and doesn’t work in XHTML

and it’s fast ;-)

and document.write?

mplayer tells me that this file is 30.00 seconds long, which I know to be correct because Phil made it.
However, it runs out at 29 seconds.

Also shouldn’t work in XHTML

So only createElement etc.? :o

Jan`: How are you determining ‘runs out’ ?

ANS_VIDEO_CODEC=’0×00000000′

Jan`: no such channel

heh…i think i am still not yet on the level on using createElements and appendChild instead of innerHTML

Jan`: try: #help
and ask for a good channel

And why does it give different answers to ‘GET_VIDEO_CODEC’ and ‘GET_PROPERTY video_codec’?

Jan`: Because jesus hates you.

there’s no “level” difference. One is writing your html with a string, another is calling a few methods
each has its own advantages

buu; Well, I hate him.

Jan`: That explains a lot.

You used small letter :/

For example
ANS_VIDEO_BITRATE=’1620 kbps’
ANS_video_bitrate=207360

What?
207360/1024

202.5

I CONCUR.

Yeah, you should use capital letters for proper nouns like “Jesus”, even when it’s a fictional character.
Like “Jesus”.

Jan`: why do you think – fictional?

Jan`: I was talking about the mexican down the street.

No no, there’s Archeological Evidence. Found by Scientists.

Bollocks.

Still needs to be a capital

Even more bollocks than the bollocks mplayer is giving me.
And that’s some seriously virile bullock’s bollocks.
ANS_video_bitrate=207360 versus ANS_VIDEO_BITRATE=’1620 kbps’

Jan`: I think you should probably just give up and get a refund.
Jan`: Also, go bother ##mplayer, they’ll love it.

hey everyone

Hi MONO`

philc yeah. I tried and I gave up.

I’m not asking them to be perfect, but you’d expect them to be able to COUNT.

I don’t.
As a general idea.
Jan`: Do you listen to any decent music?

Aaargh! ANS_AUDIO_BITRATE=’1536 kbps’ and ANS_audio_bitrate=192000
Whatthebloodyhell?!
Who do I believe?

Jan`: Surely’ there’s a reason fo rthat.

Gigantic programmer incompetence?

Jan`: It’s in the mplayer-candlemark.

Ahahaha outta here already

192000 bits per mplayer-candlemark.

peace

‘Bye

Aaah! Aaah! ANS_width=576, ANS_height=720
They have the sodding width and height backwards!
MnnnnannaaaaaarghghhjhhjrjhhjrjhjrhJRHG*@!

Jan`: so reverse them in your code

MONO`|neighbors: But… but… but… but…

but it’s the best work around unless you want to recode the entire thing yourself

This piece of software sucks like QUICKSAND!
And not that wimpy realistic quicksand! Scary sucky quicksand like in the movies!

haha
you mean like the opposite of my guitar amp on full volume? *evil grin*

Oh, oh, and look, they’ve defined frame rate (invariably one of about six values) as a Mundo Extra Precision Super Float.

yea i’m out of here
bye

ANS_fps=25.0000000000000000

LMAO! why not just ANS_fps=25
?

No? Really? YOU THINK?

aw screw it
hi Jan_trailer
=]
aha i’m out for real not
*now
bye

which Content-Language.

*om*

are there number format methods for ints?
var n = 4; n.toDigits(2); ?

there are ways to do it but I can never remember

Creating in PHP is easier. I think if i shouldn’t create the editor using PHP.

Woosta would know, but it’s night-time in the Sudtenland

However, creating editor using only JS will save server time.

Also, JS is lovely and beautiful.
And PHP is tooth-rottingly ugly and hideous.

but how to put code inside head?

but it’s impossible because FF deleted some of them

Any methods for getting the language in JS only?

SettlerX you can loop document.getElementsByTagName(‘meta’) and check get the language

doesn’t already exist.

you said get

Firefox deleted that meta

firefox doesnt delete meta tags afaik

You can see it in Firebug.

tags from rather 5 exists…

*exist

maybe your meta tag is not properly formatted r something

or wait – maybe i looked to another file

lol

useful?

well its good for the search engines

and what about Header() and can JS read it?
or html lang=”en”

document.getElementsByTagName(‘header’)[0]
same with html iirc

I mean Headers instead of head

not really, http://www.thescripts.com/forum/thread91236.html is a good thread about it

hey everyone

MONO`: hey MONO`

what’s up?

nothing, you?
I’m eager to get home to continue working on my project

well…. i had my music loud enough to be heard from half a mile away

Hi. Does JS have a function for adding slashes, like PHP’s addslashes?

and in the process set off 13 car alarms .

Found the answer myself. http://javascript.about.com/library/bladdslash.htm

wow that code makes no sense to me lol

MONO`,lol

hm…
i wonder how many of these adapters i need to make those other speakers hook up to this computer….
i wonder how many of these adapters i need to make those other speakers hook up to this computer….

how can I include one .js file in another?

Have one generate a script element in the HTML document

additionally to the script element already written in the html?

Yes

ok

hi
how can I access the last value of an array?
without actually removing it
does arr[arr.length] work if it’s non-sequential?

length-1 ?
if it’s non-sequential, how is it to know what you think is last?

hmm
ah, sorry
I have been dumb

does [-1] work in JS?

maybe if you explicitly put something there, dunno, I’ve never tried it

hm… what are you expecting that to do?
ary[ary.size - 1] ?

anyone want to see a guitar pick that a dog chewed the heck out of? =p

in some languages negative indeces return array elements counting backwards. i was just asking if JS does the same

not that I’m aware of
its possible -1 is a valid index though

so that a[-1] is the same as a[a.length]

probably the same as doing var obj = new Object(); obj["-1"]

sorry a[a.length -1]

yeah I don’t think that’s going to happen

axolx_ – what are you trying to do?

not trying to do anything specific, just curious whether js syntax supports negative indeces in arrays

Anyone working on anything exciting?!

kinda

MONO`: URL?

http://rockermono.unixpod.com
click log in as guest

MONO`: cooll. whats it for?

it does for the slice method

hm, have you figured out what negative indecies do yet?

nothing in FFox’s implementation

dunno…that’s what you get when i get bored

MONO`: it’s pretty impressive. did you build it all from scratch?

i used wz_dragdrop and i started with a tutorial on floating windows thingies but rebuilt it
i’m not even sure what to call those cuz they aren’t really windows

yup, firefox treats it like a hash key
that’s what I figured

hey DDustin, did you get any errors in IE from that page earlier?

ary[-1] = 5; ary["-1"] == 5
I forgot
that was long time ago :P

haha

MONO`: Interesting

can you check real quick, just trying to find the right function
http://www.ameritime1.com/facebook/autocomplete.php

you like it?

here’s my test:

” + ary[key]);

er, also I did ary[-1] = 666;
console.log(ary) comes out as: [5, 55, 555]

hello, i am trying to track down a bug with firebug. but the error disappears too quickly from the console. is there a way to look at the console history or another way to see the error message without adding an alert() to the javascript code?

666

MONO`: It’s not bad. I was surprised to see that it worked perfectly in both Firefox and Opera 9. I was more surprised to see that it worked better in IE6 than it does in IE7

so its literaly stored as “-1″
IE5 freaks out

right. that sucks

MONO`: Even works good in Safari

Break on all errors

MONO`: screw os X. im going to switch to MONO OS

it straight dies in IE7 lol

seems to work in IE6

thank you

^- best song ever

that didn’t work

brb

MONO`: So from what I can tell… FF/Opera9/Safari – 100% Konqueror – 90% IE6 – 70% IE7 – 30%

shouldn’t dustin hit refresh

MONO`: Still though, you must be having one heck of a fun time coding
I’m not ready to show my project that I’ve been working on. I’m super excited about it, but I have a lot more polishing to do

found the problem DDustin
[].indexOf || (Array.prototype.indexOf = function(v, n){
n = (n == null) ? 0 : n;
var m = this.length;
for (var i=n; im; i++)
if (this[i] == v)
return i;
return -1;
});
took that out and it works… must beconfliciting with index of in my other lib

back

i bet that one has a prototype for it too

hehe, I never trust indexOf to be available for arrays, I rolled my own.
uhehe, I never trust indexOf to be available for arrays, I rolled my own./u

WOOHOO!
xD

Don’t paste!

pastbin

IE’s javascript parser I’ve seen freak out a few times on complicate syntax involving functions
does putting it in a proper if block make it work?
if(Array.indexOf) would probably be a bit quicker too wouldn’t it?
[].indexOf will likely create an actual array object

http://erik.eae.net/playground/arrayextras/arrayextras.js

thats from the jquery interface iutil helper
let me try putting Array instead

yea it’s taken quite a while to get that done

shit yeah i think that fixed it
nope
didnt hah

screw MONO OS – just make it MONOS =p

im trying to understand what prototyping does
does it change what a function does?

when an object is created
the prototype attribute is moved into the actual object itself
its kind of like declaring methods in a class
they don’t really “exist” until there’s an object, but you still want to define them

so kidna of like rewriting the function for a particular object (or group of objects)

its more like a ‘default’ function

so that code i jsut pasted
changes Array.indexOf to that code
instead of the default code

it checks if the array object has an indexOf function
if it doesn’t, it defines a default

if it does, is that skipped?
yeah because of the if check huh

there’s nothing stopping you from doing a var ary = new Array(); ary.indexOf = new Function(“HACK!”);
I really am not explaing it very well…
do you know any other languages?

not any big OO languages
i learn as i go
started with html, then php, now javascript

do you get the basics of OO?

for the most part
not completely

well Array is a type that maintains many functions
that type can be ‘instanciated’ to make objects
your code adds a function to the list of functions (and attributes) maintained by the Array type
in laymans terms

oh so if you prototype Array.prototype.something = function () {}
then you can call myArray.something

precisely

woohoo
see i learn quickly

so lets say you wanted to do….
Array.prototype.allEvens = function { … return even indecies … };
you could now do
var ary = [ 1, 2, 3, 4, 5, 6, 7 ]; var evens = ary.allEvens();
and evens would now contain [ 2, 4, 6 ]

nice
learned something today

learning is good

yep

I like the way javascript does it
its kind of fun

which was hello world in C++

C++ is a huge beast of a language

yeah i dont really need to use it so i never learned it

strict typing can make life very difficult

im sure it would help
but i only learn what i need

I use it cause of its speed
and C feels too limited for me

i dont ever make software outside the browser
yet…

javascript can do some very fun things

can you check an object to see if a function is defined?

yup

whats the proper code for htat

well it depends on if you want to check the ‘type’ or the actual ‘object’

ummmm

think of the ‘type’ as the DNA for an object

i just want to check to see if its defined and if not define it

var o = {someFunc: function() {}}; typeof(o.someFunc);

function

do you want to modify the DNA or this type of object? or just a single object?

DNA

navigator

Error: Error: ReferenceError: navigator is not defined at line 0: (null)

how can I say if ‘argument’ is not equal to a nodetype of 1

jseval var o = {}; o.prototype.someFunc = function() {}; typeof(o.prototype.someFunc);

then you use prototype.name

Error: Error: missing formal parameter at line 0: var o = {}; o.prototype.someFunc = function(

throwing it in an if block is a 99% way to check
if(!Array.prototype.allEvens) { …. define allEvens function …. }

alright lets say we were using the indexOf function
its predefined by some browsers
will Array.prototype.indexOf return false even if the browser defined it
?

never

sweet

to be honest, Array.prototype.indexOf won’t be false though
it’ll likely be ‘undefined’ or possibly ‘null’
if you do if(!Array.prototype.indexOf) however, all those conditions will fall into it
which is what you really want

so all of those conditions fail in an if statement?

how can I say if ‘argument’ is not equal to a nodetype of 1
sorry for spam, last time.

yes sir

sweet
i love programming
hah

me too mad
man *

finally got it all working
thanks facebook

you mean the argument keyword?
argument is an array, its not going to equal anything

i’m passing a function two arguments, the first one is ‘div’ and I want the function just to check and make sure that it’s an element

node-type of 1? what are you trying to say here

that’s arguments, and it’s not a keyword

node.nodeName == “div”

it might now always be div

might want to do a node.nodeName.toLower() == “div”

if (typeOf(div) != 1) ?

typeof(div) will give you object
pretty useless

no, because it might be span, or h1 or whatever

ah

what do you want to check for then?
that it’s a DOM node?

trying to keep it as abstract as possible.

yeah facebook is a fun crowd
smart guys there

that’s it’s an element node

uh well.. I don’t see why you’d want to check for that
but I would do

that way if they just pass ‘blah’ it will return.

function foo(arg1) { if(!arg1["nodeName"]) return YOUFAILIT; }
where nodeName is the actual string ‘nodeName’

thanks DDustin.

if it were me I would just make a note in comments by the function header to just pass html elements
just cause it’s a simplier and more expected solution

thanks Ddustin, I’ll do both.

is there a way to make SVG files viewable crossbrowser (specifically ie6)?

SVG files?
why don’t you just do gif or png
or jpeg

well
1. because SVG is scalable
2. I was hoping that it might enable me to have better transparency in IE6
i guess i’ll just go to 8 bit

png transparency is great in IE6

not without the css workaround

browser support for SVB I don’t think even exists
SVG

how can I make a text area automatically with added text?

like on click or what?

textareaautomatically added text/textaea

http://www.ameritime1.com/newsite/template.php
see hwo good my transparent PNG files work in my fisheye?

yes, sure but the text doesn’t move

*in IE6

your javascript rollover thing is pretty slow…

really?

lol, what are you trying to say?

works well on my side… maybe i’ll try a different com
p

is english your second language
I’m getting about 2-4 FPS

keep rollin and see if it speeds up

nothin

wtf
what browser

FF2
linux version

thats bullshit it works fast in mine
ff2 windows

well, I want the text which is displayed in a text area to move up and disappear when more text is appended to it

dammit.

‘move up and disappear’?

are you using any libs lnxn?

that’s a particularly advanced topic

prototype, jquery?

HTML was not designed for these types of effects

no

can you add a div inside a text area dustin?

hm, I don’t know

~[ lnxn1 ]~ if you want to use effects id suggest getting one of those two
if you can, it would be pretty easy

I think I might have seen it done before

~[ DDustin ]~ you use jquery at all?

left div above the textarea
never have
I would float a div above it

yeah and format the text the same

left

on click disappear

and then slowly shrink the text or something while fading it

lnxn if you use prototype or jquery its as easy as

it would barely look cool though
and it would be a ton of effort
I would rather spend my time getting more bang for my effort

myTextDiv.fadeOut(milliseconds);
DDustin, is that rollover still slow?

or you could handcode it with a 10 functions and bunch of setintervals

which one, prototype or jquery

same speed

well i dunno i used to use prototype, now i use jquery
either way
all you do is something similar to

what about scriptaculous
any thoughts on that wymetyme

onClick=’this.fadeOut(500)’;
scripaculous seems kinda slow
i used it for a while
a lot of memory load

have you seen the gucci site that uses it.
it’s retarded

not sure

http://www.gucci.com

IE6 is very smooth
firefox on this machine has been very slow

view the source……that’s right no flash required.

well
if it works in IE6
then im happy
all the idiots that work for this company use IE6/7

more speed is always a good thing though

can you test in 7?
i dont have it

I don’t have it with me at the moment
konqi is smooth

i just need redo the icons for that
~[ johnnyisleet ]~ kidna choppy

IE5 has no icon rollover and the search box has no js actions going

probably should have used flash

I’m going to guess the same for IE5.5
flash sucks :x

haha

i concur
flash doesn’t suck.

flash is horrible and atrocious

flash just doesn’t get used properly, kind of like how javascript started.

IE5.5 search box works great

i think flash is great for videos

no icon rollover thingie

flash is also great for applications

crossbrowser support
hmm
does anyone use IE5.5 anymore?
i’ll probably just make another site be static

ya I think that’s the best way to do it
making a static extra page is a piece of cake

things that don’t need to be crawled by search engines, and arn’t easily replicable in the DOM.

well im going to make the site modular
so i’ll just do includes on a static template

I want to make a web interface where all data goes through the same system

whats really goign to be cool is my plan for tagging items

the system would get data from the database or whereever I wanted it to, and export it in any of a number of methods
ofcourse RSS and probably JSON
XML as well
and probably some more optimized way for php

goign to be able to highlhgt text anywhere on any page or links and apply tags, a title, and the url for the page
will eb included in qucik search
thats how i want to make this one dustin
im considering just making it a CMS type thing
so my boss can edit shit
login, double click anywhere to edit text

the idea of my system is that because everything goes through one data cetner

add new text/image nodes

*everything* can be exported as an RSS feed

yeah thats good

or used for AJAX, without any extra code

also can be searched easily

server side code
I also want to create my own clustered database system
none of this sql crap
hm, I wonder if I could sell a complete system like that
probably not

haha

people tend to be blind to things that are enough ahead of the curve

i want to make all the content on this site either a part of my main template
or
some time of object
with specific coordinates or some way to identifiy where it is to be places
*placed
so it can be moved around with the drag of the mouse
new stuff can be added
and all of it can be searched and taggeed
thats not a bad idea really
the admin could add for instance a new paragraph

http://johngiannakos.com/web3/index2.html, I’m having some problems getting this to work in safari, and I’m guessing IE will break (don’t have it here). FF it’s all good as usual. if you click the bg link in the top right it’s supposed to
change bg, the second time you click it, it displays the original value thats defined in the css

title it “how to setup email”, tag it with a few key words
and when the user searches and finds it
they click
takes them to URL and highlights that node

I put alerts in the function and the function still runs the second time but it doesn’t change the backround

rather than doing the traditional highlighting of just the keywrods
fuck yeah
i’ll just use a wysiwyg
and then have title, tag fields
use xpath to add them to pages

I’m trying to write a quick little function that checks if a checkbox is ticked when you click the box, and if you tick it, it ticks 5 other boxes.. if you un-tick it, it also un-ticks the 5 other boxes.. I’m wondering if someone here can tell me how I can see if the box is ticked or not? I
tried sending this.value and checking if value = 1, etc, but it doesn’t seem to work, it just ticks the boxes regardless.. even if the boxes weren’t initially

mugger if (someCheckbox.checked) { }

oooh ok
thanks

can’t you do

?

above

err.. oncheck and onuncheck exist? :O

sir yes sir

reall?
i didnt now onuncheck esisted
and i also cant type

reading up on it, it looks like its not standardized
and maybe isn’t particularly reliable

you could write a prototype for it right DDustin?
well maybe not in html terms

Mmm yeah onuncheck seems a bit dodgy eh

heh… prototype? no not really

since you would be trying to call it within the html doc
BUT

javascript unfortunetly doesn’t provide a good way to implement new events

if you were just calling it in your js tags you could righgt?

then I am no longer able to access “frames[0].document.getElementById(‘plugins’)” — frames.length stays at 1, any ideas how I can access the div /

Can’t seem to get if(checkbox_id.checked) working.. firefox gives me the error: “checkbox_id is not defined”

couldnt you use an object to get current checkstate
then on click

yes but that is a sloppy way to handle events

ah

….eeuuwrgh

its too sloppy even for slobs
it just plain won’t work right
and you’ll have to constantly balance between running older browsers into the ground and response time
its just an icky situation with no good solution
best to just get onclick and check this.checked

if i am making my entire page work off my template and using ajax

then you are a fool :x

hows the best way to add forward/back functionality
why?

I was being sarcastic

ah

well
forward/back there is no good solution too
a big complaint among js users

Anyone ever tried setting a field’s value by id when the id started with an invalid character in the source of the webpage?

i could record events i guess
but that would be troublesome

I suggest dividing your content into logical page breaks
and only using javascript for small changes of state

yeah i could put it all on the same page still and instead of using ajax just use php?action=

ie, “user profile” is on a separate page then “user search” but “edit profile” is combined via javascript with “user profile”

the reason i want to do that is so the content can be moved anywhere without having to deal with pages being renamed

Any one know how I can get round my problem? Why would clicking a link inside an iframe effect the DOM?

you could trick the browser using # tags

i could do index.php?page=userprofile&action=edit

#page=555
doesn’t cause a reload on most browsers

yeah true but i dont really want it all visible on the same page

index.php#ajaxpageblah
what do you mean?

or even to load
what i want to do is have it so a user is at the index
then they click on an link for lets say payroll
that would take them to
index.php?page=payroll

is there a way to make a variable named after the VALUE of another variable? for example: var frm_id = ‘test_id’; var valid = new Validation(frm); I’d like “valid” to be “test_id” but I’m not sure how

causes a reload though

thats fine in this case

kinda ruins the point of all the fancy ajax stuff

the reason i want to do that

Can you not type in complete thoughts
please

is so i can move my nodes around different pages
its more like a conversation this way mace…
your away anyways
*you’re

valid = “test_id”;

this is a support channel, check out #phpc – that’s a chat channel

it takes up more space when you have a new line for every sentence fragment.

eh, it doesn’t matter until you have a bunch of people talking

got any idea how I can fix my problem?

techincally its IRC
anyone care to explain what IRC stands for?

I don’t want the VALUE of valid to be test_id, I want the variable to be named that. So I can start validation on multiple forms, and have a handle for each (named by the form id)

internet relay chat

thank you
CHAT

* Added wymetyme!*@* to ignore list
prat.

Mace[away]: I don’t get what you’re asking

what’s going on lol

I don’t get what you’re asking

then I am no longer able to access “frames[0].document.getElementById(‘plugins’)” — frames.length stays at 1, any ideas how I can access the div /

they got mad because i was chatting in incomplete sentences
“taking up too much space”

Mace[away]: what does the link do?

phhht w/e

forget about it, you get a lot of depressed people on IRC
depressed / angry about life

lol

SHUTS UP YUO
I”M NOT DPREESSED

lol

var frm_id = ‘test_id’; var “value_frm_id_here” = new Validation(frm);

takes the user to the same page except requests that javascript output a different file type

Mace[away]: if the link navigates to another domain, you won’t be able to access its contents

it’s the same url except for &switch_type=flash

Mace[away]: you should be able to access it. In the page that the iframe loads, try setting document.domain=”yourhost”
look up document.domain in google and there shouldbe some informative mozilla docs on what the security policy is
meaning, in the javascript of the page that the iframe loads, not javascript in the main page that has an iframe in its dom

got you

Mace[away]: I’m sure you know, but just in case, if you created that “plugins” div dynamically, clicking a link in the iframe will reset the iframe’s contents from scratch, and your plugins div would no longer be there

var frm_id = “test_id”; eval(“var ” + frm_id + ” = new Validation(frm);”);

it’s very late, any suggestion is welcomed

Mace[away]: are you waiting for the iframe to properly load before you mess with it?

setTimeout(…,3000)

Mace[away]: that will work, but a better way is to listen for the iframe’s onload event
which will fire when its contents are ready for you to access them
iframe.onload=function(){ // now you can access the dom tree in the iframe }
and his iframe.document would be null if he wasn’t waiting

it could very well be null, we don’t know
which page environment does iframe.onload execute in?
the child right?

really? eval is the only way? many other languages have a method for this. For example, php you would do: $var = ‘test’; $$var = ’something’; echo $test; and you’d echo ’something’

hi, question…i know that i can open a window with window.open…but can i from there, using javascript from the previous page, control what gets written into it?

javascript is a tiny language
it does very little

yes. look at document.open, document.write, and document.close

i would love get back and object that represents the window and simply call a windowobj.innerHTML = “mycode”

frames.length returns 1 (called straight before the getElementById call) – however frames[0] returns null

thanks
i will look at those

Mace[away]: wait till the iframe fully loads before you mess with it

and you do get the new window object back. you’d use “newWin = window.open(); newWin.document.open();” etc…

iframes are fairly evil

and i don’t have to specify a url in this case?
since i’m going to be writing to the window myself

ok, with onload, alert(frames[0]) now gives objectWindow – yet the problem still remains..

what’s the error message you’re getting

is an actual DIV inside the document page

i think not, you’ll have to try it and see. it might have to be something stupid like about:blank

actually, that sort of feature is rarer than you think, probably because it opens up all kinds of vulnerabilities whenever you let people convert arbitrary strings to code

Comments off

hey I need to have a confirm pop up when I user clicks a link If the user clicks cancel Nothing happens If the

Comments off

how to compare a datetime fields where datetime now or I need to translate into a timestamp for compare

MySQL 5 is out? I’m still using MySQL 2.

lol

seekwill, but item_types is ok right?

I guess
There’s not much to say about it

There is going to be like 20 types, and who knows how many items will be added to the database and I think it’s dumb to search the database with WHERE type = ‘Guitar’ when I can search using an integer instead.

ok?

dev.mysql.com is sloooow.
I can’t load the page.

s2bu

I’m probably going to reference everything by it’s ID so I don’t think I need indexes.

Yes you do

Really?

Do you want me to repeat myself over and over?

The primary key index isn’t enoguH?
enough even

For item_types, the PK will be enough. But not the other table that references those IDs

some ideas to my problem?

What problem?
You didn’t give all the info

I want to know exactly what you want, with examples.

32 post above or so

Copy and paste will be you friend…

50,7,14,15,” ; 51,7,14,11,”

french channel ?

#mysql.fr ?
!tell iskywalker about enter

iskywalker The enter key or return key is not a substitute for punctuation. Use a period ‘.’, comma ‘,’, colon ‘:’, semi-colon ‘;’ emdash’–’, or elipsis ‘…’ instead. In other words: DON’T HIT ENTER UNTIL YOU’RE DONE.

no

i want to insert or update x,7,14,15,” ; x,7,14,9,”

i want to delete the 2nd record in table ‘messages’ which satisfies the criteria
what is wrong with ‘ delete from messages (select * from messages where receiver=’greenberet’ LIMIT 2);

Why do you need a SELECT in there?
!m Greenberet delete sy

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

maybe just a where is enough

a where??

The x is the PK?

i want to delete those record from messages

yes exactly

Update the last column to ”

delete from messages where receiver=’greenberet’

but i want to delete the second record where receiver=greenberet

well yes, but i must do an insert also

INSERT… but if it already exists…?

the first yes, the second not

i want to delete the 2nd record not all the records

huh?

will you please solve my little doubt

Greenberet, why don’t you have an ID in your table?

delete from messages where receiver=’greenberet’ limit 2, 1??
the ?? means i am not sure at all

iskywalker, i doubt that is going to work the way he thinks it will

thats because i did not make the table, and i dont want to modify a couple of pages
i dont want a where

Greenberet, you don’t want a where?
Greenberet, what?

why should a where be in the command? cant i delete from messages certain number of tuples
and that query didnt work

Greenberet, I don’t think anyone understands what you’re talking about.
Greenberet, You clearly don’t understand basic SQL.

lisson, i have a table messages and i want to delete the second message whose reciever is greenberet
so please suggest a query

Greenberet, I told you what to do
Greenberet, If you aren’t going to listen it doesn’t bother me any.

u told me what to do??
when??

Greenberet, Your table needs an id.

i know, i know but i have to change a lot of stuff to put an id

Greenberet, How is that my problem?

i am sure there will be some other methos
it aint your problem
but please suggest some other method which dont require an id

Greenberet, I’m not going to help you create that monster you call a database.

i did not create it

I don’t care who created it.

lisson, please suggest a method

Greenberet, You should be getting paid by the hour.
Greenberet, Then you get paid to make changes like this.

lisson, why such a big fuss
over a litle thing

Greenberet, It’s not a little thing. It’s a big deal.

Use WHERE. It’s there for that purpose.
!m Greenberet delete

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

And read the docs.

seekwill, Hi again.
I added indexes to my tables.

You are the man

unique(item_id, item_name, item_type_id, item_profile_id)
I’m not sure if that does what I think it does though.

It creates a unique constraint on those fields.

On those fields combined together?

Yes

I thought so
I was just making sure

So why did you ask?!?!?!

I remember having problems with unique constraints before
Plus no one else is talking so we have to pretend that php mysql web hosting discussion is occurring.

No we don’t

Yes we do

No
We
Don’t

The freenode police will get mad.

Who day???

They’ll take away our red stapler.

We don’t need no red stapler

They are listening!

5AM. I have to leave for a flight in…4 hours…

So your plan is stay up all night
so you can sleep during your flight?

No. Can’t sleep on the flight
Well, shouldn’t.

No?
Well, why not???

Flying to the east coast. When I get there, it’ll be 5PM… and pretty soon I’ll need to sleep again…

I know. Isn’t it great?

no

Oh.

If sleep was so great, I’D BE DOING IT RIGHT NOW

Well I sleep on planes all the time.

You are awesome

what is wrong with this query
delete from messages using tmptable, messages where (messages.bookid,messages.sender,messages.receiver,messages.message,message.mdate) in tmptable;

At least he’s trying

will you tell me whats wrong with that

no

and why not?? are you cross with me?
for not having an id?

That’s brian, not me.
I have a million of things to do. I don’t have time to hold your hand.
I’m pretty sure the manual gives you examples of how to do it.

everything is given in the manual
everything is given somewhere on the web
then whats the use of this room
??

To talk about our ex girlfriends

grrrrrr
its a good thing you are not in front of me
for such a simple thing you are beating round the bush

If I was in front of you… I would run. I don’t mess with people in green berets
If it’s so simple… how come you don’t get it?

i’ll get it Mr. seekwill. i’ll seek the answer

Great!

my ex girlfriend was such a dumb slut

oh great is it. well you just sleep on your plane
you will see my query in your dream
abstrakt , this is a mysql room

Greenberet, really? i thought it was for bitching about our ex-girlfriends, my bad
bGreenberet, really? i thought it was for bitching about our ex-girlfriends, my bad/b
hahaha, i’m gonna write an irc client and call it BitchAboutYourX
it’ll be a whole new paradigm in IRC communication. whatever you try to say over IRC, BitchAboutYourX will permute it into whatever it feels like it wanted you to say and then send that instead.
weird syntax e.g. the comma placement and the where clause order… and you don’t ever actually identify a row anywhere in that query.
Greenberet, you’re just listing column names… you might as well run: TRUNCATE messages;

Oh look, bags packed.
!fooP

Greenberet, what are you actually trying to do? like, in plain english. what is your goal?

seekwill still no suggestion for my problem?

as a mysql client, is there a way i can tell the server to ignore insert/update queries i run on certain tables?
or, parse the sql hosting and discover which tables it applies to?

hey all

_mary_kate_, hey is ashley there?

SELECT `id` LIKE ‘14849′ ?
i wanna say SELECT `id` LIKE ‘14849, 1234, 134345, etc’

D3ADLiN3, select id from table where id in (1,2,3,4)

ok thanks ill give that a try

pr use or SELECT `id` LIKE ‘14849′ or id like ‘1234, 134345, etc’

… probably better to do IN
given that he’s selecting based on a sequence of numeric IDs LIKE is probably not what he wants
D3ADLiN3, though technically you could make it work either way, i think IN is more appropriate than LIKE

it’s wildly different
LIKE without wildcards is essentially useless

i wonder where you got yours, like doesnt carry about lower or upper case, so there is a difference, i hope D3ADLiN3 knows it.

Is it possible to make MySQL auto increment in base 36 instead of base 10?

i got it working thanks

iskywalker numbers have upper and lowercase ?
iskywalker just FYI, IN or = don’t care about case either, if you set your collation sensibly

well he didnt say anything about it

iskywalker true!
but only crazy people – or geeks – use CS collations

hello, how to compare a datetime fields? where datetime now() ? or I need to translate into a timestamp for compare?

no

- why not?

‘because you can’t’
auto_increment is integer based

MinuteElectron just silently do a 1 / log 36 in your head…

base 36 is ‘alphadecimal’

err
can someone help me with this:
MySQL server has gone away
No connection. Trying to reconnect…
i dont see anything in the .err file that shows why its dying

!man gone away

see http://dev.mysql.com/doc/refman/5.0/en/gone-away.html

http://pastebin.ca/619022
i tried new connections.. it doesnt work
its only when i request something on stored procedures
direct access to the db works fine
heck.. the sp is corrupt
ERROR:
No query specified
when i try to show create procedure
that was a working procedure.. i used to use it all the time
is there a way to fix the procedures file or something?

Comments off

You work at a company as a developer You are given a project that entails a registration – login system as well

some_function();

either calling unset($obj) or assigning $obj = null doesn’t seem to call the __destruct() method

contact them

the code above doesnt work of course

mace – i figured somebody here might have some idea
of some examples of how it might connect

gnat42, that’s because a reference of the object still exists somewere

can you edit php.ini?

no
its just cPanel shared hosting

s,of the object,to the object,

doh

have you connected to a database?

no, i can’t connect
the thing is..

What is your error?

then I must miss understand how it works, because I’m looping

when i go to add a new database, it is an ‘ODBC Datastream’ that i create

and at the start of the loop I assign the variable
and at the end, I call unset on it

have you *ever connected to a database?

on my own linux servers, yes it works perfectly

gnat42, an object is destroyed when no more varible references it

ODBC is “cross-platform drivers”

when i create a new ‘ODBC Datastraem’ it doesn’t ask for a username or password

I only ever reference it by one variable

it may be linked by domain

gnat42, pastebin your code please

it is an inherited class
okay

Mace im so dead

http://hashbin.com/731c.html

Mace – how does that affect the connect string?

aa^way: debug, find out where it stops

I’ve trying to find a ‘memory leak’

in no way at all

because that loop increases memory consumption on every iteration
unless I uncomment all assignments to the $client variable

can someone help me try to fix a data connection already open error for ftp, the errors are shown here, http://pastebin.com/d75955205

the $client variable is a 4th level subclass to a ORM system and I think it is leaking the memory so I want it to call the destruct function so I can try to release it

coudl somebody who is a genius at arrays give me 5 minutes please

gnat42, could you please reduce the code to a reproducible case ?

ODBC are just drivers

Mace well it is not stopping. it just doesnt load new info from server with ajax, in mozilla it does. i dont know how to fix it humm.. ctrl+refresh doesnt do also job, but might be that im at IE4linux

at the moment i use mysql_connect(“localhost”,”username”,”password”);

sure

so i tried connecting without a username or password and it says
mysql_connect() [function.mysql-connect]: Access denied for user ‘ODBC’@'localhost’ (using password: NO)

aa^way: console.log the variables at every stage with Firebug in FF
aa^way: find out waht’s going off
whats*
contact their support if you ask me

ya its just that they’re in Vietnam
and don’t speak english

great choice of web host

it was the best choice

get yourself an english speaking host for $1pm

it is not for me, it is for a customer
i already have my own servers in europe

and just use it for the mysql

sure you do

but vietnamese internet is really bad when connecting outside vietnam
Mace, is that sarcasm?

http://hashbin.com/7322.html
the destruct function doesn’t get called until after the loop is complete

bah keep closing this by accident

gnat42, can you paste the class definition ?

sure, but it is empty, its a fourth level subclass used simply for overriding the generated class
so Client extends BaseClient which extends Doctrine_Record …
the issue is most definitely in the Doctrine library I’m using, but I was hoping to pin point it by getting the destruct function called and releasing/resetting it somehow in there

gnat42, one of those subclass have to hold an copy of the object itself as object property

I see
so something like $this-_copy = $this; ?

yep, well that’s not a copy but that’s another variable that references the same object
those circular references are not well handled nowadays

hmm, any idea as to how to find something like that
can reflection or something like that give me a hint where its happening?

it has to happen inside the constructors and/or the methods the constructor calls
(in your case)

right, that should have been obvious
thanks
I’ll dig some more
much appreciated

gnat42, by simply var_dumping the object, you should see where the recursion is

var_dump

Maxdamantus, var_dump provides more informations, so it’s a better alternative to print_r when it comes to debugging…

Only the array count.
And the variable type.

and the strings’ length, and .. and …

var_dump is yuck though.. Just the look of it.
Generally, you wouldn’t use print_r for anything other than debugging either.

print_r(null); print_r(“”);

not that good for debugging

aew galera! alguem pode me ajudar?

___TIAGO___, english only here

ok
sorry
I boy’s ! I have one problem! do you help-me?

simply ask your question

Boys? One problem? Do we? Ask the question!!

one problem in my page of Send e-mail
wait =D

php6 zend_is_callable the 3rd argument is now a zval how do i convert a char to zval

how can a file know if it’s been included by another file through include or require, as opposed to being browsed to by the surfer?

require_once, include_once
ahh
hmmm, I’m not sure how one would detect that in PH
… PHP

[sacabonos]: pvt
[sacabonos]: sorry xD

Alanius, just define a IS_INTERNAL constant in your frontend pages and die if it’s not defined in your include files

[SubFreeze]: pvt. look
ekneuss look pvt =/

I don’t get it

hi people, i have a question for u, not about php itself, but about the writing-style. When i indent my php files, i have alot of pure html and im not sure what the best is to do, indent php or html or both? thanks. And anyone got an good indenting course for writing nice code? thanks for your
time.

there’s a problem in my page with the e-mail sending system.

is this ok? http://pastebin.ca/652391
thanks

There is no right or wrong way to indent one’s code. As long as it works, and is easily readable, then you should be fine.

img style=\”margin-top:4px\” src=\”asdf\”
stuff is dynamic^^

thanks for your answare But what does u guys preffer?

hello, is there a graphical way to edit php.ini like a webpage or something?

logik-bomb: looks good – just taught me something new – prevents sql injections aparrently – just read up on it

could someone get a check at my page code?

hasn’t taught me to spell properly though

how would i convert ‘email%40domain.com’ to email@domain.com

Personally, I indent my HTML and any other markup as well

so you basicly indent both the same way? Isnt there some kind of layout of how a man should write his code? Im pretty good (not saying im an elite) at php, but my code is messy and a structured way to write code-tutorial would be great.

The layout/rules I use for styling are kind of in my head :-)

okei, i guess the answare is that i need to write code i think look good

http://phpro.org/tutorials/PHP-Coding-Style.html
Not sure if it’s any good, but I just came across it :-)

thank u sub

Anone know vimeo video downloader? Bah google gives old ones, vimeo has updated their system

You’re welcome

so your advice to lilminime re indenting was ‘theres no right or wrong way to indent code’
that’ll be helpful
he’ll probably start writing with if statements indented 5 tabs in from the actual body of the if statement.

And your advice was? :-)

my advice was ‘away from computer’
hehe

Lol
It seems every project I work on has different “rules” so I told him to do what he felt looked good

I want to develop a web application with 125 tables, can php support all that?

Yes, can your hardware? :-)

you mean database tables?

yes,

if your database can support that..

someone told me that php doesn’t work so well with a great amount of tables. I will use MySQL?
then, I don’t have problem using PHP for it, right

X3rus, wikipedia uses MySQL (IIRC)

why do you have 125 tables?

is a web application for a company

quick question for you

well, that does not answer the question

unset($obj) should call the destructor on that obj?

so it doesn’t depend on php, it depends on the hardware and the database

granted that the obj has no other references to it?

hm, can i crate classes at runtime?

yes..?

how?

class A { }

rza, that’s not at runtime, that’s at compile time

ah true

i need to dynamically create a new class

but php files are compiled all the time

with a certain dynamic name

ahmmm why ?

every time you include a file it’s “compiled”

TehSausage yeah, but the point is that i don’t have a file with the class def in it
easier phpunittest creation..

you could make it generate a php file, include, then delete it :P
or maybe runkit has something like that
can you use $x = new stdClass(); $x-test = create_function(x,x); ?

hm
i’d need an include that takes a astring and interprets it
but there’s nothing like that in the doc

return $x.’!';

?

? i don’t see it creating a class def
im so stupid
eval()
http://pastebin.ca/652434 what i was just working on – simpler creating of test suites than the default

Hi
My phpinfo() is looking for php.ini in a non-existent directory (a wrong one). What should I do?

hi there

is there a way to change where php looks for php.ini?

i’ve created a mysql table. I specified default values for every field. when I make a request like INSERT INTO table VALUES(…) how can I insert only one field and let others take the default value of MySQL ?

Is it possible to use a class that is set ($class = new class in a php file that is included? At the moment php messages: Fatal error: Call to a member function loginbox() on a non-object in /opt/lampp/htdocs/ezy/index.php on line 16?

I think that is a compile time option, and if using the cli you can give it a flag

in apache2, you can set PHPIniDir

otherwise for apache you’d have to set it in apache.conf

Specify only the fields you want to insert values for

Nasky – INSERT INTO table SET col1 = val1

I don’t want to set the class ($class = new class in the master (that file that includes) the php file in wich the class is set

INSERT INTO table (col1) VALUES (val1)

(I’ve never liked the VALUES format … )

INSERT INTO table (field2, field5) VALUES (‘aa’, ‘bbb’)

as long as you include the class definition before instantiating it, you can do it wherever in your code.

hm doesn’t work

!doesn’t work
!+doesn’t work

thanks guys

you have to be more specific than “doesn’t work”

yes, http://nopaste.info/321e99caee.html
was already creating nopast

i’m looking for a way using preg_replace to replace any amount of _ characters into a single one. For example te____t__sdf should become te_t_sdf.

you need to include the file with the class definition. I do not see that happening.

one more question can i set a default value for a DATE field in MySQL ? because I tried to et “0000-00-00″ but it seems not to be accepted

#mysql

I skipped it in this version.. it is included

Burhan, ohh ok thx

it is not being included, which is why you are getting that error.

ok.. mustbe right. because it is included via an other class

anyone have any idea

I gonna check the including
thx
But.. the problem is.. if i start the class in master file by $class = new class; then everything works

that is not the problem, the problem is you need to include the class definition, instantiate it, then call a member.

and it is obviosly not possible to call a member in a file seperated from the class definition and instantiation. Because it is included.. really

how can you have a member definition outside the class? That would just be a function.

php include ‘myclass.php’; $obj = new MyClass; $obj-member(); ?

Just to reply I tried using PHPIniDir in the httpd.conf file but it made no difference to the ini directory in the phpinfo() listing

- Or I’m just incompetent

I think the latter

I can’t reap it! With a different class this approach seems to work

http://www.ginawildganzprivat.dl.am/

!isset and empty is the same thing ?
if(empty($_SESSION['id'])) it’s not like if i do if(!isset($_SESSION['id']))

no, isset and empty are different
http://us.php.net/manual/en/function.empty.php

this is valid right? “array_name[][index_1]=5;”

as a string yes

how about as php code

if index_1 is a constant and array_name is prefixed with $

yes, both of those are true

sure then
$arr[][][][][][][]['index'] = 5; is valid, just a little odd

is it possible to execute c libraries in php?
anyone?

Think you can with PEAR

how is that jonathan?

I wouldn’t know sorry
I just read about it once

i see

v5 or re-engineer the c lib to be a php extension
perhaps just a wrapper

pecl.php.net/ffi

Thanks TML I think that is what I was thinking of

ffi is a package not defaultly installed?

a bit out of date/unmaintained by the look of it

i dont see much info on the site, i wouldnt know its what i am looking for

Maybe pear has a simalar one

No
you couldn’t even do it from PEAR

huh? i dont get it

What don’t you get? If you want to call arbitrary C libraries, use the ffi module. It’s still in alpha, so I wouldn’t build any mission-critical stuff on it, but it’s there

Hi all. I’m trying to generate a calendar grid for a given month (current). Is there a simpler way than taking today, scrolling back to the first day of the month, scrolling back to Sunday, iterating forward to the end of the month, and then padding out to Saturday? That just feels like there
should be some easier method.

(My goal is to get an array of all the days that will be in the grid, then array_chunk() to 7 elements, and then render that as a table.)

TML, where can i find the “ffi” documentation?

There’s YUI’s cal widget
inside the tarball
That’s pretty easy

Yeah, I’m not looking for a JS widget.

ok thanks

I’m looking to generate my own table for it. (Particular reasons for this case; it’s not a UI thing.)

TML… never really used either, never had the reason too. I guess that’s where I go wrong.

PEAR is a collection of PHP scripts. PECL is a collection of PHP extensions written in C.
Well, every month will always start with ‘1′

Well yes.
But not on the same day.

So you’re trying to figure out what day of the week the month starts with?
php.net/date

The calendar grid is always 5 lines, with Sunday in the first column and Saturday in the last, padded.

perhaps as a start you could store the array so you don’t generate it all the time and use the date function TML has linked too

I am very good friends with date(), yes. :-) I was just hoping that I there was something easier than lots of iteration.

easier for what?
It’s not clear to me why you need “lots of iteration”

Scrolling back to the previous Sunday from the first of the month, unless it’s already on a Sunday.

What do you mean “scrolling back”?

hi, is there a way to change a method of the parent? class myclass extends parentclass…

just define over it

If the method is public or protected, you simply redefine it.

Crell ok thanks

http://uk.php.net/manual/en/function.cal-days-in-month.php will help I think

Yeah, saw that. I don’t have the calendar extension available, though. :-(

Well days in the month doesn’t change much… just write a short script

You need the number of days in a month? Ask date for the day of the month for day 0 of month+1
Feb 0 == Jan 31
etc

And that’s end-of-year and leap-year safe, right?

yes

Hum…

can someone help me out for a sec
http://phpfi.com/255546
what am i missing?
must be like some ‘

comma
$_POST['name']
place a comma after that

bah thats it
hehe
thx

Filter input ok tea cya later

You also dropped a $

still didnt work though

Inside of interpolated strings, either don’t quote your array keys, or use {}
{$_POST['foo']}
You also REALLY need to learn about SQL injection
This script is hacking a great big “hack me” sign, and someone eventually will

hrm
what exactly does that encapsulation do?
http://phpfi.com/255547

same old same old, i see?

those are the two files, i reedit them
one is the form to submit…the other is the submit action

pear.php.net/html_quickform may help you with your form rendering and validation needs

which module i need to work with pdf files?

fpdf or fpdi

f00li5h, how to install it under linux?
imean do i have to compile php with some support or need to isntall some package?
its rpm base distro

foolish how do i install html quickform?

they’re pure php’

or use it

pear libraries are pure php too, you can just snag them and stick them in your include_path

oh
what exactly does this do for me?
ive heard of pear
im just trying to learn in depth php

pear is just a bundle of useful php classes that you can use

from a business aspect…not exactly a full tim eprogrammer aspect

html_quckform does forms, with validation ruels and the like

how would i call on it?

include ‘html/quick_form.php’; $form = new HTML_QuickForm();
the rest is in the docs on pear.php.net

ah
does the html qucikf form file need to be within the root web dir?

no, it needs to be in the include path

except the file i just a file 0[1] type

you generally wantn to keep libraries out of the doc-root

okay

it’s paranoid, but you should try to keep everything non-public out of the docroot

there are multiple folders in here…what of all this do i need?
element, datasource, container

folders in what?

files (php) node.php, factory.php
exception.php
etc
in the quickform2 folder
says quickform was superceded

install the PEAR module first
yeah, one is php4, the other a php5 rewrite

which should i use?

if you’ve got php5, try html_quickform2
i’ve not tried the rewrite, so i’m not sure of how stable it is, the docs should say
it says html_quickform2 is in alpha, so i’m not sure how trustworthy it is

okay i just installed the first one
now that the mod is installed then what?

it’s just a bundle of classes

i used pear install html_quickform

the docs say how you can interact with them

that parts done

excelent

does that mean i have to download the package information now? or is that done with that command?

pear will have installed it into /usr/local/pear
the docs will show you examples of how to use the classes

okay
seems confusing

there’s a quickstart

quckstart?

under end user docs
http://pear.php.net/manual/en/package.html.html-quickform.tutorial.php

oh nice i see that

you create a form object, then add fields to it
then you just have to check if the form is valid, and render/process the results accordingly

I have a question about php6

there is no php6
wrong channel
join #fantasy

wrong php6-dev branch

right
sounds usefull

not really its still being developed

or wait.. actually not rly

its not finnished yet

ugh I ran a script with php file.php & and now when I try to run it again it doesnt run or print to terminal

does that script use locks of some kind?

well I think I figured out why I’m not getting any error messages at all
Broken pipe –
pdo is freaking out

No.
It doesn’t debug or anything now.

f00li5h i still cant figure that shit out heehee, 5 hourrs now fucked with it

aa^way: that ajax cruft?

yer

what does the script do?
aa^way: find a library that already works

Broken pipe” when using pdo?

nope, which db you using?

postgres, unixODBC connection

It

very likely a problem with your unixODBC driver

It’s just a bot.

can you not just use postgresql directly using the postgre driver?

I think the & messed it up or something it doesnt debug or anything
:|
not even connect

Does anyone have good information about sending better emails through mail() function. Pretty sure its better MIME types, but I dont know much else about it.

I don’t understand why, I can connect to the db with isql just fine, and other apps use the same dsn with no problems

I’d perfer to send Rich Text / HTML emails

ah hrm

how can i call a script to run in the background? i’ve got a page that updates a user’s profile, then I want to call a php script that performs some database maintenance that may take three to five seconds, but i don’t want the user to have to wait for it to happen or to even know it’s
happening

friday \m/

trevord
Linux or Windows?

linux

for your server?
You’d want to run Cron jobs then.
Crons run at specific times in the background.

can’t i invoke the job from my script?

how can i access protected members of the instance of parent class from extended class in php5?

You want it to run timely maintenance?

reenignEesreveR, through $this

well, i could do it that way, but i don’t think updates will happen that often, i just want it to run the maintenance kind of thing as soon as an update is made

Well… I mean the other way is to make a complex function
And include it at the end of your “update”

cstockton, doesn’t work for me

you know?

hrm?
you’re writing an ircbot?

yea

but if the user navigates away before it finishes, will that screw it up?

Does anyone have good information about sending better emails through mail() function. Pretty sure its better MIME types, but I dont know much else about it. I’d perfer to send Rich Text / HTML emails

reenignEesreveR, protected properties are accessible from a child class, but not private

cstockton, do i have to redeclare it in child class?

oh

reenignEesreveR, no, it’s inherited

i tried daemonizing it with & and now nothing works

Does it literally take 5 minutes? I guess the better question is what kind of operations does it need to do?

does it have a log it writes to?

no :|

also, backgrounding it in a shell isn’t quite enough to daemonise it

paste ur code in paste bin

no it takes more like 5 to ten seconds, it does some cache clearing and updating

it just does like monie$ file.php monie$
nothing

ps ax, does it show it?

I know what youre saying, in not sure exactly how to produce the results you want, if its even possible… but hold on 1 second

i could do a shell_exec(‘php script.php’), i wonder if my shared host would allow that, they give me shell access…

No.

I know wget will execute a script on the server too.
I had to use it to make cron jobs work.

so it exits tehn

hmm

If you can send a raw unix command from php to the server

you’re runnning scripts with wget?

You mayget the results you’re looking for.
Im running a quick cron with it. Implimented it 6 months ago.

urgh

Did a search and its the results I got.

I found what was wrong. :|

you know that means other people can run your script too, right?
yeah?

It’s not the &, the weather script was locking it up.
:|

ok, thanks, i’ll try that, the only issue would be if php waited until the script was finished before continuing
but i’ll give it a try

Thanks for helping f00li5h.

it may run it once the comman is parsed

I tried using the weather parser pear module

The script updates a day counter each day for “job postings”
It’s not a big script im worried about, but im not deadset on wget
I would change it for something better if i knew something better to change it to.

hi, I have a question about arrays

This right here messes it up.
$weather = &new Services_Weather();
$wdc = $weather-service( “Weatherdotcom” );

I’ve put an array inside a function because I want that array to be available to different files. I’m using function showarray($arrayname) { $$arrayname = array(); $$arrayname['key'] = ’some value’; } – but this doesn’t seem to work, any ideas what’s wrong?
(basically it just provides an empty array)

maxo, why not just define the array in a file in the global name space

what do you mean?

maxo, and include the file as needed

I guess I could do, I’m just kinda curious as to why it’s not working in the function though

maxo, are you returning the array?

yes, I’ve also got return $$arrayName;

hey guys, is it true that some servers don’t allow htaccess files?

maxo, paste your code in paste bin

ok hold on a sec

What’s wrong with this line,$weather = &new Services_Weather();
$wdc = $weather-service( “Weatherdotcom” );

http://pastebin.com/d7270348d

maxo, I am not sure variablevariables is what your wanting here
maxo, and using global is not the best idea, better to use the return value

it’s so I can specify a name for the array

maxo, Are you, building some things for this array?

and beneath where the function is called, I’ve also got asort($myArrayName); and if I remove global, I get: Warning: asort() expects parameter 1 to be array, null given

maxo, you might want to do something like $thearray = showarray(‘whatever’); asort($thearray);

aha

the problem with variable variables and array, is the value of the array changes

cool, got it :-)
thanks :-)

php manual says if i start a program and want to leave it running in the background, i “have to make sure that the output of that program is redirected to a file or some other output stream or else PHP will hang until the execution of the program ends.” how i do i redirect output to…nowhere? i
don’t really care about the ouput and want to completely ignore it

/dev/null on linux

what about adding & to the end?

/dev/null?

yes

ok, thank you

you need to background it, and redirect it’s standard error too

that will take the result and then send all the text to nothingness

would ls -l & also work?

there is more to do yes, but thats basically it
no that would just send the process to the background all resulting text would still apear in the console

ah ok

you either need the output of the command or your running one and don’t care about the output then you can direct or pipe it to /dev/null which is nothingness or to a file with the same command but put the path to the file there.

and | (pipe)?

is a bitshift. | is a logical OR

overwrites, and | sends the data to a different program

of course, you were speaking in terms of PHP, since we don’t do linux shell stuff here :P

overwrites stdin

Hi, I’m using /*
Hi, I’m using eval(“\$” . $allents[$i]-tagname() . ” = \”" .
utf8_decode($allents[$i]-get_content())
.. “\”;”);
*/
ok, that went bad, sorry

so im still trying to figure out

| takes stdout from something and sends it to something elses stdout

whats wrong with this line?
$insert=”INSERT INTO que (name, desc, date, offer, email) VALUES (‘$_POST['name']‘, ‘$_POST['desc']‘, ‘$_POST['date']‘, ‘$_POST['offer']‘, ‘$_POST['email']‘)”;
mysql_query($insert);

something elses stdin rather

http://pastebin.ca/652598 — why does that display an empty array only ?

nickelnick, you’ve got single quotes inside singlequotes

aarcane, seems like a problem with ur for loop

so $_POST['name']; without the ‘
in front and behind

I’m using domxml_open_file to open a xml file to parse (still using php4 for this). If I have a invalid XML file that will not work and some of my clients use & char inside XML file. Can I solve this with some function?

#
for ($i; $i = -5; $i–)
should be $i = 5

reenignEesreveR, I don’t know why, it loos right, i, each time through decrement i, until i is less than or equal to negative 5

i is zero initially, condition $i = 5 does not satisfy anytime so loop is never executed

reenignEesreveR, no, I’m working with negative integers

so then what is wrong with….

$insert=”INSERT INTO que (name, desc, date, offer, email) VALUES ($_POST['name'], $_POST['desc'], $_POST['date'], $_POST['offer'], $_POST['email'])”;
mysql_query($insert);

reenignEesreveR, oh, that has to be TRUE ? I thought it stopped when it became true :-S

your for loop is incorrect hehe

yeah, I tweaked it, and I got it working
but I got my negative index array working fine, thanks

you want ($i; $i = -5; $i–)

nickelnick, it should be like VALUES (‘{$_POST['name']}’,'{$_POST['desc']}’ …

anyone?

in SQL query, ur string values must be single quoted

oh

nickelnick, please read about mysql_real_escape_string
nickelnick, that query is unsafe and could be used to hack you

so i should use the one that reenign said?

nickelnick, sql inject is a better word then hack, but I like it to sound scary

nope, do something like $safe_name = addslashes($_POST['name']) first, then put $safe_name in ur query

reenignEesreveR, addslashes is better then nothing, but realescapes tring is better
reenignEesreveR, it escapes things like \x1a and \x00

i have rewritten a large web application written procedurally, to OOP.. I have tried VERY hard to avoid global variables and have been successful until today.. I have a few basic user settings like their timezone, etc. that I would prefer not to PASS to every single object in the program!
Should I be declaring a global settings array, or is that even possible? my initial attempts have failed

nickelnick, http://us3.php.net/mysql_real_escape_string

global variables make baby me cry

how could someone hack it?

writing oo just to avoid globals makes the baby jesus cry

magic

request.php?name=’ (DELETE FROM * table), ‘ finish query

hi, ppl that use vim to code, know any fast shortcut to comment a block of lines, using visual or something like that without needing to enter in insert mode ?

nickelnick, suppose ur query is “SELECT count(*) from user where name=’$name’ and password = ‘$password’ “, put $name = “admin’OR’1′=’1″ u’ll know what can go wrong

who uses vim, get a real editor like nano. mm nano….

So I have an index page that I’d like users to be able to customize the order and creation of a bunch of “modules” and have it saved in the database. Anyone have any clever ideas on how I might do this?

reenignEesreveR … count(*) AS `count` also

Findarato, vi and vim are professional tools for system administrators and developers who can effectively use them

why not just use /* */

Findarato, haah.. yes i dont necessarily like them.. but im scratching for a solution here
I have like 5 layers of class inheretence.. I am not finding it easy to propagate this basic array all the way down

dc3aes, might want to look at organizing your object model
dc3aes, that much inheritance may or may not be appropriate
dc3aes, however; for your problem with user settings, may want static access for them

i wondered if I wasn’t going about it wrong but it is working in every other way..

vi and vim are text based text editors they are not better than any other text based editor.

really the timezone has been my most basic problem, since I have intelligent small objects that need to report back their time, etc.. so I was talking directly to them and went ruh roh!

Findarato, I prefer ed, myself.

dc3aes, final class settings() { public $settings; private __construct() } setSetting($var, $val) { self

Comments off

I have column with ~40 small images ~160×100px and i am moving them up-down while onmouseover on arrow Now they

or something like that? currently it just wipes out the content of my text object when I “unfocus” it

no, it shouldn’t
wait a moment
input class=”search_input” type=”text” name=”suche” value=”Suchen…” onfocus=”if(this.value==’Suchen…’)this.value=”;” onblur=”if(this.value==”)this.value=’Suchen…’;” /

thanks! works great

fine

howto make the ‘Suchen…’ string in this scenario appear ex. red, but not the textinput from the user@keyboard?

style=”color: red;” onfocus=”this.style.color=’black’”

that doesn’t seem to make the text black again when focused

hi all

‘lo Ay

input:focus { color: red }

this.style.color=’#000′
doesn’t work, too?

Is there any way to access inside a iframe? I mean, to the source code

yes of course
anything you can think of, there’s a way

doesn’t work

I want to include a page in an iframe, but that page seems to detect that and reloads to remove the frame

:?

then just use css like garethadams said

is there a way to prevent that page from escaping from the frame

why? Clearly the webmaster for that site doesn’t want you to do that

could be, but I want to load it in a frame with some quicklinks in the other frame
but I guess I’ll have to work with bookmarks…

oh is this just for you personally?

yeah

Firefox?

the frame would even be a page on my disk
yes, FF 2

if you can’t block JS by domain with the default prefs, I’m sure there’s an addon for it
oh
if it’s a page on your disk, just remove the JS ;p

but there is js on the escaping page which might be needed

you can’t just sort it out?

With GarethAdams CSS sollution the text becomes red again when input is without focus, I’d like it to stay black

?

input type=”text” name=”firstname” value=”Fornavn” onfocus=”if(this.value==’Fornavn’)this.value=”;” onblur=”if(this.value==”)this.value=’Fornavn’;”/
Is it possible to extend the javascript part to additionally include the color?

this.style.color doesn’t work?

no, I haven’t defined a style for the input, might that be the problem?

hi all
anybody has a tip for removing blank nodes in dom trees ?

s/style/class

i’m dealing with some XML and all these blank nodes pisses me off

sorry

input style=”color: #FF0000;” type=”text” name=”firstname” value=”Fornavn” onfocus=”if(this.value==’Fornavn’)this.value=”;this.style.color=’#000′” onblur=”if(this.value==”)this.value=’Fornavn’;”/

that almost works perfectly, the only problem is that when the userinput text is removed and the input field looses focus, the text still is black (should return to red)

ah okay
input style=”color: #FF0000;” type=”text” name=”firstname” value=”Fornavn” onfocus=”if(this.value==’Fornavn’)this.value=”;this.style.color=’#000′” onblur=”if(this.value==”)this.value=’Fornavn’;this.style.color=’#FF0000′”/

now the black userinputted text becomes red when loosing focus

ok
mom
input style=”color: #FF0000;” type=”text” name=”firstname” value=”Fornavn” onfocus=”if(this.value==’Fornavn’)this.value=”;this.style.color=’#000′” onblur=”if(this.value==”){this.value=’Fornavn’;this.style.color=’#FF0000′}”/

Is this supposed to be some sort of validation of user input?

oh, no
it just cleares the value if the user types something

Thanks alot! It works splendidly You’ve also given me a basic javascript hosting tutorial, thanks for that too

hehe, no problem

It would be troubling if there’s anyone that actually has “Fornavn” as firstname, but luckily none in norway afaik has been named that sofar
It would be troubling if there’s anyone that actually has “Fornavn” as firstname, but luckily none in norway afaik has been named that sofar

maybe I should give some parents a hint

nooo! that would totaly break my site hehe

hi all, how do you generate key events to a flash object?

what?

i’m in javascript land, there is a flash object embedded on the same page, and I want to send key events to it (e.g. to enter text in a flash search field)

is it enough to send the information when the flash loads?
or do you need to send it sometime after it’s loaded?

after it’s loaded

let me try to remember…
nah, I don’t know how to do that
but I’m sure you can
talk to #flash
#flash on efnet, even, might be better

efnet and better in the same sentence…. how bizarre

Heh all

ah, ok… thanks anyway reisio!
:-)

good morning

Good evening
I’m trying to JSON ify some Java Objects (which are currently in a HashMap)
Any thoughts on that?

yeah, well :p

Tinkering with json-lib server side

efnet is crap, flash is crap :p it makes sense that there is more activity in #flash on efnet :p

http://oss.metaparadigm.com/jsonrpc/

That and libhttpd

flash isn’t crap, flash dev is crap

*clicks*
thankyou

that project has code that translates many common java types (including maps) into json

Wonder if it will do maps of objects

hi,on a page, i am dynamically creating iframe in div, then i want to access the form element in iframe page..
i am unable to get the form element, how can i do that..

document.frames["name"]

I am 90% certain that it will.

im using FF, it says “document.frames has no properties”
alert(document.frames["testiframe"]);

you add it by the DOM or with the crappy innerHTML ?

no i m doing it like this objIframe= document.createElement(‘iframe’);

adn that objIframe variable doesn’t have the members you need to access its content ?

Bit heavier than I was after, stand alone application with embedded web server
http://json-lib.sourceforge.net/usage.html
Isn’t bad, but I’m having trouble convincing it to JSON collections of objects

I looked at the code for the link I snet you, and it doesn’t look *too* difficult to just copy the code out that does the magic you want

yea it actually loads one file, in which i have some form element..i need to read/update them

no reason you need to do the whole thing (servlet)

How can I check the images are shown in a browser?

? If you know the width/height the image is supposed to be, you could put it inside a div or something and then check the DIV size to see if it’s been expanded by the correct amount
images also have onload/onerror/onabort events you can attach to

thx

objIframe= document.createElement(‘iframe’);
objIframe.setAttribute(‘id’,”testiframe”);
objIframe.setAttribute(’src’,”ShowHtml.html”);

http://flexjson.sourceforge.net/
Sorted

that looks nice

anybody know of a script that lets firefox support CSS styled scrollbars?

not me

for all visitors to a page?
that’s not really feasible

yeah, for a frame or an iframe

save constructing your own, as has been pointed out

IE supports CSS styled scrollbars, but FF doesn´t

yeah, because it’s not standard code
it’s something Microsoft made up

IE supports css-like styled scrollbars

granted, it or something like it _should_ be standardized
but it’s not

for FF to support styled scrollbars?

No. The scrollbars color is detrmined by the operating system color scheme

it’s part of the UI
you’re not allowed to fuck with people’s UI
security issue, among others

Replace the scrollbar if you need to. I wouldnt use your site if you did though

I´m surprised such a script didn´t already exist.

it would have to install like Firefox
people don’t like to install things just to use a webpage

Is there any way to access inside a iframe? I mean, to the source code

s/like Firefox/like Java
what for?

what for? To get access…
To modify the source, for example

modify it for what purpose?

does it matter?

Impossible across domains

hmmmm ok
that’s my real question, hehe

Almost too easy
JSONSerializer js = new JSONSerializer();
response.println(js.deepSerialize(currentState));

heh

hi all
what is a good ressource which explains how to delelop ajax apps from scratch?
or with a very simple libarby

fairway, i like yahoo’s YUI
i’m no good with javascript and i’ve been able to do some small things with it

tgabjs
thanks
sorry
is it gpl?

you can use it commercial or not, i dont know exactly which license it is
http://developer.yahoo.com/yui/

YUI ROCKS!

sembiance, i’m having a little trouble with it, would you mind taking a look at my code
I’m trying to scroll a div, and it behaves inconsistently

there is also a ##yui channel

oh, thanks

BSD

would you write from scratch ajax scripts?
if no why not?
what about dojo?

hey guys, how do u get the updated value of a textbox after onkeypress?
if i write some code say onkeypress=alert(‘this.value’), the value will not include the latest change
any help pls?

Sorry, wrong window
Or the Yahoo libraries?
Or the google ones, etc etc

onkeyup

Hey guys. Does anyone have experience with TinyMCE? I have one problem which is that the top toolbar always too large is. If i set the container of it to a specific width, the content would just go over the container boundaries… anyone an idea?

thanks

Hi

hi
and bye

yop

hi!how can i pass to the parameter of document.getElementById(—) the content of a variable?

??
document.getElementById(the VariableHere)
document.getElementById(theVariableHere) *

only?
no need for + ?

a plus sign?
um?

yep
my variable is called position
and i’m doing documen.getElementById(position).style.color =’red’

documen?

nop document.
sorry

hi

and de error console is returning the following document.getElementById(position) has no properties
position contains a number

are you running the code AFTER the page loads?

IDs can’t start with a number

right

what element are you trying to access?

i’d like to get all div with a certain class with document.evaluate but it only works when there is one class, when there are several classes on the div it doesn’t work

a Label

show me the opening tag for the label

any of you familiar with tinymce? i’m looking for a workaround for this http://sourceforge.net/tracker/index.php?func=detail&aid=1618460&group_id=103281&atid=635682

strider, contains(@class, ‘yourclass’)

label id=’(increment like i)’/label

that’s not what’s in your HTML
:P

?

you have an element with id “(increment like i)” ?

i have label id=’+i+’/label

you have an element with id “+i+” ?

yes

IDs can’t have the plus symbol in them

ID is not allowed to start with a number

butt if i do a onmouseover= this.value it returns the id number
with no error

thanks dabear

.value is also different to .id

np, strider

how are you creating your labels?
on the server or on the browser?

GarethAdams, i have no value defined on the creation of the label
on the browser

elements don’t have .value

GarethAdams, i will try to explain what i’m doing

please do, it’s all a bit vague so far

i’m creating dynamic html tags, trough AXAJ
AJAX
from the server is returned several records, and i made a index, like in a html hosting table line by line show’s me the records on the db
then i made buttons to go to the next record, previous…and so on

‘Ajax’

what i’m trying to do know is highlight the record that i select and it’s showned to me at the moment
if label

as?

rephrase

as?

still don’t understand
perhaps in portugues?

hey, if i create a bob object and tina object, in my bob object’s onload function do I have access to my tina object? Or do I have to pass the tina object into my bob object in order to use it?
the scoping is messing me up

cozby, everything you define in the global scope with the var keyword, will be available

i need only to know how do i pass a variable inside de parameter of document.getElementById(here)

can I address object member by index ?
i have dataset={['a','b','c'],['a','b','c'],['a','b','c']}; can I do it like dataset[0][0] // to get ‘a’ ?

Is it possible to convert a javascript var into a php var?

Bear10 json ?

?

Bear10 js var is client-side

is there any kind of browser written that limits what javascript host can do (like the creation of ActiveX objects and other such exploitable objects) and only allows simple functionality like the modification of dom objects.

Is image a standard JS object?

ah :|

I see no mention of it in Mozilla JS docs.
however in Firefox new Image() works as expected.

Bear10 there’s a lib that does conversion between php webhosting and js
Bear10 read this http://www.xajaxproject.org/

oh ajax
yeah ive used ajax before but i dont really wana go through that hassle for this simple task, ill use a work around lol, in javascript is there like a empty() function to check if a value is empty or do you have to do var == “”

Is there a cross browser ajax library?
that’s worth using…

dojo, gwt, yahoo

ajaxalize

http://pastebin.com/m3a46c992 , im trying to make it so if that time is undefined when called that it just uses default of 2500, is this the correct way of doing it? and if its defined even if 0 it does the one that uses the time instead.

Can I use OOP function (in where I put “this” keyword) in prodecural mode (without assigning object)?
What will be done with “this.varname” variables? Will be they erased after function finishing?

No search results for ajaxalize…
Was it a code?
*joke

really? I mean I made it up, but I would’ve thought there’d be a result if you searched for it :p
even just an IRC log :p

hehe

http://phpfi.com/255306 – look there

The paste 255306 has been copied to http://erxz.com/pb/3966

ajaxize on the other hand

hello, is there a way to define constants in js ?
is “const mode_some = 0″ cross browser compatible ?

const X – but it doesn’t work in IE 6

k
or enum ?
some kind of enumeration ?

what do you mean “enumeration”?

i want to have names for this.mode like if(this.mode == MODE_XY)

just use variables

i’ll stick to strings

var Mode = { xy: 1 }; var object = { mode: 1 }; object.mode == Mode.xy

true

Question – can I use “this” keyword in procedural functions? What will be done with these variables after finishing function?

did you see that?

tags because of some small amounts of HTML for formatting… Now, when I retrieve and display this data it’s in plain text, and the HTML code shows as text in the browser, is there something I can do to prevent this, and have the HTML actually parsed?

thanks for that!

what if you create a global var named fred and inside a new function you create a fred variable?
then remove the functions fred variable, would the global one take over?

hm, how du you remove the variable then?
if you delete yourVar, maybe

well what would happen if i created a local function variable with the same name as a global var?
inside the function i create fred , but there is a global var named fred… would it use the immediate scope fred variable or the global one?
wait nm

hi

hi

anyone got an idea on dealing with the CDATA?

no one knows answer on my problem

Has JavaScript any manual? With functions, objects and so on

http://developer.mozilla.org/

I will check it
I must buy good book about JavaScript

hi, is there any problem with style.backgroundColor in IE?
i have this working on Firefox butt in IE doesn’t work
hi, is there any problem with style.backgroundColor in IE?

Why isn’t the Javscript contained in an HTML file executed in IE or Safari when I call: $.get(“/mobile/includes/shc/p2.php”, function(data){$(“#p2Div”).html(data);});
Sorry, I’m using jquery

cozby, did you try?
mstearne, eval?

how do i name a variable/function/object based on the value of another variable?

I’ll try that thanks. But will eval get tripped up by HTML?

mstearne, just use innerHTML or something
Hory, you could possibly use window['some_' + varName] = something

thanks, but i get this error if i do
“invalid assignment left-hand side”

hi. i have a question about scopes.
“text=7; alert (window.test);” i get “7″
so every variable i assign is assigned in the context of “window”?

yes

can i change that somehow?

window is the default scope

innerHTML doesn’t seem to eval JS either because now it doesn’t work in either FF or SAF
http://tempo.bigrecruit.com/mobile/

alert() is not a function, it is a method of window object, so alert is the same as window.alert

Click on Ringtones and that uses .html() from jquery
Voicetones uses innerHTML
Thanks!

mstearne, ask in jquery’s channel?

is there a way to change the scope, so that “x=7″ will NOT create a new member of “window” ?

no

will my_flash_arr=eval([['a','b','c'],['a','b','c']]) work in Actionscript ?

sorry. Thanks I have but am getting better responses here

or, you oculd use an anonymous function

I’m looking for a method to look at checkboxes in a form and return the values of all which are checked

but then you won’t be able to access the variable at all later, web

please write in code, then i understand.

tlsarles, document.getElementsByTagName(‘input’); and then do a loop and check that type == ‘checkbox’ and checked is true
web, (function(){var x=7})()
x won’t be available later
but I’m not sure that was what you wanted to do

ElementsByTagName! thats what i needed. TY

yes, that looks good. let me think for a while.

document.getElementsByTagName(‘input’)

yeah, i got it. Thanks much

greetings. any quick hint how i could copy the hight of one div and resize the other to the same size (no fancy animation, just an IE hack)

Will memory usage increase so much if I append elements like dynamic menu or voting panel (which will be used ralely) after page loading instead of only when needed?

does anyone have a good function to format numbers, like into currency

I would make Menu() function as procedural (it would return ID of created panel).

something is strange about these anonymous functions…
when i do this:
(function() { for (member in this) document.write(member); } ) ();
i get tons of crazy members.

um
kill them
no more crazy members
why would “var bgSrc = currentStyle.backgroundImage” or “var bgSrc = style.backgroundImage” suddenly make my javascript function return, even with no error message?
but only online, not offline.

crazy like a fox?

members like these:
document
navigator
netscape
XPCNativeWrapper
plus like 100 more

right
anyway..
I’m using this:
public:component” lightweight=”true”
public:attach event=”onpropertychange” onevent=”iePNGFix(0)” /
maybe they activate when I try to use “style.backgroundImage”?

that’s the global object, window

im looking for a way to execute code “x=7″ without making a new member of “window”. is that possible?

these 2 lines, they have nothing fishy in them, do they?

sure, make a local variable inside a function

nope

strange :-|

i dont want to execute “var x=7″. I want to execute “x=7″
i want to change the scope, so that “x=7; alert (window.x);” returns “undefined”

web, okay.. just download the firefox javascript implementation source
make the changes and recompile
It’s really that simple

unless you declare a variable, you’ll be accessing a property of the global object

well, with the anonymous function it kind of works already. thanks for that. unfortunately, inside the scope of the function now there is all this crap.

use tab, web
bjorninge, not bjorn

bjotab

whats tab?

a key, usually in the D00 position left of Q

woah!

congrats

thats cool!
web:
thanks!

what is test(somevar)?
eval test()

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

eval “test()”

”ERROR: 12050: Can’t find string terminator ‘”‘ anywhere before EOF at (eval 212) line 1.

eval “test(var a = 5)”

”ERROR: 12052: Can’t find string terminator ‘”‘ anywhere before EOF at (eval 212) line 1.

idk

more importantly:
what does “/IMG|INPUT/.test(tagName)” do?
eval /IMG|INPUT/.test(tagName)
eval “/IMG|INPUT/.test(tagName)”

eval /IMG|INPUT/.test(tagName)

checks if the tagname is eiter IMG or INPUT
either

even better /../i.test(tagName)

through a regular expression

I’m trying to fix this IE6 png fix
it works offline, but not offline
I copied the javascript host straight in the index.htm file because it didn’t load at all before
offline, but not online*
so i’m using alert() to check where it stops
and so far, it’s stopped at “var bgSrc = currentStyle.backgroundImage” and at “if (isSrc && /IMG|INPUT/.test(tagName)) {“
I don’t know why, but if I have “var bgSrc = currentStyle.backgroundImage” and then “alert(‘hai’), it doesn’t do the alert
it doesn’t go through the if statement, either (isSrc is true)

agamemnus, probably because the script fails in fetching the currentStyle.backgroundImage

when i eval(s) something – is there a way to find out wich variables have been set by the code in s ?

What exactly does delete do?

bjorninge, thanks, i will try to do an alert on currentstyle

you could do a for(property in this) to check all properties of an object, web

removes a property from an object

trhaynesdeletes a variable or a property from current scope

of which object?

it still doesn’t work (alert(currentStyle) stops the execution without error)

thanks guys

maybe an exception is being raised but you’re just not seeing it

I don’t know what else to do

when s=”bjorninge=13″, then a member of “window” will be created that is called “bjorninge”

ie doesn’t tell me anything, though.

no this.bjorninge will be created

deliberately cause an error

how?

alert(1/0);

does anyone know why javascript allows to escape the slash?
doesn’t really make sense does it?

oh, that’s allowed in JS

how do i find out if a certainkey i present in an array?

i got infinity

where?

“foo\/bar”
to get “foo/bar”

hmm, ok.
i got alert(bla) and i think it errored without messaging me about it

\ followed by any character is replaced by that character, except for letters and digits

odd, ok, let’s see…

are you using Prototype.js?

ok, I think I got the error now.. I had debugging off, but it still should have shown me an error triangle

so why does every second json library do “foo\/bar” for “foo/bar”?

I don’t know

no, i am using Mr. Turnbull’s IE6 png fix
ok, currentstyle is undefined
I think the errors were caused because…hmm…

okay. know why
imagine this json string ["script", "foo", "/script"]

ah

that could end a script tag under certain conditions

end a script element, yes

ok, so I think the problem is because I moved his script file inside my header
and somehow it can’t pick up the right object because of it
but if it’s in a different file by itself, it won’t even load!

how come my cookies are not saved/sent ?

I’m using ” style type=”text/css”img, div { behavior: url(‘flyingsoft.phatcode.net/flowers/iepngfix/iepngfix.php’) }/style

which cookies?

deltab, cookies stored for that domain

is there anything wrong with this?

when downloading the .js-file my server also writes out a couple of cookies, these are not saved either :/

do you have a directory called flyingsoft.phatcode.net?

no…
hmm..
I did try using http:// but I had some problems earlier, so maybe if i add it it will work this time
i also tried using relative directories

calls ?

still nothing

no, cookies aren’t mentioned at all

deltab, hm, ok. You wouldn’t happen to know of a different approach to my problem ?

no

would url(iepngfix/iepngfix.php) work?
that’s what i’m using now, and I still got nothing

use a tool such as Firebug or Fiddler to see what’s going across the network, if you aren’t already
do you have that file there?

http://www.flyingsoft.phatcode.net/flowers/iepngfix/iepngfix.php
is that correct?
the index file is in my flowers directory
(the file i’m calling the script from)

I guess so, but I don’t know

deltab, I’m looking a tcpdump, I can see my server set the cookies, but the webbrowser never returns them on the next call

well, anyway, I have “php header(‘Content-type: text/x-component’) ?” on the top
is that correct? (it’s supposed to be a fix)

Content-Type with capital T is the most compatible

the http spec is not case-sensitive

which is a royal PITA for people implementing it

dabear:that still doesn’t work
i’m not a happy camper
shit. why does it all have to be so hard?
All I want to do is use PNG images in IE6, with opacity. Is that so much to ask?

what is text/x-component?

the fix file was an .htc file, but I read that a problem could be that the fix works offline and not online
so the solution was to add AddType text/x-component .htc to the .htaccess file
problem is, my server hates .htaccess files for some reason
so I asked the guy who made it for the other fix he mentioned
and he said I should add “php header(‘Content-type: text/x-component’) ?” to the top of the htc file.
and rename it a php file
and it still it doesn’t work
and my FRUCKING server host doesn’t like deleting htaccess files.

anyone have any idea whats causing the flicker on my mouse over here http://www.forgemodels.com/model_browse.php warning some mouse overs are not work safe, stay at the top few
its on my list of models
www.valentinepro.net/index2.html the code works fine on that page
the valentinepro isnt database driven, forgemodels is

=|
I don’t see any flicker

it treats each character like its a different mouseover

agamemnus.. try renaming the htaccess file

its in firefox the flicker, safari its just really messed up www.thenextbyte.com/videos/ i made a video of it
ill be back in a few my son needs my help

ur video won’t load
oh i see
well
I know that your problem lies in an IE specific feature
cause it works fine in IE6

yet the code works fine in firefox on 2 other sites, one i borrowed the code from, and then i took the code from that site and used it with this site
yet www.babeblvd.com and www.valentinepro.net/index2.html work fine in every browser i have tried
unless its the CSS for the rest of my site screwing with this some how
im surprised people still use ie6
must have a pirated copy of windows installed :p

there are still also ie5 browsers around

yeah but thats just people with old computers, or woman

.JS file included with every subpage has about 3,1 KB. Isn’t it too much? Some people have slower transfer.

there is a free ie5.5 ie6 and with sp2 for linux
3,1kb is more than ok

Do you create applications like CMS or similar?

me? no im more of a designer/photographer/video production person

You = 2. singular OR 2. plural in English :/
but the advantage – only 1 easy word
rm, i’m looking through webpages to check the size of their libraries

jQuery is a nice javascript lib that is realy small
what lib are you using ?

libsmall is also very small

url ?

rm, my own lib
even AJAX
I optimize everything
If you want to see it, tell me.

nice, i find jQuery the most usefull piece of javascript code i’ve ever seen
you have such selectors like $(“#someid”).style ?

how might I determine the number of rows of text in a textarea?

count the \n ?
but i’m not shure

hmm, that wouldn’t count soft returns

I’m looking for pastebin with UTF now

http://tuckey.org/textareasizer/ this guy almost does what i want to do, but his code is buggy, is there a better method?

http://www.unit1.pl/pb-464 – i think some functions can be joined (e.g. Hint() with Show()) – true?

hey everyone

I has Polish comments but i can translate them to English

hello
what is the alternative for e.keyCode
IE is giving me an error

which

thanks

welcome
http://www.quirksmode.org/js/events_properties.html

I got the code from there
it was like
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
and that was where the error was

yah

IE was giving me error on the keycode

omg

so this code is not correct
SimpleSample omg what?

nothing

I took these lines from quirksmode

did you check if e exists on IE?

I used this samples in my scripts and works fine

csaba no

oh

if (!e) e = event;

if (!e) var e = window.event;
=x

mine is shorter :p
hope that didn’t sound bad

yeah

oohhh right.. forgot that
thanks

but, window.event is faster
when you use only event

why would it be faster?

the engine have to look if have a event variavel in scope of current function

thanks it is working fine now

oh

is someone available to take a quick look at this javascript menu and suggest what is causing the alignment issue? http://24.150.163.19/grindclothing/women/index.html

on the other hand it uses more time to parse “window.”

is a “full path” to get variable
less one verification

yeah but it saves time on parsing window.

I click something in IE, and then I have to click something else for the event of the first click to be fired

paste src

This is part of my source: http://pastebin.com/d772aacac
It’s trying to be very generic (not my code), however it works fine in Firefox

what is this.old_onchange ?

This is how my code overwrites event handlers; I wonder if this is the problem
It’s null

no but is it a custom attribute?

Yes
Is this problematic?

i’ve had some problems with custom attributes in IE, I solved them by assigning a random namespace… like t:myattrib
maybe that will help

=/
I never have problem when use getAttribute

most of the time me neither, but sometimes when it just doesn’t work under IE I assign the namespace and it magically starts to work

lol

How do I set an attribute with a namespace

old and good IE…

setAttribute(‘t:myattr’, ’something’) ?

maybe in quirks mode it would work without the namespace, but I always do DOM mode :/

setAttributeNS(string:namespace,string:property,string:value);

Thanks

(y)

I just can’t figure out how this works, any idea? http://www.danga.com/misc/jsdraw/xmlhttp.html
I’ve looked into it and he’s not creating small 1px divs.. or any other element
and it’s not canvas

i will see

http://www.danga.com/misc/jsdraw/xmlhttp.html —– cool ^)

cool we can all see the same drawing
i’ll wipe it now

why not canvas?

I don’t see a canvas do you?

I mean

I mean why you dont use canvas?
or you use it

how do i attach an onblur event in ie

It’s creating the image on the server side and returning it as data from what I can make out

how does it return as a data?

base64 encoded png
select-all, right click, view selection source

ahh yeah I see… it doesn’t work under ie
it’s all clear now

that’s because IE doesn’t let you access the response from XHR until the connection closes

I think ie doesn’t recognize base64 encoded images
at least not ie6

also true

or so i’ve read somewhere…
then it’s nothing special, I thought I’ve just discovered something fantastic :p

csaba
i don’t know how

Woosta solved it

‘js domref

oh yes

whoops
`js domref

png

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

I see this when debug with firebug
the png code in cmd variable
well, I have to go
I will travel today

bye bye

cya

Woosta, how image refresh?

XHR stream
data comes over it constantly
When there’s enough data to call it an image, it gets flushed to the drawing

it’s still better to use canvas, at least it’s supported by IE, FF, Opera and Safari…

having trouble getting my five start rating to save it’s state, without serverside help. so far it’s just css creating a nice hover over effect, but when a user clicks a star, it doesn’t keep them ‘lit’. any ideas how i can do this?

no canvas in IE afaik

there’s a javascript lib which simulates canvas for ie

that doesn’t count

ehh

google wrote and release a canvas lib for ie
so yes, canvas would make it work on ie

i stand corrected

I have column with ~40 small images (~160×100px) and i am moving them up/down while onmouseover on arrow. Now they are moving every 40 miliseconds by 5 pixels up/down and it`s moving smooth only on faster PC. On slower it`s eating 100% CPU and moves laggy. Is there any way to get same effect but
less consuming CPU?

the challenging part of comet is the transport…

What is the most popular action when AJAX fail? Alert? It can scare users.

standard XHR works on firefox, safari, opera; last i knew it wasn’t suitable on ie without periodic checking
multipart XHR is great but firefox-only
event-source is pretty good but opera-only

yeah

we need a good XMLSocket-to-JS bridge

IE requires polling which is horrid

yeah
iframe works but it’ll display the spinner continuously

What do you think about displaying AJAX request’s status on the statusbar?

i seem to remember that a year or two ago, whenever i visited a site with ajax in it, IE would display a warning message about activex components… now that doesn’t happen anymore. Was thee a silent update of IE that turned that message off?

there are multiple active x controls

yeah but xmlhttp is also activex

some give warnings
the newest ones don’t
also, IE 7 has native support for xmlhttprequest objects

tag contained within it? I wannah be able to do, this.element[0].color=white; or some crap like that

Yeah but I even remember a client was complaining about the warning message, and we said there’s nothing we can do about it… and now it doesn’t appear anymore

So how would I pull this off in LiveScript?

this.getElementsByTagName(“font”)[0]

wheee

How can I capture error code in AJAX?

status

Hmm
this.getElementsByTagName(“font”)[0].style.color=white; doesn’t appear to be working

good lord IE is pissing me off today

.style.color = “white” maybe?
only today?

lol
SWEEET

style.color=’#FFF’

miro’s example is more correct

Will do that

document.frm_addcontact.elements.length —IE doesn’t support that?

Such a shame that JavaScript gets confused so much with that OTHER language…

that is the proper way to count the elements in an array right?

it is

then why the heck is IE giving me an error

and it should work in IE as well
Try this:

nevermind I figured it out
I was using a reserved word

function checkempty(theform){
boo

yeah I’m pretty new to this

http://www.javascriptkit.com/jsref/elements.shtmlhttp://www.javascriptkit.com/jsref/elements.shtml
err – only once O_O
But that site has an example

can I use javascript to change the class of an element ?

`forms @ hmmhesays

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

yes, yourElement.className=”replacement class list”

I can’t use elements[index] to loop through and get my element names?

I have a form with an iframe as target. Is it possible to know when the form has been submitted and data has been loaded in the iframe?

yes, you can, but avoid trying to access the form by it’s name like document.formName

having trouble getting my five start rating to save it’s state, without serverside help. so far it’s just css creating a nice hover over effect, but when a user clicks a star, it doesn’t keep them ‘lit’. any ideas how i can do this?

‘lit’ ?
so
you used :hover and :active ?

I’d suggest changing the class of the object onclick
object/image/div

miro, i used :hover

use :active, too
or :focus

that won’t help his problem

so i can figure out how to change the star the user clicked on to change by changing the class, but i can’t get the ones to the left of the one the user clicks to stay lit

change their classes, too

for(i=1;i=x;i++) { make star x’s class “on” }

*make star i’s class “on”

hmm, i wish i was better at javascript

How many times is AJAX request’s status changed to “loading”? Only 1 time?

‘Ajax’

hey everyone

‘lo

Hello

what’s up reisio , fatbrain ?

givin’ my brain some exercise
et tu?
‘lo fatbrain

not much here, workin on some 12 year old computer that i rebuilt inside a typewriter case xD
item used in the largest quantity for that project:
….duct tape
5 feet of it

document.getElementById(‘finger’ + i) has no properties, what?

that means it doesn’t exist…

is ‘finger’ + i correct
i being my count for a for loop

well, can you pastebin the code?
you might just have a wrong number somewhere
i’ve done that many times with loops

~bin

?

oh, i was hoping for a bot to paste a pastebin link

heh

function rageMeter(fi” (9 lines) at http://erxz.com/pb/3968

nonononono

oh, thats nice though
uh oh

all the js and html
lol
found it
change for(var i = 0; i fingers; i++) { to for(var i = 0; i sizeof(fingers); i++) {

http://erxz.com/pb/3969

erm… sizeOf – make sure it’s caps
change for(var i = 0; i fingers; i++) { to for(var i = 0; i sizeOf(fingers); i++) {
there

Eh?

he was going through a loop using numberarray instead of numbersizeOf(array)

Look at the code
It’s an int, not a number
and sizeOf???
This isn’t PHP
yourArray.length is JS

ew, php.

hah, i was thinking it looked a little familiar

erm… ok….but i used sizeOf in js before..but ok

Do you have more than one id=”finger1″ on the real page?

nope

sizeOf([1,2,3]) // no you didn’t unless you wrote it

Error: Error: ReferenceError: sizeOf is not defined at line 0: (null)

idk… i might’ve written it then O.o
but i know one of my scripts used it lol… my bad

function sizeOf(ary){return ary.length} sizeOf([1,2,3])

3

stupidly pointless function

so fingers.length worked, to say it doesn’t give me an error anymore

an interesting point I found that in IE and FF length of [1,2,3] and [1,2,3,] differ.

but it still doesn’t do what i want

hm? what’s it do and what do you want it to do

because ‘fingers’ is stringified and so has a length of 1

oops, sorry, not FF but Netscape browser.

yes .. IE is stupid

and I’m attempting to access the results by document.getElementById(“HTTP_RESULTS”).innerHTML = xml.responseText; I can alert(document.getElementById(“ID FROM THE RESPONSE”) and it displays what the object is but I can’t perform a alert(document.getElementById(

“ID…”).value or .innerText or by .VALUE_I_CREATED.. It works in ie but not in firefox.. Any ideas what I’m doing wrong?

still have to live with it

yeah
pita

yeap

well, i want a standard hover star rating script, but instead of submitting the users selection with ajax, i want it to save the selection to a hidden form input and keep the selection ‘lit’
does that make sense?

yea

where is id=”finger0″ ??

cuz you have capitalized attributes? i dunno if that would mess it up but all attributes should be lowercase

it’s capital in both places.. does html require them to be lowercase?

should i start my for loop from one?

Don’t ask that. Work it out. What do you think?

oh, not HTML, it’s a little more valid but i dont think it’s required except for XHTML

it seems like this should be easier and i’ve gone the hard way

once that works, you need a few other things to get it working like you want

*

I mean if I p id=”MYNAMETRUE can’t I alert(document.getElementById(“MYNAME”).innerText); to produce “TRUE”?

WTF?
are you just making shit up again?

?
what?
what the hell?

i’ve already got the hover with css working, and the hidden field gets it’s value correctly. i just need to get the fingers to stay ‘lit’ until the form is submitted so the user knows

Or even p id=”MYNAME CUSTOMPART=”OTHER VALUE”TRUE can’t I alert(document.getElementById(“MYNAME”).CUSTOMPART produce “OTHER VALUE”?
it works with ie… just not firefox for some reason..

idk, you might need to use document.getElementById(“MYNAME”).getAttribute(“CUSTOMPART”) but that’s just a guess

tryng to figure out why..

The size of my library increased to 3,5KB

you’ll need a second loop after that one to turn the className back to what it used to be

do you need to use .getAttribute for everything? ie .innerHTML .innerText .value etc etc?

?

no, but for a custom one you might

right away?

which will be rather hard unless you *append* the new class

just a guess though

I use Date(), but it has a resolution of about 15ms. is there a way to get even finer resolution?

is there an easier way of going about this
maybe an all javascript approach

think about it .. you start from 1 and go to 4. Then change your mind and click on two, so you go from 1 to 2. 3 and 4 are still turned on though
it’s simple.

the problem is, i really have no idea about javascript, structure, functions, nothing.

if I do a alert(document.getElementById(“MYNAME”)); it produces [Object html hosting Paragraph Element] but if I alert(document.getElementById(“MYNAME”).innerText); or really .ANYTHING it produces undefined..

my version of the loop: for(var i = 1; i = 5; i++){ var el=d.gEBI(‘finger’+i); el.className = (i = fingers) ? el.className + ‘ fullFinger’ : el.className.replace(/ fullFinger/, ”) }

oh you’re trying to get the text inside it?
wait, i just realized somethin you said earlier, i meant ID=”blahblahblah” should be id=”blahblahblah”

both.. I want an attribute I set as well as the text inside

So we go through from 1 to 5. If the one we’re up to is less-than-or-equal to the one we want, we ADD ‘ fullFinger’ to the classname. If it’s higher than the one we want, we REMOVE ‘ fullFinger’

the actual attribute “id” has to be lowercase, it’s value can be whatever
well not has to be, should be
like i said – might not be the problem but it’s worth a shot =p

it finds it with uppercase as well and knows it’s [Object HTML Paragraph Element]

hm
odd

but maybe that’s part of the issue.. I’ll try lowercase too

theDivContent = yourDiv.textContent || yourDiv.innerText

trying now

I don’t follow..

Don’t follow what?
You want the text that’s in your element (I said ‘div’, should be ‘p’)

hi… Is there a way to convert a div to an image?

no

it still doesn’t want to save, it doesn’t look like the class is changing?

no idea without an actual implementation to play with.

well, I can document.getElementById(“MYNAME”).getAttribute(“CUSTOMATTRIB”) and it produces a value but I can’t get .innerText by using .innerText or getAttribe(“innerText”)

can i message you url?

ok, but can’t get it like a print-screnn?

getAttribute wont work with innerText, try innerHTML?

How do you get the contents of a THISPART? p_obj.innerText right?

there may be something with canvas .. I seem to recall it could do something like that with a whole page ..
only on IE

oh..
so it should be innerHTML?

p_obj.textContent || p_obj.innerText

tks… i’ll look for it…

so that’s the universal solution?

yes

ok now i understand..

for every click, it’s adding a new fullFinger class properly. clicking the second one adds a fullFinger to one and two

ahhh
good point
you’ll need to remove it for all 5
or not add it if it’s there
but removing is easier :-D

but when it’s there, it’s not having any effect

my version of the loop: for(var i = 1; i = 5; i++){ var el=d.gEBI(‘finger’+i); el.className = el.className.replace(/ fullFinger/, ”); if (i = fingers){ el.className = el.className + ‘ fullFinger’} }
Then you have CSS problems :-D

thank you very much that was driving me crazy

no probs

javascript is driving anyone crazy
today I found a little bug in IE
the damn IE wasn’t counting my “tab space” as a text node …

you mean something about IE isn’t a bug?

Is there any decent webpages that give small examples on various differences between IE, W3C standards and other browsers like firefox?

so by using childNodes a get a bigger table on other browsers xD

or examples on how to make it universal like p_obj.textContent || p_obj.innerText solution?

positioniseverything.net keeps a list of IE bugs

IE is the bigest shit ever :p

webdevout.net has support charts
www.quirksmode.org for js

http://phpfi.com/255383 – if I change Requestinstance.loadText later, i have to call setID() again. How to avoid it?

The paste 255383 has been copied to http://erxz.com/pb/3970

var blah; try{ blah = p_obj.textContent; } catch(e){ blah = p_obj.innerHTML; } alert(blah);

I wish I could change loadText variable when I want.

got it resolved thanks to Woosta.. But thanks for all your help
thanks for the info

oh and Aptana has very simpler yes/no indicators in code completion drop-downs
simple*

I have very little javascript in my app and it worked in IE but now I’m working with firefox from home since I don’t have ie (linux machine) and a few things were broken that worked before.. such fun
what’s Aptana? webpage? and you mean you can paste code and it tells you if it’s cross browser compat?

aptana.tv
’s’a big plugin for Eclipse, for web development, with extra focus on JS

TopStyle 3

and yeah it tells you a little bit
it’s not like webdevout.net, but it will help you along
topstyle does it, too, but topstyle isn’t open sourcey

thanks I’ll look into all those pages

yea but topstyle rox and is very lighter ;p

http://phpfi.com/255389 – simple example

The paste 255389 has been copied to http://erxz.com/pb/3971

not light enough to meet my wallet or my jolly roger, though
are you using Winders?

How can I change “text” variable in Loading function without calling “other” method?

Winders? you mean windows? at home no.. I’m in linux

k

Anyone familiar with Yahoo TV listing?
e.g. What does “(CC)” stand for?

So do jQuery and Prototype do about the same things?

I would think they are equivalent to each other

Common Content maybe ?

Then I’d imagine there’s a hot debate about which is better?

Maybe… donno
Kind of strange they didn’t supply a legend or something for the abbrievations used in the lsiting

there is much debate, google jquery vs. prototype

Does anyone know which has the edge on the iPhone
I hear it’s a slow JS interpreter

Close Captioned at a guess

sounds resonable…
“TVPG” is part of USA rating system?

No idea .. I’m in .au

ok :-)
thanks for (CC) intel.

np

http://payplay.fm/pineboxboys/wma/6

as w /msg w gn8
gn8

im trying to change css with JS but background-image doesnt work…

Then you did something wrong.

try obj.background = ‘url(your-url)’;

I thought select elements were able to have no value.

er

invalid assignment left-hand side…

obj.style.background

document.getElementById(tab).style.background-image = “url(‘../images/theme/ta…

.style.backgroundImage
- is the minus operator.

element….

rather, the value of the first option element

Yes

?

is that supposed to happen?

Yes

can only have a value that is held by one of its options

I’m having problems with an onkeypress event where I’m attempting to identify the ascii value.. if I evaluate myevent.keyCode it works in ie.. if I use myevent.switch it works in firefox.. How can I test what browser is viewing the code? or am I doing something completely wrong?
W3C has an example of if(window.event) // IE {keynum = e.keyCode} else if(e.which) // Netscape/Firefox/Opera {keynum = e.which } which works for Firefox but not for IE.. if (window.event) is never true

i got my star rater pretty close, but it needs just a little more help

hi?

hi

i have a problem with js :/ i have a script inside of a DIV .. the innerHTML of the div will changed by another script.. now i want to execute the “new” script inside of the div.. but only the old script will be executed

why are you doing it like that? :|

to pop-up a window if a new message is stored for the user
but the window.open inside the div will not executed

W3C has an example of if(window.event) // IE {keynum = e.keyCode} else if(e.which) // Netscape/Firefox/Opera {keynum = e.which } which works for Firefox but not for IE.. if (window.event) is never true

how do i sleep JS? Thread.sleep(4000); doent work, it just pauses
nm
well, how can i just sleep()…?

uhh
This isn’t java
You’d need to define a function and then use setTimeout
window.setTimeout(yourFunc, 4000);
function yourFunc() { … }

http://www.anime-manga-project.de/index.php?nb&module=ampm – the function “ShowMessages” is the problem

its inside a function though… i want to innerHTML = “foo”; sleep(4sec); innerHTML(“boo”);

just make another function then

i did window.setTimeout(Dummy, 4000); and function Dummy() {}
nothing, so i tried calling Dummy() and nothing

how about you paste your code instead of randomly telling us bits and pieces

http://216.195.183.252/ws/movielist.dev/html/ http://216.195.183.252/ws/movielist.dev/html/script.js

anyone here know wordpress

You need to learn about setTimeout. Javascript != java.
You need put the code that you want to execute after 4s in that function
That’s working as expected, in 4s it’s going to call a function that does jack squat
Scotepi, consider looking into jQuery. It’s simple syntax and a lot easier to learn than pure Dom based JS
http://www.jquery.com or #jquery

does window.setTimeout(Dummy, 4000); call Dummy or just set a setting on the function?

it will call it, after 4 seconds

k

what you prefer to use – function a() {} or a=function() {} ?

former, because it’s normal

normal ?

normal

http://en.wikipedia.org/wiki/Television_content_rating_systems#United_States

The former is more efficient, since it’s pre-compiled before the script is run
But the latter is sometimes necessary

when? i only find it necessary with ajax, when i need to eval the response that i’m getting

Whenever you don’t want the function to be pre-compiled, basically — usually closures are involved
eval() an AJAX response? That’s not possible in most cases. It’s JSON that’s eval()ed, not XML.
Also, I’ve no idea how function expressions would be necessary there.

i’m not always using ajax for xml

AJAX: Asynchronous Javascript and XML
If it’s not XML, it’s not AJAX :-)

##javascript — a channel of pedantic bastards :-D

Heh

`jif

Javascript Interaction Framework. It’s just like AJAX but without an implied dependence on XML. Woosta’s JIF library is available at http://rick.measham.id.au/javascript/jif.js

^^ Including, of course, me :-D

that might be true if ‘Ajax’ were anything more than a buzzword for a methodology :p

if i’m doing a request to a none-xml page
and than using responseText
it’s not ajax ?

No

no

cool.

It’s not AJAX if you pass false as the last argument to xhr.open() either.

http://erxz.com/pb/3972
trying to insert a newly createElement(“tr”) into a table I just created.

Could somebody take a look at my little sample here http://www.pastebin.ca/651810 WHen I process an onChange I want to be able to access the other input in the table.. I’m having problems travesing from one to the other

The paste 651810 has been copied to http://erxz.com/pb/3973

try replacing document.body.maintbl.appendChild(tblrow) with tbl.appendChild(tblrow)

k. thanks
works great, thanks a lot

no problem

http://www.pastebin.ca/651815 — here in an updated cleaner portion.. Can anyone answer the question on the pastebin for me? It seems to work in IE but not Firefox.. not sure what I’m doing wrong

The paste 651815 has been copied to http://erxz.com/pb/3974

it seems to me that the myObj.parentNode is refereng to the TD element

between the two td’s ignoring that it should still be correct right?

not to the TR as it should be

now, I have about 3000 character on 1 line in my html
usually I just use document.write(“\n”)
but that makes it not work.

does SecondInput = myobj.parentNode.parentNode.nextSibling.firstChild; work?

I entered it wrong.. take a look at the new pastebin once http://www.pastebin.ca/651820

The paste 651820 has been copied to http://erxz.com/pb/3975

so this works in IE but not FF?

yeah

i think the problem might be in FF’s treatment of whitespace

/td

the spaces between the elements are registered as their own nodes
at least within the context of each TD
so if you can have
td id=’first’input id = ‘myInput’ type = ‘text’/td
td id=’second’input type = ‘text’/td
maybe that will work?

hmm that makes sense cuz when I alart(newobj) it says text somethign
I’ll give that a shot.. that’s really annoying that whitespace matters.. is that a W3C standard or firefox is anal?

well what if it was a word rather than whitespace? you’d want to be able to parse that into the tree
so, i don’t know

true but I thought whitespace was ignored.. does \n and \t also count?

id assume it would if its in an element usually regarded as holding text, TD, P, etc

and respective indentation and formating i dont think it would matter

http://www.w3.org/TR/xml/#sec-white-space

so I can to from td to td ignoring anything in between?

“An XML hosting processor MUST always pass all characters in a document that are not markup through to the application.”
node.parentNode.firstChild
that’s the first sibling

but the firstChild might be whitespace or text..

yes
so you want a loop that checks for elements

if you’re working in FF, firebug has an excellent DOM browser
that you can select an element

can’t I get the firstChild(“td”) where it checks all it’s children for the first instance of td?

and view its parentNode, siblings etc

hmm never used a DOM browser before
but now that I found it it looks like it’ll do the trick

you can use getElementsByTagName
or, for cells in a row, row.cells

hmm

or wait for http://www.w3.org/TR/ElementTraversal/ to be implemented
http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-64060425

ill just be happy when e4x is available in all browsers in a consistent implementation :-)

yeah the DOM browser confirms the whitespace was the issue

tags.. if there was a getFirstChildByTagName() that would be great

but I’ll just remove the whitespace for now

well you could always iterate through it
checking each element to makesure it wasn’t whitespace

or use XPath

hai hai
I have a question
what’s better:

hehe, yes or something like jQuery, i don’t know how all of you stand on frameworks

a set of 52 png letters, or one image with squared off letters that I can change the location of inside a div?

what’s XPath?
ehh yeah I could do that too
how that DOM browser is handy stuff.. wish I knew about it ages ago

firebug is much more than just a DOM browser too :-)
more like a jedi-macgyver-swiss-army knife

firebox included in firefox or some sorta addon?
err firebug..

addon

the latter may be more efficient
`ala sprites
http://alistapart.com/articles/sprites

so adding in tons of blocks of the same image is not going to waste memory?

wow firebug is freaking awesome

“agnokapathetic” at 71.6.194.243 pasted “function getFirstChildWithTagName(tagName)” (21 lines) at http://erxz.com/pb/3976

that should do something similiar to what you wanted
if you don’t have any application qualms about prototypical additions to HTMLElement
and of course that doesn’t run in IE :-(
bah. you can never have anything good in this world

I think just by learning the little tricks I can get stuff working in both rather than wonder why the hell it doesn’t work in one

why not getElementsByTagName(…)[0] ?

and sometimes I don’t..

hmm even w/o the whitspace FF still adds a text element between any td/td
can I getElementsByTagName(“td”)[LAST]?

you can store it, and use cells[cells.length - 1]

hmm I might have to do that..

by the way, http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-6986576

can i make a form pass custom headers on submit?

don’t think so… what header do you want to request?

its the same thing that the stumbleupon toolbar does. they pass a custom header so they can verify that the request came from them
i want to do the same

any POST or MIME form submission is passed as a request header… I don’t see what using another one buys you

this is what a SU post looks like
http://pastebin.ca/651860

The paste 651860 has been copied to http://erxz.com/pb/3977

see lines 12, 13, and 14? i want to pass headers like that with my form

like what?

same type of thing. like a hash to identify that it indeed came from my form or something

can I trigger an event manually? ie allows obj.fireevent(eventtype) right? firefox doesn’t…
err .fireEvent..

I don’t see any custom headers in there

hi guys, I need a multiuploader that also works for linux, do you know anyone?

apart from those added by ‘mozbar’, but that’s a firefox extension isn’t it, not a javascript
which header are you actually referring to?
cookie is not a custom header, cookie is your browser cookie for “www.stumbleupon.com”
and if you want to play with cookies from javascript see here – http://www.quirksmode.org/js/cookies.html
or just google it
your server side scripting language of choice is also likely to have built in support for cookies, you don’t need to think about headers at all

ah obj.onchange(); pushes an onchange event..

er…can you send AJAX requests to external servers?

XHR can only talk to the same domain as the requesting document

oh dewi i didnt see you replied to me
http://erxz.com/pb/3977 lines 12/13/14 are sent by mozilla? not by stumbleupon?
i was under the impression that stumbleupon was sending those
infact, i dug through the code and found them setting the headers with XHR
so woosta, how would SU do it?

the X-SU ones? it looks like an extension with the ‘mozbar 3.06 xpi’ thing

hi-yawn-hi

yeah but like i said, the stumbleupon code sets those headers

an extension is a different thing to javascript running on a page
even though they are both written in JS the security model is totally different
and available API

ah ok

so if you are writing an extension that stuff is useful to you
if you are not, I’m not so sure
however a quick google does seem to indicate that you CAN send custom headers if you’re constructing requests manually using those AJAX primitives

yah, xul/xbl gives you access to a ton of stuff

but I haven’t played with such things

yeah but not to external sites, apparently?

no, that would be insecure

right

well… wait. Not so sure about that.
what site are you trying to access?

SU actually. trying to make my own “thumbs up” button basically

yah, XHR has a strict same-domain policy

Comments off

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »