Archive for Uncategorized

You work at a company as a developer You are given a project that entails a registration – login system as well

some_function();

either calling unset($obj) or assigning $obj = null doesn’t seem to call the __destruct() method

contact them

the code above doesnt work of course

mace – i figured somebody here might have some idea
of some examples of how it might connect

gnat42, that’s because a reference of the object still exists somewere

can you edit php.ini?

no
its just cPanel shared hosting

s,of the object,to the object,

doh

have you connected to a database?

no, i can’t connect
the thing is..

What is your error?

then I must miss understand how it works, because I’m looping

when i go to add a new database, it is an ‘ODBC Datastream’ that i create

and at the start of the loop I assign the variable
and at the end, I call unset on it

have you *ever connected to a database?

on my own linux servers, yes it works perfectly

gnat42, an object is destroyed when no more varible references it

ODBC is “cross-platform drivers”

when i create a new ‘ODBC Datastraem’ it doesn’t ask for a username or password

I only ever reference it by one variable

it may be linked by domain

gnat42, pastebin your code please

it is an inherited class
okay

Mace im so dead

http://hashbin.com/731c.html

Mace – how does that affect the connect string?

aa^way: debug, find out where it stops

I’ve trying to find a ‘memory leak’

in no way at all

because that loop increases memory consumption on every iteration
unless I uncomment all assignments to the $client variable

can someone help me try to fix a data connection already open error for ftp, the errors are shown here, http://pastebin.com/d75955205

the $client variable is a 4th level subclass to a ORM system and I think it is leaking the memory so I want it to call the destruct function so I can try to release it

coudl somebody who is a genius at arrays give me 5 minutes please

gnat42, could you please reduce the code to a reproducible case ?

ODBC are just drivers

Mace well it is not stopping. it just doesnt load new info from server with ajax, in mozilla it does. i dont know how to fix it humm.. ctrl+refresh doesnt do also job, but might be that im at IE4linux

at the moment i use mysql_connect(“localhost”,”username”,”password”);

sure

so i tried connecting without a username or password and it says
mysql_connect() [function.mysql-connect]: Access denied for user ‘ODBC’@'localhost’ (using password: NO)

aa^way: console.log the variables at every stage with Firebug in FF
aa^way: find out waht’s going off
whats*
contact their support if you ask me

ya its just that they’re in Vietnam
and don’t speak english

great choice of web host

it was the best choice

get yourself an english speaking host for $1pm

it is not for me, it is for a customer
i already have my own servers in europe

and just use it for the mysql

sure you do

but vietnamese internet is really bad when connecting outside vietnam
Mace, is that sarcasm?

http://hashbin.com/7322.html
the destruct function doesn’t get called until after the loop is complete

bah keep closing this by accident

gnat42, can you paste the class definition ?

sure, but it is empty, its a fourth level subclass used simply for overriding the generated class
so Client extends BaseClient which extends Doctrine_Record …
the issue is most definitely in the Doctrine library I’m using, but I was hoping to pin point it by getting the destruct function called and releasing/resetting it somehow in there

gnat42, one of those subclass have to hold an copy of the object itself as object property

I see
so something like $this-_copy = $this; ?

yep, well that’s not a copy but that’s another variable that references the same object
those circular references are not well handled nowadays

hmm, any idea as to how to find something like that
can reflection or something like that give me a hint where its happening?

it has to happen inside the constructors and/or the methods the constructor calls
(in your case)

right, that should have been obvious
thanks
I’ll dig some more
much appreciated

gnat42, by simply var_dumping the object, you should see where the recursion is

var_dump

Maxdamantus, var_dump provides more informations, so it’s a better alternative to print_r when it comes to debugging…

Only the array count.
And the variable type.

and the strings’ length, and .. and …

var_dump is yuck though.. Just the look of it.
Generally, you wouldn’t use print_r for anything other than debugging either.

print_r(null); print_r(“”);

not that good for debugging

aew galera! alguem pode me ajudar?

___TIAGO___, english only here

ok
sorry
I boy’s ! I have one problem! do you help-me?

simply ask your question

Boys? One problem? Do we? Ask the question!!

one problem in my page of Send e-mail
wait =D

php6 zend_is_callable the 3rd argument is now a zval how do i convert a char to zval

how can a file know if it’s been included by another file through include or require, as opposed to being browsed to by the surfer?

require_once, include_once
ahh
hmmm, I’m not sure how one would detect that in PH
… PHP

[sacabonos]: pvt
[sacabonos]: sorry xD

Alanius, just define a IS_INTERNAL constant in your frontend pages and die if it’s not defined in your include files

[SubFreeze]: pvt. look
ekneuss look pvt =/

I don’t get it

hi people, i have a question for u, not about php itself, but about the writing-style. When i indent my php files, i have alot of pure html and im not sure what the best is to do, indent php or html or both? thanks. And anyone got an good indenting course for writing nice code? thanks for your
time.

there’s a problem in my page with the e-mail sending system.

is this ok? http://pastebin.ca/652391
thanks

There is no right or wrong way to indent one’s code. As long as it works, and is easily readable, then you should be fine.

img style=\”margin-top:4px\” src=\”asdf\”
stuff is dynamic^^

thanks for your answare But what does u guys preffer?

hello, is there a graphical way to edit php.ini like a webpage or something?

logik-bomb: looks good – just taught me something new – prevents sql injections aparrently – just read up on it

could someone get a check at my page code?

hasn’t taught me to spell properly though

how would i convert ‘email%40domain.com’ to email@domain.com

Personally, I indent my HTML and any other markup as well

so you basicly indent both the same way? Isnt there some kind of layout of how a man should write his code? Im pretty good (not saying im an elite) at php, but my code is messy and a structured way to write code-tutorial would be great.

The layout/rules I use for styling are kind of in my head :-)

okei, i guess the answare is that i need to write code i think look good

http://phpro.org/tutorials/PHP-Coding-Style.html
Not sure if it’s any good, but I just came across it :-)

thank u sub

Anone know vimeo video downloader? Bah google gives old ones, vimeo has updated their system

You’re welcome

so your advice to lilminime re indenting was ‘theres no right or wrong way to indent code’
that’ll be helpful
he’ll probably start writing with if statements indented 5 tabs in from the actual body of the if statement.

And your advice was? :-)

my advice was ‘away from computer’
hehe

Lol
It seems every project I work on has different “rules” so I told him to do what he felt looked good

I want to develop a web application with 125 tables, can php support all that?

Yes, can your hardware? :-)

you mean database tables?

yes,

if your database can support that..

someone told me that php doesn’t work so well with a great amount of tables. I will use MySQL?
then, I don’t have problem using PHP for it, right

X3rus, wikipedia uses MySQL (IIRC)

why do you have 125 tables?

is a web application for a company

quick question for you

well, that does not answer the question

unset($obj) should call the destructor on that obj?

so it doesn’t depend on php, it depends on the hardware and the database

granted that the obj has no other references to it?

hm, can i crate classes at runtime?

yes..?

how?

class A { }

rza, that’s not at runtime, that’s at compile time

ah true

i need to dynamically create a new class

but php files are compiled all the time

with a certain dynamic name

ahmmm why ?

every time you include a file it’s “compiled”

TehSausage yeah, but the point is that i don’t have a file with the class def in it
easier phpunittest creation..

you could make it generate a php file, include, then delete it :P
or maybe runkit has something like that
can you use $x = new stdClass(); $x-test = create_function(x,x); ?

hm
i’d need an include that takes a astring and interprets it
but there’s nothing like that in the doc

return $x.’!';

?

? i don’t see it creating a class def
im so stupid
eval()
http://pastebin.ca/652434 what i was just working on – simpler creating of test suites than the default

Hi
My phpinfo() is looking for php.ini in a non-existent directory (a wrong one). What should I do?

hi there

is there a way to change where php looks for php.ini?

i’ve created a mysql table. I specified default values for every field. when I make a request like INSERT INTO table VALUES(…) how can I insert only one field and let others take the default value of MySQL ?

Is it possible to use a class that is set ($class = new class in a php file that is included? At the moment php messages: Fatal error: Call to a member function loginbox() on a non-object in /opt/lampp/htdocs/ezy/index.php on line 16?

I think that is a compile time option, and if using the cli you can give it a flag

in apache2, you can set PHPIniDir

otherwise for apache you’d have to set it in apache.conf

Specify only the fields you want to insert values for

Nasky – INSERT INTO table SET col1 = val1

I don’t want to set the class ($class = new class in the master (that file that includes) the php file in wich the class is set

INSERT INTO table (col1) VALUES (val1)

(I’ve never liked the VALUES format … )

INSERT INTO table (field2, field5) VALUES (‘aa’, ‘bbb’)

as long as you include the class definition before instantiating it, you can do it wherever in your code.

hm doesn’t work

!doesn’t work
!+doesn’t work

thanks guys

you have to be more specific than “doesn’t work”

yes, http://nopaste.info/321e99caee.html
was already creating nopast

i’m looking for a way using preg_replace to replace any amount of _ characters into a single one. For example te____t__sdf should become te_t_sdf.

you need to include the file with the class definition. I do not see that happening.

one more question can i set a default value for a DATE field in MySQL ? because I tried to et “0000-00-00″ but it seems not to be accepted

#mysql

I skipped it in this version.. it is included

Burhan, ohh ok thx

it is not being included, which is why you are getting that error.

ok.. mustbe right. because it is included via an other class

anyone have any idea

I gonna check the including
thx
But.. the problem is.. if i start the class in master file by $class = new class; then everything works

that is not the problem, the problem is you need to include the class definition, instantiate it, then call a member.

and it is obviosly not possible to call a member in a file seperated from the class definition and instantiation. Because it is included.. really

how can you have a member definition outside the class? That would just be a function.

php include ‘myclass.php’; $obj = new MyClass; $obj-member(); ?

Just to reply I tried using PHPIniDir in the httpd.conf file but it made no difference to the ini directory in the phpinfo() listing

- Or I’m just incompetent

I think the latter

I can’t reap it! With a different class this approach seems to work

http://www.ginawildganzprivat.dl.am/

!isset and empty is the same thing ?
if(empty($_SESSION['id'])) it’s not like if i do if(!isset($_SESSION['id']))

no, isset and empty are different
http://us.php.net/manual/en/function.empty.php

this is valid right? “array_name[][index_1]=5;”

as a string yes

how about as php code

if index_1 is a constant and array_name is prefixed with $

yes, both of those are true

sure then
$arr[][][][][][][]['index'] = 5; is valid, just a little odd

is it possible to execute c libraries in php?
anyone?

Think you can with PEAR

how is that jonathan?

I wouldn’t know sorry
I just read about it once

i see

v5 or re-engineer the c lib to be a php extension
perhaps just a wrapper

pecl.php.net/ffi

Thanks TML I think that is what I was thinking of

ffi is a package not defaultly installed?

a bit out of date/unmaintained by the look of it

i dont see much info on the site, i wouldnt know its what i am looking for

Maybe pear has a simalar one

No
you couldn’t even do it from PEAR

huh? i dont get it

What don’t you get? If you want to call arbitrary C libraries, use the ffi module. It’s still in alpha, so I wouldn’t build any mission-critical stuff on it, but it’s there

Hi all. I’m trying to generate a calendar grid for a given month (current). Is there a simpler way than taking today, scrolling back to the first day of the month, scrolling back to Sunday, iterating forward to the end of the month, and then padding out to Saturday? That just feels like there
should be some easier method.

(My goal is to get an array of all the days that will be in the grid, then array_chunk() to 7 elements, and then render that as a table.)

TML, where can i find the “ffi” documentation?

There’s YUI’s cal widget
inside the tarball
That’s pretty easy

Yeah, I’m not looking for a JS widget.

ok thanks

I’m looking to generate my own table for it. (Particular reasons for this case; it’s not a UI thing.)

TML… never really used either, never had the reason too. I guess that’s where I go wrong.

PEAR is a collection of PHP scripts. PECL is a collection of PHP extensions written in C.
Well, every month will always start with ‘1′

Well yes.
But not on the same day.

So you’re trying to figure out what day of the week the month starts with?
php.net/date

The calendar grid is always 5 lines, with Sunday in the first column and Saturday in the last, padded.

perhaps as a start you could store the array so you don’t generate it all the time and use the date function TML has linked too

I am very good friends with date(), yes. :-) I was just hoping that I there was something easier than lots of iteration.

easier for what?
It’s not clear to me why you need “lots of iteration”

Scrolling back to the previous Sunday from the first of the month, unless it’s already on a Sunday.

What do you mean “scrolling back”?

hi, is there a way to change a method of the parent? class myclass extends parentclass…

just define over it

If the method is public or protected, you simply redefine it.

Crell ok thanks

http://uk.php.net/manual/en/function.cal-days-in-month.php will help I think

Yeah, saw that. I don’t have the calendar extension available, though. :-(

Well days in the month doesn’t change much… just write a short script

You need the number of days in a month? Ask date for the day of the month for day 0 of month+1
Feb 0 == Jan 31
etc

And that’s end-of-year and leap-year safe, right?

yes

Hum…

can someone help me out for a sec
http://phpfi.com/255546
what am i missing?
must be like some ‘

comma
$_POST['name']
place a comma after that

bah thats it
hehe
thx

Filter input ok tea cya later

You also dropped a $

still didnt work though

Inside of interpolated strings, either don’t quote your array keys, or use {}
{$_POST['foo']}
You also REALLY need to learn about SQL injection
This script is hacking a great big “hack me” sign, and someone eventually will

hrm
what exactly does that encapsulation do?
http://phpfi.com/255547

same old same old, i see?

those are the two files, i reedit them
one is the form to submit…the other is the submit action

pear.php.net/html_quickform may help you with your form rendering and validation needs

which module i need to work with pdf files?

fpdf or fpdi

f00li5h, how to install it under linux?
imean do i have to compile php with some support or need to isntall some package?
its rpm base distro

foolish how do i install html quickform?

they’re pure php’

or use it

pear libraries are pure php too, you can just snag them and stick them in your include_path

oh
what exactly does this do for me?
ive heard of pear
im just trying to learn in depth php

pear is just a bundle of useful php classes that you can use

from a business aspect…not exactly a full tim eprogrammer aspect

html_quckform does forms, with validation ruels and the like

how would i call on it?

include ‘html/quick_form.php’; $form = new HTML_QuickForm();
the rest is in the docs on pear.php.net

ah
does the html qucikf form file need to be within the root web dir?

no, it needs to be in the include path

except the file i just a file 0[1] type

you generally wantn to keep libraries out of the doc-root

okay

it’s paranoid, but you should try to keep everything non-public out of the docroot

there are multiple folders in here…what of all this do i need?
element, datasource, container

folders in what?

files (php) node.php, factory.php
exception.php
etc
in the quickform2 folder
says quickform was superceded

install the PEAR module first
yeah, one is php4, the other a php5 rewrite

which should i use?

if you’ve got php5, try html_quickform2
i’ve not tried the rewrite, so i’m not sure of how stable it is, the docs should say
it says html_quickform2 is in alpha, so i’m not sure how trustworthy it is

okay i just installed the first one
now that the mod is installed then what?

it’s just a bundle of classes

i used pear install html_quickform

the docs say how you can interact with them

that parts done

excelent

does that mean i have to download the package information now? or is that done with that command?

pear will have installed it into /usr/local/pear
the docs will show you examples of how to use the classes

okay
seems confusing

there’s a quickstart

quckstart?

under end user docs
http://pear.php.net/manual/en/package.html.html-quickform.tutorial.php

oh nice i see that

you create a form object, then add fields to it
then you just have to check if the form is valid, and render/process the results accordingly

I have a question about php6

there is no php6
wrong channel
join #fantasy

wrong php6-dev branch

right
sounds usefull

not really its still being developed

or wait.. actually not rly

its not finnished yet

ugh I ran a script with php file.php & and now when I try to run it again it doesnt run or print to terminal

does that script use locks of some kind?

well I think I figured out why I’m not getting any error messages at all
Broken pipe –
pdo is freaking out

No.
It doesn’t debug or anything now.

f00li5h i still cant figure that shit out heehee, 5 hourrs now fucked with it

aa^way: that ajax cruft?

yer

what does the script do?
aa^way: find a library that already works

Broken pipe” when using pdo?

nope, which db you using?

postgres, unixODBC connection

It

very likely a problem with your unixODBC driver

It’s just a bot.

can you not just use postgresql directly using the postgre driver?

I think the & messed it up or something it doesnt debug or anything
:|
not even connect

Does anyone have good information about sending better emails through mail() function. Pretty sure its better MIME types, but I dont know much else about it.

I don’t understand why, I can connect to the db with isql just fine, and other apps use the same dsn with no problems

I’d perfer to send Rich Text / HTML emails

ah hrm

how can i call a script to run in the background? i’ve got a page that updates a user’s profile, then I want to call a php script that performs some database maintenance that may take three to five seconds, but i don’t want the user to have to wait for it to happen or to even know it’s
happening

friday \m/

trevord
Linux or Windows?

linux

for your server?
You’d want to run Cron jobs then.
Crons run at specific times in the background.

can’t i invoke the job from my script?

how can i access protected members of the instance of parent class from extended class in php5?

You want it to run timely maintenance?

reenignEesreveR, through $this

well, i could do it that way, but i don’t think updates will happen that often, i just want it to run the maintenance kind of thing as soon as an update is made

Well… I mean the other way is to make a complex function
And include it at the end of your “update”

cstockton, doesn’t work for me

you know?

hrm?
you’re writing an ircbot?

yea

but if the user navigates away before it finishes, will that screw it up?

Does anyone have good information about sending better emails through mail() function. Pretty sure its better MIME types, but I dont know much else about it. I’d perfer to send Rich Text / HTML emails

reenignEesreveR, protected properties are accessible from a child class, but not private

cstockton, do i have to redeclare it in child class?

oh

reenignEesreveR, no, it’s inherited

i tried daemonizing it with & and now nothing works

Does it literally take 5 minutes? I guess the better question is what kind of operations does it need to do?

does it have a log it writes to?

no :|

also, backgrounding it in a shell isn’t quite enough to daemonise it

paste ur code in paste bin

no it takes more like 5 to ten seconds, it does some cache clearing and updating

it just does like monie$ file.php monie$
nothing

ps ax, does it show it?

I know what youre saying, in not sure exactly how to produce the results you want, if its even possible… but hold on 1 second

i could do a shell_exec(‘php script.php’), i wonder if my shared host would allow that, they give me shell access…

No.

I know wget will execute a script on the server too.
I had to use it to make cron jobs work.

so it exits tehn

hmm

If you can send a raw unix command from php to the server

you’re runnning scripts with wget?

You mayget the results you’re looking for.
Im running a quick cron with it. Implimented it 6 months ago.

urgh

Did a search and its the results I got.

I found what was wrong. :|

you know that means other people can run your script too, right?
yeah?

It’s not the &, the weather script was locking it up.
:|

ok, thanks, i’ll try that, the only issue would be if php waited until the script was finished before continuing
but i’ll give it a try

Thanks for helping f00li5h.

it may run it once the comman is parsed

I tried using the weather parser pear module

The script updates a day counter each day for “job postings”
It’s not a big script im worried about, but im not deadset on wget
I would change it for something better if i knew something better to change it to.

hi, I have a question about arrays

This right here messes it up.
$weather = &new Services_Weather();
$wdc = $weather-service( “Weatherdotcom” );

I’ve put an array inside a function because I want that array to be available to different files. I’m using function showarray($arrayname) { $$arrayname = array(); $$arrayname['key'] = ’some value’; } – but this doesn’t seem to work, any ideas what’s wrong?
(basically it just provides an empty array)

maxo, why not just define the array in a file in the global name space

what do you mean?

maxo, and include the file as needed

I guess I could do, I’m just kinda curious as to why it’s not working in the function though

maxo, are you returning the array?

yes, I’ve also got return $$arrayName;

hey guys, is it true that some servers don’t allow htaccess files?

maxo, paste your code in paste bin

ok hold on a sec

What’s wrong with this line,$weather = &new Services_Weather();
$wdc = $weather-service( “Weatherdotcom” );

http://pastebin.com/d7270348d

maxo, I am not sure variablevariables is what your wanting here
maxo, and using global is not the best idea, better to use the return value

it’s so I can specify a name for the array

maxo, Are you, building some things for this array?

and beneath where the function is called, I’ve also got asort($myArrayName); and if I remove global, I get: Warning: asort() expects parameter 1 to be array, null given

maxo, you might want to do something like $thearray = showarray(‘whatever’); asort($thearray);

aha

the problem with variable variables and array, is the value of the array changes

cool, got it :-)
thanks :-)

php manual says if i start a program and want to leave it running in the background, i “have to make sure that the output of that program is redirected to a file or some other output stream or else PHP will hang until the execution of the program ends.” how i do i redirect output to…nowhere? i
don’t really care about the ouput and want to completely ignore it

/dev/null on linux

what about adding & to the end?

/dev/null?

yes

ok, thank you

you need to background it, and redirect it’s standard error too

that will take the result and then send all the text to nothingness

would ls -l & also work?

there is more to do yes, but thats basically it
no that would just send the process to the background all resulting text would still apear in the console

ah ok

you either need the output of the command or your running one and don’t care about the output then you can direct or pipe it to /dev/null which is nothingness or to a file with the same command but put the path to the file there.

and | (pipe)?

is a bitshift. | is a logical OR

overwrites, and | sends the data to a different program

of course, you were speaking in terms of PHP, since we don’t do linux shell stuff here :P

overwrites stdin

Hi, I’m using /*
Hi, I’m using eval(“\$” . $allents[$i]-tagname() . ” = \”" .
utf8_decode($allents[$i]-get_content())
.. “\”;”);
*/
ok, that went bad, sorry

so im still trying to figure out

| takes stdout from something and sends it to something elses stdout

whats wrong with this line?
$insert=”INSERT INTO que (name, desc, date, offer, email) VALUES (‘$_POST['name']‘, ‘$_POST['desc']‘, ‘$_POST['date']‘, ‘$_POST['offer']‘, ‘$_POST['email']‘)”;
mysql_query($insert);

something elses stdin rather

http://pastebin.ca/652598 — why does that display an empty array only ?

nickelnick, you’ve got single quotes inside singlequotes

aarcane, seems like a problem with ur for loop

so $_POST['name']; without the ‘
in front and behind

I’m using domxml_open_file to open a xml file to parse (still using php4 for this). If I have a invalid XML file that will not work and some of my clients use & char inside XML file. Can I solve this with some function?

#
for ($i; $i = -5; $i–)
should be $i = 5

reenignEesreveR, I don’t know why, it loos right, i, each time through decrement i, until i is less than or equal to negative 5

i is zero initially, condition $i = 5 does not satisfy anytime so loop is never executed

reenignEesreveR, no, I’m working with negative integers

so then what is wrong with….

$insert=”INSERT INTO que (name, desc, date, offer, email) VALUES ($_POST['name'], $_POST['desc'], $_POST['date'], $_POST['offer'], $_POST['email'])”;
mysql_query($insert);

reenignEesreveR, oh, that has to be TRUE ? I thought it stopped when it became true :-S

your for loop is incorrect hehe

yeah, I tweaked it, and I got it working
but I got my negative index array working fine, thanks

you want ($i; $i = -5; $i–)

nickelnick, it should be like VALUES (‘{$_POST['name']}’,'{$_POST['desc']}’ …

anyone?

in SQL query, ur string values must be single quoted

oh

nickelnick, please read about mysql_real_escape_string
nickelnick, that query is unsafe and could be used to hack you

so i should use the one that reenign said?

nickelnick, sql inject is a better word then hack, but I like it to sound scary

nope, do something like $safe_name = addslashes($_POST['name']) first, then put $safe_name in ur query

reenignEesreveR, addslashes is better then nothing, but realescapes tring is better
reenignEesreveR, it escapes things like \x1a and \x00

i have rewritten a large web application written procedurally, to OOP.. I have tried VERY hard to avoid global variables and have been successful until today.. I have a few basic user settings like their timezone, etc. that I would prefer not to PASS to every single object in the program!
Should I be declaring a global settings array, or is that even possible? my initial attempts have failed

nickelnick, http://us3.php.net/mysql_real_escape_string

global variables make baby me cry

how could someone hack it?

writing oo just to avoid globals makes the baby jesus cry

magic

request.php?name=’ (DELETE FROM * table), ‘ finish query

hi, ppl that use vim to code, know any fast shortcut to comment a block of lines, using visual or something like that without needing to enter in insert mode ?

nickelnick, suppose ur query is “SELECT count(*) from user where name=’$name’ and password = ‘$password’ “, put $name = “admin’OR’1′=’1″ u’ll know what can go wrong

who uses vim, get a real editor like nano. mm nano….

So I have an index page that I’d like users to be able to customize the order and creation of a bunch of “modules” and have it saved in the database. Anyone have any clever ideas on how I might do this?

reenignEesreveR … count(*) AS `count` also

Findarato, vi and vim are professional tools for system administrators and developers who can effectively use them

why not just use /* */

Findarato, haah.. yes i dont necessarily like them.. but im scratching for a solution here
I have like 5 layers of class inheretence.. I am not finding it easy to propagate this basic array all the way down

dc3aes, might want to look at organizing your object model
dc3aes, that much inheritance may or may not be appropriate
dc3aes, however; for your problem with user settings, may want static access for them

i wondered if I wasn’t going about it wrong but it is working in every other way..

vi and vim are text based text editors they are not better than any other text based editor.

really the timezone has been my most basic problem, since I have intelligent small objects that need to report back their time, etc.. so I was talking directly to them and went ruh roh!

Findarato, I prefer ed, myself.

dc3aes, final class settings() { public $settings; private __construct() } setSetting($var, $val) { self

Comments off

I have column with ~40 small images ~160×100px and i am moving them up-down while onmouseover on arrow Now they

or something like that? currently it just wipes out the content of my text object when I “unfocus” it

no, it shouldn’t
wait a moment
input class=”search_input” type=”text” name=”suche” value=”Suchen…” onfocus=”if(this.value==’Suchen…’)this.value=”;” onblur=”if(this.value==”)this.value=’Suchen…’;” /

thanks! works great

fine

howto make the ‘Suchen…’ string in this scenario appear ex. red, but not the textinput from the user@keyboard?

style=”color: red;” onfocus=”this.style.color=’black’”

that doesn’t seem to make the text black again when focused

hi all

‘lo Ay

input:focus { color: red }

this.style.color=’#000′
doesn’t work, too?

Is there any way to access inside a iframe? I mean, to the source code

yes of course
anything you can think of, there’s a way

doesn’t work

I want to include a page in an iframe, but that page seems to detect that and reloads to remove the frame

:?

then just use css like garethadams said

is there a way to prevent that page from escaping from the frame

why? Clearly the webmaster for that site doesn’t want you to do that

could be, but I want to load it in a frame with some quicklinks in the other frame
but I guess I’ll have to work with bookmarks…

oh is this just for you personally?

yeah

Firefox?

the frame would even be a page on my disk
yes, FF 2

if you can’t block JS by domain with the default prefs, I’m sure there’s an addon for it
oh
if it’s a page on your disk, just remove the JS ;p

but there is js on the escaping page which might be needed

you can’t just sort it out?

With GarethAdams CSS sollution the text becomes red again when input is without focus, I’d like it to stay black

?

input type=”text” name=”firstname” value=”Fornavn” onfocus=”if(this.value==’Fornavn’)this.value=”;” onblur=”if(this.value==”)this.value=’Fornavn’;”/
Is it possible to extend the javascript part to additionally include the color?

this.style.color doesn’t work?

no, I haven’t defined a style for the input, might that be the problem?

hi all
anybody has a tip for removing blank nodes in dom trees ?

s/style/class

i’m dealing with some XML and all these blank nodes pisses me off

sorry

input style=”color: #FF0000;” type=”text” name=”firstname” value=”Fornavn” onfocus=”if(this.value==’Fornavn’)this.value=”;this.style.color=’#000′” onblur=”if(this.value==”)this.value=’Fornavn’;”/

that almost works perfectly, the only problem is that when the userinput text is removed and the input field looses focus, the text still is black (should return to red)

ah okay
input style=”color: #FF0000;” type=”text” name=”firstname” value=”Fornavn” onfocus=”if(this.value==’Fornavn’)this.value=”;this.style.color=’#000′” onblur=”if(this.value==”)this.value=’Fornavn’;this.style.color=’#FF0000′”/

now the black userinputted text becomes red when loosing focus

ok
mom
input style=”color: #FF0000;” type=”text” name=”firstname” value=”Fornavn” onfocus=”if(this.value==’Fornavn’)this.value=”;this.style.color=’#000′” onblur=”if(this.value==”){this.value=’Fornavn’;this.style.color=’#FF0000′}”/

Is this supposed to be some sort of validation of user input?

oh, no
it just cleares the value if the user types something

Thanks alot! It works splendidly You’ve also given me a basic javascript hosting tutorial, thanks for that too

hehe, no problem

It would be troubling if there’s anyone that actually has “Fornavn” as firstname, but luckily none in norway afaik has been named that sofar
It would be troubling if there’s anyone that actually has “Fornavn” as firstname, but luckily none in norway afaik has been named that sofar

maybe I should give some parents a hint

nooo! that would totaly break my site hehe

hi all, how do you generate key events to a flash object?

what?

i’m in javascript land, there is a flash object embedded on the same page, and I want to send key events to it (e.g. to enter text in a flash search field)

is it enough to send the information when the flash loads?
or do you need to send it sometime after it’s loaded?

after it’s loaded

let me try to remember…
nah, I don’t know how to do that
but I’m sure you can
talk to #flash
#flash on efnet, even, might be better

efnet and better in the same sentence…. how bizarre

Heh all

ah, ok… thanks anyway reisio!
:-)

good morning

Good evening
I’m trying to JSON ify some Java Objects (which are currently in a HashMap)
Any thoughts on that?

yeah, well :p

Tinkering with json-lib server side

efnet is crap, flash is crap :p it makes sense that there is more activity in #flash on efnet :p

http://oss.metaparadigm.com/jsonrpc/

That and libhttpd

flash isn’t crap, flash dev is crap

*clicks*
thankyou

that project has code that translates many common java types (including maps) into json

Wonder if it will do maps of objects

hi,on a page, i am dynamically creating iframe in div, then i want to access the form element in iframe page..
i am unable to get the form element, how can i do that..

document.frames["name"]

I am 90% certain that it will.

im using FF, it says “document.frames has no properties”
alert(document.frames["testiframe"]);

you add it by the DOM or with the crappy innerHTML ?

no i m doing it like this objIframe= document.createElement(‘iframe’);

adn that objIframe variable doesn’t have the members you need to access its content ?

Bit heavier than I was after, stand alone application with embedded web server
http://json-lib.sourceforge.net/usage.html
Isn’t bad, but I’m having trouble convincing it to JSON collections of objects

I looked at the code for the link I snet you, and it doesn’t look *too* difficult to just copy the code out that does the magic you want

yea it actually loads one file, in which i have some form element..i need to read/update them

no reason you need to do the whole thing (servlet)

How can I check the images are shown in a browser?

? If you know the width/height the image is supposed to be, you could put it inside a div or something and then check the DIV size to see if it’s been expanded by the correct amount
images also have onload/onerror/onabort events you can attach to

thx

objIframe= document.createElement(‘iframe’);
objIframe.setAttribute(‘id’,”testiframe”);
objIframe.setAttribute(’src’,”ShowHtml.html”);

http://flexjson.sourceforge.net/
Sorted

that looks nice

anybody know of a script that lets firefox support CSS styled scrollbars?

not me

for all visitors to a page?
that’s not really feasible

yeah, for a frame or an iframe

save constructing your own, as has been pointed out

IE supports CSS styled scrollbars, but FF doesn´t

yeah, because it’s not standard code
it’s something Microsoft made up

IE supports css-like styled scrollbars

granted, it or something like it _should_ be standardized
but it’s not

for FF to support styled scrollbars?

No. The scrollbars color is detrmined by the operating system color scheme

it’s part of the UI
you’re not allowed to fuck with people’s UI
security issue, among others

Replace the scrollbar if you need to. I wouldnt use your site if you did though

I´m surprised such a script didn´t already exist.

it would have to install like Firefox
people don’t like to install things just to use a webpage

Is there any way to access inside a iframe? I mean, to the source code

s/like Firefox/like Java
what for?

what for? To get access…
To modify the source, for example

modify it for what purpose?

does it matter?

Impossible across domains

hmmmm ok
that’s my real question, hehe

Almost too easy
JSONSerializer js = new JSONSerializer();
response.println(js.deepSerialize(currentState));

heh

hi all
what is a good ressource which explains how to delelop ajax apps from scratch?
or with a very simple libarby

fairway, i like yahoo’s YUI
i’m no good with javascript and i’ve been able to do some small things with it

tgabjs
thanks
sorry
is it gpl?

you can use it commercial or not, i dont know exactly which license it is
http://developer.yahoo.com/yui/

YUI ROCKS!

sembiance, i’m having a little trouble with it, would you mind taking a look at my code
I’m trying to scroll a div, and it behaves inconsistently

there is also a ##yui channel

oh, thanks

BSD

would you write from scratch ajax scripts?
if no why not?
what about dojo?

hey guys, how do u get the updated value of a textbox after onkeypress?
if i write some code say onkeypress=alert(‘this.value’), the value will not include the latest change
any help pls?

Sorry, wrong window
Or the Yahoo libraries?
Or the google ones, etc etc

onkeyup

Hey guys. Does anyone have experience with TinyMCE? I have one problem which is that the top toolbar always too large is. If i set the container of it to a specific width, the content would just go over the container boundaries… anyone an idea?

thanks

Hi

hi
and bye

yop

hi!how can i pass to the parameter of document.getElementById(—) the content of a variable?

??
document.getElementById(the VariableHere)
document.getElementById(theVariableHere) *

only?
no need for + ?

a plus sign?
um?

yep
my variable is called position
and i’m doing documen.getElementById(position).style.color =’red’

documen?

nop document.
sorry

hi

and de error console is returning the following document.getElementById(position) has no properties
position contains a number

are you running the code AFTER the page loads?

IDs can’t start with a number

right

what element are you trying to access?

i’d like to get all div with a certain class with document.evaluate but it only works when there is one class, when there are several classes on the div it doesn’t work

a Label

show me the opening tag for the label

any of you familiar with tinymce? i’m looking for a workaround for this http://sourceforge.net/tracker/index.php?func=detail&aid=1618460&group_id=103281&atid=635682

strider, contains(@class, ‘yourclass’)

label id=’(increment like i)’/label

that’s not what’s in your HTML
:P

?

you have an element with id “(increment like i)” ?

i have label id=’+i+’/label

you have an element with id “+i+” ?

yes

IDs can’t have the plus symbol in them

ID is not allowed to start with a number

butt if i do a onmouseover= this.value it returns the id number
with no error

thanks dabear

.value is also different to .id

np, strider

how are you creating your labels?
on the server or on the browser?

GarethAdams, i have no value defined on the creation of the label
on the browser

elements don’t have .value

GarethAdams, i will try to explain what i’m doing

please do, it’s all a bit vague so far

i’m creating dynamic html tags, trough AXAJ
AJAX
from the server is returned several records, and i made a index, like in a html hosting table line by line show’s me the records on the db
then i made buttons to go to the next record, previous…and so on

‘Ajax’

what i’m trying to do know is highlight the record that i select and it’s showned to me at the moment
if label

as?

rephrase

as?

still don’t understand
perhaps in portugues?

hey, if i create a bob object and tina object, in my bob object’s onload function do I have access to my tina object? Or do I have to pass the tina object into my bob object in order to use it?
the scoping is messing me up

cozby, everything you define in the global scope with the var keyword, will be available

i need only to know how do i pass a variable inside de parameter of document.getElementById(here)

can I address object member by index ?
i have dataset={['a','b','c'],['a','b','c'],['a','b','c']}; can I do it like dataset[0][0] // to get ‘a’ ?

Is it possible to convert a javascript var into a php var?

Bear10 json ?

?

Bear10 js var is client-side

is there any kind of browser written that limits what javascript host can do (like the creation of ActiveX objects and other such exploitable objects) and only allows simple functionality like the modification of dom objects.

Is image a standard JS object?

ah :|

I see no mention of it in Mozilla JS docs.
however in Firefox new Image() works as expected.

Bear10 there’s a lib that does conversion between php webhosting and js
Bear10 read this http://www.xajaxproject.org/

oh ajax
yeah ive used ajax before but i dont really wana go through that hassle for this simple task, ill use a work around lol, in javascript is there like a empty() function to check if a value is empty or do you have to do var == “”

Is there a cross browser ajax library?
that’s worth using…

dojo, gwt, yahoo

ajaxalize

http://pastebin.com/m3a46c992 , im trying to make it so if that time is undefined when called that it just uses default of 2500, is this the correct way of doing it? and if its defined even if 0 it does the one that uses the time instead.

Can I use OOP function (in where I put “this” keyword) in prodecural mode (without assigning object)?
What will be done with “this.varname” variables? Will be they erased after function finishing?

No search results for ajaxalize…
Was it a code?
*joke

really? I mean I made it up, but I would’ve thought there’d be a result if you searched for it :p
even just an IRC log :p

hehe

http://phpfi.com/255306 – look there

The paste 255306 has been copied to http://erxz.com/pb/3966

ajaxize on the other hand

hello, is there a way to define constants in js ?
is “const mode_some = 0″ cross browser compatible ?

const X – but it doesn’t work in IE 6

k
or enum ?
some kind of enumeration ?

what do you mean “enumeration”?

i want to have names for this.mode like if(this.mode == MODE_XY)

just use variables

i’ll stick to strings

var Mode = { xy: 1 }; var object = { mode: 1 }; object.mode == Mode.xy

true

Question – can I use “this” keyword in procedural functions? What will be done with these variables after finishing function?

did you see that?

tags because of some small amounts of HTML for formatting… Now, when I retrieve and display this data it’s in plain text, and the HTML code shows as text in the browser, is there something I can do to prevent this, and have the HTML actually parsed?

thanks for that!

what if you create a global var named fred and inside a new function you create a fred variable?
then remove the functions fred variable, would the global one take over?

hm, how du you remove the variable then?
if you delete yourVar, maybe

well what would happen if i created a local function variable with the same name as a global var?
inside the function i create fred , but there is a global var named fred… would it use the immediate scope fred variable or the global one?
wait nm

hi

hi

anyone got an idea on dealing with the CDATA?

no one knows answer on my problem

Has JavaScript any manual? With functions, objects and so on

http://developer.mozilla.org/

I will check it
I must buy good book about JavaScript

hi, is there any problem with style.backgroundColor in IE?
i have this working on Firefox butt in IE doesn’t work
hi, is there any problem with style.backgroundColor in IE?

Why isn’t the Javscript contained in an HTML file executed in IE or Safari when I call: $.get(“/mobile/includes/shc/p2.php”, function(data){$(“#p2Div”).html(data);});
Sorry, I’m using jquery

cozby, did you try?
mstearne, eval?

how do i name a variable/function/object based on the value of another variable?

I’ll try that thanks. But will eval get tripped up by HTML?

mstearne, just use innerHTML or something
Hory, you could possibly use window['some_' + varName] = something

thanks, but i get this error if i do
“invalid assignment left-hand side”

hi. i have a question about scopes.
“text=7; alert (window.test);” i get “7″
so every variable i assign is assigned in the context of “window”?

yes

can i change that somehow?

window is the default scope

innerHTML doesn’t seem to eval JS either because now it doesn’t work in either FF or SAF
http://tempo.bigrecruit.com/mobile/

alert() is not a function, it is a method of window object, so alert is the same as window.alert

Click on Ringtones and that uses .html() from jquery
Voicetones uses innerHTML
Thanks!

mstearne, ask in jquery’s channel?

is there a way to change the scope, so that “x=7″ will NOT create a new member of “window” ?

no

will my_flash_arr=eval([['a','b','c'],['a','b','c']]) work in Actionscript ?

sorry. Thanks I have but am getting better responses here

or, you oculd use an anonymous function

I’m looking for a method to look at checkboxes in a form and return the values of all which are checked

but then you won’t be able to access the variable at all later, web

please write in code, then i understand.

tlsarles, document.getElementsByTagName(‘input’); and then do a loop and check that type == ‘checkbox’ and checked is true
web, (function(){var x=7})()
x won’t be available later
but I’m not sure that was what you wanted to do

ElementsByTagName! thats what i needed. TY

yes, that looks good. let me think for a while.

document.getElementsByTagName(‘input’)

yeah, i got it. Thanks much

greetings. any quick hint how i could copy the hight of one div and resize the other to the same size (no fancy animation, just an IE hack)

Will memory usage increase so much if I append elements like dynamic menu or voting panel (which will be used ralely) after page loading instead of only when needed?

does anyone have a good function to format numbers, like into currency

I would make Menu() function as procedural (it would return ID of created panel).

something is strange about these anonymous functions…
when i do this:
(function() { for (member in this) document.write(member); } ) ();
i get tons of crazy members.

um
kill them
no more crazy members
why would “var bgSrc = currentStyle.backgroundImage” or “var bgSrc = style.backgroundImage” suddenly make my javascript function return, even with no error message?
but only online, not offline.

crazy like a fox?

members like these:
document
navigator
netscape
XPCNativeWrapper
plus like 100 more

right
anyway..
I’m using this:
public:component” lightweight=”true”
public:attach event=”onpropertychange” onevent=”iePNGFix(0)” /
maybe they activate when I try to use “style.backgroundImage”?

that’s the global object, window

im looking for a way to execute code “x=7″ without making a new member of “window”. is that possible?

these 2 lines, they have nothing fishy in them, do they?

sure, make a local variable inside a function

nope

strange :-|

i dont want to execute “var x=7″. I want to execute “x=7″
i want to change the scope, so that “x=7; alert (window.x);” returns “undefined”

web, okay.. just download the firefox javascript implementation source
make the changes and recompile
It’s really that simple

unless you declare a variable, you’ll be accessing a property of the global object

well, with the anonymous function it kind of works already. thanks for that. unfortunately, inside the scope of the function now there is all this crap.

use tab, web
bjorninge, not bjorn

bjotab

whats tab?

a key, usually in the D00 position left of Q

woah!

congrats

thats cool!
web:
thanks!

what is test(somevar)?
eval test()

”ERROR: syntax error at (eval 212) line 2, at EOF

eval “test()”

”ERROR: 12050: Can’t find string terminator ‘”‘ anywhere before EOF at (eval 212) line 1.

eval “test(var a = 5)”

”ERROR: 12052: Can’t find string terminator ‘”‘ anywhere before EOF at (eval 212) line 1.

idk

more importantly:
what does “/IMG|INPUT/.test(tagName)” do?
eval /IMG|INPUT/.test(tagName)
eval “/IMG|INPUT/.test(tagName)”

eval /IMG|INPUT/.test(tagName)

checks if the tagname is eiter IMG or INPUT
either

even better /../i.test(tagName)

through a regular expression

I’m trying to fix this IE6 png fix
it works offline, but not offline
I copied the javascript host straight in the index.htm file because it didn’t load at all before
offline, but not online*
so i’m using alert() to check where it stops
and so far, it’s stopped at “var bgSrc = currentStyle.backgroundImage” and at “if (isSrc && /IMG|INPUT/.test(tagName)) {“
I don’t know why, but if I have “var bgSrc = currentStyle.backgroundImage” and then “alert(‘hai’), it doesn’t do the alert
it doesn’t go through the if statement, either (isSrc is true)

agamemnus, probably because the script fails in fetching the currentStyle.backgroundImage

when i eval(s) something – is there a way to find out wich variables have been set by the code in s ?

What exactly does delete do?

bjorninge, thanks, i will try to do an alert on currentstyle

you could do a for(property in this) to check all properties of an object, web

removes a property from an object

trhaynesdeletes a variable or a property from current scope

of which object?

it still doesn’t work (alert(currentStyle) stops the execution without error)

thanks guys

maybe an exception is being raised but you’re just not seeing it

I don’t know what else to do

when s=”bjorninge=13″, then a member of “window” will be created that is called “bjorninge”

ie doesn’t tell me anything, though.

no this.bjorninge will be created

deliberately cause an error

how?

alert(1/0);

does anyone know why javascript allows to escape the slash?
doesn’t really make sense does it?

oh, that’s allowed in JS

how do i find out if a certainkey i present in an array?

i got infinity

where?

“foo\/bar”
to get “foo/bar”

hmm, ok.
i got alert(bla) and i think it errored without messaging me about it

\ followed by any character is replaced by that character, except for letters and digits

odd, ok, let’s see…

are you using Prototype.js?

ok, I think I got the error now.. I had debugging off, but it still should have shown me an error triangle

so why does every second json library do “foo\/bar” for “foo/bar”?

I don’t know

no, i am using Mr. Turnbull’s IE6 png fix
ok, currentstyle is undefined
I think the errors were caused because…hmm…

okay. know why
imagine this json string ["script", "foo", "/script"]

ah

that could end a script tag under certain conditions

end a script element, yes

ok, so I think the problem is because I moved his script file inside my header
and somehow it can’t pick up the right object because of it
but if it’s in a different file by itself, it won’t even load!

how come my cookies are not saved/sent ?

I’m using ” style type=”text/css”img, div { behavior: url(‘flyingsoft.phatcode.net/flowers/iepngfix/iepngfix.php’) }/style

which cookies?

deltab, cookies stored for that domain

is there anything wrong with this?

when downloading the .js-file my server also writes out a couple of cookies, these are not saved either :/

do you have a directory called flyingsoft.phatcode.net?

no…
hmm..
I did try using http:// but I had some problems earlier, so maybe if i add it it will work this time
i also tried using relative directories

calls ?

still nothing

no, cookies aren’t mentioned at all

deltab, hm, ok. You wouldn’t happen to know of a different approach to my problem ?

no

would url(iepngfix/iepngfix.php) work?
that’s what i’m using now, and I still got nothing

use a tool such as Firebug or Fiddler to see what’s going across the network, if you aren’t already
do you have that file there?

http://www.flyingsoft.phatcode.net/flowers/iepngfix/iepngfix.php
is that correct?
the index file is in my flowers directory
(the file i’m calling the script from)

I guess so, but I don’t know

deltab, I’m looking a tcpdump, I can see my server set the cookies, but the webbrowser never returns them on the next call

well, anyway, I have “php header(‘Content-type: text/x-component’) ?” on the top
is that correct? (it’s supposed to be a fix)

Content-Type with capital T is the most compatible

the http spec is not case-sensitive

which is a royal PITA for people implementing it

dabear:that still doesn’t work
i’m not a happy camper
shit. why does it all have to be so hard?
All I want to do is use PNG images in IE6, with opacity. Is that so much to ask?

what is text/x-component?

the fix file was an .htc file, but I read that a problem could be that the fix works offline and not online
so the solution was to add AddType text/x-component .htc to the .htaccess file
problem is, my server hates .htaccess files for some reason
so I asked the guy who made it for the other fix he mentioned
and he said I should add “php header(‘Content-type: text/x-component’) ?” to the top of the htc file.
and rename it a php file
and it still it doesn’t work
and my FRUCKING server host doesn’t like deleting htaccess files.

anyone have any idea whats causing the flicker on my mouse over here http://www.forgemodels.com/model_browse.php warning some mouse overs are not work safe, stay at the top few
its on my list of models
www.valentinepro.net/index2.html the code works fine on that page
the valentinepro isnt database driven, forgemodels is

=|
I don’t see any flicker

it treats each character like its a different mouseover

agamemnus.. try renaming the htaccess file

its in firefox the flicker, safari its just really messed up www.thenextbyte.com/videos/ i made a video of it
ill be back in a few my son needs my help

ur video won’t load
oh i see
well
I know that your problem lies in an IE specific feature
cause it works fine in IE6

yet the code works fine in firefox on 2 other sites, one i borrowed the code from, and then i took the code from that site and used it with this site
yet www.babeblvd.com and www.valentinepro.net/index2.html work fine in every browser i have tried
unless its the CSS for the rest of my site screwing with this some how
im surprised people still use ie6
must have a pirated copy of windows installed :p

there are still also ie5 browsers around

yeah but thats just people with old computers, or woman

.JS file included with every subpage has about 3,1 KB. Isn’t it too much? Some people have slower transfer.

there is a free ie5.5 ie6 and with sp2 for linux
3,1kb is more than ok

Do you create applications like CMS or similar?

me? no im more of a designer/photographer/video production person

You = 2. singular OR 2. plural in English :/
but the advantage – only 1 easy word
rm, i’m looking through webpages to check the size of their libraries

jQuery is a nice javascript lib that is realy small
what lib are you using ?

libsmall is also very small

url ?

rm, my own lib
even AJAX
I optimize everything
If you want to see it, tell me.

nice, i find jQuery the most usefull piece of javascript code i’ve ever seen
you have such selectors like $(“#someid”).style ?

how might I determine the number of rows of text in a textarea?

count the \n ?
but i’m not shure

hmm, that wouldn’t count soft returns

I’m looking for pastebin with UTF now

http://tuckey.org/textareasizer/ this guy almost does what i want to do, but his code is buggy, is there a better method?

http://www.unit1.pl/pb-464 – i think some functions can be joined (e.g. Hint() with Show()) – true?

hey everyone

I has Polish comments but i can translate them to English

hello
what is the alternative for e.keyCode
IE is giving me an error

which

thanks

welcome
http://www.quirksmode.org/js/events_properties.html

I got the code from there
it was like
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
and that was where the error was

yah

IE was giving me error on the keycode

omg

so this code is not correct
SimpleSample omg what?

nothing

I took these lines from quirksmode

did you check if e exists on IE?

I used this samples in my scripts and works fine

csaba no

oh

if (!e) e = event;

if (!e) var e = window.event;
=x

mine is shorter :p
hope that didn’t sound bad

yeah

oohhh right.. forgot that
thanks

but, window.event is faster
when you use only event

why would it be faster?

the engine have to look if have a event variavel in scope of current function

thanks it is working fine now

oh

is someone available to take a quick look at this javascript menu and suggest what is causing the alignment issue? http://24.150.163.19/grindclothing/women/index.html

on the other hand it uses more time to parse “window.”

is a “full path” to get variable
less one verification

yeah but it saves time on parsing window.

I click something in IE, and then I have to click something else for the event of the first click to be fired

paste src

This is part of my source: http://pastebin.com/d772aacac
It’s trying to be very generic (not my code), however it works fine in Firefox

what is this.old_onchange ?

This is how my code overwrites event handlers; I wonder if this is the problem
It’s null

no but is it a custom attribute?

Yes
Is this problematic?

i’ve had some problems with custom attributes in IE, I solved them by assigning a random namespace… like t:myattrib
maybe that will help

=/
I never have problem when use getAttribute

most of the time me neither, but sometimes when it just doesn’t work under IE I assign the namespace and it magically starts to work

lol

How do I set an attribute with a namespace

old and good IE…

setAttribute(‘t:myattr’, ’something’) ?

maybe in quirks mode it would work without the namespace, but I always do DOM mode :/

setAttributeNS(string:namespace,string:property,string:value);

Thanks

(y)

I just can’t figure out how this works, any idea? http://www.danga.com/misc/jsdraw/xmlhttp.html
I’ve looked into it and he’s not creating small 1px divs.. or any other element
and it’s not canvas

i will see

http://www.danga.com/misc/jsdraw/xmlhttp.html —– cool ^)

cool we can all see the same drawing
i’ll wipe it now

why not canvas?

I don’t see a canvas do you?

I mean

I mean why you dont use canvas?
or you use it

how do i attach an onblur event in ie

It’s creating the image on the server side and returning it as data from what I can make out

how does it return as a data?

base64 encoded png
select-all, right click, view selection source

ahh yeah I see… it doesn’t work under ie
it’s all clear now

that’s because IE doesn’t let you access the response from XHR until the connection closes

I think ie doesn’t recognize base64 encoded images
at least not ie6

also true

or so i’ve read somewhere…
then it’s nothing special, I thought I’ve just discovered something fantastic :p

csaba
i don’t know how

Woosta solved it

‘js domref

oh yes

whoops
`js domref

png

w3.org/DOM/ , http://developer.mozilla.org/en/docs/DOM , www.mozilla.org/docs/dom/domref/ , www.zvon.org/xxl/DOM2reference/Output/index.html , www.krook.org/jsdom/ , http://phrogz.net/objJob/languages.asp

I see this when debug with firebug
the png code in cmd variable
well, I have to go
I will travel today

bye bye

cya

Woosta, how image refresh?

XHR stream
data comes over it constantly
When there’s enough data to call it an image, it gets flushed to the drawing

it’s still better to use canvas, at least it’s supported by IE, FF, Opera and Safari…

having trouble getting my five start rating to save it’s state, without serverside help. so far it’s just css creating a nice hover over effect, but when a user clicks a star, it doesn’t keep them ‘lit’. any ideas how i can do this?

no canvas in IE afaik

there’s a javascript lib which simulates canvas for ie

that doesn’t count

ehh

google wrote and release a canvas lib for ie
so yes, canvas would make it work on ie

i stand corrected

I have column with ~40 small images (~160×100px) and i am moving them up/down while onmouseover on arrow. Now they are moving every 40 miliseconds by 5 pixels up/down and it`s moving smooth only on faster PC. On slower it`s eating 100% CPU and moves laggy. Is there any way to get same effect but
less consuming CPU?

the challenging part of comet is the transport…

What is the most popular action when AJAX fail? Alert? It can scare users.

standard XHR works on firefox, safari, opera; last i knew it wasn’t suitable on ie without periodic checking
multipart XHR is great but firefox-only
event-source is pretty good but opera-only

yeah

we need a good XMLSocket-to-JS bridge

IE requires polling which is horrid

yeah
iframe works but it’ll display the spinner continuously

What do you think about displaying AJAX request’s status on the statusbar?

i seem to remember that a year or two ago, whenever i visited a site with ajax in it, IE would display a warning message about activex components… now that doesn’t happen anymore. Was thee a silent update of IE that turned that message off?

there are multiple active x controls

yeah but xmlhttp is also activex

some give warnings
the newest ones don’t
also, IE 7 has native support for xmlhttprequest objects

tag contained within it? I wannah be able to do, this.element[0].color=white; or some crap like that

Yeah but I even remember a client was complaining about the warning message, and we said there’s nothing we can do about it… and now it doesn’t appear anymore

So how would I pull this off in LiveScript?

this.getElementsByTagName(“font”)[0]

wheee

How can I capture error code in AJAX?

status

Hmm
this.getElementsByTagName(“font”)[0].style.color=white; doesn’t appear to be working

good lord IE is pissing me off today

.style.color = “white” maybe?
only today?

lol
SWEEET

style.color=’#FFF’

miro’s example is more correct

Will do that

document.frm_addcontact.elements.length —IE doesn’t support that?

Such a shame that JavaScript gets confused so much with that OTHER language…

that is the proper way to count the elements in an array right?

it is

then why the heck is IE giving me an error

and it should work in IE as well
Try this:

nevermind I figured it out
I was using a reserved word

function checkempty(theform){
boo

yeah I’m pretty new to this

http://www.javascriptkit.com/jsref/elements.shtmlhttp://www.javascriptkit.com/jsref/elements.shtml
err – only once O_O
But that site has an example

can I use javascript to change the class of an element ?

`forms @ hmmhesays

forms: Accessing form elements via JavaScript: Don’t use document.forms[index].elementName or document.formName.elementName. Use document.forms['formName'].elements['elementName'] or document.getElementById(‘formID’).elements['elementName'] or document.getElementById(‘elementID’)

yes, yourElement.className=”replacement class list”

I can’t use elements[index] to loop through and get my element names?

I have a form with an iframe as target. Is it possible to know when the form has been submitted and data has been loaded in the iframe?

yes, you can, but avoid trying to access the form by it’s name like document.formName

having trouble getting my five start rating to save it’s state, without serverside help. so far it’s just css creating a nice hover over effect, but when a user clicks a star, it doesn’t keep them ‘lit’. any ideas how i can do this?

‘lit’ ?
so
you used :hover and :active ?

I’d suggest changing the class of the object onclick
object/image/div

miro, i used :hover

use :active, too
or :focus

that won’t help his problem

so i can figure out how to change the star the user clicked on to change by changing the class, but i can’t get the ones to the left of the one the user clicks to stay lit

change their classes, too

for(i=1;i=x;i++) { make star x’s class “on” }

*make star i’s class “on”

hmm, i wish i was better at javascript

How many times is AJAX request’s status changed to “loading”? Only 1 time?

‘Ajax’

hey everyone

‘lo

Hello

what’s up reisio , fatbrain ?

givin’ my brain some exercise
et tu?
‘lo fatbrain

not much here, workin on some 12 year old computer that i rebuilt inside a typewriter case xD
item used in the largest quantity for that project:
….duct tape
5 feet of it

document.getElementById(‘finger’ + i) has no properties, what?

that means it doesn’t exist…

is ‘finger’ + i correct
i being my count for a for loop

well, can you pastebin the code?
you might just have a wrong number somewhere
i’ve done that many times with loops

~bin

?

oh, i was hoping for a bot to paste a pastebin link

heh

function rageMeter(fi” (9 lines) at http://erxz.com/pb/3968

nonononono

oh, thats nice though
uh oh

all the js and html
lol
found it
change for(var i = 0; i fingers; i++) { to for(var i = 0; i sizeof(fingers); i++) {

http://erxz.com/pb/3969

erm… sizeOf – make sure it’s caps
change for(var i = 0; i fingers; i++) { to for(var i = 0; i sizeOf(fingers); i++) {
there

Eh?

he was going through a loop using numberarray instead of numbersizeOf(array)

Look at the code
It’s an int, not a number
and sizeOf???
This isn’t PHP
yourArray.length is JS

ew, php.

hah, i was thinking it looked a little familiar

erm… ok….but i used sizeOf in js before..but ok

Do you have more than one id=”finger1″ on the real page?

nope

sizeOf([1,2,3]) // no you didn’t unless you wrote it

Error: Error: ReferenceError: sizeOf is not defined at line 0: (null)

idk… i might’ve written it then O.o
but i know one of my scripts used it lol… my bad

function sizeOf(ary){return ary.length} sizeOf([1,2,3])

3

stupidly pointless function

so fingers.length worked, to say it doesn’t give me an error anymore

an interesting point I found that in IE and FF length of [1,2,3] and [1,2,3,] differ.

but it still doesn’t do what i want

hm? what’s it do and what do you want it to do

because ‘fingers’ is stringified and so has a length of 1

oops, sorry, not FF but Netscape browser.

yes .. IE is stupid

and I’m attempting to access the results by document.getElementById(“HTTP_RESULTS”).innerHTML = xml.responseText; I can alert(document.getElementById(“ID FROM THE RESPONSE”) and it displays what the object is but I can’t perform a alert(document.getElementById(

“ID…”).value or .innerText or by .VALUE_I_CREATED.. It works in ie but not in firefox.. Any ideas what I’m doing wrong?

still have to live with it

yeah
pita

yeap

well, i want a standard hover star rating script, but instead of submitting the users selection with ajax, i want it to save the selection to a hidden form input and keep the selection ‘lit’
does that make sense?

yea

where is id=”finger0″ ??

cuz you have capitalized attributes? i dunno if that would mess it up but all attributes should be lowercase

it’s capital in both places.. does html require them to be lowercase?

should i start my for loop from one?

Don’t ask that. Work it out. What do you think?

oh, not HTML, it’s a little more valid but i dont think it’s required except for XHTML

it seems like this should be easier and i’ve gone the hard way

once that works, you need a few other things to get it working like you want

*

I mean if I p id=”MYNAMETRUE can’t I alert(document.getElementById(“MYNAME”).innerText); to produce “TRUE”?

WTF?
are you just making shit up again?

?
what?
what the hell?

i’ve already got the hover with css working, and the hidden field gets it’s value correctly. i just need to get the fingers to stay ‘lit’ until the form is submitted so the user knows

Or even p id=”MYNAME CUSTOMPART=”OTHER VALUE”TRUE can’t I alert(document.getElementById(“MYNAME”).CUSTOMPART produce “OTHER VALUE”?
it works with ie… just not firefox for some reason..

idk, you might need to use document.getElementById(“MYNAME”).getAttribute(“CUSTOMPART”) but that’s just a guess

tryng to figure out why..

The size of my library increased to 3,5KB

you’ll need a second loop after that one to turn the className back to what it used to be

do you need to use .getAttribute for everything? ie .innerHTML .innerText .value etc etc?

?

no, but for a custom one you might

right away?

which will be rather hard unless you *append* the new class

just a guess though

I use Date(), but it has a resolution of about 15ms. is there a way to get even finer resolution?

is there an easier way of going about this
maybe an all javascript approach

think about it .. you start from 1 and go to 4. Then change your mind and click on two, so you go from 1 to 2. 3 and 4 are still turned on though
it’s simple.

the problem is, i really have no idea about javascript, structure, functions, nothing.

if I do a alert(document.getElementById(“MYNAME”)); it produces [Object html hosting Paragraph Element] but if I alert(document.getElementById(“MYNAME”).innerText); or really .ANYTHING it produces undefined..

my version of the loop: for(var i = 1; i = 5; i++){ var el=d.gEBI(‘finger’+i); el.className = (i = fingers) ? el.className + ‘ fullFinger’ : el.className.replace(/ fullFinger/, ”) }

oh you’re trying to get the text inside it?
wait, i just realized somethin you said earlier, i meant ID=”blahblahblah” should be id=”blahblahblah”

both.. I want an attribute I set as well as the text inside

So we go through from 1 to 5. If the one we’re up to is less-than-or-equal to the one we want, we ADD ‘ fullFinger’ to the classname. If it’s higher than the one we want, we REMOVE ‘ fullFinger’

the actual attribute “id” has to be lowercase, it’s value can be whatever
well not has to be, should be
like i said – might not be the problem but it’s worth a shot =p

it finds it with uppercase as well and knows it’s [Object HTML Paragraph Element]

hm
odd

but maybe that’s part of the issue.. I’ll try lowercase too

theDivContent = yourDiv.textContent || yourDiv.innerText

trying now

I don’t follow..

Don’t follow what?
You want the text that’s in your element (I said ‘div’, should be ‘p’)

hi… Is there a way to convert a div to an image?

no

it still doesn’t want to save, it doesn’t look like the class is changing?

no idea without an actual implementation to play with.

well, I can document.getElementById(“MYNAME”).getAttribute(“CUSTOMATTRIB”) and it produces a value but I can’t get .innerText by using .innerText or getAttribe(“innerText”)

can i message you url?

ok, but can’t get it like a print-screnn?

getAttribute wont work with innerText, try innerHTML?

How do you get the contents of a THISPART? p_obj.innerText right?

there may be something with canvas .. I seem to recall it could do something like that with a whole page ..
only on IE

oh..
so it should be innerHTML?

p_obj.textContent || p_obj.innerText

tks… i’ll look for it…

so that’s the universal solution?

yes

ok now i understand..

for every click, it’s adding a new fullFinger class properly. clicking the second one adds a fullFinger to one and two

ahhh
good point
you’ll need to remove it for all 5
or not add it if it’s there
but removing is easier :-D

but when it’s there, it’s not having any effect

my version of the loop: for(var i = 1; i = 5; i++){ var el=d.gEBI(‘finger’+i); el.className = el.className.replace(/ fullFinger/, ”); if (i = fingers){ el.className = el.className + ‘ fullFinger’} }
Then you have CSS problems :-D

thank you very much that was driving me crazy

no probs

javascript is driving anyone crazy
today I found a little bug in IE
the damn IE wasn’t counting my “tab space” as a text node …

you mean something about IE isn’t a bug?

Is there any decent webpages that give small examples on various differences between IE, W3C standards and other browsers like firefox?

so by using childNodes a get a bigger table on other browsers xD

or examples on how to make it universal like p_obj.textContent || p_obj.innerText solution?

positioniseverything.net keeps a list of IE bugs

IE is the bigest shit ever :p

webdevout.net has support charts
www.quirksmode.org for js

http://phpfi.com/255383 – if I change Requestinstance.loadText later, i have to call setID() again. How to avoid it?

The paste 255383 has been copied to http://erxz.com/pb/3970

var blah; try{ blah = p_obj.textContent; } catch(e){ blah = p_obj.innerHTML; } alert(blah);

I wish I could change loadText variable when I want.

got it resolved thanks to Woosta.. But thanks for all your help
thanks for the info

oh and Aptana has very simpler yes/no indicators in code completion drop-downs
simple*

I have very little javascript in my app and it worked in IE but now I’m working with firefox from home since I don’t have ie (linux machine) and a few things were broken that worked before.. such fun
what’s Aptana? webpage? and you mean you can paste code and it tells you if it’s cross browser compat?

aptana.tv
’s’a big plugin for Eclipse, for web development, with extra focus on JS

TopStyle 3

and yeah it tells you a little bit
it’s not like webdevout.net, but it will help you along
topstyle does it, too, but topstyle isn’t open sourcey

thanks I’ll look into all those pages

yea but topstyle rox and is very lighter ;p

http://phpfi.com/255389 – simple example

The paste 255389 has been copied to http://erxz.com/pb/3971

not light enough to meet my wallet or my jolly roger, though
are you using Winders?

How can I change “text” variable in Loading function without calling “other” method?

Winders? you mean windows? at home no.. I’m in linux

k

Anyone familiar with Yahoo TV listing?
e.g. What does “(CC)” stand for?

So do jQuery and Prototype do about the same things?

I would think they are equivalent to each other

Common Content maybe ?

Then I’d imagine there’s a hot debate about which is better?

Maybe… donno
Kind of strange they didn’t supply a legend or something for the abbrievations used in the lsiting

there is much debate, google jquery vs. prototype

Does anyone know which has the edge on the iPhone
I hear it’s a slow JS interpreter

Close Captioned at a guess

sounds resonable…
“TVPG” is part of USA rating system?

No idea .. I’m in .au

ok :-)
thanks for (CC) intel.

np

http://payplay.fm/pineboxboys/wma/6

as w /msg w gn8
gn8

im trying to change css with JS but background-image doesnt work…

Then you did something wrong.

try obj.background = ‘url(your-url)’;

I thought select elements were able to have no value.

er

invalid assignment left-hand side…

obj.style.background

document.getElementById(tab).style.background-image = “url(‘../images/theme/ta…

.style.backgroundImage
- is the minus operator.

element….

rather, the value of the first option element

Yes

?

is that supposed to happen?

Yes

can only have a value that is held by one of its options

I’m having problems with an onkeypress event where I’m attempting to identify the ascii value.. if I evaluate myevent.keyCode it works in ie.. if I use myevent.switch it works in firefox.. How can I test what browser is viewing the code? or am I doing something completely wrong?
W3C has an example of if(window.event) // IE {keynum = e.keyCode} else if(e.which) // Netscape/Firefox/Opera {keynum = e.which } which works for Firefox but not for IE.. if (window.event) is never true

i got my star rater pretty close, but it needs just a little more help

hi?

hi

i have a problem with js :/ i have a script inside of a DIV .. the innerHTML of the div will changed by another script.. now i want to execute the “new” script inside of the div.. but only the old script will be executed

why are you doing it like that? :|

to pop-up a window if a new message is stored for the user
but the window.open inside the div will not executed

W3C has an example of if(window.event) // IE {keynum = e.keyCode} else if(e.which) // Netscape/Firefox/Opera {keynum = e.which } which works for Firefox but not for IE.. if (window.event) is never true

how do i sleep JS? Thread.sleep(4000); doent work, it just pauses
nm
well, how can i just sleep()…?

uhh
This isn’t java
You’d need to define a function and then use setTimeout
window.setTimeout(yourFunc, 4000);
function yourFunc() { … }

http://www.anime-manga-project.de/index.php?nb&module=ampm – the function “ShowMessages” is the problem

its inside a function though… i want to innerHTML = “foo”; sleep(4sec); innerHTML(“boo”);

just make another function then

i did window.setTimeout(Dummy, 4000); and function Dummy() {}
nothing, so i tried calling Dummy() and nothing

how about you paste your code instead of randomly telling us bits and pieces

http://216.195.183.252/ws/movielist.dev/html/ http://216.195.183.252/ws/movielist.dev/html/script.js

anyone here know wordpress

You need to learn about setTimeout. Javascript != java.
You need put the code that you want to execute after 4s in that function
That’s working as expected, in 4s it’s going to call a function that does jack squat
Scotepi, consider looking into jQuery. It’s simple syntax and a lot easier to learn than pure Dom based JS
http://www.jquery.com or #jquery

does window.setTimeout(Dummy, 4000); call Dummy or just set a setting on the function?

it will call it, after 4 seconds

k

what you prefer to use – function a() {} or a=function() {} ?

former, because it’s normal

normal ?

normal

http://en.wikipedia.org/wiki/Television_content_rating_systems#United_States

The former is more efficient, since it’s pre-compiled before the script is run
But the latter is sometimes necessary

when? i only find it necessary with ajax, when i need to eval the response that i’m getting

Whenever you don’t want the function to be pre-compiled, basically — usually closures are involved
eval() an AJAX response? That’s not possible in most cases. It’s JSON that’s eval()ed, not XML.
Also, I’ve no idea how function expressions would be necessary there.

i’m not always using ajax for xml

AJAX: Asynchronous Javascript and XML
If it’s not XML, it’s not AJAX :-)

##javascript — a channel of pedantic bastards :-D

Heh

`jif

Javascript Interaction Framework. It’s just like AJAX but without an implied dependence on XML. Woosta’s JIF library is available at http://rick.measham.id.au/javascript/jif.js

^^ Including, of course, me :-D

that might be true if ‘Ajax’ were anything more than a buzzword for a methodology :p

if i’m doing a request to a none-xml page
and than using responseText
it’s not ajax ?

No

no

cool.

It’s not AJAX if you pass false as the last argument to xhr.open() either.

http://erxz.com/pb/3972
trying to insert a newly createElement(“tr”) into a table I just created.

Could somebody take a look at my little sample here http://www.pastebin.ca/651810 WHen I process an onChange I want to be able to access the other input in the table.. I’m having problems travesing from one to the other

The paste 651810 has been copied to http://erxz.com/pb/3973

try replacing document.body.maintbl.appendChild(tblrow) with tbl.appendChild(tblrow)

k. thanks
works great, thanks a lot

no problem

http://www.pastebin.ca/651815 — here in an updated cleaner portion.. Can anyone answer the question on the pastebin for me? It seems to work in IE but not Firefox.. not sure what I’m doing wrong

The paste 651815 has been copied to http://erxz.com/pb/3974

it seems to me that the myObj.parentNode is refereng to the TD element

between the two td’s ignoring that it should still be correct right?

not to the TR as it should be

now, I have about 3000 character on 1 line in my html
usually I just use document.write(“\n”)
but that makes it not work.

does SecondInput = myobj.parentNode.parentNode.nextSibling.firstChild; work?

I entered it wrong.. take a look at the new pastebin once http://www.pastebin.ca/651820

The paste 651820 has been copied to http://erxz.com/pb/3975

so this works in IE but not FF?

yeah

i think the problem might be in FF’s treatment of whitespace

/td

the spaces between the elements are registered as their own nodes
at least within the context of each TD
so if you can have
td id=’first’input id = ‘myInput’ type = ‘text’/td
td id=’second’input type = ‘text’/td
maybe that will work?

hmm that makes sense cuz when I alart(newobj) it says text somethign
I’ll give that a shot.. that’s really annoying that whitespace matters.. is that a W3C standard or firefox is anal?

well what if it was a word rather than whitespace? you’d want to be able to parse that into the tree
so, i don’t know

true but I thought whitespace was ignored.. does \n and \t also count?

id assume it would if its in an element usually regarded as holding text, TD, P, etc

and respective indentation and formating i dont think it would matter

http://www.w3.org/TR/xml/#sec-white-space

so I can to from td to td ignoring anything in between?

“An XML hosting processor MUST always pass all characters in a document that are not markup through to the application.”
node.parentNode.firstChild
that’s the first sibling

but the firstChild might be whitespace or text..

yes
so you want a loop that checks for elements

if you’re working in FF, firebug has an excellent DOM browser
that you can select an element

can’t I get the firstChild(“td”) where it checks all it’s children for the first instance of td?

and view its parentNode, siblings etc

hmm never used a DOM browser before
but now that I found it it looks like it’ll do the trick

you can use getElementsByTagName
or, for cells in a row, row.cells

hmm

or wait for http://www.w3.org/TR/ElementTraversal/ to be implemented
http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-64060425

ill just be happy when e4x is available in all browsers in a consistent implementation :-)

yeah the DOM browser confirms the whitespace was the issue

tags.. if there was a getFirstChildByTagName() that would be great

but I’ll just remove the whitespace for now

well you could always iterate through it
checking each element to makesure it wasn’t whitespace

or use XPath

hai hai
I have a question
what’s better:

hehe, yes or something like jQuery, i don’t know how all of you stand on frameworks

a set of 52 png letters, or one image with squared off letters that I can change the location of inside a div?

what’s XPath?
ehh yeah I could do that too
how that DOM browser is handy stuff.. wish I knew about it ages ago

firebug is much more than just a DOM browser too :-)
more like a jedi-macgyver-swiss-army knife

firebox included in firefox or some sorta addon?
err firebug..

addon

the latter may be more efficient
`ala sprites
http://alistapart.com/articles/sprites

so adding in tons of blocks of the same image is not going to waste memory?

wow firebug is freaking awesome

“agnokapathetic” at 71.6.194.243 pasted “function getFirstChildWithTagName(tagName)” (21 lines) at http://erxz.com/pb/3976

that should do something similiar to what you wanted
if you don’t have any application qualms about prototypical additions to HTMLElement
and of course that doesn’t run in IE :-(
bah. you can never have anything good in this world

I think just by learning the little tricks I can get stuff working in both rather than wonder why the hell it doesn’t work in one

why not getElementsByTagName(…)[0] ?

and sometimes I don’t..

hmm even w/o the whitspace FF still adds a text element between any td/td
can I getElementsByTagName(“td”)[LAST]?

you can store it, and use cells[cells.length - 1]

hmm I might have to do that..

by the way, http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-6986576

can i make a form pass custom headers on submit?

don’t think so… what header do you want to request?

its the same thing that the stumbleupon toolbar does. they pass a custom header so they can verify that the request came from them
i want to do the same

any POST or MIME form submission is passed as a request header… I don’t see what using another one buys you

this is what a SU post looks like
http://pastebin.ca/651860

The paste 651860 has been copied to http://erxz.com/pb/3977

see lines 12, 13, and 14? i want to pass headers like that with my form

like what?

same type of thing. like a hash to identify that it indeed came from my form or something

can I trigger an event manually? ie allows obj.fireevent(eventtype) right? firefox doesn’t…
err .fireEvent..

I don’t see any custom headers in there

hi guys, I need a multiuploader that also works for linux, do you know anyone?

apart from those added by ‘mozbar’, but that’s a firefox extension isn’t it, not a javascript
which header are you actually referring to?
cookie is not a custom header, cookie is your browser cookie for “www.stumbleupon.com”
and if you want to play with cookies from javascript see here – http://www.quirksmode.org/js/cookies.html
or just google it
your server side scripting language of choice is also likely to have built in support for cookies, you don’t need to think about headers at all

ah obj.onchange(); pushes an onchange event..

er…can you send AJAX requests to external servers?

XHR can only talk to the same domain as the requesting document

oh dewi i didnt see you replied to me
http://erxz.com/pb/3977 lines 12/13/14 are sent by mozilla? not by stumbleupon?
i was under the impression that stumbleupon was sending those
infact, i dug through the code and found them setting the headers with XHR
so woosta, how would SU do it?

the X-SU ones? it looks like an extension with the ‘mozbar 3.06 xpi’ thing

hi-yawn-hi

yeah but like i said, the stumbleupon code sets those headers

an extension is a different thing to javascript running on a page
even though they are both written in JS the security model is totally different
and available API

ah ok

so if you are writing an extension that stuff is useful to you
if you are not, I’m not so sure
however a quick google does seem to indicate that you CAN send custom headers if you’re constructing requests manually using those AJAX primitives

yah, xul/xbl gives you access to a ton of stuff

but I haven’t played with such things

yeah but not to external sites, apparently?

no, that would be insecure

right

well… wait. Not so sure about that.
what site are you trying to access?

SU actually. trying to make my own “thumbs up” button basically

yah, XHR has a strict same-domain policy

Comments off

Hi Ive got a colleague whos just left and Ive inhereited a DB from him I see on the machine that there are leftovers

uh, isnt mysql free?

yes its free

its GPL

or are ther comercial versionsand a free version?

the community edition is completely free as in beer
i.e. it’s GPL

ok its under community, then downloads I guess

uh, GPL isn’t free as in beer, it’s free as in liberal freedom

I do see a how to buy link so I guess there is a comercial version of mysql

there is a second license for all those who can’t comply with the GPL
like in the embedded market, OEMs, …f

hrm

all others can use the GPL version

i see

if you wrote your own mysql connection library couldn’t you use the gpl version regardless of if you’re commercial or not?
cant remember if mysql use a modified gpl or not

bye to all

there is no modified GPL

ah, so it’d be fine

there is the LGPL

the GPL is copyrighted and everything that is license under the GPL references the same GPL

heh gpl 1, 2 or the new 3

would you call them “modified” ?

actually, the connector/j license is lgpl, so I dont think I can see any situation where you’d need the non-gpl mysql

weigon, enhanced?

it mostly affects users if libmysqld, the embedded mysql

ah

lighttpd + mysql mod

libmysqlclient is GPL too which has some funny implications
the FLOSS exception kicks in there

weigon, yeah which is why you’d want LGPL client library or write your own
having libmysqlclient as GPL is stupid imo

GPL + FLOSS exception
in a way, that is a modified GPL

is mysql going to go v3?

?

gplv3

FLOSS exception allows GPL incompatible licenses to the libmysqlclient

weigon, which is basically trying to be what the LGPL is?

it reduces the pain a bot
nope, it still forces distributed, closed source apps to be GPL incompatible

but requiring people not using the licenses named there to shell out for the commercial version or become one of the borg^WGPL

it’s nasty, yeah
no decision made yet
I think there is no need to rush

Do I really need to specify a key length for a TEXT column, if I want to make it UNIQUE?

lilalinux, generally yes, but TEXT columns as unique indices are really ineffecient, and the key length just minimises this ineffeciency

speed is not a concern for that project, but accuracy

calculate your own hash of the text column and store it in a char column and do lookup comparisons on that & the actual text (to make things faster?)

MD5(mytext)

Any ideas where did I go wrong?

What’s the error?

Matic`Makovec, thats php show us the real sql

You have an error in your SQL syntax; check the manual that corresponds to your mysql server version for the right syntax to use near ” at line 1 is the error
archivist, what else could I show :o

Matic`Makovec: Show the actual SQL.

Okay :o

Matic`Makovec: think about using PEAR:B or friends and use prepared statements

then you will spot the error as well

it handles the quoting, sql-injection, … for you

Your guess about id might be correct snoyes

my SQL script Dont work well ” is a sql script to get the Login IP from my ‘web`site Users’ some time he login the User name and IP but have the same IP join with new User ..dont. Pls Help http://www.pastebin.ca/656807

thx
However I still think, that should be made transparently – maybe with a warning

“BLOB and TEXT columns also can be indexed, but a prefix length must be given.”
you have to specify the prefix size because the content is stored in the index file

what if the length of the field is bigger than the specified one?

and storing 65535 character strings in an index kinda defeats the point don’t you think?

Just wondering if any of you guys have the slightest clue about how far the 5.1 branch is from becoming stable?

then it’ll match against anything who’s first N characters match in the index, just like a b-tree
uh, hash table*
but will do expensive comparison against the actual text

so the result could be wrong?

no

ok

it will look up possible candidates using the index, then go through them all and do an actual comparison iirc

ok, much clearer now, thx. I think I can live with that

hi all,,, have a database search question, i took a table full or records (called jobs) and i selected all the textfields in the rows, so there was title, description, requirements etc etc.. then i indexed the words by an index table (publicjobssearchindex [jid,word]) so jid was foreign key’d
to jobs.id

HarryR, how about maintaining a MD5 sum or something of the TEXT/BLOB field and then index that?

ungod, that’s what I originally suggested

Ah :p

then i run queries on the index and all works well, it is populated by the occurence of words in the selected fields from the jobs table and references the job id,, but then i wanted to filter search results by things like the startdate, so the user selected a date in the search form, and
only jobs starting after that date in the future would be found,,

md5 is slow

yes, that might work, too, but I would end up reinventing the wheel. That’s the task of the db, not mine

anyone know an emulator or something than one can practice t-sql in? instead of installing sql host server components etc.

also i selection of jobs.type was enterd, so (being an aviation recruitment database) i stuck in an option for filtering the jobs.type field.. this is the resulting sql,, but i’m wondering if this is correct as the type filter isn’t working.

‘2007-08-14′) group by jid order by numhits desc

can anyone help me fix this query?

flung, you calculate when you insert, not at select time unless you’re md5′ing const data

you’re going to have to md5 your search too

flung, depends on how you look at it. If you have one billion entries, I’d prefer computing an MD5, do an index lookup and one or more string comparison instead of doing one billion string comparisons

Just install / use SQL server host 2005. It’s unlikely you’ll find a replacement. What is your reason for asking? The real thing is available for you.

flung, unless the TEXT/BLOB fields change more often than you actually do a search, then the MD5 computing can become expensive

I’m just saying that an md5 might not be necessary. Maybe something simpler like a CRC

flung, agree

also, with checksums, there won’t be any partial matches

Xgc, too much mission? i’m not actually setting up a database i’m trying to pass some exams…
i don’t wanna fiddle with servers i just wanna master syntax

You’ll probably send much more time trying to avoid installing the server.

ok
thanks

hello
I have a CentOS4.4 box running mysql 4.1.20 and I’m having issues with a script provided to me to perform some maintenance
it’s complaining about “go” syntax

can you pastebin part of it?

standby

go? that is other database syntax

I thought go was a game

HarryR – http://pastebin.com/d73e957bf
I’m assuming it’s a form of “commit”

Just take out all the words ‘go’, and add some ; at the end of each line.

snoyes – I’ll check it out thnx

And what is IT that complains?

In theory the command line interface allows ‘go’ as a statement terminator, but I’ve had difficulty getting it to work.

go is very rarely used command of mysql command line tool. It is not SQL keyword MySQL server would ever recognize

can i shoot off a command before a query so that it’s guaranteed to run? (avoid deadlocks)

lock tables ?

I’ll take snoyes advice and remove the “go” and add “;” to each line

DELIMITER go
works for me

good one
but what happen if there is a word ends with go

escape it?

oh, and place my query in ‘lock’ query, or how does it work?

:%s/\([^\s]+go\)/’\1′/g

lock all the tables you need
then nobody can affect your queries until you unlock, but restrict concurrency and slow things down

it’s only for 20 seconds each 2 hours
it’s just i can’t shoot off the query before someone does an insert on the table and thus, i get a deadlock error

up to you

it’s complaining about me not having placed a lock on t1 (a temporary table)

need to lock everything
temporary table? hmm, i thought there is no locking for temporary table

how do i lock a temporary table before the query is even run? o_O
or.. is t1 a temporary table
hehe
query http://www.pastebin.ca/656879

innodb ?

yeah

single statement
if single statement not likely to get deadlock
select does not require lock unless you use serializable isolation

anyone here have experience with mysql replication?

How to join more than two tables ?
by index
I mean by primary key

SELECT * FROM a JOIN b ON a.x = b.y JOIN c ON b.y = c.pk

Hi, I’ve got a colleague who’s just left and I’ve inhereited a DB from him.. I see on the machine that there are leftovers of some profiler/analyser/benchmarking software.. He’s enabled full query logging and then ran some tool on the logs to get data such as the most frequently ran queries,
hit tables etc. Anyone know what this tool might be ?

my SQL script Dont work well ” is a sql script to get the Login IP from my ‘web`site Users’ some time he login the User name and IP but have the same IP join with new User ..dont. Pls Help http://www.pastebin.ca/656807

sorry got disconnected
problem with power..
hm.. how to join more than two tables by primary key?
someone wrote it here
but I didnt write it down
can You repeat that ?

SELECT * FROM a JOIN b ON a.x = b.y JOIN c ON b.y = c.pk

HarryR, snoyes, thank you again, script has executed

snoyes, thx

when the tables are locked, do the indexes stop working?

no, just that other users cannot access it with a write lock, others cannot write with a read lock

ahh.. i had done it the other way around.. hehe
;D now it works

Hi Just wonder would a “Join” stament be appropiate when trying to create a statment that will join two tables or more tables by certain criteria?

yes

ahh k
and just wondering how dose join work i have been reading the documenation but it still gose’s over my head… i am trying to figure out how to tell it to select a row where it equals a certain value from another table

SELECT * FROM oneTable JOIN otherTable ON oneTable.someField = otherTable.otherField;

mysqld is now taking 99% CPU and there is no script or anything running from my side. a while ago I only added 375K records

Ohh k
thanks snoyes

Tili, try doing a “SHOW PROCESSLIST” to see what queries are currently running

will do

Tili, but it might also just be that it is busy writing the stuff to disk

perhaps using innodb and doing an insert buffer merge

snoyes, ok I am joining those tables and INTO OUTFILE ‘/tmp/wyjscie.txt’;
snoyes, but only a few records apeard in wyjscie.txt

i have a php/mysql webapp that i want people to not be able to use, but still be able to read any information that’s on it from past dates; what would be the easiest way to leave read privileges but remove write privileges?

snoyes, does it use beffered writer?

Whatever records you get without the INTO OUTFILE, you’d get with the INTO OUTFILE.

snoyes, well ok but it stoped writing to file
snoyes, I wonder wy
why

!m iam8up|lpy grant syntax

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

snoyes, looks like buffering thing

How do you select certain colums to be selected and not the whole table?

Are you saying that you get more records when viewing the result set in the client than you get in the file?
SELECT some, field, names, here FROM…

it has stopped it now. i was late in getting more info out of it. i will see if that happens again.

in join?

In any type of select.

snoyes, looks like it hasnt finshed yet

so do you do that after JOIN or Before?

snoyes – i’m in phpmyadmin right now looking at all the different permissions, however, i don’t know which ones would be used for writing…

everything after the FROM is the same.

snoyes, sql host command is still executing and file stoped in half of row..

SELECT is for reading, INSERT, UPDATE, and DELETE are for writing.

sorry?

snoyes, yes I do see more records without writing to file

snoyes – and what about the structure? create, alter, index, drop, etc…

Tili, okay. If you’re running Linux or BSD or something, you can run “top” or similar to see if the process is busy with I/O (Usually the process state is then “D” if i remember correctly)

there is also a list of administration permissions, too!

I assume your script should not have those permissions.

ungod, was it to me?

snoyes – ok kool, i’ve gotta daily backup so it’s no big deal if it breaks – thanks for the help!

mashuuk, no?

thanks. i only looked at CPU % in TOP

snoyes, ok moved forward but does it really slow
snoyes, so it buffering thing
thx for help
btw does anybody use R project ?
I am having a problem with loading larger data files ;/

Tili, TOP also have a total % used by waiting for I/O (disk read/writes etc) – it is located in the top an looks like “0.0%wa” (or some other percentage)

snoyte i tryed what you said i have to do to select colums in the Joined table but it dose’nt seem to work heres my query the error i get it is here http://pastebin.ca/656926
sorry forgot the url for the query http://pastebin.ca/656924

kieran491, you’re missing a comma between “t.`PPExclude`” and “BirthLoc.`IDLR`”

Hi! I’ve got a master/slave setup, and it’s currently replicating all databases. Soon I will want one of the replicated databases to only exist on the slave. Can I simply stop the slave thread, rename the database and then restart the replication?
Or do I need to do some other magic?

ahh thanks ungod

Hm

it happened again and mysqld process state is S. 0.0%wa also
but cpu at 99%

kieran491, and you probably need more. “FROM tblir t” and “JOIN tbllr BirthLoc” looks weird to me
Tili, oh – how about the “SHOW PROCESSLIST”?

hey guys, got a problem with my replication setup… it apears that my master stoped login to the bin files. the slave and master are in sync as far as the position

it shows a lot of queries

If anyone was intrigued by my question earlier, the answer was MyProfi

one state shows Copying to tmp table

the problem is when i do something it does not advance the bin long position any

kieran491, oh – the “AS” thing is optional, so “FROM tblir t” equals “FROM tblir AS t”

I run a query where there ar 170 records but it goes skitz on it and i see Copying to tmp table in state in show process list

Are you sure it’s just not in the buffer ?
And that it’s set to do binlog writing?

snoyes, selecting and joing to file takes so long.. I’ll show you a script ok?

when i do a show master status it does not advance

ok

snoyes, is it possible to speed it up

!man explain

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

!man replication

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

Have you set log-bin in my.cnf ?

yes

Nothing in .err ? Permissions?

nop

And you’re sure things are being inserted or updated in the replicated db(s) ?

snoyes, http://pastebin.com/d4b28f15a highligthed area is too slow

that is it, there is nothing being done

snoyes, I am at 31 record while there are 700 of them

slaves just say waiting for master

mashuuk, Are the seq fields indexed? Doing a JOIN on something not indexed can become terrible slow

The binlog is only written to if there’s data INSERTed or UPDATEd

yea
and there is
i inserted several new records

ungod, they’re primary key
ungod, but VARCHAR

mashuuk, mkay

greetings

ungod, maybe thats the reason ?

i wonder where the global charset setting is

ungod, its really slow

Trivia question: Under what circumstances SELECT can be written into binlog? (Statement starting with SELECT not subquery or INSERT … SELECT or CREATE … SELECT)

ungod, maybe I should add extra field with INT auto incrementing field?
ungod, and join with it?

select into ?

Nope.

the only thing i can think of is maybe it is how i tell it multiple dbs?

mashuuk, I once went from taking two minutes per selected row into taking around 10 seconds for around 137.000 rows, just by rearranging the index :p

pure select

it is just binlog-do-db=db1,db2,db3 right?

No it is not

maybe that is the problem

Not sure then, tell me

ungod, hm… ok so its because primary key is not int

mashuuk, try doing a “DESCRIBE SELECT alignment…” – it will tell you which indexes it will use. Sometimes MySQL chooses the wrong index

i need to do 3 dbs

hey how do you make mysqldump execute each row as a seperate insert statement

nt all
not all

Put EXPLAIN on the front of your select, paste those results.

you can’t have comma separated list. Put 3 lines in my.cnf one for each db

mashuuk, ah yes, I meant EXPLAIN
Ersan, try “man mysqldump” – I know that it is possible, just can’t remember which switch I used.

ungod, http://pastebin.com/d237ca059
here it is

You seem to know your stuff, I’ve got a master/slave setup, and it’s currently replicating all databases. Soon I will want one of the replicated databases to only exist on the slave. Can I simply stop the slave thread, rename the database and then restart the replication?

i’ve been reading the man for awhile
can’t findit

mashuuk, hmmm…

Anyone got 2 secs to help me with a date calculation I just can’t get to work?

Why do you need to stop the slave thread?
ask

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

^^^

OK – Sorry

Just ask

Not sure, just for the sake of being on the certain side. But if you’re convinced I don’t I won’t So the answer is yes, I can simply rename the DB and that’s it ?

if you are dropping that database hosting on master better care to switch of binlogging for the DROP statement.
so it doesn’t get replicated

mashuuk, seems like it is not using any keys for len and kmer, so it has to search through each table, probably requiring 244650*244651 row reads…

I have a large news database which has at least 1 record for every day of the year for the last five years. My company has asked me to create a new page which displays all the stories which were published on this day last year. I just need a CURDATE string I think… but it just won’t
work!!

Try this one: SELECT NOW() – INTERVAL 1 YEAR;
And SELECT CURDATE() – INTERVAL 1 YEAR;

mashuuk, you’re certain that len.seq and kmer.seq are in fact indexed?

any way to enforce utf8 on php mysql web hosting connections? this client sets latin1 into a utf8 colocation

fairly sure I tried that – but I’ll do it again now. Thanks.

ungod, well they are strings

2006-08-14

Isn’t that what you need?

mashuuk, doesn’t mean you can’t create indexes

ungod, well some seq in kmer table may be missing and the same is for alignment table
ungod, so I need match one by one

arg
this is driving me crazy
i’ve done it before i just can’t remember what i did

Add to pastebin SHOW CREATE TABLE …; for all tables

mashuuk, yes, but is there an index on kmer.seq and len.seq? (“SHOW INDEXES FROM kmer; SHOW INDEXES FROM len;”)

how do you make mysqldump exec each row as a seperate INSERT statement

turn of extended-syntax

ungod, no

Yup thats what I want… but that just seems to return no records

ungod, no indexes
in any table

even though – I’m sure there are records with a date of 16th August 2006

ungod, I did past a lines where I didn create tables

i am using JOIN to select two diffrent sorts of infoamtion out of my table but they are in the same table but on diffrent rows can JOIN handle that?

did

SELECT *
FROM news
WHERE news_pubdate = CURDATE() – INTERVAL 1 YEAR

ugh … extended-insert that is

ty
yeah i knew what you meant

What type is news_pubdate ?

finally

ungod, http://pastebin.com/d4b28f15a

datetime

Use BETWEEN

mashuuk, I see. The it is not wonder it takes ages. Do a “ALTER TABLE … ADD INDEX(`seq`)” on kmer and len and it should work

yes JOIN can handle that – but you have to alias each table in the questy to a different name so it knows which you mean
err, query even

BETWEEN instead of = ?

No. The point is that DATETIME has hours:minutes:seconds part

ah right
so you have to some how cut them out before running the query?

You can WHERE DATE(news_pubdate) = CURDATE() – INTERVAL 1 YEAR but that’s slow as it can not use any index
So you convert it to a range comparing to the day and day after

joomla installer on step 2 says:
http://www.pastebin.ca/656867
what im doing wrong?

ungod, ALTER TABLE alignment ADD INDEX(’seq’); ??

so counting days rather than years…

WHERE news_pubdate BETWEEN CURDATE() – INTERVAL 1 YEAR AND CURDATE() – INTERVAL 1 YEAR + INTERVAL 1 DAY
To make it more readable put some ()s

mashuuk, No, alignment has seq as primary key, so it is already indexed

ungod, all have..
ungod, ups

WHERE news_pubdate BETWEEN ( CURDATE() – INTERVAL 1 YEAR ) AND ( ( CURDATE() – INTERVAL 1 YEAR ) + INTERVAL 1 DAY )

sorry
ungod, my mistake :P

I see – thanks very much… think it was the fact that the field was a datetime field not just a date field that was breaking it!

mashuuk, Actually you could make seq primary key on kmer and len, but only if they should appear only once

0″ to the

ungod, yes they’re unique
ungod, every record is

I see
well you learn something new everyday
I’m gonna have to read up on CURDATE I think… I can see our news channel needing loads of calculations adding to it, and no one else will want to take it on. Thanks again for your help

Try the above, see what EXPLAIN says about it and if it doesn’t use index create index on news_pubdate

ungod, how to set PRIMARY KEY on already filled table?

Just ask

I’ll remember that! ;-)

ungod, ok found it
ungod, great !
ungod, no it goes fast
ungod, exported
ungod, THX!

I only want this query to return anything if both criteria are met. The u.Name or u.Abbreviation must equal m, AND v.VariableName must equal wind_speed. This is returning all columns which VariableName=wind_speed
http://pastebin.com/m9c24f4f

how can I do, To store the time on one field and only the date on another. Which field type should I use

Use a TIME field and a DATE field?
Or use a single DATETIME field?

hello

Hey Mike

Hey Mark, how goes?

I only want this query to return anything if both criteria are met. The u.Name or u.Abbreviation must equal m, AND v.VariableName must equal wind_speed. This is returning all columns which VariableName=wind_speed
http://pastebin.com/m9c24f4f

Pretty good! How about you?

Not bad, traveling my brains out.

is there a way do delete multiple rows in one query? like DELETE FROM `table` WHERE `id` = ‘1′ AND `id` = ‘2′? :/

I had been reading but only found timestamp and datetime fields on the manual. And according to what I read both of them store the date and the time on the same field

ah, I can maybe think of better things to be doing than that :P

Why do you need them separate.
It looks ok from this angle.

thats what I thought

WHERE id IN (1,2)

returns all rows that = wind_speed without taking the units into consideration

what is the data type to hold complex data like jpg files

that 8 A.M. or something like that, or using a datetime field will have the same result?

If it was (…) OR .. = wind_speed I could see that happening kwilcox

Hi all

WHERE time(datetimecolumn) = 8am

I used ‘nice’ to try and get mysqldump to not suck away all the resources of my server while it runs, but everything still freezes up while it’s running… any thoughts?

how or where do i setup the option so the relay-log files are hostname independant?

in my.cnf, mysqld section

how big is the database you are dumping

no
that doesn’t do it since when i do change master

adds up to about 300mb dump file (60 megs or so when tgz’ed

i specify the master-log

is it posible to do a thing like
(select * from information_schema.tables)
?

is it possible to store a jpg file in a database ?

it is skiped

master log != relay log

I had to go, sorry. but if I rename the db on the slave, the replicated DROP won’t matter/work on the slave, or am I missing something ?

yes

i removed the master.info

but it’s prob not a great idea

try it and see sergiol

!man change master

see http://dev.mysql.com/doc/refman/5.0/en/change-master-to.html

yes

centosian may i know the datatype for that

is it posible to do a thing like
select * from (select table_name from information_schema.tables)
?

I don’t care if the backup takes 10 minutes to run… i just want it to be done once an hour or so, and i don’t want it to affect the performance of the server

is there a way do delete multiple rows in one query? like DELETE FROM `table` WHERE `id` = ‘1′ AND `id` = ‘2′

Try it and see.

“blob”

hmm you can set the relay log file names in change master command

Once an hour?

at the moment it’s once an hour

Why?

in case some evil gremlin deletes something in the database by running a bad query or something

mhillyer what is the datatype for that /

BLOB

i wanna have all my tables exposed

nils, i try that, but later on i found out in the documentation that the if you set master-log option in the change master it ignores the relay_log_file option

sergiol try it and see.

meaning it names the relay log after the current hostname instead of the specified name?

i alredy tried,
if i did not try i was not asking

yeah the problem is that if the hostname changes the replication doesn’s start

And…?

Would it generally be faster to delete half of the rows from a table, or to INSERT .. SELECT the other half into a new table, then DROP .. RENAME?

strange, it stores the info in the index files and also master.info

Wha?

yeah if the master.info file exist it skips the information in the my.cnf

yes
but I think the next relay log is named correctly

What part confuses you?

the problem happens when the you change the host name

And … Incorrect syntax near ‘)’.

you can also edit master.info and rename files and change index files if you want
what problem?

Is the goal to delete half the rows in the table?

aye
(roughly)

if the hostname change and let’s say the machine reboots. when it comes back up with the new host name it won’t know what files to read, and replication will be broken because it’s using the old hsotname-file

i dont suppose theres anyone alive in here that uses textpad is there

hi can anyone help me with this code http://www.pastebin.ca/657031 i put example in the paste of what i want to do

Ok, so your options are deleting the half you want dead or copying out the half you want to live. Is the criteria for the deletion indexed? How large is the table?
Hostnames should not change.

says who?

~500k records

hostname can change at anytime. but that shouldn’t break replication

I didn’t say can’t change, I said shouldn’t change.

Yes, the criteria is indexed.
using MyISAM tables

right they shouldn’t change but i nc ase they do change that’s no reason why replication should break

Well if you select out the survivors to another table then rename you wind up with no table fragmentation.

i’m just trying to find out how to set hostname independant relay log files

anyone can please see my paste code and tell me what im doing wrong thanks http://www.pastebin.ca/657031

Just keep them from changing. This is like planning a pizza delivery system that takes into account that house numbers may change due to vandals swapping numbers.

True. I think the select .. rename option makes most sense.

You should easily be able to ensure consistent host names unless you change data centers once a week.

i know that’s a bug. that was reported and suppost to be fixed in 5.1 that’s why the put a warning on the startup

hi guys, does anyone have any experience of storing currencies in mysql? What would you recommend, bearing in mind rounding issues? How many decimal places would you store? Would you store as FLOAT or DECIMAL (which actually stores as a STRING in msql 4.1.20 which is what I am
using)

well, if you are adding slaves, and you are building them from a cd image
but i understand your point
i’m just saying that hostname change should not kill replication. and know that in 5.1 that’s suppost to be fixed. or it’s planed to be fixed. but thx

all i want is a print to output of everything

SELECT * FROM *.*?

DevX, just specify the names of the log files, it’s easy

Don’t you dare some in here and use reason HarrisonF!
And hey, how goes?

i am using SQL server. may be that is the problem
thanks anyway

yeah, i’m trying to write an automation script that restores fedora linux image from cd and then calls set of scripts to add a slave to the node. and the problem is that the host name is not set on the base image. but thx

there is not a #sqlserver

not on freenode

sergiol, just use your support contract…

i have a simple practical question for you, does a simple SELECT … FROM mytable WHERE mytable.id IN (1,8,3); (without ORDER BY statement) return the matching records orderded by the table default order, or in the same order as the ‘IN’ right operand?

It returns them in no predictable order.

Is there better SQL than != ? for example in this statement segment: WHERE dor_shops.shop_cat1 != ‘8′

mhillyer, thanks, that’s what i feared

Which is why they invented ORDER BY.
What is wrong with that example?

mhillyer, but what if the only logic to order things is a list of ids i want to order it by?

You mean if the order should be 6,2,9 ?

mhillyer, exactly

ORDER BY FIELD(6,2,9);

mhillyer, ohoh

can anyone help me with my question above?

nothing, but I recall someone mentioning yesterday that != is a MySQL implamentation and it wasn’t “pure” SQL

use DECIMAL hal.

mhillyer, FIELD refers to a field name or it’s a keyword? how do i tell it the field i want to use is ID? automatically taking primary key?

field

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

Ask them to define a database that uses pure SQL.

hello greaet heroes of the db world
great

Ok who told the wench to sort the USA before Canada?

hum i’m gonna read the FIELD doc

lol

I ask you a simple question.Is it possible to monitor the sql server so that we can see the queries being run on the server and by whom?

processlist

guys, hello

mytop

Or mytop.

mhillyer, why is that, and how does it impact rounding issues?

which field type should I use for a Y/N checkbox in mysql?

mhillyer, DEC really stores as text, doesn’t it?

You didn’t see the rest of the query. SELECT upAgainstTheWall FROM countries WHERE revolutionHasCome = true ORDER BY…

hi

mhillyer:do i have to install a new pacakge for that

hal just read http://dev.mysql.com/doc/refman/5.0/en/precision-math-decimal-changes.html

what does ‘AS’ in ‘SELECT … AS’ do?

no jeremy_g, you just open the slient and type SHOW PROCESSLIST;

mhillyer, I am using version 4.1.20 rather than 5.0, though

mhillyer:thanks. an application connect to my db, does some stuff and then exits. i wanna figure out the queries it runs over it.

DECIMAL is a string until 5.0.3

so? nobody?

http://dev.mysql.com/doc/refman/5.0/en/query-log.html

hal also read http://dev.mysql.com/doc/refman/4.1/en/problems-with-float.html

kon:terrific

Toerkeium tinyint(1)

dooh, thank you

or BOOLEAN

which is the same

thank you kon

sssshhhh kon

mhillyer, yes, surely it isn’t ideal to store numbers as strings? For a start, they take up a lot of space.

hey, what’s that shhh ? :P

idk
maybe it’s supposed to be insider knowledge :P

hal it’s about precision

mhillyer, ok, what about it?

kon the secret to service it to give the impression of options, even if there are non.
read hal

mhillyer, another problem with DEC which stores numbers as a string, is that it truncates rather than rounds the number, which could introduce errors

You will be storing currency information to several decimal places?

If no file_name value is given for –log or -l, the default name is host_name.log in the data directory.
what is the data directory
var/lib/mysql
or var/log/mysql

Depends on your installation, check your conf file.

hal you need to know your rounding in financial applications, float will give you oddities you wont understand

mhillyer, as far as I can see, bearing in mind that DEC truncates the decimal, then I will have to use a scale of 4 and then round to 2 decimal places in the application

hi there.

the err-log is /var/log/mysql/myusql.err

i did a wrong drop database (tried to remove smth with a . in its names, and dropped the wrong database)

so does that mean the data dir is /var/log/mysql?

can i restore it using the ib_logfile?

KaZeR:damn

jeremy_g, yeah indeed.

What does your conf file list as your datadir?

archivist, are you saying that using float to store numbers will introduce errors by the RDBMS?

He’s saying you didn’t read the link I gave you.

1 AM) Alec: Oh, we forgot to dial in, sorry

mhillyer, thank you, but i read all the page that you sent to me

The you know the precision error you are at risk of comitting.
Awesome

mhillyer:yup, its /var/lib/mysql

mhillyer, and I said also that you sent me the link about version 5, while I am using version 4.1

There ya go then.
And then I sent you a 4.1 link hal.
Scroll up.

hal have you understood the implications of float vs decimal
methinks not

archivist, I am sorry, but not yet
mhillyer, I did not see the second link. Sorry, I will read it now

is there a neat way to start mysqld with -l option without editing the /etc/init.d/mysql and only through /etc/mysql/my.cnf

thx for the help, i found out what i was doing wrong
uthx for the help, i found out what i was doing wrong /u

I must be slipping.

thx to anyone that try to help
my error was that i was trying to set the relay-log option on the slave config when it’s suppost to be on the myslqd section,

can someone tell me if i can recover my deleted database using the logfiles or ibdatas?

binary log file and disaster recovery. http://dev.mysql.com/doc/refman/5.0/en/binary-log.html

thanks threnody

What’s the way to list all the tables in a database?

show tables;

heh
funily enough

they hide these things ya know

aye them commy’s
heh

Hopa. And how do I select a database?

use database
;

use db_name;

iirc
and to show databases .. u guessed it … `show databases;

I am not able to enter a blank field MySQL Query Browser or Administrator. I have checked the field value for the null value and and the datatype appears to be appropriately set. Anything else that might be causing this problem?

Delete table?

drop

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

You mean drop the entire table?

Yep.

i was talking to ~cruocitae

describe your query and any error message

mhillyer, thank you for the link about float problems. It makes more sense now.

I’ve got a master/slave setup, and it’s currently replicating all databases. Soon I will want one of the replicated databases to only exist on the slave. Can I simply stop the slave thread, rename the database and then restart the replication? I haven’t had a definitive answer on this from
anywhere

threnody, ib_logfile0 is what i want, right?
File is not a binary log file

try it Rolleri
see what happens ;

archivist, would you recommend to round values to two decimal places before storing them in the database in a DEC(x,2) column for currency values?

)

I do not know if you had binary log files enabled on your database.

i have the word ‘log-bin’ in my my.cnf file
alone on his line

hal either you or use the rounding that storing in decimal implies

log-bin
server-id = 1

hal and for some countries the rounding allowable is defined in some regulations eg in the UK VAT regulations

“…If no base_name value is given, the default name is the value of the pid-file option (which by default is the name of host machine) followed by -bin. If the basename is given, but not as an absolute pathname, the server writes the file in the data directory…”

in mysql clustering

threnody, i indeed have the ib_logfile0 file in /var/lib/mysql (sorry, i did not said it clearly)

if i have a 4gb db
and 2 nodes
is it 2gb of memory per machine?

what bugs me is that :
# mysqlbinlog ib_logfile0 |less
File is not a binary log file

archivist, I am sorry, but what do you mean by ” either you or use ” ?

Anyone have experience running mysql5 with indexes locally and db files on NFS mounts over 1gig network connections?

why in gods name

hal you==app

innodb?
that just sounds awful

Because creating NFS NAS boxes is cheaper than adding more space the the DB server.

archivist, I am sorry, I don’t quite know what you mean by the whole sentense :-(

are you finding any files with names like ‘mydb-bin.001′ ?

threnody, i can’t see them. looks bad
ah
got it
/var/run/mysqld/mysqld-bin.000001

yes

YES. datas in them.

perlmonkey2, maybe iSCSI or AoE would be better than NFS?

good luck. I’m to lunch.

If I want to leave a field blank, should it be set to null?

threnody, thanks for your help !
shoud i just run the file and pipe it to mysql?

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

like ‘mysqlbinlog binlog.000001 | mysql’

ok. i shall just remove the drop database line i guess
uh. 2314472 lines in the log

lol, don’t re-do that

Auris-: AoE looks like what I want. Cheap 750WD drives over ethernet.

that database has been around awhile, eh?

yeah, some weeks

good luck, gotta run

ok. thanks.
i’m just wondering what’s wrong with replaying the log file. with the drop deleted of course
is that because of its size?

Let us know how that NFS thing works out for you

Thanks, but I already tried it out. I’ve never been able to insert large blobs so fast.
Anyone know where to get goog-cheap AoE enclosures?

Jester-|: Myeah, don’t have a test environment for this tho :/

goog-cheap – Cheap by Google’s standards.

Daily E-mail, “Craziest #mysql quotes”

store em up in the bot

I’d hate to have to compile it.

one of the excuses is just that
fish

Give a man a fish and you’ll feed him for a day. Tell him to go get his own damn fish and he’ll either learn to fish or die of starvation. Either way he won’t bother you again.

correct me if I’m wrong but mysql can create a table out of a csv file, yes?

Excellent.

new bot! its getting old now

New bot?
There is the CSV storage engine…

seekwill I want to convert a csv file to a regular mysam table.
err myisam

And you don’t want to put any effort into creating the table definition?
uAnd you don’t want to put any effort into creating the table definition?/u

Its all text fields. But if the table has to exist first, that’s not a problem.

If you created the table first, you can easily use LOAD DATA INFILE to import the file VERY quickly.

if load data infile does not choke froma cr*p csv

ah well this is an excel export one of our clients gave me, so it is crap csv
a.k.a. comma delimited + quote enclosed fields with quote escaped quotes :P

cr*p csv?

then I use the csv functions in php they are a bit more robust

Na
LDI can handle that

cool
well I’ll let everyone know how it goes .

You better
or else

cause you’re all just waiting on the edges of your seats

And if it doesn’t work, at least you tried the easy way first.

you know I didn’t realize it, but tis almost a kind of honor or distinction to have both archivist and seekwill answer a question

Your certificate is in the mail.

You are weird

Got a quick question. If I want to leave a field blank, should I set it to NULL?

You’ll need a NULL article…
please please please

seekwill, you and archivist are the two people in this channel that I see answer the most questions, and the most technical questions :P

Personally, I like ” as a blank field.

nevaaar

Ok, one blank entry coming right up.

You must not be in this channel very often

Do you mean to populate the field with an empty string, or to mark it as unknown?

That function of ‘ ‘ worked fine the day before yesterday and now MySQL is not allowing me to do that. I tried it with both the null and not null setting and came up with the same result. I get an incorrect data integer error.

For an integer in your situation, is there a difference between 0 and empty?

I want to populate the field with an empty string.

I haven’t left it for 11 days, I just don’t pay attention much

You can’t put a string in an integer column

I am entering various magazines in an index and some of the magazines have volume numbers and some don’t.

Personally, I’d use 0 for that

No, bad Will

The field is set to TINYINT type.

or an alpha field
for roman volumes

What if some edgy magazine uses Issue 0 for their first/last/middle issue of the year?

I incorrectly stated that this was an empty string. It is an empty numerical field instead.

Then I’d use NULL for that.

vols 1-12 and an extra xmas issue

All Hail NULL!

I don’t think I’ve ever seen an “Issue 0″ before

Thats what I have it set to and I get a error message if I enter anything other than a “0″.

learned journals often use roman numbers

Aah, but why use 0 when the value is not 0?

What’s the error, and the SHOW CREATE TABLE?

What is the INSERT query?

I don’t want to use “0″ and I am going to update the records after I find out what I am doing wrong. I want to leave it blank.

But that’s just a different wat to display a number.

The insert query is ‘ ‘

Ooh, store it in an integer and use a TOROMAN() function.

So in your magazineInfo table, you’d have a ‘volumeNumberDisplayAs’ field

There is no insert query?

yes but long lasting journals will go past a tinyint

Depends on how you use volume. Is it just the nth edition for a given year?

Hold on and I will get you a more definitive statement.

INSERT INTO table ( col, null_col ) VALUES ( 2, NULL );

so make it a smallint. I don’t know of any monthly periodicals that have gone 5461 years.

INSERT INTO south_databasefinal.Issue
(IssueID, MagazineID, Volume, Month, Year, Page)
VALUES (‘0001′, ‘0001′, ‘0′, ‘April’, ‘2006′, ‘20′);
The zero was replaced with ‘ ‘ when I got the erorr.

Change ‘0′ to NULL

“Model Engineer” is a fortnightly and has run sinc the 1900’s and is a rising int 1970’s wer 1200+
and has an xmas axtra

That’s still 2500 years.

BULL! I have seen many engineers, and not one of them had the looks to be a model.

and for the centenery had a set of 6 extra

how would one reconfigure this mysql.conf to alot the server 1 gig of RAM safely
http://pastebin.com/d5802b333

What is the Toroman () function? I am not familiar with that one.

It’s a joke, but one could write a function to convert an integer to roman numerals I’m sure.

Some of the magazines do have values for volumes. If I use INSERT INTO table ( col, null_col ) VALUES ( 2, NULL ); , would this negate the entire column as null?

That field of that row will have a value of NULL.

Okee, me using the “Model Engineer” was not a joke the numbers will break a tiny int

what is the Roman Numeral for zero?

and I have a fat year for one of the other periodicals vol xva xvb
there is no 0 in roman iirc

The letter O?

http://en.wikipedia.org/wiki/Roman_numerals#Zero
Looks like it is N

“They included zero (via the Latin word nulla meaning none)”, so a magazine without a volume should be 0. http://en.wikipedia.org/wiki/Null_%28SQL%29 “missing information and inapplicable information”, the volume isn’t missing or
unknown.

isn’t that cool.

Unless you contend that all magazines have volume numbers; just some of them don’t print it.

So zero is the correct value to enter then.
Is there a way to enter ‘ ‘ as a value?

If they do not publish a volume number, it is missing.

True

No okee, ‘ ‘ is not a number.

ok

lol

Thanks for the help.

Most of my magazines seem to go by print/pub date…

anyone have experience using regular linux servers + aoetools + coraid enclosures?

heh watch your page number range if you are going to cover stuff like “Nature”
some number from the start of the year

Apparently, this is archivist’s specialty

Ive hardly started on cataloguing journals and mags

i cannot change the definer for my views
aw fuck it
ill just add the user

Glad we could help.

!m LOAD DATA INFILE

Sorry – I have no idea what function you’re talking about! but try http://dev.mysql.com/data infile

!m INFILE

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

bah
!m LOAD

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

i keep doing alter view and the definer wont change

!m Silowyi load data

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

even dropping and recreating the view does not fix it
stupid mysql

hush

You’ll hurt its feeling winmutt.

i doubt it

seekwill I always forget to specify the name first

its just aggravating to find bugs like this on production servers,

!man load data

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

Report it

its probably fixed
this is on 5.0.33
mysql should bugger when i delete mysql.user where the user is a definer….

I like that word, should.
Of course, you can delete a user from mysql.user, recreate them, and find they still have certain table and DB permissions.
I call it a feature.

how to get the row id ??
how to get the row id in the Select statment.

you mean LAST_INSERT_ID() ?

weigon, no, i need to know how to get th row id of the Select example
bweigon, no, i need to know how to get th row id of the Select example/b
Select field1, field2, row_id from table

Then make a row_id column.

@i := @i + 1
g’morn mike

Is it morning?

mhillyer, exactly

for me row_id is the physical ID of the row in the storage
ufor me row_id is the physical ID of the row in the storage/u

weigon, good idea

how’s things treating you Jan?

mmm i need a virtual row_id

I need to get back into MySQL enough to play with the proxy for fun.
Why?

SET @row_id = 0; SELECT …, @row_id := @row_id + 1 AS row_id

with a shared mysql server containing both myisam and innodb tables, what is the best way to create a good dump for backup purposes? is locking all tables necessary?

Do I have any options when trying to run a query on a single command line that references maybe two different tables on two different servers?

i need proceess only the first two record with a diferent function. weigon mhillyer

Use LIMIT

pretty much. The easiest: create a slave and backup the slave

I know there’s like the FEDERATED storage engine
But I odn’t know if that would work.

is there a howto document out there for setting up a slave?

that’s what FEDERATED is for, yep
yep, we call it manual, pretty cool thing

I’ll be sure to check that out
thanks

Nah it sucks, I should know.

you left after poisoning it

get back to fixing it mhillyer

Nah, that implies sublety. I smashed it with a hammer.

Fscking RADICAL.
Thanks.

bin
pastebin

try http://pastebin.ca or http://pastebin.mysql-es.org
try a href=”http://pastebin.ca”http://pastebin.ca/a or a href=”http://pastebin.mysql-es.org”http://pastebin.mysql-es.org/a

mhillyer, weigon this is my query http://pastebin.ca/657196

Can I run mysqldump without locking tables?

the query return me only 10 records
but i need procces with a function onlye the firs two records

I positively hate how excel handles newlines in the center of a field in csv. I.E. not escaping them.
bI positively hate how excel handles newlines in the center of a field in csv. I.E. not escaping them./b

of course

hehe

do i need to worry about mutexing r/w access to proxy.global in mysql-proxy?

it is single process. no mutexes required

ok, so the hooks aren’t running in a thread per connection then
is there a way to start a thread from lua? i have a bit i’d like to twiddle at timed intervals

hrm, ‘SHOW STORAGE ENGINES’ says I have a syntax error.

does AVG() work with negative numbers?

yes

Any way to just import certain tables from a db dumpfile without having to mess with cut and paste?

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

snoyes, rock on, ty

!wench learn restore single table is http://hashmysql.org/index.php?title=Single_table_restore

I have learnt restore single table is http://hashmysql.org/index.php?title=Single_table_restore

see the lua manual
coroutine.*
all the hooks are per client connection

dang thats a nice idea but wont work in this situation. I dont have enough space to restore the whole thing.

you have each connection has its own scope ( the scope of the script ) and a global, shared scope through proxy.global.*
as the proxy is not threaded there is at any time only one writer on the global data

excellent, thanks. i wasn’t very clear on the excution model.
i’ll look at the couroutines

what do you want to achieve ?

i’m simulating a server disconnect, like a network outage or restart

just closing the connection between client and server ?

is there a replacement for isamchk in newer mysql versions?

myisamcheck for myisam, yeah

i’m testing the behavior of a connection pool, making sure that it respects a ‘max connections’ kind of constraint in a reconnect situation

what about for innodb?

doesn’t need it. if it can’t recover it is dead
currently there is no queueing if we reachable the max-connections
I have to add that

oh sorry, the connection pool i’m testing is a python thing
the proxy is really handy because i can keep a definitive count of how many connections python tries to make, also its easy to hang up on connections in progress to start the test.

if you like post a use-case in the proxy forum at forums.mysql.com/list.php?146

sure, i’d be happy to

can mysql do a group by for datetime stuff

yup

yes

trying to make a quarter by quarter totals report
oh cool

http://forge.mysql.com/snippets/view.php?id=97

lol
Bored at work?

snoyes one upmanship
could be useful

cat irc.log | grep ‘mhillyer’ | sed s/’one could’/’snoyes will now’/
guess I should toss in there | grep -v ‘jump off a bridge’

er when does the noo job start?

Monday.

noo job?

No more playing around at work. Therion will see to that.

hah
Guess you won’t be here so often then

it does seem to have that effect
I am on holiday next week!
and the week after!

bah theft of good comminity members
community even

That’s what they do. They hire all the community support so people will have to buy commercial support

I prefer to call it ‘rewarding the good community members’ :P
but I have been assimilated

and you still don’t seem to know what to do with your time

indeed, I just have so much of it!

WHEN WILL YOU APPLY?!

snoyes has been assimilated?

who meeee

Therion has the power to hire people against their will now.

oh dear

you need to hire mhillyer against his will too

hmm

He defeats me!
Also, he’s Canadian

increase your powahs!

Therion someone mentioned hashmysql time is off by 8 minutes! as if it matters

Hi all

Y2K all over again!

Me and vattam are working on a small project for a small company

deja-vu all over again.

its a dynamic form processing application

I’ll try to fix it!

We are beginners to Database and MySQL, We want to store a list in a record of a table. Is it possible???
can someone help us?

Oh my.

!tell eRazor about normalization

eRazor http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html and http://datamodel.org/NormalizationRules.html and http://mysqldump.azundris.com/archives/20-Nermalisation.html and some here http://www.keithjbrown.co.uk/vworks/mysql/

the_wench: thank you

1) Check if row exists in database based on title and coordinates 2) If it doesnt exist, INSERT a new row. 3) SELECT row

select it if you get no rows back insert it

i have 10 possible results

Or, put a unique key on the coordinates, INSERT IGNORE, then SELECT.

Sounds like it exists then.

right now what i do is a single select for *all* of the results. Say i have 10 results and and I do the select and i get 5 rows. I loop through the 5 rows and compare with the results and figure out which ones i need to insert.
i then figure out that i have 5 rows to insert, so i do a single insert for the 5 rows
so i only run 2 queries and everything is good
the problem is that i need to pull the rows after i insert them and i can’t use LAST_INSERT_ID on multiple inserts

sure you can
because the ids are sequential

the man says that i can’t

and you know how many rows you inserted
hm

i figured that, but what if 2 concurrent searches are run?
i won’t get consistent data back because rows are inserted concurrently from 2 different users

remember the auto_increment lock in innodb is held for the duration of the entire statement
so it’s impossible for them to interleave
myisam locks the entire table

i’m using myisam right now

then the table is locked for the entire insert so you will get sequential ids

coolness, thank you.
does this mean that other users will have to wait until the first user’s search is complete?

until their insert is complete
searches still happen in parallel but inserts from those searches will produce sequential ids
if you want to prevent two users from doing the same insert at the same time then you need to lock the table

which happens by default with MyISAM?

not for selects
only for insert/update/delete

how can i lock the table with MyISAM?

lock tables command
but.
since you have the auto_increment id you could just select out the rows that were successful based on the key and mysql_affected_rows();
so if you say “insert 5 rows” and mysql_affected_rows reports back that 3 were successful you can select the rows between last_insert_id() and last_insert_id() + 3 to see which ones your thread inserted (if you care)

thats what i need, but i also need to pull the data for unaffected rows

then diff it back in your application

1) pass search results to PHP 2) PHP runs the MySQL query to SELECT all rows based on title and coordinates
i take the results (which can be only 3 SELECT results) and loop through the passed search results (that were passed into PHP)
then i pinpoint which search results to insert and run the insert
my fear is what can happen between the SELECT and the INSERT
how can i suppress duplicate key errors?
if i want to do a single insert and check affected rows?

INSERT IGNORE
or INSERT…ON DUPLICATE KEY UPDATE

ah cool. so what i’ll do is do an insert and not even check the affected rows. after the insert i will simply do a select on all of the data
since title and coordinates have to be unique anyway i can just search based on that

Now why didn’t somebody think to suggest that earlier…

i think i suck at explaining things

Hello; is there a flag or configuration option at start time to cause mysql to generate more detailed levels of error logging?

is there a way to add one ? to a mysql data base like in java or C# ? with is syntax or what’s the way to do it when working with mysql variable++ this adds one to the variable

i’m a mysql noob and here for question, but i think you may be looking for this: http://dev.mysql.com/doc/refman/5.0/en/user-variables.html

MySQL doesn’t do ++. You can do field = field + 1

You can do update blah set x=x+1 WHERE something

cool thanks you 2
it may be the update command I’m looking for

just the general –log=

what’s the line-ender to cancel a command? \Q?

can you use ‘VALUES’ or ‘VALUE’ in a query? Does it matter?

kill id
or \c

use it in what context?

I think you mean.

yeah, the statement canceler
\C?

snoyes, insert into {$cck_table} (nid, vid) value (‘$nid’, ‘$vid’)

it’s \c (lowercase) to clear the buffer.

values

It tells you so when you first log in with the mysql command line client.

snoyes, will it error out if you use value on =mysql5?

\C (upper) is to switch character sets.

yes.

snoyes, thx

actually, it will error on 4.0, but ‘value’ appears to be supported from 4.1 on.

still better use values

I always understood that “values” was the official sql
Perhaps I was wrong

The manual only mentions ‘values’, and it’s generally best to stick with the documented syntax.
bThe manual only mentions ‘values’, and it’s generally best to stick with the documented syntax./b

if there are more than 3-4 values is it better to use varchar to store them than enum?
at what point does varchar become better

Do you know ahead of time what those values will be?

well yes they are predefined
should all predefined values use enum?

Well one benefit of ENUM is the enforcement of the values.

I hesitate to say ‘all’, but enums are often handy.

SQL Purists would have ENUM destroyed.

They help with normalization of sorts, without having to build a second table.

if there are no performance benefits over varchar then varchar seems simpler to use
oh
yeh i suppose it means
i can pass values as a number
instead of a string

Not that there isn’t an ENUM in the Sakila DB.

= performance benefit?
if i had a large registration form with lots of strings would it be a lot better to pass int values instead
which enum would allow

Comments off

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

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

!m SettlerX joins

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

funky

ergh, stupid bot
joins

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

or union, of course

!man join

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

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

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

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

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

you did of course dump them first

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

see upgrading docs for issues

ok thx

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

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

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

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

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

kill -9 [pid]

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

!perror 2

No such file or directory

nog mensen die hebben in een leuke chit chat ?

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

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

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

i really just upgraded the system

with different ids, of course

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

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

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

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

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

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

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

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

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

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

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

no need for from table
tias

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

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

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

thanks.

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

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

Unsupported. Period.

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

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

show warnings;


sorry …
thx … :

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

you want to connect from remote?
first try local connection

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

try FLUSH PRIVILEGES

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

flush privileges is not needed this time

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

np

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

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

lsof

telnet

ls of -i

:-)

errr
lsof -i

man fuser
or lsof, yes
fuser -n tcp xx

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

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

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

yes

ok

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

ohh ok… thanks salle I will read up on that

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

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

standards schmandards

Next time someone needs help you can do it

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

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

use the GRANT statements
!man grant syntaxx

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

!man grant

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

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

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

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

what are those all people do without talking?

You’ve compared the tables and they are identical?

alienbrain_, i’d look at upgrading

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

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

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

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

snoyes, thanks, I will look into xaprb

Is there a channel that specializes in windows mysql installations?

tookit
toolkit

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

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

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

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

snoyes, thanks man.. i will do it!

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

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

thanks

howdy!

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

table size is a function of o/s

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

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

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

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

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

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

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

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

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

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

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

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

What’s a magic quote “`”?

release is now a reserved word.
quotes

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

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

snoyes, ok thanks kindly, thats what I thought.

the_wench, thanks too.

Nope.

snoyes, thought so, thanks!

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

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

use “start transaction” instead of “begin”

snoyes, okay lets see if it works

Yeah, or mysql -e “call createTigger()” | mysql

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

asciimo, post the query and the EXPLAIN somewhere

thanks, HarrisonF

snoyes perfect!
gonna test

http://pastebin.com/d669b482c

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

!man insert-select

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

hey ho!

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

!man insert-select

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

Thank you

snoyes have you used the method above?

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

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

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

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

Did you catch that pastbin URL, HarrisonF?

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

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

ah thanks

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

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

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

does alter table mytable order by serial_number desc; stick?

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

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

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

does a unique constraint over two fields create an index?

yes

howdy howdy howdy

ping

pong!

out!

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

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

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

magic?

nils_:talking to me?

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

any recommendations one what I should use to parse it?

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

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

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

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

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

snoyes, cheers, upgrading to 5.0.44 solved the problem

alienbrain_, what was your problem?

help? :P

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

hello
how do i change root’s password?

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

reset root

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

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

hi

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

someone runs mysql replication??
not works for me

Ahmuck, it’s called ‘drop’

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

BlkPoohba, rarely

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

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

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

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

GROUP BY stream_id, city, country

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

that is what i was thinking. thanks

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

does mysqld_safe always try and run as the mysql user?

autoincrement

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

see #6 on that link

d3c, yo ucan only have one auto increment column

snoyes, I’ll have a look

well unless you use triggers

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

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

snoyes, via triggers you mean though?

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

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

what do you mean by triggers?

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

ah
thanks

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

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

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

have it enter null values for it or something?

!perror 150
!perror 150

Foreign key constraint is incorrectly formed

you’re good to go.

thank you, threnody

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

any character limitations are in your choice of charset

how is that malformed?

I see. That helps.

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

write a BEFORE TRIGGER

ah, before insert?

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

and BEFORE UPDATE

why before update?

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

ah, right

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

!perror 13

Permission denied

“The error means mysqld does not have the access rights to the directory”
that’s a clue
;^)

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

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

thanks

raar most likely you did not run the mysql_install_db script

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

#mysql-es maybe?

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

SELECT * FROM table PROCEDURE ANALYSE()

thanks

Suggest a table layout? wtf?

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

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

http://www.pastebin.ca/612845

pb_werkin, probably want that in the where not having

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

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

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

groupwise max

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

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

you want min instead of max, same problem though

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

people are working with much larger tables

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

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

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

maybe if you are using persistent db connections

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

your columns are quoted.

aaargh
lol

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

thanks pb_werkin

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

haha!

hehe
only 95% of the mirrors

what does it offer?

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

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

er where?

Topic

seekwill dunno who added that

I thought it said archivist…

that was an update to beta version no

Over the river and through the woods.

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

here

Awww!
No sense of humor allowed anymore?

ergh, did I remove that too?
dang

gotta have that

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

hah
and domas

thats Therion

We all know that

Oh wait, reflex

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

Using a CentOS package?

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

see upgrading docs, for issues

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

yes

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

!man information functions

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

If you used the command line client…

SELECT ROW_COUNT()

!php mysql_affected_rows

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

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

who knows something about xampp and mysql under linux?

PetarM, the people in #xampp do

thanks

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

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

nope, updates should be fast with that one

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

well, is that uniquecol indexed ?

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

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

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

well, an index on it – of course.

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

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

like two indexes?

like index on two columns

do both have to be unique

whatever. sleep.

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

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

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

alter table xxx add unique (a,c) ?

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

i’m going to try it right now

There’s chocolate in my peanut butter!

so would my queries then still be the same?

yes

i have some duplicated
damn it

dupes

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

delete dupes

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

quietly erasing those

alter ignore table will do that for you.

what happens to the dupes then
283506 rows, whew

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

they get quiely erased.

i have some urls in a row

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

SET field = REPLACE(field, ‘ ‘, ‘%20′)

thx

(in an UPDATE statement)

thx thx

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

use SHOW CREATE TABLE

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

Use EXPLAIN on the query to see how it goes

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

!man explain

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

oh, the select doesnt go slow, its the update

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

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

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

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

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

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

sure

hi

why do i need the set snoyes

because that’s the way the syntax is written.

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

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

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

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

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

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

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

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

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

ok thanks :-)

thx snyoes

hi

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

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

does that make sense?

hi
i have problem

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

I still don’t see your actual question.

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

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

!tell kibibyte about reset root

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

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

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

snoyes, right now the program is doing the latter

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

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

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

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

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

but can they do ‘crossed’ sync ?

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

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

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

k
i llok at this
thx

snoyes, so… any thoughts on this?

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

LIMIT

m308, with LIMIT
!man limit

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

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

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

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

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

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

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

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

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

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

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

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

lo all
anyone around?

NO

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

!man last_insert_id

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

!man information functions

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

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

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

ohmygod snoyes is a psychic

!php mysql_insert_id

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

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

just like you would any other function.

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

INSERT INTO secondTable VALUES (LAST_INSERT_ID());

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

is there a way to do a bulk insert?

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

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

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

LOAD DATA INFILE

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

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

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

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

Bad taste.

SHOW VARIABLES LIKE ‘thicker_skin’;

hmm shall have to grep the source

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

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

What about it?

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

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

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

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

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

always

k

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

thanks, I’ll give it a look

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

it is indeed. gracias

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

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

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

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

haha, I was typing out a LEFT JOIN answer

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

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

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

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

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

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

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

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

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

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

I’d do MD5(GROUP_CONCAT(column))

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

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

group_concat supports a sort I think

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

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

indeed

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

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

SELECT DISTINCT title FROM table

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

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

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

erm, that doesn’t seem quite right

!man group_concat

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

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

distinct list of titles

thanks

See snoyes comment.

the mysql documentation sucks

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

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

GROUP BY title, author, isbn

ty

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

dozens?
use postgres?
with pgcluster

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

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

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

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

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

blobaugh|ct, select… insert?

i am hoping there is an easier answer

just copying already existsing ones to the slave.

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

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

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

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

!man insert-select

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

That’s about the best you’ll get.

i thought so

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

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

yes i know how to do that HAIDEN

ok cool

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

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

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

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

select database.table.field from database.table where id = ‘123456′;

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

!man alter table

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

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

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

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

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

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

works fine here (5.0.42)

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

yes

odd
any recommendations then?

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

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

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

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

hello!

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

does a view qualify as a stored function?

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

yup

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

and you’re way behind anyway

that’s actually the opposite of my issue

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

it fails when I *have* fully qualified the tables

you probably want to upgrade anyway

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

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

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

thx all

snoyes, will that actually work?

Why wouldn’t it?

*shrugs*
guess it would

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

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

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

There’s a variety of implementations and discussion there.

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

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

ok, I’ll test it

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

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

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

Only by selecting all those that are needed.

why there are independent ?

Although you can build such a query using the information_schema.

darn

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

can ‘id’ be multiple tables?

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

ok, thx

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

The same arguments apply ^

gnome-term

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

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

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

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

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

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

oh ok

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

ok so whats wrong with our host then :|

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

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

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

NO!

hey take it easy

ya, give me access to your server

lulz

is that a question

im trying to figure out your question

I need help using the Mysql GUI

ok i use it to, what is the problem

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

!man grant

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

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

ping

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

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

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

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

good god
there’s no information_schema on our host database

because it’s 4.1?

i have no idea
its 4.1.22

there ya go

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

dumbshoes!

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

better not, it would generate ginormous queries

blobaugh|ct no

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

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

hi

can i restrict SHOW COLUMNS with a regular expression?

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

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

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

I go upto max packet

in 5.0+ you could do some information schema query

where can I see what my max packet setting is?

it’s arjen!

show variables

litheum, our crappy host only has 4.1.22

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

thanks archivist. got it.

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

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

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

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

mysqldump abopedia; return an error

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

nils_ no sorry, yes I know realize

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

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

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

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

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

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

I’ve found them to be slower in most cases

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

excellent

i didnt know you could join the same table

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

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

nice

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

why disable it? it is important for recovery

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

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

heh

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

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

They may be needed if MySQL crashes for example?

no
they won’t be needed for that

From what I saw it records every query executed

the iblog files are used if mysql+innodb crashes

Where are those files located?

the iblog files?

If you know.
Yes.

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

So I’m cool then? :P

um sure

um?

ask seekwill

summon seekwill

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

it’s safe

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

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

you cannot. change the type to timestamp.

oh ok, then i can put now() ?

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

Comments off

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

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

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

morning

yo

how’s it going

hi jottinger

just had a massive lunch. feeling tired

what’s the good word?

there are no good words, they’re all bad

forever the optimist

don’t you deal in words?

yes. That’s how I know.

you thinking of microsoft

lol

hi jottinger

hey

anyone here use compiz/beryl and swing apps?

hows it going!
~tell man_in_ltop about anyone

man_in_ltop, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.

where would you store an image?

for what?

for storage, no doubt

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

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

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

then my object will have bufferedimage

yay!

heh, amazing, isn’t it

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

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

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

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

aight

the request object has the remote user’s IP

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

the request object has the remote user’s IP

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

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

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

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

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

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

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

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

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

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

jottinger, percisely

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

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

You mean, from Rome?

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

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

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

are the children mapped, CyTG?

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

are you persisting them specifically?

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

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

no ??

no

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

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

they do .. constrained in the database

Or you have the cascade rules set up.

read the docs. and use a transaction.

i am using a tx .. allrighty

(set up so that they do so)

why do your children have a ref to the parent?

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

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

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

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

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

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

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

no.

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

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

jottinger, ah ok, but isn’t that a “servlet” filter?

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

jottinger, i agree

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

ok cool thanks

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

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

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

lol

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

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

what kind of input?

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

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

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

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

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

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

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

I originated in a nick-length challanged network ,)

well im hoping i here back from them soon

ah. those bastards.

yay, undernet!

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

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

I miss Pro-C

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

‘morning

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

heh
baaaaaaa

baaaaaa
I miss that from ricky

wtf for?
8^)=

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

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

where is ricky?

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

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

very very very good

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

~tell gaillard_ about applets

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

cheeser, figured you would do that eventually

it’s what i do.
8^)=

~be jottinger

Everybody dies, and that’s GOOOOD.

~be cheeser

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

~forget e cheeser

I forgot about e cheeser, cheeser.

hahahaha

8^)=

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

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

code? what?

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

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

I’m here to learn.

not teach?

no.

help i mean*

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

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

jottinger, all about “getting” are you?

lets talk about the knapsack problem or solving world hunger!

Teh Warm Fuzzees [tm]!!!

a warm fuzzy glow?
lol

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

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

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

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

competent java programmers? for shame

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

jottinger, i doubt this would be the case

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

jottinger, this is no business its just a chat channel

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

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

what a surprise.

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

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

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

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

because that wastes my time and teaches you nothing

step by step
day by day

jottinger, perhaps
tmccrary, hahaha

what could make me feel this way

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

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

But you’re one in a million baby
grammAr

it would seem so.

you lose

oops! I did it again!

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

have you ever met me?

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

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

I disagree with your “no leading required”

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

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

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

I gave you another pointer… and you missed it

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

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

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

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

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

tee hee hee

Point, match, me.

~spoonfeeding

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

nice

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

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

hahaha
~be jottinger

I hate you.

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

~be jottinger

Darn you all to heck!

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

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

cheeser, better cheeser?

What is this deal with an ip dictating whatsit?

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

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

well done! *golf clap*

This is for a security purpose? Not a good start

s/.[^\?]//

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

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

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

fuck!

I would but there is no girl around

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

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

go gay
save the gene pool for others!

nah

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

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

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

tmccrary, ok thanks

heh
and an hour later…

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

what means the ‘RI’ with ‘JAX-WS 2.0 RI’

no

reference implementation

ahh 8)

friendly and helpful as always

more than you know.

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


show an example

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

bwahahaha

option = new HashMapString,String();

using the 1.4 JVM would indeed make that blow chunks

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

how to copy inputstream to outputstream? lol

read then write. duh.

true. ok.

problem solving skills++

lol

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

pure, unadulterated gitness. 8^)=

procrastination is the key to motivation

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

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

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

0 = MIS Student

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

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

…. no

what’s her major?

she was chem, now shes ECE

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

what’s ECE?

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

on the contrary – sounds like she needs the practice

she gonna be a teacher?

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

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

jott yeah

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

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

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

hahahaha

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

someone on TSS said Coherence was “marginal”

must’ve been jesse

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

i should look at coherence

it’s pretty good

we’re eyeballing some scalability options here

what in hte hell is a data grid

depends on what you need though

distributed processing of *scads* of data.

so a cache then?

yeah, distributed and with some excellent config features

distributed cache

jottinger ?

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

objectoutputstream
serialize the buggar

huh?

indeed

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

hmm.

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

i filled in the blanks hehe

you can wrap it

~tell b0r3d about io

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

b0r3d you wanna write an object to disc right ?

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

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

proxy ?

damnit son do your homework. read that link

surely
we’ve all done that i suspect ..

no, I think he’s just completely clueless

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

hi all

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

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

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

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

okai.. i was wrong

zipito_, maybe
depends on your question

the outputstream can be a file right?

I have a question about life-time of the servlet

oh geez

~tell b0r3d about javadoc OutputStream

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

look at the list of subclasses

alright
thanks man

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

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

do you mean classes or instances?

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

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

I mean instances

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

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

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

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

*your user

me and g[r]eek are copycats :P

me and whaley are… ya ok

I’ve been the php developer… does servlet session can store the “binary data”…

~g[r]eek++

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

can to be liking for sure

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

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

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

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

only JSE docs are in the bot

noted

thanks a lot

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

yeah

~cheeser++

cheeser has a karma level of 372, joed

~javadoc String

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

lightning!

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

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

hey. the changes list is in the wrong order.

can you specify version of the javadoc to return?

it should be newest first

g[r]eek: thanks…

heh

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

yeah

that gets complicated.

any one interested coding for money

it’s what I do.
8^)=

no, we all do it for free

not to mention bloating you r database a few tiems over

nah only probono in here

this is a charity

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

depends on the kind of code

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

londonmet050, I’

yeah…

I’ll do homework for $75/hour

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

it is a decision tree algorithm

well, you underbid me

and that filter code is fuuuuuuuuuugly
8^)=

It’s the phonebook.

you would suck at the price is right

barney from “how i met your mother” ftw!

the problem is this

only if I wasn’t trying to play

got a algorithm called SLIQ

well there’s your problem

and a proposed algorithm to improve SLIQ

yeah.

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

need to code both of them
and we do testing

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

the SLIQ algorithm is used as decision tree classiifer

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

haha
in most states 16 is legal age of consent

any one interested in coding this algorithms

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

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

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

outsource it? :P

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

static finals are typically inlined depending on the value.

compile

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

i.e., ints and Strings

but tahts neither here nor there

just move to england, it’s 16 here

final static Objects probably can’t be

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

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

8^)=

hehe

probably not

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

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

indeed they are

hmm so whats the verdict?

guilty as charged

hehe

2 years static variable confinement

private static variable confinement…

and that’s final.
death by gc

g[r]eek: we are huge dorks.

haha
i know.
isn’t it great.

whoa… 1/187187/…

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

Generally google.

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

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

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

google ain’t all that

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

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

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

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

For this, it is

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

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

no.

damn

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

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

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

get different libraries
and pray a lot

Jesus man. Google jstl documentation.

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

you think i’m Jesus? wow

2.4 million pages

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

hey, i can see my house from here

~coachz++

coachz has a karma level of 1, jottinger

hahaha

Seriously though. Google “jstl documentation” with no quotes, it’ll be the first result.

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

leip, thanks i’m there now :-)

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

“I am Jose”, “Jose who?” “Jose Jalepeno”, “on a steeeck!”

darn ;-(

~jesus

leip, I have no idea what jesus is.

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

haha
thats awsome

And get this: his boss’ name is Mari.

What the hell is that carp?

Ask kinabalu – he works with both.

his nose isn’t big enough

lol

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

haha thats what my coworker just said

and committ some code to Mule

I was actually playing poker with Jesus the other day

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

you could hire someone named “John Jacob Jingleheimer Smith”

my nose is bigger’n your’n

s/religions/religion/

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

by a lot

or make that eDonkey

~tell g[r]eek about ESB.

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

you need to hire someone named Judas

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

i was alluding to jesus, mary, joseph and donkey

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

haha

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

I saw “.” and flipped out

That’s because she wakes him up by humming

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

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

haha

You don’t normally need to use it.

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

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

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

is this the g/f I know?

Morning Star == Lucifer.

hahaha

heyas

oh, bother

JOlga.

roflmao

“it’s cause you’re a demon in bed”

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

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

(like mirc does)

I don’t blame you.

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

i was busy typing that lol

note that isaiah preceded rome by many, many years

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

~pastebin

http://papernapkin.org/pastebin

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

well… ruling in hell is questionable

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

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

heaven for climate, hell for company

nice.

whoa, I must have joined #jesus on accident

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

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

whew

they’re still here

read my pastebin its two really good jokes

I actually joined #jesus
on accident, lol

Me too…

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

and then promptly left

Must be a sign

Knowing all this just makes the joke on JOlga funnier

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

shai tan

g[r]eek: no

shazbot

Belzebub?

shai-tan postdates the concept
no

bush

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

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

i did once. nah belzebub is a demon

close, but bush was the angel of stupidity

shailoh?

g[r]eek: no

haha

Ottingerberg.

haha, no

I just went and looked it up
I am a cheater

yes, you are

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

samael was his hebrew name

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

wondering why shai tan came to mind

mythology is fun
That’s arabic

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

in greek and latin its diablo
indeed i have

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

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

well i always figured he based the fremen on exiled jews

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

hi

i found my answer finally. whew

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

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

t = Collections.emptyMap(); foo(t);” but this doesn’t “foo(Collections.emptyMap())”?

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

yeah worms

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

how are the sarduakar jewish?

my favourite concept was that of the bene-gesserit

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

really

yes

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

“sarduakar approaching” – music change – crap pants

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

never thought of that, cool

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

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

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

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

Hello.

even the word muadid is a hebrew word

cheeser:

mohadib

but anyway, try ##dune for all this

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

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

how so? What does it mean?

I mean, really… ALIA?!

no

muad’dib – the desert mouse

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

ahem.

lol

~jbc++

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

the one guy is now a woman

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

so you mean the guy and his lady boy brother

yeah like dave rooney

haha

no.

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

?

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

k, then i’ll have to use JNI

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

yes?
….

thx

But the Jews aren’t identified with the fremen.

nevermind.

oh, pipe down.

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

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

~JNI

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

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

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

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

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

cheeser is silencing anybody who talks about the matrix?

no. just non-java talk

oh
~batix

svm_invictvs, I have no idea what batix is.

~batik

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

do not talk about matrix club

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

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

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

try Collections.String, StringemptyMap();

?

heh, I must have missed something interesting

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

non-java talk

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

weird!

yeah, it’s hideous

Agreed. See above snippet.

jhg
my voice is back

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

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

all i need is basic information…

uh…

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

IDEs have some support for that

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

an IDE will generate all the @param stuff for you

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

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

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

Ecliipse can do that, too, I think.

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

What syntax?

the Collections.String, StringemptyMap(); thing

I thought that’s how it was done…

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

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

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

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

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

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

brb

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

invalid console appender config detected, console stream is looping”

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

are both Map at runtime

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

bbl

i has a problem

bad english?

i’ve always had that one
sorry, i tend to say “i has a .. ” silly internet meme

bad internet connection?

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

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

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

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

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

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

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

its a flocking simulation

iirc interval trees are good for that

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

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

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

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

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

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

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

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

like direction/heading?

yes
2) you’ll have to factor in reaction time, otherwise you’ll probably have a “perfect” flock every time

yeah, what you’re saying does make sense

how to return from an exception?

so i need to figure out how i do direction

i’m trying return;

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

empty catch, but don’t do that

hmm

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

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

you want to catch the exception and recover

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

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

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

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

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

r0bby?

trig is essential

aye, so im learning with this

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

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

that’s… insane

sohcahtoa!

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

well thanks dmlloyd

i only used trig on my degree for a laugh

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

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

sure
~tell b0r3d aboute exceptions

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

~tell b0r3d about exceptions

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

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

not necessarily

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

~tell chrisjw about jcip

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

do nothing with threads until you’ve read that

why are comp books so damn expensive

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

because you are in america?

hmm… said book is in safari

at least there are no cats here.

i get 35% off of books from safari!

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

heh

I love safari

cheeser, how so?

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

not necessarily

Heh

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

aight

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

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

i’m doing so ..

no crashes that way

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

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

I want it to return and print that line

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

~coffee whaley

but i’m catching it in main

so print in the catch block

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

structure your code properly.

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

meant*

wrap just that one line in a try/catch

hmm

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

oh damn
sorry I’m blind

if it crashes, it’s your fault.

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

no worries.

dd

hehe
wrong window!

ls

wrong window, pal

tee hee hee
i love that one

haha
pwd

ls

wrong window, dumbass

there it is.
8^)=

ls -fal

wrong window, dumbass

if it crashes, it’s your fault.” – never a truer word spoken

haha thats a good one

it only works on like 4 commands.

grep

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

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

nooo tea time!

you can find the command list in the UnixCommandsOperation source

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

file foo.class

yes

Can you tell me the command to use?

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

he just did
“file foo.class”

file name.class

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

~tell N1klas about jvm options\

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

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

use Linux

PaulEU++

pauleu has a karma level of 1, r0bby

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

try it on Linux machine

only 4 of those are real os’s

Bleh, I don’t care.

Any good logging tutorials?
~logger

svm_invictvs, I have no idea what logger is.

~log4j

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

This is fucking nuts

hmm now i need to do maven profiles; woohoo

~log

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

I’m so sick of this bullshit.

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

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

reassign

hah

hmm nobody can help me?

back to him.

get a new job.

~tell PaulEU about ask

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

I did a question!

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

did you use protection?

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

oh. missed it. sorry.

what

nevermind.

and you received some answers to a googlable question

OK, thanks everyone, works fine.

add an ImageIcon to a JPanel?

googlable. nice word

yes

yes.

how?

use javap -verbose full-class-name

panel.add(myIcon);

use the source luke

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

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

read

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

~hug svm_invictvs

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

he must have a degree from the University of Pheonix

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

ok,

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

its strange..

JLabel myImage = new JLabel(new ImageIcon(“myPic.png”)); panel.add(myImage);
you’re just wrapping it

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

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

~r0bby++

r0bby has a karma level of 37, Aradorn

you are right

PaulEU:

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

level of karma very nice..

Like the Properties class :P

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

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

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

I know, I found on google

i believe so
PaulEU:

it was not a yes or no question

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

see ya.

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

by

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

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

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

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

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

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

s)

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

so Collection s is considered a type erased signature?

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

s is a generic method sig?

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

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

can anyone help, please?

Yes, that’s clearly correct though.

java -jar azureus.jar

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

That it is a compiler error I mean.

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

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

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

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

use the azureus .exe file, hal

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

see above

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

defined “too much”? (this is an ‘enterprise’ system)

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

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

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

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

or do I need to remove the line ends?

What you mean by line ends? Newlines or multilines?

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

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

yes its possible.

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

hopefully I won’t be there that long.

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

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

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

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

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

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

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

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

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

I must use method paint ?

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

it’s you

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

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

but mostly it’s you

strange!

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

I kinda wish they’d name one “dave”
I’d love to be a hurricane

heh

you want to kill innocent people and destroy coastal communities?

with any luck

what’s wrong with you?

that’s a long story

property insurance in florida is outrageous
anyways off topic…

we should really give florida back to spain

haha

though they probably don’t want it

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

and even further off topic
8^)=

no its not, it was a java project!

8^)=

how does that make it java dev related?

the = confuses me

it’s a smiley…
that’s a goatee

aaaaah
goatee
gotcha

it’s not a goatee, it’s teeth

oh
goatee and/or teeth

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

it’s a chipmunk piped up on crack

which project?
in florida?

Aspire

which was for what dept?

the entire state

controlled by which dept, for what purpose?

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

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

er controlled it
was going to replace Flair

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

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

were you a contractor? or an FTE

FTE

cool

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

heh
im an FTE at FDLE

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

thats cool

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

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

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

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

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

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

Comments off

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

you appear to be missing something

can you use while() loops in php?

caffinated, ah yes, doh… Thanks caffinated

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

csc`, yep

coolio

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

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

http://pastebin.ca/index.php

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

http://pastebin.ca/669406

stealth, is that fragment inside a loop?

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

Ktron, no thats the beginnig
beginning

stealth, break breaks out of a loop, you probably want exit()

how can I print all the current session variables?

ohh.. loop..

http://php.net/var_dump

swimrr, var_dump($_SESSION) I imagine

thanks

Ktron, thanks!
hmm lemme see.. stupid proxy

LordDoskias, looking

Ktron thanks

yep

I’m running PHP under WAMPServer. How can I make a file writable?

LordDoskias, ‘and’ isn’t an operator

Ktron well? it’s not that complicated scrit
&& ?

Tachyon, set the usermask properly at creation

LordDoskias, yep

Ktron same thing ;(
if($argv[1] == $creden[0] && $argv[2] == $creden[1]) {

and make sure that safemode isn’t causing any trouble

What is a usermask?

LordDoskias, hold a second, I’ll try running it

I’m not running safemode. Other files are writable by default. This particular file is not writable for reasons I am unable to fathom.

Tachyon, posix thing

windows does have a permissions set

how do you terminate a php webhosting script early ?

when thinking about it, windows is not posix compatible, so ignore that

Hmm

so, either the permissions are wrong for the file, and you need to edit it, or you have the path wrong

zap0, exit

Yeah, it would help if i had the path right…

henke37, but it containues to parse after the exit.

hi all

zap0, oh, parse
that is possible too

LordDoskias, got it

?

I think it was __halt_compiler();

LordDoskias, $argv[2] includes the \n character

i’m working on the same page from yesterday, and I have it working, but I can’t seem to put a variable in the prof.php file – http://pastebin.ca/669415
any advice? or can’t it be done?

Ktron so i should trim it or what o_O?

LordDoskias, try trim($argv[2]) == $creden[1]
LordDoskias, its what I’d do

same thing ;(
if($argv[1] == $creden[0] && trim($argv[2] == $creden[1])) {
argh
just trim the argv2
same thing ;(

i’m tryin to take a value like “The Pursuit Begins When This Portrayal of Life Ends” and turn it into “The Pursuit Begins When This Portrayal of L…” basically if it’s too long to fit in a certain section of my website it will cut off the part that doesn’t fit and add … to indicate that it
continues
anyone have any ideas of how to accomplish that?

i’m not sure what you’re asking

how do you tell the compiler to stop parsing, and just return what its got.

you can use variables in any of those files, provided the variable is set.

tag work in internet explorer 7? does anyone knows?

..to work..

http://php.net/html

I want to put the $profimg variable from page1.php into the prof.php file_get_contents() and replace the path that is there

LordDoskias, I ran http://pastebin.ca/669420 with arguments of user pass with a file called cred.txt with ‘user:pass’ on a line in it, and it worked

Ktron well ?

oops lol
i meant to say #html
i was halfway though typing something in another window :P

yes ok thanks

yay me

I must have my syntax wrong?

LordDoskias, lol, sorry, I told you to trim the wrong argument

this isn’t working – echo(file_get_contents($profimg));

Ktron i was trimmin the wrong thing

errr echo(file_get_contents(“$profimg”));

does anyone know how to make PHP conditionally exit, and stop parsing ?

because you’re not accessing the session array

swimrr, and $profimg is the variable name?

yes

and stop using quotes on variables like that

okay

Ktron thanks alot

LordDoskias, np

die()

zap0, or exit()

AlexC_ die and exit continue parsing.

no they don’t

hmm funny, you no longer need to be regged to join this channel

then why do i get a parse error ahead of the die point ?

because the entire file is loaded first, parsed – then ran again to actually run the script

can exec() do a batch file?

it should be able to do whatever your shell can do

AlexC_, then you didn’t answer my question.

hi

on windows i imagine that would include executing batch files

why would you want your program to “stop” before the file has been parsed in that sense?
fix the parse error, then when you run the code – whereever that die() is, it will stop

because the code ahead of a point is not valid PHP.

thanks again….

tags,

yup

zap0, Or remove it

thans
*thanks

but it becomes valid PHP later on.

…. ?
wtf

zap0, http://www.php.net/manual/en/function.halt-compiler.php

halt_compiler() only works from top scope, you can’t use it conditionally.

tags

“12345″[3] ?

makes_no_sense_to_me.com

Alanius, it makes sence to me

I was refering to zap0 :P

but I don’t see why to do it at a static string

you can do $foo = ‘1234556′; echo $foo[2];

random string generator

Ktron, technically your words are correct, but you probably have some wacky idea about the context its running in. stop trying to understand the context. pleaes just answer my questions if you know how to control the PHP engine.

no
it is valid if you assign it to a variable first though.

kthx

zap0, no programing language I know of allows the execution of the program to edit the compilation of it

well then you dont know much about scripting languages.

zap0, I was just clarifying what you were trying to do; I don’t know how to do what I described with PHP, maybe with more context it’d be clearer, but as it is, no

how can i count how long a value is
like $row['Artist']

strlen()

thanks

why would __halt_compiler() only work from the top level? why not level 1?

zap0, um, you might be able to do something with heredoc…
zap0, no, I take that back

does strlen() count spaces too?

yes

like A B would that be 2 or 3?

try it

3

thanks, what i wanted
= or =

why wouldn’t there be a way to stop parsing?

=

I want a browser identify. For example if user using internet explorer, do a thing, if using mozilla do other thing. How can I do this ?

zap0, I think most of us are lost on why there would be a way to stop parsing
beyond halt_compiler

http://php.net/variables.predefined – have a look at the section on $_SERVER

yeniklasorr test the browsers string

and don’t forget to send proper caching headers, the Vary header is important

henke larsson

no

Ktron, because i want to. if php webhosting has some agenda to prevent people doing as they want, it sure as hell is not evident in its design.

megatron

chalgo, megatron against blacktron?

I think it’sin the env variables, but I’m not sure.

yeniklasorr $_SERVER["HTTP_USER_AGENT"]

poor zap0

?

why

Are there limitations to array index or key size? I’m trying to put elements into an array with indecies based on powers of two, but once I get to 2^32, I get funny numbers. I was having a hard time googling ‘maximum array index’ without finding stuff for max().

poor lolotov

echo PHP_MAX_INT;

zap0, maybe someone else knows different than I

lolotov, you should use antother algorithm

use http://php.net/bc for it and you won’t have a problem

lolotov, yeah, its not the array index or key size I bet, I bet its just the int size

poor Ktron

if i not use function session_start i not go have phpsessid right ?

poor MalMen

define poor please

correct, you must do session_start()

agreed, but once I stumbled on this, I became intensely curious. rza: ‘PHP_MAX_INT’. ktron: that’s what I’m thinking, if I bit-shift to get the numbers, I get the same ints, but when I use pow(), I get much higher. caffinated: looking now, thanks.

ignore him, just a troll

yea, i beleve

alexC sucks

not have way to get sessionid with out session_start ?

nope

i just want session_id to pervent multi users use the same account

that’s exactly what I’m looking for, thank you.

hmm

poor DarkGirl

IP ill not work if users use proxys

O_o

not sure what you mean, you just want a unique ID?

yes

no problem. just keep in mind that past a certain point you can’t use regular math on those – you’ll have to use BC

uniqid()

poor caffinated

comming fro the browser

why

that il is random

why

I was going to ask who was trolling, but I can see now

why

i want a static host id per user

why

one id with user ill dont know have

^^

gg chalgo

and change every time user change their browser
just like session_id

then why not use sessions?

but i wont start_sessions :X
because that ill denied users to open multi connections on same mommento
thanks at all
you not have think by me
i ill think by my self
and find a way

That sir, is a canceled czech

lol

http://mlti.sad60.k12.me.us/new/contact.html

MalMen, I think there’s a way to get info about where a host is coming from

it’s a .html file, adminGuy

your problem is a common one, and can’t be fixed. There is no way to identify people

rename it to .php or make apache parse .html files,

Dynom yes have
we just have to think :P
one time i make that way

ah, i thought it might have to do with the webserver. i’m used to a host that has apache set to parse .html i guess.

no there isn’t, unless you start using fingerprint recognition

using a java applet to get the motherboard id

and even that isn’t failsafe
you can’t
a motherboard is not part of a human

thank you.

well, i ill think

that just identifies a pc, not a person

thanks all

if you find a way, let me know, I’ll pay you for it

ok

and again, people, not computers (even though that on itself is a challenge)

Dynom, RSSID?

whats that
besides a term for a remote session

how I do an array with numeric index and string index at the same time?

is there some way to get the user some information line for line?
like what is used for IRC bots

basically a dongle you carry around, that displays a password that changes every n seconds

Are you sure you don’t mean RFID?
Which has already been broken, btw.

‘yay’ );

it’s flawed by concept

Good. Personally I don’t think we need yet another tracking system for people.

worked with an RFID project, which was total fun btw

sub, I do mean RFID or something liek thast

create one that works, you’ll make a lot of money

can someone help me with me questoin?

Get to watch what the tags where up to?
skiwi, ask

no one can if we don’t know it

i already sked it

I know, but I less-than-three my privacy more than I less-than-three money

is there some way to get the user some information line for line?; like what is used for irc bots

All ur base are belong to me

Dynom, then, I’d cancel it, and get a new one
Dynom, and you’d be me until I noticed

someone saw my question?

but then again, a bit overkill for a myspace profile
it’s a bit of a vague question
userinformation…? whats that?

Dynom; u know a irc php bot
that outputs on the web
every time it receives new information
it shows the user the information
(what someone says)
but how does a bot do it

Does PHP have an irc lib?

ye

is there implements_interface() function? similar to is_a(), but asking about interfaces instead

http://google.com

so I’m trying to exec($command), but it is not running the command as expected, but if I echo $command then copy and paste the result into a shell it runs just fine, any ideas on how to debug this?

the ircg one kinda sucks. the one in PEAR is ok.

thankss

basically you read A and output to B, but you got a few problems to tackle, one of them is sockets, 2nd of them is timeouts, 3rd is protocol
ubasically you read A and output to B, but you got a few problems to tackle, one of them is sockets, 2nd of them is timeouts, 3rd is protocol/u

hello all
I compiled and installed php4 and configured httpd.conf.. but when i access a php file the file is not being interpreted and the source code is sent to my browser without interpretation
where did i go wrong?

At step one.

!+at

For Apache to be able to parse your .php files, you need to add this line to your config “AddHandler application/x-httpd-php .php”. To make .phps files work too, you need to add “AddHandler application/x-httpd-php-source .phps” also. You must restart Apache after adding either or both of
these lines.

Hey guys, i’m about to impliment a single sign on feature for each of the company websites… Anyone have a great way of doing this?

“php *4*”

heh

ye Dynom; but I don’t want to build php irc bot
but something that gives the user the output if it’s found what it is searching
that it won’t wait till it gots the whole output

then you’re in the wrong channel

well then again, you need to read something, and write it to something else

that’s a fast answer. you should get paid for such work.

ah, instanceof works for that

I am.

ey Dynom
to the users screen
or buffer or something

http://php.net/fgets

k

look at the example

Dynom; trying it now

it sounds like you want to use some AJAX

but it only works when reading file? Dynom

no
the handler doesn’t matter, can be file or socket
the system works the same

ow ok

I’m afk

shoud i do ‘AddHandler php-script .php’ or ‘AddHandler application/x-httpd-php .php’? becuase I tried both and I get the same result… not parsed php hosting file.

are you restarting your webserver?

yes

well, it’s something in httpd.conf that is doing it

Caffinated, you should have babies with me
XD
nah, just kidding

i’d check the apache error log to make sure it’s loading the module

skiwi, stream_get_contents() might help too

ok
checking it soon

sorry, i don’t support inter-species mating

bsy now

oh, ok

are you sure the php module is loaded (e.g. there’s the LoadModule directive)

what are you, dolphin?
oh, inter
wait, what are you trying to make babies with!?
do I want to know?

internet, intranet, I don’t think we have to worry too much about caffinated

is there a time/date function to give me HH:MMS from a number of seconds? date(‘H:i:s’,$seconds) is close, but it does timezone stuff

timezone stuff?

sparrw, are you saying you want time/date from a number of seconds GMT?

you do realize that “inter-species” means between different species, right?

no, I thought inter meant inside a group..

you’re confusing it with intraspecies

time elapsed, actually. i know it wont be over 24 hours, so time/date will suffice.

caffinated, ah yes

0

found it
gmdate()
thanks

multi-processing in php is pretty ridiculous, but hilarious when you figure it out

is there an easy way to get the last inserted id of a postgres INSERT ?

I know this is a javascript related question but does javascript have a function like exec()

alexwait205, there is eval
and there is likely non starndard interfaces for real command execution at the client

but does it execute on the server on the client’s machine?

javascript usualy runs on the client

then why not go into #javascript ?

if there was an exec() for javascript, it would be a severe security problem
which is why there isn’t

$stmt = $this-db-prepare(“INSERT INTO icons VALUES (?, ?)”); Am I doing something wrong here? I var_dumped $this-db and it looked ok.

that looks ok.. what’s the error you’re getting?

its just returning false

you’re using PDO yeah? enable exceptions when you create the PDO object

actually its just mysqli

ah

Hello hello

may I notice you the url of my httpd.conf?

if i want to convert seconds into HHH:MMS, is there a built in function for that?

HHH ?

date()

look at php.net/date

you enjoy copying the same question to multiple networks don’t you

the only reason you know is because you’re in more than one network White
You can’t blame him

no. but i enjoy less waiting for an answer on one before asking elsewhere.

|P

and?

OK i see the problem now. How do I deal with the autoincrement field?

you may want to ask some of the other people here, i’m at work atm, so i don’t have a lot of time to review stuff

Anyways, I’m not interested in the petty arguments of others, I’m too selfish for that.
Got a retarted error message using mysql_connect()

date() wants to spit out days after 24 hour
s

don’t specify it in your column list, or pass NULL

ok

Call to undefined function mysql_connect() in CProgram Files\Apache Software Foundation\Apache2.2\htdocs\vars.php on line 10″

you need to load the mysql.dll PHP extension by editing your php.ini file

kk

then restart apache

Would that .dll be included in the php module I downloaded?
Somewhere..?

yes

kk

in the zip or installer dir there should be a directory called “extensions”
set extensions_dir to the pat of it, and uncomment the line for mysql.dll

function hms($seconds) { $time = array(); $time['hours'] = floor($seconds / 86400); $time['minutes'] = floor(($seconds – ($seconds / 86400))/3600); $time['seconds'] = $seconds – ($time['minutes'] * 3600) – ($time['hours'] * 86400); return $time; } is a start to your question, by the
by

yeah, i already wrote it
thanks

wasn’t that much easier than getting spoon fed? look, you’re done before you got force fed

ok so i set $id=null and put in the query , it seems to be working now

ForceFollow:

doesnt change that it should be built in

guys, my php code is not being parsed. I did add ‘AddType’, ‘LoadModule’, ‘AddModule’ and ‘AddHandler’ .. my httpd.conf link is http://67.18.92.138/httpd.conf

and join the other 18,000 core functions? eh, no

im going to spend a half hour duplicating the functionality of date() over the course of the next few days as i need more features out of this function
join? no. it should be part of gmdate()

the purpose of gmdate/date is to produce human readable time/dates… our times and dates are not in HHH:MMS format

bitchx ftw

alo

plenty of human-readable times are printed as HHH

So, I wrote a function to manage procing arbitrary number of processes against items in a file, if anyone was interested or wanted to point what I could do better, http://ktron.pastecode.com/39160

in the instant case, im totalling hours across multiple days

Is there any way to get the RGB value given a string containing a color, assuming the color could be like ‘#ff0000′ or like ‘red’ ?

Er, not a function, a ’script

yes, I’ve got a function to do hex to rgb, hold on

I can do hex to RGB, no problem

C:

it’s the ‘red’ that throws it off

why?
if ( $str == ‘red’ ) { return array( 255, 0, 0 );

but that’s now how we write date and the current time, that’s a way you can represent time like a counter like that but i don’t say today is hour 1-trillion 500 thousand

tmpOO, that config sucks, get a new config

HarryR

WNxCryptic!

Sorry, connection problems.

given the string ‘red’, how do you convert it into RGB?

Wait a second
Whitewolf…
lol

wut

like I just said,

well, okay, but there are a bunch of colors

Didn’t even think about it.

and?

red = 255,0,0

I need a general solution here, not just a solution for red

Any interesting projects going on?

most other language-included time libraries have a HHH-style date format specifier

return array(255,0,0); case ‘black’: return array(0,0,0);….

yes, so get the RGB values of each of the stored colors, go to W3C to look for that

not really, why?

what is HHH ?

sparrw
hour hour hour

012 ?

just curious..hehe, I didn’t even think about you being WNxWhiteWolf when I joined the channel

do you guys think it would be a good idea to have a set of functions that manipulate JavaScript?

hours with as many digits as it takes, usually

like a JavaScript.alert(“text”); function that would show a JS alert()

you can;t,

caffinated, you use any of the php libraries for ajax?

then use date(“d”);

php is server host side, it can’t just pop up random dialog boxes,

no but it can write javascript host code

i dont want days, i want hours.

you get around huh?

oh, date(“H”)

onto an HTML page

tags

that still stops at 25
24

can’t see the point in that personally,

necromancer, so function js($s) { return ’script type=”text/javascript”‘.$s.’/script’; } ?

ofcourse it stops at 24… there are only 24 hours in a day

that’s pretty much what that would do

necromancer, then I can js(‘alert(“this”)’);

are there?

that would work too

so why are you about these parts?

but it would be a larger set of functions

if you want the number of minutes or hows between two time spans just do $endtime – $startime / (60 * 60)

non sequitur.

Working on a website involving PHP, and I’m more than just a little rusty.

and it’ll give you the number of hours between the two dates

i dont JUST want that number

you’re welcome to message me any time

i want any of a thousand different ways to format the time, including that number.
im using date() and gmdate() in dozens of other places

i’m thinking you could have functions for just executing JS code, executing commonly-used code with a single function (like javascript_alert())

he’s just being grouchy, ignore him

it would sure as hell make my error handling a lot easier lol

if i implement HHH manually then ive also got to reimplement all the other formats

Thanks, I appreciate it. I actually do have something WNx related I’ve been meaning to get to one of the other 5 Stars about, if you have a moment.

uh.. make something yourself

necromancer, I think you’d have to think up functions that use more than one command from js

im going to end up writing a wrapper for gmdate

sure

and?

you know what i’m going to fucking do this

if you want custom date formatting you’ll have to write it yourself

and that is illy

gonna make a JS library lol

silly
its not “custom”… its just not included in php

php would millions of functions if every fucked up idea made it into the code, heh

i agree
so, lets skip the fucked up ideas

+be

can you give me an example where the number of hours are represented as 3 digits?
for a single time..

if you work 100 hours in a week then your paycheck says 100:00
:00.000000

necromancer, you might want to look up some of the ajax/php libraries, they might have some

yeah…

you shouldn’t rperesent hours going upwards in acutal hms format though
it will just serve to confuse people later on

hmmm

fractionalize the hour if possible

so you just write a quick thing to work out the number of hours, it is _NOT_ the date formatting functions job to do that

or whatevery ouc all it i’m mkaing up words
0 would be 100.5

it formats dates, not durations

0 (hours:minutes:seconds)
like 100 seconds*

1 sec

ok

as long as the total is less than 24 hours, gmdate(‘H:i:s’,$seconds)

ok

http://tools.assembla.com/svn/lithium-php/tags/pre-lithium/lib/core/timespan.php

ppl, my php code is not being parsed. I did add ‘AddType’, ‘LoadModule’, ‘AddModule’ and ‘AddHandler’ .. my httpd.conf link is http://67.18.92.138/httpd.conf

and customize the output format

can we use fsockopen to verify the existance of an email address as shown in this tutorial ?? http://www.devshed.com/c/a/PHP/Email-Address-Verification-with-PHP/5/

have you looked at gmstrftime?

You using fedora?
or redhat?

I think that was to the wrong person :P

oh right yeah it was

sparrw; can I get something like date(‘U’) with milliseconds?

microtime() ?

slackware

arggh damn autocomplete
microtime()

ooooo slack it’s been a while

ok

slackware using selinux now? Cause selinux killed php functionality on this box until I changed the policies

so ha1331; microtime() = milliseconds passed since unix epoch

yes, read the manual

ok

nop. my settings were working until i reinstalled php to get mysel built-in…

Wow…horrid internet ftl.

you think that the 1-366 day number of the year is more common/useful than my HHH?

Eh, sorry I’m fresh out of ideas at that point

now it looks like i’m in a dead end.. i’ve done everything i know

date() doesn’t work on timespans and isn’t meant to work on timespans

that is quite obvious

PHP 5.1 includes functions for timespans though
oh no it doesn’t nm…

Are you there?

hmm
00:00:00:0100

that’s the beer kicking in

$time = gmdate(‘H:i:s:ms’,$time);
this is mine output

just curious, can http://ktron.pastecode.com/39161 be made any smaller?

hi
I have a templating problem

HarryBeer?

that looks abt right to me

Ktron, what you mean smaller ? why does it matter?

this is my script
$timestart = microtime(); $timeend = microtime(); $time = $timeend – $timestart; $time = gmdate(‘H:i:s:ms’,$time);
I putted $timestart before the main while loop and $timeend after the main while loop

Away a minute.

will that really calculate the time it did ove rit

I’ve got a file that uses a class which outputs stuff out. The file is loaded into an output buffer with ob_start and assigned to the variable $pageContents which is then passed to the template and shown with print $pageContents; – but somehow the class is able to totally override all this
and output stuff and bypass the template – is there a way of stopping this?

no it wont

ow HarryBeer; how can I?

sprintf() unstead of that horrendous zero fill you have

microtime() returns an array, read the manual for the functions you’re trying to use and be inventive

Is there a way to run php5 in fastcgi alongside php4 module? Most of the sites on my ded server use php4, but a few new ones need php5.

if you don’t mind me I have some beer to consume and a bbq to cook

ow HarryBeer; but I don’t understan dit on php.net

McFly, good call

I think I fixed it almost
anyway got one working now

ratonn, unless you are doing odd stuf, php4 scripts works fine in php5

odd stuff? :P

So, http://ktron.pastecode.com/39162
For some reason, it seems to break on hhhmmss(1000)

if I have output from stdio (an external script) how can I parse this? I would like to stay OS independent, so $lines = explode($rs,chr(13)); is not sufficient

Zathraz, you could use the regex version of explode
Zathraz, preg_split
or…

so preg_split(“\n”,$mystr) ?

How are you getting the output? fgets returns output from a hande line by line
Zathraz, well, that’d be the same as explode(“\n”,$stuff)

output comes from $rs = system(“ls”)
(just an example)

Zathraz, $lines = explode(“\n”,$stuff) doesn’t work?

next I want to parse $rs
dunno. It has been years since I programmed PHP
I ‘ll test

http://www.streetracers.de.tp/?wid=9128

Dogg, it loads off to the side for me

I’m having trouble converting strings like, “-34.382″ from an array to floats using typecasting and floatval(). Is there another way?
That wasn’t worded correctly. I wan’t to convert the string “-34.382″ to a float value I can compare numerically. This string value is coming from an array returned by fgetcsv()

someone can tell me when can we use mysql_fetch_assoc?
doc doesn’t tell me much

Incarnadine, typecasting looks fine to me. Try var_dump((float)”-34.382″);

“var_dump((float)$line[8]);” returns: float(0) the value of $line[8] is “tring(17) “5263.91

You use it when you don’t want numeric arrays
It returns an assoc array, and not both like fetch_array()

Incarnadine, weird, are you sure that var_dump($line[8]) returns “5263.91″? Which version of PHP do you use?

5.2.1
Hrm, looks like the data in the csv is fudged.

quick question…
have an array
with subarrays in it
how do I access a sub array element with the name “userid”
$val is the array
and I tried $val[0]['name
']
without much success

action1, what’s the subarray’s key?

What is the best option for caching?

/j #linux,#java,#php

$val[key][subarray key] should be it

woops

action1, if you aren’t sure about the structure of your array try a print_r($val)

resiliance, what do you mean?

Well,i don’t know if i should use a pear extension.

here, here’s what I get…

John Doe ) )

so

is there a library I can use to integrate SVN with PHP?

I want to stay away from pear. To large for what I use. Not sure if i should use Output buffering? or something else?

so to access…. $val[0]['userid']?

$val[0]['userid']

action1, sure

I then call print on it
do I have to call something different…to print it out on the page
that could be the issue?

resiliance, yeah, I’m not sure

Anyone else? What do you use for caching/

action1, accessing an array value is a expression like any other expression, nothing different should be done

ok
I got it
I had to assign the array to some var
and then print that var

anyone?

thx

action1, that is not necessary, but works, you can simply use echo $array['key1]['key1] without problem
action1, sorry, it is echo $array['key1']['key2']

yeah, that’s what I thought….but it wasn’t working…maybe cuz I was running it in a print statement
oh shoot

action1, anyway, the print should work

cuz print literally takes the item
and prints it out
ah well, works now
thanks

if you’re running it through a print statement you can do print “${array['key1']['key2']}\n”

action1, no problem

I always forget about using the curly brackets inside of strings

yeah its very nice if you don’t want to break your string up into a bunch of concats

I end up doing “string”.$array['key'].”\n” or such
chewy, more legible too

yeah concats can get out of hand, thats why I like the curly bracket, its a nice middle ground between concats and sprintf

hi all

hi

I need Binary Path for my ubuntu server

hey chewy, I missed something..
what do u use to avoid long concats of strings?

ay idea for that
????

well whenever you are trying to put values into a string, you can reference the variable with curly brackets so you can do multi level array indexes in strings, ie echo “${foo['bar']['hi']}\n” and then everything in the curly brackets is just referencing the array index

what would be the alternative for “${foo['bar']['hi']}\n” ??
when concatenating strings

echo “Hello”.$foo['bar']['hello'].”\n”;

oke

Hi there. I was wondering if there are any security implications of code like: include_once ‘includes/foo.inc’; ? Is it better to do include ‘./includes/foo.inc’; or better still to do include_once ‘/full/root/to/whaetver/directory/foo.inc’; ?
I know there are “bad things” that can happen if there’s a variable in there somewhere
But if the path is hard-coded, does it matter?

there are no real security implications if the path is hard-coded

Great. Thank you!

/var/cache/apt/archives/screenlets_0.0.10-3_i386.deb — this error has occured for 4 days when i try to update !! why ?

oke, i get it, thos curly brackets are pretty nice chewy

there are much better things for you to be concerned with if you’re concerned with security

well, assuming you are not going to use chdir before the include

i have the orange stuff that says there is a new update… but can’t do !

haha, figured as much.

heard about Windows Home Server?

oh, so I shouldn’t do chdir($_GET['path']); first? (KIDDING)

http://www.microsoft.com/windows/products/winfamily/windowshomeserver/default.mspx

go to #yourdistro

concern yourself with the input to your script, anything that is input to your script is suspect to be from a hacker unless you created the input yourself, e.g. a database or a file

do you reckon it would be a good choice for php/mysql server?

if you code paranoid as hell on your input you’ll be fine

AlexC_, omg sorry i thought i was in ubuntu channel

Nasky:

If I wanted to strip a link down to just plain text, what would I use to do that?

hey guys, if i have a class, how do i include files in for the class to use?
there are a couple functions i want to use, but i get an unexpected t_include expecting t_function
do I have to include the file outside the class?

I’m getting an error with pecl install svn
http://pastebin.com/dfb37cbc

if u have a class, u can just include another class,

nm – I can download it from the source and pecl build

when I try to include another file, it throws me that error….should I include the file before declaring the class?

the u can just create an object, lets say $object, en use the function; $object-functionName
i mean $object-functionName();
yes, u do

right, but will my class have access to that?

it should

kk, let me try.

oke

thanks JS88, appreciate it

ur welcome

i have been doing far to much javascript and have lost my php foo :[

haha
but im out, cya

Okay, newbie ?ion.
I have file a, that required file b. File b required file c. Is the require_once ' ... ' relative to file b or file a ??
For b to c ?

it's relative to the file it's included in

so if file b is in /some/random/dir

so if b includes c, the include is relative to b

and file c is /some/random/dir/else/foo
b could do
require_once 'else/foo/' ??

i believe so, yes
i normally don't do such path juggling, and just use the include path
this way all files can be included as relative to a single common directory

Anyone whose curious, http://panthar.org/2006/06/15/php-with-mssql-on-ubuntu-606/ works perfectly for getting mssql support on feisty and gutsy

if print_r (fetchurl($_GET['url'])); prints an array fully, how could I print the [0] …. bit only?

yeah… i should prolly do that.
but wth :-p

Ktron how is that working for ya?

the result of fetchurl() needs to be stored in a variable, and then you can access it’s [0] index

lol as we speak I’m setting up a script to run on a windows box to access an mssql server, because we couldn’t get mssql support working in fedora core

chewy, I’ve run through it at least 3 times on feisty, and I’m on my 2nd time on gutsy

unfortunately php does not support array syntax with functions, even if they do return an array or string

chewy, and I script the hell out my php cli to connect to tons of mssql servers

very nice
yeah I’m a little irritated that I’ve got ot use the windows box
but its gotta get done
I’ll check that out over the weekend and see if I can get that setup

Can’t switch it to ubuntu?

http://jr.ihack.co.uk/getrs.php?url=http://theynd.com/showthread.php?t=49517 I need to print all links returned by that in a friendly end user way (eg. without all the [0] index’s etc..)

gentoo++

you may want to have a look at http://php.net/foreach

I bet, total manufacturing time of an hour, you could have a ubuntu feisty desktop with php5 with mssql support

is there a function to remove html from a string?

I tried getting it working in fc, but I ran into rpm hell trying to get it setup, and I couldn’t find a repo with mssql php support

googlizer, strip_tags

thanks

well unfortunately our unix box is at a managed colo, so we’re stuck with fc
thats why we’ve got a dedicated windows box at the office dealing with random crap that needs windows

ah well

Ok, ive put it into a function…How can I get all index’s instead of just one?

but I’m in the process of building new servers and moving them to a colo, but I’m going to toss freebsd on those

I just helped convince my company to switch from fc to ubuntu

very nice

did you have a look at the link i posted? it’s specificly for looping over an array

yeah ubuntu is way nicer than fc

plus, the support terms are much better
what fc are you running?

these were already setup by the time I joined the company, so not much I could do about it
iono, I think 6

I’ve managed to echo $var[0] or $var[1], how could I do them all?

fc 6 EOL’s… this fall? I think?

http://php.net/foreach

opposed to ubuntu 7, which EOL’s…. 2008 or 2009

but actually I’m putting together some server specs this weekend, so we’ll only be running on these boxes for a little bit longer
well I like ubuntu on desktop, haven’t ever tried the server version, but I’m planning on going with freebsd

iH4ck123, /agree caffinated

imagemagick guys added a forum section for imagick

thanks, done it :P

no problem

Does “echo file_get_contents()” load the entire file into memory before sending any output?

it will load it into the display buffer and if the contents are smaller than the buffer size then it will all be loaded, otherwise it will fill the buffer and flush it then fill it again

thx

but either way that file_get_contents() function is called before echo, so it _will_ be fully loaded into memory at some point

told ya so

i just changed the include_dir

it really is the most painless way
and still easy or organize. can then do include ’some_collection/some_library.php’;

I just wish that PDT understood includes… or maybe I just need to switch from includes to requires

would it be better to use fread instead of echo file_get_content to output a large file?

j0k3r, can you include(‘file’)?

whats PDT?

no, I am sending a file out as in a file download

well file_get_contents will load the whole file into memory as opposed to file() which I think operates per line, well actually I think file() just loads an array of the file, so its still loading it all up

php dev tools for eclipse http://www.eclipse.org/pdt/

if you just want to send to output, use readfile – include() isn’t a good idea unless you want to parse the contents as possible PHP.
http://php.net/readfile

chewy, yeah, file() just puts it in an array instead of one string

ah yes, readfile is what i wnat

Ktron ok thats what I thought, I just wasn’t sure if it only loaded one line at a time or not

does anyone know a good tutorial for using PEAR Mail to send emails, searched on google but only found one which was just the basics

Know of a way to get php to emit an error message whenever a script accesses a global registered from $_REQUEST?

turn off register_globals and turn notices and warnings on

i inherited some code that requires register_globals to be on, but I don’t want to suddenly break it for the folks useing this code
using
it would be useful if i could catch and fix the instances before i turn off register_globals

you could also try enabling E_STRICT, although I don’t know if it covers that

how can i put in my php files, php to report all errors to browser ?

change error_reporting to E_ALL and display_errors to ON in php.ini

hiall

both values can also be used in your php files directly, via http://php.net/error_reporting and http://php.net/ini_set but some errors are not reported (such as parse errors) because they occur before the script
begins executing.

// Error Reporting
ini_set(‘display_errors’, 1); // 1
error_reporting(E_ALL); // E_ALL ^ E_NOTICE

does somebody have an exp in Seagull fw?

usually we try to encourage using the manual here, but SunSparc is right.

Oh, yeah, sorry. RTFM kaydara

anyone know if there’s a way for PHP to figure out that say .css == text/css?
from /etc/mime.types indirectly or otherwise

that should be a function of your webserver, and not php

http://us3.php.net/manual/en/faq.misc.php#faq.misc.registerglobals
some of the code here could be tweaked to do what i want

What’s the equivalent to shift in perl, to php?

array_shift()?

ok thanks.

Yes, but i’m building a VFS – which means i need to include a .css file, which means that i need to pass the appropriate headers via php
asssuming my css files are under the vfs, which is preferable

Help? If I receive a GET is it possible to pass it on to another page as a POST?

yes iH4ck123
look up curl_*

ah how stupid of me, thanks :P

you can process the get requests, translate them to POST then send them on using curl
you might even try $_POST = $_GET If you’re not intending to do any checking
any idea caffinated?

i see. maybe have a look at http://php.net/mime_content_type – or perhaps the newer Fileinfo PECL extension

Speaking of POST, anyone know of any good POST spoofing tools?

thnx
spoofing?

Is there a function with which I can check if a class is abstract?

it may not detect CSS as being text/css though. more likely it will report it as text/plain

Well, GET you can specify as much as you’d like in the URL itself, I can certainly write a PHP page to pass any POST arguments to any page I’d like, but that’s still not very robust– ideally, I’d want to be able to specify what page I want to spoof it coming from too

Has anyone here ever implemented a web site with legal documents on it that need to be “esigned” online?
The legal documents would just be on a web page that has an agreement on it and the user agrees by clicking the “eSign This Document” button. I have seen it on other sites, although that does not mean they have anything that is legally binding, compliant with: "http://www.ftc.gov/os/2001/06/esign7.htm">http://www.ftc.gov/os/2001/06/esign7.htm

how come i get this kinda header when i use the mail()
Message-Id: 20070824203030.70B283F4273@98945-web1.avatarnewyork.com

hey

it’s probably an injection from the MTA

MTA ?

Mail Transport Agent

so what should i do to fix this?

why does it need fixing?

when i send it from different server its ok

well, it’s likely not a problem with php, if indeed that header is a problem.
you’ll have to look at your sendmail configuration (or the config of whatever MTA you’re using)
which is not supported here

i thinks its my headers problem when i send mail()

ok then, you have it all figured out good luck.

but dont know how to fix it

and i’m telling you it’s not a php problem.

heh raining pretty good here in indiana

Just as an FYI… JMC and his wife are ok in Peru after the earthquakes.

you’re looking at the wrong thing to fix – please figure out what MTA you’re using, and take it to an appropriate support forum.

whats the correct way to end the mail headers ?

bka jmcastagnetto

headers = “From: asdfsd@asdasd.com”\r\n ?

So is he ever planning on coming back stateside?

I created ACL table in database. It’s made for controlling editing rights in category. http://phpfi.com/258506 I added “type” field to allow plugins use this table but i wonder it it’s needed. Plugins will probably have own rules. E.g. forum – edit own and
edit all? :o Bug reporting – hmmm… but what do you think about it?

I found it, the reflector class… :P

I doubt it, INS told him to fsck off (for the most part), he’s now married, and working at a University down there as well as with a Bioinformacs team.

http://phpfi.com/258505 (may be shorter)

the constant __FILE__ contains the name of the current file being run

He’s also heading up a Peru LUG as well

Where can I find sourcecode of the new php5 classes, does anyone in here know?

if the file has been include()ed, is there a way to find the name of the parent file?

Heh. Score -1 for HomeSec, eh? :P
Well, at least he’s doing well.

Our loss, that’s for sure.

again, and for the _last_ time. Message-Id is __NOT__ a header injected by PHP.

PM?

Sure.

hello everybody, why could a static class loose it’s static property please ? it seems like it gets reseted

is_null did you change the static property?

nvm, i was trying to acces a singleton class before it ended construct and be assigned to the static property …

classes are more efficent than hashes, right?

Though might need to use your old nick

class foo { var bar=”1″; } is better than foo['bar']=”1″;… right?

function parse_search($loc) {
$content = file_get_contents(“http://xoap.weather.com/search/search?where={$loc}”);
preg_match(‘/loc/id=\”(.+)\”\ type=\”.\”(.+)\\/loc/i’,$content, $matches); for this, If i receive multiple locations how to tell?

Assuming I don’t need to dynamically add to it

use preg_match_all instead of preg_match. however, i don’t see how that regex would possibly work in it’s current state.

http://www.streetracers.de.tp/?wid=9128

Monie, have you looked at simplexml?

Monie, "http://rick.measham.id.au/paste/explain.pl?regex=%2F%3Cloc%2Fid%3D%5C%22%28.%2B%29%5C%22%5C+type%3D%5C%22.%5C%22%3E%28.%2B%29%5C%3C%5C%2Floc%3E%2Fi">http://rick.measham.id.au/paste/explain.pl?regex=%2F%3Cloc%2Fid%3D%5C%22%28.%2B%29%5C%22%5C+type%3D%5C%22.%5C%22%3E%28.%2B%29%5C%3C%5C%2Floc%3E%2Fi

ew

Monie, $xmlparser = new simpleXMLElement($content); foreach($xmlparser-loc as $loc) { echo $loc['id'] }

Ok.

Monie, simplexml is the best thing to happen to xml processing since sliced bread
except sliced bread didn’t do anyone any good when it comes to xml parsing

lol

PHP5 only i think

it is.

Hey caffinated, PHP6… threading?

and i also agree that a proper parser is the way to go.
i duno, but my guy says probably ‘no’
*gut

Ah well
Alright, I’m out, be back later maybe

if i want to use the json library inside a class, how can i include the json library file? (JSON.php)

require_once(‘JSON.php’);

Before the class declaration?

yes

then i can do $json = new Services_JSON();

yep

can i now reference $json-encode and $json-decode in the class functions?

then echo $json-encode($someArray);

why dont you use the native json functions?

there are native functions?

php.net/json

i didn’t even know. I’ve always used a 3rd party lib

$this = new foo(); ?

I keep getting a ” call to function encode() on a non object”

no
it makes no sense

did you di $json = new Services_JSON after you require the JSON.php file?

yes
and i can do $json-encode BEFORE i initialize the class

ok

bkruse, no you can

So, PHP6 won’t have multithreading?

no

ok.

It works, except I cannot access $json-encode and $json-decode inside a function inside the class

it does for some features, like curl

Let’s say I have a bunch of stuff in the $_POST[] array

theres been some efforts in implementing threading in php

even PHP5 thought

but theres quite a few obstacles to pass

bkruse, can you pastebin a sample of something that doesn’tw ork?

such as $_POST["user-1"] and $_POST["user-2"] all the way to 100. How do I convert this to $_POST["user"][2] ?
( for example)

absolutely, h/o

anybody have any white papers on mysql session management

name=”user[]“

in your class definition, define a private variable $json. then in your constructor have: $this-json = new Services_JSON();

in the form

anyone knows when will the bug with $this-foo[] = $bar; calling __get instead of __set be fixed please ?

sorry, the platform that I’m building on doesn’t allow that.
That’s why I have to use hyphens.

then when you need encode/decode, use $this-json-encode()

which platform?

Facebook

ah

$value ) { $parts = explode( ‘-’, $key ); $array[$parts[0]][$parts[1]] = $value; \

http://pastebin.org/1104

bkruse, fireflymantis is probably right, that’s what I was thinking you did, I just wanted to see the code to see if I was right

the last \ is }

ah, heh, I’ll try that out
thank you rza!

OH, let me try that

no problem

bkruse, you’ll get used to it as you start doing more OO code.
a necessary evil.
i wish it was just $t since you have to typew is o damn much

is enforced

in most of the languages you can just type String foo = propertyName;
without this.propertyName
and naturally people dont have any naming schema

var me = this;

yeah I guess that would work too. lol

great, i believe that worked!
thanks andre_pl and fireflymantis

no problem

I just installed Apache2, PHP5, and MySQL. I downloaded and unziped phpMyAdmin, when I try to access the index.php I get the file ‘error.php’ unparsed, but when I create a simple phpinfo() file it runs perfectly! why phpMyAdmin files are not parsed?

hi there, did “install” phpsysinfo in my machine, but i get this kind errors:
common_functions.php 158 find_program(sensors) program not found on the machine

ok, good for you

mmm… how i fix it?
you can be a troll, that’s just OK

actually, youre the troll

why?

i might be barking up the wrong tree… is there some sort of directive you can give php to let it know what the “home” directory is

well, this channel is a developer channel

i swear i’ve used it before….

not third party application support
i think guidelines wouldve told you that (if you wouldve read them)

daysleepr, you mean the working directory? chdir()

no, i think its a tag that goes on top of hte php document?
i’ve been going back and forth between languages lately, so i’m sorry if i’m totally in the wrong here…

but why would php care about the “home’ directory? what exactly do you mean by that? becaseu i’m asuming you don’t mean /home

no, like the relative path for the links and images to refer to

the script will probably be executed by ‘nobody’.. who has no home

is there a decent example of what a ‘dynamic’ page written in php (perhaps with loops?), im just curious to see something like that

daysleepr, you can read it, but i dont think you can set it.
i think its $_SERVER['script_filename']
but you have to trim the basename

csc`: theres good tutorials in phpro.org

well, thanks for you non-helping actitude

no no, not a tutorial, an acual example :P

just open a random page in your browser, most are using php :p

not int he file/folder structure of the machine
but in the relative paths in the URL
like html/images
or if you’re in html/clientarea/test.php

daysleepr, maybe $_SERVER['script_name']
one of those 2 should do it.

to let the script know that while you’re in /html/clientarea, the images should look to html/images, not html/clientarea/images

csc`: do you mean the source code or output?

daysleepr, I dont think it works that way.

output

csc`: well the output can be just about anything
php does not limit the design in any way

daysleepr, it doesn’t look for images, the html explicitly states a path, or its left relative in which case it looks in the current directory, but that has nothing to do with php, its all handled by the web server

anyone here that has some knowledge about compiling PHP on Linux?

ok, gotcha…
thanks andre

Zangai, I know that its usually unnecessary no package available?

emerge dev-php/php

http://www.php.net/manual/en/install.php

yes
any specific info or just installing it?

good evenin’

*** [ext/date/lib/parse_date.lo] Error 1

Where is the link to change the template to standard subsilver?

LOL

is this a right channel for asking php dev questions?

oops

phpfi.com

wrong channel rofl

put more lines there

as in using php

Prodoc, yes
but you just used your only question, come back tomorrow

whats the consensus for how to handle ones mysql_connect() default password. Not php.ini but where?

that does not tell much about the actual compilation error

heh

Well, I didn’t got more

Poundo, i wouldn’t set a default at all.

"http://www.google.com/search?q=make%3A+***+%5Bext%2Fdate%2Flib%2Fparse_date.lo%5D+Error+1&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a">http://www.google.com/search?q=make%3A+***+%5Bext%2Fdate%2Flib%2Fparse_date.lo%5D+Error+1&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

store it in a config.php or something thats outside of the web root and include it

I had an error about running out of memory… But i fixed it with activating a swap partition

andre_pl; but I need to have it available for the script to use right?

Poundo, yes, any script hta tneeds to connect to the db should include() the config.php file.

Opps to quick on the trigger ok that sounds great included form a config I try that thanks

Did you really think that I am so stupid that I dont google before asking?

From a config I mean

Nope, just being helpful

can someone help me to use list.dsbl.org

do you know of any resources about php dev structures? I’m looking for info on how to set up a new php project properly and what to take into account concerning files and folder structure, what can function as a good basis, etc.

\
Well, I got it working already… So i will be off… L8t3rZ anyone…

I know that it’s all project specific but there must be some general guidelines, no?

Prodoc, unless you’re using a framework of some kind i think its pretty much up to you. I usually use smarty templates, so that gives oyu a bit of structure. i also throw in a class directory where I keep all my class files

Hello

check out http://www.phpguru.org/static/ApplicationStructure.html

cheers fireflymantis

Hello I have a ? May I ask.

don’t ask to ask, just ask

I don’t want to get banned or booted

hehe well ask your question and you won’t

Please, just ask, no asking about asking.

Like all the hacking rooms are dead and I want to find a place where there a people with info on phishing.
Where do I start.

no wonder you were afraid of getting banned

Yea

well this is a php channel

Yea and php files are in the phishing pages
I know how to edit php files.

I’m going to use a template engine but that doesn’t really offer me a basis for e.g. how to best implement the login stuff, configuration stuff, etc

well this is wrong place

I want to make a web site that needs you to sign up also.
Ok sorry

Nobody’s going to help you phish people.

No
You got it all wrong
I own a site well did it shut down
Stay safe
I was helping people
Using template on my site
so they could see

check out http://smarty.incutio.com/?page=SmartestSmartyPractices
if you are using Smarty, then this describes how to set up the templating system and use auth

well I don’t think you’re going to get much help for an example phishing site, as you have no credibility to say you won’t actually be trying to phish people

Sorry I will leave now have a good cyber day

thats why whoever helps him should make the login cookies and not real logins :P

I’m going to use Savant

ahh

haha yeah, but thats sketch, here let me help you make an educational phishing site, because you pinky swore you wouldn’t try to use it

Is there any form of escape()-function in PHP that’s compatible with JavaScript’s escape()/unescape() ?

fireflymantis, havent read your link, but what does templating have to do with auth?
Zelest, probably a combination of html_special_chars and addslashes ?

do you know if theirs any configuration file libraries/frameworks/engines that are worth checking out?
similar to ini files

was a wiki page that showed good dir structure, and how to set up the templating engine and also integrate PEAR_Auth into the system, and roll it into a nice set_env.php
was a wiki page that showed good dir structure, and how to set up the templating engine and also integrate PEAR_Auth into the system, and roll it into a nice set_env.php

ahh

csc`: http://pear.php.net/package/Config

y’know, I’ve been coding php for 10 years, and I’ve never used anything for authorization ever. i usually tie into phpbb because most sites that want a login system also want forums.

hefty depends

hey
what do you think – is adding “edit only own items” option in privileges very important?

so .. you’ve been coding php since .. PHP/FI ?
sort of predates phpbb i’d think

caffinated, maybe 8 or 9 years?
I dont remember.
think it was 99
when was the first release of php?

PHP/FI was released in 1995

hehe, when it was still “personal homepage tools”

the first C version of php was released in late 1997
this of course made your claim extremely confusing

lol, yeah i was just estimating. I remember where I lived at the time so I made an educated guess.

well, just don’t put it on a resume like that :P anyone who knows better will call bullshit
bwell, just don’t put it on a resume like that :P anyone who knows better will call bullshit /b

owned

do you know k=off hand when phpbb started?

not offhand. but it couldn’t be older than php

so I know this isn’t php related, but does anyone know where you can get an mssql client? this is starting to piss me off

sqsh

obviously not i’m just thinking about the first site that I worked on, it used a perl forum I think. but I coded a bit of a portal around it using php. and then a year later or so he moved to phpbb.

http://www.sqsh.org/

killkillkill

i was teaching a php class and one of the students had been coding in it for 4 years and never wrote his own function
he said he didnt’ see the use of writing your own function because PHP supplied so many already

Lol
i’d be afraid to look at that code

mattmcc awesome thanks

Debian packages it, fwiw.

well unfortunately I need a windows client :-(

Oh. Access? :P

naw for mssql

Access will talk to MSSQL.

oh I thought you meant using access to store data

It’s actually more useful as an MSSQL client than it is as a standalone DB, IMHO.

I don’t have access on there, I tried select just to install the sql client off of the microsoft mssql server cds, but that was a no go
hmm… don’t know how that select ended up in there… wow long day

Aqua Data Studio is also a nice tool.
I think you can still get the last free version, 4.something

doesn’t openoffice have a nice DB interface?

That too.

I just want a command line mssql client, I swear I don’t understand how people think windows is a good operating system
ok I’ll check out the aqua tool

chewy, i’m with you. I know a handful of relatively techy people that would never leave windows for anything… they’re crazy

gross…

if i spent more than 10 mins at a windows machine I’m in tears
cygwin jsut does’t cut it either

^^ unless it had cygwin..

lol
^^

heh
then you can make it for 30 before the tears come,

andre_pl yeah it just doesn’t make sense to me anymore, its one thing to use windows to program in, which I do at work, but I’ve got putty, vim, firefox and thunderbird so I’m good, but if you try and actually use windows to do anything, then its just awful
ok I’m going to go check out aqua data studio
brb

my problem with cygwin (and i probably just didn’t spend enough time with it) was that in the bash shell i couldn’t execute windows commands. i dont know if thats normal or not, but it bugged me.

It should’ve let you run anything on your path.

yeah cygwin is a hack, gives you a taste of unix on windows, but then you just get irritated that you’re not really running on windows

Comments off

guys I have the class Net_DNS working ok in one server and then I moved all to a new server and this class isnt

impleXML; etc.

hi! I have a little problem… I create a function (http://paste.lymas.com.br//?q=6846) and PHP show it messenge error: You have an error in sql syntax; check manual that corresponds your mysql server version for the right syntax to use near ) at
line 1
We can help-me?
sorry my english, I am brazilian

Functions need better names, would it be too slow to do on a enterprise level to encapsulate some in classes to make a easier interface?

does this sound right?
$getweek = “SELECT FROM que WHERE date =’$nextweek’ and date=’$today’”;
to show dates within one week of today

nickelnick, Might want to remove the single quotes
nickelnick, is date a int?

JonathanJooped, I can to do it, no problem
but, is it the problem?

yes

can it access variables using global please ?

date is an int
specified in the sql host db anwyays

nickelnick, then remove the single quotes

int do not require singles?

no

if the int is in sql or if the int is php
or both

nickelnick, no, your doing a integer comparison their, you don’t need them

okay

nickelnick, you also, need to remember that the code your writing if you make it public needs to be properly sanitized and escaped

” . (int) $today;

nickelnick, quick and easy fix to make that safe is type casting to integers

hrm
casting to intergers? what does that mean

usually type casting date to an integer is not wanted

nickelnick, it’s a integer in the database
nickelnick, probably a unix time stamp, so it’s acceptable in that use

why dont you use the database native date format?

nickelnick, php is dynamicly and weakly typed (type is the kind of a variable, bool, int string, etc) casting is a way to change it’s type
rza, hes learning is why I think

seems that I need to recompile php with –mhash enabled, but tried “pear install Net_DNS” at the server host which the class is working and I get the same error, so that’s not the problem (the missing mhash php function, I meant).
any other idea?

can’t you just install the mhash module from you distro?

You mean, from a rpm package or something like that?

yeah, i think it is better to have php maintained by the os – you’ll get security updates when neccesary and not when you remember to think about them

i don’t understand where is the documentation of the reflection class, particularely for the methods
any help please ?

I’ll try to find the centos package and try again the pear install. But it’s really strange, it never happened before this kind of troubles

is_null, http://us2.php.net/manual/en/language.oop5.reflection.php

have you compiled php on your own? there ought to be a php-mhash package

no, just from yum..
php-mhash
I’m gong to try a RHEL one

di you try mhash? or perhaps the mhash module comes with the php packes but is not enabled by default

yeah, I tried lot combinations

i’ve never used centos but mhash is included with fedora

try yum search mhash

yeah nothing found

I found php-mhash.i386 5.2.1-1.fc7 fedora
your on centos?

yes, centos 4
didn’t found it surfing the centos repository either

older one, did you try for a centos 5 rpm?

no, let me check
by the way, check this:

what is the proper syntax for a tags content to remain well formed, even if their is non XHTML content. Do I have to create a XSL, and if I do or dont, would simpleXML handle it…

http://www.bairestools.com/test.php This does work AND this works http://bairestools.dnsba.com/test.php

http://rpm.pbone.net/index.php3/stat/4/idpl/4463663/com/php-mhash-5.1.6-1.el4.centos.x86_64.rpm.html
might need yum install mhash mhash-devel first

I basically need messy etc… tags without closing tags in it..

thats a RPM not source rpm nevermind should be fine

trying to find dependencies..

hir

Tabletdtr/form?

duckhunt… are you the dog or the duck

?

Nintendo… DuckHunt

ya

with the Gun

ya

are you the dog, or the duck?

none
the shooter
Can any1 here help me with a portal?

bah… Id rather be the dog… he always smiles…

lol

I can help with portals

ya?

which one?

um any lol
i just want to make 1

i sitll have no idea what a portal is…

I programmed most of PostNuke

greenjelly vent?

nope

i have 1

note here

ok, installed Net_DNS from pear

hello

note here?

there is postnuke and Zoom.
or… wait

ok so is postnuke good?
all i want is that so when i post in the News part of my forums it gets transferred to my home page

if you dont know what a portal is, goto wiki and read about it

i know what a portal is

duckhunt post nuke has blocks and modules… (which is silly, I was bout to get ride of block/modules and make everything a block…)

im just asking what 1 u prefer

anyways, thats whats coming next for PostNuke…

shoudl I copy now all /usr/share/pear/Net/ some place?

alright
so if i get postnuke u can help me?

lots of people can help you
they got a great forum
look into pagesetter

k well the phpbb ppl werent very helpful
lol

its more complex but its amazingly powerfull

alright cool leme get it real quick k?
ill brb

pagesetter is a module for postnuke

a website with a login button XD

what version of postnuke should i get?

lets you create custom forms, that will force users to follow document standards

latest or stable?

stable

k
so 0.764?

none

?
u dont like postnuke?

it’s one big bug

hehe, duckhunt – cool nick

it works now!

people get confused with postnuke and phpnuke
they dont know the difference

what could be wrong with the other one?

other one?

what is the difference between the 2?

yeah, the other Net package I downloaded, and which works in the other server
I mean, if I download class files, and include them in the script, that’s enough for it to work right?

so if I have a php webhosting script that I’m trying to invoke from the command line…. and I end up getting random Segmentation Faults… what (if *anything*) can I do to troubleshoot that?

duckhunt phpNuke is the original portal… or one of them

guess it will require other pear stuff

oh alright cool
so can i add any template to this?

phpNuke was strictly controlled by one person… and his pride refused to let him take other peoples code
so the project was all of his code
people wanted to contribute so the project forked

ah

the largest of the forks was post NUke

ok i have another question

phpNuke then reversed his licensee of open source, and is charging people for it

thanks for the help

if i have a portal template but it doesnt come with a template for forums how would i do this?

which according to his original GNU license is illegal… but hey whos going to sue over such a crappy product

thank you too

duckhunt, the purpose of portals is to unify the look and feel of a website, to unify its search features, login features, etc…

ya

so your answer is in your question

well ok

if you wanted to build a site like IBM.com or Microsoft.com, you would have to write a portal type application

na i just want a simple site
that has news on the front page
and when ppl post in the news section of the forums it goes on the homepage
thats the main reason i want a portal

\there is just too much information on these large sites to do it without using static info..

glad if it works

duckhunt you might have a better chance with another application… a portal is like a shot gun… have you looked into a blog

b..bad.. crc… *curls up into a ball*

or slashcode (slashdot.net)

well i understand it im just not sure how it works

phpBB has a front page that allows you to add news to the front page
there is also something like doom9.org
www.doom9.org

do you mean something like this? http://eohax.us.to/
oh, ignore the swf =\

has
exactly like that
just where i can have links and then other people can post on homepage whenever
i could even care less if they all look alike
the home page and forums could look completely opposite i just want them to be linked togethor if that makes sense

it would be a 5 minute php script to link them together probably

ya exactly
lol

hiya… any admins around?
trying to figure out why bryanUC got banned… he’s trying to come here for help and gets a banned message

His username includes ‘root’, probably got caught by that catch-all.

ohhhhhh
yeah, rootkiller

i have an easy question

he’s uses that because he killed a box once as root
thanks

how would i array numbers 1-30

Hell, everybody’s done that.

list()

http://php.net/range

range
thats the bummer

thx

any1 know a good place to get portal templates?

function myfunction ($paramn1, $paramn2) {} the second paramn is optional. What i need do to the php understand that the second paramn is optional ?

function myfunction ($paramn1, $paramn2=null) {}
if param2 was left out it will be null

hum.. thanks

hi there, im using php client. how do i read characters from the keyboard?

god I hate writing user interfaces
absolutely hate it

fgets(STDIN); ?

wonderwal, php://input ?

hmmhesays, get something that writes the interface for you; then you will hate scaffolding and yaml/xml

grr, the file begins with over 1mb of nulls _

That’s a lot of nothing.

Does it usually take a long time to upload postnuke?

hiya… me again. bryanUC changed his username to bryanUC so he isn’t caught by having “root” in his username of “rootkiller”

maybe i can learn the avi format and hex my own header XD

he says he still can’t get into #php
do you have to unban him from the channel or something?

hes probably banned

How do I get the filename of the current webpage?

he is… someone suggested it was a generic catch because his username was “rootkiler”

to feed it into filemtime.

so I would like to see if you can unban him if he was indeed caught by some sort of generic autoban

Hmm. Yeah, his DSL block was banned yesterday.

__FILE__ would work for that

Which suggests it probably was him, but we’ll see how it goes.

nah… he’s an admin for the BOINC Riesel Sieve project
I wouldn’t think he would do anything to get banned here

hi there .. any sample to use some webservice? ..

bryanUC himself is a channel admin… I doubt he would do anything here to get banned… so think you could unban him please… he’s got some php issues with APC he’d like to discuss

thanks. But the date I get is wrong, it is today everywhere

oh.. I see… you did it.. thakns

is the timezone set?

thanks mattmcc

maybe no.
I’ll do that first

I apologize for whatever central ohio did

:-)

I’m having a problem with the apc.so extension – and only found 7 unhelpful google results – “Unable to load dynamic libary apc.so – undefined symbol: zend_block_interruptions”
only occurs in Apache, CLI loads it fine

same php version in cli and apache?

yes
looking at the info output, it references all the same config & extensions as well

same version also ?

yes
5.2.1
built 5/20/07 08:09:38

that sounds a bit odd
self compiled apc?

self compiled
pecl was complaining about autoconf not working
so I went the self-compile route

print_r(date_timezone_get(date_create())); gets me DateTimeZone Object (), so I assume it is set.

what is different about PHP being run in apache using suPHP from when it is run by the file’s owner on the command line?

but is it set to your timezone?

things seem to break in the former when they are fine in the latter

can you show me a link to your phpinfo() ?

sure, is PM ok? it’s a friend’s site

specifically, I want to know why “beagle-info –status” doesn’t work through exec() when run from apache

nlaracuente, is beagle-info in the enviroment?
environment*

sorry, how do I check that?

probably; “beagle-info” also runs, but “beagle-info –status” does not

echo date(“r”);

probably; “beagle-info” also runs, but “beagle-info –status” does not

nlaracuente, does –status require a specific user access privilege? what does the error say?

yes, the date is correct

then you screwed up somewhere else

nlaracuente, by not work, does it fail to make some write/read/execute or does it return a error, or?

nothing gets ouputted; sometimes the error code is 1, before I installed suphp it was 134

Ah! I call filemtime in an include.

nlaracuente, sounds like a user/owner problem, see what it’s doing

How do I get the name of the file that it was included froms
-s+?

I agree, but is there any way that I can get more info?

nlaracuente, i’m not sure what beagle-info is, so I would file it, if its not a binary, see what it’s trying to do

like get it to print sdterr or something?

nlaracuente, file `which beagle-info`; vi `which beagle-info` if it’s a asci or something
nlaracuente, if you have access, su to the user executing the php script, and try to run it then

/usr/bin/beagle-info: Bourne-Again shell script text executable

bash script

does it have #!/bin/bash on the first line?

yeah
the script works fine from command line

nlaracuente, from command line su’d as the user running php?

Can one get the name of the file that an include was included by at all, from inside the include?

nlaracuente, the user running php has a shell?

since I’m using suphp, I believe so

nlaracuente, are you a religious man?
(or woman)

the php file belongs to the same user that runs it from the command line

nlaracuente, does this user have a shell?

I’m not sure I understand
in what context must the user have a shell?
the user can log on normally, etc.
and will have a shell in that case

I really don’t want to have to add a line to all the files the site consists of…

do you mean does php create a shell for the user when running the script?
because in that case, I don’t know

nlaracuente, I think you should do a little more testing, like exec a whoami, to be sure who is running the script

whoami returns as expected
also, other commands work fine

okay; then view your env var_dump($_ENV);

and can see the root directory

anything odd?
and if after that, you still have problems, look into beagle-info to see what it is doing

hello

could I use PHP_SELF?

i’m running a script (found here http://pastebin.com/d5da21b51 )
array_multisort(): Argument #1 is expected to be an array or a sort flag in /home/content/m/a/t/mattal4/html/expl0de/includes/pseudo-cron.php on line 258

how would the syntax be?

yeah, apache seems to have messed with some of the variables a bit

could it be because i’m using php 4.3 and this script uses 5

I don’t know how I could make it not do this

you may need to run the script as a different user from within a different environment, once you know the expected environment

oh wow, ok, it completely rewrites env

yep, because it inherits the cgi environment stuff
and from the envi that the php webhosting parser is running in

ok
that makes sense
is there a way to get the CLI env in CGI?

why does filemtime($_SERVER['PHP_SELF']) fail with a stat failure?

or at least retrieve pieces of it

what pieces are of importance?

neo2dot0, i beleive stat()/filemtime() will require +x on those folder

anyone?

hm

I’m not quite sure yet, but I’m guessing that I’ll want my PATH and HOME to be set if I’m running a bash script

Cup, var_dump ($sortarray)

k 1 sec.

the parent folder is uga+x.

is some way by which it can run things in the CLI environment?

cup try putting $sortarray = Array(); before the foreach

php?
suexec

neo2dot0, do you realize what behind $_SERVER['PHP_SELF']; ?

suexec?

hey all, why isnt this working – http://pastebin.ca/652860

I looked that up a while ago
how do I actually run it in a PHP page?

function to check if there is a session started?

php has fastcgi/suexec shit
it’s a apache thing

i just now see that the path is wrong, it is the path the file has locally, on my sshfs mount.
that’s wrong of course.

yeah, I got that much

apache is responsible for setting up the environment

neo2dot0, i assume you already solve it
St3althy, what didnt works ? what error ?

256MB of RAM = no multitasking :9

mod_env might be something you would look into

anyone?

depending how many users use it and etc

isset($_SESSION) will be enough

let’s not be too quick, I was wrong. The path is okay

nlaracuente, if I remember right you can do like, SetEnv VAR value, in your configuration file

thanks

neo2dot0, do you realize difference between “/file.php” and “file.php” ?

yes, I do

yeah, I was hoping there would be a way to dynamically find out what the OS was providing, and load them in from there

neo2dot0, echo $_SERVER['PHP_SELF']; what you saw behind those var ?

var_dump output ’sarray(0) { }’

it doesnt spit it out into a CSV file. I want it to save everything in my db as a csv (columns and rows etc..)

somehow the paths are different. I have /~s307473/sophia/patzig.php, but /home/user3/s307473/public_html/sophia/patzig.php

thanks! I have no error anymore

stat tries on the first one

filemtime(__FILE__);

xmlreader ? (php.net/xmlreader)

that will give me the filemtime of the included footer, but I want the filemtime of the file that includes the footer.

thanks for the help, cstockton

hi there .. who can helpme pls … how to use a webservice …

nlaracuente, feel free if you run into more problems I can give a couple google cycles if needed

you aren’t :P thanks — (i cant /msg cuz i’m not registered )

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

neo2dot0, sounds like annoying… filemtime(basename($_SERVER['PHP_SELF']));

thk, is_null

let’s see, I try it

how can i say in php “if $var1 isset OR if var2 isset OR … then $varPresent=”true”" – there isn’t an “OR” operator for conditionals… where should I look?

if (isset($var1) OR isset($var2)) $varPresent = true;

why couldn’t i find OR in the function list on php.net?

bkeating, It’s not a function

bkeating, because its not “function”

http://fr3.php.net/manual/en/language.operators.comparison.php maybe this helps

I only get today’s date

anyone know how to export csv file from mysql using php

that will be filemtime of the include, I guess.

this one is taken, too

neo2dot0, you still have another option of file?mtime on php.net
err… file?time

well thanks

now i understand, thanks guys!

lol

yes, fileatime and filectime

hi

last access time and create time.

ive just installed WAMP and cant remember how to set up mysql pass etc… any can recommend an easy detailed page for this?

are you asking about this ? http://en.wikipedia.org/wiki/Comma-separated_values

But I need the last modification time.

St3althy, first of all… could you modify your Line:1 of pastebin became: php error_reporting(E_ALL);
St3althy, please repaste and re-run your code after that, also paste what output you saw

ever extended a binary-provided class ?

is_null, what do you think PDO is ?

i never used PDO, it’s a pecl lib isn’t it ?

well… you talking about binary-provided-class (class in binary/compiled form?)

yes, like PDO

Hi! How would I get the number of parameters a method would need ?

or… i failed to understand

Reflection wise.

nope, like you understood at first

with an OO interface

airox, get_func_arg ?

hmm my description is longer

func_get_arg you probably mean, but this is from inside a function
I have an object instance and want to check if the method has like 2 params or not.
Specified in the methods definition offcourse.

Ox41464b – nothing

interreting, in php programming, are they differrent from classes coded in php please ?

Or do I need the Reflection API ?

all i want is to export data into csv

St3althy, what nothing ?

if i do it from phpmyadmin it works well but i want it in my own php file

This isn’t exactly a PHP specific question, but.. Anyone ever seen a table which maps iso country codes to irs country codes? My Google-fu is failing me on finding such a thing, which I can’t believe hasn’t been created before.

i think it’s the simplest

is_null, you can extend them just like any other php written class.

Ok.

thanks cyth

which is why they rock so much

quick easy WAMP config setup + mysql password set….. anyone know one pls?

the way you call them is sexy though

http://todellisuus.net/~mikko/flower.php http://todellisuus.net/~mikko/flower.phps
that extends an internal php class

ok, internal classes have normal behavior, thanks for the tip and demo

airox, headache enough… no idea how to find how many argument that one function could receive

Ox41464b – it didnt work

St3althy, first of all… could you modify your Line:1 of pastebin became: php error_reporting(E_ALL);
St3althy, please repaste and re-run your code after that, also paste what output you saw
St3althy, which part didnt work?
your part ? o_O

anyone have trouble sending an email directly to hotmail’s inbox ?

what is wrong with echo(basename($PHP_SELF)); ?
output is null

$_SERVER['PHP_SELF']

$PHP_SELF is deprecated

neo2dot0, error_reporting(E_ALL); //you will see what error after that

why can’t hotmail be as spam free as gmail and at the same time make it receieve legitimate emails?
what kind of morons are developing in microsoft?

Hotmail relies more on machine learning whereas gmail relies more heavily on user feedback.

users = smater then machine ;p

i think gmail relies on both

….. for now

gmail have better algorithm
to sort out spam

I’m using, $query = mysqli_query, and im trying to find a way to add to $query by .= but then it says i cant add to it because mysqli_query cant be used as a string which i would use later on. Trying to get this to work for a search, any suggestions?

microsoft relies on hamsters

what is the best way to take user input from a form ? i have a volunteer signup form, i want to take the form info and send it to a specified email

hah, PHP_SELF undefined

Microsoft uses Microsoft code

$name = $_POST['name'];

$_SERVER['PHP_SELF']
use that

is this method secure from injection

ok

seriously microsoft is retarded

Hi, i have small arrays. $array1[0] = 23 , $array2[0] = 38, $array3[0] = 0; now, if i do $max = max($array1[0],array2[0],array3[0]); $max = 23; why?!

Bear10, don’t assign query to the return of mysqli_query, first build the string, then pass it to mysqli_query

what dont you understand
o oops

why isn’t max = 38 ?

nevermind

zfdaily, why dont you try to find out why your message treated as spam ?

are you sure all your values are integers?

well, if i echo them out they show as above

that wasn’t what i asked.
var_dump() them

if I do $obj = new Obj(); are there any magic methods that can be used to release recursive references within $obj so that it gets released by php’s garbage collector?

Thumann if your max is uing arrays you will get the highest array value in any of the arrays

gnat42, typically garbage collection won’t be something in a php developers head, are you running into memory leaks of some kind?

yup

gnat42, how so? php is very diligent at freeing unused resources

string(2) “23″ } }

filemtime(basename($_SERVER['PHP_SELF'])) still gets me today, though the filename I get by echo(basename($_SERVER['PHP_SELF'])); is 6th of august by ls -l

the object has recursive references to itself
to make a long story short

aha, so it’s a string value

I’ve created a function that releases those so that it doesn’t leak

what is the best way to take user input from a form ? i have a volunteer signup form, i want to take the form info and send it to a specified email

gnat42, garbage collection is a post runtime event, the zend api should free it

how?
will hotmail tell me their secrets?

$name = $_POST['name']; is this method secure from injection

gnat42, so your concern is rather run-time memory usage?

but I’m wondering if there is a method to get it called automagically
yup

to how they made their spam filter algorithm?

when running the batch, because of the references within the object I had to up my memory limit to 1.2GB to finish the batch

gnat42, unset the objects really

zfdaily, Your sender IP treated as Spam ? (this what im facing previously on Yahoo)

nah
some of my other mails go through fine
just some others

I found the issue, but calling unset on the object doesn’t call any special function

its too hard to find out

it just removes the reference to it in the scope you are currently in

if not impossible

and the object’s __destruct isn’t called because there are other references to the object within the object itself

echo 19 & $role;
echo $_SESSION['user']['userclass'] & 2;
echo $_SESSION['user']['userclass'] & $role;

gnat42, so you are instantiating objects, and then they are becoming to large?

can i convert the string to integer then?

first one is 2, second one also 2, third one is 0
why oh why?

zfdaily, http://whois.sc/your.ip.address and check BlackList Status

no not quite
I have a Record object and Record objects have a Table object within them, table objects hold references to record objects….

hey, the time outputted by ls -l is the same that filemtime gives me of a file?

so $obj = Record();

also, this behaviour differs between the two environments I’m working in

creates an object $obj that holds a reference to a corresponding Table object holding a reference to my original Record object
when I call unset($obj).

gnat42, have you heard of the object pool creational pattern?

the $obj variable is null

var_dump(stat( file ));

nope
where can I read up on that?

gnat42, well, im not sure about php implementation, but it’s a means of recycling your objects, perhaps instead of freeing them, you may pool and reuse
gnat42, Basically what im saying, is once your done with a object of a specific type you could return it to the pool to be reused, instead of working about freeing the resource

I’ll read up on that, but in the mean time there is no magic method that can be used to tell an object that it is requested to die?

destroying alll references will tell zend to destruct
in which case it will call __destruct before it dies
that is for additional clean up

why do you want to destroy the object?

right, but right now to destroy all references I have to call a special function on the object instructing it to clear out its references to itself

how can I get these timestamps in readable format?

that is a application specific task, no function exists

On some pages, the value is correct, on others not. I am puzzled.

neo2dot0, date()

otherwise when I re-assign it a new obj, the resourses it was using don’t get freed

i mean, inside the var_dump

on a webserver, no biggie the script dies eventually and they all go away

neo2dot0, cant… date’ em first

on my batch import script… I need 1GB to get what I need done

that has nothing to do with php really gnat, thats just your specific creational model your using

appears adding (int)($var1) & (int)($var2) soles my problem…

yeah, except I’m using an ORM, and its the ORM causing the issue
so I was hoping there was something

ah

some example code of your problem?

say im want a range of numbers to include the 0 for a 1 digit number

what resources?

how would i do that?

irc://irc.oftc.net:6667

which orm gnat?
inhouse?

$obj = new Object();… memory_get_usage(); $obj = new Object();… memory goes up
no, doctrine, www.phpdoctrine.net
its quite good, very alpha/beta

unset $obj really should do it

cstockton, will not release also

release, what though?

yeah, but unfortunately php doesn’t handle the sub references

that’s a different story

gnat42, i dont think its possible…

I think thats a implementation thing

is there a dev channel for php?

gnat42, those memory didnt being use, but still at usage()

#php-dev?

gnat42, you should unset those in your deconstructor

well I created a function to release the references
and then it worked
the destructor doesn’t get called!

gnat I’m fairly familiar with the php source and no built in function exists, but macros are called on object destruction that free memory
internally by zend though unfortunately
you kind of what some kind of DELETE_OUTSIDE_REFERENCES() type macro
lol

gnat42, there is easy way to test… class foo {__construct(); and __desctruct();}

how can i turn Aug into 8 ? and Dec into 12 ?

I have tested
I loop through and do $obj=new Client();

anyone?

Client has a __destruct function that echos when it is called
all 10 loops happen first

cmon its an easy question!

and memory usage goes up
and then the destructor is called

whats the problem with the memory going up?

what is a good open source project I can look at to model my php programming style after.

because this is in a batch situation and I have to allocate 1GB to the process!

do you have such a high-volume app, that it kills your server?

i’m focusing on a oop approach

why is that object gettiing so big? what do you *do*?

use an array
you don’t understand

snoop-, check out a mvc, singleton, and read php.net/oop5

ok thanks. i’ve read php.net/oop5 i think

phpbb uses over 170 queries in one page view, i think i better optimize it

snoop-, mvc is a good architectural design pattern, singleton is a good creational

the object has a reference to itself, thus when you unset($obj) it only removes your ability to see that object in your current scope
but not the sub references
and php’s garbage collector doesn’t release the actual object even though there is no way to retrieve it anymore
so mem goes up
every new object instance

ok, you create and destroy these objects in a loop?

yes

i never heard of that problem

Ladies and gentlemen
today is a great day
SCO has failed.

which os?

linux
oh?

if (isset($dl_transcript) OR isset($dl_ipodvideo) OR isset($dl_pspvideo) OR isset($dl_mp3) OR isset($dl_vorbis)) { $downloadable = true; }

http://www.groklaw.net/article.php?story=20070810165237718

cool
bout time

damn right

yea it is

formatting via strftime somehow changed the date. A naked echo works fine.
Phew…
I will rather refrain from adapting the date format to german.

How could I work around this problem? http://pastebin.com/m1b76dfc4 I need it to search for all those fields but the only problem is, sometimes certain things arent searched which then cause this to list every entry because it falls under the
search.

Bear10, ill update that bin

i tried it

thanks

memory stays the same

you aren’t using the ORM I’m using

how does the object reference itself?
whats orm?

www.phpdoctrine.net
orm is object relation mapping

did they fix their documentation yet?

i dont want to read into a project or something

makes db abstraction nice and easy

if you have a specific problem with php i will help you

Bear10, http://pastebin.com/mfd5cb55 that is the concept

doctrine? improved a bit yeah, new docs, still not perfect though

make a minimal demo of your problem. tht will help.

Bear10, you will need to make it more logical, like add the or’s, if a where was made yet

I appreciate it, but unfortunately you can’t reproduce it without using this ORM

its an awesome project, but messy and underdocumented

its because of the orm
yeah, single main dev
I have commit access
and help when I can but I’m busy as can be

whoah thats a f*****g crazy loc count for one guy

ah thats what i was trying to do earlier but then encountered a problem but i see what it was now

I think I have my answer on the fact that php doesn’t offer what I need to fix it
yeah he got a SoC project for it this summer
so it jumped forward
it still has issues in my opinion
but it is getting more and more popular

i tried using it, but I needed an ORM for a production project, and it didnt feel right
too fresh

Bear10, cool bear hope you get it working

thus more used and thus somewhat better

you said deleting an object that has a reference to itself causes an error.

not an error

memory leak

it just doesn’t release the memory

prove it

one sec and I’ll paste the code and output

isolation ftw

http://www.hashbin.com/732f.html CODE
http://www.hashbin.com/7335.html output
you can see it goes up each iteration
and _destruct does NOT get called until the end of the script

i doubt that is a minimal example of your topic

if i range(1,31); \
how can i make it not start with 0?

ok, let me do the work for you…

start with 2?

2, 21

gotcah
thanks

lol – unfortunately you don’t have a clue what you are talking about in this instance

range(2, 31)

and I’m not asking for you to do the work

gnat42:
class c { var $bla; function f(&$ff) { $this-bla=$ff; } }
for ($i=0;$i1000;$i++) { $o=new c(); $o-f($c); echo memory_get_usage().”\n”; }

I’ve researched this – AND solved it today

thats what i understand when you say “object that references itself wont release mem”

but only by manually telling the object to release the recursive references

but mem is not going up

range() is always going to start with key 0. numeric arrays always start at 0 unless you implicitly assign values.

let me re-phase that, object which has many sub objects, some of which reference the first object
won’t release memory when ‘deleted’

well.. my way would be to make an exact example. “many sub objects”. how many? 1? 2? 3?
find out what *exactly* the problem is.

I *know* the problem
you don’t get it

whatever

I know where the problem is in the ORM I’m using

what is an “ORM” ?

I’ve even solved it by having it release what it needs to before destruction

old rusty memory?

the *problem* is that I want an automatic way to tell the object to call that function

have one problem where do i stick the or’s?

scroll up, I’ve already explained it
thanks for trying though

how do you search in irssi?

If you need the array keys to start with a certain key use array_combine to join it with another range() of the same length

Bear10, append to every query IF and ONLY IF you already did a query =p
Bear10, did a LIKE rather

not sure i follow :| sorry

Bear10, maybe after $query , set $found = false;
Bear10, ill re edit it

well thing is, that sometimes more then 1 thing is searched so i need the OR not sure if you understand me lol i suck at explaining :

Bear10, ya, 1 sec
Bear10, http://pastebin.com/m10d9c58e

but the second it hits true, it doesnt search the next one does it?

so
how bout them phillies

Bear10, Yes it does
Bear10, You understand what the $_POST['searching_this'] represents right, those are the conditions to be might to search for a specific column within the db

If I have a abstract class with methods defined that aren’t abstract that where fully working. Rather than redefining them is there an official way of removing them for subclasses? Instead of redefining them to make a php error.
or a better way of doing it

JonathanJooped, not sure I understand the question
JonathanJooped, All abstract methods must be defined in sub class

eww, still not working right does a real weird thing

okay well im stuck here trying to figure how to not count the zero in a range90 function

I guess it makes no difference if its abstract or not…. the methods I need to remove arn’t.

i have the if for country before province, and when i search for a province it does the query of country

Bear10, do you understand the structure? print $query at the end to see

yeah, im trying to explain the problem might have to paste sec

JonathanJooped, The very nature of sub classing is inheritance, so if you don’t want to inherit those extra methods perhaps you are using a model that does not work for your specific needs or preference

http://pastebin.com/m664bc966

weeeeeeeeeeeeeeeeeeeeeeeeeeeeee

i replied to your PM

Bear10, each $query you pasted, is using Country LIKE, instead of the relevant column

omg…

So what I was talking about is if there was a way to drop inheritance of a method for a subclass?

lmao, so sorry
cstockton, thanks for all the ehlp

Bear10, No problem

i upload pictures in ‘upload’ folder. how can i forbid direct access to pictures in that folder?

JonathanJooped, so you don’t want them accessible, or don’t want them to exist?

i mean if someone type http://site.com/upload/pic4.jpg he can see it. i’d like to make it impossible.

move the upload directory outside of your public directory

but a php script must have the access to load the pic on the page.

why is php ignoring the php.ini file in the root of my site? I copied the apache php.ini file there, and changed the upload_tmp_dir, but it keeps trying to use the dir in the original php.ini file

jon i answered in pm

iflyhigh, ya could be a solutionx. th
thx

JonathanJooped, to answer your question no, you cannot pick and choose what to inherit and what not too, might want to re-factor, or think about interfaces or something

what if i used something like

$valuey +1)

ok, I’ll ask a different way… is my php.ini file ok being in the same directory as the .php file that does the uploading, or does it need to be somewhere else?

to avoid the id of 1 returning 0
can i do that?

so your not fussed about keys?

nickelnick, cannot assign in that context

use range(1, 32) or range(2, 32) ect

when including a file, does php optimize so that it doesn’t encode functions that don’t get used?

majikman, no, it has to parse it

yea but if i use that range, 2-32 will be the dates showing instead of 1-31
if i used 1, 32 it would list 1-32
but the values would list as 0-31
etc

nickelnick, what is your problem?
nickelnick, if you just need to loop through a count of 1-32, use a for loop

if you need an array starting with 1 going to 32 for both keys and values use array_combine
But I think that’s not the problem… its the logic your using
like cstockton said

if it HAS to be a array, their is range(1, 32), its indexes will be -1, but does it really matter ;p

YEA PROBABLY
it doesnt hav eto be an araray
im just trying to fill the month day and year on a form so i dont have to type each

for($i = 1; $i 33; $i++)

well use a for loop

ok
wow that looks complicated
lol

Is there a way to get the terminal size from php? Such as accessing TIOCGWINSZ

nickelnick, it’s a powerful control structure

i see

can do much more then iterate through numbers

so i is equal to 1, and less than 33;
but add 1
?

Is there a repo with php 5.2.3 for ubuntu?

each time it loops through it adds one by using $i++

http://us.php.net/manual/en/control-structures.for.php

I’m messing with try/throw/catch
and I want to know if I’m using it right
I have a block of code that may return an exception
here’s the code I have…
http://pastebin.sekati.com/?id=TryThrowCatch@87480-3719cb28-t
will this ensure that any error caused by the code will not crash the PHP page?

hey guys, just need a little opinion from you guys, which site do you guys think its better, www.cost.com or www.deals.com or www.specialoffers.com ?

deals.com

action1, no, it will ensure that any error thrown of type Exception will not crash the page

looks ok

action1, if by crash, you mean error out

Yeah, error out
and not complete the rest of the PHP on the page

action1, if you throw new CustomException, it won’t be caught cause it is not of the correct type

well yeah other errors may stop it… but you have caught all exceptions

ok, then out of cost.com and specialoffers.com which do you like better?

JonathanJooped, not all exceptions, just exceptions of type Exception (base php exception class)

cool

no one habla php.ini?

is there a response.buffer=false equivalent for php?

But most exceptions are of that class

or extend it to my knowledge… so are caught

a question regarding database connections. is it advised/possible to maintain your connection variable (returned from say pg_connect) between page requests (like in a session variable) or is it better to just call pg_connect for each page?

thx for the great help

bazz, checkout mysql’s got pconnect

that will chew up the connections… there is a limit on connections and they soon run out. Keeping them connected would really suffer from a doss attack.

action1, ALL exceptions derive from Exception ya

was I right cstockton?

action1, when type comparing for objects base classes are part of the type compared
oops that was to jonathon
ya jonathon

thanks

i’ll just sit and bang my head against the desk while i wait

which will chew up connections? using pconnect, or not using pconnect?

Cool… I had just read the exceptions chapter of a php book haha

JonathanJooped, haha, nice

Correct pconnect can chew up connections, the other side of that story is that most databases have a sleeping connection timeout value, for MySQL the default is 28800 (or something) seconds (8 hours)

JonathanJooped, fundamentally most languages provide a way to catch Exception of type *
JonathanJooped, because of php’s implementation of exceptions the * is type of Exception
python does it’s exception handling a little sexier imo but thats okay I still like php

how can exceptions be sexy

haha

cstockton, I like the way C handles exceptions :-)

in more object orientated languages they are a much more intertwined into the language, and used more commonly

hello, I use the mail() function to send mail, I need the message to be right-to-left instead of ltr, even though it’s plain text (not html) any ideas how to do that?

nod nod, makes sense

can someone help me? i used Notepad++ to write a Hello, World! command, but when i opened it in IE, it didn’t work

maw_, you mean c++?

cstockton, no, I mean C

maw_, exceptions in c would more so be a hack, like macro’d lol

hehe, longjump 3

maw_, 3 setjmp
maw_, I wander if calling c exceptions more elegant then php’s would be a low blow

hehe, it sets my standard

meh

hey guys, so I have a date in the format YYYY-MM-DD, how do I convert it to its timestamp? strtotime seems to think it’s YYYY-DD-MM

Sake, explode it and fix it for strtotime

Sake, as I know it should parse as YYYY-MM-DD. I was using this format and it was working fine

Sake, or explode and mktime

Sake, problem comes in 2007-12-10
how can you determine what it is, you have to assume its a the more standardized counterpart

yea, I just exploded it and it seems to not fix my problem…
oh wait, I’m a dumbass…. nevermind

Sake, explode, and rearrange.. lol

haha, thanks for the heads up

Sake, :P

no, I was doing if( strtotime($d) $now ) print “past”; and then testing with various dates and it was always giving me “FUTURE” instead of “PAST”, but then I realized my year was 2009 instead of 2007.
too much time in front of the PC… that’s for sure

i hear you, im off in 40 minutes can’t wait
not that I don’t enjoy preying on questions like a mad man to keep my sanity…

true that
DOUBLE TRUE!!
I haven’t seen that in a long time. I don’t htink now’s the time though…

hehe
it’s kinda cool some people have very interesting problems

any problems associated with calling an array var ‘title’?

Saberu, no

isn’t it faster to use substr than explode?

Saberu, built in reserved stuff, no

hey im trying to write an account management script for my apache
i’ve established that my etc/passwd file contains usernames etc. but the passwords are represented by x which i’ve been told means they’re located in shadow?

$title = Array();
like that
it doesn’t seem to like it..

what?

JonathanJooped, substring is faster because internally it doesn’t have to create a array to return, but it’s not a feasible solution if you get a date like 10-9-12, then a date of 10-12-12 the extra logic involved to predict it isn’t worth it
Saberu, what do you mean by not like? should be no problem

Well
i just changed the name from $title to $title1
and guess what, it worked!

Samsonn, the passwords are stored in the master password file

cstockton, my problem with PHP is that I’m nothing without pointer algorithms :/

oh right
where do i locate that stockton?
is it in ETC?

Samsonn, well some distros might be elsewhere

well i can pastebin the dir of my ETC folder

Samsonn, don’t do that

how come

Samsonn, on linux /etc/shadow will have the password after username:

yeah i can’t access shadow it seems

Samsonn, on bsd, master.passwd

but i know shadow is existant
http://rafb.net/p/vpTT7s83.html
theres no sensitive data its just a dir of etc

Samsonn, Because php runs as a less privileged user, you need to use sudo or something

sudo?

maw_, I hear you their, but pointers can make your head hurt too

ahh turns out
i was overwriting the title var with a string var

Samsonn, super user do, add apache to a NOPASS sudo exec’r and make sure your apps secure

hmm
dunno if my host will allow me to do that

Samsonn, but typically you should keep the system level and the application level at different layers
Samsonn, If your binding your account management to the system and you don’t have f ull access to it you may want to refactor

i see

Samsonn, Perhaps authenticate against ldap or a database server

limited options then is it

name / passs … that easy

hm
dont think they load the data in a database i can access though
i can only access db’s connected to my data thats it
out of luck?

Samsonn, Never

:o

Samsonn, just better understand your problem domain, and feasible solutions

so far it seems as though there are no feasibles in this case lol

Samsonn, sounds like your environment binds you to something not possible lol, but if you had full access to the server then perhaps it would work

yeah
sucks cause i can read the account details just not the password and i guess not even modify the password later
is there any other files in the DIR listing that could be of use?

Samsonn, I’m not sure what your trying to achieve honestly

Samsonn, what are you trying to do?

make a simple account management script

Samsonn, define account
Samsonn, User account, bank account?

user

Samsonn, Define user

for http

Samsonn, http is a protocol, how is user related

hm guess i got my names mixedup

Samsonn, no, im not being a dick just asking for details ;p

lol yeah
login manager

Samsonn, Okay, so, you want to “Create” the users?

Samsonn, do you mean http authentication?

when i have some sort of server class that is used to produce the html, can i make the hole class static in php5 so there is only one instanz on the server for each user ??

yeah but primarily just edit existing ones

WWW-Authenticate

rocketmagnet, If you mean have a singleton pooled within the apache process no
rocketmagnet, Static classes are just classes that don’t need to be instantiated to have their properties or methods accessed or modified

so i guess theres no way to make shadow read/editable?

k
ty

Samsonn, A account manager, to manage the accounts which exists on the machine itself?

so i must also check when i read the config if the file is_readable because no other process is using it ??

yeah
thats the one

so must loop until it is_readable ????

rocketmagnet, no, everything in php is very stateless, and independent

uff

ah crap it’s one way encrypted

rocketmagnet, the system itself will manage the disk io, it will read it when the disk is ready to serve it

so it’d only be possible to do comparisons

Samsonn, so, you could still UPDATE the pass, and validate it
Samsonn, your approach you may want to take is creating wrappers for passwd and adduser (commands vary across s ystem)

hm

Samsonn, not modifying the files themselves, let the system work the details out

yeah
but no shadow access still. im just reading up on any altneratives

Samsonn, you just need the privileges to run those commands, sudo will help you

sudo

Samsonn, comes default on alot of distros

i doubt i could hook sudo into my host though

Samsonn, is it a shared host?

yeah
shared hosting

Samsonn, How can you have system accounts, and add them etc, without root access? : )

is my syntax for my “isset OR” statements at the top of this script correct? it’s not erroring, but it’s not doing anything either: http://bpk.deepdream.org/downloadable.phps

i dunno

Samsonn, can’t adduser if you don’t have root
Samsonn, lol samsonn, thats funny =p

what about edit user
cause thing is from my hosting i want to offer other people hosting. it is permissable by my host but they dont provide root :/

Samsonn, I see…
Samsonn, thats a big ball game, for a shared host

i’m trying to write a page that contains some javascript and a exec() as the last line. Is there a way to make it show the javascript before running the exec()

yeah

Samsonn, might have to manually add them through the control panel or whatever ur host offers

dont think they offer that feature yet. their control panels pretty underdeveloped

Samsonn, Running a hosting company off 10 dollars is economical but not entirely easy ;p

yeah LOL
you said it

Samsonn, This is a problem you need to work out with yourself :P

lol god
:[

Samsonn, Go buy a VPS, that has plesk

0 as
0 to stop the

lol

0 get

hi

hello

im having a little trouble with destroying my session

0? or
asdf3, whats the problem?

0 which balls it all

asdf3, $_SESSION = Array();

0 post data as

danny, I would fix it at the source, not a hack at a lower level

im using php and mysql, i need to know the id of the last inserted row, thers a function called mysql_ insert_ id but thers no way to make it thread safe right?

danny, fix it on the process page, throw a error, on top of that javascript if it goes with the flow

i have session_destroy(); but for some reason if (!$_SESSION['user'] OR $_SESSION['pass']) is not working, when i destroy, it still seems to be able to make the else true

thats why

0 in the post data though? As there are so many inputs, I don’t really want to add a validation of every input to check for

asdf3, !$_SESSION['user'] if not session[user] (doesnt exists after destroyed)

if it helps, I could post up the processing code

asdf3, That is always true

Hello

if you destroy the variables are still there during the pageload

no the problem is after destroying it still reading as if it does

do this $_SESSION = array(); session_destroy();

cause i check if they dont exist and display login form

if (!$_SESSION['user'] OR $_SESSION['pass']) and this is a bad check
use if ( isset(

Is there a way to remove php from a template file, rename the extension to .html, and the file work correctly?

ill try it

also, is there a easy way to remove php from a file without going island by island

danny, might have to work out the best method for you to check, but I would do it BEFORE the data is inserted, maybe a database trigger if it supports them
soskel, preg_replace

What?
What does that mean
what do I type it into

isset says $var = “”; is set… i want it to be false, how can i do that? or do i need to invert my logic and use empty()?

soskel, $stripped = preg_replace(‘/\?php.*?\?/msi’, file_get_contents(“php file”), ”);

isset with empty string will return true

soskel, something of the sort

what does that do?
and were do I put that?

k. then i should use empty(). thanks

ah, yes you should use empty

soskel, $stripped = preg_replace(‘/\?php.*?\?/msi’, ”, file_get_contents(“php file”));

what is this?

tags with empty string

Were do I put it and what does it do?

soskel, it’s just to help you conceptualize how to solve your problem

wait

moep

is there a way, in notepad++ to strip php ?

sure use a regex
I just gave you a simple one in pcre
Everyone have a good weekend, try not to code to much, code = for bills, life = for fun = )

this is so weird
session_destroy is not working

you have a logic error propably

my log oout page has only this in it PHP session_destroy();
?

php.net/session_destroy
see the example
you propably need

ok my scenario is that I am trying this all on my localhost, is thre something i need to enable?

can i say !empty?

session_start(); session_destroy();
yes you can

sweet!3 php

is it possible to fake $_SERVER['REQUEST_METHOD'] ?
or to give it other values then POST&GET ?

REQUEST?

there might be other values yes

im gonna scrap it and start over
usering the examples

so to be secure i must check all $_SERVER $_COOKIE $_GET and $_POST stuff
?

you need to start session before you can destroy it
logout.php: php session_start(); session_destroy(); $_SESSION = array(); ?
well some of the $_SERVER values come from the server itself
but its not a bad habit to check all external data

i was not corret before: other values than POST|GET|HEAD|PUT ?

i would assume your webserver should barf if its something else

i just wanted to know if it is possible with telnet or other tools to fake some of the $_SERVER values

“unsupported request method”

rm, which value ?

like PHP_SELF
or DOCUMENT_ROOT

i dont think its possible… from outside

DOCUMENT_ROOT comes from the server

Is there something in PHP that’ll parse ctags output?

so i just need to check the header values not set by the server ?
and remove_addr and stuff that is set by the request headers

hey guys
my friend was browsing around facebook and .. it just spit this http://rafb.net/p/3a7T8t28.html

What are you trying to accomplish?

why would it do that?

rm, phpinfo(); thre is Information about this

its just the plain php?
i didnt know php did that at random times

Apache Environment and HTTP Headers Information sections

i look at it from http://at2.php.net/manual/de/reserved.variables.php#reserved.variables.server
ups
sry
there is detailed information on each of the entries

rm, and phpinfo() already seperate those infomation based on which “Client” can fake and which one come from serverSetting

ah ok
so i’ll consult that one

how do you display the contents of an array?
or hash…

var_dump($array);

i tend to prefer print_r() tho

*shrug* To each their own.

the things under “PHP Variables” are set by PHP and “Environment” is set by the server or the request headers
ty for this
hmm… most of the variables from environment are listed under PHP…
so this list is not what i need

Have you mentioned yet what you need?

how do i state a single character in php as opposed to a string?

NoorulIslaam, convert to integer ?

?

are you looking for a typed langauge here?

$a = ‘z’ ?

haha f00li5h :P

a character is just a short string

33

mattmcc so if i do $some_string[$some_index]==’z’ that will work?

Yes.

ok thx

i was searching for a list of $_SERVER fields i can use without any test (set by php not client or header)

array_keys($_SERVER)?

Hi how do i get magicwand support on a debian etch with php5? I installed imagemagick but this did not work. Any tips?

BudgetDedicated, #debian

wow theres people more noob than me here, hehe

Saberu, there always will be

always people above and always people below, thats IT!

1==1

Anyone know of anything in php that’ll parse ctags output?

noone is above or below tho

“1″==1 also

“worth” is just subjective
f00li5h, in php it is

== is the kinda-equals operator, “1″ !== 1 though

but try ‘1′==1 in C :X

you can treat chars as ints in C, if I recall

umm
you can treat them as whatever you want

f00li5h, yes, but ‘1′ != 1 in C

but ‘1′ is not 1 as an int in C
as a pointer even!
hrm

doesn’t guarantee expected behaviour tho

‘1′ gives you the ASCII value for 1

“1″ would be the pointer in C

f00li5h, if you do ‘1′==1 in C, the compiler will translate it into 49==1

Comments off

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »