if im going to be passing an array as a parameter to a function do I need to declare that in the function Assuming

Connect('mysql://f00li5h:purrpurr@localhost/f00li5h-app'); #oh, look all done

ok now i cat get my header bit to work again
cant

give code

did you place it before any echo statements?

yes
first echo is straight under it

things outside php count as being echo'ed

How can I split a string at the last comma it contains, and give the first substring into a variable?

http://pastebin.com/d7089fff0 thats what i have now

doesn't session_start() send headers?

yeah so i need that after the header or ?

it adds them, but i don't think it sends them

Hi, I need to launch a ssh connection from a php command line script. What's the best way to do this?

system
actually, it depends on what kind of information you want, proc_open will give you everything (as far as i know)

I cant figure out why it's complaining about a database not being selected.

any ideas where im going wrong Kylratix ?

it makes no sense. I have another script that works in the same way, and it works fine

thx. I'll check both at php.net

it's likely thath you didn't select a database

you could try ob_start() at the very beginning and ob_end() just –after– the header() call

that's messy
the trick is to just not send anything to the browser

how do i make sure of that ?

Ninth line of the file: mysql_select_db($db_name) or die(mysql_error()); — Seventh line of the file: $db_name = "rhs";

go through your included files

And it's not having any problems there.

and make sure they won't output errors
or anything

pastebin, kpls

f00li5h the only echo i have is the one under header can i change that ?

i don't think the ob functions are that messy
you should know where your program begins and ends

pardon?

echo htmlentities($result);
that doesnt set $result does it ?

if it's under the header call, it's not going to fuck it up

ok yeah it is
has to be session then ?

include("/var/www/data.php"); # does this send any content?
are you sure it doesn't?

try it
http://us.php.net/manual/en/function.headers-sent.php

just has two lines $uname = dfsfsf and $pass = gdgdgdfg

to debug

make sure that php is in column 0 of line 1, and remove the ?

you can find out the line number where the header was forced

ok will do cheers gimme a sec

Oh lawd
I can't believe that was the problem

being before the database stuff at the top of the file was causing the problem

So I moved it to right before the HTML
and now it works
o_o

if you didn't fix it, it isn't fixed

If I were actually so concerned about checking to see if sylid is a number, what would I do to make sure it's a number? It must come from an outside source, so I must get the number through the URL

didnt work f00li5h

is_numeric … or just cast it to an int
what didn't work?

can someone help me with the syntax error on line 15 of this? http://pastebin.ca/634222
it's a parse error, but im not sure how to fix it

if (!headers_sent()) {

how about escaping your '`s

if( headers_sent() ){ die( "headers should not be sent yet" ); }

yeah, you totally need to escape your '

$line = ''; $file = ''; if (headers_sent($file, $line)) echo 'headers_sent() at '.$file.' : '.$line.'br /';

ah, thanks

i get errors and headers should not be sent yet thats means they are sent ?

it does

so its is session start

find out where they're being sent. infact, error_reporting(E_ALL) should tell you
you should get a notice 'output started at foods.php line 11' or similar

how do i use that f00li5h ?

stick it at the top of your code,
or ideally, in your php.ini

ok

ini_set('display_errors', true); as well

/me wants pragmas

syntax error, unexpected T_STRING in /var/www/localhost/htdocs/working/scripts/validate.php on line 3 which is teh session start bit

i always stay away from pragmas

hrm?

they make kitty scared

yeah dunno

use strict; use warnings; # must have

bah, gcc -Wall =D

ok got it
session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/localhost/htdocs/working/scripts/validate.php:2) in /var/www/localhost/htdocs/working/scripts/validate.php on line 2 — thats session_start

shazaaam
when in doubt, error reporting

so now what the hell do it do put that down the page ?
yeah

uhm, yeah call session_start() after header()

ok now php
echo $_SESSION['phonenumber'] ?
woops

did they drop libapache-mod-php5 from debian unstable?!

try ##debian

nah, screw it, I'll go check p.d.o instead

on the redirect page

-_-

ugh ciaran
that fat whore
anyway, uh

riiiight..

$_SESSION['phonenumber'] = $xml-SERVICE_PHONE_NUMBER; is used to set it

was the other php file (with the redirect) the one that set it?

yes
i need session_start on all pages or just the one that sets the session vars ?

GSN - on all pages that refer to any sessions vars

ok thought so
im also gettin
session_start() [function.session-start]: Node no longer exists in /var/www/localhost/htdocs/working/result.php on line 2

xml–
any luck?

bad karma, BAD karma!

!karma xml

xml–SERVICE_PHONE_NUMBER; ?

do i need permission to karma things?
hrm? no.

they don't like xml

ahh ok

The system is working fine now. I'm making some tweaks :P

set a var before and call that ?

nope

Such as.. "Unknown column 'wedhome' in 'field list'" — lol, typo

hmm
how to work with sessions and header at the same time

then there's a trick to it?
is it, !karma up foo, or something daft then?

with header problems - it can be a simple space or newline that can cause it to complain

nothing, just confirmed your karma on xml

$ph = $xml-SERVICE_PHONE_NUMBER; then $_SESSION['phonenumber'] = $ph ?

it said that xml was karma nuteral…

yeh, but doing xml– decreases karma, so my reaction was: bad karma.. BAD! Karma!

GSN - put your session start back at the beginning of your validate.php file for starters if its not already put back.

ausome its not because of the header problem ?

why don't you comment out the redirect line
and see if you get any warnigns

so your session_start precedes your header() redirect? or have I got hold of the worng end of the stick?

hi, anyone know why I can't use the $email array in the second while()? http://gargantua.servehttp.com/sql.txt

session_start preceeds it if its at the top

GSN - yep

ausome ill pastebin the curent version

because you don't really want to global it each time through the loop

is there an overhead associated with include();

also, you're not in a function, so you don't need to global it

GSN - grand idea

no, there isn't, it's free

and you realize that your $email array will be the last row

i mean loading/size wize

of your query

ie. should i use include() sparingly & try to consolidate my code into fewer files. or should i spread it over a few files and include them into the page

f00li5h, but I just added that, someone told me it was a variable scope problem.

no, it requires no resource usage at all (and you're not allowed to disagree until you come back with statistics)

ausome http://pastebin.com/d59a8bc5d

cool im just checking

no.

f00li5h, but not having it there doesnt do any difference.

it doesn't make sense to use $email outside that loop

why not?

because you won't get it for each value, you'd just get the last value (if any)

oh right…
well there's one problem..

plus it's the same query

GSN - ok you've got your session_start after your redirect - that wont work. session_start has to be the very 1st line after your php

no it doesn't

f00li5h, the emails table doesnt have as much values as much as the `users`.

so?

ausome that doesnt work because session_start send headers ?

what are you actually trying to do?

fooli5h - it's good practice

f00li5h, if I put the first while loop inside the second one it would only show the number of rows the `emails` table has.

how do i use session_start and headers ?

where does it say that session_start sends the headers?
no, it won't

GSN - you have something "Sending" b4 the header() -

That problem wasnt directed at me.

hmm ok

what are you actually trying to do?, what do you want a list of here?

you have to associate the emails table with the users table

Call to a member function display_contents() on a non-object in

for the query that i think you want

non-object?

what? where?
you have to include classes before session_start, for one

code result. just wondering what call on non_object means

well, any classes of ojects in the session
which code?

mine!

check the same link f00li5h, It still does the same thing.

call to a member function on nonobejct is that generic

listen, you still have not told me what outcome you hope to achieve

ausome i put it at the top now the redirect doesnt work http://220.245.196.23/working/index3.html use to form down the bottom just put in a 10 digit phone number

if you don't show me code, i'm not going to he able to help, am i?
why is the $email loop empty?

interesting point.. http://phpfi.com/252329

because I just want the rows to get stored in $row.

is the error message in there too?

yeah description
top of the page

then why are you even running the other query?

GSN - where else are you sending headers?

easy, $cart is not defined anywhere

i dunno ??

GNS - it's in result.php?

ill check.
i think it may be defined in shoppingcart
oh i see

f00li5h, which query?

1 sec

GSN - whats your result.php file

ok no error now but doesnt work 100%

ill pastebin it

the $emailr one
if you're not looking at the results, why are you running the query at all
does it make sense to run a select, and then discard the results?

f00li5h, because I want the email feild from the table `emails`.

then join the table, and run it as one query

how?

select * from email, user where user.userid = email.userid, or whatever column joins them
ofcourse, users that don't have emails won't show, and emails that don't have users won't show…

ausome http://pastebin.com/d60625694

f00li5h, so there's no possiablity of doing it my way?

you'd have to do an outer join to get them. to find out more about outer joins, see #your-database
your way is just plain wrong, stop it now.

just different $variables for each.

joining of tables is something that should be done by the database, not in php

i cant see anything in result.php ausome ?

why doesn't that work?

what are the errors it reporrts?
your html-inline-with-php is making me dizzy, put the html somewhere else, and include it

ok

did you miss the part where i said "stop doing it as 2 seperate queries"?
incase you did
stop doing it as 2 seperate queries!

f00li5h, uh no errors, just all the feilds are printed in the first row.
f00li5h, but I don't wannnaaaa!

http://blog.zenspider.com/archives/2007/07/how_irc_feels_too_much_of_the_time.html

whats a good tutorial on doing that f00li5h ?

it. is. wrong.

any other ideas ausome

i really don't know… i'd suggest using templates
but that's a flamewar/troll paradice

speaking of which, good morning, my pesky subjects

aah, Mr Seth, just in time

ok

GSN - try removing the leading space b4 your session_start iin results.php as a try

stick all your session cruft into includes/common.php … and make sure that gets included at the start of all your scripts.
no more thinking about sessions, get them out of the way

ausome same error
ok f00li5h

GSN - any spaces after php - somethings sending out

error?
the spaes before php are the problem, not the ones after it

ok going over files for spaces

GSN - good to see the good ole CSS Layout

at the end ?

http://pastebin.com/d2e5f14b — the errors f00li5h

no, you don't need it, and it tends to cause 'output already sent' problems in includes

ok ill delete them all

have sessions ever worked on this webserver?

dont know

’cause that looks like a no-premission-to-write type error
coming from deep in the belly of php

hmm ok
php has session support compiled in

yeah, but it may be having trouble keeping the session store up to date

how would i check that ?
are there any use flags that need to be compiled in with session ?

no GSN

ok
it worked when the session_start was after the header

then you must have output_buffering enabled in your php.ini - if you do it's probably best to turn that off

ok will look hang on
its already off
this is doing my head in
all i wanted was a redirect with session vars enabled
ausome any more ideas ?

just do session_start() at the very top, then set the redirect header before anything is outputted

yeah we tryed that

and what happens?

http://pastebin.com/d59a8bc5d — the code
get errors and no redirect but it outputs the validate.php page

GSN - welI just ran your results.php file here and it ran - so thats ok - on my server

add at the top: error_reporting( E_ALL ); ini_set( 'display_errors', 'on' );

what about validate.php ?
ok
ill pastebin the errors
http://pastebin.com/d2e5f14b

Can I use proc_open to open a ssh and then feed the password with pipe?

mail("bah@bah.com","testing","testing","From: test@test.com\nReturn-Path: test@test.com\n");
is there a reason the return-path won't work?
it won't set it

GSN - I'm not getting your errors here - I've commented out your include and your curl statements - otherwise it redirects fine

why would you see a return path?
don't you mean reply-to ?

why wouldn't I?
no, I mean a return path

what do you expect from it

GSN - whats in data.php

so if the mail was sent, and there was a problem sending it to a certain recepient, it will send the error message to the mail in return-path

!tell Techdeck about mail()

?

ini_set("sendmail_from","$email");
I'm afk for a few mins

Dynom, let me try

there was a factoid that said "don't use mail() directly, it's painful and it's often a security hole"

GSN - I'm off to hunt and gather dinner for the mob - so I'll be gone for a wee while - Good luck

php
$uname = "xxxxxxxx";
$pass = "xxxxxx";
?
woops
thats data.php ok cheers for your help so far

still nada dynacrylic
Dynom

any more ideas AlexC_ ?

I've never seen that [function.session-start]: Node no longer exists error before, and neither has Google

o yay if google doesnt know

he said he's going away

ALexC_ http://bugs.php.net/bug.php?id=33142&edit=1

AlexC_, k

This problem occurs when simplexml_load_string is used within the
session.

$_SESSION['phonenumber'] = $ph; change to $_SESSION['phonenumber'] = (string) $ph;

ok

what sort of time does file_exists() take?

i'd expect it'd be one stat syscall

time??

no i mean
if i run file_exists() about 50 times. would it take a lot of time?

run some tests?

saaamy, it depends, is your filesystem on NFS, on a floppy disk, what speed are your disks, how big is your disk cache?

hence why i asked :p

there was a factoid, but wolfey thought its fud and killed it

i don't really see another choice, unless you're going to use glob or opendir

i'm uncertain. shared web hosting

why does my code always end up giving me mind hurt

saaamy, either way it's 1 syscall per operation (atleast)

'fud'?

$config = substr_replace($config,"\n".substr($config,$ptr,$eol-$ptr-($eol-$ptr-$len))."$val;",$ptr,$eol-$ptr);

ick

i'm just wondering in general what sort of time that takes to process
so yeah

wtf?

not long, but you may want to cache it in an array, if you can

unless you're going to be doing 50+ per page load, don't be concerned

AlexC_ didnt fix it

ah yep

just be thankful i didnt use any braces :P

as in FUD

FUD is not in my lexicon

Fear Uncertainty and Doubt

i see

AlexC_ might have something

Hi can anyone help me with a regex

what's wrong with telling someone the risks of the choice they've made?
'yes'

ALexC_ $_SESSION['phonenumber'] = (string)$ph; no space ! omg it coudlnt have been that

basically I am using the bash function find to search a folder on my server, I need to specify to search for any file containing the search term

hi

hum?

any idea how to do that? I was using *$_POST['search']*.* but it's not that effective

http://paste2.org/p/5192
how is it possible that it prints 'FUJ'?

find . -type f -exec grep 'some pattern'

AlexC_ that fixed the errors now it works but echo $_SESSION['phonenumber'] doesnt work in the redirected page

any boolean variable that is true is equal to any string?

find . -type f -exec grep 'some pattern' {} \; # rather

when you set it, do after it - var_dump( $_SESSION['phonenumber'] );

so eg find /path/to/folder -type f -exec grep 'my user submitted string' {} \;# ?

AlexC_ what do u mean ?

after $_SESSION['phonenumber'] = … do what I just said

'my heavily filtered and escaped user submitted string'

o ok didnt read it peoperly

cheers

AlexC_ you are the man
thanks to all who helped!

^^

now to incorporate if else statement into the redirect ill be back in 5 mins with more problems

php takes whatever you are comparing to a bool and converts it to a bool, then does the comparison

anyone check out rails

he quit ^^

hello, I'm looking for a good webhosting which has a good quality/price ratio

jessy - check with mediatemple.net or bluehost.com

thank you

hey php experts.. I am having issues with: http://pastebin.com/m4d0644ef
jessy_ - your welcome mediatemple.net is not cheap, but its a very good quaility host.. they are 20/mo but great, never been down

were not psychic :P what errors/issues?

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/16389/domains/addictedtokaraoke.com/html/test.php on line 6

never put raw anything data into a query!

AlexC_ — was getting there

you're putting raw $_GET data into a query

what should I do then?

Hi folks

always use mysql_real_escape_string() to clean up values
hi,

example pleaes?

php.net/mysql_real_escape_string
also, you're problem is this: mysql_fetch_array($venues) - the line above you did $venues = mysql_num_rows($venues);

sgerbitz, mhh it a little bit expensive for me, I'm looking for something with no as much space, I need about 50mo

which means it's no longer a mysql resource,
#web or Google

I'm having a headache of a problem with the browser sending data to my server in UTF-8 format via XMLHTTPRequest, when I want it in ISO-8859-1…. The problem is that the GBP £ sign won't show up… HTMLEntities() will replace the £ sign with £ but leaves a cryptic character
before the sign

The content-type and doctype in the HTML are both ISO but the silly browsers ignore that

ok

jessy_ - pm me for more help

any way to remove the matches on the end of the filename when using that function?

which function?

so eg find /path/to/folder -type f -exec grep 'my user submitted string' {} \;# ?
because grep output matches on the end of every file name

hammondr, javascript in most browsers send the encoding it likes… you'll better stick to UTF8, just sent headers and content-type in UTF8, and echo utf8_encode($yourcontent);

hey :P

How can I cut the last 8 characters of a string?

$rest = substr("123456789", -8); - returns "1"

string = substr
jesus designer

don't you need both of those parts though?
the filename so you can link to it, and the line, so you can show the match

just need the filename

just split the results on :

i'm looping the results
ok

you could so it with sed, but the quoting will make you so angry i won't bother

If I use a UTF-8 database, and use UTF-8 throughout, and I utf_encode() the content, the GBP signs now have two cryptic characters before them instead of one

hammie, I use a UTF-8 database, and use UTF-8 throughout, then my content is already UTF8… and i can't send it as ISO-8859-1
bhammie, I use a UTF-8 database, and use UTF-8 throughout, then my content is already UTF8… and i can't send it as ISO-8859-1/b
just change your headers and content and use it in UTF8, that must work

the GBP sign isn't a valid UTF8 character though

then you need to convert it at database level, if you get a extrange symbol from the mysql level, you can't convert it back to ISO, because it is already "damaged". Can't you just change database schema to latin1 ?

I have it working now (though I'm not sure how)
It's such a farce just to get a currency symbol for a major country working
Okay, it now works when I'm retrieving data from the database…. but GBP signs written by hand in the HTML files with a text editor aren't showing up…

Hello, I am working with phpunit and trying to make use of a mock object. I have pasted the code here http://pastebin.com/m6bdb3618 (in reality each class/interface in its own file) I am getting this error :Fatal error: Call to a member function
check() on a non-object in /home/howes/dev/workspace/Calculator/src/main/php/Calculator.php on line 23. I was wondering if anyone could explain to me why as in my mind the $answerVerificationService sh

hammondr, even if you think it works fine, try it in Firefox, Opera and IE, much times different browsers parses it different

Hmm.
There must be a "pure" solution

the second problem is with the html file encoding "by hand", ensure you are using UTF8 encoding when you save the file, if you set your html to utf, or ISO if you set the content-type as ISO
hammondr, there is, saving the correct chars in the database
if you save a pound sign in a database with a format that doesn't recognize pund sign, you already have lost the chance to use it
you need to save it correctly, then you can use/show7transform it

Can I save one in a latin1 database?

but all the encoding problems ends always in the database level, imho
yep, latin1 supports mosts chars, pund, dollar, euro, tildes, ñ, etc
spanish is the language that uses more extrange symbols, and i'm always ok with latin1

if it's all phpunit libraries etc then #phpunit will help more I guess

read some docs, but i'm pretty sure you can even convert the whole data in the database to latin1 in a single step

So if I set the database back to Latin1, leave my files as ANSI (not UTF8), then I just need to convert the browsers UTF8 form submissions to ISO before inserting them?

ta AlexC

yes and no, the steps are ok, but you can't convert UTF8 (lack of chars) to ISO(more chars)
you should make the forms send ISO chars
then you can save them as is
tha's how i do it at least

well, technically they're not forms, it's data I'm submitting as POST data in an XMLHTTPRequest, which I couldn't make Firefox send in ISO

internazionalitaion is always a pain in the ass

Firefox seems intent on sending UTF8 no matter what

mmmm, for js i think there is a var to set the encoding
response.setContentType("text/html;charset=ISO…") or something like that

see what I would like to avoid is having to set things in code all the time

back

find ".$_SERVER['DOCUMENT_ROOT'] ."/FreeSamples/ -type f -exec grep ". $_POST['search'] ." '{}' \; #
really aint getting alot of correct matches, for example if I search for a file I know is there like "Synth" it says no results

from my notes:

MySQL

rawurlencode()

that rly made me cry for a second

lol why?

take a look at http://www.the-art-of-web.com/javascript/escape/

well a) no escaping what so ever.. and b) I think 'grep' is more suitable

no escaping what so ever?? I thought thats what the \; did.. just use grep on its own then?

I meant the $_POST['search']

oh I addslashes b4
and trim it

I'd go with shell escape functions tbh

don't know how do to that
can you give me an example of using grep

grep -R $search $path
php.net/escapeshellarg

what's -R do?

man grep
but -R is recursive

weird grep still don't pick up these files
Im running exec("grep -R ". escapeshellarg($_POST['search']) ." ". $_SERVER['DOCUMENT_ROOT'] ."/FreeSamples/", $output);

hmm, does escaeshelarg escape spaces?

adds single quotes around a string and quotes/escapes any existing single quotes allowing you to pass a string directly to a shell function and having it be treated as a single safe argument. This function should be used to escape individual arguments to shell functions coming from user
input.

so I don't need to addslashes()

try it w/o escapeshellarg
what do you find then

escape sctring

hi

hi epsy
welcomte to php support channel
Gophp5
why go php 5 ¿

still dont find anything

shouldn't be long when the site will be renamed gonephp5

very strange, works fine for me

aww go php6.org is already taken
gophp6.org even

anyone awake?

Dynom, hi

just stick with your find then

no, you?

Dynom, the php_ini idea was nice, but it's not working

can I ask a stupid question about search, that is well-intentioned?

any other ideas?

don't ask to ask - just ask

hmm, I asume you reloaded your httpd

well, it just seems stupid, and I'm embarrassed

mail right? *thinks back*

how does search work on linux?
like, find.

the grep is quicker, but they both dont find these

#linux would be better really

specific files

okay
but

My wordpress installation has this require('./wp-blog-header.php') but it seems my server won't accept the "./" part. Has something changed with a new PHP version (PHP 5)?

what about doing a system-search using PHP

Dynom, yes, the return-path problem

done by caching filesystem info into MYSQL
and then using mysql's built in search features
and good indices?

that is weird, because grep just finds strings in files, and goes recursive like find can do

grep is better for looking for files

okay, why?

Dynom, any ideas?

odd isnt it, the filenames are Synth01- thru synth08
if I put in synth
no matches

..
try grep -Ri

zackattack, it would be easy enough to write a php-mysql system
keeping it up to date is the hard part

keeping it up to date is also easy if you use mysql4 or above

why's that bizzeh?

just rescan every X hours, and use insert… on duplicate key update
as long as your using sane keys

purr

what would good keys be in this case?

i would say for a start, full path and or filename
or a hash of somesort

I wrote a filesystem dupe finder does most of what you want

synching the fs into mysql may be more resourse intensive than just readin the disks (depending on how often the synch is run, and how much traffic the site has)

most sane idea would depend on what your doing exactly… if you wanna display large amounts of meta data held on a file… i recomend storing the meta, if your just doing a file download service.. just go directly from the disk

asking a stupid question but this case insentive each it looks for occurances, becasue some of the results seem to be totally random

how does one go about making a page that forwards a visitor to another page?

php.net/header

like the string doesn't even appear in it

Thanks

Yeahh Go php 7

7?

i think php should jump the boring 7 8 and 9 numbers, and jump right to 10 after 6

hahah

or even, PHP X

don't even
:P

php 42

PHP XP………..

PHP 1337

PHP Millenium Edition :'(

noooo

lol

i like the idea of wording the versions

like Ubuntu?

I found a solution Dynom
apache one

PHP Slimy Salmon

why php devolepers need to version php 6

mmmm sounds yummies
…. was that… english?

PHP Propostorous Pike

lol @ propostorous
Wet Whale?
Viscious Viper

all future php releases need to be named… after fish or reptiles

PHP Horny Hamster

:|
lol

though it's not a fish

nor is it a reptile

on a saturday it is,

I can't think of too many reptiles

PHP Cantankerous Crocodile

Cantankerous?!?!
lol

php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f admin@mail.here.com"
is there a way to do this in php rather than in apache?
ini_set doesn't seem to work with this

php amourus aligator
:/

anyone?

you running your php under safemode at all? if you are, you cant set any admin values

I'm not
but I did try to do this with php's CLI
and not through a webserver
safe_mode = Off

hmmn, doesnt stuff like that only last the length of the request? ie, once the page has finished processing, the ini reverts

any ideas why it wont work?
yeah
good enough for me
but it wont even work
ini_set("sendmail_path","/usr/sbin/sendmail -t -i -f peledn@gmail.com");mail("sdskjhklsjdksjhdkjsh@skjhdskjhdsksjhd.com","testing","testing","Envelope-From: nirp@consist.co.il\nErrors-To: nirp@consist.co.il");
thats what I have

headers to be seperated by \r\n, not just \n
*should be
and, does mail use the sendmail function? or does it just run a socket connection to the send to address?

it does
echo ini_get("sendmail_path")."\n";
after I set the ini setting
and it didn't change
any thoughts?

look at a phpinfo(); on your server, ini_set may be in blocked functions

lets see
ok
what am I looking for?

there should be, if its restricted.. a restricted functions list.. ini_set may be in it, just search the page for ini_set

nada

other than that, mail() has an aditional parameters param… so you can just stick "-t -i -f peledn@gmail.com" in that param
ie. mail($to, $subject, $message, $headers, "-t -i -f peledn@gmail.com");

oh seriously?
let me check

since 4.0.5 i think

kick ass! let me try
you own bizzeh!
thanks a lot!

weee :]

ok i'm trying to configure php with mysql support (–with-mysql) but i have to define where the header file is, which i cannot find i have looked everywhere
checking for MySQL UNIX socket location… /var/run/mysqld/mysqld.sock
error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore!

!+g6

Guideline #6) Don't flood/paste. = 3 lines constitutes a flood and you will be punished. This is your warning. /msg php-bot pastebin. Also /msg php-bot enter

do you have mysql running ?

yes

if ( htmlentities($result) == 'OK' ) { header("Location: ../result.php"); } — shouldnt that work ?

whats the socket localtion?

I hope not

it 's /var/run/mysqld/mysqld.sock
that it can find

lol ok what should i do ?

checking for MySQL UNIX socket location… /var/run/mysqld/mysqld.sock

and did you set the mysql path ?
–with-mysql

i tried all different locations but i don't know what to set it to

see the ./configure –help

what would work Wolfpaws ?

and you gotta know where your mysql path is.. you installed it

do you have mysql-dev package installed?
It depends on what you want

unless ofcourse your using the rpms and stuff. where your dev is seperate from the main directory

let me check

change the header statement depending on htmlentities($result) == 'OK' or htmlentities($result) == 'FAIL'
redirect to two different pages

correction… libmysqlclient-dev should be installed
What is $result?

Need to get 7363kB of archives.
After unpacking 20.3MB of additional disk space will be used.

xml output

Ok im going to install those

And where have you got the idea of using htmlentities?

i tested it with echo statements instead of the header stamement to see if it worked
yeah displays the tags etc
i needed to add that to grab the xml tags

Ummm… What?

it formats the xml doesnt it ?

thanks guys now it find's the mysql directory automaticly –with-mysql is sufficient

I hope not

hmmm mine does ?
it displays the xml with that and without it doesnt display it

That means you're doing something horribly wrong

lol woudlnt surprise me
ill pastebin the code i use it in

good idea

http://pastebin.com/m7aa637f2

"Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /var/www/index.php:7) in /var/www/login/index.php on line 11
http://pastebin.ca/633676 et http://pastebin.ca/633671

JiBeSh try putting session_start right at the top before anything
you see what im trying to do Wolfpaws ?

I can't see, why

http://pastebin.ca/634329
it doesn't work

what do you mean ?
jibesh before the require

ok

wolfpaws how should i do it ?

What do you get back?

etc or failblahjshjs/blahblah2jkdhjdhf/blah2/fail

i can pastebin an output if u want ?

so you get XML back. Pretty much o.O XML but XML nontheless… Then why don't you use a proper parser for it?

Comments

but childNodes[2] gives me a TextNode I know that the nodeType of a textnode is 3 while an element is 1 I was

should web sites have RSS choice?

What does that question mean?

different formats ?

Is there any way to detect back and forward navigation through in-page anchors? Like from #one to #two?

hello everybody
is there a actionscript3 channel on freenode?

anyone good with VB here?
I'm trying to see which Francesco Balena book to get

I do it by using an interval that watches the location.hash for changes

Woosta, ugh…I really hope I don't have to do that

no
you do :-D

are you sure there's no other way?

Yes

woosta, what interval do you set?
delay in ms I mean
Woosta, why location.hash?

hey everyone

MONO`, I'm not everyone, but hey

Is there a way to modify the request in the browser memory? (I am thinking of changing the value remembered for a field in the form - or adding a new field using javascript)

heh, what's up darkfrog ?

just dealing with the frustrating world of JavaScript.

you can add fields with js just fine, but you cannot alter "saved form data" in the browser memory (you can once it's in the field ofcourse)

what's the maximum GEt url length?

you think workin with Javascript is frustrating? try making a custom os that works on a lappy -.-

ok how do I add a field?

MONO`, via linux?

2083 chars in IE (which, afaik, is the browser with the lowest amount)

making linux via windows haha

MONO`, vmware?

no

I'm trying to add history and bookmarking support to a flash framework. :-p (http://www.jseamless.org)
I think I win. :-p

7zip, linux.tgz [file system], bzImage [kernel], syslinux.cfg [set boot options], syslinux -ma J: to make it boot, and edit.com
it boots to a black screen when it should boot to bash -.-

MONO`, http://www.linuxfromscratch.org/ :-p

i'm bored, do you expect me to read?
[anything longer than a couple lines =p]

reading is the best way to learn

dude like i said - i'm bored, do you expect me to read more than a couple lines? lol

I'm actually installing VMware on my Vista box right now….it doesn't like it very much. :o

lol

sry missed your question, you an add a field by creating it with the DOM and appending it to the form

crap…gotta reboot
l8r

like: var oInput = document.createElement( "input" ); oInput.name = "newfield"; document.getElementById( "myformid" ).appendChild( oInput );

but what I want is to modify an existing request. I have forwarded to a new page and when THAT page is refreshed the old form data is just submitted again. But I would like to be able to add a new field before that…is that possible?

sure, there are various ways to do that, easiest would be to have a server sided script (e.g. PHP) add the field

I use symfony right now (dont know if you are familar with it) and I add a field using the a setRequest method. But the field I add is gone when I refresh the page…then it's back to the original submitted form!

but ofcourse you can also add the field in the onsubmit event handler. it all depends on your exact needs (e.g., is the field fulled automated, or does the user has to fill in things)
I'm not into symfony, so dunno about it

ok, but right now my understaning is that when I modify the request using a serverside command, I only modify the request as far as the server host knows. If the user presses F5 (refresh), the original request is still send…

ah, I think I'm starting to understand the problem now
so you have a page where somehow additional data/fields is/are added which is lost when a user refreshes?

yes!

hi
if a user clicks anywhere on my website how can i alert a hello box?

I think you'll need some means of tracking the user and the field/data you add, so you add it again when the page is refreshed
document.onclick = function(){ alert( "hello" ); };
^^ though it's silly to do

hm, ok, do you have an idea as to how it can be tracked?

well… cookies come to mind if it's very user specific data (which doesn't need security), otherwise you could use sessions (which implies access to and knowledge of server scripting)

ok, thanks…I think I can quite easily create a session for it

Woosta i mean is RRS a standard for sites other than blogs too?

nice , good luck bonaldo

*RSS

Hi !!!
one question… have "LI class="inline"a href="#" onClick="javascript:changeCont('_2'); return false;"Data-1/A/li" … need not show url down.

You know if as3 bytecode content is as easily disassembled into as3 code?
bah, disconnected…

can i ask a question regarding compatibility of javascript between firefox and ie
?

f00zle why silly

is there any way to check my jscript code for browser compatibility?

install some brwosers, and check it

i already did that..but it doesnt help..that much
i run it on firefox and inspect it with firebug
everything is called properly
i run it on ie
and one part it doesnt work
idan can i give you a direct link to see the problem.maybe you can gimme a hint if you see what it doesnt work
?

debug it in ie then.

how can i do that?
is there anything like firebug?
microsoft script editor

u can use firebug in IE.

need not show url in browser… helpme, Thanks

http://www.getfirebug.com/lite.html
expl more.

have one url where call to javascript… need not show url in browser (bar status down-left)

why do you have urls with call to javascript?
javascript is not urls

"LI class="inline"a href="#" onClick="javascript:changeCont('_2'); return false;"Data-1/A/li"
(up is where call to javascript code)
(sorry by bad english, i am talk spanish

gpy thanks

window.status = "foo" ;

UserReg_CL "LI class="inline" onclick="changeCont('_2')"Data-1/li"

where set ?
mmm…

hmm, if I've done "a = new B()" how can I get 'B' from a?

Thank gpy and Gozzy
(hi from Viña del Mar - Chile)

gpy r u there?

a.constructor.name
(will not work in khtml, because khtml is broken)

can I rely on there being an a.constructor at all?

ofc, there's always a constructor.

actually I'm being thick
I'm trying to differentiate between null and a real object (since both return "object" for typeof) but I'll just check for == null

ugh, i can't remember the DOM property/function/whatever that returns the string made up of the text in a particular element.

yes, that would be the way to go.

GarethAdams, your you can just do (if ob) {…}
(where 'ob' is the name of the object)

of course

with a lisp syntax
if(ob) { } is what we do in js

that's not really lisp syntax

"almost"

it's closer to c

not really

lisp doesn't even have curly braces

I was talking about where you put ur freaking parentesis.
om*g

you can do if(foo){…} exactly in c, you can't in lisp

you'r not listening

now if you want to talk about js in general, then yes, it's more like lisp than c

(if ob) - was the origin of my remark
no the freaking curly braces

darnit, how the heck do you get the un-marked-up text that's in a DOM node

yes

which calls the same function, how can use 'this' to figure out which one I clicked on?

anyone? :/

hmm. i know there ought to be a way to do it, but i'm not sure how
try having the function do alert(this); at the beginning, just to see what 'this' actually refers to in that scope

it's "window object" .. whatever that is.

if (obj == document.getElementById('a1')) {…}

yup, don't you mean "if (this == document…)"?

function func(obj) {… if (obj == document…) {}}

yup, that's what I tried to avoid, using id's

a href="#" onClick="func(this)" /

aha

function func(obj) {… if (obj.href=="#") {}}

i was sort of close

)

I tried obj.style.font-weight = bold ..
which gave me errors..

fontWeight

well, "color" didn't work either so
it said that obj didn't have any style properties

am i really going to have to drive to work to get my DHTML definitive reference, just to find the DOM method to get un-marked-up text from a DOM node?

first, you need assign style to it

oh
it worked
I couldn't use 'this' inside the function..

coludn't

bah
I need id's anyway :/

hm, would it work if you did onClick="this.func()"?
and then referred to 'this' in the function?

this has no func()

so?
func = fuction () {…}
doesn't that allow you to attach func dynamically to any object?

but you can make scripta1.func = func; a2.func=func;…/script

is it possible to send a post to a different server using ajax?
(different than the one from which the javascript came)

chessguy_brb cant u get the un-marked-text by using .innerText?

how can i get the parent element of something?

.parentNode

ah, thanks

can anyone please help me trace a compatibility problem
between firefox and IE in jscript
?

shadowman, just paste code, link to an example and you're more likely to receive help
don't ask to ask for help

http://www.stratigoscostas.gr/catalog.php
select the third line
the problem is that the div in the right part of the page is updated in firefox…But it is not updated in IE. It is updated only one in ie but then it stops…
http://pastebin.co.uk/18749
this is the html code
of the photo.php file

Gozzy, that's not the method i was looking for. let me check

breakerfall…can you check it
please

shadowman, I can't access your site

www.stratigoskostas.gr/catalog.php
if you click on the third line
you will be redirected to the page that the problem occurs

what third line?

it has an underlined word
then another word
and another word
the third one
”¿º¹¼±ÃĹº¿Â

ok
have you done some trace debugging to narrow your problem?

i debuged it in Firefox..which is working fine.. As you can see i added the firebug lite
but i cannot debug it in IE

why?

for what I know is that all the functions are exucuted properly. The only problem is that the items () function is called (or at least is called succesfully only the first time)
i dunno

perhaps someone with IE would be better suited to help

ah, textContent

in firefox everything works fine…and is called fine
the crazy part is that the database queries are executed correctly
even in ie
i think that it has to do with the get.elementbyID('').innerhtml

uhh
get.getElementById ?
it should be document.getElementById
unless get is a reference to a DOM node

document.getElementById('checkout').innerHTML = ajaxRequest.open("GET", "showitems.php", true);
that's what i use
to throw the showitems.php results in the div checkout
is it correct?
anybody ?

no
the .open method doesn't directly return content
at least, not to my memory, hold on
yeah, shadowman, open doesn't return what you want

oh

let me send you pastebin of a standard ajax looking call, if you're using native js and no libs

yeaps..i am not using any libs
thanks breakerfall

shadowman, this is a standard looking request http://pastebin.co.uk/18750
old actually :/
note, ignore where it sets the href to javascript; - this is pretty old code hehe
unote, ignore where it sets the href to javascript; - this is pretty old code hehe/u
anyway, you call your open method, then you attach an event handler to the object
"onreadystatechange"

ok i am going to test it right now…hope it works
breakerfall
it says:xmlHttp is not defined
items()photo.php# (line 172)
onreadystatechange()

shadowman, xmlHttp is my XHR object
the equivalent to your ajaxRequest
so you would replace xmlHttp with ajaxRequest

ok got it..silly me

never simply copy and paste code without understanding it :p
ask if you need it to be explained further

breakerfall
i did it but nothing happends

well, it happens asynchronously

http://pastebin.co.uk/18751

so the rest of your code is going to run, before the request has finished
so in all likeliness, you will need to make your script wait until the ajax call was successful, before continuing

breaker fall i use the ajaxRequest.onreadystatechange = function(){

ok, then perform the rest of your tasks in that function
only if (xmlHttp.readyState == 4 && xmlHttp.status == 200) is true

… ?

bosie, as a property, or using getAttribute

i thought so too, but its always saying "undefined" ?

document.getElementById('mylink').href;
or document.getElementById('mylink').getAttribute('href');

yes it works on href but not on bosie
if i set it myself (setAttribute) it works

well, use valid attributes

hehe yea well the idea is to pass information on from rails to javascript …
without using an array

use JSON

yea yea

Or declare your own DTD and convince MS to understand WTF you're talking about

speaking of DTDs
I was thinking of using DTDs for creating multilingual goodness
would that work cross browser?

MS ignores custom DTDs

you know, defining multiple DTDs for each language, which contains defined entities, then calling each specific one based on lang
uhh
even IE 7?

afaik
I can't imagine they'd allow custom DTDs and not understand XHTML

that kinda blows
well, it really kills that idea of using them for multilingual sites anyway

Can someone give me a reminder of IE7 supports :hover on any element
*if*

Hi, I am using a function call on an mouseup event
its looking like that:
document.getElementById('com_link').onmouseup=updatePosition;
I would like to give a layer name as parameter to the function to call

updatePosition('foo') ?

is it working, i dont know?

what's a layer name.

lets say, messageBox

id?

yes id

why would you want to do that?

I want to use the same function to multiple layers

you could just use "this" anyway

yeah

how?

Byron, could he call "this" in the function since its onmouseup, or does he have to actually specify the parameter with (this)
in function updatePosition() { var layername = this.blablabla ; }
could he do that?
psh, i still dont know what hes referrin to when he says layer name

dono

na, thats not really want i want.
I am using a script to move a layer

what's a layer.
link?

there are more than one of these layers
hey, are we here in kindergarten or what?

they cant all have the same id

..

layers are div tags my little follows

Eh?
no they're not.
are you using Dreamweaver?

_Byron, no they cant

little fellow?
Layers being called divs is 1990ish i believe is it not?

theGZA, No, I am writing my scripts by hand

use modern terms.

squitta, your using dreamweaver?

no

don't use 1990s terms
you're moving elements around in the web page, yes?
not LAYERS

theGZA, how are they called today?

dont call them LAYERS

containers?

elements?

do you know what an element is?

if not, im out

or well then i have a couple of elements which can get moved
and I want to have a small element showing theire positions
Now I am performing the update as soon as i let the left mousebutton go

This would be 200x easier if you linked to the page.

theGZA, what does that mean if i linked to the page?
You want to have a link to the script?

try putting an alert(this.id) in your updateFunctino

yes ok, I think i could get you now!
_Byron thank you very much!

eh?
lol that it?

I checking back, and then I am going to tell you compangeros!
_Byron, no, it did'nt work

hmm so you need to pass the element to the function

yes I am trying

document.getElementById('com_link').onmouseup=updatePosition(this)?

_Byron, okay it was very easy now )
document.getElementById('com_link').onmouseup=updatePosition('test');
this was working

that will not work.
you'r calling updatePosition with one argument 'test' and assigning whatever returned as the onmouseup handler.

fatbrain so where will the problem apear?
appear

?

we really need to know what your trying to do, as theGZA was pointing out

Mh ok, in my case it just does what I want
Yeah, I had an very brand knew idea, i guess its not found anywhere allready

I bet it is
search harder.

so i decide to swallow about it?
Or shall we make it a commercial product?
oh mein gott!
weltschmerz Du arme Seele!
but you people can check out the website, http://www.ejackup.com
Please tell me how it is in IE or use a mozilla firefox
But only members can see the script
so simple is that )

does anyone know if the onload event fires for image objects?

make a script section at the end if the page
and perform the function call from there

that doesnt really answer my question

yes its true
just try
I shortly figured out, that even onclick is working on the body tag, which can be really something very cool!

lol.
its not the body tag
its an element
and onclick works on any element

false = 0; - true
false = null; - false
why
==, i mean.

eh?
shouldn't it be =
not ==
argh
yeah..
== is the comparison, = is the assignment

is there anyway i can check if an image hosting object has finished loading besides setTimeout etc..

duno

i was hoping image.onload would fire

it does/

just seems to fire whether the image has loaded or not

eh, the question was why false == 0 returns true and false == null returns false

arg this is frustrating

null is the only special case.

What's a forum ?

what the!

fatbrain what's a forum ?

: learn to google

A forum is a whole site ? or a section of the site e.g. Discussion , Movies , Problems etc. ?

http://www.google.co.uk/search?q=forum

http://www.answers.com/forum?cat=biz-fin

how could i get something like this ( http://img368.imageshack.us/img368/3236/flotantescentradosfp3.jpg ) using css ? (setting the floating element in the center, from the main)

is indexOf a ideal way of checking the presence of 'foobar' within a string?
!== -1

sure.
as in "yes it is"
and settle with != instead of !==

hey everyone

please. how could i get something like this ( http://img368.imageshack.us/img368/3236/flotantescentradosfp3.jpg ) using css ? (setting the floating element in the center, from the main)

Please dont repeat the questions.

try #css

also, try a different channel, since it's not javascript.

lol.
Is your container fixed width?

… in #css nobody help me -.-

Nexus
go to #css
ask them to unban theGZA
and ill help ya there

not a good enough reason to bring it to ##javascript.

XD #javascript is about programming

lalala

yeah, asking them to unban theGZA will be futile, and bringing channel issues to other channels is usually impolite

gpy, really ? XD

Nexus.
is it fixed width
answer zeh question gawdammit

i cant understand what Nexus what despite the nice illustration and all

Nexus fails at getting help.
Ignore time

Nexus fails communication.

rofl, yeah

answer my mother fucking question that i fucking asked you right above do you fucking speak english ))…
dont fucking … me

hahaha i dont understand nothing XD i speak spanish =p
wait a minute, translating………………
:P
hmn.. ok, gpy thx…

Ok. do you want to center something? do you want to float 2 elements?

wtf?
what did he do lol

mind your langauge.

this is just because there is a very nice spanish cheese i use to buy.

thank god.

baha ok
hmm.
1, use the backend to spit out a #id on the body tag, read that attribute with the current framework tools, and use that to determine what category im browsing, or: 2, i use native js to indexOf the url.
:|

Wow.
http://www.cleanishappy.com/

the above was a question, reuqest for pointers.

1.

why

Cause stone cold said so

not a good reason enough.
location.href.indexOf('category/javascript') != -1
//true
thats a oneliner to determin what page im at.

determin what page your on?!

and of course i just wanna spit the related links to the page.

oh my…

oh my at what

im playing with my personal blog, not ready, etc. i use the del.icio.us JSON api to get my links as an object.
that object is an array of objects, urls, descriptions,etc.

ok… whatever floats your boat man :P
I try to keep my websites alive for non-js-clients as well

i can spit those out, np, but i get them ALL, i dont wanna show js links on my css pages. etc.

I also try to keep em "cool" enough to work with the text-based clients.

so, i was thinking of spitting stuff relative to what page im on.
text-based. :| bah.

text-based only when the content "may" require that.
like for a website like wikipedia or a online newspaper then it should be handle text-based clients.

yes
but my personal host blog is no newspaper or wiki :P
and its just my shitty links
=D

no, I bet that's the reason you'r not putting extra effort making it work with text-based clients :P
some text-based clients support javascript host tho, and that's nice

wich ones?

elinks and some other which name I dont remember
elinks gets the javascript support from spidermonkey libs

ok, well, thats 0.00000001% of my visitors.

indeed.
making it not worth the extra effort
I'm off, shower and some beers
have fun peeps

hm, ok.
se u.
im having an lasanga
and writing js, while u are out drinking beer and stuff.

q!

:P

err
:wq!

JsonML anyone?
http://www.ibm.com/developerworks/library/x-jsonml/

Hi, is there any way to get something like a backtrace fom a JS exception?
aka the callpath which caused the exception

utf-8 text output from php to screen through JS shows ????

but childNodes[2] gives me a TextNode, I know that the nodeType of a textnode is 3, while an element is 1, I was wondering how I can make it so that if the node type doesn't equal 1, it should move on to the next sibling until it is 1 and then alert it.. anyone?

So far I have… var second = ul.childNodes[2]; while (second.nodeType != 1) { second.nextSibling; } .. but thats making it go forever

\o/

You are confused by geckos whitespace nodes?
Use ul.getElementsByTagName('li')[1]

Can you still find a way of doing it with childNodes and checking the nodeType?
I'll use your method, but I'm still curious as to how I could've done it that other way

Yes. But why would you?

to learn.

Is there anyway I can sort of hide a div until the onload script shows it, but without making it hidden using css?

generate it with JS, but don't add it to the dom until it's ready

but then it will never be there if the user lacks JS support

e.g. document.createElement then later when it's ready el.appendChild
Well why are you trying to hide it in the first place?

_Byron, hey you have been right with the this.id thing
I just had to change back the function call to a document.getElementById(element).onmouseup=updatePosition;
and give the event handler as parameter to the function
liek
function updatePosition(ev) {

if there content is there without JS, then why not show the div and progressively enhance it?

then this.id was returning the name of the layer

*the content
or how about using JS to remove it first thing before doing anything else?
el.removeChild could be the first thing in your onload script

has anyone ever had an issue with IE and insertBefore?

Grr, silly Google maps API

oh?

well it's not stupid
the only problem I've actally had is that the map can't initialise itself properly if it's not visible

does anyone use "for-in"

Hrm, anyone know if you can have multiple networks open at once with miranda-im irc-plugin?

thats a js q?

If you can't determine if it was or not, then you probably shouldn't use a computer. :P

webben, I hide it now onload… but you see it like 0.2sec before the javascript is loaded.. and that's what I try to remove :P
webben, nothing serious, just me being pedantic

nothing wrong with beeing pedantic

hello

Hello lnxnt

Script Debugger

I think there's a "firebug for internet explorer" than you can download somewhere
(havn't tried it myself so proceed with causion)

hi there !

Don't you have to embed the script in the page itself?

what is firebug good for?

fatbrain:I don't think its a regular plugin
firebug is great for debugging js

the internet explorer developer toolbar?
hehe, I just googled for ie crap and that's what popped up

uncheck "disable script debugging"

i'm triing to make a script that makes animated tab menus (animated, i mean that i want to slow motion the height of my dropping tabs…)

I dont really bother much for IE, I write my scripts for Mozilla / Safari, and just try em out in IE, usually they work just fine

dut it doesn't work ….

I'm off, drunk on wine, need to play some guitar hero 2 before I pass out

I unchecked that

http://rafb.net/p/U7X5fR50.html
that is my script ….

psh
uhm
why do u have return function() { }

i want something like … http://www.apple.com/itunes/ (tips,downloads) menu

is there a point to that?
hmm
right side?

well i was thinking that will return my function content into the settimeourt (first that was in the incr; calling funck)

oh left

this is my first version … http://rafb.net/p/wWlLnZ53.html
it is showing … but …. not slow enough

use Strict dtd at least man
pspad sucks if its generating that
… IN WEST PHILADELPHIA BORN AND RAISED.. PLAYGROUND IS WHERE I SPENT MOST OF MY DAYS

any ideeas?

how do you test if an element has focus using javascript?

"Minnesota, born and raised. The library is where I spent most of my days"

me is back

Romania, born and raised. The f***'n country where I spent most of my days… :|

LOL

…is still loading the link for the thing I posted…

http://hb.lycos.com/hb.js
check that out

You can set some var, like "activeFocusElement" with the onFocus event.
so, onFocus="activeFocusElement=this.id;"

http://www.current.tv/community/thread/19330642.htm?start=21 CurrenTV is the s**t.
look at post #40 for the song

thanks BradleyB

wow.
Ratatouille is going to be an ownage movie

…what?… why would you say that?

apple.com/ whatever
http://www.apple.com/itunes/
trailer below
damn

I require to use javaScript variable for storing html code which contains "
What is the escape character so that " is understood to be part of the variable?

\ ?

you can escape it with \ or you can try to write "string" + chr(ascii code of ") + "string"

What is the escape character so that " is understood to be part of the variable? Sorry got disconnected

you can escape it with \ or you can try to write "string" + chr(ascii code of ") + "string"
cstextile1

Got that Thanks

** solved my problem too. my question is no longer valable

Actually I have PHP Variable which has the HTml code and now I want to echo in the form of javascript code i.e. echo 'var a='.$output. Is there any PHP function which will take care taht no problem is created

maybe you are thinking to
addslashes($output)
also you can try echo 'var a=\"'.addslashes($output).'\"';

Thanks Again
Ya I read this http://in.php.net/manual/en/function.addslashes.php

hewn you are askinking / programing php, try #php
***kewn === when

Ya I am using that channel but actually I had JavaScript question and then again I had some doubt so I asked PHP query

what's your take on ajax based components in UI frameworks like struts and JSF?
I'm not very fond of them because I perfer to write the JS myself
it's a fun language

But it is better to use such framework as they take care about Browser issues

I guess that
is right
but I also find I can do more creative things writing it myself?

I'd imagine afaik (or whatever library he's using, if any) does too ;-)

yep.. I have about 6 years of js experience… I pretty much know the quirks, the work arounds, using object detection, etc
plus, we use jQuery

Which one is better jQuery or Prototype?

define "better"

I like jQuery as it's more lightweight
I think prototype is bloated and it modifies the behavior of core js objects in ways I do not like
but you'll think prototype is the best thing since sex if you love ruby with a passion, because it essentially turns js into ruby

insin:I mean easy to use & less browser related problems

(i.e. me gusta)

jquery is better

does anyone want to take a look at a web project that I've been working on for a few weeks now, but haven't yet shown anyone? It's not done yet, but I'd like to get some feedback from someone.

sure if you'll give me feedback on mine

I'll take a look

http://www.telparia.com/solitaire/

Invalid argument" for statement "myb.setAttributeNode(myb_color1);"
in IE

they're both easy to use and they both take care of the common browser inconsistencies for you

it works fine for firefox

woah cool

http://andrewdupont.net/2006/05/18/javascript-associative-arrays-considered-harmful/ (it's an interesting article, anyways)

does it work for you?

yeah works in FF

I used for something in something_else… and of course that didn't work

I've tested under all browsers, and it works in all, just never tested anywhere other than my machines
what do you think of it? any good?

associative arrays?
you mean Object?

yeah pretty sweet, playing it now
whatd you do it for?

It's not done yet, doesn't handle resizing the window while playing, no options, different decks or other games built yet

oh.. prototype's dumb assoc arrays

I did it for fun

yeah… add something to the language that it already has to an unrelated object
sheesh

haha nice

nope, not prototype's associative arrays… people using associative arrays (hashes as an array) and javascript not blocking them.

what did the 37 Signals guys think was wrong with just doing something like var stuff = {name:'james', age:22, FooBob:33};

any feedback? Anything look wrong/ugly to you?

nope works like it should so far, gonna see if i can win

nothing… they just added properties and and using a for loop or an associative array (bad hash) like many people do does not work with the extensions to array that prototype adds

I plan on implementing some crazy cool animations when you win, but right now all it does is say 'you win!'

oh yeah… js Array can be used as a hash because it prototypes Object… but the behavior is inconsistent

what are you gonna do with it?

it should still work if you use hasOwnProperty

it's pretty . (I'm still loading- on dial-up)

you knwo what would be cool, to make a shit load of games, and sell ad space like on the cards

it's actually just about the misuse of Array instances as mapping

Going to finish it, add more decks, more games, and just announce it all over the place for people to play

lol, yeah

people could advertise at like 50% opacity on the card

sorry about the high bandwidth you need, it's only during loading, after that you should be good. I did it so you can have pretty cards
nah, I just want lots of people to play and have fun

that's fine

ads would ruin things

yeah but it would give you money :P

firebug doesn't work
I just installed the extension but when I click open firebug or open firebug in new window nothing happens

did I kill your net connection? rofl

You prob. need to enable it, lnxnt.
Click the firebug icon, and add the site to the allowed list.

nope, it was just my brother. I have our dial-up across two laptops with ad-hoc wireless. He's on windows and I'm on Linux, lol.

ahh hehe
Thanks for trying it out, I appreciate it. I'm glad you don't hate it

allowed sites and nothing happend

sure sembiance, let me know when you got more
i'll show you my project in a min
not as cool looking

I have less time now a days because I have a girlfriend (my first one ever, got her about 4 months ago) but I'm finding a good balance between code and girl

haha nice
i have to balance two lives… college baseball and coding

it's a good thing that you're not treating her as an object, or anything

they dont mix that well

show us a photo

no.

horny fuckers.

lol.

http://www.telparia.com/yosemite/

no no

Thats odd. Try clicking the green checkmark on the bottom right

I'm a girl

ooo.

ah

I know the 'got her' thing sounds funny, but I didn't mean it that way
uI know the 'got her' thing sounds funny, but I didn't mean it that way /u

lol

I don't think I could ever date a JavaScripter of the opposite sex.
Too much competition.

Me either. I hate javascript.

she doesn't code

mmmm!

(actually I probably could)

*smooch* :P

did you see the pictures okay?

I use my athlete status to get girls, leave the coding side for the 3rd date or so :P

nice
thanks You are a cute couple

thanks It's the first relationship for both of us. We met through match.com

I think the disconnect stopped all transfers… I've been at 24% for the past like 10 mintues
minutes*

ahh hehe, yah, I might have to look into fixing bugs when your net connection drops during the loading

stop smooching

Okay, okay.

you can help debugging my script instead

luckilly that's just preloading images, so if you refresh the page it should kind of start where it left off

well, the idiot trying to play the game should just reload

BradleyB:

hey Sembiance
found a glitch

Make sure that firebug is enabled, and the site you're debugging is on the allowed list.

?

one of the 3 showing cards in the deck stayed flipped over

Perhaps try to restart FireFox

oh, that's good

only happened once

so you hit deal and it moved three cards over but one stayed upside down?

probably didnt fire the flip event or something
yeah

Also, try calling "console.log('your message here');" in your JS, it should log to FireBug

k, I'll put it on my list of things to fix. thanks

if you can find it
like i said it happened once so

hopefully it won't be too hard to track down. I'm doing a lot of animations and I kind of just expect them to work, so if they fail I'm pretty sure I don't handle it correctly and try again or skip the animation and just swap out the card. I'll take a peek
did it load up for you yet?

I had to load from the begininning

yes, but the first 24% should have went a lot faster

it's a 19, but if the game's half as good as this loading screen, then I'll be happy
at*

I never tried it in low bandwidth conditions before. Let me know if the percent complete continues to stick or if it goes up
hiya

'lo semb

you have to understand that I'm probably only downloading with 14.4kbps, it's a 42.2kbps dial-up connection across ad-hoc @ ~1mbps with lots of inconsistent packets
yup, can do.

Want to take a peek at a web project I've been working on for the past few weeks? It's not done yet, but it's working enought that I wanted to get some feedback from some folks

mmm, k

http://www.telparia.com/solitaire/

is it right to install firebug as an extension? Maybe it is also a standalone program and I don't know that

no, extension is good. firebug is yummy

the standalone is useful for browsers that aren't Firefox :p

did it load up okay for you? do things seem to work okay for you?

yeah
the background looks like a floor, though
a floor far underneath the cards
it doesn't look like a wood table

I just grabbed whatever pattern I could find on the net that tiled well and looked somewhat nice
bI just grabbed whatever pattern I could find on the net that tiled well and looked somewhat nice /b
it's far from finished. I'd like to support additional patterns and custom ones (you just enter a URL and it uses that, either pattern or wallpaper)
but that's a ways away on my to-do list

yeah, heh

anything else you think is stinky?

REEESIO
hm
wtf is this poker thing
OO

not really

Damn nice lol

you think once it's finished people will use it? My goal is to have people play it and make people happy

im already using it
lol

are you speaking of my solitaire page?

probably - there might be more motivation if you keep stats or something

Yeah.

with this particular solitaire it's not exactly as much about skill :p

score board

but still

or whatev
;p

the images seem to be distorted, is that by design?

aye, I can gladly keep stats, but cheating is very possibly as this entire thing is offline capable, so the client is in the hands of the enemy

cheating is always possible

I have on my to-do list to improve the card images. Right now they are scaled to give you the biggest sized card for the screen, but that results in some icky looking cards in some resolutions
having nice looking cards at multiple resolutions is a big goal of mine and I'll be working on that some more

~[ Sembiance ]~ once you finish this you should use your skills for something productive, either make life better via opensource or make some cash baby

do you like it?

yes
im playing it now
theGZA is almost never impressed
but this is impressing

hehe thanks

oooh…. oooooooh… it's pretty… but one of my cards didn't load… probably dial-up

it's not done yet though!

how in the world do you even start coding one of these things?

yui

whats so special about yui

and I how do I flip the cards from the deck? Click them? It's not working in Konqueror (it might work in Firefox, though)

widgets

hm?

i dont use YUI, but i know its basically a bunch of set of widgets

hrm, it works in konq on my system, but I'm running the latest version of konq. Yah, clicking should flip three from the deck

ahh… wait never mind; I think that I just needed to place a window over my K window

I designed it so it will be very easy for me to make more solitaire games in it, my goal is to add a LOT of them
Next I'm going to work on getting additional decks up there, and making it so you can choose between 'Nicer Looking Cards' or 'Larger Cards'
Not sure which option I'll have be the default
anyways, thanks all for the input

argh
i'm stuck
hmm what can i move

i lost too

lala
whats up

nice
i'm almost done
fuck shit
now i'm really really stuck

I have on my To-Do list to implement some really cool 'Win Animations' so you feel really good when you win and get rewarded, but I haven't done that yet. So right now it just says 'you win!'

i came so close
fuck.
son of a bitch.

im telling you sembiance
you should get some sponsors, you could give away coupons to winners
keeps them playing

Right now if you want to start a new game you just need to refresh, but soon I'll have a 'New Game' option or something so

and then advertise on the cards
won't ruin the game
and you could bank
do it or im stealing your code.

Maybe on the empty space at the bottom of the wood

;P jk

I need a black cover 2
Fuck!!!!!!

which you eventually cover up with cards

right now I'm not thinking ads or money, I just want to make people happy and have people play it. I also want to make it the best damn thing I can (lots more game types, decks, features, etc)
So far you folks have racked up 27 plays

I see. Just a thought, I dislike ads myself. I'd rather absorb the hit on the materials and take the time to code it correctly

I don't ever plan to advertise on it

even better

hmm freenode…
:P

sembiance
http://img168.imageshack.us/img168/250/almosttp3.jpg

so I was nervous showing people, I was afraid they would be like 'dude, this sucks, why did you even bother' but I've been pleased with what you folks have said

can i make a move?
lol
i'm stuck

How is it working?

sembiance?

you look like you've lost

Sembiance makes some cheatcodes

on my to-do list is to detect when it's impossible to win and inform you

well, that's because it's awesome

alt+iwin

Also on my to-do list is some additional menus such as 'Cheat'
but maybe that's hidden or something, dunno.

make an RPG
make Halo Browser Edition

rofl
you drag master chief around? rofl

$('#carbine').each( function() { shoot(bullets); });

LOl
No
I have the greatest idea ever
Make a porn one
Hell yes.

fuck y eah
hella money
GREEDYNODE FOR LIFE

well
you'd have to have 2 versions
1 for males, 1 for females
the default is for males
censor all the penises

4 versions

and then show big tits on the queen and shit
rofl

male, female, soft, hard

i dont know
:p
Fetish.. Non fetish

how can I know the display value of an element?

innerHTML?

.value ?

oh
no

input.value ?

no no no

.firstChild.nodeValue ?

so you had mentioned that you wanted me to look at something you've done?

sure if you'll give me feedback on mine

obj.style.display

the display value… I mean, if it's set to none

value ATTRIBUTE?
O

or it is actually displayed

wymetyme
did u see my screenshot
can i move anywhere?
i'm fvcking stuck

the display value which is changed by Element.toggle

dont wanna restart

didnt look hold on
Goetmet

http://img168.imageshack.us/img168/250/almosttp3.jpg

are you using any libs?
jquery?

prototype

oh
prototype
var display = $('element').style.display

oh

"a" at 71.6.194.243 pasted "t" (1 line) at http://erxz.com/pb/3482

tthanks

~[ Sembiance ]~ gimme a min and i'll show
just a weboffice app for my job
not nearly done

"YOU ALL SUCK" at 71.6.194.243 pasted "MONKEY BALLS" (1 line) at http://erxz.com/pb/3483
"YOU ALL SUCK" at 71.6.194.243 pasted "MONKEY BALLS" (1 line) at a href="http://erxz.com/pb/3483"http://erxz.com/pb/3483/a

*errors
*MONKEY
fuck
can't even make a proper joke

its ok.. jokes aren't really appreciated here anyways

I sure don't appreciate them.

i just uninstalled vista on my new laptop
vista + dell bloatware == slow comp

true

well, I'm off to eat some pizza with my girlfriend, later everyone

is here some inuindo in there?

lol. nice, adidos

*there

(whoops, I thought I was in #ruby-lang/ #rubyonrails)

i figured you were just adding to an array in php

in irb (interactive ruby) if you typed that (something == something else), you get a return of true, and returns are always prepended in irb with '='

so if I define this.variable = 1; in some function foo() { … }
i can't access that variable outside of that function, ever?

you could
foo.variable

foo.variable?
heh
wierd, doesn't work here

you have to make a new instance of foo

Oo

myfoo = new foo;
myfoo.variable
i believe

var foo

* var myfoo = new food
dammit
foo

baye

hey everyone

guys, how can I stop a javascript execution?

remove it

in what?

I need to make a javascript script stop at some point of the script

why

what do you mean by why ?
the reason?
that's the way I design it to work basically
but I am missing that function
it's just a validation scritp
do you understand what I mean?
oh break!

ye

return works also
long time not doing anything with javascript

is there a way to findout actual image size from javascript
?
i have http://my.server.com/someimage.gif
is there a way to get just the width, height of that image?

w = document.getElementById("img").width;
or something

with a javascript?

yeah
google add contents to select with javascript

Oo
great
but what if that image isn't loaded in the current page

then you cant access it iwth javascript

hehe

yes you can.. I don't remember how

you could maybe check it with an ajax query

hmm
mmk

foo = new Image();
foo.src = http://my.server.com/someimage.gif ?
w = foo.widht
?
that might work perhaps

That should be the width defined by the img's attribute
not the /actual/ width of the image in its file
nor the actual width it's displayed at
(which would be affected by CSS)

you are gonna have to use a serverside script to get the files real dimensions im pretty sure

w = document.getElementById("img").width;
works fine
..height also

sure .. if the width is accurate, there is /no/ guarantee it is accurate however

depends ofc on how accurate one need it to bee

could anyone please help me, i think this is right but it doesnt work onclick="var compra=document.facturar.articulos; compra.options[compra.options.length + 1] = document.facturar.cod_ser;

i have only done that for scaling down or up images in a viewer ince
once

work if there is an external script imported?

do a function and call it from onclick

ok

is loaded an event handler for DOM objects?
or only the page itself?

j,
hm

onload is for the page itself

cool, thanks
um

dom becomes ready earlier

is there a javascrip debuger for IE, alike Firebug?

u can run firebug in IE
google for firebug lite

Oo

not 100% of the firebug
but u get the console
and can se what your stuff returns

firebug light is nothign like firebug
it doesnt throw very descriptive errors

something else about it, it still doesnt work

for the error problem, install a debugger, such as MSE:

you can log to it and se what your elements and objects returns, its useful

`js mse

install the Microsoft Script Editor to debug in IE: http://erik.eae.net/archives/2005/07/04/21.49.50/

that script editor is kinda whack.

ofcourse
its for IE
it HAS to be whack

there is a pay ware firebuggish thingy for IE that seems good.
cant rememnber its name now

is that the thing that displays line # and char # where there is error?

but it was 100 dollar something

function add_compra(form){
form.articulos.options[form.articulos.options.length + 1] = form.cod_ser;
}
onclick="add_compra(this.form);"

it shows you the line

uea
yea
and that's all
heh

and tells you the error message
that's a significant hurdle, considering IE often tells you the wrong file

hm
well
width: "900px",
Object Required
wtf

using MSE?

yea

have you changed the page?

well yea
and reloaded IE browser a couple of times

anybody?

page works fine in Firefox
heh

i found the error, i missed the important part
form.articulos.options[form.articulos.options.length] = new Option(form.cod_ser.value,form.cod_ser,true,false);

whoa, so many options

hey guys what if i want to set a option with an space i mean can i do new Option(form.cod_ser.value+" "+form.cant.value,form.cod_ser,true,false);
?
how can i concat strings?

tag

or the whole page?
MSI debuger that is

i am a a php programmer and need to be able to add and subtract forms on the page. Any links to tutorials and where should i start learning javascript?

http://xrl.us/h82h

thank you

you're welcome, my pool of knowledge is unlimited it seems

work if there is an external script imported?

first dont put javascript in the href
a href="#" onclick="yourscript"
is that function in the external script?

eh?

eww, href="#"
use a button

that bitch put solitaure down
im pissed
down for updates

yes
it is in an external script

input type="button" value="Do something" onclick="doSomething();"

then you have to style the button :X

yeah, if you want it to look different, of course

~[ owlcat ]~ you ask how to make it work? I dont understand exactly what you mean.. to make the function fire onclick, then do what either I or deltab said

w u g

cool, thank you.

why can't you kill the onclick attribute
?

what do you mean

document.getElementById('foo').onclick = function() { dosomething; }

much cleaner.

oh
yeah you can do that too :P

onclick ATTRIBUTE is gay

what goes in the value, theGZA? The script location?

did you ask him?

No
it doesnt have to be input

that value is what the button says

it can be any element with an ID

like "click me"

right
most use "submit" as the value
depends on what it is

Oh. Cool. So, theGZA, what I want to do is have the function stored in an external script, linked by a script type="text/javascript" src="script.js"/script, not have the function inside the link.

rrright
so then put it in external

ok

and dont forget to add the event handler after the document has loaded, or the dom has loaded, whichever

theGZA, what is that?

onclick ..
that's the event handler
it won't work if the document hasn't loaded or the elements/dom tree hasn't populated
Can't you feel teh love tonight -_-
laff

hey guys how can i check if a var is numeric?

is_int ?
err
numeric..
hm
typeof ?
if (typeof == 'integer' ) ?
err, number
rofl

seriously what can i use
okey it worked
but i have a problem, if getting the var from http how can i cast it to integer?
document.form1.cnt.value

hi
I'm trying to create a small script for the greasemonkey extension for firefox, and I'm trying to remove the 'referral' part of all links from a page..

so how can i cast a value to integer

the problem is that the 'referral' part has a post id and a thread id that change.. can I use a regular expression in the .replace(str,str2) method
ah, nevermind — I found a simpler way to do it

if(typeof(Number(form.cnt.value)) == "integer") why is that not working?

what is Number?
parseFloat(form.cnt.value)

parseInt too or not?

i think

it keeps saying not number
if(typeof(parseInt(form.cnt.value)) == "integer"){

alert (typeof(parseInt(form.cnt.value)))
see what that gives

damn it was number
damn, the problem now is that even if i send text it will say number

do this
if (!isNaN(parseFloat(form.cnt.value))) { // was a number

so cool, thanks a lot

np

will that work for if(!isNaN(parseFloat(form.cnt.value))0)
?
how is shell debuggin shell for firefox?

0) {

oops

0) {

quick would probably be

0) {

i used indexOf

I don't get what you're trying to do
how can indexOf replace what wymetyme's code does?

anyone here got experience writing jquery plugins?
O_o

#jquery might exist

it does
no1's anwsering :P
everyones asleep i think

im 'johnresig' on aim ;p
nlogax should be active in #jquery
guy practically lives there

lol

Woosta, are you on during week days?

yes .. I'm here 100% of the time

really.
hmm

well can someone have a look at this, im all confused, i think i need to make a global array and store all my image objects in there… http://pastie.caboo.se/76983

time
Mm
time

4, Baghdad: Sun

`js time

Mmm .. that machine needs ntpdate running on it :-D

4pm in la

yup
that's what it will give once I run ntdate
time
heh
time

6, Baghdad: Sun

Died when the time changed to the 'future' .. decided the server had gone away I guess

heh

Any major areas around the planet I'm missing that can't be easily inferred from those?
Mm .. should change the order to start at the IDL I think
time

9, Baghdad: Sun

bah
rehash

OK

time

syntax error at (eval 1005) line 8, near "'Asia/Baghdad'
… 'London'"

BAH
rehash

OK

time

9, Los Angeles: Sat

nearly there :-)

nothing between 8am and 1pm .. maybe I need NZ in there
hawaii

imho it should be the reverse order, but that's probably just my north-centricism

more likely to be your americentrism
time

3, Hawaii: Sat

I'm not American, but I am used to seeing west-to-east presented left-to-right

ahhh
where are you?
I can see an option to post it in that direction so that the numbers 'increase' .. but instead I've gone with the daylight :-D
time Australia/Melbourne

Time at Australia/Melbourne: Sun 13:17

elements ?

Done.

or does it have to be between head

sure
Nup, can put it (almost) anywhere

oh, fine
thanks

UK

Surprised you didn't want me to start at greenwich then :-D

I consider the Americas, Greenland and Iceland to be west of me
so from the IDL, east around to the IDL again

i want to create rows of same of data in form at the click of a button
initially there will be one row.. but on clicking the button… another row will be displayed
the form elements will be mapped to JSF Bean
how can i do that?

hey guys, i need to execute a js function just before i submit a form, will onClick do it for me?

onsubmit
oon the form

ok thanks
it didnt show the alter msg before the submit

alter?

alert?
:P

arlet?

lol
yea i ment alert

ment? mint? mont?
`paste @ jmoncayo

paste: Paste links, not code: http://erxz.com/pb/ http://pastebin.parentnode.org/ http://paste.css-standards.org/

what element are you assigning the onsubmit to?

"jmoncayo" at 71.6.194.243 pasted "i want to execute this before i submit the form" (8 lines) at http://erxz.com/pb/3485

does it looks good?

no :P

damn
whats wrong

paste ur html
your "form" i mean

heheh
there's no .concat() unless you're using VBs :P

"jmoncayo" at 71.6.194.243 pasted "the form" (10 lines) at http://erxz.com/pb/3486

result=compra.options[i].value+"!";

i found that .concat on a js web
and it worked before

hehe
is not built-in, so, must have been a custome method

are there any built in js methods for merging arrays

ok

well
there's a .concat() but is an array method
not a string one

ohhh
anything else beside it?

a=[1,2,3]; b=[4,5,6]; c=a.concat(b); c.toString()

1,2,3,4,5,6

everything else looks ok

it wont alert me

that means is something else
well… paste your call to the function
or the relevant markup and js

I have a text file on my server. Any way I can use Javascript to save the file onto someone's computer?

lol

i already did paste

well
that's not it then, it should

whats this textfile for ghhhty

http://erxz.com/pb/3486

It's a story.

couldnt you just use a cookie

no dice, no access to write a file by design

Because if I link to it, it simply shows the text.
I'm trying to make the the save dialog show up.

force mimetype?

yea

Alright, I'll google that

force the MIME by means of Content-Type http header served when the specific file is being clicked/requested

or just use different extension (one that isnt supported by default by everybrowser)

Alright., thanks

..

?
I said thanks

so, you have a typo on either

always a typo

damn
thanks a lot

no problemo amigo

muchas gracias

de nada =P

hey little problem else, it alerts true! but no the value

well
you had a wrong .concat() before ^_^
what's the function doing anyhow?

"jmoncayo" at 71.6.194.243 pasted "the form" (8 lines) at http://erxz.com/pb/3488

well, all started because i needed some kind of list box where i could add or delete items, so the only way i found to do it was js and select, now the problem was that i needed to send all the items i added to list box to my php function, but with select i could only send one value. so i
created this new function to concat all the values and send them as one with a hidden input

it all started with a big bang!!
or is it with a SHA BANG!

lol
so what could be wrong in the script now?

concatenate all values?

yes

and submitting them as a hidden one? sounds I N S A NE
why? don't you only need the selected value?

because one admin can dynamicly add new items, so the user can choose all those items and reserve them
i found the problem
so dumb

to which line does the error refer to in IE debuger?
is it the actual html document file, or the javascript section in the document?

imho, all html file

hmm

newb question (php programmer first js program) document.write(h3Additonal Head input name="addhead1" type="text"/h3) how do i make addhead1 be a variable?

in PHP?

no js

docuemnt.write("h3…input name="+ addheadVariable +" type=…/h3");

ah thank you

hmm
oh.. ok
)

heh
"docuemnt"

)

so docuement allows adding variables and document doesn't?
joking

ha. ha.

hello, how do you fix the png problem in explorer 6? (the transparency problem)

`ie pnghack @ Techdeck`

Techdeck`: ie pnghack: www.mongus.net/pngInfo/ , http://xrl.us/jywg , devilock: http://urlx.org/web.archive.org/0035a , MSDN reference: http://xrl.us/sygd. Also see `png
gamma

thanks
Woosta, which one do you recommend on using?

anything
IE sucks. Stop bending over to support it

no difference?
haha
tell me about it
but I work for a web development company, I can't 'not' support it
wish I could be like talks.php.net
if you use IE they kick you out :p

Hang on .. you work for a web-dev company and you're asking in a JS channel how to fix IE's png? Surely one of your co-workers will already have a library installed in your project repository to handle it ..

yeah one of them did have a fix, but I'm not at work atm
I took my day off and I'm working from home :o )

*burp* make it a gif *burp*

I wish I could
but the designer is being stubborn :p

That's what I did on one of my sites .. an IE CC that replaced *.png with *.gif

oh
you mean really convert them or just rename them?

eh?

nvm, stupid question

yup

ok hold on, I'll try the first solution, let's see how it goes
hmmm
Woosta, why does it use a transparent 1×1 gif?
what for?

hehe

IE let me know when there's some javascript error but FF doesn't

the png hack deal works

can I change this behavior?
in FF

CommandPrompt, but why is there a 1×1 gif?

what do you mean?

that ruins the whole point of png

so, just use that I gather, IE7 png support is not full, but decent enough for many alpha pngs

Techdeck` because that's hwo it work

when there's a javascript error IE displays a yellow exclamation icon at the bottom left
but FF doesnt tell anything

error console

from what I understand (the designer explained), .png images can be half transparent, if you use a transparent gif, doesnt it ruin the opacity level?
maybe I'm wrong..

Techdeck` read the code and work out how it all works

ok

The links aren't going to be there if they don't work

thanks Woosta and CommandPrompt

thanks Woosta

Woosta, how do I use the png fix for background images?
it seems it doesn't affect them for some reason

Read the damned docs

there's nothing about it in the pnghack docs
anyone knows?

hehehe
no true :P

I don't see anything about it..

they do indicate and give instructions on how to apply it
they also point out how it works too

theres a css hack

I applied it and it works, just not for background images

no, not for backgrounds .. there are other things to do for the backgrounds, but you'll probably have to do it yourself

I don't think is meant for bg images

Once you understand how the hack works, it will be easy to do it for backgrounds

ah
I see

heheh

let me have a look

in short, you will end up using an IE conditional methinks
you can, for IE alone, remove the img from the background, as background image, and put it on the foreground, give the containing box, position: relative; and stick the img on the foreground in it, with position: absolute;z-index: -1;top: 0; left: 0;
z-index: -1; on an abs pos box, in IE drops it on the background, and apply png stuff on it
stick all that in an IE conditional

that might work, but it's horrible :p
must be a better way

?
heheh
we're talking Internet Explorer here
horrible and IE go in the same line
heehh

how do you make draggable elements?

true but still :p

i just got AJAX working, which is exciting.

check the distribution libs for any drag subroutines

well, then i'd wonder how the subroutines work.
you don't just set an element as "draggable"?

using a lib, yes

Techdeck`: try this Techdeck`:
crap lol try this http://pastie.caboo.se/77003

wow nice Byron, let me try
can I private message you Byron?
so I won't piss Woosta off :p

ok
does anyone know a way to check if an image is loaded without using a timed event?
onload only seems to work on opera
apparently ie supports onreadystatchange
as for mozilla…?

both joke(maybe)

yeh onload fires in firefox, but way before the image has loaded
Techdeck`: how did that css work for ya?

Byron, Private messages from unregistered users are currently blocked due to spam problems,

Comments

Ive just been given a php application that uses mysql to install but our database servers are mssql Is there an

tre`: There's a mysql function 'twozip' at work that we don't know about

yea i can post that

single quotes for the sql hosting values?

i dont think the $_SESSION will evaluate inside the quotes

most likely it's because you're trying to evaluate the $_SESSION array inside of double quotes

i tried that, same error
ok, so set that as a var
i'll try that

this is an error: $a = "a foo['bar'] b";

you acn just say VALUES (" . $_SESSION['balh'] . ", $s)";

http://php.net/types.string

ok, posted both functions twozip and distance55
http://www.devpaste.com/6435

of course, i forgot a $ before foo

tre`: Well that twozip() thing shouldn't be working in there anyway…

in the query

thats fine philip, thanks and thanks ManUnderground

np

http://nonlogic.org/dump/text/1186111255.html — that returns an error, says I cant connect to the DB
when I can connect from the shell

nice name

thanks

check out http://www.devpaste.com/6431 this is what i had before
that works, but i need to sort results

Right, to sort that in the SQL you pretty much need to carry out the distance calculation in the SQL

but when i try to get the distance calc with twozip() in the query i get errors

That's because you'd be operating with values from sql that you haven't received.
One thing you could do, in PHP, is to store all the results in an array keyed by the distance, then ksort() the array

sounds like a great idea

otherwise, you'd need to work out the php mysql web hosting code for the distance calculation and use that in the query
Which could be more efficent, but is, you know, hard.

ive been wracking my brain all day trying to get an array that would work for that
if i use an array, how do I join the distance output to the output from the sql query

rtgen lm alpha 1 7 0 2100 8000000 all
grr
this is annoying me
started" (delimiter " ") key 2 returns status:

If I understood maths, I might be able to do the sums in the query
http://dev.mysql.com/doc/refman/4.1/en/mathematical-functions.html

$file_array[] = $elem puts $elem as the last element of $file_array ?

thanks for the help sycofant
im just going to experiment with arrays

tre`: Gimme a few minutes, I'm trying to learn about maths

there?

i'm trying to make a curl call to a remote web server but i keep getting a 400 response. is there any way i can see the packet being sent by curl?

tre`: Still around?
tre`: I don't have the data, and I don't really understand the maths, but: http://www.devpaste.com/6437
tre`: Actually: http://www.devpaste.com/6438
Only if you can sniff traffic on either the sending or receiving host
….or something in the middle I guess, but that's less likely.

dang… alright, thanks
dang… if only php6 was stable…. CURLINFO_HEADER_OUT - The request string sent. Available since PHP 6.0.0

still awake?

Ish
Waiting for work to finish

i solved my problem

huzzah

its not really a constant im passing, its a bitmap

…right.

so to build it up you do addition on it

i think those docs may be wrong

so if $yoho is the var to pass in, this works: $yoho = STRING1 + STRING2;

Ah, yeah… right.

philip, ? php6 if they're adding stuff about php6, then its gotta be pretty recent

i mean, i think it's in 5.2.x

oh…

what timezone are you in if youre still working?

GMT+1200

nope, its not

1pm

so you're where, australia?

New Zealand

ah, nice

2pm

not like us usa:ians, its not even friday here yet

When I try to use session_name($var) before a call to session_start(), I get this error:
session_start() [function.session-start]: open(/tmp/sess_7340891eb77dfbae5c489ac76661b902, O_RDWR) failed: Permission denied (13)

it's in here http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?view=markup&pathrev=PHP_5_2

If I remove session_name($var), then the session works fine
Hmm
Interesting…
I changed 1 digit in $var and now it's working o_O

mm, four minutes to go

philip, hmm…. it returns false to me

do var_dump(CURLINFO_HEADER_OUT);

2

so it's defined… that's something at least

so its there…
yea

majikman, you just wana see the curl request?

yea

err the http request curl is making?
wireshark my friend!

yea
lol
i was hoping of some other way around it

why? it's easier :

you sure you using it correctly?
http://ilia.ws/archives/2005/07.html shows how to use, right before the patch was created

cuz… then i have to go and compile, write the thing to disk, then copy the file…. bah…. i'm lazy =P

right before it was committed rather

ahh… CURLINFO_HEADER_OUT needs to be set…

majikman, WUT? you don't have wireshark already? blasphemy!
a network sniffer is necessary if you plan to do any network coding great debugging tool

cythrawll, lol… i hope the lord forgives me. in my defense… i do have it on my computer… just not on my server hosting =P

help me out

tcpdump

my login is not working here

ah majikman

for this php web hosting script
i cant figure out what the problem is either

I usually dev on my computer :p
but remote development would be difficult

anyone ?
i have no idea where to start

hmm….. there seems to be some kinda bug here with this curl stuff
the header seems to be constructed incorrectly…. looks like the buffer is being overwritten

linuxtk10, start by looking for errors
then output variables to see if their what you expect them to be
DEBUG

i mean
i ddint write this thing
and when i installed it like 2 months ago it worked
grrrrrr
its like i dont have somehting installed or blah
wheres the php error log usually located?
or does it even have one ?

anyone know why my headers are looking like this? the start and finish is waht i added… http://rafb.net/p/zVpU8t92.html

i mean
tyea i know it has one
but i dont know where it is hmmm

linuxtk10, look at your phpinfo() it tells all about your php setup, even error reporting setup

right now im jus pissed this doesnt work

man that's one big cookie majikman

cythrawll, cookies are tasty…
thanks to myspace

but yeah that's definitely malformed

and i'd assume even improperly calling the php curl functions shoudln't cause that

assumptions and coding don't mix

lol
true…
so, you think its possible the bug is in my php host code?

how are you setting up this curl call?
pasta bin

cythrawll, http://rafb.net/p/rI8pkQ73.html
you can probably skip the first function, thats just to get my token and cookies
its the second function where the malformation occurs

anyone used the memcacheaggregator class that is in the examples on php.net?

error_reporting = E_ALL & ~E_NOTICE
whats this mean ?
does that mean it shows everything ?

http://us3.php.net/error_reporting
ll errors and warnings, as supported, except of level E_STRICT in PHP 6.
for e_ALL
Run-time notices. Indicate that the script encountered something that could indicate an error, but could also happen in the normal course of running a script for E_NOTICE

i am syaing will error_reporting = E_ALL & ~E_NOTICE show everything ?

No, that shows everything except E_NOTIC
*E_NOTICE

|, not &

oh,

majikman, what happens when you set the CURLOPT_URL right after you init?

i c, i need to change fonts on my irc client

i just want to be able to see everything

Then set it to just E_ALL

error_reporting (E_ALL);
anyone messed with memcache?

deStone, url?

its on a localhost — wanting to try to connect to memcache box but if connection fails or no cache results, hit the db

cythrawll, i removed line 37 and changed it to $this-curl = curl_init(); and the packet is still malformed

deStone, sounds reasonable

the docs have been updated

ah, cool =D

what's the best way to test for a false grab on the cache? check for an attribute value that isnt there? if($item-id == "") { hit db }

?
WHAT CACHE
i mean what cache

deStone, well memcache get function returns false if a key doesn't exist I would check that :p

if (foo == 1) { … } elseif (foo = 2) { … )… is there a way not to write 10 if's for 10 values ?

larco, switch statement

How to convert 2007-04-17 to Apr 17 using php date function

praveen, you grabbed that from mysql I'm guessing?

my sql will not work if i give sorting for that field

cythrawll, so any idea?

praveen, what??????????!!!!!!!!!!!
majikman, no, sorry im clueless

mevermind, i'm an idiots. Thanks cythrawll

=(. its ok, thanks for your help anyways

deStone, plural even!

select date_format(a_schedule_date,'%b %e') as sch_date order by sch_date will not work

thanx that was what i was looking for

select date_format(a_schedule_date,'%b %e') as sch_date order by a_schedule_date will praveen

I want some date function to to convert 2007-04-17 to Apr 17 for dispaly

praveen, mysql's date_format is the easiest method
otherwise you'd have to explode on the -, make the time, and then pass to date

ya but it will try to sort based on alphanumeric ie april come first and jan next

praveen, did you tottally ignore my post on how to do it right?
select date_format(a_schedule_date,'%b %e') as sch_date order by a_schedule_date
order by the original date field, not the format_dated alias

let me try your idea

trust me it works
I've done it more times than years you been on the earth.
phoenixz!!

wow, it works fine , thanks a lot

praveen, no problem

!paste
Where can I paste code?

!tell alecwh about pastebin

Hi everyone

!tell cythrawll about meow

!tell Monie about meow
!tell Monie about pastebin

Hi all, I'd like to know bit about security/encryption… I want that one page access to my email account but is it secure to put my password in clear inside the page ? and if not how to do such a thing … I have the same question about my MySQL password…

ahh i got muy nick back
Laughing Out Loud

I'm having a problem with Arrays and strings. I have a string with Arrays inside it, but I get a parse error: http://hashphp.org/pastebin?pid=25587 Can someone shed some light?

alecwh a string with arrays inside it?

Yes, I'm trying to form a query for mySQL

you mean an array with strings inside it?

No…

!tell f00li5h that he didn't get the pm about meow and he had no idea what meow is so he hopes php-bot will tell him.

Well
Check the paste bin
http://hashphp.org/pastebin?pid=25587

alecwh its not possible to have arrays in a string

WolfPaws deleted the factoid about 2 weeks ago

:

did you get one from buubot?

nope

alecwh can you echo $new_sql and tell me what it outputs?

MrNaz, I get the error below…
On pastebin
http://hashphp.org/pastebin?pid=25587

alecwh yes, i want to know what the generated query is… put this under it: echo $new_sql; so you can see what mysql is being passed

some of your $data[] miss their $

which ones?
oh
those are intentnional

sorry alecwh my mistake

anyway, I'm getting a parse error, MrNaz…
It won't do it.

What do I have to do with email web hosting subject for the subject not to be classified as possible spam subject? I can see that when I send emails with Thunderbird that have iso-8859-2 characters then thunderbird makes some conversions to
them, but I dont know which they are and I would like them to happen in my php script as well .-)

Does anyone see a problem with that query?

hi folks, which ajax framework would you recommend for working with php?

alecwh i'm not familiar with that parse error… however were I you, i'd use concatenated strings rather
alecwh what db are you using?

MrNaz, It doesn't matter.
it's a PARSE ERROR!
:P
$new_sql is just a string
and it has a problem forming the string.

alecwh yes… using string concat makes it far easier to see errors when using array indexes injected into strings

I have a form handled with PHP, and I store all the $_POST data into an array, "$data". Therefore, I have "$data['title']" and "$data['date']" and stuff. Now, I have a problem putting that into a query to give to mySQL. http://hashphp.org/pastebin?pid=25587 shows the problem and the error.

clarity of code helps you to avoid mysterious parse errors

It is… clear… :P

My php forms are not posting back. I'm running (apache - provided by XAMPP). Is this some kind of configuration problem?

alecwh apparently it's not, else you wouldnt be asking :P

Not even a get request goes through.

MrNaz, look at the code. What's not clear about it?
$new_sql = "INSERT INTO articles (article_title,article_subtitle,article_author,article_cat,article_text,article_exptext,article_imgid,allow_comments,start_date,end_date,active,approved,archived,timestamp,ip)          VALUES
($data['title'],$data['subtitle'],$author,$data['cat'],$data['main'],$data['extmain'],$data['imgid'],$data['comments'],$data['start'],$data['end'],$data['active'],$data['approved'],$data['archived'],$news_timestamp,$news
Somehow, that gets a parse/syntax error.

paste. bin.
the syntax hilighting will tell you what's wrong with that line
odds are that you just b0rked your quotes up

anyone?

So, what do I have to do?

meow
if your forms aren't posting, there's a problem with your html

s/'//g

ddi you just sgugest that someone de-quote their array indexes?

yep
inside string

why?

no it posts if i try the html submit
without running it as a .php

i'm confused as to what the problem is
so your server isn't running php as php webhosting scripts?
that's a webserver thing, off to #apache with you

http://hashphp.org/pastebin.php?pid=25588

test lol

no. it runs php scripts.

f00li5h please can you beat yup with a rubber hose while I give alecwh some sensible advice
kthnx

when a form is submitted (which is delivered through a .php script) it doesn't work

hm

"doesn't work" has no meaning
pastebin the script, the html, what you expected etc

if i execute a sql host query inside a function, lets say i do $foo=["foo_bar"] how do i use $foo outside the function?

$a['hi'] = 'hello'; print "$a['hi']";

yup thats because you cant use quoted array indicies within a string

I'm reinstalling apache. will get back to you.

neat

in the meanwhile, what ajax framework would you recommend for php
?

and it is normal to use kyes without quotes inside strings

yup i can assure you that it is not.

it is

scripta.icio.us # i suppose

MrNaz, Thanks, I see what you mean now!
The error went away..

stick brackets arround your print

using non-quoted keys forces php to search for keywords by that, and then make the assumption that it is an array key when it doesnt find one
alecwh glat to help

that line you have is not a problem by itself

so yup you can go ahead and use non-quoted keys all you like, but please dont go spreading your bad practices to others
alecwh i hope you're remembering to escape those for your database… use mysql_escape_string() or pg_escape_string() on all your variables when you inject them into your sql
or find another way to suitably sanitize them from user abuse

echo "Foo: {$bar['baz']}";

MrNaz, I've got an escape data function I use
It checks to see if magic quotes is on
if it is, it will leave it

novicane that's another syntax entirely… is that even php native? that looks like smarty to me

if it's NOT, then it will escape the data.
I'm allowing HTML, however, because this won't be available to the public. :P

yes it is, you can use {} to access objects and arrays in a double quoted string

you should de-magic quote it, then escape it for the right destination

alecwh just so as you know… magic quotes are evil… i program my stuff to refuse to run if it detects magic quotes, and out puts a rude message to the sysadmin

\ is not the right quoting method for html, for example

novicane ok… i dont use that syntax anyway… i prefer using string concat always as it saves the load of php parsing every string it sees looking for variables

MrNaz, what exactly… is magic quotes?

there's no real performance gain, since php still has to parse the code outside the string to find the vars…

the performance difference is negligible really

it adds \s to your incoming data

to all the ',",and ;s right?

in post, get and cookies, it messes all manner of things up

hmm.

novicane negligible perhaps… but it takes zero extra time and i find it results in easier to read code

that kind of escaping is never going to be right for the place yous end it
yes, sticking complex de-references into a string is always going to be harder to read

alecwh magic quotes is a php feature that automatically and silently quotes everything in POST, GET and COOKIE arrays… the trouble is that it rarely does it properly

ok. :P
And, sorry one more question, Is there an easy way to parse RSS feeds? I'm aware of SimpleXML (what I usually use) but it doesn't really work with RSS.

echo 'this ' . $that-other; vs echo "this {$that-other}"; … adding a bunch of concats is imo a bad practice for readability but to each their own i suppose

novicane like i said… "I find" :P

ok, i was wrong, answer is to use {} inside string

so {$foo} is more readable than . $foo?

also it makes it a tad ambiguous when you actually want to have { or $ chars in your strings

here. i dont knwo what i am doing wrong
http://pastebin.com/m6829f88a

a string should begin/end with quotes imo… having a string with a bunch of concats and a lot of starting/stopping of the quotes makes for poor readability

that depends on how you indent it

That settles it. We should all just use s/printf

sprintf++

echo "this " . $foo-bar . " is " . $bar-baz . " annoying"; compared to echo "this {$foo-bar} is {$bar-baz} annoying";

novicane there are good arguments against string concat, but the idea that strings start and end with quotes is not one of them.

we're talking about readability arent we, sounds like a good enough reason to me

I HATE RSS!! GRR. Why can't it just be XML with "guidelines" for formatting?

http://sial.org/pbot/26617
if you're doing that much crap with your strings, perhaps you want some kind of templating

novicane yea… as you said, its a matter of taste, i find having the string's variable components "stick out" more readable to my eyes… but we're probably just both used to doing it the way we've been doing it, so yea as you said, to each their own

MrNaz, is SimpleXML a viable solution for most servers on the 'net?

i'm not familiar with SimpleXML

hmm.
It's an XML host parser for PHP.

Because RSS was meant as a generalized encoding for creating ontological and semantic meaning for data

TML, RSS is just XML with a global "format".
As far as I konw.

hummm. /me waits paitently

You're missing a lot

alecwh RSS *is* just xml with guidelines for formatting… i've seen it displayed very differently with a few different rss readers

Well, XML can accomplish everything that RSS does. It seems RSS is just a standard. :P

rss just delivers you the raw "data" how you present it is up to you
alecwh you're aware that RSS is XML hosting right?

MrNaz, I've said that. XD
6 AM) alecwh: TML, RSS is just XML with a global

meow

just checking

?

anyone here know how to use the web interface for PHPUnit?

you're not escaping your stuff right ofr one
and how do you intend for the function to return something without using the return keyword anywhere?

I mean, sure, RSS is "just XML", but there's a reason the XML that is generated to make an RSS feed contains so much markup…it's because RSS is a child of RDF, and RDF is a child of the Artificial Intelligence projects of the 1970s and 80s.

ok, i am reall new at this, so i am trying. any ideas would be gretaly helpful

&references ?

:P
anybody heard of "cutenews"?
http://cutephp.com

liek return $afirstname? or return $afirstname=$row['a_firstanem']; ?

I've just looked at it, looks like a file writing news system web app. Has anybody had any experience with it?
40 bucks to buy, wanna make sure it's good. :P

Well, it uses flat files, so that's pretty much a "No"

One of my friends uses a hosting service that doesn't have any database. :P

hello everyone, is there a way in PHP to get the datetime of yesterday without converting into a unix timestamp first?

maybe a little advice? :P

something like date("Y-m-d H:i:s")-1 subtracts the year

find a database abstraction pear.php.net/mdb2 for example, and quit using the mysql functions directly
it's painful, and crippling

the time(); function returns the number of seconds since the epoche, right?

ok. i will look into it, but you said i wasnt escaping correctly? what did you mean?

Tell your friend there are better, and probably even CHEAPER, hosts out there

uhm, ok.

well, you can't just do $sql = "insert into foo values ($bar)"; because $bar can contain things that have special meaning in sql

In today's world, there's no good reason he should at least be able to get an sqlite database

The erason I ask about the time(); function, is because I'd like to get the UNIX timestamp for tomorrow at the same time.

Requires no "database server", but is intelligent about managing synchronous file operations and such

60×60x24 to the timestamp.

time() returns the amount of seconds from the epoc, what you want to dude

time()+86400

*do is add 86400 which is the amount of seconds in a day

like thats why i remove slashes before i pass it?

does anyone know how to get the datetime in Y-m-d format of yesterday ?

How did you get 86400? :P

or must i convert to a timestamp() first ?

you need to check for 's and other things too

ah, I see now.

60 *60 * 24

86400 == 60×60x24. It's a common number when doing things in seconds, it's worth the time to memorize it.

is equal to the amount of seconds in a day

that makes me curious, how would I generate a UNIX timestamp from a specified date? Like, say I had an input field, is there a quick way to get the timestamp for a specific date?

yup, i am aware of soem of them, i dint post all the code. Just the section i am having issues with. I am trying to do this in a fucntion fo i can pass many diffrent table names to it, with diffrent colum fields. just trying to save ont he same thing over and over
if i put my form in the function everything workds great
but i dont really want the form in the function

your form, what?

this sql pull all the user info from a table and then i display it on a form, its for a profile

you seperate the displaying from the queries
$user_record = $db-get_profile_info( $userid ); print profile_html($user_record);

why doesnt $status = explode(" ",exec('/etc/init.d/apache2 status'));
echo $status['2']."br /\n";

hmm…. either i found a bug in php5.2.3 or i have some really weird obscure error.can someone confirm this for me? try running this code…. http://rafb.net/p/uolNB118.nln.html

what does exec return?

work? the string happens to be "* status: started", but it outputs "status:" instead of "started"

its malforming the data

?

perhaps there's a space before the *
why not use a preg_match, to capture the bit you're interested in

when i use 3 theres no output

then you can capture the started,failed,etc wihtout worrying about what the rest of the output is

What's the difference between explode and split?

split uses ereg

Where is $my defined?

what does explode use?

explode users literal strings
s/s//g

oh
ok.

woops… i forgot that, but in the code i'm running, it is defined… $my = new myspace();

And what exactly is the "bug"?

but the string could be different but will always be that general form

"PHP Fatal error: Call to undefined function note()…" is what I get from your code

the first few times i run that, the outpuf in getid() is correct. however, after a few times… this is the GET request that gets sent: HTTP/1.1x.cfm?fuseaction=user&MyToken=AE989B6A-BEB4-4116-88BFA1806BD3B06C15092083

Ok, I'm off. Thansk for the help everyone.

i just need to capture that word

/leave

what do you mean?
yes, you use the regex to capture the particular word

oh yea…. that isn't in there either
damn, i forgot to copy a bunch of stuff
well, just remove it, i supose

and check the different things that the script can produce

i've received the same bug with multiple myspace accounts and on multiple servers

is there a function that returns everything after a given char?

substr and index

substr

s/index/strpos/

TML, after you remove the note(), are you getting the same error?

I'm still not sure what the error is

the header is invalid
HTTP/1.1x.cfm?fuseaction=user&MyToken=AE989B6A-BEB4-4116-88BFA1806BD3B06C15092083

is that really what it's sending? and what is this myspace class?

in a switch statement after i test with different values can i give a value in case nothing matches

larco, sure, default:

f00li5h, i'm not sure if thats what its sending… haven't sniffed the packets yet. but either way, then that means there si a bug in curl_getinfo if it isn't what its sending

ekneuss thanx for the tip

and that myspace class was some class that i made… trying to make something to pull all the info from a myspace account

hi :]

what was the url for your test code again?

f00li5h, http://rafb.net/p/uolNB118.nln.html you have to define $my = new myspace(); somewhere and remove the note()
maybe its just me… but everywhere i run that thing, i get the same invalid result

well, write some code to produce debugging information (perhaps use log4php so you can have info levels)

log4php?

logging.apache.org

hmm… not much info on log4php

You appear to have a bug in collect_cookies

it uses the same interface as log4j, which is why it's not documented
you can just read the docs for log4j

oh
TML, well… even if i returned invalid cookies, why would that cause the header to overwrite itself?

"test", [1] = "test2", [2] = "test", how could i delete all duplicates, to there would be two times test

EvilDin, take a look at array_unique


wow.
i just realised how pointless that was.

php -r 'var_dump("fooo\r\"");'

that bit of code was for a website… and look at the service i was checking the status of…
$status = explode(" ",exec('/etc/init.d/apache2 status'));
….

TML, ? how come it does that?

Carriage return on console makes it wind the cursor position back to start of line and start overwriting

oh…

You have a \r in your data set, so it makes any attempt at printing make things look askew

hmm… woudln't that mean then that there was a carriage retrun between my get request ahd HTTP/1.1?

Try trim()'ing them
HTTP *should* be terminated with "\r\n"

TML, yea… but the HTTP printed on the same line as the first line so wouldn't that mean there was a carriage return *before* the string HTTP/1.1?

I'm not particularly interested in the problem at this point, so I'm not following the semantics very closely. Just trim() your strings and you should be fine.

k, thanks anyways

hey acushla

.

does anyone use any frameworks

at times
JymmmEMC, hey darlin

anyone receive this message at the end of a file…
syntax error, unexpected $end in /home/curiosof/public_html/curiosoft/test/sendnotification3.php on line 27
well, the "unexpected $end" part

dd
hi all

well yeah you didn't properly close something

you're missing a ; on the last line of your file
unexpected * generally means there's a ; missing

hey guys, If i am using an html page that submits to a php page, what is the best way to error back to the html page if things don't validate

you can't if the html is static

with the messages

What is a statis html, and its counterpart

static html is html that's not generated by a script

static = does not change

the alternate is dynamic
pear.php.net/html_quickform
it does form validation, and error reporting for free

i have set up my .ini to parse php in html

you can embed
you can do it a number of ways that way

then it's not an html page, it's a php script, isn't it?

yes, but still i need it to report errors, I wish i could just have forms and php all on one page

you can

but it's messy if you do

but I do it all the time

go and get a class to do your forms

lost me
How would i use class with forms?

$form = new Form_UserDetail(); if ($form-validate()){ $form-process($callback) }; $form-render();

pear.php.net/html_quickform

this class will do all your form rendering and validation for you
you don't have to write any html for your form
there are many others like it

hmm, I already have my validations

but you don't have the reporting of failure of the validations
html_quickform does all those things

I do, but it reports to itself

what does that mean?

it checks to see if(empty($_POST)){

great, does it check that it contains sensible data too?

sensible data?

why is that a question?
does it check that the data the user submitted is sensible
makes sense, is useful for your application

yes

memcached question — http://us3.php.net/manual/en/ref.memcache.php — am i being stupid by using the MemcachedAggregator class from 2005 — should i just be using "AddServer()"?

paste your script, so i can make fun of it ^W^W^W have a look at it
pastebin, that is

i take pride in my scripts
;P

how come when i type genlop -l into a shell it works, but when i use exec('genlop -l')

then you should be sure your script is the best, and have no problem sharing it
i don'tk now, perhaps you're running as a different user

Hi, I am recieving these apache errors relating to HTTP_GET_VARS
http://pastebin.com/d3344c010

Use $_GET instead.

This is from a site that was just moved from an old one to a new one
old server i mean

you should still be able to enable HTTP_*_VARS in php.ini
but you really should fix that, before support for it is dropped all together

mattmcc is it that simple, i can just directly find and replace HTTP_GET_VARS with $_GET? (I know zero PHP)
f00li5h tell me how to enable it and i will tell the dev guys to fix their code but in the interim they are complaining

http://sial.org/pbot/26619
find . -name '*php' | xargs /the/place/you/put/paste_26619
this will make them use the short arrays instead of the long ones

if i use exec to execute a command that has multiple lines of input, and i echo the output will it show each line on a new line?

check out the .ini, it'll have comments detailing it

ok
cool thanks

exec will give you back an array

so setting Register Globals to on fixes it f00li5h?

second day into php and i've barley learned how php controls html

what? no
register globals is evil, and fixes nothing, ever.

ok

it will bring suffering, pain and strife to you and yours.

Hah

i hate that quickform, it gives me that disgusting feeling like i did a lot more work than i had to

you did.

heh thanks

but on the plus side, their code is well tested

its alright, my validation class is nothing shy of incredible

can you combine rules with your validation class?

f00li5h, it doesnt seem very customizable, would someone be able to check to see if username != password before creating an account

sure, you'd create a rule for it

f00li5h, i dont think (i hope) there is no way to get around regular expressions
because mine is built primarily off of that

that fixed it! thanks man
; Whether or not to register the old-style input arrays, HTTP_GET_VARS
; and friends. If you're not using them, it's recommended to turn them off,
; for performance reasons.
register_long_arrays = On
much obliged

preggie matches all day long, love it!

http://pear.php.net/manual/en/package.html.html-quickform.intro-validation.php under Table 43-1. List of built-in validation rules as 'compare'

damnit, that is nice

why is php having so much trouble with this weird character

what is the character?

i dont know, it wont show up in mIRC
but if i use exec it does a few chars then stops
but if i use passthru it will echo it but when i try to do anything with the string it dies

pastebin your code

with exec or passthru
*?

is there a way you can pass that wierd character to STDIN of the program and have it read from there?

what do you mean?
hmm i know

what is the thing you are exec'ing?

gimme a sec
genlop -l | tail -2

what is genlop?

gets me the emerge log
[0m
ah it does work
it doesnt do anything after that

is there a way to get php to redirect to a home.php after a few seconds?

Azio, no, you best do that with JS.

okay this is it with passthru
http://124.177.24.149:15228/emerge/history.php

ahh bugger :

hmm… i wonder… if i do this a different way…
nup
yeah thats all it does
if i try to use str_replace it doesnt work
it doesnt wanna do anything with that string

so there is no way to use php to redirect without using header? :

no, there isn't.

doh

you could try giving them basic text
sleeping for 5 seconds, then send the html redirect headers
see if that works

oo

what?

Or use HTML…

rofl

$URL"); just won't work

well he said in php

send a page, wait then send headers? do you listen to yourself?

that is all I can think of

lol TehSausage

purr

yes I do TehSausage

is it possible for the php to wait 5 seconds and then echo a html redirect?

why?

Once you send a header, that means you're sending the content.

DrJ, after sending output, you can't send headers you know…

i'm developing a webpanel

isnt there a refresh header?

Exactly, use an HTML refresh.

i need it to wait 5 seconds for the user to acknowledge a change and then for it to automatically redirect to check.php

I bet you trick many browsers

or was that meta

DrJ, a request _starts_ with headers!

why will exec only output that much?

And completely break semantics? Yeah okay, THAT makes sense.

http://192.168.0.100:15228/emerge/history.php?records=5
err
that wont work :P its an internal ip :P

why don't you put a button there for it

http://124.177.24.149:15228/emerge/history.php

kuja, almost all pages break the rules on HTML
get over it

If you want to do it with metatags / js, that's possible, but not with php.

f00li5h because i'd like it to be automatic for our users

you are about to remove the record [ hell no ] [ do it ]

anyways

No, you're breaking HTTP, not HTML.

they would like it

that was just a suggestion

then why are you sending a page at all?
just send the redirect

Nobody mentioned broken HTML here.

I'm not talking one bit about HTTP

Yes you are, because you're talking about breaking HTTP.

ok so if i echo an html redirect, im good. even if php has sent headers, yes?

DrJ, if you send a header, you're talking HTTP.

try header("Refresh 5;http://example.com/");
err, colon after refresh:

god, do I have to spell it

heh thanks guys

echo "bla bla bla";
sleep(5);

whatever causes html to redirect";

php.net/header — "header Send a raw HTTP header"
Possibly if you attempt to flush the output, who knows.

well for starters is http://uk2.php.net/header going to help? :

then why is the header contained in html tags?

So you'll be doing the redirecting with html/js, not php.

i've already sent headers

still yes

why would you do that?

Azio, gee.

I have no idea

just send the damn header, no html, just redirect

just include the meta refresh with the delay

just like I have no idea why he can't do it in html to begin with

http://sausage.no-ip.org/tr

meta http-equiv="Refresh" cONTENT="5; URL=html-redirect.html"

ok. I might have sounded like I am an experienced php developer (cough, yeah right) so forgive me if my knowledge is a bit lacking in how to deal with this

it does not matter to the user how you redirect them

thanks

if you're removing a record, just delete it, and redirect back to the record list page

err, with consistent casing as well.

people will see that the record is gone

uber

Store a mession in your $_SESSION and you can decide to display it on the next page.

f00li5h, you're talking about users? Probably not.

your record set is paged, isn't it?

put what kuja into the header, it will redirect to html-redirect.html after 5 seconds
see that in the content= bit?

cool
i think i get it

f00li5h, very much so.

i cannot add kuja' line to the content
only header

so when you redirect back to page 10 of the result set, you'll see that the user in question is missing

$_SESSION['message'] = 'Record deleted'; header('Location: …some new page…'); // then from a new page just check for $_SESSION['message'] and output it if it isn't empty or is set.

yep because its a meta tag

ok

for each $_SESSION[notification] and add "user deleted" to that before redirecting

is the header include()ed in (like in another page)?

yeah runey

f00li5h, yes, I will, but the end-user won't. I always notify.

okay
thats easy

i will have to make a custom header for this page

nah dont worry
can you get to the header?

psh, that example doesnt work in IE for some reason ._.

oh ya

5;http://example.com/");

f00li5h, kind of like RoR's flash system. Actually, exactly like it

neat

no, $_SESSION persists for ever

is till might need to cp my header, I don't want all pages redirecting ;-)

but it wants to be like a flash

*I *still

type php echo $meta; ?

then before the include line put $meta = "meta http-equiv="Refresh" cONTENT="5; URL=html-redirect.html"
then before the include line put $meta = 'meta http-equiv="Refresh" cONTENT="5; URL=html-redirect.html"';
whoops

f00li5h, yes, but my message is empty automatically after displaying it, so I don't have to worry about that

ok
i get it
nice

think outside the box, dudez :P

5;url=http://example.com/"); works in ie

that way if you ever need to refresh from other pages you can just set $meta in that page above the include again

weird that the meta tag can work without url= but the header can't

yeah, you have to empty it yourself
but that's nether here nor there

and if you want to put something in the header for certain pages, you can just put it again in the META tag
*meta var

ok i am not as advanced as you guys
so trying to keep up

meta refreshs break the back button, why do it?

ok uber got it

nop, only if under a certain time

neat trick dude

pardon?

if its say 5 seconds you can just press the back button twice
at least, it doesnt break *firefox* as long as its over a certain time

yes, i have to do it before the 5 seconds though

pages with a refresh header don't store in the back button history'

how long do you mean?

is that with a meta or a http header

mysql_query("select table1.foo,table2.foo from table1,table2") and using fetch_assoc_array() on that returns an array which has only one foo. How could I do it right?

what?

http header

thanks

test

hmm im not getting it to work properly but heh great
my own stupidity no doubt

whats it doing?

well my header include is html

and header

??

heh

Alias one of the fields: table2.foo AS bar

say in the file you are trying to refresh its got php include($header);

ok

you would put the $meta = ""; before include($header);

try SELECT table1.foo as foo1, tavle2.foo as foo2 FROM…

$meta = "meta http-equiv="Refresh" cONTENT="5" URL=index.php";
include("system/html/header.html");
ya like this right?

nap

ah well there you go
sorry

lol its ok

ok i see one mistake "

replace 5" with 5;

$meta = "meta http-equiv="Refresh" cONTENT="5;URL=index.php";

aha

and that retarded capitalization :P

literally, out of the box ;O i thought ";" was a mistake
oh my ignorance

thanks

erm… and the header will have to be .php :P

ahh
ok

any one use the stratos framework here?

is html not php :P

can i create a header.php and call header.html from it
then i just add a file instead of change the whole header.html to php

it generates garbled output when i run the basic application.
js errors

nop :P

syntax error, unexpected T_STRING in /var/www/html/gpanel/test/start.php on line 5
$meta = "meta http-equiv="Refresh" cONTENT="5; URL=index.php";

escape the "

or just stick the whole thing in single quotes
since you're not interpolating anything anyway

$meta = 'meta http-equiv="Refresh" content="5; url=index.php"';

thanks, and sorry ;

or just use headers +_+
only reason i see for meta http headers are if you're editing static html that needs them for some reason

lol you're okay

well runey

there's no reason to

shocking!

that works, thank you. Is there something for "select *" too?

it worked with html header runey

why would static html need to redirect you?

yep, im electric :P

but i think it only refreshed once

it redirected?

thats great
EXACTLY what i wanted

How do you mean?

well, correction, moany customers
;-)

well if anyone saves a copy of the page for some reason it will still redirect, possibly to nowhere if the url is relative

well thats their problem isnt it:P

heh

meta tags use more bandwidth

SELECT * FROM t1,t2; where t1 and t2 got fields with the same name.

yeah i doubt anyone would try and save a suphp panel

yeah, i don't really see a use for that, personally

you can save almost 1kb a year :P

(a page on it)
heh

thats enough to push you over your download quota :P

i have a 100mbit commit
i can spare some bandwidth

yeah, considering that you send a whole html page with meta, and send only headers if you do header('location:'); exit;

hmm

it just doesnt make sense to use html tags instead of headers

yes it does :P

when headers are 10x easer and 10x better

why does it?

well
id have to go with the fact it was really easy for me

because i said so!
:P

and one redirect isnt breaking the bank

does meta tags let you set the status header?

what he said :P

mhh
but i am silly noob

so you're making it up, and hoping we just accept it

im a shellscript kid with php

… yep.

In the case of duplicate field names, I believe they must be explicitly named and aliased.

http://me.com/page'); exit; ?

lol
mhh
hmm

meow

what if i have already sent a header?

Because people are too stupid to comprehend "headers already sent" errors.

you can have more than one header

why would you have? you haven't included your html crap yet?

hm that's unfortunate, since raw sql can do it. (It works now anyway since the fields are not that much)

^^ hey hey f00li5h

lol kuja

yes

no, too stupid to comprehend how to send headers twice :O

They're really easy errors to fix, and are the cause of a badly made application.

why would you have, you shouldn't have sent any output before you include your header

^^

purr

apache sends 3 or 4 headers (apart from the status) by default

But people are too stupid to understand 'em.

guess what's getting released today :P

time, modified date, server software etc.

that doesn't matter, you have to send /content/ for it to prevent you sending headers

5228/emerge/history.php does anyone know why that isnt

you're getting out of the lock down?

oh yes, we can totally tell whats wrong without the source

thaught so.

lol :P not quite

Why do you even bother still?

oh, i love the really really low contrast look too
ZOMG! TANGO CMS?!!

haha, yes

hi there

I normally don't.. anymore. I just tell them they're stupid and move on with life.
It seems that my first couple years in here was wasted effort.
There seems to be an endless count of NEW PEOPLE I have to explain the SAME SHIT to EVERY DAY.

http://pastebin.com/m1244f534

Seems like you picked up where I left off.

dear irc: YOU'RE DOING IT WRONG

i know

heh

sarcastic?
:P

well cant thank you guys enough for your kind help

yeah, i started dumping crap in POD pages and linking to them
but i've kinda got sick of that too

I might as well make a small website and point every user to it and it'll explain a bunch of commonly misunderstood concepts.

i did consider a bot, that listens, and learns the FAQ's, but that's tricky

I've just been given a php application that uses mysql to install, but our database servers are mssql. Is there an easy way I could make the application us mssql, like a wrapper service or something? Or would it be easy to replace all the mysql code with mssql code?

www.read-this-before-programming-any-php-or-asking-stuff-on-hash-hash-php.net

I guess I might introduce a FAQ feature into my blog…
If… I ever get around to writing my blog.

FAQ 1. do you ever bother posting anything new in this FAQ
there is no answer to this question, check back later

Or another useful website would be something like "PHP Errors Explained"

parse-error-line-12.net?
you could register every unexpected-*.net error!

would be ideal =D

:P

If they dont RTFM, do you think they'll read an FAQ?

put flashy images on it
they'll read

Of course not, that's probably why we have error_reporting(), so they can just hide the errors that don't matter to them.

Hah

Could you remind me WHY murder is illegal again?

read the faq and flash game site!

Because if we kill all the stupid people, we'll be left with an unbalanced world of senile smartasses

because otherwise everyone would do it

Ah, that's right.

##c
(channel full of senile smartasses)

Haha

as a ##c lukere hrmph hehe

is in C or C sharp?

##c

As in C

hello kuja

kuja is getting at Zh..

kuja, in seoul ?

slumming?

I could get used to Z.
But when EVERYONE wants to BE LIKE Z… then I've got major issues.

hehe i keep quite 99% of the time

yup

quiet

kuja, me too.. haha

how does one count how much elemnts are in an array?

kuja, what's are you doing? student?

count

php.net/count
nope, working
Cheong-dam Club Veil.

the other is dead, I'm out 10 thou on my block, I said screw it put the machine back together, and dove in here to cheer myself up to watch all the stupid questions roll by.

huk…

hi

hey

Here comes one now…

say I'm getting $myvar as a parameter of a function, can I detect whether it's a string of an array of string using a conditional statement?

if( is_array($foo) ) { … }

Sure, but WHY would you want to check if it's an array of strings when everything can be casted to a string?

f00li5h, you still haven't figured out the PM thinggy? :P

some magic juju with a recursive function

how do you mean?

Hey guys I'm stuck. Please Check out, look for the —— http://pastebin.com/d14ba939
Hey guys I'm stuck. Please Check out, look for the —— a href="http://pastebin.com/d14ba939"http://pastebin.com/d14ba939/a

pear.php.net/html_quickform

f00li5h, I just pm'd you.

use a loop

no you didn't

those are examples?

snd try to put positive checks in ifs they are generally faster, if(empty($_POST['blsh']))

what are?

f00li5h, yeah I did lol.

mattsaddy, php.net/for
for ($i = 0; $i $_POST['amount']; $i++) { echo $input; }

are you identified?

ty sean

mattsaddy, np, but please tell me what your name is based upon
are you call Matt Saddy, or are you 2 people, Matt and Saddy ?

or are you matt's daddy?

name Matt s for my address
mattsaddy@gmail.com :P

oh

If only I'd seen HTML_Quickform sometime in the last couple of years :P . Spent like a day writing an equivalent class :P .
uIf only I'd seen HTML_Quickform sometime in the last couple of years :P . Spent like a day writing an equivalent class :P ./u

*inserts new address*

Just FYI… your spam folder will get flooded

a day is not nearly enough to warrant sunk cost

:p

ill just have to create a new addy

are you australian matt

No, US cali

I guess not, f00lish.

hmm
is that cause you hate aussies?

umm duh

lol

I have a thing for writing everything myself anyway -_-;

oke, 'nough for me, have to work again -.-

Is it normal for a php newb to look at for and be like wtf am i going to do with this.

It's raining… a lot

you think you're better than the 10 pear developers that wrote it?

php.net/for

mattsaddy, for noobs yes, for coders no.

kuja, :-)

No umbrella at home

kuja, I living Non-Hyun

You have noobs, which will always be noobs, and you have the coders/programmers/scripters, that have a good sense of logic

That's pretty close to Cheong-dam

the latter will win and rule the world

Ofc not :P

OMG! Libra102_ I live there too!

kuja, I know..

yeah but they had to dev that logic as well as the code.

so why do you want to use an inferiour class?

I have to go to work soon… in Cheong-dam.
And I got no damn spare umbrella at home grr

kuja, programming is not your job?

Nope, not my job.

It's not necessarily inferior ;-;!

"Am I going to ask others are search for the answer mysef?"
when you really really really can't fix it yourself, you try again..

http://clubveil.co.kr/

well, you'll not have as many man hours to do it, and you just said that there are 10 better developers who've spent far longer designing/implementing the pear class

and if you still can't fix it, go to this channel, and ask for information

Sean true but I am still dev my since of research
Here in the channel I am guided to the correct sites and books.

That class in particular isn't too complex tho, IMO

which class?

So in 10 years i should be good.

HTML_Quickform
Looking at the methods it supports anyhow

html_quickform isn't complex, which is a good thing

Indeed, the point being a home made equivalent may indeed be just as good

We are close to Club Circle
Next to the Prima Hotel

They use like ScriptDoc in the comments =D

yes, sure, if you sit down and plan for every situation

kuja, ah.. ha.. but I don't know party life.. haha

Too bad
Tonight is the Goldfinger Pole Dancers performance with their own DJ. Tomorrow is the legendary god of trance Yoji Biomehanika

ive never heard of yoji and i love trance
emuling for it now

Because Yoji is the god in the Asia region. He's pretty much the only person who's accepted worldwide mostly in Europe.
http://www.yojibiomehanika.com/

kuja i don't have one particular artist i like the most. ashley casselle, george acosta, john aquaviva, richard 'humpty' vision

I'm mostly into psytrance. Mostly Skazi and Void.

i like more melodic with unusual spoken voice stuff in it
also, funky neodisco house and breaks

bleh, I hate house… but our DJs are mostly experienced House DJs…

where do yo live

We're lucky to get psytrance guest DJs. Our general manager, luckily used to be a psychelic trance DJ and he plays often.
psychedelic*

where is this?

Seoul, South Korea

oh ok
kansas city, missouri
most of the stuff we get here is a combination of chicago house and detroit techno
there's a dnb scene as well.

You like techno? We had Ken Ishii play at our club last weekend.
You should know Ken Issii man ;P
Ishii*

trance is generally discouraged because of the fact that everybody fucking does a lot of ecstasy and they are tired of the glowsticks because they attract cops
ken ishii awesome

Our artist caretaking was absent the day Ken Ishii flew in.. so since I was the only other person who spoke English I had to pick them up
He's awesome, and his manager too.
His manager told me, if I'm ever in Japan to give him a call… he said he'll show me what REAL high class clubbing is like in Japan.

morning guys - how can I get yesterdays date ?

malkav_, calling Ken Ishii trance is … uninformed at the least

strtotime()

i didnt say ken ishii was trance

Ken Ishii is techno

where did i say that

oh nm thought you implied it

nope

trance sucks anyway

sampling trance to other forms is better

give me oldskool rave, tearout breaks or d&b or minimal techno any day
or just hard thumping techno

i like blip stuff the 8 bit music
link
k
i listen to a lot of www.bassdrive.com
for dnb

They tend to repeat a lot of their stuff

well they are show-oriented
they rotate their archived shows
i bought some cds from them
they were top notch

malkav_, you should check NSB radio, live DJs almost 24/7 and all the shows are archived for you to download

you can but recorded shows on disc its pretty neat

Yeah I listen to BS
BD*

krisp, date ('d-m-Y', time () - 86400)

BS isnt always live but they are often

Indeed

an techno.fm's d&b station is pretty good too if you want a listen

i will check out nsb radio

everything from oldskool rave to breaks to dubstep to d&b most days

oh 8bitpeoples.com is awesome thanks for that

you bet
oh, don't set "let it snow" from "8bits of christmass" as your ringtone, or i'll stab you
well, i guess it's OK if you're not in australia

nice

Hi

meow!

Is it possible to create SimpleXMLElement with no root node?

no
that breaks the XML specification

I will add it later

create the elements individually and add them to an existing root node

you need a single parent somewhere

I know
But I want to create with no root node which I will add later

you can create elements
which in it'self will be it's own root node, and add it to a document later
but you cannot have multiple top-level nodes

I know
I will create LATER that TOP ROOT node
First I need blank instance

create your elements one by one

Like DOMDocument

in a temporary document with a root node, and then possibly add it to another one?

Maybe it's possible to change SimpleXML root node?

Module 'PDO' already loaded — its there any function to validate this module already loaded or not ?

Ox41464b lurk a while this channels been very inactive for the past 30-45 minutes expect responses around 6 am

Ox41464b, http://uk.php.net/extension_loaded

o lol
well crap im going to bed

HarryR, thanks…
*dang… i know this nonsense… parsing through phpinfo(INFO_MODULES);
ini_set('extension_dir', '/some/where/else'); this not modifyable through .php ?

http://uk.php.net/manual/en/ini.php#ini.list

PHP_INI_SYSTEM 4 Entry can be set in php.ini or httpd.conf
duh… im using php -n (no configuration.ini) through CLI
any others acceptable solutions ? (with -n enable)

yes,
-d extension_dir=/path/to/dir
php –help

Hi there, I'm having a problem with php 5.1.6, If I use error_log to output the value of a var I get "Object id #2" but if I follow that line with if (is_object(…)) { the is_object fails, has anyone seen an issue like this before?

AlexC_, …. that one kinda killing my CLI command

klattimer, what about a var_dump ?

ll try it and report back

hi
i am using jpgraph and want to pass data to the image script. I want to use POST to send data. How can I do it?

aloha

darkie33, use a HTML form and then access the variables through $_POST[]

object incomplete, seems I hadn't loaded the template class include. Cheers

hi there !
I'm searching in PHP an equivalent of the C enum.
Does anyone have an idea ?

ercete, there is none, you could use an array and check with in_array, though.

okay thanks

hi

hey

i have just installed php5 and apache2 on ubuntu
when ever i try to run .php file in fire fox it asks to download the file instead of interpreting the file any solution ?

Why is eregi('(.*)!(.*)@rockt\.es', ':killerfaultier!i=PsyBNC@rockt.es') !== true?

#apache

?

@blender_noob is php running at yout webserver?

go to #apache

Why is eregi('(.*)!(.*)@rockt\.es', ':killerfaultier!i=PsyBNC@rockt.es') !== true?

this may help to:
https://help.ubuntu.com/community/ApacheMySQLPHP
no need to repeat, we heard you the first time

ok, sry

:p

ouch :|

^^

how 're you doing dude?

I'm doing good, yourself?

not bad :P

great

^^

perhaps .* is eating rockt

.*? is what you may need :P

oh, thx

Does anybody know how I can create a unique type of encoding in php?

what does that even mean?

^_^
A function that incodes a short amout of data, similar to rotate13 or base64
encodes*

hash() ?

what do you want to use it for?
scalar localtime

(.*?)!(.*?)@rockt\.es

why use ereg?

@f00li5h - This is for a proxy-like script of mine

tehe, still no non-greedy support
and what is that good for?

why not?

preg is teh prefered, killerfaultier
s/teh/the

ok…

php.net/pcre

eger is functionality that is reserved for incompitent ppl.

What do you mean, f00li5h?

you'r nick is foolsih…

why do you need a wierd encoding for a http proxy

I readed it
but I can't find the misstake

Ugh, sorry - irony there, I was coughing because I choked on a cough thing o.O

that's fantastic

Anyway, I need it because people are beginning to catch on about decrypting the url and my sites are getting blocked - on first use

that's like being hit in the nuts with a bottle of "no more tears" shampoo

I'm trying to ensure that no more get blocked
I just need a simple way of encoding these that's unique

but your browser needs to be able to decode it again

It means ! must be \!?

I just don't know in what way to do it =/
No, the URL is the only thing that's encoded and because it works by $_GET variables, the browser doesn't need to decode it at all

is it possible to fwrite to a file located on another host ?

no, it means you've got a ! after your closing delimiter

*remote location

oh, then just use base64

-.-
*sigh*
Base64 is what's used already
(As is Rotate13)

what's wrong with that?

Because filters these days are decrypting that, and blocking my sites automatically

Tobias|, think about it - why are they blocking your sites?

oO

you're taking the wrong approach mate

waht is hiere wrong?

ähm (.*?)!(.*?)@rockt\.es

What do you mean, HarryR?

are you on Linux?

are you trying to surf pr0n at work?

yes, Im on Linux

No.

Debian

Tobias|, why do they want to block your sites, and why are you trying to avoid people from blocking it?

apt-get install kregexeditor

ok

Because my sites are moneyspinners, if they're blocked there goes the revenue ^_^

Do you mean my PC is on Linux or my Server?

no, you'res till not getting it Tobias|, what are you doing wrong that makes people want to block your site?

Also, proxies are blocked by default at places like school, or in China or the UAE

PC
ofc.

oh, right proxies

nö, my PC is not on Linux

Shame.

*no
On my PC is Linux, too
Shoul'd I change?

if your site is blocked by their proxy, why would people be able to visit your proxy page?

Multiple URLS/IPs

yeah, but what makes you think that they won't just block your proxy site?

One Minute, I'm changing the OS…

Tobias|, then just write a PHP script which outputs everything using XOR encoding, with a different string each time

on Linux you have this nice program..
called…
kregexpeditor

good point

If you are on Debian or Debian derivative you can easily install it by saying sudo apt-get install kregexpeditor to the console.

Comments

im getting out of memory errors in my image handling script i *think* its because im handling images that are

, it's only used to execute the contrusctor method ?

With a good command of regualr expressions one can parse anything
it's just that most people don't know how to use them properly
while I don't recommend it, it can be done in certain situations

i use regex coach to test it - with your html source

xushi, what value were you wanting to change?

there is no such thing as a good command of regex
all regex is bad!

You're absolutely incorrect. Once you master them, it's pretty straightforward. But, it's like learning a new language.

I agree with MikeSeth, parsing HTML with regexps makes your hair fall out and God kills a kitten

font size="1" with font size="8px"

~parent

Comments

I am getting an error while trying to render a JFreeChart in a portlet BarChart could not be created and in my

I'm not sure how you relate profile to unit testing or similar? maybe I phrase my question properly.. My specific goal isn't a performance regression testing if that's what you mean

For wicket: They provide a unit testing utility iirc, consult their docs. No idea about hibernate and I wouldn't know how to test velocity.

yeah. I actually use the wicket tester currently.. mostly looking for general feedback outside what I can dig up with googling.. how others may deal with coming into a situation of 300 velocity pages.. 100 wicket pages. a weekly release cycle and ensuring everything keeps a high QA..
implementing developer policies for issue tracking.. regression tests.. etc..

yo fellows. does java have any standard, generic solution to the problem of serialization of generics?

produces a warning

no, not unless you count on @SupressWarning

ernimril, a trivial solution is to write a wrapper class, something like MyClassParameterClass
ernimril, but that leads to an excessive proliferation of classes

to be "Hi" and "there".

~tell sebdah about javadoc String

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

I'll check it out
thanks

how can i track what keys are pressed when my X resends keyevents if key is held down? i get keyreleased always after keypressed.

guys i put the WTP plugin on eclipse and started th etomcat from the own Eclipse, but when im trying to access the http://localhost:8080 it shows me HTTP status 404 The requested resource (/) is not available. any idea ?

have you got a webapp running on the server ,

and on which servlet-mapping

in a 2 dimensional array, do all second teir arrays have to be of the same type as the first array?
like if i make an "int[][] my_array = new int[3][]"

java only has simple arrays, but note that an array is an object…
so you can create an Object[] that stores a String[] in position 3 and a int[] in position 42

then can i make a "char my_array[0] = {a,b,c}"

but you will need to cast to get the right one…

what's it mean 'to cast'

~tell Garda about cast

Garda, cast is a way of changing the type of a reference (it NEVER changes an object), or converting between different primitive types. (Type)expression casts the result of expression to Type.

Roooooony yes have… when i do start the tomcat outta eclipse it works fine, but when i do from eclipse it doesnt

ok, thanks

and have you deployed the project on the tomcat4 hosting within eclipse ?

how can I add a String to a String[]? Can't see anything that matches in the API
is it even possible in Java? Maybe the array can't take any more fields after the init?

by add you mean extend the String[]'s size?

yeah adding a new value to the string

you cannot extend an array's size

just make a new one and assign it to the variable

ok

or use lists

can you make custom operators in java?

I have to use arrays =(

Roooooony no, in eclipse i just started the tomcat!! a doubt, i just can run the pages deployed on eclipse api hosting when i start from there ?? i cannot see the default one ?

But I know how many values it'll be so I can define the array after that value.
Thanks!

can you create array style access [ ] to a class in java?
like in c#

array style access?

ello.. this line is giving me an error: Array.getLength(inputString.split(" ")); java 1.6.0… any ideas?

no

and we should guess the error?

oh sorry

you can't override operators like in C++ (and I assume C#)

argh ok

that would require operator overloading which isn't permited in java

thanks paulweb515

try inputString.split(" ").length

variable Array

anyone know of a good way of distributing java applications?

ta

Run on Server

without requiring the user to have java previously installed

and see if you can get something running that way

webstart
mhm, na, maybe
not

does that just make web applets?

nope, applets and webstart are different things
but my idea fails
ship a jre

basically looking for best language to create commercial grade software
that's easy for developers, and easy for consumers
c# needs .net framework, which is a bit of a pain if users need to upgrade their computer with 50mb upgrades.. it does however have automatic upgrading
python is ok, can make 5mb executables with no dependencies, but very hard to encrypt it to stop decompilers

same restriction applies to java (as .net)

c++ is just painful to work with
yeah, same restriction with java.. except microsoft dont work hand in hand with sun.. so installing jre isnt as easy as installing .net fx

if you're doing a rich application targeting windows, go for .net I'd say

yeah.. except it's not multiplatform
and cant really be ported easily

thanks roneau16_

visual studio has some very easy installer creator that will take care of installing dotnetfxx

in theory, .net is cross-platform

mono

welcome cyberdork9000

yeah.. but it still requires an extra 50mb tagged on
java has srt which is great for multiplatform

but depending on who you target this might not be such a big problem. ati control center requires .net already. so any computer with windows and ati gfx, has it

and python can do ok aswell

vista is shipped with it (99% sure)

it comes with .net 3.0
which is great
but.. not many people use vista
at the moment we're moving forward with c#.. but always on the lookout for something bettter

I'd go for c#

if we were to develop for macosx.. then we'd be looking at objectivec

nicer language, winforms are easy to use and well integrated into windows (unlike swing).

and then web development is a whole other bundle of sticks
software development is just such a mess
maybe mono will save us all some day

no

nothing will save us all some day.
different jobs, different tools.
all you can hope for is better interfaces between them

why not take the c# talk to #csharp

please shut up
im talking about languages in general

let's talk about brainfuck

0
good exercise in compiler writing though

maybe because it doesn't have a multi-billion company to promote it

haha 'promote' ?

advertising

no amount of promotion would make it viable

You wanna be cool? Try Brinfuck 2000

or ook.

'spending too much time being productive?' - brainfuck
it'd work for sure.

Heh all.. anyone using json-lib ?
Trying to work out how I can JSON ify a HashMap of objects, neatly

~anyone

Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.
bInstead 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./b

oo, new factoid. good one

Ok!
I did both !

I guess the factoid 'yes, i did' might be appropriate:
I thought so. *shrug*

thankyou

_Bradders, I have no idea what thankyou is.

Why am I not surprised

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

haha

This is getting me nowhere
But its strangely amusing

~java

Aradorn, java is not an acronym, see http://java.sun.com

thankyou is You're welcome

Okay, csaba.

thankyou

csaba, thankyou is You're welcome

forget thankyou

I forgot about thankyou, csaba.

Hello

commands

csaba, I have no idea what commands is.

on thankyou say aaa

I guess the factoid 'sensayuma' might be appropriate:
ain't you got no sensayuma?

factoid aaa is bbb

Okay, csaba.

aaa

I guess the factoid 'factoid aaa' might be appropriate:
csaba, factoid aaa is bbb

forget factoid aaa

I forgot about factoid aaa, csaba.

help

See 'help about', 'help factoids', 'help javadoc', 'help karma', 'help abuse', 'help literal', 'help magic8', 'help google', 'help rot13', 'help dict', or 'help tell'.

help factoids

See 'help factoid add', 'help factoid replace', 'help factoid forget' or 'help factoid retrieve'.

help factoid add

To add a factoid, use the syntax ~key is value, e.g., ~cygwin is a POSIX emulation layer for Windows.

I've been out of practicre for a while

help tell

You can tell someone else about a factoid by doing 'tell nick about factoid', e.g., 'tell ricky_clarkson about karma ricky_clarkson'.

can anyone offer me some homework problems to do?

calculate the shortest path from a to b

without a*

and or urls that offer small programs to do?

seriously. Try doing pathfinding. Its very interesting topic

try pathfinding with weighted connections, and the weights can be negative, so you can't use dijkstra's algorithm :p

Alright, so I have a method, @Foo String bar() {…}, but when I grab the method with reflection and do a barMeth.getAnnotation(Foo.class) null as returned as if it didn't have that annotation. What's going on?

ok how can I teach the javabot to say "You're welcome" and not "thankyou is You're welcome" ?
learn You're welcome

I guess the factoid 'learn programming' might be appropriate:
http://www.norvig.com/21-days.html - great advice on how to become a good (or outstanding) programmer.

aaa = bbb

csaba, I have no idea what aaa = bbb is.

aaa: bbb

bbb is.

Please does this in PM as to not clutter the channel

what should i read up on if i would like my program to kill itself after issuing my quit command , i got iot to quit the server but i need to manually kill the process

http://javabot.sourceforge.net/

System.exit(0); ?

that easy huh? :P thanks

eww…

should i not use that?

It does what you're looking for

ok , thanks alot you guys

so those two urls should help me out?

javabot learn thankyou You're welcome

I guess the factoid 'learn programming' might be appropriate:
http://www.norvig.com/21-days.html - great advice on how to become a good (or outstanding) programmer.

!learn thankyou You're welcome

I guess the factoid 'jsf welcome file' might be appropriate:
csaba, jsf welcome file is http://learnjsf.com/wp/2006/12/19/jsf-welcome-file-gotcha/

~javabot reply

Just try ~reply, Aradorn.

~reply help

I guess the factoid 'help factoid retrieve' might be appropriate:
To see (retrieve) a factoid, type ~key, e.g., ~cygwin.

gah whatever its not that important

~reply thankyou You're welcome

I guess the factoid 'spring replyspring' might be appropriate:
csaba, spring replyspring is an IoC framework. It can be found at http://www.springframework.org

Alright, so I have a method with an annotation, but when I try to access that method with reflection, getAnnotations().length called on the Method, returns 0
http://pastebin.ca/651083
Any suggestions?

Anyone with knowledge on el on tonight?

~anyone

Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.

http://www.ibm.com/developerworks/library/x-html5/?ca=dgr-lnxw01NewHTML
a href="http://www.ibm.com/developerworks/library/x-html5/?ca=dgr-lnxw01NewHTML"http://www.ibm.com/developerworks/library/x-html5/?ca=dgr-lnxw01NewHTML/a
woooooo

http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html

ok, so el is converting a string with a . in it back to a float. Can I stop it (I'm losing 00's of the end of identifiers)

You can adjust by adding on a ".00" when rendering occurs… but find a better solution then that
if you can

!learn aaa bbb

csaba, I have no idea what !learn aaa bbb is.

Does anyone have a url on assignments to do?
rather basic ones, I haven't been coding in a while

to learn me something");

Please! /msg her. And google or read the docs on that link I sent you
ah

it should work

~csaba

leip, I have no idea what csaba is.

~csaba is smelly

Okay, leip.

~csaba

leip, csaba is smelly

See?

yeah but it still has "is"
I want it to say "You're welcome"

Yeah, no clue there…
Try #javabot?

forget csaba

I forgot about csaba, csaba.

!foo
~learn aaa bbb

aaa' might be appropriate:
aaa is say fff

Outdated I'm guessing

ok i give up

you need to specify @Retention(RetentionPolicy.RUNTIME) @interface FooAnnotation {} on your annotation

Sorted http://flexjson.sourceforge.net/

Thanks!
You're a life saver… really. Thank you

i learned something too =P never written an annotation before

Awesome, thanks for the chat guys, seems if you use the more standard c:set the variable is keeping the trailing 00's, but the s{truts}:set was losing it. Seems like a framework issue more than a el issue

Was that sarcasm?

http://www.jroller.com/objectpool/entry/first_post - please comment on the locking ( ernimril: I've added finally clauses)

That's my favorite part of answering questions

Wow. "Frist post" even made it into urls these days?

Did you see how I was using them? Cleaning up a command/front-controller pattern

at last someone got the joke.

Frist!

yeah, that's kinda neat

Zaph0d^: I like the name of the blog!

Zaph0d^: the domain wasn't slashdot.org

Zaph0d^: Beats my "Of Great Geekary"

/. offers blogging services?

Zaph0d^: no, the joke about first post

ah.

although, I think slashdot does have blogging in the form of its journals

!( @|=

there aren't that many "first post" in /. nowdays. at least not in the articles I'm interested in reading the comments of

but i don't think they are very useful
i guess that crowd moved on to digg

I almost named it "for Pony!", but then thought of "the object pool"

w/ANT what would be the best way to have a text file of a list of files and put it into a fileset?

fileset includesfile="filename" /

oh, I was trying to overcomplicate things as usual. thanks joedj

anyway, I'm still waiting on comments on the locking…
also - I'd love to know how you all test multi-threaded code

Hello folks. Quick question. Do i need to set a System variable of something as the javac is not recognised as a command though my cmd prompt

[-Haza-]: it needs to be on your path… what os?

XP sp2

Ya, you go into my computer or something to set the env vars in windows, right?
right click on my computer*

PATH underneath System variables

add your directory containing javac to the end of that list

Okay im there at the systems variables.
perfect i will give it a try. Cheers

I am getting an error while trying to render a JFreeChart in a portlet. "BarChart could not be created" and in my logs it claims, "No space left on device". The portlet has been working fine for several months, this message just started popping up recenetly in all portlets that try to render
a JFree Object. I have googled this error and check tmp space and other partitions and there is plenty of space. What should my next step be?

Semicolon to seperate paths?

haza yes

Thats perfect. Its working now. Sorry for such a simple question

has anyone managed to get decent feedbacks from a printer/printJob using JPS (javax.print)
because it's supposed to give informations such as print job status (success/failed) and so on
unfortunately once my job has been started, the listener never gets called.

i was working with javax.print the other day, and Wasn't Impressed. maybe i just dont' get it. i ended up replacing it with an exec that called acroread toprint the file for me

well I'm writing a big print server system with printers in different places on different computers.
and so, not knowing what happened with a printJob is a real issue.

i hear that. i don't have nay info, sorry. i found the web sorely lacking in detail - and the javax.print api docs… tortuous.

You could try the forums at javaranch.com
Or, well, write it in another language

thanks for answering anyway :-) at least I know that I'm not the only one who tried jps

don't think javax.print is production worthy

I bet there's a third party api that's better

any one have further thoughts on my issue from above

bah.
i've used javax.print in the past quite successfully

leip i'll tthink about javaranch

thing is, I currently only have one printer to test it on, and it might just be that printer that sucks.

Bug report?

I just need to know wether or not my job was succesfuly printed.

we didn't do anything like getting responses back from the printer.

ugghhh, freaking boob admins just waxed about 20 gigs of data I was working with…. I hope they have a backup

but we dropped PDF files and the like to the printer.

yeah managed to do that too, I'm just having nasty issues with the listener on print jobs.

i haven't messed with that part. sorry.

I asked a new printer, hope this helps me understand what's going on
thanks everyone anyway

cheeser you have been a lot of help to me in the past, do you have anything to add to my issue written above?

i didn't see it. just got back from a meeting.

i'm actually surprised at how widespread pdf generation is.
it's sort of nice.
i switched to generating my print job via pdf. it's nice.

That's what you get with an open format

i'm still using hte lowagie toolset - i assume that's reasonably current, yes?

Well, when that "open format" isn't xml wrapping propriatery binary blobs and requiring compliance.

*cough*

cheeser can i repost?

it's for very specific printings here using thermal printers with custom formats. pdf won't help here, at least not for this

thermal printers. you doing labels?
please don't msg me

sure

mmm. thermal printers. worst. printers. ever.

then ignore my answer

anyway - i'm printing to CR80 badge printers
thermal transfer onto PVC cards.

Does anyone know of any chans relating more towards network security?

I am getting an error while trying to render a JFreeChart in a portlet. "BarChart could not be created" and in my logs it claims, "No space left on device". The portlet has been working fine for several months, this message just started popping up recenetly in all portlets that try to render
a JFree Object. I have googled this error and check tmp space and other partitions and there is plenty of space. What should my next step be?

with JDBC is calling close() on Connection a slow process, i.e. could it introduce a delay into an app

what does this line do? return (item.getIndex() % 2 == 1) ? "even" : "odd";

if item.getIndex() is an odd number, that expression evaluates to "even". otherwise (if getIndex() is even), it evaluates to "odd"

ohhh, i see
thanks

terinary operator

Hmm.. Can anyone tell me why JPQL is any better than SQL in terms of "different languages in one file" or "relying on untyped literals"? Seems to be no step forward for me.

x % 2 means "what is the remainder of x divided by 2", if you didn't know that part

condition ? ifTrue : ifFalse

I was just reading about the "modulus operator"
thanks though

I believe he has "joe" if that's better…

i've had mine registered about 2 years longer! ;-)

Oh, it is a free world
tab completion just sucks.

Free to be arreseted

The world isn't free, the people in it are.

for the info, it looks like network printer never give feedbacks about job status.

Don't get me wrong, I love musterd, I'll put it on /anything/, but this Dejoun Pub Style Musterd ruined my sandwhich :-(

'musterd'?

mustard…
whatever

i thought it was some new daemon.

hehe

it musters the troops out on the pavilion

I have a Dispatcher class that creates a thread. The thread immediately calls this.wait(). But next the Dispatcher finds work for the thread and calls threadObj.notify() to wake it up and let it know there is work in the shared mem. But I get an IllegalMonitorStateException on the notify() call,
meaning the Dispatcher doesn't have a right to message that thread. What am I doing wrong?

sorry. i dunno what would cause that.

It's better than the daemon that tars an archive…

tard!

"retard" ;-)

Does notify have to be called inside of a sychronised block?

okay thanks cheeser

It's taring it a second time.

Hmmm, im getting a "cannot find symbol" error message when using javac. I have written two .java files in the same directory. surely i do not have to import one into the other?

yes, both wait and notify do

Thanks, and I guess that should have been obvious when messaging a thread.

[-Haza-]: are those classes in a package?

Nope. It is a very simple tutorial script

if not, it would have been obvious from the javadoc ;-)

[-Haza-]: there you go. put them both in a package

~pastebin

http://eugeneciurana.com/pastebin

Hmm, new question. Do calls to wait() stack? What happens if the thread and the dispatcher both call wait() and the thread. Does one notify() suffice to wake it?

notify will pick one of 'em and wake it. notifyAll will wake all and let 'em compete

No, I mean wait() is being called twice on the same thread.
then a single notify() being called.

then at most one of the threads will wake up

you mean 'same object' rather than 'same thread', right?

There is only one thread.

if a thread is blocking in wait(), how can it call wait() again?

it calls wait() on itself, and the dispatcher might call wait() on it. But then the dispatcher will eventually need to call notify().

if you have a moment to have a look? - http://eugeneciurana.com/pastebin/pastebin.php?show=3550

the dispatcher can't call notify if it's sitting there waiting

then there are two threads, not one, and when some third thread calls notify then at most one of them will be woken up. Also note that calling wait() on a Thread object does not cause the thread represented by the Thread object to wait, it causes the calling thread to wait using the Thread
object as a mutex. Confusing, no?

er, condition, not mutex

The dispatcher would never call wait() on itself. It is calling wait on the threadobj and the theadobj might also have called wait() on itself, it it sees no work to be done.

if the dispatcher is calling wait, then the dispatcher will block in wait.

hello, i have installed advennet cvs package ,it comes with tomcat and mysql but i want to use existing tomcat and mysql,how can i?

it doesn't matter what the dispatcher calls wait on, it'll still be sitting there waiting. i'd go read the javadoc if i were you, it sounds like you don't really understand what wait/notify do

the dispatcher is not calling wait(), it is calling threadobjworker.wait()

it doesn't matter.

that sucks

there are very good reasons for it to be the way it is. Pausing arbitrary threads from the outside would lead to programs potentially being in inconsistent states.

So theads can't make other threads wait. threads have to know when to wait on their own, which means cpu spins will be wasted.

I have a strange problem.. I have two classes that I can complie correctly [package ubs]
but when I try java ubs.classname
it says Class not found
a friend of mine has no problems

threads make other threads wait all the time. by acquiring locks

anyone who could help me?

I guess I could create a locking object, but I like thread messaging, much cleaner (if Java actually has it working, not so much in Perl).

where are the .class files relative to where you're invoking java?
BlockingQueue

they are inside the ubs/ folder

And you

me I am in example/

(sry) You're not running java ubs.Classname.class right?

ubs is inside the example/
Blafasel right
java ubs.Classname - that's all

Paste the error to a pastebin. Look at the topic if you don't know one.

java -classpath . ubs.Classname may or may not help

Good point. I was about to ask for the $CLASSPATH

ojacobson same problem

mm. if CLASSPATH is set all sorts of irritating shit like that happens

with the line you suggest

nothing

then I would suggest the class files are not, in fact, where you think they are. Are you on windows, linux, mac os, or other?
bthen I would suggest the class files are not, in fact, where you think they are. Are you on windows, linux, mac os, or other?/b

linux

can you slap the output of 'ls -R' on at the end?

sure
sorry, it takes long…

[-Haza-]: get it figured out? i was away for a sec…

for what it's worth, "messaging" between threads is really just letting one thread hand off ownership of some data and another thread pick it up. BlockingQueue forces both sides of that to happen simultaneously, but there are less syncrhonization-inducing alternatives, too

http://eugeneciurana.com/pastebin/pastebin.php?show=3550
i pasted the code. Its really really simple tutorial and requires no special packages =/

[-Haza-]: first tip. as a newbie, never assume you know that something isn't required.
i already told you to put them in packages.
try that and see if it works or not.

Okay.

Thanks, I'll check it out.

~packages

cheeser, packages is http://java.sun.com/tutorial/java/interpack/packages.html and some example http://javafaq.mine.nu/lookup?254

http://code.bulix.org/e594qv-51871

Cheers

[-Haza-]: put both source files in a subdirectory named after the package ("example", say) and add "package example;" at the top of both source files.
*clickie linky*

?
ojacobson what does "*clickie linky*" means?

that I'm reading

thank you
the classes are an example from a tutorial
don't spend too much time on them

I'm not
Is that actually your entire compilation line?

yes

I ask because I don't see any reference to junit on it.

no problems about junit during compilation

Did you put junit in the JVM extensions directory? (If so, don't; it's a nightmare waiting to happen)
This worked for me (where ~/.m2/… is where I keep my junit jar) $ java -cp ~/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:. ubs.BoundedStackJunitTest

the compliation works correctly
I think I have junit somewhere ubuntu took care of it
/usr/share/java/junit.jar
does it work for you?

[-Haza-]: works, yes?

Yes, if I compile with junit on the compiler classpath and run it with that classpath, it works fine
Something about your environment is weird

it seems… any idea?

what's "java -version" tell you the java version is? If it says gcj, you have a problem.

and will likely be banned
P^)=

Still reading mate. Feels like being thrown in the deep end

java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
I am using Ubuntu

you could try "java -cp . ubs.BoundedStackJunitTest" for kicks, though you don't need to do that on any of my systems

[-Haza-]: heh. it's fundamental concept that, once grasped, simplifies so much.

hi ;D

joedj same problem, if I use that line

I can understand that. Just hard going from years of PHP to Java.
I can understand that. Just hard going from years of PHP to Java.

~php

eidolon, php is the solution of choice for relaying mysql errors to web users

But so help me. With all the amazing Java applications out there how could i resist but start to learn! =D

any idea?

~JLS

http://java.sun.com/docs/books/jls/

[-Haza-]: resistance is futile

So true!

Hm. An interesting consequence of dependency managers is that they encourage you to have a lot more dependencies.
bHm. An interesting consequence of dependency managers is that they encourage you to have a lot more dependencies./b

heh

what's worse, depending on code you wrote (and have to maintain) or depending on code you didn't have to spend time writing?

I have five different versions of the Free Software Song on my computer that I just keep looping through…

The latter certainly encourages code bloat.

dependency bloat is not code bloat
Overly broad deps are a sign that one module may be doing too much, though

its a good thing.. its resuse

Isn't "doing too much" Spring's motto?

Possibly. I don't do Spring.

so, at the risk of everyone going "WICKET!", i'll ask anyway - i'm going to be converting my app from PHP + xmlrpc + standalone server to a JSP + servlet tomcat app. i've -never- written a pure java webapp before. I assume rather than hand-code my own servlets and MVC structure, i should use
a framework. should i learn struts or spring? (thinking also about career / knowledge enhancement here also)

WICKET!

~lart whaley

eidolon, I have no idea what lart whaley is.

oh that's sad.

definitely learn spring

Struts2, wicket, spring (not mvc)

yeah. avoid spring mvc.

freemarker vraptor
hibernate

worst. web. framework. ever.

heh.
so spring mvc != spring ?

no

why?

what is spring vs spring mvc

Ruby on Rails!
;-)

*lots* of xml. lots of hand rolling everything.

spring mvc is a spring subproject designed to make web development more like other UI development

i've only used spring ioc and some of its jdbc abstractions

spring is an umbrella term really.

ah

nothing else really

most people mean springs IoC when they say spring.

gwt !

(loc?)

(inversion of control)
(aka "dependency injection")

but its got all those dam axis libs!
url

http://en.wikipedia.org/wiki/Spring_Framework_%28Java%29
dude, wikipedia. spring. it's not hard

ejb3 + jpa is pretty tolerable, if you don't mind using a full-blown app container
that's fairly heavy though

kik try their website
why is htat

we're using ejb3 + jpa now for another project
but for my app that's overkill.

*nod*
can you move to Vancouveer?
-e

there is always hibernate3 annoations in tomcat

… i wish

which is what I do.

i can move

can i telecommute?

vancouver, eh?

speaking of
must be off to work

~tell ojacobson about gettowork

ojacobson, gettowork is http://www.despair.com/gettowork.html

hows the clustering/ and failover on tomcat… you on v6

/topic

if anyone needs me I'll be debugging XA stuff

we don't use it

why not.. how do you you deal with load and uptime.

heh. folks don't like Struts very much, do they?

i used to.. now struts2 is ok.. ie: webwork.. but i have my own tools that are easier

"You'll always miss %100 of the shots you take and, statistically speaking, 99% of the shots you do"
*don't take
damn it…

task. some of those sub-projects do the same, eventually causing a sub-project to needlessly be compiled more than once. with make, i'd prevent dropping 'stamp' files to mark a project as already being rebuilt but i'm

hopefully this potential job will happen (its doing core jse work for a company that is now owned by yahoo!)

or please let me know if there is a better place to be asking about this

hoping that will help me expand my skills

stew, your question cut off at 'being rebuilt but i' … '

stew switch to maven

i knew someone would say that…

use a master POM
glad to help
hehe
try "up to date

If you really want to hone your skills, the best way is to buy books in other languages you're better at and do the exercises in java

…i'm wondering if I'm missing something, since implementing somehting that checks for stamp files in ant seems to not be straightforward

Or google for tutorials of other languages and do the same thing

you could do that in ant. it sounds like your'e trying to get around ant's smarts by thinking Makefile wise though.

You could also come up with some fantastical goal that seems impossible and try to reach it
That's how I learned C++

ant knows whether a dependency has been built already in its run. so if you have 3 ant tasks that all have a dependency 'a', it'll only build 'a' once.

yes, that's why i'm asking here first. becuase if ant has the smarts to do this a better way, i haven't yet found it

My Hello World application was a steganography engine

vb ou delphi? what is bad ?

right but dont use ant or the antrun task

right, but i'm making recursive calls to ant to build other projects with their own build.xmls

if the build has already been done, it might run through the compile task, say, but it won't recompile.

eeee.
yah, waht cheeser said.

You left?

to check that the jar, say, is already built and skip it.

Did you get my messages?

but defining the uptodate check correctly can be tricky.

they also run java code that auto-generates other classes in other projects

stupid cgi client
heh no

and generating those other classes makes other projects look out of date

stew yoru dependancies are hoarkd then

so i guess the real answer is to figure out how to not generate those classes unless something has changed

i know java, i just need to find time outside of work to learn things like ejb3, jpa, etc…

I suggested you following guides and tutorials for other languages and implement them in Java. I also suggested that you start a project with some crazy goal and try to reach it.

uptodate

join a jakarta project

Good suggestion

hmm

javabot uses JPA/spring/wicket
8^)=

unfortunately my source in this case isn't a flatfile but a postgres database

thanks leip

yeah i need to do something more advanced

ho wicket!
wicket bites lol

~smack hanasaki

Learn lisp
Please don't hit me again, daddy…

lol you would like it

learning another language isnt the problem
its finding the time to learn th emore advnaced techniques

though uptodate will fix some of the dependencies, thanks

bbl

I was kidding about Lisp… although it does give you a new perspective

being married plus a 1.5 hour commute hurts my learning time

Come work for me.

then do the projects in both lisp and prologue

Although I can't pay you anything

yeah but ive already learn a functional language (ocaml)

were are you at

Tallahassee FL

ah.. I am down by miami

well i live in south ga, and drive to tallahassee

was in jax monday

yahoo just bought a company that has a dev team here in tallahassee for like 100 million and they are hiring some junior java devs so im going to apply

hmmm have a url?

http://www.rightmedia.com/
one of the guys i work with has a contact there

i skip any posting with a title of "junior anything"

Why?

ditto

heh

thogh you had a great gig going

i don't consider myself a junior dev and certainly don't want to get paid what they get paid.
8^)=

well they pay better and have good benefits so i dont care what the title is atm

Well, "senior" devs are those that are promoted out of the way, which cannot grasp new concepts anymore
You have to be somewhere inbetween

yeah

sign me up. and send the paycheck

~Blafasel++

blafasel has a karma level of 25, leip

and why didnt i get karma for suggesting a jakarata proejct? :P

have you seen jakarta code? you're lucky you weren't banned.
8^)=

rofl
thats why its a good suggestion.. he can fix it
so you dont use any jakarta stuff eh

ive got some cool ideas im going to work on that hopefully will push my experience up a notch or two

i do actually

hmm why.. if its so bad

back in college i had tons of free time, so i helped build a 35 node beowulf cluster that crawls the net and indexes the words it finds

ever read the ant code.. clean but Hard to follow

clean? ha. hahaha. bwahahahahahahahaha.
whew! hahahahahahahahaha
ahem.
tee hee

ever mess with ultramonkey
lol in lucene eh

no
arg ok im going to figure a way to connect to irc without using this damn cgi client

i have a question about jar files. say i'm using eclipse to develop my java app. i import a few jar libraries to use in my project and add them to the build path. now i want to compile my project into a jar file. should i want my imported jar files to be included in my project's jar file? should
i put my project's jar file in the same directory as the jar files that were imported?

~tell epswing about manifest

epswing, manifest is http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Manifest

Ho hum. Anyone played with the Spring Rich Client project? I can't tell where it's storing the passwords for its sample application in order to actually play with the damn thing.

I just thought i would put those two calss files through the Eclipse IDE. I can see now that the syntax is correct as the program compiles. What exactly is Eclipse doing that I am not when trying to compile the program with javac?
*calss/class

i dunno. personally, i don't think you should be using eclipse just yet anyway.
~newbie ide

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

lol. you have ananswer for everything
*answer

[-Haza-]: We all would have said the same thing… well most of us anyways

I do agree. To be honest, i use Notepad++ for everything!

[-Haza-]: dude… emacs.
[-Haza-]: ;-)
[-Haza-]: or vi
*vim

vi!!!

I was about to say
little difficult with Vi

xemacs

booo! ;-)
Gnu Emacs

vi!!

my boss's boss laughed at me when i told her iwas going to use vi
she said no you are not, we use my eclipse (rofl) around here

Same here

maybe she thought vi == 6

haha

Hehehe, tbh, i havent actually installed VIM onto my linux box just yet so im still using VI for that

haha
there is a guy at CNN in Atlanta that is a master at vi

holy shit. Another rough day for the market

so emacs or xemacs?

vim!
8^)=

vim!

netbeans.. ide war lol

PostgreSQL!

[-Haza-]: emacs vs. xemacs doesn't really matter, i recall

Netbeans was waaaay too confusing for me tbh

[-Haza-]: but probably xemacs then

funny.. eclipse confuses me

As i said before. It was Notepad++ for me. Gotta love flaming people that use Dreamweaver!

jEdit FTW.
jEdit is surprisingly fast; Eclipse lends credence to the "Java apps are slow" rumor
.. o O ( but only slightly less so than OO.o )

and have a huge footprint

netbeans all da way!

Right. Well im going back to a text editor for the time being. Assuming i can get this javac command to compile my programs =/

and some punch cards for fun!

I have a udp message to send. In that I have a name, should I close it with a \x0. Or should I put the length of the name infront. This is basically String.length() vs \x0 what one would be fastest and how much faster?
it is for a critical server application.

Just checking if anyone new has arrived in the room and can comment on my issue from above.
What are some spots to investigate as to why i am getting a No space left on device message being thrown to my portlet when trying to render a JFreeChart?

maybe you're not looking at the correct device
check the stack trace and see what part of the code you're when you get that.

How do I pass a string by reference?

I think all strings are passed as references…

Arg, http://www.yoda.arachsys.com/java/passing.html

maybe the disk is full ')

well, right.. you pass a reference to a String..

~tell perlmonkey2 about pbv

perlmonkey2, Java only supports pass by value, not pass by reference (references to objects are passed by value). See http://tinyurl.com/ynr5d3, http://tinyurl.com/ywlv6d (especially http://tinyurl.com/yvppac), and http://tinyurl.com/4wgdh (search for "Passing Reference Data Type Arguments")

More globals

what's the difference between "pass object by reference" and "pass reference to an object by value" ?
or is there any?
[because if there is, I dont get it.]

the reference value is copied on to the stack.
so that you can't reassign the reference in a method and affect the calling state.

right, that's what it means the reference of the object is passed by value. But how is that different than saying that object is passed by reference?

because "passed by reference" means something completely different to, say, c/c++ types.

because my understanding of "passing by reference" implies passing (by value) reference to an object rather than the object itself.

!

hi, where should i go to, to ask questions about my Idea debugger disconnecting from the VM suddenly (without the VM crashing)? I am using sun JRE 1.507

Did you check the bug tracker?

i'm checking it now. dont see anything yet…

i've not had that problem.
in C, that still means something different, iirc

well, wikipedia makes a distinction between passing by reference and passing by address, with latter being a subclass of the former… maybe that's what you mean?

http://blogs.sun.com/alanbur/entry/xml_based_j2ee_frameworks_considered
what do you guys think about that

i dunno. haven't read the article.

Anyone here uses JPA?

neko kun :'D

what?

oh, okay… I guess I'll then stick to my understanding though, hehe

nekokun, kawaii nick ^_^

~tell uttumuttu about gosling

uttumuttu, gosling is a pure java build system. It can be found at https://gosling.dev.java.net

~tell uttumuttu about wicket

uttumuttu, wicket is a component based web application framework written in java. See http://wicketframework.org/ for more details.

iow, i'm right on board afaict
8^)=

thanks ^_^
Anyone here uses jpa? Java PErsistence API…

SOrry, i got kicked off can someone please spot check my message from like 5 minutes ago and see if anyone responded to it. It was in regards to a JFreeCHart issue

~tell NekoKun about anyone

NekoKun, 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.
bNekoKun, 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./b

sent ya a pm with what i could find.

class Config { public static final String USER_NAME = "george;" }

thanks dfr

jaxb

In sourceforge jpcap what should be the best way to write a tcpdump raw packet in a file? there is no "write" method in the various classes…

is there a way to debug the jdwp debugger?

Does JPA (Java Persistence API) works with PGSQL?

some sort of -Xrunjdwp: option

I use JPA (hibernate provider) with postgres.
On jboss.

uh…
JPA works with whatever your provider works with.

indeed
I was merely pointing out that there is at least one combination of providers and tools under which postgres can be accessed via JPA

JPA uses JDBC, im sure

yes… as long as there is a good jdbc driver your a silly Cat

¬¬

it's more than a JDBC driver issue

hi

hello Bevin

what
neko = cat
ogenki desuka

Kun != silly :p
My friends are using JPA to connect directly to the PGSQL server. They can select and update, but NO inserts at all

duh

which JPA implementation is that?

anyhone using something other htan the hibernate impl…

Can select and update? saveOrUpdate() ?

JPA is a specification, not a library

you from japan

nope

Find out what implementation of that spec they're using

toplink and hibernate are the main 8impls of jpa

I'm just helping them out

And i'm trying to help you out

J2EE 5

That is also a spec, not an implementation
Are they using the sun Java EE server (glassfish), then?

OC4J

Aha

EntityManager.persist() works just fine

?

don't use toplink jpa, use hibernate

I still dislike the JPA idea..

why?
JPA kicks ass!

toplink jpa is evil

~evil

only morons use the word "evil" to refer programming practices, IDEs, etc.

it's possible oracle's implementation of JPA needs specific settings to talk to postgres

that's not a reason.

hibernate jpa is good

if you can accept the idea of some objects being mere structs and carrying no behaviour, JPA works well

uh, not exactly

If you're of the school that all objects should carry behaviour, JPA is a little hinky

jpa makes it so your objects don't become mere structs. you have it completely backwards.

not at all

Even then: I don't like the query stuff.

thanks

you can persist objects with behaviour quite well
but a lot of people still us it that way, but that's a people problem

sure, but unless used very carefully it ties your entities to whatever application the logic was written for

that's not a bug dude

He didn't state that

I tend to think of the database (and by extension the DB access layer, which is what JPA is) as being application-agnostic. I've never been somewhere where only one program ever accessed any given DB, except for demos.

in practice the distinction between 'business logic' and 'entity logic' is zilch. and nobody is going to do serious application integration at the entity level.

yeah. there'd be some service layer there.

well you're insane

so your other applications would have other entity classes that can be mapped to the same tables?

*nod*
kindly lay off the personal attacks

then you could build a more service oriented … um … architecture.
i'll call that SOA for short.

DOA layer

I'd love to see a standard way of querying for objects that doesn't rely on string literals/other languages. The db4o way is quite neat, although I see/know the problems involved.

isn't that a bad word? or is it just that I've been hearing it from idiots?

no, but it might have several tools which share a given set of entity classes

still seems pretty popular

SOA is just the latest in ridiculous buzzwordery applied to obvious ideas once the community at large catches on to them (usually several years later, and in the wrong way)
uSOA is just the latest in ridiculous buzzwordery applied to obvious ideas once the community at large catches on to them (usually several years later, and in the wrong way)/u

nobody shares entity classes dude

~dmlloyd++

dmlloyd has a karma level of 43, Logi

2-tier designs ended in 1997

this project shares entities between components with drastically different architectures so that's not true.

give me one example of logic that fits in an entity class that is not better-represented as either application level logic or a DB constraint/rule.

SOA seems like a complete waste of time

Aradorn, probably because it was explained to you by idiots

heh

thats probably true
the guys from BEA were not very forth coming on how to actually use it in an efficient manner

any computation involving the state of an entity is best encapsulated inside the entity class unless it requires services from another layer
that's pretty much the definition of business logic

i hated their examples =\

In an IPTV Middleware application I've got a ChannelAsset.getCurrentShow() method. It looks like it's in completely the right place and ChannelAsset is persisted.

example. *example*. Not assertion about generalities.

that is a known issue with meeeeeper

that makes sense, though. It's just a transient (computed) attribute of the ChannelAsset anyways.

heh, you want me to like describe a banking app?

yes, it's application logic.
then there are things that naturally belong on a level above that

but anyways, service facades — what you probably mean by application logic — are a terrible place to put logic. business logic not captures in an entity, persisted or not, is just a globally scoped function and brings all the same problems

hmm.. They've got Foie Gras on the room-service menu at 22 BGN

I'm not sure where this idea that I said "never put methods in entities" came from

you indicated that it was a good idea, but that JPA made it difficult?

right the service facade should use a dynamic dispatcher for helper service object
s

hey meeper, i'm having a lot of fun reading Mr Pat Helland, fiefdoms, saga pattern, etc.
thank you for your comments the other day

maybe when you said 'give me an example of logic that's not better placed in application logic or the db'

Can anyone come up with a really good TDD introduction? Yes, I googled. But most samples so far didn't "get" me. Any experiences with a really good book/site/tool?

no prob

perhaps shopska salada and foie gras?

no, more that putting methods in entities needs to be considered carefully. Your example was a good one, since it's just a computed attribute of the entity. Putting something that actually manipulated the state of the entity there may or may not be a good idea, depending what and
why.

I thought Test Driven Development - Back was pretty decent.
Beck even.

right
well, that's why they pay us, right

Right

Okay, that's more or less the standard recommendation.. Might buy that now/soon.

I also don't believe meeper "gets it", which is why I asked for an example from him. He's not doing anything to help that impression.
And I'm not being paid enough to clue him in.

Well, like Fowler might be when it comes to refactoring.

it may be better just let it slide

aye

and if you actually do the examples like the currency stuff, you do get some clue fairly quickly

I get it fine, like I said, you're just wrong. Most business logic belongs in entities. There's nothing that needs to be "considered carefully."

meeper thinks on a different level, you don't

if you seriously think entities should be application agnostic and shareable between applications then you're living in the same dream world that the ejb2 designers lived in. entities aren't domain-indepedent components, they're pretty much the exact opposite

then what's to stop entities from becoming grab-bags full of business methods with no real connection to the context those methods were created in?

good architecture and implemenation

well that's exactly what entities should be: grab bags of business methods and state.
you say that like it's a bad thing!

if I have an Employee entity (to pick a truly stupid example), and it has both a changeDesks (…) method that schedules Facilities to go move the poor sucker and also a changeSalary (…) method that communicates with the payroll tools, and I want to write a third tool, both of those methods
are completely irrelevant and are merely intellectual noise.

Just ordered it Together with his book on XP

that should be in a business/service layer
above the entity layer

no that's a common misconception

that's my point.

most i know that use xp and scrum use it to be an exust for hacking
excuse that is

Employee.changeSalary doesn't make any sense. Who ever heard of asking an Employee to change their own salary?

logi is that a deep breath? Like a sigh?

you don't know what "example" means do you?

you're replacing bad object oriented design with functional design.

heh

we're supposed to be using scrum, but really we aren't

he already said it was a stupid example

that's why I asked you for an example: to avoid exactly this kind of miscommunication. I quite seriously don't understand you, and wish to.

you're a bigger man than the rest of us.
8^)=

the premise of the example is wrong tho. People say 'well Employee.changeSalary doesn't make sense, so I need an EmployeeService.changeSalary'.

that's his point!

but changeSalary is business logic.
To me.

and goes in a service layer

yes, and my point is both EmployeeService.changeSalary and Employee.changeSalary are wrong

then say that and quit fapping around

well it's just very poor design. you can define all the XXXService classes you want but in the end what you're doing is just defining a bunch of global functions

you mean fraking around?

Methods have to be somewhere.

that is like asking to live in interesting times…

well yes, thanks for the tip

no thye dont, we will just change the value in the db by hand

no, they don't! think different(ly)!"

my other car is a cdr

mine's a zamboni

why can't i do this? new VectorInteger[5] ?

what does the compiler tell you?

Because you need basics

cannot create generic array

there go

my point is that a FloorplanService composed of various (entity) locators and carrying business logic that operates in terms of those locators seems like a good home for a "moveEmployee" method.

how is it generic? i specified Integer

try new Vector[5]

The name sucks ("Service" is a semantic void)

hrhr

uh…

no it doesn't

Now that was nice

that's what *makes* generic

hmm ok

generics and arrays don't mix too well because of type erasure

anyway. time for lunch.

then where would you put it?

Cheers for the help so far folks. Time to go home here

ojacobson, ah ok
ignore the warning i get for the generics after i remove Integer then?

anyways, we can agree to disagree. I've seen way too many apps full of XXXService classes with dozens of methods and so I already know it's a crap shoot. such anemic domain models are basically an antipattern for any complex app.

bingo!
we finally hit "antipattern"

Ideally the service consumers (other classes) never need to know that there's a database involved at all. It's not so much an anemic domain model as a rejection of "objects as a model of the real world"

it's the programming version of Godwin's Law

most likely I would introduce a Salary class that would not be a property of an Employee at all. It might belong to some sort of PaymentProfile which is the way most accounting depts actually work.
well, if you really believe that objects aren't a model of the real world then you probably ought not to be doing object oriented programming. but alas

The "objects modelling the real world" idea sounds nice on paper, but in practice I've never seen it go anywhere other than "lots of God Objects"
objects are a really convenient way to break down software into pieces. Looking at them that way has been far more productive for me.

objects represent things

If that doesn't fit your specific view of object-oriented software, I apologize but refuse to desist.

even if an object only represents a transient idea - for example, a request to change an employee's salary, or a request to purchase a product - it still represents an idea

Sure.

it's not just a random jumble of methods and data

well like I said, we'll have to agree to disagree. I think actually representing the real world is a great way to design applications. It's how you spot nonsense like Employee.changeSalary and EmployeeService.changeSalary

Mentally I tend to model them as "an object which can do verb", then set up whatever state it needs to be able to do that

well there's your problem

so to you an object is a procedure

my problem has earned me a fair amount of money and enjoyment. *shrug*

you ought to start with state first. then based on state figure out what objects can respond to which messages
haha, there are legions of bad programmers. it's nothing to be proud of.

If I see a cellphone object i dont expect it to contain information about a pager
Sometimes you cant help but to have objects that represent real world items because thats the easiest thing to do

Sure.

I tend to agree with ojacobson, at least in the long run. in the design / initial developing, objects represent closed ideas, classes are small and coupling is low. on the long run, objects represent crossing aspects, classes become god-like and coupling becomes relevant only as module
coupling.

And when it's the Right Thing, do it

interaction between real world objects is quite real, mind you.

Zaph0d^: well it's not that difficult but that's why design is iterative

(For what it's worth I almost never put more than trivial logic on Serializable classes, either. Serializable objects and @Entity objects are morally equivalent.)

and I'm sure it's not obvious whether a real object exists if it doesn't interact with other objects :P

even so, without a complete world-restart (scrapping the application every few iterations and rebuidling everything), you tend to get more and more complex classes

so it's reasonable to base simulation on interactions rather than objects if one wants to mimic the real world.

well the point is, when you want to change an employee's salary, the easiest thing to do is model what happens in real life. a manager sends a request to hr who approves it and sends a request to accounting to updates the payment profile for the employee. this also tends to actually lead to
the best design

agreed. But then state of employee's salary is not part of the emplotee object.

The map is not the territory, though, and pretending it is leads to some pretty hairy designs

s/tee/yee

An Accountant object is not an accountant.

Zaph0d^: well that's debatable. most of the time applications that fail to break down their domain correctly end up buried in complexity and maitenance quickly becomes prohibitively expensive

but, mind you, if company is extremely small and doesn't lack accounting, an employee might be the one defining his/her salary.
s/doesn't lack/lacks

(And to be fair, I'd find Accountant.changeSalaryOf(Employee) pretty weird too, so I'm fairly positive that's not what you meant)

true. besides, real-world objects ARE gods. they usually have so many aspects, coupled so tightly to their environment, that modeling them correctly would be a design nightmare

yeah, but then they don't need an accounting system

why is that weird?
who holds original records of your salary in your company?

Zaph0d^: I've seen real world applications full of XXXService classes that are nothing more than half a million lines of spaghetti codes. tracing even the simplest use cases becomes an exercise in mapping method calls between dozens of classes and changing stuff is very dangerous if not outright
impossible

that's why I've added "without complete rebuild". you throw out the old stuff and rebuild it from new.

there is a filing cabinet somewhere…

well, who is the primary accessor of it?

the accounting system

in that case, it makes perfect sense for me that if one wants to change salary of an employee, one must call AccountingSystem.changeSalary(employee)

They retired it most likely though…

(besides, the application I'm working on looks like that. probably the reason why I'm looking for another position)

then just rename it to AccountingService and we're done!

deal!

an Accountant is just someone who has access to the accounting system
it's a role defined in the RBAC, it's not a class

i think the root problem here is that everyone sees design of systems differently
which is why its hard to model real world aspects

no, the problem is that some people are failing to grasp the fundamental fact that I am always right

Comments

Im getting an error when using Eventobserve [Exception [object Object] when calling method [nsIDOMEventListenerhandleEvent]

handleEvent]" nsresult: "0×8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "unknown" data: no]"….can anyone tell me why this might be happening?

Hello my name is Dr. Greenthuuumb

try asking in #prototype

I did
I figured I might be able to get pointed in the right direction at least here

I can't help, others?

#prototype is sleepy right now, lol

the event threw an exception of type object

location says unknown

I think I just figured out where it is…

`js ref

http://developer.mozilla.org/en/docs/JavaScript , http://devedge-temp.mozilla.org/central/javascript/index_en.html , http://phrogz.net/ObjJob/ , JScript@MSDN: http://tinyurl.com/9pk3l , www.crockford.com/javascript/

got it

when i put a div wrapper with a z-index on top of content, how can i make it where they can't click on any of the stuff underneath it.

oO

what stuff?

the website

you can disable links
but people know how to turn off javascript
since the fox has become man's best friend

is there a way to get a nodeList of all radio buttons from a form (it sounds reasonable since all of them have the same name

yea

how?

getElementsByTagName

hmm
doesn't seem to be working. that works for XML but not sure if it can extract input from form ?

for (i=0;idocument.forms[0].radios.length;i++) { … }

ah i figured it out
you have to use an image overlay

you access each one like this: document.forms[0].radios[i].checked

what if i have two groups of radio buttons (not with same name).. just do an if underneath the for, no neater way?

or like this: document.forms[0].radios[i].value

value and checked aren't the same..

I know, lol
I was just showing you how to access attributes

can i do var radios = document.forms[0].radios; ?

sure

great
ty

np
wait a minute

what's up?

quirksmode says radios can be the name of a group of radios

sorry?

seems to be logic

let me give you the link

can anyone point me in the right direction to have a long webpage autoscroll up and down???

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

if you want to creat radio groups you have to give them all the same name ..

last section

this does not return a value at all document.forms[0].radios.length
and yes, there is only one form on the page

that's why I was talking about the group name
use it instead of radios, for example…

is it possible to access forward, backward history without JS enabled?

yes, you click the back button

i'm not following you
group name?

is there a way to get a nodeList of all radio buttons from a form (it sounds reasonable since all of them have the same name

DDustin

oh i see forms[0].groupName… yes

but is it possible to make a hyperlink to access this?

how do i get a zero value from a string that isn't a number - i don't want NaN

a zero value?

parseInt("test") || 0

0

funny… forms.formName.groupName doesn't work in IE..
on one hand.. .on the other var opts = document.getElementById("pollForm").answer; also doesn't work (so in other words it won't work by groupName
same goes for var opts = document.forms[0].answer; in IE

parseInt("")

NaN

parseInt("a")

NaN

`js forms

Accessing form elements via JavaScript: Don't use document.forms[index].elementName or document.formName.elementName. Use document.forms['formName'].elements['elementName'] or document.getElementById('formID').elements['elementName'] or document.getElementById('elementID')

jsBot could be a little less confusing with a url to a more descriptive wiki

no *you* would be less confusing with a url to a more descriptive wiki

harsh

what do you need to know that's not there?

"why" might be nice
i don't care, but someone using forbidden form 1 & 2 might not see much difference between what they have and acceptable forms 1-3

"because you asked" would generally be applicable :-D

ok - nm

getElementsByTagName works for XML — but how do you do the same with HTML tags in the dom ?

it's the same in HTML DOM

but it's not working…

:/

pastebin some code in that case

http://www.safetycenter.navy.mil/Articles/a-m/monkeys.htm

for example:
var opts = document.pollForm.answer; — works
var opts = document.pollForm.getElementsByTagName("answer"); — doesn't work

document.forms[index[.elementName get a monkey beaten
especially with the typo (dumbass)

but the problem is the first line works only in FF so I need to get this function working.

skr1 - "answer" isn't a tagname

"answer" is a group of radio buttons with the same name
var inp = document.createElement("input");
inp.type = "radio";
inp.name = "answer";

paste*bin*

ohhh i see now
but - i don't want to get all INPUT either.. only radios from this form

document.forms["pollForm"].elements["answer"]

insin still not working in IE

skr1 - what's the url?
"not working" is kinda vague

var opts = document.forms["pollForm"].elements["answer"];
opts.length // length is null or not an object
again, this is all in IE - FF works fiine
var opts = document.forms["pollForm"].elements["answer"];
alert(opts); // undefined

tell me, when doing AJAX is it mandatory that the server send headers?

skr1 - have you consulted any kind of spec or googled anything or used a debugger with a watch window

How would I redefine a CSS class using javascript?

Jimicon - why would you do that?

I've been trying to google all along, reading now on msdn intro to forms since nothing of what seems logical works.. as far as debugging, i'm kind of new to JS.. what would you recommend?

given that "AJAX" is just a HTTP request, so yes
s/so//

Jimicon

thanks

element.className = "blah"

No Nex, redefine the class itself.
I have an image container.. it has several ways of displaying an image, and a class for each. The images it contains can be of any size, so I need to redefine width and height
Actually.. never mind, I'll just use another div inside it.

How can I load a different javascript depending on the value of a form selection?
onchange=psuedo-code( load relevant .js file)

will try installing IE 7 to see if this has been resolved

are you doing it in AJAX or is the page being refreshed?

grabbing Javascript as XML, zuh?

I guess I would know if I was using AJAX, eh?

?

My .js is being generated by a perl CGI script

margin: 0 in your CSS

insin oh thanks!

i'm having a problem where when I put an alert() before a function call, everything works as it's supposed to after a div is refreshed, but if the alert() is not there, my Droppables function call does nothing. Any ideas?
http://rafb.net/p/l0lJoG66.html

when is this function being called?

http://www.onmylist.com/category/tech/Top_Six_Best_Sites_for_Windows_Skinning_1
^ neat article :P

its being called on page load, and then after I drag/drop something on it, since the droppable area is being refreshed.
the page load is fine at all times, its after the div has been refreshed that I run into this alert() problem

Is using the ternary operator frowned upon much in JS?

depends how you want your code to look, that's more of a preference thing

Comments

I am getting an error message when trying to enter data into a table The message indicates that the data is too

probably the best way is to dump the DB, manipulate the .sql file, load back

Is there a simple way to get the column names from my table or to add a column only if it does not exist?

hey, anyone have an idea why its not working? http://rafb.net/p/t8tH2U45.html …thanks!

krupa^: you get any errors?

no just not the rows I want
I'm trying to retrieve all the rows from t_wsite_elements except if they match t_wsite_user_elements but I'm getting only the ones from t_wsite_user_elements

heh
interesting
krupa^: you did forget to declare which table the variable is from in the where statment
but that really doesn't matter that much

yeah I know but that doesn't help much

still thinking give me a sec

lol ok

I suggest you declare the * with the t_wsite_elements
that just prevents getting all the dbs

ok one moment I'll try

and holy crap man couldn't you make your table names and column names simpler
too confusing!

sorry ’bout that
the db is huge and it's the best web hosting way to keep tables and fields apart

t_wsite_elements.t_wsite_elements_id could have been t_wsite_elements.id

setting specific selects won't do
no ’cause I join it with other tables to so instead of renaming columns I use it like this

pl so you are getting the rows from elements if they don't match user_elements

currently I'm getting only user_elements

I guess that is understandable
well you want to get elements if they don't match user_elements

yes + user_elements

wait

10x

so you want user_elements and elements that don't match each other

excactly

hi guys. i have this line in a query GROUP_CONCAT(CONCAT('a href=\"' ,url, '\"', critic, '/a') SEPARATOR '') as links, I want to also add the html target="_blank". can someone help

oh ok I was confused

lol me too
the userid is important here with the user_elements

pls can anyone help me add the extra code to that line?

GROUP_CONCAT(CONCAT('a href=\"' ,url, '\" target=\"_blank\"', critic, '/a') SEPARATOR '')

is it legal for a db column name to have a '-' in it?

i wouldnt risk it

krupa^: which user_elements are you receiving exactly? the ones that match?

ty very much indeed

the one that has a specific user id

no I mean
the errored return

I dont know if I can change the text without breaking something.

i cudnt work out where the backslashes went

sorry don't understand
do you mean currently
did you mean currently?

yea

ahh only the match

yea
I figured
its the left outer join

ok

I forget if there is a no equals in mysql
lol

isn't the user_elements=NULL taking care of that
if mean t_wsite_user_elements_id=NULL

well I don't know
just try
t_wsite_user_elements.t_wsite_user_elements_elements_id!=t_wsite_elements.t_wsite_elements_id
isn't that what you want?

I'll try one moment 10x

Ugh, I think I'll just have to make a real_name entry with the '-'.

:-( no
same thing as NULL probably
ahh did you mean instead of the left outer join?

yep
and get rid of null
its kind of useless

ok I'll try

well?

nope sorry

what do you get now?

one moment
the same
one row user_elements that match

heh…

probably doing something wrong one moment

no no
hrm it might be the query it self

what do you mean?

you want the user_element and element info in the same row right?

yes

maybe I am just not understanding your DB
what do elements do?

there are some basic elements that are default if the user changes them they are stored in the user_elements table with the changes so I have to receive the default minus the changed ones

oh ok
so personal preferences

something like that yes lol

hrm

brain killer?

so you want the IDs to be the same
but
but only return the data of user_elements
if user_elements is filled

no… also the elements if the user didn't change them

O.o

so I should have alwys the same amount of rows

k
and by doing t_wsite_user_elements_id=NULL what is that supposed to do?
does this mean that they set the user_element?
or does that mean that it is default?

that means that the user_elements table does not include that row so I get it from elements I added that one later someone suggested that

krupa^: Do you have separate table with defaults?

the elements table is the defaults table

krupa^: If yes you can join that table too and use values from it in case there are no values in user_elements

that's what I wanna do elements join with user_elements

krupa^: So what's the problem?

he is not getting what he wants
he gets only the matched tables
http://rafb.net/p/t8tH2U45.html
that is his query

krupa^: Let's start with something simple: SELECT e.x, ue.x FROM elements AS e LEFT JOIN user_elements AS ue ON (e.id = ue.id)
Hey!

hi salle!

Minor what?

the entire query works ’till I put the userid

krupa^: Wait. In that simple example if there is no matching rows in user_elements ue.x becomes NULL
krupa^: And then you use the "default" e.x correct?

one moment figuring out what you say

krupa^: Now let't do that "then": SELECT IFNULL(ue.x, e.x) ROM elements AS e LEFT JOIN user_elements AS ue ON (e.id = ue.id)'

hey salle, i wonder if you happen to know why memory tables are always fixed format vs dynamic. Why they chose to make them always fixed on a technical level

I was gonna ask what ROM was then realized it wa sfrom…

krupa^: Well .. I assume you understand how LEFT JOIN works

yes yes

yes FROM … s
stupid typo

mine wasn't any better with wa sfrom

It should be quite obvious if you think more about that
Allocating memory blocks and navigating between them

its messy :/
fixed is easier to deal with

yes fixed perhaps is easier to deal with but lets say I do .. blah varchar(100) … if 99% of the rows take 10 in length, and then 1% take up the 100 varchar in length, i'm wasting a lot of ram for the "easier to deal with"
can ram get fragmented easily or something
I use like 500-900MB memory tables is why I'm asking not the typical 8-16MB

Correct. It is space vs speed as usual

salle, shouldn't that be user choice at somepoint in 5.2 or 6… kinda thing?
format=fixed/dynamic on the table options .. ?

Don't think we have any such plans.
Ok s/think/know

damn
I'll eliminate the longer rows and handle them seperately in another memory table .. that way I'm not chomping..
thx salle

Why do you want to put such big tables in memory?

OK, so I have a query which is constantly quried and doesn't need to be updated very often (only like every hour or so). Can I tell MySQL about this, and let it send back a cached copy instead of re-calculating the whole thing (it's quite heavy) every request?

hello how to update the character set of a table to latin1?

If it is 32-bit hardware you better forget about it
!man alter

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

salle, I'm "data warehousing" on the peasant level .. I process so much data that I need a few tables memory

Look at ALTER … CONVERT .. syntax
But better have backup of the table first.

It's 64 on this one server .. only got 4GB tho

hehe
And how many such tables you have?

salle, not everyone can throw hardware on things
probably 100~ small tables at any one point but usually 1-2 large ones

Where can I find my slow-quries log file ?

depends on how much processing is going on .. multiple servers calling home kinda thing, not predictable
show variables like 'data%';
look at data_dir
go there

In datadir unless other location is specified

OK, so I have a query which is constantly quried and doesn't need to be updated very often (only like every hour or so). Can I tell php mysql web hosting about this, and let it send back a cached copy instead of re-calculating the whole thing (it's quite
heavy) every request?

query cache
!man query cache

see http://dev.mysql.com/doc/refman/5.0/en/query-cache.html

Why don't you just turn Query cache on?

Does it have a special name?

Note SQL_CACHE and SQL_NO_CACHE hints

Catnip96, one thing to note, any table change invalidates the qcache so if you have writes .. it'll recalculate

I don't know how did you configure your mysqld

I just enabled it by adding log_slow_queries=1 and log_queries_not_using_indexes=1 to my [mysqld] in my.cnf

show variables like 'query%';

What should I look for there ?

magical pixie dust, hopefully you win the lotto?
5.2.3 or 5.2.2 of the manual
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
5.2.3

Hi, Iam using php my admin, and I want to import files bigger than 2 mb

You enabled slow log without having idea why you did that?

Well, I don't wanna turn off query caching ENTIRELY. Just for this specific query.

Don't use phpmyadmin and you can import whatever you need

salle^: took a while but got it

Go and read about the query cache please

Um… ON.
I mean on!

ok, I also use the consol, but not able to remember how to import a whole database, any idea

Catnip96, query cache is disabled by default. You turn it on… it automatically handles everything. If you need to provide hints to mysqld there is a format for doing so. Read up on it, your site will blaze.

mysdl dump.sql

How come something as useful as query cache is turned off by default?

Provided that it is dump made by mysqldump i.e. consisitng of sql hosting statements
It is not as useful in all circumstances

have you read the manual at all ?.

Yes. I am doing so as we speak.
I also did read about this a while ago, but forgot about it. Heh.

Salle, what do you think of this for a highly write environment .. memory tables that get loaded from –init-file … and triggers that update base myisam tables "after update/insert/delete" .. so the base is always in sync, restart gets the memory tables reloaded properly.. Should blaze eh on
about 500-600MB of memory tables

ok iam not sure iam getting you, so I have the tables, and all data in a file called test.sql, and its stored on my desktop, the database name is tester, what is the comand exactly

Alloosh:
Never heard of pipes?

not really

you mean the thing the Internet is built of?

any idea?

flupps|US, thankfully that "pipes" senator is getting investigated

I've heard Internet is a huge network of Cisco routers with some small amount of other hardware connected at some end points

you've been missinformed, I think most backbones use Linksys

Well, it turns out I have have_query_cache enabled ("YES"). Still it seems to calculate the same query every time. Even if I add "SQL_CACHE" after the "SELECT", it still takes the same amount of time every time it runs the query. Why is this?

Hello everyone. If I want to define a many-to-many relationship between 2 tables, is 'multiple foreign keys' the way to go ? (I have a drugs_category and a drugs table. A drug may belong to more than 1 categerory.)

SHOW VARIABLES LIKE "query_cache_size"

he didn't read the chapter

how can i update t1.field to t2.field where t1.id = t2.id?

it's probably non deterministic

'query_cache_size', '999424'

are you using something like NOW() ?

It's a simple (but heavy) SELECT…
D'oh! Yes.

there you go

So NOW() is bad?

bingo in the hall, hold your cards

It forces a reload?

reload?
NOW() is nondeterministic

Can I do something about this?
To make NOW() only force a reload every hour?

Yes if you learn how to freeze the time of the universe

wow, no answers? how can I import database hosting which is more than 2 mb? anybody knows?

you can do that in bios
Catnip96, check bios

So the all the clocks in the world don't tick

mysql dump

These jokes are not funny. :|

you could have one query retrieve your hour, then use the string itself in the query

Hrm. I suppose…

if it's really heavy the extra roundtrip will be worth it

Catnip96, eliminate the now() .. put it in the application

How would that solve anything? It needs to be the current time for use in the query.
I wish I could do SELECT SQL_CACHE EVERY 1 HOUR…

You can ..

You can do it every 1 second
Or microsecond
Or any other interval

… what?

create table savedhourly (blah blah blah) engine=memory; … insert into that table every hour on crontab
and select from it

Why didn't you say this?

!google summary table
!g summary table

You can indeed, but as long as the query is non-deterministic it will not go into the cache
Like if you have RAND() or UUID() or any other non-deterministic function in the query

:/
!man UUID

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

Catnip96, do what I said… crontab that builds a summary table hourly … it's easy as pie… use –init-file .. to recreate the memory table on server host start… move on to bigger and better

How can you expect to cache the result of non-deterministic function?
Don't be so excited about big memory tables

I don't know. I assumed it would use the first query for "a while".

First what?

The first time the query runs.

salle, you're torturing this guy

And then it would not reload until a certain time has passed.

You haven't tell us if your query is deterministic or not after all

Catnip96, how hard is it to calculate another table that summaries these results for 1 hour and then query off that with now() ?

Yes, I have… and you've told me… it has a NOW() which I need to remove.

Yep. NOW() returns different value every second

Hi is it possible to search the whole database and not an indivigual table for say a line of text eg "Thank you - and -" ?

How can you imagine NOW() can be cached if it changes every second?
No

Because I thought this was what caching does.
Caching.
It would only do NOW() the first time, and then cache it for a while.
That's what I assumed.

Caching does not invalidate the main law of databases: The result must be always correct

So the best thing is to have a query which retrieves the last hour, based on the current time, and then uses this in the real, big query insetead of NOW()?

And if you are happy with old and invalid timestamp why don't you hardcode it?

Catnip96, what does 'non-deterministic' mean ?

Yep.

I can't explain it in English…

Tapout it means the result cannot be predicted by a computer

I'm thinking another reread of the chapter will help
adaptr, I know what it means.. i'm trying to help this guy

doesn't sound like it

SELECT (NOW() - INTERVAL 1 HOUR); // This returns the exact time one hour ago, but what if I am trying to return the last full hour?

http://dev.mysql.com/doc/refman/5.0/en/query-cache-how.html
A query cannot be cached if it contains any of the functions shown in the following table:

So?
I know this…
You told me already.
This is not that query.

what's the problem?

SELECT … WHERE col = @t …

SELECT (NOW() - INTERVAL 1 HOUR); // This returns the exact time one hour ago, but what if I am trying to return the last full hour?

oops that was for Catnip96

Ah.

There's HOUR() function and there is also DATE_FORMAT()

I need the full datetime, so I guess I need to wrap it in something.

0'); for god
Then SELECT … WHERE col BETWEEN @t AND @t - INTERVAL 1 HOUR
Or do it as SELECT @t1, @t2 and then just substitute
It's even better to do the substitution at the client side to make sure you are sending strings to the query so it gets cached

0' makes no
Why %08?
SELECT DATE_FORMAT(NOW(), CONCAT('%Y-%m-%d ', HOUR(NOW()), ':00:00'));
This works…
But isn't it ugly?
Well, got it working.
But I suspect that my that query is not very nice.
And the reason I don't do it in the app is I need to make sure I use the time of the database.
Makes sense, salle?

is there a way to get 2,200 accepted as 2200 on a local data infile

SELECT * FROM table WHERE string='value' , this WHERE is case insensitive. How can I just select strings with the same case as value, please?

hello

WHERE string clike 'value'
which may or may not be compiled for your OS version of mysql

i am using mysql 4.0 and I am not so sure how to delete things

rook2pawn, thanks a lot

it tried DELETE FROM events WHERE key='8'
what am i doing wrong?

i think like is supposed to be case sensitive but my version must have hada flag set at compile time to make it case insenstiive. go figure

|super3boy|, if key is a number, remove the ''

ok

rook2pawn, ok thanks a lot

it still does not work
DELETE FROM events WHERE key=8

|super3boy|, did you read the error message?

Why can I only connect to a certain mysql server with the 'mysql' command (Any other app can't connect)?

It says I have an error in my sql syntax and to check the manual for the right syntax to use near 'key=8' at line 1

http://dev.mysql.com/doc/refman/5.0/en/delete.html . And be sure that table name and field name are correct
even if this is strange, because syntax looks correct to me… I'm not very expert on mysql and so I don't know what can be wrong, sorry

key is reserved word
for gods sake

wait a minute
yeah

just common sense

lol
ok
let me change that

lol tibyke I did not think about it

thanks
my script is fixed

neat

bye

see ya

can i use the mysql hosting command line tool to dump a remote database to a local file?
ah i guess it's mysqldump…

Yes, it is :-)

as the name implies…

markus_, yes, you can

using mysqldump now, works fine

great

why can I only connect/telnet to mysql on localhost? I've commented out '#bind-address = 127.0.0.1' in my.cnf and restarted mysql…

skip-networking
and restart mysqld

what about 0.0.0.0?

archivist, what's the "the_wench-word" for this?
markus_, thats the default
but yet it wont work with skip-networking

aha

Probably you've got skip-networking

nope…
hmm.

In which case, perhaps it's a permissions problem. Have you granted any users access?

skip-external-locking is after some ports and .sock stuff
yes
'telnet localhost 3306' shows me '5.0.45-Debian_1ubuntu2-logs4E@NKjU,JQ9j*/Ls};', but 'telnet groupware.kubuntu.co.uk 3306' just hangs and hangs

Ahh, I wonder if you have any filtering or firewall software?
Does groupware.kubuntu.co.uk actually resolve to the right IP?

yep
umm. *nmaps*

Do you have any local firewall rules on your host?

iptables -L doesn't show anything

Funnily enough, I can actaully reach that host on mysql port

I can too. Hmm. So it looks like groupware.kubuntu.co.uk can't access itself threw the address groupware.kubuntu.co.uk.

Is that ip address actually the local interface address, or is it NAT'd ?
Is it NAT'd ?

NAT'd methinks. I'm using a vm off of someones dedicated server

What is the local interface address? Can you use that instead?

10.118.12.2 works

Right, so that's the local interface address, many NAT setups can't access the external NAT'd address from inside the firewall

I'll bug the server owner to set up an iptables rule for me Thanks
uI'll bug the server owner to set up an iptables rule for me Thanks /u

Anyone use a remote database as part of an application or website with much success?

We use approximately 50 database servers in our application, many of them remote from where they are accessed from at any given time.
So I guess, yes.

How is the performance on that, in terms of response time?

Erm, I don't know, I've not measured it. We're normally more concerned with throughput
I guess it depends from where to where
You tend to get 1000ms or so more round trip time over a VPN to the far east from Europe

Hmm, yeah.

we have datacentres all over Europe plus some in the US and far east
the delay to the east is noticably greater, but not a problem for our apps

Well, that's good. I was asking because I once had a client who wanted to host one of their databases remotely but latency was a big concern of theirs

You'll have to test it
mysql has asynchronous replication, you may be able to get better latency on readonly access if you use a local readonly replica, although that could be out of date
You will still have to do writes to the master though

Yeah, the app is very insert/update heavy

Well it may not be a problem, if you batch stuff adequately
I haven't used these)
Alternatively it might be sensible to farm off big insert / update operations to some other process nearer to the DB

Anyone familiar with MySQL Administrator? This is a Windows based gui.

kinda
I used it for a bit

How do you create a new database in MySql Administrator? The help file is a bit lame and says the following: To create a new database, right click on an existing database and choose the Create New Schema option.

shun the gui, use CREATE DATABASE.

I don't find the "Create New Schema Option". Also, it doesn't tell you how to create a new database when one doesn't exist.
Do you mean in the command line?

yep

I mean the mysql command line client
i.e. the proper interface.

They haven't told us yet how to use the command line.
I have been using the MySQL query browser for the last half of this semester for learning things like SELECT statements, WHERE statements, Subqueries, and JOINs, etc.

Thanks for the advice on using remote servers, MarkR42

No problem. My best advice is, test it thoroughly

hi everybody
when i use mysql_connect() function, it returns me a warning (it's normal cause my user id is incorrect)
but i want to echo the message myself
how can i desactivate warnings printings in mysql ??

Well I think I figured it out. You have to right click an existing database and then "select new schema". Kind of weird, but seems to work.

This is a PHP question, I suggest you direct it towards ##php - mysql_connect() does not print a warning in the C library.
Read the PHP documentation. It's nothing to do with mysql.

ok
thnaks

supprress the error/warning with @, and use or die (mysql_errorr());, but get ontopic now!

Well I am now in the MySQL Table Editor and can't figure out how to enter the attributes to the table.

Hi! I write a recommendation algorithm in C which reads a huge mysql database. I need to check periodically the changes in the database (for new items added or removed) to update some arrays in my code. What is the most effective way to do this?

I am in MySQL Table Editor. Anyone know how to add a column in the editor?

no, we only use the mysql command line interface
and you are encouraged to do so, and stop bullshitting with any gui tools

The class that I am taking hasn't covered the command line yet. That is next.

ok, ask the developers of your fancy gui tool how to achieve what you want, but this is really offtopic here

You say a "huge" mysql database
You might want to have a table of changes which you add rows to using triggers, so that you can efficiently see what's changed since last time?

yes

But the "most effective" way, would probably be highly dependent on your app itself

hi all… got a quick sql question that I simply didn't get for hours… maybe someone is willing to help me out. I have two tables, containing images and image_views. In image_view I have image_id and user_id columns. I now want to select a random image that has not been seen by a certain
user before.

i.e. that has no record in image_views containing a certain user_id

Depends how many images there are etc, if there are a huge, huge number, you might be better off selecting an image randomly, and if the user has already seen it, just picking again
If there are fewer, a query to find the images the user hasn't seen might be vaguely efficient, so you could do that

why does it have to be random if the user has not seen it yet?

the system must be able to handle one million users with 100 times more collected web-pages

well, actually it is not images, I only thought I simplify the example
ok, *thinking*

You could just store the image the user saw last
then do a select for one with a greater ID

ok, I'll use the real world example

how can I get the list of connections and queries being currently run on a server? thanks

I have a db containing products. each product will be tagged by users, and each user shall only see a product once. products for tagging are chosen at random.

SHOW PROCESSLIST

the products table may be around 3000 - 30 000 at a time. but the amount of products a user has already seen might also get aroun 90%.

When the user first arrives, create an ID of the last product they saw. Initially set it randomly between the min and max IDs. Subsequently, find the first product with a greater ID, and choose that, then update that ID they last saw.
If the ID of the last product they saw is the highest in the DB, start again from 1

that would mean that users would see the products in the same order, wouldn't they?

There is no need for them to see them in a random order
Yes, but each user would start in a different place

it is important that you can not predict what to see.

thanks, it only show 3 entries, one of which is the show command, and the other 2 are sleeping … yet the server process takes up 80-90% of my CPU, any ideas what could be causing that? tia

A large number of very fast queries which are not being executed at the precise moment that you did SHOW PROCESSLIST

:-)

Also, "SHOW PROCESSLIST" only shows your own user ID's connection unless you have SUPER priv
Additionally, some table handlers have background threads which are not shown

I can't explain it right now, but trust me that it is very important that the product chosen is totally random, or at least seems to be for different users.

Although they are mostly idle unless a lot of foreground work is also being done
Selecting things randomly is not convenient in a large table

I know. but I have no choice…
precisely I can do a order by rand()

You may want to consider instead selecting it according to some moderately unpredictable value
Yes, but if you ORDER BY RAND a large amount of data, that takes a long time as it will have to create a temporary table and use a filesort, it's going to take a long time on 10 million rows

thanks

it will be 30 000 at most I think, though another solution would be better, I agree.

I'll try to query while logged in as admin

Why not assign a random (fixed) number to each product, index that column, then query that

how would that help?

You could (relatively) quickly select random ones

how can I see all the processes for all the dbs?

It doesn't check the DB. You can only see your own unless you have SUPER priv.

how can I see all the processes for all the dbs at once? tia

It shows you them all anyway
processes are not database-specific

that's a good point …

MarkR42, hmm, might be possible. *thinking*

If you can create some kind of artificial arbitrary order, which is persistent, you can just go through those in their order, and check if the user has already seen each one
Or outer join to exclude the ones they have seen if you like
Because that will be a relatively small number
If each user starts going through this fixed arbitrary list of products at a different point, they will probably not notice that it's nto completely random (in fact, to them it will appear so)
Moreover, you can find the "next" product in the sequence very efficiently even for a large number of products
Only building this sequence will be initially slow, but you'll only need to do it once or occasioally

What do the flags called Zerofill and unsigned mean?

They mean exactly what the mysql docs say they mean

Is there a limit to the length of a table name?

I have a db in MySQL. My friend want to connect to it. Is it possible to connect to it without using MySQL? He's using Windows.

Yes, there is. See the documentation under limits.
That sounds like a bit of a contradiction. Yes, your friend can connect to your database if permissions and network allows. What tools your friend chooses to use is up to them.

I can't seem to find it.

MarkR42, Is it some tool you recommend? Freeware is it prefer.

Mysql-Fron skulle jag rekommendera

MarkR42, good idea.

Yes, it's called the mysql command line client, it's shipped with mysql. You may be able to install it independently

*MySQL-Front

How would I do the outer join to exclude the ones I've already seen? That's the part I didn't get, I think…

CroX, MarkR42 Thanks. I tell him to have a look.

You can do e.g. select whatever FROM a LEFT OUTER JOIN b on b.a_id = a.id WHERE b.id IS NULL
Obviously other WHERE caluses might be required

thank you!

A left outer join selects all the rows in the left table even if the ones on the right don't match. If you use WHERE b.id IS NULL, you select those specifically.

MarkR42, hmm, I think the approach with the fixed list will not really work. I will show each product to 20 users only. If I use a fixed list, it will always be the same 20 users that see it.

Each user should start at a random point in the fixed list

or at least it will be very often the case.

and the fixed list should include all products you want to show

yes I know. but at a certain point, overlap will start

(some value) LIMIT 1

That should be efficient if ID is indexed

it's not a mysql problem, it's a business logic problem

It sounds to me you need to figure out your business logic before trying to decide on how to implement it then.

to the users it might seem random, but it will be always the same 20 users that see a certain product when the overlap has started
it must be random, so fixed list is not an option

Pulling a random one out is NOT a cheap operation
I'm not sure the best way of doing it

guys, I'm getting errorno 1064 with INSERT INTO feed (status,id,title,site,url,usage) VALUES('0','','test','http://example/','http://examplecom/feed','1'), any idea?

!perror 1064

No, you're not.

MarkR42, I am, I swear heh

There is no error 1064
Are you sure that's a mysql error code?
because it doesn't exist in my version of mysql

MarkR42, http://paste.syntux.net/bin/13

maybe my "perror" is not working

so, any idea?

Wow, I googled it and lo and behold
Why do i get a query syntax error 1064 from MySQL when the syntax seems correct?
You will get a MySQL query syntax error number 1064 when you incorrectly use a reserved word in your query such as "when" or "order".
:-)
I believe that it is "usage" that is reserved.

Yep, loook like it

aha! it's usage

Why does my "perror" not give me an explanation for 1064
?

I don't know :-(
Mine doesn't give me one, either.

I'm sure it's supposed to

A deeper problem that lies deeper than listing the
errors in the manual is that the error-reporting
function that is supposed to be served by perror does
not work in many cases. There are a lot of errors for
Sorry, I thought that was going to paste as 1 line

hello. i'm using mysqldump to create a backup of my database, however, i must restore it to another database name. this will be an automated process. is there a way to do this from the commandline ?

I have mysql 5.1 beta on my work box (as testing), and I'm fairly sure that its perror does work right
this one is 5.0

http://bugs.mysql.com/bug.php?id=531

I think if you only dump a single database, it doesn't dump the CREATE DATABASE or USE by default

If you scroll down about halfway it explains that perror doesn't work alot of the time

MarkR42; awesome, thanks.

So provided you use the right one when restoring, it will Just Work.

MarkR42; is the command mysqldump a "read-only" command ?

Yes; almost
It may use a global lock if so configured; it often is by default.

You can pipe its output back into the mysql cli

MarkR42; thanks.

If that's what you were asking

MarkR42; i need to ensure i'm being safe when writing these bash scripts. 'sudo' has gotten me into trouble before ;(

This global lock will block any pending updates until it completes. On a large, busy database this may be a major issue

sub; yup, thats how i restore.

MarkR42, I think I'll restrict the selection range to about 3000 records, which should still be fine for a random ordering. when certain proucts are finished, the selection range moves on.

Assuming you can find a range which contains that number; if your IDs are sparse just finding that many products may be nontrivial

in PHP, can I restore by putting the output of a mysqldump into the mysql_query() function ?

Absolutely not.
Use the command line client.

I'll keep an eye on it. there might be some products deleted, but I don't care if its 2500 or 3000 products in the random selection, for now
so I can just use the id for range selection

provided your IDs aren't *too* sparse you should be ok then
Once a range is exhausted you'll move on to the next, yes?

i'm trying to keep my website database up to date with my store database. however, changes to the website database need not be reflected in my store database.

Provided the data are very small, mysqldump might be an acceptable way of doing this

4.5 megs

hi, my phpbb forum has been down for over 7 hours with the error "User has already more than 'max_user_connections' active connections [1203]" can anyone help me fix it ?

Assuming you know which is the master, and you don't mind having the data in your website database destoryed, you can do that

MarkR42; thats the plan.

Sounds like a hosting operational issue. If you are the systems admin, then you can fix it yourself, otherwise, contact whoever is.

ok

MarkR42; the store is always the master and should not be modified by the website in anyway.

If you are on shared hosting, you're in trouble

yeah i am why am i in trouble?

Because shared hosting is crap and useless

ok

They do not understand MySQL or databases in general

where can i get non shared hosting which isn't too expensive

I don't know :-)
Nobody else does, either, it seems :-)

o

hello
i just imported a file and for some reason all my fields started with a 'ABNY'
well
it doesn't show up when i type it in here
its like a '[]' thing

hmm?

so it looks like a '[]ABNY'
but its not that
its small and a block
''

where does mysql usally keep it's data?

how can i search and replace for a value in a column??
maybe that will get rid of it

umm, /var/db/mysql ?

thanks

Where did you import this file from?

CSV file
that i created from excel
it even looks fine in VI
but when i import it there is a leading character of some sort
in my fields

I ask because I'm wondering if it uses some weird text encoding

hmm it seems that ubuntu keeps it somewhere else..

Oh, right, that was where it was on my FreeBSD box. One moment.

in mysql it shows up as a .
but vertically centered

I found it in /var/lib.. should have looked closer, sorry

/var/lib/mysql
Haha, yeah.

sorry thanks though

The Character Set Latin 7 is supposed to be used for English and Western Europe. Should I use CI or CS?

You should use utf8

ok

If you plan to support anything other than latin1, ever, you should use utf8 instead
buggering around with other 8bit charsets is just too much pain

hi, can I get some help with phpmysql

Only if you have a specific problem and state it.

www.mail35.de

nope, np, fixed it thanks

www.mail35.de

how do you set the default pager for mysql?

how do I enable external connections for a user?

grant them privileges, ensure you're binding to an external interface, ensure that skip_networking is disabled, and make sure the network allows them to connect (Firewalls etc)

its the granting them privileges thing Im struggling with
am I going to need to use command line to set this up?
or can I do it within phpmyadmin?

does some one have a link towards documentation about indexes …
more indepth that the mysql official docs one … eg, what does an index of type X do exactly
how should i choose which fields etc

mysql.com/doc

does MyISAM support transactions?

google.com
Techdeck, no

thanks

What valume should I use for column collate and utf8? I am getting a 1064 syntax error when trying to create a table. Error says CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL at Line 5
What is the difference between Latin 7 general and Latin 7 cs?

guys, what do you reckon is the best data type to use in order to store an IP address in mysql 4.1.20?

varchar(15)
at least is that what i should use, as long as its an ipv4-adress that is.

Ok, I'm working on a site that is simmilar to digg, for keeping the number of "diggs" for a story, is having a table that just has story ids and userids to keep track of diggs a scalable architecture?

fraggeln, oh, good thinking! I suppose it would be a good idea to make allowances for IPv6 also!

also check INET_ATON
SELECT INET_ATON('192.168.0.10') AS ipn;
SELECT INET_NTOA(3232235530) AS ipa;
that is the same
so, you can use an int as well.
oww, wait.. mysql 4.x you said.
thats mysql 5.x

fraggeln, sadly I only have access to 4.1

What column collate should I be using with utf8? General? Ci? Or bin?

whichever suits your needs

What is the difference between the three of them? I don't find anything in the documentation?

general is general, ci is case insensitive, bin is binary

Thanks.

themolester, with respect, I don't much like you nickname

haha.

your*

can "select count(*) from sometable where foo = 'bar' and baz = 'quuz'" be O(1) if you have the right indexes?

I will never equal bar@
!

hhehe
j4cbo, rephrase

well, only need one column really… if there's a non-unique index on column foo, does determining how many rows have a given value require scanning through all the matching rows, or does the index keep track of the total?

Hello

lo

how would i do this so it doesnt pop out an error? INSERT INTO table VALUES $f_name WHERE id = $id

afaik scan thru
Sugi, mysql.com/insert, read it AGAIN

ok thx
ohh so INSERT only will insert a NEW row… cant edit an exsisting row
what command am i looking for?

update

ok thanks

mysql.com/doc helps

hello, is there any tool to draw a diagram of an existing mysql database? I tried MySQL Workbench, but it hangs with no error log :/
and DBDesigner 4 doesn't work with mysql 5

so… UPDATE employee SET f_name = $f_name WHERE id = 1

it does, but it only supports old-style passwords
create a account in mysql which uses the OLD_PASSWORD() cypher

weigon so how to get rid of this "unable to load libmysql.so"?
weigon "libmysqlclient.so"

on linux I suppose ? install the compat package

thanks for mysqlproxy - it is very needed

what are you using it for ?

I've moved the mysqlclient.so lib to the dir it should look it in, but nothing goes on. "unable to load…" after I give the user, pass and click "connect"
weigon is it possible "OLD_PASSWORD" will solve this problem?

"UPDATE employee
SET f_name = $f_name, l_name = $l_name, shift = $shift, team = $team, status = $status
WHERE id=$id";

too see what he looks for

we have two independent streams of live statistics generated for bbc

no, that's the second step

that gave me the error "Unknown Column 'Kev'"

currently we simply push them into mysql
with mysqlproxy it will be simpler

Sugi, 1. dont flood the channel, 2. output the whole query, not this php variable crap

that sounds like SQL injection

hm ok

Sugi, and yes, escape your stuff

please keep me updated and post to the forum
I'm looking for use cases and a proof that it works under real load

sure, i'll do it as soon as we finish deployment

I have 2 SELECTs, one gives me left interval boundaries an one gives me right interval boundaries. If I sort them, the n-th left boundary is coresponding to the n-th right boundary. I do however not have a join condition. How can I join them into one SELECT.

Is there any reason I should/should not use LIMIT 1 whenever I only expect one result?

always, I think with LIMIT 1 mysql stops scanning the DB after its found 1 result.
or something

If there is no reason to use it, don't

Well, that's the argument.
Is there or is there not a reason to use it?

did you see what I said?

I don't trust MySQL to magically know that it should stop looking.
Yeah.

Im not sure if htats the case, but I think I read that somewhere
shouldnt take long to write a quick perl script to test it

Is there any performance problem?

That's also part of the argument…

If you really want to know, follow imMutes advice and test it. I personally would not bother with that. If you can really be shure, this means there is a UNIQUE/PRIMARY and the database already knows. If you only hope for the SELECT to return one value, the application should check.

How do you set the default column character set so that Latin1 is automatically set?

Does "old_passwords=1" not work in mysql 5?

hi all
do you know if the mysql db has functionnality like the dbms_pipe under oracle ?
(cause i need to making two process (under two different machines) communicate)

What exactly is dbms_pipe doing? Writing to a file?

no writing to a pipe
and reading from a pipe
then one process can write on a db pipe
and another process connected to the same db can read from this pipe
even if they are not on the same machine

I have a MythTV settings table with 3 columns (value, data, hostname). I'd like to replicate all the (value, data) pairs from hostname='mooMedia' to hostname='blah'. Is there an easy query to do this?

weigon "unable to load libmysqlclient.so", ldd doesn't list it :/

No, don think so.

INSERT INTO foobar (value, data, hostname) SELECT value, data, 'blah' FROM foobar WHERE hostname='mooMedia'

weigon this error shows up after pressing "connect". The library is not needed from the start.

thanks

np

thx ElDiabolo

looks like it is loading it at runtime

so to update a column… UPDATE employee SET f_name = F_name + '$f_name' WHERE id = $id

you want addition?

no i want it to replace

Wouldn't that just make a copy of those existing rows? That is, he would have 2 sets of "mooMedia" rows instead of a set of mooMedia rows and then a set of "blah" rows?

hi all

Sugi, read that bloody mysql.com/update AGAIN!!
hi, carrera

no
the select doesn't select the hostname field, it 'selects' a static value

weigon I've made a symlink of libmysqlclient to /usr/lib. Nothing

Oh, I see that now, my bad :-)

can anyone tell me the diff between mysql-standard-5.0.27-linux-i686 and mysql-standard-5.0.27-linux-i686-glibc23?

no probs :-D

the later is 50% larger

"-glibc23"

carrera, glibc23

thanks

what a great surprise, eh?

which is the static version

you have problems understanding english text?

wek

neither of them

talking to me tibyke

weigon the file IS there. I've tried everything. Any ideas?
or, is there any other tool
I know about two od them, and none works :/

tibyke, Woosta, what do they mean by glibc23 then?
mysql dl page always confuses me

carrera, most probably a glibc version of 23, as a great surprise.

or 2.3

still no surprise to me tibyke
just frustration

well, get a coffee then
thumbs, of course

2.3, not 23 :-D

i'm probably on my 4th for today

hey, I didn't mean to correct you or anything

hungry

thumbs, come on, i know

why is the glibc2.3 version only 30 megs while the other one is 46 megs?
i guess, i need glibc2.3 for the first one to work

upgrading glibc is not a small affair

The other one is probably static linked

i know thumbs
i'm just trying to find out the mysql naming convention

d/l both, and you will see when untarred

i'e d/l both
infact, i d/l the beta too

but if your system does not have 2.3, it's safe to assume that it's an ancient installation

that's even larger, at 78 Megs
i'm running FC6
or F6 by their new naming
i think RedHat dropped 'core' from F7

then fedora was always screwy

I'm gonna guess that the beta has not had its symbols stripped and that's why it's so monstrous, but that really is just my guess :-)

can someone please take a look at this page http://dev.mysql.com/downloads/mysql/5.0.html#downloads
and explain the top two packages under Linux (non RPM packages)

What about it?

thanks sub, that explains the size diff
mysql-5.1.20-beta-linux-i686.glibc23

carrera, by their naming its still FC6
but why not use binary rpms?

right tibyke
tibyke, they only changed from F7

you are encouraged to use rpm

tibyke, i like things under /usr/local/mysql
nice and tidy, all in one place
tibyke, why?

carrera, because thats what its all about, packages, rpm package manager, etc
why do you use fc6 then? and why not slackware or *bsd?
or even gentoo

thumbs, i've a good friend called Francois back in CA
i've been a RH user for a long time
i've thought about trying Gentoo and Ubuntu
acutally, my very first Linux was Slackware

but fc6 has glibc 2.3 afaik
2.3 actually

that's back in '95 on a P90 with 16 megs of ram

Mine too.
Well, if you want to get technical, my first Linux distro I ran was called TurboLinux

ok.

mind the name of this channel, guys

Oh right, my first MySQL was MySQL 4.1 I believe
:-)

hehe

thumbs, do u live in back east?

that was my birth name. I grew up in an itialian/anglophone community
I am now back in montreal

cool
great city

as such, any french tidbits I knew back then are pretty much gone

heh

I did like Ottawa quite a bit

thumbs, Silicon Valley North?

at the time, yes

haven't been there

now Nortel and Alcatel are infinitely smaller, and the high-tech sector is absimal

too bad
at some point Nortel was threatening the Canadian Gov to move down to the US
it was over the high Canadian capital gains taxes

nortel is down to two buildings, now

wow… i guess they moved out at the end, alas in a different way

No wonder they charge $300 to recover lost passwords on their managed switches :-)

hi guys
I need an information

that's crazy sub

is available a mysql5 for the new RedHat5?

i bet Cisco recovers it for free

have you consulted the mysql download page?

http://dev.mysql.com/downloads/mysql/5.0.html#downloads

http://dev.mysql.com/downloads/mysql/5.0.html
yes
Red Hat Enterprise Linux 5 RPM (x86)

claude_monet_imp, go down to the Linux section

From what I've read, they have backdoor passwords that are based on the MAC address of the switch

sub, ?

It's $300 an instance to get this password from them

I've downloaded these files but when I try to install them a strange error appears

what's the error?

I have a Nortel BayStack 450-24T sitting in front of me that has had the password forgotten, so I've done a little research on the subject, lol

I worked on one of those

sub, now i get it

carrera, the error is Floating point exception

hmm

don't interpret the error

when I try to write in the shell mysql that error appears

I would have much more preferred a jumper to restore to factory defaults than to have to trash a perfectly good switch because the password is unknown :-)

word!

I'm sure

pastebin the error

guys, in mysql, what would be the best way to retrieve the last most recent entry in a table that meets some criteria. For example, users add data to a table of the following format: data_id, user_id, created_at, data_key, data_value. Say you allow each user to add more than one data_value for a
specific data_key, and you keep the history of what they have entered, so you never delete a row. How could you find the latest addi
tion of a specific user for a specific data_key?

SELECT * FROM foobar WHERE user_id=whatever ORDER BY data_id DESC LIMIT 1 ?

Floating point exception
Ok I'have downloaded these packages. Are correct? MySQL-client-community-5.0.45-0.rhel5.i386.rpm, MySQL-devel-community-5.0.45-0.rhel4.i386.rpm - MySQL-server-community-5.0.45-0.rhel4.i386.rpm - MySQL-shared-5.0.45-0.i386.rpm - MySQL-shared-compat-4.1.22-0.rhel3.i386.rpm

sub, of course!! That's so easy now you said it!! Thank you! I feel foolish! ;-)

Not a problem

ok, back to my original question
on the 5.0 d/l page it has: Linux (x86, glibc-2.2, "standard" is static) and Linux(x86)
where the former is 75.6M and the later 60.4M
which is the static version?

The bigger one

these are prebuilt, btw

I think
:-)

that's what I thought
now, what do they mean by "standard" is static in the 1st and larger pkg

Statically-linked binaries may give you a slight performance boost but it probably isn't anything to write home about, especially if it's a pre-built binary anyways :-)
If your system is at least somewhat up-to-date I would recommend the smaller one

it is
thanks
how about building it from src?
and forgetting about all this crap
sub?

Yes? That isn't a bad idea, either. It depends on your intent, I suppose

home use
i'll be installing apache+php soon
i wanna move my company completely to OpenSource
going with Postfix, OpenSSL, Dovecot for the mail server

that's a bad idea

i wanna move my company completely to OpenSource"

which?
why?

Just for home use? Then whatever you are more comfortable doing, whether it's downloading a pre-built binary or compiling it from source

are you doing that because you think open source stuff is technically better, or just for philosophical reasons?

hmm…
j4cbo, both
and cost

be careful.

really… why j4cbo ?

Microsoft has their ways of locking you in. In the middle of your migration you might realize your current applications cannot be easily ported to an open source solution.

everyone knows how tricky and Exchange server is

and if things go wrong, you'll just perpetuate the rumor that open source is a silly philosophy thing, and sour them on any use of any of it in the future

Consty, that's OK, this company is not too high tech

precisely my point

what's wrong with moving one app at a time

only switch an app out if there's a good technical reason for it
and sometimes (often, perhaps) there will be

the comapny who admins their current MS stuff is not too good anyway

What I would do is have some sort of testing system where I can test all my applications out on open source products like mysql and make sure everything works. After that point then I would migrate the existing servers.

for example the Exchange server
he is charging us a helluva lot
and there have more some issues with it
not accepting larger messages
dennying mail from my Gmail account

My belief is there is still no suitable robust replacement for Exchange in the open source world.

crashing on the weekend!
really Consty ?

Even primarily open source shops use Exchange for their internal communications. Usually.

Consty, I'm planning to do even more than that
I will be running them side-by-side for a while

Well I think Novell offers some sort of Exchange replacement, but I haven't heard anything roaring about it either.

if you're talking about using firefox instead of IE, or apache instead of IIS, then yes, that's probably a good idea
if you want to switch all the Joe Users over to Linux desktops, don't.

Yeah, what j4cbo said

j4cbo, oh no
just the servers

good

ah, yeah
i used to work for Telus

What services are you using right now on your existing systems?

Canada's 2nd largetst telco
and, only us, the developers, used Solaris
and eventually the Corp forced us to have Win2K laptops
to use for our e-mail communication
Consty, don't know exactly
I work for a High Pressure Engineering and Manufacturing firm

You've gotta know what you have before you even consider open source replacements.

in the oil business

In other words, the enemy!

heh
elaborate pls
I'm starting to like #mysql
some cool dudes here today

Unlike other technology rooms I think the web centric ones tend to be a bit more laid back and friendly.

yup

#java is one of the worst

really

oh yes

#java can't possibly be worse than ##c

i was thinking Linux would be bad

How bad is ##c? I've never actually hung out there.

j4cbo, why is there two '#' sometimes?

it's pretty obnoxious.
i've never been in #java, so i can't compare them

Consty, pointer to pointer bad!

That's interesting considering it's one of the most brief languages I've ever seen. The official C manual is like only 200 pages.

# is for specific pieces of software or projects, ## is for general topics

the K&R bible?

the line is sort of weak sometimes

thanks a lot j4cbo !
i've been wondering about that for a while
that doesn't say much about me, deos it?

was that to me carrera ?
The K&R thing?

yessir

Yeah, same one.

Kernighan and Richie wrote the C bible

I didn't know the authors names, but I just checked.

it was about 212 pages

i.e. there's #perl and #python because there's only one Perl and only one Python (except not really), but ##c and ##javascript

the ANSI C version
j4cbo, is there a #C too then?

no, since C is just a standard

makes sense

oh, it's Sunday back in N.A. that's why u guys are sooo cool today!

jython!

and ironpython and pypy and stackless, hence the "except not really"

That's dead now that 1.6 is out.

yeah

i wish stackless got integrated into cpython :/

j4cbo, then why #java and not ##java?

Built in and plugable scripting engines supporting any language…

I never really used it but when I first heard about it I thought, "Wow the guy that wrote that must have a crazy amount of free time"

Right now they only support javascript, but still!

since there's also basically one Java jre/jdk

Yeah.. if the source ends up forking like they think it might (hopefully not) then it'll probably turn into a general channel.

j4cbo, isn't there only one C and C++ too?

nah, there are a bunch of different compilers, libc implementations, etc
none of them are "official"

gcj

I think they say screw gcj

cross your fingers for this mysql-test-run

gcj is… interesting

is it alright to ask SQL questions here or should i do that in #sql?

i heard somewhere that pylucene is faster than the original, since the python bindings have lucene compiled to native with gcj

blehblah go for it

blehblah, well, judging by our conversation today, it should be OK

heh i just joined and you guys are talking compilers but mkay
uheh i just joined and you guys are talking compilers but mkay /u

if that doesn't surprie u, we were talking about Nortel switches earlier!

i have a table (members_to_go) with a column containing ids (member_id) from another table (members) and i want to use these ids (members_to_go.member_id) to DELETE the corresponding rows in the other table, can i do that easily with some kind of subquery?

blehblah, i'm new on this board too, but I already think the coolest guys hang out here
com'n guys, thank me!

Lol.

i'm inflating your egos

DELETE FROM members WHERE member_id IN (SELECT member_id FROM members_to_go) ??

oh i can do that?
i feel like sucha noob :}

Hehe, we all have to start somehow :-)

sould build the 5.1 beta for home then?
s/sould/should i/

go for it

it's aleady on 20th release, 5.1.20
is that stable enough?

for home use?
yeah probably

now, what's the diff between the Source RPM and Generic Source RPM?
there's yet a Compressed tar version
isn't that the same as the Generic?

is there a way to get 2,200 accepted as 2200 on a local data infile

delimit it with double quotes

well its delimited by default as tab
i think the issue is having an SQL_INTEGER as 2,200?

Hello all.. I'm having a very simple difficulty with the console. How do I get query output to format itself properly for the given terminal window?

if too many columns are returned, line wrapping will ensue
then fix your data
sed should be able to handle that

hi there
can anybody tell me where i can edit the mysql-password manually? i'm on linux

reset root

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

^^

thank ya

Can someone tell me what is wrong with this piece of code? http://pastebin.com/d63871774

what does the mysql console tell you, exactly?

is there anyway to make this work with one query "DELETE FROM message_data WHERE id NOT IN (SELECT id FROM message_data ORDER BY create_date DESC LIMIT 5)" that does what i want but MySQL does not let me put the limit there, so the only way around it that i can tell is to do the select then
delete using two separate queries

now the server cannot start any more
* Starting MySQL database server mysqld STOPPING server from pid file /var/run/mysqld/mysqld.pid mysqld_safe[11195]: ended

IceLink, did you check the logs
and did the server start before? or is this the first run

it started before i tried to change the root-password
i don't know how to check the logs, there are just strange files

what would be best to do, 2 queries, or one query which will repeat 4 columns lots of times and you just need them once ? (im left joining tables)

Elagic, one query that retrieves all the data you need an no more

edman007 im making a class on php, i have 3 tables, users, relations, and groups, so im left joining users, relations and groups, and filling the vars user, pass, level from users, which will be the same for every row
so i can do 2 queries, one for getting the user info, and another to get the groups and save them into an array

is it normal that mysql is stopped twice?

or i can do just one query with left joins
what do you think it will be best for performance?

Elagic, if doing it as one query is going to cause a lot of data to repeat that you don't use then use multiple queries

ok
2 queries then

IceLink, stopped twice? check the logs, its should `hostname`.err

now it is working but the password isn't reset like before

IceLink, then you did it wrong :P try again

now the server isn't starting -.,-

again, error?\

now the server is working
but the pw isn't reset .
oh damn must it be so difficult to create a new pw for mysql? .
i forgot sth.
is this important? ' * Checking for corrupt, not cleanly closed and upgrade needing tables.'

you forgot your statement handle?

statement handle?

reset root

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

you can re-read that, if you wish.

i'm still trying that out.

you said you forgot 'sth'. that's usually what the statement handle is called in perl documentation.

i meant something

also
!man grant

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

you can reset password with this as well

the prob is that i cannot login

then reset the root password

this is what i'm trying the whole time

I am getting an error message when trying to enter data into a table. The message indicates that the data is too long for the column entitled URL. Currently my datatype is set to VARCHARACTER(45). Is there a way to change this for the entire database without making a mess?

you can alter the table.
!man alter table

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

look. the first thing to do is to kill a .pid-file. i cannot dinf it, i guess it means that mysql isn't running

look with ps

then i shall create a text-file with a command which sets the root-pw which i have already done
ps?

i have a dumpfile (.sql) that i want to import into my database from the command line, what's the command?

man ps

the next step is to start mysql with executing this text-file but it doesn't seem to wrk

mysql file.sql

oh really
how silly of me, thanks

Comments

« Previous entries · Next entries »