Archive for Uncategorized

I have looked at phpnet and tried to find how to do this but I am out of luck I understand that doing an include

connect("mysql://blah"); and mysql_connect($dbhost,$username,$password);?
is there a preferred method?

/home/user/public_html/myapp

i have domain.com/file/5443 what header to set default filename in saving to "file.zip" ?

do echo filename and working dir out of the script

hi everyone, i have an ajax/php image cropping app i grabbed online. it uses outputjpeg but for some reason, if i use an ftp client to upload an image, it displays it, if i use moveuploaded file, it will not display, any ideas?

can't get ya

does moveuploadedfile change images somehow?

you mean in a separate script

no, but file access rights might be set wrong

yes or just add the lines….try to print out the template file and dir out of your script

hmmm.
ahhhh
how can i chmod to 755 for q file?

ok

God I am bored
e319, php.net/chmod

so? is there a references-to-functions solution in php?

The only "reference" you can create is
$foo = 'myFunc'; return $foo ();

there is a chmod function in php

you can also do $foo = myFUnc (); // but that does not mean every time you call $foo the function myFUnc will get executed.. It will only get executed once, when you assign it to foo.

i could print all vars normally

sean` : since you said you're bored… how would you get the size of a directory (including contents) from php webhosting ? :-)

hmm….something seems to go wrong with the full filename….any special chars?

fireba11, filesze, readdir/scandir and recursive structures
m0dY, you are having problems with smarty?

sean` : there's no more elegant way ?

sean`: yes

yes, fireba11

hm

sean` : dang .. thanks though

points to #smarty

and can i call functions with their names in strings?

you mean this scrambled auto generated full file name or which one you'r referring to ?

yes

sean`: exactly as long as i get nothing useful from #smarty channel

m0dY, it still is not allowed

i would try to exec a system tool and see if it can do sth. with that encoded filename

if you can't even use a 3rd party script, with such good docs, what are you doing here

sean`: it's not an issue of documentation reading
but ok
switch channel

grr

sean`: you are assuming that any 3rd party script somes from heaven with zero bugs and having problems after reading the docs then it must be something with me, doh

even better then telling ppl that there is a solution, but not teling how the solution is or works….

do you really do code using your hands and your mind or just hands?

m0dY, if the script has errors write your own
If you have problems, come here
what is your problem anyway

($dbhost, $username, $password) = connect_netipm();

lol, sorry

i'm returning those 3 variables from my function?
is that not the right syntax?

Vme, list ($foo, $bar, $baz) = array ('foo', 'bar', 'baz');
m0dY, what is the problem
fireba11, I believe there was some craz function to get the maximum dir size or current dir size of a directory
but I can't remember the name

http://pastebin.ca/635842
m0dY's problem

$foo = new bar(); leads to a new object, created from class bar, true?

sean`: here's the original description of the problem http://www.phpinsider.com/smarty-forum/viewtopic.php?t=11549

so what is new bar(); then, without that variable before?

XrMb2, the same, its just not attached to $FOO

return($dbhost,$username,$password,$database);
that is how i return them

hm, so there's an initialisation of the class, it's constructor is being executed, but with no variable associated?

never heared of arrays?
php.net/types.array
m0dY, do you have yor chmod permissioins correct everywhere?
also check if trailing slashes aren't "necessary" for the vars you're using

..true? :P

it says - No such file or directory in

sean`: all double checked
php is running an fcgi daemon under the same uid/gid of the user

getcwd return different way than /home/user/smarty/templates_c
so, when smarty whant include that file it really can not find it

hey sorry i have a quick question but i CANNOT figure this one out, i have a value in my database that is set to zero, (it is a counter) how can i add a number to this ? i tried $variable++ and $varaible +1 but that does not work because the value is set to 0

greetings, have someone ever tryed to check a counter strike server for the "right" pw?

m0dY, compile dir and template dir should have a trailing slash

is there anyway i can read this value as it is ? or do i need to change the default value to null or something ?

m0dY, also try to use absolute paths instead of relative ones

the problem is not with including, it's in creating

do checks with file_exists and is_file

sorry im just 100% stuck here

sean`: i used absolutes also no good

m0dY, smarty has proven itself over a 10000000 times.. You cannot tell me it's smarty
It is without a doubt your configuration, I am sure of that

sean`: the problem is that it should create this dir it's searching for and put the index.tpl.php file in it

open("/home/egxldr/public_html/myapp/smarty/templates_c/wrtPCrLWG", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 6
that is from log of strace

sean`: see what yup typed

invinceable, $info = *fetch_assoc ($resource); $info['counter'] += 1;

sean`: templates_c/wrtPCrLWG" is the file which should be named to index.tpl.php

You can also do this in sql hosting if you want to store it, using an UPDATE foo SET counter = (counter + 1)
hve you found occassions of similar problems on the web m0dY ?

whenever i try to run the index.php file it just creates a new file and not the main dir its searching for the file in

ahhh thank you! ill try it

fireball - i added a chmod, and the permissions are right now (755) any ideas why it wouldnt be sble to access it?

can you specify full, not relative pas to yours smarty dirs

sean`: some without a solution and some with this magic scrabled named but was a permission problem, and what i am saying here is that _i_have_no_problem_with_permissions_ by anyway as if i even had a file or dir with 000 i could still access it

m0dY, anyway, use absolute paths

http://paste.ubuntu-nl.org/31545/ would result in "image not found"

and double check them using file_exists, is_dir, is_file etc..
then set up a testing area

?

and tell me m0dY, why do you have a config dir and a cache dir?

sean`: default config asks for that ?
im not a smarty expert

m0dY, remove the cache and the config dir assignments
also remove the use_sub_dirs
template dir and compile hosting dir are the basics
set it up from that, and then move on

the same

e319, you do konw you're in ##PHP, which is about PHP
m0dY, pastebin your config

ok

sean` : remind me to not just c&p examples from the comments on php.net without checking them first ^^ the function for calculating folder size recursively had a huge bug causing it too show twice the real size

ok how can ui get the info of what the php file being called ut producing?

hahaha

smething to analyze the ajax

have you tried absolute pathes ?

e319, can you make a little more sense?

yes
http://pastebin.ca/635891

no.
hah

10 mins, have to get launch and be back

how can i see the flow of an ajax request and response? ie, seeing what the server host backend script produces as a resppnse … something for my browser?

the same error ?

bom dia a todos

m0dY, have you tried putting smarty in anothe rlocation
in the web root perhaps
if not, give it a try

hey aaron

ok, then how can i find out exactly what is the problem with this then?$editDirectory = getcwd()."/edit/";
$imageName = $_GET["imageName"];
if(empty($imageName) || !file_exists($editDirectory.$imageName)) { exit; }
$output = imagecreatefromjpeg($editDirectory.$imageName);
imagejpeg($output, "", 100);
imagedestroy($output);

Is there a method in PHP to find out what encoding is used when receiving form data?

$dbhost = $connect_info[0];
shit
sorry

connected yet?

lol
i only wanted it once
i was going to ask i have 4 variables in the array, is there an easy way to access them individually
besides [0] & [1] …etc..

is there a way to determine the DOS short name for a path on windows using PHP?

Vme ["a_name_given_by_you"]

spam much? :o

spam?

hi all.. i'm having trouble with file_exists($path) where $path contains chars like spaces, ( and [
can i escape those somehow?

Why?

Wolfpaws, don't know.. seems weird. If i do error_log($path), and just copy-paste to php -r 'print(file_exists(file copypaste here));' it says the file exists

hey

hi. I've just compiled PHP 5.2.3 with a failry smple set of extensions. Why do I keep getting "undefined symbol: zend_qsort" when restarting apache2?
(libtool run)

other than back/forward slashes, is there any other kind of santiation that should be applied when taking a querystring to use for an include? e.g. include($myfile . ".php");

hi!

zend_mm_heap corrupted How can I debug this?

"This problem is the result of making configure changes but not running a "make clean" before rebuilding PHP"
bah

http://apache.pastebin.ca/635943 but not with "php -r '$tidy = new tidy;'

Is there a way to take binary data in a variable, and pipe it to a cl app?

Vlet, use a pipe.

Yeah, but how? Say I want to pipe the contents of $x to 'file' to determine it's mime-type, etc, how could I do that?
I can't put the binary data into a shell command

proc_open()

ahh, thanks

Hi i'm doing my first login thing using session_start(); and i came across a problem where i could access anything without login in, so i figured i'd look and see what was in $_SESSION after session_start(); had just been issued and all it said was Array. Why does this happen?
Am i asuming session works in one way than it actually does work here? I was under the impression that once session_start(); was issued the global variable would contain my current session id.

Array('1'=Array('foo'='this'), '2'=Array('foo'='that')) and reduce it down to Array('this','that') ?

hello

Nevermind i think i figured out my own problem.

I have a problem with preg_replace

checkout array_reduce, that might help

[Table 'usr_web1_1.phpb3_config' doesn't exist]

hmm

pg_query_params() [function.pg-query-params]: Query failed: ERROR: syntax error at or near "$1" at character 20 in /home/daniel/public_html/scorpio/server/include/scorpsystems.php on line 18

and I want to replace it with preg_replace at some points. I'm using this pattern:/'([0-9a-z]+)\.([^_]+)/

query looks like this, pg_query_params("UPDATE systems SET $1 = $2 where sid = $3;", array($key, $value, $this-data['sid']));

but it doesn't make any changes to the text

set $1 ?
i didnt' knew that variable names could be numeric

pthreat, it should be $key in the array

and DONT ENCLOSE VARIABLES WITH QUOTES!

?

Everytime someone writes in CAPS, God kills a kitten. Please think of the kittens!

thats why im using pq_query_params insted of pg_query
safer

sigh
I HATE KITTENS

someone can help me?

theyre not variables, theyre replaced by pg_query_params with the elements in the specified array
and made sure that all quotes are \'d out

$?

http://au3.php.net/pg_query_params

You are so evil.

-_-'

B00
and $1 is a field name right …

isn't that illegal for the first character of a var to be a num?

it is

http://au3.php.net/pg_query_params
thats how the official doc says to do it
and it works in every case in my app cept this one
its not a variable

oh. placeholders

ya
but doesnt seem to be working
maybe it only supports a max of two

for an enterprise grade dbms? i doubt it

yeah
well this command works
pg_query_params("UPDATE systems SET ipaddr = $1 where sid = $2;", array($ipaddr, $this-data['sid']));
the one that doesnt:
pg_query_params("UPDATE systems SET $1 = $2 where sid = $3;", array($key, $value, $this-data['sid']));
almost the same, cept for the var instead of ipaddr

perhaps it doesn't allow the column name to be a parameter

yeah, might be

its the same thing that i've asked you
whats $1
is it the column ….

it's a placeholder

pthreat boo?
oh

got that… but im wondering what has he specified as it to be

got the meaning

ah
'ipaddr' atm

ah

hmm
as in 'ipaddr' …
update some_table set 'ipaddr'=1 ?
'127.0.0.1' rather

yeah

maybe its just that …
youre escpaing what youre not supposed to be escaping
s/escpaiing/escaping/
anyways i spelled it wrong .. ;\

i think the function automaticly handles all that

if so, checking the logged sql queries would have saved you time

im not adding any quotes

maybe the function escapes everything properly dude …

yeah lemme check on the server
haha what
UPDATE systems SET $1 = $2 where sid = $3;
its using the placeholders names

I don't think it is a wise idea to have a variable for the colum name

but dropping the $1 would give you the expected sql query?
i'm in a situation where i must allow the a column name to be determined at run time

I am just saying that the colum name can usualy be known at query template definition time

it can
but that makes it alot more static

static can be good. too much flexibility is giving me headaches…

if its done at runtime, it means when i add a colum to the db, i dont need to edit any code really

you probably will need to add a value for it anyway

but yeah, obv this function doesnt like it
ill just wrap it in my own function

well you don't have to
pg_query_params($dbconn, 'SELECT * FROM shops WHERE ' . $key . ' = $1', array("Joe's Widgets"));

ah, yeah thats a better way
altho that could be injected couldnt it?

then escape it

then again, as henke37 said, why would you want variable column names?

because you don't know what column names would be available until run-time?

~….

heh, i had to expand a 285 character line to 18 lines before i realised the logic was screwed
(first post exists and you posted it) or (you are a jr mod and first posters admin level is lower than yours)
should be first post exists and (you posted it or (you are a jr mod and first posters admin level is lower than yours))

How can I contribute to PHP6?

with a check

I mean, is it going to be open for development?

:-p how good are you at c?

ehh, I know C++
:-p

i think php is written in c
iirc

heh, and obvious screw ups in this screw up of a script?
http://sausage.no-ip.org:88/paste/warftpd-useradmin

Alright, well I've heard it's not that hard to learn c after you have a c++ background, obviously differences
But, where would I start?

any*

c is a fairly simple language
you need to know the fundementals of computer science tho if you want to do anything
stacks, heaps, linked lists
pointers, memory

php core is C, but you can write extensions in C or C++ or any other language that knows how to link against C

Alright, well maybe I'll just stick with contributing to opensource projects themselves :-p

learning C from C++ can be tough because C++ makes you lazy, learning C++ from C can be annoying because C++ takes away control

c++ gives you data structures and strings and stuff
you dont get that in c

Sure you do.

I think I've seen 3 actually decent open source php projs. The rest are just whatever.

too hard to make generic data structures in c
whereas c++ has templates and oo

Do you have ANY idea what you're talking about?

?

’cause you sure as hell don't sound like you do.

what do you mean

too hard to make generic data structures in c" That's like saying writing hello world in php is too hard

do the openssl_seal and openssl_open functions work on win32? the docs are unclear.

Yes, but you have to work out the fugly openssl.conf thing

fugly openssl.conf thing?

pollita why?

i'm not sure what you mean

c doesnt have polymorphism or generics or templates

http://php.net/ref.openssl — It's on there somewhere

you cant make a standard library for stuff like that, so you need to know how to implement them from scratch usually
is all im saying

It has C versions of all three of those.

oh goodie, i need to borrow those

c has macros

i wonder what the license is….

Right, templates are just f-ed up versions of macros.

kin dof
but with type checking and smart stuff like that

"smart"

macros just rawly replaces text

That's my point from my original statement. C++ takes away control and makes you lazy
"Here, don't think about the data you're working on, let me do that for you"

you mean the the first comment there?

mm
well, yeah
i aggree

No, in the main docs

-g

ah, i see
the bits about OPENSSL_CONF….

Anyway, don't listen to me… I'm rude and oppinionated.
Welcome to the internet

that reminds me. what happened to jymmmmm?

hmm, building a user profile page, and have a section where users list their languages and the level they have that language at, also have a section where they provide details on their licences,accreditations and qualifications, so have a simple little box per entry in each case with fields
in groups like, language:[lanaguage, level(fiar,good,fluent, native)] certification:[title, accreditingbody, dateissued] and so on…

well done

how can i have the user click add, have the form ammend itself to the column it's in on the user dash, have the user insert the detail about their licence for example, and click ok and have the data saved and display on the page in text? gotta be ajax related, but i've not done any :P
would be nice to offer that kind of dynamic page effect, but is it possible to ensure that if js is not right the form will degrade gracefully into normal http request

Is there any speed or cpu cycle advantage to using $var == ''; vs empty($var); ? I know that $var is going to be a string, so as far as my code is concerned they are the same thing

i think that optimisation would net you a 0.01% speed improvement. your time might be better spent elsewhere refactoring code

lol…probably, and that's what I thought…I just realized it as I was re-factoring a function, and thought I'd check to see…it's probably not worth the keystrokes to change it
Thanks

empty will check if the var is null, "" or undefined
== "" assumes its not null, and is defined

php is just like C, 0 == NULL ?

i think 0 and NULL are different in php

i don't

and NULL in C is ((void *)0)

null is 0 in c
well, there is no null in c..

sorry, yes, 0 in C ((void *)0) in C++

null == 0 == false
null !== 0 !== false

just put display:block; on the form and then use document.body…appendChild to attatch it to the column. if you want the form to submit without refreshing the page that will require "ajax"

deadroot ?

== doesn't test for types. === tests the types
so 1 == '1' and 1 !== '1'

ahh

and it's not only possible, it is essential. Use javascript to "block" the link to the form loading then do your stuff. If there is no javascript hosting the link will execute as normal
amazon.com/books

!+identity

hi f00li5h
you joined Wolfpaws' cat clan?

how can i save objects in a database ?
i want database mapping :P

php.net/serialize

noooo

php.net/base64_encode

Mace[work]: purr

nevermind then

Mace[work]: i never joined any kitty klan

i see
what *do* you want then?

hibernate for php

could'a fooled me ('cuse the pun)
hibernate? database mapping? be more specific..

a layer for database, dao, like hibernate api

it's overkill!

Mace[work]: it looks like i did

overkill ?

i have no idea what you're talking about
talk english

lol, i do

the only ORM i know is pear.php.net/db_dataobject, but it's a bit fruity (because it's filled with php4isms)

it's a layer for database right, so when i include it to my application, i do db.save(aPerson); and it do the job on the db

neat, next time you're in Australia/Sydney, look me up

do you really need all that abstraction?

all i have to do is to implement a few methods and config files for db mapping

hah

guys, I'm trying to get my script to write into a db host1 and select from Host2 but aint working, any idea?

sounds like nothing but a headache, g/l

well, right now no, but building like that make application so much more modular
less work next time in other words

implementing cross system api's can only be a good thing
http://www.hibernate.org/hib_docs/v3/api/
looks interesting :x

an ORM is far better than having to do all the mapping by hand with insert statements

is it possible to read the song name/album name/song length, etc without download a whole file?

java hibernate?
yeah I heard good things about it

*downlading

f00li5h, that really depends on the scale of the application… ORM can be pretty bloated for small apps.

the app won't stay small for long enough for that to matter

f00li5h, some apps stay small

personally, i'd rater use somewhat overspec'ed code for the first part, than writing all that crap myself

me two !

a smaller ap should require less code than a full size one

me three plus when you do a big app you're used to it

if i have to do all those inserts/updates myself (and write test cases for them) there'll be more code in the small, ormless one than in the big ap

thank you captain obvious for that

np
true though

it was going somewhere …

please help!

purr

DavidHKMrPowers, are you talking about id3 tags?

insults in a discussion are ftl

f00li5h purr?
cyth exactly!

purr

DavidHKMrPowers, and why do you need to read them remotely?

moew ?

is there a php framework for testing ?
like junit or something

toste, phpunit

meow

nice nice

or simpletest??? (something like that)

there's simpletest

cyth because i want to search for songs

can it "simulate" POST and SESSION stuff ?

lastcraft.com/simple_test.php

cheers

keyword in php

DavidHKMrPowers, the id3 is in the header of the music file, so you would atleast have to download the header and abort the connection somehow.

A purr is a sound made by some species of felines and is a part of cat communication.

aaaaâàeeeeuuuuh

cyth so, i need to download a fixed or varied length ?

yes, it normally indicates enjoyment, or affection

is the same as echo

DavidCraft, varied

that's about the only one there is

is bad

Mace[work]: why is that so

it's often disabled

cyth oh!

it counts as a 'short tag' and they're discouraged (perhaps deprecated)

errr DavidHKMrPowers varied

cyth thanks !

anyway back on f00li5h's point, we were talking about ORM not premade model classes, which is not necessarily ORM

ok…how about php=$var?

know one script publish news ?

ternary operator is good for shortening code

= looks like jsp eew

ORM will generally pre-generate the classes for you, so they behave a lot like models
i'm not sure that works

idefine no

somestuff here php endif; ?

oh ternary operators are nothing like that
how stupid of me
/sarcasm

cyth omg, id3 is at the end of a file

really?
i could have sworn it was in the beginning

if …. : is an icky construct, why not use {}.. most editors have a go-to-matching-brace function
bif …. : is an icky construct, why not use {}.. most editors have a go-to-matching-brace function/b

that is true.

cyth ys..the last 128 bytes

f00li5h, because that breaks templating in templates
which I am assuming he is doing

hmmm, well a mysql class with insert("table", $array); where all data in array will be place according to the key

how does it break templating?

would be good enough then

Mace[work]: hah, yeah sorry, didn't see your messageo n ternary operators.

is there a way to determine the DOS short name for a path on windows using PHP?

http://www.google.co.uk/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=6um&q=shorthand+notation+php+-directives+-php.ini+-bugs+-windows+-namespaces+-algorithm&btnG=Search&meta=

there isn't, that i know of

*shrug*

f00li5h, well actually i shouldn't say break templating, but destroys the readability of a template

again, how so?

http://www.programmingbulls.com/php-tutorial-assignment-arithmetic-string-comparis

{} is fine in all php file, but templates php if($condition){ ?
and some time later php } ?

hm yes

well, … some time later is just as bad for else :, only you have no way to find the matching else

it would take a good ide to match brackets

and an even better eye

Mace[work], my point exactly

who needs a good eye? editors and syntax hilighting can find that for me

hello, somebody can help me to find where the pear files are after installed ?

i have an excellent eye

Hey, how can I use date(); for GMT+1 ?

and it's hard

well, i like better foo(); ?

!+editors

f00li5h, editors and syntax highlighting are not an excuse to mangle readable code
period

etc just make the template a pain

(php-bot) Editor discussion usually degrades rapidly due to personal preference. It is not a valid topic for ##php. Please try http://freshmeat.net/browse/63/ , http://www.php-editors.com/ or http://en.wikipedia.org/wiki/List_of_text_editors and find your own preference
(php-bot) Editor discussion usually degrades rapidly due to personal preference. It is not a valid topic for ##php. Please try a href="http://freshmeat.net/browse/63/"http://freshmeat.net/browse/63//a , a href="http://www.php-editors.com/"http://www.php-editors.com//a or a href="http://en.wikipedia.org/wiki/List_of_text_editors"http://en.wikipedia.org/wiki/List_of_text_editors/a and find your own
preference

Mace[work]: what? i'm not taking about editors at all

http://php.net/mysql - stuck at the sql query .. how can i see all my tables

i'm saying that it is /more readable/ with the {}'s

(f00li5h) who needs a good eye? editors and syntax hilighting can find that for me

Mace[work], hmm, yeh, your right, thanks for the js/ajax tips not directly php related i know anyway.. back to figuring out my mvc stack

in fact I've been on so many systems where I had to refactor code on the fly, with nothign but vi
with nothign

NET||abuse:

Mace[work]: yes, what does that have to do with the editor factoid?

i thought editor meant editor i'm wrong

f00li5h, it is NOT more readable with {}'s

could be anything

to me, it is …
how could that be anything other than the end of a block, of some kind?

only closes one logcial structure period

the % key will take me straight to the beginning of that block

Mace[work], do you use mvc? or your own model? and do you then use a framework? i'm reading through prado, agavi, solar and a few others to see if they're really worth using, or am i better off concocting my own stack of classes,, i've started, but should i cut my time spent on that and use
something prebuilt?

f00li5h, yeah but there's alot of blocks to choose from

Mace[work]: this is what i was looking for: http://www.php.net/manual/en/control-structures.alternative-syntax.php

you must be out of your mind not to use the alternative syntax in templates

no, {…} nests perfectly, there can be only one matching { for each } in the file

Hi there. I'm trying to download a remote file via PHP. For whatever reason, this code is giving me a Syntax error in parameters on ftp_get() (which I've never seen before). Any ideas? http://pastebin.ca/635181

f00li5h, same for endif;

um actually going against what my personal beliefs are at the moment I don't use one, but I plan on using extjs _very_ soon - I've played with it, read reviews. It's the only choice if you ask me

but there's no way to match back to it in any editor I know of

but I can tell it's an end of an if block just by first glance

Googling the error brought me to a few Russian pages, but that's about it.

why doncha use file_get_contents

because the previous if isn't the right one most of the time

f00li5h, that's a feature issue in your editor

Mace[work], ohhh, nooo, i mean php mvc framework

for a given else :

That's a great question! I would love to use file_get_contents, but I can't seem to get the FTP wrapper to work, since our username has an '@' sign in it.

same answer i'm afraid - thought you were talking about form manipulation in the browser? you need javascript..

This file is being downloaded via FTP.

f00li5h, not a clue, never had an issue with it
cuz I can see the structure at a glance

it matters more for larger templates (which should likely be split into smaller templates)

and I don't need an editor to read my code and tell me what's up
cuz i know what's up

Mace[work], same answer? you use your own, or you have a framework in mind as "the only choice"

Oh ffs. I see the problem. Typo. $server_file is not the same as $remote_file.
sigh.
Sorry!

f00li5h, exactly :p

do, you have it give you more information, you don't let it be the only source

the answer being a "helpful" and "understanding" — `no`

if a word is yellow, it's a keyword… that's helpful information

Mace[work], haha, right, got you now

it sounds like you're on the right track, ask around.

Sweet. That's doing something now.

well, i have a form and user profile system to complete.. i'll look further into the frameworks again come the next project

f00li5h, it's helpful, but you shouldn't code around an editor.

you should still try and get it running with file_get_contents

Hey. I'm getting the following error in a script im trying to create. Not sure why. Parse error: syntax error, unexpected '{' in CWAMP\www\realmregister.php on line 122 I have the code up at: http://pastebin.com/m6087524b . Can anyone point me in the
right direction as to what i did wrong?

using code blocks leads to a world of unwanted illsuion of what a page of code means

did you try to urlencode() the username?

No, but that's a good idea.

well, anyways, presentation layer should always be separeted

wait
rawurlencode()

form data, logic etc
from

i'm not coding arround a particular editor, most editors match {'s, even phped can (and phped is made out of fail)

so hrm, tags are the way to go for webdesigner that like to make little pretty drawings and don't understand shit about anything happening behind

f00li5h, that's most editors… and like I said you'll never know what systems your code will end up on and all you have is a featureless text editor

hi all

that's my point

"featureless editors" are no good to me, i'm not going to waste my time with joe

I need lunch shell script from php and I don't wait
how todo that !

system( '… &' )

f00li5h, that's exactly my point f00li5h

what is?

that your useless without your editor

f00li5h, I tested it but noway

That's awesome! rawurlencoding the username worked great! Thanks so much!

but i have to disagree

I m good shell coder I know how to run backgroud process

f00li5h, editors are great, but if you can't code in notepad :p

so what's the problem then?
coding in notepad is a waste of time, it can't even preserve line endings

& doesnt the solution with php

cool!

php wait the end of execution of script

yes, it does, but you need to redirect stdout to /dev/null too, so it doesn't wait for the filehandle end
uyes, it does, but you need to redirect stdout to /dev/null too, so it doesn't wait for the filehandle end/u

f00li5h, yeah then you never been in my shoes. where you get thrown onto some computer and told to fix some code

f00li5h, good idea I will tested it
f00li5h, thx a lot

and you have nothing but vi, and hell if they let you dl something on their computer

bring a usb key with Zend studio ;P

or notepad

givm is 1.5 mb, and can be downloaded and ran as a monolithic binary
it takes no more than 2 mins to get ready

actually they expected me to do php in frontpage
and notepad is better than that

a tradesman needs his tools. end of story.

did ya know that notepad got highligthing tools ?

you can't put in a nail without a hammer… well, not cleanly

f00li5h, a tradesman in our field tools are the language.

if you're thinking of the same notepad as i am, it doesn't
no, there is more than that

the editors are nothing but battlefields.

wrong-o

and you have to be ready to fight anywhere
anytime

bollocs
that's total crap

it's not my fault you can't program without crutches

it's not my fault you're using blunt tools

hmmm am sure to have seen it somewhere

I prefer ide's and a good editor… but I am no way dependent of it, and in no way write my code assuming it's going to be viewed in an editor.

i'm not assuming any editor, we've been over that

because I've been in so many situations where I had nothing to work with.

"situations" like what?

f00li5h, your assuming an editor has certain feautres

no, i'm not assuming that at all.. i'm saying that that feature will make it easier to edit the code
as is an editors job

can anyone point me to a site for PHP authentication with NTLM?

well yeah,
but it should make it easier… not essential

you imagined that it was "essential" i never said that

you've been implying it for this whole conversation :p

no, you've been inferring it

no you :|

so's your face.
and your mum.

f00li5h, your mom goes to college
I am just saying that I've been in so many situations that I had to code…. and code now…. with nothing but joe, pico, vi, or notepad
and because of such I write my code to be easier parsed by a human,not an editor.

my editor of choice is vim, which is likely to be on most BSD/Linux's, and can be attained from gvim.org in other cases

such is my choice too, but you don't know how many systems I've come across that don't have vim installed
it is quite a large package.

yeah, and i know that each of them has an admin who can install it for you

I have this code usign xajax http://pastebin.com/m3232402d. It work fine for like 4 minutes, The problem is that then the browser stop responding and freeze. The computer slow down and I need to close everything and start the browser again. Someone may
guide me on how to improve that aspect?

f00li5h, yeah, that's if their not busy enough to go out of the way to install an editor on a machine that already has an editor on it.
been there too.

try this line "install vim, and i'll buy you a pint/pizza"

and you know what?
I am sick of RT being so slow :/

what's it running on?

I have no idea, but the search builder is sloooow
everything else is fine

i generally don't look at more than "my tickets" and "unowned tickets"

yeah we have a pretty large system, so I usually have to search around to find anything

i see…

the way we have things set up I have to look in other queues that are not my own

my fallback is to seach for keywords that may be in the subject with the quick search

is it possible to use PHP to track where my swf is embedded?
$_SERVER variables return my own host, not where the swf is being called from

not likely, what specifically do you want?

for example, if a user embeds my swf on myspace, I'd like to know that

the best you can do is track the referrer, and that's only if they hotlink it

isnt the swf url available in the embed tag?

otherwise they can just save it, and upload it ot their server

or object tag

you could includwe something in your flash thingie that dials home
and gets cranky if it's not in one of the pages on your server

well, it's not that I want to disable it, I'd just like it for stat tracking

then that's the win

huh?

I think the dialhome idea is probably the most reliable

what do you mean by dial home though?
how would I get the 3rd party site's url?

you know the sites url, because you're in the page… theres hould be something for that
all you need to do is have your flash animation make a request to yoursite.com/harvested.php?id=this-flash-aps-name&in=the-other-site.com

I need a Christmas miracle to get sendmail working. Anyone up for the challenge?

example.com is registed for that purpose, i wish people would stop using real "dummy" domain names

apt-get install sendmail

it needs to be dynamic, though?
minus the q mark

hrm?

f00li5h, I run this where?

actually, doh- I misread that- I don't think flash can get that var, though

you'd have to find out of what flash has to offer on the subject

i love f00li5h

yeah
good point

in a root shell, ln your debian box
purr

Not a debian box.

example.com isn't likely to be stealing your flash animations though

f00li5h, it is *apparently* installed, although I'll be damned if I can't find the config file.

oh… well, cd /usr/pkgsrc/net/sendmail && make test install clean # on your NetBSD box

CentOS box

it'd be in /etc/, configfile wise

example.com is registed, w3c i think, for use as an example domain

yeah…looked. Not there.
Idiot provider

i'm aware of this, and i use example.com when i write real docs

not everyone is, and people should be in the habit of using example.com

will curl info display in phpinfo()?

it's true… although there are some cases when example.com won't do it (like when you're doing interesting dns lookups)
have a look and see

well i did
and it doesn't show up
i'm asssuming it would be there if it was available
?

yes, Vme

its not, and i'm not root

then extension is not installed/enabled?

i'm really not sure … i don't have it installed

I don't see any mention of it at all

what OS you on?

the server is linux
running apache

yes but what distro?

redhat
Red Hat Enterprise Linux ES release 3 (Taroon)

http://us3.php.net/phpinfo

redhat–

is expose_php set to on?

then make sure the php curl package is installed, maybe yum install php5-curl ?

since when do I have to be a channel op to invite people?

"This includes the PHP and Zend logos, and the credits"

is page rank open to public?

DavidHKMrPowers, the google one?

i mean Page Rank(tm)

ask #web

just type in IRC /page_rank mysite.com
and it will tell you the rank

AlexC_, no need to try to get rid of him

?

AlexC_ it diesn't work in my irc..
client

really? what's the domain - I'll do it

yahoo.com

AlexC_, sorry, I thought that read /server page_rank mysite.com

24 - Yahoo.com

so do I have any good rank?
henke37.cjb.net

65,341 - henke37.cjb.net

is that good?

not sure really, making it all up =D I'm bored

lol

i entered /server page_rank yahoo.com
btw, isn't pagerank from 0 to 10?

libcurl.so.2.0.2

that is in /usr/lib

I'm not sure, but this one seems to display quite high numbers at times

hello

goooooood morning mr kn11px

AlexC_ ok

glad I could be of help

I'm having this super strange problem where echo doesn't seem to be working. http://pastie.caboo.se/82837 Anyone have any ideas?

$person['photo_file'] does not exist

AlexC_ heh

$person[0]['photo_file'] exists

I have a variable "$price['type']" which is either 'unit' or 'load' … and I have $order-price_per_unit and $order-price_per_load variables as well. I want to set ONE of those based on $price['type']. I tried this…but it didn't work AND didn't throw any errors:
$order-price_per_{$price['type']} = $price['price'];
Is there a way to do that?

can i easily convert a object to an array?

is possible to map tables in a mysql_query to an object for each table? ('SELECT * FROM posts INNER JOIN posts ON posts.user_id = users.id' to a 'Post' class and a 'User' class?)

it's easier to do $order-prices[ $type ];

Hi all. I've searched Google with little luck. Anyone know of a free PHP poll script. I want to collect a yes/no answer via a poll that requires authentication. I figured finding one is easier than writing one from scratch (which isn't overly hard I realise)

that may be, but it's already set up the other way, and I have to work with it as is

Adrian_dlcspm tried sourceforge.net?

if you can't use google to find a Poll script … then, well …. how can you not find a poll script on Google?!
there are like millions of them

:effort:

AlexC_, NOt just a poll script, oen that is Auth. driven.

if ($price['type'] == 'load') { $order-price_per_load = $price['type']; } else { $order-price_per_unit = $price['type']; }

i want to convert an entire object to an array of the same structure

big polls, little polls, fat polls, slim polls, funny polls, sad polls etc etc

DavidHKMrPowers, I'll try that, thank you.

all on there

AlexC_, Again, auth driven.

sometimes, the simple way is better

http://drupal.org/project/advpoll is the one dreamhost comes preinstalled with

of course, I goofed and it should be $order-price_per_load = $price['price'];

You have a two dimensional array, ex.: $person[0]["name"] is where the name is

tkx

s/face/fact/

ooow, AlexC_, sort of already said that

=D
why does no where sell chocolate teapots? =(

rycar, Cool, thanks. Good, I needed something where the admins can view who chose what.
rycar, This will be used for sustaining votes, and we need to interview votes to the negative.

I actually just prepended 'price_per' to the type, and then did: $order-$price['type'] = $price['price'];

why would you have $price['price'] ??

this channel is for help making your _own_ code - we don't hand out scripts or tell you want to use

Hopefully I'll get to refactor that whole class in a few weeks

sorry, Adrian_dlcspm

go through the django tutorial, it sets up a poll app.

this is the php channel? that explains why everyone was talking about code

the function that I got $price from returns an array with type and price

are you lost?

AlexC_, Perhaps the channel should be about PHP programming (which should include not reinventing the wheel)

is there a way to change the perspective if an image using phpgd?

yeah but why would you call it $price :P

perhaps you should go Google

err, no.

perhaps you should pay us for doing your work for you

or pay us even if we do no work?

AlexC_, Maybe you should reread my opening question.
rycar, Work? This isn't paid.
rycar, I'll pay you what I get paid by the church.

yes, you want a poll - a script, one ready handed to you

because an hour ago when I started…I thought "get_price" would return a price…however, I thought wrong…

theocracy + voting = lol

welcome to programming-by-guessing!

rycar, Sustaining actually, not voting.

it's ugly too… 2500+ line class. Could probably be done in 1/2 that and be twice as clean

obviously, they were getting paid per-line.

you can do an imagerotate, would anyone use it or find it useful if it was to accept a 4th parameter, imagerotate(img,degrees,0[,axis])?

fyrestrtr, Heh, indeed. Our church's ministry is not paid (not for anything we do).

lol…or bragging about it. I remember years ago when I started I was SO proud because I had a 20,000 line application (that I could probably do in 200 lines now)

axis? wtf

perspective is not an easy thing to do

I don't think imagerotate should be doing any 3D

there is no 3d involved ….

explain what axis is

x, y, or z

he means so if he rotates it 90* he will just see a 1px line
as if the you have turned to the side of the image

right

how is that not 3d

agreed rycar

I guess we have different definitions of what 3D is ^^

3d should be a separate function (3d is when you have 3 axis instead of two)
actually that definition sucks

I think I know what 3D is

3D = 3 linearly independent orthonormal basis vectors 8-)
although i guess the normal part isnt required

ultimate_frisbe1, not possible
since the 3d model got lost when converting reality to a photo

what he wants _is_ possible

3d should be a separate function
so then do you think that there should almost be a whole nother series of function for 3d? image3Drotate, img3Dpolygon, img3Drectangle, etc….?

Theres no such thing as impossible

I wrote a 3d engine once

mmmm image3Drotate
for php? gg

yeah

just use a proper 3D application ….

easily done though if you know C
you just write a DLL

noting too advnaced

that uses direct3d
yeah

imagerotate should rotate images. for perspective you need a new function, such as imagedistort or imageperspective

sorry…not everyone loves M$FT at0miku

i dont either
Who said I liked microsoft?

ultimate_frisbe1, use opengl then

using direct3d

direct3d is what you'd most probably use

LOL @ http://worsethanfailure.com/Articles/Which-Cable.aspx

or opengl

ah…fair enough

which ties it to Windows

apart from that, microsoft sucks
I suppose
opengl runs on linux as well I assume?

of course

obviously the majority of php servers runs on windows

yea

alright
I disagree

which is malarchy

ati and some other companies even makes linux drivers

yeah

haha, ATI and linux drivers

guys we can run directX on wine

ATI stopped making linux drivers I believe

not at all, at0miku

which caused outrage

nvidia 4 life

something like that

infact there are rumours of them opening up their driver,

anyways, linux (especially ubuntu) is stepping up in the world
getting more popular

focus here guys….we go from phpgd to wine

with dell offering it on laptops/pcs
the gfxcard companies will soon all be writing drivers for linux
I dunno

erm, they are?

I prefer Fedora….but i do agree that linux distros are becoming more popular cus of M$FT's latest OS
uI prefer Fedora….but i do agree that linux distros are becoming more popular cus of M$FT's latest OS/u

hey, how do i check if a record in my database already exists?

centosfedora

I'll think about it

I've used a number of distros

nVidia and AIT both have official drivers for linux

select it, then do a record count

][marko][: select it's primary id.

On ubuntu everything worked first time

*

][marko][: see if rows returned 0

fedora was okay

cheers

I really like knoppix, I have it on my bootable usb key

how do u count rows? count() ..?

mysql_num_rows() ?

mysql_num_rows($result);

why do you need to know if it exists already?

Thanks

][marko][: select id from foo where id = 12; if mysql_num_rows($result) == 0 then it doesn't exist.

anyone know how to convert an object to array?

][marko][: no need to count anything.

you might want to look into ON DUPLICATE sql command

just do an INSERT INTO x SET y = 'whatev' ON DUPLICATE KEY UPDATE y = 'whatev'
Wouldn't it be useful though if right out of PHP, you could create 3D histograms or graphs?

you just want the object properties in an array?

yes

yes it would be useful, but that functionality doesn't belong in the imagerotate function

i have structure stdClass that i want to just be an array with the same data

get_object_vars() jonwage

implement the iterable interface.

hmm, what if it has embedded objects

oi
i pass an vars to a class
the var exist before, but when in the consctructor, it disapear

see http://www.php.net/manual/en/language.oop5.iterations.php

wtf could it be ?

no need for the 'oi' …. and pastebin code

how exactly are you passing it to the 'class'?

this is a stdClass structure, not a class I have written
this is from simple_xml

nevermind, stupid mistake

make 'svn up' yours

huh?

it would be a good commercial

how do you do parameters for a mysql query?

i need that little .gif for ajax loading
anyone have an idea ?
http://www.ajaxload.info/

could you help me with this
line 62 is wrong
http://pastebin.com/d40881d17

][marko][: your qutes are messed up, by the looks of it

ajaxload.info is my favorite spot toste

'$number_log';";";

oh ye

][marko][: syntax hilighting tells you that…
][marko][: once you get used to reading colourful code, it makes stuff easier

hey, does anybody know how I can use @subpackage, to have a subpackage of a @subpackage? Basically I want ot be able to set a hierarchy more than 2 levels deep.

you mean in phpdoc?

yes

i'm not sure that you should need to nest packages

I have looked at php.net and tried to find how to do this, but I am out of luck. I understand that doing an include pulls the file into the current spot, however I would like to include a file into a variable. like $file .= include("somefile.txt"); This doesn't seem to be the way to do it
though. Any ideas on what word to search for on php.net that would lead me in the right direction?

I want the documentation to nest, kinda like namespaces.

why?
surely you should just have a pacakge with classes in it

because, I would like the documentation to mirror the folder hierarchy
I want a user navigating my documentation to be able to get to the appropriate classes in a logical manner.
kinda like the MSDN documenation, or any other complex documentation, there are multiple levels deep
as not everything makes sense in the first 2 levels

why would i choose php over perl?

don't, back to perl, kpls

what are advantages

Anybody? Any way that I can include a file into a variable?

$variable = file_get_contents("file");

well?

Sweet! Thanks!

np

the advantages of php are that it has an overly simple syntax, long function names, poor memory management, and is designed only to generate html

I'm sure Zend would disagree with you

would they?

and advantages of perl

So, nobody knows how to nest packages?

hundreds of libraries, and the language's syntax can achieve lots more
perl is much dencer than php code, more happens in a smaller space, so less code is needed to do stuff
and more stuff is done for free, or invisibly

rather, nobody knows how to nest docblock @packages, and @subpackages?

obviously complicated behaviours like that take some learning tohough
it looks like noobody does, do the docs say anything on the subject?

is it possible to stream a file from a remote server through a php script and directly to the end user without php having to buffer the file first?

Unfortunately, no. The phpdocumentor docs were written rather poorly.

"eating your own dog food" is the expression you want

it just gives a simple example of @project, and @subproject
I can modify phpdocumentor, and use my own tags, but was hoping they had something built in, as it seems like something that's necessary

perhaps you just need to do @package foo.bar.baz or something of the sort

perhaps, but is that legitimate, there's really no way to know

PHPdiddy, yes, with fopen

there is, use it, and run phpdoc and see if it picks it up

Thanks, I'll try that

well i tried that, but there's a considerable delay when doing that. i need it to immediately return

PHPdiddy, consider using mod_proxy via apache
that might speed it a little, but not much

someone experienced with smarty here?

well, the problem is, i need to inject my own headers

the problem isn't php, or using fopen

hi, are there ways in php5 to overwrite $_SERVER values from outside of a script ? i want to prevent this so i can be shure the variables are set

Comments

hi Ive got a little snippet of javascript two functions The first function is adding to an array that array is

accessKey]" nsresult: "0×8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location:
"JS frame

Comments

hi i have a little problem i export a web page html to a word document using php when just open the file all

captcha class you could use :P

i dont have pear installed

you dont need to
just download the class

pastebin.
lorl
is osnews.com yours?

Hmmm no? I'm just listening to a podcast from it.

cool

what can i use to recognize the first value in a hash?
err
key/value pair

He is discussing what is bloat :P It's interesting

$value) i want to get the $key only can i do that?

which one is it that creates the captcha that has the pretty swirly lines in the background

i dunno, theyre all the same

you know, like on the authentic windows manuals and stuff

loop through some letters, draw some pretty lines

hi…is there any other variable to store values in a session besides $_SESSION ?

http://rafb.net/p/uLNN4b97.html
Call to undefined function imagecreatetruecolor() in …captcha2.class.php on line 522

woot that captcha class is ugly :|

so…is there any variable that I can use instead of $_SESSION to store my session generated values?

eh?? you have a better one?

Hmmm.. No.

what's wrong with $_SESSION?

It seems like you don't have GD installed.

what is gd?

the server I hosted my page supports session…but I think it _SESSION doesnt exist

A php extension with functions to manipulate images.

here in my apache I use it normally…but when I hosted my page…bummmm….session vanished away…any idea?

What OS is your server running?

DARKGirl do a phpinfo(); and see if you have the gd library installed in there

unix

That's worth investigating, since $_SESSION should always be defined, unless you've managed to build PHP without the session module.

i've never had trouble with session in the default install
did you try dumping it out?

Linux maybe? Do you know what distribution?

dump?
what is it like?

var_dump($_SESSION)

moment

what does it do?

Unix PHP 5, Apache 2

var_dump dumps out all of the values in a variable
for a hash it will dump out everything in the hash
its pretty handy for debugging

try adding "pre" when doing var_dump

it's also helpful to do an echo "pre" ahead of the print_r/var_dump, just to format it logically.
….

any wiki parser libraries out there that someone recommends?

echo "pre".print_r($array, true)."/pre";

ok what is it called again?
GD?

good stuff, been wondering how to do what with var_dump though

looks for gd2 (in your php.ini maybe)
I don't have any experience with Unix so I can't help further.
*look

can always ob_start(); ob_getcontents(); ob_end_clean();

save as info.php and run that into your web server…

ForceFollow rather

and look at that file and check if you have GD installed

anyone else get php host to get itself in a tight loop and exhaust the memory in apache (and thus crashing it :/) when using SoapServer?

agentbob hmm ill check that out, it would be really nice to have for ajax stuff

I dumped session and it returned array(0) { }

i dont see gd2 anywhere

just after session_start()

gd2 or gd
one of them

neither

do you have any session variables set?

well that mean that you dont have GD installed

So $_SESSION is indeed defined.

$_SESSION['username'] = "me";

i recommend if you have access to shh with root install it or contact your hosting provided and ask for it

wiki code rendering classes/libraries anyone?

what kind of webhost doesn't offer gd? Surely it's on there…

this is MY server
lol

I use session to store some data…but then when I load the same page again the data is gone…

I am hosting my own website

What kind of host runs Unix.. It's propably a home server.

exactly :-)

you can use http://captchas.net/ if you want

i rather install this GD

You probably aren't calling session_start() on all the pages you use sessions.

what is the full name so I can search for it in google

linux?

Graphics Device?

what the heck is stdClss?!?!

linux?

http://us3.php.net/session

DARKGirl = man.

Graphics Developer?

A featureless class built into PHP, used for various purposes.

please dont insult me EoN
this is not efnet

lol

linux? and what distribution?

THIS IS NOT LINUX

she said unix.

any way to turn one of those into a regular old array?

ah secure unix web hosting

Sure, just cast it.

no girl has unix.
anywhere on the planet.

what the heck does that mean?

I'm afraid you're mistaken.
$var_as_array = (array)$var

the problem is…hosting my page locally session works perfctly…but using another host it doesn't….so..I'd like to know what is going on? it's the same code….

I have OS C
X
lol

Well, Apple sells one variety.

oh..

OS X = Unix

darwin or something :P

OS X = bsd

aye darwin

Hey now, I'll take OS X over XP/Vista any day.

unix destroys linux right?
unix destroys linux host right?

Why would it do that?

unix is a pretty general term. irix is a unix, irix is butt.

my problem is…hosting my page locally session works perfctly…but using another host it doesn't….so..I'd like to know what is going on? it's the same code….

i just got a MacBook and so far I prefer OS X to Ubuntu

eww ubuntu

unix is more likely to be used for high level absolute mission critical enterprise power-systems, than little toy linux afaik
linux more for 'my little pony' applications etc

Your information seems to be somewhat out of date.

root@kinkybox:~#aptitude purge EoN

uh, not so much

pass that doobie over this way.

thank you, that worked

Ten years ago, that might've been true.
Maybe.

cookies maybe, could be solar flares though
we've had a lot of those recently
can you write to the /tmp dir?
what are your php.ini session settings

what do you dislike about ubuntu?

here in my pc?

the Power of Freedom

sure, but preferably where it's not working… as thats what you want to fix
sure, but preferably where it's not working… as thats what you want to fix

*smells

so what is the full name of GD

how can I write in /tmp there using a file manager?

sessions are stored in /tmp by default

gd

maybe use a db session class

mmm, db sessions.

does phpinfo() tells me that?

gif draw

jennnny don't change your number eight six seven five three ohhh nyyyyighne

which distro do you prefer?

should

kahotep the real one
Debian over everything
no some copy build on top of Debian

GD should be bundled with PHP 4.3 and later.

what part…session?

good place to start

heheheheh
I'll take a look here…come back soon

not to flame every body have a diferent taste
especially me i dont like sudo here sudo there o you need administrator right to do this bah just use root and get over it…

Emacs sucks!
the sudo thing is good, imo.

bah i hate sudo

I've been using sudo for years.

imagick

make my command more longer

hardly…

well how do i get it to work with php

use imagick

so i'm guessing the "real" one is gentoo?
yea, sudo is annoying.. i've never had problems working as root all the time

'all the time"?

everyone have they own taste and yes gentoo is really good

nevermind

but lack on installation like others disctribution

real one is slackware

took me about 2 hour to install gentoon on a imac 1999

"Hey Joe how it that gentoo box doing?" "Still compiling.." :P
*is

I used to love gentoo.
They're quality control went to hell about 2 years ago, though.

wow has gentoo been around that long?

Their…

i haven't used it since it was new…

i wonder what sup with caldera

heh @ foutrelis

i used it for a couple of years

quick way to print values in an array as a comma separated list, or am i stuck with a foreach loop?

about session…any problem if register_globals is off in phpinfo?

twas extremely fast

implode(",",$array);

http://xkcd.com/303/

dont tell me I have to recompile php

that's so damn funny :P

was in context :P

Thanks!

sure.

about session…any problem if register_globals is off in phpinfo?

nope

no, register_globals SHOULD be off.

always

that is a huge security risk

I have a really dumb question. Ive been using a commercial php script and have been including some custom php files. Anyway, i just upgraded it and now my files arent working anymore because it cant find the files. I was including a file as so: include = '../path/to/file.php'; I switched to
include = './path/to/file.php';

Any idea what could have changed?

Session Support enabled Registered save handlers files user sqlite Registered serializer handlers php php_binary wddx

anyone??

probally the update erase your file or override it …

Two dots (..) refer to the parent directory while a single dot (.) refers to the current directory.

do I have to recompile PHP?

fkn skype has been down all day

yes.

i understand that, but all the paths are exactly the same as they were. Even the new files

There is an extra dot in the first path.

actually no, I lied. what was the question

Call to undefined function imagecreatetruecolor() in …captcha2.class.php on line 522

i understand that. Im just confused on what changed for the original path to not work anymore

what version of php? and does phpinfo() say anything about GD?

I don't know anything about your script so I can't really answer your question.

i dont see anything about gd in ther
and its version 5

http://www.php.net/manual/en/ref.image.php should be installed by default.. no –without-gd line at the top?

understand, cant think of a way to explain it. Something must be set differently in one of the encrypted files as all files/folders are in the exact same arrangement as the old version

i dont see –without-gd

Try using absolute paths in your include statements if relative ones don't work.

Session Support enabled Registered save handlers files user sqlite Registered serializer handlers php php_binary wddx

you mean at the configure command?

yes
was a guess, might be something else

'./configure' '–prefix=/Library/PHP5' '–mandir=/usr/share/man' '–infodir=/usr/share/info' '–sysconfdir=/etc' '–with-zlib' '–with-xml' '–with-zlib-dir=/usr' '–with-openssl' '–enable-exif' '–enable-ftp' '–enable-mbstring' '–enable-mbregex' '–enable-sockets' '–with-mysql=…mysql'
'–with-mysqli=…mysql_config' '–with-apxs2=/Library/Apache2/bin/apxs' '–without-pear' '–disable-cli'

look like gd is not enable on php.ini

is 3.1 == 3 ?

how do i enable it?

read installation http://www.php.net/manual/en/ref.image.php

it should tell you inside php.ini

ok
thank you

Ok, lets say i have a php file in /www/templates/bob/file.php

phew, it isnt, that'll save some time

np

And i file in /www/templates/tom/file.php

oh no don't do that. you NEVER want to have php files in /www/templates/bob/file.php

Lol, eh, i give up. Cant think of a good way to explain the circumstances

that is for windows only

hi example i have $array = ("1","2","3","4","5"); foreach($array as $values) if ($values) { iwant to end the foreach } –please help me

include('/www/templates/' . $username . '/file.php'); ?

has both

hmm
ill scan again

first para… you need to recompile –with-gd
did you compile manually? or install pkg

hi example i have $array = ("1","2","3","4","5"); foreach($array as $values) if ($values == 3) { iwant to end the foreach } –please help me

manually
it sucks I have to recompile

no repeat.

sod that. im not recompiling

read carefully if it is a repeat.

heh
sod it. i don't want to be a php programmer… i want to be… A LUMBERJACK!

$found = false; $i = 0; while( *$icount($array)) && $found==false ) { if($values == 3) { $found = true;} }

$found = false; $i = 0; while( *$icount($array)) && $found==false ) { if($array[$i] == 3) { $found = true;} $i++; }

and remove that * lol.

*$icount($array) ?

you know what i mean

heh

s/*/(

foreach($ar as $k=$v) if ($v == 3) return $k; ?

Does this make sense explaining my issue? http://pastebin.ca/660643

what is wrong with foreach?

check the manuals

../templates/tom/file.php relative to templates/bob/file.php is templates/templates/tom/file.php

Try include "../../templates/tom/file.php";

.. refers to parent directory . refers to current directory. it will change dpeending on where you're calling it from.

wtf
this fucking sadist

*shoots

Crap, i did that wrong

30 tracker items on my latest project

I mean my example

in one day
my client was busy

best way to do it is to define a root directory variable, and ALWAYS use that.

http://pastebin.ca/660645

Correct it and post another link

Thats the way i had it

define a root directory variable (which points to the root dir of your website), and ALWAYS use that.

But there isnt a point of a root variable if its always relative
Just trying to figure out why my relative stopped working

the relative crap isn't working out too well for you atm is it

I know, but it doesnt make sense why

define('ROOT_DIR', '/var/www'); include(ROOT_DIR . '/templates/bob/file.php); etc

EoN i understand, but i shouldnt have to do it that way and can anyone see why my way isnt working?

it depends where you're including the file(s) from.

(UGH)
cant I just make a collection of images on my computer and display them randomally and have the user type in the text that is in the image?

Maybe if that php file is included in another one then the relative path would be different from calling file.php directly.

Does anyone know of an PHP API for Aim … ?

would that be ok to do?

does "session.cache_limiter nocache nocache" impeds me from storing values in $_SESSION ?

that is something that I could prolly do easily in photoshop

1000 kittens pics :P

sure, or use text captcha
http://pear.php.net/package/Text_CAPTCHA

or use http://captchas.net
lorl

no, because their code i dont understand
im looking for a simple solution

http://www.ejeliot.com/pages/2
i've used that before

Does anyone know of an PHP API for Aim … ?

or you can just put 'fake' field in your form, use CSS to hide it. And if the field is FILLED IN, you can assume that it was a BOT attempting to submit the form.
because bots dont read css. browsers do.
better still put a few fields in

ahh that one might work because they go step by step on how to install it

that way's nice because you dont havee the extra annoyance of having to fill out a captcha.

www.ejeliot.com
compare that install instruction with
www.captchas.net

recaptcha.

hmm, do you think I should use captcha on my login screen too?

_______ then on submit if($_POST['color'] == 'blue' || $_POST['color'] == 'red' || any other colour) { // NOT A BOT }
b_______ then on submit if($_POST['color'] == 'blue' || $_POST['color'] == 'red' || any other colour) { // NOT A BOT }/b

no

to prevent brute force attacks?

that would be annoying.

people hate captchas.
also, bots dont know passwords.

ok

requiring one for registration is one thing, don't make me enter it every time I visit the site.

I didnt really want to either
lol

exactly

otherwise, I'm not coming back.

the hidden field way i described is PRETTY GOOD….
but if you've got a REALLY popular site, not rock solid.

And very simple I might add. Does it actually work?

The library requires PHP 4 compiled with GD 1 or 2 (Image Generation) and FreeType text support.
I cant use it

it works perfectly. unless someone develops a script to specifically get around it, it should be flawless..

because I dont have GD installed

but then if someone specifically tries, your'e screwed anyway

there HAS to be a way to hack GD in without having to recompile the damn thing

lol

did you read the hidden field method i described?
do you pay attention to anything anyone says except for yourself?
aahahahaha

i know what i'll do. i will make a custom captcha using div tags and layers

digg.com has captchas even for comments

yeah, good luck with that. lol.

That sounds bloated :P

Does anyone know of an PHP API for Aim … ?

how is it bloated?

#url {display:none;}

bot thinks that's a REAL field, fills it in… users dont see the field, dont fill it in.

its nothing but two layers using custom png images and a simple php randomisation script

divs tags layers
wtf is layers O_O

lmao

layer= z-order

yeah good one, let us know how you go with that.

hey guys just looking for a command to parse a php file into a variable without having to go to cli/use of exec/passthru ?

you dont know about z-order?
O_o
i used to use it all the time

ie. the php script echos and i want to capture all the output of the script into a variable

do you mean z-index ?
lmao.

flaccid, do you mean like get_file_contents?

same difference

except that z-order isn't a css property.

nah like i want to parse an external php script into a local variable
ib

can i call a php function and specify the second paramenter without speciifying the first parameter? i.e. function x($a = 0, $b = 1) {} x(,5) ?

ob_start

this is true

No.

i mean unless someone would help me recompile php so i can get done already
i have worked ALL DAY on this one page

will they add that feature? the current way it works, if you have two optional parameters, and you want to specify the second one, you also have to sepcify the first one. it isn't very practical :/

everything is done except one thing
the captcha

hidden field.

tell your function to do (or not do) something when you pass in a certain something

#url {display:none;} PHP: if($_POST['url']) { /* THIS IS A BOT, HANDLE APPROPRIATELY WITH ABUSE */ }

oh, like function x($a=0, $b=0) {if ($a==0) [specify a default]}… i suppose that works

how do I uninstall php
so I can re-compile?

just recompile, replace files after

replace files after?
http://www.phpmac.com/articles.php?view=184
i DONT want to miss anything so I wont have to do this again
?
(sigh)

how to check if a constant is set?

defined()

thank you

you use panther?

10.4.8

maybe it'd be okay, but this was written with panther

ah ha! I found the initial page that I used to install it

compiling php creates binaries, you then edit httpd.conf to use these compiled binaries (.so files)

http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x/
a href="http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x/"http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x//a
a href="a href="http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x/"http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x//a"http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x/"http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x//a/a
see
that list doesnt have –with-gd

Hi, Ive been working on a problem for 4 hours and was hoping that someone might be able to help me, I have a database set up by a program and it has a bunch of stored procedures in it. I am trying to use one of said stored procedures in a php function, basically its taking information out of a
seperate database and adding to to the one with the stored procedure. The problem is that I can't get it to actually save anything in the data

what is the proper way to add gd?

I get the "returncode" as if it went through successfully but it isn't in the database
here is my code ..
http://pastebin.ca/660673

try the manual page, php.net/image

what is -isysroot /Developer/SDKs/MacOSX10.4u.sdk" ?

what is the sound of one hand clapping?

(sigh)

hi
anyone here any good at regex? im trying to just leave a-z,numbers, and a dash (-) in a string. what is the regex for that? i know just a-z/numbers is ([a-bA-Z])
but adding in a dash doesn't work
(sorry for nooby q)

hi
Test any one there

[a-zA-Z-]
have to add the dash at the end

hallo mr.ishara

yes

YES!!

a-z, not a-b

[A-z-] :P
lol it's so annoying

thanks for help ealrier with regex

foutrelis, is it possible to check the status of the cdrom (open or not)? i'm trying to play a prank on my colleague's box :-)

I'm not sure.. Let's find out :P

alags, that would be a client side script (javascript, vbscript or the like), and i think that only worked some years ago. pretty sure the functionality was turned off after widespread "use"

trix, client side script? awesome isn't it possible to check through shell?

oh, via a distributable? maybe.. but i doubt it.
if i were going to go that route i'd just find a compiled exe for a php script to call
i'd really have to have a reason to use php though

i dont think alags meant through a webpage. where it cant be done
rather just a shell
or maybe not

trix, can you eject cdrom in php too?

it would eject the SERVER's cdrom if anything.
lol

EoN, i didn't mean through webpage.

i don't think so. you can have php call an executable that does, though

Stupid drive.. it fully opens first and then closes.. pffft

EoN, oh, yes system() would do that!

exactly
lol

:P
eject /dev/hdc; eject /dev/hdd :P oh, this is cool

how to give password protection for pdf file through php code

what would be the best function to use to just check to see if a user inputted url actually exists but does nothing with it.
would just fopen and r be good enough ? or could it be insecure

fopen would be fine
you might also use snoopy and just get the headers

snoopy ?

http://sourceforge.net/projects/snoopy/
it's a wrapper for curl

oh i dont want anything 3rd party

create password protected pdf file trough php - is it possible if any one has idea please help me out

just something like if ( url_exists() ) continue;

who wrote snoopy?
nice name.
it better be good to use such a good name

function url_exists($url) { if ereg("^http://", $url) return fopen($url, 'r'); else return false; }
snoopy rocks if you're doing a lot of http get/posts
i recommend it over streams in php but that's after having used it for several years
(schnoo, if you used something like the above piece of code remember to fclose() the pointer)

error: GD build test failed. Please check the config.log for details.
i cant find config.log

find / -name config.log

that did nothing byt freeze terminal

It might take a lil bit

anyone want to help me figure out why php is crashing? this is the backtrace http://pastebin.ca/660648 and its caused by SoapServer, but i can't figure out exactly what in my code is doing it

/usr/bin/ld: -L: directory name missing?

nevermind any errors

no im looking in the config.log right now

how to give password protection for pdf file . I am using fpdf class to generate the pdf file

conflicting types for built-in function 'fabsf'
conflicting types for built-in function 'floorf'

use a hidden field.
lol
\o/

or install Debian on VMware :P

doesn't pdf have its own form of password protection
isn't that the point of pdf

ill just try to compile again

Check this out: http://www.mamp.info/en/mamp.html

no. apache works without issue

Your php is on diet though

DARKGirl, your trying to use PHP on OS X? entropy.ch is the way to do it

hmmm I hate GD

Liquid-silence: Why is that?

use a proper distro

The pdf is generation on the fly and we are using fpdf class for generation the pdf

will tell you in a moment
I have image.php that has everything set so that its a image and I have code that does $im = imagecreatefromjpg("read.jpg"); but when I do img src=image.php in another form the image does not show up

mamp should have gd2 installed and stuff I haven't tried it but seems nice

program A is GPL, plugin B is sold. Does he need to open the code to public if he develops on B?

is this ##gpl?

Liquid-silence: A path issue maybe?

its relative

ok..

read.jpg is in the same folder as the script right? :P

yeah
:P

and the html calling it? :P

techincally I never use GPL code in applications that is sold
its just wrong

initgroups failed: Operation not permitted
whoops
ignore that

heh
yeah it is

#linux-india

Liquid-silence: Can you pastebin the script so I may try it out? :P

can I pm?

sure

I used imagecopy() to write a small image into big image but the size of small image appears small on big image
imagecopy($img, $im,$x,$y,0,0,$width,$height);

My friend said to install the package on this site. www.entropy.ch

Is there is any reduction of size of image into other big images if we use imagecopy

what a weird redirect

Hmm, is it possible to return how many variables that are in an array?

what package?

DARKGirl, pick whatever you want, the guy running entropy.ch build apache for OSX, it has everything enabled, and can work with the installed Apache or can replace apache
s/build/builds/

My friend says http://www.entropy.ch/software/macosx/php/

csc`: count()

that returns a variable?

http://rafb.net/p/CZqQe511.html
anyone can help me out on this?

csc`: yeah. count($my_array); returns the number of elements in the array. 0 or more

alright, thanks

there were errors installing the software

Liquid-silence um…

hi this code is not working in firefox
span style="FILTER: Glow(Color=#ff0000, Strength=8); width:200px;font-size:20pt;"Glow Filter/span
plz help

howdy doody

anyone in here have a sony vaio laptop, and still have your restore cds?

you are SURE I wont be able to hack in gd support on my current php install?

ScottMac__:

$format =& $xls-addFormat(); ?

it assigns by reference

thanks

(Sigh)
can someone help me configure capchas.net code to work with mine?

DARKGirl, nope, this channel doesn't support 3rd party scripts

ill ask fourfivetwofour when he arrives

http://grulez.com/~foutrelis/img.php :P
dynamic puppy

hi all

hey indro

I want this string as array, but it has different whitespaces. any idea how to do that? is there a function for this?
circletestcoordinate550 120 20
hiya foutrelis
circle test coordinate 550 120 20

So you want to turn circletestcoordinate550 120 20 into circle test coordinate 550 120 20?
or the second string into an array?

no, I want array('circle,'test','coordinate', 550, 120, 20)
the second string into array.

php.net/explode

yeah, but if I do explode(" ",$array) then it split only if there is one whitespace.

:O
hmm
$str = str_replace(' ', ' ', $str); first?

there are diffent lenths of whitespaces.

The first ' ' is two spaces

but I just found an idea in the last comment in php.net/explode.
To split a string containing multiple seperators between elements rather use preg_split than explode:

$str = str_replace(' ', ' ', $str); first? put it in a while loop with strpos(double space)

preg_split ("/\s+/", "Here are to many spaces in between");
that seems what I want.

yay

or that :P

thx anyway.
can you give the source of your dynamic image?
I need to draw a circle on a image.
or a good doc?

http://gr2.php.net/gd

I have y and x and want draw a circle there on a image.

This might do it :P http://gr2.php.net/manual/en/function.imageellipse.php

thanks!

http://grulez.com/~foutrelis/img.php :P
circle on puppy :P

lol. ^^

Hmm, anyone know of a game that uses bittorrent to download their installer and run?

and the code is at http://grulez.com/~foutrelis/img.phps if you'd like to take a look

thank you, will help me.

or what that software is called.

np
What would be the equivalent of wget in php?

this is ##php and that sounds illegal

it is?
hmm
wonder if i can sue Blizzard and Flagship studios for this software

http://www.zend.com/tips/tips.php?id=91&single=1

We have “ in PHP? O_O
thanks mace

Mace[work]: I'll take your legal advice and go sue blizzard for their bittorrent usage

You can load files from a HTTP URL using fopen()
Look at fopen wrappers in the docs for more information

meow ok

foutrelis, how did you syntax-colourize your code @ http://grulez.com/~foutrelis/img.phps ?

from a general perspective. Should I allow people to use passwords less than 6 characters?
what's the normal range?

The server must did it automatically.

foutrelis, great. :-)

Just add AddType application/x-httpd-php-source .phps to your apache configuration :P

foutrelis, oh, good. thanks for the tip

np

hey friends

What's the easiest way to remove all punctuation from a string?

hello rick111

is there a way a can see all the communications between my broswer and server, for example all the 'mod rewrite' requests etc, without sniffing packets?

except space and ','

maybe some online tool?

6 characters _minimum_

that's what I have now

letters, numbers, AND puncuation

I just allow everything

require those things

no

I don't know what I can do
without actually typing all of the characters
looks like i'll have to do that
ok thanks guys

oh, is there a regex replace in JS you could use maticode?

preg_replace with "/['.,!?]/"

exactly

what about unicode characters Mace?

you said punctuation

you could use "/^[a-zA-Z0-9]/" and _only_ allow those characters

"/[^A-Za-z]/"
whoops
I suck at regex

I want to allow space

nop, typo'ed
"/[^\sa-zA-Z0-9]/"

was I right then?

ok thanks mace i'll try that

Mace[work]: oh, i figured why you thought I was talking illegal stuff
Mace[work]: the installer of an application IS a bittorrent client that downloads the installer fromt he net to run at a later time

i see

Mace[work]: sort of how a small sized instalelr downloads a 200mb installation files to run at a later time

on the topic of regex… "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?" that won't work… it allows foo

managing the download and all
sorry for seeming somewhat "riskey"

s'ok

I'll figure this out, I took it from the regular-expressions.info site for e-mails

Don't use such a complicated regex for validation emails
There really is absolutely no point

fopen with fread and fwrite works very nice Thanks :P

what if i want to replace all commas with spaces?

Instead of fread / fwrite, you could just use copy() to download a file to a temporary location for example.

MarkR42, what one do you reccomend?
I'm just checking for simple mistakes

any girl ?

how could I strip a line break in a string of HTML output?

Personally, I use /^[a-z0-9_\.\-\&]+@[a-z0-9][a-z0-9\.\-]+\.[a
-z]{2,5}$/i
Oops that got broken up
We use /^[a-z0-9_\.\-\&]+@[a-z0-9][a-z0-9\.\-]+\.[a-z]{2,5}$/i
Which is hopefully simple enough that you can understand it

This is what I 'm doing http://grulez.com/~foutrelis/wget.phps (kind of stole it from a comment at php.net/fopen)

we've found that it will match most valid emails, and will not match things which are obviously not valid emails

I only understand and write simple regex. It's been a while since I've actually wrote a complex regex statement

nm

And that regex seems to give a good balance of complexity / accuracy

thanks guys, later
oh one last thing, how do you turn multiple spaces into a single space

MarkR42, looks good. From what I can tell it allows IP addresses

copy() should work.
Allows IP addresses? like x@127.0.0.1 ? certainly not.

Just copy('http://some_url', $file) ?

\s+

Yep.

I read it wrong I guess…

thanks

may not be the most direct solution, but nl2br the string and remove br tag, otherwise you'll be forever removing variations of \r\n (i know of no better way)
i don't think there is an identifier such as EOL in preg_replace

PHP5.2.4 ?
apache2.2.5
anybody alive ?

no

is there something similar than wget -N in php?
exec("wget -N url") seems not working. :/

You can open URLs using fopen
read the docs about http wrappers

-N checks if the remote file is newer than local file.

perhaps means you don't have access?

where can I check that?

exec is probably disabled for security reasons

exec("pwd") works..

su [user_name_of_what_php_runs_as] | wget -N url

ok then it's not disabled :P

in ssh

hi

hey maxagaz

Mace[work]: it saves the file but after that I get su: Authentication failure

login as root

hi
hello all

Mace[work], thanks for the help btw

Maybe the user indro uses to login in with ssh is different from the one apache uses

forgot to say it before darting off to bluefish :P

oh rly? i re-read and thought it wouldn't work, aren't you removing the br /'s from the HTML?

actually I just used the str_replace("\n", '', str_replace("\r", '', $content))
im not looking for the brs, just the line breaks in the code itself
im chasing some x-browser display issues
ty tho

oh ok, cool - np!

Mace[work]: I get the messsage not anymore as root.
but it doesnt save in current dir?

you're doing su to change users

yes

you are trying to see if php has access to perform the action
when you've su'ed and it works come back
##linux

it works, but I see the file not in current dir.
so the question is where it saves the file.

do "updatedb" then "slocate [the file]"

is there a function to get all files in a dir as a array?

there is in php5, search the manual

hi
will there be a su feature in php 6?

k, thanks.

Who knows. I'm not sure what a "su" feature would be or be used for

what kind of idiot base64 encodes database records?

Someone who doesn't know that BLOBs exist ?

php6 ?

even seen PHP Object Generator? egads.

have you used php6 ? super

OMGOMGOMGOMG
i fixed it!
finally

cool.

i went on the captchas.net site and forced myself to understand the code
LOL
and…it actually worked

how did you forced yourself?

well, I removed all the nonsense comments and adapted it to my code
and it wasnt that hard actually
my user registration page is COMPLETE!

girl ?

MarkR42 like the suphp thing

Dark

Well, you can use PHP6 yourself if you take it out of CVS and build from source

no , php6 is not a suprising version
i like php5 + eacc
php5 + eAccelerator
DARKGirl

yes?

are you using php ?
surprised, even have no girl hear of php

you can't have been paying attention really

hello
is there any other possibility to recognize a website visitor beside his IP address ? i would like to recognize a user if he enters the website multiple times even if he's using a dinamic IP address, is that possible ?

cookie

hmm, i'm not very familiar with how cookies work, is there anything to read about this ?
i mean, some tutorial or something ?

http protol

http://www.php.net/manual/en/features.cookies.php
http://en.wikipedia.org/wiki/HTTP_cookie

thank you enobrev

hi, i have a little problem, i export a web page (html) to a word document using php , when just open the file all the images are in the word document but when i save it or just save the file instead of opening it all the images are gone, i think this has something to do with adding certains
headers to the html file???

tag.

blabla.php?var1=value1&var2=value2 correct??
amperstand being the divider

say i have a string

yes

stroop is there a way to give them with the file so they are in the document

"i have a string"

",1,2,3,4,5" and i want to remove only the first comma….how would i do that? :P …lol
didn't mean to hit enter…_

[domon]: ltrim

it's right next to "

the string has " in it?

rza, for some weird reason, my 2nd variable is not being passed along

nah it doesn't have quotes in it

how are you accessing it?
[domon]: ltrim( $string, "," );

thx

do I need php5 for imagecreatefrompng?

I don't think so- you just need a version which supports that, that's all

rza, well, i have a condition include… the thing is that it's being reset to the default-if-not-set variable all the time
rza, and an echo shows it clean

var_dump( $_GET );
check the manual

png» http://www.libpng.org/pub/png/libpng.html Only supported in GD versions greater than gd-1.6.
So I need just a new gd version?
or also a newer php version than 4.4.4?

why dont you install php5 ?

because I have a application running under 4.4 that should be working.

it doesnt work under 5 ?

dont known, how high is the risk that it doesnt work?

php5 will meet a lot of probs

fifty sixty

such as oop

depends how well it was coded

I dont used oop…
so it might work?

there is a good chance it will work out of the box
just setup a test env
because php4 is dead and it will be even more dead soon

not easily.

hm, I could do a snapshot..
server is a in a vmware infrastructure..
okay, I think I will update then.

php.net
see the top news
php end of life has been announced

Well, porting all your applications to PHP5 should be high up on your list, if you plan on maintaining them at all

k, good to known.

Porting an app from 4-5 is not straightforward, you will obviously need PHP4 and PHP5 test environments in order to do the necessary engineering

morning guys
i have a little case… which is not quite unerstood. if anyone can check it: http://pastebin.com/d101904b0

hey guys quick question
if i want to download 10 images that are in an array what is the fastest way to do it, curl, fopen or something else ?

Nir-PHP, you need to use str_replace instead of explode

explain please
explode devide them to array.
str_replace..?

datarecal, foreach cycle and curl or system("wget …");
Nir-PHP, why does you need to divide them?

since it would be lot easier for me

just parse your string and change "" to ""

aibo which one would be less intensive or faster ?

no no..

datarecal, system("wget…

i'm trying to build something
devide is kinda nessecery

ok thanks

is there a way to keep the devide?

Nir-PHP, i don't understand you

can i pm you?

try

it doesn't load my images but it does when I I type img src="Help Images/viewVes1.jpg" alt="View Vessel Screenshot" /? Both images exist.

you can't use .tif files I think

use %20 where there are spaces

2secs

oh yes I didn't see that

and still nothing

*.jpg and *.gif decrease it dramatically

afayk, is ctype available on /most/ php distros?

.png

but don't expect to have a small size

sure lol

there are some lossless jpeg flavours too, but they aren't widespread

thank you .Png works and its about 4kb. fie with me ;-) thanx again

i thought there were losless gif's
+s

Moin!
I'm reading a ldap entry with ldap_read and getting an error on stderr of the fastcgi process if the dn does not exist
Why does it return the error message on stderr and not just return FALSE?
This seems unpractical…
Ah, to be honest i get a php Warning
But i check the return values of ldap_read and it would be totally normal for the dn to don't be there, so i would be a lot more happy if that wouldn't write into my logfiles

C3245728_10.jpg what is the best way to extract the number after _ but before .
so in this case 10

hi, has anyone used APC here?

hi

hi, has anyone used APC here?

I have $stripped="htmlhead/headbodythis is an html fileand i am replacing letters "a" for "b"./body/html"; how can I replace letters "a" for "b" in the text that the user would see in the browser?

can I put a 1 second pause in my php script using a php function?
or even half a second?

obyone, why don't you try to create a template like {{a}} and give a str_replace ?

sleep()

thanks

i think i need preg_replace_callback

preg_replace() would work fine

function A2B($matches) { return $matches[0].$matches[1];}
$stripped = preg_replace_callback("/([^]+)/","A2B", $stripped);
these two lines are the code I am making for it
the second line is perfect, but the first one, in the function i don't understand what i need to put

$stripped = preg_replace( "/\\\"a\\\"/", "\"b\"", $stripped );

Artnez $stripped remained unaltered after that

and withdraw the data within them as a variable. For example namethomas/name.

nope, the regex works, i just tested it
here's the test http://pastebin.com/m17e51b0f
http://us3.php.net/xml

Hi, I have strange problem with my understanding of transaction in php AdoDB extension. I'm trying to do this startTrans; valid query; invalidquery; endTrans. But It does valid query too. :-(

there are various other libs available that either make use of that or dont, just google

uff, i think i've been inaccurate

Hello Artnez, I had a look at XML. I found it on my googling… I tried all the examples but I don't seem to understand how to grab infomation from the XML file?

my intention is tu change all letters a for letters b in $stripped="htmlhead/headbodythis is an html fileand i am replacing all the letters a for b./body/html";

read more

The examples seem to just output the XML and some echos.
One had a PHP version aswell :P

so i have an apple would become i hbve bn bpple

)

I'm afraid I did… Maybe a clue? A keyword?

Hi there everyone

Hi, I have strange problem with my understanding of transaction in php AdoDB extension. I'm trying to do this startTrans; valid query; invalidquery; endTrans. But It does valid query too. :-(

"This example maps tags in an XML document directly to HTML tags. Elements not found in the "map array" are ignored. Of course, this example will only work with a specific XML document type. "
Am I warm?

preg_replace( "/a(?=[^]*)/", "b", $stripped );

You are using MySQL ?

http://pastebin.com/m10da56b0

da

Do you have access to the configuration of MySQL ?

si

There is an option to turn on a query log, this will help you a lot during debugging queries and this sort of situations.

aaaaa
:-(
it's overkill

And could you show us some code of the code section ?

sure

Production machine ?

http://pastebin.com/m27c8e3e3
no, but i will debug mysql for hours to find one problem in my code, you know

Your code looks sane at first, can you step into those methods on the global $db ?

Artnez $stripped="htmlhead/headbodythis is an html fileand i am replacing all the letters a for b./body/html";
but anyway, i think it will work fine anyway

it's just $db-Connect($db_address,$db_username,$db_password,$db_database);

I meant if you can view the things that are done in StartTrans() for example.

Could I ask if you have experience with adodb and transaction or just try? no offense. Code looks sane for me too, but I think i missunderstand adodb transcations

MyISAM tables or InnoDB btw ?

default one

Check if they are MyISAM please

i'm not mysql guy

Otherwise transactions will not work ..
ADODB relies on transactions on the database backend

ok. just give me minute to google how to do it

phpmyadmin installed ?
ok.

hi all - has anyone here designed an online shop from scratch and made it generic but still very detailed to allow the shop owner to sell lots of different products with different specifications with no modifications to code or am I dreaming by attempting this

i got it. show tables status; - MyISAM :-(

:-(
You will need to change the storage engine (this is what they are called) to InnoDB then.
Or maybe even some other storage engine.

MyISAM doesn't support transactions ?

This may be a bit offtopic. I've developed a website where I have by mistake mixed up the character encodings of the files. Some are utf-8 and some are iso-8859-1. Is there a windows application out there that can convert all my files to UTF-8?

Nope, it doesn't

so problem is solved, thanks

Good luck with it!

create table test (id int) type=InnoDB;

how do you out an array like this?
test['1']

out an array ?
You want the value of the index 1 ?

Sorry, how do I use an array. For example within it I have the a value called '1'… I want to echo it.

prints 1

There is a large section about howto use arrays on php.net.

Perfect thanks

http://php.net/manual/en/language.types.array.php

same result with InnoDB :-(

Oh awesome, that is massive. I'll start reading!

Have fun!
It isn't ?

I don't kown

Me neither. ;/

You know what, I have an array 'stuck' inside a variable.. how do I help i'm excape?
This is the output of the variable:
http://www.netstra.net/muz/test3.php

Odd. Could you check on every execution of a query if it fails or is going like normal ?

how do you what?

btw that invalid query return exception with 1062: Duplicate entry '2' for key 1 - probably I can't catch stuff like that with transaction and write a lot more complex code :-(

Basically I've got XML data being converted into an array. But i'm left with a variable that outputs: http://www.netstra.net/muz/test3.php .. I want to know how I can get data from within that array. For example ech 'Test Text'

what happened to reading that link ….
read it, and you'll know how

Thats fine, Its just my array is stuck inside a variable :P
It'd be fine if I created a normal PHP array.

Ok. So we know the problem again.

but anyway, When execption is throwen, It will never reach CompleteTrans and no change should be written

go and read up on arrays, you can't have an array "stuck inside a var" - I don't even truely know what you mean by that

I guess you should check for error and rollback the transaction then.

Did you see the output on that page: http://www.netstra.net/muz/test3.php

yes I did

sounds good ;-)

Or use some sort of try, catch if adodb supports it.

:-[

I can't do echo $myarray[1] it outputs 'Array'…. Although I wanted it to output Test Text…

yes try-catch-rollback

so go and read that link and all will be explained

I thought the problem might be with the array coming from converted XML.

PHP5 application ?

Good evening.

yes, but addodb's documentaions say CompleteTrans() detects when an SQL error occurs, and will Rollback/Commit as appropriate.

So its definatally not an XML problem?

no, it's a person not reading the manual, problem

Sidenote: Read something about globals btw, and think about a DB singleton or Registry class.

Oh, so its an array problem :P Okay thanks

Odd, but like I said I don't know AdoDB that much. Maybe you can step through the code in the CompleteTrans method.
To see where things go wrong.
Too bad you have to digg in this deep then.

no, it's not an array problem, the problem is that you are not reading the manual page you were linked to that will explain everything you need

Nice CMS

thanks!

That manual is for arrays?

I need to get MySQL working with PHP

$value=rand(0,3); will mave $value be 0, or 1 or 2 or 3 ??

http://php.net/manual/en/language.types.array.php

did you even look at it?

I have no idea where to start.

0, 1, 2 or 3

I'm on Kubuntu Feisty Fawn.

Google for documentation

so random from 0 to 3 both included

Thanks!

thanks for your help anyway! what's wrong with that global? Do you mean it would be better to wrap it in class or something else?

apt-cache search php / mysql-server-5.0

Yep, and I suddenly understand everything. As you said :p
Thanks.

yes, since php.net/rand states it's the min and max value

AlexC_ yes but have a look at the first example

Are you doing Object oriented programming ?

what about it?

This is multiparadigm program. But I do OOP in OOP languages.

hold on, it may be between those values not including

but It has been just thought how to avoid that global.

Ok. You know about singletons and registry pattern then ?

the manual contradicts it's self a bit there!

singleton - ofcorse. but not sure about registry.

AlexC_ rand(5, 15);
gives

Hello all

7771ç

please advise good SQL constructor for PHP

nothing returned

something like SQLObject for Python

it says "A pseudo random value between min (or 0) and max (or RAND_MAX, inclusive)." which makes me belive it will return a number _between_ the numbers you give it. Yet, the paramaters say "The lowest value to return (default: 0)" which tells me that the values you give could be returned
php -r "var_dump( rand(5, 15) );"
int(15)

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

looks like it does return the values you give it
s/does/can

Exactly your situation is described
http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software#PHP

AlexC_ before using rand should i use something else like srand in C++ ?

system("/usr/bin/wget -P $outputfolder $inputaddress");

there is no need afaik

brb, lunch

"Note: As of PHP 4.2.0, there is no need to seed the random number generator with srand() or mt_srand() as this is now done automatically."

well i do $value=rand(0,3); and then i have $value in a switch with cases 0,1,2 and 3 and it always picks case 3

then you didn't put breaks; in your switch statement
php.net/switch

i did

pastebin the code

i know it is the easiest to forget
but this time i did

pastebin the code

http://pastebin.com/m1afb1b4f

do above the switch, var_dump( $value );

what's that?

here?

it will show what is in $value

rza, yeah

http://phpfi.com/256754
can you test that on windows
results a black image here

so

(ie whole last night at home)

what about simple ORM for PHP+MySQL
?

transparency seems to be broken
it happens with imagemagick 6.3.3

hi

i dont know if that is fixed in later versions
if you can compile against the latest it would be nice

AlexC_ and an echo ??

huh?

to see the value

just do var_dump( $value ); like I said

hi there
i'm using PHP mail but it's just failing silently
mail()
are there any settings that i need to check in the php config files to fix it?
i'm using IIS on win2k3

do you have a smtp server installed?

yes, i do

AlexC_ i get written NULL

have you configured the smtp settings in php.ini?

rza, I can confirm it

i don't know

re-pastebin the code

but can't do anything until I get home

i didn't setup php
i'll check php.ini

yup, looks like an imagemagick bug to me
or a problem with edinks build

how to open some url in php, bud not with fsockopen()

AlexC_ the code is very simple anyway, it this was C++ y would be suspecting that i need an srand or something…
http://pastebin.com/m5f952ee3

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

and you get null? what php version?

4 i think

go and check,

thanks

rza, i've made sure that php is looking at the right place for the smtp server
but no email came

are you sure the email server is sending it?

Sweet!

rza, yes, i am
infact, i just checked the smtp servers logs
i'm getting "sender must be specified" for some reason
despite the fact that it is

You know how theres some chars that stuff up PHP… for example… " and '… is there a way to automatically remove this from a variable.

"stuff up PHP"Q
i dont understand the term

I think Thomasporter has his own terms for everything

he probably means magic_quotes_gpc

:P
Thats it.
Thanks, forgot what it was called.

i think Thomasporter wants a lesson on escape codes

Lack of sleep I blame it on!
Is magic_quotes_gpc really get_ magic_quotes_gpc
Can't find the manual..

you dont want to use it

look in php.ini and turn off magic_quotes
anyway, food o'clock for me - tada

How else can I add escape codes without manually typing them without magic_quotes?
http://au.php.net/manual/en/function.stripslashes.php

usually you want to escape only the data that is going to a database
and you also want to do some validation / other cleaning for the data also
trying to do this automatically can lead to errors such as XSS

This is just for a client-side PHP script, its only doing it to a XML file that isn't controlled by the user.

client-side php script?

how does a client -side PHP script work?

Yes, aweful wording.

write a php parser in javascript

Oops.

google gears

Its going in a box that hasn't got a internet connection. Its only accessable via LAN.

hi, I want to pass $get variablesh to other url via curl, bud i don't know how to handle whitespaces

htmlenitites…?

when I get some variable with whitespace… somethig goes wrong

Its E_ALL for error reporting right?

like www.example.com?var=blah&othervar=this and this

What goes wrong? Whitespace is represented with %20% or something like that I can't remember.
But its perfectly normal.

%20

does xhtml works in IE ?

don't know… in my php i try to open $url = "http://www.example.com?var=".$myvar;

to extract links like this from a html file should I use some sort of html parser? regex? a href="link"August 15: Description/a

where $myvar = $_GET['text']
when i'm opening this url directly through webbrowser… evrything is fine, bud from curl in php, won't work if var had whitespace
it seem that curl can't handle whitespace in url!

Can't just use %20 in your scripts?

i must replace evry space in my var with %20

error_reporting(E_ALL);

url_encode

what should I use to parse links like this in a html document? a href="link"August 15: Description/a

preg_match()

envp so i don't need a html parser?

what you going to to with that link ?
*to do

i want to store link and description

prem_match()
preg_match() / sorry
google it

first etc

preg_match + parse html

$price) { if ($level=$_POST['value]) { return $price; }} but i have a problem for instance if they enter 65000 it returns 110 but if they enter 120000 it returns 130 but i want it to return the one past the level so if they enter 65000 it will return and if they enter

no, only that what intresting you

what did you mean by "parse html"

hello good people.

that would imply people here are good, when in fact, most of the questions and comments here tend to lean toward the contrary.
:P But hi

Hi

InsolentDreams omg

been a long day, hehe.

huh.

Query a mysql database in php the query works fine in the command line but php says the query is invalid and dose not get the results BUT i take the query straight from php (i print out the query and copy it into the command line….)

It's been a long day, for me.

Comments

I am new to PHP and am not a LINUX guy I am work in Windows platform Do you think taking PHP seriously along

no actually, it's to complete a challenge on a hacking site
ahhh adn that's what i'm looking for

oh, then you should be using perl

or ctype

ctype?

well i was going to do it client side with python, but mysteriously my packets get lost in london , and i don't have a shell that i wanted to do this is
so i'm using PHP cURL

yeh C's ctype also works in PHP

i see

hmm interesting, I wrote a line that didnt got trough appearantly
I think I pressed a wrong button there
well doesn't matter

ok, how do i foreach though a strings characters? can i just foreach (#string as $current) ?
$string rather

depends a bit what you want, but for ($i=strlen($str); $i0; $i–) { $str[$i]; }

that would walk the string backwards tho…

….righto, is that quick? i don't know what speeds are like with php, but that looks like a LOT of calls
doesn't matter the order, this script needs to POST it's answer back in less than a seconf though

i'll trim my question down quite a bit… is there any freely available PHP security/authentication mechanism that can be used to develop/implement a fairly fine-grained access model into an existing php host application? (maybe something that could be used as
a point of reference)

would definitely be less than a second
if not tenth's of a second
depending on the length

cheers
well it's an md5 hash, so 32 chars

would RBAC do?

it'd be a great starting point, so sure!

most mature frameworks have a RBAC implementation
http://en.wikipedia.org/wiki/Role-Based_Access_Control

anything you can suggest short of googling PHP+RBAC?

^^^^^

sure thing. was just wondering if there was a popular implementation that was well known to everybody except me.
that followed best-practice php security models, etc.

how do i append to an array?

+
or array_merge
or []
$array[] = 'pew'; // new array element with the value 'pew';

so $array += "new value" ?
ahhh awesome
cheers

I have a quick question

moin

In C++ your functions can automatically return a value
In php can functions return a value?

return value
i believe

return $value; ?

yes
Man i haven't programmed in php in ages.

how do you mean "automatically" return values?

I'm so confused lol

it's no so different from C….

like in c++ you can do "return 1;"

you can do that in php web hosting too
just return whatever you want;

but where does the value end up?

..

……

$variable = myFunct(); // myFunct() { return 'poop'; }

oh right
nevermind ;-)

but where does the value end up? it's returned to the calling funtion

Sorry my questions are rather stupid

$returned_thing = call_function( … )

is it possible to use an extended class's previously set variables without passing them to the child class "class Named_Cart extends Cart", vi Named_Card($DB,$ERROR);

ok, so i've got a hash, that i know exists in an attay i've got, how do i find out what the index is?

class Pew Extends previousClass { }
or adding an object via de standard methods

Dynom ^_^ Thanks

PythonNinja, array_search()
PythonNinja, but it's slow (O(n))

there is no such thing as a fast search

Dynom, yes there is

PythonNinja, if you're doing it all over your map, then you might consider flipping it

tell me all about it

Dynom, I hear they refer to it as binary. It's the new trend.

Dynom google is pretty damn quick for the data size

-_-
there is no such thing as fast searching
thats why it's searching
search is slow per definition

I see you have faulty pre-concieved ideas

i found a better way

name a search that is faster then a defined variable

how to filter out non-characters?

created an indexed array of plaintexts, and then i'm just looking for the key
saves myself a few cycles

yeh, thats faster indeed
since it's not searching :-]

i want to use a var for sql query and afraik it contains ; ' " , etc

then escape it

PythonNinja, to be precise, you've just optimized from O(n) to O(logn)
PythonNinja, that's pretty good indeed

yarp

if (isset($searchData[$searchKey])) { // exists }
how is that slow exactly ?

i'm actually quite a good coder in python i'm just learning php as i go along

html"

Dynom, that's not slow. He was looking to find a value though, not a key.

read what he wrote above it
"created an indexed array of plaintexts, and then i'm just looking for the key"

Dynom, his initial question was "i've got a hash, that i know exists in an attay i've got, how do i find out what the index is?"
Dynom, key-based search is fast. Value-based is slow.

Dynom omg, there is a mysql_real_escape_string() thing

Did you mean what I stated? or did I didn't understood you correctly
:-]

Dynom, 'ts okay, I think we agree about speed concerns

yeh think so too, but I just want to know if he get's it or not

:

are there any other ways to do a page refresh other than header()?

i'm not dead sure what you meant, i had an array full of plaintexts, and an array ful of the hashes, then i needed to find the index of the hash, so i could ge the plaintext

hm

but then i just made the hashes the keys and the plaintexts the values
and saved myself a lot of pissing about

I guess you where right, he didn't got it
ehr
now I got confused -_-

Dynom, he changed his approach during the question :P

yeh

going from two arrays into a map

bottom line: in_array() = slow, isset($array[$key]) is fast(er)
if you do the 2nd you are doing a good thing

in fact, isset() is optimal for maps

ie going from evilbadscary and hackish, to the good way

you can't go any faster

yeah, though checking existence is pointless, i KNOW it exists

well

PythonNinja, $value = $map[ $key ] isn't checking for existance

then why bother checking..

what line must I add to httpd.conf?

PythonNinja, that line constitutes a binary search

LoadModule php_module etc.?

the right one

module_php ?
php_is_cool ?

barque, look at http://www.php.net/ it has documentation
barque, look at a href="http://www.php.net/"http://www.php.net//a it has documentation

Can a user create a fake cookie to access your site?

module_yourquestionssuck

I just want to know the correct entry name

fivetwentysix, yes

ofcourse

fivetwentysix, they could even write their own browser!

yeh, I mean MS can

So what can I do to prevent users from creating fake cookies?

( whoever starts about IE7 right now should be shot )

and taking control of my whole portal

you can't
you can't controle it
just make your system so that it can check it

What's the best method to authenticate a cookie then?

ehr
wrong question
you shouldn't authenticate cookies, you authenticate users
cookies can help you with that

I use cookies to authenticate users.

use sessions

what is in the cookies ?

However the cookie I'm relying on basically just tells me his user id

…..

And that's all I check for once a person is logged in

well there you go wrong then I guess

What else should I be checking for then

never check for id/password/username/etc

fivetwentysix, anyone knows the userid. You need to store something that is able to authenticate the user in the cookie. A piece of information that an attacker will not be able to guess.

you should put a identifier in your cookie that you can reproduce server-side

(not the password though)

Like a session key?

no
your own generated ID
session ID isn't reproducable

oh that makes sense

well if it truely did we are going a good direction at least

so i just generate a algorithm to generate a code which gets stored in my database everyime someone logs in
There for only my server and the person knows the key
right?

well

fivetwentysix, that's a way to do it. This approach is called an "authtoken".

yes, sounds about right, and when you authenticate a user
you select your algorithm and a few user variables server hosting side
and match that against the challenge you got from the user
if that matches the user might be valid

okay

from that point on you can better start using sessions
and don't be cheap in the length of data you put in a cookie
just don't exceed the length ofc

i md5 all my cookies

s/length/maxlength/
why

usually a 16-bytes hash is okay
just make sure it's as random as you can

its not like a 16byte increment is a lot of bandwidth anyways

what can I say, I like big things

:P

Recovering from a hackers' attack takes countless hours

How do I send data back to the caller? http://pastebin.com/d718044e9
Line 42

pray for whitehats, and make your siet secure
and make backups

good idea :-)

http://xkcd.com/296/

What is that?

nerd comic
thought it was funny

what are the main exploitable elements of your page?
you using a precoded CMS or cookie auth on the client side?

Well the only software I'm using that's already been written is phpBB
i'm writing my own portal
for a gaming community website and I'm using phpbb as my backend, for logins andeverything
I'm just going to heavily modify phpbb hosting to suit my website's needs
I figure phpbb's code is better than anything I could write, it's open source, and free.
Saves alot of time and money ;-)

ok, well check for exploits on milw0rm.com etc
yeah, i've got exploits in either phpbb or mybb i forget which

Okay

change the default location of DB files either way
that's the most common vulnerability

i am attempting to load a page after a php script is run, yet html is parsed before the end and therefore i cannot use header. What other options do i have?

just make sure that you keep it all under version controll so you can update your code easily when the next revison of phpbb is released

is there a way to view the source html of an iframe from within internet explorer??? I can do it within firefox, but IE7 doesn't seem to let me. (PS. i don't want to load the iframe into its own window).

hi, any idea why this doesn't work:
$handle = fopen("passwords.txt","a+");
fwrite($handle, "just a test");
fclose($handle);
echo exec('gpg –output passwords.txt.gpg –encrypt –recipient admin@commsquare.com passwords.txt');
everything works ok, except the gpg part dosn't seem to work.

f00li5h thanks for the advice
PhythonNinja do you code websites in python?

Is it possible to directly interact with PHP?
or do I have to have HTML to do stuff like POST

Phlyo, do you mean line-by-line like an interpreter ?

:_-( I don't know
I don't know much about PHP

You can run php from the command line
does that help ?

My overall goal is to get this C++ program to get data from a file to an SQL server and back
yes
Well sort of

where does the php fit in ?

hi anyone ever got mssql working under linux ?

i have
well, freeBSD

The C++ program reads in the data, connects to the internet, sets up the data to look kinda like this: POST71.111.111.111 HTTP/1.1\r\nAccept: */*\r\nContent-Type: application/x-www-form-urlencoded\r\nHost: 71.111.111.111\r\nContent-Length: 11
username=PhyloGenesis&password=aaaaaaa&command=Write&filename=5000net.dat&data=Pressed '1'}{
without the }{ sorry

ah - i see. right. yes you can

Then it uses WinSockets to send() the data. What happens there I don't know
Does it call the php hosting somehow?
Would the PHP be a program running on a server or on a client machine?

php on the server

sweet
I know very little here, I'm trying to piece together a project started by others. The person that wrote the C++ program is gone for a few weeks
he would've known how to do this

learning is fun

I'm trying to take over his part because I know C++
but it turned out nobody else really knew anything, even the guy writing the PHP :-)

.. and knowledge is for sharing

I took the code he had (that paste) and adapted it for my own sql hosting server
tried, but I don't understand how PHP gets the data from the C++ program or sends it back
I know the C++ program uses send() and recv() which are part of WinSockets I think

try breaking it down to simple steps to clear up the essentials - C++ to Winthing to php to db to php to C++ is a lot to do in one go

does anybody have a clue why this command doesn't work:
exec('gpg –output passwords.txt.gpg –encrypt –recipient admin@commsquare.com passwords.txt');
it doesn't a produce an error though

Okay, my knowledge ends at how the PHP receives the data
!wtf PHP

and i know nothing of the C++ bit

lol, a recursive acronym

i guess you're creating a HTTP request of some type, either post or get
?
(reads line again) post

looks like it, the C++ program is sending data that begins with "POST71.111.111.111 HTTP/1.1\" where the 71.111 thing is the server

so the php script has to catch your post data

hi guys

start with a simple php script that displays the contents of the $_POST variable

The one I was given starts with $username = $_POST['username']; and has several more like that
you can see it in my paste

Hey, is there any PHP debuggers out there ?

xdebug

that makes sense - so you're php is receiving the correct info, yes ?

I don't know how to test it :-!

great .. thanx

From the looks of that data it is sending, should I assume the PHP script is NOT receiving all of that, but only the part that has &username=, &command=, etc?
or *Do typical PHP scripts handle stuff like "HTTP/1.1\r\nAccept: */*\r\nContent-Type: application…"?*

I am new to PHP, and am not a LINUX guy .. I am work in Windows platform, Do you think taking PHP seriously along with Windows platform .. would be good for the career ???

http://www.url.org/filename.php?variable1=value1&variable2=value2 makes variable1 and variable2 available to php as $_POST['variable1'] and $_POST['variable2']

you can do php on windows, there's no reason to stick to a specific platform

well, most webserevrs that run PHP have apache on linux
I think it would be a big plus to gain some knowledge of linux

hi

that's why am confused … i see most the productiion servers are based on Linux

i'd say, give linux a try

It's a conspiracy!

put some in it, it really isn't hard

I'm trying to build a control panel for a guestbook

So in all likelyhood all that other stuff is to get the &username etc variables to the PHP script?

They're just telling it's linux, secretly they are all windows

and I make a long in page

lol

but I have a problem in starting session

check

sean ??? … How it is "secretly"

Ir0n, whats so difficult about session_start ();

I do not know why it does not save the values

Forget that, I am going to try to manually check some stuff

Vadi, becuase..

bbs

is the problem in the server or what is wrong

Ir0n, paste?

good luck

session_start();

… you're keeping up the secret .. haan

if (!isset($_SESSION["admin_cp"])){
if ($user_name != $_REQUEST['username'] && $pass_word != $_REQUEST['password']){
$login_temp = $new_template-load_template ("template/login.html");
echo $login_temp;
} else if ($user_name == $_REQUEST['username'] && $pass_word == $_REQUEST['password']) {
//session_register("admin_cp");
$_SESSION["admin_cp"] = $user_name;
}
}

paste in the pastebin please, not in the channel. People (including me) hate that.

Vadi, if I tell you, they'll hunt you down

sorry

I cannot let them take another life.. not today!

anyway, as per you, most the production servers runs PHP/Windows rather than Php/Linux
thx
thanx

Any Simple Machines Forum developers here?

no

!+g10

Guideline #10) We don't support script(s). We help you *write* PHP, not recommend or download and install/hack/modify/adapt/use pre-written scripts. Contact the authors of the script for support options they provide.

Just asking.
anyone know if there is a SMF channel on freenode?

berry__ did u figure out the problem

!+u

Surely you mean 'you', not 'u'? The letter 'u' is not a personal pronoun. Talking like this in ##php may get you silenced. For details, /msg php-bot aolbonics

$str = "?";

lht, I need 1 million dollars..

haaha

lht, why would you need regex for that, if you want to see if it's in the string use strpos..

sean`, me too

ok, strpos. Thanks

Char80, maybe we can work together in achieving it :p
I'll make the plan, you rob the bank.. deal?

sean`, for sure, i can be watching if the cops come

why start_session() does not start and $_SESSION does not save the value

hmm… now we just need a fool to go into the bank and rob it..

is the problem in the server?

Ir0n start_session()? wtf?

Ir0n, how are you with bags?

sean`, not really hard to found one
haha

:p

not good as you sean`

heey

Ir0n, I can teach you the magic of bagging money.. so.. you in?

Ir0n mabe try to use session_start(); ?

you go in, grab the money, put it on the roof so we can pick i tup.. and then try to make it out alive

I'm using it xk

well.. you'll have to run, not enough room in the chopper for 3

theand then we split the money, of course

yes!

Where on a server (zendurl.com in this case) would I put the PHP file?

hi

zendurl.com have serious downtime issues

hmm, that's okay

just for case

this is my first attempt at this stuff
once I even know how to get it to work
maybe I'll move on to more reliable stuff

I have a question
Say I define a variable outside a function
and the variable name is $var1

anyway, from many "free" hosts that i've tested, zendurl.com is very sweet but the downtimes

fivetwentysix, you need to globalise it if you want it inside the function, if that's what you want.
function some_function (){
global $var1;
do_something_with($var1);
}

I execute function 'function func1()'
i mean func1($var1)
does it take the variable from where it was defined?

Hmm.. Was wondering.. Is there some way to use sockets AND file pointers in a select() function?

Sorry I mean I execute the variable as func1()
but defined it as func1($var1)
or i needa globalise it?

I've made a script, which works as a multi-client server, and can also connect to servers as a client.
But I want to interact with it through STDIN.

can i globalise multible variables in 1 line

whereever you like. if for the index page (or some other known landmark) and base the location on that in the C++ call, eg 71.111.111.111/test/myNewScript.php

And if I was to make it an extra read, it would mean I'd either have to give it a delay of the timeout in socket_select, or make it use as much CPU as it wants through a for loop.

eg GLOBAL $var1, $var2…

Anyone?

How to data feed to google base ?

data feed to google base?

yes, we add add our data to google base so that it will appeare in the search

Oh, you mean so your site is on Google?
I think Google's spider has to see a link to your site.

#web

Can I define a function in a function?

fivetwentysix, yes.

you can, afaik - but why would you want to?
don't PM users without asking

AlexC_, my PHP bot has a function to interpret a line. :P
Which includes me using my !eval function.

Can I execute this function outside of the function? What would the syntax be like to execute it?

Which is why you might want to define a function inside a function.

just make it outside like a normal function

fivetwentysix, yes.
fivetwentysix, it's exactly the same.

I see no need for it even then

As long as it's inside the same class, PHP doesn't care where you define a function.

I did not understand what u r telling

type /join #web

AlexC_, also, you might want to have a function, which checks something.
And if what it is checking is true, it defines another function.

hello

I have many of those functions, not one of them is inside another function

Meaning it doesn't waste resources if what it's checking is false.

how to clear a session in command line mode? i use cURL. it sends the same HTTP_REFERER for every links it requests.

that just makes for bad coding, because what if you want to call that function? woops - you can't because it wasn't set to true

But you won't want to call that function.

I put the file here http://www.zendurl.com/q/qbonline///Transfer.php (I don't know why it put ///) and when I go there it is a blank page (which actually makes sense), but when I tried adding &username=qbonline, etc I got a 404
error

then what is the point of a function that you never call?

if a have a variable referencing another variable ( $a = &$b) how can I know if I change de value of the reference ($a = &$c) or a value of a referenced variable??

AlexC_, also, you might want to have a function, which checks something.
And if what it is checking is true, it defines another function.
Meaning it doesn't waste resources if what it's checking is false.

don't flood and copy convos' like that

I was pointing out my point again.
Anyway, you seem experienced.
Do you know about socket and stream select?

never had to deal with them sorry,

I take that back, I viewed the source and I see nothing to do with my php at all

Ok.
Or do you know how I can treat a socket as a file?
Or vice versa.

Retrying saving the file

php.net/sockets

How can I access a variable in a function?

you're inside the function and want to access one outside of the function scope?

fivetwentysix, globalise it.
global $myoutsidevariable;

no. nein. non.

mm you could, globals are generally not a good idea

Or, you could access it with $GLOBALS[myoutsidevariable]
AlexC_, why not?

no i want to access a variable in a function from another function

you can't,

You have strange theories.

me?

Yes.

ok

alexc why not?

fivetwentysix, in the first function called, store the variable outside of the function.

I take it you run PHP in safe mode with register globals on and other jazz like that? ^^

And then grab it from outside in the 2nd function.

because global data tends to get very confusing and it's very very easy to accidentally overwrite things

AlexC_, no, I do not run PHP in safe mode.
I like to give my PHP installation alot of flexability.

How do I store a variable outside of the function if i use oh…
nevermind

how can you tell if your php is in safe mode or not?

php_info()

AlexC_, I can't see anything on php.net/sockets about treating a socket as a file. :P

ty

And it's phpinfo()

Wait im confused

Not php_info()

Can I use return $var = $result ?
in the function to globalise it?
sorry im coming from C++

huh?

if php complains about undefined imagettfstring() function, what am I missing? the command imagestring works fine

I've no idea on sockets - I just pointed to a place that may have been helpful

fivetwentysix, no, globalise it first.
global $var;
return $result
Or:

urgh, messy

global $var;
$result = $var;
return $result;

if you're doing that - then why not just pass it as an argument???

return $GLOBALS[var]
(With a semi-colon at the end)

does return $result make it usable by using global?

or $var = function(); ?

fivetwentysix, no.
return returns data from the function.

blah(argument)?

if php complains about undefined imagettfstring() function, what am I missing? the command imagestring works fine

So that the function is equal to the return value.

no need to repeat every 2 mins

AlexC_, sorry .. :-(

please help! the same HTTP_REQUEST is sent in every request
in cURL

imagettfstring is not a function

imagettftext() :-)

What delineates a comment?

PhyloGenesis, a comment starting with "//" goes to the end of the line.

okay thank you

And a comment starting with "/*" goes until "*/"

same as C++, cool

Yup.

got GD installed?

Not sure if PHP stuffs up if you try "/*some */comment*/"..
Havn't tried.
I know C does.

yes it will

AlexC_, the imagestring function works fine, so I suppose that GD works … (I used the –with-gd parametr)

works

Mk.
So it's not the same as C then. :P

Note: This function requires both the GD library and the » FreeType library.

/* opens comment block and */ closes it, as simple as that

that's not what he said :P
"/*some */comment*/"

AlexC_, I have freetype installed and also gd with freetype support installed

is_null, but what about "/* this /* comment */"?

it will end it and leave comment */
so, parse error

What about the 2nd?
"/* this /* comment */"

oh - that's different to what you said before!

yes, my bad, i was talking about /* /* */

yeah that will work - "/*some */comment*/" wont work

Ok.

checking whether to enable truetype string function in GD… yes

I don't think "/* this /* comment */" works in C.. Not do "// … EOL" comments inside "/* */"
Lol. Comments are for neat people..

/*…*/ can't be nested

AlexC_, did you see that configure line?

I'm going to bed.

while(true){ ???
that will never end

Hi! Could anyone give me a howto for how to captcha onto my site? Is there any simply to use function for it?

PHP Captcha tutorial

create an image with GD - store the characters that you generated in say a session
then when the form is submitted - compare the characters entered with the one in the session

Thanks, this is the information i needed.

I am able to load my PHP page, but when I add &username=hi to the end of the URL I get a 404 error

thats because it's suppose to be ?username=hi

aha! darn you, just as I find it in an earlier thing firegrind said
thanks

?username=hi*&=hello

what is the best way of putting html into a php variable?

oops ?username=hi&something=hello

$var = 'br /';

thats not a variable

doesn;t work?

can i do that for a large amount of html

yes.. ?

just checking

AlexC_, what?
It's already in a while(true){

why would you store html in a variable anyways?

And it does end.. When I end the process, or close the STDIN, STDOUT, or STDERR pipe.

anyone know of a good tutorial for creating a php/mysql based website with dynamic content for users?

How do I display the value in a variable? I tried echo $username;

'Night

just like that

josh_, yea, it's called Google.

but I see nothing (when I goto blah.php?username=PhyloGenesis)

o, try: echo $_GET['username'];

what about both php and html into a variable

sounds you are doing dirty things
what do you need it for

Aaah, I have $username = $_POST['username']; already, is the problem that when I enter it into the URL that that ISN'T the method it is using

i am writing a facebook application, and i need to pass my code for my application into a variable

$var = "html" . $phpvariable . "a href=\"blah.html\""

POST = post, _GET = get (like: page.php?username=fubar )

so that facebook can insert it into profiles
and my code involves html and some php variables

tr3k what is your project?

yay this is good'.$wow.'ul…..

ahh, thanks

http://rafb.net/p/zEyD9K25.html here, the sessions is never unset

if your passing a variable using http method
you need to use $_GET['var']

me?:R

Okay, btw I need POST for my goal page, it's debugging I need to switch this for

method) then use $_POST

you can use $_REQUEST, that is for both

nothing really, just a test application

damn this

How do I put a newlines with echo?

echo "\n";

"\n" just turns my output into 0000
okay + "\n" does that

sniff`don't do unset( $_SESSION ); … best to do $_SESSION = array();

echo $username + "\n"; should be what?

username followed by a newline

+ adds, PhyloGenesis
no it wont

sigh, $username . "

oh, oh! I see

\n";

it's weird going from C++ to HTML/PHP stuff, ’cause the position of commands matters

position?

in C++ you can make it all crazy looking and it does the same thing

AlexC_ still the same

Yes, putting the ';' on the next line changes what is output
I think
let me check on that

you always need ; on the end of every line, PhyloGenesis
well, majority of them

AlexC_ except that the $_SESSION is nulled but not unset

because it wont be unset

how would it be?

can anybody save me please?

i want isset($_SESSION['adminlanguage']) to be false

no

AlexC_

how can we help if you ask no question?
then make sure adminlanguage is not set,

$_SESSION['adminlanguage'] = '' won't make it empty but set?

makes it empty, but set

ok what? How do I display a variable then a newline?

unset( $_SESSION['adminlanuage'] ); unsets it,

AlexC_ it's yesterday's question extended. i got to read some rows and update the time field to some value

how do you expect people to remember a question someone said on IRC _yesterday_? O_o

AlexC_ its still set :E

$foo."\r\n";
pastebin code

i got to read some rows from a table. then i need to udpate these fetched rows' `time` field to time();

AlexC_ http://rafb.net/p/iArXvk49.html

that's all the code?
so use mysql_query() ?

anyone know how to connect to an irc server like online.be.galaxynet.org with pidgin??

That only put a space (which doesn't make sense…)

#pidgin .. or #gaim if that's still the channel name

lotsa files its phplist

AlexC_ i don't know how to put SELCT and UPDATE in one query this time

it can't be set if you have done unset() - something before that is setting it again
you don't, do 2 queries

AlexC_ i guess

you can do subselects

isnt that what multi-core cpus are for?
performing multiple queries?

SELECT … FOR UPDATE ..
no its for running many threads parrallel

multithreading has little to do with having or not having dualcore cpu's

#mysql would help more

AlexC_ two?

#mysql

ThinkMedical i have tried subquery and for update…

whate are you trying to do and #mysql etc.

DavidHKMrPowers, you are too idle to read the update syntax in the mysql manual

archivist ok
i know UPDATE whatever SET whatever WHERE IN (SELECT…..)
but it would not work if they are in the same table…

#mysql - go, quick!

same table??
sigh

ThinkMedical ya..

what are you trying to do?
you shouldnt need subselects for the same table, use WHERE `id` = `userid` etc.
byou shouldnt need subselects for the same table, use WHERE `id` = `userid` etc./b

go to #mysql - this is not a ##php question

ThinkMedical can you go to #mysql to help me ?

lol

I'm sure there are other mini ThinkMedical's running around the place in #mysql that can help

where can one find a php mentor?

Google I've heard is a good mentor

you mean a free one?

lol

go read some tutorials, if you get stuck - come and ask in here

sup MikeSeth

immeasurable length of pain
you?

lol why pain? im ok, i guess

ok alex ty

Comments

I was learning Drupal and saw it had a db_query function that accepts the query as a string and the variables

haha, ya thats rediculous

I dunno if the Visa one needed a symbol, but definitely the other 3

MD5 is algorithmic, but it's asynchronously algorithmic

are you trying to say that it can't be "unencrypted"?

Anyway, just cowboy up and use SHA256 or Haval256,5

MD5 isn't encryption though I thought

is there any native sha256 function? because I so would use it if there was.

It
It's not.

gotcha

md5 works on a stream of bits, but it has weaknesses wherein it's possible to break into that stream at some point, enter new data, and then work it back itno the original stream, thereby hiding your changes

Yes, hash() is native.
That's…. not entirely accurate….

w00t!

please update what I said then, so I can learn more

Too much rum in me to explain it…

that's what I understood of it when reading about those people that had broken it. after seeing those two postscript files with different content and the same md5sum, I was impressed

i think it has to do with the randomness of the algorithm. For instance, two strings "hello man" and "hello woman" are supposed to have equal chances to change each bit randomly of the final output but people have discovered some patterns

There is no randomness.
It's 100% deterministic.
It's just a very chaotic pattern.

MD5 is the CE of D&D.

obvoiusly, there's no such thing as real randomness in this sort of thing

http://www.cits.rub.de/MD5Collisions/ that's the postscript example I was talking about

All digest algorithms work on the exact same principles…. just with different degrees and types of chaos.

it's interesting

a good hash algorithm will have an equal likelihood to change any bit in the final output from any change made in the input

$myvar_foo(foo of the $foo variable). Does possible ?

the most reliable hashing mechanism is to use two or more hashes together
e.g. md5sum(file.txt) sha256(file.txt) and confirm they both match
you may be able to break one, but never two together

What of the what and what?

the hashes use completely different algos, you would never get two differing files which had matching hashes for two different algos

that was a really niche type joke that I knew wouldn't work, don't worry about it :P

even for weak hashes like crc32

Of course not, but with sufficient storage space and processing power you could composite two separate, but complete sets of reversals

I am talking about securing the authenticity of a piece of data, by using two separate hashnig methods on it
*hashing

md5+sha1 is really just mycompositie-288

e.g. those two postscript files on that URL above I mentioned, if you used crc32 on them, they wouldn't match

I understand that.

so why did you chuckle at never ? it is a never case

They wouldn't because the person making them match didn't both to make the crc32 case match as well.
It's NOT a never case.
md5 has a 128 bit collision space. sha1 has a 160 bit collision space. md5+sha1 has a 288 bit collision space.
1 in 2^288 is not zero.

some of us live in reality though

they are exploiting weaknesses in one particular system. there's no way another hash type would end up with a match using the firsh hashes weakness

And 640k is enough for anybody.

I'm not talking about pure random collisions, those would be possible on some *extremely, extremely* rare data

You're missing the point. md5 isn't the only "weak" algorithm.

I'm talking about ones like that broken md5sum, where they are manually modifying a file to create a matching checksum

Every algorithm is weak.

people also did that a lot on BitTorrent, to spam torrents they didn't like
giving fake pieces that matched the checksum

So?

lol, that's quite fun :P

If BT were checking MD5 and CRC32 values it would just be harder. Not impossible.

md5 + crc32 wouldn't have the *same* weakness, so you wouldn't be able to create two files that match one checksum for each

YES
YOU
WOULD

i love pollita's literalness

You would just have to address their UNIQUE weaknesses independently.

foutrelis, thats second time today you've wished that. you need a new client :P

Indeed :P

well I don't think that any modern checksums will ever be made to match even with user-provided-data … and what I was talking about was data provided by ones self to others, and then letting them validate it
the person trying to cause problems would need to match a new file to both the original checksums

I'm talking about the same thing.
And they could.

alright. I don't agree with your assumption. let's move on now

Quick check…. how many hashing algorithms have you actually implemented?
’cause http://us.php.net/manual/en/function.hash-algos.php Example 847 shows a subset of the list I've done.
’cause a href="http://us.php.net/manual/en/function.hash-algos.php"http://us.php.net/manual/en/function.hash-algos.php/a Example 847 shows a subset of the list I've done.

size only goes up to 7
perhaps you mean style="font-size: 200px"

The channel has a bb code parser that changes those tags to CSS

Pollita, why did you implement those?

omg

Because I wanted to learn as much as I could about crypto, and hashing is a part of that.

are all of those digests?

yes.

That "whirlpool" algorithm sounds like fun :P

well there's quite a bit more to learn then

hrm…now http://pastebin.ca/664112 returns 0…could this be another thing that needs to be "fixed" for php5?

ext/crypto is still waiting for lawyer approval

stream ciphers, block ciphers… uh… tons more :P

I couldn't include all the hash algos I worked on in PHP because of patent issues and stupid crap like that
But those are all PD or otherwise unemcumbered

How am I supposed to read UTF8 string from $_GET?
*strings

hi folks! i've got a rather simple problem. my visitor-counter stores the number in a simple file, which i open with fgets. for every visitor, i open the file, increment the number and write it back. unfortunatelly, my number seems to be limited to 16 bits. how to resolve that?
like $num=fgets("thefile");
$num++;
then i write it back
it overflows after 65k

store it as ascii perhaps?

how to resolve that? i want a full 4 byte integer at least

or si that what you're already doing?

well, how so?
i just use fputs($num,$file)

file_get_contents(); file_put_contents(); ?

thanks, i think that's what i want. gonna look it up in the manual

although using your method, if two sessions open it at the same time, it won't end up incrimenting
I mean, it would incriment by 1 rather than 2

That….doesn't make any sense…. there's no reason it should overflow at 16bits

but it does
starts at 0 again then

does the Zend Debugger support live representation of what's going on on my php hosting server?
I find top to bottom execution a little useless

this is a rather old php 4.3 i think

That's doesn't matter.

pastebin the code

PHP uses signed long (which means -2billion to +2billion for your average 32bit prox)

strange … now it doesn't anymore
weird
i wonder why this happened before :|

a miracle

probably
that can well be
how can i make this thread safe?

Though try casting to an int when you fgets()

Is there any chance that the behaviour of heredoc will be changed in PHP6? I mean so that the ending can be indented.

$num = (int)fgets($fp);
That has nothing to do with race conditions

you sure?

But it might be related in other ways
As to racing…. just apply read locks
exclusive locks rather

alright, i'm gonna look that up

No, there isn't.

Awww
Worst thing about the heredoc is that it makes the code messy near the end

No, that's not the worst thing…
!+strings

[STRINGS] Please read http://php.net/types.string for a basic understanding of how strings work in PHP, as well as http://php.net/strings for functions to manipulate strings. Be sure to read 'user comments' as
well.

erm…
!+string

Sara knows, and now you can too! See http://blog.libssh2.org/index.php?/archives/28-How-long-is-a-piece-of-string.html

That's the one

What do you guys think of the book PHP and MySQL Web Development (if any of you have actually checked it out)

i have a page that lets users input paragraphs of text. what is the proper way of retaining and outputting the line breaks and stuff they put in?
(im using mysql db)
Consty, who's the pblisher?

Sams

I edited the 3rd edition and I can say it's a damn fine title for beginners, but if you already know your way around, you should look at "Advanced PHP Programming"

i prefer orielly

I know enough to fiddle my way around and such, but I'm looking for a more indepth coverage.
I'll check that book out though

http://pastebin.ca/664112 returns 0…could this be another thing that i need to fix for php5?

my eyes are bleeding! separate presentation from logic and I'll help you

hi
I have a WYSIWYG and in it you can write javascript and HTML Form code, I want to strip out this code, any idea how to do this?
i need stript them out before save it on the data base

i have just switched to php5 from 4, i recently changed my vars around so that the code could work without with register_gloabls off…it now works fine except that move_uploaded_file returns 0 which i describe as "Upload folder does not exist on server"….it clearly exists from what i
see

Sup gangsters

$actions = new $module."actions" ; ?
Does possible ?

can you please rephrase your question?

i did here: $classname = $module."actions"; $class = new $classname (); Thanks
$classname = $module."actions"; $class = new $classname (); worked. Thanks

ok..

$class-Action($somevar);

he said he got it working

O
i've got a question about sessions
i'm doing a login system that allows uses cookies to remember users, so I authenticate a user and then set a cookie with his unique user id
but i don't want malicious users to modify this user id to another user's id
do sessions automatically solve this problem or do I need another cookie with a secret value shared by the server and the user?

sessions create a session_id thats saved in the cookie and you can "remember" data using the $_sessions[] where you can plonk info in to share between pages - you'll need to read up on sessions

Is it php hosting security bug if I can overwrite remotely the $_SERVER['SERVER_NAME'] variable with custom user input or it is supposed to be allowed ?

I use an id that stores a specific "session" ID, the IP, and so on, as well as a hash of all those combined with the password hash, which is not stored in the cookie. No way around that afaik.
s/I use an id/I use a cookie/

hello all! hey, if i know the timezone of the user in GMT ("+3") etc.., there is anyway to calculate the date and time? … thanks!

what the oppersite to ceil so to round down?

floor, maybe, but I don't know if that's in PHP.

kieran491 - look down it's the floor

another option is to just cast to int, and even back to whatever you were using if need be.

ahh floor

floor is the one

i thought neo was….?

ok, but if I want a user to stay logged in for however long they choose (up to a month for example), doesn't the php session ID expire long before then?

I'm pretty sure that session expiration is the same for every user, whatever you set it to. Then again, I've never used sessions.

schorchsaber
you can set the session expiration

I thought it was set in the ini file?

sure, but you can set ini options at runtime
one sec
let me get you a link

ahh

there's this for setting the ini
http://us3.php.net/ini_set

so if I change the session expiration to 1 month for example, do I even need to set any cookies then or will the user automatically be remembered?

and more specifically for session http://us3.php.net/manual/en/function.session-cache-expire.php
or http://us3.php.net/manual/en/function.session-set-cookie-params.php
hexdump
don't do session exp 1 month
just don't

ok but I'm wondering on what the best way to do this login system is
if I want a user to be remembered for a month
and the session expires before then…what happens?
i was thinking that I could have another cookie with their userid that expires in one month and the server hosting would start a new session

ok, so you want a secure login for a month
sure
that's the usual way

sup ^_^

but you're worried about cookie manipulation
just md5 the value, store that in the cookie

what value?

whatever value you're storing in the cookie

yeah, crumbly cookies are no good in milk

mmm, cookies

storing and md5 hash in a cookie huh?
:P

sure

an*

sounds good to me

but can't somebody just take the md5 of another users id and put that in their own cookie and get access to the other users account?

just dont let mister plod know

sure

hash cookies are illegal unless medicinal

but that's quite the edge case

( in many places at least )

and I'm sure that will never happen
what kind of sevice is this?

ummm…I think I'd rather have a secure login system then just pretend nobody would do such a bad thing

lets weight the security issues
weigh*

it's not a real service

programmers tend to think in edge cases

i just want a secure login system
i am a programmer and I do think in edge cases

well, a secure login system would not let you stay logged in

if you want a secure cookie, store a value inside the cookie which is required to validly re-load the cookie manually, or put the users IP inside the cookie or something

sure, but an experienced programmer knows when an edge case is useless and silly

in the session data

is it possible to do something like if ( dd/mm/yy date() )

well here's what I was thinking

ive just had a total brain lapse and cant think how i could do it

go to php.net and look at the date and time functions

convert them both to unixtime

when the cookie is created a random value is stored in the cookie which is also stored in the mySQL database…when the user presents the cookie (and his session has expired) the random value is checked with the one in the sql database. that way, if I
change my user id in the cookie I can't get into their account because I don't know their random value
if the random value matches the user is granted a new session

record connection dedicated ip hosting in cookie :
:P

what good is that?

I'm running lighttpd + php-cgi, and just browsing my website by myself seems to spawn 10+ php-cgi processes each using large amounts of memory

these are excessive solutions

is this normal?

well, if connecting from a different IP, they cant use the cookie

but they can just modify the IP in the cookie!

no, not if its stored in the session associated with the cookie
the session data is not user-writable
so load cookie, check to see if IP matches, if not, die

wait a second…explain how the session data is not user writable

$_SESSION — stored server side

then thats not a cookie is it?

the only thing thats stored client side is the cookies ID

ok, but the session will expire before the cookie does

then manually maintain an association table in the database associating cookie ID's with IP's

so what is a cookie ID?

any unique number, it matters not
any unique string for that matter

but isn't my random value idea better…it's not realistic to expect that most users will have the same IP for a month

a 3rd party sniffing the connection and re-running the data through the server, so verification on cookie alone is prone to abuse .

ok, but like I said, what about the IP changing

mysql_query("UPDATE testdb SET ip = '$_SERVER['REMOTE_ADDR']' WHERE username = '$username'"); can I use a comma or something to update two or more variables at once?

your wanting them to be remembered for a month automatically eh?

yes

are you guys talking about remembering for logins?

unless they choose to log out
yes

http://www.devshed.com/c/a/PHP/Creating-a-Secure-PHP-Login-Script/

well, the best you can do is store 2 or more unique cookies and require all 3 to be present.

it's rather easy, use the cookie random key and IP
if someone gets your IP, the idea is they don't have the cookie, hopefully
I've only been using php for like 7 days so meh, I could easily be wrong

the problem is, dialup users will not have that benefit

exactly

their ip fluctuates like the wind

who uses dial-up?

90% of the wolrd
world*

i don't know that most cable/dsl companies allow users to keep a single ip for a month either!

here you can request a static ip :P

i do

I have mine for 3 days or until I reset my modem
how do normal sites do it?

3 days, not a month

my home dsl has static IP, all work ones, and what not

just a cookie?

most people I know have static IP dsl

if you want security, transfer the cookie over SSL

it will be transferred over ssl
but lets assume it's not for the sake of discussion

about my update question anyone use mysql

256bits ) or use several cookies to emulate the large cookie string

theJackal, what will a larger cookie string do?

the larger the cookie string the harder it is to guess

but it can just be sniffed

2^256 = a lot of open space

if you only use the cookie then all they need is a middle man attack

it cant be sniffed over SSL

like I said, it will be ssl, but what if it's not

I think suhosin does 2048 / 4096 bit cookies
from memory.

if not SSL, you have to rely the inherent security of the network i guess

meh, I don't think anyone is going to be bruteforcing it, so making it long is pointless

ok, lets say it's ssl

you could implement your own security system with request/reply running in java… but thats overkill

should I go with my random value idea to allow dial-up/dynamic-ip users to stay logged in for a month?
no java

Sure they will. NSA has server farms 10km square just for cookie brute forces.

if your worried about the NSA, you have bigger problems

jsoft, when the NSA wants into my site I'll let them

exactly…this has to be the most secure login on the face of the earth
and it has to last for a month

what if your site is based in 'mother russia'

what are you protecting?

nothing

secret plans and documents for world domination / solutions to rubix cubes

if you want security, abandon naked http.

i will
but i want the cookie to be secure

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

Mmm cookie.

run everything over 32Kbit encrypted SSH tunnels via TOR

it has to be secure, not anonymous

using publickey/private key authenticationn
and then mail out the keys using CDROMS

and 'password' as password.

crap, you guessed my password

okay so is there a way to update mysql_query("UPDATE testdb SET ip = '$_SERVER['REMOTE_ADDR']', code = '$code' WHERE username = '$username'"); — will that work?
uokay so is there a way to update mysql_query("UPDATE testdb SET ip = '$_SERVER['REMOTE_ADDR']', code = '$code' WHERE username = '$username'"); — will that work?/u

lol
mine too!
:P
should do Sirisian

oh so I can update 2 things at once?

if not, then mysql blows
postgres can do it

I see

pgsql for the win.

I have postgres on the server next to me, I'll be using it later

ok then, assuming I'm using ssl and I want the login to last for longer than the session for all user (including those with dynamic ip's), what should I do? should I use the random-value stored in the sql database or is there a better way?

I was learning Drupal and saw it had a db_query function that accepts the query as a string and the variables as additional paramters, like the printf() syntax. I want to rip it, but this means ripping several functions and combining them. Isn't there a function available on the net that does
this?

you could probably find the key-pairs from the SSL transaction and maybe use them, .. i forget how SSL works
so jsoft. how about them sheep?

Sirisian, mysql should be able to do that. To be sure, try channel #mysql

ok, well thanks for the help everyone

#mysql
whoops lol

hmm?

nvm :P

Oh. Ahh har har. *cough*.

its just new-zealand hour in here atm
whois me :p

I dunno, who are you.

lol
beats me
i just figgured ther was a chance I know you somehow :P
anybody here running php 5.2.4? i keep finding it fails to terminte after receiving end of input on CLI apps and cant tell if its an extension to blame or not

Is there any reason why I shouldn't set PHP_FCGI_CHILDREN to 2 or even 1 for a small server?

where do you live? Manawatu?

nope ^^, chrissy crutch.

I set mine to 2 or 3

what the function name that turns new line into ?

nl2br

are you a chick?

nope ^^

bye :p

lol
have fun with your country blonds

Meh.
Ive got one with a sprog now. Damn it.

1.8GB memory used in FF

I like the sprog but shes a slut.

thanks

why cgi anyway?

Will reducing PHP_FCGI_MAX_REQUESTS decrease memory usage?

not really
its good though, set it to 500 or so

does including cgi add significantly?

does… does what?
Including cgi?

php-cgi vs. php

Oh

add to memory usage

I benchmarked it quite a bit, and its around about 15% slower on my systems.
it will use more memory, yes.

significantly more?

But, the advantage of php-cgi is _security_, in that you can SuxecUserGroup foo bar each php virtual host.
no.

okay, I'll keep it then

if you have a decent server you will be fine.

limited to 128MB D=

:
Thats a bit low.
What is the server for?
How many sites/hits ?

personel box, my own blog + torrentflux

And obviously its not windows, right? I will slap you if its windows.

haha, no way
CentOS

CentOS!

does anyone know php-ajax based admin panel opensource

Yeah we are migrating from that atm :
you should be ok

From that to what?

centos/redhat stuff to freebsd

yeah, I would have gone for FreeBSD, but my host only provides FreeBSD 3.2 ;S

Er… what???

yeah
FreeBSD 3

3.2? You dont mean 4.2 or something do you?

Pretty sure it was 3, not sure about the 2

Tell them to get their shit together.
Seriously. Thats like giving windows 3.1 as an option.

yeah

ul does anyone know php-ajax based admin panel opensource

no.
try www.google.com.

try www.imapathetichumanspecies.com

yay. after much bluetaccing and wire twisting my headphones work again

www.imapathetichumanspecies.com not working give correct path
Macen www.imapathetichumanspecies.com not working give correct path

the channel does not support other scripts
other scripts being 3rd party scripts, I'm tired.

give me 3rd paty links

I suggest you try Google

out of curl, file_exists, fsockopen which one would be the fastest to tell if an image is on a server

on the local server? file_exists

datarecal, file_exists is probably easiest, you do mean a remote server yes?

yes

:|

hmmm can you not go = if( !file_exists($pic)
)

what is $pic?

a url to a file… it works fine without !
but i want if it returns false

hm? that conditional statement will return true when file_exists($pic) is false

hmmm the statement doesnt seem to work at all
http://pastebin.ca/664212

pastebin the code at pastebin.ca

hey friends

returns not

hi all
I have updated php4 to php5, now I get a blank site on my application but no errors, any idea whats wrong?

mysql_query("") or die("broke"); - is there a way to do 'or error' and let the script continue to run? OR ERROR does not work though

what high level library/framework would be advised to use AJAX on client-side (with PHP server-side) ?

afaik file_exists can only be used on the local hdd

so curl or fsockopen then

you need to change your php.ini to show errors, set your error level to E_ALL (for now)

I have error_reporting = E_ALL & E_NOTICE in /etc/php5/apache2/php.ini

i even tried 'or echo "error"'; but that failed

if (!mysq…) else …

I see notice but no warnings.

i see now
thanks

hm?

*but no errors.

link?
yes
why not fopen though?

got it?

loads fine for me
Undefined index: user in /var/www/oze/common/common.php on line 150
turn off e_ALL

yeah, but next page is blank when I logged in.

hm
did you code it?

it must be a error in LDAP_Login() or PC_CheckUser()
but it doesnt show errors.
yes

ok so simply echo 'here'; echo 'here2'; till you find where it stops no?

I could that but shouldnt php report me the errors?

i've noticed that when using curl sometimes the page freezes when the url it's trying to reach is false

with IF, can I match it to multiple conditions, ie. if ($temp = 1 OR $temp = 2) {}
?

and no errors are reported, do you use anything like that?
the "standard" is || for OR

not afaik.

thanks
($temp = 1 || $temp = 2)

"=="

ofc

but I use sessions, could that be the problem?

That would set $temp to 1, try using 1 == $temp to prevent typo's and annoying bugs
no
not afaik

humm

can you output text at all? maybe before session_start (for now obviously)
s/and/and thus

yes that works.

so find out when it stops working
then that's your problem

Does anyone have any idea why this isn't working?
http://www.pastebin.ca/664214
Its not my style of programming
but it is how my friend wants it…
I usually never have problems with file uploading
so this is driving me insane

php.net/is_uploaded_file

with php4 it worked fine.

you have no encapsulation on line 9
php4 ftw

I know, but thats worked before
Its strange, because It isn't working onw
now*

php.net/move_uploaded_file

I'll look at the php dot net link

check server permissions too
$ufile isn't set anywhere

The folder is CHMODed
I know, the funny thing is thoug
though*
I copied

I forgot the php5 ldap bindings. ^^

o/

from one of my old sites
and it worked perfectly
somewhere else
but when I put it here
it doesn't work

you should be using $_FILES['ufile']['tmp_name'] too

false); etc .. ?

you'd need to foreach () { } over the array and do some algorithm work

Okay

i figured as much

why would you want to do that?

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

I have concluded that
$path = "uploads/".$HTTP_POST_FILES['ufile']['name'];
that is the problem
because it returns
uploads/
instead of the filename too
Sorry for my multi line stuff, I'm trying not to wake up people.

anybody familiar with the PHP CLI fails to exit on EOF ? S
uanybody familiar with the PHP CLI fails to exit on EOF ? S/u

Even though they're several rooms away from me, I'd prefer not to take the risk .

how does adding extra characters keep them asleep?

Is it possible to create a variable parameter?
function(${'var' . $number++}){echo ${'var' . $number};}

you're coding in completely the wrong way
variable variables are set with {} though
use an array, eg. $arr[$i]

imme, as Macen said, use an array.
But note that $GLOBALS is an array.

I think it's up to me to decide if I code wrong or right… anyways, arrays are also not allowed parameters

So if you do something like $somestring = "lol"; $GLOBALS[$somestring] = "hello world";

generaly, whether you code wrong or right is up to everybody except you… :/

It will set $lol to "hello world".

depends on what you're coding and for who.

do be quiet

Why?

It tells me syntax error unexepected '[' so my guess is that arrays are not allowed as parameters

pastebin the code at pastebin.ca

You're just jelous because you're not making a BNC in PHP.
jealous*

i see

yes, you see.

hello everybody, anyone familiar with MVC patterns including actions ? aren't actions part of the controller ?

yes

thanjs
thanks
(dvorak J-K error)

http://hashphp.org/pastebin.php?pid=27117 into some kind of recursive algorithm? input array ($arr) can be any length so I can't just uses what I have now.

http://pastebin.ca/664230
^ Macen

phone

I don't really get it.
You don't use $arr anywhere right now.

anybody sleeps every 2 days?

i know..
now i write it out completey
i want to change it so it uses $arr

Im generating an xml-document in utf-8 for a flash-plug to read, but it keeps making some of my characters as "?" instead of the proper char. Where do I start to find a solution to this?

why are you passing an array into a function? use php.net/func_num_args or such. Variables inside functions have a limited scope

okay, thanks.
That's what's called a parameter right?
Or is it called an argument, or both?

Usually an argument.

an argument

But I guess paramater makes sense too.

do be quiet

so parameter is synonym to variable?

Macen, make me.

If you can't help properly don't help at all.

Usually an argument.

Did you send the utf-8 encoding header?

What's the easiest/best way of finding out if a directory is owned by the webserver, with permissions 0700? Im thinking fileperms, then a call to is_readable() to see if the webserver holds the 7, but i appreciate this wouldnt work for other modes, so there must be a better way.

optiz0r, you could read the chmod permissions of the file

which file?

sorry, I mean directory

well that would get me the 0700 but how can i confirm the owner is teh webserver user?

I believe ftp_rawlist gives you the user data

well i know how to get the owner of the dir in either uid or nposix name format
but how can i get the uid/name of the /webserver/ user?

hi. Can somebody tell me the crypted chunk size, if I use 256 bit key with openssl decrypt&
**encrypt

optiz0r, afaik that is apache

meep

lol

in this case its "nobody", but i cant guarantee that to stay the same, or work on other servers

optiz0r, posix_getuid

Perfect. got there at last
ty

Not sure where to ask this question, I'm having problems with suPHP, after installation trying to access a site running it I get a forbidden error with the error_log saying permission denied reading .htaccess (which is set to be globally readable). Anyone know how to fix this?

hi, i use func_get_args to get the arguments but now i would like to pass argument 3-N to a second function. how would you do it?

cjk_, $args = func_get_args (); unset ($args[0], $args[1], $args[2]); myFunction ($args);

Hi

sean`, yes, but myFunction expects them to be myFunction(arg1,arg2,arg3,arg4) i can not change myFunction

how can I post a form without sending the parameters to the url?
thanks

cjk_, are you getting the data from myFunction also thru func_get_args?

logik-bomb, use a raw socket.

In that case I don't see a problem just assigning an array to it, as func_get_args also returns an array

(^-^)

sean`, no, ok i see where you are getting at
sean`, thanks, i think i will figure out now

another optiojn would be eval.. but I believe my way would be better

sean`, yes, i do not like eval

If you're worried about messed up keys, you can always use a sort method to re-arrange them

^-^

anyone here know about suPHP?

can anyone recommend a very lightweight php VC (no M required) framework?

just use a MVC framework and don't use the Model part of it :P

sure, of course - but I want to find something that is simple.
I tried Codeigniter, but I found a few issues with it. Something along the same lines would be great.

"open source php framework"

yeah, I know about google, but there are hundreds of them and every tom dick and harry seems to think they can write an MVC framework, but most of them are bad.
byeah, I know about google, but there are hundreds of them and every tom dick and harry seems to think they can write an MVC framework, but most of them are bad./b
So I was asking if anyone could *recommend* a framework, not a search engine

well.. define lightweight, what are you exactly looking for

sean`: something with controllers, views and layouts. don't need helpers or advanced routing, but partials would be nice.
sean`: i'm not going to use the model layer (we have our own).

sean`: know of any workarounds for posix_getuid if posix is disabled?

well.. if you have your own model layer, create the vc yourself too?

sean`: sigh. yeah, ok.

You're asking a lot, cause you want just 1 bit of something..
You have 3 options.. 1 hopelessly continue on your search, 2 find an MVC and port it to your model layer, 3 write it yourself
optiz0r, hehe… stupid me :p
php.net/fileowner
I believe that also works for directories

yesyes i want the APACHE user :p
which you suggested posix_getuid
but posix is disabled

try out the fileowner function, it'll work out I think

how?!
itll get me the owner of the directory

yes

i want to check that the owner IS the apache user

ow yeah sorry
my mind isn't clear, I'm thinking about lunch :p

I would be, but i had a yoghurt 20mins ago

I'm not familiar with an alternate option

right ok. nasty haxhax itll have to be

optiz0r, quit while your ahead
doing any sort of proper file ownership with PHP is painful
unless your app is just for you / company

it is yes, but i cant guarantee they wont change something and break it after im gone

retainer
:d

i need to forcibly check the directory is only readable/writable by apache
student intern, so such luck

hmm is_writable is the lazy way
is_writable is_readable

doesnt check that someone *else* doesnt have read/write

oh only

i think compare perms to 0700, then check is_readable
only works because go perms are 00 though

optimus-prime, you could also just chmod it each tijme to 0700 :P

optiz0r, just use fileperms($foo) i guess

is there a way to do addslashes just on double quotes?

why wouldn't ther

well it's done, but i cant say im proud of the method

howdy

ScottMac, sean`, thanks for the help

jessy_, assclashes($foo, '"')
err addclashes lol
thats almost bash worthy

LOL

addslashes() doesn't have a second paramater :P

ScottMac, whats on your mind?

thx ScottMac

AlexC_, addC
http://www.php.net/addclashes
http://www.php.net/addcslashes
bah
jessy_, go look at the URL above I can't type today
rza, morning

ahhh thought it was a type
s/type/typo

ScottMac, it's exactly what I need
thank you

i wonder if the bug occurs with the version edink compiles against
if not, then im clueless

rza, you can get the version edin compiles with
http://files.edin.dk/php/win32/zip.zip
thats his php_build directory

does that include the libs?
propably

how can I access an array index from an array, that is returned by a function - eg: $foo-getBar()[0];
bhow can I access an array index from an array, that is returned by a function - eg: $foo-getBar()[0];/b

been having fun time compiling on windows

yeah

its such a joyfull task

it includes stuff for every extension
rza, tell me about it

took me like two hours to just compile my test program

Enigma, $arr = $foo-getBar (); echo $arr[0];

ended up having weird crashes

you need to unzip the php_build directory in the one above the source

You have to assign it first to a variable.. PHP is not that far yet :p

rza, that may be a bug

sean`: and in one statement?

Enigma, $arr = $foo-getBar (); echo $arr[0];
Thats the only option you have..

there must be a workaround
this is a bug!
or an unsupported feature as they would call it

Enigma, the parser doesn't support it
the end

-.-

haha

Enigma, we accept patches

hmm bugs.php.net accepts forms

though people who want to play with flex are most likely insane

I think PHPshould have stuff like that implemented in PHP6 though..
$foo-bar ()[0]..

though people who want to play with flex are most likely insane This says a lot about /me/ tbh

but on the otherside.. it makes you more lazy

Enigma, there are bugs for your feature already

LOL, just got scared by my printer

http://bugs.php.net/bug.php?id=32153 - can you please vote for this bug?
_all_ of you

I'll bogus it for you

func()['foo'] looks ugly as sin

does ruby look better ?

plz provide link for ajax scripts

www.google.com

._:

It's not a bug.

ScottMac:
why am i getting linker errors when all needed libs should be included ?

And it's there since 1 Mar 2005 for a reason.

"or an unsupported feature as they would call it"

Enigma, I bogussed it for you

hello earlier today I asked something but nobody replied, I want to try again, maybe someone that knows the answer woke up or something … I want to know is it possible for the user to change the $_SERVER['SERVER_NAME'] variable ? I mean with browser request for example (not from inside
PHP)

yw

error LNK2019: unresolved external symbol __imp__MagickWandGenesis referenced in function _main
something like that
isnt that like implicit declaration?
all headers and libs are included

Its not my bug I found it while creating a new one

how can i encrypt/derypt (password protected) files using php ?

Well. tbh, I don't find a feature like that usefull. You only get one element of the array this way. You could just return that one element.

With hawt nekkid faerie gnomes.
Be concise.

Gnome rules.

but if you want the first row if an database result: $db-getAll()[0] would be a great feature

here goes away my question :-/ damn netsplit

$db-getFirst FTW :P

Yea I also have this function, but give me one reason good why it should be possible?

how can i encrypt/derypt (password protected) files using php ?

is the $_SESSION['uid'] created automatically or do i need to make it myself?

afaik that's not created, but you can get the session id with session_id()

ahh ok thanks

It has been there "open" for two years.. for a reason.

..

.. == "hello"? :P

foutrelis no ..= "am I connected?"

hmmm I'm not sure :P

have you figured it out already?

ok I'm not funny.. somebody please shoot me

payback for scratching my framework ^^

AlexC_ damn! you are faster than me

ha!

AlexC_ i was going to shoot him

hello

still can ^^

And now I'm crippled for life..

meh, it's only a flesh wound

i am trying to compile php 5.2.3 on RHEL4
error: Cannot find libmysqlclient under /usr."
Cannot find libmysqlclient under /usr."
i use –with-mysql=/usr/lib64/mysql
which libmysqlclient is it looking for?

oh let me play Trinity :P

damn matrix

ehm.. that sounded kinda of.. erase that from the logs plix

do i need to give another option?

lol ^^
do you have mysqlclient installed?

AlexC_, yes, of course

s/kinda\ of/kinda/ O_O

hum, interesting

Is there a function to reverse the lines in a string? (ex: line3 = line1 & line1 = line3)

earlier today I asked something but nobody replied, I want to try again, maybe someone that knows the answer woke up or something … I want to know is it possible for the user to change the $_SERVER['SERVER_NAME'] variable ? I mean with browser request for example (not from inside PHP)

LES BURP
[dev]Viper: it can not be injected, but it can be partially manipulated if there is server misconfiguration

AlexC_, http://pastebin.ca/664303

install -dev

192.168.0.51, test.com\'" magic quotes ?

[dev]Viper: WTF

print_r($_SERVER) ?

MikeSeth, MySQL-devel-5.0.45-0.glibc23

[dev]Viper: what server does that?

is installed

apache, all versions

no, Install libmysqlclient-whatever-dev

PHP 4 and PHP 5
I don't know if I found a bug or this is supposed to work like that

[dev]Viper: never saw it do anything like this. SERVER_NAME should correspond to the ServerName setting of the server or the current vhost

I wonder if I should report it to bugs.php.net

[dev]Viper: you should check if theres a bug like that first.
it does look like a bug, but might as well be bizzare problem/conflict in Apache
in fact, are you SURE you dont have the same values in your Apache config file?
ahh gottficken

I am setting those values from a PHP script use CURL to make the request

how can i encrypt/derypt (password protected) files?

bye all,

nope

MikeSeth, this doesn't seem to exist on Redhat
for SuSE, there is libmysqlclient-devel-5.0.45-2.1.x86_64.rpm
and also for Mandriva

Hi! A friend of mine (windows user) has started learning PHP. He is a very novice user and used to the IDEs / GUIs. Would you please recommend an editor? I would like it to be cross-platform open source.
Thanks

what?

anyone here use imagemagick?

I use Dev-PHP. It's interface sucks but you can get used to it.
There are other editors. I suggest you try a few.

Jafet, but it is only for windows, right?

I think it's cross-platform.

Jafet, I'm on linux and I don't really want an IDE for php. But my friend is on windows. And I want him to use an editor which he can later use on linux also (if he migrates )

IDE for php? Zend?
Zend Studio - for Windows, Linux..
It's written on Java, so it's multiplatform

Asmos, not free

hi
is there some easy way to print out the contents of an array, if u do not know the name of the elements?
e.g. I say: echo $test; and get "array" printed out
i want to see what is in that array

print_r($arr)

thanx

np

it prints out "Array ()" what does that mean?

That it's an array.
php.net/array

oh… got it… it means there is nothing in the array! got it…

"hi" ) for the others

thanx everyone

unserialize() [function.unserialize]: Error at offset 0 of 1 bytes in

Syntax error on line 101 of /etc/httpd/conf/httpd.conf:
Cannot load /usr/lib/apache/libphp5.so into server: /usr/lib/apache/libphp5.so: undefined symbol: _zval_dtor_func
i tryed to google on the error but found nothing similiar
php4 works fine..

d

the used php5 version = php-5.2.3

welcome back everyone.

wasn't it us that left?
Since we're the minority, of like 90 or so, and now everyone's back and it's over 400

hi, can i retrieve 'someString' from 'script.php?someString' ?

You can't.
I think

kh2803, $_GET['someString']

Comments

hi on a JTable i have setAutoResizeModeJTableAUTO_RESIZE_OFF and then TableColumn col = thisgetColumnModelgetColumnindex

ewwwww
crystal reports?
that shit sucks
and that ad has it TWICE
that's like twice the sucky

9$ for?

Heh - efnet #java also is "no applets"

I have core java 2

Look for any place that has Kronos TImeKeeper, PeopleSoft, Sap Portals or whatnot else.

is this a good one?

actually it has everything twice
oh

crystal reports are cool. extremely powerful database reporting tool. they also have a java web host version now.

I don't mind Crystal that much.

dude it sucks so bad
are you talking about crystal clear?
that is the biggest piece of shit ever invented

More to the point, though, I'm looking to do the analysis and user interaction part.

db+language+db driver=good report tool

:-)

i donno what baan is
but i hope it's not like CR

hello …I am new to Java ..and I am confused by all the different combinations and versions in downloads …is there a website that clarifies all of the different versions?

I think where you have the most of those type positions are in ERP type environments.
java.sun.com

just get the latest which is 1.6
sometimes called 6
java jdk's are named stupidly

have you considered ibm?

Global Consulting might be something.

No, I have not, but I wouldn't mind working for them.

if I download JEE 5 ..will I get 1.5.0?

they have a strong consulting/analysis arm

you'll probably get 1.5.x

If you are new, I do not think you need the EE just yet.

whatever the largest x is
but you should get 1.6

plus excellent long-term career prospects

I beleive it is required by JBoss?

i read you wrong
you want J2SE
JEE is soemthing different

by downloading jboss, you download a reference implementation of J2EE
JEE is a spec released by sun. jboss is one implementation that sun approves of.

tapestry is good suppoedly

g[r]eek: the jboss docs say that I need jdk 1.5.0_x ..what should I download?

jboss is owned by redhat watch out

i think that's only a web framework

jonas is free

"jboss is owned by redhat watch out" - what's your point?
the latest jdk.

it will become similarly annoying

I have read about Jonas ..but I have not found any web hosts that run it

sort of closed source

1.5.0_x is the minimum requirement.

and support for it +JTA runs 60k per year

that's retarded.

thats me point

g[r]eek: appearently ..JBoss 5.0 does not run on 1.6.0

tapestry seems good

jboss 5 is still in beta, stay clear of it in the mean time.
also, there is a #jboss

g[r]eek: the reason I want to use JBoss 5 is because I am having trouble getting EJB 3 features to work on 4.2

well in that case #jboss and / or the jboss forums are your best bet.

g[r]eek: 4.2 does not claim to be completely EJB 3 compliant

i don't do much ejb development and thus am in no position to comment.

http://www.springframework.org/
this is supposed to be pisser too

what do you mean by pisser?

wildly awesome
its a boston expression

we dont user that in Ohio ;-)

riddle: what's round on the side and high in the middle?
*side

kurzweil4, good syhtn sound man

*sides ffs

g[r]eek: a tractor tire?

a rhinocerous?

ohio…

hehe?

wanker!
is anyone here not a high school student?

me

does anyone here make 100k like me
or better yet 200k?

rephublykan, are you always a retard?

I need to make 500k
atypical are you always insulting people you dont know?

Only the asses.

you must live with mom
get out more

No, but I think she would agree with me.

you should try to cute your expenses ;-) ..if you can't live on 100k ..then you may be spending way too much money

I'm done, joed. Sorry.

*cut

I slap excess in cgmfx

you are doing just fine.
~g[r]eek++

g[r]eek has a karma level of 5, joed

bet you don't say that to a manager every day

I tend to do

lucky

If they are managers in the right company.

anyway i'm out

you come right with your email bug?
i never got cc'd
anyhow, catch you around

if I am familiar with OO programming …is it enough to learn Java just by reading the documentation on Sun's site?

enough for what?

yes, but there are lots of tutes around too

yes
javabot tell kurzweil4 about rbi

kurzweil4, rbi is http://java.sun.com/docs/books/tutorial/reallybigindex.html

also see thinking in java by bruce eckel

where can I download the API docs?

enough for programming …I have been programming with multiple other languages for years

I can't get much done if my internet connection keeps dropping every minute

Say I have a string in system.in that is "1 2 3" is there some function that will read the next integer in the stream and knows it is seperated by whitespace?

eckel's stuff is good

check the String api for the split method

Hrrm. I'd rather read it right out of the stream

javabot tell Optikal__ about Scanner

Optikal__, I have no idea what Scanner is.

javabot tell Optikal__ about javadoc Scanner

Optikal__, I don't know of any documentation for Scanner

o.o

thanks for the help guys ..night

then generally speaking, yes, it's just a matter of familiarising yourself with java's api. but as r0bby pointed out, rbi is really useful.

er…

how can javabot NOT know about Scanner?

~javadoc String

I don't know of any documentation for String

What has the world come to when robots have to tell me what to do =(

I think cheeser's javadoc stuff is _BORKED_

g[r]eek: I bookmarked that RBI link ..it looks great

http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html

see Scanner

there you go

Yeah that's what I'm lookin for

he might want to see java web hosting 6's version, i'm not sure if there were changes.

http://java.sun.com/javase/6/docs/api/java/util/Scanner.html

~javadoc java.lang.String

I don't know of any documentation for java.lang.String

yes.

yeah i ddnt read your question fully the first time

~javadoc: String

I guess the factoid 'java string comparison' might be appropriate:
http://www.leepoint.net/notes-java/data/strings/12stringcomparison.html

g[r]eek: cheeser is switching it away from the database.

lol

ah

s/database/XML file/

can I *download* the API docs?

sure

javabot tell PovAddict about download

PovAddict, download is http://java.sun.com/javase/downloads/index.jsp

there.

ah found it

nice. i was busy finding the link

52MB…
hope my net stays alive long enough

which country?

~tell g[r]eek about javadoc string

g[r]eek, I don't know of any documentation for string

:-o

Argentina

r0bby, did you fuck it up again?

i remember when i ifrst learned java i thought it would be helpful to print the javadoc for String

[krustofski]: i was just checking if javabot was working

it was really long, and it was not helpful

my net has been working really bad all day

~javadoc system

I don't know of any documentation for system

~javadoc integer

I don't know of any documentation for integer

here in south africa we have to deal with a telco monopoly, ie: terrible internet connection every now and then with crazy fees

[krustofski]: I didn't touch it.

Is anyone here Sun certified and did it help?

[krustofski]: Javadoc stuff is handled in a seperate operation (plugin)

g[r]eek: there's no monopoly here; but all ISPs are just as bad :P

it certainly helps get your foot in the door in certain companies. but there are mixed feelings about its value

8% docs download…

[krustofski]: cheeser is in the process of converting them to use a database table.

nice quite message

~cheeser

[krustofski], cheeser is a crazy fella…. http://img523.imageshack.us/img523/941/cheeserjk7.png
[krustofski], cheeser is a crazy fella…. a href="http://img523.imageshack.us/img523/941/cheeserjk7.png"http://img523.imageshack.us/img523/941/cheeserjk7.png/a

hahahah

r0bby, my images are scattered everywhere.. good luck :P

I know.

http://beerwench.net/fn-java/

_

I think you worry too much, write something interesting, join some oss thing, consult and things will start happening. Networking is a good thing.

OK
And I agree I worry too much. I think it paralyzes me.

and does that worry you?

What do you have to loose?

or even to lose, for that matter?

nm

Heh.

I don't have anything to lose. It's totally a mental thing.

Be nice to your IRC buddies.

pr3d4t0r, all but you. ;-)

You never know when one of them may offer you a job.

is there any IO thing that lets me read until a certain terminator?
uis there any IO thing that lets me read until a certain terminator?/u

heh

listen to pr3d4t0r

preferably an InputStream, not a Reader
if not, then I'll have something keeping me busy for a while

What's wrong with an if statement?

huh?

if(scan.next().equals("#")) { // done "}

use a condition to stop reading

that.

hmm
imagine I want to read a string till a newline
it's not really a newline; but you get the idea that way

BufferedReader.readLine().
go look it up.

it's not a newline

you're not being clear.
WE TOLD YOU
if statement.
while(!scan.next().equals("#"))
there.

I'd need to read one char at a time, appending to a string, and if(c == '03') stop

there is a saying in business - "analysis paralysis" - don't be overly concerned with making the right decision. just make a decision, and then make it right.

while(c != '03') { // read }

Does someone in here have a script that allows them to easily upload screenshots to their website. maybe a python script? someone I met in an IRC room used it a lot and I can't remember where/who it was. Thanks! (sorry this is OT but I'm trying to find this person in question…)

g[r]eek, I like that. :-)

that will be $75.

I looked at readLine sourcecode and it was complex… to be able to handle \r and/or \n and other crap

where can i get a bigge integer?

64-bits not enough?

anyone?
no

BigInteger
http://java.sun.com/javase/6/docs/api/java/math/BigInteger.html

thk u

I JUST TOLD YOU
what'd I do

~tell r0bby about caps.

r0bby, http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=hawkingcapslock - check this out.

"if statement" is the most ambiguous (and unhelpful) answer ever

oh,
while(c != '#') {}
i can't get any more specific than that

that's the part I know already

for christ sakes

hey pr3d4t0r you like cats right?

then you keep reading in that loop

PovAddict, then what don't you get?

g[r]eek: Love 'em.

make a few tests, keep reading, keep parsing.

http://imagebin.org/9833

I'm *REALLY* losing my patience; use an if statement or the loop as i gave you.

String result=""; while(c != '#') {read another char; result+=c; } - won't that be stupidly inefficient?

javabot tell PovAddict about write dumb code

http://java.sun.com/developer/technicalArticles/Interviews/goetz_qa.html

stop prematurely optimizating
and yes, use StringBuilder.

Dude, chill a little.
Give the guy time to *think*.

I did, he came back with the _SAME_ question

We had a ##java board of directors meeting today and we're considering silencing you for a while.

no

Yes.

I'll behave

ok a StringBuilder makes it a lot better

I haven't been bad :/

It doesn't matter when we come in, day or night, you're spamming the channel. It's gotten to the point where nobody takes you seriously or they leave the channel or put you on /ignore.

pr3d4t0r, any motions to bring back my buddy whats_in_a_name?

I was pleading your case *for* keeping you around thanks to y our contributions to the wiki and overall helpfulness, but you're kind of getting on everyone's nerves.

I'll take a break, and stop being so verbose

heh

Please. I like you. And I believe that you have a lot to offer to the channel.

may I pm you?

No, I'm going to take a nap now.

I wouldn't consider r0bby's behavior bad enough to deserve a ban, but I'm far from being a channel regular…

I apologize for being verbose

He's chilling a *lot*.
You should've seen him a few months ago

should I? :P

a few months ago I would have _KILLED_ you.

:o

You know, he's right in what he says in many occasions.
He just needs to set his emotional regulator on "cool".

well, using a StringBuilder makes the "obvious approach" a lot less stupid… and that's not "premature optimization"

PovAddict:
Don't feed the trolls.
Try phrasing your questions in the form "I tried X, expected Y, got a Z instead. How do I modify X?"

tube cat?

yeah I have read all of "How To Ask Questions The Smart Way", and I admit I didn't follow much of it here

g[r]eek:

pm for a sec?

It's just common sens.
Er, sense.

So, where do I look to find out exactly what a java.lang.NoClassDefFoundError is?

it means it didn't find the class in the classpath
simple as that

did you do: java MyClass.class ?
java MyClass.class ?

r0bby, no, using eclipse, writing plugins, a view won't load, I look at the details and see one

ah

Could it indicate that something's wrong in the java?

yes

g[r]eek, Do you know what sort of thing? I only can find the "you're classpath is wrong" defn

it is a generally accepted fact (word of wisdom) that it is best host to avoid using IDE's (eclipse is one such IDE) until you have a comfortable grasp of java basics.
understanding how the classpath hosting works in fundamental to understanding java.

~g[r]eek++

g[r]eek has a karma level of 6, Fanook

g[r]eek, I can relate, but I wasn't given a choice
g[r]eek, it was thrust upon me that I'd be writing plugins for eclipse with eclipse and subclipse

that's unfortunate. do some research. in here, you'll get quick definitions and help with actual java coding problems. don't expect to be taught java101 though
this might help: http://java.sun.com/docs/books/tutorial/essential/environment/paths.html
also, regarding eclipse plugins and the coding thereof, try ask in #eclipse

g[r]eek, I know, I guess I was just looking for 'look over there' sort of comment; NoClassDefFoundError's explained on google seem thus far to be all connected to running from a CLI; and I guess I'm surprised because its listing the problem with a jar/class I didn't even write

and bookmark this link below
~tell Ktron about rbi

Ktron, rbi is http://java.sun.com/docs/books/tutorial/reallybigindex.html

g[r]eek, thanks

no problem. good luck.

g[r]eek, I'm sure its something simple, it'll just take time until I figure out what obvious thing I missed

configure build path) or you need to include it in your classpath in your build.xml (assuming you're using ant to compile your plugin)

g[r]eek, yeah, I found it, it was closer to the latter than the former
g[r]eek, I forgot to update the classpath in the… plugin.xml I think for the project

make a note somewhere of the lesson you just learned. i keep a notebook where i write down everything. it helps

g[r]eek, Moleskine, squared paper, reporter, already done

g[r]eek: wanna advise him on table manners while you're at it?
when to use the salad fork?

~lart vinse

I guess the factoid 'lart' might be appropriate:

ls -lart

wrong window, genius

;p

lol

I tried :P
Heh, I think learning java is easier than learning Eclipse sometimes

hence the advice to start w/o and IDE … that way you dont have to learn both at once
and learning eclipse is much easier if you already know java
s/and/an

indeed

vinse, I've done _basic_ java w/o an IDE, I've never done advanced (read: multiple files) java, and I've never used an IDE before

in any language?

brb

vinse, in any language.
vinse, SciTE, Notepad++, and vim with directories wheeee!
You have no idea how exciting it is for me to be able to refactor or see call hierarchies

if you find yourself missing vim there is a viplugin for eclipse
it's not exactly the full feature set, but has a lot of the essentials

jEdit is also good; if you're using windows, you can use Textpad (it's awesome for newbies)

like s/regex/replacement

oh, and g[r]eek, for your amusement, I think my favorite java note so far is 'ALWAYS have a *.next() INSIDE an for for an iterator!'

you arent using java 5 or 6?

vinse, I was shown earlier today actually… I'm thinking about it, I've been trying to to decide what functionality vim offers that I'd be missing
vinse, I'm using java 6

and now to give IDEA a test by writing a shogi game

then use enhanced for loops instead of that whole klunky for-with-an-iterator

r0bby, used to use jEdit then switched to Jext (which I liked more), then down to notepad++ when Jext was becoming webstart-ish, and then from that to SciTE when I'm scripting/writing PHP (though maybe I'll try the eclipse php IDE)

i'm stuck in java 4 personally cuz of work, but i'm pretty sure you never have to use that construct in 5+ … some one can confirm?

vinse, I'll have to look it up

you can't use the foreach to alter the list, as you need a reference to the iterator to do it without invalidating the iterator

vinse, It's been forever since I first started to learn java, so I'm sure I'm outdated and a half… after I make it work I'm promised a code review (I'm an intern) to point out the better ways of doing things
bvinse, It's been forever since I first started to learn java, so I'm sure I'm outdated and a half… after I make it work I'm promised a code review (I'm an intern) to point out the better ways of doing things/b

but you cant use for(Iterator i = collection.iterator(); … in that case either, can you?
http://java.sun.com/j2se/1.5.0/docs/guide/language/foreach.html

sure you can. assuming the iterator you get supports .remove()
granted, in most cases you're better off with the listiterator(), but the same limitation applies.

syntax in places too… let's see if I can figure out why I used an iterator there…
syntax

For example, if a thread modifies a collection directly while it is iterating over the collection with a fail-fast iterator, the iterator will thow this exception.
that's from the ConcurrentModificationException javadoc, that doesnt contradict you?

dude, JetBrains is czech? i HAVE to buy it now
that's why you use iterator.remove(). using collection.remove() invalidates the iterator. the iterator's remove doesn't

oh!
i didnt realize there was a distinction

fail-fast problem?

no just a general discussion

oh

although i really like the phrase "fail-fast"

hi, on a JTable i have setAutoResizeMode(JTable.AUTO_RESIZE_OFF); and then TableColumn col = this.getColumnModel().getColumn(index); col.setPreferredWidth(300); but this doesn't work, why?

so with foreach can't remove iterated items?

maybe because i define the table headers (the name of the headers) on the table model?

mefistofelix, same problem you see with ordinary iterators
~javadoc ConcurrentModificationException

I don't know of any documentation for ConcurrentModificationException

javabot's javadoc is currently down for maintanance
check with r0bby

Yikes.
I guess I'll have to put javabot on ignore now too.

he knows more about what's going on
bbl

Heh

with foreach can't remove items, with ordinary iterators you can seems: http://java.sun.com/j2se/1.4.2/docs/api/java/util/Iterator.html#remove()
what TreeModel is suitable for a remote filesystem?

cheeser made some major changes

anyone could give me a quick pointer to debuging java started from an ant build ?

do you mean debug in the sense of using a java debugger? or figuring out why something in ant failed?

java debbuger
the class is being executed, but it's failing
so i want to debug

http://forum.java.sun.com/thread.jspa?threadID=655217&messageID=3851518

thanks, that should help

the wonders of googling for 'jdb ant'
took me all of 2.5 seconds.

ew, why

how do i split on the pipe character?

because the environment variable for the current host and other tidbits is different depending on what os it was built on.

i'm trying to split a string whenever it finds a pipe.

~tell rawbdor about stringtokenizer

rawbdor, I have no idea what stringtokenizer is.

bah

~tell Ragnor about String.split (*)

Ragnor, I have no idea what String.split (*) is.

http://www.google.com/url?sa=t&ct=res&cd=1&url=http%3A%2F%2Fjava.sun.com%2Fj2se%2F1.4.2%2Fdocs%2Fapi%2Fjava%2Futil%2FStringTokenizer.html&ei=TRy9RqOeGoXeeqHR2f0K&usg=AFQjCNHbhuaL5txFoOwVk98poofKjuha3A&sig2=RZwCF1mHInr2thZoi6Mj7A

~tell Ragnor about javadoc String.split (*)

Ragnor, I don't know of any documentation for String.split (*)

oh fine.

i know about string.split

"\\|"

but for some reason… "ls".split("|") is returning { ,l, s}
ah thanks ojacobson

condition property="is.windows"
is that actually a valid property that atn sets?
ant.

not on its own

didn't think so.
ohhh

The bigger question is, why does the hostname matter at build time (rather than runtime)?
Or is it just "was built on X"

but

javadoc String

condition os.family="windows"

~javadoc String

I don't know of any documentation for String

javabot has apparently lost the api

I guess the factoid 'hashtable hashmap' might be appropriate:
The only reason to use Vector is for compatibility with Java 1.1, and 1.0. Otherwise, use ArrayList. If you need an internally synchronized version (if you don't know what that means, you don't need it), use Collections.synchronizedList(new ArrayList()); (The same applies to Hashtable and
HashMap, entirely analogous. Hashtable is old, HashMap is new).

javadocs are down for now.
It it so you can socialize a little.

task. For example, ${os.name} expands to the name of the operating system."

you mean with the rest of ##java or are you dropping hints that we're spending too much time on irc :P

ojacobson, handy.

Or talk instead of exchanging Javadocs?

~javadoc Topic

I don't know of any documentation for Topic

and, note?
the ant docs?
really suck.

You haven't used maven, have you
anyways, conditionos family="windows //condition

yes, i know that

you never read all of bettarz buildz forz mavenz?

but i'm tryng to figure out how it works. of course there's no example.

I can't deal with mergere hornblowing

Tells you all for only 9.95

do you want me to cook up an example that echos COMPUTERNAME on windows and HOSTNAME on not-windows?

ojacobson, nah, i'm no it, thanks.
er
i'm on it.

bit late now since I Get it

~tell bearded_oneder about away

bearded_oneder, We don't care if you're afk, having a shower or doing your wife. If we really want to know, we'll /whois you. So please disable any public messages your client sends when you go /away or come back.

wow. you guys are nice here

they're amazing

/AWAY doing my wife
hrmm… that didnt work

i'd say the worst docs (re convo further up) are jboss's

agree

i'd have to agree

in terms of the amount of documentation being proportional to size and popularity of package

but then jboss doesn't (or didnt?) have a huge amount of peopel able to write hte docs
before the rh buyout of course

writing good documentation is a necessary skill worth investing in

heh

"professional open source" :/

i work for jboss on eclipse plugins

I thought eclipse had more plugins than it could load?

yeah but we're determined to give it that much more

Oh… A Shiny clock.

and an mp3 player

swirly tabs :P

lets throw in a bit torrent client

How about fixing the memory problems in WTP?

Email!

heh… ugh. i work with wtp all day :-( some horrible stuff there

just make it an os. qed.

No shit.
~rawbdor++

rawbdor has a karma level of 2, joed

For the suffering.

laugh… i was wondering what that was for
its just so over-engineered
i bet you could make a slimmed-down wtp and make it 1/8th the size

Well, it is the reflection bits and rescans of changes to JSP that really kills it.
Just my .2 though.

twenty cents?
christ. talk about inflation

Yeah, I'm feeling good.

for a fine example of hyper-inflation, take a look at Zimbabwe (our neighbouring country)
i've never used wtp. any benefits that make it worthwhile?
and please don't give me ~tias

To me, no. But then I used Eclipse for a long time and swapped to that other IDE

intelliJ
?

Yeah.

the benefit of wtp was that it supposedly made things easier… unifying projects with servers and runtimes, deployment, classpath, etc
but really i dont enjoy it

inspections, xml, JSP, JSTL, EL etc
it boiled down to a solid disk light for me.

the worst part is they unify it all together and make it all interdependent
so you cnt even just take one part of it
its practically all or nothing

Yup.

if they made their jsp editor separate from the rest of their editor framework, that'd be great

oh well. i guess if i don't know why i need something then i don't need it.

g[r]eek: probably. heh

Well… If they even caught servlet errors in web.xml that'd be great.

yay. conditionals and properties setting right.

WTP projects have a flexible projehct structure… which basically means huge overhead no gain

i don't use any plugins regardless. i just enjoy eclipse because i've learnt all the keyboard shortcuts. it's cool not needing to move my hand over to the mouse every x seconds.
have you guys used MyEclipse at all? i hear good things about it

g[r]eek: my eclipse steals half of jboss ide
or jbosstools
they just take our code, and embed it in their stuff
they just repackage it. shrug

Which is more nasty.

they dont even deny it

that's not fair. they sell myeclipse

i wasn't happy with wtp when i first used it. but that was 1.5yrs ago. it wa sbuggy as hell
now i do easyeclipse whcih has jbosside embedded.

hey eidolon =]

hey.

=/ why for?

because of the "oh, we're stopping supporting jbosside because we're using whatever the hell the new tool is. oh, in the meantime, we'll put out jboss 4.2. which jbosside doesn't support. oops, sorry, the new tool isn't ready yet. so sorry!

it must be difficult managing such a large and complex project that is jboss

svn has supported 4.2 for a while

oh gee
that's fucking wonderful.

heh ok seems i touched a nerve
sorry =/

"you can download and compile and install this tool, we dnt' support svn builds, and it's not int he packaing updater. but we hax0red our svn to match it."
http://planet-geek.com/archives/003938.html
there's my post about it.

smile - http://beerwench.net/fn-java/

the exadel team seriously had no idea what i was working on
*they* didnt support 4.2
my plugins did
im sorry i didnt hear your gripe before

so why didn't you release a new version of he ide when 4.2 came out?
you -knew- that it didn't support 4.2
you patched it in svn
you knew exadel wasn't out yet.
and it didn't support 4.2

i knew the released one didnt, right. but i cant just go making releases left and right

so users had no choice.

we're not little old jboss anymore
we're ruled by corporate overlords
who do things based on marketing timetables

ah. so the aquisition of jboss by redhat means that support suffers, releases suffer, and things that are 'current releases' may not work with each other.
spiffy.

Hehe

heh… calm down, friend. no thats not what it means

tha'ts a ringing endorsement for your company.

it just means we have to reorganize a little for now
our entire build system went out the window so we could create a new one.

it's been -two months- since that post.
have you put out a patch to jbosside for 4.2 yet?
has exadel released their new workbench?

give him a break, he came here with good coupons.

you guys are cranking out 4.2 releases.
i -reallllly- want to support jboss.
really
but shit like this makes NO ONE want to work with them.

when you acquire a codebase twice as large as yours (exadel) you have to integrate them
you cant release anything until its integrated

otherwise you're releasing crap

let me ask you something.

sigh

how complex is he patch to jbosside to support 4.2?
it's 2 lines.

eh and a couple of jar changes yeah
but yeah you're right

and it's in svn, and it works

trivial mostly

why isn't it released?

because in the past two months we had no build system
none
zero

you have, on your site, right now, two releases of your main product that do not work together.
period.

Oki…. PM time?

ant build foo.jar

wasn't allowed

scp foo.jar jboss.org:/var/www/jboss/downloads

Oki…. PM time?

"Redhat's policy is to deliberately keep broken versions of their products available for download."
"Versions they KNOW are broken."
joed, this is hardly off-topic.
there are plenty of people who use jboss.
and until recently, i was a booster.

No, not at all, but we do not need to bash one person for the fallacies of redhat.

i dont know what to say. i was not empowered to put a build up. i was not empowered to publicize it or anything. simply not allowed. then we transitioned from wtp1.5 to 2.0, and that meant any patch i made would not have even been applicable
in the future i assure you older releases will get maintaince builds

if rawbdor is happy, I'm happy, and I feel your frustration.

but as this will be the first release of "JBossTools" and "JBoss Development Studio" *they* felt it was better to focus on the first release than on backwards stuff that was not forward-looking

i'll stop here, because joed's point is valid. but understand that me, as a jboss user, is having a hard time greeting the constant phone calls from Redhat salesdroids asking for a $15,000 support contract for jboss, when the one tool that we -totally depend on- is now orphaned, with no
release in sight for it's replacement.

it is sooner than you think

you get calls from rh sales staff?

rawbdor, i don't have animosity toward you, but i'm tired of jboss promises. i'll see it when it comes out, i may even try it, then i will most likely move off it.
yes, i do.
i even have 3 jboss t-shirts.

how come?

because he love(d) us

i made the mistake of asking them for pricing information.

have you already signed up somewhere / somehow?

because we needed ot know what spport contraccts would cost.

sigh

that's bad news for jboss.

a helluva lot)

fwiw, we use 4.0.5ga, and haven't had the need to upgrade. so we don't

anyway, yeah, i flyoff the handle a lot, but this whole situation was annoying when i raised it -two months- ago. i'm doubly annoyed that it still hasn't been addressed, even though jboss has released a patch to 4.2 in that time.

very stable release

4.0.5 has an -abysmal- memory / deployment handle leak in it.
try deploying a large app to it about 20 times.

take a deep breath.

you'll OOM.

lets keep rawbdor here listening.

heh. i just write tools

Well, you can feed back input.

do you know dimitri personally?

g[r]eek: no. i've had a few emails with him but i don't do much in the app-server group. i stick with the tools group for now
g[r]eek: i think he's a PM now.

he was the AS lead correct?

g[r]eek: yes
i kinda wish i had gotten involved back in the day but i was young =]
in college

are you employed by redhat full time?

g[r]eek: yep

work from home?

g[r]eek: heh… most days yeah.
g[r]eek: there is an office in manhattan but almost no one's there except some 21 yea rold interns

heh

we have yet to experience an OOM situation with 4.0.5 - i'll be sure to make a note of it though. we haven't exactly had the need to deploy larger than average apps
and in all fairness, we're jboss noobs (using it for around 8 months now)

g[r]eek, the size of the app may not be the issue. it's the deployment. we run hourly builds, and we could kill jboss in 12-14 hours.

its probably a classloader thing. (i'm seriously not familiar with it but i imagine thats what it is)

it was fairly well documented.

every redeploy probably holds on to class references from the old deployment and forgets to clean them up

hmm that's definately not good

4.2 fixed it.
(heck, maybe 4.0.5 fixed it. it was definately there in 4.0.4)

yes we've had that problem with the classloader
still haven't quite wrapped my mind around best-practise deploymeny.

Damn this is fun.

i'm interested to learn how you manage/conduct your hourly builds

poor rawbdor eats all that fleury should have.

g[r]eek, shell script invoking an ant build script. shell script updates from svn, and build / ant deploy
not that complex.
i also have a few monitoring cron jobs that ping one of the servlets looking for a 200 status code.

sure. are you deploying expoded dirs or files?

if i et anything else, then i knowt he deployment is toast.
fuck no.
just dropping one EAR file.

makes sense. we decided to try exploded dirs for a while but it caused some class referencing issues
we've gone back to files

i can't think of any sane reason to splode a deployment

for dev its nice

why?

for production nah

if you build hourly though, don't you run into the problem of expiring current active sessions?

quicker deployment during dev cycle

even an ear file supports hot deploy n stuff.
couple things. a) we don't use sessions. b) our dev host for the hourly builds doesn't actually have anone using it other than checking the deploymentand running the unit tests.

if you're sitting in eclipse with just a little local jboss running, the ant script might take 45 seconds, 2 minutes, whatever. keeping track of what changed and only copying those files = very quick
so for development, exploded is nice. for production, i'd wager less so

rawbdor, not to be snarky, but a) my ant deploy takes about 12 seconds, and b) that's what hot swap is for
brawbdor, not to be snarky, but a) my ant deploy takes about 12 seconds, and b) that's what hot swap is for /b
i poke about hotswap cuz that's your department, isn' it?

i see. so your hourly build is for your 'offline' dev build. when do you upload to your live server?
well i guess it doesn't matter since you don't use sessions

we're in alpha stage of development. so we barely have a 'live' server. we're in what we call a 'beta' test cycle right now, where the first deplment of our frameowrk is being tested in the company - customers haven't seen it yet, we're using the framework for an internal app and to train the
developers how to code against it.

that's why i was just workig on the build scripts here, to include build information into the deployed app. we were losing track of "hey, when did this app get built, and who the hell built it, and when did the y install it?"

i see
our app uses sessions, so we're pretty much forced to upload new builds after midnight

now we have this splufty little status screen we can look at:
http://pastebin.stonekeep.com/630

snarky, splufty… where do you get these words? :P
sure…

i dont think i've heard splufty before

that's one a friend of mine round here uses.

so…
if i were to do a Runtime.exec() and i wanted to feed it actual data… anyone know anything about that?

la!
feed it, after it's started?

i want to make sure i am its standard in
for example using the rev command.
it waits for standard-in, then spits it out in reverse

yah, i've seen code examples for that, no personal experience tho

hrmm

how can I encode a string with Base64 encoding ?

http://forum.java.sun.com/thread.jspa?threadID=477461

I have a program somebody else wrote that does it but it's not compiling because of this line String encoding = Base64Converter.encode("demo:" + pw );

~not working

I don't see the Base64Converter on the 1.5 or 1.6 API

opposite of generic? custom?

~wrong

No, you're doing it wrong! See http://www.oddpic.com/data/520/you_re-doing-it-wrong.jpg

org.pf.util.Base64Converter

I know it's not his own class code it's no where to be found in his code

http://www.programmers-friend.org/apidoc/org/pf/util/Base64Converter.html
also in apache ant
MrRTOS, i'm answering all your questions with 3 seconds of googling.

I saw that page
but he used standard API stuff
that doesn't seem to be standard api
org.pf.util ?
that namespace is standard?
he only imports java.awt.* java.io.* and java.net.* in his code

star imports ++

and they been using this app for a while

MrRTOS, an instantiation of classs (or referencing a static) just means it has to be on the jvm's classpath somewhere. it can be another Base64Encoding .class file in the local dir, or out on the filesystem somewher,e or within the package.
okay geeks. why is this -always- returning a whole number? (it always says '59.0' - the tenths is -always- .0)
writer.println("Total time processing —–: " + (double)(processingCounter / 1000) + " seconds.");

int division
divide by 1000.0

oo

And drop the cast

add some pixie dust as well

cast doesn't seem to be hurting, but putting .0 did it.

red ones go faster.

and blow 3 times.

the cast is pointless. dividing by a double coerces the other argument to a double
the cast is pointless. dividing by a double coerces the other argument to a double
and returns a double

i love. love love love. LOVE. when hotswap actually works.

How would I store and retrieve a float from a Hashtable? The following code isn't working:
Hashtable myHash = new Hashtable();
myHash.put("x1", 13.5);
myHash.get("x1");

hashes must be cast on get()
String result = (String)myHash.get("x1");
also, don't use hashtable, use hashmap

~tell meekish about vector

meekish, vector is http://jqa.tmorris.net/GetQAndA.action?qids=53&showAnswers=true When should I use java.util.Vector/java.util.Hashtable?

what the…

that's interesting.

~tell meekish about arraylist

meekish, I guess the factoid 'vector arraylist' might be appropriate:
meekish, The only reason to use Vector is for compatibility with Java 1.1, and 1.0. Otherwise, use ArrayList. If you need an internally synchronized version (if you don't know what that means, you don't need it), use Collections.synchronizedList(new ArrayList()); (The same applies to Hashtable
and HashMap, entirely analogous. Hashtable is old, HashMap is new).

cool, so it would look like this?: Hashmap myHash = new Hashmap();
myHash.put("x1", 13.5);
(float)myHash.get("x1");

ah there we go

you can specify which types you want the HashMap to have

= new HashMapString, Float();

(in this case, you'd use the wrapper class for float, which is java.lang.Float)

meekish, you have to get the result somewhere.

Hmmm… I'm not sure I'm following. How would the code I pasted for HashTable be translated to use an ArrayList?

er, with an identifier. missed that.

I just want to store a bunch of floats
and be able to retrieve them by name

that's what Maps are for

read the bit at the end about how HashMap and HashTable are analogous to ArrayList and Vector. to help illustrate eidolon's point of using HashMap instead of HashTable

map = new HashMapString, Float();

map.put("x1", 13.6);
float f = map.get("x1");

mm, generics.

be careful with that code. floating point literals are doubles unless you explicitly cast them to float

Can generics be used for any class?

this assumes support for boxing/unboxing..

of course, unless the generic type is bounded
that's beside the point. 10.0 is a double. (float) 10.0 is a float

yes… I don't use floats that much personally, but I was trying to change meekish's Hashtable to HashMap

Neat

Should I be using doubles?

heh, if he has generics, he has autoboxing

yes, it's part of 5.0. although, earlier versions of HashMap didn't have generics
lol. yeah, you're right

only use floats if you need to store lots of them, are concerned about memory, and don't care about very fine precision

in general? yeah. unless you NEED the smaller precision/smaller range, doubles are easier to work with

floats are great for graphics

I'm using Processing
Anyone familiar with it?

no… is that a library?

its a verb :P

http://processing.org/

How is this pertaining… to …?

Well, I'm getting an error from the following:

map = new HashMapString, Float();

map.put("x1", 13.6);
float f = map.get("x1");
expecting SEMI, found ','

~tell meekish about pastebin

meekish, http://papernapkin.org/pastebin

Just wondering if Processing uses an older version of Java that doesn't support that syntax

generics are v1.5 or later.

expecting SEMI? does it expect you to put a truck in a HashMap??

*beep beep*

heh

How would it be done in pre 1.5?

in your HashMap declaration/assignment

explicit casting

and you'll need to cast anything you get from the map… e.g. Float f = (Float) map.get("x1");

Heyas
I could really use some help with swing layout stuff - see http://pastebin.ca/653191

I'm not that familiar with pre-5.0, but I believe that you have to use map.put("x1", new Float(13.6));

Gracenotes is correct also… no autoboxing for primitives like float in pre 1.5

I had something similar to that previously, but once I pull out the Float object, how do convert it back to a primitive 'float'?

probably f.floatValue()

~tell meekish about Float.floatvalue()

meekish, I have no idea what Float.floatvalue() is.

~tell meekish about javadoc Float.floatvalue()

meekish, I don't know of any documentation for Float.floatvalue()

yep.
that's it
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Float.html#floatValue()
uh, google returned 1.4.2 first :|
but no matter, same function.

still same day.

javabot's javadoc is still inoperable

Okay, whaley.

yeah i forgot briefly
my short term memory sucks

whaley :*

Does this look correct? http://papernapkin.org/pastebin/view/1263

seriously, did you guys disable javadocs on purpose or is javabot being worked on?

It is actually finished somewhat but blew up on cheeser's prod server, he moved all of the Javadocs to a db.

looks good… now try compiling and running

So I think he needs to upload a jar and parse it.
But now you can do stuff like
~seen whaley

5 AM whaley said: meekish: looks good… now try compiling and

javabot = big brother

I guess the factoid 'really big index' might be appropriate:
whaley, reallybigindex is http://java.sun.com/docs/books/tutorial/reallybigindex.html

anyone used groovy and grails?

oh god… now he responds without a special character before his name

Well, you have not seen the logging yet
Aye.

that may be troublesome
well… easier to use… but spammy given the crowd in here sometimes

I assume javabot is programmed in, uh, Java.
..

We are actually talking of making tell, say, seen, etc besides ~factoid and javadoc come automagikally

joed.. youre not talking about that scrap thats on sourceforge i hope

Does it use a particular framework?

quite the deductive logic you have there

Thank you. /me bows.

pirc… i think is the name
erm… that's not right

ah, PircBot.

pircbot
yeah

good framework… fairly popular
Hello, Dr_Link

looks nifty… if i'm ever bored one day I might write up a bot for another network i'm on

heh, hello
and… goodnight

heh.

Looks like it's working. I'll plug in to the library and see if something beautiful pops out

go knock yourself out
how much java/programming have you done before?

Zero. I'm a Ruby programmer. I'm just using Java because I'm using Processing
Zero. I'm a Ruby programmer. I'm just using Java because I'm using Processing

i'd help but I know zilch about swing

I sure appreciate the help

cool… welcome to our world

I feel your pain.

this is a great channel to learn from… but remember to always try and help yourself first

Sure thing. I spent about 45 minutes on that one before coming here. Static typing is seriously counter-intuitive for me, coming from Ruby (dynamically typed)

~tell jbc about snippets

jbc, Snippets too often lack vital information. Create a test case instead.

~tell jbc about literal pastebin

jbc, reply(http://papernapkin.org/pastebin|http://eugeneciurana.com/pastebin|http://rifers.org/paste|http://pastebin.stonekeep.com)

~tell jbc about layouts

jbc, layout managers is http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html If the layout managers that come with the jdk dont satisfy you, have a look at FormLayout, TableLayout, PercentLayout or
HTMLLayout (ask me about each of those to learn more). Book chapter at http://javafaq.mine.nu/lookup?290

~tell jbc about welcome

jbc, http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome
jbc, a href="http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome"http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome/a

After ruby, coding in Java feels like getting an erotic massage from the Pointy Haired Boss

right. i came from python with its dynamic typing and java took a bit of getting used to… but after a while I think it actually helps
you will always know what type that oddly named variable is in java

*quack*

assertEquals("trollMode",[krustorfski].getMode());

haha junit

oh god

DONT GET ME MAD!!!!!
ILL F**KING KILL YOU!!!!

you won't like him when he's angry

funny, but worthy of a kick.

he's really really annoying

krust… he's really not like that
[krustofski]: at least not since whats_in_a_name was booted

Well, it was a pretty fair impersonation.
from latter days at least.

but seriously jbc pastebin more and tell us what the problem is
and see the layout links javabot gave you

Indeed.
0 here if that makes you feel

http://pastie.caboo.se/86777

it doesn't, but thanks anyway!

I'm not sure I'm sold on the extra verbosity required by Java

i'm actually waiting on my roomate to get back, then I'm heading to the bar

it's funny, for once I'm quiet, and people _STILL_ talk about me.

k. It's fairly vast code - I'll expand a bit more. (been poring over layout tute)

hi r0bby

~tell jbc about test case

jbc, Provide complete, compilable Java SOURCE CODE that shows the problem and nothing else. Be as brief as possible. (See http://javafaq.mine.nu/lookup?364 for details and a HOWTO.)

Well, you got the uppercase going

Stop taunting me with the ruby way, dammit :p

perl gets pretty ugly after a while too. this is a strongly typed language. Haskell is even less verbose.

jdb.tauntWith ({|x| x . " sucks." })

OK, one last brainbuster
I want to make an array of HashMaps
http://papernapkin.org/pastebin/view/1264

you shouldn't need an array of HashMaps.
(depending on what you want to do, of course)

I want to iterate over an array of HashMaps, I think

what J2EE framework is most efficient?

at doing what?

what clothing is the most efficient?

Is it possible?
What would be better?

producing web application with SSL, 1 to 1, 1 to many relationships
groovy and grails?

wicket clearly.

yeah wicket
~tell cosmic_string about wicket

cosmic_string, wicket is a component based web application framework written in java. See http://wicketframework.org/ for more details.

what are you storing?
why do you think you need an array/collection of Maps?

each HashMap will contain the coordinates for a line. (x1, y1, x2, y2)

sun's about to rise.

http://pastebin.ca/653210

*twitch*

wow.

I want to fill the array with HashMaps, then loop over the Array and draw the lines in every frame

no. just no.

hahahaha

thanks joed

It's the Ruby Way

no, even in ruby that's a silly way to organize your data

What would you recommend?

unless you've named your points for some reason

joed do you know if spring MVC can be integrated with Wicket?
and hibernate

uuuuuurrrrrrrg

jbc, and the issue?

I often use hashes for clarity. myHash[:x1] seems more clear to me than myArray[0]

You have no idea how passionately I hate SpringMVC.

~joed++

joed has a karma level of 52, g[r]eek

Spring integrates fine and dandy.

hehehe, I hate SpringMVC too

as in the comment on the page: the table's pane takes up the entire panel, leaving no room for MonitorCOntrolBox

Just use @SpringBean Dao myDao

Arraylist of float arrays? ArrayList of Line objects which contain their endpoints? Maps are for mapping keys to values. don't use them for simple storage

Hibernate/Ibatis/Guice etc all follow

awesome

I'd prefer to avoid setting absolute sizes for things, if I can

Please humor me, what would the code look like to build an ArrayList of float arrays, and then iterate over the ArrayList and retrieving the values?

If you do not like SMVC, you most likely detest the AbstracController and parsing Servlet context to make up for form posting flaws.

jbc, this.pack()

use an Array (or ArrayList if it needs to be dynamic) and your own Line class

ArrayListfloat[]

look at the forms, tie those to a model, be happy.

Is that a generic?

but yes, a Line object would be more readable
yes. if you can't use generics, just cast the object to float[] after pulling it out of the collection

aha! argh!
thank you!

jbc, read the links given to you by mr javabot
jbc, he is the super smartz0r

yes, but filtering out the leads to follow is the hard part - I'd have spen an hour fiddling with obscure layout parameters.
many thanks

other things of joy, look at the phonebook, and try and re-implement that in an Abstract Controller, Dao, SvcLayer, EL and JSP

me too

"So I'd go out on a limb and say that Wicket == Rogaine for developers." nice

Oh, you found it.
Heh

hahaha - "Wicket has a learning flat."

That is fairly accurate though.
If you do not get the models you are going to be doing some weird stuff.

~ananthmv

ananthmv, I have no idea what ananthmv is.

http://www.internationalen.se/content.php?review.335

joed will do

g[r]eek: it is an old Swedish saying - literally translated : Empty barrels make the most noise, my grandma used it when referring to people from Big Cities, Sales people or anyone I guess she did not like.

heh, we have "empty vessels make the most noise"
good saying that.

Yeah, same thing.
I always liked it and have used it frequently in meetings while still living in Sweden.

hehehe
im having fun making something so stupid
biggest waste of time evar

Another plugin?

nope

lol

there's this library called truezip… lets you treat zip files as just any other vfs
move files around, make directories, etc
i'm making a shell in java so that i can do that with tab-completion
ui'm making a shell in java so that i can do that with tab-completion/u
this isnt for jboss. this is just bc im a loser who codes at 1am in nyc on a friday night

heh, point missed :P

beats wasting a mind.

"you'll love new york. it's the city that never sleeps."

oh im up all night for sure

i've just hit 7:08am

I'm trying to create that ArrayList of float Arrays. Am I close? http://papernapkin.org/pastebin/view/1265

no.

no

… … … no

no

() and then pointArrays.put (…)

killjoy.

(feeling negative ##java?)

I can't use generics (old version of Java). What would it look like without generics?

g[r]eek: no

sections

~rawbdor++

rawbdor has a karma level of 3, g[r]eek

hehe
what makes this endeavor so much more pointless…

in java 7 you'll be able to do \o/ sections for expressionate methods.

is that it'll probably only work in linux

like a breast without nipples…

g[r]eek: exactly

if i ever started a band, i'd called it "breasts without nipples"

expressionate methods will work independently of runtime, and just \o/ w00t every now and then.

whenever i see \o/ i think of hiro nakamura

Last samuraij?

I think of a dismembered stick figure.

that japanese guy in "Heroes"
quicksand.

hi

Heya Bevin.

g[r]eek: Or that.

bbl

i feel weird.. im listening to nat king cole's christmas song
and its about 90 degrees outside… and august
think ##java has gotten to me

Greetings.

http://papernapkin.org/pastebin/view/1269
Take it easy on me

are you the only one that uses that site? for the past hour its all arrays
that looks like it could work. shrug

If you're not using generics you need to cast the object you get out of the list back to the type it should be yourself

bah… yes what he said

ArrayList firstPoints = (ArrayList) pointArrays.get (0);

Hrm… jMaki's video got almost 550 views so far. Not bad for 48 hours since posting.


the hell?

Long story.

hey so here's an interesting question. not sure if anyone will be able to answer it. relates to java.lang.Process and input / output streams
i'm reading from standard in, via a readLine() type method… and forwarding that to the process's input stream
and i read from the process's output stream and forward that directly to stdout
also via a readLine()
problem is, it's not reading a line. it's waiting a long long time, pretty much until I do ctrl+d
so for example, if i do type rev and forward abcde\n to it, it immediately reads abcde\n from stdin, forwards it ot the process. the process, i assume, takes it, but it's output is getting hoarded in the buffer somewhere
rev is the unix command reverse, which takes stdin and is supposed to echo the line as soon as it gets it via stdout, but reversed of course
i'm even issuing a flush. ponder

lawlz0r

I need a taller screen
screen's split mode is nice but with only 75 rows it's not big enough for some things I want to do

pr3d4t0r, i hear ya
pr3d4t0r, i need a 3-pane screen on this laptop
pr3d4t0r, good thai food today

Thanks.
Indeed it was.

hrmm. well… i know my stdin-reader which forwarsd to the process is working
or at least i suspect it is
hmmmmmm
anyone up for debugging some IO?

rawbdor, yeah, YOU are

laugh. yep =]

somebody advise me on a good text editor pls

TextMate

Notepad++
vim, emacs, nano

is there a comand to get them
or do i have to download them

what are you running on?

unbuntu
i just got it

unbuntu? is that like a BSD?

i dont know what BSD is sorry
but its like linux?

vim/emacs/nano are all commandline text editors, vim/emacs have gui's i think

are they easy to work wth?

at least one of vim or emacs are almost guaranteed to be installed. nano probably isn't but is more user friendly

for basic text editing? mediocre. Nano's easiest.
emacs or vim are both amazing tools, well worth learning

how do u jump around in the doc

pgup, pgdn

nano is the new pico right?

yep

don't need that much power… just something that I know will do the right thing when I hit tab, enter, etc.

so i use that get ap command right?

for unbuntu? i have no idea what that fictitious distro uses. now Ubuntu, that's debian based and will use apt-get either directly or through a gui
it might even be in your list of installable packages
and now we're drifting into territory that #ubuntu would be better suited to deal with

so sudo apt-get nano ?
oh sorry
but its a text editor for java!

no, it's a text editor. period.

for you, its intro to ubuntu.

i highly suggest you go read some tutorials on using ubuntu/linux

i got them in front of me

titleb, http://img378.imageshack.us/img378/4934/failtx2.jpg

what the hell is that?
my browser is not working

o, IRONY.

*snort* that's the best pic you've found yet, krust

Fanook, its a regular winnar! in ##swing

your browser isn't working, but your irc client is? you have larger problems

priority inversion
yeah
er

ah yes, the rectal-cranial inversion problem

now why would a open a link from some arrogant fuck

you seem to have mistaken this for a linux support channel; have you tried #ubuntu on this very server? The people there are, in my experience, both knowledgable and helpful.

arrogantFuck++

hi all

Hi Dr. gudi!

~tell gudi about welcome

gudi, http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome

are you related to the cheese?

I tried to use hibernate + spring for my swing app. But I don't see any option how I can use one long session within my app to get lazy loading workin. any idea ?

Fanook / [krustofski]: nano is one billionth, pico is one trillionth

~math barbie

I guess the factoid 'pointer math' might be appropriate:
an example of how to get at pointer math in java can be found at http://don.schwarz.name/index.php?p=30

:|

\o/

chocolate rain :-/

chocolate rain, ugh, that meme actually caught on

worst part is that tay himself *is* the meme. chocolate rain is just what he happens to be singing. but the guy is funnier than all his music

hm?
i must not be up to date on my numa numa's or star wars kids… wtf is chocolate rain?

ha
erm… lemme find link for you

jls
~jls

http://java.sun.com/docs/books/jls/

~thanks

No problem, ojacobson.

http://youtube.com/watch?v=EwTZ2xpQwpA 4.7 million views… 58000 comments
i thought there were lots more comments. they must have wiped them

Comments

in a jLabel to get the word wrap affect it works fine without any layout manager but as soon as I set gridbaglayout

it's a bit ironic since it uses the word 'motherfuckers' in it's definition

I don't use jBoss.

you know what makes jokes better? explaining them

what do you use?

Tomcat, baby.
Now I'm also using Day's Communiqué.

no ejb3?

I once mentioned that RMI sounded like a neat idea; for my sins, I now write EJB apps

Whassat?
meeper:
I feel sorry for you.

ejb3 is actually pretty damn awesome

You get to find out in 3 weeks what we run

I balance it out by hacking on haskell in my spare time.

I was interviewed by eWeek about our open-source stack.

RMI And all kind of RPC is a very weak form of a distributed process.
VERY week.

We're using Communiqué at work to migrate our content out of a piecemeal-updated WAR file

weak*

no it's not, that's a stupid thing to say.

meeper, prove otherwise.

It's a nice product. It took a while for them to convince me but their guys are sharp and professional, and they integrated well with Mule and the rest of my toys.

more that it's designed for service-to-service interop rather than distributing a single service

well if it's just a bunch of tomcat nodes then I'd pity you

The clincher was our GWT deployment to Communiqué. It works like a charm.

ojacobson, yes, limited to a certain platform.

You sound like the retards in #java.

meeper, you don't really know about other distributed interfaces right?

agree. No RPC mechanism is global.

Please don't speak to me like I'm a fucking amateur. I'm not in the mood tonight.
bPlease don't speak to me like I'm a fucking amateur. I'm not in the mood tonight./b

what did I do!

We were spamming up the channel for an hour and got sarcasta-kicked.

wasn't insulting you, I just wouldn't want to be dealing with bunches of tomcat server hosting deployments. These days I strictly use jetty tho even jetty pisses me off sometimes

heh

all software sucks.

some suck less

Except possibly M-x psychoanalyze-pinhead.

meeper thinks on a different level.

I've long since noticed.

good.

anyways, no RPC mechanism will ever be completely general (but they're all general enough to implement any other RPC mechanism badly over top)

Sorry - bad day.
meeper++

meeper has a karma level of -17, pr3d4t0r

~hug pr3d4t0r

pr3d4t0r–

pr3d4t0r has a karma level of 343, thepointer

pr3d4t0r++

pr3d4t0r has a karma level of 344, thepointer

ffa?

Barry Bonds may have just scored another homerun.

yeah, he did

They're going bananas with the fireworks at Giants Stadium

sad that he needed all those drugs.

Heh. I can tell. Nice fireworks through my window.
Just below the fog.

?

pr3d4t0r, it was a nice crack

they should have just walked him

If I wasn't so busy I'd pop my video camera and shoot the fireworks.

haha, walked him for the rest of the season or even his career

Awwwwwwww!

for dumbfucking with the bot and an OP

ideally, yes

Fireworks stopped

pr3d4t0r, click to espn if you gots it

i don't really understand, i was experimenting with the bot, is that a problem?

*yawn*

?

experiment with the bot in a pm

you played with the bot, poked at an OP what do you want?

Hrm…
I guess I get to live with this MacBook through April or May next year.
That's when Apple introduces the portables

don't ever ever ever mess with an op

hey, I'm thinking of getting one of those

are you speaking from experience?

you WILL _ALWAYS_ lose.

heh.

duh

how's the battery life, and how long have you had it?

5 hours, I had it for 14 months or so.

solid

do you have the glossy screen?

Two batteries. I can fly from Paris to San Francisco and watch movies all the way without interruptions.
Just put the machine to sleep to switch batteries somewhere past Greenland

good deal. That's a long-arse flight.
Me, I'd be happy if it survived vancouver-toronto

I've never had a Mac before, not sure if I want to have one, either, as most Macs are not even upgradable

I take very good care of my batteries so that they take good care of me.
uI take very good care of my batteries so that they take good care of me./u

at least, not without voiding the warranty by opening the thing using one of the many guides on the internet

Yes.
And yes, they're upgradeable.

get a mac cheesegrater then

how do you take good care of batteries?

How often do you actually upgrade the CPU and mainboard? Because that's the only parts of a cheesegrater you can't easily upgrade yourself.

I've never done that before
but, I only built my first PC recently

(Actually, I should pop the case on mine and check out the insides… I took it out of the box, powered it on, and it's been sitting there since.)

Everything you can possibly imagine is built-in.

the video card, however, is one component that I would like to upgrade

Everything else is pluggable via Firewire or USB.

pcix

Memory and HDD you can upgrade yourself with a minimum of grief.

yes, built in, everything is built in

kinabalu and I buy bigger HDDs for our MacBooks around every 9 months.

I want a graphics card to be upgradable easy

Get a Mac Pro for that

and yet, they seem to be soldered to the mainboard
those are expensive!

The Mac Pro line have actual PCI-X slots
but oh so worth it. *stroke*

PCI Express, you mean?

yes
sorry, been a while since I did hardware

pr3d4t0r, reminds me .. i still havne't installed that new drive

man.. Functors rock
I replaced everysingle if statement in my code wih predicates

wotcher working on, and can you share the goodness?

should i run and hide? *runs and hides*

Heh.
Just control the verbiage a bit.
It's pretty tiresome that not matter what time of the day or night, you're talking about something.

The Mac Pro has 4 or 8 CPU's in it, made out of two dual or quad core CPU's

what verbiage?

Just look at the logs.

oh just a simple CRUD app.. but been using closures, transformers, predicates, and CollectionUtils from Apache Commons
it's… sweet

ah

afaik++

afaik has a karma level of 8, pr3d4t0r

i didn't even do anything tonight :/

Heh.
cybereal!

yo

you're much nicer than I am; I had to opt to keep my mouth shut instead :/

PredicatedList++

d00d.
whaley++

whaley has a karma level of 7, pr3d4t0r

We need to talk

so, if the Mac Pro has that many CPU's, and not that many programs are multi-threaded to make use of those CPU's, then what'

multipe programs uses multiple cpu's too you know

what's the use of all those CPU's if the kernel cannot optimize a bunch of single threaded programs running concurrently very efficiently?

I can only speak from experience, but it does seem to load the CPUs down evenly

on what OS?

OS X

absolutely nothing, obviously, nobody ever found any advantage to SMP machines, ever.

4-way SMP

most apps are multithreaded these days

More to the point, I can run something CPU-consuming without iTunes chugging out

yep, there's that too

(Bus bandwidth is at a little tiny premium though)

I'm using Linux, and on a single dual-core CPU machine (AMD Athlon 64 X2. 2.20GHz, overclocked to 2.25GHz), the CPU's do not seem to be utilized equally

it will vary by the software you use and tasks you perform

and on how the balance between CPU util and IO util works out
Lots of low-IO tasks will tend to get their entire timeslice, which means they stay on one processor for longer (not noticably individually, but in aggregate you'll see some weird patterns from that)

That's because Linux's scheduler sucks.

really?
I tried FreeBSD, but it wouldn't install
NVIDIA nForce 4 chipset

Try Windows XP

no thanks
if it
if it's one OS that I'm not going to use, it's going to be that one

heh
too expensive for you?

ok…

~ping

Pong

I tested all major OSs last year. Solaris is teh shit.

how's vista?

OS X performs well but sucks for servers (until Leopard comes out).
Sucked.

I still haven't touched that OS
I'm not sure if I should be proud or what

Hardly significant given that it's still in beta

hola

what? Are you being facetious?

Could be

Hola.
Dinner's ready! Yey!

hard to judge over text
unless you're a write like pr3d4t0r
*writer

You must have forgotten Windows XP launch, it was exactly as "good" as Vista's, and up until SP1 may as well have been a public beta.
you need a towel to wipe the shit off your nose?

XP had no credible competition.

that was a joke. You see, tone is difficult to discern

shut up. You know what I mean.

no it's true because of the credible part, OS X had not proven itself yet

I have a function that expects a String[] as an argument. Is there a way to call the function with an anonymous array (something like foo(new String['one','two','three']) ) .. I'm just not getting the syntax right. help appreciated. thanks.

hasn't proven itself? wtf does that mean?

and MacOS 9 and earlier was about Win3.1 level tech

Releasing Vista in a market where people are juuuust starting to consider an alternative in the state it was in was a tactical error.

it was very new at the time

in java 1.5+ you can call it with foo ("one", "two", "three") if the string array falls into the right place in the arguments

at what time? This time? You were writing in present tense. Well, actually…. future imperfect? shit, nevermind

or foo (new String[] {"one", "two", "three"}) otherwise

jebus man, learn to read

excuse me. "In the state it's in."

sshojacobson thanks, that was exactly what I was looking for.

and "is"

ojacobson that is. can't type in the dark.

I'm a little drunk

No need to be hard on yourself for being small, nothing you can do about that you drunk

actually I'm a big drunk.. hehehe

Yeah, well alcohol has a tendency

take five.

shots.

five kicks?

You're not a drunk until you've installed pillows next to your toilet.

I guess it is time to break out the kettle one

Oh vodka!

nothing's funnier than being sober, reading code that you did while drunk

Waking up to // durnk. uintt st lra. is no fun.

I think Harold and Kumar go to White Castle is funnier

it is sad when you sold it and it hit the market.

yikes. Haven't been in that position quite yet

I had a moment… I was 17 and sold an SMS system.
I got 5 thouh and though I was lucky

got five what?

Five grand for most of the today in use SMS database layers?

ah
well that's a lot of money before you've graduated HS
wait… and you were drinking? Do I need to call the federales?

no I'm safe now.

in Canada? lol

No, actually in PA

hmm wtf
why does System.console() consistently return null?

Are you running your app through a GUI-based IDE or as a standalone JAR by double-clicking?

Because you don't have a console attached to the vm obviously

no, running it at the cmd line in screen in cygwin
there's nothing I need to do to initialize it right?

try cmd.exe

could be the way you have screen setup or due to using win32 jvm in cygwin

Cygwin's termcap emulation might be getting in the way
(Wouldn't that be a riot.)

YOU HAVE a nice plug

yeah it works in cmd.exe
well that totally fucking sucks
why doesn't System.console work in cygwin!

http://www.youtube.com/watch?v=dGXr4uOnBrw

Submit a bug to cygwin and a parallel one to sun
Watch them both blame the other guy! Fun for hours!

I'd do it, if i cared

are there any java host programmers that actually use cmd.exe? why is cygwin support so bad in general? that's the third cursed cygwin bug

Perhaps because cygwin is a big hack
and nobody knows about it but obscure computer geeks

your mother is a big hack

cmd.exe rules!
best shell evar
I was like "ls" and it was like "'ls' is not recognized as an internal or external command, operable program or batch file.". I was like "Awwww yeah"
I was like "ls" and it was like "'ls' is not recognized as an internal or external command, operable program or batch file.". I was like "Awwww yeah"
that makes the baby gates cry

ls grep perl awk et al

how do yall suppose the java.io.Console knows when a user types 'ctrl-z'? native magicery?
but no bash

probably

nope
well it's in cygwin I guess
I don't use that much though, especially now that I have finally got my equipment refresh and am on macs almost exclusively

10.4 defaults to bash, finally
tcsh is an abomination /kidding

you blasted mac people

meh not that it was ever hard to switch

tho I do envy having a real unix environment

trufax.

mebbe if the jdk wasn't always 2 years late for the platform it'd be viable for development

Meh, I don't really care, it has never been a problem for me
I don't target 1.6 anyway
It has been hard enough getting customers to accept upgrading to 1.5
K-12)

Ah, Netware, the platform that refuses to die

indeed, well in Novell's eyes it may as well be dead
they don't do much to maintain it, they basically point at SuSE

if I make several methods synchronized.. do they use the same lock

OS X 10.5 was unix certified.

meaning can I be in two different methods at the same time

So it's all up-to-date and ready to rumble.

if you make methods synchronized (keyword modifier on the method) it's like putting synchronized(this) { } around the whole contents of the method

synchronized methods are the same as wrapping the contents in synchronized (this) {} or synchronized (T.class) {}
(the latter for static methods)

so its like acquiring a lock for the class
that seems like it could be very slow

normal non-static methods lock on the object you called them on
synchronized static host methods are pretty rare (except in lazy singleton init).

what do static methods lock on

he already told you

The class object of the class the method was declared on

I heard synchronized implies static

hah no

you heard wrong

in a jLabel to get the word wrap affect it works fine without any layout manager, but as soon as I set gridbaglayout, the text in the jLabel has a very small width. Why does this happen?

sounds like someone doesn't understand what static is

the lazy-loaded singleton is an antipattern!

the *incorrect* lazy-loaded singleton is an antipattern.

well someone said synchronized methods is like have synchronized (this) { … } and then someone said for non-static methods lock on the object you called them on

javabot tell Meshezabeel about html swing

Meshezabeel, http://java.sun.com/docs/books/tutorial/uiswing/components/html.html

Singletons in general are just questionable ideas.

there is no correct way

in OOP yes

there is within any one classloader.

kind of defeats the point

in java, no

soo… does static synchronized mean that its like acquiring a lock for ALL instances of the class?

… that is a tenous claim… ok

public static hosting synchronized getInstanace () { …init and return… }
anything else is wrong

no, it's acquiring the monitor attached to the Class that represents the class

you need to distinguish between individual objects, their class, and their class' Class object

hmm.. that is confusing

"Foo" is an object (of String)
String is the class of "Foo"
String.class is the String Class object.
Let's say String had a synchronized member method called wobble

ugghh… the monitor is 2 feet away from my eyes and its starting to blur… i think i need sleep

so.. if I have two instances of the same class, they CANNOT be in the same static synchronized method

"Foo".wobble () and "Bar".wobble () would be syncrhonizing on different things

move the monitor closer

javabot hug whaley

stop making the bot molest me!

if String also declared a static synchronized method named beef, only one thread would be able to be in String.beef() at any one time

Hej.

it's not molesting you,,

May I send you a private message?

hi pr3d4t0r, i just checked my email
sure

that seems like it would be a lot of tension on that one method/lock if we were to have like 10 instances of that object
I mean class

I think pr3d4t0r is asking whaley to go out on a date with NikkiWade .

if many things call that static method simultaneously, yes, it would result in some performance issues

so why would you do it then?
if you think it's slow

The correct approach to synchronization is to synchronize as little as possible and no less

frankly that's one reason to avoid the lazy-loaded singleton pattern — the cost of synchronization.

yeah.. good point

most people don't synchronize, though, hence the anti-pattern

what advantages does the lazy-loaded singleton pattern give?
does it save memory

worse, most people who do synchronize try to cut corners
it gives you a chance to handle creation failure in a sane way

don't forget the containment breach, binding namespace for the whole classloader (or app in practice)
bdon't forget the containment breach, binding namespace for the whole classloader (or app in practice)/b

Yeah. Singletons in general are bad mojo

that doesn't really tell me why it is resizing the width of the jLabel

it saves absolutely nothing but some typing
lazy programmers don't want to have to always pass on references to new objects
that's it. period.

why don't i see code and a screenshot?

There are a handful of cases where a singleton is appropriate; even then, you should only treat it as a singleton in one place and treat it like a normal object everyhere else

yep. A singleton in spring, and an object everywhere else

ok, will do, thought maybe there was something about GBL with html hosting that I wasn't understanding

hrm GBL :/ I'm not proficient there, ##swing will be better

~totally gridbag

Sou|cutter, totally gridbag is http://madbean.com/blog/2004/17/totallygridbag.html

it stands the test of time…
"poor bastard… he must be doing some gui codin"
"screw you, gridbag! I'm just going to stare at this code til it makes.. sense.."

where's a good place to upload a screenshot?
any pastebins support them?

A while back I ran into Singleton hell (way too many singletons) and I was wondering what a good replacement for singletons is
I was creating a Java Swing App in which I made every window a singleton

uh regular old members?
and pass them to constructors/secondar initializers that need them?

is Spring a good solution
creating everything as beans

http://groups.google.com/group/javaposse/browse_thread/thread/2124cab8f1cea683

spring is good
and making every window a singleton is pretty silly…

code in the JLabel shrinks its width.

JLabels don't do word-wrapping

they do with html

javax.jws, where are you

anyone ever use this library?
http://jga.sourceforge.net/docs/javadoc/index.html
I've been getting frustrated with Apache Common Collection's lack of generics

javabot tell afaik about anyone

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

night.

I don't need help with it
I'mcurious if anyone has ever used it
and if they like/disliked it, or if they think it looks useful

there is a sort of memory limit when you call in a IIS6 a java -jar …. ?

the usual default and max heap sizes, controllable through -X parameters

ok

thanks for trying at least…it is still a good help!

if you mean the new super slime f*cking hawt one, it has been saying 3-5 weeks out

what happened to yours?

s/slime/slim
But, I'm totally getting one.
well after I try it at the apple store of course…

I ordered it right away. 3 - 5 business days.

ah, well be sure to share your opinion on it

cybereal:
I don't have opinions. You know me.

It looks nice to me, I'm a fan of low profile keyboards having worked for so long on laptops
Today was a happy day for me, because, I am a .Mac subscriber

night all, fixed my problem by enclosing the html text inside a table and setting a width on the table. Probably not the best solution, but it works.

horrible, not a solution at all, but neither is trying to put paragraphs of text in a JLabel so meh

mornink.. I have ascii encoded utf16 string in a String. How to decode that ASCII encoded string to a .. well, string?
umornink.. I have ascii encoded utf16 string in a String. How to decode that ASCII encoded string to a .. well, string? /u
so my string is like "p\u00345lli" presenting string like "pälli"

moin moin folks

Hi all. How do I use the javamail api to check for new mail?

i still don't think anyone understands your question =P

Assuming that I already have a connected store and the INBOX folder is currently being viewed.

hmm.. problem is that I have program A sending data to my program B in a ASCII encoded format. and the data it sends is utf-16 text. And because this is international text it encodes non-ascii characters as \ucode
similar to http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html

Folder.getNewMail() probably

if you want to send UTF16 over an ASCII trunk you'll have to use UUENCODE or similar.

ah, no, it's Folder.getUnreadMessageCount()

so charset is utf-16 and encoding is ASCII

but wouldn't that onyl get an int..?

problem is not sending utf16 over ASCII.. problem is decoding that in my Java app

ah.

you didn't say that you also want the mails

unfortunally that peace of shit software can't send it in any other form than ASCII encoded utf16

sorry, to be more precise: I also want the mails, and I want them to show up in my folder viewer object

well, if you use UUENCODE or BINHEX or similar, just decode it at the other end, simple enough. If you want the '\u1234' "protocol", that's a different story. I'm not sure if there is an easy way to decode that, even.
okay, so the sending element isn't in your control (as in: you can't change that?)

which is just the stock sample that comes with the SimpleClient example in javamail

i don't know the api, i just looked that up in my own code

yep, I can't change the sending element

you can determine a charset for readers, streams and so forth

Well, using \u to encode stuff outside the ASCII range is not actually a standard.

java has lots of constructors like that :P that mostly default to isolatin1

As such I somewhat doubt that there's a set solution to decode it, but it should be trivial to roll it yourself.

i'd check every message if it is new in case that there are new mails
or just those with the highest index

this really has nothing to do with charset, perse. If you decode this with US-ASCII you'll get your \u1234 as "\\", "u", "1", "2", "3", "4", and not as a single character.

well, java host atleat uses \u to encode stuff in ASCII outside ASCII

the spec isn't even clear - how does \ get encoded? as \\?

yep, it has nothing to do with charset, it's about encoding/decoding of ASCII to utf-16 (which java uses internally)
I don't know, mostlikely

I repeat, using \u isn't actually a standard, so, I seriously doubt there's a built in decoder. But how hard could it be to roll this yourself?

I don't know.. neews somoe parsing and I hate doing parsing

well, that's just lazy talk.
scan for backslash, see if next character is a u. if NO: just add the next char and ignore the backslash. if yes: read 4 more and parse that. It's a fucking 4 liner. Stop your kvetching.

well, yeah, something like that.. perhaps a regexp could do it nicely

The code javac uses to do it is buried in javac somewhere, not in the string or unicode libraries

i agree there's unlikely to be anything in the stdlib to decode text like that, maybe in one of the com.sun classes

i fucking hate that php shit that sends that crap

burn it.
With FIRE.

regexp?
~regexp

If you know what you're doing, go to http://javachannel.net/wiki/pmwiki.php/FAQ/Regexp ; otherwise ask me about javadoc Pattern or javadoc String.split(*);

dammit.

@profanities
If I use a JSR-188-style web service, jboss injects the web service context but not any EJBs
If I use an EJB-style web service, it injects other EJBs but not the web service context

~no, regexp is replyIf you know what you're doing, go to http://javachannel.net/wiki/pmwiki.php/FAQ/Regexp ; otherwise ask me about javadoc Pattern or javadoc String.split(*); — remember, though: "Some people, when confronted with
a problem, think: "I know, I'll use regular expressions!" Now they have two problems" - JWZ

Okay, surial.

Just when it looked like I wouldn't have to write any JNDI code, this shit happens

See quote and apply it to your situation.
you do NOT want to do this with regexes.

scan for "\u", when you see one suck out the next (up to) four digits, parse and replace the whole shebang with the resulting char
repeat until you run out of "\u"
Depending on how fascist you feel you can treat less-than-four digits a number of way
s

that won't work.

surial:I don't? isn't that just simple \u([0-9][0-9][0-9][0-9])

because \\u != something you should react to.

actaully it's hex but idea is the same

pff. correctness is overrated.
(You have a point. My bad.)

again, that won't work, because \\u should be skipped by your parser. unless we're talking \\\u, which should NOT be skipped. but \\\\u should. And now do this in a regexp. Answer: You will get it WRONG.
Why the hell do you think regexp, anyway?

oh yes, nice one

I don't get that. This fundamental tendency to say REGEXP! when there's some sort of parsing to be done.

I do lots of text converting with regexp

you should say REGEXP when there are COMPLEX PATTERNS to detect. This is a linear simplistic pattern. It's perfect for linear parsing. In fact, that's where the whole backslash escape thing came from.

finite state automata are just so shiny!

I prefer nondeterministic automats

is this normally not ok syntax? ((com.cyc.tool.subl.ui.SubLReaderPanel) local_0_11e0c13) = other; ?
(to place the cast on he lvalue)

the left side of an assignment isn't an expression.

doesn't even make sense

and casts are things you do to expressions. hence, that is invalid. Secondly, as cybereal mentioned, WTF?

ok i see i was going to do that with all variables

What do you mean it's "working in a decompiler" what does that mean?

oh, working on one.. the output

however, (com.cyc.tool.subl.ui.SubLReaderPanel)local_0_11e0c13 = other MAY make sense because assignments are themselves expressions and hence castable. Not sure if java compiler accepts that though.

oh you'r emaking one
oh yeah that's probably what's happening
local_0_11e0c13 = other will return other

Hello we are using valgrind to profile our code in java. Is this really a useful tool for java profiling?

or well, local_0_11e0c13 typed other

~tell DepressGuy about profiler

DepressGuy, A profiler is a tool to find performance bottlenecks. jmp and ejp are free; jprofiler and jprobe cost money. Some more are listed here: http://javafaq.mine.nu/lookup?169

best learning manual for java please

~tell Carok about RBI

Carok, RBI is http://java.sun.com/docs/books/tutorial/reallybigindex.html

~tell Carok about bibles

Our ITO team is using valgrind as an excuse that our java program is leaking memory

1) Sun Java Tutorial (http://java.sun.com/docs/books/tutorial) 2) Bruce Eckel's "Thinking in Java" (http://www.mindview.net/Books/TIJ) (Get the 3rd edition, the 4th is only freely available up
to chapter 7.)

I want to know if valgrind has been use in the java servlet hosting community

Which Java version?

j2se 5

yeah .. local_0_11e0c13 type wasnt discorvered at the time of declarion it was declared java.lang.Object intianlly.. one assignment operations i was goign to add it later so the src could be better understood by humans.. but heh not good if the compiler wont understand it
uyeah .. local_0_11e0c13 type wasnt discorvered at the time of declarion it was declared java.lang.Object intianlly.. one assignment operations i was goign to add it later so the src could be better understood by humans.. but heh not good if the compiler wont understand it /u

Let's try again: which Java version EXACTLY?

and in their valgrind logs, they say that our java is leaking memory

do yourself a favour, load a big list of foobar variants someplace and replace the local_blah_shit with them.

java 1.5.0_10

OKi, they may be right.
Install _11 or later.

well youc an assign any object to a variable typed Object so yeah… it actually makes sense assuming the compiler's order of op is handling the = expression before the cast

so foobar, xyzzy, quux, spam, eggs,

_11 fixed memory and threading issues.

no one is going to mentally keep local_0_11e0c13 and local_0_65dfa2 apart.

indeed, use a list of words, perhaps from a children's dictionary

hehe that might be a good idea.. pull names out of a dictionary of terkms.. makes code fun to read

I had a copy of a C obfuscator that was written to take regular C code and turn it into a storybook of sorts

these are things which any sane person ought to realize. The 4 debuggers I know of all don't do this. And people wonder why I consider 'average joe' a retard.

usually about monkeys and bananas, etc.
the cool thing was it could take that story and turn it back into C code, then compile it
and you could have it as part of your build process

with defines?

the output wasn't C it was a story

so the story is kind of like a deobsifaction key ?

Heh.
Clarian Health and the new thing they are trying with health insurance coverage for their employees. They are charging unhealthy people more.
Clarian++

steganographically speaking it's just a non-deterministic replacement cipher applied to program code.

the story ws the code, it could be compiled back into C (albeit with different names from the original)

Anyway.

yes it's simple, it was meant to be for fun

Have a wonderful night, Everyone.
Z z .

I believe it was by the guys who originally did blowfish encryption

one of the oututs of this java decompiler is going to be C .. but oi might be stuck with C++

That would be bruce schneier.

outtus/outputs

hey folks

C++. another one of those things I'll never get. C is decent. Objective is decent. What right to exist does C++ have?

none, it's a crap excuse of a language

~tell m0zzzy about welcome.

m0zzzy, http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome

are there any WebLogic experts?

well i never write original program C++ until i learned java

~ask

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

~tell m0zzzy about anyone.

m0zzzy, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.

I'm learning Objective C right now. And damn, it's nice.

surial++

surial has a karma level of 30, NikkiWade

It can do a lot of things which java can't. Nice things. Like statically typed references to methods.

does anyone here uses tanuki's wrapper?

Delegates and selectors are nice too

i read someting onlinecomparing a C++ and Java benchmark and i guess the java runtinme was only 10% slower

~tanuki

surial, I have no idea what tanuki is.

Do explain

~tell DepressGuy about anyone.

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

it's an execution wrapper, primarily useful if you want to run a java app as a windows service

Indeed, and I also love that smalltalk method signature stuff.

only 10% was actualyl very good.. other languages like python was 50% the speed of the java version

surial++

surial has a karma level of 31, NikkiWade

Hi all. I need to to remove and then add a couple of components to a Jpanel to update their contents (I need to construct entirely new components)

To dream…

How do I refresh the jpanel after I re-add them?

ok, do anyone here has a problem with regards to tanuki's software wrapper.log if it limit the java heap size used?

Wouldn't it be nice if Java had such niceties instead of the fugly patches we've got in every release?

i am trying to understand what a JSRT block is.. its a JumpSubroutine that is ussually in to represent a Finnaly block?

Currently, the removed and then added components lock up, and the rest are fine.

well, lots of languages are being JVMified. Who knows, maybe a decentJSmalltalk of sorts will get there. A java-ized ObjectiveC is pretty much Smalltalk anyway as far as I can tell.

older versions of that software have memory leaks related to the logging, yes

You can invalidate() or pack() the component/layout.

amongst other things. My memory is very fuzzy on this stuff though.

I'd get rid of the JVM as well.
Too much baggage compared to Smalltalk's.
Anyway… time to sleep.

Squeak is downloadable and works. Nothing stopping you.

thanks

Squeak is a joke.
I meant real Smalltalk, not Disney-rejected shit that not even Alan Kay screws with anymore.

I admit I haven't actually ever worked with smalltalk. Just sort of liked it, and since working with ObjC and recognizing a lot of smalltalk stuff, liking it a lot more.

erm just a JSR block.. whats happening is the javac is embedding duplicated source (the finanly code) at the end of every call in the try {} block

correct.

i am thinking i'll be able to just convert this to one sane try{}finally{}

we are actually using the latest version, as far as i know, there are instances that the JVM completely stops or it will run the program initially but will not process the program

If you're on a Mac, you want to look at F-Script.

I've never had that trouble. Why don't you stop using it?

at least in the 1.5 javac, that happends. It rears its ugly head a lot with JSPs - JSPs are usually 1 giant method, and a big finally gets replicated a heck of a lot, and at some point you run over the 64k java bytecode instructions limit.

It's Smalltalk for OS X, built-in.

I downloaded it, haven't done anything with it yet.

surial++

can u recommend other wrapper software?

surial has a karma level of 32, NikkiWade

no
but I'd look into what tomcat uses

It's "you", not "u".

~tell DepressGuy about aolbonics

DepressGuy, aolbonics is talking like a retard using speech as if you were on AIM or using single letters for you, are, you are, you're, see, etc. Talking like this is frowned upon in ##java and may result in you being silenced. You have a full keyboard so use it. We don't care if you talk like
an idiot with your friends but we don't want to sit through stuff like this: http://forums.oracle.com/forums/thread.jspa?threadID=499980&start=0&tstart=0

Why can't these people read the fucking /topic?

or any of the various java apps that run as services on windows

~NikkiWade++

nikkiwade has a karma level of 6, surial

It's the ancient unanswerable question of IRC

Between the /topic and the wiki they'd get about 60% of their questions answered.
And it'd save them the bitch-slapping from using aolbonics and wasting our time.

Well you're viewing this quandry too deeply into its evolution. If they were the type of people capable of groking answers from such resources, they never would have joined this channel.

hmm.. that fucking php crap is not working correctly. I hate PHP.. they never work and I have to always fix them (which is not my job description)

so in a way its probly good like that for runtime speed sacrificy memory. i think i am going to make a synthetic call like make it a method like finally$001

given that pointing out flaws in just about any programming language is shooting fish in a barrel, your whining is heartfelt but sort of pointless.

I disagree. Plenty of smart folks are here.
And in all channels.

not asking dumbass questions
totally different motivations

Heh.
Ah, he's back.
Hrm… 12 minutes ’till midnight.

I'm here in the hopes of catching some advanced discussion, and believe it or not, trying to help some peeps out from time to time

That fireworks display was nice tonight.
We carry the advanced discussions elsewhere.

I much prefer to get my answers to regular questions from robotic websites than snobby irc chatters

Invitation-only place.

well, that php code encodes characters wrongly

Indeed.

I started to look closely, every non -ascii character is encoded as \u00000000
and that is a pear library

'u with 8 zeroes?

surial:yeah

What's that about?

well, that's… retarded.

well, it's php, what you could think

replaceAll("\\u00000000", "?");
the places where that won't work are basically completely void, except in documentation talking about the encoding algorithm.

yes, but that does not help alot because I want ä and ö to be seen. So, I have to fix that PHP and change the source program…

yeah.

…so fix it to use UTF-8 instead of that bogus "encoding"?

well, I was thinking that but the code looks ugly. So solution is: writing it from scratch
it's not the first time I'm doing JSON encoder

http://pastebin.com/m4177eae4
does that mean config error or something?

well-formed is an XML ailment. It's also a very googlable term, and any XML editor will point out which bit is not well-formed.

but I didn't edit any .xml its a fresh install tomcat

nice

popt, it might be that you need to edit a .xml

which .xml should I edit, I am not sure…
from tomcat log, i can see the error, but don't know where get wrong

which java.util.Set uses == for object comparison?

IdentityHashSet
and it doesn't use ==. it uses identity HashCode.
which amounts to the same thing, though.

instanceof in java

… instanceof

at least it should be the same.. it will be becuasse i'll use System.indentiyHashCode(this); for hashCode()

you don't need to override hashCode() - that's the impl you inherit from java.lang.Object.
but regardless, IdentityHashSet uses identHash for hashing, and for equality I assume it doesn't check.

well yeah.. i would i guess if i wanted to make it "final" but right thats alreay what would be happening
thanks

do you use min and max heap size for the wrapper

feel free to override and make it explicit. It'll make your code more clear and it has absolutely no appreciable impact on speed.

.
it got quiet in here all of the sudden

well, push any of many buttons and who knows.

dmiles_afk, could you help me catch the error
tomcat log errors I paste above

ok.. i'll look
i think its expecting to find a .jar that declares a class that would have made the xml element a legal element
in the stock config they made refernce to it.. so it should have been a stock .jar

I didn't mess up any .jar files
why tomcat complains about it

you might paist line 11 for the server.xml in #tomcat
if its stock 5.5 i am sure they heard of this
it might even be that you need more -Xmx

to avoid an XML parse error? no.
or if so, SAX is fucking retarded. And the point is, SAX *IS* fucking retarded, but, even it has practical limits to its retradedness.

well there is a users database thing it uses.. that by default people dont set up but it still has to load a class that exports an interface ofr it.. that class i was thinking might be running out of memery.. or couldnt load.. therefore not letting Sax know that it has it propritary
elements

dmiles_afk, line 11 is comment
http://pastebin.com/m411d5f59

Is there a good library of facility or something in java for parsing plain-text config files?

try commenting out 20 thru 23

like, what would be the cleanest way to parse a plaintext config file into variable/value pairs?

popt, just to see if thats what it is.. its idea of what line 11 is.. hard to guess

mogunus, use java properties files?

it may be blind to comments or consider them all one line

~javadock Property

I guess the factoid 'ant property' might be appropriate:
loesh, ant property is http://ant.apache.org/manual/using.html#properties

hmm, not what i meant
~javadoc Properties

loesh, please see java.util.Properties: http://java.sun.com/javase/6/docs/api/java/util/Properties.html

ahh
thats it…

thanks :_)
this is perfect

yea its pretty smooth

~ant properties

elbowed antennae; the presence of a metapleural gland; a strongly constricted second abdominal segment forming a distinct node-like petiole, a narrow waist between their mesosoma (thorax plus the first abdominal segment, which is fused to it) and gaster (abdomen less the abdominal segments in
the petiole).

http://papernapkin.org/pastebin/view/1231 , in java standalone app i could do this but in JSP, i have to modify this since JSP output it to a log. how should i go about doing this? i tried with arraylist(i create a page that called every
array member in a loop), it worked. but how about without using arraylist
a href="http://papernapkin.org/pastebin/view/1231"http://papernapkin.org/pastebin/view/1231/a , in java standalone app i could do this but in JSP, i have to modify this since JSP output it to a log. how should i go about doing this? i tried
with arraylist(i create a page that called every array member in a loop), it worked. but how about without using arraylist

Hm?

while (rs.next ()) + "in JSP"

Oh, eww.

hehe gotta agree a bit there !

He should clearly be using the sql taglib!

ohh i should?

mm in jsp its just out.println("lollerksates");

~slap DRMacIver

DRMacIver, you have been slapped, thank you, please come again.

well i would code the database stuff in a servlet and use a datashuttle to present the result in a JSP

but i would suggest usign a taglib or a db framework for that

if you promise to rewrite this so the JDBC stuff is really, really far away from any JSPs I'll tell you the answer.

oh yeahh i forgot to tell, the code in the pastebin is in a javabean
what do you mean by that?

What loesh said. Build up completely stupid, logic-free state beans in a servlet, then use those in the JSP
by the time the JSP stuff runs, the JDBC connection should be closed and gone
(Ideally in some servlet-agnostic helper class that you call from a servlet)

any example code, ojacobson?
supposely all the outputs should be handle by JSPs and only the process is done by servlet/javabean stuff right?

Whaaat? *innocence*

in the JSP, it's still pretty nasty

Ignoring for the moment the questionable wisdom of retrieving the password from the DB, you should probably have a User bean with two properties

yeah, and that's what im doing now right? which is totally not a sexy code at all aight?
haha yeah, password is just a example only, ignore that please

Create a whole run of those from the DB during the servlet processing, and either put a list of them in the request scope or put another object holding a list of them in request scope (semantically equall)

can't get it working, but still thank you dmiles_afk

err you mean I should create arraylist? that hold id, password is it? sumthing like taking data from db, put them in an arraylist?

hi

i've done that actually, i thought it would be a bad idea(which is totally from my logical point of view, and im not a programmer or sumthing like that)

I'm trying to make a "dictionary" that maps letters in ASCII to UTF-8 symbols

actually, it's a good idea… it means you can verify that you have all the data before you present anything to the user.

which is the most logical way to do such a dictionary? String[]?

~IdentityHashSet

If you have enough state on one page that you're *really* worried about memory constraints, you should probably not have it all on one page

dmiles_afk, I have no idea what IdentityHashSet is.

~java.util.IdentityHashSet

dmiles_afk, I have no idea what java.util.IdentityHashSet is.

~javadoc IdentityHashSet

I don't know of any documentation for IdentityHashSet

~javadoc IdentityHashMap

ojacobson, please see java.util.IdentityHashMap: http://java.sun.com/javase/6/docs/api/java/util/IdentityHashMap.html

i guess HashSet is the same
or i can put the thing in in the Map with itself as the contents

^^ that

i see. what if i had to modify a row, should i modify the "cache data" or modify directly to the db? which is the better way?

Personally I'd have separate "modify" and "view" stages
Modify the DB, next time you go to view get the new values from the DB

or should I use some sort of List thing?

to the UTF-8 encoding of the same letter?
eg the 'a' character to the byte[] containing UTF-8 of 'a'?

ojacobson, nope, romaji conversion

I'd just use a MapCharacter,Character

latin characters to Japanese hiragana/katakana

okay got it. thank you.

~Map

http://java.sun.com/docs/books/tutorial/collections/interfaces/map.html

i'd expect you need to map multiple ascii chars to the one hiragana/katakana char

might be more appropriate

wouldnt that be character, string :P ?

No, he means what he said

n

yeah, i see he wants to do it from latin

ojacobson, yes
a friend of mine complained he can't input hiragana at work

aha

so I'm thinking of making a small tool to help him

then yeah, you'd want String, Character

[and teach myself Java]

looks like what I might need

Preload it at startup from a mapping file (possibly a Properties, possibly not) and use it to look up entered phrases

surely the conversion process is more compliated than mapping sequences of letters to characters? are hiragana/katakana phonetic?

jottinger, yep
er, joedj, yes [if I understood what you asked]

i guess the question was wrong

katakana and (particularly) hiragana are actually very regular phonetic alphabets

romanji is (i guess) a phonetic representation of those chars, in ascii

joedj, yes [if you use Nippon-shiki]
other romaji styles are messy

hmm
it's possible jbossws' automatic WSDL generation is not as clever as it might otherwise be
java.net.MalformedURLException: no protocol: REPLACE_WITH_ACTUAL_URL

heh

The funny part is, I've tried three different jboss releases in as many hours and they've all had different, uh, quirks

be ordered?

the Map interface makes no promises about order
TreeMap is ordered by key if the key is comparable, or by a custom comparator otherwise
LinkedHashMap is ordered by insertion
Both implement Map
HashMap is usually what you want, but it implies no ordering at all

I mean… does it have to be? will it make it slower if it's not ordered?

It Depends
For the various HashMap implementations, no
TreeMap may have to rebalance more or less often depending on the order you insert things in, but will maintain order on its own
uTreeMap may have to rebalance more or less often depending on the order you insert things in, but will maintain order on its own/u
good man
Map itself is an interface. You probably want HashMap for the implementation class; ideally the rest of your code should just refer to Map though.)

I know this will sound entirely stupid question, but

TreeMap has higher complexity than HashMap for random access. you only want it ordered if you find yourself getting map.keys() and sorting them often

pair to the (Hash)Map?

foo.put (a, b)
later, retrievedB = foo.get (a)

ojacobson, but since I have a fixed set, I don't need to set them one by one
is there a bulk set something :P

you don't have a choice, really

Only from another map

:/

there is no literal map syntax, like there is for arrays

You should probably load that set from a resource file anyways

OK, not what I wanted to hear, but I guess that's what I needed to know

easier to update if you don't have to drag javac out

no problem. here you go:

= new HashMapA, B{{put(someA, someB); put(someA, someB}; etcetcetc}};

make sure to use 2 {{ or it won't work

ojacobson, resource file would be…?

that is simultaneously the grossest and coolest thing I've seen all week.
Also, you forgot the ()

surial, oh, that looks cool

Properties file is maybe more common

so you figured out how it actually works?

sure, I've used jmock before

ah, yes. correct.
ojacobson:

what the hell? =P

I love object initializers. No one knows they exist. Or at least, most people don't.

They're limited, but if you can do what you need with them they're pretty cool.
If you don't mind the extra bonus anonymous class.

at which point are they executed?

ojacobson, is there "()" missing from what surial told?

you can use a Properties object, though that is only string-string mappings. And you can get any file straight out of your classpath, even from a jar, Using ClassLoader#getResource

when the new object is initialized, before the c'tor is invoked (iirc)

after the superclass constructor, before the current constructor?

Yes - between the first { and the last

that sounds sane

so it's new HashMapA, B(){{ /*bunch of put statements here */}};
sort of.

surial, thank you very much!!

but after the current class' field initializers? =P

if someone can look at this ant tell me why i get an error when i use an image bigger than icon size it causes a memory problem, http://pastebin.com/m28c96d9a

CONSTRUCTOR). And if there's a chain of inherited classes, that whole trajectory is run for the superclass first, then the next superclass, etc etc

and initializing a value on an attriburte? that's ALSO an object initializer.

why soo many blank lines?

660 lines of code and no main()?

so it gets run intermixed with field initializers, as they are the sme thing

please give an example we can run and see the problem

e.g. public int foo = 5; is the EXACT same thing as: public int foo; { foo = 5; }

image handling can need lots of memory use the -Xmx switch to give the jvm more heap

you can even have multiple ones spread all around your class file just to really make your code look screwed.

why must you tell me these horrible things?
I mean, I knew that, but I'd blocked it out!

but… but… it's funny!
not to mention it makes for a wild java puzzler.

except that you can't call non-static methods in a field initializer, afaik… :/

the script is from a sourceforge project TinaPOS
this project needs a lot of help

No, you can't, because your object hasn't been constructed yet.
but the put() method you're calling in that hashmap hack is in super(), and super is not off limits.

hrm

in the sense that the bit of your class def from superclasses HAS been initialized.

surial's a bad man

put() is also valid in a field initializer of a subclass then (assuming it had a return value) ?

he's right, though. It's just going to confuse a lot of people who read your code

yes.

i see

except, indeed, without a return value you're SOL.
Though put has a return value, no?

i think it's void

boolean on whether or not it did something?

ojacobson, what happened? what did I miss?

~javadoc Map.put(*)

ojacobson, please see java.util.Map.put(java.lang.Object, java.lang.Object): http://java.sun.com/javase/6/docs/api/java/util/Map.html#put(java.lang.Object,%20java.lang.Object)

~javadoc java.util.Map.put(*)

surial, please see java.util.Map.put(java.lang.Object, java.lang.Object): http://java.sun.com/javase/6/docs/api/java/util/Map.html#put(java.lang.Object,%20java.lang.Object)

damn.
V - old value.

V - previous value for K

see, I win.
ha!

I saw my line first
I call it a tie

hmmm, clearly some echo in here…

damn.
you won the javabot draw.
so you win :/
~ojacobson++

ojacobson has a karma level of 12, surial

~surial++

surial has a karma level of 33, ojacobson

Normally I hate karma, but it'd be rude not to reciprocate there

Yes, java absolutely needs map literals.
the fact that my arrogant, condescending, rude, and foul mouthed ass has a karma of plus 33 is plenty of evidence it's a joke.

the initializer trick surial showed you takes advantage of some of Java's less well-lit corners. It's perfectly valid and will never break, but I guarantee you you'll confuse the first poor sucker who comes across it.
I know, what the fuck's up with that bullshit?

Yeah, but it's a great trick.

ojacobson, eh

I doubt it'll be confusing

ok, surprising

Although personally I just wish Sun would stop using the PURE EVIL that is returning void and start allowing for method chaining.

The code is clear. The intent is logical. It might trip some people up as to: How the fuck does this even WORK?!?… but when they run it and eclipse gives the all-clear… no problem.

#smalltalk is –

some surprises are good, like a birthday cake, others not

I've never actually used smalltalk.

that's like the legitimate twin brother of "it compiled, ship it"

Actually, defaulting to 'return this' for void is bad. But lots of methods that currently return void shouldn't.

ah. The default return in smalltalk is 'self'.

Yeah, I know.

case in point: There was some confusion as to if put() returned void or something else. Well, no confusing for me, but I digress.
not quite.

it compiled and passed all the unit tests

there's a difference between: I don't grok this code, but it works, so fuck it, and: I grok this code, I just didn't think it would compile, but it does, so it's valid. fuck it, ship it.
unit tests are for wimps.
admittedly the second thing doesn't roll around often, but the {{}} trick is the poster child.

java doesn't have the linguistic hoo-ha the haskell community uses in their tests

True. I'm sure there are places where returning void is appropriate. It's just that there are far fewer such than there are places where methods return void.

haskell?

What about Haskell?

Oh please. unit tests in haskell is no longer the territorry of wimps..
it's the territorry of sheer, outright pussies.

otherwise my unit tests would be foreach X in (some type) object.method (X) == Y

You've obviously never seen Quickcheck!

It takes a lot of effort to write buggy haskell code that bugs in non-obvious ways.

hi. I have a jsp/taglib question… I would like to make a custom tag that prints the name of the jsp-page that used the tag. and I can't use the request-uri because most of our jsp-pages are started using forwards. anyone? I know how to do this in the jsp-page, but I want a tag

hmm i don't use java much

or you could be a noob, it happened to me

unit testing in haskell is silly

I have seen quickcheck. implementation: gorgeous. point: none.

you can prove that code formally =P

Hi, I'm about to develop a web-based administration system, and I like to use java. Earlier I have used tomcat and struts. What would you recommend?

GWT and jetty.

Not really. Haskell doesn't have a formal semantics.

prove anything nontrivial involving monads or IO ()
you *can*, but you won't really enjoy it

It does seem to be possible to create bugs in Haskell. It's just a lot harder to create bugs in *small* Haskell programs.
GHC and HAppS seem to generate quite a few for example.

i was kidding

(Actually, I'd really like to have something like quickcheck for Java)

nothing portable, look at your container's APIs
The portable definition of JSPs treats the file as a mere implementation detail; it's probably compiled to a servlet at runtime anyways
*at or before

how would you do it in the JSP?

Nono, it's possible to create bugs in haskell, but like any static language, the usefullness of the shallow testing provided by unit tests is near zero. and haskell's EXCELLENT type system means the usefulness is lower than virtually any other lang.

imo 70% of the value of unit tests comes in learning to translate bug reports into one or more of them
then at least you get some automated warning if you bring the bug back

sure.
nah.
that never happends.

some, not complete
*giggle*
Sure, and nobody here has ever fucked up 'svn merge' before.

at least, approximately never. Compared to the time put in.
I never do.

It'll happen.

mostly because I don't use SVN. piece of hsit.
git is nice.
and it's really REALLY hard to silently screw up a merge.

On the other hand, Haskell's EXCELLENT type system means that the effort required to create unit tests is lower than virtually any other language.

I'm a bit biased; our current release process is actually three complete versions behind our dev cycle now, so there is a LOT of merging going on

And because you can express them purely in terms of invariants, they serve strong documentation purposes as well.

Testing is the act of consciously trying to break your app. You're a smart fella. Go break shit. If you feel the need to write some code because that's the easiest way to accomplish this: GO nuts, write that unit test. That's the reason you do that.
That is completely removed from the koolaid that the unit test guys push

I actually do write my tests first
but not because of the reasons the kool-aid vendors give
more because it forces me to think about modularization

i'm not sure how the type system affects the usefulness of unit testing? it just means a whole lot of tests don't need to be written that would otherwise be necessary

Now I'm confused. What's "them" in that last sentence?

The tests.

If I open eclipse right now on my project…
I see a nice clean slate of no errors, no warnings.

You can write them as "This condition always holds. Quickcheck, smallcheck, go try and prove me wrong!"

this is no guarantee whatsoever that the app is bugfree.

sure. that says nothing about logic bugs, though

HOWEVER, it is a guarantee of sorts that a large number of easy 'd'oh' gotchas have been eliminated.
This is the same thing unit tests do.

i don't agree
unit tests in java don't do that, because the type system does it for you

and that's probably why dynamic meta programming language afficionados are so in love with unit tests.

*gnk*

Hence my point.

Java's type system is very hard to make assertions about

unit tests are for wimps.

The purpose of both types and unit testing are not to prove a program bugfree, but to demonstrate the absence of certain classes of bugs.

Comments

« Previous entries · Next entries »