colID orderID dataCol I have selected all from that table with a certain colID and with orderID=1 orderID =7 This

maybe, SHOW CREATE VIEW `view`;
that works for tables, anyway

!m SettlerX joins

SettlerX see http://dev.mysql.com/doc/refman/5.0/en/joins-limits.html

funky

ergh, stupid bot
joins

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

or union, of course

!man join

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

one letter of number (1 or 2), ID field and NAME field.
Union… hmm… Perhaps that's it.
SELECT CONCAT(1,ID),name FROM '.PRE.'cats WHERE sc="P" && access!=3 UNION SELECT CONCAT(2,ID),name FROM '.PRE.'pages WHERE access!=2
is it right?

can i ask one more dumb question? (er, make it two — #2) how do i check what the values of innodb_table_locks and AUTOCOMMIT are?

select @@innodb_table_locks, @@autocommit; ;-) )

hi all
i have upgraded my mysql server from ubuntu warty to feisty
feisty comes with mysql hosting 5.0.38
i have had old isam tables, that can no longer be read
is there a way to read isam tables with mysql 5.0.38?

you did of course dump them first

If i did that, i would not be here asking the experts
i tried to migrate to anonther server (still 4.1) but it keeps running away, when I am accessing the tables

see upgrading docs for issues

ok thx

I'm probably not explaining this in the most understandable way, but
colID orderID dataCol. I have selected all from that table with a certain colID and with orderID=1 orderID =7. This leaves me with all dataCols of colID within a specific order range. I need to find all other colID with dataCol of the same value in the same /respective/ order: that is, not the
exact orderID. Any idea how such a query, if even possible, would look?

itrie to stop Mysql it says failed how can I then stopp it?

an exact pattern matcher: to find all colID with certain data in a certain order

i did mysql_upgrade, but i am still getting ERROR 1017 (HY000): Can't find file: '' (errno: 2)

I try to stop mysql but it failed what can I do to stop it?

kill -9 [pid]

i did mysql_upgrade, but i am still getting ERROR 1017 (HY000): Can't find file: '' (errno: 2)

!perror 2

No such file or directory

nog mensen die hebben in een leuke chit chat ?

the_wench: http://nopaste.org/p/afLqBV0ykb

probably an innodb table and you did not copy the innodb tablespace

when i do a "show innodb status", i see this 20-25 times: —TRANSACTION 0 984019436, not started, process no 4901, OS thread id 1160055136
MySQL thread id 19236, query id 1353401520 10.10.170.16 root
is that bad?

i really just upgraded the system

with different ids, of course

here is the fs structure
http://nopaste.org/p/aZQRLKA0I
i see the ib_data file
that should be it, right?

from what version as isam support has not been in the engines for a while
hence the need to dump from an old version first
you will need to downgrade/compile isam in
Note that mysql hosting 5.0 does not support ISAM

ok
my problem is that i did the following
stop mysql
copy the isam tables away
move them on another server
running mysql 4.1
but on that server i keep getting
MySQL server has gone away

henceforth never upgrade without reading some documentation and a backup
!man gone away

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

hi people, i will like to know how can i call functions like LAST_INSERT_ID() and NOW() by using query strings/?? example SELECT LAST_INSERT_ID() FROM Table1;?
i assume it's similar to COUNT(*)?

FreeNet, depends on language for last insert, now() its just that
!php mysql_insert_id

int mysql_insert_id ( resource link_identifier ) Get the ID generated from the previous INSERT operation http://php.net/mysql_insert_id

mysql_insert_id is part of the php library.
but i am using C#
so is there a way to retrieve the field just by using querying

actually it calls the C so whatver its called in your lib

so that means even if i do this, SELECT NOW() FROM TAble1; won't work right?

no need for from table
tias

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

got it
SELECT LAST_INSERT_ID(); and SELECT NOW();

mysqlcheck –auto-repair EVO … mysqlcheck: Got error: 2013: Lost connection to MySQL server during query when executing 'CHECK TABLE … '. I think I have learned my lesson

thanks.

what can i do now?
is there a documented way to downgrade?

I would just copy the isam tables to a downgraded box and dump them

Unsupported. Period.

this is what i did, and where i am getting the above error

hi, i've got a warning with a command, how can i know what was that warning…?

show warnings;


sorry …
thx … :

I typed this:
CREATE DATABASE my_dbname;
GRANT ALL PRIVILEGES ON my_dbname.* TO 'my_username'@'%' IDENTIFIED BY 'my_password';
as root on a mySQL version 5, and it definately won't let that user/pass connect, do I have to do anything else?

you want to connect from remote?
first try local connection

I tried both local and remote
you think it would work right? it's always worked in the past

try FLUSH PRIVILEGES

tried that :-)
oh well
bye bye :-)

flush privileges is not needed this time

i found a decent backup
copied the file and everything is fine now
thx for your help

np

To copied the file,can it using in innodb type table??

what's the command to find out which program is using a given port?

lsof

telnet

ls of -i

:-)

errr
lsof -i

man fuser
or lsof, yes
fuser -n tcp xx

Welll hello
I have a table (1 million rows) and I want to count how many entries there are for an array of Zip Codes. So what I am doing is SELECT count(*) FROM realtors WHERE (shortzip = '123245' OR shortzip = '123246' ORshortzip = '123245' …)
and I usually have about 20-300 zipcodes in my where clause
how can I get the results to come faster?

little bit faster to use WHERE shortzip IN (12345, 56789, 98765)
Do you have an index on shortzip? That will help too

yeah
I jsut index shortzip
that is the correct way.. right?

yes

ok

If you need thousands of numbers in that array you should think of temporary table with them

ohh ok… thanks salle I will read up on that

CREATE TEMPORARY TABLE temp (shortzip INT UNSIGNED PRIMARY KEY) ENGINE=MEMORY; populate it and then simply do join: SELECT count(*) FROM realtors, temp WHERE realtors.shortzip = temp.shortzip;
CREATE TEMPORARY TABLE temp (shortzip INT UNSIGNED PRIMARY KEY) ENGINE=MEMORY; populate it and then simply do join: SELECT count(*) FROM realtors, temp WHERE realtors.shortzip = temp.shortzip;
There is no such thing as explicit join defined in standard

damn I don't even have to work anymore! Just sit back and ahve you guys do everything… I really appreciate it. thanks 100x

standards schmandards

Next time someone needs help you can do it

I will do what I can… if they need help asking question… I am their man

I wanted to give access to a remote ip, but the db table in mysql database host is empty!
so my update db set host… where db='blabla' statement is useless
any ideas?

use the GRANT statements
!man grant syntaxx

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

!man grant

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

hello
i need some help about .NET platform, do you know any sepcific channel for that?

I've a SELECT SQL statement that returns results on my dev server host (5.0.38 Ubuntu) but doesn't return results (0 rows) on the production one (5.0.24 CentOS). Does anyone know where I should start looking?
If I remove the "GROUP BY …" bit from the statement, it works fine on both. But I hope I could figure out what's going on.

I am trying to get remote connections working on a windoze php mysql web hosting server and having some trouble. When I uncomment 'bind-address' and 'port' the server begins without error, but then is inaccessable by phpmyadmin. I have tried setting the
config for phpmyadmin to the IP instead of 'localhost' but that didn't really do anything.. ideas?

what are those all people do without talking?

You've compared the tables and they are identical?

alienbrain_, i'd look at upgrading

snoyes, I've dumped the exact database from the production to my dev, tried the sql host and it returned results. On production it doesn't.

does anybody know how to add ASP mobile web form templates to visual studio 2005?

HarrisonF, Of course, I'd run the latest version myself, but unfortunately it's not an option for this client (e.g. the server is not under my control and is running dozen of other applications)
HarrisonF, I'm trying to find the bug report so at least I could convince them
(if it's a bug that is)

While it could be a bug, I'd first make positively certain that the two data sets are identical (using xaprb's toolkit), and that the query is identical on both sides.

snoyes, thanks, I will look into xaprb

Is there a channel that specializes in windows mysql installations?

tookit
toolkit

xaprb's MySQL Toolkit (http://sourceforge.net/projects/mysqltoolkit/) includes tools to compare databases across servers (such as master to slave) and bring them back into sync, profile queries, and other handy features.

i'm trying use mysql on one DB and tha shell return form me
Access denied for user 'www'@'localhost' to database 'PORTAL' when doing LOCK TABLES
what is this?

Just what it says. The user 'www'@'localhost' doesn't have permissions to lock tables on the 'PORTAL' database.
Log in as a user with sufficient privileges. Change your privileges with a GRANT statement
!man grant

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

snoyes, thanks man.. i will do it!

Hello, is there a way to copy a database without using mysqldump?

stop the server, then copy the /var/lib/mysql directories and files.

thanks

howdy!

Hello all
it is a known "feature" that a table biggern than 4GB is the max limit?

table size is a function of o/s

Linux 2.6.x
I guess my MySQL is compiled without large file support
it's a pretty old Debian box actually

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

thanks
Linux 2.4+ (using ext3 filesystem) 4TB
I'm using ext3 under Linux 2.4
still I get the error
it seems like a pointer size stuff
Some idea about how to get a decent value from AVG_ROW_LENGTH=nnn from my dataset?

snoyes, unfortunately I don't have GRANT privilege to allow connections from my host. and can't install it there as I'm firewalled so it won't be able to connect to my mysqld.
I will continue searching the bug queues for now. If anyone could help please do so :-)

Can you mysqldump on both and run the results through diff, or is the db far too big for that?

snoyes, I can.. will do that now
oh first thing.. my bad. The production is 5.0.42 not 24
that makes it higher than dev
snoyes, I'm positive, absolutely no changes.

Ok, can you make a small test case that shows the difference in behavior?

snoyes, I didn't understand the cause yet, so I'm not sure I will be able to identify the issue and make it reproducable, but I will try

does anyone know if mysql stored procs can be used to create triggers and other stored procs?

You cannot create a trigger from within another stored routine.
nor a procedure

Does anyone know why "UPDATE `tv` SET release=2007 WHERE id = 0000002045;" stopped to work after upgrade to MySQL 5? I've released that changing query to "UPDATE `tv` SET `release`=2008 WHERE id = 0000002045;" make it through.

hi. i noticed a new option on one of my servers. i can optimize the machine for sequential memory access, or random meory access. what would mysql be doing most of? or is it application specific?
i would assume sequential

What's a magic quote "`"?

release is now a reserved word.
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)

snoyes, thanks alot. Next question, is there something to do about that except changing queries?

snoyes, ok thanks kindly, thats what I thought.

the_wench, thanks too.

Nope.

snoyes, thought so, thanks!

Is this the correct way to do transactions in mysql 5.0.37?
http://bin.cakephp.org/view/745718243

up to now i have my stored procs or functions basically output the code for the triggers, which Ive been copying and pasting, but from the sound of it I am going to have to create a php hosting front end or something.

use "start transaction" instead of "begin"

snoyes, okay lets see if it works

Yeah, or mysql -e "call createTigger()" | mysql

Hi. I have a question about MyISAM indexes. I have a 44MM record table with a CHAR(3) column that I want to join on. There's an index on that column, but EXPLAIN says it's not limiting the number of rows in the results set
The values are not unique

asciimo, post the query and the EXPLAIN somewhere

thanks, HarrisonF

snoyes perfect!
gonna test

http://pastebin.com/d669b482c

Hi, How do I use output of one SQL query in another, like "INSERT INTO a (b) VALUES ( (SELECT z FROM x WHERE y='q') )

!man insert-select

see http://dev.mysql.com/doc/refman/5.0/en/insert-select.html

hey ho!

I got disconnected, so just in case… Hi, How do I use output of one sql host query in another, like "INSERT INTO a (b) VALUES ( (SELECT z FROM x WHERE y='q') )

!man insert-select

see http://dev.mysql.com/doc/refman/5.0/en/insert-select.html

Thank you

snoyes have you used the method above?

"SELECT a.id,f.position FROM ALTRO as a, ALTRO_FEC as af, FEC as f WHERE f.position != 1 and af.FEC_ID = f.id and af.ALTRO_ID = a.id;" - I wrote this to make sure I got the where clause. I actually want to remove all of the rows from ALTRO,ALTRO_FEC and FEC where the clause is satisfied.
How2do ?

not for creating triggers per se, but for generating dynamic sql, yes.
!m hyakuhei delete syntax

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

See the "Multiple-table syntax", and note that you have two options.
They do the same thing, just different ways to write it.

Did you catch that pastbin URL, HarrisonF?

snoyes, gotcha. Is there a way to eliminate the ——– that surrounds the output?

-B (and you'll want –skip-column-names too)

ah thanks

I still want to know what -N and -L are deprecated.
*why

hello
wich command should i use to import a file with the from file.sql?

mysql file.sql, or if already in the cli, source file.sql

does alter table mytable order by serial_number desc; stick?

ok that worked for creating the code properly…when I | mysql -pmypass dbname I get PAGER set to stdout

snoyes:don't i have to specify the table that i want to import the data to?

the thing is my show index mytable still says its sorting ascending

does a unique constraint over two fields create an index?

yes

howdy howdy howdy

ping

pong!

out!

I am selecting from a table based on a date field using the syntax field BETWEEN start_date AND end_date but am always getting an empty resultset although there are definitely entries present
any ideas?

What should I use to turn this txt(http://www.itu.int/ITU-R/space/plans/ap30b/RS42C_030507.zip) to a importable CSV file?

Put the SQL and a sample of the data that you would expect to see in the pastebin

magic?

nils_:talking to me?

You'll need to write your own parser and convert it

any recommendations one what I should use to parse it?

Any language you are comfortable with that has a good string library. I would use Python if it were me

ah forgot the quotes around the dates
now it's working

that'll do it
also, that doesn't really look like flat data. ie, I don't think it really belongs in a CSV format. Looks like the data will probably end up in several tables. Probably best to parse it and then insert it into the database on the fly

I have a 8 page explanation on the format of the txt files data. Isn't there a program where I can give it the format and it'll convert it to csv, xml or whatever..

hi.
I need to do an update using data from another table. is this right:
update t1 set field = (select data from t2 where t1.id = t2.id)

snoyes, cheers, upgrading to 5.0.44 solved the problem

alienbrain_, what was your problem?

help? :P

TapouT, I had a SELECT query that was returning results with older versions (5.0.38) but returning 0 results with 5.0.42
TapouT, removing GROUP BY part of the query however, makes it work
TapouT, anyway, once we upgraded to 5.0.44 all worked fine.

hello
how do i change root's password?

davidfetter, you can start mysqld with –skip-grant-tables

reset root

See http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

alienbrain_, archivist, thanks
um, it's currently empty string
so i can get in there

hi

how do i remove a database? deleted database and remove database does not work

someone runs mysql replication??
not works for me

Ahmuck, it's called 'drop'

does it make sense to create the columns 'first, last, name' name = 'first last' ?

BlkPoohba, rarely

BlkPoohba, I use firstname middlename lastname companyname things like that
i used to use namefirst namelast namecompany etc to organize all names together but this is tedious. now i use a serial number based on an ID in the comment, so I can do a select from information_schema and my sead database (sead is my personal tracker for all information related to columns,
tables and dbs)

i shouldn't need a column that combines the two though right.

hello, at http://rafb.net/p/dzMbCb48.html i have pasted the table description, the query i need to do, my try and what i think is wrong. please can somebody take a look and try help me with this query ? thanks

BlkPoohba, no
BlkPoohba, you can do this:
select concat_ws(" ",firstname, lastname), address, city, state, zip from mycusts;

GROUP BY stream_id, city, country

oryou can even use a view, but usually the select with the concat_ws would be enough

that is what i was thinking. thanks

Hi. Is it possible to autoincrement with a unique ID (user id, in my case)? Like, row 1: 1-1. row 2: 1-2. row 3: 1-3. row 4: 1-4. row 5: 1-5… you catch my drift.

does mysqld_safe always try and run as the mysql user?

autoincrement

http://hashmysql.org/index.php?title=Autoincrement_FAQ

see #6 on that link

d3c, yo ucan only have one auto increment column

snoyes, I'll have a look

well unless you use triggers

You can have lots of auto_increment columns if you play with LAST_INSERT_ID(expr)

not so much. You would have to "explain" the format to whatever program might exist anyway and like I said earlier, it doesn't look like a single table of data anyway

snoyes, via triggers you mean though?

Triggers are one way to do it. You can also roll it yourself with one or more update statements.

guys, please. I need to do an update using data from another table. is this right:
update t1 set field = (select data from t2 where t1.id = t2.id)
?

what do you mean by triggers?

It might work, but you can also use UPDATE t1 JOIN t2 ON t1.id = t2.id SET t1.field = t2.data;

ah
thanks

snoyes, ah gotcha.
i am a big fan of triggers

Row 17 doesn't contain data for all columns…. is there a way to bypass this?

If I select, say, mediumtext as the data type instead of varchar, it can still have numbers and symbols, right? It's not literally the 26-letter alphabet (in English), is it?

have it enter null values for it or something?

!perror 150
!perror 150

Foreign key constraint is incorrectly formed

you're good to go.

thank you, threnody

KEY crawling_name_idx (name),
CONSTRAINT `crawling_ibfk_1` FOREIGN KEY (`name`) REFERENCES `script` (`name`) ON DELETE CASCADE ON UPDATE CASCADE

any character limitations are in your choice of charset

how is that malformed?

I see. That helps.

is it possible to create a constraint which limits the amount of rows which has a column with a specific id?

write a BEFORE TRIGGER

ah, before insert?

STOPPING server from pid file /var/db/mysql/ngdev.org.pid

and BEFORE UPDATE

why before update?

it might be close to your pid file
UPDATE tbl SET fld = 1;

ah, right

ah - gotit, thanks! In there I have: http://rafb.net/p/s6Vvmb54.html - any clue what's wrong?

!perror 13

Permission denied

"The error means mysqld does not have the access rights to the directory"
that's a clue
;^)

Operating system error number 13 in a file operation." why can't it print strerror(errno) as well?

ah I see, okay I'll look into that, thanks threnody!
now I'm getting http://rafb.net/p/w3RWsI57.html - is this permission related too?

thanks

raar most likely you did not run the mysql_install_db script

helo
please
http://www.lcc.uma.es/~bds/adminbd/practicas/ABDPract5.pdf
as serian the possible tables porfavor? of the question I number one

#mysql-es maybe?

what is the command that makes mysql suggest a table layout?

SELECT * FROM table PROCEDURE ANALYSE()

thanks

Suggest a table layout? wtf?

is there a way to group data in a SELECT query returned by HAVING? if i don't group, i get the relevant rows but i need counts. if i group, the HAVING seems to apply to the grouped data and i get an empty set which is useless. suggestions?

show your query and the result set you're going for

http://www.pastebin.ca/612845

pb_werkin, probably want that in the where not having

the problem with where is that min() isn't allowed.

me thinks its a groupwise max miss understanding
do you want min date or a range of dates

i need the minimum date. basically this is a list of transactions, and i want to get the first order date of each customer as long as they fall within the date range. if i do having without the group by, i get good info, but it's not summarized. i need the summary of what the having returns. i
suppose if i can't do this in the query, i can build the summary in perl easily enough.

groupwise max

http://jan.kneschke.de/projects/mysql/groupwise-max/ http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html

i'm reading through that but so far don't see how to make it apply here.

you want min instead of max, same problem though

Is there a recommended maximum size of a table? I have a table that might end up being 7-8GB. Is this too much for MySQL to handle? I can break this table into smaller sets of data if necessary.

people are working with much larger tables

archivist, great.. I figured as much, but just wanted to make sure.

It could be beneficial to separate out the data. It depends on what kind of queries you run.

hello
if i execute a 'set character set' query in one connection, would it affect another ?
i mean php scripts

maybe if you are using persistent db connections

can anyone see what the syntax error is in this? INSERT INTO images ("imageindex","manufacturer","keywords","image","thumbimage") VALUES ("","130","130","/images/130-Nexus_NEX-G_Chair.jpg","/images/thumbnails/T130-Nexus_NEX-G_Chair.jpg");

your columns are quoted.

aaargh
lol

trying to recover mysql from a power failure here - i've determined which tables are corrupt with mysqlcheck

thanks pb_werkin

do i just drop the old tables and "mysql -u -p database database_backup.sql" ?

haha!

hehe
only 95% of the mirrors

what does it offer?

Lesons - Lessons?
Or is that some sort of UK humor????

k, that max groupwise doesn't fit my situation perfectly, but it gave me an idea how to make it work. i can query the having results into a temporary table then select the groups from that. i can live with that, but i'll probably still see if i can figure out a single select
method.

er where?

Topic

seekwill dunno who added that

I thought it said archivist…

that was an update to beta version no

Over the river and through the woods.

and under the bridge by the stream
hmm grep the log to see who added it

here

Awww!
No sense of humor allowed anymore?

ergh, did I remove that too?
dang

gotta have that

apparently my UC slides have been on del.icio.us frontpage.
34k downloads in single day

hah
and domas

thats Therion

We all know that

Oh wait, reflex

more general question. i've been running 4.1.10 on centOS, overdue for an upgrade. any concerns or gotchas upgrading with the latest GA rpms? (doing a backup first, of course.)

Using a CentOS package?

the 4.1 was installed from the packages at mysql.com, not from the centOS dist.

see upgrading docs, for issues

hey. is there a way to tell if an UPDATE *actually* altered a record?
row_id: 123, col_name: foo, col_descr: hello world
if i run UPDATE table_foo SET col_name = 'foo', col_descr = 'hello world' WHERE row_id = 123
is there a way to tell that nothing actually got changed?

yes

or vice versa, that a change actually occurred?
archivist, cool, how?

!man information functions

see http://dev.mysql.com/doc/refman/5.0/en/information-functions.html

If you used the command line client…

SELECT ROW_COUNT()

!php mysql_affected_rows

int mysql_affected_rows ( resource link_identifier ) Get number of affected rows in previous MySQL operation http://php.net/mysql_affected_rows

huh… ok so if nothing *actually* changed… that value will be 0?
i knew about that function. i guess i just didn't realize it was "smart" enough to report that

who knows something about xampp and mysql under linux?

PetarM, the people in #xampp do

thanks

archivist, ok cool, yeah that page explains it clear as day thanks

Hi everyone, I have a fairly large table with a unique column. When I update a record, it takes about a second, but I'm looking to get the time down even further. Is there a better query than update table set xxx=xxx where uniquecol=xxx?

nope, updates should be fast with that one

just seems like it has to scan through the entire table to find what it's looking for
would limit=1 be of any benefit?

well, is that uniquecol indexed ?

I'm trying to perform a full text search on two tables (news and comments), but I don't know how to structure my query to retrieve the results from both tables in order of relevance

as in, did you specify, that it is unique?

domas, yes
actually, i haven't created the unique column yet but am planning on doing so
it's slow the way it is now
would a unique column speed it up appreciably?

well, an index on it - of course.

i have something like update table set xxx=xxx where a=b and c=d

have an index on (a,c)
or (c,a)

like two indexes?

like index on two columns

do both have to be unique

whatever. sleep.

With index(), there's no unique constraint. If you do UNIQUE(a, c), then the combination of a and c must be unique (a could repeat, and c could repeat, but not the same a-c pair)

snoyes, i think that's what i want, the unique(a,c)
because there are multiple a's and c's, but only one a and c
and that would be quicker than using "where" with both columns?

You would still need to use the where clause. It just makes the query go faster.
Just like looking in the index of a book is faster than going through every page and searching for a particular word.

alter table xxx add unique (a,c) ?

yep. If it's a big table, that might take a little while.

i'm going to try it right now

There's chocolate in my peanut butter!

so would my queries then still be the same?

yes

i have some duplicated
damn it

dupes

find them with select count(dupefield) as qty,otherfields from table group by dupefield having qty 1

delete dupes

If you have a unique ID and the name may contain duplicates then DELETE t1 FROM table1 t1 JOIN table1 t2 ON t1.idt2.id AND t1.name=t2.name if you have other fields that need to be taken into consideration extend the join as needed

quietly erasing those

alter ignore table will do that for you.

what happens to the dupes then
283506 rows, whew

is there a way to replace each space in a row with a %20

they get quiely erased.

i have some urls in a row

is describe table supposed to show that it's unique?

SET field = REPLACE(field, ' ', '%20')

thx

(in an UPDATE statement)

thx thx

i see key is "MUL" for userid, but not the other column

use SHOW CREATE TABLE

UNIQUE KEY `userid` (`userid`,`letterid`)
suppose that's right. not sure if it's speeding up at all

Use EXPLAIN on the query to see how it goes

oooh i take that back
the query takes 0.00 secs now
wow!
where do i put the explain though just for kicks?

!man explain

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

oh, the select doesnt go slow, its the update

How can I perform a full text search on two tables for the same term in one query, so that the result set is returned together?

well thanks for your help guys, everything is a lot smoother now!
bye!

will this work?
UPDATE legacy_url REPLACE(legacy_url, ' ', '%20') FROM `layouts_legacygraphic`

once you get the syntax right, yes.
!man update syntax

in mysql can I create a index of a varchar 55 field ?

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

sure

hi

why do i need the set snoyes

because that's the way the syntax is written.

I have a very quick question. I need to perform 2 SET operations in one go. is there any way to do this? I've tried for example: UPDATE pages SET homepage='0' WHERE homepage='1' AND SET homepage='1' WHERE id='8' . But this doesn't work?

UPDATE pages SET homepage = CASE id WHEN 1 THEN 0 WHEN 8 THEN 1 ELSE homepage;
or possiblly UPDATE pages SET homepage = CASE WHEN homepage = 1 THEN 0 WHEN id = 8 THEN 1 ELSE homepage; If that's what you were after.

ok I think I understand most of that except for the last bit, what is the "ELSE homepage" bit doing?

setting the value back to itself if neither of the conditions match

ok cool thanks :-)
and do both ways do the same thing? (just wondering in particular about the 'id' bit?)

The first tests the current value of id for 1 or 8. The second tests the value of homepage for 1, or id for 8, which is what you said, but I wasn't sure if it's what you really meant.

sorry yeh that's what I meant, getting a little confused, ok I got it :-)

i cant figure out why this is wrong
UPDATE layouts_legacygraphic SET REPLACE(legacy_url, ' ', '%20')
lookeda thte syntax for update

UPDATE table SET field = REPLACE(field, …
I forgot to put the END on the examples shown. Check the manual for the full syntax.
http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html#function_case
stupid tab completetion. Sorry maxkelley. maxo, for you ^

ok thanks :-)

thx snyoes

hi

hey… so i've got this situation where i've got an M:M relation ship, a user relates to all the states/provinces he covers
pretend it's for a sherpa web app, a sherpa can lead you on a trek through e.g. Colorado, The Yukon Territory or Virginia
i'm looking at the current implementation of this system and i'm thinking it's really pretty dumb. right now it's doing a shit load of logic processing to "figure out" which states to delete… seems to me it would be just as if not more effective to simply delete all the users states and then
re-insert the new dataset…

SELECT sherpaName FROM sherpas JOIN sherpaLocations USING (sherpaId) JOIN locations USING (locationId) WHERE locationName = 'Mt Everest'

does that make sense?

hi
i have problem

snoyes, you didn't see my actual question/scenario yet ^^
kibibyte, i have a nuclear device
kibibyte, what's your point?

I still don't see your actual question.

i set Host column in mysql table to * and i cannot login as root how to fix it

snoyes, i know how to setup the M:M tables and do the joins and whatnot

!tell kibibyte about reset root

kibibyte See http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

snoyes, for updating what states a user covers, is it any less effecient to simply delete all the states and then insert the new dataset than it is to "figure out" programatically which old states need to be deleted and which new states need to be added

Do that, put instead of changing the password, issue FLUSH PRIVILEGES; GRANT ALL ON *.* TO 'root'@'localhost'

snoyes, right now the program is doing the latter

i have 2 server with differents databases, can i sync the 2 servers ? ie : the 2 servers have all the database : their bases and the bases synced from the other
is it possible ?

snoyes, seems highly inefficient to me, at least from a code maintenance and obfuscation perspective

Depends on how many states and people there are.
!tell Sp4rKy about toolkit

Sp4rKy xaprb's MySQL Toolkit (http://sourceforge.net/projects/mysqltoolkit/) includes tools to compare databases across servers (such as master to slave) and bring them back into sync, profile queries, and other handy features.

snoyes, erm… well, there are about 100 "states" or regions that a sherpa can cover, and about 25,000 users
snoyes, however we have a restriction in place where if a user selects "all states" we actually store "no states"
snoyes, because for our programatic purposes the two are equivalent… e.g. to our users, them not specifying a state is equivalent to saying they cover all states
snoyes, i'm pretty sure we have indexes on the lookup table, at least i sure as hell hope so

but can they do 'crossed' sync ?

snoyes, so, worst case scenario, someone is going to be deleting 99 records, and my guess is it will be rare that they check "all but one" state

That's known as master-master replication. Yes, doable.
!man replication

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

k
i llok at this
thx

snoyes, so… any thoughts on this?

how do I limit the the amount of results returned by mysql ?
I tried top 100 and that doesnt work

LIMIT

m308, with LIMIT
!man limit

see http://dev.mysql.com/doc/refman/5.0/en/information-functions.html

Or just select the rows you actually want to show.
(if you're not intentionally trying to do "pagination" with them)

I can't guess which will be easier for your application. If you can drop and reload, fine.

mm-mysql, erm… yeah, what if the rows you actually want to show happen to be 10,000 of them

snoyes, i did but still i have * in Host field
how to change it

snoyes, why not? i mean. i'm just talking really basically from a code maintenance perspective. i mean think about it. A) programatically identify "rows that need deletion" *and* "rows that need insertion" and then delete and insert as appropriate or B) I. run a delete query II. run a foreach
on the $_POST['states'] array

snoyes, i guarantee option B is way easier from a coding perspective, i just wanna know if you think option B has any possible technical flaws
snoyes, is there any reason you can think of immediately that would either cause a major slow down in performance or be prone to error… i can't
archivist, have you any input on the matter?

I don't know of any problems. We use that approach in some areas on our site.
The only issues we had were when some genius used GET insead of POST and overran the allowed query string length.

When I have a FK that can be 'empty' … or the relation is optional, should I set " NULL " or " NOT NULL Default '' " ?

snoyes, ok cool, thanks. that's all i wanted to know. just basically looking for confirmation that it's not a retarded idea, and i don't think it is

If you can't log in, then you need to use the link shown to skip the grant tables. Once there, you can recreate the root user for localhost, or you could edit the table directly and change the * back to localhost.

ok i used –skip-grant-tables and it works
:P

lo all
anyone around?

NO

when you insert some information into a table, is there a quick way of returning the autonumber it was assigned?

!man last_insert_id

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

!man information functions

see http://dev.mysql.com/doc/refman/5.0/en/information-functions.html

"What if someone else inserts before I get to read it?" gausie asks next.
autoincrement

http://hashmysql.org/index.php?title=Autoincrement_FAQ

ohmygod snoyes is a psychic

!php mysql_insert_id

int mysql_insert_id ( resource link_identifier ) Get the ID generated from the previous INSERT operation http://php.net/mysql_insert_id

how can i use it in another INSERT query
so i want to insert something

just like you would any other function.

im not sure how
i insert something in one table, then something else in a second table. the second thing needs to contain the first's "SELECT LAST_INSERT_ID()". how do i do it?
oh ok ill just use mysql_insert_id
thanks

INSERT INTO secondTable VALUES (LAST_INSERT_ID());

So, I'm trying to migrate a 300M database, I made a dump and when I try to reinstantiate it it complains of a syntax error.

is there a way to do a bulk insert?

It says there's a syntax error on the first line .. Which is a comment ..

or do i just have to run a bunch of inserts?

The engine now detects incorrect comments. That's a feature.

LOAD DATA INFILE

snoyes, can i do that from PHP?
snoyes, is there a man page for that?

Xgc, will it stop the migration though? Because that happened after it had done a load of work.

Inappropriate comments in poor taste, or just bad syntax?
!man load data infile

see http://dev.mysql.com/doc/refman/5.0/en/load-data.html

Bad taste.

SHOW VARIABLES LIKE 'thicker_skin';

hmm shall have to grep the source

hey guys… I'm looking through the docs, but am not seeing the answer… let's say I were selecting a series of posts on a multi-author blog: how would I limit it to one (or two) post(s) per author in the same select statement?

what about doing a select statement that will return multiple rows and then using INSERT SELECT
but just doing the SELECT statement with literals

What about it?

snoyes, would that work for a "bulk insert" and how would i get a select statement to return multiple rows given a list of numbers

I'm unsure why you'd want to do that.

snoyes, as in i have a PHP array, i can build a comma separated list, or whatever… how could i get a multiple-record result set out of that and use it to INSERT
snoyes, dunno, just figure it might be faster than making anywhere between 1 and 99 separate INSERT queries with PHP
snoyes, then again maybe 99 INSERT queries is rather negligible (that's about the most that will ever occur at any given time

Well, you can do them all at once with an extended insert. INSERT INTO table VALUES (a, b), (c, d), (e, f)

ahhhh, great, thanks that's more along the lines of what i was looking for
INSERT table (foo, bar) VALUES (a, b), (c, d)
snoyes, yes no?

always

k

From a question asked yesterday: http://rafb.net/p/E2bG9j59.html
It slightly more complex, but you might find it helpful.

thanks, I'll give it a look

Slightly simpler from a question asked last year: http://rafb.net/p/g5WFhm39.html
That
That'll be easier for you to ahndle.

it is indeed. gracias

You're welcome.
There's a little (unnecessary) mysql cheating going on in that last one.

ok, now what about figuring out if a data set (a, b, c, d) is NOT the same as another data set, e.g. smaller or larger (a, b) or (a, b, c, d, e, f, g)
i just want the boolean result… whether or not data set A is the same as data set B

SELECT (a, b, c, d) = (a, b, c, d, e);

i've got data set A existing in the form of multiple rows in a M:M lookup table, and i've got data set B existing in the form of an array in PHP, which i can convert into any format
snoyes, aha! perfect. i was wracking my head to think of some massive LEFT JOIN or something to do that. classic case of overthinking the problem
lol

haha, I was typing out a LEFT JOIN answer

snoyes, hmm… well ok thing is though, remember the form of the data is a factor though

that is a row by row comparison. If you need full sets, you'll have to go with a join and count the results where the join failed

snoyes, i would need to be able to "select" the data set from table A into a comma delimited list
snoyes, data set B can easily be (and already has been) made into a comma delimited list via PHP

Well, you could do that. How big it the array?

select fields from (set A) LEFT JOIN (set B) on conditions where set_B_key IS NULL

snoyes, as i said, max size for either one is going to be approx 100 vals

You could select the values from MySQL, put it in an array, and use PHP to compare the arrays.

snoyes, yeah i'm trying to avoid that
snoyes, well i would prefer to avoid that…

You could calculate the MD5() of both sets of data and compare those two.
You could just compare a delimited list, as you said.

snoyes, hmmm… i suppose that's an option, as in SELECT MD5(SUM(column))
snoyes, the issue is getting the rows in table A into a "delimited" list format just using SQL

I'd do MD5(GROUP_CONCAT(column))

snoyes, ahhh right, yeah that'd be better
snoyes, only thing is i don't have any way of knowing if the concat order for the DB would be the same as for the arryay given to me by PHP

or skip the MD5, for such a small value.
make it the same order then.

group_concat supports a sort I think

though, actually i suppose i could array sort and ORDER BY

GROUP_CONCAT supports a sort, and it's easy to sort an array in PHP

indeed

how would I select all the results with a distinct or unique title ?
ie no dupes

hmmm… yeah i think that's the best idea so far is the concatenation idea

SELECT DISTINCT title FROM table

inviso, problem is i need to know either way, i need to know if it doesn't exist in B *or* if it doesn't exist in A
inviso, i just need to know if they're different
!man group concat

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

Do you want to suppress those that have duplicates or only show the distinct list of all titles?

erm, that doesn't seem quite right

!man group_concat

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

yeah, you'd have to union the two directions to do it that way and I didn't realize you were working with row sets. What snoyes already came up with is simpler

distinct list of titles

thanks

See snoyes comment.

the mysql documentation sucks

I think the documentation is great, but the search sucks.

its easier to just simply say, "group by title"
the site looks like shit and is organized poorly
is there a multiple group by ?
rather group only if all 3 values match ?

GROUP BY title, author, isbn

ty

Is there an application out there to help assist in setting up dozens of databases for replication ?

dozens?
use postgres?
with pgcluster

As in creating new databases, or as in copying them to another server to begin replicating?

sorry mysql guys.. mysql cluster isnt ready.. and replication is crap

yes dozens
and no i am not going to use postgres
as in the entire process to get replication going

is there some way to clone a row minus its key?

But are you asking about existing databases, so you just need to copy them to a slave, or you want something to create a bunch of dbs first?

blobaugh|ct, select… insert?

i am hoping there is an easier answer

just copying already existsing ones to the slave.

mysqldump | mysql -h address.of.slaves
!man replication

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

blobaugh|ct, what were you expecting? i dont know of an easier way

im not really expecting there to be an easier way. just thought i would ask to see if anyone knew
would for sure if there was

!man insert-select

see http://dev.mysql.com/doc/refman/5.0/en/insert-select.html

That's about the best you'll get.

i thought so

blobaugh|ct, not sure if you know about this.. but when i say select… insert… its all one command
blobaugh|ct, look at the docs about it

There are other ways to do it, I don't know that I'd call them easier.

yes i know how to do that HAIDEN

ok cool

this is gonna be ugly. there are a ton of columns. good thing my programming can handle it after the initial query it built

You can use the information_schema to generate it for you.
SELECT CONCAT('INSERT INTO table SELECT ', GROUP_CONCAT(column_name), ' FROM table') FROM information_schema.columns WHERE table_name = 'table' AND column_name != 'id';

hey all… I found a bug in MySQL, I need someone to confirm it. I'm selecting from a view using the full namespace and it tells me "Incorrect table name" — query follows

Impossible. There are no bugs in MySQL. The code is perfect.

select database.table.field from database.table where id = '123456';

if i want to move a column from after a column to before a column, how would i do that?

!man alter table

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

however if I use select table.field from database.table where id = '123456'; it works

But remember, it should much matter what order the field is in.

do i have to alter table tblname change col col varchar(30) after col2;

yeah, or use modify instead of change so you don't have to list the name again.

i'm trying to load data into a table that i created

works fine here (5.0.42)

I'm on 5.0.19
are you selecting form a view?

yes

odd
any recommendations then?

http://rafb.net/p/uPvyUO75.html (example)

Is that query you show the view definition, or how you're selecting from the view?

that query is selecting from the view
the view definition is quite large

I win jcornelius, http://bugs.mysql.com/bug.php?id=18444
In other words, keep mysql up to date

hello!

And if that isn't the exact bug, I still suggest you upgrade to 5.0.23 as it may have been fixed in the same patch
err, .25 that is

does a view qualify as a stored function?

No, but it's possible that the same bug caused both.

yup

quoting the bug comments "It seems that you can work around this bug by fully
qualifying not only the name for the stored function but also the name for all tables
involved in the query"

and you're way behind anyway

that's actually the opposite of my issue

views in old 5.0 were quite buggy
some issues with indexes &c

it fails when I *have* fully qualified the tables

you probably want to upgrade anyway

Well, given that someone on a newer version of 5.0 is not having the same problem and you're on a very old version of 5.0..

yea I'll try the upgrade first…. and report my findings

I'd like to give question. I don't understand why mysql return me difference values? website: http://pastebin.com/m5d9cb92d

thx all

snoyes, will that actually work?

Why wouldn't it?

*shrugs*
guess it would

in both examples there is article 0002 have different values - question: why?

MySQL is generous in allowing you to put fields in the SELECT list that aren't in the GROUP BY and aren't aggregate functions (SUM, for example). However, it won't guarantee which row you get in that case.
groupwise max

http://jan.kneschke.de/projects/mysql/groupwise-max/ http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html

There's a variety of implementations and discussion there.

wrr in article 0001 of course has dealer = B, on second dealer = A
ok, I'll read it
but its strange
you suggest that I have don't use it ?

Not really. Try doing it by hand - take the table and put it into groups by article id. Now, if I say which is the dealer for article 1, which one would you give me?

ok, I'll test it

To put it another way, consider that the various fields in the SELECT list are independent of each other. Now, imagine you'd done just SELECT article, dealer FROM show GROUP BY article. Why should one particular dealer appear over another?

is there a way to execute a query that selects everything EXCEPT a list of columns that arent needed?

sorry, but I don't understand what do you say
did you say

Only by selecting all those that are needed.

why there are independent ?

Although you can build such a query using the information_schema.

darn

Because they are. SELECT a, b, c, d - none of those fields affect any of the others.
SELECT CONCAT('SELECT ', GROUP_CONCAT(column_name), ' FROM table') FROM information_schema.columns WHERE table_name = 'table' AND column_name != 'id';

can 'id' be multiple tables?

if you change it to AND column_name NOT IN ('id', 'other', 'tables', 'here')
You can take the result of that query and pipe it back to mysql if using the command line client. Or you can store it in a variable and make it into a prepared statement from within a stored procedure. Or you can just use it as the sql string for your next call to mysql_query if from within some
application.
However…
evil

ok, thx

evil is clearly defined at http://www.parseerror.com/sql/select*isevil.html

The same arguments apply ^

gnome-term

heh
http://ebergen.net/doc/select_star.php

wow, the linux version of mysql-query-browser has problems
i think this may be easier to just build the query in php
ui think this may be easier to just build the query in php/u

can anyone help me give access to I can use the MySQL Admin client to connect to the server?

Can anyoen give me some reason why to upgrade from mysql 4.1.2 to 5.0? trying to convince boss

snoyes, can i not do a nested query like SELECT `Field` FROM (DESCRIBE tablename);
mugger, I believe my biggest frustration with 4.1 is that there is no innodb support, but that could just be my server

not from describe. you could from a subquery against the information schema.

oh ok

4.1 supports innodb
mugger send him the change list for 4.1 after .2

ok so whats wrong with our host then :|

can anyone help me give access to I can use the MySQL GUI Admin client to connect to the server?

you're kidding, right?
or did i just badly misread that?

what
|__rb___|, give you access to one of our servers?

NO!

hey take it easy

ya, give me access to your server

lulz

is that a question

im trying to figure out your question

I need help using the Mysql GUI

ok i use it to, what is the problem

I can use it to connect to one of my server
it says permission denied, I know I have to give permission from whatever IP im' coming from
just don't know how sorry guys I'm sure you can tell I'm a newby in mysql

!man grant

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

kewl, thanks, and I you wanna give me permission to your server, that's fine too

ping

I used to play tournaments. Haven't done that in a few years.

hah
you referred me to http://rafb.net/p/g5WFhm39.html before, and that was definitely helpful, but I have a follow-up … is there a way to make the count go in the opposite direction?

how do i compare two tables to see which column value is not common between the two?

Ping Pong is a very fast sport.
ORDER BY usually works.
He ran away.

good god
there's no information_schema on our host database

because it's 4.1?

i have no idea
its 4.1.22

there ya go

ugh so i'll have to use describe and then some sort of foreach statement in php to exclude certain fields from a query
i hate my host

dumbshoes!

can mysql change data with a regex similar to preg_replace in php? im looking at the regexp page, and im not quite sure. looks like now?

better not, it would generate ginormous queries

blobaugh|ct no

hot damn, 45 is GA
woot, bug fix reading time

ok, read the guide, too complicated, anyone with easier exmaple,

hi

can i restrict SHOW COLUMNS with a regular expression?

I have a set of data I am trying to put in a mysql database. The dataset is very large (~8 gigs). What would be the best way to format the inserts? INSERT INTO table VALUES (data row), (data row), etc.. or a ton of full insert commands?

multiple at a time , put indexes on afterwards for more speed

archivist, is there any limitation on how many I can put in one insert command?

I go upto max packet

in 5.0+ you could do some information schema query

where can I see what my max packet setting is?

it's arjen!

show variables

litheum, our crappy host only has 4.1.22

http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html

thanks archivist. got it.

cool, wasted a couple hours on this now
i just need to select all fields except for a provided list of exceptions

is it possible to move a database from one server to another?

depends normally yes.
mysqldump might be your friend, with a lot of data you might prefer to do it on filesystem level

how do you recommend me to do it? I just have to move my mediawiki db from this pc to another
oh, ok
thanks

mysqldump abopedia; return an error

it's a standalone tool, you invoke it from your normal shell

nils_ no sorry, yes I know realize

archivist, if I incrase the max_allowed_packet, should I also increase the bulk_insert_buffer_size?

i need help optimizing a query in mysql 4.1
i let it run for like 45 minutes while i went to get lunch and it still had not completed
and its a monster of a machine
i think it has something to do with subqueries

explain select distinct(account) from accountlog where ipaddress = any ( select distinct(ipaddress) from accountlog where account like 'ajaxstaff' );

well, - the explain
essentially, this table is a log of all account logins
i want to pull all the ipaddresses that were used to login to ajaxstaff and see what other accounts they logged into
theres only 438k rows
if i do a user with 1 ip address and use = instead of = any it takes .83 seconds
so id figure even with no optimization at all
the worst it could take would be .83 * number of ip addresses
which in the case of ajaxstaff is 22

Mark`: try this - explain select distinct(account) from accountlog as a1, accountlog as a2 where a1.ipaddress = a2.ipaddress and a1.account = 'ajaxstaff'

okay
i mean theoretically the subquery should be faster right? but i guess i cant complain if im not using 5.x

I've found them to be slower in most cases

well
i think your example worked perfectly
thank you very very much 3

excellent

i didnt know you could join the same table

aytime
*anytime
I only recently discovered how to do it properly

im not really a mysql guy, i just put all our logging in mysql to avoid the disk io for local file writes
ahh
only takes 15 seconds too
much better than i though
t

nice

Hello.
To disable binary loggin I edited /etc/mysql/my.cnf and commented out the lines about log_bin, expire_logs_days and max_binlog_size. Was that the right thing to do or did I do something stupid?

why disable it? it is important for recovery

hmmm
I only thought they were used to replicate the db from a master to a slave
I only thought they were used to replicate the db from a master to a slave

also, put it on a separate disk, so that you can recover data if disk crash

heh

I can't do that. It is a remote VPS

they are only required for replication
if you want to do some kind of point in time recovery you can use them for that but mysql can function with them turned off

They may be needed if MySQL crashes for example?

no
they won't be needed for that

From what I saw it records every query executed

the iblog files are used if mysql+innodb crashes

Where are those files located?

the iblog files?

If you know.
Yes.

typically in the datadir
they have nothing to do with the binary log
or log-bin
they are innodb specific

So I'm cool then? :P

um sure

um?

ask seekwill

summon seekwill

If you are there and see this, is it safe to disable binary logging?

it's safe

ok thanks ebergen ^-^
I'm curious if disabling binlogs boosts performance Lets do some stress tests :P
Hmmm.. same performance

hi
what should i put on the default of a datime field for it to be the date at the moment of the insertion?

you cannot. change the type to timestamp.

oh ok, then i can put now() ?

you cannot use funtions for default values. the timestamp data type will automatically insert the current date and time on insert and update. read the manual on its use.
byou cannot use funtions for default values. the timestamp data type will automatically insert the current date and time on insert and update. read the manual on its use./b

Comments

In a client-server architecture where everything the passed over the network is serialized and there is a common

And apparently one person still in the 1.3.x neighborhood.

most windows users will even use java6 due to auto-updates

morning

yo

how's it going

hi jottinger

just had a massive lunch. feeling tired

what's the good word?

there are no good words, they're all bad

forever the optimist

don't you deal in words?

yes. That's how I know.

you thinking of microsoft

lol

hi jottinger

hey

anyone here use compiz/beryl and swing apps?

hows it going!
~tell man_in_ltop about anyone

man_in_ltop, 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.

where would you store an image?

for what?

for storage, no doubt

I need to store it in an object, what type should it have?

so, does anyone know why some, but not all, SWING apps don't render when using compiz/beryl as window manager?

store it in an object?
Why not use a BufferedImage?

then my object will have bufferedimage

yay!

heh, amazing, isn't it

surprising, considering the advice
normally, given "use bufferedimage" people would say "so I'll use an org.w3c.Document!"
the response to that, past "you're an idiot" would be "so at least use CDATA" and the Document-user's response to THAT would be "no, I'll just use ints to represent each byte"
so a 2k image would end up taking 468k of XML, and ungodly amounts of RAM
ah, good times, good times.

how would i go about limiting access to a servlet of mine if the request didn't come from an applet that originally came from the same machine as the servlet is on?

but BufferedImage ctor requires width/height.. and i'm getting the image host from http i only know its length..

I'm just lucky I have so much faith in humanity.
so use Image instead.

aight

the request object has the remote user's IP

jottinger, is there a way to check where the applet came from though?
jottinger, is there a way to check where the applet came from though?
jottinger, im sorry man

the request object has the remote user's IP

jottinger, how does that inform me where the applet came from?

jottinger, this is an applet that gets downloaded to the client

jottinger, Image is abstract hmm.. i'm getting the image from an inputstream (from http)

jottinger, so the remote ip would be the person behind the browser right?

the applet, if it communicates with a servlet, does so via a request object… to the servlet
so the servlet host gets a request that has… wait for it… the remote user's IP

Content-Length 922040
Content-Disposition attachment; filename="SLP2007081213_001.jpg"
like this.

jottinger, ok i understand that, but how does the remote users id help in letting me know if the applet originally came from my server or not?

I really think I need to hop off of IRC for a few minutes… I told my son yesterday that I was stupidity-intolerant and I need to back that up with actions.

jottinger, hope he doesn't take that the wrong way haha

you do understand that you said you wanted to restrict access to the servlet to applets that had downloaded it, right?
If he's not smart enough to take it the right way, tough.
s/it/from the same server hosting as the servlet/

jottinger, percisely

so… the servlet knows what server it's on. The applet tells the servlet where IT was from; when the applet is downloaded, NOTE THE REMOTE USER'S IP. Then match the remote static ip hosting from the applet to that list.
I typed that really slowly so you might understand it.
if that's insulting, ask me if I care… I've told you at least three times already. Maybe more, but I can't be bothered to count.

does anyone here ever have used Sun's SyndFeed for RSS??

You mean, from Rome?

jottinger, assuming someone runs with something your saying is not telling them three times, i believe what you just said is the only thing that fits what i asked, and thank you for that

Rome != Sun's… even though Rome is run by Sun employees
I gave you the information you needed. Remember "the servlet gets the remote IP"?
That's the water. I led you - the horse - to it.

hibernate noob .. http://pastebin.com/d4f1f026c if anyone got the time, can you tell me why only the parents are getting persisted and not the children ?

are the children mapped, CyTG?

autogen' reversed with myeclipse .. so they should be yes

are you persisting them specifically?

dont know ? i just attach them to the paret Test2 and does a save on that .. shouldt that persist the whole structure including children ?

session.save(test3) in the for() block
no

no ??

no

oh my goodness
so you're telling me i have to persist the parent first, and then the children one by one ?

why? If you want it to walk the tree entirely, then you need to use an OODBMS
no, you can persist the children first and then the parent
unless the children rely on the parent existing

they do .. constrained in the database

Or you have the cascade rules set up.

read the docs. and use a transaction.

i am using a tx .. allrighty

(set up so that they do so)

why do your children have a ref to the parent?

i did read the docs .. found some comments with someone having a similar issue as me, wich is why i was pretty much aligned with the thought of persisting the parent would automaticly traverse the structure ..
jottinger ask myeclipse.hibernateperspective.reverseengineer .. they just do..

well, modify your mapping if you can, unless you really do tend to get the children and then look up the parent

http://forum.hibernate.org/viewtopic.php?t=956859 … this dude is apparently persisting children with a save on the parent ..

maybe his mapping is set up differently then.
I dunno… JPA tends to want you to save each mapped entity.

maybe .. allrighty .. ill look into the mapping .. id just rather not touch that since its autogenerated .. you know, next time theres a change in the database i either do it manually or reverse and apply "patches" ..
okay thx .. ill look into it..

With my limited knowledge of JPA it seems that saving our parent with hopes of it saving yoru children states as well would be problematic. And it would be best to save each node as you go.

is there a servlet or anything invoked when just a static html file is requested in a tomcat server?

no.

jottinger, may i ask then, how I could store a user ip without anything knowing about the applet being downloaded?

you can, however, set up a servlet filter, which WILL catch html references.

jottinger, ah ok, but isn't that a "servlet" filter?

you could also use JSP if you wanted to, instead of an .html file, but that'd be dumb.

jottinger, i agree

that would fall under the "or anything" category, assuming you set it up.

ok cool thanks

golly, school just started up again, didn't it

what happens if a Thread waiting for input from a server is not the active thread when input is sent from the server
uwhat happens if a Thread waiting for input from a server is not the active thread when input is sent from the server/u

why don't you A) try it and B) be silent… YOU'RE THE MIME FOR GOD'S SAKE

lol

well my client isn't recieving some messages, so i was wondering if that was a possibilty, or if its a problem server-side

chances are it's the server-side problem.
That, or Java has a bug!

what kind of input?

I'm apparently not in a good non-sarcastic, non-cynical mood today.
I blame you

input coming in over a socket should be queued by the OS
(if nobody immediately reads it)

I'm pretty sure I'm being punished for my sins today
Well, I'll show you, God!

Dunno who has been punishing me, but someone certainly has.. I've been fixing bugs in vb6 stuff the whole day

it's karmic retribution for not using any vowels in your nick.

im glad i did not get put on that project here at my company =\

going for the new job, then?
8^)=

I originated in a nick-length challanged network ,)

well im hoping i here back from them soon

ah. those bastards.

yay, undernet!

vb6, unlucky
i've been writing Pro*C all morning

my web hosting company is in a hiring freeze atm so even if i get the promotion i wont get the raise/promotion until after the legislation decides what they are doing…

I miss Pro-C

on the upside, I never have any problems with people taking my nick, or someone else having registered it elsewhere ,)

'morning

but I wonder if my Pro-C experience is different than what other people mean
I never had that problem once I switched from icarus to Epesh
I guess using a mis-spelled hebrew word is good for nics
plus, people were afraid

heh
baaaaaaa

baaaaaa
I miss that from ricky

wtf for?
8^)=

it may have been stupid but it was probably the most intelligent thing he ever said

well, it would have been pretty easy to spot someone trying to impersonate you..

where is ricky?

yes, spot the crowd… people wouldn't have run away quite so fast
not here
and that's gooooood

jottinger, what about sending the results of getDocumentBase() ahead of the request the applet will be making to check that document base is served from the server? is there a hole with that?

very very very good

hahaha
the applet can only communicate with the hostname from which it's downloaded
that's the applet sandbox

~tell gaillard_ about applets

gaillard_, Check the topic, read the Wiki… Essentially we try to avoid them

cheeser, figured you would do that eventually

it's what i do.
8^)=

~be jottinger

Everybody dies, and that's GOOOOD.

~be cheeser

I guess the factoid 'e cheeser' might be appropriate:
8^]=

~forget e cheeser

I forgot about e cheeser, cheeser.

hahahaha

8^)=

jottinger, i know that, but i am only trying to make sure that someone can't access the servlet that is not from that applet

yes…
but you see, THAT'S WHERE YOUR SERVER CODE COMES IN.
in fact, if you want to be truly clever, use your filter to do that… by only invoking the servlet if the session has downloaded the applet.

code? what?

But ignore that, you're not ready.
if you try to do that, you'll ask me more stuff and I don't want you to.

jottinger, why are you hear then, people come here to ask questions
here*

I'm here to learn.

not teach?

no.

help i mean*

well i appreciate the help, but don't complain if your helping and you don't want to, you don't have to obviously

I mean, what the hell do I get out of teaching or helping

jottinger, all about "getting" are you?

lets talk about the knapsack problem or solving world hunger!

Teh Warm Fuzzees [tm]!!!

a warm fuzzy glow?
lol

yes. I want to get a programming culture around java host that's competent.

gaillard_, i have an interesting project to work on
could you help me?

That's what I want. That's what will satisfy me.

andresgr, i could try
jottinger, if you don't care what others want, i doubt they will care about your interest

competent java programmers? for shame

… unless what I want is to the advantage of those from whom I want it.

jottinger, i doubt this would be the case

… in which case, actively denying my desire would be disdvantageous for the ones doing the denying.

jottinger, this is no business its just a chat channel

But that's what happens all the time anyway.
I think you fundamentally misunderstand what I want.

this is a chat channel occupied by those who are in business

what a surprise.

jottinger, i could care less, considering you could care less about what i want, see how that works?

*couldn't* care less
saying you could care less is meaningless and illiterate

but, see, I do care what you want… I just don't care to guide you step by step

cheeser, very good english major, english is not my concern

because that wastes my time and teaches you nothing

step by step
day by day

jottinger, perhaps
tmccrary, hahaha

what could make me feel this way

i actually have a bachelor's and a master's in CS and yet I still can speak coherently.

I don't have a degree at all and yet I can master grammer.

But you're one in a million baby
grammAr

it would seem so.

you lose

oops! I did it again!

i have a simple questing with a simple answer i am sure, no leading required, how do i check that a request is coming from an applet and not something else?

have you ever met me?

cheeser, how about that, but its still not a requirement.

no, but I want to. Oh boy do I want to

I disagree with your "no leading required"

cheeser, just call microsoft right now and you'll see what i mean

I gave you a huge pointer earlier and… you missed it

it shows intelligence, though. sounding dumb is … stupid.

I gave you another pointer… and you missed it

i probably would just append something to the URL. some token of some sort.

every time I've pointed you in the right direction, you've consistently missed it

i mean. i would if I just gave the problem a little thought.

I'm all about the enablement.
yeah, imagine that. a LITTLE thought.

jottinger, i don't see how ip's can indicate request from withinside an applet or not

tee hee hee

Point, match, me.

~spoonfeeding

Spoon-feed a newbie for a day and he will come back with more questions. Teach him how to find his own answers and he'll leave you alone.

nice

That's okay. You're complaining about other programmers being clueless. Right now, I'm beating salespeople over the head

i challenge what you said, ip has nothing to do whether its an applet or not

hahaha
~be jottinger

I hate you.

Yeah, salespeople are the bane of people would actually have brains within their head

~be jottinger

Darn you all to heck!

jottinger, have some pateince for those who know less, it will go a long way
patience*

you think I haven't shown you patience? Boy, you don't know what hotheadedness is.

cheeser, better cheeser?

What is this deal with an ip dictating whatsit?

he's trying to restrict access based on server *and* client
very very hard, you see

tmccrary, i just want to check if a request in a servlet came from an applet or not

well done! *golf clap*

This is for a security purpose? Not a good start

s/.[^\?]//

tmccrary, would you explain why? I can't read what i am to infer by not a good start
if the applet is sandboxed, what else matters from the servlet end besides stuff thats not from the applet?

The servlet knows nothing about the applet
the applet is on the client side

http://pastebin.com/d6e578f4a and a few more in a JFrame that is supposed to fake a machine where you pay with coins (€ is the Euro sign, in case you wonder) - I want the pay(amount) method to display the frame until the user has "paid" and then
close the frame and return whether the user paid or not (the default close operation is to just set the boolean wait to false) - can anybody tell me how to make this work? I
guess it would only be a minor change…

fuck!

I would but there is no girl around

tmccrary, i understand this, all i want to make sure is that the request was from an applet, thats all

Just add a URL parameter to the request and check if it's there. Make sure your applet doesn't include this

go gay
save the gene pool for others!

nah

This isn't a security feature, but it would let you change output on the servlet depending on the request

what would i not include it in my request from the applet, thats what i want to go through
i think it should be reversed then

could be, I don't fully understand what you're trying to do
either way though, that should give you the idea

tmccrary, ok thanks

heh
and an hour later…

if you are bored can you take a look at my problem please?

what means the 'RI' with 'JAX-WS 2.0 RI'

no

reference implementation

ahh 8)

friendly and helpful as always

more than you know.

what would cause the javadoc tool to blwo up on generic declarations?
1.4 jvm?


show an example

and today, i feel the pain i shall feel for the next year or two.
it's time to start looking at weblogic,and how to deploy this app into it.

bwahahaha

option = new HashMapString,String();

using the 1.4 JVM would indeed make that blow chunks

but i have it set for 1.5 compatability and eclipse is set to use the 1.5 jvm
so it baffles me, guess ill sift through this params
er these params rather

how to copy inputstream to outputstream? lol

read then write. duh.

true. ok.

problem solving skills++

lol

nah that's got nothing to do with problem solving =D
that's laziness by itself
=D

pure, unadulterated gitness. 8^)=

procrastination is the key to motivation

oh, shit! that's due in an hour?!? I haven't even started!

heh
when it came to cs projects i always finished days ahead of everyone else, but all my other classes i could care less

hey, it worked for me
I got lots of As in school by waiting until the night before to write term papers and stuff
bI got lots of As in school by waiting until the night before to write term papers and stuff/b

0 = MIS Student

I made a C on just about every paper I turned in during highschool and college, but I have written all my wifes papers and she always makes an A
its stupid

sounds like you need to switch to your wife's major.

…. no

what's her major?

she was chem, now shes ECE

heh, it's a whole new angle on cheating
maybe I'll get my wife a B.S. in compsci :P

what's ECE?

haha
early childhood ed
shes smart, 3.9 gpa, but she is the slowest typer in the world. So I will crunch out her papers and she fixes them

on the contrary - sounds like she needs the practice

she gonna be a teacher?

like the kids will know if she's typing correctly anyway

It sucks, you'll need to help her with C++ classes.

jott yeah

I remember taking C++ at the uni - we spent the whole semester learning about 1) the IDE and 2) streams

"once we sign volare i'll have control of the ballet and that spells cash with capital.." "K!" "you should really go back to school." "I *hated* teaching."

streams are such an *irrelevant* part of C++

hahahaha

8^)=
http://www.imdb.com/title/tt0103872/
remake of "A Night at the Opera"

someone on TSS said Coherence was "marginal"

must've been jesse

http://www.theserverside.com/news/thread.tss?thread_id=46552#237925
no

i should look at coherence

it's pretty good

we're eyeballing some scalability options here

what in hte hell is a data grid

depends on what you need though

distributed processing of *scads* of data.

so a cache then?

yeah, distributed and with some excellent config features

distributed cache

jottinger ?

how to write an outputstream to a file
damn i'm trying so hard

objectoutputstream
serialize the buggar

huh?

indeed

if you have an outputstream, you're already writing to something

hmm.

since you can't read from an outputstream, you can't write it to something else

i filled in the blanks hehe

you can wrap it

~tell b0r3d about io

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

b0r3d you wanna write an object to disc right ?

I already copied inputstream to outputstream but need now to output it to a file

then split the output into a file as well as the original target
b0r3d, uh
why did you copy the inputstream to an outputstream

proxy ?

damnit son do your homework. read that link

surely
we've all done that i suspect ..

no, I think he's just completely clueless

i think hes doing a lil proxy ..
useful for rippin of a protocol of sorts

hi all

i'm getting an image through an inputstream… I want the user to provide an outputstream (file or somth) so I write the image to it

so get the outputstream, and then write the image to it in a loop

is this channel for discuscion of web-development in java?

if the user wants it to go to a file, they'll give you a fileoutputstream

okai.. i was wrong

zipito_, maybe
depends on your question

the outputstream can be a file right?

I have a question about life-time of the servlet

oh geez

~tell b0r3d about javadoc OutputStream

b0r3d, please see java.io.OutputStream: http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html

look at the list of subclasses

alright
thanks man

after the user connected to servlet, would servlet hold in server memory the classes, used by servlet, between requests?

yes, classes loaded by a servlet will generally stay in memory until that servlet is undeployed

do you mean classes or instances?

dont confuse that with objects created inside the servlet's doGet

http://pastebin.com/d6e578f4a and a few more in a JFrame that is supposed to fake a machine where you pay with coins (€ is the Euro sign, in case you wonder) - I want the pay(amount) method to display the frame until the user has "paid" and then
close the frame and return whether the user paid or not (the default close operation is to just set the boolean wait to false) - can anybody tell me how to make this work? I
guess it would only be a minor change…

I mean instances

only if the servlet does something stupid to hold on to them
but you're smarter than that, right?

if you want to keep objects that you're user uses throughout his interaction with your webapp, store them in an HttpSession object

I want to make my servlet to hold the dbconnection with user supplied data

the servlet won't hold on to them, but they can be stored in a session

*your user

me and g[r]eek are copycats :P

me and whaley are… ya ok

I've been the php developer… does servlet session can store the "binary data"…

~g[r]eek++

g[r]eek has a karma level of 7, whaley

can to be liking for sure

g[r]eek: that's not very nice!

session objects can only store other objects
i don't know if that answers your question about "binary data". what do you mean exactly? primitives?

yes. you create objects inside one servlet. you put references to these object in the session. then you can retrieve these references later on from another servlet to access your objects
~tell zipito_ about javadoc HttpSession

zipito_, I don't know of any documentation for HttpSession

only JSE docs are in the bot

noted

thanks a lot

that'll change soon, though, now that the docs are in the db.
anyone notice how much faster the javadoc calls are?
8^)=

yeah

~cheeser++

cheeser has a karma level of 372, joed

~javadoc String

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

lightning!

take a look at javax.servlet.http.HttpSession;

I'm still waiting for the day where I can say ~javadoc Session from Hibernate, or ~javadoc XAResource from javaee 5.0

hey. the changes list is in the wrong order.

can you specify version of the javadoc to return?

it should be newest first

g[r]eek: thanks…

heh

there's only 1.6u2 docs in there.
i don't think i want to support versioned APIs in there.

yeah

that gets complicated.

any one interested coding for money

it's what I do.
8^)=

no, we all do it for free

not to mention bloating you r database a few tiems over

nah only probono in here

this is a charity

i'm not too worried about db size.
mainly on management

depends on the kind of code

i code for money, but noone can afford me so i do it for free

londonmet050, I'

yeah…

I'll do homework for $75/hour

if it's a really interesting problem someone in here might pay you to get the rights to solve it

it is a decision tree algorithm

well, you underbid me

and that filter code is fuuuuuuuuuugly
8^)=

It's the phonebook.

you would suck at the price is right

barney from "how i met your mother" ftw!

the problem is this

only if I wasn't trying to play

got a algorithm called SLIQ

well there's your problem

and a proposed algorithm to improve SLIQ

yeah.

g[r]eek: eh? i missed something here. what does doogie howser have to do with any of this

need to code both of them
and we do testing

in one episode he plays "the price is right" gameshow and dominates
that guy is my hero. damn he's funny

the SLIQ algorithm is used as decision tree classiifer

barey: "the only time you ever wait one month for sex is when she's 17 years and 11 months old"

haha
in most states 16 is legal age of consent

any one interested in coding this algorithms

g[r]eek: i've never watched that show… but i like allison hannygan or whatever her name is

oh man you'd love it. it's darn hilarious

yeah, but some have some silly rule about being a certain age older than the girl until she is 18

outsource it? :P

does a class that accesses some final static field from another class, put that value in on compile or access it later?

static finals are typically inlined depending on the value.

compile

right if you are more than 3 years its statutory rape (typically)

i.e., ints and Strings

but tahts neither here nor there

just move to england, it's 16 here

final static Objects probably can't be

cheeser, ok, so an applet wouldn't try and resolve that class then that it came from i am assuming?

final static string literals tend to be I think.
Oh, you said that.

8^)=

hehe

probably not

I found that out a bit of the hard way when I called Character.LINE_SEPARATOR, which I compiled in windows and ran on bsd… ^M all over the place

I just saw the comment about final static Objects, and Strings are objects after all.

indeed they are

hmm so whats the verdict?

guilty as charged

hehe

2 years static variable confinement

private static variable confinement…

and that's final.
death by gc

g[r]eek: we are huge dorks.

haha
i know.
isn't it great.

whoa… 1/187187/…

Where would i go to learn what specific tag libraries do? For example: http://java.sun.com/jsp/jstl/functions

Generally google.

i tried google
can you tell me what this particular one does ?
or is there a SUN page that documents it?

google contains 10 billion pages, im pretty sure there is something out there that explains it
rather google has indexed about 10 billion pages

If Sun has a page that documents it, then I imagine google has indexed it
haha, right.

google ain't all that

They've cached a fair amount of pages, but I'm not sure they've cached /that/ many ;-)

you know google has only indexed about 1/10 of the net, according to some studies done at berkeley

wow
I'd hate to be that other 9/10

So can any of you tell me what http://java.sun.com/jsp/jstl/functions does ?

For this, it is

deep web content is about 96 billion pages, surface web is about 20 billion according to a report i read 2 years ago for a research paper i did

is there a way in a web.xml to do url-pattern that match anything BUT a certain string?

no.

damn

http://xkcd.com/
wow ive actually used that excuse before

http://java.sun.com/jsp/jstl/functions in google returns one only and taht page doesn't say it

What do you do if you have a .jar library with dependencies that conflict with other libraries?

get different libraries
and pray a lot

Jesus man. Google jstl documentation.

Results 1 - 10 of about 2,400,000 for JSTL. (0.15 seconds)

you think i'm Jesus? wow

2.4 million pages

yes. And as a Jew, I want to now put you on a stick.

hey, i can see my house from here

~coachz++

coachz has a karma level of 1, jottinger

hahaha

Seriously though. Google "jstl documentation" with no quotes, it'll be the first result.

vv.getRenderContext().setEdgeLabelTransformer(MapTransformer.Number,StringgetInstance(LazyMap.Number,Stringdecorate(new HashMapNumber,String(), new ToStringLabellerNumber()))); // The world has gone mad.

leip, thanks i'm there now :-)

And you can't be Jesus because I work with him.
And you don't look like him.

"I am Jose", "Jose who?" "Jose Jalepeno", "on a steeeck!"

darn ;-(

~jesus

leip, I have no idea what jesus is.

http://eugeneciurana.com/galereya/view_photo.php?set_albumName=ThePond&id=IMG_0199 - Yes, this guy's name REALLY is Jesus.

haha
thats awsome

And get this: his boss' name is Mari.

What the hell is that carp?

Ask kinabalu - he works with both.

his nose isn't big enough

lol

We just need to hire someone named Joseph and we'll be all set
.. . .

haha thats what my coworker just said

and committ some code to Mule

I was actually playing poker with Jesus the other day

If nose length is a sign of enlightment and divinity, I would be the next messiah.

you could hire someone named "John Jacob Jingleheimer Smith"

my nose is bigger'n your'n

s/religions/religion/

He had to go sell his hair to cover his bets at the end of the game, so he may be looking a little different nowadays

by a lot

or make that eDonkey

~tell g[r]eek about ESB.

g[r]eek, ESB is Enterprise Service Bus. Please /join #esb for a smarter discussion of this topic than in ##java.

you need to hire someone named Judas

It's a line from a piece of sample code in the 'new and improved' version of Jung.

i was alluding to jesus, mary, joseph and donkey

Hrm… I got a good gig going already then. I call my g/f "Morning Star".
g[r]eek: Ah.

haha

Where, in a most ironic move, they've done their absolute best to fake decent typing and functional programming in Java, thus preventing me using it in a language which has decent typing and functional programming.

I saw "." and flipped out

That's because she wakes him up by humming

She feelt flattered about it until I explained what that meant.

It's how you explicitly bind type parameters in a generic method.

haha

You don't normally need to use it.

"Oh, so I'm your angel of the morning, like in the song?" "You bet. You're my fallen angel of the morning. My little morning star." She beamed.
Then later that day I told her the other side of the story.

I don't know the other side of the story myself

i would have beamed too. what's the other side?

is this the g/f I know?

Morning Star == Lucifer.

hahaha

heyas

oh, bother

JOlga.

roflmao

"it's cause you're a demon in bed"

hey, is there a way to send all keybaord input in a window to one component?

Oh right, of course. I lost my mind in that long list of static methods

(like mirc does)

I don't blame you.

"How art thou fallen from heaven, O Lucifer, son of the morning! How art thou cut down to the ground, which didst weaken the nations!"
Why Lucifer? In Roman astronomy, Lucifer was the name given to the morning star (the star we now know by another Roman name, Venus). The morning star appears in the heavens just before dawn, heralding the rising sun.

i was busy typing that lol

note that isaiah preceded rome by many, many years

which is why some say lucifer was envious of god (the sun)

~pastebin

http://papernapkin.org/pastebin

Lucifer the morning star became a disobedient angel, cast out of heaven to rule eternally in hell.

well… ruling in hell is questionable

The whole write up blames King James' scribes for munging that one up.

he's only portrayed that way in one book, yob

heaven for climate, hell for company

nice.

whoa, I must have joined #jesus on accident

http://www.lds-mormon.com/lucifer.shtml

http://papernapkin.org/pastebin/view/1297

whew

they're still here

read my pastebin its two really good jokes

I actually joined #jesus
on accident, lol

Me too…

I don't think you can take the moron church as being authoritative on hebrew angelology

and then promptly left

Must be a sign

Knowing all this just makes the joke on JOlga funnier

anyone know satan's hebrew name without looking it up?

shai tan

g[r]eek: no

shazbot

Belzebub?

shai-tan postdates the concept
no

bush

It wasn't angelology, it was smybolism. For the transition we can blame the church.

I did at one point. Damned if I can remember it though.

i did once. nah belzebub is a demon

close, but bush was the angel of stupidity

shailoh?

g[r]eek: no

haha

Ottingerberg.

haha, no

I just went and looked it up
I am a cheater

yes, you are

and I don't mean the catholic church or the church of england, I mean institutionalized faith

samael was his hebrew name

On the day of atonement, a gift to Sammael [a Jewish name for Satan].

wondering why shai tan came to mind

mythology is fun
That's arabic

g[r]eek: islam
also, you've read frank herbert

in greek and latin its diablo
indeed i have

Although i find jewish/islamic/christian mythology the least colorful
and the least interesting

who, despite being jewish, wrote Dune with a muslim theology in the desert
well, they were monotheistic and largely faithful
but you should read the aggadah, it's pretty colorful

well i always figured he based the fremen on exiled jews

g[r]eek: no… fremen were exiled muslims

hi

i found my answer finally. whew

mind you, i was 12 when i read dune.
my grasp of religion was limited to greek orthodoxty
*orthodoxy

g[r]eek: he uses islamic imagery almost constantly in dune

t = Collections.emptyMap(); foo(t);" but this doesn't "foo(Collections.emptyMap())"?

perhaps i am missing something, but i am trying to have a passthrough filter for servlets but is there no way to exit the chain of filters?

yeah worms

g[r]eek: Judaism shows up in Dune but almost never really positively
Dune, Jews show up explicitly as Jews

how are the sarduakar jewish?

my favourite concept was that of the bene-gesserit

They're the ONLY ethnic group that survives unchanged, but they're also slightly … unadmirable
see the Dune appendix, he makes reference to the Sardaukar's use of Towruh

really

yes

yeah ok. and the fremen are actually the jews in dune dude

"sarduakar approaching" - music change - crap pants

you know, distinctively marked tribe, enslaved, forced to wander the desert, waiting to build their own kingdom and a messiah. it's pretty ironic you missed that.
you know, distinctively marked tribe, enslaved, forced to wander the desert, waiting to build their own kingdom and a messiah. it's pretty ironic you missed that.

never thought of that, cool

yeah i agree with meeper
that's the exact interpretation i had

off hand psuedo references to judeo, christian systems showup frequently in sci-fi. the matrix comes to mind.

apart from being off-topic, the fremen are as much islamic descendants as anything else.

the more I think of it, though, I think he refers to the torah's use on Salusa Secundus, not the sardaukar specifically

Hello.

even the word muadid is a hebrew word

cheeser:

mohadib

but anyway, try ##dune for all this

and the fremen used far, far, far too much islamic imagery and terms to be jewish in nature

is it possible to receive key-events while the frame is not focused, without using JNI?

how so? What does it mean?

I mean, really… ALIA?!

no

muad'dib - the desert mouse

God, those guys that directed the matrix should just do everybody a favor and walk in front of a fucking bus.

ahem.

lol

~jbc++

jbc has a karma level of 1, g[r]eek

the one guy is now a woman

herbert's use of world religions is a lot more complicated then stealing words. trust me. the fremen are the jews and paul is moses.

so you mean the guy and his lady boy brother

yeah like dave rooney

haha

no.

great - can I spend my karma point on some help with swing?

?

tmccrary, one of the matrix directors had a sex change?

k, then i'll have to use JNI

I agree that his use of religion is far more complicated than mere words.

yes?
….

thx

But the Jews aren't identified with the fremen.

nevermind.

oh, pipe down.

Sorry, wrong channel. Try #dune-religion-and-everything-not-java

I was wondering why you opped up…but I see now.

~JNI

Overlook217, JNI is http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html

In March 2006, the San Francisco Chronicle reported in an article on transgender people that Larry Wachowski "has changed his sex and is now living as Lana Wachowski". [8]

I want one particular textField to receive all keystrokes - like mirc

My eyes skipped and I thought that was part of the JNI factoid for a moment

is there a non-horribly-involved way to do this?

cheeser is silencing anybody who talks about the matrix?

no. just non-java talk

oh
~batix

svm_invictvs, I have no idea what batix is.

~batik

svm_invictvs, batik is a set of Apache libraries for manipulating SVG documents.

do not talk about matrix club

t = Collections.emptyMap(); foo(t);" but this doesn't "foo(Collections.emptyMap())"? The latter complains "no such method foo(MapObject, Object)" when in fact foo is only defined for MapString, String

because in the latter case, it's too hard to imply the context

really?
it's too likely to run into ambigious matches?

try Collections.String, StringemptyMap();

?

heh, I must have missed something interesting

that worked
oops, yes, that worked
I didn't even know that syntax was valid Java thanks a lot

non-java talk

Alot of matrix talk. And meeper being a douchebag as usual.

weird!

yeah, it's hideous

Agreed. See above snippet.

jhg
my voice is back

is there a tool that will automatically write javadoc to your files?

(I really wish the inference of parameter types was better)

all i need is basic information…

uh…

I didn't know you could call generic methods like that

IDEs have some support for that

(But there are so many things I wish for Java )

an IDE will generate all the @param stuff for you

I had a Perl script that generated javadoc for simple get/set methods
it had some quirks but it was surprisingly coherent

yeah i need something like that, trying to figure out how to do it in eclipse without having to actually start the javadoc comment line myself.

For some reason, one of my JSP tags renders repeatidly until an out of memory exception is thrown…

Ecliipse can do that, too, I think.

I wonder how many people had to run to their IDEs to see if that syntax *really* works

What syntax?

the Collections.String, StringemptyMap(); thing

I thought that's how it was done…

Collections.Foo,BaremptyMap():/
I, for some reason, just thought that iddn't work….
Though that works in C++…

well the C++ thing is actually totally different
it just *looks* similar

Syntatically similar, implemented way differently.
heh, I have some dangerous downcasting in my code, teehee.

i'm having trouble printing out an arraylist using jstl - does this seem correct? http://pastebin.com/m724da686
the error i get seems to exist that the arraylist does not exist in the transfer object stored in a session - http://pastebin.com/m4aa08601
but if i print out the session variables it does exist

Doesn't exist as in it is null?
and where are you printing it out?

i have logging on in the form action bean that forwards to this jsp page - and i use a get method to print out the arraylist and it is there
i have also tried using java on the jsp page itself to print out the available objects stored in the session and it is there
i am also able to use jstl to print out simple strings stored in the session object - but not this arraylist
i use setter methods to set both the strings and this arraylist into the transfer object - i don't understand why jstl is not able to print this arraylist out like it is able to do w the strings

brb

this might interest you, regarding my Collections.emptyMap() question: http://forum.java.sun.com/thread.jspa?messageID=9825080
the guy brings up a good point

invalid console appender config detected, console stream is looping"

yeah, sounds like he pretty much nailed it
though you can't have more than one method of the same name that takes just a Map as a parameter

are both Map at runtime

ooo!!! Generic method inference. And I thought that nastiness was only reserved for the CLR!
uooo!!! Generic method inference. And I thought that nastiness was only reserved for the CLR!/u

bbl

i has a problem

bad english?

i've always had that one
sorry, i tend to say "i has a .. " silly internet meme

bad internet connection?

anyway, I have a problem
actually i do have a bad internet connection, it hates me too
but that's not todays problem
todays problem is maths (yes maths hates me too)
gosh, no love for me at all!
i have an object. im trying to give it a field of view. so that i can detect if any other object comes into its field of view (meaning a collision is iminent)
so field of view would mean it cant see directly behind itself, might have say 120degree field of view etc
wokring out the distance between itself and another object is easy, but working out if the object is within the field of view
i dont know how to do it in java
its a 2d environment, so cant use local co-ordinates to work it out.
if it was in 3d i could do it i think. but 2d… i dont know
i fail

eh? 2d is easier then 3d, i think.

2d is just like 3d, but everything is on the same plane
it's quite simple I think, basic trig

except with 2d, i cant say.. oh if its withing this distance and the y co-ord is positive, its in field of view

but an imminent collision would not be limited by field-of-view, would it?
forget about X and Y - draw a triangle with a 120 degree inside angle

well the field of view is for detecting where its neighbours are, and see it will try to avoid its neighbours based on how far away they are etc

so you have a large number of objects and you need to keep track of distances between them?

its a flocking simulation

iirc interval trees are good for that

each object tries to avoid the other, keep together and match each others speed
they all have the same individual behaviours, which contribute to a total group behaviour

but only the other objects it can see?
I see
sounds interesting

my focus is on different ways i can do the "dont bump into each other" behaviour

ok, so step one would be to figure out what other members a given member can "see"

exactly
id like to implement a field of view, so it will try to not collide with objects in its field of view

so each member has to have a "direction" that it is facing
any other object within the field of view, (and probably within a certain distance) would be considered "visible"

each one has their xy position, all the behaviour rules return new velocities, a new velocity is given to the object and enables it to update its position

you're missing a few things
1) each one has to have an x,y position *and* a heading

like direction/heading?

yes
2) you'll have to factor in reaction time, otherwise you'll probably have a "perfect" flock every time

yeah, what you're saying does make sense

how to return from an exception?

so i need to figure out how i do direction

i'm trying return;

you could probably do a generational system (like the game of life), and say it takes between 3 and 5 generations of consistent behavior by a member in order for that member to be "imitated"

empty catch, but don't do that

hmm

if a member is acting erratically, probably the other members would ignore or avoid it

r0bby, actually that doesn't work because my whole program is crashing.
it's in main.

you want to catch the exception and recover

well i'm catching it i want to return to main

direction is easy - your Member object would have: double x; double y; double heading; // in radians maybe

so how do work out its heading?
i mean i have its xy and its x velocity and y velocity

well x velocity and y velocity is easily convertable into r-theta
basic trig
and in fact I think r-theta will be easier
double x, y, heading, velocity;

i feel stupid, because i know what you're saying, but my trigonometry is shameful

r0bby?

trig is essential

aye, so im learning with this

if you get absolutely nothing else out of math - get trig - whether you're going to be a carpenter, schoolteacher, programmer, whatever
it's essential

imagine, i got through 4 years of computer science not knowing this kind of trig
:/

that's… insane

sohcahtoa!

you should have had this level of trig when you were about 14 years old
anyway, off to feed the children

well thanks dmlloyd

i only used trig on my degree for a laugh

il go have a think, and read up on my trig

something is throwing an exception inside main, would I still be able to recover from it?

sure
~tell b0r3d aboute exceptions

b0r3d, I guess the factoid 'generic exceptions' might be appropriate:
http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-generics.html

~tell b0r3d about exceptions

b0r3d, exceptions is http://java.sun.com/tutorial/essential/exceptions

cheeser, I already know that if a checked exception is thrown in main the whole program will crash.

not necessarily

if i were to make my own threading application which needed to handle global functions and variables, what would the best way of handling it be?
having a locked global function that handles the functions on the main thread
or a function on each thread that manages the global functions etc

~tell chrisjw about jcip

chrisjw, jcip is Java Concurrency In Practice, a book focused on implementing threaded and concurrent applications in Java. http://jcip.net/

do nothing with threads until you've read that

why are comp books so damn expensive

because each one sells about 6 copies and they need to make up for low volume

because you are in america?

hmm… said book is in safari

at least there are no cats here.

i get 35% off of books from safari!

I think learn Java in 21 days by SAM's sold at least 18 copies

heh

I love safari

cheeser, how so?

damn. that guy almost made it all 21 days
how so what?

not necessarily

Heh

oh. well, check this. this is kind of an advanced topic, but I think you can handle it.

aight

you can actually *catch* that exception in main() and handle it.

safari is neat… although I'm on the cheap plan and have to swap 10 books in and out

i'm doing so ..

no crashes that way

cheeser, I have a System.out.println("hi"); after the line that threw an exception in main.. it's not printing out.

well, duh.
it'll go to the catch block
you say you've read that exceptions link?

I want it to return and print that line

it won't if the method throws an exception
go read that page.

~coffee whaley

but i'm catching it in main

so print in the catch block

so no way to go back to the normal flow of the program?

structure your code properly.

that's what I mean by the whole program would crash.

meant*

wrap just that one line in a try/catch

hmm

that's not crashing. that's normal exception handling.

oh damn
sorry I'm blind

if it crashes, it's your fault.

didn't see all the thing inside try
my fault, sorry.

no worries.

dd

hehe
wrong window!

ls

wrong window, pal

tee hee hee
i love that one

haha
pwd

ls

wrong window, dumbass

there it is.
8^)=

ls -fal

wrong window, dumbass

if it crashes, it's your fault." - never a truer word spoken

haha thats a good one

it only works on like 4 commands.

grep

i had it scan /usr/bin at one point but it *really* chatty
8^)=

lol
tail
ok nm
-(
=D
lunch time!!!!

nooo tea time!

you can find the command list in the UnixCommandsOperation source

Is it possible to find out which version of the Java compiler was used to compile a given .class file?

file foo.class

yes

Can you tell me the command to use?

how can I insert image into panel? Is it possible? Because method add doesn't have method like add(javax.swing.ImageIcon) :/

he just did
"file foo.class"

file name.class

java.lang.OutOfMemoryError: Java Heap Space Where do I increase the memory for JVM ?

~tell N1klas about jvm options\

N1klas, I guess the factoid 'jvm arguments' might be appropriate:
N1klas, jvm arguments is http://java.sun.com/docs/hotspot/VMOptions.html

Oh, sorry. I tried that, and got: FgaAgs.class: Java Class file (byte and word-swapped)
i.e., I don't see any Java compiler version information.
Maybe I'm using the wrong "file".

use Linux

PaulEU++

pauleu has a karma level of 1, r0bby

I use Windows, Linux, BSD, AIX, HP/UX, and Solaris.

try it on Linux machine

only 4 of those are real os's

Bleh, I don't care.

Any good logging tutorials?
~logger

svm_invictvs, I have no idea what logger is.

~log4j

g[r]eek, log4j is a logging system for java. See http://logging.apache.org/log4j/docs/index.html.

This is fucking nuts

hmm now i need to do maven profiles; woohoo

~log

joed, logging is a common task in java programs, for which many libraries are written. There is log4j ( http://jakarta.apache.org/log4j/ ), or Jakarta Commons Logging ( http://jakarta.apache.org/commons/logging/ ), or you can use java.util.logging.Logger. Each one has useful points over the others.

I'm so sick of this bullshit.

Foo.class: compiled Java class data, version 50.0
for java 6.

Bugs assigned to me that aren't my responsibility because the test engineer is too much of a fucking moron to capture the stack traces.

reassign

hah

hmm nobody can help me?

back to him.

get a new job.

~tell PaulEU about ask

PaulEU, The Ask To Ask protocol wastes more bandwidth than any version of the Ask protocol, so just ask your question.

I did a question!

g[r]eek: He's reporting a but that occurs because the server decides to close the socket randomly.

did you use protection?

is it possible to add ImageIcon for JPanel?
g[r]eek: protection?

oh. missed it. sorry.

what

nevermind.

and you received some answers to a googlable question

OK, thanks everyone, works fine.

add an ImageIcon to a JPanel?

googlable. nice word

yes

yes.

how?

use javap -verbose full-class-name

panel.add(myIcon);

use the source luke

(after adding it to your frame.)
javabot tell PaulEU about swing

PaulEU, swing is a windowing toolkit for Java. Tutorials: http://java.sun.com/docs/books/tutorial/uiswing/ and http://www.swingwiki.org/ also check out ##swing

read

God forbid he can copy the stack trace file into the bug reports.

~hug svm_invictvs

I tried: jpanel.add(img); but it doesn't have method add(javax.swing.ImageIcon)
JPanel don't have a method for it

he must have a degree from the University of Pheonix

http://www.google.com/search?q=add+ImageIcon+JPanel
go.

ok,

do this: add the ImageIcon to a JLabel, then add the JLabel to the JPanel
add the ImageIcon to a JLabel, then add the JLabel to the JPanel/u

its strange..

JLabel myImage = new JLabel(new ImageIcon("myPic.png")); panel.add(myImage);
you're just wrapping it

ok, but I don't want a JLabel
nativelly its not possible
and I must use JLabel - OK

I just told you how to do it, and trust me it works, i've done it

~r0bby++

r0bby has a karma level of 37, Aradorn

you are right

PaulEU:

y'know, I've noticed a bunch of stuff in the java library that needs a good cleanup…

level of karma very nice..

Like the Properties class :P

http://blogs.zdnet.com/emergingtech/?p=662
cool pics of the damage to the space shuttle tiles

s), and Class B extends A with method foo(Collection s) in what cases does it override?

but everybody was right, you could have googled and found my solution.

I know, I found on google

i believe so
PaulEU:

it was not a yes or no question

I think subclass methods always override super class declarations where the signatures match

see ya.

That will always override or generate a compiler error I think. I'm not sure where it will do the latter.

by

so in this case i believe B will override A's declaration

I think the question here is what happens if only the erased signatures match.

TIAS … you should be able to do that with a couple of println()s

Morally it shouldn't override, but I'm pretty sure methods overloads are resolved based on their type erased signature.

ok sorry, im not well versed in all the generic ins and outs yet =\

This is an obscure one. I've no idea what the answer is without TIASing myself.
I just know that it's either going to be an override or a compiler error.

s)

the runtime doesn't see the generic method signature. it only sees the type erased signature.

so Collection s is considered a type erased signature?

though it should be a compiler error in practices. subclasses aren't allowed to narrow their parent's interface

s is a generic method sig?

i was considering cleaning up the base class, adding proper typing, but wanted to make sure that it would not break things

hi guys, I am trying to run the azureus java client, but I am getting the error "could not find the main class. Program will exit". I know this is a common error, but despite reading all the internet pages on it, I cannot get it to work. The command I am running is java -cp .
azureus2.jar

can anyone help, please?

Yes, that's clearly correct though.

java -jar azureus.jar

doesn't exist at all at runtime. it's syntactic sugar for the compiler to help you spot errors in your code and make your code more readable.

That it is a compiler error I mean.

does exist at runtime. It's just not enforced.

one, use the scripts that come with azureus. 2. try an azureus forum. this isn't an application support forum.

it's not wise to narrow a base class' interface. you probably will break something and will have to change all subclasses.

CProgram Files (x86)\Azureus Javajava -jar Azureus2.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cl
i/CommandLine

use the azureus .exe file, hal

In a client-server architecture where everything the passed over the network is serialized and there is a "common" jar (used by the client and the server) - would you convert all "common" data structures as soon as they come from the server to client-only ones?

see above

Zaph0d^: it's a good idea if it's not too much of a PITA

defined "too much"? (this is an 'enterprise' system)

Zaph0d^: the idea is to build a facade so the client is decoupled from changes in the network protocol and vice versa.

is it possible to pattern-match over several lines in java?

that already exists. However, the client is still affected by changes in the server

Zaph0d^: well too much means if it's too much work. but if you only have a single client under your control then don't worry about it

or do I need to remove the line ends?

What you mean by line ends? Newlines or multilines?

meeper I was afraid that's the answer I'd get. actually, I'm afraid that's the answer I'd get from my team leader.

JLearn, yeah sorry, new lines
JLearn, I have an ical File and need to extract only the VEVENTs

yes its possible.

Zaph0d^: don't worry. when the time comes and you need to rewrite the client because it's not sufficiently decoupled from the network you'll learn the right answer

hopefully I won't be there that long.

hmm I have strange problem.. I load image, but its not visible on JPanel :/

JLearn, I thought pattern-matching could get me the single events

jPanel.add(new JLabel(imgIcon)); jPanel.repaint();

jottinger, I have been using the azureus version that has been compiled for windows, but there is a new feature in the beta release that I would like to test, which is why I am attempting to get this one working

Zaph0d^: then it's not your problem at all. do whatever is easiest.

JLearn, but now I'm not sure how to get only the lines between the tags BEGIN:VEVENT and END:VEVENT

and it don't show image, but I can read these dimension of file

talk to the azuereus developers. you're doing them a favor by wasting your time beta testing for them and they'll be happy to help you

jottinger, what I don't understand is where it is getting the reference to apache (in the above erro). On another PC the error references the eclipse application

I must use method paint ?

meeper, but is this a problem with azureus or my lack of knowledge ?

it's you

the problem is with evil open source developers who waste billions of dollars each year with poor documentation!

ask on the azureus forums. they'll have dealt with this already.

but mostly it's you

strange!

cheeser, meeper and especially jottinger, thank you for your help

I kinda wish they'd name one "dave"
I'd love to be a hurricane

heh

you want to kill innocent people and destroy coastal communities?

with any luck

what's wrong with you?

that's a long story

property insurance in florida is outrageous
anyways off topic…

we should really give florida back to spain

haha

though they probably don't want it

dude the state of florida spent 100 million dollars on a product they never recieved

and even further off topic
8^)=

no its not, it was a java project!

8^)=

how does that make it java dev related?

the = confuses me

it's a smiley…
that's a goatee

aaaaah
goatee
gotcha

it's not a goatee, it's teeth

oh
goatee and/or teeth

don't listen to meeper. ever.
8^)=

it's a chipmunk piped up on crack

which project?
in florida?

Aspire

which was for what dept?

the entire state

controlled by which dept, for what purpose?

i think it was java btw, i know i was going to have to interface with it. Yeah the dept of revenue controller it IIRC

every sales tax dollar in FL goes through a series of my programs

er controlled it
was going to replace Flair

I don't know. He almost seems to be talking sense for once.

really? I'll have to call them up and dig it out - I thought they were all SAP now

were you a contractor? or an FTE

FTE

cool

but this was before Suntax
or, rather, I left not too long after Suntax finally went live in any degree

heh
im an FTE at FDLE

a lot of the people I worked with are still there, but not in the same roles whatsoever… suntax ruled all
my sister in law works there… or labor, I can't remember which
she's kinda a wallflower, she never made an impression
my brother in law's a probation officer for FDLE

thats cool

is FDLE on one of the IBM mainframes or still the E1100?
(I'm trying to remember if they were on the AMIC system)

we still have some legacy stuff, most of its being replace by 1u racks

haha
That's not surprising… the E1100/4 was a whopping 6MIPS
of course, it also had ungodly amounts of IO but still… 6 mips!

i guess it depends on what system you are looking at
FCIC or Falcon etc..
im not in those groups so not sure about hardware

Hey guys.. I'm having a problem using an eclipse plugin called fat jar.. is anyone familiar with it?
I'm trying to use fat jar to compile my class grabber.grab which includes jxl."things"
into a single jar file

the unisys was also famously able to manage -0 != +0

Comments

Ive got a file that uses a class which outputs stuff out The file is loaded into an output buffer with ob_start

you appear to be missing something

can you use while() loops in php?

caffinated, ah yes, doh… Thanks caffinated

i have a part in a if nest that i want it to stop completley I have a break; it works .. its great but I get Fatal error: Cannot break/continue 1 level in … on line 53.. How can I have it not say this im breaking on purpose?

csc`, yep

coolio

stealth, code?
stealth, it doesn't sound like its breaking on your break
stealth, er, I think it is breaking and not doing what you want on your break

http://rafb.net/p/qeGgFJ11.html
Ktron, try just hitting search http://68.204.200.241/old/parts/

http://pastebin.ca/index.php

Ktron, i dont want to search for nothing.. it yeilds way too many results

http://pastebin.ca/669406

stealth, is that fragment inside a loop?

why this doesn't work…
if i check only the first argument it works but when i add the second it doesn't o_O

Ktron, no thats the beginnig
beginning

stealth, break breaks out of a loop, you probably want exit()

how can I print all the current session variables?

ohh.. loop..

http://php.net/var_dump

swimrr, var_dump($_SESSION) I imagine

thanks

Ktron, thanks!
hmm lemme see.. stupid proxy

LordDoskias, looking

Ktron thanks

yep

I'm running PHP under WAMPServer. How can I make a file writable?

LordDoskias, 'and' isn't an operator

Ktron well? it's not that complicated scrit
&& ?

Tachyon, set the usermask properly at creation

LordDoskias, yep

Ktron same thing ;(
if($argv[1] == $creden[0] && $argv[2] == $creden[1]) {

and make sure that safemode isn't causing any trouble

What is a usermask?

LordDoskias, hold a second, I'll try running it

I'm not running safemode. Other files are writable by default. This particular file is not writable for reasons I am unable to fathom.

Tachyon, posix thing

windows does have a permissions set

how do you terminate a php webhosting script early ?

when thinking about it, windows is not posix compatible, so ignore that

Hmm

so, either the permissions are wrong for the file, and you need to edit it, or you have the path wrong

zap0, exit

Yeah, it would help if i had the path right…

henke37, but it containues to parse after the exit.

hi all

zap0, oh, parse
that is possible too

LordDoskias, got it

?

I think it was __halt_compiler();

LordDoskias, $argv[2] includes the \n character

i'm working on the same page from yesterday, and I have it working, but I can't seem to put a variable in the prof.php file - http://pastebin.ca/669415
any advice? or can't it be done?

Ktron so i should trim it or what o_O?

LordDoskias, try trim($argv[2]) == $creden[1]
LordDoskias, its what I'd do

same thing ;(
if($argv[1] == $creden[0] && trim($argv[2] == $creden[1])) {
argh
just trim the argv2
same thing ;(

i'm tryin to take a value like "The Pursuit Begins When This Portrayal of Life Ends" and turn it into "The Pursuit Begins When This Portrayal of L…" basically if it's too long to fit in a certain section of my website it will cut off the part that doesn't fit and add … to indicate that it
continues
anyone have any ideas of how to accomplish that?

i'm not sure what you're asking

how do you tell the compiler to stop parsing, and just return what its got.

you can use variables in any of those files, provided the variable is set.

tag work in internet explorer 7? does anyone knows?

..to work..

http://php.net/html

I want to put the $profimg variable from page1.php into the prof.php file_get_contents() and replace the path that is there

LordDoskias, I ran http://pastebin.ca/669420 with arguments of user pass with a file called cred.txt with 'user:pass' on a line in it, and it worked

Ktron well ?

oops lol
i meant to say #html
i was halfway though typing something in another window :P

yes ok thanks

yay me

I must have my syntax wrong?

LordDoskias, lol, sorry, I told you to trim the wrong argument

this isn't working - echo(file_get_contents($profimg));

Ktron i was trimmin the wrong thing

errr echo(file_get_contents("$profimg"));

does anyone know how to make PHP conditionally exit, and stop parsing ?

because you're not accessing the session array

swimrr, and $profimg is the variable name?

yes

and stop using quotes on variables like that

okay

Ktron thanks alot

LordDoskias, np

die()

zap0, or exit()

AlexC_ die and exit continue parsing.

no they don't

hmm funny, you no longer need to be regged to join this channel

then why do i get a parse error ahead of the die point ?

because the entire file is loaded first, parsed - then ran again to actually run the script

can exec() do a batch file?

it should be able to do whatever your shell can do

AlexC_, then you didn't answer my question.

hi

on windows i imagine that would include executing batch files

why would you want your program to "stop" before the file has been parsed in that sense?
fix the parse error, then when you run the code - whereever that die() is, it will stop

because the code ahead of a point is not valid PHP.

thanks again….

tags,

yup

zap0, Or remove it

thans
*thanks

but it becomes valid PHP later on.

…. ?
wtf

zap0, http://www.php.net/manual/en/function.halt-compiler.php

halt_compiler() only works from top scope, you can't use it conditionally.

tags

"12345"[3] ?

makes_no_sense_to_me.com

Alanius, it makes sence to me

I was refering to zap0 :P

but I don't see why to do it at a static string

you can do $foo = '1234556'; echo $foo[2];

random string generator

Ktron, technically your words are correct, but you probably have some wacky idea about the context its running in. stop trying to understand the context. pleaes just answer my questions if you know how to control the PHP engine.

no
it is valid if you assign it to a variable first though.

kthx

zap0, no programing language I know of allows the execution of the program to edit the compilation of it

well then you dont know much about scripting languages.

zap0, I was just clarifying what you were trying to do; I don't know how to do what I described with PHP, maybe with more context it'd be clearer, but as it is, no

how can i count how long a value is
like $row['Artist']

strlen()

thanks

why would __halt_compiler() only work from the top level? why not level 1?

zap0, um, you might be able to do something with heredoc…
zap0, no, I take that back

does strlen() count spaces too?

yes

like A B would that be 2 or 3?

try it

3

thanks, what i wanted
= or =

why wouldn't there be a way to stop parsing?

=

I want a browser identify. For example if user using internet explorer, do a thing, if using mozilla do other thing. How can I do this ?

zap0, I think most of us are lost on why there would be a way to stop parsing
beyond halt_compiler

http://php.net/variables.predefined - have a look at the section on $_SERVER

yeniklasorr test the browsers string

and don't forget to send proper caching headers, the Vary header is important

henke larsson

no

Ktron, because i want to. if php webhosting has some agenda to prevent people doing as they want, it sure as hell is not evident in its design.

megatron

chalgo, megatron against blacktron?

I think it'sin the env variables, but I'm not sure.

yeniklasorr $_SERVER["HTTP_USER_AGENT"]

poor zap0

?

why

Are there limitations to array index or key size? I'm trying to put elements into an array with indecies based on powers of two, but once I get to 2^32, I get funny numbers. I was having a hard time googling 'maximum array index' without finding stuff for max().

poor lolotov

echo PHP_MAX_INT;

zap0, maybe someone else knows different than I

lolotov, you should use antother algorithm

use http://php.net/bc for it and you won't have a problem

lolotov, yeah, its not the array index or key size I bet, I bet its just the int size

poor Ktron

if i not use function session_start i not go have phpsessid right ?

poor MalMen

define poor please

correct, you must do session_start()

agreed, but once I stumbled on this, I became intensely curious. rza: 'PHP_MAX_INT'. ktron: that's what I'm thinking, if I bit-shift to get the numbers, I get the same ints, but when I use pow(), I get much higher. caffinated: looking now, thanks.

ignore him, just a troll

yea, i beleve

alexC sucks

not have way to get sessionid with out session_start ?

nope

i just want session_id to pervent multi users use the same account

that's exactly what I'm looking for, thank you.

hmm

poor DarkGirl

IP ill not work if users use proxys

O_o

not sure what you mean, you just want a unique ID?

yes

no problem. just keep in mind that past a certain point you can't use regular math on those - you'll have to use BC

uniqid()

poor caffinated

comming fro the browser

why

that il is random

why

I was going to ask who was trolling, but I can see now

why

i want a static host id per user

why

one id with user ill dont know have

^^

gg chalgo

and change every time user change their browser
just like session_id

then why not use sessions?

but i wont start_sessions :X
because that ill denied users to open multi connections on same mommento
thanks at all
you not have think by me
i ill think by my self
and find a way

That sir, is a canceled czech

lol

http://mlti.sad60.k12.me.us/new/contact.html

MalMen, I think there's a way to get info about where a host is coming from

it's a .html file, adminGuy

your problem is a common one, and can't be fixed. There is no way to identify people

rename it to .php or make apache parse .html files,

Dynom yes have
we just have to think :P
one time i make that way

ah, i thought it might have to do with the webserver. i'm used to a host that has apache set to parse .html i guess.

no there isn't, unless you start using fingerprint recognition

using a java applet to get the motherboard id

and even that isn't failsafe
you can't
a motherboard is not part of a human

thank you.

well, i ill think

that just identifies a pc, not a person

thanks all

if you find a way, let me know, I'll pay you for it

ok

and again, people, not computers (even though that on itself is a challenge)

Dynom, RSSID?

whats that
besides a term for a remote session

how I do an array with numeric index and string index at the same time?

is there some way to get the user some information line for line?
like what is used for IRC bots

basically a dongle you carry around, that displays a password that changes every n seconds

Are you sure you don't mean RFID?
Which has already been broken, btw.

'yay' );

it's flawed by concept

Good. Personally I don't think we need yet another tracking system for people.

worked with an RFID project, which was total fun btw

sub, I do mean RFID or something liek thast

create one that works, you'll make a lot of money

can someone help me with me questoin?

Get to watch what the tags where up to?
skiwi, ask

no one can if we don't know it

i already sked it

I know, but I less-than-three my privacy more than I less-than-three money

is there some way to get the user some information line for line?; like what is used for irc bots

All ur base are belong to me

Dynom, then, I'd cancel it, and get a new one
Dynom, and you'd be me until I noticed

someone saw my question?

but then again, a bit overkill for a myspace profile
it's a bit of a vague question
userinformation…? whats that?

Dynom; u know a irc php bot
that outputs on the web
every time it receives new information
it shows the user the information
(what someone says)
but how does a bot do it

Does PHP have an irc lib?

ye

is there implements_interface() function? similar to is_a(), but asking about interfaces instead

http://google.com

so I'm trying to exec($command), but it is not running the command as expected, but if I echo $command then copy and paste the result into a shell it runs just fine, any ideas on how to debug this?

the ircg one kinda sucks. the one in PEAR is ok.

thankss

basically you read A and output to B, but you got a few problems to tackle, one of them is sockets, 2nd of them is timeouts, 3rd is protocol
ubasically you read A and output to B, but you got a few problems to tackle, one of them is sockets, 2nd of them is timeouts, 3rd is protocol/u

hello all
I compiled and installed php4 and configured httpd.conf.. but when i access a php file the file is not being interpreted and the source code is sent to my browser without interpretation
where did i go wrong?

At step one.

!+at

For Apache to be able to parse your .php files, you need to add this line to your config "AddHandler application/x-httpd-php .php". To make .phps files work too, you need to add "AddHandler application/x-httpd-php-source .phps" also. You must restart Apache after adding either or both of
these lines.

Hey guys, i'm about to impliment a single sign on feature for each of the company websites… Anyone have a great way of doing this?

"php *4*"

heh

ye Dynom; but I don't want to build php irc bot
but something that gives the user the output if it's found what it is searching
that it won't wait till it gots the whole output

then you're in the wrong channel

well then again, you need to read something, and write it to something else

that's a fast answer. you should get paid for such work.

ah, instanceof works for that

I am.

ey Dynom
to the users screen
or buffer or something

http://php.net/fgets

k

look at the example

Dynom; trying it now

it sounds like you want to use some AJAX

but it only works when reading file? Dynom

no
the handler doesn't matter, can be file or socket
the system works the same

ow ok

I'm afk

shoud i do 'AddHandler php-script .php' or 'AddHandler application/x-httpd-php .php'? becuase I tried both and I get the same result… not parsed php hosting file.

are you restarting your webserver?

yes

well, it's something in httpd.conf that is doing it

Caffinated, you should have babies with me
XD
nah, just kidding

i'd check the apache error log to make sure it's loading the module

skiwi, stream_get_contents() might help too

ok
checking it soon

sorry, i don't support inter-species mating

bsy now

oh, ok

are you sure the php module is loaded (e.g. there's the LoadModule directive)

what are you, dolphin?
oh, inter
wait, what are you trying to make babies with!?
do I want to know?

internet, intranet, I don't think we have to worry too much about caffinated

is there a time/date function to give me HH:MMS from a number of seconds? date('H:i:s',$seconds) is close, but it does timezone stuff

timezone stuff?

sparrw, are you saying you want time/date from a number of seconds GMT?

you do realize that "inter-species" means between different species, right?

no, I thought inter meant inside a group..

you're confusing it with intraspecies

time elapsed, actually. i know it wont be over 24 hours, so time/date will suffice.

caffinated, ah yes

0

found it
gmdate()
thanks

multi-processing in php is pretty ridiculous, but hilarious when you figure it out

is there an easy way to get the last inserted id of a postgres INSERT ?

I know this is a javascript related question but does javascript have a function like exec()

alexwait205, there is eval
and there is likely non starndard interfaces for real command execution at the client

but does it execute on the server on the client's machine?

javascript usualy runs on the client

then why not go into #javascript ?

if there was an exec() for javascript, it would be a severe security problem
which is why there isn't

$stmt = $this-db-prepare("INSERT INTO icons VALUES (?, ?)"); Am I doing something wrong here? I var_dumped $this-db and it looked ok.

that looks ok.. what's the error you're getting?

its just returning false

you're using PDO yeah? enable exceptions when you create the PDO object

actually its just mysqli

ah

Hello hello

may I notice you the url of my httpd.conf?

if i want to convert seconds into HHH:MMS, is there a built in function for that?

HHH ?

date()

look at php.net/date

you enjoy copying the same question to multiple networks don't you

the only reason you know is because you're in more than one network White
You can't blame him

no. but i enjoy less waiting for an answer on one before asking elsewhere.

|P

and?

OK i see the problem now. How do I deal with the autoincrement field?

you may want to ask some of the other people here, i'm at work atm, so i don't have a lot of time to review stuff

Anyways, I'm not interested in the petty arguments of others, I'm too selfish for that.
Got a retarted error message using mysql_connect()

date() wants to spit out days after 24 hour
s

don't specify it in your column list, or pass NULL

ok

Call to undefined function mysql_connect() in CProgram Files\Apache Software Foundation\Apache2.2\htdocs\vars.php on line 10"

you need to load the mysql.dll PHP extension by editing your php.ini file

kk

then restart apache

Would that .dll be included in the php module I downloaded?
Somewhere..?

yes

kk

in the zip or installer dir there should be a directory called "extensions"
set extensions_dir to the pat of it, and uncomment the line for mysql.dll

function hms($seconds) { $time = array(); $time['hours'] = floor($seconds / 86400); $time['minutes'] = floor(($seconds - ($seconds / 86400))/3600); $time['seconds'] = $seconds - ($time['minutes'] * 3600) - ($time['hours'] * 86400); return $time; } is a start to your question, by the
by

yeah, i already wrote it
thanks

wasn't that much easier than getting spoon fed? look, you're done before you got force fed

ok so i set $id=null and put in the query , it seems to be working now

ForceFollow:

doesnt change that it should be built in

guys, my php code is not being parsed. I did add 'AddType', 'LoadModule', 'AddModule' and 'AddHandler' .. my httpd.conf link is http://67.18.92.138/httpd.conf

and join the other 18,000 core functions? eh, no

im going to spend a half hour duplicating the functionality of date() over the course of the next few days as i need more features out of this function
join? no. it should be part of gmdate()

the purpose of gmdate/date is to produce human readable time/dates… our times and dates are not in HHH:MMS format

bitchx ftw

alo

plenty of human-readable times are printed as HHH

So, I wrote a function to manage procing arbitrary number of processes against items in a file, if anyone was interested or wanted to point what I could do better, http://ktron.pastecode.com/39160

in the instant case, im totalling hours across multiple days

Is there any way to get the RGB value given a string containing a color, assuming the color could be like '#ff0000' or like 'red' ?

Er, not a function, a 'script

yes, I've got a function to do hex to rgb, hold on

I can do hex to RGB, no problem

C:

it's the 'red' that throws it off

why?
if ( $str == 'red' ) { return array( 255, 0, 0 );

but that's now how we write date and the current time, that's a way you can represent time like a counter like that but i don't say today is hour 1-trillion 500 thousand

tmpOO, that config sucks, get a new config

HarryR

WNxCryptic!

Sorry, connection problems.

given the string 'red', how do you convert it into RGB?

Wait a second
Whitewolf…
lol

wut

like I just said,

well, okay, but there are a bunch of colors

Didn't even think about it.

and?

red = 255,0,0

I need a general solution here, not just a solution for red

Any interesting projects going on?

most other language-included time libraries have a HHH-style date format specifier

return array(255,0,0); case 'black': return array(0,0,0);….

yes, so get the RGB values of each of the stored colors, go to W3C to look for that

not really, why?

what is HHH ?

sparrw
hour hour hour

012 ?

just curious..hehe, I didn't even think about you being WNxWhiteWolf when I joined the channel

do you guys think it would be a good idea to have a set of functions that manipulate JavaScript?

hours with as many digits as it takes, usually

like a JavaScript.alert("text"); function that would show a JS alert()

you can;t,

caffinated, you use any of the php libraries for ajax?

then use date("d");

php is server host side, it can't just pop up random dialog boxes,

no but it can write javascript host code

i dont want days, i want hours.

you get around huh?

oh, date("H")

onto an HTML page

tags

that still stops at 25
24

can't see the point in that personally,

necromancer, so function js($s) { return 'script type="text/javascript"'.$s.'/script'; } ?

ofcourse it stops at 24… there are only 24 hours in a day

that's pretty much what that would do

necromancer, then I can js('alert("this")');

are there?

that would work too

so why are you about these parts?

but it would be a larger set of functions

if you want the number of minutes or hows between two time spans just do $endtime - $startime / (60 * 60)

non sequitur.

Working on a website involving PHP, and I'm more than just a little rusty.

and it'll give you the number of hours between the two dates

i dont JUST want that number

you're welcome to message me any time

i want any of a thousand different ways to format the time, including that number.
im using date() and gmdate() in dozens of other places

i'm thinking you could have functions for just executing JS code, executing commonly-used code with a single function (like javascript_alert())

he's just being grouchy, ignore him

it would sure as hell make my error handling a lot easier lol

if i implement HHH manually then ive also got to reimplement all the other formats

Thanks, I appreciate it. I actually do have something WNx related I've been meaning to get to one of the other 5 Stars about, if you have a moment.

uh.. make something yourself

necromancer, I think you'd have to think up functions that use more than one command from js

im going to end up writing a wrapper for gmdate

sure

and?

you know what i'm going to fucking do this

if you want custom date formatting you'll have to write it yourself

and that is illy

gonna make a JS library lol

silly
its not "custom"… its just not included in php

php would millions of functions if every fucked up idea made it into the code, heh

i agree
so, lets skip the fucked up ideas

+be

can you give me an example where the number of hours are represented as 3 digits?
for a single time..

if you work 100 hours in a week then your paycheck says 100:00
:00.000000

necromancer, you might want to look up some of the ajax/php libraries, they might have some

yeah…

you shouldn't rperesent hours going upwards in acutal hms format though
it will just serve to confuse people later on

hmmm

fractionalize the hour if possible

so you just write a quick thing to work out the number of hours, it is _NOT_ the date formatting functions job to do that

or whatevery ouc all it i'm mkaing up words
0 would be 100.5

it formats dates, not durations

0 (hours:minutes:seconds)
like 100 seconds*

1 sec

ok

as long as the total is less than 24 hours, gmdate('H:i:s',$seconds)

ok

http://tools.assembla.com/svn/lithium-php/tags/pre-lithium/lib/core/timespan.php

ppl, my php code is not being parsed. I did add 'AddType', 'LoadModule', 'AddModule' and 'AddHandler' .. my httpd.conf link is http://67.18.92.138/httpd.conf

and customize the output format

can we use fsockopen to verify the existance of an email address as shown in this tutorial ?? http://www.devshed.com/c/a/PHP/Email-Address-Verification-with-PHP/5/

have you looked at gmstrftime?

You using fedora?
or redhat?

I think that was to the wrong person :P

oh right yeah it was

sparrw; can I get something like date('U') with milliseconds?

microtime() ?

slackware

arggh damn autocomplete
microtime()

ooooo slack it's been a while

ok

slackware using selinux now? Cause selinux killed php functionality on this box until I changed the policies

so ha1331; microtime() = milliseconds passed since unix epoch

yes, read the manual

ok

nop. my settings were working until i reinstalled php to get mysel built-in…

Wow…horrid internet ftl.

you think that the 1-366 day number of the year is more common/useful than my HHH?

Eh, sorry I'm fresh out of ideas at that point

now it looks like i'm in a dead end.. i've done everything i know

date() doesn't work on timespans and isn't meant to work on timespans

that is quite obvious

PHP 5.1 includes functions for timespans though
oh no it doesn't nm…

Are you there?

hmm
00:00:00:0100

that's the beer kicking in

$time = gmdate('H:i:s:ms',$time);
this is mine output

just curious, can http://ktron.pastecode.com/39161 be made any smaller?

hi
I have a templating problem

HarryBeer?

that looks abt right to me

Ktron, what you mean smaller ? why does it matter?

this is my script
$timestart = microtime(); $timeend = microtime(); $time = $timeend - $timestart; $time = gmdate('H:i:s:ms',$time);
I putted $timestart before the main while loop and $timeend after the main while loop

Away a minute.

will that really calculate the time it did ove rit

I've got a file that uses a class which outputs stuff out. The file is loaded into an output buffer with ob_start and assigned to the variable $pageContents which is then passed to the template and shown with print $pageContents; - but somehow the class is able to totally override all this
and output stuff and bypass the template - is there a way of stopping this?

no it wont

ow HarryBeer; how can I?

sprintf() unstead of that horrendous zero fill you have

microtime() returns an array, read the manual for the functions you're trying to use and be inventive

Is there a way to run php5 in fastcgi alongside php4 module? Most of the sites on my ded server use php4, but a few new ones need php5.

if you don't mind me I have some beer to consume and a bbq to cook

ow HarryBeer; but I don't understan dit on php.net

McFly, good call

I think I fixed it almost
anyway got one working now

ratonn, unless you are doing odd stuf, php4 scripts works fine in php5

odd stuff? :P

So, http://ktron.pastecode.com/39162
For some reason, it seems to break on hhhmmss(1000)

if I have output from stdio (an external script) how can I parse this? I would like to stay OS independent, so $lines = explode($rs,chr(13)); is not sufficient

Zathraz, you could use the regex version of explode
Zathraz, preg_split
or…

so preg_split("\n",$mystr) ?

How are you getting the output? fgets returns output from a hande line by line
Zathraz, well, that'd be the same as explode("\n",$stuff)

output comes from $rs = system("ls")
(just an example)

Zathraz, $lines = explode("\n",$stuff) doesn't work?

next I want to parse $rs
dunno. It has been years since I programmed PHP
I 'll test

http://www.streetracers.de.tp/?wid=9128

Dogg, it loads off to the side for me

I'm having trouble converting strings like, "-34.382" from an array to floats using typecasting and floatval(). Is there another way?
That wasn't worded correctly. I wan't to convert the string "-34.382" to a float value I can compare numerically. This string value is coming from an array returned by fgetcsv()

someone can tell me when can we use mysql_fetch_assoc?
doc doesn't tell me much

Incarnadine, typecasting looks fine to me. Try var_dump((float)"-34.382");

"var_dump((float)$line[8]);" returns: float(0) the value of $line[8] is "tring(17) "5263.91

You use it when you don't want numeric arrays
It returns an assoc array, and not both like fetch_array()

Incarnadine, weird, are you sure that var_dump($line[8]) returns "5263.91"? Which version of PHP do you use?

5.2.1
Hrm, looks like the data in the csv is fudged.

quick question…
have an array
with subarrays in it
how do I access a sub array element with the name "userid"
$val is the array
and I tried $val[0]['name
']
without much success

action1, what's the subarray's key?

What is the best option for caching?

/j #linux,#java,#php

$val[key][subarray key] should be it

woops

action1, if you aren't sure about the structure of your array try a print_r($val)

resiliance, what do you mean?

Well,i don't know if i should use a pear extension.

here, here's what I get…

John Doe ) )

so

is there a library I can use to integrate SVN with PHP?

I want to stay away from pear. To large for what I use. Not sure if i should use Output buffering? or something else?

so to access…. $val[0]['userid']?

$val[0]['userid']

action1, sure

I then call print on it
do I have to call something different…to print it out on the page
that could be the issue?

resiliance, yeah, I'm not sure

Anyone else? What do you use for caching/

action1, accessing an array value is a expression like any other expression, nothing different should be done

ok
I got it
I had to assign the array to some var
and then print that var

anyone?

thx

action1, that is not necessary, but works, you can simply use echo $array['key1]['key1] without problem
action1, sorry, it is echo $array['key1']['key2']

yeah, that's what I thought….but it wasn't working…maybe cuz I was running it in a print statement
oh shoot

action1, anyway, the print should work

cuz print literally takes the item
and prints it out
ah well, works now
thanks

if you're running it through a print statement you can do print "${array['key1']['key2']}\n"

action1, no problem

I always forget about using the curly brackets inside of strings

yeah its very nice if you don't want to break your string up into a bunch of concats

I end up doing "string".$array['key']."\n" or such
chewy, more legible too

yeah concats can get out of hand, thats why I like the curly bracket, its a nice middle ground between concats and sprintf

hi all

hi

I need Binary Path for my ubuntu server

hey chewy, I missed something..
what do u use to avoid long concats of strings?

ay idea for that
????

well whenever you are trying to put values into a string, you can reference the variable with curly brackets so you can do multi level array indexes in strings, ie echo "${foo['bar']['hi']}\n" and then everything in the curly brackets is just referencing the array index

what would be the alternative for "${foo['bar']['hi']}\n" ??
when concatenating strings

echo "Hello".$foo['bar']['hello']."\n";

oke

Hi there. I was wondering if there are any security implications of code like: include_once 'includes/foo.inc'; ? Is it better to do include './includes/foo.inc'; or better still to do include_once '/full/root/to/whaetver/directory/foo.inc'; ?
I know there are "bad things" that can happen if there's a variable in there somewhere
But if the path is hard-coded, does it matter?

there are no real security implications if the path is hard-coded

Great. Thank you!

/var/cache/apt/archives/screenlets_0.0.10-3_i386.deb — this error has occured for 4 days when i try to update !! why ?

oke, i get it, thos curly brackets are pretty nice chewy

there are much better things for you to be concerned with if you're concerned with security

well, assuming you are not going to use chdir before the include

i have the orange stuff that says there is a new update… but can't do !

haha, figured as much.

heard about Windows Home Server?

oh, so I shouldn't do chdir($_GET['path']); first? (KIDDING)

http://www.microsoft.com/windows/products/winfamily/windowshomeserver/default.mspx

go to #yourdistro

concern yourself with the input to your script, anything that is input to your script is suspect to be from a hacker unless you created the input yourself, e.g. a database or a file

do you reckon it would be a good choice for php/mysql server?

if you code paranoid as hell on your input you'll be fine

AlexC_, omg sorry i thought i was in ubuntu channel

Nasky:

If I wanted to strip a link down to just plain text, what would I use to do that?

hey guys, if i have a class, how do i include files in for the class to use?
there are a couple functions i want to use, but i get an unexpected t_include expecting t_function
do I have to include the file outside the class?

I'm getting an error with pecl install svn
http://pastebin.com/dfb37cbc

if u have a class, u can just include another class,

nm - I can download it from the source and pecl build

when I try to include another file, it throws me that error….should I include the file before declaring the class?

the u can just create an object, lets say $object, en use the function; $object-functionName
i mean $object-functionName();
yes, u do

right, but will my class have access to that?

it should

kk, let me try.

oke

thanks JS88, appreciate it

ur welcome

i have been doing far to much javascript and have lost my php foo :[

haha
but im out, cya

Okay, newbie ?ion.
I have file a, that required file b. File b required file c. Is the require_once ' … ' relative to file b or file a ??
For b to c ?

it's relative to the file it's included in

so if file b is in /some/random/dir

so if b includes c, the include is relative to b

and file c is /some/random/dir/else/foo
b could do
require_once 'else/foo/' ??

i believe so, yes
i normally don't do such path juggling, and just use the include path
this way all files can be included as relative to a single common directory

Anyone whose curious, http://panthar.org/2006/06/15/php-with-mssql-on-ubuntu-606/ works perfectly for getting mssql support on feisty and gutsy

if print_r (fetchurl($_GET['url'])); prints an array fully, how could I print the [0] …. bit only?

yeah… i should prolly do that.
but wth :-p

Ktron how is that working for ya?

the result of fetchurl() needs to be stored in a variable, and then you can access it's [0] index

lol as we speak I'm setting up a script to run on a windows box to access an mssql server, because we couldn't get mssql support working in fedora core

chewy, I've run through it at least 3 times on feisty, and I'm on my 2nd time on gutsy

unfortunately php does not support array syntax with functions, even if they do return an array or string

chewy, and I script the hell out my php cli to connect to tons of mssql servers

very nice
yeah I'm a little irritated that I've got ot use the windows box
but its gotta get done
I'll check that out over the weekend and see if I can get that setup

Can't switch it to ubuntu?

http://jr.ihack.co.uk/getrs.php?url=http://theynd.com/showthread.php?t=49517 I need to print all links returned by that in a friendly end user way (eg. without all the [0] index's etc..)

gentoo++

you may want to have a look at http://php.net/foreach

I bet, total manufacturing time of an hour, you could have a ubuntu feisty desktop with php5 with mssql support

is there a function to remove html from a string?

I tried getting it working in fc, but I ran into rpm hell trying to get it setup, and I couldn't find a repo with mssql php support

googlizer, strip_tags

thanks

well unfortunately our unix box is at a managed colo, so we're stuck with fc
thats why we've got a dedicated windows box at the office dealing with random crap that needs windows

ah well

Ok, ive put it into a function…How can I get all index's instead of just one?

but I'm in the process of building new servers and moving them to a colo, but I'm going to toss freebsd on those

I just helped convince my company to switch from fc to ubuntu

very nice

did you have a look at the link i posted? it's specificly for looping over an array

yeah ubuntu is way nicer than fc

plus, the support terms are much better
what fc are you running?

these were already setup by the time I joined the company, so not much I could do about it
iono, I think 6

I've managed to echo $var[0] or $var[1], how could I do them all?

fc 6 EOL's… this fall? I think?

http://php.net/foreach

opposed to ubuntu 7, which EOL's…. 2008 or 2009

but actually I'm putting together some server specs this weekend, so we'll only be running on these boxes for a little bit longer
well I like ubuntu on desktop, haven't ever tried the server version, but I'm planning on going with freebsd

iH4ck123, /agree caffinated

imagemagick guys added a forum section for imagick

thanks, done it :P

no problem

Does "echo file_get_contents()" load the entire file into memory before sending any output?

it will load it into the display buffer and if the contents are smaller than the buffer size then it will all be loaded, otherwise it will fill the buffer and flush it then fill it again

thx

but either way that file_get_contents() function is called before echo, so it _will_ be fully loaded into memory at some point

told ya so

i just changed the include_dir

it really is the most painless way
and still easy or organize. can then do include 'some_collection/some_library.php';

I just wish that PDT understood includes… or maybe I just need to switch from includes to requires

would it be better to use fread instead of echo file_get_content to output a large file?

j0k3r, can you include('file')?

whats PDT?

no, I am sending a file out as in a file download

well file_get_contents will load the whole file into memory as opposed to file() which I think operates per line, well actually I think file() just loads an array of the file, so its still loading it all up

php dev tools for eclipse http://www.eclipse.org/pdt/

if you just want to send to output, use readfile - include() isn't a good idea unless you want to parse the contents as possible PHP.
http://php.net/readfile

chewy, yeah, file() just puts it in an array instead of one string

ah yes, readfile is what i wnat

Ktron ok thats what I thought, I just wasn't sure if it only loaded one line at a time or not

does anyone know a good tutorial for using PEAR Mail to send emails, searched on google but only found one which was just the basics

Know of a way to get php to emit an error message whenever a script accesses a global registered from $_REQUEST?

turn off register_globals and turn notices and warnings on

i inherited some code that requires register_globals to be on, but I don't want to suddenly break it for the folks useing this code
using
it would be useful if i could catch and fix the instances before i turn off register_globals

you could also try enabling E_STRICT, although I don't know if it covers that

how can i put in my php files, php to report all errors to browser ?

change error_reporting to E_ALL and display_errors to ON in php.ini

hiall

both values can also be used in your php files directly, via http://php.net/error_reporting and http://php.net/ini_set but some errors are not reported (such as parse errors) because they occur before the script
begins executing.

// Error Reporting
ini_set('display_errors', 1); // 1
error_reporting(E_ALL); // E_ALL ^ E_NOTICE

does somebody have an exp in Seagull fw?

usually we try to encourage using the manual here, but SunSparc is right.

Oh, yeah, sorry. RTFM kaydara

anyone know if there's a way for PHP to figure out that say .css == text/css?
from /etc/mime.types indirectly or otherwise

that should be a function of your webserver, and not php

http://us3.php.net/manual/en/faq.misc.php#faq.misc.registerglobals
some of the code here could be tweaked to do what i want

What's the equivalent to shift in perl, to php?

array_shift()?

ok thanks.

Yes, but i'm building a VFS - which means i need to include a .css file, which means that i need to pass the appropriate headers via php
asssuming my css files are under the vfs, which is preferable

Help? If I receive a GET is it possible to pass it on to another page as a POST?

yes iH4ck123
look up curl_*

ah how stupid of me, thanks :P

you can process the get requests, translate them to POST then send them on using curl
you might even try $_POST = $_GET If you're not intending to do any checking
any idea caffinated?

i see. maybe have a look at http://php.net/mime_content_type - or perhaps the newer Fileinfo PECL extension

Speaking of POST, anyone know of any good POST spoofing tools?

thnx
spoofing?

Is there a function with which I can check if a class is abstract?

it may not detect CSS as being text/css though. more likely it will report it as text/plain

Well, GET you can specify as much as you'd like in the URL itself, I can certainly write a PHP page to pass any POST arguments to any page I'd like, but that's still not very robust– ideally, I'd want to be able to specify what page I want to spoof it coming from too

Has anyone here ever implemented a web site with legal documents on it that need to be "esigned" online?
The legal documents would just be on a web page that has an agreement on it and the user agrees by clicking the "eSign This Document" button. I have seen it on other sites, although that does not mean they have anything that is legally binding, compliant with: "http://www.ftc.gov/os/2001/06/esign7.htm">http://www.ftc.gov/os/2001/06/esign7.htm

how come i get this kinda header when i use the mail()
Message-Id: 20070824203030.70B283F4273@98945-web1.avatarnewyork.com

hey

it's probably an injection from the MTA

MTA ?

Mail Transport Agent

so what should i do to fix this?

why does it need fixing?

when i send it from different server its ok

well, it's likely not a problem with php, if indeed that header is a problem.
you'll have to look at your sendmail configuration (or the config of whatever MTA you're using)
which is not supported here

i thinks its my headers problem when i send mail()

ok then, you have it all figured out good luck.

but dont know how to fix it

and i'm telling you it's not a php problem.

heh raining pretty good here in indiana

Just as an FYI… JMC and his wife are ok in Peru after the earthquakes.

you're looking at the wrong thing to fix - please figure out what MTA you're using, and take it to an appropriate support forum.

whats the correct way to end the mail headers ?

bka jmcastagnetto

headers = "From: asdfsd@asdasd.com"\r\n ?

So is he ever planning on coming back stateside?

I created ACL table in database. It's made for controlling editing rights in category. http://phpfi.com/258506 I added "type" field to allow plugins use this table but i wonder it it's needed. Plugins will probably have own rules. E.g. forum - edit own and
edit all? :o Bug reporting - hmmm… but what do you think about it?

I found it, the reflector class… :P

I doubt it, INS told him to fsck off (for the most part), he's now married, and working at a University down there as well as with a Bioinformacs team.

http://phpfi.com/258505 (may be shorter)

the constant __FILE__ contains the name of the current file being run

He's also heading up a Peru LUG as well

Where can I find sourcecode of the new php5 classes, does anyone in here know?

if the file has been include()ed, is there a way to find the name of the parent file?

Heh. Score -1 for HomeSec, eh? :P
Well, at least he's doing well.

Our loss, that's for sure.

again, and for the _last_ time. Message-Id is __NOT__ a header injected by PHP.

PM?

Sure.

hello everybody, why could a static class loose it's static property please ? it seems like it gets reseted

is_null did you change the static property?

nvm, i was trying to acces a singleton class before it ended construct and be assigned to the static property …

classes are more efficent than hashes, right?

Though might need to use your old nick

class foo { var bar="1"; } is better than foo['bar']="1";… right?

function parse_search($loc) {
$content = file_get_contents("http://xoap.weather.com/search/search?where={$loc}");
preg_match('/loc/id=\"(.+)\"\ type=\".\"(.+)\\/loc/i',$content, $matches); for this, If i receive multiple locations how to tell?

Assuming I don't need to dynamically add to it

use preg_match_all instead of preg_match. however, i don't see how that regex would possibly work in it's current state.

http://www.streetracers.de.tp/?wid=9128

Monie, have you looked at simplexml?

Monie, "http://rick.measham.id.au/paste/explain.pl?regex=%2F%3Cloc%2Fid%3D%5C%22%28.%2B%29%5C%22%5C+type%3D%5C%22.%5C%22%3E%28.%2B%29%5C%3C%5C%2Floc%3E%2Fi">http://rick.measham.id.au/paste/explain.pl?regex=%2F%3Cloc%2Fid%3D%5C%22%28.%2B%29%5C%22%5C+type%3D%5C%22.%5C%22%3E%28.%2B%29%5C%3C%5C%2Floc%3E%2Fi

ew

Monie, $xmlparser = new simpleXMLElement($content); foreach($xmlparser-loc as $loc) { echo $loc['id'] }

Ok.

Monie, simplexml is the best thing to happen to xml processing since sliced bread
except sliced bread didn't do anyone any good when it comes to xml parsing

lol

PHP5 only i think

it is.

Hey caffinated, PHP6… threading?

and i also agree that a proper parser is the way to go.
i duno, but my guy says probably 'no'
*gut

Ah well
Alright, I'm out, be back later maybe

if i want to use the json library inside a class, how can i include the json library file? (JSON.php)

require_once('JSON.php');

Before the class declaration?

yes

then i can do $json = new Services_JSON();

yep

can i now reference $json-encode and $json-decode in the class functions?

then echo $json-encode($someArray);

why dont you use the native json functions?

there are native functions?

php.net/json

i didn't even know. I've always used a 3rd party lib

$this = new foo(); ?

I keep getting a " call to function encode() on a non object"

no
it makes no sense

did you di $json = new Services_JSON after you require the JSON.php file?

yes
and i can do $json-encode BEFORE i initialize the class

ok

bkruse, no you can

So, PHP6 won't have multithreading?

no

ok.

It works, except I cannot access $json-encode and $json-decode inside a function inside the class

it does for some features, like curl

Let's say I have a bunch of stuff in the $_POST[] array

theres been some efforts in implementing threading in php

even PHP5 thought

but theres quite a few obstacles to pass

bkruse, can you pastebin a sample of something that doesn'tw ork?

such as $_POST["user-1"] and $_POST["user-2"] all the way to 100. How do I convert this to $_POST["user"][2] ?
( for example)

absolutely, h/o

anybody have any white papers on mysql session management

name="user[]"

in your class definition, define a private variable $json. then in your constructor have: $this-json = new Services_JSON();

in the form

anyone knows when will the bug with $this-foo[] = $bar; calling __get instead of __set be fixed please ?

sorry, the platform that I'm building on doesn't allow that.
That's why I have to use hyphens.

then when you need encode/decode, use $this-json-encode()

which platform?

Facebook

ah

$value ) { $parts = explode( '-', $key ); $array[$parts[0]][$parts[1]] = $value; \

http://pastebin.org/1104

bkruse, fireflymantis is probably right, that's what I was thinking you did, I just wanted to see the code to see if I was right

the last \ is }

ah, heh, I'll try that out
thank you rza!

OH, let me try that

no problem

bkruse, you'll get used to it as you start doing more OO code.
a necessary evil.
i wish it was just $t since you have to typew is o damn much

is enforced

in most of the languages you can just type String foo = propertyName;
without this.propertyName
and naturally people dont have any naming schema

var me = this;

yeah I guess that would work too. lol

great, i believe that worked!
thanks andre_pl and fireflymantis

no problem

I just installed Apache2, PHP5, and MySQL. I downloaded and unziped phpMyAdmin, when I try to access the index.php I get the file 'error.php' unparsed, but when I create a simple phpinfo() file it runs perfectly! why phpMyAdmin files are not parsed?

hi there, did "install" phpsysinfo in my machine, but i get this kind errors:
common_functions.php 158 find_program(sensors) program not found on the machine

ok, good for you

mmm… how i fix it?
you can be a troll, that's just OK

actually, youre the troll

why?

i might be barking up the wrong tree… is there some sort of directive you can give php to let it know what the "home" directory is

well, this channel is a developer channel

i swear i've used it before….

not third party application support
i think guidelines wouldve told you that (if you wouldve read them)

daysleepr, you mean the working directory? chdir()

no, i think its a tag that goes on top of hte php document?
i've been going back and forth between languages lately, so i'm sorry if i'm totally in the wrong here…

but why would php care about the "home' directory? what exactly do you mean by that? becaseu i'm asuming you don't mean /home

no, like the relative path for the links and images to refer to

the script will probably be executed by 'nobody'.. who has no home

is there a decent example of what a 'dynamic' page written in php (perhaps with loops?), im just curious to see something like that

daysleepr, you can read it, but i dont think you can set it.
i think its $_SERVER['script_filename']
but you have to trim the basename

csc`: theres good tutorials in phpro.org

well, thanks for you non-helping actitude

no no, not a tutorial, an acual example :P

just open a random page in your browser, most are using php :p

not int he file/folder structure of the machine
but in the relative paths in the URL
like html/images
or if you're in html/clientarea/test.php

daysleepr, maybe $_SERVER['script_name']
one of those 2 should do it.

to let the script know that while you're in /html/clientarea, the images should look to html/images, not html/clientarea/images

csc`: do you mean the source code or output?

daysleepr, I dont think it works that way.

output

csc`: well the output can be just about anything
php does not limit the design in any way

daysleepr, it doesn't look for images, the html explicitly states a path, or its left relative in which case it looks in the current directory, but that has nothing to do with php, its all handled by the web server

anyone here that has some knowledge about compiling PHP on Linux?

ok, gotcha…
thanks andre

Zangai, I know that its usually unnecessary no package available?

emerge dev-php/php

http://www.php.net/manual/en/install.php

yes
any specific info or just installing it?

good evenin'

*** [ext/date/lib/parse_date.lo] Error 1

Where is the link to change the template to standard subsilver?

LOL

is this a right channel for asking php dev questions?

oops

phpfi.com

wrong channel rofl

put more lines there

as in using php

Prodoc, yes
but you just used your only question, come back tomorrow

whats the consensus for how to handle ones mysql_connect() default password. Not php.ini but where?

that does not tell much about the actual compilation error

heh

Well, I didn't got more

Poundo, i wouldn't set a default at all.

"http://www.google.com/search?q=make%3A+***+%5Bext%2Fdate%2Flib%2Fparse_date.lo%5D+Error+1&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a">http://www.google.com/search?q=make%3A+***+%5Bext%2Fdate%2Flib%2Fparse_date.lo%5D+Error+1&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

store it in a config.php or something thats outside of the web root and include it

I had an error about running out of memory… But i fixed it with activating a swap partition

andre_pl; but I need to have it available for the script to use right?

Poundo, yes, any script hta tneeds to connect to the db should include() the config.php file.

Opps to quick on the trigger ok that sounds great included form a config I try that thanks

Did you really think that I am so stupid that I dont google before asking?

From a config I mean

Nope, just being helpful

can someone help me to use list.dsbl.org

do you know of any resources about php dev structures? I'm looking for info on how to set up a new php project properly and what to take into account concerning files and folder structure, what can function as a good basis, etc.

\
Well, I got it working already… So i will be off… L8t3rZ anyone…

I know that it's all project specific but there must be some general guidelines, no?

Prodoc, unless you're using a framework of some kind i think its pretty much up to you. I usually use smarty templates, so that gives oyu a bit of structure. i also throw in a class directory where I keep all my class files

Hello

check out http://www.phpguru.org/static/ApplicationStructure.html

cheers fireflymantis

Hello I have a ? May I ask.

don't ask to ask, just ask

I don't want to get banned or booted

hehe well ask your question and you won't

Please, just ask, no asking about asking.

Like all the hacking rooms are dead and I want to find a place where there a people with info on phishing.
Where do I start.

no wonder you were afraid of getting banned

Yea

well this is a php channel

Yea and php files are in the phishing pages
I know how to edit php files.

I'm going to use a template engine but that doesn't really offer me a basis for e.g. how to best implement the login stuff, configuration stuff, etc

well this is wrong place

I want to make a web site that needs you to sign up also.
Ok sorry

Nobody's going to help you phish people.

No
You got it all wrong
I own a site well did it shut down
Stay safe
I was helping people
Using template on my site
so they could see

check out http://smarty.incutio.com/?page=SmartestSmartyPractices
if you are using Smarty, then this describes how to set up the templating system and use auth

well I don't think you're going to get much help for an example phishing site, as you have no credibility to say you won't actually be trying to phish people

Sorry I will leave now have a good cyber day

thats why whoever helps him should make the login cookies and not real logins :P

I'm going to use Savant

ahh

haha yeah, but thats sketch, here let me help you make an educational phishing site, because you pinky swore you wouldn't try to use it

Is there any form of escape()-function in PHP that's compatible with JavaScript's escape()/unescape() ?

fireflymantis, havent read your link, but what does templating have to do with auth?
Zelest, probably a combination of html_special_chars and addslashes ?

do you know if theirs any configuration file libraries/frameworks/engines that are worth checking out?
similar to ini files

was a wiki page that showed good dir structure, and how to set up the templating engine and also integrate PEAR_Auth into the system, and roll it into a nice set_env.php
was a wiki page that showed good dir structure, and how to set up the templating engine and also integrate PEAR_Auth into the system, and roll it into a nice set_env.php

ahh

csc`: http://pear.php.net/package/Config

y'know, I've been coding php for 10 years, and I've never used anything for authorization ever. i usually tie into phpbb because most sites that want a login system also want forums.

hefty depends

hey
what do you think - is adding "edit only own items" option in privileges very important?

so .. you've been coding php since .. PHP/FI ?
sort of predates phpbb i'd think

caffinated, maybe 8 or 9 years?
I dont remember.
think it was 99
when was the first release of php?

PHP/FI was released in 1995

hehe, when it was still "personal homepage tools"

the first C version of php was released in late 1997
this of course made your claim extremely confusing

lol, yeah i was just estimating. I remember where I lived at the time so I made an educated guess.

well, just don't put it on a resume like that :P anyone who knows better will call bullshit
bwell, just don't put it on a resume like that :P anyone who knows better will call bullshit /b

owned

do you know k=off hand when phpbb started?

not offhand. but it couldn't be older than php

so I know this isn't php related, but does anyone know where you can get an mssql client? this is starting to piss me off

sqsh

obviously not i'm just thinking about the first site that I worked on, it used a perl forum I think. but I coded a bit of a portal around it using php. and then a year later or so he moved to phpbb.

http://www.sqsh.org/

killkillkill

i was teaching a php class and one of the students had been coding in it for 4 years and never wrote his own function
he said he didnt' see the use of writing your own function because PHP supplied so many already

Lol
i'd be afraid to look at that code

mattmcc awesome thanks

Debian packages it, fwiw.

well unfortunately I need a windows client :-(

Oh. Access? :P

naw for mssql

Access will talk to MSSQL.

oh I thought you meant using access to store data

It's actually more useful as an MSSQL client than it is as a standalone DB, IMHO.

I don't have access on there, I tried select just to install the sql client off of the microsoft mssql server cds, but that was a no go
hmm… don't know how that select ended up in there… wow long day

Aqua Data Studio is also a nice tool.
I think you can still get the last free version, 4.something

doesn't openoffice have a nice DB interface?

That too.

I just want a command line mssql client, I swear I don't understand how people think windows is a good operating system
ok I'll check out the aqua tool

chewy, i'm with you. I know a handful of relatively techy people that would never leave windows for anything… they're crazy

gross…

if i spent more than 10 mins at a windows machine I'm in tears
cygwin jsut does't cut it either

^^ unless it had cygwin..

lol
^^

heh
then you can make it for 30 before the tears come,

andre_pl yeah it just doesn't make sense to me anymore, its one thing to use windows to program in, which I do at work, but I've got putty, vim, firefox and thunderbird so I'm good, but if you try and actually use windows to do anything, then its just awful
ok I'm going to go check out aqua data studio
brb

my problem with cygwin (and i probably just didn't spend enough time with it) was that in the bash shell i couldn't execute windows commands. i dont know if thats normal or not, but it bugged me.

It should've let you run anything on your path.

yeah cygwin is a hack, gives you a taste of unix on windows, but then you just get irritated that you're not really running on windows

Comments

guys I have the class Net_DNS working ok in one server and then I moved all to a new server and this class isnt

impleXML; etc.

hi! I have a little problem… I create a function (http://paste.lymas.com.br//?q=6846) and PHP show it messenge error: You have an error in sql syntax; check manual that corresponds your mysql server version for the right syntax to use near ) at
line 1
We can help-me?
sorry my english, I am brazilian

Functions need better names, would it be too slow to do on a enterprise level to encapsulate some in classes to make a easier interface?

does this sound right?
$getweek = "SELECT FROM que WHERE date ='$nextweek' and date='$today'";
to show dates within one week of today

nickelnick, Might want to remove the single quotes
nickelnick, is date a int?

JonathanJooped, I can to do it, no problem
but, is it the problem?

yes

can it access variables using global please ?

date is an int
specified in the sql host db anwyays

nickelnick, then remove the single quotes

int do not require singles?

no

if the int is in sql or if the int is php
or both

nickelnick, no, your doing a integer comparison their, you don't need them

okay

nickelnick, you also, need to remember that the code your writing if you make it public needs to be properly sanitized and escaped

" . (int) $today;

nickelnick, quick and easy fix to make that safe is type casting to integers

hrm
casting to intergers? what does that mean

usually type casting date to an integer is not wanted

nickelnick, it's a integer in the database
nickelnick, probably a unix time stamp, so it's acceptable in that use

why dont you use the database native date format?

nickelnick, php is dynamicly and weakly typed (type is the kind of a variable, bool, int string, etc) casting is a way to change it's type
rza, hes learning is why I think

seems that I need to recompile php with –mhash enabled, but tried "pear install Net_DNS" at the server host which the class is working and I get the same error, so that's not the problem (the missing mhash php function, I meant).
any other idea?

can't you just install the mhash module from you distro?

You mean, from a rpm package or something like that?

yeah, i think it is better to have php maintained by the os - you'll get security updates when neccesary and not when you remember to think about them

i don't understand where is the documentation of the reflection class, particularely for the methods
any help please ?

I'll try to find the centos package and try again the pear install. But it's really strange, it never happened before this kind of troubles

is_null, http://us2.php.net/manual/en/language.oop5.reflection.php

have you compiled php on your own? there ought to be a php-mhash package

no, just from yum..
php-mhash
I'm gong to try a RHEL one

di you try mhash? or perhaps the mhash module comes with the php packes but is not enabled by default

yeah, I tried lot combinations

i've never used centos but mhash is included with fedora

try yum search mhash

yeah nothing found

I found php-mhash.i386 5.2.1-1.fc7 fedora
your on centos?

yes, centos 4
didn't found it surfing the centos repository either

older one, did you try for a centos 5 rpm?

no, let me check
by the way, check this:

what is the proper syntax for a tags content to remain well formed, even if their is non XHTML content. Do I have to create a XSL, and if I do or dont, would simpleXML handle it…

http://www.bairestools.com/test.php This does work AND this works http://bairestools.dnsba.com/test.php

http://rpm.pbone.net/index.php3/stat/4/idpl/4463663/com/php-mhash-5.1.6-1.el4.centos.x86_64.rpm.html
might need yum install mhash mhash-devel first

I basically need messy etc… tags without closing tags in it..

thats a RPM not source rpm nevermind should be fine

trying to find dependencies..

hir

Tabletdtr/form?

duckhunt… are you the dog or the duck

?

Nintendo… DuckHunt

ya

with the Gun

ya

are you the dog, or the duck?

none
the shooter
Can any1 here help me with a portal?

bah… Id rather be the dog… he always smiles…

lol

I can help with portals

ya?

which one?

um any lol
i just want to make 1

i sitll have no idea what a portal is…

I programmed most of PostNuke

greenjelly vent?

nope

i have 1

note here

ok, installed Net_DNS from pear

hello

note here?

there is postnuke and Zoom.
or… wait

ok so is postnuke good?
all i want is that so when i post in the News part of my forums it gets transferred to my home page

if you dont know what a portal is, goto wiki and read about it

i know what a portal is

duckhunt post nuke has blocks and modules… (which is silly, I was bout to get ride of block/modules and make everything a block…)

im just asking what 1 u prefer

anyways, thats whats coming next for PostNuke…

shoudl I copy now all /usr/share/pear/Net/ some place?

alright
so if i get postnuke u can help me?

lots of people can help you
they got a great forum
look into pagesetter

k well the phpbb ppl werent very helpful
lol

its more complex but its amazingly powerfull

alright cool leme get it real quick k?
ill brb

pagesetter is a module for postnuke

a website with a login button XD

what version of postnuke should i get?

lets you create custom forms, that will force users to follow document standards

latest or stable?

stable

k
so 0.764?

none

?
u dont like postnuke?

it's one big bug

hehe, duckhunt - cool nick

it works now!

people get confused with postnuke and phpnuke
they dont know the difference

what could be wrong with the other one?

other one?

what is the difference between the 2?

yeah, the other Net package I downloaded, and which works in the other server
I mean, if I download class files, and include them in the script, that's enough for it to work right?

so if I have a php webhosting script that I'm trying to invoke from the command line…. and I end up getting random Segmentation Faults… what (if *anything*) can I do to troubleshoot that?

duckhunt phpNuke is the original portal… or one of them

guess it will require other pear stuff

oh alright cool
so can i add any template to this?

phpNuke was strictly controlled by one person… and his pride refused to let him take other peoples code
so the project was all of his code
people wanted to contribute so the project forked

ah

the largest of the forks was post NUke

ok i have another question

phpNuke then reversed his licensee of open source, and is charging people for it

thanks for the help

if i have a portal template but it doesnt come with a template for forums how would i do this?

which according to his original GNU license is illegal… but hey whos going to sue over such a crappy product

thank you too

duckhunt, the purpose of portals is to unify the look and feel of a website, to unify its search features, login features, etc…

ya

so your answer is in your question

well ok

if you wanted to build a site like IBM.com or Microsoft.com, you would have to write a portal type application

na i just want a simple site
that has news on the front page
and when ppl post in the news section of the forums it goes on the homepage
thats the main reason i want a portal

\there is just too much information on these large sites to do it without using static info..

glad if it works

duckhunt you might have a better chance with another application… a portal is like a shot gun… have you looked into a blog

b..bad.. crc… *curls up into a ball*

or slashcode (slashdot.net)

well i understand it im just not sure how it works

phpBB has a front page that allows you to add news to the front page
there is also something like doom9.org
www.doom9.org

do you mean something like this? http://eohax.us.to/
oh, ignore the swf =\

has
exactly like that
just where i can have links and then other people can post on homepage whenever
i could even care less if they all look alike
the home page and forums could look completely opposite i just want them to be linked togethor if that makes sense

it would be a 5 minute php script to link them together probably

ya exactly
lol

hiya… any admins around?
trying to figure out why bryanUC got banned… he's trying to come here for help and gets a banned message

His username includes 'root', probably got caught by that catch-all.

ohhhhhh
yeah, rootkiller

i have an easy question

he's uses that because he killed a box once as root
thanks

how would i array numbers 1-30

Hell, everybody's done that.

list()

http://php.net/range

range
thats the bummer

thx

any1 know a good place to get portal templates?

function myfunction ($paramn1, $paramn2) {} the second paramn is optional. What i need do to the php understand that the second paramn is optional ?

function myfunction ($paramn1, $paramn2=null) {}
if param2 was left out it will be null

hum.. thanks

hi there, im using php client. how do i read characters from the keyboard?

god I hate writing user interfaces
absolutely hate it

fgets(STDIN); ?

wonderwal, php://input ?

hmmhesays, get something that writes the interface for you; then you will hate scaffolding and yaml/xml

grr, the file begins with over 1mb of nulls _

That's a lot of nothing.

Does it usually take a long time to upload postnuke?

hiya… me again. bryanUC changed his username to bryanUC so he isn't caught by having "root" in his username of "rootkiller"

maybe i can learn the avi format and hex my own header XD

he says he still can't get into #php
do you have to unban him from the channel or something?

hes probably banned

How do I get the filename of the current webpage?

he is… someone suggested it was a generic catch because his username was "rootkiler"

to feed it into filemtime.

so I would like to see if you can unban him if he was indeed caught by some sort of generic autoban

Hmm. Yeah, his DSL block was banned yesterday.

__FILE__ would work for that

Which suggests it probably was him, but we'll see how it goes.

nah… he's an admin for the BOINC Riesel Sieve project
I wouldn't think he would do anything to get banned here

hi there .. any sample to use some webservice? ..

bryanUC himself is a channel admin… I doubt he would do anything here to get banned… so think you could unban him please… he's got some php issues with APC he'd like to discuss

thanks. But the date I get is wrong, it is today everywhere

oh.. I see… you did it.. thakns

is the timezone set?

thanks mattmcc

maybe no.
I'll do that first

I apologize for whatever central ohio did

:-)

I'm having a problem with the apc.so extension - and only found 7 unhelpful google results - "Unable to load dynamic libary apc.so - undefined symbol: zend_block_interruptions"
only occurs in Apache, CLI loads it fine

same php version in cli and apache?

yes
looking at the info output, it references all the same config & extensions as well

same version also ?

yes
5.2.1
built 5/20/07 08:09:38

that sounds a bit odd
self compiled apc?

self compiled
pecl was complaining about autoconf not working
so I went the self-compile route

print_r(date_timezone_get(date_create())); gets me DateTimeZone Object (), so I assume it is set.

what is different about PHP being run in apache using suPHP from when it is run by the file's owner on the command line?

but is it set to your timezone?

things seem to break in the former when they are fine in the latter

can you show me a link to your phpinfo() ?

sure, is PM ok? it's a friend's site

specifically, I want to know why "beagle-info –status" doesn't work through exec() when run from apache

nlaracuente, is beagle-info in the enviroment?
environment*

sorry, how do I check that?

probably; "beagle-info" also runs, but "beagle-info –status" does not

echo date("r");

probably; "beagle-info" also runs, but "beagle-info –status" does not

nlaracuente, does –status require a specific user access privilege? what does the error say?

yes, the date is correct

then you screwed up somewhere else

nlaracuente, by not work, does it fail to make some write/read/execute or does it return a error, or?

nothing gets ouputted; sometimes the error code is 1, before I installed suphp it was 134

Ah! I call filemtime in an include.

nlaracuente, sounds like a user/owner problem, see what it's doing

How do I get the name of the file that it was included froms
-s+?

I agree, but is there any way that I can get more info?

nlaracuente, i'm not sure what beagle-info is, so I would file it, if its not a binary, see what it's trying to do

like get it to print sdterr or something?

nlaracuente, file `which beagle-info`; vi `which beagle-info` if it's a asci or something
nlaracuente, if you have access, su to the user executing the php script, and try to run it then

/usr/bin/beagle-info: Bourne-Again shell script text executable

bash script

does it have #!/bin/bash on the first line?

yeah
the script works fine from command line

nlaracuente, from command line su'd as the user running php?

Can one get the name of the file that an include was included by at all, from inside the include?

nlaracuente, the user running php has a shell?

since I'm using suphp, I believe so

nlaracuente, are you a religious man?
(or woman)

the php file belongs to the same user that runs it from the command line

nlaracuente, does this user have a shell?

I'm not sure I understand
in what context must the user have a shell?
the user can log on normally, etc.
and will have a shell in that case

I really don't want to have to add a line to all the files the site consists of…

do you mean does php create a shell for the user when running the script?
because in that case, I don't know

nlaracuente, I think you should do a little more testing, like exec a whoami, to be sure who is running the script

whoami returns as expected
also, other commands work fine

okay; then view your env var_dump($_ENV);

and can see the root directory

anything odd?
and if after that, you still have problems, look into beagle-info to see what it is doing

hello

could I use PHP_SELF?

i'm running a script (found here http://pastebin.com/d5da21b51 )
array_multisort(): Argument #1 is expected to be an array or a sort flag in /home/content/m/a/t/mattal4/html/expl0de/includes/pseudo-cron.php on line 258

how would the syntax be?

yeah, apache seems to have messed with some of the variables a bit

could it be because i'm using php 4.3 and this script uses 5

I don't know how I could make it not do this

you may need to run the script as a different user from within a different environment, once you know the expected environment

oh wow, ok, it completely rewrites env

yep, because it inherits the cgi environment stuff
and from the envi that the php webhosting parser is running in

ok
that makes sense
is there a way to get the CLI env in CGI?

why does filemtime($_SERVER['PHP_SELF']) fail with a stat failure?

or at least retrieve pieces of it

what pieces are of importance?

neo2dot0, i beleive stat()/filemtime() will require +x on those folder

anyone?

hm

I'm not quite sure yet, but I'm guessing that I'll want my PATH and HOME to be set if I'm running a bash script

Cup, var_dump ($sortarray)

k 1 sec.

the parent folder is uga+x.

is some way by which it can run things in the CLI environment?

cup try putting $sortarray = Array(); before the foreach

php?
suexec

neo2dot0, do you realize what behind $_SERVER['PHP_SELF']; ?

suexec?

hey all, why isnt this working - http://pastebin.ca/652860

I looked that up a while ago
how do I actually run it in a PHP page?

function to check if there is a session started?

php has fastcgi/suexec shit
it's a apache thing

i just now see that the path is wrong, it is the path the file has locally, on my sshfs mount.
that's wrong of course.

yeah, I got that much

apache is responsible for setting up the environment

neo2dot0, i assume you already solve it
St3althy, what didnt works ? what error ?

256MB of RAM = no multitasking :9

mod_env might be something you would look into

anyone?

depending how many users use it and etc

isset($_SESSION) will be enough

let's not be too quick, I was wrong. The path is okay

nlaracuente, if I remember right you can do like, SetEnv VAR value, in your configuration file

thanks

neo2dot0, do you realize difference between "/file.php" and "file.php" ?

yes, I do

yeah, I was hoping there would be a way to dynamically find out what the OS was providing, and load them in from there

neo2dot0, echo $_SERVER['PHP_SELF']; what you saw behind those var ?

var_dump output 'sarray(0) { }'

it doesnt spit it out into a CSV file. I want it to save everything in my db as a csv (columns and rows etc..)

somehow the paths are different. I have /~s307473/sophia/patzig.php, but /home/user3/s307473/public_html/sophia/patzig.php

thanks! I have no error anymore

stat tries on the first one

filemtime(__FILE__);

xmlreader ? (php.net/xmlreader)

that will give me the filemtime of the included footer, but I want the filemtime of the file that includes the footer.

thanks for the help, cstockton

hi there .. who can helpme pls … how to use a webservice …

nlaracuente, feel free if you run into more problems I can give a couple google cycles if needed

you aren't :P thanks — (i cant /msg cuz i'm not registered )

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

neo2dot0, sounds like annoying… filemtime(basename($_SERVER['PHP_SELF']));

thk, is_null

let's see, I try it

how can i say in php "if $var1 isset OR if var2 isset OR … then $varPresent="true"" - there isn't an "OR" operator for conditionals… where should I look?

if (isset($var1) OR isset($var2)) $varPresent = true;

why couldn't i find OR in the function list on php.net?

bkeating, It's not a function

bkeating, because its not "function"

http://fr3.php.net/manual/en/language.operators.comparison.php maybe this helps

I only get today's date

anyone know how to export csv file from mysql using php

that will be filemtime of the include, I guess.

this one is taken, too

neo2dot0, you still have another option of file?mtime on php.net
err… file?time

well thanks

now i understand, thanks guys!

lol

yes, fileatime and filectime

hi

last access time and create time.

ive just installed WAMP and cant remember how to set up mysql pass etc… any can recommend an easy detailed page for this?

are you asking about this ? http://en.wikipedia.org/wiki/Comma-separated_values

But I need the last modification time.

St3althy, first of all… could you modify your Line:1 of pastebin became: php error_reporting(E_ALL);
St3althy, please repaste and re-run your code after that, also paste what output you saw

ever extended a binary-provided class ?

is_null, what do you think PDO is ?

i never used PDO, it's a pecl lib isn't it ?

well… you talking about binary-provided-class (class in binary/compiled form?)

yes, like PDO

Hi! How would I get the number of parameters a method would need ?

or… i failed to understand

Reflection wise.

nope, like you understood at first

with an OO interface

airox, get_func_arg ?

hmm my description is longer

func_get_arg you probably mean, but this is from inside a function
I have an object instance and want to check if the method has like 2 params or not.
Specified in the methods definition offcourse.

Ox41464b - nothing

interreting, in php programming, are they differrent from classes coded in php please ?

Or do I need the Reflection API ?

all i want is to export data into csv

St3althy, what nothing ?

if i do it from phpmyadmin it works well but i want it in my own php file

This isn't exactly a PHP specific question, but.. Anyone ever seen a table which maps iso country codes to irs country codes? My Google-fu is failing me on finding such a thing, which I can't believe hasn't been created before.

i think it's the simplest

is_null, you can extend them just like any other php written class.

Ok.

thanks cyth

which is why they rock so much

quick easy WAMP config setup + mysql password set….. anyone know one pls?

the way you call them is sexy though

http://todellisuus.net/~mikko/flower.php http://todellisuus.net/~mikko/flower.phps
that extends an internal php class

ok, internal classes have normal behavior, thanks for the tip and demo

airox, headache enough… no idea how to find how many argument that one function could receive

Ox41464b - it didnt work

St3althy, first of all… could you modify your Line:1 of pastebin became: php error_reporting(E_ALL);
St3althy, please repaste and re-run your code after that, also paste what output you saw
St3althy, which part didnt work?
your part ? o_O

anyone have trouble sending an email directly to hotmail's inbox ?

what is wrong with echo(basename($PHP_SELF)); ?
output is null

$_SERVER['PHP_SELF']

$PHP_SELF is deprecated

neo2dot0, error_reporting(E_ALL); //you will see what error after that

why can't hotmail be as spam free as gmail and at the same time make it receieve legitimate emails?
what kind of morons are developing in microsoft?

Hotmail relies more on machine learning whereas gmail relies more heavily on user feedback.

users = smater then machine ;p

i think gmail relies on both

….. for now

gmail have better algorithm
to sort out spam

I'm using, $query = mysqli_query, and im trying to find a way to add to $query by .= but then it says i cant add to it because mysqli_query cant be used as a string which i would use later on. Trying to get this to work for a search, any suggestions?

microsoft relies on hamsters

what is the best way to take user input from a form ? i have a volunteer signup form, i want to take the form info and send it to a specified email

hah, PHP_SELF undefined

Microsoft uses Microsoft code

$name = $_POST['name'];

$_SERVER['PHP_SELF']
use that

is this method secure from injection

ok

seriously microsoft is retarded

Hi, i have small arrays. $array1[0] = 23 , $array2[0] = 38, $array3[0] = 0; now, if i do $max = max($array1[0],array2[0],array3[0]); $max = 23; why?!

Bear10, don't assign query to the return of mysqli_query, first build the string, then pass it to mysqli_query

what dont you understand
o oops

why isn't max = 38 ?

nevermind

zfdaily, why dont you try to find out why your message treated as spam ?

are you sure all your values are integers?

well, if i echo them out they show as above

that wasn't what i asked.
var_dump() them

if I do $obj = new Obj(); are there any magic methods that can be used to release recursive references within $obj so that it gets released by php's garbage collector?

Thumann if your max is uing arrays you will get the highest array value in any of the arrays

gnat42, typically garbage collection won't be something in a php developers head, are you running into memory leaks of some kind?

yup

gnat42, how so? php is very diligent at freeing unused resources

string(2) "23" } }

filemtime(basename($_SERVER['PHP_SELF'])) still gets me today, though the filename I get by echo(basename($_SERVER['PHP_SELF'])); is 6th of august by ls -l

the object has recursive references to itself
to make a long story short

aha, so it's a string value

I've created a function that releases those so that it doesn't leak

what is the best way to take user input from a form ? i have a volunteer signup form, i want to take the form info and send it to a specified email

gnat42, garbage collection is a post runtime event, the zend api should free it

how?
will hotmail tell me their secrets?

$name = $_POST['name']; is this method secure from injection

gnat42, so your concern is rather run-time memory usage?

but I'm wondering if there is a method to get it called automagically
yup

to how they made their spam filter algorithm?

when running the batch, because of the references within the object I had to up my memory limit to 1.2GB to finish the batch

gnat42, unset the objects really

zfdaily, Your sender IP treated as Spam ? (this what im facing previously on Yahoo)

nah
some of my other mails go through fine
just some others

I found the issue, but calling unset on the object doesn't call any special function

its too hard to find out

it just removes the reference to it in the scope you are currently in

if not impossible

and the object's __destruct isn't called because there are other references to the object within the object itself

echo 19 & $role;
echo $_SESSION['user']['userclass'] & 2;
echo $_SESSION['user']['userclass'] & $role;

gnat42, so you are instantiating objects, and then they are becoming to large?

can i convert the string to integer then?

first one is 2, second one also 2, third one is 0
why oh why?

zfdaily, http://whois.sc/your.ip.address and check BlackList Status

no not quite
I have a Record object and Record objects have a Table object within them, table objects hold references to record objects….

hey, the time outputted by ls -l is the same that filemtime gives me of a file?

so $obj = Record();

also, this behaviour differs between the two environments I'm working in

creates an object $obj that holds a reference to a corresponding Table object holding a reference to my original Record object
when I call unset($obj).

gnat42, have you heard of the object pool creational pattern?

the $obj variable is null

var_dump(stat( file ));

nope
where can I read up on that?

gnat42, well, im not sure about php implementation, but it's a means of recycling your objects, perhaps instead of freeing them, you may pool and reuse
gnat42, Basically what im saying, is once your done with a object of a specific type you could return it to the pool to be reused, instead of working about freeing the resource

I'll read up on that, but in the mean time there is no magic method that can be used to tell an object that it is requested to die?

destroying alll references will tell zend to destruct
in which case it will call __destruct before it dies
that is for additional clean up

why do you want to destroy the object?

right, but right now to destroy all references I have to call a special function on the object instructing it to clear out its references to itself

how can I get these timestamps in readable format?

that is a application specific task, no function exists

On some pages, the value is correct, on others not. I am puzzled.

neo2dot0, date()

otherwise when I re-assign it a new obj, the resourses it was using don't get freed

i mean, inside the var_dump

on a webserver, no biggie the script dies eventually and they all go away

neo2dot0, cant… date' em first

on my batch import script… I need 1GB to get what I need done

that has nothing to do with php really gnat, thats just your specific creational model your using

appears adding (int)($var1) & (int)($var2) soles my problem…

yeah, except I'm using an ORM, and its the ORM causing the issue
so I was hoping there was something

ah

some example code of your problem?

say im want a range of numbers to include the 0 for a 1 digit number

what resources?

how would i do that?

irc://irc.oftc.net:6667

which orm gnat?
inhouse?

$obj = new Object();… memory_get_usage(); $obj = new Object();… memory goes up
no, doctrine, www.phpdoctrine.net
its quite good, very alpha/beta

unset $obj really should do it

cstockton, will not release also

release, what though?

yeah, but unfortunately php doesn't handle the sub references

that's a different story

gnat42, i dont think its possible…

I think thats a implementation thing

is there a dev channel for php?

gnat42, those memory didnt being use, but still at usage()

#php-dev?

gnat42, you should unset those in your deconstructor

well I created a function to release the references
and then it worked
the destructor doesn't get called!

gnat I'm fairly familiar with the php source and no built in function exists, but macros are called on object destruction that free memory
internally by zend though unfortunately
you kind of what some kind of DELETE_OUTSIDE_REFERENCES() type macro
lol

gnat42, there is easy way to test… class foo {__construct(); and __desctruct();}

how can i turn Aug into 8 ? and Dec into 12 ?

I have tested
I loop through and do $obj=new Client();

anyone?

Client has a __destruct function that echos when it is called
all 10 loops happen first

cmon its an easy question!

and memory usage goes up
and then the destructor is called

whats the problem with the memory going up?

what is a good open source project I can look at to model my php programming style after.

because this is in a batch situation and I have to allocate 1GB to the process!

do you have such a high-volume app, that it kills your server?

i'm focusing on a oop approach

why is that object gettiing so big? what do you *do*?

use an array
you don't understand

snoop-, check out a mvc, singleton, and read php.net/oop5

ok thanks. i've read php.net/oop5 i think

phpbb uses over 170 queries in one page view, i think i better optimize it

snoop-, mvc is a good architectural design pattern, singleton is a good creational

the object has a reference to itself, thus when you unset($obj) it only removes your ability to see that object in your current scope
but not the sub references
and php's garbage collector doesn't release the actual object even though there is no way to retrieve it anymore
so mem goes up
every new object instance

ok, you create and destroy these objects in a loop?

yes

i never heard of that problem

Ladies and gentlemen
today is a great day
SCO has failed.

which os?

linux
oh?

if (isset($dl_transcript) OR isset($dl_ipodvideo) OR isset($dl_pspvideo) OR isset($dl_mp3) OR isset($dl_vorbis)) { $downloadable = true; }

http://www.groklaw.net/article.php?story=20070810165237718

cool
bout time

damn right

yea it is

formatting via strftime somehow changed the date. A naked echo works fine.
Phew…
I will rather refrain from adapting the date format to german.

How could I work around this problem? http://pastebin.com/m1b76dfc4 I need it to search for all those fields but the only problem is, sometimes certain things arent searched which then cause this to list every entry because it falls under the
search.

Bear10, ill update that bin

i tried it

thanks

memory stays the same

you aren't using the ORM I'm using

how does the object reference itself?
whats orm?

www.phpdoctrine.net
orm is object relation mapping

did they fix their documentation yet?

i dont want to read into a project or something

makes db abstraction nice and easy

if you have a specific problem with php i will help you

Bear10, http://pastebin.com/mfd5cb55 that is the concept

doctrine? improved a bit yeah, new docs, still not perfect though

make a minimal demo of your problem. tht will help.

Bear10, you will need to make it more logical, like add the or's, if a where was made yet

I appreciate it, but unfortunately you can't reproduce it without using this ORM

its an awesome project, but messy and underdocumented

its because of the orm
yeah, single main dev
I have commit access
and help when I can but I'm busy as can be

whoah thats a f*****g crazy loc count for one guy

ah thats what i was trying to do earlier but then encountered a problem but i see what it was now

I think I have my answer on the fact that php doesn't offer what I need to fix it
yeah he got a SoC project for it this summer
so it jumped forward
it still has issues in my opinion
but it is getting more and more popular

i tried using it, but I needed an ORM for a production project, and it didnt feel right
too fresh

Bear10, cool bear hope you get it working

thus more used and thus somewhat better

you said deleting an object that has a reference to itself causes an error.

not an error

memory leak

it just doesn't release the memory

prove it

one sec and I'll paste the code and output

isolation ftw

http://www.hashbin.com/732f.html CODE
http://www.hashbin.com/7335.html output
you can see it goes up each iteration
and _destruct does NOT get called until the end of the script

i doubt that is a minimal example of your topic

if i range(1,31); \
how can i make it not start with 0?

ok, let me do the work for you…

start with 2?

2, 21

gotcah
thanks

lol - unfortunately you don't have a clue what you are talking about in this instance

range(2, 31)

and I'm not asking for you to do the work

gnat42:
class c { var $bla; function f(&$ff) { $this-bla=$ff; } }
for ($i=0;$i1000;$i++) { $o=new c(); $o-f($c); echo memory_get_usage()."\n"; }

I've researched this - AND solved it today

thats what i understand when you say "object that references itself wont release mem"

but only by manually telling the object to release the recursive references

but mem is not going up

range() is always going to start with key 0. numeric arrays always start at 0 unless you implicitly assign values.

let me re-phase that, object which has many sub objects, some of which reference the first object
won't release memory when 'deleted'

well.. my way would be to make an exact example. "many sub objects". how many? 1? 2? 3?
find out what *exactly* the problem is.

I *know* the problem
you don't get it

whatever

I know where the problem is in the ORM I'm using

what is an "ORM" ?

I've even solved it by having it release what it needs to before destruction

old rusty memory?

the *problem* is that I want an automatic way to tell the object to call that function

have one problem where do i stick the or's?

scroll up, I've already explained it
thanks for trying though

how do you search in irssi?

If you need the array keys to start with a certain key use array_combine to join it with another range() of the same length

Bear10, append to every query IF and ONLY IF you already did a query =p
Bear10, did a LIKE rather

not sure i follow :| sorry

Bear10, maybe after $query , set $found = false;
Bear10, ill re edit it

well thing is, that sometimes more then 1 thing is searched so i need the OR not sure if you understand me lol i suck at explaining :

Bear10, ya, 1 sec
Bear10, http://pastebin.com/m10d9c58e

but the second it hits true, it doesnt search the next one does it?

so
how bout them phillies

Bear10, Yes it does
Bear10, You understand what the $_POST['searching_this'] represents right, those are the conditions to be might to search for a specific column within the db

If I have a abstract class with methods defined that aren't abstract that where fully working. Rather than redefining them is there an official way of removing them for subclasses? Instead of redefining them to make a php error.
or a better way of doing it

JonathanJooped, not sure I understand the question
JonathanJooped, All abstract methods must be defined in sub class

eww, still not working right does a real weird thing

okay well im stuck here trying to figure how to not count the zero in a range90 function

I guess it makes no difference if its abstract or not…. the methods I need to remove arn't.

i have the if for country before province, and when i search for a province it does the query of country

Bear10, do you understand the structure? print $query at the end to see

yeah, im trying to explain the problem might have to paste sec

JonathanJooped, The very nature of sub classing is inheritance, so if you don't want to inherit those extra methods perhaps you are using a model that does not work for your specific needs or preference

http://pastebin.com/m664bc966

weeeeeeeeeeeeeeeeeeeeeeeeeeeeee

i replied to your PM

Bear10, each $query you pasted, is using Country LIKE, instead of the relevant column

omg…

So what I was talking about is if there was a way to drop inheritance of a method for a subclass?

lmao, so sorry
cstockton, thanks for all the ehlp

Bear10, No problem

i upload pictures in 'upload' folder. how can i forbid direct access to pictures in that folder?

JonathanJooped, so you don't want them accessible, or don't want them to exist?

i mean if someone type http://site.com/upload/pic4.jpg he can see it. i'd like to make it impossible.

move the upload directory outside of your public directory

but a php script must have the access to load the pic on the page.

why is php ignoring the php.ini file in the root of my site? I copied the apache php.ini file there, and changed the upload_tmp_dir, but it keeps trying to use the dir in the original php.ini file

jon i answered in pm

iflyhigh, ya could be a solutionx. th
thx

JonathanJooped, to answer your question no, you cannot pick and choose what to inherit and what not too, might want to re-factor, or think about interfaces or something

what if i used something like

$valuey +1)

ok, I'll ask a different way… is my php.ini file ok being in the same directory as the .php file that does the uploading, or does it need to be somewhere else?

to avoid the id of 1 returning 0
can i do that?

so your not fussed about keys?

nickelnick, cannot assign in that context

use range(1, 32) or range(2, 32) ect

when including a file, does php optimize so that it doesn't encode functions that don't get used?

majikman, no, it has to parse it

yea but if i use that range, 2-32 will be the dates showing instead of 1-31
if i used 1, 32 it would list 1-32
but the values would list as 0-31
etc

nickelnick, what is your problem?
nickelnick, if you just need to loop through a count of 1-32, use a for loop

if you need an array starting with 1 going to 32 for both keys and values use array_combine
But I think that's not the problem… its the logic your using
like cstockton said

if it HAS to be a array, their is range(1, 32), its indexes will be -1, but does it really matter ;p

YEA PROBABLY
it doesnt hav eto be an araray
im just trying to fill the month day and year on a form so i dont have to type each

for($i = 1; $i 33; $i++)

well use a for loop

ok
wow that looks complicated
lol

Is there a way to get the terminal size from php? Such as accessing TIOCGWINSZ

nickelnick, it's a powerful control structure

i see

can do much more then iterate through numbers

so i is equal to 1, and less than 33;
but add 1
?

Is there a repo with php 5.2.3 for ubuntu?

each time it loops through it adds one by using $i++

http://us.php.net/manual/en/control-structures.for.php

I'm messing with try/throw/catch
and I want to know if I'm using it right
I have a block of code that may return an exception
here's the code I have…
http://pastebin.sekati.com/?id=TryThrowCatch@87480-3719cb28-t
will this ensure that any error caused by the code will not crash the PHP page?

hey guys, just need a little opinion from you guys, which site do you guys think its better, www.cost.com or www.deals.com or www.specialoffers.com ?

deals.com

action1, no, it will ensure that any error thrown of type Exception will not crash the page

looks ok

action1, if by crash, you mean error out

Yeah, error out
and not complete the rest of the PHP on the page

action1, if you throw new CustomException, it won't be caught cause it is not of the correct type

well yeah other errors may stop it… but you have caught all exceptions

ok, then out of cost.com and specialoffers.com which do you like better?

JonathanJooped, not all exceptions, just exceptions of type Exception (base php exception class)

cool

no one habla php.ini?

is there a response.buffer=false equivalent for php?

But most exceptions are of that class

or extend it to my knowledge… so are caught

a question regarding database connections. is it advised/possible to maintain your connection variable (returned from say pg_connect) between page requests (like in a session variable) or is it better to just call pg_connect for each page?

thx for the great help

bazz, checkout mysql's got pconnect

that will chew up the connections… there is a limit on connections and they soon run out. Keeping them connected would really suffer from a doss attack.

action1, ALL exceptions derive from Exception ya

was I right cstockton?

action1, when type comparing for objects base classes are part of the type compared
oops that was to jonathon
ya jonathon

thanks

i'll just sit and bang my head against the desk while i wait

which will chew up connections? using pconnect, or not using pconnect?

Cool… I had just read the exceptions chapter of a php book haha

JonathanJooped, haha, nice

Correct pconnect can chew up connections, the other side of that story is that most databases have a sleeping connection timeout value, for MySQL the default is 28800 (or something) seconds (8 hours)

JonathanJooped, fundamentally most languages provide a way to catch Exception of type *
JonathanJooped, because of php's implementation of exceptions the * is type of Exception
python does it's exception handling a little sexier imo but thats okay I still like php

how can exceptions be sexy

haha

cstockton, I like the way C handles exceptions :-)

in more object orientated languages they are a much more intertwined into the language, and used more commonly

hello, I use the mail() function to send mail, I need the message to be right-to-left instead of ltr, even though it's plain text (not html) any ideas how to do that?

nod nod, makes sense

can someone help me? i used Notepad++ to write a Hello, World! command, but when i opened it in IE, it didn't work

maw_, you mean c++?

cstockton, no, I mean C

maw_, exceptions in c would more so be a hack, like macro'd lol

hehe, longjump 3

maw_, 3 setjmp
maw_, I wander if calling c exceptions more elegant then php's would be a low blow

hehe, it sets my standard

meh

hey guys, so I have a date in the format YYYY-MM-DD, how do I convert it to its timestamp? strtotime seems to think it's YYYY-DD-MM

Sake, explode it and fix it for strtotime

Sake, as I know it should parse as YYYY-MM-DD. I was using this format and it was working fine

Sake, or explode and mktime

Sake, problem comes in 2007-12-10
how can you determine what it is, you have to assume its a the more standardized counterpart

yea, I just exploded it and it seems to not fix my problem…
oh wait, I'm a dumbass…. nevermind

Sake, explode, and rearrange.. lol

haha, thanks for the heads up

Sake, :P

no, I was doing if( strtotime($d) $now ) print "past"; and then testing with various dates and it was always giving me "FUTURE" instead of "PAST", but then I realized my year was 2009 instead of 2007.
too much time in front of the PC… that's for sure

i hear you, im off in 40 minutes can't wait
not that I don't enjoy preying on questions like a mad man to keep my sanity…

true that
DOUBLE TRUE!!
I haven't seen that in a long time. I don't htink now's the time though…

hehe
it's kinda cool some people have very interesting problems

any problems associated with calling an array var 'title'?

Saberu, no

isn't it faster to use substr than explode?

Saberu, built in reserved stuff, no

hey im trying to write an account management script for my apache
i've established that my etc/passwd file contains usernames etc. but the passwords are represented by x which i've been told means they're located in shadow?

$title = Array();
like that
it doesn't seem to like it..

what?

JonathanJooped, substring is faster because internally it doesn't have to create a array to return, but it's not a feasible solution if you get a date like 10-9-12, then a date of 10-12-12 the extra logic involved to predict it isn't worth it
Saberu, what do you mean by not like? should be no problem

Well
i just changed the name from $title to $title1
and guess what, it worked!

Samsonn, the passwords are stored in the master password file

cstockton, my problem with PHP is that I'm nothing without pointer algorithms :/

oh right
where do i locate that stockton?
is it in ETC?

Samsonn, well some distros might be elsewhere

well i can pastebin the dir of my ETC folder

Samsonn, don't do that

how come

Samsonn, on linux /etc/shadow will have the password after username:

yeah i can't access shadow it seems

Samsonn, on bsd, master.passwd

but i know shadow is existant
http://rafb.net/p/vpTT7s83.html
theres no sensitive data its just a dir of etc

Samsonn, Because php runs as a less privileged user, you need to use sudo or something

sudo?

maw_, I hear you their, but pointers can make your head hurt too

ahh turns out
i was overwriting the title var with a string var

Samsonn, super user do, add apache to a NOPASS sudo exec'r and make sure your apps secure

hmm
dunno if my host will allow me to do that

Samsonn, but typically you should keep the system level and the application level at different layers
Samsonn, If your binding your account management to the system and you don't have f ull access to it you may want to refactor

i see

Samsonn, Perhaps authenticate against ldap or a database server

limited options then is it

name / passs … that easy

hm
dont think they load the data in a database i can access though
i can only access db's connected to my data thats it
out of luck?

Samsonn, Never

:o

Samsonn, just better understand your problem domain, and feasible solutions

so far it seems as though there are no feasibles in this case lol

Samsonn, sounds like your environment binds you to something not possible lol, but if you had full access to the server then perhaps it would work

yeah
sucks cause i can read the account details just not the password and i guess not even modify the password later
is there any other files in the DIR listing that could be of use?

Samsonn, I'm not sure what your trying to achieve honestly

Samsonn, what are you trying to do?

make a simple account management script

Samsonn, define account
Samsonn, User account, bank account?

user

Samsonn, Define user

for http

Samsonn, http is a protocol, how is user related

hm guess i got my names mixedup

Samsonn, no, im not being a dick just asking for details ;p

lol yeah
login manager

Samsonn, Okay, so, you want to "Create" the users?

Samsonn, do you mean http authentication?

when i have some sort of server class that is used to produce the html, can i make the hole class static in php5 so there is only one instanz on the server for each user ??

yeah but primarily just edit existing ones

WWW-Authenticate

rocketmagnet, If you mean have a singleton pooled within the apache process no
rocketmagnet, Static classes are just classes that don't need to be instantiated to have their properties or methods accessed or modified

so i guess theres no way to make shadow read/editable?

k
ty

Samsonn, A account manager, to manage the accounts which exists on the machine itself?

so i must also check when i read the config if the file is_readable because no other process is using it ??

yeah
thats the one

so must loop until it is_readable ????

rocketmagnet, no, everything in php is very stateless, and independent

uff

ah crap it's one way encrypted

rocketmagnet, the system itself will manage the disk io, it will read it when the disk is ready to serve it

so it'd only be possible to do comparisons

Samsonn, so, you could still UPDATE the pass, and validate it
Samsonn, your approach you may want to take is creating wrappers for passwd and adduser (commands vary across s ystem)

hm

Samsonn, not modifying the files themselves, let the system work the details out

yeah
but no shadow access still. im just reading up on any altneratives

Samsonn, you just need the privileges to run those commands, sudo will help you

sudo

Samsonn, comes default on alot of distros

i doubt i could hook sudo into my host though

Samsonn, is it a shared host?

yeah
shared hosting

Samsonn, How can you have system accounts, and add them etc, without root access? : )

is my syntax for my "isset OR" statements at the top of this script correct? it's not erroring, but it's not doing anything either: http://bpk.deepdream.org/downloadable.phps

i dunno

Samsonn, can't adduser if you don't have root
Samsonn, lol samsonn, thats funny =p

what about edit user
cause thing is from my hosting i want to offer other people hosting. it is permissable by my host but they dont provide root :/

Samsonn, I see…
Samsonn, thats a big ball game, for a shared host

i'm trying to write a page that contains some javascript and a exec() as the last line. Is there a way to make it show the javascript before running the exec()

yeah

Samsonn, might have to manually add them through the control panel or whatever ur host offers

dont think they offer that feature yet. their control panels pretty underdeveloped

Samsonn, Running a hosting company off 10 dollars is economical but not entirely easy ;p

yeah LOL
you said it

Samsonn, This is a problem you need to work out with yourself :P

lol god
:[

Samsonn, Go buy a VPS, that has plesk

0 as
0 to stop the

lol

0 get

hi

hello

im having a little trouble with destroying my session

0? or
asdf3, whats the problem?

0 which balls it all

asdf3, $_SESSION = Array();

0 post data as

danny, I would fix it at the source, not a hack at a lower level

im using php and mysql, i need to know the id of the last inserted row, thers a function called mysql_ insert_ id but thers no way to make it thread safe right?

danny, fix it on the process page, throw a error, on top of that javascript if it goes with the flow

i have session_destroy(); but for some reason if (!$_SESSION['user'] OR $_SESSION['pass']) is not working, when i destroy, it still seems to be able to make the else true

thats why

0 in the post data though? As there are so many inputs, I don't really want to add a validation of every input to check for

asdf3, !$_SESSION['user'] if not session[user] (doesnt exists after destroyed)

if it helps, I could post up the processing code

asdf3, That is always true

Hello

if you destroy the variables are still there during the pageload

no the problem is after destroying it still reading as if it does

do this $_SESSION = array(); session_destroy();

cause i check if they dont exist and display login form

if (!$_SESSION['user'] OR $_SESSION['pass']) and this is a bad check
use if ( isset(

Is there a way to remove php from a template file, rename the extension to .html, and the file work correctly?

ill try it

also, is there a easy way to remove php from a file without going island by island

danny, might have to work out the best method for you to check, but I would do it BEFORE the data is inserted, maybe a database trigger if it supports them
soskel, preg_replace

What?
What does that mean
what do I type it into

isset says $var = ""; is set… i want it to be false, how can i do that? or do i need to invert my logic and use empty()?

soskel, $stripped = preg_replace('/\?php.*?\?/msi', file_get_contents("php file"), '');

isset with empty string will return true

soskel, something of the sort

what does that do?
and were do I put that?

k. then i should use empty(). thanks

ah, yes you should use empty

soskel, $stripped = preg_replace('/\?php.*?\?/msi', '', file_get_contents("php file"));

what is this?

tags with empty string

Were do I put it and what does it do?

soskel, it's just to help you conceptualize how to solve your problem

wait

moep

is there a way, in notepad++ to strip php ?

sure use a regex
I just gave you a simple one in pcre
Everyone have a good weekend, try not to code to much, code = for bills, life = for fun = )

this is so weird
session_destroy is not working

you have a logic error propably

my log oout page has only this in it PHP session_destroy();
?

php.net/session_destroy
see the example
you propably need

ok my scenario is that I am trying this all on my localhost, is thre something i need to enable?

can i say !empty?

session_start(); session_destroy();
yes you can

sweet!3 php

is it possible to fake $_SERVER['REQUEST_METHOD'] ?
or to give it other values then POST&GET ?

REQUEST?

there might be other values yes

im gonna scrap it and start over
usering the examples

so to be secure i must check all $_SERVER $_COOKIE $_GET and $_POST stuff
?

you need to start session before you can destroy it
logout.php: php session_start(); session_destroy(); $_SESSION = array(); ?
well some of the $_SERVER values come from the server itself
but its not a bad habit to check all external data

i was not corret before: other values than POST|GET|HEAD|PUT ?

i would assume your webserver should barf if its something else

i just wanted to know if it is possible with telnet or other tools to fake some of the $_SERVER values

"unsupported request method"

rm, which value ?

like PHP_SELF
or DOCUMENT_ROOT

i dont think its possible… from outside

DOCUMENT_ROOT comes from the server

Is there something in PHP that'll parse ctags output?

so i just need to check the header values not set by the server ?
and remove_addr and stuff that is set by the request headers

hey guys
my friend was browsing around facebook and .. it just spit this http://rafb.net/p/3a7T8t28.html

What are you trying to accomplish?

why would it do that?

rm, phpinfo(); thre is Information about this

its just the plain php?
i didnt know php did that at random times

Apache Environment and HTTP Headers Information sections

i look at it from http://at2.php.net/manual/de/reserved.variables.php#reserved.variables.server
ups
sry
there is detailed information on each of the entries

rm, and phpinfo() already seperate those infomation based on which "Client" can fake and which one come from serverSetting

ah ok
so i'll consult that one

how do you display the contents of an array?
or hash…

var_dump($array);

i tend to prefer print_r() tho

*shrug* To each their own.

the things under "PHP Variables" are set by PHP and "Environment" is set by the server or the request headers
ty for this
hmm… most of the variables from environment are listed under PHP…
so this list is not what i need

Have you mentioned yet what you need?

how do i state a single character in php as opposed to a string?

NoorulIslaam, convert to integer ?

?

are you looking for a typed langauge here?

$a = 'z' ?

haha f00li5h :P

a character is just a short string

33

mattmcc so if i do $some_string[$some_index]=='z' that will work?

Yes.

ok thx

i was searching for a list of $_SERVER fields i can use without any test (set by php not client or header)

array_keys($_SERVER)?

Hi how do i get magicwand support on a debian etch with php5? I installed imagemagick but this did not work. Any tips?

BudgetDedicated, #debian

wow theres people more noob than me here, hehe

Saberu, there always will be

always people above and always people below, thats IT!

1==1

Anyone know of anything in php that'll parse ctags output?

noone is above or below tho

"1"==1 also

"worth" is just subjective
f00li5h, in php it is

== is the kinda-equals operator, "1" !== 1 though

but try '1'==1 in C :X

you can treat chars as ints in C, if I recall

umm
you can treat them as whatever you want

f00li5h, yes, but '1' != 1 in C

but '1' is not 1 as an int in C
as a pointer even!
hrm

doesn't guarantee expected behaviour tho

'1' gives you the ASCII value for 1

"1" would be the pointer in C

f00li5h, if you do '1'==1 in C, the compiler will translate it into 49==1

Comments

Ok in PHP4 I have a class for the sake of simplicity Person It will be only instantiated once per page as far

Generally, I prefer it for people to actually Google and consult Wikipedia before wasting others' time in IRC or discussion boards.

true

I thought you cant use doublequotes

well, you shouldnt

i dont see any mistake
or missing quote

03:26,3,2000'

i can see it clearly
right before 0

thats not a date

yep

this is strange, i am executing a query which should return results
but it still says its invalid

well there is a quote after
so it needs a quote before

6,3,2000'); which is

then

that whole statement is fucked

theres an EXTRA quote

INSERT INTO temp (`songname`, `artist`, `album`, `genre`, `time`, `track`, `year`) VALUES ('Rose, 'A Perfect Circle','01 - Mer De Noms', 'Hard Rock',' 03:26,3,2000');

where exactly

you don't need single quotes around the entire VALUES section

i know but i didnt write the insert

one extra space there it seems

what rza said

man it's all wrong

re-write it buddy

i have a php script that generates this insert line from csv data

You need a single quote after rose

when in doublt, Ctrl+X
oh yes

then your php script is messed, write your own

i see your problem

its not even my script

you dont include all the values in a quote

so write your own

i downloaded it and modified it alittle

we're not going to fix some opensource script you downloaded and 'modified'

INSERT INTO temp (songname, artist, album, genre, time, track, year) VALUES ('Rose', 'A Perfect Circle','01 - Mer De Noms', 'Hard Rock', '03:26,3,2000');
appear to be missing a value

Wooohoo! That's the copy and paste ANTI-PATTERN

there are 7 column names

mmf
man

and 6 values

6,3,2000' as
check the database structure

You can put in '' for one of the params
two single quotes

find out if the last 2 items are INTS or VARCHARS or TEXT or whatever
do your homework

they are int

then don't quote them

then why is there a single quote after 2000

whoops. forgot pecl :-\

Ramihg's right. What are the types/
?
it's single quotes surrounding varchar, no quotes around int
single quotes around dates
etc
make sure you have a value for every column

numbers in general no quotes

that you're specifying
ok, off to bed for me
have fun

Nighty Night!
May you dream of good code

always

this is retarted

indeed

i can do a query in my user db

One more favor.. http://www.pastebin.ca/663065 I wrote notes in my script discribing what is the 'stump, branch, leaf and dir'… (while were planting trees) Could you please have a quick browse, so I know i'm on the right track?

i can do a query for a specific user
but i can do a specific query for a user ans password
wow
nevermind i got it
nevernevermind
now it is the same
wtf
i forgot why i learned cfml
less risk of suicide

hi
I've been trying to make a small page that shows exactly the host in the addressbar like http://www.bugousurl.com
how can I obtain this address?

buy it

?

hahaha

not following

He means
get the address

No match for "BUGOUSURL.COM".

I'm serious. I want the page to display the address calling it

the domain is not registered
so he needs to buy the domain

heres an example: function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? ''
: ($_SERVER["HTTPS"] == "on") ? "s"
: "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? ""
: (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];

no pasting

}
function strleft($s1, $s2) {

aaaaaaaaaaaaaaaaaaaaah spam

return substr($s1, 0, strpos($s1, $s2));
}
Wow, I had no idea it was that long.

ignore.

http://www.pastebin.ca/663074
Infact, I pasted it by mistake.. I did put it in this pastebin: http://www.pastebin.ca/663074

oh you want the host machines address to be in the address bar?

thanks Thomasporter, gonna check your code right now

One more favor.. http://www.pastebin.ca/663065 I wrote notes in my script discribing what is the 'stump, branch, leaf and dir'… (while were planting trees) Could you please have a quick browse, so I know i'm on the right track?

Thomasporter, Asynyde1 is gone

i suppose it's bad that i've been using svn for about 2 hours now and my includes file is already on revision 207…

Dam ..
Would anyone know anything about planting trees and or/ XML/DOM? :P

possibly

Well. Trees should be planted in dirt, with an area that offers the right amount of light and water.

shoot

http://www.pastebin.ca/663074 within that pastebin is part of my script using DOM. I've labeled it from 'dirt to leaf' could you please confirm that my dirt is really dirt, and my leaf is really a leaf?

Woah wtf
what a werid structure name

where?

Yup

hi all, anyone suggest how to make php's upload file with progress bar ?

I'm trying to learn how to use DOM. Using a tree format makes it easier.

I would like to hear the answer of that too

http://www.whenpenguinsattack.com/2006/12/12/how-to-create-a-php-upload-progress-meter/

thank you

Ok… in PHP4 I have a class, for the sake of simplicity Person. It will be only instantiated once per page as far as I can see. I also have a currently existing DatabaseConnection object already instantiated. if i want to create an instance of Person, with its constructor populating all its
properties on load, should I PASS the DatabaseConnection object to the constructor? ie $person = new Person(45, $db); ?

seems a little sloppy?
is there a better approach?

http://www.google.com/search?q=javascript+upload+progress+bar

basicalyl i think im after the singleton pattern, but am not sure about the best way to handle/pass the db object.

Sorry, pasted that in the wrong channel :P

thanks a ton Thomasporter, the selfurl function worked perfectly

If there will be only one database connection, why not use a global variable

hmmmmmm

Not a problem

i guess that's possible… it would be a bit more elegant in php5 where i could use static methods on a class etc.
so make it a global OBJECT basically?

or you can inherit a database connection
it all depends on how many instances of the database connection class you want

yes…. .yes indeed
inherit sounds a bit sexier.

Hahah

so just have a Base class with NOTHING in it other than DBconnect? then the Person class inherits from that?
although i guess that means if i have for example, a Person (and another class called Dog) both inherit from that on the one page, then there'd be 2 instances of the Object right?
which wouldnt be so efficient

Exactly
do a global object for database
or
pass the object as a referance
reference*

back features ?

like, 1-10 | 11 - 20 | 21-30…

SELECT * FROM NAME LIMIT X
next-back features: google it

my form halts its execution after making the country field and it doesn't load any of the countries…
http://pastebin.com/d760695d7
http://208.116.56.20/~travter/beta/profile/index.php?action=signup
http://saurabhdhariwal.com/travel/profile/signup.html

My computer makes this weird noise
i have to smack it so it stfu's

how do i include a file and have it only run a certain part of code from the pgae

Set a variable before you include it

like can i include("example.php?type=basic");?

And in the page you include, run code only if that variable is set
no

Is there a good book which dwells a lot on SPL?

$is_set = "go ahead";

kk

and in the page u include

i understand
thanks

np

Smack that all on the floor, Smack that give it some more, Smack that ’till you get sore, Smack that oh-oooh! o.o

I like rock
If only i can find a rock song that deals with smacking… :P

heh :P

is this syntax correct ? cho "it is" . str_replace('\"','"',$csv_array[$counter],); i want to replace all occurences of \" with "
oops
thats echo …

is it $_RESULT?

you asking me ?

no anyone

str_replace('\\\"','"',$csv_array[$counter])

is $csv_array and array of strings? if yes, then yes, that is a good way of doing it
what gzty said

why 3 slashes

my form halts its execution after making the country field and it doesn't load any of the countries…
http://208.116.56.20/~travter/beta/profile/index.php?action=signup
http://saurabhdhariwal.com/travel/profile/signup.html
http://pastebin.com/d760695d7

how do i check for results from both $_GET and $_POST vars? is it $_RESULT?

gzty, ?
gzty why 3 slashes ?

as you know \ is a reserved character too, not only "
but wait
single quotes dont handle \
so its '\"'

nope i get a parse error

what are you trying to do?

replace all occurences of \" with "

stripslashes()

morning dude

goooood morning foutrelis ^^, how are you?

sleepless but still kicking

hehe =D

still getting parse error

pastebin the code

my wish is to sleep early and wake up early

you can use /* and */ to comment out code right ?

yes

yerp
$foo = 'bar; /* this is some lovely comment */ $oh_look = 'a var!';
with the missing ' of coruse ^^

im getting an error because of this line of code
echo "it is" . stripslashes($csv_array[$counter])
when i comment it out the error goes away

pastebin the code

thats it

the whole code

the rest isnt relevent

pastebin the code

hi .. i could use a little help here. i have a form that posts a couple values like value[a]=1 value[b]=2 value[c]=3 … now i don't have a fixed list of possible array keys, still i need key/value pairs .. how do i get those ?

; at the end of the line?

i figured it out

technical question.. does php 4.4.x work 'better' in apache 1.3.3x compared to 2.0.5x-prefork ? or are the results not worth looking at ?

not sure. but php5 webhosting supposedly is better with apache 1.3

yea, that what brought me to ask about php4

php4 is dead

god is dead aswell

well, thats a bit older news

sure are
but worth mentioning
there are quite a lot of people out there still believing in god's existence

Hey all how would i go about making a file retriver
say downloading a zip file from a webserver
would i use sockets or

no
you would use file_get_contents or curl

but then how would i write it somewhere

is there a built in function to check and see if a string is a valid time
0"

just check it's an integer above 0

in it

oh sorry, I thought you meant timestamp ^^

i do i think

no, that's not a timestamp
^^ install Blender if you want to play around with 3D, I've only tried it a few times but it's a great program, foutrelis

whats wrong with this ? if ( is_numeric($str[0]) == true && is_numeric($str[1]) == true && $str[2] = ":" && is_numeric($str[3]) == true && is_numeric($str[4)] == true ) {
return true;
}

do we have to guess the error?
I like that game :P

I already have blender installed, played with it a few months ago. ^^ I'm happy you recommend it too :P

sure is a good program, they are developing it so fast - really getting some very nice features, they are planning on improving the interface soon to

Use preg_match. I believe you're be better with it. :P
damn my English

nothing wrong with your English,
ah, well - "you're" should probably be "you'll"

I'm having trouble installing php4 webhosting on apache2.2 win (worst possible combination I think).. getting 404s as "/php/php.exe/file.php not found". Help?

why install php4? =\

I wanted to write you'd.. and I probably meant you'll.. AlexC_ 3 :P

^^ either will do really,

AlexC_, legacy application dies badly when I run it with 5 but I need to look at it.

Damn English.

how would I remove the first occurrence of from a string ?

I think it would be a good idea to port it over. For that I doubt you need PHP 4.

preg_replace has a limit parameter
syntux, ^

Jafet, I had php5 working, the app died badly. It uses a lot of php 4 objects.

I would install the latest XAMPP full and use phpswitch.

Jafet, beautiful, thanks

Still, port it over or complain loudly to someone who should.

jess do eeeet

if the app were small enough for a one man port I'd do it

i have 10 arrays of numbers. how could I find intersections?

what do you mean by intersections?

numbers that exist in all arrays

array_intersect?
http://xkcd.com/293

array_intersect looks good, but i have arbitrary number of arrays. is it possible to pass them to array_intersect?
i have array of array of ints
does anyone understand what I'm saying? I could have 2 arrays or 20. is it possible to pass as many as I have to array_intersect

call_user_func_array ?
yeah, passes all keys of an array as seperate arguments to a function

if i wanted to strip off the last "," off a string only if there was nothing after it, how would i do that? :/

great thanks

is it possible to integrate php webhosting within html? I want to display random quotes of the day from an include file?

if (substr($string,-1) == ',') $string = substr($string,0,-1);

awesome :3
i thought it would be something like that

would if (end($string) == ',') work?

or rtrim( $str, ',' ); ?

rtrim FTW
thx
which is faster?

rtrim can trim multiple characters, non?

no idea,

[domon]: Measure it.

yes,

[domon] test it if you care

hah…like i can really tell which is faster LOL

[domon]: rtrim will trim multiple trailing commas, mind you.

great

$str = 'yay some commas,,,,,,,'; echo rtrim( $str, ',' ); will display yay some commas

good
or
$str = 'blah, blah b,4,7,,,,, rtrim($str, ',') blah, blah b, 4, 7 :P

can I integrate an include file within HTML?

yes eth01
some_html_elementphp include( 'wow_mega_file.php' ); ?/……

thx -.-

anyone know a good Dynamical MySQL Lister
that lists the table

you can do that with a #mysql command

but i don't mean one for debug purposes

you just want to list the tables?

well yea

#mysql it is then

but that is more PHP than MySQL
im sure someone has made a basic engine for that
so it contains searh and stuff like that

no, you want to get a list of tables - there is one single command for it that #mysql will help you with

search and the sorting
no i don't want a debug command for table

I didn't say a debug command

well it is

you want to list all tables for a database, correct

yea and i want the Asc/Desc sorting for them
and the Search

yes, so go to #mysql

just go,

and then they want me to come ask here
because its a PHP script afterall

and you are using mysql, so you need to run a mysql query to get all the tables
so, go into #mysql and ask how to list all tables for a database,

wtf
i want more than that

yes, which you can do _within_ the MySQL query!

Ask the PHP parts in ##PHP, and the MySQL parts in #MySQL.

why are you so against going into #mysql? they don't bite… I think,
they may nibble at your ankles, but nothing else ^^

because i want PHP project
library
what ever they call it

…and it uses MySQL. If you have a MySQL question, ask it in #MySQL.

it think its class
yea i think it was called a class

go to #mysql - ask how to LIST all tables

i know how to list all the tables

so what is the problem?

So, what's your problem now?

i need to find one that looks pretty
and is dynamical and coded correct
because i have no tried to make one myself 3 times

does anyone knows a good php hosting ide for linux?

Not our problem…

everytime it turns out to be static hosting and horrible

? all you've got to do is 1 mysql query Jygzy and you can do Order and Search in it
!tell logik-bomb about editors

If you think this problem is wrecking your life complain in ##phpc.

thanks

i need to know the name for it
so i can search a class
is it called a "Table lister"

no, it's called "I wont go into #mysql"

Go waste your time on Google or something.

where do i find PHP Scripts?

and gawd dang does it stink!

We are a PHP programming channel. Not a "hiya hlp me find leet php scripts" channel.

phpclasses.org and hotscripts.com were the right anserws

none of those will "look pretty" or "coded correctly"

well 100 times more than mine

Regardless, he is offtopic, abusive and being a troll.

im tired of coding it again everytime for every project

Should we tell him about interfaces and code reuse? Naaah.

there is always the right way to make things and then there are thousands of wrong ways

I think we should just burn it at the stake and throw apples at it,
what else is there to do on a Sunday?

mourn.

Apples?

this is true, we shall not waste the apples!

or tune into united and city :p

Burn? Do you know where gas prices have been going lately?

Output sql host query results as HTML tables

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

thats the stuff

I guess my idea is flawed then? =(

Just tie them to comfy chairs, tape up their eyelids and start playing Cartoon Network reruns at full blast.

http://www.phpclasses.org/browse/view/image/file/8373/name/Katalog1.gif
thats what i need ;

hey, I've installed PHP 5.2.3 from source, but I don't have any php.ini in my /etc/, am I meant to create it myself or.. ?

it's in /etc/php5/apache2/

I don't have apache, I'm trying to setup lighttpd

look anywhere in /etc/php5 and subfolders

And there's no /etc/php5/ dir either

find / -name php.ini *g*

how did you install it?]

I'll try that, locate turned up nothing

do phpinfo() and see where it is

you may have to do updatedb

you cant use locate for this, use finde
-e

./configure –enable-fastcgi –enable-discard-path –enable-force-redirect; make; sudo make install
done update db, doing find now

and it installed fine? no errors?

make test turned up a few seemingly minor things
but other than that, no errors
Hmm, I've got /home/plantain/php/php-5.2.3/php.ini-recommended
I've got pear.conf
Any other ideas?
–with-config-file-path=/etc/php5 — will that fix it perhaps?

try it

trying now
nope, no such luck

how can i display random quotes?

$quotes = array( 'I like tea', 'tea is good', 'I love tea', ); $random_quote = array_rand( $quotes );

Undefined variable: memcache in /var/www/html/discuss/includes/handler.php on line 23

just define it before hand,

I did.

obviously not,
pastebin the code

Ok.
lol

that code up there was for you, btw

yeah, thanks.

$memcache = new Memcache; ?

http://www.pastebin.ca/663181

So is php.ini generated, or copied from something in the source?

it's not within the functions scope, KairuMaiku
php.net/variables.scope

this is what i get for writing code at 3am

me kills KairuMaiku
er,forgot the / lol

hey guys i have another question

lol

i cant get a wildcard to workright
i want php so see if there is anything that matches view:x
where x is an integer

that's very vague

to*

any what? any teapots that have view:x engraved on the bottom? a pigeon that is called view:x?
cos … I don't think PHP can does those =(

http://unspecific.net/domains/unspecific.net doesn't seem to show up the random quotes.. :/

unless you have a tracking device on the pigeon with all information about it,
but then it would still be quite tricky

well this room isnt short of any smart asses tonight
any rows of a database

pastebin the code,
see, now we can help
using MySQL?

of course

#mysql then

its not a mysql related question

http://pastebin.com/m25ee79c7

you want to match a field in a row that could be view:* ?
how is that code going to help me help you?
I need that rq.php file

no, i want to match a rows id to view:x
where x is the rows id

yes, so it's a #mysql question

http://pastebin.ca/663190

or, do you already have the rows in an array etc?

i do not think your understanding me here

well you have to echo something,

alrite, what exactly? in the html?

you want to echo $random_quote;
go and read some basic php tutorials

internal server error

do I echo $random_quote in the HTML? i'm assuming you, do.

in that php file

right, still make's no difference like.

repastebin the code
oh sorry, $random_quote = array_rand( $quotes ); echo $quotes[ $random_quote ];

ah, ty.
http://pastebin.ca/663199

yes that's right eth01

ok

ive got a problem i downloaded php code that creates a form with a textform where you paste csv code and it turns it into sql insert into code. the problem im having is say i paste 5 lines. i outputted the number of lines and it reports back almost double. how do i parse it correctly

and if i wanted to put "" around the quotes, would it just a case of putting " in front of them?

yes, eth01 or do echo '"'.$quotes[ $random_quote ].'"';

ok, thanks for your help.

you're welcome

mean's alot

does it mean alot?

http://rafb.net/p/0gS7bA31.html - help!

it's something called manners

bloody pidgin, does anyone know how I install phpize? http://rafb.net/p/0gS7bA31.html
nm

ok back to my problem earlier

since gd is a php project now, i guess i can ask in here, this has never happened to me before, i need gd statically compiled for mrtg so i download it, configure with –disable-shared but i tried and that argument makes no difference for this problem, then when i run make it says permission
denied, i can't run ls i can't run pwd, everything says permission denied as if the gd dir has been removed, so i cd to another dir outside of the gd dir, back to the gd d

did that get cut off?

basically what im trying to do is if($_GET['example'] == 'view:x')
x represent a rows id, which could be any integer

basically after running configure in the gd package i get permission denied errors from pwd, ls and make as if the gd dir was gone, then when i cd outside of it and back in again everything works

what was the regexp to match all
(^*.) something like that

^ is start of line Jygzy, just use .* to match nothing or everything
..+ to match at least one char

oh so (*.)

.*

:o
regex
lol

ayea

can anyone help me?

what you want to do is cut off the view: from the front

use split

How?

http://www.php.net/split

is this the right way to count # of newlines in a var echo "it is " . substr_count($csv_data."\n");

lol
net/split

lol KairuMaiku

i already have them split people

i've been up since 3pm yesterday :-\

i don't want to start a flame war but good for you, i've used postgres for many years now and never ever wanted to use mysql again, i've actually seen practical situations where postgres has saved the day while mysql forced the client to just buy more and more hardware

i just need to get it so that the x in the previous mention statement can stand for any integer

but i guess mysql is catching up now, they're implementing functions postgres has had for years

Yup. I've not liked the way that MySQL is heading now for a while, and then I saw that postgres basically hammers MySQL in terms of multi-processor capability

does anyone understand what im trying to do?

That's an important fact considering I don't have very many single processor servers
You use split.
You split it so that you only have X
and then you can do whatever you want with x

if you're comparing that get array element with a string you don't have it split, you need to use split to get the two values in two seperate variables
or preg_match if you want

ok let me reexplain cuz either your not understanding me or im just to tired to think

I'm probably tired too

but i just wanted to tell you all that on freebsd the gd package creates some weird permission denied situation until you cd outside of it's directory then back in again, i'm too lazy to fill out a bug report or search so good luck with that

if($_GET['action'] == 'view:*')){
all i need it to do is make it so that view:* could be anything
maybe view:1 or view:2

well
check substr for view
and use that to get the view num?

ahh I see, hold on

damn i have already got them seperated
thats not what im trying to do

oh

xD

i just need a wildcard

ooooooh

why do you need a wildcard?

is it a database query

no
i already have the database query

if ( preg_match( '/(view[0-9]{1,}/', $_GET['action'] ) ) {
if you want the ID as well, do '/(view([0-9]{1,})/

can anyone help me out

no one can help if you ask no question

3 AlexC!!!
lol

i did

i'd offer my help but i'm way too tired to do anything other than comment on the funny function names

i am trying to parse string data
when i print out the number of lines its more than what i pasted
i replaced all newlines with @ and echoed it to the webpage
and found this:

thats exactly what i needed

http://pastebin.com/m310d8db1

hold on, it doesn't work fully :P
oh it does,

if you look and see where it says @ every time
those represent newlines

that will be true for like view:1234454445 - if you want to limit the end number, change {1,} to {1,2} which will make it return false for view:1233

lol AlexC_
"it doesn't work fully, no, it does"

^^

i just need it to work for any integer
like 1 or 2 or 5
or 98296

of just 1 digit?

xD i spent the last 6 hours getting centos, apache, postgresql, php, php-memcache, memcached, and svn installed

anything

rewriting part of my code

oh, yeah - so {1,} will do fine

so my brain is prety much mush right now

no of endless didgets

does soneone know how to upload big files like 100-150MB sized?
or does anyone know any tutorial about it?

set the limit higher in php.ini

Well. You uh send packets. Lots of packets. For a couple hours :-\

i can't change the server settings..

Ask your ISP. Usually they'll do it if you have a legit reason.
At least, we do. :P

i found http://www.sibsoft.net/xfilesharing/ this one.. it upload big files…

You need to change server settings to do that, lol
It has nothing to do with your script

is it fine if i split files to default size (=8 MB or 2 MB?) and then combine it…

That would be fine and dandy but you can't split them on the server :P
uThat would be fine and dandy but you can't split them on the server :P /u

Comments

Hi Ive made a class that extends JFrame and contains a JLabel and a JProgressBar Running this multiple times from

to get the User Agent String
it is generating the User Agent String

You could help out by telling me what the useragent string currently is

Opera/8.01 (J2ME/MIDP; Opera Mini/3.1.8295/1704; en; U; ssr)

hello

I've been a Vodafone customer before (platinum level, even) and always hated their braindead branding idea. So I'd like to help you out here. It's just that you are providing not enough information.

i mean, i read those sun tutorials, but somehow im missing the big picture of how all this helps me.

Ar-ras: And what whould the "right" useragent be? Did you scan the source for this and found only this single method?

Blafasel http://gsmfreeboard.com/forum/showthread.php?goto=newpost&t=144832
Changing the U700 Firmware is harder, then changing a J2ME midlet i think

Probably. But still: The method doesn't seem to contain the parts you're looking for.

its the only possible part

Try to debug it
Ar-ras: I guess this string is taken from a resource file or something, because in your method I cannot find a literal that seems to be related.

morning waz

g'morning

morning

hmm, anyone familiar with xmlbeans?
i'm having some trouble with the gYearMonth xsd data type

anyone besides Bea uses xmlbeans ?

Rhino used to.
But it's been removed in the latest version.

what is it using now?

i am

Just the standard APIs I think.

using it to compile schemas to java

DRMacIver, jaxb et al you mean

how do i use java ant build files ?
how do i use java web host ant build files ?
iam trying to compile http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html to get OX running

however when i have an attribute of type gYearMonth whihc should look like "YYYY-MM" i get that plus the timezone

ok so i have 2 versions of java sdk installed one in cprogramfiles and one in cjava. When im compiling the compiler automaticly uses the one in cprogramfiles. How do i set it to use cjava instead?

Cjava\jdk_x.x.x\bin\javac *.java, change your ide settings, change your path, or tell us more

i need help to change the path on win 2k

exerd, you know what PATH is?

find PATH and edit. also might need to change JAVA_HOME if it exists

morning

test change by typing java -version in prompt
hi joseph
podcast was interesting this morning. with news of ee6's extensibility

tht's not NEWS though, the EE6 announcement mentioned it

g[r]eek: java -version just outputs the current version (?)

What is the best way to call method1() wait 5 seconds, and then call method2() ?
use a Timer ?

why not method1(); sleep(5000); method2();

do you care if method1 is complete?
completed even

no..

probably an Executor is what you want then

ok so i have 2 versions of java sdk installed" - you can use java -version to test if your PATH update worked.

ah, i've found the problem with xmlbeans, there's a bug Calendar.clear() fixes what i wanted

what? a bug with Calendar?

first i heard of it. wasn't keeping tabs

nah, with xmlbeans
for some reason they don't mask the timezone field

file a bug

i would, but i have to use an old version anyway

i'm more interested into sun's making use of interface21. debunking the whole "spring is not the new javaee" myth

g[r]eek: JCP, not sun…
and they've had the opportunity for a long, long time

so is it still a good thing or is to little too late?
bso is it still a good thing or is to little too late?/b

w3schools tutorials++

g[r]eek: of course it's a good thing

so am i getting this right, javabeans are just normal classes on pcb ?

printed circuit boards?

no, the drug.

pcp, not pcb
and no
javabeans are normal classes that follow some rules

I'm not familiar with "pcb", but I do know that classes don't take drugs
the people who write them often seem to though

haha!
time to go… luck with the drugs

pcp? lol

pcbs aren't any good for you either

and those rules let them integrate easily into a certain crappy ide ?

yeah, pcbs are supposedly not being produced by power plants anymore
but they still are

yes, with said crappy ide being netbeans, eclipse, IDEA, jdeveloper

by… power plants?

yes, pcbs are pollutants
it's a TLA with more than one meaning

I see

http://www.youtube.com/watch?v=LGEdDd5zsHo

but being on a drug meant more in context than "being on a pollutant" so I assumed he actually meant "PCP"

^^ breif story on pcbs

BTW, being on acid makes more sense than being on PCP
esp. with PCP usage being relatively rare

well actually there's really no way it makes sense

how do i use java ant build files ?
iam trying to compile http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html to get OX running

~tell xored about ant

xored, ant is similar to make, but intended for Java, and uses XML config files instead of Makefiles. It can be found at http://ant.apache.org or discussed at ##ant.

i have ant installed, i have a build.xml
how to run it ?

type "ant"

rtfm mate

Hi. I've made a class that extends JFrame and contains a JLabel and a JProgressBar. Running this (multiple) times from main(…) works flawlessly, but when run from a JMenuItem actionPerformed(…) event, the code is run (confirmed from a println) but neither the label/progress bar appear - any
ideas?

so whats everyone up to

stumped!

why doesnt "java /folder/to/my/java/program" work, but when i "cd" to the folder and then "java Program" it works

you need to add that folder to your CLASSPATH

because you're using the command wrong

it also doesnt work when i run "java -cp /folder/to.. /folder/to.."

or use 'java -cp folder/to/my/java/ program

java takes a classname as an argument, not a file path

nope, theyre both wrong… you forgot to sacrafice the goat before trying

dmlloyd how is it roght?
what have i to do?

try "java -help" for starters

sacrafice a, perferably small, goat to the sun gods

then read this
~tell r4663r about classpath

r4663r, 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">http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html and http://mindprod.com/jgloss/classpath.html#ANACHRONISM

okay thank you

Um.. I'm trying to run eclim to do some python coding.. Eclim is powered by eclipse & vim.. and it needs "java-config" to run. Does anyone here know where I can get "java-config" for ubuntu?

try #ubuntu

Yeah.. I did. Not much help there I figured java-config might be some obscure little application, perhaps it doesn't exist packaged for ubuntu? I found some jar-file available for download.. I figure that's not what I want though.. Since I'm looking for something executable.

it is not distributed with java
gentoo has a program called java-config, but it is very specific to gentoo
it would be completely and utterly daft for some random program to depend on it

fulhack, gots a link to where it mentions said "java-config"

krustofski, Just an error. eclipse/plugins/org.eclim_1.3.0/bin/eclimd: 43: java-config: not found

file thateclimdFile
Probably a shell script. So - read it.
java-config is used on Gentoo (and maybe on other systems) to set (irrelevant for this) or get (probably what this tool wants) the system/user vms and related paths

Oh. That was bad. heh. Thanks Blafasel. Seems like my system is identified as gentoo when looking in the script.. Now I feel stupid. I'll just edit that away. Thank you!

never, ever have kids
they're annoying

*blinks at joe*

never, ever have doors without locks after you have kids :P

I suggest everyone get neutered/spayed right now
don't delay

too late!

If you already have children, commence beating them

i see…
or wait, do you mean you have children ?

God makes you love your children, because otherwise they wouldn't survive their own youth

http://www.flickr.com/photos/planet-geek/945469972/ — that's my son

he looks like the mailman

ah, didnt have a large sack handy ?

you wish.

haha

take him swimmin', kitten style

just had a great conversation with the l-programmer. she was complaining that a certain tree navigation routine in JENA was running slow. I finally ferreted out that they were storing tree data (this task belongs to these 3 projects, which belongs to this project, etc)…
as…
wait for it.
XML documents stored in the project record.

haha

taskstask id="blah"/task id="flee"//tasks

ouch

so they were retrieving the XML doc, scanning it for the task sub-list, then subquerying all the tasks there, pulling their xml documetns, anc iterating.

jena seems like a project desperately in need of pruning of cool tech

"Gosh, it's slow!"
fortunately, R just hired a new guy who really groks databases - when i said "Google for storing tree structured data in oracle" he was like "yeah, this is an easy problem, and has been solved a zillion times."

indeed

admirable.
this is like databases 101.

it's hard work!
and tree structures shouldn't be a database's problem
but yeah, it's been done a billion times

eeheh, i gotta say these sun tutorials are great.

oracle actually has a special construct for trees
"connect by"
pretty cool actually

First rule of databases. You do NOT go around the database schema by inventing your own.
Second rule of databases. XML hosting is NOT a database.

which ones?

They tell me how to use netbeans to do something in 20 steps, that then takes up atleast three lines of code.

I've yet to see a really good sun tutorial
oh
sarcasm

indeed

I've actually started joining JSRs for teh sole purpose of improving documentation

Six screens across, and multiple "special clicks" after which arent explained.. and now my OK button sets a property on a bean.

I think sun documentation is one of the bests
there are waaaaaaaaaaaaaaay worst documentations out there

yeah, like the "no documentation" documentation

(most of open source projects)

heh
yes

or reaally outdated documentation

but I expect open source projects to rely on amateurs
and Sun shouldn't be in that group

"But everyone can read source code anyway!"

sun's biggest problem is that they don't know who their audience is
so they almost always target the wrong people

well, sun is a big participant in the OSS world
they have lots of different audiences

yet they address few of them

is there any API to manage tomcat users and security-constraints from my app code?

im still wondering what exactly is the … use.. of this bean technology.

it's a spec for mandating consistency

bawk… like a chicken?

yeah im getting the drift that its more like a convention

a chicken on pcb?

hahahaaa!

yes like a chicken!

yes, a very consistent chicken

a chicken on brazilian communist party ?

heh

whoa… karl rove quit!

huzzah

quit what ?

life, I hope

pcb usage ?

he's leaving the whitehouse!
woooo!
finally, we'll have ethics in politics again!

so finally i can get that chair?

doesn't matter… he'lll apoint some other nutjob
*appoint

~jpa

Aradorn, jpa is Java Persistence API

~javabot tell jottinger about politics

Just try ~tell jottinger about politics, whaley.

~tell jottinger about politics

jottinger, politics are off-topic. try #politics or ##politics (or if you want to get REALLY crazy ###politics)

haha

:P

you people are retarded. This is *important!*

why
i'm english

im southern…

Bush affects the world
he's like the nuclear bomb of political stupidity

karl rove doesn't

karl rove is an influent java developer! didn't you know that?
:P

karl rove affects Bush

karl rove is one of the great evils in the world today
he is an evil, evil man

wow, that Guice TSS thread is really long http://www.theserverside.com/news/thread.tss?thread_id=44593

could be longer
110 messages isn't that big of a deal

the JSF one was one of the bigest?

the sad thing is this doesn't weaken or change anything. rove has no task in the presidents cabinet anymore. he's leaving. it will not weaken or change the situation at all. i think he's just bored

that is very likely true

uh, minor hint… You don't think this is so he doesn't have to save more emails through the White House email system?
Georgey will still webmail hosting / call him. But it's now off the record completely

u r so cynical

jottinger, you are the op!!!!

can i ask one thing, who in the hell would use an official email system like that to discuss private matters you would not want tracked?

stupidity?

gah what did you say…

stupidity?

thats my only guess

I think it's funny that they have done so much to encourage the use of secure email while they're apparently ignorant of it

hi

"Who would" -. "Stupidity"? That trait is a person now?

ciao dob1

yes
see administration, bush, 2000-

C'mon.. Others would've been kicked out already or hushed for being way offtopic..

I'm an op!

hmm. so, oracle has 'select… start with… connect by…' commands.

what is a fast way to check if all the characters in a String are numeric character?

am i going to have a problem using that stuff with JPA?

not sure… I dont think JPA uses it

dob1, regexp

yeah, taht's what i'm worried about.
can't i inject oracle commands into JPA entitybeans?

~Blafasel++

blafasel has a karma level of 26, andresgr

hmm i don't know nothing about regexp

Integer.parseInt() for the lazy

dob1, you have work to do then

yes

Start writing lots of SPs and tell JPA to use those? :o

is esr

heh
"no."

ok, i am at a complete loss, i beg someone to help me check my mappings, i have tried them all for this gwt rpc servlet mapping

mappings meaning…?
servlet mappings?
what's not working?

firebug gives a weird error and i get a 405 if i type in my rpc address manually

heh still the same issue

jottinger, the app isn't going to the right place for the gwt service

eidolon:

g[r]eek, yes, if anyone knows the right mapping i would really appreciate it, i have tried them all

(a type. a second attempt. lots of intermittent typos. abbandon idea)

405 is which http error?

omg. a type. *g*. a flipping typo on typo.

jottinger, doesn't support get… which means my service is there fine

resource not available, IIRC

jottinger, the app is just going to the wrong place when i hit my button

in the hosted mode or in a webapp

in webapp
jottinger, hosted works fine

so are you compensating for the web app context?

you should have been here yesterday.

jottinger, i believe
jottinger, in my url-pattern for the servlet i have tried /MyApplication/Service and /Service

well, show the line that looks it up

my entry point is getmoduleBase() + "Service"
jottinger, in the java?

shouldn't it be "/Service" in that case?

jottinger, i have tried that, and most people on the google group seem to think so
jottinger, either way i get the same error
how can i know if the app is just not finding the service or not?

I'd have to see the files

jottinger, ill paste all relavent
~pastebin

http://eugeneciurana.com/pastebin

Start the conslutation clock (no, that was not a typo)

heh

~[TechGuy]++

[techguy] has a karma level of 41, g[r]eek

I think it's fun that people want more GWT content on TSS

hey everyone.. I'd like to run a java hosting service on a port 1024, but not be root. Any ideas on how to do this the best way?

jottinger, http://eugeneciurana.com/pastebin/pastebin.php?show=3588

portmapping

that'd be cool. gwt is nifty

jottinger, i beleive those are the 3 relavent files

jottinger, like in port forwarding?

yes

Good morning.

in Ant, how can you include a common xml file?

jottinger, hm, k..

re pr3d4t0r

hey eugene

jottinger, this is the error firebug gives, http://eugeneciurana.com/pastebin/pastebin.php?show=3589

Hej

does the server log show you anything?
which jars are you including from GWT?

0 AM org.apache.catalina.core.ApplicationContext
SessionListener: contextInitialized()
jottinger, the servlet.jar
gwt-servlet
not user

hmm,very off
odd… set the servlet to load on startup, see if you get anything then

jottinger, nope… same error

with load on startup set to 1 for the servlet?

yes

why doesn't SimpleDateFormat process java.util.Calendar values?

Hi

gwt++

hmm, hmm. Which container?

tomcat
6

tomcat–

When I make the ant run -Daction=store I get the error: /src/events/EventManager.java:2: package org.hibernate does not exist

Uh, getTime() ?

I exactly did what they told me in the tutorial

classpath issue

okay, the firebug info is useless, although you may want to consider turning on verbose mode for GWT's compiler

jottinger what info do you want?
theres a cool IE program called fiddler that gives HTTP response/request info

every second question in here involves a classpath issue.

for GWT, being told "error in nc()" doesn't mean much
g[r]eek: it's the number one ill of java!

haha

jottinger, ya i was hopping that info didn't mean anything

httpheaders does that for firefox andresgr

mele-: What means that ?

someone needs to write a tutorial to end all tutorials. so that nobody ever has classpath issues again.

jottinger, can you think of anything else? i havn't a clue

I'd have to play with the application

could i send you an eclipse project?

no, please don't, unless you're paying me

~tell hansworscht about classpath

hansworscht, 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">http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html and http://mindprod.com/jgloss/classpath.html#ANACHRONISM

nothing personal, but I really don't have time otherwise

no i understand, i just wish there was a fix for this… its ridiculous

there probably is

are there any deployable examples using rpc around anywhere?

I've not had any issues using GWT's remote services, so debugging issues like that…
kitchen sink uses rpc!

g[r]eek: But I compile it via ant, where can I define the path to the hibernate-dir there?

use the gwt google group

jottinger, it does?

is there a class/lib that can convert simple java src to another language? I'm just wondering if something like this has been done/tried before..

yes
you mean, like GWT?

well you said you're following the tutorial exactly. so perhaps you just need to tweak your build.xml to map to your hibernate jar correctly

i'm not sure what that is i'll look it up

jottinger, it doesn't have a server package…

hmm, I thought it did
Well, I'm pretty sure one of the demos does

[TechGuy]: you mean Date.getTime()?

no, Calendar

jottinger, which release do you use?

1.4

damn me too

to be honest, if you can't figure out how to setup your classpath correctly, you're not ready to start using hibernate. no offense intended. master the basics first.

g[r]eek: In my build.xml in the javac line is a option classpathref="libraries" and libraries is defined as ${basedir}/lib/*.jar and I put all .jar files from the hibernate folder in this folder, so whats wrong ?

[TechGuy]: you mean getTimeInstance() then?

no

haha

~tell multi_io about javadoc Calendar

multi_io, I don't know of any documentation for Calendar

oh good lord.

SimpleDateFormat is used for formatting and parsing date values to/from strings

~javadoc Calendar

I don't know of any documentation for Calendar

hah

~javadoc java.util.Calendar

I don't know of any documentation for java.util.Calendar

haha
now THAT is useful

~botsMack

g[r]eek, I have no idea what botsMack is.

what version of java is javabot on, 1.1

Apparently I have to connect A to B to C…

but iirc since 1.1 j.util.Date is used for storing a "timestamp" only; all the getYear()/Month()/Day() methods are deprecated

The javadoc isn't loaded, I think

i thought it used to be

What's your point?

j.util.Calendar is used for storing year/month/day values, so it would seem logical to use a Calendar, not a Date, as input for SimpleDateFormatter

used to be and "is now" are different

g[r]eek: In my build.xml in the javac line is a option classpathref="libraries" and libraries is defined as ${basedir}/lib/*.jar and I put all .jar files from the hibernate folder in this folder, so whats wrong ?

PEBCAK

j.util.Date only stores a timestamp (number of seconds since 1/1/1970 UTC), so it can't provide year/month/day values without being given a timezone

is there a program that is able to take a simple or maybe even complex java app example myapp.java to another language example myapp.pl or myapp.c or myapp.py?

there are some, yes

any opensource ones you know of?

they can be found through the magic of chicken entrails, goats, and google

Hi all !
may somebody answer some of my questions ?

no

no.

you haven't asked any that have answers.

LOL

PEBCAK?

But - you both answered this question of his.
Weird.

right, maybe that is his question

~pebcak

jottinger, pebkac is Problem Exists Between Keyboard And Chair

somewhere between your chair and keyboard, there's a problem.

hahahahaha

that means that the bulldog clip in front of me must cause a lot of problems

ah-ha! I was suspectingthe wrist support!

okay, well, does somebody know how I could use custom annotations on my implementation classes in order to run some scripts to generate code ?

~javadoc java.util.Date

I don't know of any documentation for java.util.Date

This is a question as general as it could be. Be more precise. Say what you would do or better: What you tried and where you're stuck.
What happened to the javadoc support? Anything badly broken or just a minor thing?

ok, well I put @webservice name="myService" on my class, and then in my maven plugin written in jelly or in my ant script (no matter), I want to be able to get annoted classes informations such as annotation parameters , class name and package…..Well I'm stuck cause I can't find a simple API
to do this : scan sources for annotation and get informations back
oups, sorry

is there a simple 3D wrapper library? I've looked at JOGL and read about Java3D, but it seems ridiculous to (in JOGL's case, at least according to the tutorials I've read) render vertex-by-vertex manually. Ideally, it would not require native code, but that's not a necessity.

Reflection (if you want to scan classes, not the source)

ok, well I put @webservice name="myService" on my class, and then in my maven plugin written in jelly or in my ant script (no matter), I want to be able to get annoted classes informations such as annotation parameters , class name and package…..Well I'm stuck cause I can't find a simple API
to do this : scan sources for annotation and get informations back
no, no
that was buggy, here came the entire message
I'm talking about "sources of the class"
no reflection

Boths messages look equal to me. So you have access to the .java files? What's wrong with reading it then?

I want to do what xdoclet , for exemple, does, before taking the template and generate code

Check apt perhaps

well, I'm looking for existing APIs that does the job

Not sure if that does what you want, but might be right.
apt is part of the jdk (and jre? No idea)

apt, sounds familiar
1.4 ?

huh? 1.4 and annotations?

yes !

i'm using tomcat web manager to deploy a new struts app - i try to deploy it by uploading a .war file, when i hit 'deploy' button, i get a blank page but nothing gets uploaded. there's no error in catalina.out or localhost_logs.

like xdoclet used to do

how do i troubleshoot this? i tried it in different browsers and os's. same result.
also - this was previously working

Hey, i need some help
i have a JTextArea with a black background… how do i change the color of the text cursor
its hard as hell to see

I'm out. Java annotations are new in version 1.5 and somehow you seem to talk about different things. I don't know about xdoclet either.

gikid, toolkit

awt?
what?
lol
oh
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Toolkit.html
that?

Ok, actually, annotations exists long time before jdk 1.5, maybe 1.3, but weren't bundled in jdk, so xdoclet and others were used to read implementation classes or interfaces annotations in order to generate code like Stubs and Skelettons for EJB for example
never mind, I will try to have a look at xdoclet sources, if I can find and understand it
thanks Blafasel

im lost, would that be createCustomCursor?

wow
i just found a goto statement in production code

or setDesktopProperty….

print it out?

yeah this needs to be framed

haha

Aradorn, a labeled break?

no
its an actual goto statement
looks like old style error handling or something
its a vb script but tahts no excuse…
http://www.wizzy.com/andyr/Mel.html
everytime i think of goto's i think of the story of mel for some reason.

any more hints for me?

hi all
i need to execute root command from java application
how should i do?

what command and why

command to manipulate apache2
start, restart, stop..
and mysql

man sudo
Or man sudoers

I'l call it a day

or run it as root

that link is pretty good ))
using overflow to snap out of a loop.. trying doing that with java…

its the coolest story ever
haha yeah

s/trying/try

how to run it as root andresgr

login as root, then execute your java program

where i should specify the password
?

not that hard

http://jstock.cvs.sourceforge.net/jstock/jstock/src/org/yccheok/jstock/gui/GoogleMail.java?view=markup

Although I receive the email, but I always get javax.mail.AuthenticationFailedException
Any idea? I do not wish to get any exception when the email can be sent, so that I can tell user whether their username + password is correct or nto.

well, you can always catch the exception
that's sort of what they are designed for.
I send mail via smtp.gmail all the time using javamail, it can certainly work.

surial, but…. how i can noe, whether the mail is successfully sent or not?
surial, both send success and send fail, they will throw the same exception.

then you're doing it wrong.

yes, i know i am doing wrong. but i just cannot figure out why.
i had inspected the code several time, it make sense

~pastebin

http://papernapkin.org/pastebin

BufferedInputStream fr = new BufferedInputStream(new FileInputStream(f)) throws filenotfound exception when f is a directory …..

and thats surprising to you? :P

f exists.. but why does it through a file not found exceptions ?
am new to java.. sorry

its a directory?

it implies it might throw it.

you cant accomplish anything with a inpustream from a directory

oh ok.. thanks

surial, http://papernapkin.org/pastebin/view/1277

looking
hold on, I need to dig up my own gmail sender to compare.
does anyone have a mac?
I built a little test program in coca..
cocoa, that is, but I'm not sure if it has any system dependencies or not. Last time I made a release, it did (it would only work on my machine).
hmm, difference one, though I doubt it matters:

surial, thanks! looking forward ur reply

props.setProperty("mail.smtp.socketFactory.port", "465");
I don't have that. you do.
But, again, I doubt that matters.
it doesn't appear to be neccessary in any case.

suria, u need not to spefici the socket port explicitly??
i afraid the google had change their service somehow. i remember i did some testing few months ago, no exception thrown.

I use Session.getInstance instead of Session.getDefaultInstance

I try again.

map.smtp.port = 465. You set that as well, and so do I.

could you recommend an embedded database with the use of Hibernate (not hsqldb)
?

but you also set mail.smtp.socketFactory.port which is apparently not neccessary.
h2sqldb.
and if you don't like that, derby/javadb (same thing), but that is slow as shit and not very flexible.
and if you don't like that, you're out of luck.
try again with Session.getInstance instead of Session.getDefaultInstance?
~javadoc Session

I don't know of any documentation for Session

d'oh.

well… I shifted to derby and it doesn't seem to work well..

right. hsql is better.
and h2sql is even better.

soo… (sorry for the stupid question)… h2 differs from hsqldb, right?

surial, can u run ur sender program once, see whether there is an exception?

yes, it's a total rewrite. From the same author though.
~tell chenchen about aolbonics

chenchen, 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=0

thanks, …

surial, try to remove the port number and change to Session.getInstance, not work.

hmm. let me test mine.

Hm. Interesting. javax.swing.undo doesn't actually have any graphical aspects to it.

I need to buy some NAS, a DB server, and gig networking (non-fibre). But I don't want any big iron. Anyone know of a good place to purchase?

It's probably useful for theft for elsewhere.

my kids have a dvd by tmbg of all kid's music - one of the songs is called "U R N X", and the whole song is single letters - "U R N X, N I M N X"
or maybe it's called "I C U", I forget

well, shit in a bag and punch it.
seems like gmail does something different these days.
I take it this is gonna be rack-mounted?
I get an elaborate exception… but the mail does arrive. Same thing you seem to get. Hold on, let me paste teh exc.
~pastebin

http://papernapkin.org/pastebin

http://papernapkin.org/pastebin/view/1279

Hello.

if you write a public User getUser() method, do you return with null or with a runtimeexception?

same exception you're getting?
NonsensicalQuestionException
though there's a generic answer: Do not EVER throw a RuntimeException. Throw a subclass of it.

in fact, avoid throwing subclasses of runtime exceptions too :P
returning null might be reasonable if, say, the object was not initialized or whatever.

sorry, it's just a bit late. So what I've meant is that *in case you do not find the particular user*, what do you do?

return null if it's normal not to find a user.

why?

oh. Well, a RUNTIME exception is a signal of an error that is generally either 1) Not something an app could handle, or 2) Not something an app normally expects. a CHECKED exception is like an alternative return result that can be handled and can be expected (like e.g. an
InsufficientBalanceException in a banking app when someone's account is too low to handle a transaction)..
and returning null is more or less accepted 'not found'.

hmm

well, because it's a reasonable answer — "give me a user" "I dont have one… so I'm gonna return you a value that means "no user" "

the problem with null returns is that that's your only option for a non-standard return value, and it has no type and no documentation. HOWEVER, as a general rule, for any method that returns an object and searches for something, 'null' is conventionally used to signify not found.

if you feel that that should never ever happen, then throw something appropriate…

Which is why it's acceptable to return null for 'not found' - it's expected.

I
gah..

If it should never ever happen, then it should throw a RUNTIME exception.

yes… something like illegalstateexception or whatever.
but then you have to have a pretty good clue why it should never ever happen

Indeed. Or if it's actually an outright bug, then I might go with InternalError, depending on how likely it is that if this invariant didn't hold, that the entire app state is beyond repair.

dfr: the problem is that there are certain errors, that don't get handled 90% percent of the cases, but there are a few cases, when they need to be handled. but I guess I'll just use a subclass of RuntimeException

hold on.
the choice between checked or unchecked exception (unchecked = subclass of runtime, checked = anything else)…

basically, if you're throwing runtime exception, that pretty much means that the code is buggy.

is simple: Is it both A) 'handleable' and B) 'expectable'? checked exception. Otherwise, unchecked.

I'm using jox to convert java objects to xml, but only want to load Strings, Integers, etc and not, for example, JMXConnectors. Is there a way to do this without writting my own DTD?
Jox grabs a hold of my objects jmxconnector and starts making jmx calls… definitely less then ideal

not-found is probably handleable, but the question you need to ask yourself is: Is it expectable. I'm getting the feeling that, yes, it is. So in that case, (subclass of) runtime exception is singularly a BAD idea.

if there's any doubt make it a RuntimeException

dfr: yeah. basically the question boils down to the following: should I use getUser(String id) returning a null value in case it is not found, or should I use public boolean userExists(String id) together with getUser(String id) throwing a RuntimeException?

only make checked exceptions when you know the person should handle it without a doubt

surial, not quite same. mine is javax.mail.AuthenticationFailedException

first chance. Second is a bad idea, imo.

return null
the combination userExists(), getUser() is FUNDAMENTALLY FUCKED.

surial, do you got the exception you mentioned when you run your app last time?

that's because threads exist. The operation on the userstore must be atomic from the caller's point of view.
yes.

well maybe, but I see it all over the place

turns out most of the world are idiots.
the idea of doing a check first, then running the code proper, is ALWAYS BUGGY. ALWAYS.
I know everyone does it. Irrelevant.

dude, shut up

for getting something out of a store, the operation is ALWAYS: just get it, THEN sort out of it worked or not. Not the other way around.

well it is transactionally correct from the database point of view

dude, fuck off.

Hali_303, http://www-128.ibm.com/developerworks/library/j-jtp05254.html?ca=drs-j2204

using multiple methods is fine, as long as it's all taking place in the same transaction

userExists is a reasonable method though…

Hali_303, good reading on when should exception be applied.

Yes, if you ONLY need to check if a user exists.

yeap

userExists is a fine method to exist. your method design has nothing to do with transaction demarcation.

It is not reasonable to use that as your method of handling the case where a user does not exist.
Personally, in many situations, checking if something exists, with no further immediate action, is an extremely rare operation. Thus I almost never add exists kind of calls. If people really really want it, it's just a getUser(something) != null.

there are many cases where you only want to see if a user exists. the most common being validation and ensuring duplicate users aren't created. you can just stop listening to surial to now

and by not having it, I remove the temptation to do something stupid. Like check if the user already exists, if so, generate error, if not, set new user. Except of course that requires a bunch of synchronized() in the calling code, which is a total mistake.
there you go again, dupe users.

i use map.containsKey extensively

using an exists() is wrong.

dude, just be quiet. you're just wrong. exists() has absolutely nothing to do with atomic checks.

You should have a addUser() method, which refuses to complete if that user already exists. Then that LIBRARY code, which knows about implementation details, can suss out whatever synchronization is needed to make sure that works right.
exists() ITSELF, no, but 99% of the exists() code out there is either buggy (no atomic check), or bad design (caller code must worry about sync).

see, you're wrong

for example, one of Spring's core interfaces, BeanFactory, has a getBean (throwing a RuntimeException if not found) and a containsBean() for checking..

most people with half a brain will have an addUser method that first does an exists() check. this is not anything magical.

map.containsKey(), but of course. That's your library code - your UserStore object, doing that check, probably inside a synchronized. The point is, if you expose that to UserStore instance users, you are given them a gun pointed at their feet.
Indeed.

exists() is a very common method when you need to prevent duplicates

So why the fuck EXPOSE the exists() as well as the addUser?

why not? and jesus dude, stop shouting. it's bad enough you're wrong

Can you stop saying dude? You annoy me.

then go away, mebbe dude?

it's a matter of layers. On a certain layer, UserStore is something you shouldn't know any implementation details of. It's just something that holds users. It has a number of operations. Like: Add user, Remove user, change user, get user.

anyways, if there's any doubt make it a RuntimeException. Unless you are absolutely sure something needs to be checked then don't make it checked.

stop arguing with all the assumptsion. just show the real code example

those ops should be atomic from the caller's point of view. The caller at this level should never first check if something exists, then do it. That code needs to be abstracted.

let the fact speak

exists() doesn't require any assumptions about implementation

How often have you seen this: if ( store.hasUser(newUserName) ) return "That user already exists."; else store.setUser(newUserName, someUserObject);

look, what you think the caller does or doesn't want to do is irrelevant. many times the caller does want to just check if something does exist. t

that code is fundamentally flawed the moment you run this app on a dual core chip.
to 'just check' is potentially acceptable.
But it's something that gets abused a hell of a lot.

yeah, it's "potentially acceptable" in the way it's perfectly reasonable. most user data is going to be stored in an rdbms anyways so in practice your entire argument is just silly

you are right if we are talking about memory variables, since memory is not transactional. But on databases, the transaction guarantees that the result of exists() will be valid

Thanks for supporting my point. You both presuppose that the caller knows if the code is running using a memory backend or a transactioned database connection.
I am quite factually correct in stating that such a knowledge assumption is A) asking for trouble and B) can be engineered right out easily.

i'm not against our opinion

and in cases where rdbms aren't used, it's up to people to read the javadoc and figure out if an operation is atomic. there's no way to easily express this in java without closures

I'm just asking myself, because I don't know what to do..

no, you're just annoying and wrong. there's absolutely nothing wrong with exposing an exists() method presuming your client understands the transactional guarantees described in javadoc

Look, let's say you ahve a UserStore, and you have a legitimate use case for completely changing an existing user (overwriting, basically), and also a legitimate usecase for creating a new user.

and in practice it's never an issue because everybody uses declarative transactions

It is a mistake in this case to write a 'userExists' and a 'setUser' method and let caller code sort out the difference in those cases using an if (userExists) kind of check. That is flat out wrong.

return null if user wasnt found and log a bunch of stuffs

if those two use cases both exist, write separate methods. write an addUser(), and a replaceUser(). the addUser does the ifExists check internally.

again, the setUser method will do it's own userExists check so once again you are just wrong
all of the setUser and addUser and replaceUser methods need to check for user existence. what the caller does is completely irrelevant

okay, now we're on a different argument. You're saying that it is not really a problem if calling code does an ifExists check, and the called code ALSO does so.

one can maybe also follow the Maop style? and if overrites, returns the user overwritten?
s/Maop/Map

whereas in practice this automatically implies that the caller code does NOT in fact know what the hell its doing and makes (bad) assumptions. If the assumption that the setUser method does an ifExists call is actually wrong, then the code seems to work just fine during development. Then you
roll it out and completely corrupt everything.

I'm saying you don'tunderstand what an API does. when somebody exposes a method like addUser the presumption is not that addUser can make duplicates.

That's again giving people a lot of rope to hang themselves with.
Stop twisting my words.

well maybe if all your devs are retards. I don't think I've ever seen an addUser method that can just blithely add duplicates and corrupt the database

you mean them willing to add a user but replacing?

Indeed.
Let me try this from a different angle.

sorry, but if you were making any sense then none of this would be an issue. again, restrictions like duplicate checking are always enforced from an API level

Let's say a servlet exists that does this:

well, it sounds like an unsurprising behavior to me… and the approach is taken in the jdk.. so it must have some validness
of course throwing a "UserExistsException" makes sense.

if ( userStore.exists(newUserName) ) showUserThatHeNeedsToPickDifferentNick(); else userStore.addUser(newUserName);
I'm saying that this is ALWAYS WRONG.
it should make 1 call to addUser, and then REACT to the result of that - whether this is done with a nullCheck or by catching an exception is a detail not relevant to this discussion.

hmm, i prefer the first way, i think.

is that really your whole point?

the first way is going to lead to a lot of weird user interaction once your app grows large.
Yes.

well congratulations

hm

what do you mean by weird user interaction?

And it's something I started this discussion with. If you had removed your head from your ass long enough to read, you may have not missed it the first time.

Whats' up

take youtube for example.

but if the point of that code snipplet is to distinguish between adding new user and handling case where it exists, it's reasonable

Dont' listen to meeper.

tho again, in practice, there's nothing wrong with that code because any addUser code will do the duplicate check again. It won't simply add a user and corrupt the database.

surial, why not check on standard java api, see what does designer did?

at some point, youtube was generating a lot of strange 'oops, something went wrong' pages, seeminglyat random.

besides, what'd the catch statement do anyway?

what was happening is that their transaction isolation wasn't being handled - in DB land transactions sometimes just fail due to conflicts, and you SHOULD just do them over.
The catch statement would call tellUserToPickADifferentNick();
that situation is very similar to this one - the assumption is made that the server won't be busy enough for an assumption of staticness where none exists to hold.
The problem with such assumptions is that those assumptions hold, for quite a while, until your app starts seeing serious usage. Then all hell breaks loose. It's better to just teach yourself to do it right the first time, and this also means to generally consider atomic operations 'nicer'
regardless of the specific context.

no your argument was that an exists() method should NEVEr be exposed. this is just a retarded argument

I never said that.

haha ok
sure you didn't

I said that it is often rare to do that check with nothing else, and if so, there's no good reason to expose it.
Especially considering that, for a rare event, the workaround is simple: if getUser(someThing) == null

anyways, (1) there's nothing wrong with exists (2) in practice your 'worst code in the world' is never a problem because everybody uses declarative transactions

so why would that not lead to to a lot of weird user interaction once the app grows large?

so you're making a big deal over something stupid and small

Remind me to never hire you to code anything. You make a lot of shaky assumptions that limit future optimizations.

it's not a rare event and there's no point loading a user if you just want to do an existince check

Actually, you made a big deal.

larger chance to deadlock when high concurrency

haha, ok, will do

actually it IS a big deal question. just look at the JPA

Because in the first situation, you USUALLY get 'please pick a different nick, that one is taken', but as the site gets busy, you more often get: Uhoh, a database error occurred.

Purely from a code point of view, the try { } catch ( ) { } solution is much nicer anyway.

(because the code that redirects to the nice error is done with an ifExists check, and then the actual addUser call is assumed to work, because we just checked that it will, so that code, assuming it's written right, throws an exception (DuplicateUserException or whatnot), and you handle that
considerably less nicely.
~DRMacIver++

drmaciver has a karma level of 32, surial

Finally, a sane voice shows support.

Exceptional circumstances should be handled by… exceptions. This isn't surprising.

check as much beforehand as you like, as long as you keep in mind that your insert might fail and deal with it appropriately

that arugment fails in practice.

i like failing early, even with a db engine in the back.

what you are saying is that this code is good:

well, right. I'd certainly check if it exists but then check any possible failures from addUser as well

I don't have a strong opinion on the scalability aspect. It sounds plausible, but I'd need to think about it more than I can be bothered with.

http://pastebin.ca/655757

except when checking something like "DublicateUserException" I'd be throwing along the lines of "new WTF??Exception"

~javadoc jni

I don't know of any documentation for jni

I think that code is just dumb. Just remove the entire if statement, it serves no purpose.

I do have a strong opinion on people who make me read ugly code.

where can i find a tutorial on JNI
?

guys, look at the JPA. it has a class called EntityManager, method find(Integer id), which returns null if entity not found. It also has a Query class, with a getSingleResult() method, which throws an exception in case the entity is not found. Now who understands this?

sometimes you want to fail early.

that makes perfect sense

yeap, but I'd be throwing WTFAreYouSmoking exception thopugh to show a programming error.

not to everyone though it seems.

of course you do. But the place where this fail early occurs is in addUser(), not this code.

’cause evidently something went wrong.

What about it?

[exists and the throwing of the exception are not synched]

why null and why an exception? my guess is that an exception is used in the second case, because we need an exception for signalling multiple results anyways

But that's bad design.

if the check and the failure are that local there is not much point in making the distiction, fully agreed. if they aren't however…

being defensive to errors?

Why should this particular code even care about sync?

surial is confusing the issue because he's retarded. There's only three things you need to know: (1) All addition methods, like EntityManager.persist(), will need to do a duplicate check anyways (2) An exists() method is fine (3) If you're checking for user existence to go to error handling
code then you should use null/exception. It's the common doIfNot scenario

the addUser method should be defined as; tries to add a user. If this can't be completed for whatever reason, I'll tell you.
So to use this method, call it with abandon, then afterwards check the result of this operation and react to it. That's the correct flow.

Oh, Sun are and have always been wildly inconsistent as to where one should return null and where one should throw an exception.

exception handling code can also obscure code, perhaps. maybe the api designers meant to allow for an algorithm without exception catching because of that.

well, you're right.. if it's expected that state of the db might change between the calls, your suggestion is better.. but in most of cases i work with (without DB in general) it'd be a very buggy-like situation I'd love to catch and investigate.

no they haven't

There's really no way of making one set rule that says, "It's okay to throw an exception, or its okay to return null."

the rule has always been very clear. return null for find operations and throw an exception for get operations. it makes perfect sense.

Actually, by doing it my way, you get interesting options. Like transactional memory, or atomic DB ops, which are different.

~tell meeper about javadoc java.util.Map.get(*)

meeper, I don't know of any documentation for java.util.Map.get(*)

That doesn't hold outside of the J2EE though, unfortunately. e.g. List.get() returns null if not found.

Oh, broken javadoc.
Point still stands.

Map.get() has nothing to do with data storage dude

Right, what DRMacIver said.
~ridicule meeper

~cookie meeper

I'm not sure why you would assume Map.get which has no concept of finding and searching to behave like a db

Silly Kids. Maps are clearly something you use to find directions.

look, if you don't understand something, just admit as much. But don't blame the api which does indeed make sense

Perhaps not. I find returning null is more often than not a bad idea.
You're so cute when you're acting superior.

well it's necessary. stupidity spreads like a virus. You bring up the case of Map.get and use that to argue for data operations, surial picks it up — it's a vicious cycle

hm. maybe it would help deciding on the question if we would talk about how someone implements exists(). Cause in JPA code, basically exists() and getUser() does the same, retrieves the user from the database using the same SQL query, the previous just alters the return value to boolean
instead of the User object

woah

that's a good observation.

how can commons httpclient be so fast @_@
0.035 secs per request

the entity cache in Hibernate guarantees that actully it does not retrieve the entity two times

compared to 0.055 secs for standard java http requests

the rule is really quite simple: If you JUST need to do an exists check, and aren't going to do any further interaction with the thing you called exists on dependent on the result, you can use exists. In any other situation, do not use exists. Make the call immediatly and handle the
fallout.

sounds like you're microbenchmarking to me.

surial, microbenchmarking?

trying to measure how long a relatively fast, simple operation actually takes. This is almost impossible to do right. It's a science that takes years of study to do right, basically.
I'm saying that your times are unlikely to be realistic.

surial, err… i just repeat the same operation, say, 16 times

Right. That won't work.

surial, and the results seem consistent

especially '16 times', that definitely won't work.
irrelevant.

Help needed to install the NetBeans C/C++ Development Pack in Ubuntu 7.04

surial, of course the 0.055 / 0.035 secs/request only applies to my specific application, but that's fine for me ^_^

here's a test for you: I'm goign to do operation 'X' 100,000 times. I store how long each consecutive batch of 10k runs takes. So that gives me 10 results.
1 second, 1 second, 8 seconds, 0.1 second, 0.1 second, 0.1 second, 0.4 second, 0.08 seconds, 0.1 second, 0.1 second
explain what jsut happend. If you can't, you should not be mirobenchmarking.
You can ask in here but you may have more luck in #netbeans

~surial

http://www.zwitserloot.com/

or ##netbeans. Whichever one has more people in it.

~surial++

surial has a karma level of 35, Clackwell

from the article about "dumb code" or something like that, the author argues that benchmarking should be done in industrial conditions as java runtime depends on environment quite a bit.

that channel no one responds

so if you're using it in real conditions, chances are the timings will be different.

Okay. No problem. It's fair in here too.

Help needed to install the NetBeans C/C++ Development Pack in Ubuntu 7.04 . Iam facing problem on installing the pack which asks for the installation folder of netbeans ide 5.5.1

In case you are wondering what happend, the 8 seconds one is where a GC run coincided with the hotspot compiler recompiling because X was being called so much, which also explains why after those 8 secs things were faster. The 0.4 second was another GC run, which elimated a bunch of heap and
managed to make the a couple of things that were previously out of CPU cache range in range..

making the next run faster, but after that more memory got filled again, and that situation no longer held, so back to 0.1

and what was your opinion on the null vs runtimeexception stuff? one point is that null is simpler, however a custom runtimeexception (rather than a nullpointerexception) is nicer. RuntimeExceptions however make life harder, because the container (EJB3 or Spring) may think that you wanna
rollback the transaction, while you may handle the runtimeexception.

and I covered maybe 2% of things that realistically affect microbenchmarking.

How would I convert an org.w3c.dom.Document into a string of actual XML?

It depends.

so actually no rollback should be done

surial, certainly there is a lot of variability in the results, but doing enough repetitions should fix it

but if someone handles the exception, no rollback will occur. and if someone doesn ot, then the rollback is warranted, no?

surial, that's basic statistics

no, that doesn't hold.

surial, of course if the results depend on each other, it's a bit more complicated

For one, you don't know how much is enough. You said '16', for example. This isn't even in the same ballpark as enough.

~jit

JIT - Just In Time compilation explained by Microsoft: http://javafaq.mine.nu/lookup?264 ( "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconjitcompilation.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconjitcompilation.asp)

the problem is you cannot really apply the statistics to the larger project.

anyone know off the top of their head which property to set to make SAX ignore whitespace?

so at the very least you need to store the intermediate results (so if you do 1000 runs, store the time taken for each batch of 100, and compare. If those are NOT constant, your results are invalid. if they ARE constant, that says nothing).

so if you find out that rough running time of the httpclient is X seconds, you cannot make a judgement that if you use it for your project, it will be also roughly X seconds.

then you need to basically eliminate the GC, and make sure the caching situation is similar to real life operation.

there is no question. look at the way hibernate, JPA, cantor, jdbc and really every persistence api on the planet works. stop trying to break the wheel

heyu folks, under linux, when running an ant script, why does '${env.HOSTNAME}' not have a value? other env values are working.

~dfr++

dfr has a karma level of 3, surial

~jvm options

Clackwell, jvm options is http://blogs.sun.com/roller/resources/watt/jvm-options-list.html

that last one, making sure the page caching is similar to real life scenarios, is usually completely impossible.

well yeah in general, but this can be a bit more complicated in reality. Image you have class A, with declarative transaction demarcation. This calls class B, which also has declarative transaction demarcation. Let's say class B throws a RuntimeException to signal class A that the entity is not
found. Class A catches the exception. In this case, the transaction will be still rolled back, because the internal transaction demarcation

so instead you come up with two numbers: best case scenario and worst case scenario. Except to manually force cache flushing is very difficult.

wow, that's a great page, Clackwell

then there's a design bug in the demarcations.

except it won't be. Look at how EntityManager.persist() method works.

ok, supposing my whole "stats 101" approach to profiling is incorrect, what's the correct approach?

yeah, it has many lines of text on it :]

how do they work?

heh

read the javadoc duh

it's not the statistics that are incorrect, it's how you apply then

don't worry about it.

no it's not a design bug, it's a settable option in Spring for example. Not sure about EJB3

i think the best approach is to actually include it in a big chunk of code.. and compare then.

you're asking stupid questions about stuff that is was settled a long time ago. there are very clear conventions about when to throw an exception and when to return null.

build your app, and only when you actually run into performance problems, get a profiler, run a serious, 'industrial' realistic load, and find trouble spots. Then play around with different implementations..
and other than that, have a good grasp of algorithmic efficiency (summarized as: Don't use bubblesort where you can quicksort).

"http://www.springframework.org/docs/api/org/springframework/transaction/support/AbstractPlatformTransactionManager.html#isGlobalRollbackOnParticipationFailure">http://www.springframework.org/docs/api/org/springframework/transaction/support/AbstractPlatformTransactionManager.html#isGlobalRollbackOnParticipationFailure()

Comments

In php5 if you have a class that basically abstracts a data table plus some other stuff for example a Music song

GetInstance($id); or to use a constructor? $song = new
Song($id); or something else?
$song = new Song(); $song-loadDetails($id); ?

I didn't think you could do $song = new Song

Comments

« Previous entries · Next entries »