Archive for August, 2007

I have databes with 120 000 records in the biggest table But my application starts to working slowly after inserting

I get "Can't connect to MySQL server on 'www.zendurl.com' (4)" from $con = mysql_connect("www.zendurl.com:80",$username,$password);
that's not very informative :-(
I'm positive my username and pass are correct
hmmm

but is that for local host or tcp connections

helo

use a semi colon

i upgrated mysql from slack 11 to 12, and my database is gone

ThinkMedical ya… how to use returned results directly for UDPATE?

UPDATE blah WHERE blah; SELECT * FROM blah WHERE blah
unless im wrong (?)

ya…
say, if SELECT returns 100 rows..

use update ffs

ffs?
archivist a little bit more hint please?

your questions are not clear enough to get more hint

ok…

it shows a basic missunderstanding of basic sql such as update

you want to return the updated rows from the query? essentially something like SELECT "UPDATE…"

I need to SELECT * FROM `crawl` WHERE `last_crawl_time` 100; UPDATE (these_resulted_rows) SET `last_crawl_time` = 101;

hehe

sigh

he has no idea
even spoonfeeding him fails

put your select in a WHERE clause on the update, DavidHKMrPowers

UPDATE `crawl` SET `last_crawl_time` = 101 WHERE IN SELECT * FROM `crawl` WHERE `last_crawl_time` 100

no selecat at all

oh
same table… sigh

just a where clause needed

get rid of "WHERE IN SELECT * FROM `crawl` " DavidHKMrPowers

um…so what would be returned resutls?
do i still get the certain rows updated?
phpmyadmin returns nothing for this…

the rows update and you get a boolean result

oh…i can't get only a boolean,..
i needa to get the rows also… since i need to crawl them

the use a semi-colon

why i update them is to udpate them not be crawled in short time

UPDATE `crawl` SET `last_crawl_time` = 101 WHERE `last_crawl_time` 100; SELECT * FROM `crawl` WHERE `last_crawl_time` = 101;

after I change my.cnf (which I found on my own - woot) I assume I have to restart mysql? (since changing my.cnf did not seem to make a difference)? I've looked around for docs on restarting mysql - Im looking for something like graceful — this seems overly complex for just restarting the
database nicely: http://dev.mysql.com/doc/refman/5.0/en/mysql-server.html
?

ThinkMedical ya…it could but still no…because there could be other rows whihch habve `last_Crawl_time` = 101 too
needa update exactly the last selected rows

youll probably need cursors and such

o.O

there's a RETURNING keyword in pl/sql not sure about std. mysql sql

oh…btw…innodb and MyIsam which should i use?
maybe becasue i use the incorrect db type?
i am using myisam

Doesn't matter. Just make sure your search criteria only picks the last 2, using an explicit ordering since rows in a table have no guaranteed order.
Don't select. Just perform the update properly.
By doing this you won't have to worry about any sort of locking.

Xgc ya…but i need to get what i 've updated
i mean i need to get the rows i updated

If you have a specific that isn't behaving well, post it exactly so someone can help you with it.

they have tried

Ultimately, you may need a safe process, if you have requirements beyond just updating the rows. You could even use a trigger and a column that indicates who performed the update. By doing that, you can determine which rows you updated without being bothered by any updates by other users.
The trigger could insert logs into a separate table to indicate which rows were actually updated.

Xgc ya..i also thought of this method…but things would be complicated then…

Actually, that simplifies the process.
This creates a queue instead of requiring locks. You can take your sweet time without worrying about impact on any other users of the table.

you can use cursors in mysql?

You can.

you can use FETCH then i guess, with a cursor

possible to get last_update_id ?
if possible i would update it first and thene select

Via trigger. Otherwise, not directly, without locking.

i let it be..

greetings
Host '192.168.0.31' is not allowed to connect to this MySQL server
any idea?

it means what it says, you need to grant your user rights to log in

i did

GRANT ALL PRIVILEGES ON *.* TO 'oo'@'*' IDENTIFIED BY 'XXX' WITH GRANT OPTION;

Query OK, 0 rows affected (0.01 sec)

can anybody help with this? If I aquire locks using GET_LOCK from within a table trigger, will it stay locked until the trigger runs again and unlocks it? or automatically unlocked when the trigger finishes?

external

remove bind-address= and skip-networking from my.cnf and grant permission to the external 'user'@'host' and remove any firewall rules blocking port 3306

all the case expect what is "external" ?
woa
% instead of *

aep and check if you have an anon user grabbing the login

found. thank's anyway
havea nice day

hi, i'm trying to sum the last 6 values for a praticular IP in my db… select sum(amount) from accounting where ip=$ip will give me all.. how do i make it limit to 6?

i hv been installed mysql .. at rhel 4 .. how to start its service .??

service mysql start
or service mysqld start

… order by timefield desc limit 6

thx pb

(where "timefield" is some field that identifies the rows chronologically, obviously.)

it returns -bash: serice: command not found

did u miss the v out?

try "service mysqld start"
oh.

can i print somewhere which i get … basically i hve been remove php mysql web hosting .. now i install it again
?

what are you trying to accomplish, exactly?

if service doesn;t work, u can use /etc/init.d/mysqld start

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

i hv tried to install mysql .. but getting msg .. there is no mysql.sock .. i could not locate it
so i m installing again ..

that would be an error you get as you start mysqld, not install it.

u logged in as root?

the sock is created by running mysqld

check if u have /etc/my.cnf

read the INSTALL docs for your distro. You need to install the initial database with mysql_install_db

from where .. will u pls guide ?

that depends on your distro.

using rhel4 … will u pls check, this link http://sial.org/pbot/26565

read paragraph 2, please
but before you can do that, you need to start mysqld
I would recommend asking in #redhat or #fedora to inquire on the exact startup script location.

ok

cluster works with MySQL 4?

I have databes with 120 000 records in the biggest table. But my application starts to working slowly after inserting of these records. I optimize the indexes of the tables. What other i can do to optimize the queries? To use SQL_CACHE?

!man explain

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

i used explain to see where to add indexes

!man cluster

see http://dev.mysql.com/doc/refman/5.0/en/mysql-cluster-backup-concepts.html

bobby switch the slow query log on and look for the root causes

SELECT DISTINCT trade_shows.show_id, trade_shows.show_image , trade_shows.show_name , trade_shows.start_day , trade_shows.start_month , trade_shows.start_year , trade_shows.end_day , trade_shows.end_month , trade_shows.end_year , trade_shows.show_id , trade_shows.location ,
trade_shows.organizer , trade_shows_industries.industry_id , ref_industries.industry , country.CountryName from trade_shows left join trade_shows_industries on trade_shows.ind

Can anyone see why that would output multiple show_id's?

pastebin you got cut short

multiple rows in trade_shows_industries that match the id.

yep

thanks i didnt know that

snoyes you looked at jaypipes blog?

basically the query outputs exactly the same information, for however many results are in trade_show_industries
I just want it to output one result

you should just group by show_id

hello

haven't seen it today

ah ok, thanks pbro

DISTINCT goes on every field

k

.. and not just the first one.

Are you referring to the picture of Marten?

i am having a series of what appears to be mysql server crashes on a debian server, what should i look at to find out the cause?

snoyes its the benchmark tool name

oh yes, I saw that.
Was going to comment about it, but there's no underscore

yea that worked, thanks pbro

anyone could give me any advice on how to sort multiple rows to keep certain order? i mean how, for example sort something in the way that row with prev_id = x follows a row with id = x

field

ORDER BY FIELD( country, 'US', 'Canada', country ), country; // This will order the list by placing the US first, Canada as second, and the other countries in alphabetical order

Hm, maybe that's not quite what you were after.
sounds like you want to order an adjacency list; that's tricky for mysql.
trees

http://www.dbazine.com/oracle/or-articles/tropashko4 and http://www.sitepoint.com/article/hierarchical-data-database, http://jan.kneschke.de/projects/mysql/sp/ http://jan.kneschke.de/projects/mysql/sp/sp_tree.sql http://www.vbmysql.com/articles/database-design/managing-hierarchical-data-in-mysql/ http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

easier with a nested set.
or materialized path.

thanks, i will google that i had no idea how to call this way of sorting

can i pipe the output from one select into another? i want to do .. select distinct(ip) from accounting; select sum(amount) from accounting where ip=$ip order by date desc limit 6; but use the ips from the first select in the 2nd

!man subqueries

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

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

thank tyou

tcp or socket ?

Hello!
I'm thinking about category tree and I will probably IP.trees.

Hi, I want to set up some backupscript for my sql. mysqldump only requires SELECT, right? (So a GRANT SELECT ON * TO 'backupuser'@'localhost' IDENTIFIED BY 'supersecretpassword' should do it?)

if I have a result set that I want to use in my application, but also use as input for another query, is temporary table what I want?

However, i have some performance questions.

anybode in here uses cluster with mysql 5?
body

amigrave, i would think socket would be quicker than tcp, as there isn;t the static ip hosting header involved
hehe.. would think..

What is faster? 1. Sorting records by 3 fields. 2. Searching by: LIKE "10.5.%" (% only at the end)?

can anyone give some pointers on how to diagnose mysql crashes, i am stuck, and can't find anything helpful on google

thanks

Are you using MySQL's official binaries?

resolve a stack trace, as the crash message suggests. create a repeatable test case and submit a bugreport

SettlerX, what sort of schema are you using?

Can you reproduce the crash?

it's a debian sarge server, so they are debian's version

SettlerX, can you paste bin the "SHOW CREATE TABLE" and indices for it?

Hi there

the server host seemed to stop responding on friday, i restarted it, there was a corrupt table, which I repaired, all was well

trudim test hardware and try mysql.coms versions

I juste got a "Out of memory (Needed 8164 bytes)" error on my MySQL server
with "mysqld got signal 11;" after that

np

this morning all the websites that use mysql were down, everything else on the server is working perfectly

look at .err files and syslog

i am trying to find some log that will point me to the cause of the failure,
the /var/log/mysql.err is empty

is there a way to know what is using so much memory ?

Legor, what sort of system are you running & how much memory do you have?

i'm running Debian 3.4.3-13sarge1 with 8Go RAM

and you need MySQL to use all 8gb of ram? you 64bit from system to userland?

i don't know if i need so much memory, thoug top gives very few free memory
yes this is a 64bits system

check the output of free -m
and make sure the mysql you're using is native 64bit

what should i check in "free -m" command ?

ugh

Legor, how much is being used for buffers & cached while mysql's running
basically you're trying to work out if MySQL is hitting an imposed limit, or a hard system limit

mysql is running now and i have 5054 used for buffers/cache

k, so you're only using ~3gbish
you know what explicitly triggers mysql to run out of memory
e.g. can you replicate the problem all the time?

no i don't
and unfortunately no i can't reproduce the problem on demand
i can only wait and see that it happens

can you upload your my.cnf somewhere

yep
to you know some upload site ?

it might be something silly like having too large per-client buffers, getting a sudden spike and needing 8 bazillion gigabytes
uh. paste2.org

i think i have standard config

ah paste it anyway

i only had to change max_heap_table_size and tmp_table_size to 1024M
here you go :
http://paste2.org/p/5303
what do you think of it HarryR ?

uh, is this a dedicated MySQL machine?

Is there a my.cnf equivalent to skip-name-resolve?
Or is that option only possible through the command line startup?

Legor, you're using the very small defaults, on a system with 8gb of memory you can push some of these up quite a bit

yes it runs only mysql
which one for example ?

Typically the command line options work in my.cnf, just lead off the leading –

you can probably increase the key buffer to a GB or two
query cache upto 32 or 64mb

actually i had a previous conf with higher values, but the servers crashes frequently with "mysql got signal 11" error

ok, it looks like you're running the 32bit executable then
go and get the 64bit build of MySQL so it can actually access 8gb of your memory
instead of getting killed off when it tries to access more than ~3.5gb

how do you see that ?

k..I'll give it a try. Thanks

It's a guess based on what I've seen so far

Legor, see the my-huge.ini example file

e.g. http://atonal.ucdavis.edu/matlab/database/mysql/my-huge.ini

and how can i check i'm running the 64 bits exe ?

if you run `file /path/to/mysqld` it'll tell you the ELF header

wait for a while..

e.g. ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), stripped

what is the "file" command ? i don't have that on my system

it works out the filetype based on a set of configurable rules, so if you're unsure of what a file is you run "file" against it and it matches it against known formats
Which distribution are you using?

thank you, snoyes. worked perfectly. I had tried that before, but I had put –skip-hostname-resolve in the my.cnf file by mistake. It worked now that I typed it correctl.

Legor, show variables

Hi Guys, how to enable mysql to allow remote connections, ie. from another machine in the office?

external

remove bind-address= and skip-networking from my.cnf and grant permission to the external 'user'@'host' and remove any firewall rules blocking port 3306

show variables gives the following :
version 5.0.41-Dotdeb_1.dotdeb.2
version_comment Dotdeb Etch backport
version_compile_machine i486
version_compile_os pc-linux-gnu

486 there you go

sounds good ?

no thats 32 bit

so it's definately 32-bit, so you won't be able to use more than half of the memory on your system
which is probably why you're getting memory allocation problems under high load
Legor, are you using Intel, AMD or other processors?

AMD64

k, when you run uname -m you get x86_64 right?

exactly !

which distro are you using?

Debian 3.4.3-13sarge1

oh sorry, I forgot

np

hello

hello Nomalz

Legor, check http://dev.mysql.com/downloads/mysql/5.0.html#ubuntu and make sure you get the AMD64 server

HarryR i introduce to my server admin Nomalz

and associated packages, I can't find just a plain non-rpm or deb version of the AMD64 build
Hi Nomalz

hi
We used the dotdeb debian package version

the AMD64 build?

on debian 3.1 that we built with amd64 "experimental" kernel
(debian 4.0 wasn't released when we installed it)
i don't know which version it is :o

9' DAY_MINUTE

wait pls

Nomalz, k, the only thing that seems to have gone wrong was that you installed the 32bit version build and not the 64-bit build

mysql-server-5.0 5.0.41-1.dotdeb.2 MySQL database server binaries
yep it's possible
but how can the server host use all of its ram (8go) with a 32bits version ?

it cant…

total used free shared buffers cached
8110064 7416620 693444 0 37104 1256460

the rest of the memory usage is just disk buffers & caches

3.4gb for disk buffers & caches ? is it possible ?

yeah

oh
not cool

Normalz, MySQL itself can't but if you're using MyISAM tables the 4.5GB that MySQL can't use directly will be used by the OS to cache the data rows. MySQL doesn't cache MyISAM data rows itself so this can be useful.

ok

Since the 32 bit server is also faster than the 64 bit server unless you need to have MySQL itself allocate more than 3.5GB, if you are using MyISAM and need that amount of OS cache for your data, there would be no reason to switch to the 64 bit version.

Jamesday, or like… if you have lots of clients and want to have reasonable buffers for them and were running into problems like.. running out of memory

the major part of our data is myISAM
we had the out of memory problem today only
but we had a few crashes with no explaination

how much load is the server under?

on this server and another one, which has the same ocnfiguration
very loaded
and the database is huge

and you're running with a 16mb key buffer on a box with 8gb ram?
that's 16mb for the whole of that mysql instance

we changed the value
to test

ah k

but we may need a little help on the conf part
we hade key_buffer_size = 768M before
but since it crashed, we tried the default conf…
on our first server (lelit), there is a big database which has 1.4go of MEMORY table and 1go of MyISAM table
2.4go
+others database which are about 400mo in total
is 8 gb sufficient for this kind of database ?

yes

ok
it's a first step
the serv has 288 query / s

how many average connections do you have?

between 150 and 250
if there is a configuration template for high loaded server like ours, it could help

are there any good resources out there to go to for more advanced help with join syntax? the mysql documentation on joins leaves a lot to be desired

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

problem is, if you've got 250 clients at maybe 6mb each per active thread, 768mb key buffers & 1gb maxium temporary table size, you're going to hit the 32bit limit fairly quickly

what about this conf file ? http://atonal.ucdavis.edu/matlab/database/mysql/my-huge.ini

yep :
would mysql enterprise give us a little help with all of this (better management & maybe more support for crashes) ?

it's very likely, but so would understanding why you're getting these issues and what you can do to resolve them
it's very likely, but so would understanding why you're getting these issues and what you can do to resolve them

k, thx HarryR

thanks guys

don't forget to thank the bots!

http://phpfi.com/253330 - but is it helpful for you?
the second: http://phpfi.com/253331
LIKE: "1.17.15.%"

Normal, Enterprise would give you MySQL support engineers to check why your'e crashing (but you'd need Platinum level for performance tuning beyond that)

the second way - we find categories by sorting by: master, step, name (from another table) - so with JOIN

Normalz, it's probably per-session variables liek sort_buffer_size that are too large.

and in the first case - without JOIN
but how is it with performance of LIKE with % in the end?

we're talking about the error "mysqld got signal 11", right ?

is it faster or slower than sorting records by these 3 fields?

Normalz, yes

we have another server which is less loaded and with the standard conf. it has 8go of ram (only use about 4 ou 5 go) and still has about one crash per month !

SettlerX, Like with on the end will use an index if one is available and also can be used for the rest of your join. It's very fast.

so i don't really think that it's a conf value problem, since even the basic conf on a huge computer makes crashes

Nomal, then you definitely need to look at your my.cnf settings to see where the RAM is being allocated and see if youre per-session allocations are too large.

the standard conf provided with mysqld can be too large ??

Nomalz, I don't recall how debian configures it. Standard configuration can allocate too little RAM for key_buffer_size so your queries are slow and your connections build up to the point that you run out of RAM.

that's an neverending problem

Nomalz, also need to look at your indexes and queries to ensure that those are efficient
But can start with my.cnf checkout first to see if that's reasonable.

yep, that's Legor job :p
i'll probably go with the my-huge.cnf

Nomalz, or mine if I wasn't on vacation
Nomal, tha'ts a good start anyway - there's nothing grossly wrong with that one and it does allocate sensible buffer sizes

yep, i think queries are mostly optimized, unless there is some that were forgotten…
Jamesday, any chance we have further information about crash looking at the backtrace ?

with "1.5.17" method (it's a path) i don't need joins. It would be an index. If it's fast, so i will implement it.

Legor, not when I'm on vacation
Legor, see how it does with my-huge.ini and can adjust from there.

ok Nomalz will have a look at that
do you think bad my.cnf can trigger "signal 11" crash ?

If you do get stuck, toss some money MySQL's way But that pays my wages so I'm biased

No wireless at the beach? Totally unacceptable.

Legor, easily
Legor, I've seen people have setups that at the maximum connections they allowed could use several terrabytes of RAM
Legor, I've seen people have setups that at the maximum connections they allowed could use several terrabytes of RAM

so our only way is to adjust the conf each time that the server crashes

Nested trees (left+right), all connections (e.g. 1-2, 1-3, 2-3) with depth, recurenction - they are more problematic
I have heard that Microsoft uses IP.trees - true?

they also use the blood of puppies

Nomalz, or you can watch memory allocation to see it rising. Or cut back on sort_buffer_size and the other per-session variables

evil doers

DSal-Rak: can you extent your words?
*Extend

Your load doesn't sound high for the box you have so it's probably just tuning
Though when you crash, don't trust he automatic MyISAM table check - do a manual check table for each table to be sure.

that what we do
we always have one to three crashed tables
that block our scripts

what will happen if we don't check tables manually ?

(that's how we know that mysqld crashed…)

Corrupt tables can cause the server to crash. Can end up with a nasty cycle

we have MEMORY table that we use for rankings (it's being recalculated each 30mn, and each table is 700mb), maybe it could be better if we converted theses tables to MyISAM ?

Worth a look at your mysql error log file as well to see what it's complaining about - see if it's complaining about being unable to allocate RAM
Nomalz, why do you need memory tables? What is the operation that you're doing with them that caused you to use them originally?

we neved had any ram error before today, and it's only because we switched our conf to the standard conf to test
our main problem is error 11 crashs without any other error (mysql.err staying empty)

Nomalz, so your own config worked, standard causes crashes?

standard caused crashes quicker

ah, quiker is OK - so need to compare yours to standard and see what he differences are
how many sort_merge_asses do you see in show global status?
sort_merge_passes rather

also standard causes "Out of memory" error

hi!

Therion, I'm not here, you don' tsee me, I'm an illusion Hi

The differences are mainly the per session value, which were bigger than the "my-huge.cnf"

wherease own config gives only "signal 11" error without mor information

hehe

Nomalz, OK, which ones are bigger, which smaller and what does sort_merge_passes say?

sort_merge_asses: 617 (it's still running with the standard conf now, so i don't know if the value is really useful)

OK, how much uptime for that?

from smaller to bigger : standard conf my-huge.cnf our previous conf
1 hour and 28 mn

Nomal, interesting.
I have a stuck z key btw

^^

what is sort_buffer_size?
in each config?

in standard, there is no sort_buffer_size
in my-huge, sort_buffer_size = 2M
in our previous conf, sort_buffer_size = 32M

32mb per client! ouch

OK. right HarryR
Nomalz, OK, calculate sort merge passes per second with current setting

current is standard

two show global status 5 minutes apart, subtract values, divide by difference in uptime
Then try sort_buffer_size = 4M and see what difference that makes to the rate of sort_merge_passes. Adjust until you have found the lowest value of sort_buffer_size that doesn't make sort_merge_passes increase t a fast rate.

ERROR 1148 (42000): The used command is not allowed with this MySQL version
but i cant see what ia m doing wrong
LOAD DATA LOCAL INFILE '/home/cot.co.uk/autofiles/cotmembers.csv1' INTO TABLE members FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' thats what i am doing in mysql 4.1

k, i see

Nomalz, sort_merge_passes aren't very expensive so a few per second is fine.
that may mean lowering your sort_buffer_size value below 2M - if so, do that

http://pastebin.com/m79bdfeb1
(our confs)
my-huge.cnf is the conf that we are gonna use soon
at the next restart
we'll see if it goes better…

Nomal, choke…
max_heap_table_size = 1024M
tmp_table_size = 1024M
those are… somewhat large

yep
but our memory tables are 700mb large
if we don't use theses values, mysql says "table is full"

we may use MyISAM talbes instead, as suggested Nomalz before

and do you use 1GB temporary tables that have to be all in RAM?
that one can probably be smaller

Legor knows better than me the utility of theses tables

do you think it could help to use MyISAM rather than MEMORY ?

BDB!

Hi domas

Hi!

Nomalz, maybe

we designed MEMORY tables because there is a lot of access to this table and we wanted to make sure the server has data in his cache

Nomalz, show global status, what are the temporary table lines saying

that works with innodb too ;-) )

Created_tmp_disk_tables 67

innodb is perfect for hot stuff

Created_tmp_files 834
Created_tmp_tables 15 k
is that what you wanted ?

how to choose between innodb and memory TW ?

TW is the country!

oops :$

are you asking whole country to help you?

^^

Lower max_tmp_table_size to 8M then adjust until the created_tmp_disk_tables rate is about 4-5 per second

lol nope of course

if you have 700MB, you choose innodb, its easy ;-)
just turn off the log flushing

could you say why ?

finegrained locking ;-)

if we lower max_tmp_table_size to 8M, mysql won't allow us to put 700mb in our table

the maximum temporary tables sie is probably why you're crashing

or am i wrong ?

of course, BDB rocks too ;-)

Nomalz, so don't create it as a temporary memory table, create it as a memory table instead

it is a memory table !

what is create table for it?
max_tmp_table_size doesn't limit the size of memory tables - unless you've found a nice new bug

ok
so we can lower this value
ENGINE=MEMORY DEFAULT CHARSET=latin1 AUTO_INCREMENT=2660036 ;

doms could you advise when using InnoDB, BDB, MyISAM, Memory ,
?

and then all the connectiosn that need temporary tables for other reasons wont' allocate 1GB of RAM

ok, that may be better ^^

all data is cached in memory, let it be myisam, innodb or whatever

that will probably stop your crashes

there's just a question if it is backed by physical disk

what about the other values of the my-huge.cnf ? it seems ok ? ( http://pastebin.com/m79bdfeb1 )

and how well backed

then you can think about other changes liek memory or myisam or innodb choice

how many changes are you getting, etc

467

whoah
that was Therion

it can stop our crashes, but remember that we have another server with the same hardware, more database but less loaded, with the standard mysql conf (so without tmp_table_size !) and it still crashes (but less often, i admit)

Nomalz, successive refinement time after this - to allocate as much RAM as is needed and no more to the buffers - will gradually get there
domas, is there a pre-conference yet?

mmm, we're doing sightseeing now mostly
the 'conference' starts at 1st

sightseeing sounds good

well, except that it is 35C and 100% humidity

oops. seeing your pretty computer sights sounds good

nah, did spend whole day out
did have some tropical rain showers today
with lightning in close proximity every few seconds

guys, thx for your advices

yep, thanks a lot
if it continues crashing, i'll come back when you're out of your holidays ^^

domas, our MEMORY table is a huge table (2.5M records) with a lot of SELECT
which engine would you adivse ?

Hey Seekwill

oh no, I'm being singled out

I got a question for you if you have a minute

Nomalz, Legor, heh, just catch me when I'm eating dinner again. going back to playing games now

how to contact you ? you're always here, or maybe i can ask your mail ?

Why me?

I was told you might know

There are 429 other people who might know better than me…

Nomalz, you can't reliably catch me - I'm not normally here.
heh seekwill

To much presure ? hehe

oh

Nomalz, as domas said, subscribing to enterprise can catch me - I'm oone of MySQL's support engineers.

Like, look at Jamesday. He like, invented wikipedia with domas

hey Kaj!

k

hey Domas!

seekwill, heh, you're telling people all of our secrets

Ah, you work for them?

TW= Taiwan?

yep!

HI kaj

OH I didn't know it was a secret!

wow!
hi Jamesday!

wikimania!

Seriously ? I use wikipedia all the time

cool, I might be in TW in a month or so

I'm leaving in ~9 days
I guess will miss you ;-)

9 days, that's a long time!

yup, lots of stuff ahead

You are in the presence of the higher power. Bow down or ask a question for infinite wisdom

I should have arranged to visit teh apac group and had the travel coincide with wikimania. But travel… long distance travel.. yuck

lol

http://commons.wikimedia.org/wiki/Image:Wm07warm_up_party.JPG \o/
its already up there

listen to seekwill

I have a table, indexed with 1 row. A query such as "select id from table where id=3" takes 63ms. Why does it take so long?
It should take about 3ms
Also the computer is 100% idle, and has enough memory. Also it's a 2.4ghz quadcore machine.

context switching

disks arn't that fast yet

\o/

context switching?

How did you come up with 3ms?

I can use the memory engine with this table and it still takes 63ms

well, queries have to take less than 1ms usually
then test timing error!

On my other machine, that is the time the query takes

Use the other machine then

lol

perljunkie2, I was first DBA for wikipedia, domas is current. both of us work for mysql as support engineers. So if anyone ever says MySQL support doens' have people with a clue about real world big systems… .

or DNS

what else is that machine doing

or TCP connection

is it a winbox

actually there's no clue about real world
who says wp is a real world

heh

well, look where it is waiting
can be anything in the stack

ok. It's unreal that the place can raise a million dollars in donations

usually a proper database server returns in ~1ms

Can one reset the counter that MySQL uses for auto_increment?

it doesnot
ALTER TABLE

domas|TW, Thanks, I'll check that …

How do I figure out where it is hanging?

strace -t or what was the switch
-r?

domas|TW, Are you sure? "help alter table" doesn't seem to show anything allowing me to reset the counter.

see you

yes, I'm sure ;-)
mysql.com/alter+table

domas, you need to work out how many of those Taiwanese girls you can pack and where you will store them in your apartment.

lol wtf

domas|TW, Thanks - found it: ALTER TABLE t2 AUTO_INCREMENT = value;

naaah, its always nice to come here!
ant there's typhoon incoming
never saw a typhoon
should be fun.
I already enjoyed what they call 'rain' here
its probably 'storm of the century' back in europe

lol

domas, typhoon? you should arrange to visit florida dring a hurricane to complete the set

mmhmmm, would have to do disaster migration stuff

get people to migrate the servers first

no!
thats not fun

lol

if we migrate servers before disaster, no way to ask for donations

ah! an evil plan!

Anybody a fan of UserFriendly? Does Domas remind you of anyone?

Dogbert

dogbert?
hahaha

haha

seekwill, hahahahaha

Could the ms delay be due to an old OS (rh3) or old mysql (4.x) ?

no

how do you drop tables? is it simply "DROP TABLE tablename;" ?

RH3 or RHEL3?
it is

ok ty

RH3 is yes, pretty old
you can expect anything with it

lol rh3…

2 EDT

thats probably not RH3

what is it then?

RHEL3
;-)

what's the difference ?

RH3 is very very VERY old

6 years

lol ok

probably

nope, older
March 1996
thats 11 years

9 years from rhel3
still ancient

rhel3 = Oct 2003

lol http://ars.userfriendly.org/cartoons/?id=20070726

hehe wysiwtf

hehe
I can't get any work down when the company VPN is down!

The company VPN is always down it seems.

in the immortal words of jazz…. "what up bitches?"

I did the strace. It appears to take 20ms unless I am reading the times incorrectly. http://rafb.net/p/7X2kdk80.html
1185812089.268749 to 1185812089.281307
I'm not even sure what that means I guess

is it possible to have more than just two 'masters' in a master-master replication situation? all the howto's only seem to ever document 2 servers

JerJer, you can do circular replication
JerJer, you can't do star or similar however

Hi. I have a query which spends a 99% of its time in the "Sending data" state. What can I deduce from that ? What else is interesting to look at in such case ?

Subdino, and the query is?

ugh … so circular sends it from one server to another to back to first server (eventually) ?

Subdino, eg. asking for too much data , select * or a poor use of a limit

JerJer, yes, it goes in a circle

what level of detail do you want ? basicaly, select sum(my_column) from my_table where [15 boolean operators, around 4 inegality operators, 8 egality operators]

A

is that why they call it circular replication?

Subdino, that sounds like a full table scan

The strace says my query is taking 16ms, The interface says 63ms

"explain" gives a index_merge with extra "Using intersect(payment_uid,resource_uid); Using where"

xzilla, yes sir, tricky naming!

3210 rows estimation, table has 16 columns: 9 bigint, 2 double, 1 datetime, 4 varchar
I really don't get what this execution state means… transfered data should not be so big, so I guess time is spent in "processing rows" part as described on general-thread-states.html, but I have no clue what it really means
is it the cost of the index merge ?
intersect, I mean

dunno it may be, can you simplify it at all

afternoon all. in an explain, will a DERIVED table always show "using temporary"?

Yes

i wasn't sure. i knew it was a temp table, but didn't know if it would tell me that i'll stop trying to find a way to optimzize the temp table out then

Joins, Groups, and Subqueries

??

They all use temp tables

joins don't unless you are joining more than your buffers allow
groups you can get away from if you do it right

not always

I thought it was. Interesting

if index can be used, temporary tables are not used

maybe my buffer is to small

so back to my question. on a DERIVED table should i continue trying to optimize out the using temporary? or is that informational (because it is HAS to be a temporary table)
(by DERIVEd i mean a subquery in the FROM clause)

hey guys, im doing a fulltext search to grab some rows from a Postings table, at the same time I want to know if the user doing the searching has previously viewed the posting, this data is stored in two tables eg. tableA[guide_id,user_id] tableB[guide_id,posting_id] ..iv been trying some
joins but all I can get is ONLY the postings the user has viewed and not all postings from the search and extra data for th

do you have any mysql book recommendations .. a coworker just asked me about mysql books
the only good one i know is mysql performance tuning
but its a bit dated .. and focuses on a specific subset of mysql
pro mysql seemed ok from the sample chapter i skimmed a while back

SELECT * FROM postings, tableA, tableB WHERE tableB.posting_id=postings.posting_id AND tableA.guide_id=tabelB.guide_id AND tableA.user_id=123; - this doesn't really work as it only returns postings the user has viewed before
uSELECT * FROM postings, tableA, tableB WHERE tableB.posting_id=postings.posting_id AND tableA.guide_id=tabelB.guide_id AND tableA.user_id=123; - this doesn't really work as it only returns postings the user has viewed before/u

mmm, nope, didn't read any

I thought 'high performance mysql' was a little too basic.

neither have i

SOURCE CODE!

hehe

i have only read generic sql books

didn't buy it after browsing it in the bookstore. There was only a couple chapters not covered in every other SQL book

book

http://www.kitebird.com/mysql-book

and o really mysql stored procedure programming

Just read the log history of this channel.

archivist

the bot keeper at the moment

hehe

er yes

it's a pretty sweet bot actually

domas
heheee

dammit

We have 4 (soon 5) physical locations that the powers that be want to have all of our data 'replicated' at all location… would circular work for this sitaution?

\monster\: Use an outer join, not inner join, when looking for rows of one table that are not associated with rows of another table. The alternative is using NOT EXISTS (…).

JerJer, possibly, assuming you know the limitations of circular

\monster\: or NOT IN (…)

ok ill play with that

what about mysql performance blog ?

\monster\: Listen to the_wench …
a not in b

SELECT a.* FROM a LEFT JOIN b ON a.id = b.id WHERE b.id IS NULL;

what about the mysql cluster stuff? assuming we wrote our apps to be aware of the read-only versus write-only. would that be 'better' ?

SELECT SQL_CALC_FOUND_ROWS posting_sl.posting_id, MATCH (desc_long,desc_short,response,ota_keywords,page_title,meta_keywords,meta_description,summary) AGAINST ('java') AS sort_by, study_guide.*, study_guide_record.*
FROM
oops
ignore that

\monster\: Ignore what?

accidental paste

\monster\: What paste?

JerJer, mysql cluster is not designed for geographical replication

ok - good to know

a not in b ..example would only return rows not present in b wouldn't it?

\monster\: That's the idea.

ok, now what im looking to do is do a normal search on one table and also grab info regarding past views for each posting returned for the user doing the search
maybe im making sense here, not too sure
maybe ill pastebin the actual query im trying

\monster\: The example shows you how to obtain the missing rows. Just remove that WHERE criteria to see them all, noting that nulls in the right table represent those not viewed (not found).

quick question for ya, how hard was it to get the_wench to post the correct url's for !man ? did you have to index the page or does it just post a search?

define incorrect

heh

it uses mysql xml index terms
which are borked

hmm this is sql 101, i think iv had a different issue on friday, checks

You're taking a class on SQL?

thanks
(but that stinks about the xml being messed)

nope, just saying what Xgc is describing is basic stuff so i think iv had another problem
bnope, just saying what Xgc is describing is basic stuff so i think iv had another problem/b

fatpelt its been entertaining making a reader

\monster\: Not knowing anything about tableA and tableB (in your example) makes it hard to propose a direct solution. What does tableA and tableB represent?

need to nuke this coffee
one min i think i can do a better job describing this heh

any good books on data structures in sql?
like storing trees

trees

http://www.dbazine.com/oracle/or-articles/tropashko4 and http://www.sitepoint.com/article/hierarchical-data-database, http://jan.kneschke.de/projects/mysql/sp/ http://jan.kneschke.de/projects/mysql/sp/sp_tree.sql http://www.vbmysql.com/articles/database-design/managing-hierarchical-data-in-mysql/ http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

amazing…..

hi
how to dump a single table?

mysqldump

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

fatpelt thats how we cheat ^^^ with bad index terms

Hey, is there anyone able to lend me a hand? Thanks.

this one is php-mysql and is in 3 mysql chans

it is written in php? what do you use to connect to the channel? (i found Smart_IRC and i'm not sure about it yet)

Hey, is there anyone able to lend me a hand? Thanks. [MYSQL]

its got smart_irc in the core
ask

"I have a question", Don't ask: "Is anyone around?" or "Can anyone help?". Just Ask The Question. Also, please read: http://workaround.org/moin/GettingHelpOnIrc

i guess i'll stick with it then

Yah but it's work related, so I don't want to give out sensative information, the_wench.

hehe

if you want private support and hand holding mysql.com/enterprise

Lol, archivist, that won't help either
I've already wiki'd everything, seen it etc, now I need someone to help, wether I'm going crazy or it is a genuine problem within a host or the script

quite a deal……

can't do sub-selects in mysql? like select * from foo where foo_id in (select * from bar); ?

!man subqueries

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

Zaki, did you try it

Anyone know why some system variables, specifically innodb ones cannot be selected like 'select @@innodb.buffer_pool_size;' but others can?

ok http://pastebin.com/d3237c990 is my actual query, i want to get all rows from posting_sl table and match if possible rows from the other two tables, what I have there returns only rows from posting_sl that match the WHERe clause
user_id field is in study_guide table

errr "select @@innodb_buffer_pool_size; "

Basically, my client's website is MYSQL powered [eg, all the information, bios etc]. Moved server, everything setup accordingly, the backup was executed perfectly but none of it shows on the pages [ bios etc] which is from within the database..

EvanLugh, are you getting any sort of error?

nope
thats the weird thing, no error
the information just *doesn't* output

are you sure it isn't a rights issue?

rights issue? Please explain

often times sites suppress error messages. something like a "Access Denied" type thing

oh, nope no error or anything everything is fine apart from the information not outputting!
www.lucy-anne.co.uk/index.php [it's for a model website, No XXX]
you should see the disclaimer

Oh, no XXX? Blah, don't need to click it then

well above that, should be the information taken from the sql database, it should give an error should the database info be wrong
haha
and under the stats box

how to cast the type of output values of a subquery?!

EvanLugh, not if you have error reporting off

it's on
YES messgae or whatever
message*

what happens if you run one of the queries in something like Query Browser ?

what's that?

thats a program message not an error message

!man query browser

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

+Sorry, I'm not good when it comes to SQL, edit variables is all :p
u+Sorry, I'm not good when it comes to SQL, edit variables is all :p/u

fatpelt as I said index terms suck

hehe

also
it worked before I upgraded the plan with the host
so i contacted them many times

did your ip addresses change in this ?

but they didnt say it was on their side
huh?

think i figured out a solution to my issue, wee

change in what exactly
monster lucky :P

it seems that enterprise really wouldn't help here….

hey, is it possible to write a select statement that will select where a condition is met in any of the table's fields ? ie. for a search feature

are the ip addresses different from before when it worked ?

fatpelt, i don't see how/why the ip should affect it
an ip*

answer the stupid question

LOL

(it could matter)

ip address of what exactly?!!
the sql host ?

the db server and or the webserver. you said you migrated the system

oh
yes they did, but I changed all of the variables

(did /me misunderstand)
did you make any modifications in the mysql.* tables?

it's with 1+1 like, 1009@1+1.com _
Yes, fatpelt

EvanLugh, the php may override the error reporting settings

did you "flush privileges" ?

flush prileges?

a phpinfo() will tell you what your error logs is

um
ok

after you made changes in the mysql.* tables did you either a) restart the server or b) flush privileges

nope neither and i never edited the tables just the backup database settings

er… s/error logs/error reporting/

how to create a table from a query?

because this is the third time we've changed to make sure no downtime is occuring, and i've done everything like I have the second time, only the second time it worked fine :P

!man create table

see http://dev.mysql.com/doc/refman/5.0/en/create-table.html
see a href="http://dev.mysql.com/doc/refman/5.0/en/create-table.html"http://dev.mysql.com/doc/refman/5.0/en/create-table.html/a
see a href="a href="http://dev.mysql.com/doc/refman/5.0/en/create-table.html"http://dev.mysql.com/doc/refman/5.0/en/create-table.html/a"http://dev.mysql.com/doc/refman/5.0/en/create-table.html"http://dev.mysql.com/doc/refman/5.0/en/create-table.html/a/a

this was my last resort too :X
i already phoned 1+1 approx. 4 times

is it possible to setup a mysql 5.0.42 slave to replicate a 4.1.22 master?

did your ip addresses change the other time you migrated?

Hi EvanLugh. My name is Evan too.

perljunkie2 = High five
fatpelt= hostname did
or my ip? My IP changes all the time /dynamic

"select * from #mysql where real_name='evan'"

432

it all depends on how the rights are set up in the mysql.* tables as to if it is hostname or ip address specific

fatpelt= yah already edited those variables

What is the error message exactly?

there isn't one
:p

hmm. something is wrong with my query, my name isn't evan and there are 431 people here….

that's the confuzziling part

so back to my first question, did you then restart the server or flush privileges ?

I think one left sense your query

we cant restart it and no how do i flush priveleges
bah i gotta go for 30 mins, would i be possible you could tell me in a priv chat, fatpelt? OTHerwise I'll miss your answer
I really appreciate your help

We will just halt all conversations here until you return.
Hurry.

haha

nope. sorry

Everyone play world of warcraft for 30 minutes till Evan gets back

hehe

Good plan, I wish

how to rename a table :P ?
create table foo from select * from bar;

!man alter table

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

then drop table bar ?
ok

!man rename table

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

thanks alot weign and all

when "im Weierächer" is 13 bytes long and it also has 13 characters, then it is not saved in UTF-8 format, correct?

how to get the integer value of a string?
string = varchar field

It will implicitly cast as needed, or you can use the CAST() function.
!man cast

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

!man adding new user

see http://dev.mysql.com/doc/refman/5.0/en/adding-users.html

Can someone point me to a How-to on how to restore a dump from a remote server, to the local server I am working on now?
I allready grabbed the *.sql file, but my attempts to locally restore it, has failed numerous times.
o.o

you can't just mysql -uUSER -pPASS database backup.sql ?

nope

hey all can someone direct me to the link that explains how to export results to a file? I did it once before but forgot the synatax and can't find it on mysql website

hihi im back

SELECT … [INTO OUTFILE 'file_name' export_options
Etc.

k thanks!

how can i flush priveleges in phpmyadmin
please*

why not just flush them in the mysql console?

i dont know how, it was suggested earlier because im having problems

select *,foo/bar as foobar from .. where foobar 10; "unknown column foobar in where clause" - This surprises me, i was so sure that using "as" allows me to use the name later in the where clause.. no?

its simply, FLUSH PRIVILEGES;

ok where do i put that?
!man flush

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

./mysql -u root -p type ur password in use your data base then type it

99; is being auto limited by something at 1000 rows

which variable/setting is that that I've recently stumbled against

!man outfile

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

lokieee, was that for me? nothing popped up after a bout of rtfm

anyone happen to know the export_options to outfile that will save the nice lines/table that sql select usually produces? instead of just the data? I'm using into outfile '/root/devicesOut.txt' but the .txt is just the data, and its not nicely formatted but I can't seem to find that option
kitchen no that was for me

Nope. But you can use a HAVING clause instead.

mysql dbname export.sql ?

SELECT …, expr as foobar FROM … HAVING foobar 10;

there's a flag for that on the cli tool

does anyone know if mysql dependent packages like zlib, openssl, libgcc are available by yum in 64 bit?

mysql -t …

if I had used INSERT DELAYED I might see it as delayed_queue_size is 1000

fatbelt, you alive yet, still need your help and I have some more info :P

fife_out.sql

woops

rofl

lol

*scans for site*
JK

luckly its local host

grr is it easy to fix that my php files don't seem to be connecting to the databases?
haha
or is there a certain chmod eg 677 or 777

677?
You want it rw by the mysql user
Make sure mysql owns it

Hey I am trying to create a table that uses the memory engine
and I need to save text data

it already is 677

of unknown lenght

so basically, the php files have the correct variables to send and retrieve/output the information into other php files [index.php].. but aren't

but it says that The used table type doesn't support BLOB/TEXT columns
is their another way?

they dont seem to be connecting to the mysql database(s)

do you have shell access to the webserver?

i want to add a n:n relationship to every field in every table of my database, to be able to add "sources" for every bit of information

hey fatpelt
nope

would i end up with a sources table and a linking table with keys "table" and "id"?

i deleted the database
and nothing changed
no errors
so im guessing, the php files weren't contacting the mysql databases
to retrieve the info

or maybe a separate linking table for every data table?

anyone got some input on this? freebsd 5.3

do a phpinfo() and see what your error reporting is.

mario# mysql_upgrade
mysql
Can't find 'mysql'

ok hold on fatpelt
fatpelt
http://lucy-anne.co.uk/phpinfo.php
a href="http://lucy-anne.co.uk/phpinfo.php"http://lucy-anne.co.uk/phpinfo.php/a

what connection method are you using?

connection method? eg- FTP?

for mysql. pdo/mysql/mysqli

is there an expectation of when 5.1.x will be made GA?

I expect it tomorrow.

back
mysql fatpelt

GA?

does your code look like this $conn = @mysql_connect(…) ?

or maybe I should ask if there is a published timeline?

general availability

johnny generally available

oh..

yes fatpelt

ie marked as stable

the @ supresses the error

that's what i just say

here's a part of one
$cn_models = mysql_pconnect($

please help!

DavidHKMrPowers, please read http://catb.org/~esr/faqs/smart-questions.html

SELECT `A`.`a`, `B`.`b`…… how to mix them together to become one column?

don't say another word in here until you do

say, column a is "file://" , column b is "install.bat"

you could always say H. E. L. P [ it's not a word, it's scrambled letters! :P ]

please h.e.l.p

i was joking _

\o/

Any ideas, fatpelt? OR do you need more info from me xD

do as johnny said and read that url

fatpelt ok..
but it's not related to my question

you won't get any answers until you read it

and would it be a good idea to recreate the database, so that I can see if it connects as of yet, fatpelt?

that url i believe is related to any question

fatpelt, nice response.. i'll use that

i wonder if i should have said "that url is related to every question"

i suppose.

it still feels like a permission problem. where the user that you are trying to connect as does not have rights to the database
that's just me being picky though

Ok I am getting ready ro move from one server to another. Now both the servers are running 5.0.27 the Database uses InnoDB the binary file is 67GB. Now i need to move the site with the least about of downtime. any ideas?

Ok fatpelt, so what should I do? It's frustrating, fifth day with this problem!
It's all chmod to 677 already =s

EvanLugh, same thing here

Should i setup replication on the servers and have the new server be the slave?

but i wait patiently just like everybody else..

!man permission

see http://dev.mysql.com/doc/refman/5.0/en/query-speed.html
see a href="http://dev.mysql.com/doc/refman/5.0/en/query-speed.html"http://dev.mysql.com/doc/refman/5.0/en/query-speed.html/a

huh? does that answer have anything to do with the question?

What isyour problem?

how to make columns other than the primary key column unique?

that's a good way.

UNI

sorry that was for EvanLugh but it messed up

!man unique
?

see http://dev.mysql.com/doc/refman/5.0/en/constraint-primary-key.html

make the field not null and unique

fatpelt, i know
i was suprised at the answer

But can the slave handle changes while it is a slave ?

call me Evan must be annoying writing EvanLugh all the time _

altho i don't realy know how to query the thing personally, i could tell that answer was wrong
tab completion
so not really

EvanLugh just type ev then hit tab

as long as there are no EvanSomethinelse

well blow me
ok well that just did it for me johnny XD

i'm doing that not for your benefit, but for everyone else's
i don't know what to tell you. it seems like the webserver doesn't have permissions to connect. i could be wrong there, but that's what it seems like

Right, fatpelt, I'm editing all the variables for a new database now, and making the database, then I'll add the backup and let you know if it works, which it presumably won't considering it'll be the 4th try.

seekwill, my problem is such that i'm working on an open source project, which is a moudle for a cms type system , it does comments

does any of you have a function that would replace a certain word in each of all fields in a db?

it is implemented with some hybrid nested set and something else model
so i'm trying to bring it inline with it's true nested set roots

i start to like mysql

Were you working with Xgc?

correct
he was a big help

Oh good luck then I'd stick with him

how is mysql comparing with postgresql?

hi

now i'm trying to reorder the results by the thread head

I will to known how to import a backup made with mysqlhotcopy ?

adding backup now

seekwill, i'm trying to spread the joy around

i would like*

lol
being somebody's personal tech slave is no fun.. so i was trying not to mention his name
err his/her …

DavidHKMrPowers http://monstera.man.poznan.pl/wiki/index.php/Mysql_vs_postgres

DavidHKMrPowers, it's faster last i remember..

Comments

I have a database table that stores a username and the date when a user loggedin if the user presses the logout

method()
even though it's a static call, $this is available still
it's voodoo
^^ for you

mmk
thanks

np

nham…other question, where i donwload Apache?

http
blah
http://httpd.apache.org
there is again Win32 binaries

thanks xD

Thank you, I should've known that Davey!

Delixe:

any recommendations for a unit testing framework?
phpunit was uhhh, painful.
or is this seriously a lost cause, as i've been told?

What's the most common XMLRPC implementation? (I have full access to the server)

anyone know how to set up curl

hey y'all

server or client?
the extension?

client, I guess. does it matter?

check out the one in Zend Framework, it's pretty good
and the nicest API

i was like here 2 days ago looking for a decent HTML tree parser ( php4 compatible ), still can't find anything have been trying to write one, but its a total bitch :[

PEAR has the HTML_SaxParser IIR
C

weird I thought there were native versions

there is the xmlrpc extension, and the immature xmlrpci extension (client only)

I guess i'll take a look at zend, thanks

http://pear.php.net/package/XML_HTMLSax3

http://us3.php.net/manual/en/ref.curl.php

*reads*

http://pear.php.net/package/XML_HTMLSax for the older stable version
what are you trying to do with CURL?

this i am assuming
nuttin much
play with it\

if you're *making* standard GET requests, the http stream is far superior
if not, maybe HTTP_Client/Request or Zend_Http_Client would be better
finally, there is installation instructions right there in the page

davey….you are talking way over my little head

file_get_contents("http://url") == HTTP stream - automatically just works
if you are wanting to pretend to post forms or whatever, http
blech

yeah !! thats ut
it

http://pear.php.net/package/HTTP_Client or download the Zend Framework http://framework.zend.com and pick out the Zend_Http_Client

me ?

yes, you

oh god….i'm scared

if you want to post forms or perform more than basic requests, use those
well, you're in luck, I wrote the base of the Zend one, heh
http://framework.zend.com/manual/en/zend.http.html#zend.http.client
it's pretty well documented

how ?

how?
I hit the keys on my keyboard

yes, how?

letters were typed

and then

or am I misunderstanding your question

sorry….just amazes me

HTTP is a pretty basic protocol

hold me

are you hot? :P

don't worry i am a girl

I didn't ask that

so its ok if i was a hot guy

Who am I to be picky?

man you men arent picky anymore, are you
whatever walks …grab it

if someone is hot, they're hot. regardless of gender. The fact is I find very men hot :P
very FEW men

but you do find some hot ?

sure

hello
what is PHP

depends who you ask

Personal Home Page.

don't make me stab you.

i am logging stuff to a file…

Yes, everyone on IRC does that [domon].

but it's *most* common answer is, a programming language commonly used for web sites (in fact, the most popular for that job

characters?

are you going to be a little more constructive?
[domon]: str_replace()

yuck lol

[domon]: pass in arrays for both the first two args
it's fast
[domon]: the other option is http://php.net/html_entity_decode

i think that's better
thx davey

[domon]: but it's pretty much the same thing under the hood
[domon]: str_replace() is faster if ALL you want is and

html_entity_decode replaces more than and .
Things like — and & will probably get replaced as well.

it's also character set aware

:P

if I have a mysqldump/phpmyadmin dump.. is there some how to easily excute it again through PHP?

yes and no

Wrong parameter count for fread() in /var/www/vhosts/iptriple.com/httpdocs/API/index.php on line 720
Wrong parameter count for str_replace() in /var/www/vhosts/iptriple.com/httpdocs/API/index.php on line 722
:|

if you have MySQLi then yes, it's reasonably easy

oh whoops
LOL

just use mysqli_multi_query()
otherwise, you need to explode() it into seperate queries, and iterate them through your query function of choice

hi. i am trying to understand the code here: http://pastebin.ca/636773. I know that it relates to the mapping of URLS within the site I am looking at. The main bit I'm unsure about is $GLOBALS['app']-Map-Connect. I am used to OOP syntax like
$this-class-method. Can anyone shed any light on this?

$GLOBALS['app'] is just the $app var in the global scope
$GLOBALS['app'] is an object, which has a property called Map, which is also an object, which has a property called Connect

okay, thanks

Davey, thanks. is this php4? I am used to php5 oop syntax. DO you mean an object as in an instance of a class?

welcome
it's PHP 4 and 5
and yes

I have a requirement to add the ability for users to be able to save a partially filled form, and allow them to resume filling it out later
anyone have any experience developng such a feature?

Davey, is there a general term/phrase for what the developer is doing here so that I can read up on it?

actually, I spotted one the other day, one minute
http://jan.prima.de/LiveSaver/

wow, that is great
thanks @Davey
I was considering using a button, and a table with form id:value in order to save
but, this is more "resilient"

$fp = fopen("iptlogfile.txt", "w+");
$data = fread($fp, "706220");
what's wrong with that? o.O

[domon]: assuming $fp != false, nothing

Davey, i'm guessing that the app object has been instantiated somewhere earlier in the code and is stored in a global variable. I'm not used to working that way but would be interested to find out more

it's nothing special; you understand scopes?

Davey, variable scopes, yes. As in local variables and global variables. I probably don;t understand the intracacies of them across all versions of php, though.

http://pastie.textmate.org/83002
Resource id #16
1

hasn't changed since PHP 4.1.2
well, even then the scopes didn't change, they just added superglobals

that's the output of the script o.O

[domon]: php.net/resources (IIRC)
$GLOBALS is a superglobal that is an array of variables in the global scope

Why does 10%3 give 1, but 3%10 gives 3? Shouldn't they both be 1? Where did the 3 come from?

% = remainder after division using whole numbers

it prints out 1 for is_resource

so 10 / 3 = 3 remainder 1, 3 / 10 = 0 remainder 3
because 3 is not divisible by 10

Oh, I see.
Thanks, Davey.

grr, 3rd blackout

ouch

UPS ftw!
no problem

anyone have any ideas?

Davey, I have heard people say that globals are bad. Why would you not just extend the base App class? Might this be to ensure that the script works on php4 and 5?

well, i didn't say the code was *great*, they should've used a singleton IMO

singleton? :| ?

its a design pattern

[domon]: one of the staples of design patterns

vaguely remembers it being talked about but can't remember exactly what it is
erm..
that was meant to have /me in front of it

http://www.phppatterns.com/docs/design/singleton_pattern

ty
anyone know wtf is going on with my script?

TML?

Davey, the code is from a cms/framework called Jaws. ever heard of it?

ugh, this is *old*
yes, and know people who work on it

TML? davey said you were a moron

Davey, ah cool. what do you think of it?

kidding

http://www.fluffycat.com/PHP-Design-Patterns/Singleton/ - better

Davey, I am interested in getting involved and maybe helping with the documentation (there is none)

never worked with it, but I know the guy I'm thinking is a decent code
a decent coder*
I think you'll find I said TML knew me when *I* was a moron :P

lol
i have to make myself laugh sometimes

Davey, is he a native english speaker. I always seem to get a non-native in #jaws

no, he's icelandic, but his english is great
helgi thormar (where the th is a weird char like |D)

Davey - cool I'll look out for him. THanks for your help and general wisdom!
bDavey - cool I'll look out for him. THanks for your help and general wisdom!/b

makes me worry for the human race, frankl
y

its all relative!

I am by no stretch of the imagination, wise.
I'm just a good actor

does anyone here know a good PHP gallery?

coppermine?

is preg_match a good thing to use for all my validations

http://coppermine-gallery.net/

only if you want to make complex patterns
*always* use native string functions if you can, like ctype_*, is_numeric, etc
regex is *slooow*

Well, i am using is_string to validate a firstname box
But doesnt that mean they can put in whatever they want, spaces, $, %

sup!

I checked out php.net/is_string and they tell you how to use stuff, but never say what it excludes

yes, try using ctype_alpha instead

For example Davey, does ctype_alpha exclude spaces

yes
maybe you want ctype_printable
(IIRC)

Ok, looks like i have a winner, thank you

Then that would still allow spaces, $, %.

How can I see what pear libraries I have installed?

pear list
from the command line

Hm, weird. I installed the progressbar extension, and I don't see it there. Maybe I'm looking for something else.

pecl extension?
pecl list

gah, yeah, it was pecl
Thanks, I'm a tad rusty

Yeah I've been using coppermine
But I don't know crap about php so when I really want to customize
it's near impossible for me

pear list -c pecl or some such would work too

gets frustrating

you're going to run with that with most thing
s

yeah
I should probably learn PHP
on a scale from extremely difficult to impossible
how hard is it

uhh

because it seems real hard

it's relatively easy

any advice on where to start?

get the visual book on php
(PHP published by Visual)

hm, okay, maybe it wasn't pecl. Or maybe it was installed by hand, and that's why it wasn't on the list (eg. from source).
require_once() [a href='function.require'function.require/a]: Failed opening required 'DB.php' (include_path='.:/usr/share/php') - that's the error, hm, I know it's pear, I think. /me googles

ok

php config-show
make sure the php_dir is set to /usr/share/php

does anyone here have any experience with coppermine?

http://pastie.textmate.org/83005 - what's wrong with that?

Hm, php config-show says Could not open input file: config-show. And where is php_dir set? I don't see it in php.ini. hmph

Could PHP be used so that, if I were to choose an item from a drop down box, it writes a table depending on what I selected?
Would I have to write the HTML using PHP?

sorry, pear config-show

why couldn't you do that?

oh, hehe

I'm not sure how I could accomplish it
PHP can't write into an HTML page that's already there, if I am not mistaken?

1) Formulate the problem 2) think hard 3) code solution

print "table$variable/table"; or….

Hm, yup, php_dir is /usr/share/php. I'm moving stuff from one server to another, and I forget what DB.php is.

No, PHP is a server-side language and HTML is static.

print "table" . $variable . "/table";

You can always use EMCAscript.

hey who can put PHP programming into a nutshell for me

you can use AJAX too

[domon]: I would but I don't really know any Javascript. D:

google xajax
you dont need to know a drop of JS
all done in PHP

Hmm. This looks interesting. I'm assuming, since it's PHP, I can use it with MySQL also?

PHP is a programming language, commonly seen with web frameworks. End.

yup

My PHP-based system now uses MySQL, that's where it gets the data for the HTML Table from

If you have mysqld running and PHP is built with MySQL support, yes.

yeah not really what i was looking for
cool though

http://pastie.textmate.org/83005 - what's wrong with that? T_T

hrpmh, what function i need to cleanup text retreived from database, that has " and ' in it that i need to echo thru html
tried addslashes, not work, i forget what's out there

grr, apache creates a directory, then can't delete it, permissions are 0777

why is apache creating a directory?

a directory for an ftp user

what is ownership of directory created?

Apache

what is group?

it has all permissions set
windows doesnt have groups
well, not in the same sense

are you sure its apache creatign the directory?
never knew it too have such a feature, but i never use it on windows either

pretty sure
the owner is apache, and it's created the same time i run the script
hmm, something weird is going on D:

print filesize("/var/www/vhosts/iptriple.com/httpdocs/API/iptlogfile.txt");
returns 0 everytime :|
tho the file does exist…

sounds more like a problem with windows than apache, i'll try afew more things

http://thatvideosite.com/video/4607

this script is php you talk about ?

well this is a php channel

solution, dont run apache on windoze :P

well php is creating the dir?

maybe i'll just go back to running apache as SYSTEM

as user apache

php runs under apache

safe mode?

no safe mode
unlink(CFTP\root\home\test) [function.unlink]: Permission denied in Dwww\dev\admin\ftp\user.php on line 43
i'll try delete it manually as the apache user

can someone help me really quick

tag

PHP has a function for this, $text = nl2br($text) to convert newlines to BR tags
so echo nl2br(file_get_contents($blah)); would work

i did that but now the text do show up

why not just use \n for newlines?

\n is fine for console
if printing to browser, \n !=

well this is what i have

yeah

php $text = nl2br($text);
echo nl2br(file_get_contents($news.txt)); ?

which is the whole point in conversion

permission denied

\n?

tags in where the newlines are, which could change how your site looks

it can write files into it but can't chdir into it

php echo nl2br($text); ?

TehSausage, i think you need to start conversation from scratch, sound like theory… why is script making directories as apache and not as user running script?

it's just a simple script to add/delete ftp users

is there a php-suexec or whatever?
for windows

okay apache user can delete from bash

cuz apache is deleting it, sounds like user is trying to delete which is why denied

have to use file_get_contents or else the content in the file wont disply on screen
have to use file_get_contents or else the content in the file wont disply on screen

file_get_contents = file into string
file = array

php echo nl2br(file_get_contents('somefile.txt')); ?

can someone tell me why print filesize("myfile") returns 0? the file is 777 for permissions, and definitely exists, as i can see it via FTP and shell

is the file bigger than that? rofl :P

because = the result
0 = the result

erm..?

[domon]: Well, what is the actual size of the file?

690 KB
706,220 bytes

oh joy, is_writable('C\FTP\\root\\home\\'.$user) returns true aswell

it worked thanks

anyone?

[domon]: You can try if (file_exists($filename)) print filesize($filename); else print "File doesn't exist?\n";

it exists

that way you can make sure you're referring to the file you think you're referring to… we don't know where this file is (same dir as the script? somewhere else?)

har har
found the problem

i think you have to take out \n

i had fopen(filem, w+) before print filesize(file) XD

hiddenfellon, why would he need to take out \n ?

hi

let's see if I can figure this out

how can i make a string always to be 10 digits? i tried all - $tmp = sprintf("%-' .10s", doesnt work

hello

use substr($string,0,10)
so $string = substr($string,0,10);
that will make it 10 digits

and this retuerns also 10 digits if the string has only 5?

well, no
then it would be 5

thats my problem

strpad

then just add some stuff onto it

I'm trying to figure out how to read data from a database using this

I want useing the javascript source.

strpad(substr($x,0,10),10,'0',STR_PAD_LEFT);

how can i do it?

thx

$row = mysql_fetch_array($query); this array value $row .. how can I using the javascript var i=[]; ?
db query and var a=[]; a==$row?; alert(a);
function Array() { [native code] }

you cannot do that
JavaScript and PHP have nothing to do with each other.
You need to loop through the results in PHP first, and assign them in JS during loop

Artnez, okay.. I know loop .. but it's very long line.. :-)

example - php echo "var results = new Array();\n" for( $i=0; $isizeof( $results ); $i++ ) { $result = $results[$i]; echo "results.push( '$result[name]', '$result[address]', '$result[other_field]' );";

so I will find better skill ^^;

in any case, you can't share variables between PHP and JavaScript, please read the basics of these 2 languages to understand why.

Artnez, thanks.. :-)
good man..

does anybody where i can get fonts fot FPDF?

Yes. Offtopic.

Jafet, can you tell me where?

I don't know.

Jafet, You said Yes!?

what does that have to do with PHP?

You asked if anybody knew. Somebody probably knows, so the answer is yes.

Artnez, yes . the class is written in PHP

Ask an inappropriate question…
If I write a PHP script to serve fetish hardcore gayporn, does that make fetish hardcore gayporn a valid topic of discussion in this channel?

Jafet, do you think you are "cool"? i don't think so

Yes, I think certainly think highly of myself. I don't see how that has anything to do with this, though.

I think he's cool too!

damike, google probably knows

He's convinced me too

stay on topic here please, do some googling

He seems pretty cool to me.

Jafet, here are PHP developers - i don't say the problem to ask such a question - just idioits complain about that!
see

In English please?

lol

Jafet, the last part is enough for you

?

And here he comes, straight into the troll-trap, folks!

damike - ASL?

just to questions about *php code* and you'll be fine

Artnez, …

google search for "fpdf fonts", could you know have done that?
the first result is what you need
you'd have all of your fonts ready by now if you spent that time google searching

Artnez, i still tried to convert manually

whatever, just use google. i believe this channel is to help people learn PHP better, not how to operate proprietary librarys that convert font files to PHP files

"The award-winning Opera Web browser The coolest, fastest, and most secure Web browser available." - those are rather bold claims =/

hello

ShaunOo`: Bold… but true!
Firefox doesn't count because it's an XUL interpreter, not a web browser.

Artnez, no problem so far - but at the moment there a no people here asking PHP questions - so i can't understand why IRC people have problems with that - the "my holy channel" thinking .oO

you are ignored. im not an admin, talk to them :-/

I'm sure there are lots of user in this channel who know where to find fetish gayporn as well. That does not make it appropriate to ask for fetish gayporn in this channel.
s/user/users/

ShaunOo`: Opera is great. Only problem that I have is it doesn't have a lot of community plugins like FF.

which functions can i use to list in a web page the last 5 files that have been modified or added inside a directory ?

ShaunOo`: IE: the web developer plugin sucks, whereas the one for firefox is great

http://xkcd.com/293

Artnez, ahh. IE and Opera - where is the PHP part? …
troll channcel

#phpc

:p
funny pic
anyways

All the functions needed should be neatly categorized in the manual.

do you know them

you were talking about FireFox?

Check under Filesystem and Directory, or something.

k thanks

No, I don't. I do know where to find them.

My Name is Blah My Name is Halb, how do you make it some preg_replace only replaces between the first ocurrence of My Name?
so*

To throw damike off. Nevermind.

use the filemtime() function

is it recursive ?

Generally preg_replace will find the first occurence My and the last occurence of Name
Can you set it to non-recursive?

um, no. you need to specify the filename as a parameter.

No LongBeach. You have to traverse directories yourself.

just loop through the dir and sort

ok, i hope it's fast

If it isn't, don't use PHP.

nah, traversing recursively through a large directory tree is not fast in any way, php or not

PCRE regex isn't recursive by default, if I understand what you're asking that is…

Doesn't preg_replace only replace the first occurence unless you use the global flag…

I want to replace the first My Name not what's in between…

it would help to use special naming conventions for the filenames

I am not sure guys

http://www.the-art-of-web.com/php/dirlist/

tell us the original text and the way you want it to be
can't guess what you want

"My name Chad"

preg_replace('/My name/', ''); ?

"My name is Bob My name Chad", it's already null thankfully.

Artnez, I prefer Opera for PocketPC but not for desktop for some reason *shrug* but regardless, it's THE best mobile browser.
Hell, even IE for mobile is better than Minimo :P

preg_replace doesn't look at the first occurence and stop, it looks at the end of the string and then replaces..

so you want to remove the "is"
is it *always* "is", or can it be something else?

What's your expression?

Well the REAL string is:
"SELECT [….] FROM WHERE ( SELECT FROM […] WHERE [….] )" and I want to replace the FIRST occurence of SELECT FROM and place something like count(*) inbetween it. only the first occurence.

are you trying get total results for DB query?

yes
I have a bunch of union'd statements

there is a better way

So I have make them sub-queries
What's the better way? I haven't see any other way to do it…
heh

SQL_CALC_FOUND_ROWS

Use a non-greedy match.

http://www.arraystudio.com/as-workshop/mysql-get-total-number-of-rows-when-using-limit.html

Or that.

sorry, i had to google it. couldn't remember the exact thing

Interesting, I'll try it.

read the MySQL docs on the topic here: http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows
note what they say about unions
will probably be relevant to your situation

Interesting, thank you so much for that Artnez, that helped me immensely.
No preg_match needed =D

$var, $_POST['var'], $HTTP_POST_VARS['var']

i think im going to buy a hat tomorrow so i can really tip it, thats such a smooth thing to do
use $_POST

ok. just out of curiosity is there a reason why everyone doesn't just use the shortest version?

learn the difference between superglobals, read up here:

http://bin.cakephp.org/view/851322774

http://php.net/manual/en/language.variables.predefined.php#language.variables.superglobals

alright thx

please dont forget to read up on
*register_globals*

well i'm reading a book right now. just haven't gotten to superglobals and stuff yet

how old is the book?

$arr[0][0]['count'] ?

2005. it talks about php5

oh…

but thats the newest

hey
how do you calculate sysdate minus 2 weeks ?

arg the websites talking about php6. i wish technology would pause for a moment sometimes :P

go back to kernel 2.2 then

ha

Thanks Artnez again, that really saved me A LOT of time and actually improved a lot of things

or go back to Rasmus Ledorf's mother womb

cool

Can somebody say 'unbirthing' … ew ..nothing could be more worse

uhh wtf lol

what do you guys think of MVC?

it will save your life
just dont use somebody elses code to do it

what do you mean? not use a lib?
or an MVC framework, rather
im thinking of using CodeIgniter

yeah. Look at how frameworks work, and learn from them, and create your own to suit your needs

well, i did, but it doesnt use MVC
and i'm doing just fine with it

it all depends on what you want your site to do

it actually acts alot like MVC does, except with Models and the file structure is slightly different

if your site has a 'one-look-and-feel' based system, MVCing is going to be a big timesaver
aaah… MVC = Model View Controller
so 'except with models' == wtf?

*without, sorry

oh :P
imo, file structure is unimportant
its how the code is assembled that counts
nasty = include trees

yes, i avoided this well

include("bigincluderfile.php") ?
ive worked on so much code that includes more than nessecary to make a page work, and its hell trying to work out what exactly it does

yes, i dont do that at all. there's only one place where includes come from and that's the main.php file (which is the starting point)

imo, the MVC philosophy basically equates to keeping the problem domain in the one place

i guess i'll stick with my framework, it's been working great for half a year with no problems
was just second guessing myself as i always do to try and better myself :]

yeah, if it works good, and development is fast, i say dont change unless you _know_ something else will work better ^_^

ha, i need to take a week or two break so i can pull my code together and make it rapidly deployable (ie; create an SQL schema and refine it, maybe an installer files)

my biggest task atm is modularisation for easy slap in from one site to the next

i actually just finishe that upgrade

my MVC aint perfect yet,

at the moment the framework comes with MySQL database handler, data objects, session handling, etc
in the config, you set the libraries you want to load
some are dependant on one another, so errors are raised appropriately

why raise errors? why not just be smart and include what you need?

the biggest gotchas i keep having where there are modular interactions, but the interactions are always different depending on the task :/

because there's no overhead by raising the errors. let's say i have a code profiler. instead of including the profiler only when i need it, i can save time by just disabling it
if statement checks of config wants to load the profiler and other dependant classes make sure the profiler is loaded with another simple if statement - no problemo
regarding my page modules, i do a different system than MVC. i have a dir name "modules". my-site.com/my/profile will be modules/my/profile.php

is there a quick way to sort, in a chronological order, an array filled with (value, date) fields ?

usort()

url-php relation is a must, seen too much abuse of mod_rewrite and

thanks

ok so you should use $_POST['var'] instead of $var but what if you are defining a new local variable which obviously wouldn't be in the POST array. $var may not work because the register_globals setting may or may not be on
the book I'm reading just keeps using the $var format for local variables

url-php

Url has at least 1 file that exists in the FS which is an obvious and unique entry point
maybe not for paramters, but use some common sense

my page system doesnt do that, and it works fine. as said: site.com/my/profile accesses /modules/my/profile.php

as it should

nvm got it

i hate dealing with some systems that have doc_root/my_profile.php, which includes like 30 libraries and a 'main.php' file at the top

/my/profile and /my/otherprofile dont both call the same php script, which then does magic

theJackal, well this is how i deal with parameters

yeah, i know exactly waht you mean

lets say you want to view someone's profile
site.com/user/theJackal is /modules/user.php

by parameters, i mean, numbers, names, etc, ie: things youve watned to clean out from the ? part of the equation

what i basically do is traverse the modules directory
using the url
in this case it sees that there is no /modules/user/theJackal.php so it goes up one
and it finds /modules/user.php
then it takes everything that was in front of the found module (in this case "theJackal") and appends into the $_GET method with numeric array
so to access the username, you would access $_GET[0]

thats good :P .. but im saying the problem is when dumbasses do a mod-rewite to site.com/user/thejacakal == index.php?dir=user/theJackal
and then have no file even with user in it

ooooh, i see
when i came up with that idea for numeric keys for $_GET it felt like fate, as all keys for $_GET are strings

you just spend hours looking through code to find somehting as trivial as a html syntax error

the one thing that interested me about MVC is keeping the page module in a class file
so in the constructor i could assign template values each time

and then theres people who combine that stupidty with _NOT_ using MVC, and have about 20 versions of every file

in my case, i need to have seperate files for update/delete/etc
/modules/user/delete and /modules/user/update

and _NOT_ usins svn*

brb

people who dont use an RCS need shot
repeatedly
in the balls
( tennis ) _

i dont, dont shoot only because i do all projects on my own and for some reason every client needs everything "NOW NOW NOW", thus i just skip version control and get coding right away
i've implemented good version control a few times though, when designers and other developers were coming onboard later on
i had one nightmare situation when there was no version control and developers were overwriting updated files with their older ones when they made updates
the amount of times i got the "hey can you update your version of some_file.php because i overwrote it with my old one" phone call was unnerving

is it possiable that the file get command wont let you change the size of your content in your text?

can you rephrase?

ill just tell you my problem
i used this command to get the content of my txt file to display php echo nl2br(file_get_contents('site.txt')); ?
now when i go into txt file to add html it wont work
for example FONT FACE="Times New Roman" SIZE="12"something here/FONT
it displays at size 24 i think
but its not 12 thats for sure

that's an HTML problem, size=12 is not size 12
first of all, start using CSS in external css files. second of all, do "font … style="font-size: 12px;"something here/font

I have a database table that stores, a username and the date when a user loggedin, if the user presses the logout button he gets removed from the table, but if he turns off the browser he stays logged in in the db table, how do i remove him from that table when he turns off the
browser?

http://www.htmlcodetutorial.com/character_famsupp_92.html
there is no reliable way of doing this

i see. Any way that might work?

you need to create an "updated" field, that updates to a new DATETIME (NOW()) whenever they refresh the page
then you could say that if he/she didnt access the website in the last 30 minutes, their session is expired and you automatically remove it

font, what I would do:, add another column, 'lastPageLoad', update it every time they load a page with the unixdate. Add another query that searches the table for any lastPageLoad older than 20 minutes and remove it

you'll need a maintenance function that either runs from cron, or runs on every page load (more overhead) to do this
you can use javascript however

A cron would be more preffered but if you must, just do it on page loads
*cronjob

I think i can manage on page loads, cause the page won't have much traffic.

javascript has an event called onunload(), it is called whenever the page is closed. you can trigger the "logout()" action using this event.

interesting.

Artnez, like you said, not very reliable

Is there a way in php5 to extend more then one class?

unfortunately, some people might have javascript turned off, so it would probably be good to implement both the session timeout and the onunload() methods

I see, thank you for the insight.

you mean like ClassA extends ClassB extends ClassC?
if yes, then no you can't

ShaunO` solution is very good. (with additional column)

-sigh- thanks ;|

http://us3.php.net/manual/en/language.oop5.basic.php
"A class can inherit methods and members of another class by using the extends keyword in the declaration. It is not possible to extend multiple classes, a class can only inherit one base class."

And i get the pageload from js?
Oh no. I get it now.

what you would need to do is use the onunload() to trigger another page via ajax or similar

Comments

I have a database in server it has some MyISAM tables and many InnoDB tables If I look through phpMyAdmin its

but the try/except it supposed to catch that i think..

/usr/local/mysql/bin/mysql

`which mysql` could help

how which
i compile 5.0.41
i compile host 5.0.41
what to write then path to mysql shared libraries directory?

is it an autoincrement issue? doesn't look like you're inserting a primary key

i dont have an autoincrement. the 'groupname' is the key

oh, hm, and an exception is being thrown?

ihaaaaaaaaaa
it work

congrats

sandrot, from where are you ?

US

sandrot, thanks man
SP

ok im totally retarded
nevermind
i had "show exceptions" checked , so when it popped up the exception, i thought it was erroring out..

glad he irc helped kickstart your brain

it was doing exactly what it was supposed to do

=]

well, at least i know im not losing my mind.. that was working fine yesterday!

sandrot, what is the new version of mysql

I don't know ubuntuserver

ok

can you give a full query an alias or variable or something?

Is there any way to do a 'select into outfile' from the command line that outputs to STDOUT? That is, write a query that outputs CSV

will mysqladmin do it?

That's kinda why I'm asking :-D
I can't see anything in the help that will do it
mysqldump is more likely, but I can't see the useful options

you may not get a csv out of the box but if you organize the dump excel or something could generate the csv for you.

excel? I don't think mysql is gonna do excel if I can't get it to do CSV
I think I found what I need in mysqldump
heh .. it just a select into outfile internally
Unfortunately it won't do it to stdout coz it needs –tab

I meant you could take the contents of the dump and import it into excel, then have excel create a csv out of the contens
Hmm

that would be the craziest way to do it :-D
It would be much saner to just SELECT in perl and just output to STDOUT

thought you wanted csv specifically…

yes .. perl is quite able to output to CSV ..

yeah, guess it could be easy to do with perl
nice

much better than having to manually phart around with excel!

fuck yeaH!

I have a database in server, it has some MyISAM tables and many InnoDB tables. If I look through, phpMyAdmin it's size is more than 28MB. But when I check database file size with command "du /var/lib/mysql/databasename", it shows 448kb. How this is possible?
I just came to know this by copying directory to localhost for backup.
and check it through localhost phpMYAdmin

the whole directory is 448kb?

yes

hmm, yeah you're right…

and in localhost phpmyadmin, I see only all tables, but does not have records.
?

I dunno, records have to be stored somewhere else, but I thought the MYI stored all the info

no, in the downloaded directory, for many tables, there is no MYI files, only FRM files are there.

hey

and all these FRM are InnoDB too.

what about /var/lib/mysql/ibdata# ?

has anybody here used the Google patch for replication?

not familiar with it

mmm

1 min

It makes sure that the slave never falls behind

nice

ibdata1 = 171MB

by not commiting any changes until the slave has received them
wondering how well it works o_O

ib_logfile0 and ib_logfile1 = 5.1 M
I do not know what is happening.
But once commented all setting related to innodb in mysql configuration file, I get the database host and tables as it is in server.
Anyhow, thank a lot for response.
bye

see ya

http://rafb.net/p/IAlHxe91.html
Is that possible with a SELECT query?
Hello btw (

what's the problem?

I have a table with fields and their values and one table containing the fields for a particular type.
type, fieldname, fieldvalue.
I can do SELECT fieldname, fieldvalue FROM mytable WHERE type = 0 to get the fields for each item in the table which has type set to 0
Though, I'd like to get one row for each item of type 0 and turn the table 90 degrees so that the values of column fieldname end up being the name for the columns
as my little drawing shows

what's the second table schema like?

Something called PIVOT tables they said in #sql, but I didn't really understand any of the stuff I found on google
I know what JOIN is and that's not what I want here.
I want to turn the table 90 degrees clockwise so that the left most column turns into table header
and the right column becomes the first row

does anyone know of a proper way to input zip codes into a mysql database? the table itself
I want to input it into a table called users i want to make a field for zip codes

Almost certainly, you want a varchar- even if it seems like you want a int or decimal

Im thinking i might need a int

Remember that post codes do not necessarily follow the same format in countries outside the usa

I'm trying to setup the table the correct way So i do not run into problems later

Varchar is best, e.g. Swedish zip codes are 60351 inside sweden, but S-60351 from outside.

im going to end up making a radious and proximity search

I don't know what the structure of a USA zip code is, but I strongly recommend a varchar

alrighty, even tho char is faster?

As far as I know, you'd have to store lat/long to do a radius search

Mark is there a pasty site that this channel uses?

char is not "faster". Benchmark them to see which is faster if you're terribly concerned about performance.

dpaste.org is nice

varchar is potentially faster if your server is I/O bound and most of the rows contain only a short string
The only way of determining what is "faster" is to benchmark your application with real data

yes
dpaste.org is down

pastebin.ca

http://dpaste.com/14919/
I need to do it in the users table
Because I need to make it so when they do the search it gets people in there area

their

thar

If you're expecting a significant number of users, and you want to search by zip, I'd suggest you might want to index the zip column too ..

how would I accomplish that?

(also, if you're international consider just a free-text 'name' as some cultures don't have the same concept of a first and last name)

hang on here is how I was planning on accomplishing this tell me if I'm doing this the wrong way
I was going to go ahead and have all of the peoples zip codes stored in there user section

THEIR

then get all of the information for longitude and latitude and make a new table called zip codes
have the script take the searching zip code use the info inside of the zip code database then print the users profiles because it knows there zip codes
Is this the wrong way to accomplish this?

sounds about right to me .. though are you planning on calculating the GSD to every other zip on-the-fly?

I'm trying to a SELECT a from `table` where LOWER(a) = LOWER(b) but this doesn't work. is there some other way to do this?

Why do you need to use LOWER() ? Why not just use a collation which is case insensitive (these are used by default in most installations anyway)

woosta I'm going to have the Users zip codes stored in the users table, have the data with long and lat stored inside of the zip codes database so it would do it fast

No, it wouldn't

I'm probaly going to end up even caching the zip codes searches too so it doesnt need to calculate instantly

I don't know how many zip codes there are in the USA, but you're going to have to calculate the GSD for every one of them on every request

not a bad idea, but at other times this table needs to be case insensitive.. is there a way to force the collation for the duration of the comparison?
(rather, case sensitive!)

Woosta, I dont just have usa

Then you MUST cache it

I have canada, all of uk australia and many more

However, I wouldn't bother

I believe there is, but you will lose the ability to use indexes if you do this. Normally if you use = to join two indexed columns, this is a good thing

Just have a table of 'close' postal codes

the tables are small, it's ok

You'll find that due to our government's idiotic information policy, getting location data for postcodes will cost you money
(I mean here in the UK)

I already have them :-p

You can calculate the GCD just once then for every postalcode-pair, and store the closest N

fresh from 1 month ago

What, all of them?

yes

I assume you paid money, it is NOT free

I know the owner of a data company

the information is 'out there' ..

It is out of date and potentially wrong however

sure

he paid
I didnt
:-p

All because our government is too stupid to see the public interest of making it free
Curiously, in the USA this info is free

lol

is it?

so should i use varchar with int? or just varchar

In our country, healthcare is free but post code geocoding data costs money
varchar.

ok

Why an int?
jsut a varchar

I can't see Moore making a film about the geocoding data though

And as I said, you DO NOT want to calculate the GCD in real time, ever

mhm, what is the benefits to using char then?
Curiosity guys
I'm learning =p

It can store post codes for countries other than the USA

alrighty
how many characters?
do you think

Erm
Don't you have the data already?

i dont know how many uk has
its on my laptop
lol

So .. have a look there
Pointless asking us

grr now i have to get up and get it haha

As far as I'm aware, the longest uk postcode is 7 chars, but don't count on it

We know databases, but can't really tell you much about international postal codes

well one of you all said you are from uk
ill go safe with 15
varchar(15)

If anyone can help with this, please do. I'm at a complete loss.
MySQL won't start. InnoDB just gives out an error … let me get it
It tries to process the binlog, one that doesn't exist and is removed from the index.
Error: tried to read 16384 bytes at offset 0 770048
Was only able to read 8192
Error Number 22 means 'Invalid Argument'
read
Cannot continue operation

Are you sure it's trying to process the binlog, not its own log files?

It tries to open a non-existant binlog then errors.
So I made a backup of the ib_logfile's and deleted the original to try again.
But it's just odd … it's trying to open a non-existant binlog.

If you don't want to recover the server from a backup and it's not a replication master, you can safely remove (or move) all the binlogs and their index file. php mysql web hosting will start again from 1.
Be very careful what you do to a production system however
(obviously)

We did remove the binlogs.
It's still trying to open them for some reason, even tho they aren't there.
This time I got a I/O error after it said it was trying to read from log-bin.000008
Hey … question.
ib_arch_log_000000000000 what's in there?
I just tried copying it to my backup, and the disk gave me an I/O error

If your disc is giving I/O errors, you have other problems.

Oh I know.
I'm trying to get shit off this drive, but I need MySQL up to do it.
Can I safely try and delete the ib_arch_log file?

If your hard drive has failed, you may as well restore from a backup
I don't know.

The drive isn't failed, yet.

My servers never seem to have one of those. We use 4.1

Ah

If it's giving IO error, the drive *has* failed

Yeah, backups on this box are very hard to make. Something about 2.5 million tables.
It's just this one file.

2.5M tables sounds like too many to me

So it's that part of the drive.

hey guys Im going to do one more pasty really fast

And yet I can delete it.

if you go to http://puqs.com/install.php if you go here http://dpaste.com/14920/ that is my code I'm trying to make it force into the database
there is an error on the last line am I closing it wrong?

Don't use PHP short tags
Does your user have permission to create tables? WHat happens if you execute the same command from the mysql client?
Are there some quotes missing in that script?

if i drop the table in phpmyadmin it works
but I cant get it to run this way

Stuff phpmyadmin - use the mysql command line client
It looks like there should be a quote on line 16

how do i make it work without using any client
just the server

Use the mysql command line client to test queries in your development environment. Don't use phpmyadmin for anything, it's made by idiots

") ENGINE=MyISAM;" ?
=[ I'm still learning just started today figured the best way to learn is to take my time and learn as I go along
been reading tutorials and such
Mark, the query works
It's getting the php hosting to drop the files in the database
that is not working i have all permissions set on the database

hellas
i have installed the xampp package and would like to install a forum
but it cant find the php mysql web hosting server

not found"

This is a mysql channel, sounds like you're using some strange bundled package. Consult the winmysqladmin support people or xampp.

ya
ok

line 42
better yet…
supplied argument is not a valid MySQL result resource in /home/made/public_html/www/doc-root/flipcide23/index.php on line 42

This is a PHP problem, you have failed to correctly call mysql_query, or not checked its return value. Probably there is a problem with your query.

thanks

hi everyone!
when I've got a 'enum' field, can I order per value? so like: order by enumfield = "open", enumfield="close", … ?

insert ignore
does that mean disregard errors
ignore insert errors?

I believe it only applies to duplicate key errors

cool thats what i want
second question. structure question

Other types of error will still be reported

i have a product inventory table

it means you have to read mysql.com/insert

i want to add a feature to TRACK the old prices of products (when doing a big database update)
so the way i'm planning it is. a second table. old_prices
ProductID,Price

You would surely need to have a date/time of when the price was current from / to

nah. i'm only tracking the last price
just so i can show on the product page Up $22 or .. Down 13$
anyway the dilemna is… how do i set the change to Zero.. if the price is the same?
Inventory (current invent) and… NewInventory (latest inventory & prices)
all i do is update inventory,newinventory set i.price = new.price where i.code = n.code
wait i think i got it

Why not put it in another column in the same table?

i dont like too many columns in one table

Prefer new columns to new tables, mostly.

and because that would destroy a million other things in the database host update system

Why?

cause of the way my system is built thast all
update inventory i,newinvent n,pricehistory h set h.price = i.price where i.price != n.price and i.code = n.code and n.code = h.code
hows that

I'd just do two updates
But again, I'd put it in a column

nah man
you heard of Normalization?

Yes I have. Having several columns does not violate normal form.

sure it does
dude
you can't denyyyy. that PriceHistory should be a table
look at the name. it screams tablify me

If you only want to store one historic price per product, you may as well put it in the product table.
If you need several, you need another table.

nah. just pretend that i want to store date & other prices
ok you win in that regard i geuss
but ill still make a second table cause one table is 2 much
work

If you're storing it so you can display "was £5 now only £4", then you only need one
One table

yeah i know
i knwo this
but i have to do 2 tables
anyway a table JOIN isn't that slow is it

A table join isn't generally that bad, it depends on a lot of factors however

ah yep

someone how knows how to sort on multiple enum values? like: order by enumfield ="open", enumfield = "other" ?
didn't try this, but is that possible?

roxlu, itis

grouped by location. Whats the best way to do this?

ORDER BY created, location doesn't work like I want. and neither will location, created
Is this a programming issue or can it be solved with a query?

group by and order by

SELECT * FROM `job_listing` GROUP BY `location` ORDER BY `created` desc LIMIT 5 ?
doesn't seem to work properly
Anyone?

so customize it to your needs

and when you remove the quotes?
ah..

What?
The quotes dont matter

god damnit

How int he world can I repair an innodb table?
Incorrect key file for table 'table'; try to repair it

sorry ’bout that one :P

Hi
Whats wrong with this syntax? INSERT INTO packages (name, major, manor, release) VALUES ('error-0.1.0.zip','0','1','0');
bWhats wrong with this syntax? INSERT INTO packages (name, major, manor, release) VALUES ('error-0.1.0.zip','0','1','0');/b

Comments

i have a database query returning me array elements with NULL for some of the values issetdata[Column Containing

I create 10 XMLHttpRequest, but response are serial, not parallel as one would expect

because of the browsers limitations

I see.

if you start 10 copies of wget, or something like apachebench, it can handle as many connections from the same ip address as you've got threads/processes to handle
unless you have a module which limits the number of concurrent connections per dedicated ip hosting address

So, neither FF, nor IE, nor Safari handle that?
yes, you're right too.

it's a browser limitation to stop you from ddosing the server or client, but yeah I thought it would atleast be able to do one other connection in parallel

ok, I see your point. Sad

How exactly can I access the @attributes array from a simplexml_load_string response? I can't do $xml-result-@attributes-hid.. ?

did you try it without the @?

yes

$xml-result-attributes()-hid ?

did you try reading the docs?

!rtfm

that gives compile errors

http://uk2.php.net/manual/en/function.simplexml-element-attributes.php

I wonder, though, how can a browser 'decide' how to have the request handled by the server.
I wonder, though, how can a browser 'decide' how to have the request handled by the server.
it just sends a 'packet'…

so you have to iterate (foreach) over the attribute array to access a specific value??..

yeah but the general concensus was that less connections is better, so for the past 5-10 years they've been leaning towards that

you may be able to use xpath or something

for example, if your browser loads a page which has 1000 images on it, it doesn't start up 1000 new http connections to try and get all the images at once

keep-alive!

you mean connections are held and not forwareded until the 'channel' is free?

ste, it uses 2-3 connections because it's more effecient with traditional websites

ok

yes

Very lame.

although AJAX is changing the requirements somewhat

ste there is still only one string between server hosting and client

Ok, so I'm done
the browser, yes, access.log states that request are ISSUED in a 'serialized' way.
won't blame php anymore. won't blame apache anymore. 100x.
won't blame php webhosting anymore. won't blame apache anymore. 100x.

ste, read the HTTP RFC

hehe, the whole beast? About what?
well, one may also say that 10 simultaneous connection to a single server is not even sane, actually.

ste, most browsers will use keep-alive and pipelineing to open a small pool of connections, and then they send a bunch of requests all at once in each connection, then the server responds when it can keeping the order consistent in connections
it reduces the latency caused by the SYN/ACK of the TCP connection, most browsers will open one connection, then pipeline 8 requests to it, and repeat until it has issued all requests for the page

I'm having a brain fart right now, I'm trying to process using recursion, an unknown depth of multi-dimensional array, http://pastebin.ca/644245. Any help on the logic/

ste, but read the HTTP RFC, and most of it anyways, skim over it so you at least read every header (though probably not the full descriptions), it will tell you what is valid and what is not and how the browsers interact with the server

lo

CrazyTux[m], you can do that without recursion…

HarryR, enlighten me

gimme a few seconds

ok, thanks. I suspect actually that this behaviour has something to do with avoiding floods of requests to a single server

HarryR, thank you, I haven't came accross this problem in a while, and it's 5am, so, not thinking to clearly :P

uh, im not quite sure what you're doing though

How to clear cache with php ?

oh right, getting all keys, and putting them in $data[$key]

ste, for your stuff, you asked if PHP is thread safe, yes it is, but you have to understand that browsers always pump stuff out in parallel, and your session data is written at then end of the request, so if you do stuff wrong your session file can get clobbered

you can't do anything with the browser cache, but you can control it's caching behaviour using header()

HarryR, it's basically a prototype example to be applied in other context.

ste, you can also download safari, get the nightly webkit version, it has a debug thing where it will show you when the requests were made and in what order, when they started, basically everything

HarryR, I want to maintain the tier, basically, and recreate the same array…

uh not quite getting what data you want to apply it against

HarryR, the real purpose would be to take a unix path i.e. /some/path/ and start at /some/path/ and create an array file struct.

How to control with header

my requests are independent. 10 requests that will update 10 different blocks in the page.
but actually I see they are pumped out one after another

uh right, with all the files in there too?

array('a', 'b', 'c', 'd')))

HarryR, correct

k you're doing it in reverse though!

HarryR, what do you mean?

at least, looking at access.log. But ok, I see what you mean.

ste, http://webkit.org/blog/wp-content/uploads/2007/06/newinspector.png

oh nm, you're going to be giving it an exploded path?

ste, that is very useful

HarryR, no, just a single path

see php.net/header, Caching directives

but as an array

HarryR, those paths were file structural examples.
HarryR, /a/b/c/some_file_a, /a/b/c/some_file_b, etc

ok, thanks

HarryR, well I'd be using either old fashion opendir/readdir or SPL (DirectoryIterator)

argh

HarryR, but I want to pass a single path, and create a structural array of files based on that path

7pm, lunch
k I see

HarryR, I'll be around , if your still up for running me through my logic thoughts when you get back from lunch.

hey
i need some help with building a logic
http://paste-bin.com/12184
a href="http://paste-bin.com/12184"http://paste-bin.com/12184/a

where can i get googlemaps support?

CrazyTux[m], it can be done using one array like a stack (LIFO), just loop until its finished, no recursion needed

td width="86" (single_cat_title() == "blog") ? 'bgcolor="white"' : 'background="http://www.101greatgoals.com/wp-content/themes/default/images/header_white.jpg"' ?/td

foutrelis www.tangocms.co.uk ^^

do you guys see an error?

hrm?
that's filthy, don't do that
just give the thing a CSS class and assign presentation based on that

PHPadam, don't use short tags for one…and i agree with f00li5h

then you can use .blog .post { background-color: … } and .news .post { background: url(…) } to stick formatting to the cells

edman007, So traverse reversed?

PHPadam, single_cat_title() is a wordpress tag, i presume? Your usage is wrong.

CrazyTux[m], you make a LIFO (Last In First Out), open the root folder, loop through it, read everything into your output array and put the folders on your LIFO, then when you finish looping through a folder you read the next one from your LIFO, your done when the LIFO is empty

edman007, so in essence storing whole paths in an array and filtering in the end?

yea, the LIFO is the list of folders to read, and your final output array will grow as you progress

$phpbb_root_path = '../forum'; which is my phpbb.php file in public_html to link to the forum folder in my root? http://images.uploadimago.net/?s=30416Untitled.jpg

Is there any way I can typecast my php vars?

imme, yes

imme, yes.
$integer = (int) '1';

and string?
(string) ?

anyone?

Or is that called datatyping?

Mech0z, this is not PHPBB help

it's called typecasting

I'd like to define what datatype the vars are inside my class…

how do I see if the php host is compiled with –enable-fastcgi support?

hello friends

$string = (string) 1;

edman007 its not really a phpbb problem more a php problem

thank you.

settype will probably work.

settype, great, thanks.

sure

f00li5h you know yesterday we was talking about clean urls?

hrm?

well i now understand what you were saying, ive read up on it real good

oh, neat.

let me come back to you on this one

sure

can you read what I said in #apache f00li5h?
I'm 99% there

rick111, where is the other 1%? wondering the streets?

im being bulled by apache

edman007, I'm still having a problem comprehending how exactly to go about this… I don't see how to grab the structure to begin with is possible without recursion? given Nth number of dimensions?

bullied

CrazyTux[m], it actually scales better then using a recursive function, lemme get you a little demo function

edman007, thank you, appreciate it, yea.. I try and stay away from recurssion.

CrazyTux[m], you keep a reference to the parent in an array
and use each() on it

what's happen with mysql_connect() function? It shows "Undefined function"

great tool (webkit inspector), really!

Congrats on the site

thanks I'm so happy to release it finally ^^

AlexC_ lets see

www.tangocms.co.uk

Have you installed the appropriate mysql package?

I installed using
sudo apt-get install ubuntu-lamp

never knew that exists,

however… yes.

try sudo apt-get install php5 apache2 libapache2-mod-php5 mysql mysql-serveer
and php5-mysql

Lamp stands for Linux Apache MySQL Php (you know…)

yes I know :P

or perl/python

i don't know there is a ubuntu-lamp package

it's not in my repositories

AlexC_, "mysql" not found

woops, sorry
sudo apt-get install php5 apache2 libapache2-mod-php5 mysql-server php5-mysql

If I declare a var or a const as a property of my class, why does it complain about the value of it being inside an array?
Example; const request = $_SERVER['REQUEST_URI'];

pastebin the line and the classes

No need to pastebin that, right?

i think that may be too complicated to go there

HarryR, so reference the parent being the value of the array?
HarryR, $a = $a[key][] = some value…

AlexC_, thanks a lot, it works

HarryR, or something like that/

So, I should put it in a var and put that var inside a construct?

AlexC_, now I have to understand how… humm bye bye

you're welcome

ghehe… php.net speaks: "The value must be a constant expression, not (for example) a variable, a class member, result of a mathematical operation or a function call."

that's a bit silly, but true

yeah, that's silly

anyone familiar with nusoap? I have a question…

you there?

CrazyTux[m], http://pastebin.ca/644303 …all well i'm slow

edman007, thanks, let me take a look

CrazyTux[m], and actually line 8 in there is garbage, it does nothing…

anyone familiar with nusoap? I have a question…

edman007, alrighty, let me examine this, and see if it makes any sense.

XeroCks, if i say no will you not ask your question?

what does that do again?

exactly
i'm trying to accept a request, containing a bunch of string elements and one list of strings

f00li5h, recursively read a folder into a multi-dimensional array without a recursive function

i can't get the list part to work

also, you want to read from the directory and close the dir handle before you recurse
oh, sorry
i did one of those just the other day, but in perl

Hello
is it possible to add an interfase to add Linux users through a php web page?

It is but I'm not sure if it's the right way to go

why not?

I mean, you can execute linux commands to add a user with the functions at http://php.net/exec. As far as security is concerned this may not be a safe way :P

corpulunt, possible, yes, but you really need to know C as well (or any other compiled language) to do it in a secure fashion
….well i guess you can use other scripts if you use sudo….
but you need to basically have a fronted that executes something that ads the user, and that requires escalating your privileges (so sudo or setuid)
corpulunt,

since you can't avoid passing your user input through a shell, none of php's run-commands type scripts are safe

that sucks

use ldap with pam

f00li5h, you can

how?

open the executable with a constant (so no user input) and pipe the user input through stdin

sure, and all unix binaries read their options from STDIN?
also, that doesn't avoid the shell
the shell is still invoked to run the binary

f00li5h, well write one that does accept it that way, or write a C wrapper to do exec() the C way

write another exec type function for php?

write directly to /etc/passwd, /etc/group and /etc/shadow
and create homedir

can anyone see why this is not running? echo shell_exec('/crontab -u cowen /var/www/time/crontab1.txt');

f00li5h, exec('/app/bin/binary', 'app-name', 'arg1', 'arg2', NULL); there is no need for escaping with that call

what? why?

yes
to avoid shell when adding use
r

but php doesn't have that one, does it?
i'm not adding users

no, but thats where this discussion started

and if writing to /etc/passwd was a good idea (see also: isn't) i'd still have to put the column there

f00li5h, the one in PHP parses it in PHP or sends it to a shell to parse it

and as you can see it was not directed to you

which one parses it in php?

there is also a shell escape that will do

shell escape is garbage

f00li5h, http://us2.php.net/manual/en/function.exec.php

i can set my sell to all manner of confusing things, for example, my shell could find f to be a magic character (if it wanted to)

look at the C function, man exec
it takes multiple args so you just need to pass a valid C-string

who's being passed a C-string?

Hi

f00li5h, man 3 exec

Hi all. Can you suggest me a good Linux program to create web pages (writing by hands) ?

oh, right
g?vim

uh?
"g?vim" ?

vim or gvim

So, they'll probably add this assign_return_of_function_to_const thing to php6, or not?

emacs for PHP…

f00li5h, I tried Screem (not good highlighting but good automatic completion) and Geany (not automatic completion but good highlighting)

vim does both of those things

uh, good…

ZmaX, bluefish/Quanta for HTML editing, but they are too bloated for me

auto completion is annoying

TehSausage, not me :P

propably not

not if you have to demand it to happen

What exactly is the purpose of SSL/OpenSSL/TTL and stuff like that? I've been programming PHP/MySQL etc. for many years but have never got in to it.

why not then?

So I'm wondering what the purpose and implementation is like
As in, why use it, and for what reasons

vim requires me to say ^N or ^P to get it to produce the list

thats against the nature on constants
on=of

Along with how difficult it is to implement in projects that are near completion or very far along.

Kcaj, so i can't buy stuff with your CC when you go shopping at the coffee store

f00li5h, what is the difference between "vim" and "gvim" ?

/dev/null 2&1 &"');

http://www.paste.co.za/8

gvim has gui bits in it

I do not understand, the "variable" $_SERVER['REQUEST_URI'] is a constant itself, within a call, not?

menus and button bars and the like

edman007 Okay, so basically, OpenSSl if I implemented it, just makes all communication between the client and the server encrypted?

not

Kcaj, for HTTPS, yes

its a superglobal

f00li5h, ok thans a lot for your suggestions!

You might also like to take a look at easyeclipse

yeah?

heh, gvim actually works on here
hmm, vim with a gay font and menu's… cool

It's an IDE. Just take a look at it.

lol

It's java absed though…
But the superglobal doesn't change all the time My PHP-program is running…

it's the variable's name
but that doesn't make it a constant
$foo = 'moose'; #never changes, but is still a variable

the gza, the rza, methodman, redman and ODB omg the wu-tang clan, ghostface killah, and etc.
!seen OldDirty[Bastard]
I haven't seen him on in years
omg, overdose :O

i haven't seen 'olddirty[bastard]' sicne he overdosed and died, Kcaj

I'll read up…

hello
any nginx users out there?

hello simoncpu

fifo_, i would say its one of those undefined behaviors, but it is somewhat unexpected, if you file a bug report i bet they will say its not a bug

never mind

bah, i can never get gnome to start ;(

fifo_, foreach ($ar as &$bugVar); gives different results as well

I still don't really get it, if I got a variable and I want the current value of that variable to be assigned to a constant, why is that not the way constants work?

imme, assigning implies changing the value, "constant" means something that does not change (look it up in a dictionary)

could you set it to a reference to a variable when you define it?

I'm looking for some suggestions or hints how to make a website login that would also login you to phpBB forums at the same time if you know what I mean. And also, how would I keep sessions up on the website then…coockies or what would be the proper solution in your opinion?

That would mean constant could never get a value. I'm talking about the first assigning…

imme, the define() for the constant can only occur once, and that is where the constant is created, in many other languages constants are things that are done at compile time (so it should give you an idea on how people expect them to work)

Yes, and with define everything goes well. However, when I want to define a const inside a class, it does not,
define('req' , $_SERVER['REQUEST_URI']);class tst{const request = req;}

edman007, it probably is not a bug.

class tst{const request = $_SERVER['REQUEST_URI'];}

edman007, but just to relieve my frustration in finding this bug, i'm gonna give them a headache

imme, thats because define() is a function, and is done at runtime, a class constant is most likely done at parse time

edman007, at least a glimpse of a headache

just because something works, doesnt mean it's right

fifo_, you ever mess with sessions and have register_globals on? it does the same thing, but a bigger scale

it's possible to access private/protected properties with some useless string parsing, but you don't

fifo_, echo $_SESSION['myVar']; $_SESSION['myVar'] = 1; $myVar = 2;

Do you think it should not work like this?

fifo_, that ^^ is inconsistent depending on register_globals

you shouldnt have to store a variable in a constant
just use the variable
define('HTTP_STATUS_NOT_FOUND',404); # good use of constants

imme, class constants are generally used as parameters to class functions, and their values should almost always be integers (though strings would do)

LOOK AT THIS PAGE ITS VERY FUNNY
http://www.pennergame.de/ref.php?uid=2349
THANKS
http://www.pennergame.de/ref.php?uid=2349

spammer.

Is mb_convert_encoding not supposed to convert & to amp if you pass "HTML-ENTITIES" and "auto" as the 2nd and 3rd parameters ?

icio, did you RTFM?

no, where should I be tryingit ?
oh, LOL
newb
yes, I did.

hey.. what php ide for windows would you reccomend besides PHPEclipse?

I'm not exactly sure what I'm looking for, though :/

input id="site_update" name="site_update" type="submit" value="Update"
once you click this, does a variable in $_POST get set?

HTML-ENTITIES OR HTML_ENTITIES ?

Vme, site_update is set to Update, so $_POST['site_update'] = 'Update'

- (dash/hyphen), like in the manual

$_POST['site_update']";
i try this

and stuff like that

it fails
i get nothing

if you read the manual is says that

echo $_POST['site_update'];

mb_convert_encoding ( string $str, string $to_encoding [, mixed $from_encoding] )

you should understand how strings works in php

2nd is TO, 3rd is FROM

what is wrong with my syntax?

meh…i need sleep, 20 hours is too much for me

I'm trying to convert the likes of © to ©
try echo " HERE: {$_POST['site_update']}";

icio, htmlentities()

and "

thats htmlspecialchars()

Anyone have any fancy suggestions on how to impliment javascript alerts into my php programs?

with javascript?

Right now I basically have it sending a header location with a variable containing the message which shows on page reload when $alert is set.

well, there are options, I prefer printf('HERE %s', $_POST['site_update']);

what does that mean?

Which works nice… but when they hit the "back" button, it obviously shows an old alert.
Style_Info.php?StyleID=".$_POST['Style']."&alert=Hello My Friends");

MrBojangles, scriptthrowError("php echo $error; ?");/script
just make it good HTML/javascript etc..

throwError is a javascript function?

hi people it exist any function that return a first letter? examge +Pepiro the function return +

strstr, I think
to Dj-TaMPaX

thanks MrBojangles

Dj-TaMPaX: substr()

use substr(0,1,$variable);

I think you'd redirect to the old page, only with the alert, and if the alert is solved they get to go to the next page.

I just looked it up in my code

you can also $first_letter = $string{0};

why not just use a ticket queue, like bestpractical.com/rt

curly braces style is deprecated, right?

for subscripting strings? yes.

i have this in .htaccess but dont work, and i have in first line RewriteEngine On, i have mod_rewrite loaded and AllowOverride None

/var/www/test/urls.ph
/var/www/test/urls.php

Did you check to make sure that the .htaccess is pushing the url to the php file?

how does that relate to php?

yes

#apache … :P

if apache does send it to the php script it does if not it doesn't :P

I was just gonna say.. it DOES have .php extension… lol

i have a database query returning me array elements with NULL for some of the values. isset($data['Column Containing Null']) will return false on these despite that the variable is set to a NULL value. is there a better way to test if the variable exists, even if the value is NULL?
a .php function doesn't make it magically sent to be parsed by php
* file extension

if==NULL or ($datap[])
if($data[''])

does it really have null in it? var_export($data['column'])

checks against NULL, FALSE, and

is_null()

that'd throw an error if the array element (column) doesn't exist
i did a var_dump

and what type was it?

NULL

softwork:do a var_dump or print_r on $_POST and $_REQUEST to see what it is getting

well, is_null is what you're looking for

if ( isset() || is_null()) ?
php throws a Notice if the element really isn't set at all. i can't guarantee on the returned elements

have you got error_reporting and display errors?

yes. but turning them off seems premature…

who said anything about turning them off?

okay, i was assuming that would be the next logical thing

never code blind

i don't like coding blind -_-

the last place i was at had notices disabled
it sucked

and i scolded my colleagues for doing the same and then turn it on for them

notices disabled..yuk

I turned it ON for a couple of requests while debugging, and it broke so much stuff
like it even broke sessions (because notices happened before the cookies on login)

now about the problem of detecting variables that were set but have the value of NULL and can't be guaranteed to exist?
what about ob_start()?

you should know if they're going to be set
ob is not the solution there … fixing the borked crap code is the solution
why would there be variables that you don't know about in advance? you put them there

on line b34/bbr /

ob would buffer it so that the code would work while you stamp out the notices/warnings/errors

the line is array_push($nicks_tratados,$pepe);

Dj-TaMPaX: you are not allowed to ask any questions about that error message

and $nicks_tratados = array();

Dj-TaMPaX: it's not an array, it's that simple
you've assigned something over it somewhere

but i have this line $nicks_tratados = array();

not actual variables, but data returned from the database. i can't guarantee that the columns. they may change without notice. i'm using SELECT * FROM

what's the best way of implementing a verification of email system? (eg sent an email that verifies your account when you register)?

Dj-TaMPaX: it's not an array, read the message
not implementing it, go and find someone else's code to do it for you
don't use select * from

is that a suggestion or an accusation?

both.

I've got an idea of how to do it
I just wanted to know if there was a "trade standard" way

i know of the "SELECT * FROM" is considered harmful.

you need to know what dataset you're operating over, selecting extra stuff that the code doesn't use is wasteful (since it's ignored) and selecting less is useless, because the code can't make it's decisions
select what you use, and use what you select

in my case, it would be * all the time.

then list each column

and to do otherwise would result in the code blowing up in size by at least 10x

if i alter the table, and ad a blob column, you don't want to have that column retreived all the time
how?

because i have hundreds of tables

Not an apache spesific question, but I'm trying my luck anyway. I've installed suphp, and it's not giving me any errors, but scripts are being executed as cgi-php, instead of the user. What have I misconfigured ?

how?

maintained by database n00bs

do you really WANT to select all of the hundreds?

well, that needs fixing too

and i can't replace the n00bs because that would mean kicking out half the country
tho that would have been nice

but you can't change the schema until you know what is used where

Can someone help me out with an SQL query, or point me towards a better place to ask? Simplified, I have two tables, orders and line_items. Line items have a boolean column, in_stock. I want to select all orders where every line item is in stock. Any ideas? I'm using MySQL.

#your-database
once you know which code uses which columns of which tables, you can start changing the database schema

?

becaues you know what code will break when you make each database change
#Mysql

no. i don't want to select all of the hundreds. only one table is selected at a time, depending on what lookoup the user is doing

Oh duh ok.

how do I check if certain table exists already in php?
in sqlite
in php

sounds like you need to … gah I don't know I'm new at this stuff I think a switch might be necessary though

your tables should be created when you install your application
they should just be there from there on

i've been around for a few years. don't worry about it. first time i have had to deal with NULL values though

f00li5h, I want it to create a table if it doesn't exist and if it does, it just uses it
f00li5h, I hate assumptions in coding

the user you connect to the database as shouldn't be able to alter the schema
you are allowed to make assumptions, if you ensure they're true before hand

doesn't creating a table that already exists return an error?

f00li5h, so can it be done or do you not know?
I have no idea

it can, but there is no reason to do it

I would guess so

:/

it will make your application more complicated and less secure

meh, then I'll assume

it will also make it more fragile

check the table "sqlite_master" for an entry

but you don't want to have to check for the table before every query

from a security point of view, if your malicious attacker with intent to destroy gets in the system you have lost when he exploits a user account with the DELETE privilege

of course not
sqlite is an embeded database

i'm aware of that. with the publicity surrounding firefox

deadroot, I'm creating for my own use on my own computer with http server bind only to localhost
so the security isn't really an issue

then it being fragile and buggy is still going to be an issue

feel free to use root then.

it'll be on localhost, until someone sees it and thinks "that looks useful, get everyone a copy"

like there is a hacker for every ten database sites

and even more users… users do all manner of things to your application

deadroot, 10 hackers for every 1 microsoft db site
f00li5h, I'll remember to use magic quotes!

DON'T USE MAGIC QUOTES

why the hell not

escape them explicitly!

deadroot, what does that mean?

magic quotes leads to sloppy programming. there are times when you don't want to escape that ' or "
and when some smart guy disables the magic quotes without checking the code, there goes your security

place holders for the win

you should escape at a low level an for the target - not generic
and

yes, times like printing the data the user just submitted

or builing an sql statement (if not using prepared statements)

why would you not be using prepared statements?

IN ()
old databases, old php versions, …

for me, i would escape the data when storing into the database, and then use htmlspecialchars (generally) when returning the data to the user

yeah

wow I feel honered…. just found an online game thats a 99.9% rip off of mine lol

how do you know that they ripped you off, instead of a pure coincidence?

and for sqlite it is sqlite_escape_string()

i'll pay IN ()

SeanB, what is it called?
SeanB, also, did you invent it originally?

They keep trying to advertise on our site and they acually have parts of my HTML comments

dynamic conditions :-)

Not the genre but the game yeah

well… the audacity of them

fun!

I actually enjoy it since it's such a bad ripodd lol
*ripoff

(not really)

Even down to the old ticket center we used to use is copied lol

tags in ONE script?

Yes

yes

Praise the lords!

it buffers the whole script

you can even call them more than once, recursively!

morning all

sup AlexC_

ahh not much :P just relaxing on my b'day ^^ … not sue why I am on IRC when it's my b'day but oh well!
s/sue/sure
yay, what I've always wanted

f00li5h, I was actually thinking about writing one

oh, rly?

but the time it was published, it would be outdatted, surely 6 would be out before then

hi

f00li5h, ntrly

well, the trick is to not make it about php5

make it in general,
then explain some of the ways of doing it for those versions

I can't help but think that if everyone held off for that reason, we'd be somewhat book-less.

or you could write the book about a langauge that doesn't break major volumes of code with each release

there are some generic programming books. there's even one highly recommended one that doesn't even focus on programming. iirc. don't know the title tho

is it the gang of four book? i hear that's quit egood

I know some too

s/ eg/e g/

might be

a really good one imho is the pragmatic programmer, it's a generic best practices book.

I hear that's a good one, but it didn't seem pleasing when i was reading it at the shop

also I find antipattern books to be handy for that as well
f00li5h, any reason why?

amazon, AU$40, Borders, AU$70
bastards.
I guess I just didn't like the tone, or something

yeah books are expensive, I have a metric shitton
probably have several thousand dollars worth of books

you have a what now?

f00li5h, a metric shitton

what's that then?

f00li5h, it's a unit of measure

oh, i see
weight, is it?

yeah, it's ambigously large
it's bigger than a crapton

Hi all

but smaller than a holyfuckton

cyth its hard work cataloguing a large pile of books

If I have one function which connects to a MySQL database and another function which uses the connection, should that work fine so long as the functiont hat connects to MySQL is run first?

and all of them weighs less than the ether
yes

archivist, cataloguing is for the OCS types, my cataloguing contains rummaging throuh a pile on my desk or floor

hehe
only desk and floor

are all of those books actually useful stuff that you can't learn from the net?

Is there anything wrong with this?

s/OCS/OCD/
the one's that I don't read much are on bookshelves

$query = "SELECT content FROM templates WHERE theme='$GLOBALS[theme]' AND group='$group' AND name='default'";
$result = mysql_query($query);
$data = mysql_fetch_assoc($result);

mtappenden, your not checking for errors… that's a big problem

have you tried echo mysql_error()?

No shall try that now

deadroot, most books I have are replacements for crappy documentation on the net.

Well this is what it says, but I don't see anything wrong…

I find tutorials to be to brief, lacking in theory as well

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group='support' AND name='default'' at line 1

#mysql

mtappenden, to debug… echo your sql out to make sure it looks right
after that, #mysql

kk
thanks

/mxg php-bot guidelines
hey all..what is the best SOAP server to use these days? Is that PEAR SOAP? I've been using nuSoap but have run into some limitations

how can i remove all ' — these from a string?
city='here',state='there',etc..

php.net/str_replace

zwi, php soap?

php soap … pah, what next - php shower geil?

What is the real difference between PEAR and php soap? I'd like to be able to generate a WSDL on the server.

i don't think php soap has that ability
I hate using soap :p
REST ftw

hey guys

cyth I'm sure your friends hate you for hating soap as well!

AlexC_, nah showergel!

^^

I've been using nusoap and when working with the WSDL have found some shortcomings…So thought I'd try out pear soap since it seems to be the successor. I can't even get that to generate a wsdl…segfaults at first (which I've worked around) but no WSDL at all
What I'd really like is to just have a WSDL that a soap server can use and go from there..any suggestions?

in php, if i want $blah = system("/usr/bin/file $name|wc -l"); — how can i get it to be quiet ? when i run that.. it works.. it gives me what i want, but it spits out the answer
so if the answer from that system command is 1, it ends up saying 1 and 1 twice.. once for $blah = system("/usr/bin/file $name|wc -l"); and once for echo $blah;

Hey how can I have let the user of a form attach a file to the form, that then gets sent to my mail scirpt?I need to know how I can attach it to the email

BigMac, you'll have to learn how emails handle attached files and do that, it isn't too hard, just have to have the right headers and base64 encode the file
or you can find a mail class somewhere that makes that easy

Anywhere specific I could learn that stuff?

I would suggest checking out the PEAR:Mail since it has MIME encoding right in it for sending/recieving etc

I have a page which refreshes for every 10 mins. and it has a image which should be only refreshed after 1 hour.
how can I do this?

BigMac, http://www.sitepoint.com/article/advanced-email-php

n/m about my question, got it sorted

BigMac, I would like to override SeanB's suggestion and suggest the newer Zend_Mail (part of ZF)

Hi all. Regarding vim/gvim, it has a very good highlighting but I cannot setup the auto-completion…

so is there anybody in here who would consider themselves a soap/wsdl expert (or at least darned good)?

#vim then?
or #linux #yourdistro may be able to help,

lol
AlexC_, I am sorry.

anyone here use php with a ldap database?
sorry
type
o

is it possible to do concurrent programming or threading in PHP that works cross-platform?
pcntl_fork in only available on *nix systems

amgd, nope wrong language
try ruby, perl, or python

i want a php frontend that will submit info such as username, contact, serial numbers, and products

Yah, neither of those make any sense to me :/

I would, but that's not an option

Is anyone in here good with GD im having a small problem, i cannot make PNG's transparent no matter what i do, yeah i have the png extension and all …

just wondering if it would be easier done with mysql or ldap

BigMac, what doesn't make sense to you?

any help will be appreciated

is there a way to tell if the value in an input table has changed?

What browser?

pthreat, there is something you have to set… can't say what it is on the top of my head, but it's in the manual somewhere.

Firefox

IE has poor PNG transparency support

Is there something that has to be done to allow sites to open streams or is it supported out of the box?

so when the click submit i only pull the changed variables?

could you check for it please … ???

The attachment process, I already have a form, and i need to make a button for uploading, and then in the php file another entry for the attachment, but can't figure either out

i've looked at the manual a lot

BigMac you know how file uploading works?

did you look inside it?

Very basically

var_dump ($_FILES) on your action script
better yet echo 'pre'; var_dump ($_FILES); on your form method="POST" action="myfileuploadscript.php"

BigMac, so basically you get the uploaded file with the $_FILES array, you don't need to move_uploaded_file or w/e the function is, just open in and base 64 the contents and stick it in the message with the mime boundaries, like that sitepoint article explains on page 5 I believe

tag? and do where do I put the files variable inside mail()

ok looks like i still have the problem. when i run: if ($blah = system("/usr/bin/blah $name|wc -l") == "1") { echo "the answer is 1"; } else { echo "the answer is 0"; } it spits out what i want for the echo but it also spits out the answer, (From wc -l).

or action="" even

like so if the answer is 0, it would say.. "0 the answer is 0"
instead of just "the answer is 0"
so im wondering how to get this quiet

ah yeah enctype="multipart/form-data"

im just trying to dive into php and then later go back and redo stuff better ways et
c

omitted that one :P
so everything would be like form method="POST" enctype="multipart/form-data" action="myfileuploadscript.php"
have you checked that for me

ok and where in mail() do I list the files

imagealphablending($im,false); (where $im is the image resource).

base64_encode them ?

guess I will have to read up on base64 encoding

guess you will

imagesavealpha($im,true);

hey thanks a lot

that's what system does , it writes the answer to stdout , you're gonna have to consider a different scheme , or bind stdout to /dev/null or something and then restore it before the echo

BigMac, in mail the base64 encoded string will go in the message
BigMac, read that sitepoint article I posted please
all 6 pages

thats nothing :P
^-^

I don't understand most of it is the problem

hypomanic

BigMac, well then find a class that does it all for you.

looks like i just needed to use `

or hire someone that knows how to do it :p

instead of system("blah"); i did system(`blah`);
and it works now

Try finding a class at phpclasses.org that handles mailing attachments for you if writing your own attachment emails is to difficult.

but thx tho

oh , maybe you're write I haven't tried that before
write=right

yea dude im a newb hardcore
lol

I guess I could try, but it usually seems harder for me to get a class to work then code it myself

im just donig shit whatever way
then of course later gonna redo things. im just learning right now

BigMac, well then it sounds you need practice in both areas then

Eh phpclasses.org isn;t that bad, 99% of the classes comewith sample/demo scripts on how to use them and some good documentation. Most of the time you can just copy and paste the code over. Though this doesn't mean your off the hook, as cyth says, you could use more pratice

Yup probably do, I have only learned bits and pieces of php to get me by. I am more of an html guy

i don't think system(`command`) is correct. $a = `command`; would execute it already. what you did looks like it would happen twice

BigMac, unfortunately I recommend against that for lots of reasons. coding doesn't go well learning bits and peices, you end up with bad code and security holes.
so out with that mentality and become a coder guy!

i agree with cyth

I had planned on learning php over summer break, but learned ruby and some python instead

also, creating HTML is a lot easier once you understand php

BigMac, so use ruby and python instead

oh

deadroot, personally I'd say creating PHP is much easier once you understand HTML
deadroot, I see a lot of people who start PHP first without learning HTML and end up with too many questions

don't know rails yet:p

fair point

BigMac, you don't need to know rails to do webdev with ruby

like where does $_POST come from

Its like capring apples and oranges there, it doesn't really make it any easier, since PHP is a serverside language but you can use PHP to help do more dynamic layouts and such. You still need to know HTML to utilize it.

just use it in a fastcgid or mod_ruby and just code like you would php.
rails is nicer though

Hmm, maybe I could do that.

ok I hate goto

HarryR, lol, $_POST has nothing to do with HTML really more with HTTP

and I think the idea of having it in PHP 6 is evil
and btw PHP 5.2.4RC1 is out

which knowing how HTTP works is essential to both client and serverside web logic.

so a good PHP dev needs to know PHP, HTML, CSS, HTTP and a smattering of image codecs

ScottMac, you don't have to use it, thing is people will use it

deadroot, nah, a good php developer needs SQL as well

just like that guy the other day was using exception handeling for code execution control

cyth want to know why?
http://xkcd.com/292/

oops. missed that one ^^

why isn't that valid?

lol

zedboy, why isn't what valid?

execution control with exceptions

zedboy… exceptions should only be triggered for exceptional errors. catch is a nonlocal transfer of code execution, it has the same problems of goto if exceptions are used incorrectly.
spaghetti cooooooode

it's pretty normal in functional programming

zedboy, i bet it's not, it's a common anti-pattern
and if it's pretty normal than that normalicy means nothing, antipatterns are common by nature.

http://xkcd.com/297/ ROFL

deadroot, have i destroyed your productivity?

it's a shame more people don't use asserts in PHP

"normal" in functional programming is often weird to others …

deadroot, see http://xkcd.com/208/
i have that on a T-shirt

90% of the stuff that I do wrong, instead of having weird errors appearing that I do or dont detect, I get 3-4 asserts
showing me exactly where shit happened, without the overheads of exceptions

not at all. i visit xkcd occasionally.

uh, sorry about the language

assert ?

HarryR, we use both here. We throw exceptions for SQL errors

I use exceptions for form validation (kill me I know)

zedboy, misuse of exceptions is misuse, I don't care what the paradigm is. Nothing in functional programming I know of has exceptional code control as a 'feature'
HarryR, that is the wrong use of exceptions

basically you just have a function to validate each field, you throw an exception if it's bad, then you loop through all the fields call the validation function for that field and collect the exceptions

anybody know of a tutorial on creating your first php class?

cyth, no… bad data is exceptional circumstances and makes code 100x cleaner
and makes the validation routines situation agnostic
e.g. "i dont care where you call me from, if I get bad data somebody will know about it"

Is there a ny way to make use of a variable set outside a function within it without padding it int he form functionname($var); ?

HarryR, no no no. bad data is not exceptional unless you don't expect the data to be bad. and if the data is coming from a user on the form, than such validation mistakes should be expected.

cyth, I don't just use it for user input forms

HarryR, the correct usage for exceptions is if your parsing data… like an xml file, or a sql result resource, and it's found that the data is bad and cannot continue…

or.. if you're checking some dependancy against another field after serialization, or validating data after serialization

if the user entered bad data, the scripts cannot continue

HarryR, validation errors aren't really exceptional either… an exceptional error would be if the validator couldn't even begin to parse the file to validate it.

and considering all I'm doing when handling forms is serializing $_POST into a class, and having the class do the validation, I think it's perfectly ok
an exceptional state would be "you gave me (the class) bad data which breaks me. idiot!"

\ha

that said, I don't use exceptions at all in C++

deadroot, HarryR those should be expected often on normal circumstances… their not exceptional

ok, originally I made it with assert

asserts are worse

*they're

\L\O\L

shell_exec('sudo useradd ".$_SESSION['user']."'); who can fix this for me..?

assertions should only be used for HOLYFUCK HOW DID THIS HAPPEN errors.

i work with neither. i still don't get how to write my own objects without killing performance… T_T

costel, arghhhhh my eyes are bleeding!
cyth, ok yeah I guess I'm abusing exceptions then

costel, delete all your code now and start over

ajaja

is just an example…

has anyone ever made an irc server purely in PHP?

try, shell_exec('sudo useradd "'.$_SESSION['user'].'"');

Fushuing, no, but I'm writing one in C++ now

thanks that is what i wanted

Hi all if I do return $variable; is there any reason why print $variable; won't do anything outside the function, I know the $variable isn't empty since if I put print $variable' INSIDE the function it works fine?

it sounds like a nice challenge to do in PHP

writing an irc server in PHP isn't hard

HarryR, I see alot of misuse of exceptions… enough so I wrote a blog article on exceptions last night, I figured with all the abuse, maybe another article out there on the blogosphere surely couldn't hurt.

writing one that won't fall over every 10 minutes is

maybe the var is not defined yet?

There was one that was being made
don't know what happened to it

cyth; link ?

How so? I put print $variable; after running hte function …

:|
what's it called?

cyth, originally I didn't write it with exceptions, I just passed an array to each validation function which then put it's error messages back if it encountered an error

sikkle, http://www.codeangel.org/article/misconceptions-about-exceptions

cyth, but made code very brittle so I started experimenting with detecting when assert failed, and just gave up and used exceptions

anyone?

HarryR, that original way would be somewhat better. what was brittle about it?

cyth, it has made that specific situation much much easier to understand and allowed me to re-use the same piece of code more (making it very flexible)

it's a bit easier in Python, but there are too many in python already

sorry dood im not sure…

HarryR, there's better documented ways to handle that… filter and validation chains are nice for that

I can't remember the name and can't find it online anymore either
guess it died out

cyth, yes I'm using validation chains but implemented as normal PHP code
hangon I'll see if I can find some code

when you think abou tit PHP can use shared memory and can be decent at handleing sockets
would be fun

suphp question. How can I prevent a php script from reading a file that doesn't belong to the user ?

cyth; use of Auth and ACL on this CAorg ?

makes sure that file has the right permissions

SeanB, I'm using /dev/epoll and distributing the load over #insert number of cpus here# threads with thread-local storage for buffers to make stuff faster
SeanB, PHP really is the wrong tool for the job (tm)

permissions of 0400 would make that file only readable to the owner (but not writable or executable by anybody)

Yeah but would be fun lol

cyth, files uploaded belong to the user. If I set i.e 700 on the file, apache can't read it (html files). If I set 744, apache can read the html file, but so can everyone else.

SeanB, if you need to use multiple PHP processes, you're doing something wrong
you should be using non-blocking sockets to avoid horrible locking issues

I never have had to but in cases could see it needed

cyth, the problem is because of the umask I need to set on my ftp server. If I set it to 744, people can cat each others php files, and extract passwords. If I set it to 700, apache can't read html files and sites won't work unless the user manually chmods.

Mill|ooo, if their storing passwords in php files in plain text… they deserve it :p

If I remember there is a command in the PHP FS functions to get the owner

quick question, is there a method for creating directories? such as fopen/fwrite can create a new file

www.php.net/mkdir

oh heh
duh
tanx

SeanB, like a setting in php.ini ?

http://us2.php.net/manual/en/function.fileowner.php

SeanB, yeah .. that's not at all what I want

Mill|ooo, what is it you are trying to do?

php.net/stat

anyone know how i can add kontera ads into my smf forum?
i keep getting parse errors when i try

Wrong channel

its in php

!+g10

Guideline #10) We don't support script(s). We help you *write* PHP, not recommend or download and install/hack/modify/adapt/use pre-written scripts. Contact the authors of the script for support options they provide.

Evilx, prevent one user from running a cat on another users file using i.e system(). The problem arises because of the umask my ftp server sets. If I set 744, files are public and readable by everyone, if I set 700, html files aren't read by apache.

ech0dish, if you knew php, then you would know how to add it.

right thanks for the help guys
fuckin' dicks bye

HI all. How do I take an array and convert it to a string?

php.net/join

tnx

How can i run my own mYSQL server?

vigilant, by installing it

vigilant, install it

If apache can read the file, then any one who can upload PHP scripts will be able to get Apache to read it for them.

okay, isntall the mysql5.45 or w?E
then i can run it locally?

Mill|ooo, there is only a few ways around such issue, and it sorta involves having roots rights on the system.
vigilant, yeah

Evilx, I have root.

im a newb oop tis fun

do you know much about jail/chroot enviroments?
heh

open_basedir is a good way to restrict file access

thanks Evilx

Evilx, I'm going to have to chroot to prevent that stuff? ugh, that sounds overkill.

201 CLOSE_WAIT

wrong channel?

is theer any PHP buffer to dont get CPU to much Hight "cpu 99% up"
Kobaz my server side is php code write

Mill|ooo, do you understand how linux permission work?

you'll have to rephrase your questions, i have no idea what you're asking

Evilx, yes

finding someone to talk to in your native language may help

thebest, is your script using sockets?

No, there's nothing in PHP that you can do to tell it "don't use up 99% of the CPU"

if i want to preg_match just integers, isn't it just d+?

Evilx yes i use Socket server side.

you're close. See php.net/pcre.pattern.syntax

TML i dont whant to have CPU 99% ..but when conection is Lost. then he jump CPU up.

aahh….. sweet, id idn' tknow that page existed. thanks

hi

My suggestion would be "Don't write services in PHP"
It's not a particularly good langauge for it, as you're discovering

tml , you mean web services?
or like system services?

for some reason a new persistent connection is created every time i issue pg_pconnect(), which fills my database with inactive connections.. is this the correct behavious?
-s+r

No, I mean daemons

oh, yeah.. bad idea

Don't use pconnect

use perl

is ther a regular expressions channel?

d-media: #regex

why not?

you can run into a ton of potential issues with pconnect

Because it's broken

php isnt designed to really work well for a services, you cant even create a thread .

you can make threads

php has threads

PHP doesn't have userland threads, it's simply thread-safe

since when?

More accurately, it's written for a very specific subset of people who understand the full implications of enabling it.

http://us.php.net/manual/en/function.pcntl-fork.php

That's not a thread
That's a fork

hi guys… having trouble with a site… i developped a site, and on two servers it works great, on another server i sometimes get blank pages.. if i refresh them, they appear.. any ideas on what might be the problem?

so the best wai is server side with sockets write in Java code ? or perl ?

different time limit settings
?

php is probably crashing

way*

seriously?

check the error logs
yeap

Check your server's error logs

it's not my server :/

i crash php pretty often, and that's what happens

hm

hehe the good old fork vs thread, heh.

but then it would be the error of the server? not the script? or would it be script?
because it's working on 2 other servers

server problem
i mean, you can change your script to not crash php, which is what I wind up doing

A number of things can cause it, but they'll all show up in the error log

yeah that's what i would think
hm and i prolly can't check that without server admin rights right?

You could probably ask the admin to tell you what's going on

hi to all..

i was doing a large eval and it would make php crash and burn

They'll usually want to help you resolve that, since it's likely causing other problems.

is it in the apache error log?

anyone knows if i can install php on Mac Os default apache?

yeah

ah i think i can access that in the backend.. let me see

most hosting places have your access/error log seperate

Evilx Thanks

How could I take "1+1" and split into an array?

explode()

Thanks all.

Ok, thank you.

Yes, there should be something in the Apache error log

application/x-trash when i access the root

Note: "*should*"

i really have to point to the index.php before it opens it :/

misconfigured web server

That's a server configuration thing.

cannot read directory for multi:"
see that a lot in the error log

it doesnt have index.php as a default index file
get a new hosting place :P

Kobaz, apache not setup right.

I concur with Kobaz
Get a new provider
They're a dime-a-dozen

yeah i also told the company that outsourced this to me that this seems to be crappy hosting… but because my server knowledge is not optimal, i can't pinpoint it ..
cannot read directory for multi:" ? what does it refer to

haha, that's even worse
that it's a customer site, that sucks
it doesnt have index.php as a default index file

it skips 2 desktops at a time, instead of one!

sorry ppl - wrong channel

a customer site?

your company's customer… or did i misread that
or is it just a one level outsource
what i was getting at was…
it's not your own site, and it's someone elses… so that makes it hard to switch

euh, a company outsourced the project of their client to my company…
yeah
exactly
my hosting is excellent

http://defindit.com/readme_files/apache_13_error.html

hehe

Google knoweth all

thnx, gonna read up on that

what php ide for windows would you reccomend besides PHPEclipse?

zend studio

PDT
!+editors

Editor discussion usually degrades rapidly due to personal preference. It is not a valid topic for ##php. Please try http://freshmeat.net/browse/63/ , http://www.php-editors.com/ or http://en.wikipedia.org/wiki/List_of_text_editors and find your own preference

hello. i am using php 5.2.3 on lighttpd with fastcgi. trying to use SoapClient and SoapServer classes with a simple non-WSDL example. it keeps timing out, with this in the error log: Uncaught SoapFault exception: [HTTP] Error Fetching http headers.

TML, sorry

No worries. Now you know.

TML, ah ok, so this error isn't really all that bad.. problem for this is just that there are no default files selected (which is still very unprofessional, but…)
let me try to get the other problem, and see if another error message appears

I wonder why soap is so popular as of late… seems we get 10 questions daily about soap

heh
soap is good for you

nah
rest is better for you

well, i am open to other web service options. i know soap is supposed to be slower

you can get clean with showergel, rest is necessary

if only i could get gsoap compiled on hpux
then i would be golden

cyth without soap, you would stink.

but that's okay

everything ive seen on rest with php is completely 'roll your own' anything to make using rest as easy as SoapClient/Server seems to be

MatteusX, if you have a choice! don't use soap! use RESTful services
matt_, Zend_Rest

ok. ive read bad things re soap (speed/size).

err MatteusX

ok thanks!

are we talking about soap or soap?

Evilx, soap

not cleaning soap?

you could clean with it

wsdl is aweful standard, soap is overly complicated while rest is really really simple.

hm, i think the error log doesn't update realtime
on the backend

would i be better off using a framework like cake ?

with all this soap and rest. I think i am going to go take a shower and then take a nap.

Better off than what?

and eat some cake

I'd bet that your server is dying before it gives a response. Check the apache error logs.

though I wouldn't recommend rest if you don't want resource oriented services… xml-rpc is good for remote procedure oriented services.

better than trying to code access control logic and all that good stuff on my own

A common mistake is setting memory_limit too low, as SOAP is a massive memory hog

interesting. we're direct on lighttpd, btw.

i wrote a soap interface to paypal's services api
i just skipped using the soap client and just did curl and simplexml

i ugess what i'm curious is people's experiences with using these frameworks that are out there
i've been wanting to try cake, but i'm not sure if it will speed up my development time

fedya, the definition of a framework is that you have to use that framework's architecture to build the application, and if that wheel doesn't fit your car… well your still rollling on your own.
I like Zend Framework because it's far more relaxed about the architecture you use for it…. it's not so tightly coupled and makes extending and interfacing to meet your needs easy.

i've never really used a framework, been wanting to try it to see if it will reduce the amount of code i'd have to write

fedya. cyth makes a good point. i want to make one other: theres always going to be a learning curve (some bigger than others) when picking up a framework. it can be discouraging, but once you master the framework development time can be greatly reduced
as long as your needs don't outgrow what the framework can offer

hi

fedya, MatteusX is right about framework learning curve, it can be like learning another language in alot of ways.

can some one tell me a best book to learn php
I am a newbie

man this provider sucks… doesn't even have index.html as default page

so is it a matter of personal preference?, it seems to me that cake has a good community out there, i like that they have some screencasts on their site, but i haven't been able to find any demos

I've never seen a good PHP book. Just use the website.
default.htm

php.net

hi.. where the heck can someone go in the bay area to find a web design course for front end design… the look/feel issues..

Comments

Grub boot kernel only once vs Lilo -R

People which started to use Linux in the `90 probably miss nowdays Lilo. Grub is now installed by default on every linux distro. However Grub is not that bad at all its only hard to get use to it in the begining.

I came accross one problem, trying to test vanila kernel which i compiled, however i did not know how to make grub to boot my kernel only once for a test (good old lilo -R new-kernel) command.

I started to search on google and i have found this:

booting-only-once
This seems to be quite old method because you would run into this problem:

root@boss [~]# grub-set-default 1
-bash: grub-set-default: command not found
root@boss [~]#
As you can see there is NO such command grub-set-default. I tought, okey maybe there are some additional rpm packages for grub which will replace this missing command, but i was not able to find ANYTHING!

After looking for grub`s tutorial i have came accross one nice command:

savedefault –default=X –once

This is the right command which replaces lilo -R or grub-set-default!

Now here is working example:

my /etc/grub.conf:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hdc
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu

title Fedora Core (VZ)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.1.4.el5.028stab035.1 ro root=/dev/VolGroup00/LogVol00 rhgb
initrd /initrd-2.6.18-8.1.4.el5.028stab035.1.img

title Fedora Core (2.6.17-1.2187_FC5)
root (hd0,0)
kernel /vmlinuz-2.6.17-1.2187_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb
initrd /initrd-2.6.17-1.2187_FC5.img

As you can see by my config file, the "VZ" kernel is default and it will be booted first.

The second kernel is "2.6.17-1.2187_FC5" - which is old FC5 kernel.

For test i want to boot "2.6.17-1.2187_FC5" old kernel first instead default "VZ" kernel.

To do that at shell prompt type:

grub

GNU GRUB version 0.97 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]
grub>

Now type this: savedefault –default=1 –once

grub> savedefault –default=1 –once

Next line type: reboot

grub> reboot

and you are back into shell prompt.

Now reboot your system and thats it !

Simple! I did not come accross any tutorial which will explain in plain english how to boot kernel once !

Comments

Ive created a list of radio buttons that all have the same name and the first one is checked This works ok in

there are about 32 mouseover functions, and all but three work perfectly

notice the input type is button, not submit, so it will not cause the form action to trigger

the three that don't work are exactly the same as the others
so I don't have the slightest idea why it is that they don't work
any clues?

due to a wierd opera css style with text-indent and input

so… button type="button"
then its explicit that its not a submit
because submit is the default button type so you have to have that even though it looks redundant

hi all
does anyone know how javascript determines if /foo/ is a regular expression or a division operator?

get any errors on your JS console when those functions are supposed to fire?

er.. what kind of program would have a console? :|
I'm using Coda to edit the JS/HTML

firefox has a javascript host console

hmm

and you can get one for IE i'm sure

You still up?

alright
I checked out the error console
but the error makes similarly little sense
it says
document.emp1 has no properties
but emp1 isn't called by the function
emp6 is
so…
what the heck?

then the problem lies outside that function.

does internet explorer recognize location.reload?

well
here's the function that's causing problems
function getscript() {
document.emp6.src = script.src; return true;
}
I double checked that script.src is the right image and that the image doesn't have any errors
so I'm really at a complete loss

If you want to reference an element in your document, use document.getElementById('the_image_id').

hmm
so, for instance
how would I get the id of this:
script = new Image(1024,850);
script.src = "Images/nle/script.png";

Then you refer to it using the variable name script.
I was refering to your emp6 code.

is there a possibility to go through an array without using an index? that's why i have an associative array, which i need to go through.

err
I should probably mention that I'm completely new to javascript ~_~

hmm how is it determined what button in a form is perssed when pressing enter in a text field?
and does that invoke onClick?

i need to do something with every element of that array, which is an associative one.
so i can't use a loop-index?

use the for(var p in object) { … } statement.

I know screen.height, but is there a way to detect the actual browser window height?

how do i get the viewport dimensions of the browser?

any ideas on when jquery 1.14 will be out?
1.13 breaks metadata plugin

hi guys
how can I create array of inputs ?
like document.createElement('INPUT');
but it shoud be array

~_~
screw JS

?

these functions don't work for no reason at all
out of 32 nearly identical functions (only difference is the image hosting being called) 3 just don't work

of course
because computers do things randomly without any logic

apparently
check the source
it's all there

it's never that the programmer doesn't understand what's happenig

http://celluloid.sourceforge.net/Screenshots.html
okay, allow me to illustrate
this function:
rubber = new Image(1024,850);
rubber.src = "Images/nle/rubber.png";
works
this
oh
shit
lol
that's not the function at all
function getrubber() {
document.emp6.src = rubber.src; return true;
}

ok
first

this function works
function getscript() {
document.emp6.src = script.src; return true;
}
doesn't
see any difference?

stop using the enter key as punctuation
secondly
`paste

Paste links, not code: http://erxz.com/pb/ http://pastebin.parentnode.org/ http://paste.css-standards.org/

but you just used the enter key as punctuation yourself :|

irony is lost on you
anyway, you lose a lot of points for using global variables
tell me which ones don't work

getscript() getpreview() and getfilters()
I checked the images
they're fine

whats the difference between document and window width?

those 3 mouseovers work for me


they do?

yeah

uhh
let me try in a different browser then…

I'm pretty confident that if you weren't using global variables (especially with such generic names) then you wouldn't have these problems

I'm really new to JS, it's just something I got off some tutorial

bit stupid to come in here shouting that it's all javascript's fault that your code won't work, then
bbit stupid to come in here shouting that it's all javascript's fault that your code won't work, then/b

hi

well, did you see anything wrong with the functions? :|

yes
you're using variables that aren't initialised in the same scope

How do you get information about a particular pixel in an image? I know in ff you can draw the image to a canvas then use getImageData. Is there an equivalent method for ie?

those three don't work for me in Camino or Shiira (Gecko and WebKit)

if(instance==null){synchronized (instance){if instance ==null; instance = new Locator(); } } …………. Don't you people think the second "instance == null;" statement is unnecessary ?
synchronized(lock) *

this is javascript, not java.

heh
once again sorry guys

if you have function foo(arg){ code } do you _have_ to pass arg to foo()? is so, is there a way to make it optional?
s/is/if/

You don't have to pass args to foo
unassiged arguments will have undefined value.

thnx

`defaults
`default

All parameters in a javascript function are optional. Any you don't pass into the function are set to javascript's 'undefined' value. Check for param===undefined if you want to set a default value.

also, you can pass extra arguments to a function if you want

is there a way of telling if an element is currently visible to the user, being that its located somewhere on the page not under any other element also within the users current scrolled range?

inside a function you have access to a collection called `arguments` which contains *all* arguments that were passed in

can i do getElementById(variable)? it doesn't seem to be working

getElementById("foo")

its a variable though called blah

blaargh, anyone using jquery multifileupload plugin?

Oki, then it should work like you described…

hello, I have a link a href="" onclick="popup(); return true;"/a. When I click this, in FF, the popup shows and the page doesn't do anything, and this is ok. But in IE, when I click the link, the popup shows but the page, goes to index.html
any ideea why this happens ?

how do you declare a string variable?
`js string
`string

hi
does it make sense to detach a handler for an event when a page is being closed?
if yes, how do I do this in a cross-browser way?
is there some type of onclose event where I can trigger this "cleaning up" sequence?

onunload
how did you attach the handler?
var s;
it's a link; the click event causes the link to be followed, unless it's cancelled

the return true should've cancel it right ?

no, that allows it
return false

aha, thanks

remember it by thinking of returning the result of confirm("Do this?")

deltab, I attached the handler using "obj.event = Fn"

then the reverse is obj.event = null;

I'm working with msie6.0, I could also do this with attachEvent. it probably has a corresponding detachEvent
deltab, does this have any advantages?

yes, though other browsers may not have attachEvent/detachEvent and 'this' won't refer to the element receiving the event

deltab, the other browser probably have addeventonlistener or something. I'd rather do it the cross-browser way.
deltab, I don't understand your second point about "this" sorry.
deltab, could you please explain?

for example element.onclick = function () { this.firstChild.checked = true; } can work because 'this' means the element clicked on

do you mean to say that "this" is a msie only object? I have used this earlier on firefox, and it's cross-compatibl.

but if you attach the handler some other way, 'this' will refer to the window

I'm not using anonymous functions.

it doesn't matter whether they have names or not

Is onunload portable?
I mean w3c approved?

http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.3

ah, that's great.
deltab, I have put all the (relevant) elements in arrays.
should I just run a for-loop on all of them to register the onunload event?

"The onunload event occurs when the user agent removes a document from a window or frame. This attribute may be used with BODY and FRAMESET elements."

ah.

bot json
js ref json
js ref

deltab, thanks a lot.

I can't seem to find one of those guides telling me how to emulate non-a:hover in MSIE 6.
With JavaScript.
I have found this via Google before, but not today.
Any tips?

focus ? onblur ?

Talking about table rows switching colors when you hover them.
I should have kept the code I spent a lot of time with before.

doable with a css trick I think.
http://css.maxdesign.com.au/listamatic/
css goodness.

I don't see how that is possible since MSIE 6 only knows about a:hover.
That URL is irrelevant.

… , fetch the object, tr_obj.onmouseover = function () {this.style.backgroundColor = "#f00"} ?

Hello

Catnip96_, get the shiznit?

How can I get the css hover oroperty using js?

Sounds like BobTheMighty has the same problems as me.

google?

Google is overloaded with info and giving hard time

Yes. I cannot find anything of value with that crap engine.

Its not crap but it has this weakness

is there a regular expression list anywhere for javascript functions?

Catnip96_, did you get my proposal for your problem?

Sorry… I did not understand that.
This must work without any modification of the HTML.
So it must auto-detect any table, and then do its thing with the trs.

so?

Your line of pseudo-code frankly makes no sense whatsoever to me. :$

you can just go fetch the object with document.getElementsByTagName … etc.
change the style of the tr dynamically for an onmouseover event.

Hmm.
Is it that simple?
No looping and stuff like that?

probably not, but it's a start.
go experiment with the thingy already.
css / javascript hosting makes for a deadly combo.

I hate MSIE 6.

btw, you can combine behaviours by associating a class with a certain behaviour and specifying the classes of the element with element style="class1 class2 class3" /

Is that even possible to get the HOVER properties using JS?

Yes, it is.
But I cannot for my life find the articles now.
I am desperately trying to find them on Google.
I've found it before, and implemented it.

Uhhh… same here its driving me mad

If you find one, please tell me.
I remember it had two simple loops and a simple assignment.

Bound any other propertie, porn and lots of menues
Found*

Any luck? :|

"dramman" at 71.6.194.243 pasted "wierd problems with inheritance" (23 lines) at http://erxz.com/pb/3924

when I step through the call to the constructor of the subclass, none of the object are shown in firebug (nor available to js)

example code plz.

5 lines up ^

see http://phrogz.net/JS/Classes/OOPinJS2.html or http://phrogz.net/JS/Classes/OOPinJS.html

I've created a list of radio buttons that all have the same name, and the first one is checked. This works ok in Firefox but in IE I can't select any radio button. When I click on it it just stays unchecked. What am I doing wrong?
anyone?

ah, thanks

csaba, example code plz.

You mean that shape.redraw is undefined?

"csaba" at 71.6.194.243 pasted "radio button doesn't work" (8 lines) at http://erxz.com/pb/3925

which of the properties vanishes?
all properties?
seems strange if you loose the actual objects (shape and line)

any idea why it won't work on IE?

all properties are there, from both base class and sub class, but _no_ functions are there
ball properties are there, from both base class and sub class, but _no_ functions are there/b

Comments

hi i created a Jtable with a custom model-renderer-editor and i put it on a JScrollPanen if i put the JScrollPane

g[r]eek: sorry, my comp got locked ok, let my try it on the default port first, and i'll tell you the result!

how can you use javascript to control an applet? IE: how is this called so i can find more info on it

hi. i use jfreechart to render my charts. I need to render several pie charts with of course different data. unfortunally the layout manager renders each chart-legend-arangement different so it looks really ugly in the printout. how can I for example align the chart itself to the right side
or define fixed layouts?

~tell DonJohnny about topic

DonJohnny, The topic has several references for your perusal. That's why Chanserv msgs you to read the topic. Reading the topic and asking questions is a great way to get help.

anyone know of a good free hibernate book?

hibernate.org is pretty good…
what do you need a hibernate book for?

yeah im reading their tutorials, but some of the stuff they use is based on a book =\
but hopefully i can pick up everythign off their site

lots of excellent *books* on hibernate but not many free ones

yeah

wich Book i must buy to lern Java ? and flex

what you need to do is wait until hibernate is end-of-lifed, then you'll have plenty to choose from

wouldnt that kind of defeat the purpose?

details, details

any xsd visualiser tool in java hosting and also anything that generates hibernate mappings from xsd

hibernate mappings from…xsd?
yikes

yeah i found one but wasn't able to get it working

~tell StarWars about bibles

1) Sun Java Tutorial (http://java.sun.com/docs/books/tutorial) 2) Bruce Eckel's "Thinking in Java" (http://www.mindview.net/Books/TIJ) (Get the 3rd edition, the 4th is only freely available up
to chapter 7.)

http://xmlpipedb.cs.lmu.edu/index.shtml
as crazy as it sounds it is quite intricate and done above

I'm trying to conceive of the usefulness of doing it off of XSD

free, free, free…

I'm sure

well time

pay for the books!

otherwise you'd have to do it from scratch yourself

dangertools thanks

assuming you only have the xsd model to work off
castor eh

not quite the same though

=(

hmm no may not be the same

what I'd do is generate an object model from XSD, then generate a hibernate mapping from the object model

hi. i use jfreechart to render my charts. I need to render several pie charts with of course different data. unfortunally the layout manager renders each chart-legend-arangement different so it looks really ugly in the printout. how can I for example align the chart itself to the right side
or define fixed layouts?

is the latter a generation? what does that?

lots of tools for it
an awful lot depends on how often you need to do it

actually silly me; all i need is the object model; so if castor does that then great
the other tool pasted above does straight to hibernate which one can also extract an object model from i guess; but i don't really need the hibernate stuff specifically
not right now anyway
i never cease to be amazed at the sheer number of tools available for arbitrary tasks

~unix++

unix has a karma level of 1, jottinger

all hail unix, from whom all arbitrary taskness flows

people are lazy
so where people can cut corners they will
thats why we have windows…

no, those are rough edges, joed
jottinger

SCOX) fell over 70%, to 44 cents a share. ah

in response to what?

heh

a judge pointing out they have about as much right to UNIX as I have

YES
wooo
I can't wait until SCO dies

they now owe novell $24m

"pull a mcbride" is going to be a term for jumping the shark intentionally and expensively
and it couldn't happen to a bigger asshole

lol

There's just something inherently wrong with buying someone else's IP and then aggressively pursuing it, esp. when said IP is questionable
It's like one of those things your momma slapped you for when you were a kid
like saying "I'd like to fuck gramma" — guaranteed to end up with a sore bottom and a mouth full of soap
it's one of those things you're born knowing not to say

well it can be too risky to pursue your own IP, because companies counterattack.

lol
wow you just equated ip address host to screwing your grandmother thats got to be a frist
er first…

IP to GILF - no

ok ill take your word for it

GILF yes
I mean, they bought caldera, which had contributed code quite openly and then sued people for using that code
all right, I gotta run
be back in a few hours

woooooo
i just got the java persistence with hibernate book for free
well to at least read for a bit

i'm trying to make a jar file, i have many libraries, all my libraries are in a "lib" folder. I make my jar file, i add to my manifest file the class-path where the lib are, but when i run the jar, i still have a class-path problem, someone can help me ? is my manifest file good ? http://rafb.net/p/o4wyZr25.html

Celos`: no jars in jars
ooops,

i think your path to your jars are messed up
let me rephrase that, I think the path to your jars is messed up

it can't be
i've check

hello, can someone tell me how this is even possible http://www.kimberlyandgeorge.com/debug.jpg ?

Celos`: what about using lib/asm.jar

instead of \ ?

right (I'm not sure it makes a difference, but why take the chance)

creating an ArrayList from a Synchronized Map, and I get a different size

~test case

Provide complete, compilable Java SOURCE CODE that shows the problem and nothing else. Be as brief as possible. (See http://javafaq.mine.nu/lookup?364 for details and a HOWTO.)

was that for me?

yes

i can't create a test case

sure you can.
it's just code.

the code in question id aprt of the JXTA framework
is part of the JXTA framework

but you can create code to recreate the behavior.

all Im asking is this; how can an ArrayList created from a SynchronizedMap have a different size?

i have a "failed to load Main-Class manifest attribute" error when i'm running the jar

I tried to do this, but had no success; since I don't know how it could be happening!
somehow there is a Null element in the ArrayList

seldon75, are you using JXTA? for what my i ask?

yes am writing a private media content delivery network based on JXTA

Celos`: maybe you have a bad line ending in your manifest
Celos`: what if you put the Main-Class attribute first?

ok trying

so, does anyone have any theories on how an ArrayList created from a SynchronizedMap could have a different size?
how about if a member of the Map was GCd at a particular instant - could that cause it?

i got the error because i add the previous jar file into the new one
but now
i still have the class path error
the previous class path error

~javadoc SynchronizedMap

I don't know of any documentation for SynchronizedMap

if it's happening because of a GC for example there's no way I can replicate that in code
uif it's happening because of a GC for example there's no way I can replicate that in code/u

Celos`: please pastebin the classpath error

~javadoc Collections.SynchronizedMap

I don't know of any documentation for Collections.SynchronizedMap

javadoc is not working at the moment :-)

ah

is it happening all the time seldon75?

no, sporadically

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

but I don't know the JXTA code well enough to know if it is something they are doing

Celos`: and which jar is that in?

i think it doesn't find the lib

Celos`: I'm betting not one of the ones listed

they are all in the jar

i hate documenting code
its so boring…

and i run the jar in the same directory where lib directory is

Celos`: what jar is javax/persistence/Persistence in?

there is no jar in that path, the jar is in lib/jpa-hibernate/ejb3-persistence.jar

Celos`: OK … if that class is not in your classpath, then … your JVM will *not* find it
Celos`: this is rocket science, you know
:-)

but this class is in one of my library jar
in the lib directory
this class is in lib/jpa-hibernate/ejb3-persistence.jar which i add to the class path in my MANIFEST java host file

Celos`: sorry, it wasn't in the manifest you showed us

does your jar java hosting live in the parent dir of lib?

arf yes, sorry i pasted the bad one

all manifest paths are relative to the jar

http://rafb.net/p/yRAp6J36.html here is the good one
i run the jar file in the same directory that the lib directory

Celos`: and now onto cheeser's question …

pastebin the command you use and the dir listing

im attempting to make a window that has three JTextArea's that resize with the window and resize with dividing bars in the window. This is very complicated and glitchy looking because the JTextArea's resize by columns and rows. I am also doing all the math and so forth manually to accomplish
these resizeing feats. I know theres an easier way.

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

and the manifest?

it's in the jar file

someone should tell dharrigan how to spell "wizard"
Celos`: i don't have that jar now do I?

but in the jar file he is in src/META-INF/

what is in the manifest file? pastebin that.

he eh

wait.
the manifest is *in* the jar host under the path src/META-INF?

yes

~smack Celos`
META-INF goes in the root of the jar

euh i was wrong, META INF is in the root of the jar
sorry

~smack
~smack Celos`
8^)=

double smacl
lol
but i still have the pb
problem

so pastebin the MANIFEST java host file

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

they all go on one line
do you use ant?

no

ah. well, you should. 8^)=

what is a good xml parser (DOM) for java? the one that comes with j2se seems really outdated API-wise

if you give me what i have to run with ant, i can use it

put all those jars on one line. they wrap at 72, iirc, and indent the next line with 2 spaces.
~manifest

cheeser, manifest is http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Manifest

task in ant.

shadowarts-lappy: i use dom4j

Uh oh.. pr3d4tr011: Last time you used that nick you pasted your password. Be careful

ok, but if i don't want to use ant, i just want to be able to run my jar file :/

You didn't read the password then

then do what I showed and read what javabot posted

cheeser, cool, that looks *much* better than what i was trying to use

I did. But if zou imply that it wasn't real: I wasn't sure..

Blafasel:
/msg nickserv password byt3m3|

just use /nickserv

im attempting to make a window that has three JTextArea's that resize with the window and resize with dividing bars in the window. This is very complicated and glitchy looking because the JTextArea's resize by columns and rows. I am also doing all the math and so forth manually to accomplish
these resizeing feats. I know theres an easier way.

That's not an irc standard command
Last time it was byt3m3n0w! ;-)

well i don't understand what is wrong with my manifest file

should work on most irc clients

Not on mine

what client do you use?

irssi

hell it even works on thsi cgi client

Celos`: you don't list the jars on separate lines. all those jars go on one line and wrapped like I explained.

weird im pretty certian it works on mirc, pirch, bitchx, xirc, and a few others ive used

nope

I don't think it works in bitchx for example (although I'm not sure). However: There's nothing wrong with /msg nickserv unless you can't type or are careless.

nor in irssi

i already tryed to put all the jar in the same line, but i got an error "line too long"

so wrap the line like i told you.

Celos`: He gave you the link to the manifest specs

right not saying theres anything wrong with ti, just saying on some clients you can use /nickserv

you're running out of runway, here, Celos`. time to pull up.

wrap = ?
i don't get what it means

you know what line wrap means?

switch line ?

I think \ I know \ what \ that means \ how are \ you \ cheeser?

Celos`: go read the manifest link that javabot gave
it explains it all and gives examples

Yes, BUT
Read above the link that the bot gave you
http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Name-Value%20pairs%20and%20Sections

éNo line may be longer than 72 bytes (not characters), in its UTF8-encoded form. If a value would make the initial line longer than this, it should be continued on extra lines (each starting with a single SPACE). " it's what i've done in my manifest

Celos`: that's not what you pasted.

im attempting to make a window that has three JTextArea's that resize with the window and resize with dividing bars in the window. This is very complicated and glitchy looking because the JTextArea's resize by columns and rows. I am also doing all the math and so forth manually to accomplish
these resizeing feats. I know theres an easier way.

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

is there any way to do dividers between JPanels or JEditorPane objects? so that you can select this divider and slide it one way or the other making them bigger or smaller (in relation to a bounds they both share)?

jsplitpane?

hmm, sounds promising. thanks.

Celos`: *sigh*
one. wrapped. line.
so when you wrap the first time, go out another 72 chars and wrap.
repeat until you're out of text.
this isn't rocket surgery.
it's a simple line wrap.

when allocating space for a buffer, is there any performance improvements by making it a power of 2? byte[] buf = new byte[len]. len = 4096 vs len = 4500?

have you profiled it?

nope

try doing that.

morning all

it seems that i needed one more space at each new line

the 2 spaces at the beginning of the line?

yes

put all those jars on one line. they wrap at 72, iirc, and indent the next line with 2 spaces.

30 minutes ago. good job!

slap me
lol

~smack Celos'

~smack Celos`

hi, on windows does java depent on the winsock for tcp/ip ?

well, i still have a problem it doesn't find my org.postgres.Driver class, but it's in the class path

Of course

is there a trick in getting wsgen in jax-ws to generate the correct parameter names in the wsdl?
ie the same name as in the method, instead of arg0 arg1 etc ?

[TechGuy] : I'm thinking of writting a custom winsock to wrap the one that windows has, and place it in my java folder for java to use. That way I could customize it's behavor

uh… that's bizarre

yea, but crappy software demands crappy solutions
I've got a software that like to bind to the wrong interface

Are you going to implement icmp too?

I'm just going to generate stub functions that pass the function for the orginal funtion. I'll replace the dll, then that dll will load the orginal and pass the calls, execpt in the case of bind.

some guy was in here earlier asking for you. i was trying to help him sort out his ssl certificate issue.

g[r]eek: ah, I think I pointed him towards making his own certificate and explain why they prompted users to acknowledge.

yeah he read through your link and got stuck somewhere along the line
i think his nickname was progreSSive
anyway. bygones.

Aye, not impreSSive.

hah

What's wrong with this code? new StringBuffer('[').append(string).append(']');

What happens?

can someone tell me about the structor of a class file ? Are they compiled, or compressed or what ?

~tell some_dude about bytecode

some_dude, I have no idea what bytecode is.

wtf man
sheesh

~vmspec

cheeser, vmspec is http://java.sun.com/docs/books/vmspec/

~jls

http://java.sun.com/docs/books/jls/

why is SecurityException not a checked exception?

"because"

public static void main(String [] args){} It needs annotation names?

heh
i hate that about eclipse
~tell popcount about newbie ide

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

Is it even possible to write a stand-alone main? (not in a class) I thought it was possible, but my Java knowledge is rather rusty.

Hiya, can anyone please point me to good docs that

no
in java everything must be class or inside class

show me how to setup jdbc connection in sjas?

sjas?

sun jva application server

hm i have never used it but i assume you must set up jdbc datasource descriptors and connection pools
in management console
and maybe jndi names

Or maybe manually in some server-specific xml file

no. everything lives in a class

but management console would be the way

I keep getting invocation exceptions
Since I'm using netbeans on a local server I have xml files to edit.

I assume that you can test your dataSource through managent console

I wish maven put the jars it downloaded somewhere sensible. Is there a way of making it download them to a specific directory?

Mybe, I'll try now.

w00t! IDEA 7.0M2
hey! me first@!

Blafasel, it forgets the first '['.
Blafasel, I will see for myself why that happens.

DRMacIverI'm looking for it

2nd build, you are several days late

2nd build?

7123 and now 7126

i had the day off yesterday. my folks are in town. 8^)=

'[' is a char. But there are no constructors with for that type. There is a CharSequence, but "all known implementing classes" doesn't show anything related to char, but char is a primitive type, so things could work differently.

both were labled M2, the later is what made it to the front page
and yes, i'm aware that it is utterly irrelevant

I am referring to what constructor gets called for new StringBuilder('[').
Blafasel, do you know that?

You can configure property maven.repo.local

Your char will get thrown to an int and call the int constructor, which is not what you intend, I suspect

wlfshmn, oh, I thought auto coercion wasn't in Java.
wlfshmn, thanks

s/thrown/cast/

wlfshmn, yes, I know what you meant.

hi

i SocketChannel.close() throws an exeption. a) is the socket now closed?

depends
of the exception

so how should it be handled??

check the state before trying to close and get fixed
I don't know exactly how this object works, but it should be possible to check it's state

i havent got that situation btw, its hypothetical

any one use gwt canvas widget?

no

~tell gaillard_ about anyone

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

i'm using org.apache.log4j.Logger; to log debug messages - do these messages go to catalina.out?
i can see them when i run my struts app from netbeans, but when i deploy it in tomcat, i'm not able to find these debug msgs

can someone tell me how to scan for annotations in sources, in a maven 1.x plugin, with jdk 1.4, and recover annotation parameters and also classname and package ?
depends how you configured you log4j.properties or log4j.xml file

ok i'll check

console appenders don't write to files
if you see it in your netbeans console, you should also see them in your tomcat console, but not in catalina.out, which is reserved
bytheway , you might configure log4j to write in it
can someone tell me how to scan for annotations in sources, in a maven 1.x plugin, with jdk 1.4, and recover annotation parameters and also classnames and packages ?

re

sorry

do you ever catch NullPointerException?

chnarr - what do you mean by tomcat console?

depends
in normal code? no way

system console, through which you execute tomcat server
yes, NullPointerException should not be catched, but if(null != myObject) should appear incode to prevent

ugh
that's horrible

thanks, i figured so but had to check

I know what you mean

tomcat is running in the background - should i restart it and watch the log msgs in my terminal?

I'd catch NPE in framework code that had to compensate for it (to present error messages cleanly)

soooo, now configure log4j with appenders to your custom log files

but apart from that? no way, no checks

why not jott?

i am also seeing this in my log4j props file - log4j.appender.A2.File=../logs/claimacct.log

unless null is a valid condition for something (which happens with JPA and some other similar mechanisms)

firefox stopped showing the popups asking if you want to run applets, and just tries running them anyway (causing connection refused errors in pjirc's case). how do i get those back?

but when i look at that file, it looks like it has not been written to

request.getParameter("somename") returns null if its not there

if I'm passing null around, *normally* it's an actual error and I want it to blow up
yes, and that's a valid condition

oh ok i get what you are saying

but that's not catching NPE

i was like wait a second, there are several methods that return null and you cant help but check for it

no, robust code should test almost everywhere if variables are null or not before processing anyhow :p

I disagree. The *usual* case where I'd care would look like this: if(foo==null) { throw new NullPointerException(); }
there's no point in that!

so if your dependent api dont like null parameter, dont call method, ensure not having null before process the call

defensive coding is *usually* not really smart coding

I agree but only if your sure nullity is not your fault

see Maguire and McConnell, both of whom worked for MS even though you wouldn't be able to tell from MS' code quality
also PvdL, who basically says the same thing

JSR305 to the rescue

~JSR305

I agree also, not to put it everywhere, but keep in mind a null value at the wrong place is someone's fault

Aradorn, I have no idea what JSR305 is.

all the more reason to let Java blow up incredibly
hiding errors is bad

so throwing an exception will push the fault further nothing more

if I'm passing around a null when I don't mean to, by golly, I *want* to know
no it won't - throwing an exception signals the exception. CATCHING it hides it.

default return types!!!

right
ok, if it helps you correcting and developing

s/and developing/
s/if //

also, you should implement your own custom Exceptions , not just NPE
I think so

i read a cool article a few weeks ago about what exceptions you should and should not handle

tell more

let me see if i can find it

ah, if only ricky were here to shout that checked exceptions were teh evile

i dont want to misquote it

there tends to be an almost as loud guy shouting back though..

checkedexceptionssuckjustlikewhitespaceandconcreteinheritance!

more than one, since it's not really a debate

both sides have their arguments

rick ever come here anymore?

i think its personal preference

sometimes

He still have his blog?

I don't

yep

checked exceptions signal that the caller is expected to handle something

remember it's address cheeser?

unchecked means that the caller *may* handle something
rickyclarkson.blog-city.com IIRC

nope
ahh blogspot

so do you risk having the entire app blow up?

with what?

if a null pointer exception occurs while processing some information what do you do with it?

normally, I let it blow up the app

Vector or Object array..which is best ?

what did you say jott

this is for a J2ME application

List

normally, I let it blow up the app

no List.

what if its perfectly acceptable to have a null there?

if it's perfectly acceptable, I catch null and manage it

J2ME only has Vector

ok

no you check for null, don't you?

if it blows up it means your app is broken and you should fix it

i.e., Object o=getObjectButCanBeNullIfNotFound(); if(o==null) { /* process not found */ }

better checking for null before :p

I think Object array is better

if I *expect* that it should be found, then I don't bother checking
i.e., Object o=getFoo(); // getFoo() returns null if not found, but app requires that it be there
o.doStuff()
if it's not there and my app expects it to be there, I *want* it to blow up

Right. Fail as soon as possible in that case, so that you are on track if you see the stack

right, fail-fast
in every case I can manage.

right but why not handle it gracefully?

what does "graceful" mean?

but your user doesn't know what's the meaning of NullPointer exception

what's more graceful than an NPE pointing to o.doStuff()?

I do think contrary

are you going to spit an exception page back in their face? Or return them back to that page and tell them what they did wrong?

that's why I fail fast - so *I* see it rather than my user
oh god

may be found or should be found

all of you, shut up
some of you get it, the others don't
I check for null *if* it's acceptable

problem of context

i get what you are saying about handling it before you go any further, i guess im wondering on how you handle it from taht point on

you don't explain all of it

it's a programming error, should never happen in production code

request.getParameter("foo") can be null, so I check for it because my user might have screwed it up - that's a VERY NORMAL error condition that's not an APPLICATION ERROR

if the user sees "null pointer exception" steams "omgomg!!!" and files a bug, that's what the programmer wants him to do.

but entityManager.getCategories() that returns null is an APPLICATION ERROR because my application requires categories to exist
an application error is something I want to see ASAP

s/steams/screams

a user error is something I want to handle gracefully from the user's perspective
I already said all this

right, ok, I would throw an exception, but I would not throw a NPE …thats the point
(yes, sorry)

… ok now you explained your case good job

what would be the use of an exception that wasn't an NPE if an NPE caused it?
explained it *again*

no, you said you get a null value not a NPE

If I get an NPE, I want to know. Immediately.
if I use that value and it's null, I get an NPE
Golly… sometimes I wish people would realise I'm not incompetent
it would save so much time!

so don' use it if it's null, and throw an exception, whatever you want but not NPE, thats my point of view

i dont think your incompetent, im trying to learn and understand. So I ask stupid pointless questions.

that's fair but I disagree

I don't think so
(about you incompetant)

If o==null as a valid circumstance - i.e., user data yielded null - that's not an exception *at* *all* from a language perspective.

right

i wouldnt be a npe that should be thrown probably, something like, datanotfoundexception instead

if it's an error that is sorta expected (because of the user logic or whatever), then yea… cast it as checked exception and throw it.. if it should never every happen due to logic, you can leave it as NPE, even though i prefer illegalstateexception or illegalargumentexception
usually it's one of those two cases.

if I used it without treating null as a special case, then yes, it's an exception, because the programmer was an idiot.

if a NPE isn't handled, you will get some unexceptional/strange exceptions, so for debugging, I think it's good hobby to handle NPE

some common methods yield null as a magic value.

i hate that too

i know, its an accepted practive
*practice

like how getParameter("blah") returns null… why not ""?
(im being sarcastic)

duh! I alrady started typing reply
wasted 10 characters
and then 10 delete characters.. /shake fist

haha
god i want to take a nap so bad

I hear ya sir

If a NPE isn't handled you get a stacktrace and the app crashes. What's strange about that?

my mistake, I mean if you don't check NULL, in the latter it will cause some other Exceptions

how may I change the vertical size of a JTable's heading? I need to display column headings consisting of 2 (or more) lines..

Yes, a NPE

and after spending a lot of time, you will find the root is the damned NULL
band after spending a lot of time, you will find the root is the damned NULL/b

ha! ha! ha!

tsk. you take naps when your kids allow, I suspect

I can leave here whenever I want and continue at home too. Ha!

What was the alternative to System.out.print* that java 1.5 added?

ok forget about

I just let them make do on their own in that case
println

we'll see if this become one day official best practice, maybe

printf

they are that old already?

if I say it's an official best practice, I'm de facto right
yeah, 12, 9, and 5

I thought there was another class added that replaced System.out

it seems to be a pattern, I remember someone mentioning spawning, and next thing I hear, they start middleschool

check Console

fiats! they're not just for driving around in style anymore.

see, I thought you were still at 2

yes, I outnumber me now

Wasn't that 1.6?

depends on how you count ego

I think so, I don't keep up with specific versions any more

you can say java is real object language also duh

Well, yeah

There wasn't a shorter hand way of doing System.out.printing?

say whatever

my ego counts for five

Something static

static import System.out;
but don't use that

hideous

when signing a jar with jarsigner will it be possible to get my ip that i had when i signed?

static import…

SOAP is evil

No, then you sound like Ted

^_^

I have a bigger soapbox than you do

lol

~evil

only morons use the word "evil" to refer programming practices, IDEs, etc.

Just have done most things with XML-RPC

[TechGuy]: should I?

we can still use 'evil' when refering to people though, right?

and recently had to do things with SOAP

I'd just ignore you.

SOAP is a way for Microsoft and IBM to sell useless product suites.

And pr3d4t0r…

^5

no, there are no evil people, just stupid ones. lots and lots and lots of stupid ones.
and then there are mexicans.
don't you have a car to wash? A wal-mart to work in?

Apparently *you* got pr3d4t0r riled up enough

anyway, it's time to get some lunch

lol

I can even poke at pr3d4t0r because i can fire his lazy ass

hi guys

Byte me.

hello verto

~tell pr3d4t0r about lame

~tell verto about welcome.

pr3d4t0r, I guess the factoid 'flamewar' might be appropriate:
pr3d4t0r, flamewar is http://en.wikipedia.org/wiki/Flamewar
verto, http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome

BAH!

~welcome

http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome
a href="http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome"http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome/a

[TechGuy]: his lameness is part of his "charm."

~tell [TechGuy] about limo.

[TechGuy], Your limousine has arrived: http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=knuttz_ueba_34

indeed
oh man I'm trying to laugh today.

bwahaha, mattel is recalling 9,000,000 toys

Have to deal with a crappy closed NMS system that is using MySQL 4.0.13

and the guy in charge of the company behind that committed suicide last saturday
eventually we might have to go back to toys made in taiwan

Poor box is dying under a 2 million record per hour load

[TechGuy]: ugh.. sorry to hear man

and if it gets really bad, we might even have to use toys mad ein america

noooooo not that

That's not funny.

what ever happened to kids playing with metal tonka trucks and shit

what's not funny?

that metal was often lead

9 *million*?

i mean you could kill yoruself with one of those dump trucks if you werent careful

yes, see CNN.com

hey guys…. I've been reading aobut this problem but it's confusing the hell out of me. I'm normally a c programmer I'm trying to create a jar file that uses another jar file

I'm going to try and upgrade it to MySQL 5, and I'm rush-ordering a dual-quad-Xeon with 4G

that might explain what happened to me then

heh

the program is in a package called grabber.Grab.java

That's not a package

the external jar is jxl.jar

i had like 2 or 3 of those things

grabber is the package

actually, i played with my parents tyos when i went to my grandparents house, and they were these old lead tractors and such
i got some exposure

I think the suicide of those guys is horrible (their FDA equivalent got sentenced to death!)

Man, the new keyboard is *nice*
It's like typing on air.

And the question being … ?

but then again, the chinese do seem to grok accountability, even though they apply it way too late

Good feedback, and it won't get scummy like the old one.

url?

[TechGuy]: hehe will that should cheer you up right there.. cept if your database is big and you gotta convert it over to mysql5.

http://eugeneciurana.com/galereya/view_album.php?page=1
Wait.
http://eugeneciurana.com/galereya/view_album.php?set_albumName=Apple-Keyboard

I've tried unpackaking jxl.jar then building both into one jar.. but when I try to run the newly created jar it says noclassdeffounderror

The last oen.

hmm, I wonder if that'd work on non-Apples…..

that a new Imac?

it should, looks like a USB connector?

No, just the keyboard.

ah ok

It will, but you won't have software for the special keys.

didnt know if you could get them alone yet

hmph

I ordered it about 3 minutes after they posted them to the site.
Meh.

it'd be supported under WinXP on mac, no?

OKi, time to shower.

It's already in InnoDB, thankfully. It's only 1.5 gigs
The problem is these archival tables that are created have no indexes in them. The damn query parser has to do a row scan
kills the thing

Sort of. It'll work, but it won't see the special keyboard mappings for volume, screen brightness, CD eject, and the extra 7 function keys.

[TechGuy]: ewwwww
ahhhh

Not my design!!!

how much is it, pr3d4t0r?
[TechGuy]: tell a DBA to add indexes

$50.

Every other table has at least somewhat decent indexes.

I have a java program called grab.java it imports things from a separate jar (impot jxl.Cell; etc) how do I build the program into an executable jar?

order me one!

I'm about to order one for my office
:|
Get the MacBook first.
OKi, shower and see ya.

urrrrgh

You cannot embed JARs in other JARs. You either distribute the other JARs alongside the main executable JAR, or use something like FatJAR
Yeah, uh, the DBA is over in India, and everything we suggest to them is "it will be considered in a future release based on priority and customer need"

[TechGuy]: so accidentally index it yourself
that's what I'd do

haha

I'm going to be doing that. Except new archival tables are built daily
Have to write up some type of script that scans for new tables and adds indexes to them somehow

I've realized that I'm attemting to do the first method.. so I unpacked jxl.jar now I do: jar cmf manifest.mf app.jar Grab.class Grab.java
everythign is in the same directory

Uh, seriously, if you're going to do that and try combining JARs, just use FatJAR.

alright thanx

~onejar

cheeser, one-jar is a library that allows packing multiple jars files into one. See: http://one-jar.sourceforge.net/

OneJAR, to me, is a pain compared to FatJAR

well, fatjar is just the eclipse plugin.
and the new version of one-jar comes with a handy ant task.

~emacs

vdv, emacs is escape-meta-alt-control-shift, or Eighty Megabytes And Constantly Swapping, or an operating system without a text editor, or more seriously, an extensible text editor.

makes it almost trivial

ah

~vi

Aradorn, vi is http://www.vikrammohan.com/images/vi-vim-cheatsheet.gif

I hate Eclipse… it returns System.console() returns null

oh wow good image

~tell leip about tool

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

~tell leip about hate

leip, I guess the factoid 'i hate you' might be appropriate:
leip, *cough* *sob* *gulp* *sob*

Hmm..
~hate

I guess the factoid 'i hate you' might be appropriate:
*cough* *sob* *gulp* *sob*

Where's the other factoid?

you could search for it in pm…

Aye. Or just ignore it.

poor javabot..

http://www.cnn.com/2007/WORLD/asiapcf/08/14/japan.biker.reut/index.html
pay attention, dude!
and jeeeezly crow, take some calcium!

if you id is misspelled then your javascript will not work!
your…

I got trouble running sgs under netbeans IDE. I downloaded a plugin from https://netbeansdarkstar.dev.java.net/ And can compile it, however I can't run it. it is a AppListener / Serializable server.

what should my class path be?

hi, i created a Jtable with a custom model/renderer/editor and i put it on a JScrollPanen, if i put the JScrollPane inside a JInternalFrame the table editor works perfect, but if i put the JScrollPane inside a JPanel and then inside the JInternalFrame the table editor doens't work, as i click
on a cell it doesn't let me to edt and it set te default value, why?

I don't know. It varies for each person
err, rather, project and JVM installation

jottinger you can answer my prayer?

no, I'm not god

he isn't god, but don't give him any ideas.

Does polymorphism not work in J2ME ?

jottinger, Maybe you can answer me still, you always seems to have a good solution to any problem
wlfshmn, I will try
I got it to work from the console real easy but how in netbeans

hi. can you please post your .emacs file?

Finally finished my tld generator
Didn't take that long, actually..

http://rifers.org/paste/show/5257
that is home, work is a bit different, but I do not have that one here…
I use no advanced stuff…

thanks

can i prevent a jax-ws web param of type enum to not have minOccurs="0" in the generated wsdl?

hippie-expand is really nice… :-)

you are using "stroustrup" style

for C, yes. What style do you prefer?

now using gnu

GNU is Now Used…

i'm used to put opening brace on it's own line
gnu is quite incomfortable for me

nobody knows Project darkstar ?

I usually pu the brace on the same line: "if (…) {"
no, but I know of eclipse, sounds to be about the same ;-)

You use BSD style, ernimril uses GNU / Stroustrup.

if I have a reference to an anonymous inner class, the outer class won't be garbage collected, right?

I could get into a rather protracted argument about visual flow with people who put the opening brace on the same line like that. )

style does not matter much as long as you use only one style for each project
[TechGuy]: I am sure you could do that, please find someone else to do it with… :-)

Oh, here we go, get this… In another OSS project I'm in, like Mono, they put a space between the method name and the opening parenthesis. It's *REALLY* annoying

correct

I don't believe so, no

even if the inner class has no references to variables to the outer one?

feel that coding style is a matter when passing scjd exam

[TechGuy]: I always put one space before any '('…

Hali_303, ernimril, I guess NO

they pay attention at style

inner classes always have a variable Outer.this

ernimrill eclipse is a IDE, project darkstar is a server archtecture I think.

for games

O_O
gaaaaaahhh!!!!!

stickto: thanks!

i dont like putting { on the next line =\

I know nothing of darkstar, just trying to be funny…

only commies do that.

and i hate spaces in front of the parameter declaration in methods

ernimril

ernimril, anonymous inner class has no reference to its "outer class"

yea it does.

only static inner classes have no references

My big argument for putting the opening brace on its own line goes with visual flow of the inner code block. If you were to be truly literal, then the closing brace would have to be on the same line as the last statement

OuterClass.this
[TechGuy]: which would suck

Plus I've seen some stupid code folders foul up on braces on the same line

[TechGuy]: that's just punishment for stupid formatting
8^)=

and more often than not, proper code indentation is not maintained when you don't have visually-matched braces like that

eh?

[TechGuy]: you should see the C code one of my friends wrote after she first had learned scheme….
[TechGuy]: all the ending braces on the end of the last line…

gah!

cheeser:if anonymous inner class get a reference to outer class, why the code in it just can access the final variables of outer class?

all my code is indented properly and i have the brace on the same line as the declaration

[TechGuy]: quite horrible, but understandable. She did use that style for some time, her java code follows standard convetion nowdays though…

what?
anonymous inner classes *can* access the final vars

yes, and *just* can

and your point?

Visually, to my eye, it doesn't look right to have a closing brace on its own line, with an unmatched opening brace on the previous line and not on its own

aic can access fields in the outer class as well as final _method_ variables

Screws up the code scrolling in my eye as I scan down a column

[TechGuy]: try participating in more projects with different styles…

like the one i'm on now. 8^(=

I'll gladly kick and scream, thank you.

as I know, if an outer variables isn't final, it can't be accessed by the anonymous inner class

correct.

Meh. The one class per file, one directory for package structure is really annoying.

don't like normal inner class

what?

so I guess the AIC has no reference to outer class

Believe me, I'm prefering it more and more.

[TechGuy]: i was doing the matching braces a while back and then switched to same line since code is more compact. Generally it's easy to see what stuff starts blocks of code (for, if, try, etc) so it's obvious which statement the brace belongs to.

or it can access every outter variables

Working on a .Net project where there's gobs of classes in a single file, which is now over 800k in size

AIC has a reference to the outer class instance

~smack stickto
we just told you it did

hehe

but they can only access final vars because of how they're implemented in the VM.
this is all well documented and explained.
~inner classes

http://java.sun.com/docs/books/tutorial/java/javaOO/innerclasses.html

*shrug*. Again, I would do that if I put the closing brace on the same line as the last statement, just to maintain the whitespace balance

[TechGuy]: if you were to do that, you wouldn't clearly see the end of block, imo… but maybe it's also a question of practice.

ok, i will read it first

[TechGuy]: Yeah, I've seen that. I hate that too.

The end of the block is visually defined by a change in indentation

[TechGuy]: C#'s take on it is more sensible, but is open to abuse by bad or lazy programmers.

[TechGuy]: pre commit hook that checks and blocks large files!

heh
Haven't figured out how to do that with SVN on SF

[TechGuy]: yea, that's what i meant by practice

cue the crickets

chirp

*squash*

chirp chirp ch-***

you are right

hello; is there a way to build a method name using string concatenation?

~tell gvcoman about reflection

gvcoman, reflection is http://java.sun.com/tutorial/reflect

[TechGuy], ty

Hi, I'm using `javac -sourcepath src -d build`. I have source files in src/dlcspm4/dsl/. Running this command returns the error, "javac: no source files". Why is this? I'm trying to create a class file for all my source code in a given package.

Hello

http://www.dailymail.co.uk/pages/live/articles/health/dietfitness.html?in_article_id=475021&in_page_id=1798
winnar!

i'm having trouble printing vector elements using jstl - can anyone check my thread please? http://forum.java.sun.com/thread.jspa?threadID=5205855&tstart=0

whatup guys

Nothing much

grr. Why do people think it's perfectly OK for developers to read documentation, but managers can just manage by their divine birth right?

Zaph0d^: can you provide an illustration of your issue at hand? I fail to see the connection

err. opps
part of a comment I pasted somewhere

you've just proven why managers are necessary.

i think what he really means is that developers need to keep up to date but managers often don't put any effort in that

about someone (manager) not reading the mythical man-month and rediscovering the essential truth that adding a developer to an already late project is futile.

but actually at my last job there were more than one developer that didn't keep up to date
one developer (unfortunately my boss) thought that he already knew everything necessary to know when it came to SE
Zaph0d^: yeah that one too

ah true, though, most managers no longer delve in day to day code.

i think you're still missing the conversation
mythical man month is very relevant to managing a SE project
and not very relevant to code

Hello. I have a stupid question. I do not understand "different from 1" in if (argv.length != 1)
(it is from the xml tutorial)
why should it be different from 1 and not 0 for example?

what do you mean you don't understand different from 1?

Can someone explain when to use Service POJOs instead of Stateful Session Beans?

argv[0] is the name of the program, iirc

argv is reference to the input in console?

so that array should have always at least one value.

thanks dfr

unless OS messes up or whatever.

thanks for the explanation, I did not knew it

np

That's not the case in Java though…

wtf
i don't know how dfr translated his question into "what is argv[0]?"

I'm slightly puzzled myself.

he's a psychic

unchecked cast from Object to SortedMap
How do I fix it?

he translated very well

well, he asked why argv.length is checked for 1 rather than 0….

i think that's a suggestion to use generics

usually you check if array is empty by 0.. but not case with argv ’cause in there "no args" means it's 1

hahah, did he?
where do you get argv anyway?

I read " I do not understand "different from 1" in if (argv.length != 1)" as "WTF is there a 1???"

public static void main(String[] argv) —?

yea.

ah, idea names that args

tie– I am trying to do: SortedMapObject,Object[] sm = obj.method.getRows() — method return type is jstl result.

most everyone names it args

hmm.. what do they call it in c?

i thin in C its argv

’cause that's where my naming would come from

is useless

yeah

The problem is most likely that obj.method.getRows() returns a SortedMap rather than a SortedMapObject, Object.

thats what i was just about to say

ya, that's why i call it that… argc is the length, i think
oh, it's also ARGV in perl…

Zaph0d^: Mm. I'd sometimes use it in preference to an erased type.

heh

but my app, that takes no arguments, seems to have an empty args
but my app, that takes no arguments, seems to have an empty args

Zaph0d^: It fucks up the interaction with Real generics less.

why?

yes, but the getRows() method is defined in jstl.jar.

it might be a bit funky in java… since i dont think you ever invoke the program itself.
unless you do exec.

Zaph0d^: Combining erased types and generic types can do some weird things.
(I can't think of any good examples offhand)

the code is coming from http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/work/DomEcho01.java

i feel like i dreamt about this. I remember reading that args[0] stands for the program too

erm. I'd rather the compiler warning me about my stupid mistakes.

It does. In various languages which Aren't Java.

(or someones else stupid mistakes)

ah, so this must be something i learnt from C/C++

it's in OS specification.. but in java, the name of program is "java" or whatever the name of the jvm executable.
it's in OS specification.. but in java, the name of program is "java" or whatever the name of the jvm executable.

Yeah.

see you later

you never really execute your class from OS point of view.. the jvm does.

right

Zaph0d^: Perhaps. I'd rather have the types say what I actually mean.

but you don't have to be that logical. It COULD have the name of the class with the main in it

so "name of program" kinda loses sense…

drm– yes getRows() returns a SortedMap. How do I assign that to a variable, knowing that I have to use generics, yet they are not defined as such in the return of that method.

yea, but you can get it via this.getClass().toString() anyway…

Like you just did.
And live with the warning.

i hate this cgi client im using, everytime someone types something it refreashes the screen and takes focus off the input screen

(You might want to provide a more specific type though if you know it has one)

so if i hit backspace i go back to the login page and disconnect from irc =\

supress the warning

yes, but I'm sure i can think of some other example where java does something weird jsut cause other programming languages do it. But i don't wanna go down this road

Zaph0d^: Shh.

yea.. i have yet to be smacked by cheeser.. and i prefer to keep it that way

drm– I have about 200 warnings because of that line. –

erm. I meant red9012, not DRMacIver for the last comment.

it seems java related enough

why do you have that line in 200 places?

my current project is a webirc type thing

it is super annoying that my work ISP blocks outgoing ports

because Its repeated for different sql queries.

is there any way I can remotely use jmx with this situation?
oh so jconsole has a detect deadlock button eh? Does anyone have any experience with this? Does it work well?

it can probably detect java deadlocks, not native ones

for detecing deadlocks that arise from Java synchronization primitives, yes

ok

"monitor A is used above monitor B in the stack"

if you have a circle in the graph, you're deadlocked.

Zaph0d^: you don't even need to do that - there's a ready-made class that you can use, and I suppose jconsole uses

inside a class should I refer to a variable using 'this.' or through getter ?

yeah i prefer jconsole :P
if it works just as wel
l

really? damm. all those seconds thinking about it when I could state blankly at the wall.

but i understand the concept

s/state/stare

in other words, I have private String x; getX(){};Set(x){}; if a method inside that class needs to refer to x, should it be this.x or getX() ?

doesnt matter

getX().

Zaph0d^: in the ThreadMXBean that jconsole itself uses

Zaph0d^: for extensibility reasons.
fun. I'm talking to myself. red9012: the last one was for you.

your name IS Zaph0d
Was he the dude that had two heads?

yes

ye

hehe

Maybe the little head was talking to the big head.

such a dang good book
lol

very old nick. never changed

What do people think are the best job sites for Java these days?

Zaph0d^: can I have your drugs?

does anyone here use statsvn

sure.

Is the 'notification buffer' screen for an MXBean supposed to be broken and display nothing?
bIs the 'notification buffer' screen for an MXBean supposed to be broken and display nothing?/b
java1.6 beta jconsole which might not help.

flavoring

This channel is a pretty good place to find a job if you're any good.
Plus your interactions here qualify as a pre-interview.

pr3d4t0r, we are hiring at my startup… getting crap off craigslist…
pr4d4t04, getting high quality off jobs.joelonsoftware.com but very low volume…
trying to figure out where else to post…

i got this job off craigslist fwiw

cheeser!

what up, yo?

hire me

the other interviews I had this morning improved over the first one, which was the tell me what static means in regards to java.. umm, ummmm, ummmmmm [click]
Anyone care for Dice?

whats a dice

dice is like monster.com
but for techies

dice does a lot of marketing indeed

gotta roll one one a d20 eh ?
*on

it's ok but a huge complaint is that every day it repeats the same ads over and over again
and says it's new for that day
i think they do it to make themselves look more important
by ad, I mean job posting

is it bad to apply for both a promotion and a new job?

haha.

=P

i think in english they call that a "backup"
i'd do it

Or "leverage"

or/and "leverage"

"promote me or i'll leave." ?

well a job opportunity has presented itself with a really cool company here and i might be able to get on there. The yhave better benefits and id get paid more. But my promotion would also pay more than what im currently making but its still not great and I probably wouldnt get to move up
after that.

new job, then.

Right

is there a command to stop ALL sounds ?

if you see the end of the road at one company, you should probably explore other options.

yeah, plus the new job will allow me to expand my skill set

and the question was what, again?

sounds like a no brainer to me: stay with your old job

8^)=

haha

tieTYT++

tietyt has a karma level of 21, cheeser

lol

yes, .cutCable()

public sector sucks btw !!!

The question was "How is this java?"

that may not stop those system beeps
but that depends on the cable you cut i guess

oh! silly me. P^)=

but it tends to be much more stable

if you cut the right one, you can even stop the sounds from the fan

ie, for life

theres motherboard.add(new Scissors()) for that

true, but the pay sucks and the benefits arnt that great

it's usually tougher to get into public than private no?

other way around
i had to pass an FBI background check and a full credit check to get this job

depends which governemnt we're talking about
anyway, this is totally off topic

i have a custom ListCellRenderer and I want to expand the selected item to show more information… showing more information is easy, the problem is the cell in the JList wont resize, anyone know what i could do?

I never had to go thru that for private companies I've worked for
yours is prolly in the security biz

traditionally motherboards have been forked, not scissored: http://irccrew.org/~count/forkattu_kovo.jpg

shadowarts-lappy: I think you need to make the layoutmanager re-layout.
shadowarts-lappy: did you try that?

surial, call validate()?

Is that the new 64 core thingie from sun? Weird shape.
shadowarts-lappy: or even relayout(). It's been almost a decade since I last did swing stuff, though.
though I'm about to get re-acquianted with it ,writing some jconsole plugins.

~tazle++

tazle has a karma level of 6, g[r]eek

surial, hold on one sec…
surial, no relayout()

shadowarts-lappy: or just layout(). Work with me here.

surial, layout exists, tried it, didnt help though

shadowarts-lappy: well, then I'm out of ideas.

(its deprecated btw… must have been a long time since you use swing ;D)
hmmm
it seems like once something is given a size, it always keeps that size

I am getting a "should be accessed in a static way" what does this mean?
I'm using obj.method

Use Class.method()
Where Class is the name of your class.

instantiate your class; then call your method that way.

read the question; then answer

eek
in that case
javabot tell red9012 about static

red9012, static is http://java.sun.com/docs/books/tutorial/java/javaOO/classvars.html, also see http://mindprod.com/jgloss/static.html

i didn't see the second line

It happens

too much :|

i'm having trouble printing vector elements using jstl - can anyone check my thread please? http://forum.java.sun.com/thread.jspa?threadID=5205855&tstart=0

what is the overhead of using hashmap for referencing data compared to referencing directly?
hashmap would contain about 100 keys

insignificant

hashmap takes more memory but the element access is with constant complexity.
More memory for fast access
one for another

i'm optimizing 3d engine that references graphics through hashmaps
of course it does lookup while rendering every single frame

should the java src live in the same directory as the package it specifies? e.g. package com.mine.util; lives in ~/src/com/mine/util/myutil.java ?

yes.

the amount of memory overhead in hashmap is insignificant compared with almost any object.
howevre, there the hashmap constant time has some ugly constant overhead to it (mainly calculating the hashCode()). Also, it's constant only on avg.

yes, i have used hashmap with great success for looking up objects from set of objects with more than 1000000 objects
but in 3d engine, for looking up graphics, i do not know if it's good idea to use hashmap
i will do an experiment

benchmark will always be the best answer

just make sure your stored objects cache their hashCodes if they are computed from the object's "state" (like String does)

Hmmm.. Rickys ideas always seem strange to me.

what did he come up with now?

According to his blog he wants to remove the "private" access modifier

ernimril, link?
Blafasel, link?
*

Because encapsulation would work equally well or better if you turn to anonymous/unnamed classes.. Uhm.
something along the lines of rickyclarkson.blogspot.com?

this? http://rickyclarkson.blogspot.com/2007/06/taking-private-out-of-code-without.html

Just checked it. Yes, the link is correct.
That and the one above (which is based on that idea)

hehe good ol Ricky

yeah. htf is that easier to read?

No idea

1
hmm

Ricky is hard set on IDEA now eh?

hmm

I thought he was a vim and ant guy

makes me want to switch to netbeans

is it me or does ricky suggest removing all private variables from class?

8^)=

hahaha

Didn't he do that as an experiment rather than because he actually thought it was a good idea?

’cause his implementation does seem to contain that map as private variable…

I guess all his latest posts are just ways to say "Java should be like Lisp"
Like "This all makes me realise that it isn't a problem that Common Lisp's OO support doesn't include private. That might actually be a good thing."

Comments

« Previous entries · Next entries »