Good morning all We recently upgraded from MySQL 5022-log to MySQL 5044-log on a CentOS server We run a service

indeed i did read it.. even though it means little to me as it was working before and i do not know of changing any settings and it therefore seacing to work

'expire_logs_days=10', remove or comment out this crap out of your bloody my.cnf, Sniper_jo
how about the 2nd line ffs?

this is an unintended side effect of the progress in linux distros. anyone can install powerfull server processes, with no idea of how to manage or secure them.

and the the 4th?

blah.. ok i was going to try and keep the contents of my databases
but who cares…

adaptr, ah, yes, the good ol' times….
Sniper_jo, are you in write-only mode? omfg

Cheers for the advice

what have your databases got to do with anything over the last half hour ??

[ended] is a hint. Now that you know the problem, you're giving up??

Get out and have fun.. before the next fedora linux distro comes out..

sad little fscktard
he's been bullied by the smarties!
grow UP

indeed i have… hence i am leaving..

get a life, dude

Strange. That's not a good sign when you lead him to the finish line and he doesn't recognize it.

it's circumstancial evidence of Win-think

well if you were perhaps a little more helpfull i may of surpassed the finnishline

o_O, I step away for 10 minutes and this is what happens?

this kid thinks he can be clever.

you got your answers ! how DARE you claim you were not helped, you ruthless little fucktard

/o\

settle down a bit, it doesn't have any bearing on any of us

let alone non-paid help

i diddnt claim i wasnt helped.. would just be good if it wasnt in riddles

of course not, but this back-biting is reminiscent of a 6-year-old

volunteer is the word I was looking for

as far as I know, the helpers did their best to figure out what your problem was.

Yes, so quietly ignore it please

grumble…

guys, lets move on..

is that the way you talk to 6-year-olds?

inddeed… to reinstalling mysql

you vicious old madman

I don't know - I don't know any

adaptr, I do, they will take over the world

prolly, yes
with their cellphones and their interwebs and their chauffeured cars

hah

erstazi has been watching too many Kids Next Door episodes imo

we'm too old now - can't take the strain anymore
can't keep up with the MTVs

inviso, nah, just got kids of my own and step kids
they are evil

oh you meant *eventually* - hah, hard to argue that

heh

ciao ciao

Sniper_jo, auf wiedersehen

i hope xgc finds some form of happyness
even if it is infront of a computer screen

that's an odd statement.

Sniper_jo, leave while you can ffs

lol
ok i am gone

provoking us any more would not help your case.

what a fscking retard

inviso

inviso is a perl hating bastard

psh, not that silly

hehe

of all the people in #mysql, thats the first time I saw someone cause a fit

I mean super, kick him in the face powers

karma inviso

I have inviso with a karma of 3

we get 4-5 of those a day in #apache. adaptr and I are used to them

bot does not forget

thumbs, I attend #apache occasionally

well, not that obnoxious though… just clueless

karma archivist
awww, he doesn't love me though

thumbs, I must join when its quiet heh

yes. You must have never met pradalver

trailing space problem inviso

and setuid

karma archivist

I have archivist with a karma of 19

thumbs, yes I have, let me think…

ah

setuid ftw !

i must fix that

thumbs, what about that nick? it rings a bell

the only difference is that setuid thinks he knows what he's doing.

hello there anybody knows the channel for pevasive sql hosting or can help me a little about it ?

when in fact, he's misleading everyone.

he was so everything-less it wasn't even funny

*pervasive

Do you have some specific sql in mind?

anyhow
we have months and months of logs for your entertainment, if you wish.

thumbs, if I had months and months of time I would laugh about it heh
thumbs, I can imagine, I have seen many good flamers in my day that can start a flamewar over a penny

the worst are the ones that refuse to help you help them, and question the validity of your answers.

no actually i wanna know something basic … i got a windows 2000 with a programm on it which uses pervasive sql. Now the hd broke and i have a file backup from the system which i cant boot from. the programm got run once a week so the db shoudnt be corrup. Can i somehow retreve the data from
these files ?

thumbs, swimming in de-nile

so i can insert it into the new database or can i just copy some files ?

blubs, Pervasive PSQL is Pervasive Software's relational database (RDBMS) product

How is pervasive sql host related to MySQL?

blubs, http://www.pervasive.com/psql/
blubs, a href="http://www.pervasive.com/psql/"http://www.pervasive.com/psql//a

erstazi actually i just came here because u could probably know the channel where i can ask .. or anybody probabaly knows about it still

someone have enemy territory tc in kubuntu?

try #sql or try support directly with the vendor. It looks like a commercial product with commercial support as part of the purchase.

threnody, .ch != .fr (.fr is SniperJo)

Keep hitting this nasty bug with myisam+triggers+"for update" queries. Scripts were wrote for innodb, I changed table types and continually get 127 errors …

inviso, agreed

ok thank you

perror 127
!perror 127

Record-file is crashed

ouch

adaptr, threnody, heh

no, 43%

Take a look at http://dev.mysql.com/doc/refman/5.0/en/table-maintenance.html
Take a look at a href="http://dev.mysql.com/doc/refman/5.0/en/table-maintenance.html"http://dev.mysql.com/doc/refman/5.0/en/table-maintenance.html/a

heh

rounding error

my feet smell
sorry, I was thinking off the top of my head… I been very busy on my feet making reloads

come again?

thumbs, reloads of rifle ammunition

ok…

foo.sql', can I recover that "snapshot" as simply as 'sql -uroot -pwhatever foo.sql'?

hi guys, when i hit my website, i get "SQL/DB Error — [Field 'link_title' doesn't have a default value]" — I want to turn these errors off on the site. Is this a mysql setting or a php setting?

that's the basic idea

the command is "mysql", but yes

thanks folks - that will leave any other databases alone, right?

sounds like a php hosting problem

I typo'd…

i turned off both "display_errors" and "display_errors on startup
in php.ini

You can open the .sql file up and look at what it will do if you don't feel comfortable running it
and what is SQL/DB? Sounds like a php db library

Can't connect to local php mysql web hosting server through socket '/var/lib/mysql/mysql.sock'. Does anyone know why this might be happening?

sounds like it's not running

I have, and I feel more comfortable having done so, but I've avoided learning SQL for many years now. I just wanted to be sure.
Thanks a bunch!

np, good luck

how do you start it up?

/etc/init.d/mysql start or something similar to that

k, thx

or /etc/rc.d/rc.mysqld start

damn, neither of those exist

rc.local?

what linux distribution are you using?

I'm using centos

ls -l /etc/init.d | grep mysql

provided he even has an init.d directory.

If he doesn't, we'll know shortly

I have an init.d directory
but that command does nothing

Is it possible to not have one? I mean wouldn't you be running of a bare kernel otherwise?

sounds like mysql isn't even installed?
How did you install it?

I installed it using yum

you would have a BSD-style init structure then
i.e. /etc/rc.d/rc.*

Like on my slackware install. But essentially they are the same no?

as system root do 'service mysqld status'

slackware is different.

it's an unrecognized service

hehe for a second I thought I was in ##linux

yum list installed | grep mysql

heh.

you didn't install the server

it shows mysql.x86_64 and mysql.i386 as being installed
and mysql-libs

grrr, wtb man yum

as system root do 'yum install mysql-server'

thx

mysql-server is the package name? Saves me looking it up

as I recall

ah ha, here's the yum command I was looking for. yum search mysql
That should give you a rather long list of all available packages with the word mysql in them. Pick and choose as needed

you might find that the CentOS 4 yum install of mysql server creates the proper rc.d kill script links, but not the start script links. So when you reboot, the server might not automagically start. Remember that if it happens.

im still getting "SQL/DB Error — [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]" how do I turn off these errors?

a better solution would be to fix the broken query

^agreed

I'm getting the same error as Kev

i know but i dont want every error to be public

php only returns the mysql error if you code it to do so.

i turned off both "display_errors" and "display_errors on startup" in php.ini

then make sure your queries don't throw any errors
i.e., do input validation.

mysql_query() returns false if the query fails. The error is only show if you call mysql_error()
shown*

that's an error message from a db wrapper library

does mysql have a "strict mode" or something like that?
i thought i remember hearing about something like that
and i need to turn off strict mode or something

you need to look at the php code itself. Look for '…mysql_error(
you need to look at the php code itself. Look for '…mysql_error()…' in there somewhere.

Yeah just comment out mysql_error()

plus fix your query.

Anyone think they could help me out with my error e_e

You might want to keep the errors, maybe head over to php.net and learn how to print those errors to a file for later use.

i found this in my.ini
# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
can i just comment out this line?

you're asking in the wrong channel.

… that's from mysql's ini file

doi
sorry

I'm getting the same error as kev but it's saying "MySQL server version for the right syntax to use near 'ORDER BY time ASC' at line 1:undefined"
Here's the query "SELECT * FROM public_chat WHERE timeNOW() - INTERVAL 30 SECOND AND map=".$_SESSION["map"]." ORDER BY time ASC"

http://dev.mysql.com/doc/refman/5.1/en/faqs-sql-modes.html
You'll need to figure out which mode is suitable for your queries.

ok thx
that could be same for henaro too

I'm not trying to make the errors not visible i
I'm trying to fix them

Well I'm assuming kev2 is running what he believes is a valid query …

I think I'm running a valid query

lol

But I'm an idiot.

henaro, what does $_session["map"] return?

It returns a number
Which is set on login to 1

so is ur map column a integer column?

ur?

Yeaah~

ok

It should be

well try this

Let me doublecheck

try a statement w/out the session stuff
just put in a number
"select bla bla AND map=1 order by time asc"
and see if that works

Okay

that why u know if it's a syntax problem or if ur session thing is giving u something bad
or maybe ur map column is not integer

Lol it got rid of one error and gave me a new one e_e
Heehee

fun fun

you're one step closer :P

I have it set as a tinyint(3)
Yeah

any way for you to drop the instant messagign acronyms, kev2_ ?

lol
im out anyway, peace

that is one annoyig habit.

?

using instant messaging acronyms, i.e. 'u', 'ur'.

thumbs, Oh in 6th grade I had a devil typing teacher that would eat us if we typed like that.
Mrs. Bruno
She was scary. I think she made me cry once.

select 4175/4067.42866 — trying to get percentage of that
that gives me 1.0264
think the percentage would be 2.64

convert the values before dividing them
also, that is definitely 1.0xxxx

what do you mwant conver them before diving them ?

4175/4067.42866 the dot is decimal point how to get 2? you need more than 8000 to get 2

lost me

the result seems correct

4175/4067.42866 — what the percentage of that ?

do you know division?

yes

that result is correct

i thought i had to * 100 the result value

if you want percentage, divide by 100 again
sorry it is multiply 100

select 4175/4067.42866 * 100;
102.6447

so, that should be correct

that dont make snese
102 percent

102%
your value is bigger than the dividor
*divisor

4175 is 102.64% of 4067.4286 is correct. you're not thinking clearly

percentage does not have to be between 0% and 100%

wonder how my co worker got 2.6447
Pct_above_Avg

this isn't coming from MIT, eh?

using a different formula, maybe -100%

mit no

is the divisor the avg?

count/avg

above avg probably means (count -avg) / avg , thats above

trying to get Pct_above_vg

you need to define that term first

what does the first figure represent, and then the second figure.

count(4175) is the number for a given day, the other value is the avg click for a given month
tyring to get Pct_above_avg

well, that days' figure is 102.64% of the avg click for the month.

the Pct_above_Avg is 4175(day clicks) are above the average number of clicks(4067.4286)

Unknown column '/mnt/sdb7/mu[e]sic/Röyksopp/Coldplay - Clocks [Röyksopp Re' in 'where clause' — beside that umlauts are borken the string is cut before end, i just wanted to aks whether this is just a matter of the debug output or a "real error"

so would i do (count -avg) / avg * 100 ?

that is your column name?
maybe it mean the literal, but use the wrong quotes

no, actually it's a value of the column `path`

according to the error message, it was treated as a column name

yes, that was what confused me too but in phpmyadmin my syntax works

please read error message carefully then debug

i did

you use " ?

no

' ?
or ` ?
` definitely won't work

"`" for table / row "'" for value

" might or might not work
maybe you want to check your sql statement again

I don't think that makes sense.

http://rafb.net/p/7Zy21H31.html

no, that'll work.

please confirm the exact sql statement, all those variables and concatenation, you won;t know exactly what is the sql statement sent to the server
i just saw it, `
you expect to type ' but typed ` instead

okay, thanks

quotes

Use ` around identifiers (database/table/column/alias names) and ' around strings and dates. MySQL does allow " for strings, but ANSI standard uses " for identifiers (which you can enable with ANSI QUOTES option)

If I want to select fields from more then 2 tables in a query how will I make that work? Some JOIN ON or compare a field like I do when its 2 tables?

http://www.wellho.net/solutions/mysql-left-joins-to-link-three-or-more-tables.html

thanks

This is probably more of a discussion question, but I'm curios to know what are the ramifications of greating merge tables on the fly for lots (approx 500) of tables, with several million rows in each table.

is there any way to get mysql's REGEXP matching operator to be case sensitive?

use the BINARY keyword in your expression

COLLATE is probably the new replacement of BINARY

Thanks for the help guys! I'll try this.

like 'select binary col from table where col regexp yadda'

argh, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `path` = '/mnt/sdb7/mu[e]sic/Air - 10,000 Hz Legend [2001]/Air - 10,000 Hz' at line 1 — what's wrong with this? *duff for all*

near WHERE, maybe just before WHERE

show the whole query

ah, got it!

select count(*) as value, value from table — i thought if i alias a column i could use its value else where ?

freibier!
thanks a lot!

look into nested queries.

hum
no error, but nothing updated

Installing the PEAR directory in roots directory could be the source of why an example from a book using pear HTML_Table wont work?

can i use UPDATE when content is NULL?

threnody, so without sub selects i can't use a alias else where ?

alias renames a column heading

Right. However, you can use an alias in the HAVING clause.

oic

you can order by, group by, etc

thxs

SELECT expr AS alias_name FR tbl HAVING alias_name 'k';
s/FR/FROM

I have an 11 gigabyte .sql dump file which I need to import into MySQL (it was originally exported from MySQL also). I use 'mysql dbname dump.sql', and it takes 8 hours to complete.

oic

_8 hours_. I have what I believe to be an optimized config for inserts, but this still takes _forever_ to complete.
Any way I can tweak this further to speed it up?

foreign keys in the database?

threnody, I don't believe so, but let me check
threnody, None

when you did the original dump, did oyu by chance use the –opt flag for mysqldump?

Nope
Schmee, This is actually a Wikipedia database dump (ships in XML, and I use their java tool, mwdumper, to convert it to .sql)

I though –opt was the default now, even if you don't call it

that's probably your problem. The dump file has a separate insert query for each record

Each insert is about 5M in size also

not that I know of, but I suppose it's possible

SQL

That's what the process requires at this point
Its weird, it seems to get progressively slower as more rows are added

can you show your table structure on pastebin?

Schmee, Sure, just a sec.

from the manual "…Note that all of the options that –opt stands for also are on by default because –opt is on by default…"

progressively slower suggests an index/key is being updated which will slow things down
cool. I didn't realise becasue I always used it anyway.

me too
need to find a way to turn off indexing until the inserts and updates are done

Schmee, http://rafb.net/p/QiropG48.html
Those are the three key tables in this particular import

you need to change the structure of hte tables to not have keys, then alter table ot add the keys after the import

Schmee, But won't that alter take 7+ hours on its own too?

nope

Ok, so truncate the tables, alter it to remove the primary key, import, then alter to add the primary key?

I remember reading in the manual that it's faster than to let the keys update during the insert

Query OK, 5365743 rows affected (0.22 sec)
So there's 5.3 million rows in each of those three tables
Let me alter that and see if I can get a faster import

I had a similar problem, but probably not to the same extent. I have a table with a couple of million entries (actually several tables) with an index that crippled the server during imports.
dont' forget to change the dump file to remove the create table sections

Wait, which index am I removing?
er… that'll be a problem I don't have an editor that will edit an 11G file

all indexes except the primary key

So in ep_en_page, that'll be page_random and page_len, yes?

and page_title

its not an index, its a unique key
And if unique keys also, why not page_namespace too?

look in the manual for '–disable-keys, -K'

yes, that one too, unless threnody has just hit on a way to bypass the keys altogether

hrm, checking/testing

alter table ep_en_page disable keys;

Query OK, 0 rows affected (0.01 sec)
hrmmm…

So now I have to check if the huge sql dump is actually doing a drop-if-exists on the table

no, it's a mysqldump argument. "For each table, surround the INSERT statements with /*!40000 ALTER TABLE tbl_name DISABLE KEYS */; and /*!40000 ALTER TABLE tbl_name ENABLE KEYS */; statements. This makes loading the dump file faster because the indexes are created after all rows are inserted.
This option is effective for MyISAM tables only.'

Its doing about 1,000 rows/second, importing

grep

kimseong, grep on an 11G file is no small task

grep can be set to only retrieve the first x results, or is that egrep?

maybe more or less, just need to check the first table

probably better off with a perl one-liner

rest should ne the same

strings huge-ass.sql | less
Schmee, I actually used a perl one-liner to add table prefixes
oooo, wait
Should there be a COMMIT after every insert?

no'

threnody, Looks like the SQL dump doesn't include any DROP/CREATE statements, its just an enormous number of inserts

not unless you configured it that way, using command line arguments. mysqldump does create table by default.

mysqldump wasn't involved in this process at all

that explains a few things

The original source was XML, which was then converted to SQL INSERT statements by a java tool called 'mwdumper'

my apologies. I misunderstood

threnody, No worries, its a convoluted process, but the whole database is getting close to 1TB
So its enormous

I would alter table and remove all indexes except the primary key, import data, then alter table to add the indexes.

threnody, I'm trying that, but what's weird is… when I issue the alter to disable the keys (as pasted above), then do 'describe ep_en_page;', it still shows the keys.
Should it?

and switch to replication
not disable keys, delete them
disable keys is an argument for mysqldump command

: actually it's also used in create/alter table as well

Then why was it accepted above?

use the drop index syntax

back in a bit. lunch time

So both indices and the two unique keys?

just not the primary keys

Right
ALTER TABLE ep_en_page DROP INDEX page_random;
etc..

I think so.
then import data, then alter table and create the indexes

Yes, testing that now

it'll take a while, but not 8 hours

I'm going to be doing this over on a monthly basis, so the quicker I can make it, the better
http://projects.plkr.org/encycloplucker/

you should see a significant improvement. But replication may be your real solution.

replication?
How will that help me here?

brb

is mysql bad when it comes to joins? performance wise?

not if you index correctly, and write good sql
I was assuming you were doing some sort of db backup

threnody, Just rsync to a backup slice
Ok, keys are gone, testing an import now

replication can create a duplicate database on another server in real time

I wish there was some sort of feedback with the redirect import approach

Hello, sometimes I have an 'duplace entry error' using large INSERT INTO, its a good idea to use REPLACE INTO instead?

Only if you want to replace the conflicting record.

so, will fix my problem?
?

So to be able to use a column in the WHERE clause, it needs to be an index?

no. it simply speeds the query.

what is better for me, INSERT INTO or REPLACE INTO? is very ver bad to have that error?

Alright, thanks
Why did you say I didn't want a reverse behavior for the foreign key? What harm would that do?

look at INSERT ON DUPLICATE syntax. http://dev.mysql.com/doc/refman/5.0/en/insert.html

that erros is very very bad?

depends to what you want, insert, insert ignore, replace, insert .. on duplicate key, there are 4 different situations

no. it just prevents you from inserting dupicate data based upon your database structure. you can use '…INSERT ON DUPLICATE UPDATE..' to manage it.

go and study the difference of the 4 situations and decide what you need

but, REPLACE INTO does not use it for me autmagically?

depend to what behaviour do you want to have

Your parent needs to be there so that you can add children. You don't want to remoev the parent just because you delete a child, even the last one. If at some point you do decide to remove the parent row, make that a separate operation.
On the other hand, when you decide to remove a row in the parent table, the constraint will not allow the operation unless you also remove the children. ON DELETE CASCADE allows that to happen automatically.

Alright
Still don't see the reasoning behind the first case.
Why would I want to keep the parent record that's unused?

To be able to add a child.
It needs to be there first.
It's much like having a color table and a car table that refers to the color table. Just because you have no cars refering to one of the colors doesn't mean you no longer want to have that color available.

Hey

Hi all, I tried moving the location of mysql.sock out of /tmp because it keeps getting deleted, but something must have gone wrong

Im trying to find a record based on part of a field (the email address). Select * from User where …;

I specified a new location in my.cnf, restarted mysqld, but no go

I can't seem to figure out the where clause to find based on part of it

threnody, ping

WHERE x LIKE y

real 33m46.770s

Look that up.

Ah, like. Thanks

So I went from 8+ hours with keys, to 33 minutes without keys

Yeah, am looking it up now

holy-freaking-shnizit

Make sure your clients who use it also know where to look.
Describe the bad behavior.

when I login via ssh , I can get the mysqld_safe deamon to start, but I cannot connect to the socket: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/home/k3005/stijn/mysql/socket/mysql.sock' (2)

Who can't connect? Be specific. Is the socket file at that location in the error message?

ut oh

yes, the file is there. I try to connect with "mysql -u …."

Does the user rnning the client have access to that socket file?

I need to add a unique key on two fields in a table… but phpMyAdmin won't let me do it
What is the right syntax? I need a unique key called 'name_title' on 'page_namespace' and 'page_title';

Use the mysql command line client or query browser.

Xgc, I use the cli

I think so… "mysql -u root -p" gives the same result

Just use a comma separated list for the colunm names: primary ket (f1,f2) or unique index (f1,f2)
primary key, that is.

ALTER TABLE `ep_en_page` ADD UNIQUE INDEX ( `page_namespace`, 'page_title' );

That fails

!perror 2

No such file or directory

That's what that error means.
The client doesn't have access.

right.

or the file is not there.

the client used to have access when the socket was in /tmp though…. I just stopped the server, specified a new location in my.cnf, and restarted…. this seems to have created the socket at the new location (as far as i can tell), but I can't seem to connect anymore.

whew, ok… this seems to work: ALTER TABLE `ep_en_page` ADD UNIQUE name_title(page_namespace,page_title);
I can't believe this 8 hour process was just shortened to 33 minutes

The file is not there or the client doesn't have access. This is entirely a local file system issue. There's nothing mysql specific about this problem.
If the server is listening on the standard port, you should be able to connect via that.
Using a host and port as the connection details.

"mysql -S mysql.sock -u root -p". This seems to work fine.

That probably means the default is different.

yes, seems that way. have I forgotten to change a configuration file somewhere?

Alright, I guess I agree with that approach. Thanks a lot for the explanation !

The error messages tells you all you need to know. Check that the path in the error message matches exactly the path you used manually.
You're welcome.

looks fine, really. basically, I changed my.cnf, and set $MYSQL_HOME to point to my.cnf, and logged in. Is there anything else that needs changing?
weird… after giving the socket location explicitly with -S path/to/mysql.sock once, it seems subsequent attempts to connect with mysql now all work, even without the -S option.
ah well, it seems I can make it work then. thanks Xgc

what is information_schema for?
and cluster?

mysql.com/information_schema, mysql.com/cluster

I have a table with a `created` column (YYYY-DD-MM) whenever I insert a new row I wanted to delete the oldest row. How do I structure a DELETE FROM to delete the oldest row?

how to know what db or what table i'm using ?

select database() to see the current default db. ou are using whatever table you are specifying in a query.

select database;

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
arjenAU,

Would DELETE FROM `tablename` ORDER BY `created` WHERE * LIMIT 1 work?

where * is nonsense, but otherwise yes. and no need to backtick everything

Can I have a DELETE FROM without a WHERE? and whats backtick?

yes.
the `blah` you were using
see how what you typed there is not what I said?

kk
And another problem, is it possible to use GROUP BY and ORDER BY succesfully together?
Because im not having much luck

Yes, but probably not the way you're thinking. ORDER BY happens after GROUP BY

would anyone recommend Innodb as a db engine for a website?

it depends on what's the kind of u'r request

i've used it with success at decent load… but really i still consider myself a DB/SQL n00b especially when it comes to server config

Some people say it should be the default engine

or what do u'r mysql busy for

So it should be InnoDB unless another engine is specifically better

mixing 'em only makes sense if you are using aggregate functions or a having clause.
otherwise they essentially do the same.
question too vague.

Ah.
Lets say I have a table with title, created, and location.
I want to retrieve the last five rows, and then group them with their location
Is there an easy way?

arjenAU!!
I was looking for you the other day

and?

I managed to get our 8.95 hour SQL import down to 33 minutes

define last five?
oh good! used any of my hints for that?

Some, yes..

fab. I should start charging some time

That's an enormous savings with the Wikipedia imports, and now I can probably re-cook them weekly, instead of bi-monthly
hahahah
I'll give you a cut of whatever we make in sales

half an hr sounds good anyway. excellent to hear.

newest five, according to 'created'

righty. that'll be either a subquery or two queries. the first query would grab the last five using order by and limit, and then you order by that by location.
order by comes before limit, so you can't do it ina single query

Would I be better off doing it that way, or having a seperate table called "latest" that only had five rows total?

you could have a separate table with just the IDs of the latest 5 entries, and update that some time.
or duplicate the data… but then you might as well cache it on the application side rather than in a table

Thats the solution I was considering
A seperate table would also allow manual modification of the 'latest' listings

not doing that query all the time is best, regardless of how you phrase it.
don't make your life too complicated

k thanks.

no worries. I work for chocolate.

any preference on the type?
I'm a bit partial to white

do I need to do something special to select a DB once I've connected to MySQL

use dbname
or mysql dbname

I'm getting this error - Access denied for user 'database'@'localhost' to database 'database'
me?

swimrr, Did you grant user 'database' permissions to the database named 'database'? (and I hope those are fake, because having a user 'database' and a database named 'database' is really not a wise idea)

yes, those are fake

Every db you have, should have its own separate username and unique password

I thought I granted 'database' permissions

Ok, so just "grant add,drop to horsemonkey@localhost to database dwarf_porn;"
er…
"grant add,drop on dwarf_porn.* to horsemonkey@localhost identified by 'I-love-ponies';"

Is there a easy way to click though a mysql database and look at all the data?

hi.. im looking for MySQL-Max on the mysql download site.. for version 5.0.. does mysql still provide one?

Gokee2, "click through"? Its a database, not a desktop application

its not on the list.. unless they placed it on a different page..

you don't need it.
phpmyadmin or another gui

setuid, I am wanting a app to view the database

Gokee2, phpmyadmin

Ah ok… Can I install phpmyadmin on one computer to view a database that is on a different one?

can I do that through my cpanel?

I have no idea what a cpanel is, so I don't know
Gokee2, Yes

Ok thanks

Gokee2, If the database machine exposes port 3306
Which may not be likely, many do not

my control panel

how to set mysql only allow local connection? only bind to unix socket

skip-networking

i guess i'm lost because i've connected to mysql no problem, but can't access the database

I should be able to make it…. I just don`t want to install a web server on that comp

okei… i got that..

Hi.
I was wondering, is there such command i can use to check wether something exist in the database.
What i mean is:
select * from users where 'hi' isin `profile`
I made that up, but is there a way to check for something inside a column

look in the manual for LIKE and REGEX

ok, Thank you for the reply.

hello… can someone help me out with a simple myql cluster design question?

no problem
how simple?

ok great let me explain
the way i thought this cluster should work is the following.. and please forgive my mysql ignorance if such
have 2 server scooped out to be the data nodes that would store the databases..
have another 2 servers that i thought would run ndb_mgmd and be the sql nodes
then i have some web servers that would be requesting the data
i believed that the web servers would talk to the sql nodes and then the sql nodes would talk to the ndbd cluster nodes
is this correct ?
so basic flow of data would be the web server requesting data from sql node running on one server then the sql node gets the data from ndbd servers and sends back to the web servers

hmmm, sounds like you are not using a cluster per se, but really a load balancer and replication, with some form of caching. Correct?

i know there is a way to change the next auto_index value..but I cant find it

Using lib mysql client.. Is there any reason why if I use it too many times in a second that it would crash my program?

anyone know how i change that?

show .. i have tested the cluster node failover replicatin and that works.. tested the sql nodes or api nodes quering data from data nodes and that works but now when i go further in testing with the web servers quering the sql nodes, as i thought this is how it should work, i have run into
questioning if this is a proper design

i am using a load balancer in from of the sql nodes or sql api servers

ah I found it

that is part of my design but not in use yet.

do you need load balancer?
if you can put 1 mysqld in each of the web server or apps server, it should solve the problem since all the mysqld are active

i have a load balancer .. i think my design is correct (2 data nodes over 2 servers) and (2 sql api nodes on 2 servers that also do management daemon)

a single load balancer becomes the single point of failure
how many web/apps server?

i guess what i am having problems with is testing the web server to sql node query and getting results from the data cluster

you can run 1 mysqld in each web server

i have 2 Load balancers
which will load balance 4 web servers and 2 sql api nodes

maybe load balance your web servers

i thought it would be better performance to have sql node seperate from data node and web servers .. is that not ok?

i will suggest to remove the 2 sql node, install the sql nodes on the web server itself, 4 web servers with sql node on each

but then there is data on the web servers.. which i can not have due to security

of course if you want to load balance the 2 sql nodes, still possible

yea thats what i have designed..
the 4 sql servers are in a internal "bunker:" network for security .. which the LB fronts the 2 sql nodes
now i am trying to do my next phase of testing which is a query from a web server to a sql node server that should be able to see the databases of the sql data nodes but all i am getting is the inital databases that i assume are just on the sql nodes by default.. so how do i tell the sql nodes
to query the sql data nodes not themselves

mysql cluster uses ndb storage engine, then the data are stored in the data nodes
make sure that the tables are ndbcluster

yup i have that .. and i tested the replication btwn the two ndbd servers thats all fine

you should be able to read the same data from any sql node

i dont see the test db's that are on the ndb servers..

may have to create the database, the tables will appear automatically

hmm that may be it ..
i did have to do that on the other ndb
did not think i would have to do on the sql nodes also

on the sql node
ndb means what? ndb api?
or the data node?

data node.. process is ndbd
sorry missed the d at the end

you cannot do anything to the data node, right?

what do you mean do anything?

the data nodes listen to ndb api, which mysqld will send messages to ndbd, you cannot connect and work on the ndbd directly unless you use the ndb api

no.. i can connect to any data node (ndbd) server directly and create or query .. no problem..

using what?
mysql client?

ok i had to create the database on the sql node
now it works ..
yea using command line mysql
running on ubuntu

means you also have sql nodes running in the ndbd nodes?
mysqld on the same machine?
mysql cli can conenct to mysqld not ndbd

let me check .. i believe so .. i think i was having some issue so i did put mysqld to start on there .. newb move
yup .. sure do .. so i should only have ndbd running on sql data nodes
and mysqld on sql node

yes, unless you want to allow conenction to the same machine

perfect. so its normal that i would have to create the DB on the sql api nodes? i orginally connected to from the data node to the same data node to create the db .. thats where i probably started off wrong????

Good morning all. We recently upgraded from MySQL 5.0.22-log to MySQL 5.0.44-log on a CentOS server. We run a service in Tomcat using Hibernate on this, that used to work. However, since we did the upgrade, we get an error "ERROR JDBCExceptionReporter:72 - Data truncation: Data truncated for
column 'cadtjoin' at row 1" on the first date we try to write to the database. Has anybody experienced anything similar?

if the server's time is correct, why would NOW() register as 7 minutes ago?

ur time is 7min fast?
:-p

hehe
but i'm not comparing it to my computer's time.

good shot skipper

the server says it's xx:xx:xx when i run 'date' but when i created a record with NOW() it says that it is 7 minutes earlier.
4 PDT
the seconds are wrong because i had to do some clicking manually.
oh wait wait… i think i know why.

how to set mysql only allow local connection? only bind to unix socket

i think my host uses a different server for MySQL than it does for my user account. that's probably why.

skip-networking

arjenAU, where to use skip-networking?
_mary_kate_, ^

in my.cnf

_mary_kate_, cool, you from wikimedia
_mary_kate_, i do not have my.cnf, should I create it myself?

sure? it should be in /etc

run 'locate my.cnf'

I have a really big problem. A PHP include at the bottom of my page seems to be reverting all the MySQL UPDATE's I have done on the script in question. But the file PHP is including is a file which contains NO PHP… Any ideas anyone? I know it is the include because if I remove it or place a
die(); before it, it will work. Help.

More of a ##php question…

It is only affecting something to do with MySQL.

Well, the PHP is doing something…
Not exactly MySQL's fault
I bet your include has PHP

I bet it doesn't. Because I checked it at least 100 times. This problem has been with me for days.

Check ##php yet?

If i was looking for the word hi in a user's profile. is this correct: SELECT * from table WHERE profile REGEX `hi`

how about WHERE `profile` LIKE '%hi%'?

Iam using that right now,
Its not really working

how is it not really working?

well, it shows like 2 - 3 rows but it wont show liek the rest of the rows in the database
say 5 rows have the profile with word hi in it, and it only outputs 3 of them

do you how to use pastebin?
it helps to see code.

Yes i know how to use pastebin
and here is my sql code.
SELECT * FROM users WHERE `profile` LIKE '%".$search."%'"

yeah but maybe your code is the problem and not the SQL query.
do you get the same results from query the database directly? like from the command line or phpMyAdmin?

Oh, I havent tried that. I'll do that.
Hm works fine on the phpmyadmin.

For all you SQL gurus, how would you increment the count of some field in a row if that row already exists, and insert the row (with count 1) if it doesn't? Can that be done in one round trip to the database or do you need two queries?

Thank you my friend, i had a simple php problem. Phpmyadmin showed the problem. Thanks again

no problem.

I am looking for a software that have the mysql-query-browser, mysql-admin, mysql itself and this kind of tools in ONE, for windows, whats the name? mysql tools or what?

i'm not a guru but i'm pretty sure you can do that. the default value would be 1 and the query would take the current value and do a +1 to it.
you mean the software that the MySQL group makes?

!!
skype claims its your birthday!

INSERT … ON DUPLICATE KEY UPDATE

you mean the software that the MySQL group makes?

why not
lol
The mysql package itself comes with all that?
he left, anyone answer please

in replication.. you place the db name to be replicated in the my.cnf… what if you added a new db on the master. would that mean i need to update the conf and restart the master?

just dl and install. mysql.com has the download files. they all have installers. the server and the gui tools package.

Yes it is called MySQL Tools and consists of query browser,m administrator and other tools
Don't add any in my.cnf and it will replicate all databases
If you don't want replicating some just add it to replicate-wild-ignore list

how to view mysql command-line result page by page , like more/less in unix shell?

mysqlhelp
pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
mysqlpager more

thank you

salle I will download mysql tools, does it mean i will have it ready to use or I still need to download a mysql server

xjkx, which mysql tool?

http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-gui-tools-noinstall-5.0-r12-win32.zip/from/pick
I will need to create an account, argggh

oh,no need

max_user_connections=0 is unlimit?

densin,have a try,and u will get it

it is value ,see when show varilable

thanks a lot

denis:yes, it means unlimit
but it is limited by 'max_connections'

thank you
what about if max_connections=0 ?

the "on duplicate key update" hint…. it works perfectly!

Ah. Great!

no one can login into mysql,expect root via mysqladmin
if set max_connections=0

We recently upgraded from MySQL 5.0.22-log to MySQL 5.0.44-log on a CentOS server. We run a service in Tomcat using Hibernate on this, that used to work. However, since we did the upgrade, we get an error "ERROR JDBCExceptionReporter:72 - Data truncation: Data truncated for column 'cadtjoin'
at row 1" on the first date we try to write to the database. Has anybody experienced anything similar?

very dangerous

y,be careful

hi i have an interesting problem with innodb engine, yet i have converted a database MyISAM to InnoDB and the next inserts autoincrement value is 2.
is that normal for InnoDB ?

from show table status?
just ignore that, it will be determined when you make the first insert after the server started

anyone ever had issues with mysql server running but not connecting? im on debian

from remote client?

nope
and its all using a socket file

what is the error

dunno it's a live server so as i saw it didn't work i restarted it

works after restart?

yeah
that's what's weird
and its not the first time (or only server) i had stupid issues like that
anyone has an idea?
brb

The_SNiFF whats the question?

can u scroll up? i restarted my irc client

The_SNiFF, i just joined
going to bed now

ok
thanks anyway

Really that hard to repeat?

no. he said he's going to bed

god am I enthused about databases

Yes

I imported my first monstrous data set
300M of lyric data

Nice!

170 thousand records
bashscripting on flat files took me hours to do anything with the data
mysql does it in 5 seconds

Using the right tool for the job

its like delicious cake or sex
i just want databases of everything now
ill find something to throw in my databases
make it queriable
maybe make it public
does anyone sell or offer free premade databases?

Sure
Mailing lists?

they sell mailing lists?

People do.

Shit. I could go harvest emails or home addresses
how much do they go for?

That's not good
We don't like spam

Then are there any good ideas ? :p

Lots of ideas
You can log our IRC conversations

into sql?

Yes

that sounds crazy

Why?

isnt there some table limit?

Yes

how big

!man how big

Sorry - I have no idea what function you're talking about! but try http://dev.mysql.com/how big

I had taken a dump of all the databases present in my db, how do I restore them?

mysql database -p dump.sql
er
mysql -p dump.sql
Joelwork_, look at the dump.sql file, it should look pretty obvious

kk , I was wondering if I had to specify the database
thanks

itll recreate all the databases
delete if they exist

ok

http://dev.mysql.com/doc/refman/4.1/en/full-table.html
You may need to specify the database name if it is not specified in the .sql file.

ok
I think the dump was taken with –alldatabases

seekwill, the = comparison on text fields doesnt care about case?

Usually

but select distinct will care about case

No

alright
i've got like 5 lyrics from 'Guster'
and they are all coming up twice
because i put two data sources in
one GUSTER one Guster
how can I get rid of the duplicate guster?
or should i have made the artist name field an index?

Well, if there are two, which one do you want?

the first one
with the lowest id?
or just not to add two of any

You need to decide what you want…

here's a simple question. I have a query like "select url,size from logs where username = 'user' order by size limit 10" What I want to know is, is the resultant 10 records sorted from the whole table, or is the sort done on the first 10 records?

Whole table
LIMIT is done "at the end"
So your query will return the smallest 10 records
in the whole table

so that would work if I used limit 1000,10 as well? it would sort the entire table, then pick the last 10 records?

If you wanted the last 10, use ORDER BY size DESC

I just tried it but I don't think it worked that way

Well… now you know

ahh, the desc was the bit I was missing. Thanks for that
now I can save myself a lot of extra processing.
thanks again seekwill

np

hi
i database a bout 5Go is considered like medium large or huge ?

how do I select all indexes on a table in mysql 4?
index name and type

"select all indexes"?
What does that mean? Select for what?

how do I list the names of indexes defined on a table with sql?

!man show index

see http://dev.mysql.com/doc/refman/5.0/en/show-index.html

show index from
thanks

i only avec 2G of memory on this system
s/avec/hve
s/hve/have

I only have 512MB
s/have/hve
s/hve/avec

lol

Are you making fun of my 512MB?
I'm poor.

hello

the mysql tools doesnt install in win98?
doesnt work*

seekwill 1GB is $50

jacks-: Oh really? That's awesome! You can paypal $50 to seekwill@mysql.com. THANKS!

haha

How to migrate " `date` timestamp NULL default CURRENT_TIMESTAMP" to MySQL3? MySQL3 dos not support the CURRENT_TIMESTAME…

that is probably for the price of newer RAM, for older type can be more expensive or end of line even
just remove the default
but it will be updated on both insert and update

It seems there has no other way?
I dos not want to remove the default …

shpchp, yes,seems no way

the expected behaviour will insert the timestamp as default even in old version before 4.1
as long as it is the 1st timestamp col in the table

ok, thanks you guys

We recently upgraded from MySQL 5.0.22-log to MySQL 5.0.44-log on a CentOS server. We run a service in Tomcat using Hibernate on this, that used to work. However, since we did the upgrade, we get an error "ERROR JDBCExceptionReporter:72 - Data truncation: Data truncated for column 'cadtjoin'
at row 1" on the first date we try to write to the database. Has anybody experienced anything similar?

Just as feedback
the problem was that I needed to upgrade the jdk I was running.

i would like to do something like select foo, concat(field1, field2) as field3 from test wherefield3 = 'something';

mysql server upgrade has nothing to do with jdk, do you mean connector/j ?

this obviously doesn't wor. what is the correct way to do it?

mo, why does it not work?

alias cannot be used in WHERE
change it to its original form before the alias

select foo, concat(field1, field2) as field3 from test where concat(field1, field2) = 'something';

zongk, ah thanks. :-)
thanks. didn't know tat

mo, that was kimseong's answer
you can thank him

thanks kim ;-)

mo but dont use a function in a where as an index wint be used

so is there a more efficient way?

much better to have a composite index and where field1='part1' and field2='part2'
and concat the answer

hello, trying to solve one thing, would somebody please help me. i have a highscore table for a game. fields are: id, name, email, score, news and dt(datetime). i have to pick 30 highest scores but.. i am trying to achieve that no names and emails repeat. 30 unique. my query looked like this.
SELECT DISTINCT * FROM highscore GROUP BY name, email ORDER BY score DESC LIMIT 30. but this gives me not what i want.

thank you very much in advance
anyone?

order by max(score)

hi
can somebody help mi?
me
i've just installed mysql-5.0.27 under Zenwalk linux
but there isn't preconfigured the db server
how can i do this?

just configure it?:

sorry i've solved the problem
the maker of the package didn't write the mysql main config commands for the install script

i need a little help. this query INSERT INTO `email` (alias,dest) VALUES ('test00@test.de','test–0001'); fails with ERROR 1136 (21S01): Column count doesn't match value count at row 1. it looks like the interpreter stopping at the — b/c it thinks a comment starts here (note the
quotationmarks) if i remove one of the - the query works. wtf?

lo lo
I've got another strange problem with my 2 node mysql cluster

select version();

5.0.32-Debian_7etch1-log

mysql on node 2 seems to take a lot of cpu when running a simple query (such as when I load a dynmamic webpage). loading the same page off node 1 is instant. stopping ndbd on node 1 makes loading a page off node 2 instant.
once I restart ndbd on node 1 as soon as the management server notices node 1 is back, node 2 is slow again :|
running strace on the mysqld process is giving me nothing I can work with

Did you try that insert from MySQL command line client or Query Browser?

cli

Works fine in 5.0.37-community-log
Post the complete sql file to the pastebin.

ok, will take a while though i have to collect commands first

Is this not just one sql file? How did you run this?
If this was done interactively, maybe you typed something strange.
Post the create table statement as well.

http://rafb.net/p/Jm9mbE30.html
i am copy-pasting from a rather long file, trying it line by line so that i can make sure everythings ok

No problem. Post the create table for log.

hello!! I have a SELECT statement depends on SUB QUERY. In Sub query, I have two columns, 1. for iD, 2. for COUNT(*) used with HAVING. as there are two columns used in subquery, my whole SQL statement failed. how to hide the second column?

http://rafb.net/p/n5fMo149.html

and email

how to hide a column from showing in SELECT statement?
in result set.
?

The problem looks to be the trigger.

http://rafb.net/p/GaOkyV37.html

((SELECT (SELECT myvalue FROM tmp_table WHERE mykey='username') AS myval,NOW(),aid,bid,NEW.id FROM users WHERE user=NEW.dest)) is not correct.

i was fiddeling around with it until mysql didn't complain anymore

Remove the outer set of ()'s

that will make mysql complain

The problem was not your posted insert.
It's can't work with the ()'s.
I suspect you're removing the wrong set of ()'s.

excuse me, help me too
I could not find anything possibility in SELECT statement syntax
is it possible?

You should use this form: INSERT INTO tbl (column, list) SELECT blah, expr FROM tbl2 WHERE …;

that causes a syntax error

Not if done correctly as I showed.

what query can I run to get the only the latest entered record back?

don_martino, that was to you.

what I want is the 'ID' of the most recent record

i'll try again

Is it possible to hide a column from showing in SELECT statement result?

that would be my new trigger-insert-statement: INSERT INTO `log` (`user`,`date`,`acctmapid`,`acctusrid`,`addid`) VALUES SELECT (SELECT myvalue FROM tmp_table WHERE mykey='username') AS myval,NOW(),aid,bid,NEW.id FROM acctusr WHERE username=NEW.dest;

Hey all

does that look ok?

is it possible to do what i want?

I am unlucky, so many people are here, but no one respond. Anyhow thank you. Bye.

all my records have an ID number which is auto increment, i want sql to query and return the latest nukmber only

ORDER BY id DESC LIMIT 1

I'm having an odd issue with MySQL(5.0.45) on OS X 10.4.9. all was working fine for a while, now it refuses to start, any idea?

thanks

Kieran, check your mysql logs

You added a users table. Can you post that create table?
No. Don't use the VALUES keyword when using INSERT SELECT.

no, i might get into trubble releasing that much of the layout as i've done already. what would you look for in the user table?
ah, i just read over the VALUES thing.
sorry

I would only need the columns of the users table requried for this SQL. You already showed the column names. Surely that structure (that you already showed) wouldn't be confidential.

the VALUES keyword was the problem all along! i took it out and now it works. i was just too dumb to read your instruction carefully :-(
but it's working now. thanks!

You're welcome.

Where are the logs on OS X? they're not in /usr/local/mysql

Possible /var/logs
or /var/log/mysql

Nope, already looked there.

lsof to determine the real location if you can't find it.

moin

moin moin

Hiya … im not sure which place is best to ask this question….. but i have a problem … i have a software which posts logs to the database the server is running in uk and Australia the uk one works fine but when i check logs in database via phpmyadmin … the time stamp of logs is 1970
…. how do i fix this ???

Clocks probably run backwards in Australia.

ugh - no ideas about my slow sql cluster node problem ?

Dimensions, learn about the timestamp type or fix the code, locate the source of error

so you mean its coming from the code has nothing to do with phpmyadmin

or the mysql version or the setup of the timestamp field

found the log [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

Hmmm - does anyone have any links to PHP5 vs. 4 performance benchmarks?

Any ideas?

Kieran, odd a number of people reporting that as a problem recently

Any fixes that you know of? I'm totally new to mysql, well, running a mysql server anyway

no, I dont have osx so dont help with install issues on that, just notice a few questions

Alright
google to the rescue :P

That would normally happen if you never initialized the mysql database.

Everything was working fine, I had added databases etc and I was then getting unable to connect via socket messages and then I realised it wouldn't start.

Changing your config file or mysqld command line options could also cause this behavior.
Sometimes this happens following the first reboot/restart using a config file you never tested.

Meh, this is where OS X annoys me
everything is in non standard places and finding your way around is almost impossible.
I think I'm just going to install debian on a seperate computer and set mysql up there

ok - even more bizarre
stracing ndbd on node 1 makes node 2 respond quicker

hiya!
I have a very large mysql database…. like 20 gigs
how do i go about backing something like that up and moving it

what?

dmb062082, if you have got to that size and dont know how to back it up……

sure I could abck it up

ah, backup, ok

into a 9 gig gzip or something
even 9 gigs
how the heck do I move something like that

anybody experience with IS NULL optimization? (with indexes)

better yet
how would i break it into smaller queries

bobster, state the real problem

when i do an EXPLAIN on my SELECT.. it shows in type = ref.. instead where i expect the ref_or_null

WHERE deleted_at IS NULL

does the query plan (with WHERE deleted_at IS NULL) use this index and optimization for IS NULL?

bobster, but what does it say in the possible keys col

is it appropriate here to post up a select query to get an opinion, or do we paste?

pastebin

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

thanks archivist

perhaps the explain as well and create

it mentoins the index_name

well big dump will come in handy I think
adios

but type of the plan is: ALL (fulltable scan?)

then to an analyse table
do
if the nulls are 50% of the table then thats the fastest way
or try with force index to see if its quicker

could do with some help deciphering this http://pastebin.ca/633006

analyze table doesn't mention anyting bout nulls.. uuhm, how to?
force index in the SELECT-statement?

opalepatrick, like '% silk %' cannot use an index, rewrite to use fulltext
!man analyse table

Sorry - I have no idea what function you're talking about! but try http://dev.mysql.com/analyse table

ah ok, thanks a lot archivist will go and do that

!man analyze table

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

i'll try
thanx the_wench and archivist

bot

I'm *not* a bot! I'm a real buxom wench

archivist, should have checked those fields are all FULLTEXT type

lol

nothin mentoined about an option "force index" in then man analyze table

its a type of index
there wouldnt be

talking to me
?

its a select option
yes

ok, let me get this right, lol. I have already created a fulltext index for those fields. :-)

thanx ive found it in the F.M.

explain SELECT * FROM target_groups USE INDEX (ui_target_groups_code) WHERE target_groups.deleted_at IS NULL;

SELECT * FROM target_groups USE INDEX (deleted_at) WHERE target_groups.deleted_at IS NULL;

ALL, possible_keys: deleted_at…. and index in table really is on deleted_at (which is NULL-able)… is this allright?

if it works and is fast

thanks for your help, I have just discovered how to do a match against boolean for more than one term, so that will do a much better neater job all round! Thanks for your prompting.

i don't know this yet.. it's in development.. but i wanna know whether my DDL (index) for IS NULL optimizations works?

funny I had done this on a buch of other queries but didnt know how to + or - multiple terms. Seems so easy now!

Comments

ich want to migrate two postfix servers which authtificate against a mysql database the first database contain

Translator (http://sqlfairy.sourceforge.net/)

hi folks

Dont forget the bots

i have a database and try to allow a user to use it, but my grant doesn't work
grant all on mythconverg.* to mythtv@'%' identified by 'password';
flush privileges;
but if i try to log in via
mysql -u mythtv -p

Thats cause you are probably logging in via localhsot
grant all on mythconverg.* to mythtv@'localhost' identified by 'password';

Do you have an existing user on that host, perhaps ''@'localhost' ?

Try that

% will honor localhost, but if you have ''@'localhost', it will attempt to login as that instead of mythtv@%, because the host is more specific.

yep, user mythtv exists
basically, i just wanna log in with mythv + passwd from everywhere

SELECT user, host FROM mysql.user; What do you see?

there are two mythv
first one with %
second with localhost

And you just created those two, right?

Thanks the_wench and snoyes

hmm, i am not sure, i installed the mythtv package
and it "should" have created them

What other users did you see from that last query, particularly any with a blank user name?

http://pastebin.com/m57a5fbed

Ok, doesn't look like it. you should be able to log in from anywhere with mysql -u mythtv -p. What error do you get when you try/

is there a way to find out how many read/writes I am getting per database.. or at all?
looking basically for hit-rates

Access denied for user 'mythtv'@'localhost' (using password: YES)
can I reset the password of both mythtv users, just to be sure

That's probably the best idea.
!man set password

see http://dev.mysql.com/doc/refman/5.0/en/set-password.html

thanks, that was is…

hm…is there a way to totally export a whole database? I'm ssh'ing into a linux box but i'm not sure how i'm going to export the database, then get it to me

mysqldump

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

ahh how nice
oh wait the_wench is a bot isn't it? i was talking to it i think

bot

I'm *not* a bot! I'm a real buxom wench

lolacaust

the_wench, 2+3?

6. For very large values of 2.

:-
and 4 for small values of 3.

hello
I'm having a little problem when I'm trying to use mysql administration over ssh tunnel

but, what happens when you have large values of 2 AND small values of 3? Is that a NaN then?

Lost connection to mysql server during query

"2 added to 1 - if that could but be done!" it said, "On one's fingers and thumbs"
b"2 added to 1 - if that could but be done!" it said, "On one's fingers and thumbs"/b

could you advice me a bit?

!man gone away

see http://dev.mysql.com/doc/refman/5.0/en/gone-away.html

Vaksy, running the query again works for me

UukGoblin I cant connect

check your tunnel then
stop mysql, run netcat on 3306, check if you can establish a connection

"Access denied for user 'www-data'@'localhost' (using password: NO) " how to turn to ON? thanks

mysql -u root -p
er, mysql -u www-data -p

hello, a little question
what would be the MySQL syntax to remove every line from the table "log" with the value "3" in field "sector"?

DELETE FROM log WHERE sector = 3;

thanks man

snoyes what does it do

-p prompts you for a pssword

what password?

the password for www-data

and how do i use it for my php scripts
host, user, pass, db

mysql_connect('localhost', 'www-data', 'password');
mysql_select_db('dbname');

localhost, www-data, mypass?
really?

Nope, just made it up to throw you off.

so i can using the one account for all DBs?

You could. Or you can create several accounts to do different things. Whatever floats your boat.
Generally, it's best to have the user with as few privileges as possible to do the job they need.

this get me an error.. ERROR 1045 (28000): Access denied for user 'www-data'@'localhost' (using password: YES)
if i type my own pass

Then you have the wrong password.

this is changing the pass? not to set?

To set the password, you'll need access to the database as a user with super privileges (probably named root)

snoyes i can understand that shits… i have a big head… on the site i have still Access denied for user 'www-data'@'localhost' (using password: NO) .. i create the user with GRANT, set the params into my scripts, and still i have there and error about www-data using password no
i cant
in mysql_connect i puutting the new login and pass and this idiot still typing me something about www-data

i don't know how to do it

changed to Yes when you specified the password. The fact that access was still denied implies that the password was wrong, or there is no user 'www-data'@'localhost'

snoyes i dont know, maybe there isnt user www-data, but why it wrote www-data? what i can do?

If there is no www-data user, what user is there?

i dont know! i idiot already
really confused

Do you have access to the database via some other front end? phpMyAdmin, command line access, MYSQL Administrator, something like that?

yea i am using also phpMyAdmin, what i create the users and pass with GRANT statement, i can successfuly login via phpmyadmin, but in my scripts not… i dont understand

Whatever user/password you use for phpMyAdmin, you can use in your scripts too.

so i am doing it! trust me… but i have there still this shit.. Access denied for user 'www-data'@'localhost' (using password: NO) in … maybe problem somewhere else?

NO', then you didn't put a password in your mysql_connect() call.

snoyes ooo shit you have right, it seems for the problem in my script… moment
snoyes "Table 'tablename' is read only" how to fix it?

Your user does not have update permissions to the table in question.
and/or, the user as which mysqld runs does not have permissions to write to the data files.
http://www.linuxquestions.org/questions/showthread.php?t=11199

snoyes ok and how can i set the perms?

UukGoblin nothing appears to netcat

i used GRANT ALL PRIVILEGES ON …. WITH GRANT OPTION

how can i remotely connect to a listening mysql server?
mysql -u user@remotehost -p
but it seems as if the connection is made locally
mysql is listening if netstat is right\n: tcp 0 0 *:mysql *:* LISTEN

1036 SQLSTATE: HY000 (ER_OPEN_AS_READONLY) what is that mean?

did you try to write anything

hey guys I posted an image of what i'm looking at and i'm alittle confused on the notation of the relationships, like the double line through the bar, or the 3 pronged fork looking thing with the 1 line through, anyone know where I can find information on this notation? i'm using mysql-workbench
builder and there doesn't seem to be tutorials that I can see…so it must be standard sql notation? http://img72.imageshack.us/img72/5120/mysqlyi8

since, open as readonly, means that you can look at data but not update delete etc

are that perms for the db files ok? -rwxr–r–

ls -l and df -h
lokieee, image is not ok, cannot be viewed

-rwxr–r– 1 mysql mysql ………

argh, imageshack fails me again! i'll be back later, food time! see ya

seeya

some one help?

what version, titii?
df -h?

what mean df.. ?
what i have to looking? that prints some rows

df = diskfree

anyone willing to help me a bit with using mysql administrator over ssh tunnel

you'd better contact your system administrator, titii

tibyke i mean i can do by my self.. that is my server
my friend isnot accessible

df -h

and i wrote you that print some information
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 36G 1.9G 32G 6% /
tmpfs 253M 0 253M 0% /lib/init/rw
udev 10M 52K 10M 1% /dev

dont flood the channel

tmpfs 253M 0 253M 0% /dev/shm

damnit

/dev/hda1 137M 12M 118M 10% /boot
/dev/hdd1 38G 25G 12G 69% /mnt/disk/1
sorry

*sigh*
use your brains, please

sorry
ok what now?

check the logs

where it is located?

(this should have been your first pick)
your box, not mine, you have to know that

http://pastie.caboo.se/80785 , ALL type on explain results … that column is indexed — simple join … why using table scan?

apparently you know nuts about mysql and linux

look around /var/log

there are some files but arent readable

why not

if you GROUP by week() is there any way to take out the last week

take out of where?

Define last week.

anyone can help how to solve this problem? Mysql - #1036 - Table 'my_table' is read only

most recent

omg
titii, please stop whining, we cant help you if you are not open to get help

Use a WHERE clause relative to NOW().

I only want it to show full weeks
I'm not sure I'm following

tibyke i believe i am, maybe you can give me another instructions

http://pastie.caboo.se/80785 , ALL type on explain results … that column is indexed — simple join … why using table scan?
become root first titii
then assuming that you have the ever so popular ubuntu/debian distribution

Calculate the last day you want in the set and allow only records less than or equal to that day into the set.

i need ls -l /var/lib/mysql

iratik, grouping by a function

ahh — so like the weekday… 1-7 ?

what do you mean?
group by is involved in indexing?

8

that can't look right to anyone else

yes but you are grouping the output of a concat(…

I don't know what your idea of a full week is, so I can't give you an exact answer. If you know how to find the end of the last full week (related to NOW()), just use that in your WHERE clause.

hi there

hm…. is how i'm doing it the best way of showing the result with the number of records on each unique route in each row?

iratik are you talking with me?

i got lost at your /var/lib/mysql output

8

Okay, what if I wanted it to show until the last Sunday

updatedb && locate MYI
use paste for the results
i have some experience with that

what did you come up with?

find the previous sunday?
hmmm.. give me a minute

6

okay

"error undefind mysql_connect" how do i fix this?

ich want to migrate two postfix servers which authtificate against a mysql database, the first database contain usernames like user%domain.tld the second one has got usernames like user@domain.tld i dont want that all email users have to change there usernames. The Problem is that I cannot
change the query. So is there any way to modfy the database entry that a query for @ and % is succesful?

why not update the usernames? it will be a pain in the ass later if you keep this scenario…

500 accounts most of them to stupid to change their usernames without telefone support
this woul be pain in the ear ;-)

got it
well close enough

heh

select makedate(date_format(now(),'%Y'),(date_format(now(),'%U')-1)*7);
makedate takes year and number of days and gives you the date
so you take this week of the year (format now(), %U) … -1 for last week…. * 7 days a week– and use that as the second argument
gives last sunday… might not need to take that 1 away though.. because it gave me the 8th
which is the sunday before last

ahh, i see
thank you very much

np… struggled bad with that stuff before

yeah, it's kinda hard to get your head around sometimes…

!man between

see http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html

http://pastie.caboo.se/80785 , ALL type on explain results … that column is indexed — simple join … why using table scan? most importantly… if its because i'm using group by with a function of the fields …. is there any way to optimize this
query?

!man date comparison

Sorry - I have no idea what function you're talking about! but try http://dev.mysql.com/date comparison

!man date

see http://dev.mysql.com/doc/refman/5.0/en/using-date.html

why in the world doesnt MySQL administrator not like mysqldump files…

mysqldump files are easier to process with bash than the gui in my opinion

how am i supposed to restore one schema
when the dump has all the schemas

you just want to restore one table's schema?

hi

thats easy man

i just want to restore one schema and all the tables within it

how i can create a file with mysql sentence (example phpfile with contains echo "hi")

well.. dude
cat mysqldumpfile.dump | mysql -u root -ppass thedatabaseyouwanttorestore

not iratik, from mysql

i meant nyc-host

function similar to load_file

lets see if this works…

i don't know what you are trying to do well enough to not dismiss as pure cajolery

keep in mind the mysqldumpfile.dump has all the databases

nyc-h0st. it doesn't really matter man

i've access from phpmyadmin, and i want to exec for example touch hello.txt
how i can?

what!?
what is your native language man

iratik it does matter man because mysql will restore all the other schemas as well
i dont want that to happen

spanish

nyc-h0st. do you saee the last argument on the example i gave you?
s/saee/see
que quieres hacer?

i've done it before this same exact way and it totally ignored the last one
but lets see what happens

if you are that concerned
create a second database .

quiero ejecutar comandos shell desde mysql (desde phpmyadmin)

you can't execute shell comands from within mysql can you
i hope to god not

english
ffs

no pienso que puedes ejecutar comandos shell desde mysql …. por que queres ejecutarlos alli ?

i know it's possible with system nd !
becouse i don't have access to ssh

oh believe me i'm that concerned, at 60+ schemas i'm very concerned

i hate the word schema- — keeps confusing me …. when you say schema … you mean databse - not table right?

hmm, do you see no chance to to solve the different username thing?

you are correct database not table

if i want to create table new_table with some fields copied from another_table and some other fields newly defined how would i do that? (like create table new_table (some_id int unsigned not null auto_increment primary key, some_name varchar(255), some_number int, SELECT * from
other_table);

m4rz, #mysql-es for spanish

if you search for user%domain.tld — that will match user@domain.tld (as long as like is being used) …
i fear you won't be able to do it without changing the query…..

how can i get current date to default value to ate
Date
CURRENT_DATE() doesnt work

try CURDATE();

nyc-h0st: thats a pain in the ass … the sure fire way to do it man tho is long

the query ist generated by postfix, and with that version it is as far as i know not possible to change the query

i swear there was a configuration directive in /etc/postfix/main.cf for changing that query

for changing the mailbox location query?

zOrK no

no what

tibyke no the username query

it doesn't work

arnekaiser, i dont think there is a customizable query for that. you mean the virtual_mailbox_users?

yep

thats just "select field", "where field"

mysql … && cat mybigdump | mysql … temp_bertha && mysqldump -u root -ppass specific_db_you_want_to_save | mysql -u root -ppass actual_db_you_want_to_restore

Vaksy, do you have that column set as DATE?

arnekaiser, ^

?

dude… even that doesn't make total sense

arnekaiser, you can only set the "select_field" and the "where field"
like what you need for what user

zOrK Create table test (day DATE default curdate()); for example

but it assumes mybigdump contains several databases … and even though you specify to only restore it into temp_bertha … that specific_db_you_want_to_save would be a database other than temp_bertha because according to you mysql ignores that argument
i disagree from my experience … in fact- — i'd suspect that not more than one database were stored in a dumpfile

is curdate() == CURDATE() ?

because mysqldump doesn't work without a database argument … unless you did it per database and joined each dump file together

zOrK it doesn't work either with uppercase

ok, than I think i really have to switch to one username format with a lot of support…thanks

is this for webmail?

arnekaiser, yep, thats the only option

Instead of date_format, I prefer simple calculations: SELECT DATE_ADD(NOW(), INTERVAL -(DAYOFWEEK(NOW())-1) DAY);

not only its for all sorts of authetification

arnekaiser_, most probably pop3/imap and smtp

select now()+interval -dayofweek(now())-1 day; should work too

exact

use one rule, preferably foo@bar.org
i have the same scenario

Hi guys. How come this won't work? SELECT * FROM ( SELECT * FROM danyay d ORDER BY TIME DESC LIMIT 10 ) m ORDER BY TIME ASC

and several years ago some version of netscape crashed with @ in the username that why the old server uses % instead of @

SELECT DATE(NOW() + INTERVAL -(DAYOFWEEK(NOW())-1) DAY);

Yoshee, select * from __where__?
arnekaiser_, that was decades ago

I was hoping to reverse sort a limit

no limits on subqueries

Weird thing is it works on another script i have on another server

i know but it is still usual to use the $ usernames

Hm. so is there a way to do what i want it to do? (get me latest 10 items, in reverse order)

you mean as if for example you took the 10 newest posts of a blog ordered by ts desc … and wanted to show them in reverse order?

Yes, precisely

That's fine in 5.0.x: SELECT * FROM (SELECT * FROM xint ORDER BY id DESC LIMIT 3) v1

http://pastie.caboo.se/80785 , ALL type on explain results … that column is indexed — simple join … why using table scan? most importantly… if its because i'm using group by with a function of the fields …. is there any way to optimize this
query?

SELECT * FROM (SELECT * FROM xint ORDER BY id DESC LIMIT 3) v1 ORDER BY v1.id

Hmm, I wonder if that's why it's not working, it's on 1and1 so I don't know the version

Probably some old version. select version(); to find out.

4.0.27

jesus

Very old.

ha yeah i bet. man that sucks
I'm using perl to grab the data, I could always reverse the array but I didn't want to do that

itterate through the results in reverse order
when you show the results

hello, is anyone here using mysqli in php?

for ($i=sizeof($arr);$i0;$i–) .. something like that

excellent, thank you. I guess i'll have to make do with my ancient mysql

http://pastie.caboo.se/80785 , ALL type on explain results … that column is indexed — simple join … why using table scan? most importantly… if its because i'm using group by with a function of the fields …. is there any way to optimize this
query?

when you create table and copy fields with select from another table, can you also create regular fields too at the same time?

hey, quick n00b q
mysql can only use one index per table ber query?

no

haha no?
so if I'm selecting on a single table, can it use 2 indexes?

ther may be several possible ones ….. and a query may reference more than one column being indexed at the same time
yeah

so

i think its one index per column tho

does anybody know if there's a way to use arrays in php's mysqli_stmt_bind_param() ?

what's the point of doing multi key indexes?
i.e. (fname, lname)
when you can just do fname and lname seperately?
separatel*

because if you do a query with fname='bla' and lname='bla' its quicker with the multi-key index … rather than two separate indexes … i've got a great example for you tho
a phone book has its entries listed with a multi key index

ahh, okay

lastname, firstname
would it really be faster for you to find records based on last and firstname if the phonebook just had two separate sections … ?

don't muli index's let you also limit duplications?

where the records were only be able to be looked up by either lastname or firstname but not both?
unique keys do that

that;s a good point

how do i find out where mysql is storing the database?

nice date query but it doesn't round — so if a query was done on Sunday between the remaining hours of the day, it will still display them

as root …. updatedb&&locate MYI

one more q

well, it works guys. thanks!

thx

what are the benefits to clustered indexes with innodb, and can they be/should they be multi-key?

don't know… i've found innodb to suck

hello all i having some real problems with connecting to mysql db….i just installed it and im trying to add a db but i cannot connect to it. ive tried both ways to reset the password that are recomeneded but it still wont work

ps ax | grep mysql
that tells you if mysql is running
better yet … ps ax | grep mysql | grep sock

http://pastebin.ulteo.us/7262
its running
i installed it and it never asked me for a password. i then tried to add a db and it says denied for root@localhost

http://www.netadmintools.com/art90.html

btw, running updatedb as root is bad without options

hmm not working
[root@localhost ~]# mysql -u root mysql
Access denied for user 'root'@'localhost' (using password: NO)

updatdb standalone will log /root etc and files normally skipped

really.. — didn't know that .. what is a safer command?

in debian just call /etc/cron.daily/find i think it is

can you help me with my problem

then it will properly set all the prune paths and run as user etc

i've been here over an hour now

anyone here familiar with xampp

whats your problem now iratik ?

what does install a service mean?
I would like to install the MySQL server as a service!
Do only work under with NT, Windows 2000 and Windows XP. (I am using vista btw)

it means run the given component of xampp as a windows service rather than a standalone instance
i've only had one question since i got here
http://pastie.caboo.se/80785 , ALL type on explain results … that column is indexed — simple join … why using table scan? most importantly… if its because i'm using group by with a function of the fields …. is there any way to optimize this
query?

iratik, heheh what would you recommend… i guess i dont really understand the differences

a server means it runs in the background when computer starts, even if norbody logged in yet basically

hmm
i think i should go for a standalone since I wont be always using this …

honestly … i'd say standalone gives you more control over when parts of your computer are accessible — running services leaves ports open i belive … can't be that much harm possible — with the exception of apache/php being left o

hmm ok
thx

hey
I've read in severl places that mysql will only use one index per table per query
so
I'm confused
is this is a recent change to mysql?

no

really? hm

look at my problem dude
http://pastie.caboo.se/80785
the explain show which indexes and tables are being accessed in a query
as you can see… several indexes being used
well.. i don't know — when i look at it again… there are several possible keys for the columns being filtered out of each table
it would have to use multiple indexes per table … when you filter by two separate columns with their own indexes

ahh k
ah
this restriction was removed in the 5.0 series. http://dev.mysql.com/doc/refman/5.0/en/index-merge-optimization.html
w00t

if I have two foreign keys that both come from different tables, how do I represent it?

i give up
j'abandonne

Each foreign key is independent.

i have no idea. From what I can tell the query looks fine. Heck, i never even knew you could group by a concat

oh yeah you can
if you can group by a function .. you can group by any function

i dont like that filesort line though, ive had that nip me in a few of my own selects

i can't even tell how long its taking
i run it … talk in here for like 5 minutes… and go back- — the map is populated then

i had similar issues when I did a select+order by on a view which was a join
the filesort rather

hi
/usr/bin/ld: can't locate file for: -lmysqlclient
ld returned 1 exit status
how i can resolve it

First time here. Is there a good resource for troubleshooting ODBC connection issues? I am using MySQL ODBC 3.51 driver and getting Access denied for user 'user'@'hostname.domain' (using password: YES)

show grants for 'user'@'hostname.domain';

Xgc on mysql? or on the database I'm trying to connect to?

on the server running the db

Aren't you using a MySQL database?

Xgc, yes, running MySQL - was asking, grants on the database "mysql" or on the database I am ultimately trying to use.
IOW, querying mysql.user?

what process does data sent by php go through before stored in a mysqk datavbae?
database*

apache?

MangosDebian, you're referring to database rights, yes? not user-account rights on the server which hosts MySQL?

Your question doesn't make sense. Just issue that command while connected to the database as a user with appropriate access.

didn't know there was a distinction. every time ive ran show grants it didnt matter if I was connected to a db or not

t/y Xgc will do
t/y MangosDebian. I think I misunderstood what you and Xgc were asking.

have you installed the mysql lib's? included the path with -I or whatever it is?

The user has usage on *.* and all privileges on the database I'm ultimately trying to use

now, whats the rev dns that the mysql server things for that client?
did you get the host.domain right?

MangosDebian, I'm sorry, I don't understand that — the rev dns?
The user is identified as 'username'@'%'

do you have a grant for 'username'@'%'?

Show the exact output.

MangosDebian, yes
Xgc is it okay to paste it here or should I pastebin it?

ok, so you can get '%' to work, just not 'home.domain'?

If it's one or two lines, paste here is fine.

MangosDebian, I cannot get it to connect via ODBC even as %

well, ive never played with odbc with mysql
does it even use the right port etc?

Two rows for the user. First row: GRANT USAGE on *.* to 'username'@'%' IDENTIFIED BY PASSWORD 'passwordstring'
GRANT ALL PRIVILEGES ON 'mysql' TO 'username'@'%' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON 'our-database' TO 'username'@'%' WITH GRANT OPTION

no 'username'@'host.domain'?

Apparently you are using the wrong user or you're not showing useful information here.

MangosDebian, no.

guess you wouldnt need it really with %

Hm … what should I expect to see for a correctly configured user?

'user'

I'd rather lock it down more once I get it working

you need to provide exact detail.

Xgc, I thought I was providing exact detail What I typed is the result of the query "SHOW GRANTS FOR 'username'@''%'" The only change is the actual user's name and the actual name of the database I'd like to ultimately connect to.
As is probably obvious I am new to MySQL; maybe I am misunderstanding something.

Changing any detail you show is a bad idea.

is there a good book on mysql? I have the mSQL/mySQL o'reiley book, but basic intro topics are really under-written. something like a Perl cookbook but for mysql?

SHOW GRANTS FOR 'fred'@'%' results in those three lines, s/username/fred
I also didn't write out the hashed password string, obviously.

well, pretty safe to give out the hasg tbh
unless these guys already got a rainbow table

I'm sure you're right. Do you want the hash? It looks like other password hashes. ( Not using old_password() )

i dont think it matters as much. but does it start with a * and is 41 char's long?

MangosDebian, yes.

Are you using the right MySQL connector for this version of MySQL?

Xgc I think so; using MySQL Ver 14.12 Distrib 5.0.41, for Win32 (ia32) and MySQL Connector / ODBC 3.51

has anybody here used the google replication patch?

you can replicate to gmail or something?
or does google offer actual mysql db's to replicate to?

I'll have to shut down in a few minutes; wanted to say thanks, though, Xgc & MangosDebian.

how do you delete a temporary table?

You can probably drop it. It also is automatically dropped when the connection is closed.

is there a work-around for a load data local infile ERROR 1148 (42000): The used command is not allowed with this MySQL version
5.0.41 FreeBSD port: mysql-server-5.0.41

Where does mysql physically store info like the grant tables etc.

in the mysql db

on the hard drive

in the data bits

that's what I thought archivist .. thanks .. vluther

in a computer

actually the original questions was even more retarded and I was assuming that's what was meant and wanted to be sure.. but .. eh thanks again

is there a work-around for a load data local infile ERROR 1148 (42000): The used command is not allowed with this MySQL version
im on freebsd

Anyone here use Connector/J much?

why does "mysql -u user -p –local-infile database_name" have to be executed first on FreeBSD systems in order for load data local infile to not give errors whereas every other OS doesnt require this?

i want to do a multi table select. but how do i stop the query from returning zero results if the SEcond tble has no matching rows

Hi, Is there any help for using a mysql server with mirc scripting to save your date remotely?

Yes. Do you have a real question?
It's really best to ask the question before waiting.
That's either a bug or a misunderstanding.

how do I do an update modifying 2 fields at once?
something like UPDATE nzb_groups SET start=1111 and end=22222 where group='hello';
is that right?

set blah='foo', bar=12

ah cool, ok

UPDATE table VALUES (blah, blah2) SET (blah, blah2), (blah, blah2)
I believe
… WHERE blah = 'blah' :P

hmmm.. blah

I don't even understand how that syntax could work

I remember it being used somewhere

values(x, y) set (x, y), (x,y) ? I don't understand how that could possibly be anything meaningful

well, being an SQL noob like me, I probably forgot the exact syntax

what's the solution of this problem:
BLOB/TEXT column 'group_name' used in key specification without a key length

Jonathan25, add a key length, when you create the index on those types you need a key length

edman007
what would be the syntax
UNIQUE KEY `group_name` varchar(255) (`group_name`) ?

hi, can someone help me
Error, MySQL said: Cannot connect, invalid settings
does anyone know what to do

change config.inc.php to use the right username/password/host

wheres that lodated, what DIr
located*

phpmyadmin dir

k, thanks
where would i find/set the MySQL user and pass

How to use mysql with c++ in linux?

how can i tell how much space all of the mysql databases on my server are taking up, combined

du -ch in the mysql data directory

evening all. as i'm using explain and see that my queries need indexes, is there any sensible way to know what order the index columns should be in? as it is i'm just guessing and trying different orders till i find the right one

not sure what you mean by order\

indexes can have multiple columns in them. the order matters

Hmm, I guess I didn't know that
thanks

mysql uses indexes left to right column wise
this table i'm working on has 1.2 million rows so it takes a while to re-index it. /me would love to have a smarter way of figuring this out

wow

it depends on the data and the queries. you want to a) improve selectivity (reduce the # of index items the serve rneeds to check) and b) not have a lot of different indexes for differnet queries just coz you got the order wrong

left to right?

also, mysql 5 can use multiple indexes in a single query in certain situations.

i believe that is only in 5.1 and i'm sadly stuck on 4.1 for now

you can have an index on (a,b) or even (a,b,c) but the server can only use it if a is referenced. otherwise it can't use it just for b, as b has no order without a.
5.0.

and yeah, i'm just modifying the one index, switching the order around trying to get it to not table scan and temp table this million rows

if you're on 4.1, then choosing appropriate composite indexes should be fine. don't overdo it.

that's my question. is there a good way to get the order of teh composite index. right now i'm just guessing until i find the right one

anyway the above is a general idea, there's no one single answer to the question. it depends.

Mmm thanks! so if I have a,b indexed but I only select b the index won't be used?

correct

I'd do educated guessing based on the schema, dataset, queries that need to be done, a bit of mysql knowledge, and experience.

and does c depend on b as well?

if you're missing any of that list, you might indeed be guessing ;-)
yes. just like finding the 3rd letter in people's names in a phonebook…

my question arises from the need to inner join with one table, where off one column and order by two others

is indexing dates a good idea?

which should come first in the index? the join, the where or the orders?

if used in your where clause, certainly. can reduce the # of rows that need to be looked at significantly.

!man explain

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

that helps tons

the where clause for the first table is looked at first. then the join onto the second table. however, the optimiser is free to choose join order. what you write may not be what it does. the explain shows what it actually does.
uthe where clause for the first table is looked at first. then the join onto the second table. however, the optimiser is free to choose join order. what you write may not be what it does. the explain shows what it actually does./u

by "or the orders" you mean the order by correct? So indexes are applied when using "order by x" ?

they can be yes

you could run some queries to work out the cardinality of a given composite index.
but of course that would change as soon as the dataset changes
running such stats on a small test dataset never makes any sense.
it's like doing a street survey with 1 person.

how is "re-indexing" accomplished?

in 4.1 it involves a complete copy of the table in the new structure.
which , in case of just adding one or more indexes, should be unnecessary. but thats how 4.1 does it.

for me i had just updated my index and the system re-indexed it for me

in 5.1 there's code to not have to do that, depending on which engine is used.
yep it'll do it for you, for sure. on a big dataset is can just take a while. there's some server buffers you can tune to make it faster, depending on the engine again.

any good sql books to recommend?

i just read one that wasn't too bad. something like High Performance MySQL
i think it was oreilly

thanks, I've got Paul DuBois' fat ass mysql book, It's alright but not extremely informative.
erm, for being as fat as it is

so i got the ALL down to a range, but it is still using temp ; using filesort. any ideas on how i can optimize those out?

just out of curiousity, is the db for a website?

nope. there is a client side application that drops data into it for later analysis

gotta love "later analysis"

ah… i can't get rid of the filesort

innodb for all those records?

at least i got the explain down from 1.2M,1K,1K,1K to 700K,1,1,1
myisam

damn, looks like a good optimization!

)))

hmm. is there a way to invalidate the query cache for a table(s) without inserting into them ?
hehe. i figured it out. i changed one of the values and that should bypass the cache
hehe. i figured it out. i changed one of the values and that should bypass the cache

DBI connect failed:Can't connect to local Mysql server through socket var/run/mysqld/mysql.sock (2)
somoene here
5.0.41
DBI connect failed:Can't connect to local Mysql server through socket var/run/mysqld/mysql.sock (2)

seems like you don't have a mysqlserver running

i have it
i can't access from webmin
the mysql.sock in in /tmp

but you can access it with the mysql client?

yes
when write mysql it work

I don't know anything about webmin

or i need to download the latest mysql maybe they fix this bug?
bor i need to download the latest mysql maybe they fix this bug?/b

this is only kinda related to mysql i think.. but was wondering if anyone used the MySQLdb module for python? im having a heck of a time getting it to work

I doubt there is a bug, double check you webmin settings

ok
can you help

I use it…

can you help

feel free to ask in the channel
I don
I don't use it directly, really use it through django…

path to mysql command ?

this is my code here: http://deadbeefbabe.org/paste/5521
it bombs when trying to insert a dupe value into the database (key)

what directory i need to write path to mysql command?

Comments

Oh Hrm that might be ungood So say I needed a random letter between a through m would chrrand017 work properly

I had asked my question, didnt really get an answer though

your tip doesn't work for me

VIOLA!
I just freakin figured out how to get past dig being psychotic

hmm, is_readable isnt working very well
i remove my read access, it says it's readable and then fails when i go to read it

$_SERVER['argv']

that works too

hi there

? really, pastebin the code

does anybody know if it is possible to reduce the bitrate of a mp3file with php`
?

brain-xy: php and audio don't go well together,

yes.. i thought so.. hm

Thanks a ton for all your help. I think I am actually almost done with the actuall backend part of the code now thanks to you pointing me in the right direction.

http://sausage.no-ip.org:88/paste/desu-is_readable

no problem, it's why were here!
you can actually set permissions like that up in Windows?

of course
maybe php just doesnt support it
i'll try chmod
nope, same error

using a symbolic link anywhere?

changed the owner, still is_readable returns true
nope, file is in the same directory

try it not from command line (if that's what you're doing with $argv)

file_exists works fine
and it's getting $file from the same source
theres no notes about windows on the is_readable php page
i'll try a different version

Okay so I know how to get a random number. Is there a way to get a random letter instead?

sure,

Using rand() and then converting each number to a letter?

chr(rand(0,255);

beat me to it :P

oh sweet.

however, that wont always get letters

good point

65 to 122 I think is what you need, but then you'll get []/_ etc sometimes

lowercase = 97-112 or something

Oh. Hrm, that might be ungood. So say I needed a random letter between a through m would chr(rand(0,17)); work properly or do I chance getting something off?

no, you'd get all control characters

http://www.asciitable.com/

chr(rand(97,104)); // a-m

97-122
yeah,

So 97-109 would give me what I need. Sweet, thanks.

i'm not a good counter

haha

my random number generater generates 18-24 characters a-zA-Z0-9 - and _ and it's slow as hell :P

a random number generator that includes a-zA-Z - and _ ?
since when have they been numbers?

and it's not even totally random ;-; just 2^24 possibilites
str_replace('number',''); :P
how high should i generate a random number
0-INT_MAX or what?

you can specify the length of your password as an argument to your function

why do you want to create a random generator?

i mean, whats a reasonable value for rand(0,xx)
if i wanted the biggest range without using floats
and i just noticed something, PHP_INT_MAX is signed and sprintf("%u",-1) is unsigned +_+
i had them both defining to the same name as they were available

Is it possible to use extends in PHP4 when creating a class?

um… Yes

I feel like OOP in php4 host is pretty basic and I'd gain a lot from a switch to PHP5
I can't wait :/

classes in php5 and almost useful :P
are*

So, writing a DNS Traversal tool. Not so much fun

floor(sprintf("%u",-1)/2) seems like a big hack ;-;

PHP5 is PHP4 with the mutant powers of "Oh, gawd! I swallowed a radioactive Java!"

i'd probably just include a comment explaining the magic constant, and then just precompute it and put it in the code

but it's different on 64 bit machines

ah, right

and theyre coming in fast

Where all can i view errors for php files. I have error_reporting to on, but i still have a blank white page
I checked httpd/error_log, but im not seeing anything

is display_errors on aswell?

yes

error_reporting E_ALL|E_STRICT display_errors on and nothing piping anything i guess

The files started doing this when i moved the script to a new folder
Yes, i have even E_ALL set and still nothing

check if it's calling any exit/die and if theres any absolute paths in the file

There isnt, thats whats driving me nuts

Comments

oh did I mention the build environment is in Sri Lanka and the build doesnt run after 6pm local time because the

How can I print out all the elements and attributes associated with a org.w3c.dom.Document?

If I have an external library in this case Jakarta Commons HttpClient, which I want in the classpath so my app can run, htf do I do this?
Is it even possible? Afai can see it isn't

JVM option -Dclasspath=path-to-jar
I believe

This compilation process used to work, I have to reinstall all my server because of a HD phisical problem and then now I am getting these 3 errors in output. http://pastebin.com/m6811e271 Any idea, please

Nope
How do proper apps do it?
I can't believe it's this difficult just to find a class
jars are pathetic then
What is the point of the jar if it has to stand alone


that last point is terrible. but anyway, maybe this will help: http://forum.java.sun.com/thread.jspa?threadID=583158&tstart=90

g[r]eek, HAHA. I am reading that exact thread now

hi

any help, please

yeah, import Itau.Itaucripto; is borked
~tell azuos10 about classpath

azuos10, 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

I tried this and still getting the same 3 errors: /usr/lib/j2sdk1.4.2_04/bin/javac Consulta.java -classpath /home/aaa/itau_shopline/Itau -sourcepath /home/aaa/itau_shopline/ -d /home/aaa/itau_shopline/

I guess the factoid 'getting started' might be appropriate:
azuos10, getting started is seegetstarted

where?

I guess the factoid 'where are you' might be appropriate:
Here

What is factoid?

I already have a factoid with that name, azuos10

~factoid

DRMacIver, factoid is a small snippet of information like this one.

Why "where am I" would be appropriated?

I guess the factoid 'why not mozilla' might be appropriate:
https://bugzilla.mozilla.org/show_bug.cgi?id=84128

hehehe

Are you talking about my IRC client?

I guess the factoid 'the truth about garbage collection' might be appropriate:
azuos10, the truth about garbage collection is http://java.sun.com/docs/books/performance/1st_edition/html/JPAppGC.fm.html

you know that you are talking to a piece of software, right?
or do you meet that less people that finding this out is impossible

Anyone ever setup jetty + jndi with properties?

In JNI two different 'jobject' references can point to the same object. Is there a way to get a unique value for an object (like a ptr) to store in a hashmap?

sometimes you learn a lot about the bot looking at newbies talking at it
hey dharrigan

andresgr, !

I can not see how GC could help me there?

I guess the factoid 'cannot resolve symbol' might be appropriate:
azuos10, cannot resolve symbol is http://c2.com/cgi/wiki?CannotResolveSymbol

you still didn't get it?
you could also go into the kitchen and talk to your microwave

I saw it before when you said the first time. I put it into the compilation command and still there with the problem

I guess the factoid 'fallacies of distributed computing' might be appropriate:
azuos10, fallacies of distributed computing is Please check out http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing for more information.

sigh

how do I use FilenameFilter? is the String equal to REGEX ".*name.*"?

wow

I'd like to list all files in a directory [using file.list()], only if the name starts with "metadata_"
not list, I want an array that contains the file names

you will probably need to build it yourself

yea, just implement the interface

hi

oh (oO)

I'm looking for the easiest and simpliest way to implement a RESTapplication server in JAVA

OK, next question :P how do I implement an interface :P

is there any framework that you would suggest to me ? I've googled a bit, but I don't know which one to take ?

~interface

Aradorn, interface is http://java.sun.com/docs/books/tutorial/java/concepts/interface.html

thanks

~rest

http://en.wikipedia.org/wiki/Representational_State_Transfer

OK, let's see if I got it, I'll "implement" it for my class and in my class I write a method called "accept" [that's the method for the FilenameFilter]?

yes

nice
I love this Java thingie :P I keep learning something new every day

heh

and thanks to you, Aradorn and Duesentrieb

hello .. i want to get involved with an open source java project, where i will be able to learn how to use and apply java web host in real life ..
any suggestions for me ?

rohan, http://greenteapress.com/thinkapjava/
very good start
if you want to learn java

thanks, daredemo , but i already know java ..

ah
sorry :/ sourceforge?

i'm looking there too .. but since i have no prior experience, i have very few options

This compilation process used to work, I have to reinstall all my server because of a HD phisical problem and then now I am getting these 3 errors in output. http://pastebin.com/m6811e271 Any idea, please

rohan, I'd suggest helping for example, Ayam, or sunflow :P
or any other 3D related Java project
rohan, or you can team up with me :P

did you now realize what javabot is or do you still ignore me?

rohan, but I know very little Java

lovely .. but do you already have a project ?

Could you help me with my problem?

rohan, yes, but I'm not sure if they are open source

or, yor are a microwave as well

looks like your classpath is wrong

rohan, I'm writing a English-Japanese dictionary interface for edit

Even when I set the classpath it takes the same error

~tell azuos10 about classpath

azuos10, 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

and now read tht
that

rohan, and I'm writing one stockmarket tool [for local market]

setting it doesn't make it correct

It is finding the Itau package, but not recognizing Itau.Itaucripto

Is it possible to do an HTTP connection to a server host by IP, and specify the virtual host to retrieve?

This package is a blackbox for me. it was provide to me and I have already checked the md5 and it is ok

provided as a jar?

provided as itaucripto.class
I create a subdir called Itau and then I copied the itaucripto.class file into it

so the classfile is /home/aaa/itau_shopline/ltau/ltaucripto.class ?

yes
that is why my program is doing import Itau.Itaucripto;

you could put it everywhere, you'd just have to set the classpath

I am not a java developer, but I think it is rigth, because it was working before my server crash

in which directory are you?
set the classpath to /home/aaa/itau_shopline

i'm sorry, i was disconnected
what are you using, for the stock market tool ?

I thought my projects were too boring :P

I did it and still the same error

rohan, what do you mean "what are you using"?
by+

i mean, GUI ? if yes, what GUI ?

it will have swing GUI with Graphic2D and/or jogl interface

cd to that directory and try again

I am inside the directory
as root

rohan, at the moment I've got data retrieval working, I'm currently starting to work on the actual data drawing

ok .. let me see if i can find a worthy project on sf.net otherwise i'll tell you ..

/usr/lib/j2sdk1.4.2_04/bin/javac Consulta.java -classpath /home/aaa/itau_shopline/ -sourcepath /home/aaa/itau_shopline/ -d /home/aaa/itau_shopline/
It is correct, isn'it? Still the same

is there some nice function in java string to "asciify" a string? chaninng all "foreign" chars to their ascii variants, ie ü to u.. á to a..

download daily summary data if the file is not downloaded yet (works), draw candlestick (and optionally other) charts (work in progress)

wow, and you say you don't know java !

rohan, I have a wild imagination :P

anyone who's doing so much has to know loads of java

rohan, if you can't find a project, tell me, and I'll start one on google or something
rohan, nah, I only know REGEX :P

haha .. sure thing, but doing what ?

rohan, anything

then i have no idea, sure you used the same case, not itao, but Itao etc. ?

rohan, I'm into 3D

ok, start one on google .. let's see how wild your imagination is, daredemo :P

rohan, so, mobile games would be one option
but I doubt I'd like to make them opensource, as I'd like to get paid for it

and who would pay you atm ?

rohan, I have some pre-agreements for some educational 3D stuff

what kind of pre-agreements ?

rohan, money :P if I get something useful done

great, daredemo ..

rohan, what I plan to do is slightly questionable :P
rohan, I'm a Member of Board of one foundation that funds educational IT projects

yes, I did, just to have an idea when I type -classpath /home/aaa/itau_shopline/Itau instead of -classpath /home/aaa/itau_shopline, it says the Itau package does not exist. So I do not think it is a classpath problem

rohan, and I want to set my own company that tries to get money from them/us

wow .. which foundation is it ?

but in both case I still got the same 3 errors

well, of course I'll abstain from voting if they discuss my projects

no idea then

thank you dangertools

rohan, a small governmental foundation of one small country
rohan, our budget is about 1 million euros per year
but most of it goes to training related projects

which country ?

/whois daredemo

ee stands for ?

http://www.google.com/search?client=safari&rls=en&q=domain%20.ee&ie=UTF-8&oe=UTF-8

estonia, no?

cheeser, should be

This compilation process used to work, I have to reinstall all my server because of a HD phisical problem and then now I am getting these 3 errors in output. http://pastebin.com/m6811e271 Any help, please

again. fix you classpath.

as discussed with dangertools. The problem does not seem to be with the classpath

there seems to be no other explanation

rohan, would you be interested in some educational soft development?
rohan, the edu soft HAS TO be opensource

yes, very

rohan, OK, let's exchange contacts or something

if the VM says it can't find a class, there are very few alternatives.

It is not saying that

sure, it says that it cannot find the class

"cannot resolve symbol"

with the wrong path it says Consulta.java:1: package Itau does not exist
with the correct one it does not say it

then make sure that class exists in the Itau directory

sorry man, but I am not stupid, I know I might looks like, but I am not

no one has said you are.

it clearly says symbol not found which means class not found, don't ignore that

in the pastebin I printed the ls -l too

in your javac commandline, where's your -classpath entry? http://pastebin.com/m6811e271

tthe file is there

Anyone know how you get those breakdowns on google, like, google for "outsurance". the first result has 4 sub links. how do you get them?

for all i know you're a rank newbie so i'm starting at the beginning.

rank newbie ?
~rank

Roooooony, I have no idea what rank is.

also are you sure that Itaucripto is in the itaucripto.class file (the case doesn't match)

in the pastebin, the classpath host is not there, I just did it here and the same thing

Hi, I'm trying to get the Postgres JDBC working with my fedora 6 box. I have the drivers installed apparently but a call to Calls.ForName("org.postgresql.Driver") raises an exeption

before my system crashed it was working fine. Unfortunately it is a blackbox and I cannot see inside it

add the pgsql jar java hosting to your classpath

it is the same phisical file

try renaming it to match the class case

if you copied both, java source and ls -l output you ignored my "is the case right question" right away

lol

ah, where would i find the pgsql jar file? i'm really new to java

you said you had the drivers installed. what drivers are you talking about?

ln -s /dev/null pgsql.jar

I did not ignore you. the case is right

the jdbc postgresql driver

not if you use Itaucripto and itaucripto.class

itaucripto and Itaucripto are seriously not the same case

I understand I should add the jar file but I don't know where it would normally sit on my Fed box.

~tell BrokenNoze about classpath

BrokenNoze, 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

it can sit anywhere you want. you just need to add it to your classpath

most of the installs include the JDBC jar in their directories somewhere … try in your /usr/lib/postgres … or whatever

ok. thanks people

thanks for your help. I can not understand how my file code has changed, because it were a backup but it is working now. thanks a lot

Hm. Any good tools for searching for classes in the classpath?

javap
8^)=

hello anyone knows why i have to use "http://java.sun.com/jstl/core_rt" instead of core

~jogl

daredemo, jogl is a JNI binding of the OpenGL 3d Graphics library. Great for 3d games in Java. https://jogl.dev.java.net/

i am using jakarta-taglibs-standard-1.1.2
with tomcat 5.5

anyone know of an IRC channel for Ant? I've just tried to subscribe to ant-users but the signup process is borked

Hm.
Looks like I might need to use the release candidate of Idea 7.
(Or possibly downgrade to the last version. Hard to tell which. I'm hoping it's the upgrade, as this is 'cutting edge' stuff )

i'm using eap 7111

What's the verdict?

it's good.
i miss one part of the dep mgmt, but it's stable.
and the new features are pretty nice

That's good.
I've had bad experiences with release candidates of IDEs being mindboggingly unusable. (Specifically Netbeans)

yeah. i've had the same with some IDEA EAPs

(Of course, I've had bad experiences with official releases of netbeans being mindbogglingly unusable, so…)

but the vast majority are surprisingly useable
heh

I had some issues with TestNG-J unfortunately otherwise it is fine and dandy, running EAP 7118

I haven't fired up IDEA in over a month…
Time to see if there's anything new

Many new JPA inspections

They've closed three such bug reports of mine regarding hibernate specific stuff in jpa queries recently..

Yep, looks like I need Idea 7.

and I have a few more pending.. but they are closing them faster than I can find new things to comaplin at

Now to downgrade my version of Scala…

IDEA rocks. Simple as that

bleah, morning AGAIN

Aloha jottinger

yeah.. It's nice to report stuff and end up basically chatting with a developer in jira imidiatley..

when is the next 7.0 release coming?

they typically release EAPs on fridays, but the last bug of mien they close they closed with an M2 tag, so I'm unsusre

they haven't hqd an EAP of 7.0 in a long time, have they?

current mileston is M1, current EAP is #7118, which is much much newer than the milestone

The milestone 1 has been around for a while now.

hqd?
ah, had..

ahhh
I'm on the milestone, not the eap… silly me

not in a long time if you only got by milstones ;9

I take it the eap is far better than the milestones

Yeah.

I think we have had three eaps in the past two weeks or soemthing
the EAP is also, in my oppinion, quite stable by now

very cool, I need to update

not release quality ofcourse, but getting there rapidly

Plugins is where b00gz seem to be.

hopefully they fixed the facets

mostly.
i find it still drops my JPA datasource definition.
the DS is still there. the facet just forgets about it…
and i miss the dependency tree bit where all the deps were in alpha order.
that was nice for spotting dupes. or just finding something.

it auto-added my JPA facet, but didn't add my persistance.xml, nor link up with the single datasource I have configured

Same here.

I don't mind it not linking up the datasource I supopse, that is acceptable, but it should have picked up the persistance.xml

buh bye javabot

you still see the end result of the library imports in the project view, libraries tab though

you killed javabot… you bastard!

it's where I tend to find oddness..

(Well, this particular Idea plugin. but it's still their fault. )

okay, downloading 7118

250 bucks for a license?
thats rediculous
… ridiculous

and worth every penny

yes, it should be $500!

I wonder why it is that developers always seem to think it's -toher- people who are suppsoed to be paying for software

IDEA has this strange tendency to be rejected by people who don't want to pay for it… and then when and if they break down and try it, they end up saying "whooo, what a deal"

I actually think Idea's license fee is very reasonable.

s/toher/other/

And did even prior to trying it.

they are a bit like macs…

hi all
can somebody help me in javamail?

can you ask a question that has an answer?

everythink works fine, but i can't setup connect's port

and chances are, if you're using javamail, you should use commons-emil instead

soory jottinger

Plus, they charge in dollars, it's gettig cheaper by the day for me

Eeeeemil!
Then IDEA is the best 250 bucks you spent for it.

if i was using a mac i would use textmate but thats a different story

Likewise.

is it a one time fee?

WHOA… breadcrumbs!
~idea++

No, it's a two time fee. You pay the dollar price up front then, at some unspecified time later, they come for… your SOUL.

otherwise, join an OSS project.

or your goat.
Most people give up their souls.

I could also manage the payments for you, then it is a 4 time payment.

but yeah, OSS projects get a free license.
But it's still worth the cost.

~ping

is idea that expensive?
when i was about to buy it it was like 50euros

$250 for personal

You rang, m'lord?

~ping

You rang, m'lord?

~javadoc String

I don't know of any documentation for String

tee hee hee

w00t to ze version
~logs

joed, channel logs is http://servlet.uwyn.com/drone/log/bevinbot/%23java

~be joed

r3trartz uniti3!!

academic license is only 99usd

~karma joed

joed has a karma level of 51, cheeser

My goodness!

~karma cheeser

cheeser, you have a karma level of 370.

Oi,
~cheeser++

cheeser has a karma level of 371, joed

~karma chameleon

chameleon has no karma, deebo

javadoc coming right up!

figures

laaaaag
uploading src.zip to the server to process
8^)=

Damn it's amazingly enterprisey scalablebly fast!

~be jottinger

I hate you.

~about

I guess the factoid 'the truth about garbage collection' might be appropriate:
cheeser, the truth about garbage collection is http://java.sun.com/docs/books/performance/1st_edition/html/JPAppGC.fm.html

~javabot

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

~help

See 'help about', 'help factoids', 'help javadoc', 'help karma', 'help abuse', 'help literal', 'help magic8', 'help google', 'help rot13', 'help dict', or 'help tell'.

hrm.

~rtfm

Read the Fine Manual - API Docs: http://java.sun.com/javase/6/docs/api, Really Big Index: http://java.sun.com/docs/books/tutorial/reallybigindex.html

somewhere in there was teh version info

~version

~stats

I guess the factoid 'unsupported version' might be appropriate:
unsupported version means you compiled your code on a newer version of the VM than you're trying to run it with. Recompile for/with the older VM or upgrade your VM.
I have been up for 0 days, have served 11 messages, and have 2544 factoids.

I always just did a whois on version.

2.0 8^)=

can anyone get to commerce.bea.com?

sure, gimme your credit card

yeah

it's working?

indeed

hrm, something funky on my end then

your infamous Solaris box?

~javadoc String

I don't know of any documentation for String

[TechGuy]: the solaris box is able to reach it, it's the windows box that's having the problem

hrm.
doesn't seem to have worked…

web-ui?

haha, it's very javascript-driven, so links couldn't use it!

Noticed that GF is up to v2RC2 now?

nothing in the logs either.

You have a virtual2 Reality Cache 2 Girlfriend?

weak!
8^)=

Any bombing ?

It's virtually realistic

well, i'll deal with it later.
it's just the javadoc anyway.

[TechGuy]: no, I need to wait until it's stable to use it

module startup times seem faster. Only took about three seconds to load the JSF module when first going to the admin page

the rest works? Like factiods/logs/karma?

yep

Publish url?

[TechGuy]: heh
does the jca registration still suck?

dunno. Never dealt with JCA
Want me to fire it up and I PM you my address?

no

Hi. Is the comet implementation in tomcat hosting 6 only an experiment or it can be used in real world applications?

gah

you can use it however you'd like.

IE can *read* bea.com, but I can't log in

IE. tee hee

~ridicule jottinger

Some perverted side of me wants to play with Oracle XE

sweet ;-)

I gave a glance…it seems a little hard to understand and very quiet low level..

Safari and Firefox both failed

is there any library that make it easy to work with this paradigm?

[TechGuy]: so why don't you?

It's Oracle. I'm scared of it.

I need to add an attribute to a DOM Node, any ideas?

sure. go for it!
you can do it!

[TechGuy]: oracle is quite nice in many ways, it can also be a high resource user…

bomo

Well I can't figure out how to do it.

err boom
Emphasis on high resource user
I have a friend who I haven't spoken to in years who's a senior Oracle sales exec. He used to give me lots of free CDs here and there.

[TechGuy]: well, you can run XE on your desktop machine, but you probably do not want to do that…

any "framework" for comet?

google for cometd. seems like a saw a few but can't remember which.

what class/library are you attempting to use?

~stats

I have been up for 0 days, have served 3 messages, and have 2544 factoids.

~be joed

r3trartz uniti3!!

~stats

I have been up for 0 days, have served 6 messages, and have 2544 factoids.

Tharz we goez

~tell mattis___ about xml

mattis___, xml is best parsed with XOM (http://www.xom.nu/ ), JAXB (http://java.sun.com/xml/jaxb/ ), JDOM (http://www.jdom.org/ ) or XmlMap (http://www.zwitserloot.com/java-boilerplate/mox ). If you like pain, you may wish to check out SAX or DOM (http://java.sun.com/xml/tutorial_intro.html ).

STAX isn't bad

Doesn't OC4J and OAS have a generally dim opinion in here?

ah HA!
~opera++

opera has a karma level of 1, jottinger

"don't," techguy… and when you say OAS, what do you mean?

Yeah bite my fat ass. :o , I was originally typing just OC4J. And Oracle AppServer

ah
well, it's not bad, really

bite my shiny metal ass!

all hail Bender

OAS can also be used to refer to OrionServer, was why I asked

~hail bender

All hail the mighty bender of benderness!

and my opinion of OrionServer is and nearly always has been that it's the bestest J2EE 1.3 server around

Where're Prof. Farnsworth and Zoidberg when you need them?

Will there ever be an updated version, you think? or is it dead?

zoidberg's probably eating his young

I think it's a victim of WoW addiction.

unlikely, his race dies after breeding.
hehe, seriosuly?

yeah

That is both amusing and tragic at the same time

rumor has it at 95% done in a LOT of areas.
yes, agreed
it really bugs me.

hello
i have an issue running a java app on mac os x

damn you lionel richie!

the culprit is steve jobs

I blame Woz

is there any way to have the app running using gtk instead of aqua?

luke`: only if the app supports switching to the l&f
i dunno if you can force that externally or not.

I don't think so with Apple's VM

hmm

[TechGuy]: can you with sun's?

I blame lionel ritchie too for giving nicole ritchie a basis for being known

java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel your.fine.Program

very nice.
i'll have to remember that.
i don't do a lot of SWING so i'm unlikely to.
8^)=

~look and feel is replyjava -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel your.fine.Program

why remember when you can have robots remember it for you wholesale

~look and feel

joed, look and feel is java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel your.fine.Program

Hmm, reply, maybe we need to clone().trim() that…

I need to append my classpath at runtime– any ideas?

hrm. no feedback when creating a factoid?
~feedback is replywhat do you want to hear?

Okay, cheeser.

luke-jr: create a new URLClassLoader

strange
~feedback

what do you want to hear?

hi all. I like to know if NetBeans support collaborative develpment (like SourceSafe on VisualStudio) thank you.

and that will change the classpath?

#netbeans can probably tell you

sourcesafe isn't collaborative

luke-jr: well… yes and no. you can use your own lcassloader to load classes from additional places (directories, jars)

it's a way of putting the brakes on development

I'm not the code loading it

how do I prevent aqua from decorating each window in the application? The application looks great on linux and windows

luke-jr: the classpath defines which places are searched by the default classloader. you can not change that.

why not?

VSS is the lesser of the two evils I have to use..

luke-jr: because that's how the class loader system works.

what's the worse?

ccc/Harvest
Change Management stuff. Wrose by several orders of magnitude.

in what kind of hell do you work?

luke-jr: if you have class X which needs to load class Y from an obscure place, make sure class X is loaded through a classloader that also knows where to find class Y

Your everage mid-large ERP vendor..

It's the sequel to The Divine Comedy… The Holy Sitcom

Look at it this way, I checked in a change in harvest earlier today, and waited for 114 minutes for the build to complete…

hahahaha
I mean, uh, ouch
at least with VSS you have an excuse to lie about using it
"Oh, it lost my change… again"

the build ofcourse failed. not on my stuff, but on someone elses, so I'm waiting for the next build, which should be done in about three hours
hopefully said person will have fixes their problem so the build as a whoel can complete, and I can promote my fix from implementation to the -actuall- build
It's an… interesting way to work

I've been there before.

hello

oh, did I mention the build environment is in Sri Lanka, and the build doesn't run after 6pm local time because the power to the industrial area the building is in gets the power cut at nights?

i advetise for #math-prog . anyone willing to help out is welcome there

hahaha

that's awesome

no… but I think that trumped me

It's apparently something fairly common while they construct new regions, as the power grid can't keep up.. when people come home frmo work and turn on lights, there isn't enough capacity

that's spooktacular

anyway, it's life.. fortunatley most of my work doesn't involve that particular system, so I get to use VSS.. hence why VSS feels almost like a treat

golly, I feel like I can't even make fun of you now, out of pity

i have no such compunctions.

hehe
I'm sure it makes more sense to some other group of people than it does to me..

yes, your competition

Tsk. This is ERP. This is like the ERP equivalent of agile development..

buzzwordy and of dubious value?
~ping

Uh.. wha?

ive just installed jdk 6, how do i get rid of the old jdk 5? (using windows)

uh…

why do you need to do that?
you can keep both and it can be handy to have java/5 in a few cases…

uhm, tidy up space and clutter ?

add/remove programs does not work?

it's in the control panel. consult a windows help forum and/or google

Anyone remember what the MySQL implemented semaphores are called? It's for when a process wants to create an lock on a namespace rather than a database object.

ask ##mysql?

nope, it probably calls the installer again, because it says that it is already installed (doh)

That is a 1337 channel where no one talks about these simple matters.

is there an easy way to test javabot from console, preferably not needing any irc server…

not atm. but there are testng tests you could use.

if you want your apps to work with mac you have to compile using java5
at least that's my experience

there's a java6 preview out but it's oooooold

ok well i'll keep it.

but you can compile with 1.6 and target 1.5

guess I have to open another feature request then… :-/

in case the uninstaller doesnt work (which is the case) can i just delete the jdk5 directory ?

heh.

there are a few missing docs on how to start coding/testing javabot…

what do you need this time?

cheeser maybe that's what i did.. i'm just a n00b

yeah. that should probably be updated.
a *lot* has changed since 1.7

I added my throttle multiple tell, want to test that it is working correctly… want the diff?

man, BEA needs to get some bandwidth

attach it to a ticket in the issue tracker.
i was just talking to joed about that request.

post it to the tracker

my folks are coming to town so I won't be able to look at it for a few days. but joed might.

where do I upload files there?

if not i'll try to apply it next weeks

are servlet questions ok here or do they have a special channel?

they're okay here

just attach them as issues

great.. i'm planning to learn something about it

I just see "add a comment:" I do not see any attach file…

are you logged in?

no…

"

sf.net ate my password when they were hacked, the account sends mail to an old school account so I can not reopen it….

weird

(I could create a new account, but that sucks since I have my project there…)

and the admins can't fix that?

s/my project/one of my projects/
tried to contact them, got no response, stopped bothering

yeah. they kinda suck sometimes.

got it?

if you declare an Object, but do not initialize it, does it automatically get set to null?

moved all my projects to my own server instead…
it depends

Thank you!

note that it is untested, but the difff is probably easy to read…

No problem!

ernimril, on what?

Hm

where you declare that object

~graph

I guess the factoid 'graphics repository' might be appropriate:
DRMacIver, graphics repository is Java Look and Feel Graphics Repository http://java.sun.com/developer/techDocs/hi/repository/

~jung

DRMacIver, I have no idea what jung is.

~fmarceau

fmarceau, I have no idea what fmarceau is.

ah

if it is an instance or class field, then yes it will be null by default

i'm debating moving javabot to launchpad.net

jung is the Java Universal Network/Graph framework, a very powerful library for manipulating and visualising graphs in Java. See http://jung.sourceforge.net/

Okay, DRMacIver.

graph is seejung

if it is inside a method, then you will get a compile time error if you try to use it before setting it

~ping

Pong

Hm

~graph

I guess the factoid 'graphics repository' might be appropriate:
cheeser, graphics repository is Java Look and Feel Graphics Repository http://java.sun.com/developer/techDocs/hi/repository/

ernimril, what do you mean if it is an instance? aren't all objects instances of a class

~graph is seejung
~literal graph

I have no factoid called "graph"

~literal graph $1

I have no factoid called "graph $1"

class Foo{ Object o; void bar(){Object p;….}}
o is null, p is undefined

jung

Okay, joed.

~jung

jottinger, jung is the Java Universal Network/Graph framework, a very powerful library for manipulating and visualising graphs in Java. See http://jung.sourceforge.net/

~graph

joed, jung is the Java Universal Network/Graph framework, a very powerful library for manipulating and visualising graphs in Java. See http://jung.sourceforge.net/

~be jottinger

There are no stupid questions, only stupid people.

anyway.

~be joed

r3trartz uniti3!!

~graph is seejung

I already have a factoid with that name, cheeser

~graph

cheeser, jung is the Java Universal Network/Graph framework, a very powerful library for manipulating and visualising graphs in Java. See http://jung.sourceforge.net/

ernimril, does it make a difference if the method is static?

the sequence value was borked
was getting dupe IDs

Yep, for some reason. I'll look later at that. I have the same error in a test here.

~tell peeps_work about variables

peeps_work, variables is http://java.sun.com/docs/books/tutorial/java/javaOO/variables.html

probably just an import problem.
select setval('hibernate_sequence', 100000);

hmm.

GAAAH!!! Where TF does it say, anywhere, on commons-httpclient that it also depends on commons-codec?!?!

in the pom.xml?
8^)=

[TechGuy]: why do you need commons httpclient anyway?

Simple post-read-response HTTP where I have to control a request header. I hear commons-httpclient tossed about here enough

Dependencies

err, [TechGuy]
disregard

well that's a helluva place for it

[TechGuy]: and HttpURLConnection does not give you enough?

It's nice when one is able to cut out huge chunks of the design as irrelevant.

yeah. they should've picked some place less obvious

Or, ya know, maybe actually *mention the damn deps* in the readme or such
Probably does. But commons-httpclient says HttpURLConnection has "issues" (dunno what those were).

[TechGuy]: well to be fair so does commons-httpclient…

[TechGuy]: that's the place where the dependencies of all Commons projects are
[TechGuy]: but yes, it's hard to find

True. Grain of salt

whats wrong wtih HttpURLConnection?
Ive used it pleanty of time without any problems

Screw it… quick refactor back to HttpURLConnection

but but but, more dependencies == bettarz?

that would explain why javabot needs 35 MB of external jars…

heh

You see the light!

Hm. Jung really is astonishingly featureful.

JSF's and Facelets seem like they are ready made to create the uberest CMS ever.

RYO!

do I use "import java.io.FilenameFilter;" before I can use it to implement with my class?

tias

very little about the framework choice has much to do with how good a CMS is.

I agree that good arch is the most important. But having a slick magical framework behind it, makes creating a good arch easier.

and i'm not sure JSF is that magical framework.
8^)=

It's magical how long it has taken though.

I'm interested in your take on it, as I'm not only new to Java, but very new to JSF's having only gone through the tutorial and watched the few flash demos.
I understand the biggest issue is it is .net component based rather than MVC.

erm

.net-ish I mean.

~seen kinabalu

9 AM kinabalu :unaffiliated/kinabalu joined the

w00t

Indeed!

Anyone want to give me a hand? I'm getting "ghosting" in a JTable. When I add a new row, the values from the row above appear in it, but they're not the cell's contents.

do you have a test case for that?
are you sure that you only modify the table on the edt?
~edt

Event Dispatch Thread, the thread that drives the swing gui. See http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html for a tutorial on Swing and threads, and note http://java.sun.com/developer/JDCTechTips/2005/tt0727.html#1

I'll take a look. I'm new to java. When I'm adding the row I'm manually instantiating a new row in the model, filling it with null values, and then fireing the fireTableRowsInserted, so I'm fairly sure that the new row's values are empty

anyone ever use quickfixengine?

excuse me gentlemen
which is more advisable these days, to make methods take arrays or lists as parameters?

if you use generics you usually want to avoid arrays, since arrays and generics does not mix well

{ public void dance(E[] sequence); }

ernimril, hmm that be true

i have JRE 1.6 installed and when i try to run a java program, it returns with: Exception in thread "main" java.lang.NoClassDefFoundError: com/jgoodies/looks/plastic/PlasticTheme

I got stuck with FilenameFilter interface :/ How do I make the "accept" method?

exactly as it is described in the interface
that's an external lib, you miss the plasticTheme

it's trying to use some external class, and you haven't told it where to find the class

how would i pass that option? the program comes with 2 more jar's….looks-2.1.4.jar which i'm assuming will have the theme

~tell adeel about classpath

adeel, 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

thanks

hmm is this idea's .form format some propietary crap or a supported format?

it's a supported format. In IDEA.

:/
guess ill just do my gui stuff by hand then
time to prepare the razor for the wrists

g'morning.

Why not tell IDEA to generate the java code instead of the .form?
I mean, it's an option…

hmm i didnt find that, lets have another look
ah there
been a while since i used this :P
mmm, how do i start editing a class that is already extending jpanel and has components

i can only find new form, which creates .form instead of .java alltho i have set it to generate .java

use netbeans matisse to edit your forms and idea to edit your code

look in your class… there should be collapsed code at the end

what does this mean? : java: xcb_xlib.c:50: xcb_xlib_unlock: Assertion `c-xlib.lock' failed.

jeesus this is hard, ill just do it by hand
when i open a class that extends jpanel the side bar doesnt have the "ui designer" tab
and ll i can do from the new menu is make a new .form
which i dont want
but if i create a new Dialog it will generate java too
going from idea to eclipse was hard, but its hard going back to idea :P

hi all, does anyone know of a c compiler that doesn't require an install? Something like eclipse where you just unzip it in a folder? I would ask in #C but they block my gateway
rather unfortunate…

GCC

I should mention that I'm on a windows machine that I'm not allowed to modify in any way

yes, that changes the answer to "GCC"

so I'm thinking of running off a usb stick

mingw/gcc should

anyone know if idea can import/convert a complete eclipse workspace?

you think cygwin would work? I also need a prolog and a lisp compiler

it should

I could give it a try I guess
can anyone tell me what a recursive decent parser is in simple terms?

decent?

err
descent? [sic]

n) parse(n)

using java 1.6, is there a way to get around the 'xcb_xlib.c:50: xcb_xlib_unlock: Assertion 'c-xlib.lock' failed' error?

http://en.wikipedia.org/wiki/Recursive_descent_parser

markup didnt go quite right there but still :P

I have to write one in c for programming languages
woohoo fun stuff…

aaah its like that :P

of sorts
well, I gtg and try this cygwin for a bit, thanks guys

why do people use global resource directives in server.xml and then use resourcelinks in their context.xml?
dosnt seem to make any sense

i don't use either of those.

how do you normally do it?

it is.

yeah tomcat
we are pretty low tech here
quiet today

yeah

ill liven it up some…
when i compile my program it is giving me a ClassCastException but I dont cast any objects in my program. Can someone tell me what is wrong!

hi

Guten Tag

when I create a soap server in java, can I specify the IP address I want to bind to ?

oh my god.
Wow, did I ever mention how fun it is to use gcj.

that bad?

no

javabot tell svm_invictvs about gcj

svm_invictvs, gcj is not Java; don't be surprised if we refuse to help you. You can find information about gcj at http://gcc.gnu.org/java/ or see #gcj on irc.oftc.net

Fun like having a papercut on your nutsack.

so, this is odd.
this is -not- a slow machine.

drop em, i'll give you the papercut

gcj is can't be that much fun

but things like firefox, thunderbird, and eclipse… tend to be sluggish.
i have a decent video board, plenty of ram - but it's like the GUI hooks are rendering pig-slow.

eidolon ive had that problem lately

yeah i know what you mean. "I got three cores free, please use them for the goddamn ok-button!"

on a 2.26gig P4 w/2gig, i should be able to flip screens from my firefox desktop to my eclipse desktop without spending time watching widgets redraw.

Tahts' waht the last girlfriend said.

i'm wondering if i have something misconfigured.

off topic, but ff and thunderbird use the mozilla rendering engine, which is largely javascript

i have a 3.4 p4 with 3 gigs of ram and eclipse/ff2 have been really slow lately

it's loosely related,and i understand that tb and mozilla use XUL.
and i know XUL is pretty low-end.

svm_invictvs…

im thinking about ditching eclipse here at work
it takes almost 3 mins to startup

hi all
someone know why jList1.setLayoutOrientation(javax.swing.JList.HORIZONTAL_WRAP); doesn't change nothing at all
?
items remains vertical

eeef.
mine doesn't take that long.
you're doing something wrong

who is doing something wrong?

let eidolon show you how to double click that icon.

heh

you mean you are assuming the setting would make things from up to down :P ?

eclipse should not take 3 minutes to start.

its my machine

no i want items from left to right wrappwd to the jlist width
i want a classical windows listview for files
explorer like

i just did a 'time runeclipse.sh' - just going from command line to where i could edit and hit [Close]
real 0m27.823s
http://planet-geek.com/yawl.html — on this machine

have you read the actual api page ?

java comiles into…what? bytecode/object code/binaries?

bytecode

usppose i could replace this 2.26gig machine with like a dual core 3.0gig machine. that might help performance a bit.

How do I explain this to a bunch of old school C programmers. They keep asking about the "object code." taht's produced.

you could call byte code object code…

mm ok so the same problem how can i have a listview?

they're wrong

send me your old one

object code is pre-link.

it's just a different machine

the most common the more hidden un-present

yeah, that's true.

argh i hate java

err.. what ?

optimized object code for a vitual machine?

and what assembly language is the "object code" in.

you came to the right place!

Proguard!

what are you trying to accomplish :P ?

you can get these machines (like yawl) on ebay for like $120.

Java bytecode - the machine code of the Java Virtual Machine.

duh, I've tried to explain that.

currently an out of work college student….I don't have like $120

is the java plugin framework any good?

i want to know if there is a swing component that i can use to show a list of files in the manner any os's explorer would do

get a job!

JFileChooser?

actually..have an interview in 45 minutes

good luck!

not to choose a file

well.. i think that varies..

we'll see….its a part time tech support job…I'm going to try to wrangele that into a part time support-and-a-little-coding job

and there is something called "vertical wrap".. if you read the actual api page for the method you were using..

all tech support jobs morph into coding jobs.

so let me ask again, have you read the api page ?

argh yes coulb be i'm not able to understand it at this point

trust me its really simple, just scroll down to the method you were using..
gotta start small eh ?

that's what she said?
michael scott++

no that would be "You call _that_ 'the moNSTERRR' ?!"

i was in the pool!

followed by loud laughter

i need formMain.jList1.setVisibleRowCount(0);
works now

okayy..
i swear you were on pcb, but good for you :o

pcb?

where does NetBeans save the GUI layout data for applications? I'd like to make the visual layout in NetBeans, but I don't want to use it for anything else

in the .java

cheeser, also the location of buttons and all?

look and see

yes all java code that use the .properties file

what?

swing app framework code uses some .properties file

no it doesn't, stfu

I think something is wrong..

swing app framework code?
wtf are babbling about?

Is this javavm working ? https://www2.bancobrasil.com.br/aapf/login.jsp?aapf.IDH=sim

lol i see it

cheeser, looks like it's in the .java

no way!

but nevermind i don't know java
can i create a beanclass and then bind a tree of this beans to a Jtree?

thanks again, everyone

i want to write only the beanclass, where is a generic tree data structure bindable to a jtree?
write my bean, declare a tree BuiltInClassmybean, Jtree.bind(tree)
someone can poit me to a simple example?

hmm, i have a class with an textarea
and a eventlistener for a button
is there a good way to access this textarea in the anonymous eventhandler for the button?

u mean final sucks?

yeah

same problem here

~tell mefistofelix about aolbonics

mefistofelix, aolbonics is talking like a retard using speech as if you were on AIM or using single letters for you, are, you are, you're, see, etc. Talking like this is frowned upon in ##java and may result in you being silenced. You have a full keyboard so use it. We don't care if you talk
like an idiot with your friends but we don't want to sit through stuff like this: http://forums.oracle.com/forums/thread.jspa?threadID=499980&start=0&tstart=

eh sorry
the final problem remains

yeah, feels awkward to extend the eventlisterner, just to be able to access my textarea from the actionevent

look at the javadoc for ActionEvent

the cheeser response is: use the Swing application framework annotations to workaround

stfu for once?
quit talking about your ass.
er, out
8^)=

quit talking about him talking about his ass!

sorry i'm frustrated
java kicks hard on programmers that want to write and read logical code

don't blame java. millions of developers have gotten it working just fine.

you know procedural is very logical..

mefistofelix, you really have no idea what your on about…

there are swing tutorials you should work through.

and since when was logic anything but relying on arbitrary rules anyway ?

Exception in thread "main" java.lang.NoClassDefFoundError, what am I missing?

jtree beans binding root node, but nothing usefull

a static void main(String[] args) method?

Rémi Forax's Blog: Beansbinding goes to the wrong direction
lol

grub, it's there
sorry, GraveDigger, it's there

hi all. what types have i to use in bean class declaration for its properties - primitive one or wrapper classes ?

eh?

https://appframework.dev.java.net/intro/index.html
a href="https://appframework.dev.java.net/intro/index.html"https://appframework.dev.java.net/intro/index.html/a

eh. are you using command prompt?

no

i mean. i see in tutorials that they use wrapper classes as type for properties of bean - not primitive . is this some particular rule or simply an accident ?

hm. it's possible that you referred to a class that doesn't exist. somehow.

pastebin the actual error message

I don't think IDEs would be that stupid…

you can use primitives

hi all

i know that i can, but what is the true approach or better approach ?

http://pastebin.ca/652667

there's nothing "wrong" with it

people does anybody here have used snaq.db.ConnectionPool??

~anyone

Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.

s far as i know in M9 you cannot bind for example JTable to your custom property myList , only to util.List bean and its contruction limited only to Query (huh!?) wrapped by ObservableList (still didn't understand why cannot just use ObservableList without Query…). In beansbinding itself -
everything works fine. But i still cannot bind JTree. Exceptions… Even snippet from javadoc does not work. Where can i find JT

http://pastebin.ca/652668 and this is the error when I run it

is that class in a package?

ok. thanks . do you know some links where can i get detailed info ?

yes, I guess so

~javabeans

cheeser, beans spec is http://java.sun.com/products/javabeans/docs/spec.html

I'm using that Connection Poolling implementation and got SQLException without any message.

Anyone that uses IntelliJ IDEA
?

javabot tell mgenov about anyone

mgenov, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.

a lot of us use IDEA.

Okay, i'll ask.

don't do that in channels, just ask.

~mgenov we all do, kthxbye

I guess the factoid 'fallacies of distributed computing' might be appropriate:

I have an web module with some jsp page in it and i wan't to redeploy web pages on save.

joed, fallacies of distributed computing is Please check out http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing for more information.

server is tomcat
5.5
I've configured the web module to use exploded directory
instead of war file
I can do this manually by clicking with right mouse button in the editor and invoking "Package file"

hmm, implemented the ActionListener and added the method ActionEvent and so on
it works, because it starts things in handler
but it can't update a textarea field
private JTextArea infoArea = new JTextArea("blah", 5, 20);
i can't even do a infoArea.append("shit"); in the constructor

if the ActionListener is a separate class, pass the reference to the JTextArea in its constructor … ?

it is in the same class, i just implemented the ActionListener interface
the text 'blah' shows up, as it should

so what exactly was your problem ?

is there like a requirement to have scrollpanels or something?
i can't append to the textArea

where, when ?

for instance in my actionPerformed method

no, append should work.

I can't find any explanation/discussion on the scope parameter in jstl SQL tags.
I want my simple query to be application scoped, so that I only fetch the data once.

if i add infoArea.append("shit"); to the end of my method that draws the GUI it don't show either

do you do this in the initializer, or the actionPerformed method?

i tried both
ill pastebin my code

eh. I'm not as familiar with with Swing as I'd like to be.

well it should work anyhow

http://pastebin.com/m1e78d30f
*silence*

i would like to compare text in 2 documents for "keyword differences", not line-by-line differences as in coding, ex: "1.txt" contains 'Hello you are funny' "2.txt" contains 'I you are funny' Results show "hello" occurs in first document
i've only been able to find one program that does this, CompareSuite, but am looking for something else….*(I'm not a programmer)

does it even go into the block start starts at 69 ?
*that starts

i've tried 10 different programs so far, just coming to a programming channel to ind out if anyone might use a program that does this

yes
and by having the infoArea.append("shit"); i can make sure that the dialogue is still active
i would have bought that the "Connecting" thingie wouldn't show up due to it wouldnt have time to repaint or something
but that does not seem to be the problem

so you have actually debugged it and seen it go into that block ?

well, i know that the game starts fine when i press the connect button

right

but i haven't walked it through with a real debugger yet
but that feels a bit far fetched

so the "shit" appears, but not connecting or waiting ?

no, the shit does not appear.

people how called pattern which show the way that how to have only one instance of object?

singleton

called I mean the name
oh yes thanks

havn't you heard? there is a witchhunt on for singletons..

allways has been, allways will be..

this.infoArea.repaint();
this.settingsDialog.repaint();
after the "shit" line

until the day we can all spell "always"
8^)=

but that didnt help at all

hehe

i should not ahve come to work today
murphy's law has taken over today

i'm not even supposed to *be* here today!

well, you do dispose on the dialog where you added it..

true, but it the infoArea.append("shit"); should be visible though
and the Networker.Connect(blabjhaha) could take a few seconds

which db connection pool package you are suggest?

dbcp

jakarta apache. as I know

Or a pooling jdbc driver if your database has one.

I want create connection pool and store it in singleton object. my application is servlet based web application?
write=right

making mistakes is the only way you'll learn

well, watching others' mistakes is helpful, too. P^)=

And laughing. Laughing is very useful.

jsr168 anyone ?

MyClass [] myclasses = { new MyClass("foo"), new MyClass("bar") };
but the compiler is complaining

portlets?

yah
oracle has had its way with me for the last 3 days my ass hurts and i still cant figure this out

sounds like you're using them incorrectly…
8^)=

you need a new MyClass[] before your { }

http://www.youtube.com/watch?v=FG_HuFtP8w8
kinda long
but good

"doc, for all the good those suppositories did me, i could've shoved 'em up my ass."

i have followed the docs, but i cant get the edit and help modes to work

Sou|cutter, oof, thanks

strangely I have a hard time remembering that syntax sometimes too

they just dont show up

in my portlet.xml file doesnt do a damn thing

well, try quoting the dispose and see what happens..
as far as i can see there isnt any reason why the append shouldnt work.
so the odds are you just arent seeing it for some odd reason.
Assuming there is space to draw it, so it isnt drawn outside what you see, or something silly like that.. i dunno ^^

How do I use layout managers to have one component take up as much space as possible?

you could try using .setText(), and see if theres a difference.

is it the only component?

no
otherwise I'd use gridlayout

or borderlayout may work for that too
if you were to use gridbaglayout, you'd have to give more info than you have
if you read a tutorial about how to use it, i'm sure it would be obvious

yeah

oi
shall i use jetty or tomcat with wicket ?

jetty with wicket!

i've used both

Jetty++

Hello. I have a question about graphics libraries for Java. Is Java2D the de facto standard for rendering 2D graphics? (And for 3D, what should I use? JOGL?) I have no prior experience with OpenGL.

jetty all the way

hmm, starting to bog down a bit. have 11 progams open, not including services.

11 programs is nothing

I need a bigger monitor here at owkr

as a metric, I mean

I think i found the problem!
it was the .setModal(true);

what on earth :P

yeah, kind of weird

if anyone has used stripes, can controller handlers be mapped resfully? instead of /controller?action ?

someone if there is something in wicket for javafx support?

restfully* as on /controller/action

uh. no.

i hope, only for now

well, the shit appears now, but still can't get the actionevent appends to work

did you try quoting the .dispose ?

even with the dispose commented out
yeah

how do I draw right up to the border when using a BorderFactory.createTitledBorder

have you tried using setText ?

don't hold your breath

or is the textarea surely big enough to support more than one line ?

WOOUUUH! i saw the text!
yeah

for a tcp socket server, what's the correct way to read in data to a buffer? BufferedInputStream?

it waited with the painting until my connection was established
somehow

yeah, ofcourse, because thats the interface updating thread you are doing stuff with..

it's text

wait for the connection in a separate thread if you dont want to wait
erm, yeah..

yeah
anyway, perhaps i should bug-report or something about the setModal thingie

is a number always odd if its right most bit is one?

depends on the number format

int

yes

oh thats sexy

yes for positive numbers. not 100% for negative

num & 1 != 0

of course, you could just use the mod operator
is cleaner code IMO

it's less "cute", though :|

-n = ~n +1

s/cute/obfuscated

that trick should always be used with a comment.
if at all, as you imply.

whats ur favorite one liners?

"thats what she said"

"oh snap"

neat, but not terribly useful: x ^= y ^= x ^= y

JavaPosse says we're going to see Java replaced with a bunch of domain specific languages like Ruby.

iirc, you need to use parentheses.

since when was ruby a language ? Do they actually name the bastardisations of perl and python these days ?

in java, at least…

yeah, predicting the future in the IT area is a very reliable thing to do.
(aside of trivialities, such as "computers are going to be much faster in the future!"

Comments

ManUnderground as i said i found that those phishing websites were mainly uploaded using some PHP vulnerability

create() should be compatible with that of Object

Comments

Hey Im making a php script that adds several hardware items into a database and if that hardware item already

Unless there isn't anymore you can sort of "automate" through different logic.
For example, layouts.

um "later plan on doing something with content" uhh, yeah look at the bottom of that paste… i "do something with content" i echo it inside template.php

template.php would be considered a sort of 'layout'

that paste is supposed to be two separate files as you can see by the HTML comments

You could just as easily stick the content into a separate file and include it rather that buffering it, can't you?
ah okay, you're already sort of doing that

uh, either way, even if i included it, i'd still have to buffer it to get the output into $content

Why?
Because of your $title and $s?
$rs

because of the way i'm using template.php
i call it the "decorator pattern"
it's the opposite mechanism of including header and footer

I don't do header and footer. I do layouts.
Your template.php would be an equivalent to what I call a layout.

well, i've heard it called the decorator pattern, though when i looked up "decorator" pattern on wikipedia it wasn't really this
sure, so then i'll call it layout.php, whatever makes you happy, point is in order for the "layout" method to work, i have to put the page's template into a var called content
it doesn't matter if i include() that page's template or just put it inline, it still has to go through ob in order to accomplish the layout method

With your current pattern, yes it does.

like this
http://pastey.net/71330
anyway, if i wanna use the "layout" style pattern rather than the "include header & footer" style pattern, the only way i can think to do it is with output buffering
unless you can think of a different way
actually i just thought of a different way

No, using output buffering is the best way unless you like weird shit like making a separate request to your own host

anyone here done any Pear:OAP with NetSuite integration?

right, k that's what i thought… some fool from russia was in here dissin me cuz i used output buffering
but he liked smarty, so… i guess that explains that

Anyone who LIKES or USES Smarty needs to burn in the firey pits of their religion's corresponding hell

hahahaha
i know i tried to tell him that but he didn't take it too well

That's close enough

Who ever allowed smarty.php.net to be created should also burn.

anyway, i personally prefer the first style i pasted, the one with the page logic and the page template in the same file… reduces the amount of excess file management required in the project

I bet they thought it was a good idea at the time, and now they're thinking "shit… i shouldn't have started this project"

i *guess* i can understand breaking out the template into a separate file like in my second paste, i just prefer to have it all in the same file… i feel it's more manageable that way

Well, your code is getting closer to the MVC pattern.

mostly based on the premise of avoiding: http://en.wikipedia.org/wiki/Yo-yo_problem
oh?

If you take out some of that stuff and do it from a controller, you've got an MVC based website.

yeah to me MVC is really more of an approach
i think the strict OO version of MVC is useless, i realized i've basically been doing "mvc" for quite a while, but most MVC purists wouldn't call it such

Well, if your approach works great for you, the people maintaining your code, and your co-developers–then all is good.

DMBS = model, PHP = controller, embedded html host + layout = view
indeed, that is the goal

Right, but stuff like retrieving a result from a database, you're doing from the view, but it's damn close to the MVC approach.

okay flood control both server-side and cilent-side is implemented on my ajax chat

um… no not really… i'm retrieving the result in the controller

great success

i'm displaying the result in the view
in the view i've already got the result… $rs = result set
the view just cycles through said result set to display it

Oh okay, the file doing your title setting and database retreiving is your controller. I get it. Then it's already an MVC application

yup
i just usually prefer to keep the controller and the view in the same file, that's all
given that they're so intertwined and i personally haven't ever come across a need to use more than one different view for a given controller

It doesn't matter in your case if it's in the same file, as long as the code is separated.
There's no rule saying that separating code dictates separate files (like most people think)

yah exactly, the code is very separate

hai

right
ok that gay moment has passed…
anyway

Now, time to head out to the electronics market to see what new cool shit is out on the market…
Maybe I'll test out the Prada phone :P

lol Prada phone
get an openmoko

Prada phone sucks The Shine is nice ..some faults, but on the whole nice

I really want an iPhone, but there's no telecom service for it in Korea yet… so I believe the Prada phone is the best I can get so far

http://openmoko.com/products-neo-advanced-00-develkit.html
screw the iPhone, get an openmoko
the openmoko was around before the iPhone was even announced

Wolfy[drawing]: So how are you doing?

?

i'm pretty sure the openmoko will work in Korea

fine, fine. You?

Wolfy[drawing]: Eh tired, had a long day at work.

http://openmoko.com/products-neo-advanced-00-develkit.html is like a personal cell phone assasin kit

I should be studiying myself, but — I am… Ummm… Busy

Wolfy[drawing]: studying yourself… is that code for masturbation?

*blinks*

anyone?

I think everyone blinks here serveral times a minute

If it works in Korea (the phone) then I'm sold.
AFAIK, the only way for it to work in Korea is if one of the telecom companies here provide service for it.
In the Prada's case, LG Telecom provides service for the Prada (and it's an LG product)

perhaps this is a mysql question

it's a GSM phone so it should work basically everywhere

Wolfy[drawing]: Bad Wolfy, do I need to take your pencil away? xD

Try it. You're not gonna like it.

GSM does not in 1 mile deep caves

I'll look into it

hi, I am currently using phpbb…basicaly I want to be able to sent email notification for users for new posts. I was forwaded to this room can any one help please. thanks

no you weren't. #phpbb, please.

yah dude, the iPhone sucks, you can *only* use it with ATT
apple? forcing proprietary usage compliance and vendor lock in? no! i don't believe you!/sarcasm
i used to be a huge mac fanboi, now i think Apple is just as evil as MS if not more so
and i've started to think that maybe MS is not really as evil as everyone wants to believe they are

I still want a MacBook Pro :P

I don't care about ipods / macs / iphone.

I'm also considering a PMP.. I want one with a large harddrive and long lasting battery life
Unforuntately, I can't find one as good as the iPod.

PMP?

*Unfortunately
Wolfy[drawing]: Portable Media Player

PSP :3

Wolfy[drawing]: For example, I use my iPod to watch movies/anime and listen to music.
If I got a 80GB, that's be nice.. lots of space for everything.

o.O

Currently I have a 30GB which is also great, but I'm almost out of space from all the music and anime.

My Palm has like 4 gigs :o
haha

But I want a PMP because of widescreen videos.
You may not know, but the iPod screen is horrible for widescreen

I don't have any problems with that on my palm

Either a PSP or some other PMP… I need

The new Palm ish secksay

I never liked 'em

Hello everyone. I have a file that is at http://pastebin.ca/633854 that sets parameters for a class function The class is at http://pastebin.ca/633854 . If someone can I'd like someone to check this out for me and
point out some flaws that might cause PHP to warn me tat it's missing arguments.

Wolfy[drawing]: I'm gonna go to the electronics market to check out some PMP's and get some new earphones. My friend is coming with me to pick up the PSP he ordered

how much is php web hosting there?

PHP? lol
You mean the PSP?

What sort of thing in php would produce an 'undefined' string?

I can't believe I typed that. PSP, of course

Wolfy[drawing]: Google says: 320 000 South Korean won = 350.08 U.S. dollars

Im trying to fix up this horribly coded site and its doing something weird and telling the client to request something called undefined.
320 000 = 350? Crikey

Echoing something that isn't defined

The PSP is only $250 or so if I bought it for him
$250 is the original price if you bought it in the states, no?

Wolfy[drawing]: I thought that would just echo nothing

Or was it $200..

0 to like tuesday july

Pricey
echoing / using undefined variables throws an error of level E_NOTICE
(unfortunately)

Wolfy[drawing]: The electronics market has a basement like place that sells copied games, gaming consoles and they also attach mod chips to your consoles. If he would've bought it from there he could've gotten it real cheap, but he didn't because he has to pay of monthly bills on it since
he's pretty broke right now.

copied games? Isn't that… Illegal?

Yes :P

heh

Each game is 10,000 WON

"Pirated stuff 1st basement"

10 000 South Korean won = 10.94 U.S. dollars

anyone??

And there are deals like… buy 4 and get 1 free.

that's almost as normal game

Wolfy[drawing]: No, normal games are $50+ -_-
For example, PlayStation 2 games are around $50 on average.

how do I absolutely reference an include file outside the web directory?

$50?!?
oh, for PSP

Wolfy[drawing]: Can't you just download PSP games?

PRobably

There's this really popular website called Ruliweb in Korea for downloading games for any gaming console.

heh

Most Koreans download and burn their games from there.
When you buy a Nintendo DS from the electronics market basement, they ask you if you want to change the default platform and if you would also like to purchase a disk containing 16 games included in it and if you would also like to purchase a set of 4 DVDs containing hundreds of NDS
games

Cool!

Of course, all illegal :P

of course

I might also check out the Apple store in the electronics market to see if the new MacBook Pros are in

Have you found a shop in Korea where you can buy MiniITX motherboards?

Hello everyone. I have a file that is at http://pastebin.ca/633854 that sets parameters for a class function The class is at http://pastebin.ca/633854 . If someone can I'd like someone to check this out for me and
point out some flaws that might cause PHP to warn me tat it's missing arguments.

What's the best way to remove a node in PHP 5 using DOM? is this function valid? DOMNode-removeChild()

They have MBP's here. $2000 euros; about um… $3000

Wolfy[drawing]: You can probably easily obtain one from the plaza selling computer hardware. Just put in an order for it.
That plaza sells parts cheaper than newegg.com
I bought a Pentium 4 3.0E for about $50 or so
I believe Newegg's price is $70-ish

The MiniITX stuff is pretty exotic :3

can anyone tell me how to absolutely reference a file outside the web directory?

Placing an order from Korea to Europe would be ridiculosely expensive

Wolfy[drawing]: Probably
Wolfy[drawing]: Korea is the heaven of electronics and hardware.
More precisely put, the electronics market is.

I'm looking for info ok reading FLV metadata with PHP. Can someone please point me towards a tutorial? I'm having a hell of a time finding something on the net…

Wolfy[drawing]: Anyways, time for me to head out to the electronics market and snoop around

you can't. You can try to (ab) use ffmpeg to do that for you
okies. Laters

Maybe also check out some pirated DVDs along the subway paths :P

Wolfy[draw: I'm not trying to inject metadata, but just read it…
I'm using ffmpeg for the encoding

There's an flv tool for linux, find it.
I don't know if it works on Windows though
anyways, peace! :O

sure it does

one question.. work PHPNews with TinyMCE 2.1.1.1 ???

kuja is right. use flvtool2

try it and see

Yeah, FLVTool2 does the metadata injector, all I'm trying to do is grab the name of the video and length to pass to flash when we load the file

neither is a topic of ##php

!tell UserReg_CL about g10

ok thank

if I have a hierarchical site, where a page can have multiple children and a page could conceptually make sense in multiple parents, would it be better to be strict and force choosing one parent over the rest, or loose and allow multiple parents at the risk of possible redundancy?

yes, so? if you can inject metadata, you can also *READ* it

I just need PHP to read that metadata, much like reading ID3 tags for audio…
so you are saying to query FLVTool2, then respond that query to php hosting and deliver the data?

maybe

sorry to ask again, but can anyone tell me how to absolutely reference a file outside the web directory?

uh… What?

Hello everyone. I have a file that is at http://pastebin.ca/633854 that sets parameters for a class function The class is at http://pastebin.ca/633854 . If someone can I'd like someone to check this out for me and
point out some flaws that might cause PHP to warn me tat it's missing arguments.

!+g2

Guideline #2) Don't Repeat. If nobody answers your question, don't just repeat it; we all heard you the first time. more likely, nobody knows the answer (/msg php-bot ask), or you need to provide more information.

Wolfy[drawing]: sorry

! +g2
!+g2

:p

oh darn

lol

Well I didnt repeat in two consecutive things like a spam. So dont be pulling that bot stuff on me lol

lol

php-bot is made in python?
i ment
perl

Perl

thats unexpected

why?

Well you think it'd be in php

there is a reason, why PHP isn't appropriate for bots

Meh

Well how come php.net doesnt have an irc server built in PHP? PHP CLI

you can do anything in php

I've done bots in PHP
PHP is perfectly capable
Not really my language of choice for an IRC bot though

So have I. But if you can make something in a language that wasn't meant for that doesn't mean it's goot to use it for

Kernel modules?

Nah
Wolfy[drawing]
I disagree
PHP works perfectly for irc bots

you do? With which part?

therefore

you mean you "think" it does.

no

okay :-) maybe not that

PHP works fine

no, not really

it does

Why do you think it doesn't?

whats the problem with writing a bot in php?

memory management

Oh?

plus the fact that PHP doesn't do multithreading

Hmm.. php doesn't have privary or public variable scopes for OOP model?

yeah
the multithreading thing I can agree with
perl's multithreading is crap as well
pythons multithreading is great
and you can use http://uk2.php.net/declare to have functions running concurrently

Can someone please help me write a regular expression for PHP? I've searched on the site http://regexlib.com but cannot find the pattern I need. What I have is a list of email addresses, in the following format: "FirstnameLastname" email@email.com, "firstnamela
" email@address.com, email@address.com. I want to extract the email addresses as well as the name-strings.

first you neet to split the string
like this explode(',',$string);
then iterate the resulting array

What if there is a comma in the firstname, though??

good question
now i was going to erm talk about that

really you need some kind of "*" *, regex

i was just waiting to see if you were going to notice that

does session_id() change with every referesh ?

nope

heh.
=P

what if this happen with me.

I believe it changes when they restart their browser, though

Hey, count(false); should return false or 0, right?

I can't see how could ticks be connected to multithreading

i put session_start() in between ob_start() and ob_end_clean()

Wolfy[drawing]: declare does the job
if you want a function running while other code is running

ah wait, no, I rtfm again and it should return 1.

Actually; You'd want PCNTL_fork for that

Wolfy[drawing]: oh alright then

Does PHP5 support private/protected variables in Classes?

yes.

AzMoo[w]: Ah, that's wonderful

somthing like '/"([\w\s]+)"\s*(\w+@\w+\.\w+),?/'

indeed it is! Check out http://www.php.net/oop5

i don't see any wrong in my coding that rewrite the session_id which lets me get new session_id every refresh

OMG… implementation.. sweet
AzMoo[w]: One quick question: if I have a Calendar class and a MySQL class and I create an instance of mysql hosting class inside of Calender and assign it to $this-mysql. To acceess a variable with a special function inside of MySQL, would I then
run $var = $this-mysql-getResult() ?

so session_start() is called before anything is outputted to the browser i guess

yup

db would be a better variable name, alkos333, and using pdo or some standard interface for the db class (which could extend from mysqli) would allow a client that does not have mysql to swich easily

could it be that your browser is blocking the cookies or something

i called it in into body
no i've other application that not change the id every refresh
ooops, i moved session_start before any output, now it's static, thanks

heh :-)
np

fully implementing the mvc design pattern would be useful also, alkos333, however a quasi-implementation would suffice… i assume that is what you are doing, creating standard crud functions in a class using a private $db
ufully implementing the mvc design pattern would be useful also, alkos333, however a quasi-implementation would suffice… i assume that is what you are doing, creating standard crud functions in a class using a private hosting $db/u

Hold on a second, I'll show you what I'm writing
The server is running PHP4, I'm gonna ask them to update - php5 is just too good not to take advantage of

What is the php regex equivalent of "?"

\?

This is the calendar I started working on: http://laptop0.alkos333.net/nsco/cal/
I was writing the code for PHP4, but looks like I'm gonna go with PHP5 and ask the hosting providor to update to PHP5 since they are very flexible.

Wolfy[drawing]: I mean the non-greedy …

perl

it's like the optional +..

sorta…

_nixMan[Work]?…

yes i much prefer 5 alkos333

_nixMan[Work]: Evading ban I see…

you asked what is the php regex equivalent of right?

What's PDO and what's mysqli?

Wolfy[drawing]: who are you?

!+pdo

New in PHP 5.1, there is a little thing called PDO, the PHP Data Objects. This isn't database abstraction layer (as many believe)… It's more or less database function unification. If you want abstraction layer, take a look at ADODb or PEAR:B.

_nixMan[Work]: the one who banned your other IP

!+mysqli

Wolfy[drawing]: oh that fag because i said winblows… yeah good one

nah

mysqli == mysql improved. http://php.net/mysqli

mysql_* functions arent available in php5

… um, yes they are

Says who?

yes they are.

Hi everyone, how do i use a variable that contains two words in an sql statement

mysqli_* functions aren't available in PHP4
what are you actually trying to do?

MySQL support is not enabled by default, what i what i meant

neither is mysqli

it's not enabled by default ever afaik

it was in PHP4

oh ok then

not bundled with php5 either

I have a variable, $var, that contains 2 words, "Word1 Word2", and I need to use quotes properly or something to get it to work in my WHERE clause of the sql statement

so many times i've takled to possible clients about how they hired some kid to program their site that used some framework and it's all horrible and not working

so you would have to go out of your way to enable them

i dont take those jobs if they don't agree to let me rewrite

um, yeah it is

nope

if you download the zip file it is indeed bundled with the mysql extension and the libmysql

yes they are
mysqli

So you have to enable it in php.ini?

sorry i go off what the manual tells me

if you're on *nix then your distro's repos better have php-mysql available or your distro sucks

the manual doesn't say they aren't enabled by default

does anyone know if microsoft is going to get more pushy with upgrading users to IE7 soon?

"MySQL is not enabled by default, nor is the MySQL library bundled with PHP"

that's admirable, but it's still better to go based on reality

http://uk.php.net/manual/en/ref.mysql.php

but the mysql library *is* bundled with PHP… i downloaded it just a few days ago

is that php5 and are those mysql or mysqli abstrakt?

Because of the change of license in MySQL 4.1, PHP excluded libmysqlclient. in PHP4 the libmysqlclient is still present

wait it does. my bad. i ment that it doesn't say they aren't included

all of the above

and i am getting an error message, is it O.K. to paste?

!tell yadayada about pastebin

no. Use pastebin

Ok

use mysqli

http://hashphp.org/pastebin?pid=24666

what is the SQL statment yadayada?

You have an *sql problem

wtf

it isnt a php problem

did someone kick me?

" this is a PG channel - pretend your 8yo niece is here, or get booted. "

haha

i think that was you before who got kicked for some violation of that, couldve been someone else

no it wasn't that it was because of my away announcement
SO I ASK THEE WOLFPAWS
if ye be drawing, how can one be kicked by a man
or fox
wolf
such as yourself
;-)
but i'm also trying to find out how to stop announcing away in this chat

http://hashphp.org/pastebin?pid=24669

Then don''t do it at all?

"SELECT * FROM products WHERE ref='".$var."' ORDER BY cost ASC";
oops sorry
you dont need to concatenate
that really annoys me

i never concat anymore. since i figured out {} string syntax

silly pointless additions to code, like if($x == true) or echo "hello".$user

I originally didn't but i thought it would keep the two words together

With glob, if I'm searching for "foo.inc.php" within a valid directory and it's not there, it should return an empty array, correct?

That kinda sucks, because you can't do "blah{function()}blah"

i generally only concatenate when the variable is at the start or end, '/users/view/'.$id for example

orly? i thought that was the point?

no flowOver

Wolfy[drawing]: it's part of x-chat aqua

" hello {$array['username']} "

it's off for now but i want to see if i can set it to not announce in here or in another channel

should i try the {}

but everywhere else

?

if a variable is set, does it return true?

fucntions in {} work since 5

oh?

so says man

's been a while since ive missed a feature

can I store an object in an session-var ?

heh i was confused because i always do function calls in strings wiht {}
i guess i should keep that in mind though with 4

How do i keep the two words together in the string?

echo "{ucfirst('hello')}"; doesnt work?

no, it doesn't work

i know, it was rhetorical

Well, I have PHP 5.2.1 and well… It doesn't work.

i get the queries done but i dont get the times and the form did not dissapear

{} are for assoc. arrays and things like {$path}index.php

I prefer concat for that.

hmm i can't recreate it locally on 5. maybe i was mistaken thinking it worked. man says "Note: Functions and method calls work since PHP 5." and also below that says that {} takes more mem than concating.. which is opposite what i was told.

yes, i do too, but… thats what they're for Wolfy[drawing]

i'm wondering now how accurate that second statement is, if the quote is wrong

which page flowOver?

php.net/string

looking at that already

hey Wolfy[drawing] darlin

php.net/string

hai, liggy

oops

Wolfy[drawing], pm?

I have resolved mine, thank you

Sure

so i can't see how they mean functions and methods dont work with {} , yet tests are showing they don't

is there some way to recode hex chars (e.g. %22) to ASCII?

and the man says they do

hexdec

function test() { return "foo"; } $foo = "test"; print "string{$foo()}"; works {test()} doesn't.
interesting

i that what it means is you can use {} in dynamic function calls as of 5
${'foo'} for instance
echo ${'foo'}();

$t = 'trim';
$var = " a ";
print "{$t($var)}"; — this works

no need for "" though Wolfy[drawing]
so perhaps {} is only useful when you dont need it

i want to control user so he can only insert 1 record within a week.. it's about the week how it would be calculated.

actually, there *IS* a need for quotes

yea its not to clear on the point really. the note in the manpage about 5 led me to think that all function calls in { } would be parsed, but only dynamic function calls are parsed

oDesk, check the date and do the necessary math to check

i suppose the cases where i've used it where only ever dynamic function calls, i've never tested static function calls untill this day

no Wolfy[drawing], $t($var) works also

Care to try?

seems tricky

yes, i have Wolfy[drawing]

so did I

oDesk, how is math tricky?

trim returns a string. but we're testing for what happens inside strings being parsed

print $t($var); works Wolfy[drawing]

yes but that misses the point of the test

but the test goes to show how redundant the 'feature' is

I didn't mention $t($var), but "$t($var)";

"$t($var)" won't work

oh yes, i said, " no need for "" though " however Wolfy[drawing]

like, i'll check if it's Thursday, if so then will reduce 1 day interval then will check if there is record inserted in this time interval right ?

Are we dealing with strings or proper PHP here, ThinkMedical?

we're testing how php parses variables inside strings.. so doing it properly isn't a worry here, since its a test

im just making the oberservation that {} for a dynamic function in a string is still somewhat redundant as a feature

oDesk, get todays date, get the records date (assumes you wrote it when you inserted), add 7 days to the insert date and if it is greater - allow another insert
if todays date is greater

That doesn't voids the fact that it works.

no.. and i never said i did… Wolfy[drawing]

nice idea

math ftw

ick. Math.

ew
math
nasty

ThinkMedical, *sigh* would have prefered exponentially

Wolfy[drawing]: personally i think that the man should clear that up. all it has on the subject is a note that can be interpreted a few different ways
uWolfy[drawing]: personally i think that the man should clear that up. all it has on the subject is a note that can be interpreted a few different ways/u

Like the "proper" way.

one would think it would parse "{ function() }" according to the note

spaces dont work in any instance

that translates to "proper", floppypond.

ThinkMedical, oh - now I am like the artist formally known as Prince

haha

mybad. i always put spaces in to. then of course take them out. hah.

Hmm, anyone here know of any good image gallery scripts?

gallery2?

Wolfy[drawing]: Hmm, I heard that one was good. I'm going to intergrate a gallery system into PHPBB for my friend's site.

ughh
yea use gallery2

I think there are already some hacks in that direction…

there's a phpbb mod for it

Thanks Wolfy and flowOver

what licence is gal2?

http://www.phpbbhacks.com/download/1060

urgh fpl

GPL, IIRC

*gpl

Wolfy[drawing]: She wanted a way to easily update her gallery instead of manually uploading all the images and create a page for each of them, so I opted in to help. Also I'm really jealous of her art skills . http://www.gerbilfat.com/

gpl basically cuts your user base in half, or more

Anthros 3

Wolfy[drawing]: Yeap
Wolfy[drawing]: http://www.gerbilfat.com/gallery/railcolor.phtml

She can't compare with http://jocarra.sheezyart.com tho :3

gallery 2 has a sweet shell tool

Hmm, is it easy to use? Gallery2 in general

yesh. But you need DB

relatively. once it's setup for the person to use it, its got alot of features to ease things out

er, what? half user base due to gpl?

setting it up though…

well obviously anyone looking to… dare i utter such herasy… make money, can use gpl can they AzMoo[w]?

AzMoo[w]: it kills the possibility of commercial use

* cant

You can use GPL scrips for commercial use, but there are strings attached.

i'm not sure if that means she can't charge for access to her site. i think it just means that she can't sell the script at all

it depends how they're making money. GPL doesn't prevent you from using the scripts, it means that you can't sell the scripts.

Hi

lol, yes AzMoo[w]

Is there any way to handle a fatel error

Wolfy[drawing]: Thats one amazing artist. o.o 3 Wolves

guess what most people who use gallery2 are.. coders AzMoo[w]

i will brbrb

AzMoo[w]: coders make money by ?

so provide it as a free "module".

Because I think its dumb that trying to allocate memory thats not there causes a script to die

Yeah Wait… There is one more… *fetches link*

AzMoo[w]: you would only use it if you needed to, if you needed to the client wouldve asked for a gallery, that would be part of the site… having a gallery they dont have complete rights for wouldnt sit well with most clients asking for one

http://mixedcreature.sheezyart.com/ — She does mixed stuff, tho… Cartoons, realism,…

is there something wrong with if (!in_array({$key}, $exclude) && !preg_match('/ID$/i', $key)) { array_push($thearray, $key); } ? this appears from within a foreach, im trying to push every value of $key to the array if it isn't in $exclude and doesn't end in ID

I think the fatel error out of memory should be managable in a try/catch block

Pffft. Lots of speculation in there. My experiences tell me otherwise.

so either the coder looses $100+ for gallery, AzMoo[w], or they dont…

anyone in charge of making php

AzMoo[w]: coder cant charge for gallery therefore less moeny for coder, it's very simple

Post your requests on the internals ML, please.

and fair enough too. Coder didn't code it.

AzMoo[w]: yes but anything they use it for has to be under gpl too
see linus' rants for more info

Hmm
For some reason my ajax chat doesnt like £ and some other characters
Is there anyway I can make it support them?

unicode :o

yeah

Wolfy[drawing]: what is internals ML?

csc`: so um, how can I handle unicode characters?

lists.php.net

at0miku, beats me :P

oh :

:

with mb_string

okay cool thanks
3
Wolfy[drawing]: how do I use it? D:
the documentation is just telling me loads of crap

what can I use for debugging php-code?

a lot of echo and print_r

or var_dump

Wolfy[drawing]: Ahh wait nevermind I got it
Wolfy[drawing]: At some point I split the string, is this where it goes wrong? I need to use mb_split, right
?
Well lemme try

ahhh i found the line that explains the function behaviour. only when $ comes directly after { does it trigger the parsing syntax. so anyways. back to what started all of this. i brought up i dont concat anymore since i learned {} syntax. but apparantly it uses more memories than . syntax.. so
back to the old school ways

split the string how?

Well hang on
Hmm

hmm..I bet there is some good tools. :P that's easier than a lot of echo :P I remember seeing a pop-up window containing all vars/values

http://atomiku.com/scripts/ajaxchat/chat.html

anyone know of something like that?

When I put "#" in the text, it doesnt seem to add it to the database

is posible import some class from external php file ?

i am a little confused, i just encountered a strange bug in my code which makes it look to me like the code "$_SESSION['a'] = "something else"; $a = "hello world"; echo $_SESSION['a'];" would echo 'hello word', is that possible?

atomiku - have you addressed people being able to edit the js on their client ? like polling more often

_Quintus_, what about $_SESSION['a'] = $a?

ÿ

no matter how many times I see "ajax chat", it still makes me hurl

lol k

csc`, that is not in my code
csc`, my session variable and local variable are not supposed to be set unless someone logs in, but just putting any name in logs someone in even if their password is wrong.

http is not a chat protocol and isn't designed for it at all

true

flowOver, what about https?

csc`, i fixed it by JUST changing my session variable from 'a' to 'session_a'
csc`, so it looks like somehow using the same name was a problem

csc`: And that is different from HTTP… how?

secured http
:p

is there a setting in php that will let you use local variables by the name X to represent super-globals by the same name?

csc`: yes, so?

yea thats still not made for a chat
even worse actually
its further away from what you need

SSL is used in some chats
Erm.. servers / rooms

its the ssl over http that haggars it

how so? IT's just another layer.

opening an ssl connection incurs overhead. it's only done once to open one secure connection with chats. with http its done every single request

opening an SSL sonnection on the modern machines shouldn't be notiocable

yea but with http ajax chat polling the server every 2 seconds?
it'd be noitoicable

HTTP isn't built for these kind of junk.

yup, and thats why https is even worse for ajax chat
than http

no, not really. It's overkill, that's given, but HTTPS connection is still unnoticable on the modern machines.

can text in an input field be filtered?

filtered how?

for a certain character combination

anyone here do Freelance ?

!+jobs

no job posting / asking for jobs on ##php (see /msg php-bot g7). You might want to check out: ##php.jobs http://www.geekfinder.com, http://www.monster.com, http://www.rentacoder.com or http://www.getacoder.com, or php.net/links, "Developers and Job Opportunities".

yea 3 people have let me down so far

hi, all. I have a question, In version 4, I can use a class variable, like this $object[$variable_name].

its like people dont want money anymore
just to waste time

and I found I can't use this in new version.

$object isn't array

yes. wolfy

so?

your mean, I have to change my code. right?

right

ok
thanks

lol l3dx one sec bro

i dont want to get kicked but if anyone does freelance and wants some money please contact me

whats wrong with that btw

wrong with what?

5- (slacker403) i dont want to get kicked but if anyone does freelance and wants some money please contact

and i got kicked

yes you did. Go away.

its not like he's spamming it left and right :o

it will likely happen again if you don't drop the subject

wow

Dude clearly knows the rules and he broke them. Why not kick him?

ok ok
damn
its just these damn freelance sites are the worst places thought since its IRC there might be something or someone with some time on thier hands and that would be directly reachable

theres a rule against asking for freelance work?

jeeese

i agree
but um
if thats the rules… then I suppose ya gotta obey them

recruting in anyform shouldn't be conducted here.

lol anyways
slacker403
pm me

Wolfy[drawing] you mean i can't ask someone to do my homework for me?

rule 7.

funny

..and recruiting successfully completed

i was going through the courses i can take this september…
i have to be in third year to take the server side web programming course, but i have to take client side in january (seconds semester, second year)
i am very disappointed

programming classes in any form are boring

it's only a 2 year diploma, and i don't feel like completing the degree atm, since i kind of need to work off my debt
Wolfy[drawing] i agree, but with them i can say that i have the education (even if i sleep through the course and ace the tests)

hahahaha!

i really should look into a challenge exam of some sort

Something like http://wolfy.homeunix.org/projects/hts/bot.phps?

Wolfy[drawing] huh???

Is __construct called as soon as I do new Class; or can I do $class-var = 1; first?

What?

Something like http://wolfy.homeunix.org/projects/hts/bot.phps?

IT's a solution for an anagram bot

i'm lost

Answer to "challenge exam" :P

lol

i have 2 scripts, one an html/form with 2 inputs which calls a php with a 4 minutes database process, the process ends ok but it goives no echo and the form page stays in the client

Are there any open source URL shortening scripts for PHP available?

what does Google say?

I was looking and most of the results are ads
And completely unrelated links

can php create compressed archives internally?

why don't you make one of your own?
csc`: Sure, why not?

Wolfy[drawing], is it a function?
or do i have to do system(); or something

php.net/zip, php.net/gz and pear.php.net/file_archive

thanks

depending on circumstances I need to write to $item['description'], or $item['content']['encoded']; how do I write this as $item[$key]?
surely $item[$key] won't get into the subarray?
should I eval?

o.O

Hey guys, I am trying to build a directory browsers that also lists the sub directories. Any suggestions on tutorials that work in php 4.6?

$key = "['content']['encoded']" ?

Mmmm, any idea why my server doesn't allow me to use mkdir? I get the path with $_SERVER['DOCUMENT_ROOT'] and its always worked on every server I've tried it on, but just can't seem to get it working on this new one..

Um. No.

is posible import some class from external php file and how to do it?

can you set an array and write the entire array into a file if you just use $foo instead of $foo[#]?

What's wrong with using multi-dimensional arrays, anyways?
csc`: like var_export does?

eh
im stupid and dont know php extremely well :p
im trying to get a script to compress a wanted file into a .tar.gz archive, then send the user a link to the file

csc`: use file_archive. Anything else would be more or less waste of time

any idea why my server wouldn't be allowing me to create a directory?

anyone know of a good directy browser that lists sub directories?

Make one yourself?

Sorry, I lost connection
8) MartinCleaver: so I want to generalize my code to allow

wolfy[drawing], I cannot get it to list the sub directories with out it listing all the files with in it =\

.

sure you can

What's wrong with using multi-dimensional arrays, anyways?

wolfy[drawing]: i know it is posible, I just cannot figure out how easily

glob

so I would rather see a different method
glob?

php.net/glob

y, I answered, & I meant that I am not in control of when it is multi-dimensional

you could use glob; But in anycase you'd need recursion.

http://pastebin.ca/633986

sometimes its deep in a nested key, other times it is not

whoops
okay
will look
ty

I'd apritiate if you'd type proper english.
Then fugure out how you put data in the array in a first place.

AzMoo[w]: what pattern is appropriate?
AzMoo[w]: wait, nevermind

I am handed the structure. I am not in control of it

!+recursion

http://www.zend.com/zend/art/recursion.php If you can't understand that, you're beyond help of ##php…

*, and use the GLOB_ONLYDIR flag

AzMoo[w]: I need to search for something without a period in it

i have 2 scripts, one an html/form with 2 inputs which calls a php with a 4 minutes database process, the process ends ok but it goives no echo and the form page stays in the client

All I can do is detect where the data is and use that location (i.e. in ['description'] or in ['content']['encoded'])

Wolfy[drawing] they have snet that to me 5 times and it still is jibberish.
Wolfy[drawing] okay fine, maybe not but it sounded good "beyond help"

Wolfy[drawing]: recursion is only needed if you want to view the entire tree though.

AzMoo[W] thank you

READ the page.

AzMoo[w] correct

any ideas why a server wouldn't allow me to use mkdir?

mugger permision

AzMoo[w]: Am I missing something? I thought that was the point here.

do I have to worry about the permissions above the web root?

yes you do, php does not run as root

as in the entire path is something like /var/www/vhosts/domain.net/subdomains/subdomain/httpdocs/content/directory I want to create

you are in linux?

How would i secure a form that requires two hidden fields username and password, so that they are not right there in plain text for everyone to see ?

yeah linux

!+eval

If eval() is the answer, you're almost certainly asking the wrong question. — Rasmus Lerdorf, BDFL of PHP

you lnow chown muger:muger the_folder

Wolfy[drawing]: seems that he just wants to list the first level sub-directories of a dir so that he can create links to them and drill down page by page.

chown muger:muger the_folder
chown is change owner

AzMoo[w] you are a smart (wo)man

this is linux commnad

ok, what does muger:muger mean?

group and user
apache_apache
apache:apache
try

what would I want to change it to?

Thanks :p (man)

mugger, that's the syntaxis for chown linux's command

it will be writable

AzMoo[w]: time to get the logic down here and I think i will be set. TY!

is there an array_* routine that allows me to pass in the structure pointer as a string? e.g. array_something($item, "['content']['encoded']") ?

the folder
i have 2 scripts, one an html/form with 2 inputs which calls a php with a 4 minutes database process, the process ends ok but it goives no echo and the form page stays in the client
this is my problem. im going crazy

no

good luck!

http://rafb.net/p/b9UdET92.html i cut a lot of mysql bcoz they are working ok

I guess I have to use eval then

or intelect

?
what do you suggest?

Study the problem; Find solution.

Do you think I have studied the problem?

no.

no

anyone here know anything about Linux Vserver ?

what would you need to see to be convinced of that

#linux

?

Your conclusions.

linux verver openVZ etc ?

#linux

its not a part of linux really but yea hmmmmmmm

I. Don't. Care. It's not a part of ##php nor PHP either.

it hasa php lib

and that is it :P

idiot

wow
clam down dude

does it involve the phplib in it?
yah, wolfy, why be such an ass?

this channels behavior has already got it to ##php seems like it might be ###php soon

sigh

Anything that isn't PHP does not belong in this channel. EOF.

i understand

Erm, I mean Null.
Take it to #phpc.

EOF? LOL!

What's wrong with EOF?

Hey I'm making a php script that adds several hardware items into a database, and if that hardware item already exists it just doesn't get added. I was planning on using mysqli's multi query function and having the name of the hardware item be unique in the mysql table so that when the script
attemtps to add it if it's a duplicate it just doesn't make it. Is that an acceptable solution?
or is there something inherantly problematic in it that I can't see?

Question about globals, which is better to use $GLOBALS['a']; or global $a; ?

both are bad

Wolfy[drawing]: alright, is this the register_globals problem?
Well being despised?

nope. register_globals is something completely different

Wolfy[drawing]: so how would I use an outside variable in a function for instance?

hi

register_globals makes Get / Post / Cookie keys visible in global scope… Like ?name=blah make $name containing'blah'
Pass it as parameter.

still there? not suer what I should be doing with chown

Wolfy[drawing]: oh okay. I'm just going through the php manual, a bit bored, and trying to figure out stuff I didn't pay attention to or skipped.

AzMoo[w]: That function suggestion worked great! I have a full directory browser up and running now

Wolfy[drawing]: Thanks

chown changes the ownership of files/directories
http://swoolley.org/man.cgi/chown

I see.. I'm just not sure how this relates to php not being able to create directories via mkdir

nice one Glad I could help.

Well, if you run php as an apache module then it has the rights of the user apache runs as. On my debian server for example that would be the www-data user. In order for php to create a folder or file somewhere the user www-data must has write access there. So you could change the owner of the
directory to the user php uses

ahh, but I have no idea which user php uses

What's your issue?

mkdir won't create a directory, and as I'm sure you know the error it provides isn't very helpful

Is there a way to check if my script is being run from a CLI?

anyone know how to secure/encrypt hidden form fields ?

I see. I suppose your have shell access on the server, right?

I know its correct, because I can't even do something as simple as mkdir('folder', 0755, true);.. I can paste that to any of my other servers and it works fine
yeah I do

What OS?
*distro

centos 4.4

You can try chown'ing the folder your want to write in to the apache user/group. chown apache:apache /path/to/the/folder

muggerthe the apache has no rite to write NOTHING on your folder
so, you must create a writable area for it

what is it called when you do things like function() or die();
what kind of structure is that or part?

die() is a function

yeah but what if I don't want to just die and I want to do something else as well?

Do whatever you want to and then call die()

Hmm.. where would I ever use interfaces and abstract classes… and I can't really understand the difference b/w the two

you're a legend! chown apache:apache did it thanks a million

Nice :] You're welcome

yeah but how does the syntax go function() or {blah blah blah die();} ? or what?

i have 2 scripts, one an html/form with 2 inputs which calls a php with a 4 minutes database process, the process ends ok but it goives no echo and the form page stays in the client

an abstract class is a class that *must* be extended. It cannot be instantiated on its own. An interface defines what a class implementing the interface must define.

Yeah, something like that. http://pastebin.ca/634020
You write a function and then call it from within your script

AzMoo[w]: Yeah, only interfaces in PHP suck
I could harldly tell the difference at first…
Java OO is way better so far..

luisgrin whats your timeout settings in php.ini ?

i dont know

have a look

gms thanksssssss

You mean like this? http://pastebin.ca/634021

gsm

yeah, it's certainly not the best OO around, but it's heaps better php4

im sure you must be rite

max_execution_time and max_input_time and possible memory_limit

http://pastebin.com/m5f9dbac1 — This is valid, isn't it?

max exu is ok, problem is with one form who calls a php

can i pass variables to a php class?

if the php does not resolve…..

yes, they are arguments in the constructor.

if the php does not resolve in a TIME …. the form … ok the form can time out

AzMoo[w]: Yeah, that's true.

but i dont know with paramenter must be

I must have misunderstood what you wanted. Like this: or die(mysql_error());

oh ok

Yeah I understand that part, but my problem is it nees to include a header file to finish off the layout as well as print the error and exit.
so I'm wondering if you can replace the or die() part with a different function or strucutre.
and in a way that stops mysqli from printing out it's own error.

wait sorry I don't understand

I believe you can put your own function after the 'or'
I haven't tried it myself so I'm not 100% sure.

"or die" means "if the function returns false then die". Instead, test the return value of the mysql function and do your own processing as a result.

if you want to pass a variable into the class just put the names of the variables in the construct or function like __construct($arg1, $arg2) and then when you call the function new myclass($arg1, $arg2))

got it, thanks

AzMoo[w]: you mean like this? http://pastebin.ca/634028 because if I do it like that right now it's throwing out TWO errors mysqli throws it's own and then the one that I'm printing.

yes, like that. If you want to suppress mysql's error put an @ in front of "new"

ahh I guess that would make sense…
Cool that works.

Of course it does

I would have never figured out that putting an @ in front of it would suppress the error on my own

Would anyone here happen to know why CURL doesn't return special characters for other language sets like Japanese?

AzMoo[w]: can you do that in front of functions too?

i imagine because of character sets. unicode support in 6

sure can.

http://www.tilansia.com/babeltest.php Know anyway to fix it?

So I'm trying to write a DB class which would handle genereric database processing and a Calendar class which would have all of the necessary calendar methods. Would it be alright to create an instance of the DB class inside of a Calender class and use that instance to send/receive data from the
database?

GNS hi

http://au2.php.net/manual/en/language.operators.errorcontrol.php
I would separate them so that you can use the db abstraction layer for other projects in the future without it being coupled to the calendar.

AzMoo[w]: Ok, so that's what I have right now - just two separate classes not connected at all.

http://pastebin.ca/634035 has the solution I used

AzMoo[w]: Then the question becomes, what's the best way to link them together then?

ahh that's what I'm looking for.

check out mbstring
i shy away from multi language dealings because well.. have you seen that page? ugh
good luck getting the characters going i suppose is all i can offer.

AzMoo[w]: You there?

hey, do you really need to ensure that all mysql results aren't false?

hi,all
where can download websites source code(PHP)?
free.

Not exactly I mean if you don't care that the mysql query failed then you don't really need to check it do you?

For which website and what "free"?

Well, you don't "HAVE TO" per se, but it's a good practice. What if you have an error and your program attempts to do something it can't do because the result is invalid?

well like, it would be nice to check it to gracefully fail, but what kind of things would make it fail? how often would that happen?

I m a student, I want learning the php language, so I want download some free source code samples.

true, but I was looking at drupal and joomla, and neither of them do any checking

Well I guess if it's a really really simple query you won't have a problem.

It's a good design to check for errors wherever you can. That way you will detect them at the earliest stage and will know exactly what's going on.

Use teh Google Luke.

Search for them. They are everywhere.

I tried it , but only search local info.

What do you mean?

hm, okay
thanks

Well like if it's a simple INSERT INTO blah () values () there's not much that users could send you that would cause that query to fail.

The amount of checks you do is obviously up to you.

and I could see how if you're absolutely sure that line will never create an error, and it's part of an intense application where you need every bit of performance boost you can get I could see you leaving out error checks.

well with luck this would be a commercial thing

only could search local country's website ,cann't search other country.

Just have to be reasonable - find an equalibrium

hm, okay
thanks

Then use the checkbox underneath the search box. Geez.

Then you certainly want as many checks as possible.

Don't people ever read forms they submit?

yeah
but I find oss code to be top notch, so I got confused when I looked at drupal because of how good that code is supposed to be

Ahh, young and unsuspecting.

lol

in other words, that code isn't that great?

Trust me, there is always room for improvement

Whenever you have more than a few people writing code for a project, things tend to get messy.
It's like the second law of thermodynamics.

ahaha

a never ending proccess

okay

the code is never better than the program. Second law: every commit reduces the code quality.

if all our automobiles were made using the software development process,
one car would randomly blow up every few minutes

Crap, I'm on commit 347
heheh
rofl

Just when you thought you were done and decided to check your email… Baamm bug report

But that's already true, isn't it.
At least a drunk user can't kill a random person with Microsoft Word.

DesktopBSD 1.6-RC3 is out! yay :P

guess who's back. back again. joshie's back. tell a friend.

can some one tell me how can i execute system command as nobody using php script i tried by system() but not working

a drunk user can't make his car stuck in the middle of the road
hehe

Linux has a user "nobody"?

yes

sure does

Does it have "somebody" as well?

has anyone here done integration work with disk.com?

it can if you want

Here are some functions for command execution: http://gr2.php.net/exec

humm

I think that the command runs under the user php (or apache if php is a module) runs as. I'm not sure though :]

would work for me, but the shorthand wouldn't?

Have any of you guys written a generic sql class to work with the databases?

K so I'm doing a mysqli multiquery where I expect some if not all of the queries to fail how can I create a while loop that goes through them? I think you would use while(mysqli-next_result()) but next_result() should also return false if that specific query failed right?

my debian box runs apache with the user "www-data", but I have heard of it being run by "nobody" as well
yeah, you can turn off support for "" in the php.ini

not working

what command are you trying to run?

well i want to run apf command
which is firewall to block ip addresses from webpage

I would just run the queries one at a time…
ah, I see

ah, thanks… I just installed apache/php locally for the first time… it must be turned off by default

try something basic like ls for testing

okies

you are welcome… if you're planning to distribute your code at all though, it's a good idea not to use for the reason you just encountered

its working for ls
but not working for apf

thought it might. Does the user that's running apache have +x on the apf bin?

yes
"/etc/apf/apf: line 35: /etc/apf/conf.apf: Permission denied"
i will be back brb

then give the user permission to /etc/apf/conf.apf?

hummm

yes! whiskey on the keyboard

when you are going through a foreach loop in an array with named fields how to you retrieve the name of the field you are currently in?

I'm currently trying to get my apache server to recognize I had installed php on my windows xp system. along with the load module and add type codes, I remember there was another code that was needed to allow windows to accept … something… does anyone remember what that code would
be?

$value)

$key)

Ch1ppy beat me to it

I win

can I pass a variable from a function within a class to another function wtihin the same class?

you mean like:
public function test($var) {
$this-yay($var);
}
??

hm
like i have a class and then a function and when i run it has paramaters, then when i run another function from that class i want to be able to access the paramaters.
of the first function that already ran.

oh
you can store them in the class…

you mean by changing the constructor

class Test {
private $var;
public function test1($passed) { $this-var = $passed; }
public function test2() { echo $his-var; }
}

hey all. im messing around with some xsl and xml, and I
'm trying to teach myself as i go, but im having trouble dumping my vars (which are xml and xsl string)
and getting something useful to look at. so, i'm thinking about using file i/o to dump my vars and look at that way.
hows that sound?

oh ok thanks

you are welcome

By the way, thanks for helping out here but for future refrence, if you need to post more than three lines of code, use a paste bin Some mods/ops here can be strict about it.

I was actually thinking about that as I wrote it, but was lazy :P Thanks for the heads up on the strictness though

or vardump will cause the browser to "half-render" my data, where obviously I just want to see the xml

Can't you just look at the source?

no, it comes from an api call, so from the moment I have it, its in a var

Well, its that posting moree than three lines can flood the channel. So if people come i and see other people doing it, they might just start posting code as well. So it can cause a mess. Saw it happen before. This one guy tried to post about 50 lines of code.

ahahaha. alright, thanks

plus i need to add to add to the xml i get… so, dropping it in a file to verify im doing it right seems like the logical choice, right?

Why can't the browser display the whole data?
or.. maybe that's all the data return from the api?
*returned

because some of it is valid html and it tries to render it, so i'm asking if there is some way (i thought there must be) to make my browser be literal in displaying this string

Oh.. hmm

so um guys quick question
I want a download.php with a download counter. each downlaod is stored in msql database. I want it to get the URL, and set the header for it
so download.php?id=IDHERE is actually file.zip

htmlsentities and htmlspecialchars

thanks, gonna look into it

nvm I got it

I mean htmlentities. Note, these formats the html into browser safe text/entities

cool

You can also try using header to send a content type header saying the page is text and not html, but some browsers are buggy and don;t respect content-types *coughs*IE*coughs*

or header("Content-Type: text/plain; charset=utf-8"); :P
before the var_dump

good to know, thanks

how was it I get the mime type again?

You're faster

print(fread($file, 1024*8));
meh
I suppose so
open file, echo its contents

hey

I just dont know how to get a file's mime type
or whatever it's called
video/mpeg, etc…

You know whats great? The people at Microsoft decided it would be smart to enable their own mime type detecting by default and ignore anything the server sends. Thanks to this, it opens up a hole which makes IE one huge XSS flaw. Basicly you can make an image and embed html in the image in
the data fields and IE will process that HTML inside the image as real HTML.

So people could include javascript and all kind of things inside a website.

What is the companion function to htmlentites that is used for mysql queries called?

does anyone here know of a good random image generator for a site? i'm looking to set something up where a person can just click an image and have it randomly display another and so on and so forth

IE should be banned!

oh so is there a built in mime type thing?

So a simple avatar or sig image could send all the cokie data, ect to someone else.

Comments

if Im making a list from a AJAX database call should I build up some HTML and then use innerHTML or make DOM elements

I am pretty sure it iwill

Many things glitch in Opera

i've tried to implement simple benchmarking on this http://dev.byron-adams.com/jquery/plugin/appendDom/ by subtracting the start time ( new Date().getTime() ) from the end time but im not sure if i did it right, do those numbers
at the top represent ms?

thanks for the compliment on my little site

no problem

I'm just learning JS

all that, is it fetched from your comp or ?

I upload my music
it's only like ~20 gigs

jesus, all that is on the web?

you can stream it, too, which is cool
rsync ftw

I am trying to run some ajax with jquery that is simple calling an HTML file that also has some Javascript in it. in Firefox the JS gets executed but in Safari only the HTML is rendered. how can I get Safari to execute the javascript within the page I am calling? The JS contained in the script
works fine in FF but $.get("includes/shc/p2.php", function(data){$("#p2Div").html(data);}); doesn't work in Safari, the JS that is. any idea

folks…. are relative path names that i use in JS relative to my SERVER or relative to my js file? (in this case, i insert a js file that is not local to my server)

hey, can some one clear something up for me. what exactly is going on here… var onpostload = { _that: null, handleEvent: function(event){ this._that.onPosLoad();} onpostload._that = this;
i think relative to the js file

are u sure?

actually.. hrmm
frig can't remember, i fiddle with this before
anyone have any ideas about the code i just dropped?

that code is missing a brakcet
var onpostload = { _that: null, handleEvent: function(event) { this._that.onPosLoad();} } onpostload._that = this;
the idea is that you want to save your |this| context. when onpostload.handleEvent() is called, |this| points to onpostload, but this._that points to the object you were originally in

oh ok

how do I see the function definition from JS shell ? for example.. the definition of Array() function

thank you

Is the output of Array.from the definition of Array function ?

eh?

opena JS shell and type Array.from enter

nothing
What are *you* expecting?

it prints something…

what is the right way to set up a whole list, and each should do something when clicked?
onclick="" on each, or a listener?

i'm in an iframe, how do i reload the parent window?

I think that will kill your iframe

don't care about the iframe
actually
window.parent.reload()

but… I guess you just use a reference to the parent window
yeah that sounds about right

hi, I want detect the duration it took a user to press a mouse button on a link. basically, the time between mousedown and mouseup. how can I do that? by the time I calculate the duration, the link will have been clicked and the browser will leave the current page.

a href

onClick="yoursillycalculations(); document.location=porno.html;"

ahhh good idea
wait, but still how do I get that duration data on my server?

"document.location='porno.html?dur='+reactionTime();"
i dunno of that works :P
if*

make an AJAX call to your server before sending them?

k, I'll try deebo's method and if that doesn't work, I'll look into ajax

no, deebo's will work if you can record the link time on the next page
I thought you were sending them off your site

they are being sent to another page on my website
for example, mysite.com/page1.html will have a button. they click on the button and I want to know the duration of that click. they will be redirected to mysite.com/page2.html

sure
on page 2 record the referrer and the duration from the query string

ah, nice
any way to do this transparently? using POST maybe?
it's not a huge deal I guess
that timing might be tricky though - so I have to record the value of the mousedown, then record the value of the mouseup, then do the calculation in reactionTime() hoping that the value are recorded by the time it's called

just make a hidden field and input type=button onclick="document.myform.myhiddenfield.value=reactiontime();document.myform.submit();"/
then read myhiddenfield from the request

no, you're doing the link yourself
so you control when we move to page 2
but transparency is an issue
you could ajax, or put in a form and POST

I see
thanks guys

if I'm making a list from a AJAX database call, should I build up some html hosting and then use innerHTML or make DOM elements and keep appending them with appendChild?
which is better practice?

DOM
`innerhtml sucks @ trhaynes

innerhtml sucks: If you have events on elements that are rendered via innerHTML they do not go away when you empty the innerHTML area. They may even crash your browser. You cannot use innerHTML for building items like tables in IE. You cannot use innerHTML for adding options to selects
in

elements in innerHTML are not executed.

oh wow
glad I asked
so if I'm making a table, I have to make the taboe
and then put a thead in
and then put a tr in
and then tds in that

yes

etc. ? seems tedious
and add attributes to each along the way?

`html2dom // save yourself some time

Woosta's (x)html to DOM convertor .. convert xhtml chunks to DOM scripting: http://rick.measham.id.au/paste/html2dom.htm

yes
if you already have the HTML worked out, paste it in the top left and click convert

oh nice
thankss
is something.id better than something.setAttribute('id', .. )

IMO yes

anyone know if it's possible to get browsers today to do a filtered resize of an image?

(1) you *have* to do it for className
(2) you save a pile of chars
they'll either do it all the time or not at all. You have no control

browsers just interpolate, not filtering

thing is
the new zoom feature in IE7 uses a fully filtered resize
but

just make your own lanczos resize javascript!

heh

Hi, how can i get the page height, document.body.clientHeight gives me unscrolled height.

but anyway even IE7 although it has code for filtered resizing, doesn't do it, unless you're telling it to 'zoom'

could anyone tell me by some miracle why my mouseover stopped working on http://www.forgemodels.com/model_browse.php warning not work safe some of those overs… if they worked

you have to do it for class name?

yes
IE is stupid
`className
jsbot find classname

js ref classname, js syntax classname

bah, not in the bot

oh, IE doesn't like setAttribute('class
'?

correct
it expects setAttribute('className', ..)
But that doesn't work anywhere else

of course not

so foo.className is the only cross-browser thing that works

because className is not an attribute
ok, thanks

exactly

so what if I want to make a paragraph, add some text to it, and then add it to the dom?

use the tool

var p = document.createElement("p"); ??? mydiv.appendChild(p);

var p = document.createElement('p'); p.appendChild(document.createTextNode('text')); yourDiv.appendChild('p');

ah, textnode
how very obfuscated

hey, I have some code that's sensitive to resize and load events…in IE, a load event generates a resize event as well, is there anyway to prevent this?

how can i get the page scroll value?

what about getting things with innerHTML?
is that kosher?

don't worry, found the answer ( document.body.scrollTop)

how would i fix the quotes so that the src="" quotes dont interfere with the onclick quotes?… a href="#" onclick="$('large').update('img src="test.jpg" /');"test/a

yeah, I treat innerHTML as read-only
or write-for-non-markup-content

bold"

rather than creating a textnode, an I element, with a text node, then another text node

hi all. how to debug some javascript hosting code?

`firebug

Debug your Javascript in Firefox using Firebug: http://www.getfirebug.com/ .. Or use Firebug Lite for debugging in non-firefox browsers: http://www.getfirebug.com/lite.html

thanx

any ideas on how to fix the quote issue i have above?
preceding the img src="" quotes with backslashes doesnt work

http://phpfi.com/255201

The paste 255201 has been copied to http://erxz.com/pb/3962

jsBot, thanx for firebug again. all my problems disappeared

`bot @ iobit

bot: Hey! I'm a bot! I appreciate the sentiment, but you might want to thank whoever told me to tell you that!

)
Woosta, tnx

hmm, any easy way to check if a text areas content has changed from the original?
to like bring the users attention to the save button

if(yourTE.value != yourTE.defaultValue){…}
(Which may not be cross browser)
I can't remember

How can i have contents of some div tag hidden?

set its class to hidden
TE has a defaultValue?
ie. the one it was inited with

all form elements do (at least in FF .. as I said, no idea if it's cross browser .. but the defaultValue gets used when you reset() a form)

ah
hmmmm
have to look into that

moin

can anyone tell me why i get the flickering on the mouse over?
http://www.forgemodels.com/model_browse.php like go left to right, each letter of the name causes a flicker
www.thenextbyte.com/videos you can see what i am talking about if you cant get it to do it with your own browsers

hmm why wont a basic textarea format text with CRLF row changes?

what is the best way to work out what IE means when it says there is a javascript error on line 64? of which file?

Did MS change the designmode engine in IE7? Now it adds a generator tag that is strikingly similar to the one MS Word adds. And it behaves differently with styles

hmm anyone knwo a website that has test data in weird languages and character sets?
like chinese/japanese characters etc
lorem ipsum for businesslogic :P

Just do a search for Unicode test page.

utf test page, yes
http://www.columbia.edu/kermit/utf8.html

unicode OR utf-8 test
That ought to do it.

ah that'll do, thanks

learn utf8 test = http://www.columbia.edu/kermit/utf8.html
hello? jsBot?
I'm a talkin' to you
`js ref
You're not a talkin' t' me though huh?

How to delete element definitely? I know i can use removeChild() but the element probably still exists in RAM after deletion.

If there are no pointers to it, it will get garbage collected

Anyone living in EST?

does the unescape() function has a maximum string length?

near Estonia, me

no, EST - Eastern Standard Timne
time*

DD
sorry

hi i hv a prob
i want to reload a form by another form
both form has no relation

reload a form?

yes

explain..

from another form without using any parameter

what do you mean with refreshing?!

actually i hv a pop up window which parent window has two separate form i hv to refresh one form of them when any changes occur in popup window
another form of parent window should not be refresh

How do I check for if a variable is 0 or false?

if a == true

===

ok thanks

Is there a way to make onblur="value='please input something'" happen only if value='' ?

yes

How?

onblur="if(value='') value='please input sth'"

SlimG, 3
er du her ja

hehe jeg er overalt
I forgot to mention that the onblur is a html tag, not javascript, sorry

s/tag/attribute/

Thanks GarethAdams

yes, should work anyway

Comments

« Previous entries · Next entries »