Archive for Uncategorized

oh did I mention the build environment is in Sri Lanka and the build doesnt run after 6pm local time because the

How can I print out all the elements and attributes associated with a org.w3c.dom.Document?

If I have an external library in this case Jakarta Commons HttpClient, which I want in the classpath so my app can run, htf do I do this?
Is it even possible? Afai can see it isn't

JVM option -Dclasspath=path-to-jar
I believe

This compilation process used to work, I have to reinstall all my server because of a HD phisical problem and then now I am getting these 3 errors in output. http://pastebin.com/m6811e271 Any idea, please

Nope
How do proper apps do it?
I can't believe it's this difficult just to find a class
jars are pathetic then
What is the point of the jar if it has to stand alone


that last point is terrible. but anyway, maybe this will help: http://forum.java.sun.com/thread.jspa?threadID=583158&tstart=90

g[r]eek, HAHA. I am reading that exact thread now

hi

any help, please

yeah, import Itau.Itaucripto; is borked
~tell azuos10 about classpath

azuos10, The class path tells Java or the compiler in which jar files and folders to look for classes. Use the -cp/-classpath run-time options to specify the class path. Also see http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html and http://mindprod.com/jgloss/classpath.html#ANACHRONISM

I tried this and still getting the same 3 errors: /usr/lib/j2sdk1.4.2_04/bin/javac Consulta.java -classpath /home/aaa/itau_shopline/Itau -sourcepath /home/aaa/itau_shopline/ -d /home/aaa/itau_shopline/

I guess the factoid 'getting started' might be appropriate:
azuos10, getting started is seegetstarted

where?

I guess the factoid 'where are you' might be appropriate:
Here

What is factoid?

I already have a factoid with that name, azuos10

~factoid

DRMacIver, factoid is a small snippet of information like this one.

Why "where am I" would be appropriated?

I guess the factoid 'why not mozilla' might be appropriate:
https://bugzilla.mozilla.org/show_bug.cgi?id=84128

hehehe

Are you talking about my IRC client?

I guess the factoid 'the truth about garbage collection' might be appropriate:
azuos10, the truth about garbage collection is http://java.sun.com/docs/books/performance/1st_edition/html/JPAppGC.fm.html

you know that you are talking to a piece of software, right?
or do you meet that less people that finding this out is impossible

Anyone ever setup jetty + jndi with properties?

In JNI two different 'jobject' references can point to the same object. Is there a way to get a unique value for an object (like a ptr) to store in a hashmap?

sometimes you learn a lot about the bot looking at newbies talking at it
hey dharrigan

andresgr, !

I can not see how GC could help me there?

I guess the factoid 'cannot resolve symbol' might be appropriate:
azuos10, cannot resolve symbol is http://c2.com/cgi/wiki?CannotResolveSymbol

you still didn't get it?
you could also go into the kitchen and talk to your microwave

I saw it before when you said the first time. I put it into the compilation command and still there with the problem

I guess the factoid 'fallacies of distributed computing' might be appropriate:
azuos10, fallacies of distributed computing is Please check out http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing for more information.

sigh

how do I use FilenameFilter? is the String equal to REGEX ".*name.*"?

wow

I'd like to list all files in a directory [using file.list()], only if the name starts with "metadata_"
not list, I want an array that contains the file names

you will probably need to build it yourself

yea, just implement the interface

hi

oh (oO)

I'm looking for the easiest and simpliest way to implement a RESTapplication server in JAVA

OK, next question :P how do I implement an interface :P

is there any framework that you would suggest to me ? I've googled a bit, but I don't know which one to take ?

~interface

Aradorn, interface is http://java.sun.com/docs/books/tutorial/java/concepts/interface.html

thanks

~rest

http://en.wikipedia.org/wiki/Representational_State_Transfer

OK, let's see if I got it, I'll "implement" it for my class and in my class I write a method called "accept" [that's the method for the FilenameFilter]?

yes

nice
I love this Java thingie :P I keep learning something new every day

heh

and thanks to you, Aradorn and Duesentrieb

hello .. i want to get involved with an open source java project, where i will be able to learn how to use and apply java web host in real life ..
any suggestions for me ?

rohan, http://greenteapress.com/thinkapjava/
very good start
if you want to learn java

thanks, daredemo , but i already know java ..

ah
sorry :/ sourceforge?

i'm looking there too .. but since i have no prior experience, i have very few options

This compilation process used to work, I have to reinstall all my server because of a HD phisical problem and then now I am getting these 3 errors in output. http://pastebin.com/m6811e271 Any idea, please

rohan, I'd suggest helping for example, Ayam, or sunflow :P
or any other 3D related Java project
rohan, or you can team up with me :P

did you now realize what javabot is or do you still ignore me?

rohan, but I know very little Java

lovely .. but do you already have a project ?

Could you help me with my problem?

rohan, yes, but I'm not sure if they are open source

or, yor are a microwave as well

looks like your classpath is wrong

rohan, I'm writing a English-Japanese dictionary interface for edit

Even when I set the classpath it takes the same error

~tell azuos10 about classpath

azuos10, The class path tells Java or the compiler in which jar files and folders to look for classes. Use the -cp/-classpath run-time options to specify the class path. Also see http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html and http://mindprod.com/jgloss/classpath.html#ANACHRONISM

and now read tht
that

rohan, and I'm writing one stockmarket tool [for local market]

setting it doesn't make it correct

It is finding the Itau package, but not recognizing Itau.Itaucripto

Is it possible to do an HTTP connection to a server host by IP, and specify the virtual host to retrieve?

This package is a blackbox for me. it was provide to me and I have already checked the md5 and it is ok

provided as a jar?

provided as itaucripto.class
I create a subdir called Itau and then I copied the itaucripto.class file into it

so the classfile is /home/aaa/itau_shopline/ltau/ltaucripto.class ?

yes
that is why my program is doing import Itau.Itaucripto;

you could put it everywhere, you'd just have to set the classpath

I am not a java developer, but I think it is rigth, because it was working before my server crash

in which directory are you?
set the classpath to /home/aaa/itau_shopline

i'm sorry, i was disconnected
what are you using, for the stock market tool ?

I thought my projects were too boring :P

I did it and still the same error

rohan, what do you mean "what are you using"?
by+

i mean, GUI ? if yes, what GUI ?

it will have swing GUI with Graphic2D and/or jogl interface

cd to that directory and try again

I am inside the directory
as root

rohan, at the moment I've got data retrieval working, I'm currently starting to work on the actual data drawing

ok .. let me see if i can find a worthy project on sf.net otherwise i'll tell you ..

/usr/lib/j2sdk1.4.2_04/bin/javac Consulta.java -classpath /home/aaa/itau_shopline/ -sourcepath /home/aaa/itau_shopline/ -d /home/aaa/itau_shopline/
It is correct, isn'it? Still the same

is there some nice function in java string to "asciify" a string? chaninng all "foreign" chars to their ascii variants, ie ü to u.. á to a..

download daily summary data if the file is not downloaded yet (works), draw candlestick (and optionally other) charts (work in progress)

wow, and you say you don't know java !

rohan, I have a wild imagination :P

anyone who's doing so much has to know loads of java

rohan, if you can't find a project, tell me, and I'll start one on google or something
rohan, nah, I only know REGEX :P

haha .. sure thing, but doing what ?

rohan, anything

then i have no idea, sure you used the same case, not itao, but Itao etc. ?

rohan, I'm into 3D

ok, start one on google .. let's see how wild your imagination is, daredemo :P

rohan, so, mobile games would be one option
but I doubt I'd like to make them opensource, as I'd like to get paid for it

and who would pay you atm ?

rohan, I have some pre-agreements for some educational 3D stuff

what kind of pre-agreements ?

rohan, money :P if I get something useful done

great, daredemo ..

rohan, what I plan to do is slightly questionable :P
rohan, I'm a Member of Board of one foundation that funds educational IT projects

yes, I did, just to have an idea when I type -classpath /home/aaa/itau_shopline/Itau instead of -classpath /home/aaa/itau_shopline, it says the Itau package does not exist. So I do not think it is a classpath problem

rohan, and I want to set my own company that tries to get money from them/us

wow .. which foundation is it ?

but in both case I still got the same 3 errors

well, of course I'll abstain from voting if they discuss my projects

no idea then

thank you dangertools

rohan, a small governmental foundation of one small country
rohan, our budget is about 1 million euros per year
but most of it goes to training related projects

which country ?

/whois daredemo

ee stands for ?

http://www.google.com/search?client=safari&rls=en&q=domain%20.ee&ie=UTF-8&oe=UTF-8

estonia, no?

cheeser, should be

This compilation process used to work, I have to reinstall all my server because of a HD phisical problem and then now I am getting these 3 errors in output. http://pastebin.com/m6811e271 Any help, please

again. fix you classpath.

as discussed with dangertools. The problem does not seem to be with the classpath

there seems to be no other explanation

rohan, would you be interested in some educational soft development?
rohan, the edu soft HAS TO be opensource

yes, very

rohan, OK, let's exchange contacts or something

if the VM says it can't find a class, there are very few alternatives.

It is not saying that

sure, it says that it cannot find the class

"cannot resolve symbol"

with the wrong path it says Consulta.java:1: package Itau does not exist
with the correct one it does not say it

then make sure that class exists in the Itau directory

sorry man, but I am not stupid, I know I might looks like, but I am not

no one has said you are.

it clearly says symbol not found which means class not found, don't ignore that

in the pastebin I printed the ls -l too

in your javac commandline, where's your -classpath entry? http://pastebin.com/m6811e271

tthe file is there

Anyone know how you get those breakdowns on google, like, google for "outsurance". the first result has 4 sub links. how do you get them?

for all i know you're a rank newbie so i'm starting at the beginning.

rank newbie ?
~rank

Roooooony, I have no idea what rank is.

also are you sure that Itaucripto is in the itaucripto.class file (the case doesn't match)

in the pastebin, the classpath host is not there, I just did it here and the same thing

Hi, I'm trying to get the Postgres JDBC working with my fedora 6 box. I have the drivers installed apparently but a call to Calls.ForName("org.postgresql.Driver") raises an exeption

before my system crashed it was working fine. Unfortunately it is a blackbox and I cannot see inside it

add the pgsql jar java hosting to your classpath

it is the same phisical file

try renaming it to match the class case

if you copied both, java source and ls -l output you ignored my "is the case right question" right away

lol

ah, where would i find the pgsql jar file? i'm really new to java

you said you had the drivers installed. what drivers are you talking about?

ln -s /dev/null pgsql.jar

I did not ignore you. the case is right

the jdbc postgresql driver

not if you use Itaucripto and itaucripto.class

itaucripto and Itaucripto are seriously not the same case

I understand I should add the jar file but I don't know where it would normally sit on my Fed box.

~tell BrokenNoze about classpath

BrokenNoze, The class path tells Java or the compiler in which jar files and folders to look for classes. Use the -cp/-classpath run-time options to specify the class path. Also see http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html and http://mindprod.com/jgloss/classpath.html#ANACHRONISM

it can sit anywhere you want. you just need to add it to your classpath

most of the installs include the JDBC jar in their directories somewhere … try in your /usr/lib/postgres … or whatever

ok. thanks people

thanks for your help. I can not understand how my file code has changed, because it were a backup but it is working now. thanks a lot

Hm. Any good tools for searching for classes in the classpath?

javap
8^)=

hello anyone knows why i have to use "http://java.sun.com/jstl/core_rt" instead of core

~jogl

daredemo, jogl is a JNI binding of the OpenGL 3d Graphics library. Great for 3d games in Java. https://jogl.dev.java.net/

i am using jakarta-taglibs-standard-1.1.2
with tomcat 5.5

anyone know of an IRC channel for Ant? I've just tried to subscribe to ant-users but the signup process is borked

Hm.
Looks like I might need to use the release candidate of Idea 7.
(Or possibly downgrade to the last version. Hard to tell which. I'm hoping it's the upgrade, as this is 'cutting edge' stuff )

i'm using eap 7111

What's the verdict?

it's good.
i miss one part of the dep mgmt, but it's stable.
and the new features are pretty nice

That's good.
I've had bad experiences with release candidates of IDEs being mindboggingly unusable. (Specifically Netbeans)

yeah. i've had the same with some IDEA EAPs

(Of course, I've had bad experiences with official releases of netbeans being mindbogglingly unusable, so…)

but the vast majority are surprisingly useable
heh

I had some issues with TestNG-J unfortunately otherwise it is fine and dandy, running EAP 7118

I haven't fired up IDEA in over a month…
Time to see if there's anything new

Many new JPA inspections

They've closed three such bug reports of mine regarding hibernate specific stuff in jpa queries recently..

Yep, looks like I need Idea 7.

and I have a few more pending.. but they are closing them faster than I can find new things to comaplin at

Now to downgrade my version of Scala…

IDEA rocks. Simple as that

bleah, morning AGAIN

Aloha jottinger

yeah.. It's nice to report stuff and end up basically chatting with a developer in jira imidiatley..

when is the next 7.0 release coming?

they typically release EAPs on fridays, but the last bug of mien they close they closed with an M2 tag, so I'm unsusre

they haven't hqd an EAP of 7.0 in a long time, have they?

current mileston is M1, current EAP is #7118, which is much much newer than the milestone

The milestone 1 has been around for a while now.

hqd?
ah, had..

ahhh
I'm on the milestone, not the eap… silly me

not in a long time if you only got by milstones ;9

I take it the eap is far better than the milestones

Yeah.

I think we have had three eaps in the past two weeks or soemthing
the EAP is also, in my oppinion, quite stable by now

very cool, I need to update

not release quality ofcourse, but getting there rapidly

Plugins is where b00gz seem to be.

hopefully they fixed the facets

mostly.
i find it still drops my JPA datasource definition.
the DS is still there. the facet just forgets about it…
and i miss the dependency tree bit where all the deps were in alpha order.
that was nice for spotting dupes. or just finding something.

it auto-added my JPA facet, but didn't add my persistance.xml, nor link up with the single datasource I have configured

Same here.

I don't mind it not linking up the datasource I supopse, that is acceptable, but it should have picked up the persistance.xml

buh bye javabot

you still see the end result of the library imports in the project view, libraries tab though

you killed javabot… you bastard!

it's where I tend to find oddness..

(Well, this particular Idea plugin. but it's still their fault. )

okay, downloading 7118

250 bucks for a license?
thats rediculous
… ridiculous

and worth every penny

yes, it should be $500!

I wonder why it is that developers always seem to think it's -toher- people who are suppsoed to be paying for software

IDEA has this strange tendency to be rejected by people who don't want to pay for it… and then when and if they break down and try it, they end up saying "whooo, what a deal"

I actually think Idea's license fee is very reasonable.

s/toher/other/

And did even prior to trying it.

they are a bit like macs…

hi all
can somebody help me in javamail?

can you ask a question that has an answer?

everythink works fine, but i can't setup connect's port

and chances are, if you're using javamail, you should use commons-emil instead

soory jottinger

Plus, they charge in dollars, it's gettig cheaper by the day for me

Eeeeemil!
Then IDEA is the best 250 bucks you spent for it.

if i was using a mac i would use textmate but thats a different story

Likewise.

is it a one time fee?

WHOA… breadcrumbs!
~idea++

No, it's a two time fee. You pay the dollar price up front then, at some unspecified time later, they come for… your SOUL.

otherwise, join an OSS project.

or your goat.
Most people give up their souls.

I could also manage the payments for you, then it is a 4 time payment.

but yeah, OSS projects get a free license.
But it's still worth the cost.

~ping

is idea that expensive?
when i was about to buy it it was like 50euros

$250 for personal

You rang, m'lord?

~ping

You rang, m'lord?

~javadoc String

I don't know of any documentation for String

tee hee hee

w00t to ze version
~logs

joed, channel logs is http://servlet.uwyn.com/drone/log/bevinbot/%23java

~be joed

r3trartz uniti3!!

academic license is only 99usd

~karma joed

joed has a karma level of 51, cheeser

My goodness!

~karma cheeser

cheeser, you have a karma level of 370.

Oi,
~cheeser++

cheeser has a karma level of 371, joed

~karma chameleon

chameleon has no karma, deebo

javadoc coming right up!

figures

laaaaag
uploading src.zip to the server to process
8^)=

Damn it's amazingly enterprisey scalablebly fast!

~be jottinger

I hate you.

~about

I guess the factoid 'the truth about garbage collection' might be appropriate:
cheeser, the truth about garbage collection is http://java.sun.com/docs/books/performance/1st_edition/html/JPAppGC.fm.html

~javabot

http://javachannel.net/wiki/pmwiki.php/FAQ/Javabot

~help

See 'help about', 'help factoids', 'help javadoc', 'help karma', 'help abuse', 'help literal', 'help magic8', 'help google', 'help rot13', 'help dict', or 'help tell'.

hrm.

~rtfm

Read the Fine Manual - API Docs: http://java.sun.com/javase/6/docs/api, Really Big Index: http://java.sun.com/docs/books/tutorial/reallybigindex.html

somewhere in there was teh version info

~version

~stats

I guess the factoid 'unsupported version' might be appropriate:
unsupported version means you compiled your code on a newer version of the VM than you're trying to run it with. Recompile for/with the older VM or upgrade your VM.
I have been up for 0 days, have served 11 messages, and have 2544 factoids.

I always just did a whois on version.

2.0 8^)=

can anyone get to commerce.bea.com?

sure, gimme your credit card

yeah

it's working?

indeed

hrm, something funky on my end then

your infamous Solaris box?

~javadoc String

I don't know of any documentation for String

[TechGuy]: the solaris box is able to reach it, it's the windows box that's having the problem

hrm.
doesn't seem to have worked…

web-ui?

haha, it's very javascript-driven, so links couldn't use it!

Noticed that GF is up to v2RC2 now?

nothing in the logs either.

You have a virtual2 Reality Cache 2 Girlfriend?

weak!
8^)=

Any bombing ?

It's virtually realistic

well, i'll deal with it later.
it's just the javadoc anyway.

[TechGuy]: no, I need to wait until it's stable to use it

module startup times seem faster. Only took about three seconds to load the JSF module when first going to the admin page

the rest works? Like factiods/logs/karma?

yep

Publish url?

[TechGuy]: heh
does the jca registration still suck?

dunno. Never dealt with JCA
Want me to fire it up and I PM you my address?

no

Hi. Is the comet implementation in tomcat hosting 6 only an experiment or it can be used in real world applications?

gah

you can use it however you'd like.

IE can *read* bea.com, but I can't log in

IE. tee hee

~ridicule jottinger

Some perverted side of me wants to play with Oracle XE

sweet ;-)

I gave a glance…it seems a little hard to understand and very quiet low level..

Safari and Firefox both failed

is there any library that make it easy to work with this paradigm?

[TechGuy]: so why don't you?

It's Oracle. I'm scared of it.

I need to add an attribute to a DOM Node, any ideas?

sure. go for it!
you can do it!

[TechGuy]: oracle is quite nice in many ways, it can also be a high resource user…

bomo

Well I can't figure out how to do it.

err boom
Emphasis on high resource user
I have a friend who I haven't spoken to in years who's a senior Oracle sales exec. He used to give me lots of free CDs here and there.

[TechGuy]: well, you can run XE on your desktop machine, but you probably do not want to do that…

any "framework" for comet?

google for cometd. seems like a saw a few but can't remember which.

what class/library are you attempting to use?

~stats

I have been up for 0 days, have served 3 messages, and have 2544 factoids.

~be joed

r3trartz uniti3!!

~stats

I have been up for 0 days, have served 6 messages, and have 2544 factoids.

Tharz we goez

~tell mattis___ about xml

mattis___, xml is best parsed with XOM (http://www.xom.nu/ ), JAXB (http://java.sun.com/xml/jaxb/ ), JDOM (http://www.jdom.org/ ) or XmlMap (http://www.zwitserloot.com/java-boilerplate/mox ). If you like pain, you may wish to check out SAX or DOM (http://java.sun.com/xml/tutorial_intro.html ).

STAX isn't bad

Doesn't OC4J and OAS have a generally dim opinion in here?

ah HA!
~opera++

opera has a karma level of 1, jottinger

"don't," techguy… and when you say OAS, what do you mean?

Yeah bite my fat ass. :o , I was originally typing just OC4J. And Oracle AppServer

ah
well, it's not bad, really

bite my shiny metal ass!

all hail Bender

OAS can also be used to refer to OrionServer, was why I asked

~hail bender

All hail the mighty bender of benderness!

and my opinion of OrionServer is and nearly always has been that it's the bestest J2EE 1.3 server around

Where're Prof. Farnsworth and Zoidberg when you need them?

Will there ever be an updated version, you think? or is it dead?

zoidberg's probably eating his young

I think it's a victim of WoW addiction.

unlikely, his race dies after breeding.
hehe, seriosuly?

yeah

That is both amusing and tragic at the same time

rumor has it at 95% done in a LOT of areas.
yes, agreed
it really bugs me.

hello
i have an issue running a java app on mac os x

damn you lionel richie!

the culprit is steve jobs

I blame Woz

is there any way to have the app running using gtk instead of aqua?

luke`: only if the app supports switching to the l&f
i dunno if you can force that externally or not.

I don't think so with Apple's VM

hmm

[TechGuy]: can you with sun's?

I blame lionel ritchie too for giving nicole ritchie a basis for being known

java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel your.fine.Program

very nice.
i'll have to remember that.
i don't do a lot of SWING so i'm unlikely to.
8^)=

~look and feel is replyjava -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel your.fine.Program

why remember when you can have robots remember it for you wholesale

~look and feel

joed, look and feel is java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel your.fine.Program

Hmm, reply, maybe we need to clone().trim() that…

I need to append my classpath at runtime– any ideas?

hrm. no feedback when creating a factoid?
~feedback is replywhat do you want to hear?

Okay, cheeser.

luke-jr: create a new URLClassLoader

strange
~feedback

what do you want to hear?

hi all. I like to know if NetBeans support collaborative develpment (like SourceSafe on VisualStudio) thank you.

and that will change the classpath?

#netbeans can probably tell you

sourcesafe isn't collaborative

luke-jr: well… yes and no. you can use your own lcassloader to load classes from additional places (directories, jars)

it's a way of putting the brakes on development

I'm not the code loading it

how do I prevent aqua from decorating each window in the application? The application looks great on linux and windows

luke-jr: the classpath defines which places are searched by the default classloader. you can not change that.

why not?

VSS is the lesser of the two evils I have to use..

luke-jr: because that's how the class loader system works.

what's the worse?

ccc/Harvest
Change Management stuff. Wrose by several orders of magnitude.

in what kind of hell do you work?

luke-jr: if you have class X which needs to load class Y from an obscure place, make sure class X is loaded through a classloader that also knows where to find class Y

Your everage mid-large ERP vendor..

It's the sequel to The Divine Comedy… The Holy Sitcom

Look at it this way, I checked in a change in harvest earlier today, and waited for 114 minutes for the build to complete…

hahahaha
I mean, uh, ouch
at least with VSS you have an excuse to lie about using it
"Oh, it lost my change… again"

the build ofcourse failed. not on my stuff, but on someone elses, so I'm waiting for the next build, which should be done in about three hours
hopefully said person will have fixes their problem so the build as a whoel can complete, and I can promote my fix from implementation to the -actuall- build
It's an… interesting way to work

I've been there before.

hello

oh, did I mention the build environment is in Sri Lanka, and the build doesn't run after 6pm local time because the power to the industrial area the building is in gets the power cut at nights?

i advetise for #math-prog . anyone willing to help out is welcome there

hahaha

that's awesome

no… but I think that trumped me

It's apparently something fairly common while they construct new regions, as the power grid can't keep up.. when people come home frmo work and turn on lights, there isn't enough capacity

that's spooktacular

anyway, it's life.. fortunatley most of my work doesn't involve that particular system, so I get to use VSS.. hence why VSS feels almost like a treat

golly, I feel like I can't even make fun of you now, out of pity

i have no such compunctions.

hehe
I'm sure it makes more sense to some other group of people than it does to me..

yes, your competition

Tsk. This is ERP. This is like the ERP equivalent of agile development..

buzzwordy and of dubious value?
~ping

Uh.. wha?

ive just installed jdk 6, how do i get rid of the old jdk 5? (using windows)

uh…

why do you need to do that?
you can keep both and it can be handy to have java/5 in a few cases…

uhm, tidy up space and clutter ?

add/remove programs does not work?

it's in the control panel. consult a windows help forum and/or google

Anyone remember what the MySQL implemented semaphores are called? It's for when a process wants to create an lock on a namespace rather than a database object.

ask ##mysql?

nope, it probably calls the installer again, because it says that it is already installed (doh)

That is a 1337 channel where no one talks about these simple matters.

is there an easy way to test javabot from console, preferably not needing any irc server…

not atm. but there are testng tests you could use.

if you want your apps to work with mac you have to compile using java5
at least that's my experience

there's a java6 preview out but it's oooooold

ok well i'll keep it.

but you can compile with 1.6 and target 1.5

guess I have to open another feature request then… :-/

in case the uninstaller doesnt work (which is the case) can i just delete the jdk5 directory ?

heh.

there are a few missing docs on how to start coding/testing javabot…

what do you need this time?

cheeser maybe that's what i did.. i'm just a n00b

yeah. that should probably be updated.
a *lot* has changed since 1.7

I added my throttle multiple tell, want to test that it is working correctly… want the diff?

man, BEA needs to get some bandwidth

attach it to a ticket in the issue tracker.
i was just talking to joed about that request.

post it to the tracker

my folks are coming to town so I won't be able to look at it for a few days. but joed might.

where do I upload files there?

if not i'll try to apply it next weeks

are servlet questions ok here or do they have a special channel?

they're okay here

just attach them as issues

great.. i'm planning to learn something about it

I just see "add a comment:" I do not see any attach file…

are you logged in?

no…

"

sf.net ate my password when they were hacked, the account sends mail to an old school account so I can not reopen it….

weird

(I could create a new account, but that sucks since I have my project there…)

and the admins can't fix that?

s/my project/one of my projects/
tried to contact them, got no response, stopped bothering

yeah. they kinda suck sometimes.

got it?

if you declare an Object, but do not initialize it, does it automatically get set to null?

moved all my projects to my own server instead…
it depends

Thank you!

note that it is untested, but the difff is probably easy to read…

No problem!

ernimril, on what?

Hm

where you declare that object

~graph

I guess the factoid 'graphics repository' might be appropriate:
DRMacIver, graphics repository is Java Look and Feel Graphics Repository http://java.sun.com/developer/techDocs/hi/repository/

~jung

DRMacIver, I have no idea what jung is.

~fmarceau

fmarceau, I have no idea what fmarceau is.

ah

if it is an instance or class field, then yes it will be null by default

i'm debating moving javabot to launchpad.net

jung is the Java Universal Network/Graph framework, a very powerful library for manipulating and visualising graphs in Java. See http://jung.sourceforge.net/

Okay, DRMacIver.

graph is seejung

if it is inside a method, then you will get a compile time error if you try to use it before setting it

~ping

Pong

Hm

~graph

I guess the factoid 'graphics repository' might be appropriate:
cheeser, graphics repository is Java Look and Feel Graphics Repository http://java.sun.com/developer/techDocs/hi/repository/

ernimril, what do you mean if it is an instance? aren't all objects instances of a class

~graph is seejung
~literal graph

I have no factoid called "graph"

~literal graph $1

I have no factoid called "graph $1"

class Foo{ Object o; void bar(){Object p;….}}
o is null, p is undefined

jung

Okay, joed.

~jung

jottinger, jung is the Java Universal Network/Graph framework, a very powerful library for manipulating and visualising graphs in Java. See http://jung.sourceforge.net/

~graph

joed, jung is the Java Universal Network/Graph framework, a very powerful library for manipulating and visualising graphs in Java. See http://jung.sourceforge.net/

~be jottinger

There are no stupid questions, only stupid people.

anyway.

~be joed

r3trartz uniti3!!

~graph is seejung

I already have a factoid with that name, cheeser

~graph

cheeser, jung is the Java Universal Network/Graph framework, a very powerful library for manipulating and visualising graphs in Java. See http://jung.sourceforge.net/

ernimril, does it make a difference if the method is static?

the sequence value was borked
was getting dupe IDs

Yep, for some reason. I'll look later at that. I have the same error in a test here.

~tell peeps_work about variables

peeps_work, variables is http://java.sun.com/docs/books/tutorial/java/javaOO/variables.html

probably just an import problem.
select setval('hibernate_sequence', 100000);

hmm.

GAAAH!!! Where TF does it say, anywhere, on commons-httpclient that it also depends on commons-codec?!?!

in the pom.xml?
8^)=

[TechGuy]: why do you need commons httpclient anyway?

Simple post-read-response HTTP where I have to control a request header. I hear commons-httpclient tossed about here enough

Dependencies

err, [TechGuy]
disregard

well that's a helluva place for it

[TechGuy]: and HttpURLConnection does not give you enough?

It's nice when one is able to cut out huge chunks of the design as irrelevant.

yeah. they should've picked some place less obvious

Or, ya know, maybe actually *mention the damn deps* in the readme or such
Probably does. But commons-httpclient says HttpURLConnection has "issues" (dunno what those were).

[TechGuy]: well to be fair so does commons-httpclient…

[TechGuy]: that's the place where the dependencies of all Commons projects are
[TechGuy]: but yes, it's hard to find

True. Grain of salt

whats wrong wtih HttpURLConnection?
Ive used it pleanty of time without any problems

Screw it… quick refactor back to HttpURLConnection

but but but, more dependencies == bettarz?

that would explain why javabot needs 35 MB of external jars…

heh

You see the light!

Hm. Jung really is astonishingly featureful.

JSF's and Facelets seem like they are ready made to create the uberest CMS ever.

RYO!

do I use "import java.io.FilenameFilter;" before I can use it to implement with my class?

tias

very little about the framework choice has much to do with how good a CMS is.

I agree that good arch is the most important. But having a slick magical framework behind it, makes creating a good arch easier.

and i'm not sure JSF is that magical framework.
8^)=

It's magical how long it has taken though.

I'm interested in your take on it, as I'm not only new to Java, but very new to JSF's having only gone through the tutorial and watched the few flash demos.
I understand the biggest issue is it is .net component based rather than MVC.

erm

.net-ish I mean.

~seen kinabalu

9 AM kinabalu :unaffiliated/kinabalu joined the

w00t

Indeed!

Anyone want to give me a hand? I'm getting "ghosting" in a JTable. When I add a new row, the values from the row above appear in it, but they're not the cell's contents.

do you have a test case for that?
are you sure that you only modify the table on the edt?
~edt

Event Dispatch Thread, the thread that drives the swing gui. See http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html for a tutorial on Swing and threads, and note http://java.sun.com/developer/JDCTechTips/2005/tt0727.html#1

I'll take a look. I'm new to java. When I'm adding the row I'm manually instantiating a new row in the model, filling it with null values, and then fireing the fireTableRowsInserted, so I'm fairly sure that the new row's values are empty

anyone ever use quickfixengine?

excuse me gentlemen
which is more advisable these days, to make methods take arrays or lists as parameters?

if you use generics you usually want to avoid arrays, since arrays and generics does not mix well

{ public void dance(E[] sequence); }

ernimril, hmm that be true

i have JRE 1.6 installed and when i try to run a java program, it returns with: Exception in thread "main" java.lang.NoClassDefFoundError: com/jgoodies/looks/plastic/PlasticTheme

I got stuck with FilenameFilter interface :/ How do I make the "accept" method?

exactly as it is described in the interface
that's an external lib, you miss the plasticTheme

it's trying to use some external class, and you haven't told it where to find the class

how would i pass that option? the program comes with 2 more jar's….looks-2.1.4.jar which i'm assuming will have the theme

~tell adeel about classpath

adeel, The class path tells Java or the compiler in which jar files and folders to look for classes. Use the -cp/-classpath run-time options to specify the class path. Also see http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html and http://mindprod.com/jgloss/classpath.html#ANACHRONISM

thanks

hmm is this idea's .form format some propietary crap or a supported format?

it's a supported format. In IDEA.

:/
guess ill just do my gui stuff by hand then
time to prepare the razor for the wrists

g'morning.

Why not tell IDEA to generate the java code instead of the .form?
I mean, it's an option…

hmm i didnt find that, lets have another look
ah there
been a while since i used this :P
mmm, how do i start editing a class that is already extending jpanel and has components

i can only find new form, which creates .form instead of .java alltho i have set it to generate .java

use netbeans matisse to edit your forms and idea to edit your code

look in your class… there should be collapsed code at the end

what does this mean? : java: xcb_xlib.c:50: xcb_xlib_unlock: Assertion `c-xlib.lock' failed.

jeesus this is hard, ill just do it by hand
when i open a class that extends jpanel the side bar doesnt have the "ui designer" tab
and ll i can do from the new menu is make a new .form
which i dont want
but if i create a new Dialog it will generate java too
going from idea to eclipse was hard, but its hard going back to idea :P

hi all, does anyone know of a c compiler that doesn't require an install? Something like eclipse where you just unzip it in a folder? I would ask in #C but they block my gateway
rather unfortunate…

GCC

I should mention that I'm on a windows machine that I'm not allowed to modify in any way

yes, that changes the answer to "GCC"

so I'm thinking of running off a usb stick

mingw/gcc should

anyone know if idea can import/convert a complete eclipse workspace?

you think cygwin would work? I also need a prolog and a lisp compiler

it should

I could give it a try I guess
can anyone tell me what a recursive decent parser is in simple terms?

decent?

err
descent? [sic]

n) parse(n)

using java 1.6, is there a way to get around the 'xcb_xlib.c:50: xcb_xlib_unlock: Assertion 'c-xlib.lock' failed' error?

http://en.wikipedia.org/wiki/Recursive_descent_parser

markup didnt go quite right there but still :P

I have to write one in c for programming languages
woohoo fun stuff…

aaah its like that :P

of sorts
well, I gtg and try this cygwin for a bit, thanks guys

why do people use global resource directives in server.xml and then use resourcelinks in their context.xml?
dosnt seem to make any sense

i don't use either of those.

how do you normally do it?

it is.

yeah tomcat
we are pretty low tech here
quiet today

yeah

ill liven it up some…
when i compile my program it is giving me a ClassCastException but I dont cast any objects in my program. Can someone tell me what is wrong!

hi

Guten Tag

when I create a soap server in java, can I specify the IP address I want to bind to ?

oh my god.
Wow, did I ever mention how fun it is to use gcj.

that bad?

no

javabot tell svm_invictvs about gcj

svm_invictvs, gcj is not Java; don't be surprised if we refuse to help you. You can find information about gcj at http://gcc.gnu.org/java/ or see #gcj on irc.oftc.net

Fun like having a papercut on your nutsack.

so, this is odd.
this is -not- a slow machine.

drop em, i'll give you the papercut

gcj is can't be that much fun

but things like firefox, thunderbird, and eclipse… tend to be sluggish.
i have a decent video board, plenty of ram - but it's like the GUI hooks are rendering pig-slow.

eidolon ive had that problem lately

yeah i know what you mean. "I got three cores free, please use them for the goddamn ok-button!"

on a 2.26gig P4 w/2gig, i should be able to flip screens from my firefox desktop to my eclipse desktop without spending time watching widgets redraw.

Tahts' waht the last girlfriend said.

i'm wondering if i have something misconfigured.

off topic, but ff and thunderbird use the mozilla rendering engine, which is largely javascript

i have a 3.4 p4 with 3 gigs of ram and eclipse/ff2 have been really slow lately

it's loosely related,and i understand that tb and mozilla use XUL.
and i know XUL is pretty low-end.

svm_invictvs…

im thinking about ditching eclipse here at work
it takes almost 3 mins to startup

hi all
someone know why jList1.setLayoutOrientation(javax.swing.JList.HORIZONTAL_WRAP); doesn't change nothing at all
?
items remains vertical

eeef.
mine doesn't take that long.
you're doing something wrong

who is doing something wrong?

let eidolon show you how to double click that icon.

heh

you mean you are assuming the setting would make things from up to down :P ?

eclipse should not take 3 minutes to start.

its my machine

no i want items from left to right wrappwd to the jlist width
i want a classical windows listview for files
explorer like

i just did a 'time runeclipse.sh' - just going from command line to where i could edit and hit [Close]
real 0m27.823s
http://planet-geek.com/yawl.html — on this machine

have you read the actual api page ?

java comiles into…what? bytecode/object code/binaries?

bytecode

usppose i could replace this 2.26gig machine with like a dual core 3.0gig machine. that might help performance a bit.

How do I explain this to a bunch of old school C programmers. They keep asking about the "object code." taht's produced.

you could call byte code object code…

mm ok so the same problem how can i have a listview?

they're wrong

send me your old one

object code is pre-link.

it's just a different machine

the most common the more hidden un-present

yeah, that's true.

argh i hate java

err.. what ?

optimized object code for a vitual machine?

and what assembly language is the "object code" in.

you came to the right place!

Proguard!

what are you trying to accomplish :P ?

you can get these machines (like yawl) on ebay for like $120.

Java bytecode - the machine code of the Java Virtual Machine.

duh, I've tried to explain that.

currently an out of work college student….I don't have like $120

is the java plugin framework any good?

i want to know if there is a swing component that i can use to show a list of files in the manner any os's explorer would do

get a job!

JFileChooser?

actually..have an interview in 45 minutes

good luck!

not to choose a file

well.. i think that varies..

we'll see….its a part time tech support job…I'm going to try to wrangele that into a part time support-and-a-little-coding job

and there is something called "vertical wrap".. if you read the actual api page for the method you were using..

all tech support jobs morph into coding jobs.

so let me ask again, have you read the api page ?

argh yes coulb be i'm not able to understand it at this point

trust me its really simple, just scroll down to the method you were using..
gotta start small eh ?

that's what she said?
michael scott++

no that would be "You call _that_ 'the moNSTERRR' ?!"

i was in the pool!

followed by loud laughter

i need formMain.jList1.setVisibleRowCount(0);
works now

okayy..
i swear you were on pcb, but good for you :o

pcb?

where does NetBeans save the GUI layout data for applications? I'd like to make the visual layout in NetBeans, but I don't want to use it for anything else

in the .java

cheeser, also the location of buttons and all?

look and see

yes all java code that use the .properties file

what?

swing app framework code uses some .properties file

no it doesn't, stfu

I think something is wrong..

swing app framework code?
wtf are babbling about?

Is this javavm working ? https://www2.bancobrasil.com.br/aapf/login.jsp?aapf.IDH=sim

lol i see it

cheeser, looks like it's in the .java

no way!

but nevermind i don't know java
can i create a beanclass and then bind a tree of this beans to a Jtree?

thanks again, everyone

i want to write only the beanclass, where is a generic tree data structure bindable to a jtree?
write my bean, declare a tree BuiltInClassmybean, Jtree.bind(tree)
someone can poit me to a simple example?

hmm, i have a class with an textarea
and a eventlistener for a button
is there a good way to access this textarea in the anonymous eventhandler for the button?

u mean final sucks?

yeah

same problem here

~tell mefistofelix about aolbonics

mefistofelix, aolbonics is talking like a retard using speech as if you were on AIM or using single letters for you, are, you are, you're, see, etc. Talking like this is frowned upon in ##java and may result in you being silenced. You have a full keyboard so use it. We don't care if you talk
like an idiot with your friends but we don't want to sit through stuff like this: http://forums.oracle.com/forums/thread.jspa?threadID=499980&start=0&tstart=

eh sorry
the final problem remains

yeah, feels awkward to extend the eventlisterner, just to be able to access my textarea from the actionevent

look at the javadoc for ActionEvent

the cheeser response is: use the Swing application framework annotations to workaround

stfu for once?
quit talking about your ass.
er, out
8^)=

quit talking about him talking about his ass!

sorry i'm frustrated
java kicks hard on programmers that want to write and read logical code

don't blame java. millions of developers have gotten it working just fine.

you know procedural is very logical..

mefistofelix, you really have no idea what your on about…

there are swing tutorials you should work through.

and since when was logic anything but relying on arbitrary rules anyway ?

Exception in thread "main" java.lang.NoClassDefFoundError, what am I missing?

jtree beans binding root node, but nothing usefull

a static void main(String[] args) method?

Rémi Forax's Blog: Beansbinding goes to the wrong direction
lol

grub, it's there
sorry, GraveDigger, it's there

hi all. what types have i to use in bean class declaration for its properties - primitive one or wrapper classes ?

eh?

https://appframework.dev.java.net/intro/index.html
a href="https://appframework.dev.java.net/intro/index.html"https://appframework.dev.java.net/intro/index.html/a

eh. are you using command prompt?

no

i mean. i see in tutorials that they use wrapper classes as type for properties of bean - not primitive . is this some particular rule or simply an accident ?

hm. it's possible that you referred to a class that doesn't exist. somehow.

pastebin the actual error message

I don't think IDEs would be that stupid…

you can use primitives

hi all

i know that i can, but what is the true approach or better approach ?

http://pastebin.ca/652667

there's nothing "wrong" with it

people does anybody here have used snaq.db.ConnectionPool??

~anyone

Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.

s far as i know in M9 you cannot bind for example JTable to your custom property myList , only to util.List bean and its contruction limited only to Query (huh!?) wrapped by ObservableList (still didn't understand why cannot just use ObservableList without Query…). In beansbinding itself -
everything works fine. But i still cannot bind JTree. Exceptions… Even snippet from javadoc does not work. Where can i find JT

http://pastebin.ca/652668 and this is the error when I run it

is that class in a package?

ok. thanks . do you know some links where can i get detailed info ?

yes, I guess so

~javabeans

cheeser, beans spec is http://java.sun.com/products/javabeans/docs/spec.html

I'm using that Connection Poolling implementation and got SQLException without any message.

Anyone that uses IntelliJ IDEA
?

javabot tell mgenov about anyone

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

a lot of us use IDEA.

Okay, i'll ask.

don't do that in channels, just ask.

~mgenov we all do, kthxbye

I guess the factoid 'fallacies of distributed computing' might be appropriate:

I have an web module with some jsp page in it and i wan't to redeploy web pages on save.

joed, fallacies of distributed computing is Please check out http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing for more information.

server is tomcat
5.5
I've configured the web module to use exploded directory
instead of war file
I can do this manually by clicking with right mouse button in the editor and invoking "Package file"

hmm, implemented the ActionListener and added the method ActionEvent and so on
it works, because it starts things in handler
but it can't update a textarea field
private JTextArea infoArea = new JTextArea("blah", 5, 20);
i can't even do a infoArea.append("shit"); in the constructor

if the ActionListener is a separate class, pass the reference to the JTextArea in its constructor … ?

it is in the same class, i just implemented the ActionListener interface
the text 'blah' shows up, as it should

so what exactly was your problem ?

is there like a requirement to have scrollpanels or something?
i can't append to the textArea

where, when ?

for instance in my actionPerformed method

no, append should work.

I can't find any explanation/discussion on the scope parameter in jstl SQL tags.
I want my simple query to be application scoped, so that I only fetch the data once.

if i add infoArea.append("shit"); to the end of my method that draws the GUI it don't show either

do you do this in the initializer, or the actionPerformed method?

i tried both
ill pastebin my code

eh. I'm not as familiar with with Swing as I'd like to be.

well it should work anyhow

http://pastebin.com/m1e78d30f
*silence*

i would like to compare text in 2 documents for "keyword differences", not line-by-line differences as in coding, ex: "1.txt" contains 'Hello you are funny' "2.txt" contains 'I you are funny' Results show "hello" occurs in first document
i've only been able to find one program that does this, CompareSuite, but am looking for something else….*(I'm not a programmer)

does it even go into the block start starts at 69 ?
*that starts

i've tried 10 different programs so far, just coming to a programming channel to ind out if anyone might use a program that does this

yes
and by having the infoArea.append("shit"); i can make sure that the dialogue is still active
i would have bought that the "Connecting" thingie wouldn't show up due to it wouldnt have time to repaint or something
but that does not seem to be the problem

so you have actually debugged it and seen it go into that block ?

well, i know that the game starts fine when i press the connect button

right

but i haven't walked it through with a real debugger yet
but that feels a bit far fetched

so the "shit" appears, but not connecting or waiting ?

no, the shit does not appear.

people how called pattern which show the way that how to have only one instance of object?

singleton

called I mean the name
oh yes thanks

havn't you heard? there is a witchhunt on for singletons..

allways has been, allways will be..

this.infoArea.repaint();
this.settingsDialog.repaint();
after the "shit" line

until the day we can all spell "always"
8^)=

but that didnt help at all

hehe

i should not ahve come to work today
murphy's law has taken over today

i'm not even supposed to *be* here today!

well, you do dispose on the dialog where you added it..

true, but it the infoArea.append("shit"); should be visible though
and the Networker.Connect(blabjhaha) could take a few seconds

which db connection pool package you are suggest?

dbcp

jakarta apache. as I know

Or a pooling jdbc driver if your database has one.

I want create connection pool and store it in singleton object. my application is servlet based web application?
write=right

making mistakes is the only way you'll learn

well, watching others' mistakes is helpful, too. P^)=

And laughing. Laughing is very useful.

jsr168 anyone ?

MyClass [] myclasses = { new MyClass("foo"), new MyClass("bar") };
but the compiler is complaining

portlets?

yah
oracle has had its way with me for the last 3 days my ass hurts and i still cant figure this out

sounds like you're using them incorrectly…
8^)=

you need a new MyClass[] before your { }

http://www.youtube.com/watch?v=FG_HuFtP8w8
kinda long
but good

"doc, for all the good those suppositories did me, i could've shoved 'em up my ass."

i have followed the docs, but i cant get the edit and help modes to work

Sou|cutter, oof, thanks

strangely I have a hard time remembering that syntax sometimes too

they just dont show up

in my portlet.xml file doesnt do a damn thing

well, try quoting the dispose and see what happens..
as far as i can see there isnt any reason why the append shouldnt work.
so the odds are you just arent seeing it for some odd reason.
Assuming there is space to draw it, so it isnt drawn outside what you see, or something silly like that.. i dunno ^^

How do I use layout managers to have one component take up as much space as possible?

you could try using .setText(), and see if theres a difference.

is it the only component?

no
otherwise I'd use gridlayout

or borderlayout may work for that too
if you were to use gridbaglayout, you'd have to give more info than you have
if you read a tutorial about how to use it, i'm sure it would be obvious

yeah

oi
shall i use jetty or tomcat with wicket ?

jetty with wicket!

i've used both

Jetty++

Hello. I have a question about graphics libraries for Java. Is Java2D the de facto standard for rendering 2D graphics? (And for 3D, what should I use? JOGL?) I have no prior experience with OpenGL.

jetty all the way

hmm, starting to bog down a bit. have 11 progams open, not including services.

11 programs is nothing

I need a bigger monitor here at owkr

as a metric, I mean

I think i found the problem!
it was the .setModal(true);

what on earth :P

yeah, kind of weird

if anyone has used stripes, can controller handlers be mapped resfully? instead of /controller?action ?

someone if there is something in wicket for javafx support?

restfully* as on /controller/action

uh. no.

i hope, only for now

well, the shit appears now, but still can't get the actionevent appends to work

did you try quoting the .dispose ?

even with the dispose commented out
yeah

how do I draw right up to the border when using a BorderFactory.createTitledBorder

have you tried using setText ?

don't hold your breath

or is the textarea surely big enough to support more than one line ?

WOOUUUH! i saw the text!
yeah

for a tcp socket server, what's the correct way to read in data to a buffer? BufferedInputStream?

it waited with the painting until my connection was established
somehow

yeah, ofcourse, because thats the interface updating thread you are doing stuff with..

it's text

wait for the connection in a separate thread if you dont want to wait
erm, yeah..

yeah
anyway, perhaps i should bug-report or something about the setModal thingie

is a number always odd if its right most bit is one?

depends on the number format

int

yes

oh thats sexy

yes for positive numbers. not 100% for negative

num & 1 != 0

of course, you could just use the mod operator
is cleaner code IMO

it's less "cute", though :|

-n = ~n +1

s/cute/obfuscated

that trick should always be used with a comment.
if at all, as you imply.

whats ur favorite one liners?

"thats what she said"

"oh snap"

neat, but not terribly useful: x ^= y ^= x ^= y

JavaPosse says we're going to see Java replaced with a bunch of domain specific languages like Ruby.

iirc, you need to use parentheses.

since when was ruby a language ? Do they actually name the bastardisations of perl and python these days ?

in java, at least…

yeah, predicting the future in the IT area is a very reliable thing to do.
(aside of trivialities, such as "computers are going to be much faster in the future!"

Comments

ManUnderground as i said i found that those phishing websites were mainly uploaded using some PHP vulnerability

create() should be compatible with that of Object

Comments

Hey Im making a php script that adds several hardware items into a database and if that hardware item already

Unless there isn't anymore you can sort of "automate" through different logic.
For example, layouts.

um "later plan on doing something with content" uhh, yeah look at the bottom of that paste… i "do something with content" i echo it inside template.php

template.php would be considered a sort of 'layout'

that paste is supposed to be two separate files as you can see by the HTML comments

You could just as easily stick the content into a separate file and include it rather that buffering it, can't you?
ah okay, you're already sort of doing that

uh, either way, even if i included it, i'd still have to buffer it to get the output into $content

Why?
Because of your $title and $s?
$rs

because of the way i'm using template.php
i call it the "decorator pattern"
it's the opposite mechanism of including header and footer

I don't do header and footer. I do layouts.
Your template.php would be an equivalent to what I call a layout.

well, i've heard it called the decorator pattern, though when i looked up "decorator" pattern on wikipedia it wasn't really this
sure, so then i'll call it layout.php, whatever makes you happy, point is in order for the "layout" method to work, i have to put the page's template into a var called content
it doesn't matter if i include() that page's template or just put it inline, it still has to go through ob in order to accomplish the layout method

With your current pattern, yes it does.

like this
http://pastey.net/71330
anyway, if i wanna use the "layout" style pattern rather than the "include header & footer" style pattern, the only way i can think to do it is with output buffering
unless you can think of a different way
actually i just thought of a different way

No, using output buffering is the best way unless you like weird shit like making a separate request to your own host

anyone here done any Pear:OAP with NetSuite integration?

right, k that's what i thought… some fool from russia was in here dissin me cuz i used output buffering
but he liked smarty, so… i guess that explains that

Anyone who LIKES or USES Smarty needs to burn in the firey pits of their religion's corresponding hell

hahahaha
i know i tried to tell him that but he didn't take it too well

That's close enough

Who ever allowed smarty.php.net to be created should also burn.

anyway, i personally prefer the first style i pasted, the one with the page logic and the page template in the same file… reduces the amount of excess file management required in the project

I bet they thought it was a good idea at the time, and now they're thinking "shit… i shouldn't have started this project"

i *guess* i can understand breaking out the template into a separate file like in my second paste, i just prefer to have it all in the same file… i feel it's more manageable that way

Well, your code is getting closer to the MVC pattern.

mostly based on the premise of avoiding: http://en.wikipedia.org/wiki/Yo-yo_problem
oh?

If you take out some of that stuff and do it from a controller, you've got an MVC based website.

yeah to me MVC is really more of an approach
i think the strict OO version of MVC is useless, i realized i've basically been doing "mvc" for quite a while, but most MVC purists wouldn't call it such

Well, if your approach works great for you, the people maintaining your code, and your co-developers–then all is good.

DMBS = model, PHP = controller, embedded html host + layout = view
indeed, that is the goal

Right, but stuff like retrieving a result from a database, you're doing from the view, but it's damn close to the MVC approach.

okay flood control both server-side and cilent-side is implemented on my ajax chat

um… no not really… i'm retrieving the result in the controller

great success

i'm displaying the result in the view
in the view i've already got the result… $rs = result set
the view just cycles through said result set to display it

Oh okay, the file doing your title setting and database retreiving is your controller. I get it. Then it's already an MVC application

yup
i just usually prefer to keep the controller and the view in the same file, that's all
given that they're so intertwined and i personally haven't ever come across a need to use more than one different view for a given controller

It doesn't matter in your case if it's in the same file, as long as the code is separated.
There's no rule saying that separating code dictates separate files (like most people think)

yah exactly, the code is very separate

hai

right
ok that gay moment has passed…
anyway

Now, time to head out to the electronics market to see what new cool shit is out on the market…
Maybe I'll test out the Prada phone :P

lol Prada phone
get an openmoko

Prada phone sucks The Shine is nice ..some faults, but on the whole nice

I really want an iPhone, but there's no telecom service for it in Korea yet… so I believe the Prada phone is the best I can get so far

http://openmoko.com/products-neo-advanced-00-develkit.html
screw the iPhone, get an openmoko
the openmoko was around before the iPhone was even announced

Wolfy[drawing]: So how are you doing?

?

i'm pretty sure the openmoko will work in Korea

fine, fine. You?

Wolfy[drawing]: Eh tired, had a long day at work.

http://openmoko.com/products-neo-advanced-00-develkit.html is like a personal cell phone assasin kit

I should be studiying myself, but — I am… Ummm… Busy

Wolfy[drawing]: studying yourself… is that code for masturbation?

*blinks*

anyone?

I think everyone blinks here serveral times a minute

If it works in Korea (the phone) then I'm sold.
AFAIK, the only way for it to work in Korea is if one of the telecom companies here provide service for it.
In the Prada's case, LG Telecom provides service for the Prada (and it's an LG product)

perhaps this is a mysql question

it's a GSM phone so it should work basically everywhere

Wolfy[drawing]: Bad Wolfy, do I need to take your pencil away? xD

Try it. You're not gonna like it.

GSM does not in 1 mile deep caves

I'll look into it

hi, I am currently using phpbb…basicaly I want to be able to sent email notification for users for new posts. I was forwaded to this room can any one help please. thanks

no you weren't. #phpbb, please.

yah dude, the iPhone sucks, you can *only* use it with ATT
apple? forcing proprietary usage compliance and vendor lock in? no! i don't believe you!/sarcasm
i used to be a huge mac fanboi, now i think Apple is just as evil as MS if not more so
and i've started to think that maybe MS is not really as evil as everyone wants to believe they are

I still want a MacBook Pro :P

I don't care about ipods / macs / iphone.

I'm also considering a PMP.. I want one with a large harddrive and long lasting battery life
Unforuntately, I can't find one as good as the iPod.

PMP?

*Unfortunately
Wolfy[drawing]: Portable Media Player

PSP :3

Wolfy[drawing]: For example, I use my iPod to watch movies/anime and listen to music.
If I got a 80GB, that's be nice.. lots of space for everything.

o.O

Currently I have a 30GB which is also great, but I'm almost out of space from all the music and anime.

My Palm has like 4 gigs :o
haha

But I want a PMP because of widescreen videos.
You may not know, but the iPod screen is horrible for widescreen

I don't have any problems with that on my palm

Either a PSP or some other PMP… I need

The new Palm ish secksay

I never liked 'em

Hello everyone. I have a file that is at http://pastebin.ca/633854 that sets parameters for a class function The class is at http://pastebin.ca/633854 . If someone can I'd like someone to check this out for me and
point out some flaws that might cause PHP to warn me tat it's missing arguments.

Wolfy[drawing]: I'm gonna go to the electronics market to check out some PMP's and get some new earphones. My friend is coming with me to pick up the PSP he ordered

how much is php web hosting there?

PHP? lol
You mean the PSP?

What sort of thing in php would produce an 'undefined' string?

I can't believe I typed that. PSP, of course

Wolfy[drawing]: Google says: 320 000 South Korean won = 350.08 U.S. dollars

Im trying to fix up this horribly coded site and its doing something weird and telling the client to request something called undefined.
320 000 = 350? Crikey

Echoing something that isn't defined

The PSP is only $250 or so if I bought it for him
$250 is the original price if you bought it in the states, no?

Wolfy[drawing]: I thought that would just echo nothing

Or was it $200..

0 to like tuesday july

Pricey
echoing / using undefined variables throws an error of level E_NOTICE
(unfortunately)

Wolfy[drawing]: The electronics market has a basement like place that sells copied games, gaming consoles and they also attach mod chips to your consoles. If he would've bought it from there he could've gotten it real cheap, but he didn't because he has to pay of monthly bills on it since
he's pretty broke right now.

copied games? Isn't that… Illegal?

Yes :P

heh

Each game is 10,000 WON

"Pirated stuff 1st basement"

10 000 South Korean won = 10.94 U.S. dollars

anyone??

And there are deals like… buy 4 and get 1 free.

that's almost as normal game

Wolfy[drawing]: No, normal games are $50+ -_-
For example, PlayStation 2 games are around $50 on average.

how do I absolutely reference an include file outside the web directory?

$50?!?
oh, for PSP

Wolfy[drawing]: Can't you just download PSP games?

PRobably

There's this really popular website called Ruliweb in Korea for downloading games for any gaming console.

heh

Most Koreans download and burn their games from there.
When you buy a Nintendo DS from the electronics market basement, they ask you if you want to change the default platform and if you would also like to purchase a disk containing 16 games included in it and if you would also like to purchase a set of 4 DVDs containing hundreds of NDS
games

Cool!

Of course, all illegal :P

of course

I might also check out the Apple store in the electronics market to see if the new MacBook Pros are in

Have you found a shop in Korea where you can buy MiniITX motherboards?

Hello everyone. I have a file that is at http://pastebin.ca/633854 that sets parameters for a class function The class is at http://pastebin.ca/633854 . If someone can I'd like someone to check this out for me and
point out some flaws that might cause PHP to warn me tat it's missing arguments.

What's the best way to remove a node in PHP 5 using DOM? is this function valid? DOMNode-removeChild()

They have MBP's here. $2000 euros; about um… $3000

Wolfy[drawing]: You can probably easily obtain one from the plaza selling computer hardware. Just put in an order for it.
That plaza sells parts cheaper than newegg.com
I bought a Pentium 4 3.0E for about $50 or so
I believe Newegg's price is $70-ish

The MiniITX stuff is pretty exotic :3

can anyone tell me how to absolutely reference a file outside the web directory?

Placing an order from Korea to Europe would be ridiculosely expensive

Wolfy[drawing]: Probably
Wolfy[drawing]: Korea is the heaven of electronics and hardware.
More precisely put, the electronics market is.

I'm looking for info ok reading FLV metadata with PHP. Can someone please point me towards a tutorial? I'm having a hell of a time finding something on the net…

Wolfy[drawing]: Anyways, time for me to head out to the electronics market and snoop around

you can't. You can try to (ab) use ffmpeg to do that for you
okies. Laters

Maybe also check out some pirated DVDs along the subway paths :P

Wolfy[draw: I'm not trying to inject metadata, but just read it…
I'm using ffmpeg for the encoding

There's an flv tool for linux, find it.
I don't know if it works on Windows though
anyways, peace! :O

sure it does

one question.. work PHPNews with TinyMCE 2.1.1.1 ???

kuja is right. use flvtool2

try it and see

Yeah, FLVTool2 does the metadata injector, all I'm trying to do is grab the name of the video and length to pass to flash when we load the file

neither is a topic of ##php

!tell UserReg_CL about g10

ok thank

if I have a hierarchical site, where a page can have multiple children and a page could conceptually make sense in multiple parents, would it be better to be strict and force choosing one parent over the rest, or loose and allow multiple parents at the risk of possible redundancy?

yes, so? if you can inject metadata, you can also *READ* it

I just need PHP to read that metadata, much like reading ID3 tags for audio…
so you are saying to query FLVTool2, then respond that query to php hosting and deliver the data?

maybe

sorry to ask again, but can anyone tell me how to absolutely reference a file outside the web directory?

uh… What?

Hello everyone. I have a file that is at http://pastebin.ca/633854 that sets parameters for a class function The class is at http://pastebin.ca/633854 . If someone can I'd like someone to check this out for me and
point out some flaws that might cause PHP to warn me tat it's missing arguments.

!+g2

Guideline #2) Don't Repeat. If nobody answers your question, don't just repeat it; we all heard you the first time. more likely, nobody knows the answer (/msg php-bot ask), or you need to provide more information.

Wolfy[drawing]: sorry

! +g2
!+g2

:p

oh darn

lol

Well I didnt repeat in two consecutive things like a spam. So dont be pulling that bot stuff on me lol

lol

php-bot is made in python?
i ment
perl

Perl

thats unexpected

why?

Well you think it'd be in php

there is a reason, why PHP isn't appropriate for bots

Meh

Well how come php.net doesnt have an irc server built in PHP? PHP CLI

you can do anything in php

I've done bots in PHP
PHP is perfectly capable
Not really my language of choice for an IRC bot though

So have I. But if you can make something in a language that wasn't meant for that doesn't mean it's goot to use it for

Kernel modules?

Nah
Wolfy[drawing]
I disagree
PHP works perfectly for irc bots

you do? With which part?

therefore

you mean you "think" it does.

no

okay :-) maybe not that

PHP works fine

no, not really

it does

Why do you think it doesn't?

whats the problem with writing a bot in php?

memory management

Oh?

plus the fact that PHP doesn't do multithreading

Hmm.. php doesn't have privary or public variable scopes for OOP model?

yeah
the multithreading thing I can agree with
perl's multithreading is crap as well
pythons multithreading is great
and you can use http://uk2.php.net/declare to have functions running concurrently

Can someone please help me write a regular expression for PHP? I've searched on the site http://regexlib.com but cannot find the pattern I need. What I have is a list of email addresses, in the following format: "FirstnameLastname" email@email.com, "firstnamela
" email@address.com, email@address.com. I want to extract the email addresses as well as the name-strings.

first you neet to split the string
like this explode(',',$string);
then iterate the resulting array

What if there is a comma in the firstname, though??

good question
now i was going to erm talk about that

really you need some kind of "*" *, regex

i was just waiting to see if you were going to notice that

does session_id() change with every referesh ?

nope

heh.
=P

what if this happen with me.

I believe it changes when they restart their browser, though

Hey, count(false); should return false or 0, right?

I can't see how could ticks be connected to multithreading

i put session_start() in between ob_start() and ob_end_clean()

Wolfy[drawing]: declare does the job
if you want a function running while other code is running

ah wait, no, I rtfm again and it should return 1.

Actually; You'd want PCNTL_fork for that

Wolfy[drawing]: oh alright then

Does PHP5 support private/protected variables in Classes?

yes.

AzMoo[w]: Ah, that's wonderful

somthing like '/"([\w\s]+)"\s*(\w+@\w+\.\w+),?/'

indeed it is! Check out http://www.php.net/oop5

i don't see any wrong in my coding that rewrite the session_id which lets me get new session_id every refresh

OMG… implementation.. sweet
AzMoo[w]: One quick question: if I have a Calendar class and a MySQL class and I create an instance of mysql hosting class inside of Calender and assign it to $this-mysql. To acceess a variable with a special function inside of MySQL, would I then
run $var = $this-mysql-getResult() ?

so session_start() is called before anything is outputted to the browser i guess

yup

db would be a better variable name, alkos333, and using pdo or some standard interface for the db class (which could extend from mysqli) would allow a client that does not have mysql to swich easily

could it be that your browser is blocking the cookies or something

i called it in into body
no i've other application that not change the id every refresh
ooops, i moved session_start before any output, now it's static, thanks

heh :-)
np

fully implementing the mvc design pattern would be useful also, alkos333, however a quasi-implementation would suffice… i assume that is what you are doing, creating standard crud functions in a class using a private $db
ufully implementing the mvc design pattern would be useful also, alkos333, however a quasi-implementation would suffice… i assume that is what you are doing, creating standard crud functions in a class using a private hosting $db/u

Hold on a second, I'll show you what I'm writing
The server is running PHP4, I'm gonna ask them to update - php5 is just too good not to take advantage of

What is the php regex equivalent of "?"

\?

This is the calendar I started working on: http://laptop0.alkos333.net/nsco/cal/
I was writing the code for PHP4, but looks like I'm gonna go with PHP5 and ask the hosting providor to update to PHP5 since they are very flexible.

Wolfy[drawing]: I mean the non-greedy …

perl

it's like the optional +..

sorta…

_nixMan[Work]?…

yes i much prefer 5 alkos333

_nixMan[Work]: Evading ban I see…

you asked what is the php regex equivalent of right?

What's PDO and what's mysqli?

Wolfy[drawing]: who are you?

!+pdo

New in PHP 5.1, there is a little thing called PDO, the PHP Data Objects. This isn't database abstraction layer (as many believe)… It's more or less database function unification. If you want abstraction layer, take a look at ADODb or PEAR:B.

_nixMan[Work]: the one who banned your other IP

!+mysqli

Wolfy[drawing]: oh that fag because i said winblows… yeah good one

nah

mysqli == mysql improved. http://php.net/mysqli

mysql_* functions arent available in php5

… um, yes they are

Says who?

yes they are.

Hi everyone, how do i use a variable that contains two words in an sql statement

mysqli_* functions aren't available in PHP4
what are you actually trying to do?

MySQL support is not enabled by default, what i what i meant

neither is mysqli

it's not enabled by default ever afaik

it was in PHP4

oh ok then

not bundled with php5 either

I have a variable, $var, that contains 2 words, "Word1 Word2", and I need to use quotes properly or something to get it to work in my WHERE clause of the sql statement

so many times i've takled to possible clients about how they hired some kid to program their site that used some framework and it's all horrible and not working

so you would have to go out of your way to enable them

i dont take those jobs if they don't agree to let me rewrite

um, yeah it is

nope

if you download the zip file it is indeed bundled with the mysql extension and the libmysql

yes they are
mysqli

So you have to enable it in php.ini?

sorry i go off what the manual tells me

if you're on *nix then your distro's repos better have php-mysql available or your distro sucks

the manual doesn't say they aren't enabled by default

does anyone know if microsoft is going to get more pushy with upgrading users to IE7 soon?

"MySQL is not enabled by default, nor is the MySQL library bundled with PHP"

that's admirable, but it's still better to go based on reality

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

but the mysql library *is* bundled with PHP… i downloaded it just a few days ago

is that php5 and are those mysql or mysqli abstrakt?

Because of the change of license in MySQL 4.1, PHP excluded libmysqlclient. in PHP4 the libmysqlclient is still present

wait it does. my bad. i ment that it doesn't say they aren't included

all of the above

and i am getting an error message, is it O.K. to paste?

!tell yadayada about pastebin

no. Use pastebin

Ok

use mysqli

http://hashphp.org/pastebin?pid=24666

what is the SQL statment yadayada?

You have an *sql problem

wtf

it isnt a php problem

did someone kick me?

" this is a PG channel - pretend your 8yo niece is here, or get booted. "

haha

i think that was you before who got kicked for some violation of that, couldve been someone else

no it wasn't that it was because of my away announcement
SO I ASK THEE WOLFPAWS
if ye be drawing, how can one be kicked by a man
or fox
wolf
such as yourself
;-)
but i'm also trying to find out how to stop announcing away in this chat

http://hashphp.org/pastebin?pid=24669

Then don''t do it at all?

"SELECT * FROM products WHERE ref='".$var."' ORDER BY cost ASC";
oops sorry
you dont need to concatenate
that really annoys me

i never concat anymore. since i figured out {} string syntax

silly pointless additions to code, like if($x == true) or echo "hello".$user

I originally didn't but i thought it would keep the two words together

With glob, if I'm searching for "foo.inc.php" within a valid directory and it's not there, it should return an empty array, correct?

That kinda sucks, because you can't do "blah{function()}blah"

i generally only concatenate when the variable is at the start or end, '/users/view/'.$id for example

orly? i thought that was the point?

no flowOver

Wolfy[drawing]: it's part of x-chat aqua

" hello {$array['username']} "

it's off for now but i want to see if i can set it to not announce in here or in another channel

should i try the {}

but everywhere else

?

if a variable is set, does it return true?

fucntions in {} work since 5

oh?

so says man

's been a while since ive missed a feature

can I store an object in an session-var ?

heh i was confused because i always do function calls in strings wiht {}
i guess i should keep that in mind though with 4

How do i keep the two words together in the string?

echo "{ucfirst('hello')}"; doesnt work?

no, it doesn't work

i know, it was rhetorical

Well, I have PHP 5.2.1 and well… It doesn't work.

i get the queries done but i dont get the times and the form did not dissapear

{} are for assoc. arrays and things like {$path}index.php

I prefer concat for that.

hmm i can't recreate it locally on 5. maybe i was mistaken thinking it worked. man says "Note: Functions and method calls work since PHP 5." and also below that says that {} takes more mem than concating.. which is opposite what i was told.

yes, i do too, but… thats what they're for Wolfy[drawing]

i'm wondering now how accurate that second statement is, if the quote is wrong

which page flowOver?

php.net/string

looking at that already

hey Wolfy[drawing] darlin

php.net/string

hai, liggy

oops

Wolfy[drawing], pm?

I have resolved mine, thank you

Sure

so i can't see how they mean functions and methods dont work with {} , yet tests are showing they don't

is there some way to recode hex chars (e.g. %22) to ASCII?

and the man says they do

hexdec

function test() { return "foo"; } $foo = "test"; print "string{$foo()}"; works {test()} doesn't.
interesting

i that what it means is you can use {} in dynamic function calls as of 5
${'foo'} for instance
echo ${'foo'}();

$t = 'trim';
$var = " a ";
print "{$t($var)}"; — this works

no need for "" though Wolfy[drawing]
so perhaps {} is only useful when you dont need it

i want to control user so he can only insert 1 record within a week.. it's about the week how it would be calculated.

actually, there *IS* a need for quotes

yea its not to clear on the point really. the note in the manpage about 5 led me to think that all function calls in { } would be parsed, but only dynamic function calls are parsed

oDesk, check the date and do the necessary math to check

i suppose the cases where i've used it where only ever dynamic function calls, i've never tested static function calls untill this day

no Wolfy[drawing], $t($var) works also

Care to try?

seems tricky

yes, i have Wolfy[drawing]

so did I

oDesk, how is math tricky?

trim returns a string. but we're testing for what happens inside strings being parsed

print $t($var); works Wolfy[drawing]

yes but that misses the point of the test

but the test goes to show how redundant the 'feature' is

I didn't mention $t($var), but "$t($var)";

"$t($var)" won't work

oh yes, i said, " no need for "" though " however Wolfy[drawing]

like, i'll check if it's Thursday, if so then will reduce 1 day interval then will check if there is record inserted in this time interval right ?

Are we dealing with strings or proper PHP here, ThinkMedical?

we're testing how php parses variables inside strings.. so doing it properly isn't a worry here, since its a test

im just making the oberservation that {} for a dynamic function in a string is still somewhat redundant as a feature

oDesk, get todays date, get the records date (assumes you wrote it when you inserted), add 7 days to the insert date and if it is greater - allow another insert
if todays date is greater

That doesn't voids the fact that it works.

no.. and i never said i did… Wolfy[drawing]

nice idea

math ftw

ick. Math.

ew
math
nasty

ThinkMedical, *sigh* would have prefered exponentially

Wolfy[drawing]: personally i think that the man should clear that up. all it has on the subject is a note that can be interpreted a few different ways
uWolfy[drawing]: personally i think that the man should clear that up. all it has on the subject is a note that can be interpreted a few different ways/u

Like the "proper" way.

one would think it would parse "{ function() }" according to the note

spaces dont work in any instance

that translates to "proper", floppypond.

ThinkMedical, oh - now I am like the artist formally known as Prince

haha

mybad. i always put spaces in to. then of course take them out. hah.

Hmm, anyone here know of any good image gallery scripts?

gallery2?

Wolfy[drawing]: Hmm, I heard that one was good. I'm going to intergrate a gallery system into PHPBB for my friend's site.

ughh
yea use gallery2

I think there are already some hacks in that direction…

there's a phpbb mod for it

Thanks Wolfy and flowOver

what licence is gal2?

http://www.phpbbhacks.com/download/1060

urgh fpl

GPL, IIRC

*gpl

Wolfy[drawing]: She wanted a way to easily update her gallery instead of manually uploading all the images and create a page for each of them, so I opted in to help. Also I'm really jealous of her art skills . http://www.gerbilfat.com/

gpl basically cuts your user base in half, or more

Anthros 3

Wolfy[drawing]: Yeap
Wolfy[drawing]: http://www.gerbilfat.com/gallery/railcolor.phtml

She can't compare with http://jocarra.sheezyart.com tho :3

gallery 2 has a sweet shell tool

Hmm, is it easy to use? Gallery2 in general

yesh. But you need DB

relatively. once it's setup for the person to use it, its got alot of features to ease things out

er, what? half user base due to gpl?

setting it up though…

well obviously anyone looking to… dare i utter such herasy… make money, can use gpl can they AzMoo[w]?

AzMoo[w]: it kills the possibility of commercial use

* cant

You can use GPL scrips for commercial use, but there are strings attached.

i'm not sure if that means she can't charge for access to her site. i think it just means that she can't sell the script at all

it depends how they're making money. GPL doesn't prevent you from using the scripts, it means that you can't sell the scripts.

Hi

lol, yes AzMoo[w]

Is there any way to handle a fatel error

Wolfy[drawing]: Thats one amazing artist. o.o 3 Wolves

guess what most people who use gallery2 are.. coders AzMoo[w]

i will brbrb

AzMoo[w]: coders make money by ?

so provide it as a free "module".

Because I think its dumb that trying to allocate memory thats not there causes a script to die

Yeah Wait… There is one more… *fetches link*

AzMoo[w]: you would only use it if you needed to, if you needed to the client wouldve asked for a gallery, that would be part of the site… having a gallery they dont have complete rights for wouldnt sit well with most clients asking for one

http://mixedcreature.sheezyart.com/ — She does mixed stuff, tho… Cartoons, realism,…

is there something wrong with if (!in_array({$key}, $exclude) && !preg_match('/ID$/i', $key)) { array_push($thearray, $key); } ? this appears from within a foreach, im trying to push every value of $key to the array if it isn't in $exclude and doesn't end in ID

I think the fatel error out of memory should be managable in a try/catch block

Pffft. Lots of speculation in there. My experiences tell me otherwise.

so either the coder looses $100+ for gallery, AzMoo[w], or they dont…

anyone in charge of making php

AzMoo[w]: coder cant charge for gallery therefore less moeny for coder, it's very simple

Post your requests on the internals ML, please.

and fair enough too. Coder didn't code it.

AzMoo[w]: yes but anything they use it for has to be under gpl too
see linus' rants for more info

Hmm
For some reason my ajax chat doesnt like £ and some other characters
Is there anyway I can make it support them?

unicode :o

yeah

Wolfy[drawing]: what is internals ML?

csc`: so um, how can I handle unicode characters?

lists.php.net

at0miku, beats me :P

oh :

:

with mb_string

okay cool thanks
3
Wolfy[drawing]: how do I use it? D:
the documentation is just telling me loads of crap

what can I use for debugging php-code?

a lot of echo and print_r

or var_dump

Wolfy[drawing]: Ahh wait nevermind I got it
Wolfy[drawing]: At some point I split the string, is this where it goes wrong? I need to use mb_split, right
?
Well lemme try

ahhh i found the line that explains the function behaviour. only when $ comes directly after { does it trigger the parsing syntax. so anyways. back to what started all of this. i brought up i dont concat anymore since i learned {} syntax. but apparantly it uses more memories than . syntax.. so
back to the old school ways

split the string how?

Well hang on
Hmm

hmm..I bet there is some good tools. :P that's easier than a lot of echo :P I remember seeing a pop-up window containing all vars/values

http://atomiku.com/scripts/ajaxchat/chat.html

anyone know of something like that?

When I put "#" in the text, it doesnt seem to add it to the database

is posible import some class from external php file ?

i am a little confused, i just encountered a strange bug in my code which makes it look to me like the code "$_SESSION['a'] = "something else"; $a = "hello world"; echo $_SESSION['a'];" would echo 'hello word', is that possible?

atomiku - have you addressed people being able to edit the js on their client ? like polling more often

_Quintus_, what about $_SESSION['a'] = $a?

ÿ

no matter how many times I see "ajax chat", it still makes me hurl

lol k

csc`, that is not in my code
csc`, my session variable and local variable are not supposed to be set unless someone logs in, but just putting any name in logs someone in even if their password is wrong.

http is not a chat protocol and isn't designed for it at all

true

flowOver, what about https?

csc`, i fixed it by JUST changing my session variable from 'a' to 'session_a'
csc`, so it looks like somehow using the same name was a problem

csc`: And that is different from HTTP… how?

secured http
:p

is there a setting in php that will let you use local variables by the name X to represent super-globals by the same name?

csc`: yes, so?

yea thats still not made for a chat
even worse actually
its further away from what you need

SSL is used in some chats
Erm.. servers / rooms

its the ssl over http that haggars it

how so? IT's just another layer.

opening an ssl connection incurs overhead. it's only done once to open one secure connection with chats. with http its done every single request

opening an SSL sonnection on the modern machines shouldn't be notiocable

yea but with http ajax chat polling the server every 2 seconds?
it'd be noitoicable

HTTP isn't built for these kind of junk.

yup, and thats why https is even worse for ajax chat
than http

no, not really. It's overkill, that's given, but HTTPS connection is still unnoticable on the modern machines.

can text in an input field be filtered?

filtered how?

for a certain character combination

anyone here do Freelance ?

!+jobs

no job posting / asking for jobs on ##php (see /msg php-bot g7). You might want to check out: ##php.jobs http://www.geekfinder.com, http://www.monster.com, http://www.rentacoder.com or http://www.getacoder.com, or php.net/links, "Developers and Job Opportunities".

yea 3 people have let me down so far

hi, all. I have a question, In version 4, I can use a class variable, like this $object[$variable_name].

its like people dont want money anymore
just to waste time

and I found I can't use this in new version.

$object isn't array

yes. wolfy

so?

your mean, I have to change my code. right?

right

ok
thanks

lol l3dx one sec bro

i dont want to get kicked but if anyone does freelance and wants some money please contact me

whats wrong with that btw

wrong with what?

5- (slacker403) i dont want to get kicked but if anyone does freelance and wants some money please contact

and i got kicked

yes you did. Go away.

its not like he's spamming it left and right :o

it will likely happen again if you don't drop the subject

wow

Dude clearly knows the rules and he broke them. Why not kick him?

ok ok
damn
its just these damn freelance sites are the worst places thought since its IRC there might be something or someone with some time on thier hands and that would be directly reachable

theres a rule against asking for freelance work?

jeeese

i agree
but um
if thats the rules… then I suppose ya gotta obey them

recruting in anyform shouldn't be conducted here.

lol anyways
slacker403
pm me

Wolfy[drawing] you mean i can't ask someone to do my homework for me?

rule 7.

funny

..and recruiting successfully completed

i was going through the courses i can take this september…
i have to be in third year to take the server side web programming course, but i have to take client side in january (seconds semester, second year)
i am very disappointed

programming classes in any form are boring

it's only a 2 year diploma, and i don't feel like completing the degree atm, since i kind of need to work off my debt
Wolfy[drawing] i agree, but with them i can say that i have the education (even if i sleep through the course and ace the tests)

hahahaha!

i really should look into a challenge exam of some sort

Something like http://wolfy.homeunix.org/projects/hts/bot.phps?

Wolfy[drawing] huh???

Is __construct called as soon as I do new Class; or can I do $class-var = 1; first?

What?

Something like http://wolfy.homeunix.org/projects/hts/bot.phps?

IT's a solution for an anagram bot

i'm lost

Answer to "challenge exam" :P

lol

i have 2 scripts, one an html/form with 2 inputs which calls a php with a 4 minutes database process, the process ends ok but it goives no echo and the form page stays in the client

Are there any open source URL shortening scripts for PHP available?

what does Google say?

I was looking and most of the results are ads
And completely unrelated links

can php create compressed archives internally?

why don't you make one of your own?
csc`: Sure, why not?

Wolfy[drawing], is it a function?
or do i have to do system(); or something

php.net/zip, php.net/gz and pear.php.net/file_archive

thanks

depending on circumstances I need to write to $item['description'], or $item['content']['encoded']; how do I write this as $item[$key]?
surely $item[$key] won't get into the subarray?
should I eval?

o.O

Hey guys, I am trying to build a directory browsers that also lists the sub directories. Any suggestions on tutorials that work in php 4.6?

$key = "['content']['encoded']" ?

Mmmm, any idea why my server doesn't allow me to use mkdir? I get the path with $_SERVER['DOCUMENT_ROOT'] and its always worked on every server I've tried it on, but just can't seem to get it working on this new one..

Um. No.

is posible import some class from external php file and how to do it?

can you set an array and write the entire array into a file if you just use $foo instead of $foo[#]?

What's wrong with using multi-dimensional arrays, anyways?
csc`: like var_export does?

eh
im stupid and dont know php extremely well :p
im trying to get a script to compress a wanted file into a .tar.gz archive, then send the user a link to the file

csc`: use file_archive. Anything else would be more or less waste of time

any idea why my server wouldn't be allowing me to create a directory?

anyone know of a good directy browser that lists sub directories?

Make one yourself?

Sorry, I lost connection
8) MartinCleaver: so I want to generalize my code to allow

wolfy[drawing], I cannot get it to list the sub directories with out it listing all the files with in it =\

.

sure you can

What's wrong with using multi-dimensional arrays, anyways?

wolfy[drawing]: i know it is posible, I just cannot figure out how easily

glob

so I would rather see a different method
glob?

php.net/glob

y, I answered, & I meant that I am not in control of when it is multi-dimensional

you could use glob; But in anycase you'd need recursion.

http://pastebin.ca/633986

sometimes its deep in a nested key, other times it is not

whoops
okay
will look
ty

I'd apritiate if you'd type proper english.
Then fugure out how you put data in the array in a first place.

AzMoo[w]: what pattern is appropriate?
AzMoo[w]: wait, nevermind

I am handed the structure. I am not in control of it

!+recursion

http://www.zend.com/zend/art/recursion.php If you can't understand that, you're beyond help of ##php…

*, and use the GLOB_ONLYDIR flag

AzMoo[w]: I need to search for something without a period in it

i have 2 scripts, one an html/form with 2 inputs which calls a php with a 4 minutes database process, the process ends ok but it goives no echo and the form page stays in the client

All I can do is detect where the data is and use that location (i.e. in ['description'] or in ['content']['encoded'])

Wolfy[drawing] they have snet that to me 5 times and it still is jibberish.
Wolfy[drawing] okay fine, maybe not but it sounded good "beyond help"

Wolfy[drawing]: recursion is only needed if you want to view the entire tree though.

AzMoo[W] thank you

READ the page.

AzMoo[w] correct

any ideas why a server wouldn't allow me to use mkdir?

mugger permision

AzMoo[w]: Am I missing something? I thought that was the point here.

do I have to worry about the permissions above the web root?

yes you do, php does not run as root

as in the entire path is something like /var/www/vhosts/domain.net/subdomains/subdomain/httpdocs/content/directory I want to create

you are in linux?

How would i secure a form that requires two hidden fields username and password, so that they are not right there in plain text for everyone to see ?

yeah linux

!+eval

If eval() is the answer, you're almost certainly asking the wrong question. — Rasmus Lerdorf, BDFL of PHP

you lnow chown muger:muger the_folder

Wolfy[drawing]: seems that he just wants to list the first level sub-directories of a dir so that he can create links to them and drill down page by page.

chown muger:muger the_folder
chown is change owner

AzMoo[w] you are a smart (wo)man

this is linux commnad

ok, what does muger:muger mean?

group and user
apache_apache
apache:apache
try

what would I want to change it to?

Thanks :p (man)

mugger, that's the syntaxis for chown linux's command

it will be writable

AzMoo[w]: time to get the logic down here and I think i will be set. TY!

is there an array_* routine that allows me to pass in the structure pointer as a string? e.g. array_something($item, "['content']['encoded']") ?

the folder
i have 2 scripts, one an html/form with 2 inputs which calls a php with a 4 minutes database process, the process ends ok but it goives no echo and the form page stays in the client
this is my problem. im going crazy

no

good luck!

http://rafb.net/p/b9UdET92.html i cut a lot of mysql bcoz they are working ok

I guess I have to use eval then

or intelect

?
what do you suggest?

Study the problem; Find solution.

Do you think I have studied the problem?

no.

no

anyone here know anything about Linux Vserver ?

what would you need to see to be convinced of that

#linux

?

Your conclusions.

linux verver openVZ etc ?

#linux

its not a part of linux really but yea hmmmmmmm

I. Don't. Care. It's not a part of ##php nor PHP either.

it hasa php lib

and that is it :P

idiot

wow
clam down dude

does it involve the phplib in it?
yah, wolfy, why be such an ass?

this channels behavior has already got it to ##php seems like it might be ###php soon

sigh

Anything that isn't PHP does not belong in this channel. EOF.

i understand

Erm, I mean Null.
Take it to #phpc.

EOF? LOL!

What's wrong with EOF?

Hey I'm making a php script that adds several hardware items into a database, and if that hardware item already exists it just doesn't get added. I was planning on using mysqli's multi query function and having the name of the hardware item be unique in the mysql table so that when the script
attemtps to add it if it's a duplicate it just doesn't make it. Is that an acceptable solution?
or is there something inherantly problematic in it that I can't see?

Question about globals, which is better to use $GLOBALS['a']; or global $a; ?

both are bad

Wolfy[drawing]: alright, is this the register_globals problem?
Well being despised?

nope. register_globals is something completely different

Wolfy[drawing]: so how would I use an outside variable in a function for instance?

hi

register_globals makes Get / Post / Cookie keys visible in global scope… Like ?name=blah make $name containing'blah'
Pass it as parameter.

still there? not suer what I should be doing with chown

Wolfy[drawing]: oh okay. I'm just going through the php manual, a bit bored, and trying to figure out stuff I didn't pay attention to or skipped.

AzMoo[w]: That function suggestion worked great! I have a full directory browser up and running now

Wolfy[drawing]: Thanks

chown changes the ownership of files/directories
http://swoolley.org/man.cgi/chown

I see.. I'm just not sure how this relates to php not being able to create directories via mkdir

nice one Glad I could help.

Well, if you run php as an apache module then it has the rights of the user apache runs as. On my debian server for example that would be the www-data user. In order for php to create a folder or file somewhere the user www-data must has write access there. So you could change the owner of the
directory to the user php uses

ahh, but I have no idea which user php uses

What's your issue?

mkdir won't create a directory, and as I'm sure you know the error it provides isn't very helpful

Is there a way to check if my script is being run from a CLI?

anyone know how to secure/encrypt hidden form fields ?

I see. I suppose your have shell access on the server, right?

I know its correct, because I can't even do something as simple as mkdir('folder', 0755, true);.. I can paste that to any of my other servers and it works fine
yeah I do

What OS?
*distro

centos 4.4

You can try chown'ing the folder your want to write in to the apache user/group. chown apache:apache /path/to/the/folder

muggerthe the apache has no rite to write NOTHING on your folder
so, you must create a writable area for it

what is it called when you do things like function() or die();
what kind of structure is that or part?

die() is a function

yeah but what if I don't want to just die and I want to do something else as well?

Do whatever you want to and then call die()

Hmm.. where would I ever use interfaces and abstract classes… and I can't really understand the difference b/w the two

you're a legend! chown apache:apache did it thanks a million

Nice :] You're welcome

yeah but how does the syntax go function() or {blah blah blah die();} ? or what?

i have 2 scripts, one an html/form with 2 inputs which calls a php with a 4 minutes database process, the process ends ok but it goives no echo and the form page stays in the client

an abstract class is a class that *must* be extended. It cannot be instantiated on its own. An interface defines what a class implementing the interface must define.

Yeah, something like that. http://pastebin.ca/634020
You write a function and then call it from within your script

AzMoo[w]: Yeah, only interfaces in PHP suck
I could harldly tell the difference at first…
Java OO is way better so far..

luisgrin whats your timeout settings in php.ini ?

i dont know

have a look

gms thanksssssss

You mean like this? http://pastebin.ca/634021

gsm

yeah, it's certainly not the best OO around, but it's heaps better php4

im sure you must be rite

max_execution_time and max_input_time and possible memory_limit

http://pastebin.com/m5f9dbac1 — This is valid, isn't it?

max exu is ok, problem is with one form who calls a php

can i pass variables to a php class?

if the php does not resolve…..

yes, they are arguments in the constructor.

if the php does not resolve in a TIME …. the form … ok the form can time out

AzMoo[w]: Yeah, that's true.

but i dont know with paramenter must be

I must have misunderstood what you wanted. Like this: or die(mysql_error());

oh ok

Yeah I understand that part, but my problem is it nees to include a header file to finish off the layout as well as print the error and exit.
so I'm wondering if you can replace the or die() part with a different function or strucutre.
and in a way that stops mysqli from printing out it's own error.

wait sorry I don't understand

I believe you can put your own function after the 'or'
I haven't tried it myself so I'm not 100% sure.

"or die" means "if the function returns false then die". Instead, test the return value of the mysql function and do your own processing as a result.

if you want to pass a variable into the class just put the names of the variables in the construct or function like __construct($arg1, $arg2) and then when you call the function new myclass($arg1, $arg2))

got it, thanks

AzMoo[w]: you mean like this? http://pastebin.ca/634028 because if I do it like that right now it's throwing out TWO errors mysqli throws it's own and then the one that I'm printing.

yes, like that. If you want to suppress mysql's error put an @ in front of "new"

ahh I guess that would make sense…
Cool that works.

Of course it does

I would have never figured out that putting an @ in front of it would suppress the error on my own

Would anyone here happen to know why CURL doesn't return special characters for other language sets like Japanese?

AzMoo[w]: can you do that in front of functions too?

i imagine because of character sets. unicode support in 6

sure can.

http://www.tilansia.com/babeltest.php Know anyway to fix it?

So I'm trying to write a DB class which would handle genereric database processing and a Calendar class which would have all of the necessary calendar methods. Would it be alright to create an instance of the DB class inside of a Calender class and use that instance to send/receive data from the
database?

GNS hi

http://au2.php.net/manual/en/language.operators.errorcontrol.php
I would separate them so that you can use the db abstraction layer for other projects in the future without it being coupled to the calendar.

AzMoo[w]: Ok, so that's what I have right now - just two separate classes not connected at all.

http://pastebin.ca/634035 has the solution I used

AzMoo[w]: Then the question becomes, what's the best way to link them together then?

ahh that's what I'm looking for.

check out mbstring
i shy away from multi language dealings because well.. have you seen that page? ugh
good luck getting the characters going i suppose is all i can offer.

AzMoo[w]: You there?

hey, do you really need to ensure that all mysql results aren't false?

hi,all
where can download websites source code(PHP)?
free.

Not exactly I mean if you don't care that the mysql query failed then you don't really need to check it do you?

For which website and what "free"?

Well, you don't "HAVE TO" per se, but it's a good practice. What if you have an error and your program attempts to do something it can't do because the result is invalid?

well like, it would be nice to check it to gracefully fail, but what kind of things would make it fail? how often would that happen?

I m a student, I want learning the php language, so I want download some free source code samples.

true, but I was looking at drupal and joomla, and neither of them do any checking

Well I guess if it's a really really simple query you won't have a problem.

It's a good design to check for errors wherever you can. That way you will detect them at the earliest stage and will know exactly what's going on.

Use teh Google Luke.

Search for them. They are everywhere.

I tried it , but only search local info.

What do you mean?

hm, okay
thanks

Well like if it's a simple INSERT INTO blah () values () there's not much that users could send you that would cause that query to fail.

The amount of checks you do is obviously up to you.

and I could see how if you're absolutely sure that line will never create an error, and it's part of an intense application where you need every bit of performance boost you can get I could see you leaving out error checks.

well with luck this would be a commercial thing

only could search local country's website ,cann't search other country.

Just have to be reasonable - find an equalibrium

hm, okay
thanks

Then use the checkbox underneath the search box. Geez.

Then you certainly want as many checks as possible.

Don't people ever read forms they submit?

yeah
but I find oss code to be top notch, so I got confused when I looked at drupal because of how good that code is supposed to be

Ahh, young and unsuspecting.

lol

in other words, that code isn't that great?

Trust me, there is always room for improvement

Whenever you have more than a few people writing code for a project, things tend to get messy.
It's like the second law of thermodynamics.

ahaha

a never ending proccess

okay

the code is never better than the program. Second law: every commit reduces the code quality.

if all our automobiles were made using the software development process,
one car would randomly blow up every few minutes

Crap, I'm on commit 347
heheh
rofl

Just when you thought you were done and decided to check your email… Baamm bug report

But that's already true, isn't it.
At least a drunk user can't kill a random person with Microsoft Word.

DesktopBSD 1.6-RC3 is out! yay :P

guess who's back. back again. joshie's back. tell a friend.

can some one tell me how can i execute system command as nobody using php script i tried by system() but not working

a drunk user can't make his car stuck in the middle of the road
hehe

Linux has a user "nobody"?

yes

sure does

Does it have "somebody" as well?

has anyone here done integration work with disk.com?

it can if you want

Here are some functions for command execution: http://gr2.php.net/exec

humm

I think that the command runs under the user php (or apache if php is a module) runs as. I'm not sure though :]

would work for me, but the shorthand wouldn't?

Have any of you guys written a generic sql class to work with the databases?

K so I'm doing a mysqli multiquery where I expect some if not all of the queries to fail how can I create a while loop that goes through them? I think you would use while(mysqli-next_result()) but next_result() should also return false if that specific query failed right?

my debian box runs apache with the user "www-data", but I have heard of it being run by "nobody" as well
yeah, you can turn off support for "" in the php.ini

not working

what command are you trying to run?

well i want to run apf command
which is firewall to block ip addresses from webpage

I would just run the queries one at a time…
ah, I see

ah, thanks… I just installed apache/php locally for the first time… it must be turned off by default

try something basic like ls for testing

okies

you are welcome… if you're planning to distribute your code at all though, it's a good idea not to use for the reason you just encountered

its working for ls
but not working for apf

thought it might. Does the user that's running apache have +x on the apf bin?

yes
"/etc/apf/apf: line 35: /etc/apf/conf.apf: Permission denied"
i will be back brb

then give the user permission to /etc/apf/conf.apf?

hummm

yes! whiskey on the keyboard

when you are going through a foreach loop in an array with named fields how to you retrieve the name of the field you are currently in?

I'm currently trying to get my apache server to recognize I had installed php on my windows xp system. along with the load module and add type codes, I remember there was another code that was needed to allow windows to accept … something… does anyone remember what that code would
be?

$value)

$key)

Ch1ppy beat me to it

I win

can I pass a variable from a function within a class to another function wtihin the same class?

you mean like:
public function test($var) {
$this-yay($var);
}
??

hm
like i have a class and then a function and when i run it has paramaters, then when i run another function from that class i want to be able to access the paramaters.
of the first function that already ran.

oh
you can store them in the class…

you mean by changing the constructor

class Test {
private $var;
public function test1($passed) { $this-var = $passed; }
public function test2() { echo $his-var; }
}

hey all. im messing around with some xsl and xml, and I
'm trying to teach myself as i go, but im having trouble dumping my vars (which are xml and xsl string)
and getting something useful to look at. so, i'm thinking about using file i/o to dump my vars and look at that way.
hows that sound?

oh ok thanks

you are welcome

By the way, thanks for helping out here but for future refrence, if you need to post more than three lines of code, use a paste bin Some mods/ops here can be strict about it.

I was actually thinking about that as I wrote it, but was lazy :P Thanks for the heads up on the strictness though

or vardump will cause the browser to "half-render" my data, where obviously I just want to see the xml

Can't you just look at the source?

no, it comes from an api call, so from the moment I have it, its in a var

Well, its that posting moree than three lines can flood the channel. So if people come i and see other people doing it, they might just start posting code as well. So it can cause a mess. Saw it happen before. This one guy tried to post about 50 lines of code.

ahahaha. alright, thanks

plus i need to add to add to the xml i get… so, dropping it in a file to verify im doing it right seems like the logical choice, right?

Why can't the browser display the whole data?
or.. maybe that's all the data return from the api?
*returned

because some of it is valid html and it tries to render it, so i'm asking if there is some way (i thought there must be) to make my browser be literal in displaying this string

Oh.. hmm

so um guys quick question
I want a download.php with a download counter. each downlaod is stored in msql database. I want it to get the URL, and set the header for it
so download.php?id=IDHERE is actually file.zip

htmlsentities and htmlspecialchars

thanks, gonna look into it

nvm I got it

I mean htmlentities. Note, these formats the html into browser safe text/entities

cool

You can also try using header to send a content type header saying the page is text and not html, but some browsers are buggy and don;t respect content-types *coughs*IE*coughs*

or header("Content-Type: text/plain; charset=utf-8"); :P
before the var_dump

good to know, thanks

how was it I get the mime type again?

You're faster

print(fread($file, 1024*8));
meh
I suppose so
open file, echo its contents

hey

I just dont know how to get a file's mime type
or whatever it's called
video/mpeg, etc…

You know whats great? The people at Microsoft decided it would be smart to enable their own mime type detecting by default and ignore anything the server sends. Thanks to this, it opens up a hole which makes IE one huge XSS flaw. Basicly you can make an image and embed html in the image in
the data fields and IE will process that HTML inside the image as real HTML.

So people could include javascript and all kind of things inside a website.

What is the companion function to htmlentites that is used for mysql queries called?

does anyone here know of a good random image generator for a site? i'm looking to set something up where a person can just click an image and have it randomly display another and so on and so forth

IE should be banned!

oh so is there a built in mime type thing?

So a simple avatar or sig image could send all the cokie data, ect to someone else.

Comments

if Im making a list from a AJAX database call should I build up some HTML and then use innerHTML or make DOM elements

I am pretty sure it iwill

Many things glitch in Opera

i've tried to implement simple benchmarking on this http://dev.byron-adams.com/jquery/plugin/appendDom/ by subtracting the start time ( new Date().getTime() ) from the end time but im not sure if i did it right, do those numbers
at the top represent ms?

thanks for the compliment on my little site

no problem

I'm just learning JS

all that, is it fetched from your comp or ?

I upload my music
it's only like ~20 gigs

jesus, all that is on the web?

you can stream it, too, which is cool
rsync ftw

I am trying to run some ajax with jquery that is simple calling an HTML file that also has some Javascript in it. in Firefox the JS gets executed but in Safari only the HTML is rendered. how can I get Safari to execute the javascript within the page I am calling? The JS contained in the script
works fine in FF but $.get("includes/shc/p2.php", function(data){$("#p2Div").html(data);}); doesn't work in Safari, the JS that is. any idea

folks…. are relative path names that i use in JS relative to my SERVER or relative to my js file? (in this case, i insert a js file that is not local to my server)

hey, can some one clear something up for me. what exactly is going on here… var onpostload = { _that: null, handleEvent: function(event){ this._that.onPosLoad();} onpostload._that = this;
i think relative to the js file

are u sure?

actually.. hrmm
frig can't remember, i fiddle with this before
anyone have any ideas about the code i just dropped?

that code is missing a brakcet
var onpostload = { _that: null, handleEvent: function(event) { this._that.onPosLoad();} } onpostload._that = this;
the idea is that you want to save your |this| context. when onpostload.handleEvent() is called, |this| points to onpostload, but this._that points to the object you were originally in

oh ok

how do I see the function definition from JS shell ? for example.. the definition of Array() function

thank you

Is the output of Array.from the definition of Array function ?

eh?

opena JS shell and type Array.from enter

nothing
What are *you* expecting?

it prints something…

what is the right way to set up a whole list, and each should do something when clicked?
onclick="" on each, or a listener?

i'm in an iframe, how do i reload the parent window?

I think that will kill your iframe

don't care about the iframe
actually
window.parent.reload()

but… I guess you just use a reference to the parent window
yeah that sounds about right

hi, I want detect the duration it took a user to press a mouse button on a link. basically, the time between mousedown and mouseup. how can I do that? by the time I calculate the duration, the link will have been clicked and the browser will leave the current page.

a href

onClick="yoursillycalculations(); document.location=porno.html;"

ahhh good idea
wait, but still how do I get that duration data on my server?

"document.location='porno.html?dur='+reactionTime();"
i dunno of that works :P
if*

make an AJAX call to your server before sending them?

k, I'll try deebo's method and if that doesn't work, I'll look into ajax

no, deebo's will work if you can record the link time on the next page
I thought you were sending them off your site

they are being sent to another page on my website
for example, mysite.com/page1.html will have a button. they click on the button and I want to know the duration of that click. they will be redirected to mysite.com/page2.html

sure
on page 2 record the referrer and the duration from the query string

ah, nice
any way to do this transparently? using POST maybe?
it's not a huge deal I guess
that timing might be tricky though - so I have to record the value of the mousedown, then record the value of the mouseup, then do the calculation in reactionTime() hoping that the value are recorded by the time it's called

just make a hidden field and input type=button onclick="document.myform.myhiddenfield.value=reactiontime();document.myform.submit();"/
then read myhiddenfield from the request

no, you're doing the link yourself
so you control when we move to page 2
but transparency is an issue
you could ajax, or put in a form and POST

I see
thanks guys

if I'm making a list from a AJAX database call, should I build up some html hosting and then use innerHTML or make DOM elements and keep appending them with appendChild?
which is better practice?

DOM
`innerhtml sucks @ trhaynes

innerhtml sucks: If you have events on elements that are rendered via innerHTML they do not go away when you empty the innerHTML area. They may even crash your browser. You cannot use innerHTML for building items like tables in IE. You cannot use innerHTML for adding options to selects
in

elements in innerHTML are not executed.

oh wow
glad I asked
so if I'm making a table, I have to make the taboe
and then put a thead in
and then put a tr in
and then tds in that

yes

etc. ? seems tedious
and add attributes to each along the way?

`html2dom // save yourself some time

Woosta's (x)html to DOM convertor .. convert xhtml chunks to DOM scripting: http://rick.measham.id.au/paste/html2dom.htm

yes
if you already have the HTML worked out, paste it in the top left and click convert

oh nice
thankss
is something.id better than something.setAttribute('id', .. )

IMO yes

anyone know if it's possible to get browsers today to do a filtered resize of an image?

(1) you *have* to do it for className
(2) you save a pile of chars
they'll either do it all the time or not at all. You have no control

browsers just interpolate, not filtering

thing is
the new zoom feature in IE7 uses a fully filtered resize
but

just make your own lanczos resize javascript!

heh

Hi, how can i get the page height, document.body.clientHeight gives me unscrolled height.

but anyway even IE7 although it has code for filtered resizing, doesn't do it, unless you're telling it to 'zoom'

could anyone tell me by some miracle why my mouseover stopped working on http://www.forgemodels.com/model_browse.php warning not work safe some of those overs… if they worked

you have to do it for class name?

yes
IE is stupid
`className
jsbot find classname

js ref classname, js syntax classname

bah, not in the bot

oh, IE doesn't like setAttribute('class
'?

correct
it expects setAttribute('className', ..)
But that doesn't work anywhere else

of course not

so foo.className is the only cross-browser thing that works

because className is not an attribute
ok, thanks

exactly

so what if I want to make a paragraph, add some text to it, and then add it to the dom?

use the tool

var p = document.createElement("p"); ??? mydiv.appendChild(p);

var p = document.createElement('p'); p.appendChild(document.createTextNode('text')); yourDiv.appendChild('p');

ah, textnode
how very obfuscated

hey, I have some code that's sensitive to resize and load events…in IE, a load event generates a resize event as well, is there anyway to prevent this?

how can i get the page scroll value?

what about getting things with innerHTML?
is that kosher?

don't worry, found the answer ( document.body.scrollTop)

how would i fix the quotes so that the src="" quotes dont interfere with the onclick quotes?… a href="#" onclick="$('large').update('img src="test.jpg" /');"test/a

yeah, I treat innerHTML as read-only
or write-for-non-markup-content

bold"

rather than creating a textnode, an I element, with a text node, then another text node

hi all. how to debug some javascript hosting code?

`firebug

Debug your Javascript in Firefox using Firebug: http://www.getfirebug.com/ .. Or use Firebug Lite for debugging in non-firefox browsers: http://www.getfirebug.com/lite.html

thanx

any ideas on how to fix the quote issue i have above?
preceding the img src="" quotes with backslashes doesnt work

http://phpfi.com/255201

The paste 255201 has been copied to http://erxz.com/pb/3962

jsBot, thanx for firebug again. all my problems disappeared

`bot @ iobit

bot: Hey! I'm a bot! I appreciate the sentiment, but you might want to thank whoever told me to tell you that!

)
Woosta, tnx

hmm, any easy way to check if a text areas content has changed from the original?
to like bring the users attention to the save button

if(yourTE.value != yourTE.defaultValue){…}
(Which may not be cross browser)
I can't remember

How can i have contents of some div tag hidden?

set its class to hidden
TE has a defaultValue?
ie. the one it was inited with

all form elements do (at least in FF .. as I said, no idea if it's cross browser .. but the defaultValue gets used when you reset() a form)

ah
hmmmm
have to look into that

moin

can anyone tell me why i get the flickering on the mouse over?
http://www.forgemodels.com/model_browse.php like go left to right, each letter of the name causes a flicker
www.thenextbyte.com/videos you can see what i am talking about if you cant get it to do it with your own browsers

hmm why wont a basic textarea format text with CRLF row changes?

what is the best way to work out what IE means when it says there is a javascript error on line 64? of which file?

Did MS change the designmode engine in IE7? Now it adds a generator tag that is strikingly similar to the one MS Word adds. And it behaves differently with styles

hmm anyone knwo a website that has test data in weird languages and character sets?
like chinese/japanese characters etc
lorem ipsum for businesslogic :P

Just do a search for Unicode test page.

utf test page, yes
http://www.columbia.edu/kermit/utf8.html

unicode OR utf-8 test
That ought to do it.

ah that'll do, thanks

learn utf8 test = http://www.columbia.edu/kermit/utf8.html
hello? jsBot?
I'm a talkin' to you
`js ref
You're not a talkin' t' me though huh?

How to delete element definitely? I know i can use removeChild() but the element probably still exists in RAM after deletion.

If there are no pointers to it, it will get garbage collected

Anyone living in EST?

does the unescape() function has a maximum string length?

near Estonia, me

no, EST - Eastern Standard Timne
time*

DD
sorry

hi i hv a prob
i want to reload a form by another form
both form has no relation

reload a form?

yes

explain..

from another form without using any parameter

what do you mean with refreshing?!

actually i hv a pop up window which parent window has two separate form i hv to refresh one form of them when any changes occur in popup window
another form of parent window should not be refresh

How do I check for if a variable is 0 or false?

if a == true

===

ok thanks

Is there a way to make onblur="value='please input something'" happen only if value='' ?

yes

How?

onblur="if(value='') value='please input sth'"

SlimG, 3
er du her ja

hehe jeg er overalt
I forgot to mention that the onblur is a html tag, not javascript, sorry

s/tag/attribute/

Thanks GarethAdams

yes, should work anyway

Comments

Im looking to write a bookmarklet for the iPhone with very little javascript background What do I want to look

Thanks anyways guys,

innerHTML–

lol, serious brainfart
Next up: Freeing memory before you've allocated it

Woosta, ain't working

bugger

argument is not getting passed apparently
i am getting p_data undefined variable
Woosta, channel_obj = new window[channel_klass](t_data);
channel_obj.display_response();
two precious lines, and i expect t_data to be passed to the constructor

initially i have a combo with, 6 elements… how disable the combobox? onload ?

works for me .. var foo = function(){this.y = 12}; var X = new window['foo'](); X.y

Woosta, works for me too, the problem was elsewhere
Object.extend was the culprit

ahh cool

how would I go about scrolling the page so that a spacific element comes into the viewport?

lokkju_wrk, scrollTop and getting the element position?

Where I can find all Keybord keys?
KeyCode i mean

is anyone familiar with plotkit?

if i add an form element via javascript.. and then i fill out that element and then have javascript add another form element is firefox known for clearing the first made form element?

Can someone help me debug a bizarre bug?
I will paypal someone $10 for their help

how are you modifying the form? innerHTML?

yes

Bzzzt

heh

`innerhtml sucks @ kuito

innerhtml sucks: If you have events on elements that are rendered via innerHTML they do not go away when you empty the innerHTML area. They may even crash your browser. You cannot use innerHTML for building items like tables in IE. You cannot use innerHTML for adding options to selects
in

elements in innerHTML are not executed.

"Form elements apparently added to forms via innerHTML do not get submitted with the form."
If you need to modify a form, you need to do it via DOM calls. InnerHTML should be avoided for all but the simplest of HTML

could you point me to a good tutorial that explains nodes and how to use them correctly? or is that the right way?

`html2dom @ kuito // Put some form stuff in the top left and click convert

html2dom: Woosta's (x)html to DOM convertor .. convert xhtml chunks to DOM scripting: http://rick.measham.id.au/paste/html2dom.htm

you'll see how the DOM methods look for the supplied HTML

so cut and paste the form into there and it will break it down for me?

yup
Of course, most of your form can already be on the page, you'll only need the parts of the code that add in the new parts
I don't do PM .. what's the problem in general terms. If it interests me, we can go from there

so if i switch this all to using createElement and appendChild and such it should remedy the problem?

yup

word that shouldn't be all that difficult

nup

seems like a bit more work than using innerHTML - but since it's the best way i will convert

innerHTML is so nice though
it's like…
document.innerHTML=whatever
and BOOM!

get over it

haha
i'm over it

innerHTML is a good idea, poorly implemented
If I had my way, you wouldn't call it on elements, but as a method
var contentObject = document.importHTML(yourString); someNode.appendChild(contentObject);

http://rafb.net/p/Nhcssw35.html — any ideas how to fix this function to work in Firefox as well as in explorer?

ya i wouldn't mind that .. would be simpler than createElement etc etc

exactly .. but it's in the same vein. It's a DOM method so it converts the string into a DOM object which you can then do whatever you want
BTW, if you have a chunk of HTML and don't want to turn it all to DOM, put your browser to work:

chart is not defined
in explorer it works

… then you can do: contentObject = d.gEBI('someChunk').cloneNode(true); someNode.appendChild(contentObject);

`no ie @ Techdeck_

no ie: Sorry, I don't help out with IE-only problems. They take up too much of my own life to spend time helping fix yours.

(and vice-versa)

woosta, do you know of a simple way if you had div1 above div2 to take div2 and move everything in it above div1?

Everything *in* it, or just swap them over?

ya everything in it would stay as well

div1.parentNode.insertBefore(div2, div1)

easy enough

will remove div2 from where it sits and insert it above div1

Woosta, the problem is in firefox, not IE :o )

is there also a insertAfter?

and I'm actually trying to make it portable ..

insertBefore( newNode, someNode.nextSibling ) === insertAfter

IE is working .. firefox don't know chart for some reason

`insertAfter
jsbot learn insertAfter = insertAfter is not a built-in function as the process is simple: containingNode.insertBefore( newNode, afterThis.nextSibling );

OK

Woosta, come on..

jsbot learn insertAfter = insertAfter is not a built-in function as the process is simple: containingNode.insertBefore( newNode, afterThisNode.nextSibling );

OK

(and vice-versa)

You seriously caught me on a bad week .. I've been knee deep in cross-browser problems all week

that's a bummer

Actually .. make that nipple deep. It's been a bad week

ah okay man.. can you just give me a direction?

Left

i do a lot of html/css and cross-browser problems are the suck

-wiseass remarks :p
nvm, I'll google my soul out

Meltdown

Module Meltdown does not appear to be in core. Perhaps capitalization matters or try using the 'cpan' command to search for it.

lol

hello. how can i include a script file only once the html host body is loaded?

`include

Include another Javascript file in your Javascript .. http://www.phpied.com/javascript-include/

^^ adapt

im not sure what just happened
but thanks ill give it a go

anyone used swfupload.mammon.se ?

*crickets chirp*

indeed
i need a multi fileupload system but browsers are retarded
what about this http://www.fyneworks.com/jquery/multiple-file-upload/
hmm are jquery and its plugisn gpl'd?

`explorer

http://paste.debian.net/33443
this is a script that helps me drag nd drop table rows (sortable way)
I've got it somewhere online
now… this scripts triggers also the onDrop event when I only click on the row and don'ta ctually moveanything
can somebody help me prevent doing that?
I would like that onDrop is triggered only when the row is moved

i cant help you for this script but Yahoo's UI library is hard to beat for drag and drop.

yes I tried jQueries interface and scriptaculous but both doesnt support table rows
I will check yahoo UI but I doubt
hm… and yahoo UI doesnt work with jQuery, right?
couse I've got the whole app on jquery, so I cant use anything else
except for simple scirpts taht doesnt enterfier
so any1?

some one work with jsquery? i am testing the width function wich works properly in msie 6, mozilla and also on one comp on msie7, but on another comp on msie7 it doesnt work properly, i am detecking the witdh of UL in another parent UL, LI, and is the problem, in msie7 he get the the with of
ist parent LI, not an UL how it is, because the UL is bigger than its LI parent. any idea? thank you

you ment jQuery probably, right? try on #jquery

Lion29 ok i try yes i ment jQuery, sorry

http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=7084203
a href="http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=7084203"http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=7084203/a

how to change the background of a tr by mouseover?
onmouseover="document.table.tr.background='#FFFFFF'" ?

hi
i seem to be having some reentrancy issues with qooxdoo and xmlhttprequest
the callback of the xhr seems to fire while the code is busy doing something else

try onMouseOver="this.bgcolor=….";
or background

is this correct ?
i would expect setTimeout and the xhr callbacks to fire after other running scripts complete

and it's better to use style

I'm looking to write a bookmarklet for the iPhone with very little javascript host background. What do I want to look at to popup a modal dialog with some text, a text input field, and three button?

first i suggest you take some gasoline, soak the iphone in it, take am atch and light the POS on fire
first i suggest you take some gasoline, soak the iphone in it, take am atch and light the POS on fire

I'll take that under advisement. :-)

then get a real phone and start over

anyone that can direct me to some documentation on 'when' the callback of xmlhttprequest and settimeout fire ?
google hasn't been helpfull

is what I want to do hard, or am I just not looking at the right stuff? I see the prompt command, but I cannot supply three buttons.

does work

does anyone know of a compatible way to do t his http://wvr.me.uk/javascripts/parentnode.html
it doesn't work in MSIE

anyone? please

tr onmouseover="this.style.backgroundColor='red'"tdtest/td/tr
this works perfectly

how can i add the class attribute into an existing input-field with Javascript?
the input-field is this:
input name="sa" value="Google-Suche" id="sbb" type="submit" /
it should work like this:
input class="button" name="sa" value="Google-Suche" id="sbb" type="submit" /

where is the error? http://pastebin.com/m470b38d8 thanks

http://www.irt.org/articles/js027/index.htm

it works
but the problem is with the parameters

???
no help here to add a class="button" to an input-Tag?

what is the problem? you want to add a class to an element with js?

Yes

document.getElementById('input_element_id').className = 'button';

i will try it… thanks… i think it must be like appendChild etc…

Does anyone knows whats my problem with the arguments? http://pastebin.com/m6e745c2
Thanks

why are u using quotes?

logik-bomb: http://pastebin.com/m21a6e5a5

Twey, shouldnt this work? http://pastebin.com/m35c70cae
thanks

What's the best web hosting standalone JS implementation in terms of C extensibility, most standard support, speed, etc?
Spidermonkey?

this is probably the grossest question ever but, is there any way to do rounded edges without javascript?
and easy way?

yes

using CSS?

you can use four images

Romes, yes there is

yes, there are a lot of options for you out there

google

but this is a js channel… so I guess if you'd lke to do it without js you don't need our help

you can use four images, for each corner

hehe
why not two, top/bottom?

oh i thought you said WITH js

there are a lot, really a lot of articles out there for rounded corners
check google

lol
will do
thanks

Romes, it depend, you want it to be able to get wider?
you'll be stuck with one width if you use two images

true, I didn't think about that

or one height

he said top/bottom

why not two, top/bottom?

Romes, google it
i found a site that makes you these 4 corners
you give him color and some stuff
he gives you the images, css and html

hah, cool

Romes, http://www.roundedcornr.com/
use the "Basic RoundedCornr"

http://pastie.caboo.se/82425
but i'm it doesn't work. maybe you have an idea?
why?
i think it's easy for you js-experts

okay, doing this manually is going to suck
especially since I change colour schemes all the time…
so… is there any way to do this *with* javascript? lol

anyone?

while(true);
1+1;

2

while(var i=0;110){i–;};

Error: Error: syntax error at line 0: while(var i=0;110){i–;};

:/

while(var i=0;i10){};

Error: Error: syntax error at line 0: while(var i=0;i10){};

so IS spidermonkey the best choice for a standalone impl?

Comments

I ma looking for suggestion I have C program that downloads some data when program starts It is putting it into

Hi, when I create a table with engine = memory, does this means when I restart mysql, the table would disappear?

You can't use SELECT * and GROUP BY in a standard way. MySQL does allow that form, but you either shouldn't use it ever or be very very careful you know what you're doing.

just the contents

I have a table with fields `user_id`, `page`, `timestamp`. I am ordering first by user_id, then by timestamp. I want only the last page for each user.

aha! thanks for the clarification;

http://dev.mysql.com/doc/refman/5.0/en/memory-storage-engine.html
groupwise

Eh, bsod

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

Check that URL.

Is there no way to get it to replicate alter table without stopping the slaves first?

Thanks alot I'll check it right now Xgc

I'm doing a database query and I need a wildcard in my WHERE (i.e. something = ? )… what should I use? And is there a place that I can look up these special characters?

Just don't specify that column in the WHERE clause.

not an option: I hard coded it and I need a variable to replace it
is there not one at all?

something

That'll work for null as well.
No. There is no constant that will do what you want.

darn

If ? can be a column name, the best you can do is something = something, if you can't change the operator.

alright, thanks

something will do exactly what you want.

rails replaces the ?s in my query in order: "YEAR(#{ self.table_name}.created_on) = ? AND MONTH(#{ self.table_name}.created_on) = ? AND DAY(#{ self.table_name}.created_on) = ?", year, month, day…. and I want to allow for a lookup by month without changing the code (as it's nice), but I'll
write two different version

Good evening all.

guys imneeding some help tryign to get someinfo out of the db

Does ? always represent some literal value or can it be an identifier?
Is it the equivalent of a prepared statement?

well, in my application the variable subsituted in for the question mark is always an integer
except sometimes the month and day are missing

Ok. If you could replace the operator with LIKE you could use wildcards.

I hadn't thought of that

field LIKE '%' would match any non-null field value.

im tryign to get al lthe user_name from the user table
http://paste2.org/p/5668
and have them in order by name

that's awesome, that keeps my code pretty

You're welcome.

can anyone tell me if my code is right or even close ?

It's perfect, as far as I can tell. You have fluff in that example that has nothing to do with SQL.

fluff ?

Is there really both a name and user_name field?

hmmm, I could pastebin this query, but it requires a bit of work to anonymise, so will ask w/o a pastebin first….. I have a ELT(FIELD(GREATEST(…..), …….), '….', '….', '…..') - it works very well for sorting (with thanks to the esteemed #mysql from _ages_ ago)

oh well i don't need both

BUT the problem is that it picks the first field, when if all fields are NULL
(when, not if)

if one of those doesn't exist in teh table, the sql host will fail.

i want them ordered alphibetically

ORDER BY user_name

there is a user_name field though

and it really should be NULL

oh i see now lol
and this $c = "SELECT NAME='$type'";
should the be user_name ?

That has nothing to do with sql or MySQL.
You need to ask that in whatever channel handles that language.

I ma looking for suggestion. I have C++ program that downloads some data when program starts. It is putting it into database host as it comes from socket. Now I dod delete all data first before starting download. This is quite bad. So what I am looking
for to start download data to a temp table and when all download completed than drop data from main table and move temp to main table. How can you do that? Can you?

Not sure what you're trying to ask, unless you want to use COALESCE() to convert nulls to some known non-null value.

Xgc, hmmm……sec, will rewrite

no reason why you can't. don't know that it will be any faster though.
how many records are involved?

DROP TABLE tblname; RENAME TABLE tblname to new_tblname;

it is not matter of beeing faster

Ooops.. DROP TABLE tblname; RENAME TABLE newtblname to tblname;
He just wants to be sure the new data is in place before dropping the old table.

ELT(FIELD(GREATEST(product_1, product_2), product_1, product_2), 'product_1', 'product_2') — where the contents of the field is 'when that product was downloaded'

To be really careful, rename the original table, don't drop it.

but sometimes the user doesn't d/l either products so both field are NULL, yet that query returns product_1

it isthat is what I want to do
jsut make sure that data is there before droping

Only drop it after the incoming table is renamed successfully.

else I will be left with empty data
is temp table persistent between stored proc calls?

Import into tmptable … rename table tblname to savetable; rename table tmptable to tblname; drop table savetable;
If you create a concrete table, it will persist.
As an aside, this is a *very* bad way to handle data. Hopefully this is just a maintenance procedure and not done during live/production operation.

how do you create concrete table? and how do you check if it already exist before inserting data. So it is only created on first call
Thank gusy for help

create table …;
Even a temporary table would persist between procedure calls, as long as it's within the same connection.

it is same connection
how do you check if temp table exists

You create it.
Why wouldn't you know it exists? This really doesn't seem like a very sound design. Consider not creating any tables dynamically.

Xgc, got a sec to throw me a bone? :/

What's the easiest way to give a non root user the ability to change his own password?

!m ampex set password

ampex see http://dev.mysql.com/doc/refman/5.0/en/set-password.html

it is always possible to change your own password

are you sure?
no need for mysql table update privilege?

When both fields are null, the above expression returns null, not 'product_1'.

Xgc, :o

Either your version of MySQL behaves differently or you're misunderstanding something.

yeah, possibly
this is 44.x FWIW
4.x

select ELT(FIELD(GREATEST(null, null), null, null), 'product_1', 'product_2'); Try that.

hmm, I get a syntax error, due to the null
nm, typo :P

Must be a 4.x bug or you didn't run it properly.
and the result?

I get "NULL", yeah

Well, while you're initial question was faulty, there is some bad behavior you missed.
select ELT(FIELD(GREATEST(1, null), 1, null), 'product_1', 'product_2'); also produces null.
You may need to treat nulls differently.

hmmm….. not here
here, if I replace "null" with "1" (I assume you meant a literal "1", I get product_1, not NULL

In 5.0.37, greatest(1,null) is null.
Ah. Sorry. That was a typo.
No. I meant 1, the number.

heh - I must be contagious :P

In 5.0.37, greatest(1,null) is null.

yeah, I put in 1
4.1.22 here FWIW

select FIELD(GREATEST(1, null), 1, null); generates 0.
Which of those behaves differently for you?

hmmm, on THIS side, GREATEST(1,null) gives 1
checking field

Ouch. That's the one.
It probably should be null, which is the 5.x behavior.

& F(G( returns "1" too :/

Since null is unknown, the db can't be sure 1 is the greatest.
I suspect that was fixed in 5.x.
You probably shouldn't depend on that 4.x behavior.

ah HA!
Before MySQL 5.0.13, GREATEST() returns NULL only if all arguments are NULL. As of 5.0.13, it returns NULL if any argument is NULL.
ah ha! and another problem with the query - Field() = "If str is NULL, the return value is 0"
oh, nm - that'd be correct

guys

actually, I think FIELD() is the broken one
ignore me, brain's frieed

I read your suggestions. I am still confused a little. What is your suggestion to that I should do. One more time. I want to make sure that do not delete existing data until successful download. I could just update/insert on every net download what is new/missing. But this would grow number
of records over time.

Wow
http://linux.slashdot.org/article.pl?sid=07/08/09/2047231 Time to switch to PostgreSQL!

and spend time relearning
badly phrased title

guys i have a problem
how i searh in a field type date, when the month is 5 and the year 2007 ?

range search for every day in the month

where col"2007-06-01" and col"2007-04-30"

mmm

The title is downright *incorrect*
It's shameful,really.
MySQL (even Enterprise) is obviously still GPL…for the time being.

maybe it could changed too

But even so the recent developments all lead to the conclusion that all the effort in the world to relearn a DB system and switch to PostgreSQL is worth it.

but Community is always there

And I know I wont be alone in doing so.

relearn is one thing, rewrite application is another

True, but most applications I use support either MySQL/PostgreSQL

interesting point of view.

Thank you for respecting my perspective enough to not flame me, even if you may not agree with me.

it is worth looking into, clearly.

No Enterprise Source Tarballs! Alas, MySQL has become the great Satan!
No Enterprise Source Tarballs! Alas, mysql hosting has become the great Satan!

It's still GPL though.

Noooo, it's evil!

Unlike sensasionalistic Slashdot headlines would have you believe.

Isn't it?

I'm not saying it's NOT evil.
It's enough reason for me to switch to postgresql hosting personally.

No, then you play right into their hands!

But Enterprise edition is still GPL so you can still get sources and binaries from other distributors.
Haha why's that?
Play into their hands by not using or recommending the use of their product?

Well, the MySQL MO is to see how much nerd rage they can generate without people switching. You have to scream but not leave.
SCO, the initial split, the removal of the tarballs, it all flows together.

don't forget Area 51, which is Norwegian for 'Master Plan'.

Sssshhhhh, do you want to get us killed?

*loads his rifle*

SubFreeze is Norwegian for Sigmund Freud.

*loads his pistols*
*loads his AK-47*
*equips his grenades*
*straps on his kevlar*
*looks at threnody and winks*

down boy

don't MAKE me pull this planet over!
cheater

*sigh* I wonder where it'll end up…

Is there a way to concatenate the columns that I get with a select * from foo?

CONCAT()

R T F M

select concat(*) from foo doesn't work

TLDR

you need to choose the columns to concat

Of course not :-)

I don't know the column names

w t f

this is blind sql host injection

you did read the documentation on concat(), did you?

yes

don't do SQL injection

I am pen-tester

contact(field1, withfield2)

I like SQL injection
One of my favorite security topics TBVH

anyways, I need to figure out the column names, and I don't have access to information_schema

concat(fieldone, concat(field2, concat(field3, field4)))

My next favorite is arp poisoning

I don't know the column names mate

select * works, it tells you the name-value pairs

The only way I've ever figured out column names is by guessing :-(

or "describe tablename"

I am attacking a web app with blind injection…

….

ahh, brute force! I love it

the only output is the mysql error message
so brute force is the only way?

or SHOW CREATE TABLE
:-)

and we're supposed to help you attack the website?

SELECT * FROM TABLE

that doesn't work in subquery

new query SELECT * FROM table; TRUNCATE table;

php doesn't allow that

Yes, I know, I am quite experienced in what you are doing :-)

Damnit!

Yes, PHP only allows one query per call to mysql_query()

can you do a sub-select?

yes

have anyone considered that what borius is trying to achieve might be illegal?

You can however use subqueries and UNION SELECTs

this is legal pen-testing

pen as in prison pen?

heh

0, 1, 2))

problem is I can't figure out the name of password column

pwd

Error MySQL server has gone away while close stmt

tried 'em all mate

Yea, pwd is a good one, as is password, pass, pw, passwd

How do i fix that ;[

tried them, and then some

close stmt?

so, here I am wondering if there is a way to turn * into a huge string that I can dissect with substring()?

select * will not give you the column names.

yeah I know

Hacker

I don't really need them, I just need the output from the password column. So I figured if I could get everything concatted then I could figure out what's the password.

Just tell your client to fix their injection issue by regexp'ing out anything not numeric and longer than the max id in the db

they are corporate droids, they want proof of concepts

select * ; loop through array; print values;
booya.

He doesn't have access to the code. He's using injection

and how would I do that in a subquery?

o.

normally I guess the names or bruteforce them out of information_schema
but that has failed me here

borius, toss the URL

haha, no way

Are you fortunate enough to get error messages?

awww, why not?
he is fortunate enough to get error messages

yeah I get them
but they just say "unknown column name blah blah blah"

hey all. I want to do something like this: SELECT * FROM table1 LEFT JOIN table2 USING (id) WHERE 'there is nothing in table2'
SELECT * FROM table1 LEFT JOIN table2 USING (id) WHERE table2.id = null?

SELECT * FROM table1 LEFT JOIN table2 ON table1.id = table2.id

hmmm, guess I am SOOL then

Hmm.

SELECT * FROM table1 LEFT JOIN table2 ON table1.id = table2.id WHERE table2.id is null?

If you're getting error messages and the "corporate droids" such as myself can't see the messup in the code, and they can't figure out not to let anything other than an integer pass, then they probably can't afford to pay you.

heh

the fact that you can get some columns should tell them that somehow someone will guess them all and get their data

well, it seems the password field has some really weird name

I'll tell you now that I do not believe you are doing this legally

all the other fields are guessable from looking at the web app's var names

people that do it legally know what they are doing, and don't usually come here asking for help in hacking
or rather, "cracking"

yeah yeah, believe what you want

leave them to their demise if you can't convince them their system is insecure.

Just write it down and keep it in your CYA file.

are there any functions that accept the output of a select * query?
doesn't seem like it, they all say input should be one column only

Your "Cover Your Ass" file, should anything ever come of it and they say "Why didn't you warn us!? Isn't that your JOB?!" you can show them that you did.

I'm not employed there
am consultant

you're contracted, which puts your arse on the line if something does happen after you've told them it won't. So warn them, document it, and let them fail

yeah well…

unless you're really trying to get everyones passwords so you can get system access and not warn them, then, well, yea.

haha, I love this paranoid atmosphere
trust no one

Eh, it's not mis-trust, it's acceptance of all possibilities and their consequences.

Isn't that the primary concept behind infosec?

yeah

Hmm, wow, good way of wording it SubFreeze

It's just how I think

Yeah, well you hit the nail right on the head.

so, borius, good luck getting access and flip off the PHP MySQL module for not allowing multiple queries.

Haha

eek!

Alright you all, I'm outta here. It's home time with a pinch of sleep

yeah well… being a whitehat sucks… if I was evil I could just social engineer them with freebie USB sticks

If the company won't heed your consulting warning based on the evidence you already collected, they won't make it anywhere and you need to find better clients.

cool, I just found out a way to get the number of columns

ORDER BY 1…
ORDER BY 2…
ORDER BY 3…
:-)

hehe
I used (select (select * from users) = (select 1))
the err msg tells me the number of columns
I'm not an sql guru, I'm the first to admit it

Well, post the URL and let us do some dirty work

I need money for guns, women, computers

guns and computers are worth your money

Zing!

I guess

they depreciate and take less. Women just keep taking more, and they don't appreciate.

the money part is for buying peacock attire and seduction books

the gqame ftw

ahh, setting yourself up for failure, got it.

hehe

I'm going to go hit the bar next door, then get in my car and go home. Later all

I've got mates who have gone from wbAFC's to hardcore PUA's… I don't have the time for it myself

Well, if you're driving, don't hit the bar too hard, heh.

driving drunk ftw

Just scoping out available, drunk women

Respect.

s/drunk/coked out/

comes when they sober up
and I tell them I saved them from a horrible mistake by allowing them to make a not so horrible mistake
uand I tell them I saved them from a horrible mistake by allowing them to make a not so horrible mistake/u

Hah

hasta

lat
late*

guess you lot are Americans?
I am euroweenie
it is like 6am here

Ah, yea I'm american

cool
you get to have guns
and be like actual citizens and not just subjects

Yes, and so far I have 3

damn you, don't make me jealous

:-)
Anyways, I know what you mean about not having time for hardcore pickup
I just apply the basic concepts in my day-to-day life, I'm a busy guy, I don't have time for it either

I'm into hacking in all of life's areas
like smart drugs
heard of 'em?
aka nootropics

Nope, never heard of them.

well they're a class of substances that allegedly make you smarter and shit
most known is piracetam
the effects are kinda subtle but I can say that they do work
now, what I really need to get my mittens on is modafinil
aka the new wonderdrug of the DoD

hello!

i have a query which joins the table group to the table release. there is a release_date field in the group table which is currently being used to determine the release_date. however there is also a release_date field in the release table (don't shoot me, i didn't design the db). now what i
need to do is change the FROM clause so that instead of group.release_date, i have something like MAX(webstock.release_date) AS release_date … so basically i want to use

your line was too long. it cut off at "… want to use…"

top

the latest date from the release table instead of the date in the group table… but MAX won't work there because i'm not using a GROUP BY clause
bthe latest date from the release table instead of the date in the group table… but MAX won't work there because i'm not using a GROUP BY clause/b
thanks

why aren't you using a group by clause?

because it's not my query and i want to change it as little as possibly. it's a monst0r of a query that is central to the operation of a production system

I wrote script that restore db but I can't do it quietly. This command: sudo mysqldump –all-databases -u root -pPassword $1 where $1 is first parameter of script

that doesn't restore anything

I don't want that mysqldump is showing on screen progress

hmm I'm not quite clear… do you want the bigger of the two dates? There is a function called "greatest()" that will return the biggest of whatever values you pass to it

file

it should be: sudo mysql -u root -pPassword $1

so greatest(group.release_date, release.release_date) would return whichever date is greater (later)

ups, thx for help.. I didn't good understand docs :/

actually i think what i'm talking about is impossible… because what i'm talking about will occur across multiple rows

then you need a group

yeah it's not going to happen… i think i'll solve this problem at the import side
thanks for your help guys

well… ok

lol
musta been a gentoo guy
go fish

sorry I just took a week of vacation time

have it your way then

Hooray for vacations

Hi

damn. guess I still have over 150 hours of vacation! Crazy state

go fish

i am just wondering i want to select everything out of a table except one colum… any ideas how i can go about it so far i got SELECT * FROM tblnx ?

heh
list 'em all out. There is no " * except blah"

sorry?

you have to list all the columns you want to select

the current topic is vacation. Why'd you have to go and ask a legit. question?

who knows
so you cant just do SELECT *, -Order …?

lol, 150 hours? Its insane

nope

damn ok

SELECT * is evil anyway

yes but o so convident

8 hours every 2 weeks

and they can compound all the way to 150 hours?

higher than that… I think up to 300

well I'll beee.

hihi
buu, We're sorry, but Google Answers has been retired
what a pity
seriously ?

yep. for about 18 months now

I don't want to stay retired

I kind of doubt they would appreciate it if I let it build up to 300 and then say "oh by the way, I'll see you in 3 months. kthxbye"

tias
and let us know

heh well especially now since I might end up being the only developer, DBA, sysadmin and billing person if my coworker leaves…

If I set a timestamp column to current for ON UPDATE, will it be set when the row is first entered? I'd like a "entered" timestamp, and a "last_updated" timestamp.
It seems that I can only have one timestamp column with any kind of CURRENT_TIMESTAMP set

just make the "entered" column a datetime type and insert NOW(). Then the "last updated" column can be a timestamp column

i like triggers

anyone who speak spanish?

try #mysql-es

thanks jbalint

hey guys, why would you use mysqld_safe instead of mysql
?
safe_mysqld vs. mysqld rather.

hey guys… when i clear the mysql.log file (that logs sql query(s)) do i have to restart the server??

wtf, this SQL server is pegged at like 100% CPU, but a 'SHOW FULL PROCESSLIST;' simply shows a lot of sleeping processes.

that's because they're snoring very loudly

Oh hey, that was pretty good.
Well, I just bounced mysqld, and usage went down

maybe it was a lot of very quick queries. When I'm parsing XML and doing massive inserts I rarely catch a query in the process list even though it is inserting 2,000 records per second

Ahh.
I've never had a problem with this particular server. It's a backend for a Postfix mail server, which rarely sees that kind of usage.

good morning

'morning.

too early to tell if it is good yet

well - I wish you all a good morning, I am not sure wether it will be good

Happy yesterday!

Hello

could it be that snmp traps in the dashboard version 1.2 is currently broken?
(okay, the enterprise website too…)

Whats an easy query to duplicate a row in a table, only creating a new unique ID (autoincrement) and timestamp?

hello everyone

is there an easy way to copy one structure of a database to another ?

mysqldump

–no-data
if you only want the structure, not the data itself

hello ?

good morning

is it possible to grant two passwords for the same user?
GRANT USAGE ON *.* TO `user`@`%.domain.com` IDENTIFIED BY 'password',`user`@`%.domain.com` IDENTIFIED BY 'password2',

i dont think there is but i could be wrong

Zap-W: No
Hmm…
Try it and let us know

well it didnt work for me , it took the password from the second one ,`user`@`%.domain.com` IDENTIFIED BY 'password2',

Zap-W: it is treated as a 2nd user with the same priv, overwrites the 1st in this case

Zap-W: As kimseong says in MySQL world user1@host1 and user1@host2 are completely different users

i am set GRANT Insert,Update and i only see Update in columns_priv

hi guys, my feeble mind is giving me problems again i'm trying to construct a select query that would return me a list of 201 people where i have the 'person' i search for as number 100. So basically.. i want the 100 over him, and the 100 after him (ranked by a score)

UNION will help you

4 |
update user set gecos='Hey Hey' where User='sad';
UPDATE command denied to user 'nss-root1'@'localhost' for table 'user'
lol users
never mind

Where can I find a list of all the commands understood by mysql_real_query?
uWhere can I find a list of all the commands understood by mysql_real_query?/u

alguem fala portugues???????

mysql_real_query is a function. It does not understand commands
mysql_real_query sends SQL statement to MySQL server and gets back the result and errors if any

it unterstands "SELECT" to "CREATE"

Which are not commands

Okay, I need the list of SQL statements and the parameters/syntax for them.

dev.mysql.com has the manual

The list is very small actually

What's the latest stable MySQL version?

hello, trying to get a dump of a database that is guaranteed to be consistent withing a database. atm I'm doing "–complete-insert –lock-tables –add-locks –flush-logs" with mysqldump but that doesn't guarantee anything. also mysqlhotcopy according to the manpage does only table locks. so
does anyone have a tool to get a consistent dump of a mysql myisam database?

or if you are more hard-core, check the sql/sql_yacc.yy

However SQL is a language with more than 30 years history You can hardly learn all about it from a single list

dev.mysql.com has that info too

there isn't such a thing SQL being a standard that is usable on different servers is an urban legend…
bthere isn't such a thing SQL being a standard that is usable on different servers is an urban legend…/b

ninguem fala espanhol???

try #mysql-es or #mysql.es

xau

!spanisch

is a row cell limit the 64 characters?
*limited to

depends on the column type
look it up at mysql.com/doc

kk, ty

ok, anyone has some pointer to backup a myisam database in a consistent state on a live server? i looked thru the docs and it seems that only single tables are guaranteed to be consistent and there is no way of getting a consistent database wide dump

Hey all. I have a question about caching in MySQL databases.

ekimus, change to innodb for a start

I'm running a script that used to take about 4 seconds to process each row, but now each query is taking so long that it takes 20 seconds per row. But when I run the script a second time on those rows go by lightening quick. I'm assuming it's because they are now cached.
Is there anyway to speed things up or force certain things into the cache?

do I read that I'm right with my above assumption? and the only way is to switch do innodb?

eyeRmonkey, first find why its slow in the first place use explain
ekimus, myisam does not have transactions

Alright. I did the explain. It didn't really tell me anything I didn't know already. What am I looking for?
1 PRIMARY albums_serialized ALL NULL NULL NULL NULL 90969 Using where 2 DEPENDENT SUBQUERY multidiscs ref PRIMARY PRIMARY 242 func 1 Using where; Using index

use of indexes

morning

which it isnt

the subquery is
i suppose there's probably a way to optimize it

i know that, but I'm not quite sure if that means that i can't do a consistent database backup. (while the server is online)

let me show you the query:

pastebin

try http://pastebin.ca or http://pastebin.mysql-es.org

http://eyermonkey.pastebin.com/m4bcd9a41
albums_serialized is the main table and blz_id is the primary id. multidiscs is a helper table with no keys or indexes
wait. i take that back. multidiscs does have a primary key. It's the "primary_disc_id" column

Hi, can i ask a question releated to Access and SQL

go ahead.

!tell eyeRmonkey about a not in b

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

is it necessary to have the table names be infront of the column names like that?

i have a tblUser, and a form with a text feild. i am using Environ("username") to get the NT username

no but helps to make it obvious what it means

actually its a combo and not text
so how can i make the combo name display the user name

what kanguage are you using to connect to the DB
language *

*oh, because NT username is usally jtim, if the user realy name is Jim Tim, so i build a function that will check the username and match it to the real name
i am using SQL

thats not a lanuguage to connect to the DB
the Combo box is in Html yes ?

It sounds likes C# or VB.NET
Does anyone know how to list mysql process on windows and kill a specific one that is taking too long?

SHOW PROCESSLIST;

alright. I changed my query. Unfourtunately, it's still going really slow. It went really fast up to the point where I last stopped it. I'm guessing that's becaused those results were all cached. Any other ideas for optimizing it?

well currently its scanning 90K plus records that needs to be stopped

was that directed at me?
oh yea. i guess it is.
i think that was a bad estimate though. it only has 20k
and i kill the processes everytime i stop and start it
Wow. Alright. I found the problem, but this leads me to a new question.
For every row I grabbed form the primary table, I did some processing, then did this query:
SELECT * FROM albums_serialized WHERE blz_id IN (SELECT secondary_disc_id FROM multidiscs WHERE primary_disc_id='blah';

dont quote numbers if primary_disc_id is a number

it's not. but thanks.
the first query I showed you on pastebin grabbed the "primary disc" using the multidiscs table as a reference. This query grabs all the secondary discs. When i commented out this query, every row was processed in a fraction of a second.
So this is obviously what was slowing things down
is there a way I could use a join to get all of them at once?

likely yes

http://eyermonkey.pastebin.com/m5e9b2eba

and likely a lot faster if the correct indexes are in place

if you need me to explain the columns purposes, let me know.
join
I'm reading the manual on joins again so I can try to understand them.

eyeRmonkey is the is a mysql for windows???

Yes.
Do you mean is mysql available for windows? Or were you asking if I was using it on windows?

eyeRmonkey i was asking if there is a mysql for windows
links

http://dev.mysql.com/doc/refman/5.0/en/windows-installation.html

thanks

There is MySQL for windows for almost a decade
Actually more than decade. Since MySQL 3.12
3.21

do you have any idea what i should look into to combine those two queries?

salle thats good, but i only start working with SQL 3 days ago

Welcome to the exciting world of SQL then

and by exciting you of course mean chaotic and senseless.

I see nothign chaotic with it.

i'm kidding.

just remember sql is 'declarative' you declare what you want and not how

It's a language derived straight from the relational algebra and when you derive somethign from pure mathematics the definition of chaos is not what it is in everyday life

Haha
you have a very good point. It took me a while to get used to that. I still am as a matter of fact.
Would anyone be able to help me combine these two queries into one?
http://eyermonkey.pastebin.com/m5e9b2eba

sql sometimes is easier to a person who do not do sturctured programming

Why not UNION?
I'd say always
Some mathematical background helps a lot while experience with procedural languages acutally makes thigns more complicated

Would that off a speed increase from doing two separate queries? The way it is structured it seems like there MIGHT be a more elegant way.

Ask EXPLAIN

Hehe. Will do.

I would rewrite the second one to JOIN. There's no need for subquery there

A left join or a normal join? I'm no good with them.

mysql 4.1 manual, rewriting subquery as join

Instead of SELECT .. FROM a WHERE id IN (SELECT id FROM b); use SELECT .. FROM a, b WHERE a.id = b.id;

http://dev.mysql.com/doc/refman/5.0/en/rewriting-subqueries.html
I didn't think they would have a whole manual page just for that.

historical reason, before 4.1 no subquery

that's a good point.

And then you will see you can combine both where clause into single one with OR
We had that manual page long before MySQL 4.1

I bet. I just recently realized how amazing IRC rooms are for getting help. I really appreciate all the help you guys offer.
And you have a good point. And OR would do it. No need to make things complicated. Haha.

hehe irc rulez nearly as much as google for help

If not more so

better acuracy

and no doubt someone has allways encountered the problem before

yep

half the time on google its knowing the correct syntax to ask it
yay just stripped a 67 meg db into an 11meg one

Very true. I'm surprised when I see some of my nerdy friends typing horrible search queries.

just with some better storing methods

Jester-|: enlighten us.

the original had about 36 tables in it, i stripped that into 8

Jeeze.

and got rid of some shit data and cleaned up the structure
was a mess
while at the same time im 75% through writing a webOS for my companies database … i smell a payrise coming for me

you said this: Instead of SELECT .. FROM a WHERE id IN (SELECT id FROM b); use SELECT .. FROM a, b WHERE a.id = b.id
Instead of SELECT .. FROM a WHERE id IN (SELECT id FROM b WHERE b.id='blah');

I preffer select

as opposed to?

select … from a join b on a.id=b.id
both those alternatives

where a.id=b.id
short and sweet

So do I use the ON and WHERE clause or just one or the other?

on is easier for the syntax when having a real condition
you only need one of them

I read in the manual that you should use WHERE in most cases
http://dev.mysql.com/doc/refman/4.1/en/join.html
3rd paragraph

iirc u can select where AS then choose b.is=what.the.as.was
but i could be wrong again

imo, the on syntax is much easier to read if you have real condtions

The join you guys are suggsting just isn't clicking in my mind. I have more than one condition that i'm trying to satisfy.
SELECT * FROM albums_serialized LEFT JOIN WHERE blz_id IN (SELECT secondary_disc_id FROM multidiscs WHERE primary_disc_id=$blz_id_escaped)
SELECT albums_serialized.* FROM albums_serialized JOIN multidiscs ON albums_serialized.blz_id=multidiscs.secondary_disc_id

you are omiting the left join

Why yes I am. Haha.
But it still seems like something is missing.

you know, I have a simple rule for query design

what's that?

designate one, and only one, table who's rows is the main table
the other tables are just there to add info to it
but this one is the core one
for this particular query
say we got a web forum and are getting the posts in a topic. the posts table is the main table then

Alright
SQL is the hardest thing I've ever had to learn. I think it's because I'm so used to doing things procedurally. I've been reading the hashmysql.org page on JOINs for 10 minutes and i'm barely grasping it

Join helps you to understand things in depth. On top of that joins are usually better optimized
Better find a book about mathematical theory of sets

I took discrate mathematics last year in college

Tables in relational model are defined as sets. All operation on them are set operations. Things like intersections, joins etc. even "empty set" come straight from there

I just feel like none of the syntax or keywords are all that intuitive for all the work that is going on behind the scenes

eyeRmonkey, you won't get anything until you do tutorials… once you see how it works it's so easy

I've done tutorials. And I can do basic selects and inserts (after some practice). Everything else is still foreign to me.

I usualy recommend sqlcourse.com for starters …

one you see joins.. it's easy
eyeRmonkey, I guarantee reading up on Normalization will tie joins together in your mind

Think of WHERE clause as "find subset of a set" and inner join which is simplest join as "find intersection between two (or more) sets"

I actually understand normallization pretty well (or at least I think I do). It's the SQL that is the problem, not the design of databases

b.id

or is that not even possible?

Who says it is better?
Who says they do the same?

I made it up. So… Maybe they don't?

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

It's kind of strange you say you don't understand SQL well, but you play with outer joins

Play is the key word. I have no idea what I'm doing. You guys said to use joins…. So I am.

hehe

how do I change from myisam to innodb and what are the effects going to be on existing database?
bhow do I change from myisam to innodb and what are the effects going to be on existing database?/b

is it possible to make incremental backups of mysql's database by using mysqdump?

can you split the question please ?
if you split it, you will get a yes and a no

ALTER and there are too many effects that it will take full week course to discuss them

weigon, yes, here we go
I have some databases very big and I was looking for a way to backup only the table's register that are modified from a day to other and not the complete database every night
is that possible by using mysqldump?

mysqldump is for "dumps" aka full backups
for incremental backups check out the binlogs

binglogs? but even so the incremental backups should be done by block or files and not under the mysql's engine?
What usually people do when they have a 30GB database for example. They cannot save the complete one each night

replication to alive backup

archivist, but replication does not involve backup, it is just a replication
you mean people usually use replication and they don't do backup of the database

1 its a live backup and 2 you can backup the slave

With replication you can have full live copy of the data at second server
With some lag indeed because the replication is asynchronous

yes I kno what you mean

Could someone tell me if these two queries are anywhere near being identical:
http://eyermonkey.pastebin.com/m40136e6f
Well… It seems they are the same. Cool.
The queries still take 20 seconds, though.

hi all - is it standard practice to name which fields are to be inserted into on a sql insert. I used to think it was unnessary but then thought if more fields are added later then it means adjusting each php page which has an insert where as if the fields are mentioned then field additions dont
alter anything unless they are compulsary field additions

so use explai and check for index use
explain

live by explain, die by explain

nickthorley, yes it is goog practice to name columns for insert

thanks

should I create an index for all my columns to speed things up?

no only needed columns

so only columns that might be involved in a condition of a query?

yes match indexes to queries

nickthorley, it is also possible to change the column order with an ALTER TABLE, and then a positional insert will fail

and select * then fails …..

it is unlikely i will need to change order of cols but may need to add a field and without having fields identified on insert then i would need to adjust each page with an insert where as naming i wouldnt so that sounds good to me

Sounds good. Do I ever need do anything with indexs in my query, or will they handle themselves after I set them?

99% handle themselves

And I don't need to set an index for something that is already a primary key, correct?

make that 99.99%
yes

Sigh. I added an index to the secondary_disc_id column and it still took 20 seconds. Is there any flush or something that I need to do after adding the index?

hi to all
create view test as select foo.time_id from (select time_id from dim_time where time_id10) as foo;
is the statement is correct or not?

eyeRmonkey, no need they get built automaticaly

no. FROM specifies a table. You are giving it a subquery which will just return rows
but then again. i have no idea what i'm doing. so i might be wrong.

SELECT … FROM (SELECT ..) is quite correct

salle, yes its working in postgresql

Nothing wrong with it. It's another question if it's necessary

yeah. I started to remember that right after I said it. I'll let you guys give the advice for now.

Why do you need subquery there?
No point.
Yours is like SELECT 1 FROM (SELECT 1)

its just a sample

("PRIMARY" must be the name of and only of a primary key!)
I have a column named "primary_disc_id" but it is not a primary key. is that why i'm getting that warning?

cant have two primary keys

so i can use the sub query on the view at the from clause right?

I know. I'm not. It's just the name I chose
primary means it's "disc 1" of a set. secondary means its its "disc 2, 3, …"

Welcome back to the theory

Hi

Primary Key is important concept there

how to load fast text file to mysql with tab delimited columns ?

If you think it's just kind of index you are wrong.

any loader for ascii files ?

!man LOAD DATA

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

!m mashuuk LOAD DATA

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

again. Primary key I understand. SQL, I don't. Ha.

What is your definition of Primary Key then?

salle, whats the opposite of that LOAD DATA command?

Hi, I'm trying to construct a select query with the UNION clause, but is there a way to refer to a result from the first select, in the second select?

!man export data

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

SELECT … INTO OUTFILE

ahh
gotcha

PRIMARY KEY(id).

thanks

Thumann, a self join

the_wench, thx

not a union

If you care to open the load data page of the manual you will see it there too

the_wench, is the first column PRIMARY KEY ?
the_wench, after loading ?

The definition of a car engine is not "it revolves"
Better read the page please.
It will tell you LOAD DATA will not create the table for you

what i'm trying to do is, to get a list of 200 rows, where #100 is the input of the query, as in.. i want a list of people where i have the 100 above me and the 100 after me (99) based on a score rank

it's a column where no value can appear twice and it's optimized for lookups. as things are inserted, they are put in a sorted order so they can be found with quick search techniques (like binary search) later on.
correct?

Close, but that also defines UNIQUE KEY

salle, LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table

I knew you were going to say that! Haha. So what else makes it special?

PK value identifies the row. The theory dictates that every table must have PK even if it spans across entire row. In practice sometimes it's good to violate that indeed

here's what I have. http://eyermonkey.pastebin.com/m204e946f … should I change the name of the "primary_disc_id" column?
I see.

Why should you change it?

because of the word "primary" being in it. That's what phpMyAdmin was warning me about. I guess it was just being overly catious.
**cautious
Alright. Now that I have it as a join instead of a subquery, how would I combine these: http://eyermonkey.pastebin.com/m5c2887a

I have a database with a long list of (sometimes multiword) tags (14,000) which I am matching against a long list of posts (60,000) using MATCH() AGAINST() and a FULLTEXT index. At the moment I have to query to get the list of tags, and then run one SQL statement for each different tag as you
are not allowed to have non-constant AGAINST() clause - is that right? Is there a more efficient way of doing it? I am doing IN BOOLEAN MODE because I do not want, f

or example, "fish cakes" to match fish and/or cakes, but the phrase "fish cakes". Is there a more efficient way of doing this? (It currently takes around 300 seconds - as I do not do every post, just those that have been updated recently)

jeesus mate, that's one hell of a query

do your own search functions and indexes

archivist, how?

well heres my lookup www.arhivist.info/search/index.php/Sql

Wow! I'm so tired. It's 4AM here.
Salle, archivist, thanks very much for your help. I appreciate it a lot.

I'm so tired too. It's 2pm here …

12pm here

Well. See ya around. I'm sure I'll be back here quite often.
Night all.

It's addictive

Hehe. It is indeed.

is there a cure?

any pointers to my previous "question"

Hello
I have a normal PHP5 website connecting to a MySQL database. I'm uploading it to some Windows hosting - they say they allow PHP5 and MySQL, but I can't connect to the database they set up.
I think they are running MS SQL Server configured to allow MySQL access… how do I go about connecting?

http://us2.php.net/mysql_connect
?

select charater_name,character_score from ranking where character_name = 'Thumann'; would give me, my name and my score.. i need the query also to return the 100 people over me in score, and the 100 people below me in score.. so i get a list with 201 people

salle, why this doesnt work ? create table baza.table_o12_e2_pam20 (REAL index, DOUBLE PRECISION alignment_i, DOUBLE PRECISION kmer);

will need a selfjoin and maybe some other magic for that

flupps, the usual mysql_connect isn't working for me - I can see in cPanel that they have an 'ODBC Datasource' created with my database name, so I'm wondering if there are some different parameters

salle, what is type indefier for double in mysql?

use decimal
is there any patch available for mysql to create view with subqueries?

luckymurali_81, I need double precision
luckymurali_81, with floating point
Any help ?

mysql manual doesn't mention magic anywhere
hehe

FLOAT(7,4)
use float

Thumann, what about the UNION solution ?

gnari, hi

Any help
?
How to create table with floating point records ?
in columns ?

mashuuk, use float

well, how do i refer to the score of the input player in the two other selects?

lymeca, I want double

hi float and double are taking same ranges of value

create table table_o12_e2_pam20(index FLOAT, alignment_i FLOAT, kmeri FLOAT);
doesnt work

Doesn't work is not a helpful statement. Was there an error? Unexpected results? Does it sit on the couch all day eating all your cheetos and ignoring the classifieds? Be specific!

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 'FLOAT, alignment_i FLOAT, kmeri FLOAT)' at line 1

http://www.htmlite.com/mysql003.php

luckymurali_81, ok but this doesnt explain why my request doesnt work

paste your code in paste bin

with the error

Thumann, select * from (select id,score from scoretab where score (select score from scoretab where name='x' ) order by score desc LIMIT 100 UNION ALL select id,score from scoretab where score =(select score from scoretab where name='x') order by score LIMIT 101) as foo ORDER BY score

luckymurali_81, I already pasted it here

where?
gnari, hi

mashuuk, reserved word index

Thumann, possibly you need more parentheses in there
hi lucky

luckymurali_81, http://pastebin.com/d7a850ee

i have a doubt in your query for thumann
mashuk, index is a key word
change the column name to other
it will work
cant we optimize the query
its looking like beginers

Argh, how do you get a single value? A specific field in a specific record in a specific table?

phylo, select [col name] from table name where condition

what is condition?
that's pretty broad

condition to retrive the particular record

that's as far as I got :-(

ok thx
luckymurali_81, thx

ur always welcome

Anythign which can possibly evaluate to boolean TRUE can go to WHERE clause. Yes it is pretty broad

Sorry, it turns out it's become a question of how do I ensure my user will always have a RecordName field, but it's irrelevant to SQL.

i'll give it a shot
Incorrect useage of union and order by
http://www.pastebin.ca/652204

The proper form: (select * from xint order by id limit 1) union all (select * from xint order by id desc limit 1) order by id desc;

is there any way to know how the big are your databases without using a php script that goes to show databases and show tables?

Hm
how to set DOUBLE uninque
?
or as index?

and of course those sample selects inside each set of ()s can be complex. Feel free to add your subqueries within them.
uand of course those sample selects inside each set of ()s can be complex. Feel free to add your subqueries within them./u
Just like any other.
The most common form is: create table blah ( field double primary key );

Thumann, as i said, you have to add some parentheses . try http://www.pastebin.ca/652210

if using 5.0, you can query the INFORMATION_SCHEMA tables to get the sizes

I have been told that but they are older version

Actually, in your case you could have just moved the existing parentheses. You had plenty of them already… and you didn't need the outer select * from () …;

Xgc, I get duplicated entry error http://pastebin.com/d61c252dd

what's this! i need to spell column names correct aswell.. futile language

Just follow the proper form: () union all ();

sloooow learning curve for me

Xgc, while there are 186507 line begining with 0.1… and seq column is cuted off to one integer after point

Greetz. How do I add 14 days to the last field in the following WHERE statement? DATE_FORMAT(`created`, '%Y-%m-%d') = DATE_FORMAT(`timeout`, '%Y-%m-%d')
I would like the fetch all rows where `timeout` is exactly 14 days bigger than `created`

hmm.. http://www.pastebin.ca/652218

Show a full example of the behavior. Use the pastebin.

it's kinda useless with some many people with the same score.. hehe

Xgc, I gave You link
Xgc, http://pastebin.com/d61c252dd

select * from blah where timeout = date_add(created, interval 14 day); or something

I can't use that without a sample text file.
The input is important.

Thanks

and the input 'Molri' is nr. 130 on the list instead of 100 or so..

Xgc, input has 100mb

You can create a test input file that contains 2 or 3 lines to show the behavior.

Xgc, here it is http://cannibal.kaduk.net/~mateusz/input.txt

SELECT id,MATCH (titel,artikeltext) AGAINST ('Tutorial') FROM artikel;
this will order results by relevance. but how can I give out the relevance?

Xgc, ups
Xgc, I know where is the problem
Xgc, can primary key be a string ?

sure

Yes. varchar(n)

usernames make nice primary keys

ok thx

But they don't always make for efficient systems.

prompt?

they appeared to be simply sql scripts

source file.sql;

Xgc, i was wondering how to generate them.

select into outfile …;
mysqldump is the more common approach.

Comments

im looking to make a five star rating script but i dont want it to submit anything itll be on a form and when

Comments

« Previous entries · Next entries »