Archive for 2007

Fanook but if i have this class that ovverride equals and hashcode and implements Comparable but i want to create

regclass) – so when I insert record in the ordinary way and ommit that fieald in the insertion everything allright
but the JPA tells that it can’t insert such record

what annotations are associated with it

with that field?

yes, the @Id
what generation strategy, etc
come on, come on
copy/paste
something

how can i get a list of field names with JDBC and MySQL ?

resultsetmetadata

@Id @Column(name = “id”, nullable = false)

what else
no generation strategy?

nothing

jottinger, thanks

well, tell it the generation strategy is AUTO
or IDENTITY

jottinger, thanks… I’ll try

by telling it the generation strategy, you tell the container – the JPA engine – how to load and/or generate primary keys
but with nothing, it assumes YOU are assigning the primary keys manually

how to analyze serialized data (if i cannot read object from that file to Object)?

wasn’t last night fun :P
the collateral(sp?) damage

jottinger, it doesn’t helped
I’ve added @GeneratedValue(strategy=GenerationType.AUTO) – and it doesn’t helped

don’t use toplink

Setting GenerationType.IDENTITY – helped
WOW!!! I’ve made it!!!

don’t use toplink

thanks a lot to all of you!!!
why?

it’s evil
use hibernate jpa. you’ll be a lot better for it

meeper, why..
toplink essentials is free and is the RI and also in glassfish…

but the glassfish server supports toplink as the default
and this is the main reason

it’s underfeatured, unpredictable, and evil
hibernate jpa is fast, mature, and can do pretty much anything you ever need to do
toplink jpa was involved in the utah mining disaster

meeper, hibernate has a free version?

that’s not saying much
and hibernate is LGPL

are you using toplink?

no, I use hibernate

as I’ve understand the principles of the JPA – I need only change the persistence.xml to move to Hibernate ?

so what if hibernate is lgpl?
probably, if it’s still early in your project

Why did you ban me?

he keeps banning random people for fun
~pr3d4t0r–

pr3d4t0r has a karma level of 354, ColonelJ

holy ****

For fun and non profit ™

What happens to local variables when the method finishes? if they were registered in another class?

that’s a good question for the java documentation

is zipito_ using toplink? All I saw was that he was using JPA

ok I give up, I’m surrendering myself to the tutorials

_Kariem, make sense please.

yay Hello World!

jottinger, I’m using the JPA…

which implementation?

the variable goes away. Whether the object it refers to becomes eligable for GC or not depends on the overall state of the progra
m

but as I understand JPA is just the interface

“the JPA” is a specification, not an implementation

how do you register local variables in another class?

toplink

K

jottinger, ?

p”OK”
personally, I’ve had none of meeper’s hatred issues for toplink essentials
but then again, meeper’s thought processes are kind of odd to me in the first place

jottinger, you can tell that toplink – is something bad?
and I shouldn’t use it?

I haven’t had any problems with it, I prefer it to hibernate, although hibernate has a lot of features that are quite nice

I plan for the application server with about 500 to 700 simultaneous access

:$
When i was writing an example i found out the answer.

would the toplink produce the problem with that?

I don’t think any of that matters
it’s all if the JPA implementation works for you
the problem you had had absolutely nothing to do with toplink vs. hibernate

jottinger, I think so too

meeper just has something up his butt that’s rotating awfully fast

If you will some day write .Net applications use Hibernate, because of NHibernate the learning curve would be much better

and if you’re writing .net, you’re better off with ActiveRecord anyway

_Kariem, thanks but microsoft must die!

nah

. . .

Activerecord uses NHibernate

without MS, none of us would have home computers
does it? really?

MonoRail rocks!

But ActiveRecord is considered an Anti-Pattern

jottinger, well yes… but what are they doing now! They are monopolistic and trying to make own laws!

suddenly I see the Java channel filled with people loving the CaslteProject like me.

end of out of topic.

It couples persistance to the domain model.

*shrug* java’s alive and well

nah, let them contribute to the open source world before they die
unah, let them contribute to the open source world before they die /u
unah, let them contribute to the open source world before they die /u

would JPA allow to work with temporary tables ?

not normally, unless you *really* know what you’re doing

IMO C# syntax is more elgant than Java’s

ordinarily, assume no
one neat feature of the JVM is how easily it uses other languages
the CLR can do it too, obviously

imo, typoing “elegant” is highly ironic.

but the mindset of the Java world is far, far more open than that of MS

and don’t forget the DLR?

I want to store in the temporary table the real user-name store (not the database-web-connector login) and to use that value with mine dataaudit mechanism

“We can’t promise you fame, fortune, or even a job if you learn the Java programming language.”
right that’s it I’m leaving

…what?

neither c#

anyone using GWT on a mac?
and IDEA

he was just kidding
mele-: GWT on Windows with Eclipse 3.2 here

damn

what kind of person writes that?

Fucking mac is killing me

writes what

Exception in thread “main” java.lang.InternalError: Can’t start the AWT because Java was started on the first thread. Make sure StartOnFirstThread is not specified in your application’s Info.plist or on the command line

http://java.sun.com/docs/books/tutorial/getStarted/intro/changemylife.html
stupid stupid stupid
oh I didn’t read ahead
“requires less effort than other languages”

for the time that the tutorial was written? true

how old is it???

this article is made before ruby

but other languages learned just like java had learned up to that point

woah

you have a problem with IDEA / GWT configuration, since I’m working on Eclipse, I have no idea!
you have a problem with IDEA / GWT configuration, since I’m working on Eclipse, I have no idea!

sure it is

agrees with Woflborg!

but whats the question ?

ha

But what makes java better than c# and ruby is the will know design pattern it adapts.
patterns*

I need at least 5 people to tell me the tutorials are worth reading before I continue

Microsoft gets that patterns and make anti-patterns from them

“can we slap a new nametag on something that was called ‘perl’ ten years ago, and sold it as something fresh and new ?”

like Datasets

they’re definitely worth reading

Do you use GWT with Mac in Intellij?

1

mele-: no mac here

gr

I see you’ve met ML

intellij, yes; GWT, yes; macintosh, no

*g, d, rlh*

I’m fine on window

Dynamic languages beat strongly typed languages any day in MVC based project

window

projects*

windows grr
not mac
9.240 java[457] Apple AWT Java VM was loaded on first thread — can’t start

wtf is that

Thats my thoughts exactly

Well my VM works fine

the tutorials are worth reading, btw

2

the problem is with the IDE and not with GWT..
I can tell that atleast for sure.

I agree, but how do I correct it

one guess is version conflict. but why not Eclipse?

IDEA is far better
“You must create a second thread and call JNI_CreateJavaVM from that.”
ugh w-tf answer is that

I’m bored of waiting, I’m going to continue reading the tutorials

does jetbrains have a channel?

mele-: I dunno, I’m not i it if there is

ColonelJ What tutorials?

THE tutorials

bastards

to be more precise THE JAVA TUTORIALS

Good

which is about as precise as it’s going to get I’m afraid

you don’t need to get more precise than that
read them, you moron

I found a solution for my problem of mocking service classes without injecting them in my Domain objects.

realistically you don’t HAVE to read them but you’re a moron if you don’t

I’m reading I’m reading
(The alternative was reading the specs btw)

I will use a Service locator.

or SPI

SPI?

SPI, yes
~spi

I guess the factoid ‘how to use spinners’ might be appropriate:
jottinger, how to use spinners is http://java.sun.com/docs/books/tutorial/uiswing/components/spinner.html

bleah
look up the jar file spec

What is SPI?

service provider interface

he didn’t ban them for fun; this idiot was trolling.
he _KICKS_ for fun, get it straight.

Hi, I started to learn programming servlets and JSP, can someone tell in brief, when to use which?

~tell zendo about j2ee

zendo, for a tutorial on java ee see http://java.sun.com/javaee/5/docs/tutorial/doc/

learn them a little more, it’ll be sort of obvious

aha… ok, them, maybe I was a little impatient and curious
thanks

jottinger:Interesting

it’ll be really obvious, really early

~tell

Sorry, I’m case-sensitive. Use ‘tell’, not ‘Tell’.

JSP is for presentation, the servlet is the logic, I believe.

see if it works there

sorry I new with this, do you mean that sevlet can generate JSP page, and then JSP would be converted back to servlet and display HTML?
Or, JSP page generate HTML page, in which form calls servlet?

go read.

ok

JSP is for displaying the results (the HTML), the servlets are for the backend stuff.

keep reading. but in short, a jsp can be written like an html file with special tabs/syntax inserted throughout… it will be compiled to a servlet when accessed. Servlets can forward requests to it – hence performing logic in servlets and presentation in jsp
erm… forward is a poor choice of wording
dispatch, i suppose, is more appropriate

this is scary…the fact I know this yet can’t use em..

because you are a ##java addict

true
I picked up lil bits of information here and there

consider it a good thing. I hang out here and don’t know a lick of Swing.

ok, it’s obvious that I need to read on, but for now can you someone tell me is it, not on onlu possible but common, to use both servlet and jsp?

yes its possible… now go back to reading!! :P

aaaaah is it common?
in practice

typically yeah, although there are frameworks that have other ways of doing the same thing that are cleaner

how good is netbeans on a scale from 1 to 10?

struts, JFC?

yeah… but everything is based on servlets… so make sure you understand what is going on with them

thanks a lot

ColonelJ:a lot better than Visual studio

really?

yes

well that’s quite good then

one more question, why is PHP still more popular on server side processing than servlets/JSP?

I don’t know what you mean by a 10 though
more morons out there than anything else

I even have trouble finding Servlet/JSP hosting

you have a point

-1

that’s the real reason

Better refactoring, better Unit testing, faster, and the most valuable feature it is free.

I’m waiting for it to download

waiting for what to download?

NetBeans IDE

most valuable feature of what?

mac + idea–
fuck
plus gwt

of Netbeans

free isn’t a great feature for an IDE IMO

or whatever, hence php became popular for general purpose non-enterprisey stuff

lol

you tend to get your money’s worth

I have not try IDEA.

that’s a broad generalization, btw

IDEA is great, but this GWT plug-in on mac sucks

The best IDEs in java IDEA, Eclipse, Netbeans.

aha, so generally you say it’s because it’s easier not better in some sense

quick: what other IDEs are there?

JEdit
VIM
:x

depends on what your budget looks like

vim XD

notepad++

Java is free as much as I know, and soon it will be GPL-ed (not sure how much this is a smart move), is it really faster??

come on
ignore budget
java is faster than many environments, yes
come on, name editors for java

In my experiance Netbeans is faster than Visual studio.

yeah, and you can always torrent an illegal version anyway… So for an IDE really it’s a useless feature

yes, but _Kariem says PHP is faster, or I missunderstood

jedit!

an illegal version if IDEA? why?

what?

~language war

I guess the factoid ‘backwards compatibility’ might be appropriate:
the operative word in “backwards compatibility” is “backwards”!

uggh

no reason, just saying

itmight be faster at completely, totally trivial apps, I guess

~start an ide war

Netbeans kicks the living shit out of JBuilder!

esp. since jbuilder is dead

94%

kicking a dead horse
~start an ide war

Eclipse kicks the living shit out of Jedit!

stop handing them clues

so, to conclude, generally, PHP is in more use because its easier to learn and use?

pretty much

fuck IDEA is getting more complex man
and still broken with version 7.x

mele-: you’re on a mac, who cares

I know basically that’s what is going on.

zendo:Ruby on Rails is easier than PHP :P

Looks like I’ll use Eclipse

so who cares, you mac people are on your own

fuck

ok, that explains a lot, still, PHP doesn’t have as mush features as Java so it’s their loss )

RoR is pretty nice, esp for simpler apps

with everything.
Even the JDK

thanks guys, you really differ from folks on C++ channel (yes I’m also working with[switching] c++)

135.3 MB additional space would be needed to install the selected items.

C++ Rules

all right, I’m off

sigh

I haven’t even selected anything yet

hey guys how do i go about changing folder permissions to a single directory

On C drive, to extract the temp

I can always use IDEA to code and Eclipse to debug

nice IDEA ;]

the netbeans just spat out a messagebox full of random errors

So you buy IDEA to debug on eclipse.

that’s ok, but amount of egoism and impudent by people who know how to write “hello world” app is great

~start an idea war

I guess the factoid ‘backwards compatibility’ might be appropriate:
the operative word in “backwards compatibility” is “backwards”!

Thanks for answers, best regards, bye.

most of which involve swing

ColonelJ:like what?

~tell OR|M about fail

OR|M, http://img378.imageshack.us/img378/4934/failtx2.jpg

and does anyone know if when java creates a directory that if its under the user running the program or if it is it

I’ll take a screenshot

s own user?

is this possible to implement in JPA something like beforeInsert() trigger?

Yes there is interceptors, i think.

~tell javabot about fail

javabot, http://img378.imageshack.us/img378/4934/failtx2.jpg

:P

it is called EntityListener

EntityListener? thanks…

http://img292.imageshack.us/img292/6460/netbeansfailai3.png

http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/listeners.html

could you point me to the weblink with some instructions about that? ’cause sun.com containes too few information about it

this is from hibernate docs but it works with regular JPA

_Kariem, thanks

np

anyone know what user java uses to create new folders so i can get a grasp on permissions

keep the hibernate docs open

Jonty is playing with his bears again

i would hope it uses the permissions of the current user. applets are, of course, a whole other kettle of fish

and giggling maniacally

are they the www-data?

ColonelJ, http://www.netbeans.org/issues/show_bug.cgi?id=85361

because its a java class that would be doing the creation of directories but it would be running on a java application server

that wasn’t the error
And I’m not using Vista of course

This is Xp?

I lost track somewhere
I got the list of errors when I cancelled before starting the install

oh

well I do realize that the cancel button is an error in itself
uwell I do realize that the cancel button is an error in itself/u

hmmm, not sure how the appserver does it. it’s quite possible that it has its own user account

damnit
how could i go about changing the permissions of that folder then?
well i guess i wouldn’t have to do that….
hrmmm
no no i do

~tell YangYin about talking to oneself

YangYin, I have no idea what talking to oneself is.

chmod, if you’re on unix, some control/info panel on windows

yeah but how would i do that with my java program

I have to go, cya

bye and thx

you don’t. java’s file api can’t mess with local file permissions. maybe in java7

because if its going to create the folder that needs to be accessed by user www-data the permissions need to be changed
damn
i guess i could just run a command with java chmod’ing it
gotcha i wont talk to myself… just helps ya know

yeah, I do it to

hi

ahoy

talk like a pirate day is coming up!
….random fact

http://uploads.neowin.net/forum/post-218115-1188061969.jpg
yarr…

holy..

i’d hit it

you’re talking like it’s a chick..

you’re making that sound like a bad thing

Hi… I’ve created a class inside another class. Is it possible to access members of the primary class from methods of the sub-class?

if you create a class inside a class, it would mean a nested class
and not a subclass.

OR|M, sorry, I’m not familiar with the terms. I guess you are right.

you will write a new class that inherits from the primary class (you will call it as super class)
using the “extends” keywords
and inside it, you would automatically have access methods to the super class.
you can also have a nested class that inherits from the parent class.

Hm… I see what you mean, but my case is a bit more complicated… Let me explain.
It’s my first time I’m using GUI and threads

public class Foo{ public class Bar extends Foo { public Bar(){ this.FooMethod(); } } public void FooMethod(){ /**/ } }
add formatting ^ ^

I have to make a simple, multithreaded server
I’ve created the GUI and the threads
and know I want the threads to change some things in the GUI
know *
now **
(sorry)

ok, is this event-based, or will the changes happen based on what you read from the socket?

Fanook, just from the socket
Currently System.out.println is working

~tell JoKo about javadoc SwingUtilities.invokeLater(*)

JoKo, please see javax.swing.SwingUtilities.invokeLater(java.lang.Runnable): http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#invokeLater(java.lang.Runnable)

any changes to the gui MUST happen on the EDT. invokeLater will handle that for you
~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

Comments off

if a or b and i know that a will be false in most cases while b might be true in most cases Is it faster to do

i guess i’m just not seeing yet how two programs are using two different php.ini when i’m only using one php-cgi
yes

it has a netris tourniment! that’s hawt!

it’s the only webserver i have installed

any one know a good tutorial of print to parse html format into print or a sort better way or have multiple line that have html with print command…

freeshell.org is a site that will let you host web pages for a minimal fee…$1 USD, in fact.
Who installed phpbb?

i did

via apt?

no

so ive got to pay in order to use the service

Yes. $1

i downloaded the tarball and installed it myself… i’m using sqlite with phpbb
i’m the one that added pdo_sqlite to php.ini
and then it worked

I have no idea how you managed to tell PHP to use a different ini file without conciously understanding what you did
It’s possible that sqlite was also added to the *real* php.ini and that’s why it worked.

ok, i think i have enough info and see the root of the problem to investigate this further on my own now. there also some real linux people at my company that should be able to help me with this

why not just run your site on a different port until you decide what you’re going to do?

i mean.. i’m not a real secure linux web hosting person… didn’t mean to say you weren’t

what are you talking about? it doesnt matter what port my server listens do

In 5.2.3, is there any mechanism to mark a class and/or source file as deprecated, a la Java? I want to be able to remind people to use a new class without yet killing off the old one

yes it does, that’s the whole reason you’re using this idiot-frame-thing, isn’t it?

You could also use something like tinyurl/xrl to create a link to “http://yourdomain.com:non-port-80/…”

good night… thanks again for all your help

no. my ISP blocks port 80. It has nothing to do with my domain registration

i never said anything about Domain hosting registration

f00li5h is trying to make the point that you can just give people a link to “http://yourhost.com:8000/

Dyndns offers mywebhop server host for those that cant use port 80
and i am telling you that mywebhopserver will still forward a frame

but you don’t have to use that webhop thing, this is what i’m saying

Then use it.

The point is that you don’t NEED the webhop thing

you’re right, I don’t
well what do I do instead?

you give them the URL to your machine directly, with the correct port number

make a url with the port number in it

why don’t you just use your ip?

http://my-hostname.no-ip.com:83/

without dns crap.

’cause IP’s aren’t any good for name based vhosts

because I dont have a static IP
I use DynDNS

I doubt he

how do i get all the names of the column names in an RDBMS database with PHP

I have an ip address updater

’s anywhere near production…

i need help with this line of code
echo ‘a href=”‘ . $_SERVER['PHP_SELF'] .
‘?page=’.$page.’”Next Page!/a’;

What database hosting are you using?

i want $page to be $page + 1 but i dont know the syntax

yes, you do, but there is an A record somewhere, pointing to your webserver, isn’t there?

$page+1

mysql

yes, there is

?page=’ .($page+1) .” …
use that, with the port number on the end

if i try to reference a GET variable that doesnt exist, what will be returned

In 5.2.3, is there any mechanism to mark a class and/or source file as deprecated, a la Java? I want to be able to remind people to use a new class without yet killing off the old one

a notice

eh?

and you’ll get null back
it’ll raise a notice, and give you null

A notice will be generated, and null will be the value

okay

No

mywebhopserver IS the A-record

thank you that worked

it sure did

trigger_error(“Deprecated, foo.”)

You could do something like raise a user error in the constructor, I suppose, but there’s nothing inherent in the language for it
Man, I’m off my game tonight

thanks much; that’s what I was looking for

no, the one that points to your server, not theirs, yours. the server that belongs to you, what is it’s name?

When you sign up for DynDNS, you pick a hostname. What hostname did you choose?

my server name?
my hostname is c0denamemercury.com

So if Apache is on port 8080, http://c0denamemercury.com:8080/ is the direct URL to you

Destination URL is registred as WebHop host. You should use final target url instead.
thats what it tells me when I try to specify a port

*sigh* Turn *off* the WebHop host service.

ok all records have been deleted

Now set it up so that you have one A record which points directly to your dynamic IP

you mean a host record?

they might call it that

i made ‘redirect.c0denamemercury.com’

if it redirects to port 8080, you’re done.

how can I get the current page URL with php?

no because it has ‘Webhop Redirect URL:’

Look at a phpinfo() page

redirect failed

http://www.php.net/phpinfo ?
still fuzzy
$_SERVER["PHP_SELF"]

I don’t work for DynDNS, and I’ve exceeded my quota of nice for the day. The idea is that you make “c0denamemercury.com” point to your dynamic IP, and probably also “www.c0denamemercury.com”. You think tell people to get to your website by going to “http://c0denamemercury.com:8080“, or whatever port number is appropriate. How you do all of that within the scope of the dyndns tools, I can’t tell you, as I’ve never used their services.

warning, you are over quota.

try this: http://c0denamemercury.com/

ok
i don’t see an A record there

tiredness

redirect.c0denamemercury.com is the redirect

*headdesk*

*ineedaholiday*

not redirect, I mean hostname

redirect.c0denamemercury.com has no A record

I will try to create another host record

Go to www.whatismyip.com, get your IP address. Set c0denamemercury.com to resolve to that IP address. Turn everything else off.

perhaps it hasn’t propogated

it doesnt seem to give the option to directly resolve an dedicated ip hosting address

hey TML — I see things haven’t changed much.

it just allows you to create a new host
(fill in something here).c0denamemercury.com”
then it has “TTL:”
then it has “Service type:” which has A-record available
then “IP Address:”
then “Webhop:” with “Redirect URL” and it has a checkbox that allows you to cloak the page

try no-ip.com

and thats all thats here

you can add all manner of records, and there is no trickery

no, because I registered my dns with these people
unless theres a way to get around that

you registered your domain with them?

yes
c0denamemercury.com is registered

i’m sure you can re-delegate it, but i’m pretty sure that no-ip won’t host dns for free

re-delegate?

yes, make another dns server responsible for your domain

sod that, if they cant provide the proper service that they are supposed to, i want my money back

“Service Type: “
“A-record pointed to IP address”
Took me about 30 seconds to find

fine
its created

you could go on “who wants to be a milloinaire” fastest fingers first!

now how do I specify PORT 8080?
you see thats what i did initially, but I didnt see anyplace where you can specify a port

Click “Add New Host” under “Hostnames”

You DON’T specify port 8080

already done
I dont?

No, you don’t.

you mean i just have my server host listen on all ports?

No, you have your server listen on port 8080
And when someone wants to get to your website, they’ll go to http://Service Type:
err, http://codenamemerucry.com:8080/
Or whatever it is

but thats stupid, I wanted to hide the fact that they have to type port 8080

you could have apache do it, i think

No, you can’t.

but perhaps not if your on a shared host

why dont you just use port 80?

sure you can TML, just a simple Redirect

It’s blocked by the ISP

oh.

oh, ya, you are pretty much screwed

What f00li5h and I have been trying to explain for the past hour or so is how to stop trying to hide that fact.

this might be a whole can o worms, but why is it blocked?

Many ISPs block inbound port 80 connections

because they want more money

because they prob dont want people hosting website off their isp

Because they don’t want you serving webpages off of a residential account

I need some help with my php webhosting and SQL code

ah, thought this was a shared hosting hosting package sort of deal

is there anywhere I can post it so somebody could take a look?

!tell navets about pastebin
Are you trying to do pagination of data?

im not sure lol
http://hashphp.org/pastebin?pid=26771

fine

here is my code

I have www.c0denamemercury.com and c0denamemercury.com set up

the problem is that it posts all my entries in my database except the latest one
and when I try to post a new entry, it posts the one before it

and now I have to wait about an hour for my changes to affect the nameservers

such is the way of DNS

navets, that should show them all. Maybe paste the actual query you are using

you should be able to query their DNS servers directly to see that you’ve marked them up right though

how?

does anyone know of a non-sucktastic video playing web plygin things?

mplayerplugin?

i am sort of new to this, so how do I post my query?

what OS are you running, asks he knowingly

os x

thanks
open terminal, type dig c0denamemercury.com SOA

navets, before that you must of had a statement that was like mysql_query

the query is what you are assigning to $query for example $query = mysql_query(‘SELECT * FROM tablename’) or die(mysql_error());

where you set $result

it’ll give you a list under ; ANSWER SECTION, then pick one of those names, and do dig @ns2 c0denamemercury.com

oh ok one second

try a couple of different ones, since it may only be on one of them right now

what is @ns2?

it’s an @ sign, followed by one of the things that were listed in the ANSWER SECTION the first time

c0denamemercury.com. 3600 IN SOA . . 0 0 0 0 0
that was the answer

hrm?
oh, sorry, it’s in ADDITIONAL
those things are the name servers that are responsible for your IP
s/IP/name/

so wat do I type?
I dont know how to localhost into my server though
because I use a vhost

how do I call a website / url from php?

and I use a ‘default’ vhost to catch anything thats not supposed to go to any of the other hosts

karter you can redirect using header()

php.net/curl
that is if you need to make a request in background

cool.
how do i send email ( i don’t have mail / mailer program) using php?
i tried phpmailer, didn’t work, tried installing pear didn’t work

remote SMTP/IMAP classes, Im’ guessing.

regretfully, i’m on windows.

hrm?

then , use mail() , on windows, it sends email hosting using smtp anyway

dig is for querying dns servers, it doesn’t relate to your vhosts at all

mail() doesn’t seem to work. It keeps giving me errors.

what kind of errors?

Can some one point me to a clean example of laying out a page in frames/cells

im not worried about that, they will fix themselves later, I am talking about testing my website locally. localhost doesnt work for me
becuase if I localhost, it will go to the ‘default’ vhost
which contains nothing

one sec.

because, in the past ive had issues where you would type one web address for one vhost and it would take you to the OTHER website for the OTHER vhost

check php.ini settings, btw… http://php.net/manual/en/ref.mail.php#ini.smtp

let me give you a better example

class mail not found.

just make your host the default one then

lets say you have one vhost that resolves www.foo1.com and another that resolves www.foo2.com

and pear package for 5.2 does not seem to work.

I would type www.foo2.com and it would pull up the server directory for www.foo.com
very annoying

indeed

i am sure you can understand my frusturation. So, I was told to make a dummy vhost that would be the 1st vhost because the server always defaults to the 1st vhost in the list

ok guys sorry it took so loing

personally, I wish it didnt do this

here is all the code
http://hashphp.org/pastebin?pid=26772

wait, so the new address would be www.c0denamemercury.com:8080/login.php?

yes

it looks ugly, but it will have to do I suppose

you get used to it
if you want, you can use xurl or something like that ot use a tinyurl equivilant

any one have any ideas why its not posting correctly?

no its ok
I can always change the listening port to a smaller number
so it woulnt look so…clunky
my goal right now is to get the website to work properly

how do i get a file extension from a file

so, you have a webserver running, what’s the trouble?

huh? im talking about the actual webpages
the issues BEFORE we found out there were issues with frames

oh, right
the one where you haven’t written the site yet?

what is the command to reset apache again? i cant remember

apachectl
/etc/*.d/apach* restart

/etc/init.d/httpd restart

it’s not common on bsd boxen

/etc/rc.d/init.d/httpd restart
ohh bsd

who’d have rc.d and init.d?

I foud out what is messing up my code

what the hell??
no!

I just need somebody to tell me how to fix it

UGH

is it between your keyboard and chair?

westhost.. has rc.d/init.d/

f00li5h no the mouse is fine

hi

ok here’s the deal

i have to do a search in a variable who contains a cs file…

this line works properly

that’s an odd place for the mouse

$result = @mysql_query(‘SELECT id, name, email, site, date, body FROM Board ORDER BY id DESC’ /*LIMIT ‘ .$first. ‘,’ .$last*/);

!+@

[@] The PHP error control operator that suppresses errors (@foo()), see: http://php.net/operators.errorcontrol – Don’t use it. Think I’m wrong? Ask me about “GO”.

but if I uncomment the last part
it breaks

pastebin the code

ok

can someone give me a clue ?

!+clue
!+clues

One for $1, two for $5, three for $10, and our best value yet… Four for $20! While supplies last. Call now, operators are standing by! 1-900-CLUE4$

xd

you can only call that number from a blackberry

k here is the code
http://hashphp.org/pastebin?pid=26773

Elitists.

the bug only happens when i uncomment the part in $result
I think it may be a syntax issue

where?

It’s a conspiracy, I tell you.

and your point is?

UGH!
do you know what?
when I try to restart apache I get this error
no
this is a php error

ahhaha

can someone help me ?

check the sql syntax for LIMIT

what’s the problem?

k

i have to make a search script from a comma separated file…

Syntax error on line 112 of /Library/Apache2/conf/httpd.conf: Cannot load /Library/Apache2/modules/libphp5.so into server: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib\n Referenced from: /Library/Apache2/modules/libphp5.so\n Reason: image not found

but don’t know how to begin…

i had this error the LAST time

the values inside the file are comma seperated?

yes

php is not even located in that directory

but i asted the file into a variable, easier…
Laner Starblood,Raeraia Town,Guard,2440,4433,Syrtis
have 750 lines like that to search with a form

which string are you searching for

it depends on the user

ok…

you can search on name and/or class and/or realm…
name,location,job,xpos,zpos,realm
(it’s fotr a mmorpg)
what can i do?
i’m totally lost

are you only worried about exact matches..

no
the first thing i have to do is to have a variable which contains the lines matching with the keyword entered for name
the first thing i have to do is to have a variable which contains the lines matching with the keyword entered for name
what do i have to do ?

i like to move it – move it

hum

oh god, im using a 15inch screen at work, i cant belive how horrible it is

please…

UGH
nice time for my freaking server to break

what’s the script to query the lines which matches with the keyword?

ask in #your-httpd

that channel doesnt exist

grep

grep ?

preg_match

ok

you’re kidding me, right?

well someone appeared in there
no, it doesnt exist because it made me op
if it were registered i wouldnt have been made an op

thats me, just cause i wanted to check it up

and in my example how to apply it ?

which httpd are you running?

hi

oh you mean in console

apache/iis ?

can someone help me filling in my grep function ?

there is a number of ways to do it.. you can break up your text variable into an array

Gilbror,Montsognir City,Denizen,1008,1351,Alsius; this is an example of a line
i only have to search a variable in the first words before the first ,

ohh ok…

this would be Gilbror in this example
even if i search for bror or something like that ^_^

http://au.php.net/manual/en/function.preg-match.php

that looks like a line from a csv file

yeah

( it looks like you’re parsing a CSV file, would you like some help? )
|?

hihi

wel the csv is stored directly in my php file, in a variable

fgetcsv()

meow

$list_npc = “Gilbror,Montsognir City,Denizen,1008,1351,Alsius;*…”;
this is my csv

why inside the php code?

try something like $pattern = “#^(.*?)\,#”; and then get with index 1 the result but really depends on content of it. you can also explode by comma

because i prefer

.* is nearly always wrong in a regex

hm very difficult

if it is inside the php code you should use php webhosting array notation

/([^,]+)/g

euhm ok :s

if you can give me example that will not work..let me know. any source of this inspiration?

and thye keyword entered by the user is in a variable named keyword…

why not just explode() the string on “,” and then use strncmp() on the array element?
or use the PHPCSV class?

it works – but ungreedy pattern like yours are slower (says the documentation)

i search the esiest method..

well thats quite different from always wrong in regex.

do i have to use preg_match ?

just try it

ok
but hat’s the correct pattern ?

but it is “nearly always wrong”

you tell us..have you tried it

can try sometin i cant find

please, give me source with proof…maybe it is true..but just saying it…kind of..

/([^,]+)/g doesn’t contain my keyword

whyt f00li5h means that it is slower and can have unexspected side effect (it does not have in this case) – so it is better style use a greede and more exact pattern

k. and how f00li5h regexp is better than expload for example?
if you get a warning on g no such modifier..just drop it

it searches only to the first , with some data before it

My $_POST['varname'] seems to never loose it’s content after my browser has performed a post, it would be nice if the $_POST forgot it’s content/got undefined between non-post pages, how to do this?

hi, where can i find a nice manual on how to compile php with gd2 library (i need the imagerotate function)
SlimG2 don’t refresh after posting

nice

you need to do a greedy match (preg_match_all) for mine to work, and it can be easily extended to allow for some escape sequences
it’s best to use a pre-written csv paser though

of course
or in case you put in the php source – build da php data structure in code
send a location http header and redirect a new page

whats wrong with http://php.net/gd explanation

it should do that anyway
if you post from a form that resulted from a post, the values from the first post shouldn’t appear

jmut well i’ve done… almost that (on linux used sudo apt-get install php5-gd) and i have gdlib now, but can’t use imagerotate function

what do you get in phpinfo() on gd section

as i said, i have gd enabled
_but can’t use imagerotate function_
This function is only available if PHP is compiled with the bundled version of the GD library.’
that’s why i’m asking…

so you have GD Version 2+ and it says imagerotate function undefined ?!

yup
GD Support enabled
GD Version 2.0 or higher
php version 5.2.1

hm…mind to see ./configure setting strings `which php` | grep ./configure | sed s#”‘”#”"#g

how can i remove the last two characters from a string?

substr()

-bash: ./configure: No such file or directory
%)

thank you

uh ?! you put all line. try putting ./configure in quotes

from what dir?

whicever
whichever. matters not

do suh dir
such dir
ubuntu linux 7.04

strings `which php` | grep ./configure | sed s#”‘”#”"#g

is there any form of xml beautifier that one can use before outputting simplexml/dom generated xml without too much of a overhead?

jmut nothing outputed

which php gives any output?

/usr/bin/php

strings /usr/bin/php ?

omfg

is there anything robust for XPATH and DOM traversal (e.g. xml, xhtml, html) in PHP than SimpleXML? it breaks when the document is malformed or using invalid markup (instead of guessing and continuing to parse like most browsers do)

that was too much .

k. jst ctrl+c it

i have only… 1\10 of it, i think .

ok since you get some output..just grep the ‘./configure’ should be there..you are first person this does not work.

why would you want to beautify XML?

pmq___, if the document is invalid – then it’s invalid and cannot be parsed

corsair@Ubuntu:/usr/bin$ ./configure
-bash: ./configure: No such file or directory

in some cases it could be edited by a human too, its only when saving config files, its not a big deal.

pmq___, consider something like libtidy support to fix the broken xml first

oh… wait

well, surely you’d be reading the xml then writing it back?
won’t the xml generator be able to generate tasteful xml anyway?

hmmm
no output O.o

don’t think simplexml does any form of formatting.

i’m trying to parse myspace html–they do it on purpose to shake scrapers. modern browsers just make assumptions (e.g. left-open tags, invalid/non-existant attributes, attribute values not surrounded by double-quotes, etc.)

does it matter that i didn’t compile this version of php? i just installed LAMP

pmq___, I dont think they do it on purpose to shake scrapers, their just incompetant

but yeah in most cases should only be changing inner values not adding nodes etc, but it will add/remove nodes now and then so would be nice, not really important anyway.

maybe so

have you actually tried it?

yeah

pmq___, http://uk3.php.net/tidy – pass it through that first

I don’t know about this LAMP stuff..but should install plain php..should not matter. `which php` -version do you have cli php

pmq___, it’s designed for broken html/xml

jmut i’ve installed php5-cli

– familiar with HTMLTidy.

corsair@Ubuntu:/usr/bin$ `which php` -version
PHP 5.2.1 (cli) (built: Jul 17 2007 18:14:23)

not a bad idea. i’ll give it a try

`which php` # redundant

and?

should be in ones path

i just got a \n and can input some random text…

WOOOT IT WORKS
it now redirects 100% the way its supposed to
shall we continue with our previous conversation?
what does this mean anyway?

how can PHP connect to a daemon ? is there a pipe-like thingy ?

zap0, connect to a daemon?

connect to an IPC socket?

you can use unix sockets/shm ?

yeah
http://us.php.net/manual/en/ref.sockets.php

http://devhat.pastecode.com/38923

which bit?

something’s outputting text to the browser before the socket_start() call. don’t know what the first arguement on line 44’s about without seeing the code.

omg

you can use proc_open or just fopen to read/write a named pipe

i’ve got a hand-written imagerotate function…
god it looks ugly
http://wl.zapto.org:81/w/ab/captcha.php

f00li5h, does proc_open open an already running app? or does it open a new one?

it’ll run a new one

if(in_array($_SESSION['username'],$admin_users) && $check_version) {

i do not want to open a new one.

you’d have to arrange that the existing thing was listening on a socket before hand

hello everybody, what is the most optimized way to check if a string contains only number please ? any other way than matching it to /[0,9]*/ please ?

$check_version?

the part where you show me how to link html templates

/[0-9]*/ :P

meow
oh, the most simple way is to just include them

f00li5h, so a socket is the only way? what is this shm thingy ?

shm?

HarryR, mentioned it above.

algorythm afaik

is_numeric ?

unix sockets, i think that’s done with mkfifo

zap0, http://uk2.php.net/shmop and http://uk2.php.net/manual/en/ref.sem.php

thanks, i was using is_int …

what’s the value of $_SESSION['username']

Heh. Yay, door games.

I wish I could find the door I was playing in 1995 or so. Persistant RPG on a huge world map, Rolemaster-based combat

whee
I cant believe i fixed it

congrats

sweet

well actially it was a crap if block that didnt need to be there
so…i removed it

what’s this?

oh its part of my userlogin code

there was one BBS that had it locally, and it lasted a couple of months

it now properly links to badcreds.php
like its supposed to
but it now doesnt set the session properly

you shouldn’t get anything in your session if you’re not logged in

aye, but I see it here $_SESSION['logged_in'] = true;

you could just destroy the session after someone fails to login

no, whats happening is that I type in my admin username/password and nothing happens
I get sent back to the login screen

is this big code…can you show us simple snippet of it..just logic no html

what is the max string lenght for an array key name please ?

jmut is asking you to move crap into templates
i’d imagine there’s not a limit on it
I believe they’re C strings underneath

can’t imagine situation where it matters

I found the offending line
if(!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] == false) { header(“Location: login.php”); exit;} is not working properly

howso?

how do I echo the value of a variable?

strange factorisation design

echo $var

thanks f00li5h, what is a c string limit please ? more than 255 ?

I want to see if $_SESSION is being properly set

print_r($_SESSION);

var_dump($_SESSION)

I would really suggest you do it so it doesn’t matter. sounds weird

there is no limit on string size in C. the limit is whatever you malloc() for it.
or whatever you define the character array as. char c = f[999999999999999999999] etc.

thanks garrett__

well.. you’ve probably got a 64bit integer limit, but i don’t think that you have that much ram :P

c strings are terminated by null, so it’d be an integer limit, i’d imagine

ah ha!
it equals NULL
WHAT THE HELL?

does it really? var_export it

\o/

whats this [bool_return] value all about?

ignore it
if you pass in true there, var_export will return the string instead of printing it

another approach that will help you is write pseudo code…meaning no php at all. forget php.. just think of logic . customer comes in here…if not logged in goe ther…there check if logged in..if so…continue..if not log…check log etc etc. with simple words. Cause I think you miss the
workflow at some point

it equals NULL

it is null?

aye
its null
I cant explain why
it shouldnt be
at all

it would be null by default

but what I am saying is that it should be set to something when it goes to the Welcome page

what?

the sql database check for the username and password is working
because it would go to the badcreds screen (which doesnt exist yet)

yeah, but you’d update the session in login.php, wouldn’t you?

no

you should though

I update the session in logon_user.php

you shoudl do all your login related things in one script

login.php has no php in it

the error messages should be printed, above the login form in login.php

its just named php for consistancy

hello

what?
that makes no sense at all

logon_php is the actual php code that parses the username/password and removes all the excape chard and whatnot

no really. is it possible to put this in pastebin somewhere…. just delete username/pass for db access

why?

well thats the way im doing it!
grr

/msg php-bot guidelines

calling things that are not php .php is a bad idea

yeah, a moment
I dont mind
its going to have some php that resets your session if you go back to that page anyway

is there a way to troubleshoot a new php instalation via alog files or another mechanism?

so it WILL have some php

shouldn’t logout.php do that?

not yet though

login.php shouldn’t log you out

you mean besides phpinfo() ?

yes

yes, but you shouldnt be able to press the back button and be able to go back to the login screen, should you?

sure you should

if you press the back button, you get loged out of your session

don’t break the back button

and have to log back in again

cause i followed the instalation instructions and still phpinfo() .. nothing
where may i find a log file?

good day.

well thats the way I want it to work

or any indication that a module is loaded ?

what if i need some detail from before i logged into your site to play the game?

im using apache

i hit back a bundle of times to get to it, copy it from the page, and come back and have to log in again?

either that or send the user to a ’session expired’ page

no, just let the user stay logged in

is there a function to sort alphabetically but take into account umlouts for exampe a umlout is really ae so i would like a umlouts to appear sorted in the array aa ab ac ad ae (a umlout)

you’re convinced it’s him, why does using history log you out?

this isnt for just anyone to login
this is only for members of my programming team

what do you mean?

it needs high security
this is not a public site

high security, running on your home dsl box?

=\ why does opendir(‘/’) end up at the current directory

the plot thickens

does it?

well as high as I can get it

yes it does XD

perhaps it’s trimming the trailing slash

the level of security I give it would be enough

$dh = opendir(‘/’); how could that be trimmed at all?

don’t make login.php log you out

what does require() do?

ppl and their security conversations as if they have a clue

strip the trailing slash

I’m trying to decide about the best type of open source license to use for a new company.. Is there a channel relating to oo licenses or any suggestions on places to ask?

you get opendir(”); #which is a sensible analogy to open the cwd

$dh = opendir(‘/////////’); worked
+_+

trimming the trailing slash o_O

haha.thats a good one

what does require() do?
oops

groklaw, maybe

php.net/require

it includes it and dies if it fails

ok, just making sure

the site, that is. don’t know if there’s an irc channel
or maybe a gpl channel.. there’s probably one somewhere

hmm thanks.. I think the idea license type we want is, something like gpl v2 but with an added restriction saying for no commercial use

What i need to do to install zend on gentoo

you could make an ammendum to the gpl, i think…

lets install a google and a burger king while we’re at it

there’s a creative commons license which fits it, but pretty strange to release code under a cc from what I’ve seen

try an opensource channel or something.. if you can find one, they’d probably know

http://rafb.net/p/QZBtD979.html

someone’s probably been in the same situation before

thats my included config.php file

What i need to do to install zend on gentoo

?

what does $ss-check() do?

yeah, thanks garrett__

http://rafb.net/p/r9eynM42.html

hrm?

the function is in there

a fingerprint, interesting

ill have to change some stuff obviously, now youve seen it

#gentoo-php maybe

why’s that?
i can’t change the contents of the session

it was a joke :-(

oh, i see

hi

the normal joke in that situation is “now that you know i’ll have to kill you”

hehe

how can I get the name of the file where I am for example if I am in at http://www.domain.com/index.php” how can I get index.php

aye, I was hoping you’d deduce that
but my problem still remains

[bash]: $_SERVER[PHP_SELF] or __FILE__

$_SERVER['PHP_SELF'] or __FILE__ or one of the varianets.. don’t remember off hand

the session remains NULL for some reason

huh. jinx

the whole session?

aye

do you have a logging method (if not logging.apache.org) get the session class you have to log when it erases people’s minds^H^H^H^H^H sessions

unless theres a way to show whats in $_SESSION

var_export( $_SESSION )

i beg your pardon?
ok ill try it

hi

[bash]: f00li5h $_SERVER['PHP_SELF'] is not secure

i need help in finding the string in multi dimension array

Which string? oh that string. thanks for being clear!

$a[1]=array(‘a’,'b’,'c’);
$a[2]=array(‘d’,'e’,'f’)

for(){for(){if(stncmp(…))}}
is one way

nice identation. magic quote trick is not good enough. register_global stuff didn’t understand. just work as if off..always!. Debug mode set to 3…much faster to develop that way

UGH
see this is what I dont understand
it DOES create the session

also this script doesn’t help to spot the problem in no way.

but when it goes to welcome.php the session magically vanishes somehow

did you magically forgot to put session_start() in welcome.php

all your session crap should be in core.php

it doesnt need to be there if logon_user.php had it and then used a header(Location:welcome.php), right?
im NOT moving this code about

yes, it does need to be there

yes it does !!!

your way is clearly WRONG why would i tell you to move stuff for the fun of it?

header location is making a brand new request. and to access $_SESSION var you need session_start()

ill just include config.php

header(location — as jmut mentions

I think thats what I forgot to include

session_start() is not a configuration item, it shouldn’t be in config.php

anyone know why when I use str_replace(‘-’,”\\”, ‘2007-08-15′); it returns 2007\8\\15 ? I though it was suppose to return 20078\15

does it really return that?

haha thats a good one. where you read this?

or is that the result of some priting method you’re using?

it really does…

var_export the result of that str_replace

it works perfect here.. one slash.

blah nvm =_+

a triple slasher?

see, and now it works
looks like config.php needed to be included

and this is why you don’t want to be redirecting all the time

and this is why you should spend a week reading core php manual stuff…and don’t have such simple probs anymore….unless this is just a one time stuff and you are not really into php

no, even then you should read the docs
if you’re not into php, you should be out of it

yeah..but there are always good idiots like us in this instance…who will try assist till the end….even on how do I echo a var.

it’s true, some people don’t have anything better to do

hi

hmm now it doesnt work now

i overheard you talking about no-lifers

i dont know why it worked once but not noe

oh, hey

i’m just looking for reasons not to do any work

you’re about to run out of credits

i dont think “if(!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] == false) { header(“Location: login.php”); exit;} ” works

how does that not work?
if it’s not set, or it is false, redirect
that works.

http://php.pastebin.com/m6ac3c7a1

what’s wrong is that you’re not setting ‘logged_in’ in the right place

ok..you search for 33 for example..and what should be the result in this case?

does || in php quit after it finds one true?

yes, it short circuts

yes

i’ve never used that for or but all the time for and

mysql_connect(…) or die (…); # uses short circuting

i never use or like that either :P

oh

wow, i managed to put off doing anything for 10 minutes

a for loop, and in_array are all you need
perhaps you can refactor your data structure to be keyed by the values from the sub-arrays, containing the values of the keys in the other array

hi, can i use,,, array["arrayname"]; ? associative array in php?

that is an associative array

meow

purr

haha..

hm whats will all that moaning

you might want a $ there.

my partition stopped writing at 17mb free

sorry i am late
the result should be 1

the result of what?

k so use f00li5h suggestion

the result of search

f00li5h, can is i aks question now?

is there any one who know about editing video ( .3gp ) in php ?

LOL

you still there?

http://php.pastebin.com/m46ddffa7

nothingelz, i know….. its impractical.

yeah
sort of

can I query you?

sure

that sounds sexy

use FFmpeg

you can _query_ me anytime you want

is the only way

is it to can be for to and is an answer question to be time for me?

http://php.pastebin.com/d7e6d718

tnx , but’s too heavy !
i just want to add frame or maybe extract frame

ok whats with 4 digit years. what are we going to do at 31.12.9999 next day all is screwed?
ok whats with 4 digit years. what are we going to do at 31.12.9999 next day all is screwed?

jmut, lol

orite, our programs will still be used in 9999

i’m really worried about that actually
i mean, i’ll have been dead for 7 thousand years, but my svn repo may still be arround

is there any function to pass unix time stamp to regular date on the fly?

jmut, hexadecimal years, 31.12.270F

thanks

10001 clearly
it didn’t start as “0001″

logik-bomb, date(‘Y-m-d’, $timestamp);

10000 or such

logik-bomb, this fly that people speak of must be carrying alot by now.

thanks

how are you going to indicate that the years are in hex?

bleh why only 4
clearly it will increment

f00li5h, 0x then
f00li5h, 0×7D7-08-15

that’s 5 characters

it’s the 27th of January 0×38d2?

may as well do 10000 no

yeah

i need a holiday
:|

hi, one of my users wants cakephp. Will I have to do anything as the su to make it available for him?

you may need to allow him to change some apache directives, but otherwise, just stick the php libs somewhere he can read them
you’d need to actually do your own research or ask on #cakephp

any one know about connecting slite to php ?
sqlite*

does anyone knows how do I enable korean charsets on my computer? Thanks

you’d have to install the bindings and then interact with it via whatever api you use
you can only get sqllite3 for pdo, as far as I know

what do u mean by install ?
sqlite dosen’t have installing file
u could just copy it
i mean is there any library for using it in php
like delfsqlite
which use to accessing it in delphi

yes, i’m talking about installing the sqllite drivers, not the database itself

how can i match any string not containing a certiain word with regular expressions?
maybe not a php question tho, sorry

it’d be easier to not match it

well maybe im going about this the wrong way but i want to implement [quote]…[/quote] in a project on mine and nested quotes are giving me trouble

don’t do that
have the posts know which post they’re in reply to instead

well people arent just quoting posts tho

post 100 is a reply to post 83 which is a reply to post 33 etc

for bbcode use a bbcode parser like pear:bbcode

oh my gosh, ive searched for one of those

hello

thanks

hello

h at shared server , i can’t install driver ?

I need to generate a list of weeknumbers of an given year. Every entry should also have the start and enddates of those weeks. But I can’t think of a way to find all those weeknumbers. Anyone an idea?

your database will provide a date format that can give you year/week-of-year

week/ sunday-date , saturday-date

I don’t want to know it from 1 date. I want a list of all the weeks in a given year.

find first date then write it in sunday, then add 6 then friday then add 1 and sunday again
dont go over 31 thogh

and how do I find the first date?

umm, 1 to 52, is this a trick question?

00.00.00

and why not go over 31?

you find the year/week number from each membership, then you order by those
as you’re looping over, you produce a new week 31 type heading each time the week number changes, filling in the blanks if any are missing

yeah, most of the time it is 52 weeks. But some years do have 53 weeks (not a complete week) and how to find the start and end dates then?
what are you talking about memberships? I never said anything about a membership :p

you can ignore the partial week if there are no users in it, otherwise, you’ll have a row for that week, and the solution above will work
s/membership/record/

there must be a algorithm out there for doing that , im sure many physisists worked hard at it

I have a few hunderd entry’s every day. Also in the 53th week

well, then there won’t be a problem, will there?

I don’t think you understand everything . I just want to create a list of all the weeks in a year. And if I don’t have to use a database for this that would be great (don’t know why I should use a database since PHP has date funcions ). But HOW do I find the first week? in PHP I mean. I must
combine date(), mktime() and strtotime() or something, I think. I only can’t figure out how to combine them
I want to use that list to create an dropdownbox. And the week that is selected in the dropdown box is used in the database to select records between those 2 dates

hello

hi, anybody using eclipse for php development? Can I easily upload just the modified files using eclipse?

in the image functions of php is there no support for BMP images???

you really don’t need to have 2 dates, you can just say where date_format( ‘%week’, date ) = $selected_week and date_format(‘%year’, date) = $selected_year

check out phpthumb
it support BMP images

lots of people i work with use eclipse’s svn module. there’s probably an ftp option, too–try google

I use svn too but i cannot figure how to connect to the svn server from my web server and checkout since svn is not installed there

so try ftp or scp. there’s probably a module somewhere.

OK thanks

i’m sure you can snag the source, and complie the svn client on your webserver

he’d still need a script in eclipse to ssh to his webserver and issue an svn checkout command

well, actually I can but not usre if it worths it

though there is an ssh client for eclipse–or at least i think i’ve seen people using one

well, it’d mean you didn’t have to re-transfer the entire site when you want to update to a particular version

after installing php what to do?

write/install php scripts

why?

nothingelz but php
does not support bmp right?

what ?

php’s image functions

i don’t check
but i know

BMP (via ImageMagick or phpthumb.bmp.php) –

phpthumb support this format
and u could do anything u want with it

ok it’s only via image magick
nothingelz I don’t wan to use this

why ?

well, i assumed you installed it for a reason

yeh i think so too..

so do that thing with php

thx
this is a greast forum
great

nothingelz because I am just making a small function to put files in the server
and this phpthumb is huge

u could delete some function and files
and make it smaller

nothingelz not worth the trouble
do u know if there is a way to detect if my host supports image magick?

actually im not sure i installed php

just use it , if error occurred it dosen’t support or …

Hi! is it possible to use wildcards in file_exists func? and if yes, how? I mean something like: file_exists(myfil*) which should be true if there’s i file caled myfilesomethingelse.test

Acs, use phpinfo()
http://www.php.net/manual/en/function.glob.php

I am trying to use http://someip:13013/cgi-bin/sendsms?username=abc&password=abc&to=14047881723&text=Test

thx!

by using exec(http://someip:13013/cgi-bin/sendsms?username=abc&password=abc&to=14047881723&text=Test)
But this never executes..
Anyone with any idea?

Hey guys.. I think I’m just being stupid again, but I can’t get PHP 5.2 to work with Apache 2 .. are there some compatibility issues or something? It says it can’t load the module “d:/server/php/php5apache2.dll” into the server, although the directory is correct and the file
exists.

I had a problem like that too, try to redownload a package on the website
And
replace the dlls of the new package downloaded
with the one you have

K, I’ll try

When i tried to install php gtk, i had that, it said that php5.dll wasn’t here
same for php_pdo or so, so i redownloaded package, replaced dlls
and worked x_x

I’ve read on some forums just now that I’m not the only one with that problem.. but I couldn’t find a solution x.x

rza, huzzah

rawr

is there a know version of php that does work?

php 5.1 is good

php 5.2.3 rox

I have php fie with this line — exec(“http://someip:13013/cgi-bin/sendsms?username=abc&password=abc&to=14047881723&text=Test“)
But it never excutes.!
Any reasons?

blackhole, file_get_contents

are you sure you are not in safe mode ?

exec runs a program, a URL is not a program

have you read the manual for what exec actually does?

Qube, If i need to execute a URL what i need to do!

isn’t there passthru() func also? or..

Xn`: NO, also wrong

I just ask, dont use caps lol

can’t you run that script form the command line?
Xn`: percentaeg wise, there were hardly any caps

blackhole, I already told you the answer

is that someip the same server your script is runing on?

f00li5h, nope!

then eval(file_get_contents(url))

Xn`, you are a very dangerous guy

:d

blackhole, what does that file output?

Hello, could someone just quickly tell me how named backreferences should be written?

eh, he wants to execute it
!

eval(file_get_contents(url)) == pwned

(For a preg_replace that is)

Amenthes, Not it just executes…!

i used that as a backdoor actually ;x

Xn`: why would you want to eval it?

blackhole, you want yo execute something on another server by means of an url or what?

to execute it correctly, on the webserver i was running that on, without the eval() it wasn’t correctly working.

Amenthes, Yes you are right that url sends an sms to a number… I am using kannel!

blackhole, i dont understand what you want to “execute”

i’d suggest a wrapper arround the remote url with a shell script

blackhole or, just create a socket, and make a GET request

one that takes the number as an argument, and reads the message from STDIN

with your parameters
:O

f00li5h, I was thinking about using lynx!
lynx URL!

hi all

wget would be slightly less horrible
since it won’t try to spawn a console for you
meow

???

blackhole – I think you are trolling.
get working answer here, then go over to efnet and start asking the same question

Ok, I got it to work
But now I’m even more pissed off than I was before

Qube, What?

Does anyone know about named backreferences? The Interwebs don’t seem to have the answer.

I renamed the file, restarted apache, named it back, restarted again, now it works

i didn’t think that backreferences were named

I didn’t change anything..

i have a probleme with my site, some persons can access at phpinfo.php (browser konqueror) and other konqueror not work. have you a idea ? i dont have .htacces in my directory

s3project :-

sory for my english

haha french
;x

Thnx anyway for your help Xn

np 3

they can be. The syntax is *apparently* something like (?Pbackreferencename)

I guess i could do the same thing for my problem earlier

who told you that?

Although that doesn’t seem to work! It’s in the PHP documentation

http://www.regular-expressions.info/named.html

where?

Unfortunately that reference doesn’t work.

jeevesbond, sorry
jeevesbond, so it is a PCRE bug in PHP? i’ve never tested that

http://ca.php.net/manual/en/reference.pcre.pattern.syntax.php
I think it’s more likely that the documentation is missing information (or I’m doing something wrong!)

Since PHP 4.3.3, (?1), (?2) and so on can be used for recursive subpatterns too. It is also possible to use named subpatterns: (?Pfoo).?

Yes, that’s where I found that PHP can do what I need.

so it does not work in your script?

how do I get that to work with preg_replace?
That’s how to name the match, but how do I get that match out again when it does the replace?
http://www.pcre.org/pcre.txt but they’re for Perl and don’t seem to work in PHP. Oh, well it doesn’t matter, will find another way around the problem.

http://www.litfuel.net/tutorials/regex.htm

i just testet named patterns and it works (preg_match)

if (a or b). and i know that ‘a’ will be false in most cases while ‘b’ might be true in most cases. Is it faster to do: if (a or b) than doing: if (b or a)?? I mean because if i do: if (a or b) it will break in most cases after checking ‘a’ and BEFORE checking ‘b’. Is that right??

i guess he doesnt know the $matches['named_pattern'] thing

hi

testing preg_replace now

good one, haven’t tried that yet… Will do so now

php does

Comments off

Hey I have a fairly large and complicated MySQL database running a webapp Im building I want to build a diagram

Yes.

that’s the ‘characterisic’

well .. adding that worked

Basically the same result, except for that extra 21759 row in solution #2.

yeah.. i see.

i start my mysqld width –log-slow-queries
but i dont know ready a file with logs
in file have not the queries

it’s created but it gives an error that dbname.SUM is not a function

you have a space between SUM and ( ?

i changed it now, but i’m not sure
i think not
do I need to add a space?

you should not have one.

okay, can I remove the entry from the mysql.proc table?
(drop function [name] yiels “does not exist”

then it doesn’t exist.

hmm I see it in the mysql.proc table

Perhaps you spelled it wrong when issuing drop function.

i’ve added “_” in the names

wrap it in “ then.

okay
hmm still that SUM error
http://paste-it.net/2888

good evening

there is a space you see
good evening Syntux

take it out.

$^)
okay that works, .. only the result is NULL every time

take out the @ on line 32. That’s for something else.

can you run a query and have it output into a csv file?

yes. see the INTO OUTFILE option of the SELECT syntax.

Also, try SELECT … INTO local_var …; /* using the right type for local_var */ return local_var;

!man SELECT

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

roxlus, that is.

thanks snoyes!

so the @ is used as sql host var and not as “procedure” variables?

Right.
you can use @vars in procedures if you want to, but that’s not how function arguments get passed around.

does anyone know if innodb deadlock detection is an instantaneous operation, or is it a timed delay at all

okay! well it works now :-) !

innodb’s row level deadlock detection is instant
the table level deadlock is times
*timed

can I add a new “inner join” based on a certain field value?

As in, join a table sometimes but not others?

yes

probably not.

ah okay
I can probably solve it be changing the where

I’ve set up an ssh tunnel with ’ssh -L 3306:localhost:3306 ipaddy of server’, but I’ve read the man pages for ssh, and can’t figure out how to use this tunnel to allow mysql-admin to connect to the server on the colocated box. I got the impression

Ooooh, there is Coke in the fridge. What’s up with the keg fridge?

from the ssh man page that all I needed to do was point the mysql-admin to localhost with the login credentials for the mysql server on the remote host and I’d be able to log in.

On the “client” computer, where you run mysqladmin, connect to localhost
Yes

snoyes but I can change the “and field = otherfiedl” values based on a if, right?

yes
of course it could get very slow if you do

needs some work… if you have experience you could work on that project :-)

lol. No way! I won’t be here to enjoy it

-p -h localhost it works fine.

freight__, make sure you don’t try to use unix socket files instead of tcp sockets if you need a tcp connection
use the numerical ip if you want to avoid the file socket

Hrm, that may be it.. let me look.

what would I put at the ?? in http://paste-it.net/2889
line 30

and doesn’t mysql supprt ssl anyway?
just so you know, I belive the “inner” keyword is optional

I think change that whole thing to something like AND (r_date_from = s_date_end AND r_date_last = s_date_start OR sp_interval != ‘day’)

It looks cooler with INNER

that’s the spirit

Wow… this is harsh. I have a table with 2.99M rows, and I want to pick a random group of 10 out of there. I’m currently using something like “SELECT * FROM `links` ORDER BY RAND() LIMIT 10″, but understandably this is really, really slow.

rand

I’ve created three indexes, but that doesn’t seem to help a whole lot more.

order by rand

http://jan.kneschke.de/projects/mysql/order-by-rand/

Read that

I am ordering by rand?

!tell dan__t about order by rand

dan__t http://jan.kneschke.de/projects/mysql/order-by-rand/

is there a way I can do an update while I am doing a select? like I want it to update some rows but also want it to return those rows

the socket file would be ‘tcp’? I just read the manpage for mysql client and for mysql-admin (again), and it does not specify what the actual file name would be.

Ok, I see it now.
Very cool.

mysql -h 127.0.0.1

only if you wrap both statements in a stored procedure.

Run that, and tell us what happens

freight__, no, the socket file is like /var/mysql/socket

Ahah!

ok thanks

rather, /var/run/mysql

it’s configurable in any case
I can place it in /dev if I feel like it

Can’t connect to MySQL server on ‘127.0.0.1′ (111) I tried a few other things along the way, but kept getting the same response.
This may seem to be a ridiculous question, but I got the impression that /all/ activity on my local system that goes to port 3306 will now be forwarded to 3306 on the remote server, regardless of it’s source, yes? For all intents and purposes, port 3306 on localhost is port 3306 on the colo’ed
box.

I can solve it using this: http://paste-it.net/2890

Grr.. breaking my own rule.. about to smoke in the office..

seekwill, very cool, much faster, thanks for the tip.

0

As I don’t quite understand the entire query, I’m not sure as to how one would go about returning N results, not just 1.

strange thing is that when I describe my new table it says it allows nulls (YES) and the default is “NULL”

that’s possible with an autoincrement, yes
0 is null,

FAIAP?
0 wouldnt that indicate

it could, it could also be a bad value that was adjusted to the column default
depending on sql mode being used

0 I would think that would mean

hello everyone
i have alot of tables, is there a way I can describe all of them, rather than going into each one and typing describe table name;

0 defaults to null in time

tables.sql

or possibly SELECT the data you need from information_schema.

tables.sql; ncim is the name of my database

What’s the error message?

tables.sql’ at line 1

Remove the space.

mysqldump is a commandline utility

tables.sql”

oops there was no space when i retyped it i put a space

Hrm, netstat on the colo’ed box shows mysqld listening on a unix socket if I’m reading it correctly.. secure unix web hosting 2 [ ACC ] STREAM LISTENING 773119 /var/run/mysqld/mysqld.sock

It’s a shell command, not a mysql.exe command.

ooo

for the ssh tunnel to function properly, does it need to be listening on a tcp socket?

thanks guys!
usually 22 is for ssh

freight__ if ssh is not listening on a socket, there’s no way you can use it

how can I order my results by the reply which has move chars?

Make sure skip-networking is not in your my.cnf. If so, comment out, restart box
s/box/mysql

s/socket/port/

Funny. That probably be the whole reason why you don’t have remote access to begin with… now you won’t need the tunnel

http://paste-it.net/2891 is my my.cnf

Normally, if you’re using a tunnel, you’ll be port forwarding a connection from one host/port X to another host / port Y

when my query returns multiple rows is it still possible to create a function of it?

The socket will have nothing to do with this.

what would, the skip_networking? that was never there, and I’ve commented out the bind_address
ssh is up and listening, nice as can be.

X can be equal to Y, but that’s not required.
What is the symptom?

seekwill, I see how those queries that you had showed me work, however, I’m yet unable to adapt them to return to me 10 results.

Describe the details of the port forwarding you have.

Ok, here’s the skinny. I have a colo’ed box running mysql 5.0.4x. I’m trying to get remote clients to be able to log in to the mysql server. the port is open but filtered on the colo system.

SELECT id,link FROM links JOIN (SELECT CEIL(RAND() * (SELECT MAX(id) FROM links)) AS id) AS r2 USING (id);

What port is open?

the tunneling is something someone here suggested. Umm.. 22, 3306 among others, on the server.

and what filtering are you talking about, a firewall filter of some kind?

are you still there?

Yes, the colo host has filtred port 3306 via a firewall rule.

No. No. I didn’t ask about all the ports you have open. I’m asking about the specific ports associated with this tunnel.
If you don’t want to talk about the tunnel, what do you want to talk about?

3306 only.. the command I’m using is ’ssh -L 3306:localhost:3306 ipaddy of server

Perfect.
So now connections are forwarded to the server from this host that has access.

Ok, so if that’s perfect, when I try and run mysql-admin from my local system, I still get the “can’t login”.. umm the exact return is:.. one sec..
Can’t connect to local mysql server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

freight__ is that truly a socket ? “stat /var/run/mysqld/mysqld.sock”
it frequently gets displaced without any warning from your distro

Are you sure the colo allows port forwarding?

stat? I see no ’stat’ there. /var/run/mysqld/mysqld.sock
I don’t actually know.. there’s got to be some way I can access the bleeding mysql server remotely, n’est ce pas?

Also, your main problem is trying to use the local socket. Don’t do that. Use an address:port connection.

well have to go, but snoyes really thanks a lot!!!

“stat – display file or file system status”

-p -h address:port’?

mysql –host=localhost –port=3306 …

Kk, will try that.

If you don’t do that, mysql will attempt to access the local socket which has nothing to do with the tunnel.

same as before.

I don’t believe you.
The socket has nothing to do with this if you issue the proper command (with proper options/arguments)

Now, one of the questions I’m trying to answer, with the command ’ssh -L 3306:localhost:3306 ip_of_server’ run on my laptop here will tunnel all activitiy on port 3306 to the colocated system? i.e., if I run mysql-admin from another terminal?

mysql –host=localhost –port=3305 test; try that — it should result in an error.
That’s sets up a tunnel so that any connection to your local system will be forwarded to the remote colo server.
Any connection to that local port, that is.

same as all of the others.

You’re making a very fundamental mistake, but there’s no way to know what that is from here.

Want me to do a screen scrape and post it to pastebin?

You can’t possibly get that error.

or paste.it?

Sure.
rafb.net/paste is fine.
When you make a tcp connection directly to a specific port, that fact that there happens to be a unix domain socket or not is immaterial.

Hello. Anybody knows a good tool that can create an E/R kinda diagram from an existing MySQL database?

http://rafb.net/p/pA5nG143.html

TheGoldDIggah E/R ? as in.. Emergency Recovery ?

haha no

or is it possible you mean an Entity Relationship Diagram, also known as an ERD ?
and *only* as that

Entity Relationship
lol

I didn’t type a suggestion for you to ignore it completely.

normally its known as E/R diagram

well, no – the literature spells it ERD

and *only* as that

what did I ignore?

Go back to my comment and use the options exactly as typed.

:/var/run/mysqld$ mysql –host=localhost –port=3305 test;
Can’t connect to local mysql hosting server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

Sorry. You included more info than expected.

oh boy – I wonder how many times one man can repeat that line
freight__ IS THERE A SOCKET OR NOT ?

which mysql

*verify* this

Just show me that output.

what innodb_flush_method values do people use ?
and does it make much difference ?

/usr/bin/mysq

It’s almost as though your options are being ignored. It shouldn’t be trying to touch any socket.

life is too short

Ok, I’m a complete moron. how do I verify there’s a socket?

freight__ with the command I showed you half an hour ago – stat /path/to/supposed/socket

The only thing I can think of is your /usr/bin/mysql is a shell script that is ignoring –host and –port.

from my local system, or the remote server?
Hrm.. one sec.
:/var/run/mysqld$ file /usr/bin/mysql
/usr/bin/mysql: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.1, dynamically linked (uses shared libs), stripped

2.6.1 ??!?

This has (should have) *NOTHING* to do with your local mysql socket being there or not. It has (should have) *NOTHING* to do with the server hosting having or not listening to a unix domain socket.
Connections to a port do not require any listener on a socket.

like I said – verify if the socket the client is connecting to actually *exists*
or drop the socket idea altogether

why does this not work! http://pastie.caboo.se/79290
omg!

http://rafb.net/p/eGlXEN35.html
so, unless I get the colo host to drop the filter, I’m pretty much screwed?

freight__ you need the *socket*, not any kind of directory

whoops, sorry, wrong paste.

http://pastie.caboo.se/79290

solved! and I dinnet even look

If you read the introduction, you’ll see there are two mechanisms available for connections. Unix domain host sockets and direct host:port connections. One does not require the other.

although, strictly speaking, a listening TCP port *is* also known as a socket

If the colo is allowing you to create the tunnel and port forward or allows direct connections to port 3306, you’re fine.

http://rafb.net/p/qsh0nr16.html

0 Blocks: 0 IO Block: 4096 socket — so it does exist
now the client settings in my.cnf, btw is this a local client ?

You can also independently run a local mysql server, but it can’t be listening on port 3306 if you’re using that for the tunnel.

help – syntax error …. i must be doing something really basic wrong: http://pastie.caboo.se/79290

and it can be listening on a secure unix web hosting domain socket file. But that has nothing to do with the tunnel not to any direct port connections.
s/not/nor

iratiku you can keep adding words to your incomplete question, but how about we skip the next 5 steps and you just *ask* it, first ?

eH?

Any command line options should override your configuration files.

what is wrong with my syntax on the paste http://pastie.caboo.se/79290

ah – that’s a question
how do you know anythign is wrong with ti ?
*it

the error 1064 that comes back
i thought that was valid syntax .. i just can’t see anything wrong with it

error 1064?
!error 1064
hrm

Remoev the s.*

is there anything special needed to upgrade from 5.0.33 to 5.0.45?

You don’t want a column list in a delete.

http://pastie.caboo.se/79290

Also, you need some form of JOIN between those tables.
Maybe a comma is allowed too.

it is
but you’ll only get an inner join

read the documentation closer. You’re making simple mistakes you should have to ask about.
s/should/shouldn’t

eh?
http://pastie.caboo.se/79290

and it’s not suggested that you mix comma form of joins (which aren’t really joins) with JOIN syntax.

Ok, my brain’s fried.. time for a break. I’ll hammer on this later this evening.. thanks to everyone for their help, and I apologize for any frustration I’ve caused.. I really am reading the docs, btw. Peace all. See you later tonight.

comma form doesn’t use the on (…=…) clauses
comma form uses there where …=… format… i’m not using the comma form

I was commenting on your initial SQL, which had two tables, apparently that you intended to have a comma between.

no .. i missed a join word
its still erroring out ..i’ve implemented every change everyone has suggested

That’s WAS the point.
Remove the ORDER BY.
What version of MySQL is this?

i swear i’ve been able to do that before
delete the newest record … by using order and limit on delete

We don’t swear here, unless people are still using 4.0 or easlier.
earlier
select version();

5.0.22-Debian_0ubuntu6.06-log

Hello. Anybody knows a good tool that can create an E/R kinda diagram from an existing MySQL database?

Yes. delete with order by is supported.

then why did the query only work without the order by clause?

Bug?

of course

I’m not using that version. I can’t really test it. If you post the create table statements, someone else could test your SQL.
That’s usually a really quick/smart way to get verification.

yeah.. its always an options-
last resort for me
does anybody here want a job in missouri?

You know you’ve asked a erally smart question in a smart way if the answer comes without any further questions about what you really want or what your environment contains.
You know you’ve asked a erally smart question in a smart way if the answer comes without any further questions about what you really want or what your environment contains.
Are you running away?

no….. too overloaded with database crap to do
don’t have enough time to find answers .. to busy collecting issues

*smile* Thought you were trying to get a replacement.

no.. just exhausted

I see someone read the documentation for you. You must really be tired.

I just created a new set of system tables with mysql_install_db, and I can’t log into set the root password, even when I try the commands it gave me.. should I just go through the lost root password process, or is there an easier method

Ok. Still trying to think of a quick way to get N random results from a database hosting of 3M rows.
Anyone have any suggestions?

how can i set the value of one field for all records to 1?

UPDATE row=’1′
no WHERE

I don’t understand it.. I just reset the root password with the –init-file method, and I still get Access denied errors

with what command ?

uh, mysql -u root -P xxxx
er
mysql -u root -P xxxx -p

and you are surprised that doesn’t work ?
mysql cannot *set* a password where there is none
just run mysql

Any luck? Port forwarding worked well in XP to itself. I just forwarded 3316 to 3306 locally. ssh -L 3316:localhost:3306 localhost
Even windows can do it.

tried it without the -p, didn’t work either

devicenull look in my.cnf if any options are set there
if they are, remove them
and run mysql

Nothing that should stop me from logging in

how do you know ?

because, it’s just stuff that sets directories
datadir, etc

under the [client] header, obviously
not the server, it has nothing to do with this

[client] isn’t even there

sigh

fixed it.
ran with –skip-grant and did it that way

i have mysql set up on system running gentoo
from that machine i can connect with the mysql command line interface no problem…
but I can’t connect from a remote machine for some reason
is there a setting somewhere that I am unaware of?

yes, there is

why would this query be returnin 29 rows
SELECT * FROM mytable ORDER BY FieldID DESC LIMIT 85 90

remove skip-networking and/or bin-address from my.cnf and restart
*bind-address

where is my.cnf?
n/m

and you’re running Gentoo ? in /etc/mysql, of course

I know… dumb question
ok… skip-networking was already commented out
I commented out bind-address
ok… so now it’s denying me because my remote system’s ip is showing as part of the username and it’s denying that then
when i create the user… do I need to a wildcard or something?

yes

just *

user@%

?
hmm… I thougtht ath’s what i did
it says if you don’t use a hostname it default to %
oh well… ti works if I specify it

hi, im working in mysql promt, is how can i change from a db to another

hey guys
i enabled binary logging to set up replication, but haven’t fixed that yet.. however, i have run out of space on quite an important server, and it’s all the binary logs. Is there any way to purge them all?
can i just set the master status to off and remove them or something?
it’s quite important to me to get this done quickly, so i am asking at the same time as searching for answers using other mediums..

use db_name;

vice-versa, gracias, sabes si es que se puede restringir el acceso con mysqlbrowser?

English

vice-versa, sorry I forgot I was in this channel

np

i can’t flush the logs because the service is not running any more, and the only real space i can save is with these logfiles…

vice-versa, thank you, do you know if it is possible to “disallow”(not allow) the access by mysqlquerybrowser ?

put it this way. If i just remove this line from my.cnf ‘log-bin=mysql-bin’.. then remove the logfiles, and start the service.. will i break everything, or is it quite safe to do that?

no, authentication isn’t client centric

vice-versa, but the admin can do it?

hi. i need help with a trigger please.
mysql 5.0.33
the trigger creates a record in an audit table for every field that is updated.

mysql authentication is client host dependant, depends to how the user is setup

this works in test environment (5.0.37)
in production, if there are multiple fields updated, it will only write the first value. if there is only one field, sometimes it writes it, sometimes not.
also, increment is set up for replication, so it increments in 10s, instead of 1s

Can anyone help me with a query?

are you saying i should check my user permissions?

i don;t know the problem, but if can connect from 1 host but not another cold be the user account client host restriction

That almost certainly is it.
Unless the ISP of the host that can’t connect has certain ports blocked both ways or something on that computer is causing trouble.

hey can you timestamp a record on a read?

select now(),* from …

no, it can connect.
that’s not the problem.

Does the server say anything?

explain problem again since I don’t have earlier message when i just join

no, no errors.
well, i think i resolved it.

Heh.

had a table with a trigger on it.
the trigger only fired once.
upgraded the server to 5.0.45 and it’s working.
now.
now checking user permissions to see if i can remove any.

Can anyone help me with a query?

hi

kimseong, do you do any courier imap or pop3 installs?

?

just trying to find a way to track the last time an account was logged into

force an update

how can i cout number of rows that any field is repeating???

select never write anything

count sorry

select now(),* changes the timestamp?

count(distinct colname)
that returns the timestamp, won;t change anything in the table
select is read only

damn

Just add an update query.

kimseong, and in a inner join query where i have multiple rows ??
i need to count how many times col1 has fix value when col2 is changing
any sugest?

hi there, how do i achieve the same as installing a distro’s ‘mysql-devel’ package when compiling from source?

Hey. I have a fairly large and complicated MySQL database running a webapp I’m building. I want to build a diagram of some kind that outlines the structure, but it would take a fairly long time to do by hand. Does anyone know of any tools that will pick up foreign key relationships and the
like and build something useful?

7″ to
like formatdate(a.date, MM-DD-YYYY) would be nice

willrjmarshall: do the gui mysql tools from the official mysql site do that yet?

I don’t know. I didn’t even know there were official GUI tools

how do I log which user is logging into mysql and the results?

!m bahamat general query log

bahamat see http://dev.mysql.com/doc/refman/5.0/en/query-log.html

thanks
how can I turn up the verbosity?

i have a query “select count(val1), ….”; how can i order the recordset by row1??
can i define an alias for row1??
or do any as ORDER BY row1
??
can i order a count???
mm, i solved

is there any way I can make mysql tell me more of what is going on?

good evening

generally, at what ammount of rows in a table does mysql become slow?
without optimizations
except from primary key :x

There’s no single answer.

that’s not even a question.

It depends on your system, cache and buffer settings, etc.

can someone take a look at my query. http://www.pastebin.ca/622676 i keep getting right syntax to use near ” at line 1

right syntax or wrong syntax

you named a table #__fb_whoisonline ?

wrong
ya the #__ is replaced with a define but oh wait i bet i need to use “ for those

Can someone help me with a query?

i meant generally. at 1 million rows, 2 million rows?
where the selects really get to take 10 seconds

I meant, not possible to answer with the information given.

Hi, I’m trying to build a query with match against, but the columns needs to be qualified because i get an ambiguous error. Can I do this like: …MATCH (`Classified`.`title`,`Classified`.`body`) AGAINST….

I can take a system that runs query X in 20 minutes or (easily) more and change a single configuration parameter to reduce the query time to a few seconds.

it might help if you were to remove all the defines and php code and try the query at the console, then post any error message in their entirety.

yes was just doing that and found my issue i believe, will update soon as i know thanks so much.
yep found the error mistypes a column name hehe silly me, thanks

glad it worked out.

The behavior will also depend on many other factors, including the query itself, available indexes, the various ways you can partition the data,e tc.

do your own benchmark
and there is different definition of slow

Can someone help me with a query?

hey guys im looking for an alternative to phpmyadmin

SQLyog. I love it. Just my two cents.

I dont use half of its features anyway I just want to be able to create tables and check thier content etc

The number of rows might have almost no impact on the result at all if designed carefully.

joe_-, cool ill go look for it in ports
joe_-, thats a windows only thing

No its not
http://www.webyog.com/downloads/betas/MONyog/MONyog-0.16-1.i386.rpm

joe_-, according to its site:
ah

Oh sorry

im reading some forum

Nevermind. That’s MONyog.

Why this doesn’t work? …WHERE MATCH (`Classified`.`title`,`Classified`.`body`) AGAINST….

joe_-, I cant find anthing at all in freebsd ports

Sorry, I just assumed since you didn’t specify an OS

joe_-, im looking for an alternative in freebsd

error message?

Heh, command line?

joe_-, why would I use command line when I have Xorg running?

*shrug*
I do @ work usually.

I normally use phpmyadmin
but I moved over to lighttp for my default www server (this is only a laptop)
and as I work with perl/cgi just got rif of php altogether

Shame.

Can’t find FULLTEXT index matching the column list

joe_-, I class it as a sanity advantage

heh

you need a fulltext index to search with the same column

why does innodb seems to take up loads more CPU time than myisam ?

yes, those index separately exists, I can’t use them in conjunction

does anyone know how i can make the query logging more verbose so I can troubleshoot my ssl client connection?

you need a combined index

ohhh, I see…thanks

http://pastebin.ca/622611

joe_-: whats the problem

how can I do if I have to perform more than one update and I want to perform all of them or no one? I remember something about autocommit but I don’t know exactly… can somebody give me a clue, please?

multi table update if they re related, otherwise use transaction on transactional storage engine

kimseong, what’s a multi table update? I’m using InnoDB as engine… and I have some foreign keys for those tables that I want to update

innodb allows transactions, so you can do start transaction; all the updates; commit;

MySQL doesnt throw an error, just never completes. I wind up locking up the server before I get so much as a peep from the query.

joe_-: maybe it is processing

kimseong, ok thanks. And will it be a problem that I am using prepared statements?

joe_-: show processlist

Well, it’s taking too long It is processing but it needs to complete inside of, ~1000ms

should be fine
joe_-: try to EXPLAIN and optimise your query

I can only take EXPLAIN so far. I’m not that good at this stuff =/

kimseong, I think I got it. I’m using JSP… do you think that it will work if I set autocommit off, then I do my updates, and then I do the commit?

probably

kimseong, ok thanks a lot

as a test, do a rollback to make sure

kimseong, ok thank you

joe_-: you have 4 table join and a complicated maths operation, you expect to finish fast, better have a good optimised query or indexes

My other one, that doesn’t use the similar table finishes in roughly 700ms
Would I just be better off breaking the statement down into chunks and having PHP do all the heavy lifting?

Hi all. I need some help changing the root password for MySQL on OSX (bsd, linux-like), but I’m having some trouble following the online docs. Anyone know ‘nix well enough to help out?

Okay how about this one, that math operating returns a multiple rows for a single artist. What if I just want to get the row with the lowest result from that math operation for each individual artist?

mysqladmin: connect to server at ‘localhost’ failed
‘Can’t connect to local MySQL server through socket ‘/opt/local/var/run/mysql5/mysqld.sock’ (2)’
‘/opt/local/var/run/mysql5/mysqld.sock’ exists!

i’m converting an existing MyISAM database to InnoDB and creating foreign keys, however have just come across the following error:
1452 – Cannot add or update a child row: a foreign key constriant fails

joe_-: It can often help to post the create table statements for the tables involved. Also show the other SQL you refered to.
joe_-: and note the number of rows in each table.

Will do.

joe_-: Also post the explain plan for the bad behaving query.

http://pastebin.ca/622730 That’s the create tables for the ones in question.
http://pastebin.ca/622731 explain on query

joe_-: cartesian product, all ALL
foreign jey contraint violated
*key

It was working earlier today, then I added some indexes to try and speed it up and then this all happened. I’ve since removed those indexes in an attempt to see if for some reason that fixes it.

my innodb seems to using up loads of CPU, especially in ‘wa’ state

wa ?

I presume Im doing loads of transactions to disk

each commit make at least 1 disk write

kimseong, i checked and every foreign key is available in the referenced table

can I not buffer up the disk writes though ?

what statement you are doing? update
Durability reason

joe_-: Why does your SQL use Events and you posted an stEvents table?

is there things to speed up the disk write though ?

there is an innodb option to group the write to once a second, but will loss data in case server crash

I pasted the query from my PHP code, in PHP it uses a global config variable $SQL['Events'], for readability purposes I replaced the table names with something easier to understand.

yes kimseong

joe_-: No problem. Easily adjusted.

If need be, I can of course run the distance calc in PHP. I imagine PHP may be quicker on the up-and-up concerning that, although I’m not sure

the new value of the update cause fk violation

“mysql -ppassword /var/lib/backup/sqlfile.sql.gz” but the file needs to go through gunzip first, and the output of gunzip must be directed to mysql.. .. How do I do this?

joe_-: Why would a date be a text type?

mysql -ppassword `gunzip /var/lib/backup/sqlfile.sql.gz` hope this works

…sad, sad legacy code.
Timestamp was giving me some issues back in the day if I recall correctly.
Then again, that was a good while ago. Although I do plan on addressing and changing that field, it’s not the top of my list on priority =/

otherwise gunzip /var/lib/backup/sqlfile.sql.gz | mysql -ppassword

Just curious.

Heh. Yeah I saw that and remembered it myself. Cringed a bit too.

kimseong, That first example made my bash go wild.. Had to put it down before it would bit me..

i am in awe
installed apache2.2 + php5 + mysql5

does it all work?

Call to undefined function mysql_connect()”, so i check with phpinfo(), and there’s no mysql module

joe_-: Adding the appropriate indexes should make a big difference. Show the explain plan after you add them, if you still have questions.

PHP Warning: PHP Startup: Unable to load dynamic library ‘c\php\\ext\\php_mysql.dll’
something is off

Will do.

Havlox reboot if you havent, it wouldnt load the modules on my windows machine until i did that

reboot apache, right? not the computer

joe_-: The explain plan should look more like this: http://rafb.net/p/ZwC6dS60.html

no the whole computer

well thats the one thing i haven’t tried

joe_-: Minus the difference in number of rows.

i had that same problem on my laptop

lol. I just removed *all* indexes. Setup only a handful and the full query is finishing in 157ms now.
Is there anyway to make it only return one row, the one with the lowest distance, per artist?

i have tried setting “extension_dir” to cphp\ext, \ext, .\ext,
tried putting the folder in the path environment

joe_-: Sure. Use a form of GROUP BY and JOIN.

but i will restart, its worth the shot

joe_-: http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html

Can you explain? I got lucky with getting these queries to work. I know enough to get in trouble, but not do neat stuff.
nm. mmkay, thanks.

You’re welcome.

I’ll sift through it and figure it out
Ahh, it’s perfect

can anyone recommend a good way to update/display information via the web? PHP? PERL? I’ve been using PHP to simply display the results of a query, but i’m not terribly impressed thus far…

You have to tell PHP what to do with your data

yea

some people like ruby

its just not very dynamic from what i’m seeing

I made an awesome (if I say so myself) way to show my data just now with the help of Xgc
What?
Seriously?
PHP is as dynamic as *you* make it.

well, i would like to write something where I can type in a Letter and all the records except for those starting with that letter go away, then type another and so on
yea, don’t get me wrong, i’m not a great programmer

Well, what you’re trying to do is somewhat advanced, but by no means new.

but i have a SH*T TON of data to display and i’m having a hard time displaying it effectively and updating it

What do you need to do with it? What is the display for?

Xajax/php could help you with that

mostly informational

I hate Xajax =/
For that you may just want to use an SQL gui

yea, i have that

ive had good luck with xajax

but i’m hoping to eventually that I won’t be the only person updating this data
and that others will be using/updating/etc…

I’d rather make use of the JS class I’m already using for any thing else.

How do I make a column stop being auto_increment?

but Tables aren’t very for displaying data in my opinion

Well you have to figure how they’re going to edit the data. Do you need a CMS perhaps?

joe_- oh well that makes sense, i didnt want to have to write much js

Mootools or jQuery. Mootools is fast, jQuery a bit more “strong” but learning them has been great. I’m like, 98% PHP but I love those classes.

we basically have about 4000 sites on our network, all with their own IP allocations, and very specific details and I would like to find a way to have a central respository for the data

joe_- you can do database access through jquery?

write now we are using 100’s of spreadsheets
its so crappy

Well that’s not exactly AJAX and I’d doubt you’d want to.

hey guys, anyone know how i would get the results from two tables in one query?

You need to join them perhaps?

Most everything Im using xajax for is updating things based on queries, i do use jquery for a few other things

of union
or union

How do I make a column stop being auto_increment?

k

What I do is when PHP (the client) needs something updated, it hits up $.post on jQuery which goes to the server and goes to an “AJAX Controller” and it knows what to do.

alter table and modify the column removing the auto_increment

I’m trying to figure out the syntax for that

joe_- cool, do you happen to have an example i can look at?

The request passes through my normal authentication framework, if it fails, it gets rejected, if not it passes onto the AJAX control.
They’re at work but I imagine I could explain it fairly easily.

ahh thats ok, i dont want to waste your time

any help?

eep, modules still won’t work

Hey all, I can’t seem to get sudo mysqld_safe5 to run on OSX, meaning that I can’t seem to start mysqld. Any help on this? I installed using Macports.

apache error log still says it wont find the modules in ‘c\php\\ext\\php_mysqli.dll’
why does it use double slashes?

No worries. A quick “cheap” example is to do a post to index.php that looks like http://www.yourwebsite.com/index.php?action=ajax&method=updateUserInfo&name=bob in which case index.php
would go “Oh, this needs to goto my AJAX controller” and the AJAX controll would see if it had a method (function) for updateUserInfo and, if so, pass along execution to that function.
It makes AJAX just as dynamic as Xajax and is less “bloated”. Big upside is, it’s all your own code

cool, that makes sense

hey all do any of you guys use msqlcc

For escaping the slashes. Is the .dll there?

yes, they are all there
in cphp\ext

Try misnaming a dll you know is being included and seeing what happens.

the “extension_dir” is set to “cphp\ext”

Change a working DLL to like your_dll.dll2 and see what it says. Does it have slashes then in the error log?

there are no working dll’s, all of the ones i have included (like crypt, bz2, mysql etc) end up with a “The specified procedure could not be found”
in the apache error.log

Wait… in your apache log?
You probably need those in your PHP config.

for now, i have only uncommented extension=php_mysql.dll
in php.ini

What version of PHP?

5.3.2

you put in the right module filename?

I think in that version mysqli should naturally be included.

php on windows provides 3 module dll files depending on the version of apache

I use ADODB anyways =/

im on windows, running apache 2.2.3, mysql 5.0, in the apache config, i am using php5apache2_2.dll

kk… so php is working… it’s just some mysql call from php…

damnit, union is difficult

Pastebin your query

yes, php works fine (phpinfo() shows up), but it wont load the extensions

k

Im not great, but I may be able to help.
What OS?

windows xp sp2

Development “sandbox” setup?

indeed

WAMP program?

no, manually installed all of them

http://www.pastebin.ca/622776 — im trying to get all the fields in the query in the result

Ah. I’m a wuss and downloaded WAMP. Works outta the box

e.g. id, login, email, userlevel, vpsid, hostname, ip etc

All on one line?

yeah

i might end up getting wamp, if all else fails

It’s quick and easy. I love it.

still learning ;-)

Is there anything between the two tables that are similar?

Man here is how i always do it in windows. Install apache 2.2, install php5 and MAKE sure to select 2.2 apxs module. Reboot at this point. Then go install mysql. and it works

joe_- – username field is the same in both.

I download WAMP and hit run

hehe

SELECT * FROM users, vpsservers WHERE users.username=vpssservers.username;

aka “login”
Unknown column ‘vpssservers.login’ in ‘where clause’

What columns do you have in vpsservers?

id,login,hostname,vpsid etc

huh.

nm works now

lol. Mmkay.

vpsservers spelt wrongly

Dont you love that.

haha

phycho do you understand the error message, why people don’t read error message nowadays

i did, but couldnt understand where i went wrong
because they both looked similar
6am had something to do with

ok it seems to be working now
apparently, i had a waaay old libmysql.dll in my windows/system32 folder
after replacing, mysql functions are restored
what PITA

i had an operation that did order by RAND(), which is obviously a bad idea
i should fake it above sql shouldn’t i?

hello
if i create select x as l from j where xm why it cannot find the l?

if an innodb DB is 100% in memory…. will DELETEs still be slow? I think it would just start using the WAL and no more reads…..

Tell the complete story. What are you expecting and what is the actual behavior?

select *, DATE_ADD(`pd_sales`.`sold_date`,INTERVAL 14 DAY) as “expired_date” from `pd_unit` inner join `pd_sales` on `pd_unit`.`unit_no`=`pd_sales`.`unit_no` where `pd_unit`.`company_code`=’01′ AND `pd_unit`.`phase_code`=’1A’ AND `pd_unit`.`project_code`=’PAKA’ AND `pd_unit`.`sales_flag`=’1′ AND
`pd_sales`.`active_flag`=’A’ and `pd_sales`.`sold_date` !=”0000-00-00″ and `pd_sales`.`snp_date` =”0000-00-00″ and expired_date = ‘2
Above is the query.When i count date sold date plus date_Add 14 days then i want to check if expired date more then current day
it said it cannot found the expired date column

hi

the exact error you get?

Use a HAVING clause to test derived column names or use a derived table.

with jdbc, can i connect to a mysqld that’s only listening on a unix socket ?

select id as abc from xint having abc2;
or… SELECT abc FROM (select id as abc from xint) v1 WHERE abc2;

it cannot found the expired_date column.
I have got the solution.It seem when you create a column.It wasn’t ready for it until you query it

Derived columns are determines after the WHERE clause expressions are evaluated. The WHERE clause has access to the FROM list only, not the SELECT list.

6) i tried select SUM(finish – start) from table; to try and get the total number of hours, but it gave me a number that was far too large. is there a way to do

My solution are DATE_ADD(`pd_sales`.`sold_date`,INTERVAL 14 DAY) = current_date()

Yes. You can recalculate the expression.

was that recalculate comment mean for me?

can anyone point me in the direction of a ncurses admin package for mysql?

ncurses admin package?
i dont know of any

yea, i got a friend that just wants to run queries and the poor bastard is doing inserts at CL

i only ever use the cli

i’m not sure what you need with ncurses

a cheesy shell

i set my pager as vi using \P vi – and if i’m writing a big query i just write it in vi then execute with mysql -u user –password=pass query.sql

so aka a freindly terminal app that is like phpadmin like thing?

yea, probably.
i am not familiar with mysql, but ive used stuff like that for mysql in the past

No. You could calculate number of seconds from the epoch, then determine the difference and convert that to hours.

when i’m in CL mode i deal with mysql client
aka i dont know a friendly command line interface, imo that would be a hard thing to do

be less difficult than writing one for php
ill pass this info on to him though, thanks for your help

See: UNIX_TIMESTAMP(date)

okay, so SUM(UNIX_TIMESTAMP(finish) – UNIX_TIMESTAMP(start)) — is there a corresponding DATE or TIME function to go back from the timestamp to hours?

FROM_UNIXTIME()

great! thanks

If you wanted hours, you’ll want to divide by 3600.

if i use ltrim then i can get it in the correct : separated format
rather than hours as decimals
hrm… cours that will only work if it’s less tan a day

How do I make a column stop being auto_increment?

ALTER TABLE

I’m looking at the manual page, don’t see it there.
nvm, just found it

Are it better using myisam or innodb for two query ?
or more?
since php lock mutiply query in one statement?

hello
i have a question about pulling mysql results from php.
if there’s a space in a value, it doesn’t pull the entire value (of varchar())
just the first word untilt he space

whats “ROW_FORMAT=COMPACT” and “ROW_FORMAT=FIXED” and do they apply to InnoDB?

http://dev.mysql.com/doc/refman/5.0/en/data-size.html
http://dev.mysql.com/doc/refman/5.0/en/create-table.html

is there a grouping function that’ll return NULL if there is a null value amonst those to be grouped?

CaT[tm]: IF(COUNT(IF(field IS NULL, 1, null))=0, 1, null)
CaT[tm]: IF((COUNT(*)-COUNT(field))0, null, 1)

Anybody doing any data warehousing with mysql?

nope
well at least im not

I’m going to supporting a corporate workgroup in trying to organize all the data they’ve stored in Excel fles.
files

hello all

ew

I decided on something similar. case count(*) when count(field) then etc – just testing it now.
thanks but. nice to know I’;m on the right track

hi, what is the difference between using a varchar vs a text (performance wise)?
i read that varchar is not padded, and presumably text isn’t either, it seems to say that text is slower, what in the implementation makes it slower?

Hi, I have a DATETIME field named created, I want to do something like WHERE created = ‘2007-07-17′
I wanted to get results even if the field has time data
is there a solution other than LIKE ‘2007-07-17%’ ?

!man date and time

see http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html

pretty sure there is a better solution somewhere in there
probably use date_format to strip out the time and then you can just do =

what are the implications in using e.g. varchar(10) vs varchar(500)?

or you could probably do WHERE created = ‘2007-07-17′ AND created ‘2007-0718′ – I think mysql will implicitly add zeros for the time
storage space mostly I think

hmm don’t think it’ll add zeros

hello people

wow, im getting 25% speed improvement just from changing to use O_DIRECT

how to query for a date between two other dates
kinda what you wrote but with date functions

i think there’s a BETWEEN directive, not sure if that helps much

yea, BETWEEN doesn’t count the two ends

ok well then what about my date_format suggestion?

what about it ?

try it?

69) where b.id = null, could this cause any possible optimisation/inefficiency problems

don’t know about that but you won’t get the results you want… “where b.id IS NULL” is the correct way to compare to null

That will be fine.

ah thanks ToeBee, probably saved 30m of frustration somewhere down the track

Just test for NULL correctly.

righto cheers

null is also fine, just for fun.

Moin

moin moin

hi. I have a question about the C api.. if i use ‘mysql_use_result’, can i call ‘mysql_free_result’ before i have finished going through all of ‘mysql_fetch_row’?..
hmm, no :/
“When using mysql_use_result(), you must execute mysql_fetch_row() until a NULL value is returned, otherwise, the unfetched rows are returned as part of the result set for your next query. “

hmm which collation applies best when using utf8 character set for german texts? utf8_roman_ci, can’t really find any info about that in information schema (using 5.0)

can some one help me thing through a query fwith me. http://www.pastebin.ca/622937

I’m trying to do something that I don’t really know how to explain.. but I’m doing a query that is returning 2 rows — I’m doing a select from table1 innerjoining table2 where table2.column = table1.column
table2 has 2 entries that match, so I’m getting 2 results back
(table 1 only has one row)
I only need one column value out of table 2, but I want that column info from both rows to appear in 1 row in my query
in my query result
can anyone understand that? :x

you want to represent two rows of data in one row?

kinda?
ok

you could use group_concat

table1 = a listing of games that have been played
table2 = a list of the teams that played in the game
I want to do a select for games
and inner join the team info
but not have it return 2 results (when 2 teams are associated with the game)
because then if I have something that displays the info, I’ll get the same game information for each team that played in the game
get what I’m trying to do?
and the problem?

in my user table each user has a list of friends, what is the best way to store the friends

where can i find documentation for the IN(a,b,c) command? (its hard to search for

right now i have a column for friends and keeps a list of user ids seperated by semicolons

hiho
“Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL”, how can i fix the problem? can i somehow delete the query?

possibly create a table of (user.id, friend.id)

Hey
Is there a function in MySQL that tells the connecting IP?
Shows mine if I connect, John Doe’s if he connects.

its part of select current_user()

No it’s not since it’s an anonymous connection.

ah
select user() doesn’t work either?
then show processlist;-)

Yeah it did
^^

can anyone help with my question? (stated above)

marc-andre: you can skip it
marc-andre: or you can adjust slave schema to allow execution
marc-andre: or you can add error to ignore list
(userid,friendid)

lol, ok

or userid,sortcolumn,friendid
;-)

thx

i dont think i got what you said :o

nevermind
some day you’ll get it
morning salle

possibly create a table of (user.id, friend.id) – ah didnt see this

now i understand what you said :p

Hi, we’ve got replication working with a master and a slave. now I’d like to have the master db twice on my slave one for backup/recovery and one to run some statistical progs on it – so any ideas/way how to replicate to two databases on one host?

Hi, what is the way to get a copy of the structure of a database without the ‘data’ ?

create table like
ah, database… mysqldump –no-data

can someone look at this and see if something pops out that could be wrong. http://www.pastebin.ca/623005

Beardbar, not sure if it makes sense, but try to remove the ” , using the values as numbers
and do WHERE ((rank_min = 10) AND (rank_special = 0))

Beardbar, if you have integers, dont use quotes

k testing, left in there where vairables used to be
perfect thanks chap.
noted, thanks mate!

“warning: connect to mysql server localhost: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’” but when i do: “mysqladmin –protocol=socket –socket=/var/run/mysqld/mysqld.sock” i can connect to the socket, someone has an idea?

thanks
mysqldum -B mydatabase –no-data, it is the correct way?

Yes, should work.

the last question please , how to import the result to a new mysql database?
the ‘dump’ to another DB

Can’t you guess that?

mydatabase.dump”

mysql dump.sql

thanks alot!

do you have a good reference on jdbc with mysql?

http://dev.mysql.com/doc/refman/5.0/en/connector-j.html

“warning: connect to mysql server localhost: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’” but when i do: “mysqladmin –protocol=socket –socket=/var/run/mysqld/mysqld.sock” i can connect to the socket, someone has an idea?

marc-andre: Bad permissions on the file?
ls -l /var/run/mysqld/mysqld.sock
Is the postfix user allowed to use it?

hi all; is there a way around this error: “Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client” without upgrading the client? i have no control over the client

you can down-grade your password hashes in the mysql.user table
SET PASSWORD FOR user@host = OLD_PASSWORD(“supersecret”);

or set old password = 1

that only works for new passwords
aehm … it only changes the meaning of the PASSWORD() function to be the same as OLD_PASSWORD()
the hashes in the mysql.user table are still in the new form

which file?

marc-andre: The socket file

SELECT user, hostname, password FROM mysql.user; and check if your password starts with a * or not

the permissions are 777 on the socketfile and the owner is mysql:mysql

d’oh

okay checking now

hi everyone

thank you

If I distribute my product, that uses mysql, and in my product I silently install mySQL, but no more thant that, then use it from my software, and I charge a fee for my software. Does that make my software GPL?

yes it does
The main point of GPL is *distribution*. That’s what makes the difference.

So if I didn’t distribute mysql with my software, but just write it as a prerequisite it would be fine?

i’m not sure about that – is his product really a derivate work of mysql, just because the installer installs mysql?

Whether your charge for it or not it is irrelevant for GPL
When you distribute GPL product your entire distribution must be GPL-compatible

yes, I understand, but I would want to have the people who buy it not be able to distribute it

Hi guys, I’m trying to setup replication on one of my servers, the server was setup before I took control over it and it does not seem to have a my.cnf. Where would I create one (for RHEL 4)?

ok, thanks, that makes it clear

yeah begin with *

his app links against the libmysqlclient (GPL) and he distributes it, yep

Chrysalis, and how do you silent install it ? could you share that ?

now it is up to you how you handle it. Perhaps you want to create a ‘olduser’ account for each user with a OLD_PASSWORD()
upgrading the clients to use the 4.1+ protocol is highly prefered

Don’t tell the customer what do you install

I don’tk now if that’s possible, but it can be non-silent as well

hmm no can’t change client

otherwise they can’t use Stored Procedures or Prepared statements

marc-andre: sudo -u postfix mysqladmin –protocol=socket –socket=/var/run/mysqld/mysqld.sock
Try if that works

salle, lol
was asking what is the command line to silent install mysql, i have never been able of getting it using the mysql docs at least in windows

i used the set query you gave me

and now all have “supersecret” as password ?
double check, that the hashes are shorter now and don’t start with a *

yes, that works

no it is set to my own password (!) and don’t start with * anymore; thanks a lot for your help
opme
crap sorry; wrong virtual desktop

Every windows msi can be silently install, however mysql comes as a setup.exe not sure it runs an .msi

ok, ty Chrysalis

check the options of msiexec

hello.. i have my tables encoded in latin1_swedish_ci. when i make a dump with “select into outfile” i get something strange. the result file seems to be multibyte since danish or swedish letters are translated to a couple of weird chars. unfortunately it is not utf-8… any hint?

ty u too weigon, googleing

/quiet /passive /q… are your options

nice, i’m just reading about that

hello

I’m trying to setup replication on one of my servers, the server was setup before I took control over it and it does not seem to have a my.cnf. Where would I create one (for RHEL 4)? I already tried creating one in /etc/my.cnf and it does not seem to take effect on restart of
mysqld

any distro i have tried looks always for /etc/my.cnf
in first place
try to create and invalid /etc/my.cnf
and restart mysql
if it doesn’t start.. there is your location

$ mysql –help 2&1 | grep my.cnf
here it is /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf /etc/my.cnf

http://eugeneciurana.com/pastebin/pastebin.php?show=3214
?

zap-clone: how about printing the error-msg too ?

one second, it’s in german, need to recreate it in english again

zap-clone: that’s fine

/etc/my.cnf /var/lib/mysql/my.cnf ~/.my.cnf

zap-clone: you have to use ` instead of ‘ for the field names (if sql_mode is not set to ANSI_QUOTES)

http://eugeneciurana.com/pastebin/pastebin.php?show=3215
hmm, the ‘ are created by a PreparedStatement Object in Java

zap-clone: the ‘ in the field-names ?
zap-clone: fieldnames are not preparable

yes
oh, then that is the problem…

what would be the best way to database multiple blogs? create a database/table for each blog or just manage all blogs from one table by blog id

looks like the jdbc prep-stmt emulation didn’t took that into account

then I need to figure out a way to handle the field names…hmmm…
thanks

somewhen you want to be able to scale by splitting them into seperate instances

i do not follow. can you explain further

create a database for each blog-instance
you can apply access-privileges on that level and you can move a blog to its own database later if you like
the blogs itself are independent I hope

that would be the most efficient way? If I am hosting say atleast 1000 blogs.

yes. split them

ok

hehe
I’d have one huge table
esp. if going after million blogs

time to merge the en and de wikipedia

hehe

thats ‘thousand’
if we’d have millions of wikis, they’d definitely live clustered in biggish tables
if we’d have millions of wikis, they’d definitely live clustered in biggish tables
you don’t need big iron for that
you still can split your databases
‘mysqldump -w “instanceid in (a,b,c)” | mysql -h anotherbox

damn!

^^ haha

Indeed I could use dammit instead

hi all. Can anyone tell me why the following line fails with ERROR 1064 (42000)?
ALTER TABLE events RENAME COLUMN count TO r_count;

`count`
What is the exact error message?

.oO( why is everyone too shy to print the error-msg they get ? )

there is no RENAME COLUMN syntax

you don’t run nude around city, do you?!!?

wanna see pix ?

Use CHANGE

gief!

hi, somebody have try to make a jdbc polling?

hello.. i have my tables encoded in latin1_swedish_ci. when i make a dump with “select into outfile” i get something strange. the result file seems to be multibyte since danish or swedish letters are translated to a couple of weird chars. unfortunately it is not utf-8… any hint?

exact error is:
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 ‘COLUMN count TO r_count’ at line 1

PhoenixAndy COLUMN is a reserved word you could try `COLUMN`

There is no RENAME COLUMN syntax. Use CHANGE COLUMN instead

cheers. That worked
ok, one more problem
UPDATE liberty_content SET primary_attachment_id=( SELECT attachment_id FROM liberty_attachments_map lam INNER JOIN liberty_content lc ON ( lc.content_id=lam.content_id ) WHERE lc.content_id=liberty_content.content_id AND lc.content_type_guid=’treasuryitem’ );
ERROR 1093 (HY000): You can’t specify target table ‘liberty_content’ for update in FROM clause

Hi. I have a problem with the MySQL Query Browser: It does not show any schemas in the list when connected to my server. The user does not have the rights to execute SHOW databases. Does anyone know how to get the tables of my database there?

hi @all is there a poibility saving the result of a statement like SELECT * FROM x into a variable in a stored procedure ? THX .. :-)

you nearly wrote the correct syntax for it
SELECT … INTO var;

i’ve tried allready SELECT * from x INTO variable_name it does not work
i get an error that said that only one row can be passed to the variable not the whore result

Comments off

hi when i have class_a that extends class_b the stack of functions inside class_a are parent__construct other

__construct().. other function, so when i initialize the class_a the first thing that PHP will do is call the construct() inside class_b and execute all the functions inside the construct() and
then when finished it will return to class_a and execute the remaining functions, right?

god dam***

correct, akan01n_w

ok, thanks

oh got I just tried to tab-complete when doing “mkdir”

lol

that’s okay…i did it for “ls” once

but … ls does have tab compelte …
s/compelte/complete

oh, I thought you meant for the command
like “mk tab”

? I do, in terminal – I did mkdir t[presses tab] to get mkdir tags
oh you mean to get the command? :P

yeah – heh

would be cool if they could implement mind-tab-completion

I just completely missed that there was a sleep function don’t feel too bad lol
granted I havn’t needed it since php3

you can use voice recognition with windows vista… hehehehe…

yeah and you’ll never catch me using Vista

sure there is a nix VoiceR program somewhere

Because you only use it in your closet with the door locked?

shhh!

hehe

is it possible to compile php scripts as a .exe?

hi

no, but you can run “php scriptname”

How can I test if a PEAR:B handle is actually connected, I dont see a isConnected or similar method ?

which wont do it for what i want
think i’ll use perl instead for this one

may I ask why you’d want a php script as exe??

dude i know wants a script which does some file copying/replacing

can someone help me please?

no one can help if you ask no question,

I have a PHP daemon running in the background, and occasionaly the mysql drops the DB connection, how can I test if the handle in my code is still connected ?

See, the only pdf related options I see under ./configure include –with-cpdflib, which of course is ClibPDF, which the manual page says is provided by FastIO, who’s site appears to be down.
Has been down for like… a week.

stupid opera

try r&os pdf lib, works well

er, ok, i’ve seen that around.
It doesn’t have any dependencies?

no
its pure php , no need to compile it in

Hm.

its kind of slow

php if (wp_list_pages(‘depth=2&is_page=Route) == Route) { } else { wp_list_pages(‘title_li=’ ); } ?

#wordpress

I did but no one is answering

thanks, qbert.

!tell ShawnRisk about g10

AHA
i sorted it out
ok
sorry about enter problem again – anyways so the zend ext line needs to be above all the others for ioncube to worka nd your extensions dir needs to be ./

hi.. i’m looking for some help formatting numbers to have a leading zero.

str_pad() ahiredplane

this would be for the hour of the day. this is what i have, and it’s not giving me leading zeros… ($x=0; $x24; $x++)

why not just use the correct format when using date() ?

I’m not sure… I’m taking code that was given to me, and I need to make edits.
I’m not sure how much I can change without breaking something.
May I paste the full 8 lines of code?

no, use a pastebin

Please forgive me, I don’t know what that is.

www.paste2.org

thanks
http://www.paste2.org/p/5453

then look into str_pad()

lol I almost feel ashamed I am doing a code repo system with all these other out there

like SVN, CSV, Git etc?

site I meant sorry, like paste2 etc

.weather
darn
no weather informant

oh a pastebin

Making one for myself that has versioning and stuff on scripts so can have multi versions stuff like that
mostly for personal code

Mornin’

why not just use a revision control program like svn?

confidential

I do
But not as display friendly
plus not as much fun :P
same reason I program my own forums

hi guys…is it possible to iterate in a foreach over two arguments?

yes,
no

foreach (blah as bleh, bluh as blih){} can I?

nope,

do you have any idea of how I can do something similar ?

2 foreaches?

=D serious?

thanks Alex

you’re welcome

!pastebin
http://hashphp.org/pastebin?pid=25534 this doesn’t seem to work right
I didn’t write the code, but I know enough php web hosting to think that that is the cause of my problem.
can anyone tell me if there is an obvious mistake there?

would be cool to have a bot that could connect to soemthing like pastebin and upon request would message you the highlighted code in IRC … I need to stop thinking before I go try it :x

the point of a pastebin is that it doesn’t flood the channel,

lol

yeah not the channel

by doing that you’ve just reversed it

the person requesting

I see, in a PM

yeah
cause some people may not be able to pop a browser as easily as they can hide a current irc session

hi im trying to get php mysql web hosting support enabled in php on an ubuntu linux system. are there some binary packages i can download with apt to do this or do i have to do a manual build

have you already tried looking? o__o

well apparently there is a package but it doesnt seem to do anything

it very much does do something

i’m sure it’s all command line

sudo apt-get install php5 php5-mysql apache2 libapache2-mod-php5 mysql is IIRC, all you need to do

while($filename = readdir($handle))
is that a proper if sentance?

that’s not an if statement,

er
a proper while*
lol

yes,

there doesn’t need to be == (two equals)? I’m not a php person so I’ll take your word for it.

oh, yes sorry
==

hmm

no
just = sorry lol

no?
wahgljrkgaerg LOL PICK ONE _

=

I’m trying to fix this horrible problem
why only one?

php.net/readdir
haha sorry
oh god I’m going mad, ignore me – read the docs, I need tea

*lol*

hmm
tea mm
the docs say that that is the “wrong way”
so I’ma try the “right way” and see if that really makes a difference

Hello, does anyone know of any solutions to deal with how IE timesout? I’ve got a process where a user uploads a file, the process runs in the background (this an take a long time, sometimes an hour or so), and then redirects the user to a results page…works fine in Firefox, but IE times
out

Did you properly light the insense?
in what order did you chant and throw the chicken bones?

.. ?
:P

lol

hi….

hey

hi

in creating web apps, just how the heck do you ‘debug’ a php app on apache!!

can session contain arrays?

yes, and objects
auto un/serialised

with a normal c app, i can set breakpoints, examine the stack/registers/etc…

by using other php functions such as echo, var_dump() is_file() file_exists() is_object/bool/null/string/int etc etc

any articles that i can look at??

ThinkMedical ok ty

want to check if it’s going in an if … place either echo ‘YAYAYA’; or die( ‘fooooooo’ );
if it displays the text, it went in the if

alexc – so there’s no way to examine registers/events/etc.. short of simply adding debug code and writing out the results..

or use an IDE to do breakpoints etc.

heya people. question: Is there a WWW

Comments off

I am experiencing a problem with flash ie that i cant seem to identify I am using a flash replacement technique

i want to count _only_ numbers in a string – how would i do this?
not add them up, count the number of digits
Or, how do i strip a certain character from a string? eg remove all spaces?

`js ref

http://developer.mozilla.org/en/docs/JavaScript , http://devedge-temp.mozilla.org/central/javascript/index_en.html , http://phrogz.net/ObjJob/ , JScript@MSDN: http://tinyurl.com/9pk3l , www.crockford.com/javascript/

by using google

by using replace

he is
mornign

how goes?
I remembered some image compression techniques I designed about15 years ago you might want to try out… unless you’ve moved on

nah i haven’t moved on. i’m actually stuck ;-)
the lz77 is sometimes really bad

oh? stuck on?
yes

in that a file becomes larger if there are no matches

every technique has data it sucks with
some systems use a 0 length to mark that next is a run of unmatched chars… with their own run length token

and problem is if i do lazy matching then the algo starts to put in too many literals instead of copies

lazy matching?

means if i have found a match i continue to search for longer matches one byte after the current input byte

not opting for a Boyer-Moore search ,then? :P

boyer-moore?
whats that?

string search algorithm…very efficient
there’s a lot of LZ77 variants…. some opting for faster compression, others for smarter matching, etc
anyway.. some of my old ideas worked on dictionaries of 2d blocks of pixels
banyway.. some of my old ideas worked on dictionaries of 2d blocks of pixels/b

hm. thats interesting. i was kinda thinking that it should be possible to use spatial information of the image. because lz77 just thinks its a long array where each byte has only 2 neighbours

right

2d wavelet compression in js?
nice

if you took, say, 4×4 blocks of pixels…
my basic scheme worked on direct matches…. but some others worked on base+difference … so you could say “OK, this is block X, plus block Y”… much trickier on the compressor

hm boyer-moore has to be adapted for lz77. its only working for constant length search strings

but if you look closer, extending the string is easy
as in, once you find a match, add a char, update your offsets and pointer… and keep going
the joy of LZ77 is you can make the compressor smarter or more slack… and decompression doesn’t change

hm. i’m not sure if it is really worth the effort. compression speed is not really a concern

iLess:

Is it mandatory to put a submit button in a form??
I want to send the form using an event

How will you post the form without javascript without a submit button?

have you xp with c++?

I think I’ve it

you’ve it?

more than I’d like

I’m try $(‘id’).submit()
Where id is the form ID

haha. can you have a look at my lz77 code?

ok

Mace[work]: s.replace(/\D/g, “”).length

thx, realised js is the same as php – no “remove” but only “replace”

Munter asked how you’d submit the form without javascript hosting available

It will have
It’s a TV embebed app
I’m sure It will have it

http://77.57.2.131/~schwadri/lz77.cpp
maybe i did something wrong.
i haven’t found a good implementation that i could compare with my code

true http://pastie.caboo.se/82439 ??

fortunately, it’s been too long since I used C++ to parse that quickly…
I wrote all my LZ77 code in C

oh. i hope the templates doesn’t confuse to mutch

How do you reference what the user see’s in a select box, the selected row?
eg oFieldSelect.value would be the “value”, but what would the description the users see’s be?

hi

none?

i have problems with memory leaks programming in ajax
how can i free the memory of IE?
i have tried with history.go(0) function

oFieldCardType.value is outputting the value, AMEX etc whereas oFieldCardType.text isn’t outputting the display text

but it doesn’t work

fix the memory leak problem maybe..

I have fix the ajax memory leak with the API of Yahoo
the web page have to be opened the 24hours of the day
It´s a google maps mashup
Why history.go(0) doesn´t free the memory¿

sorry, mate… can’t really follow it right now

np

what is the attribute to set to hide a button within a form?

argh
oFieldCardType.options[oFieldCardType.value].text doesn’t work, oFieldCardType.value outputs as expected, as does oFieldCardType.options[2].text

“document.frmForm.btnClear.visibility = hide;” is not working for me. am I setting the wrong attribute or value?

Mace[work]: oFieldCardType.options[oFieldCardType.selectedIndex].text

aha
thank you – was about to itterate through it heh

.style.visible = “none” or something.

IE is a great shit

document.forms['frmFrom'].elements['btnClear'].style.visibility = ‘hidden’;

join #compression

grammar question, is it “Card number is too short for” or “Card number is to short for”

deltab/jafet, thanks. i got it to work with deltab’s line.

Mace[work]: “too”

thought so cheers

http://pastie.caboo.se/82439

what’s wrong with it?

deltab, my aim to get something the second. but this one doesn’t work…

how doesn’t it work?

deltab, the second one doesn’t send anything

what does it do?

is there a “replace_all”?

deltab, it is landing in nirvana. the url is wrong and the browser is running some kind of endless loop (always searching for something)

Mace[work]: add the g option
Mace[work]: s.replace(/\D/g, “”).length

ah that’s what that was, thanks

deltab, definitely not working

document.write isn’t going to work once the page is loaded

deltab, o.k. what would you advise me to do instead?

what’s the point of this dynamic form creation anyway? why not just have the form in the page?

deltab, the reason is why the form only shall be defined when clicking the button (onclick)

what is the reason?

deltab, having not only one button like this but more than 20? 20 forms on the page?

why so many forms/
wouldn’t one form do?

deltab, right. i also don’t like that many forms
deltab, no i want to have the data of that form belonging only to that button.

what does the form submission do on the server?

deltab, CRUD on a db.

you could encode the value you need in the name of each button

deltab, and when i have more than 1 value per button?

encode them into one

deltab, do you have an idea, how to achieve such a create_form_on_the_fly?

the general way you’re doing it, without the useless document.write

deltab, yes. but i need a hidden-input int that form. how to add it?
in that

using DOM ?

with appendChild

deltab, you form.appendChild?
you mean

why is iCardNumber = oField.value.replace(“/\s/g”,”); not removing spaces?

Mace[work]: because Javascript is not PHP
Mace[work]: javascript has regular expression literals

it could have been python but w/e
thanks

deltab, thank you for your good hint. it works now

thx, realised js is the same as php

they’re very different but i understand why you said that
common misconception

using javascript, how can I uncheck a radio?

.checked = false

staz, like “document.frmForm..elements['radArtEmail'].checked = false;” ?

have you tried it ?

yeah, didn’t work
i accidentaly put the ‘..’ when i was copy and pasting

when doing /(\-)(\D[\s\-])+(\-)/g – how do you reference (\D[\s\-]) in str.replace?

$2
note that – has no special meaning in regexes outside character ranges

it says it can’t find $2?

“12-X -34″.replace(/(\-)(\D[\s\-])+(\-)/g, “=$2=”)

12=X =34

ah k

“12-X -34″.replace(/-(\D[-\s])+-/g, “=$1=”)

12=X =34

document.getElementById(‘radArtEmail’[0].name).checked = false; I’m trying to reset a radio button

what’s ‘radArtEmail’[0].name ?

I have the following currency, 25,000.00, how could I multiply that number while retaining its format?

“radArtEmail” is the radio buttn name. I thought the [0] referenced the first index in the array for the radio buttons called radArtEmail. the “.name” is the property?
i got it working it was this.document.frmForm.elements['radArtEmail'][0].checked = false;
that’s for the suggestions
*thanks

‘radArtEmail’[0] refers to the first character of the string

deltab, oh

“abc”[0]

as opposed to the first index…

a

0 is the first index

HEYYYYYYYYYy0-
wussupppppppp Scripters!!

=/

lol
am too hyper,too much rock songs for a long time XD

heh

guys i was wondern

are you bored or something Deja?

rock songs? lol

loool well am working a saving a webpage button

scripters make us sounds like we are not real coders

using javascript
well a weried web develoepr.i sing and rock around
well i got a really complicated casse
i have to make a button that saves the HTML page to the client

Have you been drinking? Again? Look, we’ve had this discussion five times now. This has got to stop.

including the IMAGES
loool
well yeah,i think am drunk when u am talking about javascript to create a button to save the whole webpage including the images
any could help
?

Doubt it can be done. There may be proprietary functions to invoke the save as… button in the file menu which might be what you want but I don’t think I’ve seen any.

Deja^vu^Boy: javascript host can’t write data to a hard drive without external help (java, flash, activex)
Deja^vu^Boy: just use wget or something

Server side you could use wget and generate a zip file for download.
Then link to it.
And run that script with cron.

I am experiencing a problem with flash ie that i cant seem to identify. I am using a flash replacement technique that was written by another developer at my job and for some reason in ie when the flash gets written onto the page if there is a hash in the url it gets appended to the end of the
title bar. has anyone ever encountered this problem?

So it keeps up to date.

server side isnt that practical
i thought of using activex


Oh dear.

its a news portal website

that has like 5000 daily news with about 2 for each

Hmmm… nice generalisations you’ve got going there.

tahts why i guse its not pratical,imagin that works on a cron job,2 huge procedure

Uh?
I don’t think you quite understood what I was suggesting.

http://pastie.caboo.se/82492

I wasn’t suggesting you write an entire database backed site.

Ummm………..okay,could u explain it
more

I was suggesting that daily you ran a script that connected to your site as a client on the server.

Deja^vu^Boy: Why not just detect the browser they are using and give them instructions on how to use File-Save As…

I have the following currency, 25,000.00, how could I multiply that number while retaining its format?

And then zipped the resulting html hosting + js + css + image up.
Sembiance’s solution is the easiest and for most purposes best.

convert to an int, multiply, then re-format

Alright, I’ll try it out.

Umm….

hello, how can i know if a string contain only numbers?

TheHcDreamer, use regular expressions
you can do a test for non numeric characters

in theory isNaN(parseInt(theString, 10))

I believe \D will check for any non-numeric characters

/^[0-9]/ but i don’t know if is correct

breakerfall has a good suggestion too

TheHcDreamer, nope, that will simply only match a string which begins with numbers

ah ok
so /[0-9]/?

“ioeini3e3e33″.test(/\D/);

Error: Error: TypeError: “ioeini3e3e33″.test is not a function at line 0: (null)

well..cant i just execute a “SaveAs” a “complete web page”?i have found already a exeCommand(‘SaveAs’)
it shows a save as HTML

TheHcDreamer, /[0-9]*/

thanks

hi
i have the name of a field of a form in a string. how can i get the value of it in javascript?

formElement.elements[fieldName].value

http://techrepublic.com.com/5208-6230-0.html?forumID=101&threadID=203616&start=0
check this forum out

var regexp = /\D/; regexp.test(“dcdc3334″);

true

TheHcDreamer, that’s a better solution

?????:??

63

var regexp = /\D/; regexp.test(“3334″);

false

breakerfall i will try

s.match(/\d+/g)
hmm
s.match(/^\d+$/g)

deltab, the solution I provided makes much more sense :p

no, that results in true when there *are* nondigits

breakfall so now i can do if(regexp.test(mystring)?

TheHcDreamer, yes
deltab, “hello, how can i know if a string contain only numbers”

and you said “here’s a test to see if a string contains any non-numbers”

TheHcDreamer, if you receive true, then it means you have non numeric characters in your string

it work good!

GarethAdams ?

if (/^\d+$/.test(s)) { print(‘it contains only digits’); }

deltab’s made more sense – it can be read as “does this contain only digits”. Yours is simpler, but it doesn’t make more sense

if (/\D/.test(s)) { print(‘it contain a nondigit’); }

GarethAdams, I suppose, readability wise, you’re right

i can try all two solution
with second solution /\D/.test(s) it dont’work for me
but with /\D/ it work

hm
how can i change the ondblclick property of an element by javascript?

myElement.obdblclick = newFunction

GarethAdams, so, can i do something like myElement.ondblclick = “fooFunc(); barFunc(3);”?

no
myElement.ondblclick = function() { funcOne(); funcTwo(); }

is there any reason that i cant use the google maps api host and use rel=”external” on the same page?

what happens?

the map doesnt show up

what are you using rel=”external” on?
is the presence of rel attributes the *only* thing you’re changing? or is there a script you’re removing?

the there’s the external.js
if i dont let it load the part that adds target=”_blank” behavior to links, the map works
if i include that, its blank

so adding (that part of) external.js breaks the map?

http://pastebin.ca/634621

The paste 634621 has been copied to http://erxz.com/pb/3777

thats what external.js looks like
well, its named popout.js though because i’m using it for popping up a new window for showing galleries too

Question, is there a way to wait until an ajax request finishes loading (via an outside call…IE, can’t change the ajax calls)? This includes loading the images, etc.

hi, I’m inside a div and would like to make all it’s children visible (children[].display = ‘block’), how can I iterate over an element’s children?

firebug isnt showing any errors and the xhtml is valid, so i dont know whats wrong

how are you creating the map?

i did it like the google api shows

ok

http://colbyframeco.com/directions.shtml

window.onload = function() { myCreateMapFunctionHere(); popout(); return true; };

if its only for one page though, and i’m using SSI, will it freak out on other pages that don’t have a div#map?
the map creating function is on body onload=, not on window

move it out of there
window.onload = popout(); is overwriting the other

same thing

also, it should be window.onload = popout;
anyway, try what I’ve pasted above

the return true is irrelevant, isn’t it?

and get rid off onload of the body element
yeah, it is
just preferences in this case

deltab, i copied it from elsewhere

and it’ll error when #map is not present

Can anyone help me with a google-maps issue?

put the code you want to run later into a function, and have that function called when an event happens by assigning it to onload or whatever

ok that sounds about right — can you do an onload on an element that may not even exist yet?

no
so you need something else to set that up when it does exist

does it matter if i put popout or load in window.onload=”" first?

hmm

it doesnt make sense that popout was overwriting the map though

you can put onload=”" into a div tag, no?

because thatd imply that map ran and then the popout script ran
mcknin, no

hmm

you had two window.onload handlers, didn’t you?

and i used alerts and the map one doesnt run at all if the popout.js is htere

tags) and it didnt fix it

for (var i = 0, childrenLen = children.length; i childrenLen; i++) { var myChild = children[i]; if (myChild.nodeType == 1) { myChild.style.display = “block”; } }
window.onload = function() { popout(); Gload(); };
like so

woot! thank you maggi!!!

you’re welcome
forgot one thing: var children = refToDivEle.childNodes; for…

if I’m using AJAX to load a page into, say….a div, is there a good way to have JavaScript eval any JavaScript in the page I’m loading
?

now back to deathwishes for the developers of internet explorer and their inability to understand & implement proper CSS support

thanks!

Receive my bookmarklet awesomeness.
t=true;w=window;d=document;a=w.addEventListener;r=w.removeEventListener;n=’click’;v=’keypress’;s=’30em’;b=’white’;p=d.createElement(‘p’);q=p.style;q.position=’fixed’;q.top=’48%’;q.left=’35%’;q.width=’30%’;q.height=’4%’;q.border=’1px black
solid’;q.backgroundColor=b;q.color=’black’;q.padding=’0.5em’;q.textAlign=’center’;p.innerHTML=’Click a block of text until as much of the page as you want is a readable width. Then ctrl-click if you w

ant it
centred.’;d.body.appendChild(p);h=function(e){if(e.ctrlKey){c(e.target)}else{m(e.target)}};a(n,h,t);f=function(e){if(e.keyCode==27){r(n,h,t);r(v,f,t);p.parentNode.removeChild(p);w.clearInterval(o)}};a(v,f,t);m=function(e){u=e.style;if(u!=undefined){if(u.width==s){m(e.parentNode)}else{u.width=s}}};c=function(e){if(e.parentNode.style.width==s){c(e.parentNode)}else{e.style.margin=’0
auto’}};void(o=w.setInterval(function(){if(q.back
groundColor==b){q.backgroundColor=’yellow’}else{q.backgroundColor=b}},1500))
It’s ALIVE

and the immediate parent node’s name?
for a child div, the enclosing div is called how?

what is that snippet of code?

myChild.parentNode.nodeName.toLowerCase()

cool

It’s a bookmarklet I just made and mangled really tiny that makes bits of text that are too wide a readable length.
(30ems to be exact)
And then optionally centres it.

‘this’ is the ‘a’ element, right?

correct

hi guys
javascript can some method to get IP?

when I put a name=”blah” inside a node, can I then use that name directly in js? (ie: blah.visibility = ‘block’)

no

or should I use id=”" and then document.getElementById() ?

that’s the most stable way

ok, thanks
so what’s the name for?

form elements are sent to the server in name/value pairs
where name and input are attributes on input elements

ah, ok, just for forms then

*name and value

you could use name using some javascript framework supporting xpath/css selectors, but by id is more convenient

except your HTML would probably not be valid

exactly

or you could use getElementsByName

that goes for all attributes.

I’d go by id or class

yeah, works
I’m developing a treeview, the problem is that in all my a onclick=… I have also href=”#” which sends me to the top of the page each time,
is the href mandatory?

you’ll have to return false
to prevent the default action

great

hum, i need to request an url (make a HTTP / 1.1), but not view the document
i dont need the respons
response*
document.location makes the browser go the the actual url,
any ida?

timtux, HttpXmlRequest, iframe, image host tag, link tag, script tag, etc.

hello!
Does javascript have any problems with forms??
I have this js code after a form tag and it only works if the name and target fields of the form are not there
http://privatepaste.com/3a1w9veEFi — here is the code
on line 12

If I have something like this I get all types of errors from the functions

if I put it commented like that it all works fine

can I change the onclick from the onclick?

anyone know?

when clicking I then want to insert another eventhandler in the onclick
to invert the state

im passing an id to a function I want to take that element and get the child element that has a class name = to “content” and change the style
how can i do this

my bad, a simple if/else does it

anyone know my problem?

I might if you described it.

I did
but it’s not important now
I solved it

how bout my problem

http://maps.google.fr/maps/geo?q=saint%20germain%20des%20pr?s&output=json&key=ABQIAAAAtOjLpIVcO8im8KJFR8pcMhQjskl1-YgiA_BGX2yRrf7htVrbmBTWZt39_v1rJ4xxwZZCEomegYBo1w
but it return null, any idea why?

I have a php hosting script that I want to execute every 30 seconds, someone may guide me on doing that?

you can use meta refresh

is there a way to specify regex match to only return unique matches?

I only one a small segment, of the page to refresh not all

use xmlhttprequest

“a1b1c1a1bb2ccc3″.match(/[abc]/g) to only result in [a,b,c] for matches – rather than what it seems to do now: [a,b,c,a,b,b,c,c,c]

MikeD_, I may be wrong but [] signify character sets that can be included in your result

I’m parsing the matches (as tokens) and globally replacing each match with a specific value – there’s no point to having the second+ occurances checked for the replace if the first occurrance is global
it’s just an example – the actual regex is different

MikeD_, principle is the same, [abc] will match any a or any b or any c

suppose a,b,c are tokens/stubs that should get a different value replaced into the text at those points
right
but every time “a” appears it should be replaced in the text with “Foo”
so i don’t need the match to tell me that “a” is in the text 5 times
if i’m doing a global replace of “a” with “Foo” then i only care about the first “a”

can some1 help me
im trying to change the style of an element
when i pass in the parent elements id i want it to be able to find the child element
based on class name

MikeD_, why not use string.replcae

MikeD_, I dont think yo want match then

div id=”4″h2test/h2div class=”content”/div/div
so how can i make the content div change style?

I need some help. I’m trying to add script tags to the head on the fly
But it’s not quite working

i tried var name = document.getElementById(newsid).childNodes[0];
alert(name.nodeName);
and it gives me #text

I have an arbitrary length file containing any number of variables that are delimited with @@ – so i do var t = textblob.match(/@@.?&&/g); for(var x=0; xt.length; x++){ textblob.replace( new RegExp(t[x],”g”), getReplacementValue( t[x] ) ) }
titosanta – you need to iterate the collextion of childNodes looking for an element that has the class you want – think about how many elements may be inside a div – you can’t expect element 0 to be the one you want

i just didnt know why it was giving me #text

wouldn’t it be easier to change a className on the parent and use the cascading power of CSS

and the first item following it (which might contain just the line break character or other whitespace in the source)

how do i do that

what tag are you trying to access inside the parent div?
inputs? that are checkboxes of class “foo” ?

var children = this.childNodes; for (var i = 0, childLen = children.length; i childLen; i++) { var myChild = children[i]; if (/(^| )content( |$)/.test(myChild.className)) { myChild.style.color = “green”; break; } }

Maggi – nice

should give you an idea

does childLen get declared locally or globally with exactly that syntax?

locally

the comma separates multiple “var” s? cool

e.g. var x, y = “Foo”; alert(x); // “Foo” alert(y); // “Foo”

im just accessing a div

err
var x = “Foo”, y = “Foo”;

x = y = “Foo”;?

does var x=’foo’, var y=”foo” break the for() structure?
grimeboy – would you actually ever write that in real code?

var x = y = “Foo”; also works
not sure, try it
and yes, it can be practical
e.g. ele.onmouseover = ele.onfocus = myFunc;
just take a look at my example and adjust it to your needs, by the way, an ID shouldn’t start with a number, it’s not valid

hello excuse me, I have a question about printing
already googled for solution but did not seem find it

developing Firefox extension in Javascript — im working with contextual menu — and have object at document.popupNode — but how do i get that object’s document?

document.all

http://www.jboss.com/index.html?module=bb&op=viewtopic&t=114526

(kidding)

many thanks to any help!
nobody has a solution? Thanks in advance!

hrm

anyone have a clue about my RegExp question?

what was the question again?
not sure if I’d be much of a help tho, reg exp is not one of my strongest points ;p
you could try window.open(“…”).print();

I have a regexp match that returns the same value multiple times – i iterate all the matches and run a global replace on the text for each match

What are you trying to do.

how do i bind this window.open(“…”).print() to a button?

the 2nd+ occurrence of a specific match value are entering the global replace step even though they’ve already been done

sorry for the stupid question, i’m really clueless about javascript…

i was wondering if there is a way to return only unique matches

What are you trying to accomplish?

`paste

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

(Please, no code, just give me an example)

um… hold on

refToBtn.onclick = function() { var doc = window.open(“URLHere”); doc.print(); return doc.closed; };

input type=”button” value=”Print” onclick=”window.open(“…”).print()”

;D

lol
you and your fancy code

yes

big thank you!

it’s not that fancy

big thank you too!

you’re welcome
I havn’t tried it tho

np ningning

so try it first

i have a formatted list from a java bean, how to bind thid list to your “var doc” ?

“MikeD” at 71.6.194.243 pasted “prevent duplicate effort of global replace on redundant matches” (13 lines) at http://erxz.com/pb/3781

and what should i write for the URLHere?

I let you guess that
;p

the use of the done object accomplishes what I was looking for

I believe you can only print a whole document with the print method

fatbrain – i don’t think i could have explained that without code

Hi all. I’m trying to write a scanner according to ECMAScript 3rd edition. It’s fully working so far, except for regexps. I’m really lost on how to decide what is a regexp, and what is a division, or division&assignment operator. I can’t find anything in the standard. How should I be doing
this?

well, you could give me the source-string and the value you want when the parsing is done.
But I get what you want to do.
It’s alot easier than you think.

really? please explain

var content = { fname: ‘foo’, lname: ‘bar’ }; ‘@@fname@@ and @@lname@@’.replace(/@@.*?@@/g, function(s) { return content[s]; });

undefined and undefined

Any recommendations for standalone drag and drop library (no toolkits/frameworks)?

var content = { fname: ‘foo’, lname: ‘bar’ }; ‘@@fname@@ and @@lname@@’.replace(/@@(.*?)@@/g, function(s, f) { return content[f]; });

foo and bar

Did you get that?

what is “s” ?

it’s the whole match, e.g. ‘@@fname@@’ where f is the first matching-group i.e. ‘fname’

that’s very cool, thanks

np

i was unable to make that work in a JScript environment – most likely because Microsoft …
no matter

hihi

Hi Jan-

what’s the difference between using the new keyword to an object constructor and calling a function that returns an object?

if the function that returned the object did so by “new-ing” it, then there is very little difference
if it gives you some pre-existing object, then there’s a big difference
so i guess the answer is “it depends”
was it you who had the cool link about events and “this” with the sample of the Prototype bind function?

Guys when doing async javascript and sending values over $_GET how in the world do you retain the format of new lines?
it sends
one
two
as onetwo

npoe
nope, eben

but i need to process it and output it as seperate lines

dont use new line as a separator?

how do i do it then

wait

sepArate

what are you doing with the returned value? is it html? xml? js?

ajax

:/
wrong answer ….
what is the type of the ajax response?
errrrr
what is the type of the ajax response? are you expecting something that yo’ull treat as data?

i need ajax to take input.value that has stuff in lines
and not post it as $value=thisisnotonsamefuckingline

what does “ajax” mean to you

oh jesus.. prototype ajax.update call

what?

ok i dont use Prototype
typo, meant to address aleksey3

what about it?

what about what?

hey how can i dynamically change a css style? element.style = … does not work

change properties of the style object, dont assign directly to style
e.g. element.style.backgroundColor = …

k. thx.
are the names exactly the same as in css?
like border-color, border-width etc?

yes except where they have hyphens
i think those are camel-case
borderColor, etc.

anyways
answer is escape()

k. thx

grats on consulting the documentation after asking in channel!

uhuh. k

there’s also a special case
which is float
becomes cssFloat
except in IE

k thx.
don’t need float atm though
have you guys experience with canvas?

i have a var in javascript e.g var_test = “testtest”… how could I put another variable onto the end of that one.. e.g. in php it would be $var_test = “testtest” . $other_var;
?

var_test = “testtest” + other_var;

thanks

welcome

is there a simple string function that can be used to determine if a string contains a specific value anywhere in the string? For instance, I want to evaluate a string that reads “blahblahSOMETHINGblah” and respond if SOMETHING is found within the string (sorry for the bad example)

Is there any way to grab the values of inputs in a form as an array? I know that can be done if it is passed to php, but I want to process it with php.
*sorry, i meant to say that I want to use ajax

derenrich, no automatic method
you would have to write one

argh

but shouldn’t be too complicated
just stick all the form elements into an array then simply access their value or inner values
but you know, there are various other scripts already in circulation to do this. I think there are plugins for mootools and jquery at the very least

It isn’t a simple array at all (it’s 2D) and I planned to encode data in the array names and dimensions
as in name=”education[1][school_name]“
something like that

then it’s not an array
it’s a hash/object contained within an array
don’t confuse the two (no, really don’t)

In ph they are both arrays
*php

not in javascript

thus the problem

js doesn’t have associative arrays

Well, it has hacked objects

you use objects instead

yeah

tag into the head of my html page using js, is there a way I can tell when the script has been loaded without added javascript code to the script file?

Don’t think so

Luminari, use an object
in your included js file

I have objects there

simply have it create window._custom_object = true
then you can do a check if said object exists

.match property can be used to validate if a string contains a specific value

basically you mean write a loop that keeps going till the object exists?

Wait, browsers won’t parse script tags that are created by js afaik
I had that exact problem this morning

they definitely will
as long as I wait long enough for the script to load, I can

Maybe that was the problem

you can insert script using dom methods

I didn’t even realize it was a problem until just today when I tried to use the data right after added the tag

if it’s an external file (if I remember correctly)

thats how I did it
I just have to make sure the script is loaded before I can continue

Luminari, the only thing I can think of then, is to have your added script call a function in the main script

http://pastie.caboo.se/82578

or if the main script is adding the new script, write an oncomplete function that’s called once the script is appended to the page

var myStr = “abcSOMETHINGdef”; if (myStr.indexOf(“SOMETHING”) != -1) { // do something }

I was hoping to avoid that because the script actually contains localizations, which I didn’t want to confuse since non techies may end up writing them

Luminari, so write an oncomplete script in the code that actually includes the file

don’t completely follow

If I do var AB = {} then AB.options = {…}, then var BBB = new AB;, will BBB.options be set?

thank you. I’m finding that var myStr=”abcSOMETHINGdef”; if (myStr.match(“SOMETHING”)==”SOMETHING”) {// do something} works as well, though the indexOf method might be cleaner…

`js ref

http://developer.mozilla.org/en/docs/JavaScript , http://devedge-temp.mozilla.org/central/javascript/index_en.html , http://phrogz.net/ObjJob/ , JScript@MSDN: http://tinyurl.com/9pk3l , www.crockford.com/javascript/

if i have temp = {a: 0, b: 1, c: 3}; how can i add ‘d: 4′ to the object?

temp.d = 4

ahh. easy enough
thx

yup expando properties

is there a way to pop a specific value off of an array?

you mean by index? no.
I prototyped a method on for it
You c
You can have it if you want

um, I mean if I have array ["poem","shortstory","novel","other"]
and I want to do this.. (pseudocode)
newarray = oldarray.pop(‘novel’);

Fair enough. Don’t think it works like that.
Write yourself a quick method to do it and prototype it onto Array.

right, that’s what I’m working on figuring out
like ruby array.delete

anyone know of a simple way to clone a select box?
with all its options and such intact?

innerhtml?

ah, found it, in the prototype library array.without is like ruby’s array.delete

http://www.careerbuilder.com/JobSeeker/Jobs/JobDetails.aspx?IPath=JRGCM&ff=21&APath=2.21.0.0.0&job_did=J8E27R758MWRHR3QTG9&cbRecursionCnt=1&cbsid=47a3d5d17ecc4586953287951ed6777d-238780828-JP-5&ns_siteid=
extreme web dev job

just what I want at my job, IED’s

Does anyone know a good looking, easy to use, DHTML calendar?

What do you mean?

for a form

You want to put events on a page, or do you want to select a date?
`calendar @ collink // no idea if it’s any good, but someone put it in the bot at some stage for a reason :-D

http://www.dynarch.com/projects/calendar/

I’ve tried that
it looks good
but it has an issue with recursion

Coo. Iraq coder.
(or the ability)

Is it possible to have multicolored text inside a textarea element?

no

Ok. It was just a dream :P

ok. how can i get the length of that object now?
temp.length is undefined

onClick=”location.replace()” –how can i make it open in same window onClick=”location.window()” ?

onclick=”alert(‘Press Ctrl+N please’);” :P just kidding

hey little question. is cloneNode faster than createElement?

window.open(document.location); ?

given the following:
var temp = {a: 1, b: 2, c: 3};
how can i find the length of temp?
just iterate through a for loop, or is there an easier way?

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:splice and http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:indexOf#Compatibility

thanks Maggi – I found a method called .without in the prototype library

temp is an object. It HAS no length

How can he find how many elements it holds?

yeah. i’m aware of that, but it has 3 key/value pairs. surely i can get that number from the object

yes, cloneNode is faster than createElement

So I want to do something like if (m != null) {m.close()} but soon as I reference m to see if its null it gives me a m is not defined error, any ideas?

var tmpLen = -1; for (var i in temp) { tmpLen++; } alert(tmpLen); // 2

yeah. that’s what i ended up doing. figured it was easier to count…

not quite right
`for/in @ atoponce and Maggi

for/in: Loop over keys in an object, skipping prototypes: for( var i in Obj ) if( Obj.hasOwnProperty(i) ){ … }

ah nice that someone came out with a simple fix for the for..in crap

ah, yes, nice

i will stick with the regular way of iterating

regular?

if (typeof m != “undefined” && m != null) { m.close(); }

woosta, i meant my regular way i guess
thanks maggi

Letting prototypes creep in?

how much faster?

woosta i dont see how prototypes creep in with for(var i =0; iObj.length; i++){}

Erm .. coz that’s not an object .. that’s an array
significantly

even faster than creating the elements using html-code and innerHTML?

No .. but at least it WORKS

ok. thx.

good point

Object.prototype.Foo = “Bar”; var myObj = {}; for (var i in myObj) { if (myObj.hasOwnProperty(i)) { // Foo is not taken into account, correct? } }

correct

awesome
does IE support this?

yes

great

You don’t need that extra set of braces
for () if () { .. }
will work just fine

yes, just being strict there

return Validation.get(‘IsEmpty’).test(v) || !/\W/.test(v)

hi all

whats !/\W/.test(v)
it’s regex for alphanum ?

var h = my_element.style.height; – how can I convert it to a numeric value if I for example got something like “500px”?

tests if v doesn’t contain non word chars

i need to replace this with something that accept an adress

address?
email or snail?

666 HellStreet

erm .. the best you’ll get there is just making sure it has SOME value

use parseInt or parseFloat

can’t i just add the ‘SPACE’ char to this regex ?

thanks

/^\s*$/.test(v)

!/\W\s/.test(v)
what about this ?

no
google for “JavaScript regular expression”

http://www.commentcamarche.net/javascript/jsregexp.php3
well your’s work with anything lol
[many numbers] [space] [many char/space]

always include optional braces
it’s a language specification error to even make them optional in the first place
NO OPPOSING VIEWS ON THIS POINT ARE ACCEPTABLE

I’m in agreement in this case.

tyvm

All braces or no braces.

no braces?

No middle ground as far as I’m concerned.

if (/^\s*$/.test(v)) { // v is empty or contains only whitespace chars, error handling here blah }

then how to define blocks? sytactically-meaningful indentation?
tha’ts a mistake too imo

well, blocks can be useful :P

Nah, I like meaningful whitespace.

[0-9] [A-Z]
anyways, ill just write required
and regex it with php
damn i hate js

bullshit
Please don’t spread FUD

It’s not fud, it’s obviously strongly held personal opinion.

I don’t mind his opinion, but it’s most certainly FUD that is was a “language specification error”
They lend no semantic significance to a single action
Thus they are not required
It *annoys* me that they’re needed in other languages .. but I’m not going around claiming that their need in other languages was an error

What are we talking aboot?

if i have a variable referencing a uri, like x = http://test , can I get the source in txt form for the uri?
i want to do some regex work on the uri to get some data out

You can, but only if the URL is in the same domain as the calling document
Thanks, but no thanks. Plenty of leftover Indian in the fridge

do you mean domain as in same file system or as in http://

Is it possible to limit the types of chars I input in my text box?

mmmm indian

“leftover chinese” is a phrase which no-one in my house could parse

http://this.bit.here/

http:// is the protocol.

woosta, no, it’s an external uri

Chinese as in “chinese food”

http://this.bit.here/but/not/this.bit

Or at least the close approximation served by takeaways in Essex

Then no, you can’t do that

you have to use a server-side proxy then.
(which must reside in your domain)

^^ And make sure it’s no an open proxy!
(no cross-site XHR was supposed to be a security measure (bleugh) .. instead it has led to thousands of open proxies being exploited by spammers)
(no cross-site XHR was supposed to be a security measure (bleugh) .. instead it has led to thousands of open proxies being exploited by spammers)
b(no cross-site XHR was supposed to be a security measure (bleugh) .. instead it has led to thousands of open proxies being exploited by spammers)/b
off

Curried chicken, natch.

reboot, brb

Mmmm. Full now.

JAN!

DAVEMAN!
Er.

Hello Jan

how’s Daveworld

Pretty good, Jan, … pretty good
Busy as all hell, so, the usual, I guess
Woman got a promotion
How’s your work going? :P

It makes me get up superearly and sleep when I get home.
I’m getting a bit tired of it.

Jan, well, hopefully there’s SOME reward to it…
say… something to pay the rent, perhaps?

how do i get the value of a radio button?
i tried using .value but i’m getting “undefined” on alert;
is it similar to a select where i have to take selected index or something?

are you sure you’re doing .value on a radio button and not a NodeList?

um, pretty sure, what’s the difference?

form.elements['status'].value

onclick=’document.body.style.fontSize = “18″;

are there multiple radio buttons with the same name in your form?

nevermind
forgot px

yes indeed there are, that’s the way radio buttons work no?

then form.elements['status'] will give you a list, not a radio button

and i need the value=”" attribute of the one that is selected
ok
`js ref

http://developer.mozilla.org/en/docs/JavaScript , http://devedge-temp.mozilla.org/central/javascript/index_en.html , http://phrogz.net/ObjJob/ , JScript@MSDN: http://tinyurl.com/9pk3l , www.crockford.com/javascript/

loop over it and find the one which is .checked

does javascript have foreach?
`js ref radio

for(var i = 0, l = yourList.length; i l; i++) { var item = yourList[i]; }, or use soemthing like http://dean.edwards.name/weblog/2006/07/enum/
*something

k

Hello

what do i use to do a simple ‘y/n’ dialog with an OK/Cancel button?
does alert() support that or do i use something else?

confirm

`js ref confirm
bah, anyone? ref on that?

http://developer.mozilla.org/en/docs/DOM:window.confirm

`dom ref confirm

Displays a modal dialog with a message and two buttons, OK and Cancel. (http://developer.mozilla.org/en/docs/DOM:window.confirm)

confirm etc are DOM methods
(For some bizarre reason)

strange if they where part of the js-language.

yeh, quite bizarre reason, but whatever

what else would they be

Application Object Model

Hoenoes!
ZOMG!

hi all
have pb with IE nd this script
http://paste2.org/p/5210
it add me an empty value to the list
any idea?
pb with leftlist.appendChild(newOption);

uh, variable names that start with ‘var’?

yes what’s the pb?
it works fine with IE
euuh
with FF and opera
but not with IE
what’s the pb?
heho

var var; – teh leet syntax. or maybe you gaiz di’n get the memo

why on earth would document.formname.submit(); get me the error that “this object doesnt support that property or method” ?

`js forms
use document.forms['formname'].submit()

i shall try o7
no dice
document.forms.formname and document.forms['formname'] are interchangeable

fhat is id of your form ? is it really is formname ?

but either way it says my form cant be submitted…do I need to have a submit button for it to be submittable?
no, its getfile but i tried it with getfile

no, you do not have to have submit control

http://paste2.org/p/5212
same pb

strange. can the javascript be after the form for it to work?

it add an empty row to the select list
rightlist.item(rightlist.selectedIndex).text cotain a null value when i put alert
with FF and opera all it’s right
the pb persist with leftlist.appendChild(newOption);
newOpetion Contain a right value
but when it append it to the new list, it append an empty valuee
http://paste2.org/p/5212

anyone knows those image gallery scripts that fill the screen with a semitransparent png?

look jquery library

k

so i have an action that needs to fire on a resize event … however i’m not exactly sure how to go about capturing this event in IE6/7 since it continuously fires the event. Where as in FF / Safari it fires it after the user has finished resizing. any ideas?

onresize=function(){ if(window.resizeTimeout) clearTimeout(window.resizeTimeout); window.resizeTimeout = setTimeout(function(){ do whatever }, 500) }
Now it will only ‘do whatever’ 500ms after you stop resizing
in IE it will constantly set and reset the timeout
in FF it will just be set once
In both, it will call the handler function just once, 500ms after you stop resizing

whats hte css property that greys out an entire div or such? like in lightbox?

^[0-9a-zA-ZäöüÄÖÜß-\+\*\~\#\^$\§\%\€\ ]{10,250}$

this channel is 99% dead btw
where’s the real freenode javascript chan

99% dead? saywhat?

from a page? is there something along the lines of a document.removeElement() or document.deleteElement() or something?

#css ?

s/99% dead btw/not responding to me INSTANTLY LIKE I DESERVE, DAMNIT/

background: gray; ?

lol

that effect is often acheived by overlaying an element over the whole viewport and making it semi-transparent

Woosta, thank you

insin; hmm i see
so i need to find my elements position and size

is there a javascript way to quickly see if an array contains an item?

var yourNode=document.getElementById(‘yourNodeID’); yourNode.parentNode.removeChild(yourNode)
no

a particular item that is.

well
`index of
`indexof
`indexof array
bah
`array indexof

indexOf is only supported in JS1.6+ .. so you can optionally add it as a prototype to earlier versions: if(![].indexOf) Array.prototype.indexOf = function(needle){ for(var i=0; ithis.length; i++) if(this[i] == needle) return i; return -1 }

a valiant effort, Woosta

FINALLY

ah, bested!

opacity (W3C), filter: alpha(opacity) (IE), -moz-opacity (Mozilla based), -webkit-opacity (Webkit based, Safari…), -khtml-opacity (KHTML based, Konqueror…)

`css opacity
learn css opacity = opacity (W3C), filter: alpha(opacity) (IE), -moz-opacity (Mozilla based), -webkit-opacity (Webkit based, Safari…), -khtml-opacity (KHTML based, Konqueror…)

OK

sweeet

pretty much every modern browser supports the W3C variant (CSS 3) except for IE (this includes version 7)

ie supports nothing… ‘cept activex trash :p

learn css opacity = W3C: opacity:0.5; Gecko: -moz-opacity:0.5; Webkit (Safari): -webkit-opacity:0.5; KHTML (Konqueror): -khtml-opacity:0.5; IE: filter:progidXImageTransform.Microsoft.Alpha(opacity=50);

OK

learn css opacity = W3C: opacity:0.5; Gecko*: -moz-opacity:0.5; Webkit (Safari)*: -webkit-opacity:0.5; KHTML (Konqueror)*: -khtml-opacity:0.5; IE: filter:progidXImageTransform.Microsoft.Alpha(opacity=50); (* = recent versions support W3C)

OK

how do i get the position of a div after i have its object w/ document.getElementById

how can I get the id of an element?

?

getAttribute(“id”)

thanks, Maggi :-)
sorry about that.. :P

Hang on kalve .. WHY do you want the ID?

my fault

position? At a guess you mean offset .. in which case offsetLeft and offsetTop .. which is an offset from offsetParent

hmm does firefox not render border-top-style dotted ?

i found a function
findxywh()
next i need to figure out how to set x, y, w, and h.

With CSS

hey everyone

i’m using mootools Drag.Drop .. and when I drop the item, I need to get the id of the element I just dropped.

hey look at this
http://www.developpeztn.net/verboz/
have pb with IE

but it didn’t work with getAttribute(“id”), probably because the element is a “clone” of the original element.

the question is WHY you think you need it

Woosta, http://www.developpeztn.net/verboz/
any suggestion?

I need to send the ID to a script using an ajax request

OK, we’re getting closer .. why does your script need the ID?

to know what was dropped in the “cart”, and update it accordingly

So you’re trying to use the ID to store data
but because the drag clones the original node, it’s gone
(as you can’t have more than one instance of any ID in a document, a clone will not clone the ID)

ok

is there a way to refresh a page via js

window.location=window.location ?

would you mind take a look at my code and see if you have a quick suggestion on how I could pass that information?

hm what was that’
?

string value
not id

location.reload();
you could store it in a custom property (not attribute) of the clone
or give the clone the ID + “Clone”

^^ kalve .. talk to Maggi .. and remember: ID is not for storing data
NO
don’t store data in there

you could then just strip out “Clone” but I’d go with a custom property
anyway, dinner time

is there a way to define custom property in html? or should I first use custom property on the element (from source elements ID) when I clone the first element?

Hey

ok, say I have a table and onclick on I want to do something to that cell that I click. How do I get the value of the cell that was clicked?

I am just getting into java script
I bought a book, I was wondering though if any of you guys would suggest a good one

?

OnClick

antihaxer-: what?

case sensitive?

then this.innerHTML=”new what not”
right?

never use uppercase in html

I was wondering if you could suggest a good book for learning javascript

antihaxer-: no

lol

i don’t know javascript :p

This channel is ##javascript?

are you a programmer? or a web designer?

vise versa ?

do you have a programming background?

Does anyone know of a good book for learning javascript?

oops
i meant to refer to antihaxer- not kalve

I have done a lot of programming in PHP, and a lot of web design
ok

Me?

antihaxer-: it depends on what your background is

Yes, i do have a programming abckgrounf
background*

sup

I know some c and a bit of other languages
I also know html

hello

hey

i know the basics

how is that chat going? :p

arrays, variables etc in all the languages

its going great
just about to ask a question related to it, actually

vinse, so suggestion on a book? For programming, not web designing.

msg = msg.replace(‘+’,”%2B”); If msg is “lol+lol” it will replace with “lol%2B”. But if msg is “lol++++lol” it will replace with “lol%2B+++”.. why is this?

antihaxer-: check out www.crockford.com; he’s a good technical resource for javascript

K, thanks, bookmarked, but for an actual book?

antihaxer-: plus he has a specific book recommendation
though i dont remember what it is

ok, thanks

hey everyone

Nearly all of the books about JavaScript are quite awful. They contain errors, poor examples, and promote bad practices. Important features of the language are often explained poorly, or left out entirely. I have reviewed dozens of JavaScript books, and I can only recommend one: JavaScript: The
Definitive Guide (5th Edition) by David Flanagan.

now i’m generating these table cells with insertCell(); how do I add an onClick event to them?

give it s a regex, not a string, then make it global
replace(/\+/g, ‘%2B’)

okay thanks dude Lemme try it out
Last time I did /\+/ but that didnt work
but I suppose that global thing will help

before you insert it just do myCell.onclick =

ok onClick is an attribute
cool

should be all lowercase [some browsers dont like it if it's not]

dont capitalize it

woot! It works
http://atomiku.com/scripts/ajaxchat/chat.html
feel free to try and break it
I need to get this thing fool proof before I release it D:

pfft

its pretty secure atm

You can only test for foolproof by giving it to fools

just slap a “beta” on the label
and release with impunity!

XD
I suppose so
but if something bad went wrong

it’s good enough for google …

my reputation would be lowed
lol
*lowered

have you fixed your sql injection? :p

why do i have to hit enter twice to send a message on that? lol

what browser?

Firefox/WinXP Media Edition

doesn’t seem to be working
x.cells[offset].onclick=”table_edit_cell(this)”; x.cells[offset] is the cell I want to assign my onclick to
but it seems to be not working

heh
try … = function() { table_edit_cell(this); }

what does that do?

it creates an anonymous function and assigns it to the cells onclick property

I don’t think thats my problem

when you do function foo() { … its the same as var foo = function { …
yes it is, what you just showed wont work ever
you assigned a string to the onclick property
onclick has to be a function
wait

that should have been the same as onclick=”table_edit_cell(this)”
table_edit_cell(x) is one of my functions

no
table_edit_cell is a function
“table_edit_cell” is a string

ahh
yes
so when I set mycell.onclick= to what?

function() { table_edit_cell(this); }

so that sets the onlick property to a function instead of a string
regexp in javascript looks like a pain

ya know in js, when you go back
is it possible to keep the form elements in place ?

how can I determine the coordinates of a pop-up window after it has been opened? Say I would like to know if the user has moved the window around…

can i do a triplicate equality check? $foo == $bar == $baz; to see if three vars are all the same?
i don’t suspect i can, but i figure maybe javascript will do that
er, i guess that’s sort of PHP syntax, remove the $’s

with or without $s you cant do that

just break it into two statements
for example if A=B and B=C
then A would = C

it will evaluated the first comparison to some boolean value and then compare the result of foo == bar to baz

$foo == $bar && $bar == $baz

DO THE NETSPLIT
that never gets old

whats going on?
why is everybody leaving an joining so fast?
is it just my client?

some wierd irc network freak o ut
happens fairly regularly

how can I determine the coordinates of a pop-up window after it has been opened? Say I would like to know if the user has moved the window around…

element.offsetTop and element.offsetLeft will work i think … the element has to be a child of the document body though

I have a question concerning table manipulation, specifically how to dynamically update an image placed in a table. Forget for a moment that this is not the ideal solution (I would much rather set the page up with div’s, but thats not an option). I have a column of check boxes and I want to
respond to a check box being checked and change the image. I have a function I’ve written to respond to the check box and it’s

working, but how do I update the table of my choice with the proper image?!?

create an img element and append it to the td element you want it displayed in
i’m answering way more questions than is justified by my actual javascript knowledge
hopefully some one will read all this and correct me

ok I will look into it, and it is a child so that works out =]

regex1 = new RegExp(“/^\input.+\$/”); is that proper syntax for a regex?

tags. Can you give me a for-instance/example of what you are referring to?

are you familiar with DOM methods?

yes

regex1.test(“\input”) should be true

you can use DOM to create an element of a specific type, ie img

ok, that’s a good place to start. I will do some research on this.

ok can’t figure this out

I think I’ve found a blog that goes into some detail. Thank you for the direction

np

hey everyone

http://www.regular-expressions.info/javascript.html
from my bookmarks

yeah I’m reading it right now

hey is there any routine available to javascript to decompress data? like deflate?

Not built in.
Why do you want to do that, though? The browser should handle compression and decompression en route.

just curious
i’m trying to do inline html images

Ah. Was just having a code-hiding discussion in #python, and when people ask about compression and decompression in Javascript, I automatically, cynically, think: “oh, that person’s just trying to obfuscate code. Let’s try to deter him from doing that.”
Ah. data urls?

nope
i have a javascript string that contains the rgb data

You could use one pixel table cells. :-)

its lz77 and base64 encoded
i draw to a canvas and for ie i fall back to table cells

How’s the performance on that?

i also had a version that used divs. but it was way too slow

Have you tried the canvas-for-IE implementation?

quite bad ;-)
and occasionally the browser crashes

What about the last technique listed here? http://www.elf.org/essay/inline-image.html

i’ve read that already
and it looks quite wastefull having to escape all the data

And it doesn’t work in IE anyway.

my code should also work in ie, but unf. i couldn’t test it yet with it

It seems easier to just let the server generate the image.

but its cheating! ;-)

Well, it could be a simple program that slurped the urlencoded image from the URL and echoed it with the correct mimetype. :-)
Of course, you run afoul of URL length limits that way.

here is a taste of how slow it is: http://77.57.2.131/~schwadri/peep.html

Yow
Just over three seconds

CHOCOLATE RAIN!

really?
weird
mine was so much slower
hm the table version seems to be broken
hey is it possible to delete objects just like in c++?
delete somevar?
or var=null?

`js ref delete

The delete operator deletes an object, an object’s property, or an element at a specified index in an array. (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Operatorspecial_Operators:delete_Operator)

try searching the docs before asking

k. thx
do u use ie?
oh
lol

hey everyone, i’m having a problem correcting the offset in IE7
http://projects.darkcitydesigns.com/bcp/
every submenu is supposed to be 65px to the left of where it’s at
when i try to fix this in JS, nothing happens
i could set the style.left property to 9000px, nothin
and the worst part is i don’t have access to IE7 at all
because i’m using a mac
anyone?

hmm trying to get a dynamically created form to post
and its not sending the data I want

is it possible to load an entire style sheet dynamically with javascript?

algum brasileiro?

there’s no reason to, CSS has a statement called @import

how could I import a css from a drop down menu?

is there any way to make a text input box without the border?

CSS
I do it here .. with an action on focus to put them back: http://rick.measham.id.au/paste/drag-n-drop.htm

Comments off

hi im experiencing an extrange behaviour with a call to an external file with JavaScript code i have to load two

I found that document online, but how can i integrate these changes into my application: http://groups.google.com/group/Google-Maps-API/browse_thread/thread/b74bad232d8d2e28?hl=en ?

hey if I have a number that has a decimal point in it… is there a method to chop the decimal point and everything to the right of it off?

How can Reddit be so fast with Ajax?! Digg has a clear delay every time you dig/bury something, while Reddit just instantly switches colors and apparently registers this change. How can this be?

sure that its already saved?

a guess: because the colorswitching is done purely at clientside (everything preloaded) and the “saving” of the setting is done via AJAX in the background

Well… um…
I… guess.
Then Digg and all other sites must be very badly coded.
Well, in Digg’s case it’s obvious

very badly coded?

Yes.

var x=document.createElement()… var y=x; – is Y a copy of X?

Since you “feel” the delay.

if Reddit changes colour immediately before waiting for a response from the server to confirm that the change has been made then I’d say Reddit’s not too hot

no

in all browsers? are you sure?

yes

hello

uh
when i do this
http://pastebin.com/m2ffd5c08
the select field has two rows, first says Fist and second is empty
why is there a empty row O_o

Can anyone help me on a little row visibility thing? I simplified everything to the simplest way that is possible. Just view the page in FireFox and click on ‘Merk 1′, and see what happens. http://www.q13.nl/libohorloges/

its an issue @ opera xD

nevermind, fixed
Firefox seemed to like display = “” more than display=”block”

‘mornin

hello

?

looks ok

hmm, for some reasons I don’t have the alert though

, is it possible to change this var from within the body?

Like onclick

you can’t define a var inside the head tag, js is not that tightly coupled to the DOM
it will become a global variable if it’s at the root of a script file

is in the head of the document

does that make it global?

it doesn’t matter where you put the script tag

So how do I make it global?
in the root of script file?
How do you mean?

var foo = bar; outside of any function, or omit the var prefix (in which case you can do it inside a function body as well)

hmmmm
because my var is defined outside of the function[s]
so i just hafta remove the var!
Not working, hmmm
Raevel, I defined num = 0; outside of the funtion and when I click it is not changing
Raevel, does this look right:? onclick=”javascript: num = 2;”

level9wiz don’t put “javascript:” inside events

I just noticed that on google lol
Hmmmm
still not working
Not getting any js errors from the browser tho. js is on and working on other componenets

Hi. Is there a simple way to catch the event of clicking on a checkbox?

Raevel, onclick=”num=2″ ? That should work right?

is there a difference between an object with numerical properties and an array with a sparsely populated index?
(are numerical properties even legal?)

an array has the array prototype associated with it

`js watch

and the ahref is overriding it

and, properties are always toString:ed

var obj = { 13 : “return”, 9 : “tab”, etc }; alert( obj[ charcode ] ); ?

looks fine

no, illegal! you go to jail!

if not, then use an array
it’s legal

mutilator – i ask because my coworkers tend to clone my code a lot, so if it learn later that I did something that isn’t quite right, i’ve institutionalized bad code practice

heh

i know, cloning code is already bad practice

a= {1 : 23}; a[1]; is fine, at least in the ’shell’ bookmarklet

i’d use an object for that, since the property names are of significance

Anyway to make the onclick event override the ahref? I need the href for rel=”ajaxtab” but i want to use onclick to handel some functions

a href=”" onclick=”fCall(); return false;”

Raevel – that’s what I was thinking, just wanted to check

does anybody know if the [object].watch works in IE6?

it doesn’t

thanks

frames.parent[0].location.substr(0,20) -doesn’t work?
when i console.log the “frames.parent[0].location” i get http://www…../main_content.php href=http://……main_content.php
frames.parent[0].location.toString returns “toString”
I want to check whether a url of a frame is as expected

.location.href

ah
yes was about to say .href etc don’t return a value
thank you

hey, i have a simple form (name:, function:, submit..)
i would like to add a “Add another user” button
so that JS print another form with a specified id

toste – do you really want another form, or another input inside the current form?

another input

hello, can I add a method to a DOM tag, as I ‘d do, for example, for a string string.prototype.myfunction = fucntion() ?
I tried form.prototype… (for the from element!) but get an error: form is not defined :/

section?

I have to do an alert from inside the page, and that’s an included php file, so i cannot modify head

what’s the javascript function to scroll to an anchor?

you’ll have to find y coordinate for target anchor
then, use window.scrollBy(0,anchorY);

are you freakin serious?
you can’t do window.location or something?

“wnix” at 71.6.194.243 pasted “function to find Y coordinate from object” (16 lines) at http://erxz.com/pb/4126

no, it should work in the body too. But if you want access to a DOM element in this script, the script should add after this element to the body.

http://erxz.com/pb/4126

nvm, prototype has scrollTo
woot

or use eg. an event handler window.onload = function() {….your script… }

http://redditmedia.com

hi! can someone give me a hint on how to catch a key event (like keypress/keydown) in a certain svg object?

Hi all. How can I use the value of a variable in a regular expression in javascript? var x = ‘taco’; othervar.match(/x/); clearly won’t work

new RegExp (x);

big thanks leobm

I think I understand. thanks.

hey, a quick question, can javascript access contents on a CD?

no

not from a browser.

hm.. thanks
unfortunate..
any idea how i can load information from a cd like a file with records and display it in a browser?

in jquery?

like let’s say my site normally retrieves data from a mysql database, but if i were to bring a laptop to somewhere with no internet access, i would like to be able to get some of the information into a CD and brining it around and still be able to do presentations using information from the CD.
is that possble at all?

$(“#id”).text() and $(“#id”).value and $(“#id”).html() does not work
Oops sorry – wrong channel

an alternative could be a signed applet.
or webstart application.
search in google for the keywords ‘java webstart” or “java signed applet”

hmm, but that means i would need to code a bit in java..
alright, thanks for the ideas leobm, i’ll be to reconsider my options
s/be/have

Im having problems with array.forEach-command, it does not seem to step through all items in my array but rather a random amount of them. Has anyone played around with this?

can you reproduce it?

yes

http://java-avm.sourceforge.net/

thanks leobm

java 1.6 has a javascript engine included. you can code javascript and can use java classes. look at
“Scripting for the java host Platform” google

Im using forEach because I do not add items sequentially but at scattered indexes, so I need to loop through the array and get the index where each item is located at.

leobm, thanks for the advice and help

the fact that you’re using an array probably messes that up
use a regular object instead

how do you mean?
I have been thinking of using Hash instead, but a regular object is a new one

an array represents a list, if you scatter the indexes it’s not a list, it turns into a dictionary

how do I check if a variable is declared?

typeof theVar !== “undefined”

ah cool ty

“raar” is not an english word

raar is undefined
I didn’t know how to check before
‘document.all.whatever.style’ is null or not an object” – what am I doing wrong; http://www.french-property.com/scripts/tom/edit_mails.php ?
firefox works fine with document.layers

you should use neither of the two

hi

oh? what should I use instead?

it depends on what you are doing, but document.getElementById is one alternative

I’ll give it a shot, ty

(typeof x!==undefinedl)
ups

I made an web application based on Chameleon GIS environment, my problem is that I want to make floating window which contains the keymap. I already made most of that part I can move the keymap layers into the floating div, but if I try to marquee the div that contains the keymap away from
the original position it loses the framing functionality

I mean I can’t mark a part of keymap to be displayed on the main Map, except if I move back the floating div to the original position again

Does anyone have any ideas about why http://httux.htgm.no/statviewer/ just refreshes once and then stops in IE? The JS is http://httux.htgm.no/statviewer/statviewer.js (jquery)

hi, is there any way to get the document height? (not window height)

the main problem that the Chameleon make such stupid implementation of this part it just work with document.write, when it creates the keymap layers it scatters them all over the document

script language” (25 lines) at http://erxz.com/pb/4128

http://erxz.com/pb/paste so uh
ehr
http://erxz.com/pb/4128 why does this have results like x: 1.9000000000000015 // y: 0.7900000000000005 O_o

so I’m looking through google’s map code
look what I found…
if (“GMapEZ” in classes) { … }

lol

Here we are checking if a property named “GMapEZ” is present in the object “classes”.

ya I get it, its kind of clever. I didn’t know you could use the ‘in’ inside an if statemen
t

Probably because of the internal storage format for floating-point numbers.

oh boy…
i so hate computers xD

lol, this is funny
alert(["Your browser is not capable of displaying", "Google Maps on this page. Try using Firefox:", "http://getfirefox.com/"].join(“\n“));
they’re not a fan of just using \n in their strings eh?
such overkill

Search for the article “What every computer scientist should know about floating-point”. It’s floating (pardon the pun) around somewhere on the ‘Net.

That article is kind of intimidating for beginners…

That’s life. :-)

Wikipedia explains the same thing is a bit simpler terms.

document.write(“” + “script src=\”" + src + “\”" + ” type=\”text/javascript\”" + “/script”);
why did they split the from the script?

Probably because they were worried the browser will parse it as a new opening tag and they didn’t properly comprehend the concept of inline JavaScript.

:/

hm.. yes.. older browsers.. right
seems like excessive paranoia, but it can’t be that bad

so

It is stupid.

what happened to the “the computer only does what you tell it”? :P

I’m really laughing at google’s alert box

that wouldnt be true in this case
O_o

alert(["Your browser is not capable of displaying", "Google Maps on this page. Try using Firefox:", "http://getfirefox.com/"].join(“\n“));
the same *exact* thing could just be

All you have to do is use DOM methods, or if you insist on living in 1995, say <script instead of script.

alert(“Your browser is not capable of displaying\nGoogle Maps on this page. Try using Firefoxnhttp://getfirefox.com/“);
but I bet the guy who made it got excited when he learned what join could do
and wanted to use it

what happened to the “the computer only does what you tell it”? :P # what are you talking about?

LMAO.

Does anyone know if it’s possible to unit test Ajax?
…and if so.. what framework is good for such a task…

hi
how can I check the domain the user is navigating to on unload?

I doubt you can. Atleast I hope you can’t

how can one check if a value is undefined?

yeah, i was doubting it too.. I was telling a coworker it would probably be a security risk if you could

myVar === undefined
or

it would be possible to examine where they are going, see that they are leaving, and say “HEY! GET YOUR ASS BACK HERE!” and force them back :L(

thanks, wnix

typeof myVar === “undefined”

the first example did not work
alright
thanks

myVar === undefined works, as long as myVar has been declared
myVar === undefined

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

var myVar; myVar === undefined

true

function f(myVar) { return myVar === undefined; } f();

true

var obj = {}; obj.myProperty === undefined

true

typeof(something) == ‘undefined’;

true

that kind of defeats the purpose mostly
but thanks for playing.

“kind of defeats the purpose mostly”?

mostly

document.myForm.array[0].value, where array is an array of strings and contains the names of the form’s elements (to put it in a loop)?

depends what your purpose is mostly

because I’m not declaring the variables
so it wouldn’t help me
but the other one does

why not?

it’s cool

you can still test for them as properties of the global object

yeah, the other example works fine

this.myVar === undefined

true

document.myForm.array[0].value = “someValue”

no

“array” is not connected to the DOM.. right?
not directly.

myFormElement.elements[inputName].value = someValue;

deltab, hum.. I’ll try that

you shouldn’t use document.myForm, by the way
use either document.forms.myForm (or document.forms['myForm']), or document.getElementById(‘myForm’)
I represented those above by myFormElement

ie6 seems to be having problems dealing with inserting a row into a table using javascript
or is this a programming error on my behalf

deltab, what is myFormElement? the name of the form?

depends on how you are inserting the row probably

no, the form element
as obtained through document.forms.myForm (or document.forms['myForm']), or document.getElementById(‘myForm’)
or the form property of an input

new Insertion.bottom(“tblid”,…)

try using the table’s tBodies[0] instead
it looks like it checks for insertion into tbody and tr, but not the table

is there a cross browser compatible function to check pageYOffset?

you can’t read CSS values if they have not been set with JS before”

is this true?
pageYOffset — what’s that supposed to measure again?

what part of the page is visible
like when scrolling

so… the just the window height?
because that’s not what Mozilla says
“Gets the amount of top page content that has been hidden by scrolling down.”

ok well im looking for a cross browser version of that

this? http://msdn2.microsoft.com/en-us/library/ms534618.aspx

Agamemnus does scrollTop apply to the scrollbar on the browser as well?

hello~

i don’t know and the page isn’t opening anymore
hello

hi!

what’s up?

hi, getting started with Javascript – I can put a style property for a div in a var, but how to show the current value when viewing the page containing the div?
some simple plugin for Firefox maybe?

Does anyone know if it’s possible to unit test Ajax?

attachment_array = attachments.split(/,/,attachments); — for some reason attachment_array is not an array, hmm how can i makeit an array ?

so… is it all just people comeing here to seek help without anyone helping? ^^;;

..and if so.. what framework is good for such a task…

that’s right, Princess^^.
coppershade-org^…

you can’t read CSS values if they have not been set with JS before”

“unit test Ajax”?

Uh.. yeah. Does that sound right?

no, it doesn’t.
what are you talking about?

hi… does somebody knows how can i discover when a window is minimized and when it isn’t?

I guess I should say “integration test” but without opening/closing the browser eeach time
*each

ok so I’ll ask the question I am here for… =P

Selenium is too heavy for my purposes

BARBA_RUIVA, might be a bit difficult

so basically I am using javascript to do an animation and I want the page to go to another page at the end of it
but I don’t want to use like window.location.href = newpage or something

BARBA_RUIVA, look at the screen.height / screen.width values, the browser’s natural height and width window, and the current window size.

cuz that kills the back history -.-

window.location.replace(“http://google.com“); – the history remains unchanged

how can i populate an array from str.split(/,/) ?

does it?
hmm
let me try

Princess^^: yes ma’am, that’s the poitn of the function
Princess^^: compatbility is questionable

Agamemnus, i will try

var ary = str.split(/,/);

i tried with window.onblur… but is not exactly i need
Agamemnus, thanks!

DDustin, thxs

Can the var top be used as a global variable for iframes/anything within a single browser window?

iframe communication is tricky, google it
also, firefox recently released a patch to “fix” an iframe “exploit”. FF 2.0.something might make it impossible now

My company uses iframes in their product, which is IE only, and I wish their was an easy way to just declar some js library once and all “child” frames/whatever will have access to it

nopes thanks for the suggestion tho
think Ialready tried that one before too
window.location.href = nextpage works for firefox but not safari -.-
on safari it kills the history

who cares about safari

errr…

how does it kill the history?
you mean the spanish iphones? -.-

otherwise I wouldn’t care

look at the mac history
if it’s something other than “undefined”, maybe you’ll see how to fix it
well, safari history
also, is it safari 3?
someone earlier mentioned buggy javascript in that

any of you familiar with the safari, back button, iframe ordeal?

enlighten us

does anybody know a way to move an iframe inside the domtree and prevent a reload of the frames contents? insertBefore does moving, but the framecontents reload.. ?

Agamemnus:safari 3, the history looks right just the back function that won’t work right

safari doesn’t add iframe pages to history
also doesn’t add #hashes

http://bin.cakephp.org/view/1738437074
anyone can check whats rong in there ?

http://www.streampad.com/blog/?p=110

hi!i have a definition of document.getElementById(idSTR).style.backgroundColor = ‘#FFFF99′; in firefox it works, i get to see the background color butt in Internet Explorer it doesn’t show
is it diferent the sintax?

oh well thnx guys… I’ll figure something out

I have a question about IE6
tavares, no, I don’t think so. probably you did something funky with the id
in IE6, on the first reload, sometimes images don’t look right (too big in height/width etc.)
and then on the second reload everything is fixed
does anyone know how I could fix this?

press reload?

thank you, i’m here all week

but I want the images to look right all the time
i don’t know why this is happening

because webprogramming sux

seriously it does
nuthing comes out right

Agamemnus:

nor cross compatable

Princess^^: yes I double checked and window.location.replace does just that

try reload like that:
window.location.href=window.location.href;

safari is a browser that is lacking, I doubt it will allow you to move w/o modifying history

lol

if you have server acess you could do a 403 redirect or whatever the number is

wnix, no

Princess^^: yes that’s the correct way to do it, if you have control over the server

I don’t want to reload my page infinitely, or even at all
I think it’s because the height and width attributes somehow get distorted..
I had this problem before too

iwas the “#” before the code of the color it as to be without it…

tavares, what?
tavares, oh.
idk
i’m just a noob

window.location.reload(true);

try preloading the images?

I don’t think it helps

..oO ( is my question that unclear or the domtree too tricky ) ..

but how do I preload an image anyway?
rnix, idk.. i don’t use iframes =\
wnix, but wouldn’t the reload the page?!?

hmm well when I do window.location.href = nextpage; at the start of my function and comment out all my animations it works… must be an issue with my timers somehow

here is my code for preloading:
function cacheimage(curimage) {var preload_hoverimage = new Image(); preload_hoverimage.src = curimage}

the issue is tho then it requires 2 hits of the back button instead of one.. which I could live with

It don’t work Agamemnus

what the heck
wnix, rnix?

hmm, sorry. hover images with javascript? did i missed something?
no hack, i’m another

rnix, what?
rnix, what hover images?
I just pasted my image host preload code and I was asking whether it’s correct

just because you types preload_hoverimage in your example code

var myImages = []; function cacheimage(curimage) { var preload_hoverimage = new Image(); myImages.push(preload_hoverimage); preload_hoverimage.src = curimage; }

oh yeah I was doing something else with that code earlier and forgot to rename it

now works

is it not possible to just define your hover functionality with css?

… wrong hover.

ah

wnix, that just loads them all into an array. i’ll try..

yeah
ah global array
in your version, when function ends, the variable with image will be deleted

i know, but doesn’t that still load the image into the browser cache?

hummmm
I think so
=/

maybe it is some other problem
it’s pretty rare
do you use IE6, wnix?

IE7 too
my IE6 is standalone

can you look at my site and waste some bandwidth clicking the links?
and then tell me if anything gets distorted
maybe it is just an IE6 issue
http://www.flyingsoft.phatcode.net/flowers/index.htm if you want..

yeah… bugged
when click in any item of menu

var id = document.getElementById(‘id’).value;
that will give an array with of id=’value’ ?

or will check for id=’id’ ?

get the value at element and place in variable id

what happens when you click?
you mean images distorted or something else?

uh

Agamemnus, i have tried without results here… do you know some example in the web?
i dont understand exactly you means when you say to check window screen

Hello all, I’m having a strange problem with Firefox where I have a frameset, and I use onload in the frameset, yet the child frames have not completely loaded… I thought they were supposed to be completely loaded before load triggered ?

images distorted

http://bin.cakephp.org/view/699064378
the remove function does not work
wnix, any idea ?

Agamemnus, sry was away, sure you can. Angus PNGfix reads CSS properties.
I know it was ace_noone who said it (before I joined probably) but you gave it to me

coppershade-org^, I thought you had a problem with the same thing earlier?
anyway, thanks I will look at that later.. I changed my div to be made in javascript code instead already, though

is to possible to use multiple statements in a case switch? for example: switch( i ) { Case 1, 2: alert(“ok”) }

ron_asheton, yes
case 1:
case 2:
alert(‘foo’); break;

or you can do this:
switch(true) { Case ((i==1) || (i==2)): alert(“ok”) }

can somebody point me in the right direction for controlling an embedded quicktime movie with javascript?
document.getElementById(“movie”).stop(); isn’t cutting it
got it
http://developer.apple.com/documentation/QuickTime/Conceptual/QTScripting_JavaScript/bQTScripting_JavaScri_Document/chapter_1000_section_5.html

err
how do I get the text width of a ?

Agamemnus, I meant that

meant that?
meant what?

Agamemnus, Case ((i==1) || (i==2)), this kind of syntax. thank you

oh, ok.
sure.

You know all those sites which let you choose a country and then it shows a list of cities or “sub areas”? How do you get this information? Is there a global database?

obviously they have the money to hire monkeys to find out
you can try mining wikipedia

“Information age” indeed…
Sadly, the information is mostly crap. :P

mostly

What do you mean by “mining Wikipedia”?

does anyone know how to get the text width of a element or even to center it…

You do that with CSS.
text-align: center;

with javascript
center on a div
you can download the appropriate files from wikipedia using your own program or javascript
you can extract the cities from the files

What files would that be?

or maybe google has something

What articles are you talking about?

http://en.wikipedia.org/wiki/Cities
List of cities by country
List of cities by latitude
List of metropolitan areas by population
etc..

I wonder how reliable that is…
Or even how complete it is.

http://en.wikipedia.org/wiki/List_of_cities_in_Afghanistan
as reliable and as complete as you can hope for.
55°43′N 12°34′E Copenhagen Denmark

there is a .mil site with a similar list, though probably not the ancient times and middle ages stuff

zhttp://www.infoplease.com/almanacs.html
http://www.infoplease.com/ipa/A0001796.html

is it possible to load google maps on an ajax loaded page? i want to init the load() function inside the ajax page

is there a window.close() that works in FF?

zombor, sure, why not… try iframes?
migs, isn’t that a security risk? :-|

iframe?
cant use that

not in this case

sure, but that’s probably why you can’t find it in mozilla

so it’s IE-only?

im trying to load google maps inside a jqmodal dialog box with custom php host variables

maybe you can find another way
did you look in mozilla’s developer-mozilla.org thing?

I guess it’s okay if it’s IE only

zombor, idk

hmmm

any body know about using Javascript with Chameleon GIS Environment
??

the ajax doesnt load with all the google scripts in there, but it will load without ajax

I doubt there’s a way to automatically log out the user after they hit the close button, is there?
or is that just a retarded question?
nm, it’s a retarded question

yes
pretty retarded… try onunload?
ppl, i have no idea what the ajax is so….
zombor, ppl*

im using jquery
http://kenoshaareachamber.imagemanagement.com/member_directory.html

add it to the button’s onlcik event

tells me nothing cause I never used it
close button in the browser.

how do I force a variable to be type string?

ron_asheton:

so I missed something : )

somestring = “”

what do you mean by “what the ajax is”?

Agamemnus, I mean some method like parseInt( variable );

^migs^, you can use cookies if the user wants to log in again and use a cron script to monitor last-known-activity-time
idk, ron
zombor, well… Idk. IDKKKKKKKKKKKKKKK

ok

lol

use an iframe
if you’re somehow inserting the google script in, look at namespace conflicts maybe

i cant use an iframe
like i said

use ajax

i am using ajax

everyone should use ajax

thats my problem

if the page you’re trying to load uses javascript you’ll have to manually parse and eval it tho

What is the syntax for making a new Object that is basically an array (as I’d like to add my own functions) ?

or if there is a lib that does that, tell me!

in the ajax loaded page

that might work

amf, somearray = new Array()

it doesnt work
i get an error back from jquery

and then add to it by doing somearray[0] = 1; somearray[1] = 2;, etc.

I could set up a cron script on their computer that monitors the cookies. If the cookie says it’s okay to log out, then it logs out

I wrote a function which loads a page with ajax, parses the script tags and eveals them (when its a src=”..” script tag, pull in the file with ajax first and eval the content)

^migs^, nono you got it backwards
^migs^, save their login stuff to a cookie and use the cookie data to automatically log them in if they want to log in again

myeah, a friend had the exact same problem, even with the js parsing and evalling it wouldn’t work
)

^migs^, then use a cron script to track their last login date and use a timeout value to check whether they’re still logged in

=(

I think he means his own namespace, as in
var awesome = { cool_alert : function(a) { alert(a); } };
awesome.cool_alert(“blah”);

cron script on the server

right amf?

of course the first part is not what you asked, but it would help

so i cant have javascript in a page loaded with ajax

the matter would be clarified if we knew why you want to log out the user if he closes a window and how “logging out” proceeds

you can, but the simple ajax scripts you find on the net won’t evaluate the js contained in the page you load

function NewArray() { this.prototype = new Array(); } this is closer to what I want, but wrong

so or extend these scripts or find a library that does

if your script just looks at the IP to test whether the user is logged in, that’s different than looking at a cookie that gives the login info constantly
amf….. what did you want again?
“What is the syntax for making a new Object that is basically an array (as I’d like to add my own functions) ?”

hmmmm

ok, amf, try this..

I guess var NewArray = Array(); then NewArray.prototype.somefunc = function () { } makes more sense than what I just said

hmm, where it it…
maybe this is what you need?
http://www.w3schools.com/js/js_objects.asp
or you already know this?

I thought I wanted to extend Array(), but I just want my object to have the interface of an array but do different things for push(), pop() etc

is JScript.NET still based on ECMAScript? I can’t get some features to work

hello collink

omg!

Do the thing i described
you can build your own namespace, so you can do methods such as .pop .push

you schoolin’ nubs in here?

box is dropped down? this.offsetHeight doesn’t change?

in my off time :P

LOL

s/\?$/\./;

seemed like you were helping someone just now

so you can var blah { = { custom_push: function(a, b) { alert(“pushing “+a+” to “+b); } };
blah.custom_push(“foo”, “bar”);
hows things looking with zeb? still doing work on the drift website?

not much

Is there a way I can use javascript host so that when a user clicks a button, it opens and closes their CD drive, makes their computer beep several times, and gives them a BSOD?

^Migs^: tell them to use IE
then just write code as normal.

nice
http://qdb.us/103393
whee

anyone know how to do that ‘big pixels getting smaller as the image streams’ for graphics-intensive sites?
is it done with some attribute of the img tag, for like lower res pictures?

sure
it’s in my huge HTML 4 book
I remember reading it

anyone know of any existing conflicts with effects.js (from scriptaculous) and IE 6 ?

or even better, is it easy to write a script that loads a lores pic and stretches it, blurring it?

image something

and then fades the real pic into focus?

wait…..

I’d do it with the dxtransform thingy, but I don’t know if it works on mac?

“Simply save your GIF or PNG images with the “interlaced” option, or your JPEG images with the “progressive” option.”

ah

! that’s why my images didn’t look right (distorted) at the beginning

still a blurred image host that comes into focus would be even nicer

I don’t think mozilla does that
coppershade
http://www.codinghorror.com/blog/archives/000468.html
it’s basically the same as you said
I need to de-interlace all my images
dammit

hehe
exactly – but does JS have any processing power for fading a pic away on top of another – I mean rendering capabilities?

yeah sure, opacity
coppershade.. if you know photoshop, is there a way for png images not to be automatically named ____ copy.png?

box is dropped down? this.offsetHeight doesn’t change.

Agamemnus, ??

alex25nj, test if it is selected?

I save pics as png all the time and I never got that

what version?

are you using ctrl+alt+shift+s?
I have CS2

no
me too
i used the dialog box

if you don’t “Save As” but “Save for Web” it should work
I have a special grip for hitting ctrl+alt+shift+s in one go
I’ve programmed my hand :P

aight
can’t you reprogram keywords?
i don’t think you need to program your hand
i like “save for web”, saves a few more steps too

how can i print out all the attributes of a variable?
theres some function but i cant remember the name

childNodes?

Test if a drop-down select-box is in a dropped-down state

onfocus or onselect.

I have a tooltip script that appears in the wrong place only when the select box from which it appears (onmouseover) is dropped down. Hiding it onmouseout, onmousemove, and onchange doesn’t do it.

idk

does anybody know anything about the readystate attribute of embed objects?

Hi all
Hello
Is there a simple way to get a users computer name ?

no, just their hostname

Hostname meaning there net connections name
there has to be a way to get there physical computer name.. Its all on the itranet
intranet

well, sometimes it might be transfered in the user-agent string

hmm.. Ill take a look at that

msg /listserv

but it’s definately not going to be reliable

there is no way to build a realible solution even if i have to ask for users permission in a script to access the system
im not really a scripter I just have the idea

nope

what about using asp? or java?

those are server technologies
nothing to do with a client giving up it’s computer name

gotcha…
ill brb

Hi all

hello again, I have a form that I want to submit using AJAX, everything works ok, except that I don’t know how to send an array with javascript

Can someone please help me with http://www.alexlibman.com/jstest.html (use firefox). Read explenation therein.

xhr.send(data.makeRequest()+’&attitude=’+['salut', 'coucou']);
but it’s converted to a string before being sent

array.join (‘,’) ?

Can anyone help me with the best way to implement namespacing?
I have seen two approaches

hey guys, there is a way to know the screen coordinates of an object ? (Relatively to screen)

in the php file ?

yes, sec

Use arrayname.join (sep) in JS, see http://us3.php.net/split for PHP. Make sure the sep string you use cannot appear in data as usual. Don’t know if there’s a better way, see PHP manual.

this would also work with javascript enabled?
gonna read it anyway
thanks

Alex25NJ ?

sec
Download http://www.alexlibman.com/CieNTi.js let me know if you have questions

what’s the simplest way to fill in a form field?

thanks Alex25NJ

how do you mean

i have a form and i want to fill it with “test”

This is relative to browser object, or do you need the entire screen?

just put value=”test” for the value attribute
or
with JS

entire screen if is possible Alex25NJ

obj.value = “test”;
obj being the input value which could be grabbed it’s id with document.getElementById

wow, i just saw a screencast and the dude keep doing function(){…}

for (var i = 0; i document.forms[0].elements.length; ++i) { document.forms[0].elements[i].value = ‘test’; }

that is horrible coding
ppl like him should go live with monkeys

do you have a code example?

Can someone please help me with http://www.alexlibman.com/jstest.html (use Firefox, there’s no issue with IE). Read explanation therein.

hello, interested in the whole name spacing thing.
Is there a best practice for this?

me too?

does anyone know some good tips on how to get prototype to work well with IE?
IE complains (crashes) when safari & firefox don’t

then it’s working normally
IE is meant to do that.

IE7 crashes or older version?
Ask the users to use latest version, don’t even worry about compatibility with older ones, they’re a security risk anyway.

If neccessary to sort of support older IE, you might find it helpful to cut back features
I do this, if I detect that it’s ie6, I often cut out certain ajax functionality, effects and such like

IE6 mostly;
that might be the way to go

but I thought prototype mostly behaves
bitwise5, what’s giving you problems? anything specific?

ie6 says it’s syntax related; “expected :” also “element not defined”

i have a js function, how do i invoke it?

bitwise5 – pastie your code..

see prototype.js (i’m using 1.5.0)

bitwise5, prototype.js behaves well, so my money is that you’ve got a syntax error. safari and firefox are much more lenient than ie.. Are you using any ie plugins for debugging..
is that your only include? have you isolated it, so there is no other js
not even on the page?
as in no onclicks nothing
this sounds liek aproblem elsewhere I use that version of prototype without probs

yeah, ie6 debugger points to a specific line in each of prototype and scriptaculous;

hello

bitwise5 sounds like soemthing fishy to me. Both those libs are fine. I reckon the error is elsewhere.

need a little help – which properties should I use to change the value of something using javascript in a frameset based page?
I need to update a counter from one frame to another

Are they included in a page with no html other than head body and include js tags
?

i’ll have to try that….
i’m guessing they load fine though, the page dies halfway through (well after the includes)…

so you’re including only scriptaculous and prototype?

no, i’ll try that though; make make a few of the same calls that we do in the other pages

do you have ms script debugger and webdev helper and iedevtoolbar? (sorry if I’m being patronising)
they’llve give you more accurate debugging..

actually, our dev team is on macs so we weren’t even test (GASP) ie6 until a few minutes ago

I sometimes get errors in ie which are total bullcrap, and then use webdeve helper and find the real error, whcih is often in another file, or inline (hence me asking you to isolate your scripts)
I’m a mac too
and I did just the same with www.listen2listings.com

yeah, i’m sure the reported error is bs -

went live and then worked out that javsacript in ie has totally different security features and this crappy debugging situation. expect pain for a few hours, my friend
those tool bars will help alot
you can also get firebug for ie
which will let you execute the code snippets live, and that will help you debug
u include it as a javascript on your page.. If you had a page with scriptaculous – prototype and firebug includes
with 1 div
you could try executing some stuff like Effect.Appear(‘your_div’) and shit, to see if it’s working (press F12 to display firebug)..

yeah, i was thinking just call everything we use by hand, one by one
that’s great advice though, thanks

I suggest build up from that and isolate what IE doesn’t like – I guaranttee you’ve either missed a semicolon, or you’re getting an element back from prototype which isn’t quite supported in ie. The errors will be bogus, coz of the way protoype uses eval – the problem isn’t prototype, so dont;
freak out.. it’s something else.
good luck!

thanks!

`icons // Anyone suggest a generic name for icons like these that won’t be confused with other uses of that name (ie, ‘buttons’ is out)

Say it loud, say it proud, say it way too much: http://gtmcknight.com/buttons/validated.php

what’s the name of that script that keeps the header and fades in what is below (when you switch page)

Can someone please help me with http://www.alexlibman.com/jstest.html (use Firefox, there’s no issue with IE). Read explanation therein.

hi guys, Iam trying to have my text field show available options while typing. any idea? note, iam not a java professional, actually not using it much, but want to use it more in the future

“i am not a java professional” — lesson one: java != javascript

I’ve heard them referred to as “antipixel” before but that seems to just be named after the blog which popularised them

Yeah, never heard that before .. I’m calling them micro-badges

mmhmmm
widgesigns!

you need to use AJAX for the options.

OK, thanks
thanks

You don’t need ajax at all
It’s *useful* if you have a great number of options, but it’s never *necessary*
;google javascript suggest

and is updated onkeypress

http://www.devarticles.com/c/a/JavaScript/Suggest-As-You-Type/

^^ Alloosh

thank you, I know that the available options are js and ajax, I want to add this as an option to one site iam making and its not so important.

(AJAX is an overused buzzword, I know. But you do need JavaScript.)

(do the same google search for other options)

can I use this to play flv files? var so = new SWFObject(swf, id, width, height, version, background-color [, quality, xiRedirectUrl, redirectUrl, detectKey]);

No one is helping me… Can you recommend a good forum I can take this to?

tips for sorting a table?

http://rick.measham.id.au/paste/tableSort.htm

hi im experiencing an extrange behaviour with a call to an external file with JavaScript code, i have to load two files, the first is loaded but the second doesnt, it wont work if i change the order of loading the files, and i have verified the privileges, the extrange thing is that if i change
the file to web’s root, it will load nicely.. my tree is /js -where i intend to store the javascript code., can you help me please?
the code im using is script language=”JavaScript” src=”js/validator.js”/script

If you edit the location URL for your browser to open your .js file instead of .html, does it come up or do you get an error?

no, it gets the file in text mode

The JS code might be dependent for them to be loaded in certain order, or from a certain place (in head vs in body, etc).

thanks, you indirectly help me to find the issue, it was firefox cache, that was preventing me to load it.. ohh i hate this things!!, i lost like two hours trying to solve this!
thanks a lot, excuse me for the n00b :P
gotta go!, thanks again
lol

I’m in the habit of pressing Ctrl+Shift+R (or Ctrl+F5) to refresh instead of w/o Ctrl – that overrides cache.

damn, saved my png as interleaved, still it won’t show while loading
pixelated I mean

how do you make a link on a page be a “back button”
window.history.back()
hrmm.. how do you put that in an anchor tag and make it work.

== eww

help meeeee

Available Plugins: oeis jeval spell cpan shorten rt topic squeeze rbeval acronym change managementspeak reverse join translate bibleit core imdb insult tv help echo eval convert jseval mangle restart quit deparse part pyeval reload_plugins goobooblink heap_test rss

someone help meeeeeeee

hey guys … can someone explain me (if possible) how to fix the delay in the reaction of an IE moving the slide ? (works great on FF). http://www.lachapamecanica.com/nuevo/?seccion=chapastudio
just place the mouse over the slide and it will follow it
but in IE a mouse with sandclock appear and do the slide move slow
and FF does perfect
someone knows how to fix it ?

i’ll help you
_IF_.. y
_IF_………….

?
it works
i did the neccesary browser especific things

if you go here http://flyingsoft.phatcode.net/flowers/pictures.htm
and tell me if the images are distorted

taller, yes

goddamn it

i see a left menu, with tall-distorted items

ok, so your problem with IE.
did you just say it works?

yes
try it
it works
but the response time is slower than FF

yeah, i do see an hourglass sometimes

FF works *perfect*
and ie is slow
open it with FF now

How do you get all the methods of an object using introspection in js again?

hmm
for me, ie isn’t slow
but it does have an hourglass
are you using ie7?
and I think I might know the problem

” + object[key]);

try replacing ‘object’ with ‘window’ for a good time

cienti?

Agamemnus IE6

anyway i had a problem like this before.

tell me please

the little cursor thing is an image?

hum, I’ve never used console.log actually – mostly alert and div’s

is a div background (9×9 px gif)

well then replace console.log with the logging of your choice
I wouldn’t do alert, however

yeah i think if you change it to an image it might not be a problem

you’ll be sitting there for a while

it’s a little tricky because you might break it in mozilla if you fix it in ie6

let’s try !

nn all ye brave

i don’t exactly remember my solution though but i think it was a div and an image together

” + ok[key]); doesn’t give anything though (not a single alertbox even)

I just had a look at the code – i want methods not members

my solution does have a URL, but it’s somewhat broken in Mozilla 2.0.0.6 now

what makes you think methods and members are different somehow?

because I’m used to members being variables, methods being functions, the they is used as an arraykey which I guess would retrieve variables but not disclose membernames

“members being variables, methods being functions,” yeah most languages are like that. javascript is not

functions are first class variables in javascript

javascript is typeless, a function type is the same as any other type

as george clinton almost said, free your mind and your code will follow

ah right, so it should work then.. strange.

if “loosely typed” is the term, javascript would be the town bicycle on crack

Agamemnus much better .. thanks a lot

” + t1[key]; \n alert(t2);

yes it should
but it doesnt

sure

the date object seems to have no properties, wierd

test it in mozilla too

s/wierd/weird/

if that doesn’t work you might want to switch whether it is an image or div background depending on the browser

interesting

What is the best table sorting .js, most compatible and faster ?

sort
its an amazing function

DDustin?

any good IE7 toolbars for debugging and speed loading?

it sorts arrays

but i mean tables
i have a table

Is there some defacto place to look these things up? I keep using searchengines, landing random places. Such a grief compared to some other stuff. I realize there are many companies with their own implementation but..

how to sort it

you don’t want to make your own?

welcome to javascript :x

http://rick.measham.id.au/paste/tableSort.htm

(like in my case, the api for the Date class)

probably no

tsb I usulaly use mdc
usually *.. it seems to be the best
for most things

can you believe I’ve been doing web-stuff for years? for some reason I shun sjavascript.. a lack of any good reference might be part of the reason.
right, thanks.

thanks Woosta

most web devs do
that’s the reason I’m making my MMO javascript game

ahah
good grief!

ya. its actually mostly done

WOW Woosta it ownz
:P
Woosta can i use script in body instead of head?
its a php cms

but its to hopefully help prove to everyone that javascript isn’t something to be afraid of

so i dont feel like including it in all

I do that all the time

and would suck to check if it has to load the script or not

It’s JS, you can do whatever you want with it

DDustin it validates still right?

Anyone knows a little about Ext Js and can help me (although I’m pretty sure it’s something I’m missing with javascript)

Woosta love you

I stopped caring about validation years ago :P

i dont, since i get paid for it

I know, it’s a much easier language then what I usually use, it’s just that is is so wildly inconsistent across browsers and poorly documented and whatnot that it just turns me off. There are plenty of offline-implementations of ecmascript as well

ya cross browser is annoying

but yes validation sux

for hobby projects my rule is I only port to browsers that have proper debuggers

and async javascript didn’t exacly make things better
it make for cool possibilities, but compared to sockets and other things it is a nightmare to debug, atleast that’s my experience with it
is the game still behind closed dmz’s or have you published a beta?

uh ya its public, hold on

Can someone please help me with http://www.alexlibman.com/jstest.html (use Firefox, there’s no issue with IE). Read explanation therein.

what was your original question? just looking for docs on Date object?

it was about introspection, I had done it several times before, but had forgotten it I looked Date up on mdc

nfi why js thinks nothing is “in” Date in a for loop

yeah it is public, it looks like I broke it though

instead of doing this manually, are there any editors with intellisense or whatever? I’m sure vim has some omni support for it, but the short description would be good to get as well

let me fix that

Dojo 0.9 is out woo!

http://wipproject.zapto.org/tmp/start.html

I’m guessing konqueror isn’t supported?

no sir

works better than opera though
actually, is there supposed to be more than characters there?

as many characters as there are people viewing the page

right

the left control button fires
are you zues?

yeah. it actually seem to work in konq, except for ctrl

here I’ll fire a bullet at you and kill you

(but that’s because ctrl in konq is an accessibility key which highlights links)

hey … in php you can do a negative comparison just writing ! before ( if(!$var) …) … in JS there is a way to do that ?

hehe neat.. this reminds me of my first allegro efforts

that’s funny, you’ve used allegro?
this script is intended for allegro.cc

if you change direction midair you have to click twice to jump once
haha!
yeah, allegro and then sdl
years ago..

oh
maybe I got it :p

and then sdl/opengl, which is fun but getting graphics for anything but a spaceshooter seemed impossible so it’s been a while..
and then sdl/opengl, which is fun but getting graphics for anything but a spaceshooter seemed impossible so it’s been a while..

Night all

What’s the one-line “if/else” statement look like again (or what is it called?)

omg
i’m running into that problem
there Agamemnus?

what
what do you want

that print issue
http://www.icegn.net/test.html
clic print, print/close are suppose to dissapear
but focus goes back to the window and it redisplays it

the ternary operation, condition ? c1 : c2

thank you SO much!

and it was working fine earlier?

yea, remember, ya tested it
except the code was different

but with style.display=”?

right
remember i had both ways on the screen
resize and style.dispaly

yeah but then we figured out a way to use style.display

but theres something with the html on that specific page that makes it not work

right?
it did work with style.display, right?
with a timer.
you didn’t implement it? :/

because a timer doesnt matter
the focus goes back to the page
i could redisplay on a timer, but theres no guarantee when they click print so it could print the buttons

because you need to change your onclick
that’s not what I mean
instead of onclick=”printWindow(0);”
onclick=”start_timer()”
the timer should hide the button then start a 1 second timer that activates printWindow(0)
or less if it works

ok..

do you know how to do that?

yea

ok..
do that and tell me if it works…

dont work
problem is focus seems to be returned after the js function executes
so it redisplays the window
er
button
reload it
i made it alert on focus

show me your code

notice when ya click the button
it popups up and says focus

can you show me your code….

ya
pastebin is slow
hold
http://www.pastebin.ca/666328

The paste 666328 has been copied to http://erxz.com/pb/4131

didn’t you forget a 0?

no, was leftover from the resize function

printwindow(0)?
oh, ok

just got rid of it

but wait
you don’t need the focus part anymore

how will it redisplay the buttons?

did you try it with the timer and without the focus?
worry about that later

thats all i’m worried about
it hides the buttons and prints fine

so it does work?

yea, that has worked

ok, so now the buttons

the problem is focus gets returned
s it redisplays them

ok ok hold on
why not set a timer on the onfocus?

what’d the timer do?

well, actually…
when does the onfocus activate?
when the button is clicked right?

right after your onclick
yea

ok so you need to set a global var
set a global var when the timer is set
or rathr..
how about this
onfocus, set a var
nono…

well
global it on print
and then onfocus check for it
works

if (var1 == 1) {make buttons visible, set var to 0} else {set var to 1}
you could do that too

the disturbing part

but just put the global var in the onfocus
easier to maintain

it worked on the other test page i did
but not this page

maybe your onfocus action was defined at a different time vis-a-vis your onclick action

http://www.icegn.net/test2.html
check it
its odd

idk,
but your page isn’t totally fixed yet
i have an error in IE6…
and ur global var isn’t in the onfocus

ya, error is cause it onfocus and printed doesnt exist yet
printed being the global
haha
guess what was causing it to refocus?
right; in the div tag
if i remove it, it doesnt return focus to body onclick
er no
position:absolute;
thats what it was
o_O

thats good to know
and also quite strange

aye

does a mix of position: absolute and float make sense?

heh nope

anyway, going to sleep, nn

the code is so bastardized from where it came from
trying to figure that out

: )

evenin

`dom ref @ Woosta

dom ref: http://w3.org/DOM , http://mozilla.org/docs/dom/domref/ , http://krook.org/jsdom/ , http://www.zvon.org/xxl/DOM2reference/Output/index.html

`ajax ref @ FlashWolf
nothin?
ow
xit
have 2 go

There is no such thing as ajax .. it’s a concept

cya plpe

`js ref xmlhttprequest // this may be what you want

The XMLHttpRequest Object specification defines an API that provides scripted client functionality for transferring data between a client and a server. http://www.w3.org/TR/XMLHttpRequest/

sorry…
wht shame…
so long
so long folks
mom is callin me
xD

how do i switch the order of an array ? like i have: [1] = blah [2] = hello [3] = bye have it [1] = bye [2]=hello [3]=hello ?

`js ref splice @ Elagic

js ref splice: Changes the content of an array, adding new elements while removing old elements. (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:splice)

that is a script?
i want to know how to do it manually

no, it’s a command ..

so i can modify this table sort you gave me
to make it list ASC and DESC

note the URL “Core Javascript 1.5 Reference”
Oh, you just want reverse?

yeap
just to reverse them

`js ref reverse //
bah
`js ref reverse

Transposes the elements of an array: the first array element becomes the last and the last becomes the first. (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:reverse)

ownage
thanks
excelent
Woosta considering the code you gave me, where would you put the tableData.reverse(); ?
i made it i thin
had to change the class of the th to verify if it was asc or dsc
Woosta this has a problem, its doing if th.className == “asc” it wont match if class= someclass anotherclass asc
for example
how to say “if asc is in classname” ?
actually ” asc “

if( /\basc\b/.test(foo.className) ){ it’s there }

that is a regexp match?

yes

that is the .test for?

that’s a method of the Regexp object

wow
weird name for a method
:P
lets try it

A lot faster than the match method of string

kewl
regex rules

\b is a word break .. it will work if you don’t try using hyphens in your class names

damn, im spanish, hyphens were?
works very good
oops i found a bug
if asc is in className it makes a .reverse() and sets className to desc

class=”foo-bar” will match the regex as two words

but that will lose the rest

you’d have to replace the asc with desc

actually \basc\b with \bdesc\b

foo.className = foo.className.replace(/\basc\b/, ‘desc’)

exactly
but desc should have \b also right?

No
\b is for matching

oh ok thought it was to match a space

no, it’s a zero-width word boundary

ownage
it werks

and i still cant find out how to remove $ and , from matching string … anyhelp ? ;o

vbm, are you there

yup

still having problems?

yes :$

“and i still cant find out how to remove $ and , from matching string … anyhelp ? ;o”
what are you talking about?

$ 1,000,000 ( that’s million dollars and i want to have just numbers … 1000000 )

yeah ok
i know A way to do it
It’s not the shortest or the most efficient but it’s A way
it’s a string, right?

yup

(typing)

tnx for your help in advance

“$1,000,000

Error: Error: unterminated string literal at line 0: “$1,000,000

oops

noooo this is mine

“$1,000,000″.replace(/\D+/g,”)

1000000

don’t say anything
goddrn67d467dn578mfd689,g7.890890,m567

type faster

haha

ignore woosta

i will … he’s a bad dude :P

for (i = 0; i mystring.length; i++) {
for (var i = 0; i mystring.length; i++) {

“$1,000,000.99″.replace(/\D+/g,”) // I’ll leave this one for you to fix though

100000099

“$1,000,000.99.99″.replace(/\D+/g,”) // And how do you want to treat this one?

10000009999

;o

no wait.

dont confuse me ;/

let’s do this.
and it’s always in the form $1,000,000?
that is, the commas and such
no decimals
and nothing silly like $0?
or $000?

there is sometimes $ 0
it’s a bank page :]

$ 0?
like “$ 0″?

yup


can you control the entry form?

yes

you need to make the entry form not accept invalid values like “$ 0″
don’t allow any keys except $0123456789.
and ,
allow ,

$ and , is not allowed

strip out the “,”, we don’t care if it’s in the wrong position
then it’s not really a problem is it
lolz
ok don’t allow anything except “0123456789.”
do you know how to do this?

well … if i knew i wouldnt ask :P

oh and one more thing
you don’t want a hacker to crash the system
so you need to do client side checking later
i mean..
server side checking
you can’t trust input that you get from the form

it’s for greasemonkey script … and it’s for web game i’m playing ;d

a bank?
in a game?

yup

you’re programming a bank in a game? what?
…..
?

im trying to create “withdraw money” button

As opposed to withdrawing it some other clumsy way

click on amount that is visible in td … remove $ and , and fill in the form
more or less

but the website that you don’t control receives the data?
um… anyway… someform.onkey() should not allow the $ and ,

Comments off

i want to just get the raw exact data from the post and then use it if i am going to use it in a mysql query i

mattmcc, right, but nothing in program files is in my path

it’s a posix layer, so of course it’s not going to let you execute cmd.exe commands unless you explicitly run that shell

err… not really running on unix

caffinated, i meant more like progams, nut builtins for cmd.exe
i installed mplayer for windows and couldn’t run it from my bash shell
piss on that.

you would have to cd into the place it is instelled to.

fireflymantis, yeah, and thats jus tnot ok with me. because the place its installed to is too far away.

why you’d want to use mplayer is beyond me .. windows already does media fairly well.

whoever came up with the name “Program Files” should be shot
caffinated, i’m addicted to mplayer. I hate every other media player

progra~1

shudder

lol. yeah i hate that more than the full name

It’s VLC and winamp for me when it comes media on wndows

yay totem.

Cool, that only took 9 minutes.

hey, nice
chanserv++

VLC is okay, but it never shows up on the right screen (I use tv-out_) and it gets all buggy when you try to open a file and the play is already open. you ahve to drag it between screens and resize it.
plus no other media player has the keyboard controls that mplayer does

Does anyone see something wrong with this code? http://pastebin.osuosl.org/2045

Attempting to use an array as a scalar?

bkero, you need to lose the $ before stuff un 4this-stuff

if ($thing) array_push($this-$stuff,$thing); should be if ($thing) array_push($this-stuff,$thing);

should be $this-stuff

o, so no second $

right

3

Syntactically valid, but not likely what you intended.

Danke

with the $ would be a variable variable reference

i didn’t know that would work.,

does anyone have strong mod_rewrite-fu? I’m after a rule to translate /* to /vfs/* – assuming of course that it’s not already /vfs/..

is anyone good with php/openssl bindings?

fireflymantis, is that how simplexml does those dynamic properties?

so if $foo == ‘bar’ then $this-$foo == $this-bar

actually i think that kind of works in the opposite way

Is there a way to make PHP not store large ints as X.XXXXXXXX EXX ?

http://ca3.php.net/bc

Hahah.

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

what is this php webhosting thing for? fb?

Euler Project

Is there anyway I can use a variable to declare a variable name? like: $_POST['q'.$i] ?

hmm

$$?
i think thatll do it

hm

when you have is correct.

Xinil, that example you posted should work too

/s/when/what

what do you know about creating a mailserver?

Some
PM Me about it though.. this isn’t the channel :p

well I am going to have questions about its operation with php anyway

ok…

ah, $key did work
dunno why, just thought it wouldn’t work for sure

because when I validate someone and make them able to log into the site, it is supposed to send them an email allowing them to do so

Xinil, your example looks to me like it would obviously work, but php is capable of more surprising things than that for dynamic variable names.

Is there a mail server running already?

it lets them know they have been accepted on the team
mailserver? naw
not yet

WOOT Works great

thanks andre_pl

DARKGirl.. linux or windows?

OSX (Unix)

Uhh… lol
No idea

haha
its just the same as Linux, silly

if you’re banning those mass join/quits they’re just bots heheh

Its unix based, but the same applications won’t run on it
DARKGirl, look into the PHP mail function
Should work fine though

sure they will

OSX (Unix) Lol. I wonder how much we’re going to see OSX being called unix host now that its got the seal of approval. not that anything actually changed.

csc`: yep, they’re bots which won’t join/quit after i’m done

lals

what if those ip’s are stolen from others :

It’s just a perl script connected to a pool or tor proxies
so you’re banning legitimated users from your channel
np

you just have to compile whatever application for OSX than Linux

Aww
Opps wrong indow
window
Having fun?

heh… so aqua data studio works, but it still doesn’t solve the problem that I’m connecting to an mssql server to get data dumps…

Notice how everything starts with either “88″ or “85″ ?

wietz0r, you can’t ban a whole subnet though :p

goddammit just blanket ban tor from the channel

hi

hi brenden

I have to Logins screens on my App, one is for admins, and the other one is for customers, when an admin logout of the app the customer session getlost…. anyone can help me??
is two, not “to”

omp arent you ruby

csc`: yeh

do if(array_key_exists($key, $array)) {} and if (isset($array[$key])) {} do the same thing?

NemesisD they are very similar, I would double check on the case of an initialized key pointing to a null value, because that should return true for array_key_exists, but it might return false for isset($array[$key])

hey there

hi guys i’m trying to learn how to hack php

ok chewy, i think ill go with isset in that case then
hack();

k

yeah thats what I would do

have an embarassing question
re logical operators in php i’m used to seeing && when doing a logical AND statement

was php made for people who can’t understand perl?

however in Drupal I’m seeing a lot of & instead of &&
is there a difference?

&& is logical AND || is logical OR, & is bitwise AND, | is bitwise OR

not especially. an alternative, yes.

ahh bitwise that would explain it!
thanks chewy one of the items is indeed bitwise

why use perl if yyou dont have to… sure I can understand it, but that doesn’t mean I want to deal with it.

eh.. perl is fun

perl IMHO

in fact, a lot of people in here can write perl, and just choose not to.

for web scripting definitely
btully np

NemesisD, I agree… i wont doubt the power of perl, but its just too nasty to look at.

perl is a lot more fun that php for one liners

yeah, if thats your idea of fun.

i prefer video games for my fun :P

‘one liners’ are generally not realistic.

well I do a lot of php -r one liners
and perl would make a lot of that easier

what about in an if statement you need to see if 3 things are true/set and only one is a bit

but then I would be writing perl code to generate php code and thats just too much of a head ache

if one of your goals when you code is to make things readable without 10 lines of comments, the ‘one-liner’ is usually not a good idea.

if ($foo && $bar && ($num & 32))
caffinated well I just use one liners for code generation, so its more of just quick hacks than never get looked at again

fair enough.

lets bash asp.net instead. I just found out that’s one of my classes this year, and theres no php at all

ouch that sucks

if ($item['type'] & MENU_VISIBLE_IN_BREADCRUMB && $item['path'] && _menu_item_is_accessible($mid)
) {
does that make sense?

i think its ridiculous. I understand forcing us to use .net for general desktop programming, because they want to make people know whats going to be used mainly in the workplace… but lets face it, ASP.net is a HUGE minority on the internet.
not giving them php experience is shooting them in the foot.

MENU_VISIBLE_IN_BREADCRUMB is the bit
the rest are either true or false

that looks alright, I would put parenthesis around the bitwise and

eh, any programmer should be able to pick up at least rudimentary php in a week or two.

but that seems fine

it’s hardly complicated as far as languages go.

caffinated, yeah but in school, most of the people in my classes are idiots who need to be spoon-fed everything.

and they’re the ones who will fail.

if they dont learn it in school, they wont learn it.

you mean if ($item['type'] & (MENU_VISIBLE_IN_BREADCRUMB) && $item['path'] && _menu_item_is_accessible($mid)

yeah php is pretty quick to learn because it lets you do whatever the hell you want, haha

?

you don’t need to be concerned about them though. you only need to be concerned with you.

caffinated, i wish that was the case. but no. my school sucks and everyones stupid.

naw I mean if ( ($item['type'] & MENU_VISIBLE_IN_BREADCRUMB) && $item['path']…

ahhh i see
thanks!
and if i need to add another item that is bit but i need to check that it is not set?

that way you’re sure its doing bitwise and comparing item['type'] and MENU_VISIBLE_IN_BREADCRUMBS, rather than bitwise and between item['path'] and (MENU_ITEM_IS_ACCESSIBLE && item['path'])

just out of curiosity, for anyone who is in post-secondary school in the US, what are your computer courses like?

$item['type'] & MENU_VISIBLE_IN_BREADCRUMB ~ MENU_LOCAL_TASK)
?

I always forget the precedence tables so I like to make sure its not an issue
andre_pl absolute crap
I dropped out of comp sci and I just work full time now

Is there in PHP anything similar to “friend” keyword from C++?

btully you can add && !isset(NEW_BIT_ELEMENT)

nice

JaBoJa is friend similar to protected, or is more of a casual relationship

thanks SO much!

I have a php script that generates text files from a mysql database. The files are probably 20-60 kb in size each and about 5-15 files at a time. When this script is running, although only a few seconds, I cannot execute other php script on the server simultaneously?

yeah np

it blocks other requests and it shouldn’t. the server is fast enough and with 4 gb ram…

Crytor well if you’re doing a db dump then the db is locked

it allows to access protected members from methods of another class

chewy, I’m in college in canada and i’m pretty confident that i’m not going to learn a thing until at LEAST my last year.

check http://dev.mysql.com/doc/refman/5.0/en/table-locking.html

well, SELECT queries and file_put_contents – on selected fields from database. not a total dump

andre_pl ya know, I thought that too, then I started getting into the more advanced classes and it was just letdown after letdown

aha

I had an operating systems class where we did a fucking play for the dining philosphers problem

LOL

Crytor well as long as you’re not locking the db, and you’re on a multiuser os then you should be fine

chewy, my OS class was using VMWare to install windows, then we learned about some of the advanced control panel things, then we install sisoft sandra to inspect our hardware.
that was it

wow that sucks

MUTEX EXIT STAGE RIGHT
I’d love to see the script for that play.

chewy Totally. 10 assignments, every one of them was “Create a power point presentation with screenshots from your VM. showing the following 10 screens”

mattmcc lol

I think mysql locks the table anyway per default

andre_pl ahhh that sucks, we got to do a final project where we analyzed the VM of an os, so I did it on unix version 6.0, using my lion’s book, so that was pretty cool, but there wasn’t anything in the class I couldn’t have done more effeciently and had a lot more fun, doing it outside of
class

Crytor you might be right, but I didn’t think it locked it for selects

chewy, in my java class, we were supposed to be using linux hosting (just to give us a taste) but my teacher put it off ALL Year (i assume because he didn’t know how to use it) and then he ended up just giving us a bonus 5% if we demonstrated hello world
running under linux.

LOL

the issue is that lets say you have long running query A. then along comes a update B. then there is another select C. B has to wait for A. and C won;t run if there are waiting updates (b)
(where A is a select of course_
)

I used linux all year for everything

but won’t those queries be queued?

yes

but also I thought he said he was just doing a series of select statements
that should just take a min longer if hes doing selects and updates, but it shouldn’t lock him out completely

with MyISAM, it often does

if A is a select and B is an update why would B have to wait for A to finish?

heh… time for some regex fun… gotta take an mssql create database dump and then convert it to mysql

because otherwide A’s select could be corrupted

andre_pl because you can’t have the update modifying rows while the select statement is running
caffinated see thats something I would probably write a one liner for, going from mssql to mysql

INNODB has row-level locking, and might solve your problem Crytor at the expense of a small loss in speed.

well I might make that an actual script in case I need to run that again, but that would be a fun one liner

erm, i would use an adapter pattern

does anyone know how to dynamically create div tags based on a list?

What type of list?

How about a loop?

well, i am supposed to read from a mysql database hosting a list of users that have asked to gain authorisation to log in
this is an administor-apprroved site
you cant just sign up with a username and password and expect to log in right there

foreach($users_needing_auth as $user) {echo “div$user/div”};
like that?

ah an echo?
facinating

yeah, that’s kind of complex

well you could just kep adding to a string and then send it out all at once.
complex?
how so?

he’s being sarcastic.

oh, lol

Nah, just echo it as you get it

well I will need some special stuff. I will need a checkbox to be added next to a userid to show what settings the users have on their accounts

DARKGirl, you can add all of that inside the loop

that is so cool

lol, pretty basic stuff.

I didnt realise echo was that powerful

its not echo.
its the foreach
echo just prints things

ah, I am familliar with foreach
ask Thecks

Nooo!
I am not an oracle

yes, you don’t even support views

nonsense, youre a PB programmer just as I am

PB?

I don’t support views? :o

Oracle does

aye, but its supposed to load all of the users in the database

I’m learning Zend framework… that uses the view model
I meant An Oracle… that mystic thing you go to for advice :P
PB = Pure Basic

i’m just being an ass. don’t sweat it.

its a user managment system. it allows me to easily remove/modify users without having to resort to the damn console

http://www.evolt.org/article/Storing_form_array_data_to_MySQL_using_PHP/18/60222/
Take a look at that, it shows how to load all the data from MySQL into an array
And cycle through and output it

aye! thats something of what I was talking about!

Its more … untidy than the foreach example

its going to be a makeshift table though

But you get the idea

not a real one
just something I made myself

well, you can also do it directly in the result set loop

I do understsand the concept now, yes

it really depends on your code logic

DARKGirl, http://pastebin.ca/669698

pastebin is a nono
lol

why?

http://rafb.net/paste/
use that
because its slow
VERRY slow

i’m not gonna re-paste it.

eh, pastebin is fine. you’re right, we were encouraging people to use other things in the past, but that’s because it was taking like 3 minutes to render the page

it was just a simple example

i wont be able to see it then

its fine for me. not slow at all

improvements have been made since then

DARKGirl, it loads fine.

I tried it
its still loading
it almost never works for me

thats messed up. never had a problem here.

fast for me as well
it must be a netowrk problem

i was going to copy it to rafb but when I copied from pastebin it numbered the lines and made a mess of it.
don’t feel like cleaning it up

ah good, you use mysql_fetch_assoc()

caffinated, imho only a moron wouldn’t.

“Safari can’t find the server.”

who wants to refer to column names by a #?

i don’t have to use my ##php user vodoo doll

yeah, I can never connect to that
it keeps timing out

caffinated well an adapter pattern would work, but then I would have to make that, and thats a little more complicated than I’m looking for, for two reasons, 1) This is just a table dump, so there is only 3 regex I need to parse the whole thing, and 2) if I made an adapter pattern that would
imply that I’m expecting to run into this again, and I really don’t ever want to do this again

what can i say, i’m a sucker for punishment

haha
well at least I’m going to do this in a script rather than a one liner, I’m not trying to punish myself that much on a friday

someone in the community channel was making some joke about someone eating something, and representing it as object/method calls. I fixed the composition. :P

lol

caffinated, sounds like my C++ final project.

well, a lot of people here don’t really understand object relationships too well.
which is fine i suppose, considering php’s procedural nature

caffinated, strangely enough, when I started lto learn about OOP in java, i found it easier to apply the concepts to php than to java.

haha yeah because objects in java hosting are just annoying

likely because java is very strict.
php really allows you to get away with a lot. some would argue too much.

yeah I think php is too loose

I’ll never agree to that. the looser the better!

But, that’s what we’ve got ruby & python for.

eh… a loose language is nice, but its annoying when you don’t have variable checking so typos create interesting little bugs
of course its nice being able to declare and increment a count variable inside of loops and conditionals

chewy, that’s so rare though, I almost never mistype a variable name, and its just not worth all the hassle.

if that made any sense

yeah it did

well I would just like use strict for php
haha

chewy, I think theres something you can pass to error_reporting that’s supposed to indicate possible misspelled variables.

in php5 oo you can force methods to accept only objects of a certain class

E_NOTICE

thats it

which is some kind of exception to the loosiness

Cahaan, I didn’t know that, but I can’t see how I would ever use it.

mm .. loosiness

Colbert-style programming.
Boolean operators that determine truthiness..

yes. it has an exceptional truthiness quality

well I don’t use many objects, but I would like to at least have my variables checked that they have been declared

lol

That’s great until you want to type hint a string or int.

hey is there some way i can use php to change my current link in my navbar?

yeah you should then create your own classes to encapsulate string, and int
byeah you should then create your own classes to encapsulate string, and int/b
which starts to be annoying

And eventually you’ll have a nice Java class hierarchy…
Oh, wait, Zend’s already working on that.

if i had a stick, i would poke you with it

see you click on the different links but it doesn’t change because its reloading the new page in the middle iframe
carlolorenzetti.com

I don’t mind

lol

eh, I would rather have ruby style objects that just allow you to add methods on the fly to predefined classes, than be able to make wrapper classes for primitives

class String { } … that is a little overboard i think

lol

Yeah, then you get a few third party libraries into the mix, and pretty soon you don’t have the foggiest idea how a string behaves…

well it exists in Java, in C++, and a lot of other languages

well, yes, but it’s a part of the standard library

sure it is

AND Those are “Strongly typed languages” php is not, and shouldn’t be

mattmcc well I don’t remember exactly how ruby does it, but I’m pretty sure you could keep the changes in the third party library isolated

that wouldn’t be. worse, it would be in userland code

I agree andre_pl
I’m not trying to argue actually

Monkeypatching gives me the willies.
I don’t know how ruby folks can like it so much.

so it is possible to do yes?

they are all crazy macbook users
and they like danger
method_missing magic really angers me some times. people abuse the hell out of it.

My Dad wants a MacBook for his next laptop. :P

clos, you’re not making much sense. php can probably help you, but you need to know more than just that you want your links to change

tell him it’s a trap.

I like it because then you don’t have to makes functions to act on passed in values, but rather functions to operate on values
caffinated lol

andre i’m just starting to learn php and i think i need to echo back some html somehow

I find it a non-coincidence that he started thinking about getting one around the same time he started poking with Rails.

do you think OO in php webhosting can be interesting for some projects ?

if you go to the site you’ll see what i mean

I’ve got a macbook and I love ruby, and my good buddy who is a ruby hacker also has a macbook

it’s sort of hive-mind mentality i think.

i just need to change the current link

Silly humans.
Sorta like how everybody has a webcast now.

clos, if its loading in an iframe like that, then you probably need to use css & javascript to change it

Cahaan not really, because you’re limited by the lack of state, however there is a pretty good book on design patterns in php 5, and you can do some cool stuff, but you are significantly limited in the useful of design patterns compared to most languages

After all, how are people supposed to learn about your software if they can’t watch a movie?!

write a mac virus, and set it loose on the conference wifi.

that’s right

We already know nobody reads documentation..

yeah i fugured i could do it with javascript, but i don’t want to
i fugures i could do it with php

clos php can only change a page when it is refreshed. that page never refreshes

i see

well, the quality of most documentation is very poor until said project reaches a certain mass of followers.
most people don’t like to write documentation. even fewer are good at it.

and since OO seems to change with every new version of PHP, I would think twice before using this paradigm

and then once you get the mass of followers you get the comment system that is php.net

Django’s docs are pretty good, I’d say. However they made (imho) a critical error in making the default docs apply to the dev version, rather than the latest release.
Case in point, http://www.djangoproject.com/documentation/tutorial01/

caffinated psssh… write documentation? shiet I don’t even like writing comments

my comments are usually commented-out echo’s

A couple weeks ago, ‘max_length’ in trunk used to be maxlength (As it was in all released versions to date). It was changed for consistency, and to avoid confusion with the HTML attribute.

that’s the ruby attitude too – if you need a comment, your code is too complicated.

Now, at the top of every docu page, it says “This document is for Django’s SVN release” with links to the docs for the last two releases.

as a result, there is a lot of poorly documented “magic” ruby.

And yet when max_length was renamed, we literally got a dozen bug reports about it.

caffinated haha yeah seriously, ruby is all about breaking things down into so many small cases that if you try to comment it, you will more than double the code for thank chunk

“Your docs are wrong!”

hah

*for that chunk
wow I’m having issues typing today

well, it’s good until you understand how much the community loves to metaprogram

it’s quite fun to write documentation

its friday and I’m ready for the weekend, but I’m going to be here at work all day tomorrow

then simple-to-understand things become simple-to-understand-for-the-initiated

tools like doxygen can make it even more fun

caffinated yeah they tried to avoid doing shortcuts like perl so that it didn’t have the initiation overhead

as with all languages though, the core group doesn’t give a rats ass if you understand it or not
i hear it a lot at the conferences that people are afraid ruby will be “overrun by php users”

haha yeap, and they shouldn’t beyond an extent, I mean they’re the people who are using the language constantly, so they have the best idea of what it does and does not make sense to turn into shortcuts
caffinated haha yeah I could see that, because ruby on rails lets you knock out a lot of code very effeciently once you’re used to it
so as ruby becomes more widely available I’m sure a lot of php users will switch over

well, also, if you go from rubyconf to railsconf, people at rubyconf have a disdain for the people at railsconf .. even though it’s a lot of the same speakers
some hardcore eliltism there

caffinated really? I didn’t realize there was hostility in the ruby community like that, as powerful as ruby on rails is I would have thought the ruby people would be all over it
“hey cool I can knock out badass MVC websites using ruby code.. sweet!”

well, people at rubyconf are interested in the language, and some see rails as a gateway to let idiots in.

I don’t see why they wouldn’t like having that tied into their language
caffinated well anytime a language gets to the point that you have really cool features that can be easily used, you get a certain amount of hype from people who actually know how to use it and love it, so then you get a lot of idiots switching over
thats just part of the internet tho, eventually you can’t hold the idiots back

oh, it’s just like linux power users wanting to keep linux complicated so the newbies don’t pick it up.
it’s kind of sad, actually

Every tier of society has to have another tier to look down on, to feel better about themselves.

what is a registered, but unused domain name worth? like if i want to make an offer on it?

person Y want item X to be popular enough that you can do it as your job, fulltime. but in the same token they don’t want it so popular that idiots use it. however, that sort of adoption is in person Y’s _best interest_

caffinated haha well I do agree with that to a certain extent, to be honest I don’t really like the current state of linux distros, ubuntu rocks and has a lot of cool features, but its become bloated and unreliable, I’m not much of a fan of suse or redhat or mandrake, slack is cool but I would
rather just run freebsd, and my old distro of choice, debian, has been overshadowed by ubuntu, so there isn’t really a distro I like that much right now

right. which is why there will be another one some time in the future to further add to the confusion.

I love fluxbox, and I played around with getting fluxbox working with ubuntu, but all of the cool ubuntu apps require tons of gnome or kde libraries, defeating the purpose of having a lightweight WM like fluxbox

i hate how fragmented linux is.

caffinated, it hates you too.

well, distros are i should say

:P

caffinated yeah no kidding, its becoming a serious issue

no its not.

distros? they sure are.

theres like 4 different MAIN Distros. and they’re similar enough

to be honest, I’ve switched over to OSX with my macbook, and I use freebsd/openbsd for my servers now

hi aain

i swear, i’ve screwed up so many times on this batch i probably couldve done it manually by now

andre_pl they don’t have many similarities, they all have different package management systems, they have different directory trees, they have different base applications, etc etc. Linux distros are getting farther and farther apart rather than becoming more standardized

similar enough to you.

extracting all images from a dll, renaming them in order, removing every 4 starting from 2, renaming them to (style)(color) then converting to transparent png

if they were “similar enough” i should just be able to install a package on any machine with minimal hassle using any packaging format i like.

what would you name a variable that stores either ‘ASC’ or ‘DESC’?

caffinated, i can install rpms on debian, thats good enough for me
`cb, $sort_order

yeah, good enough for you

yeah but installing rpms on debian just makes me want to stab myself in the eye
I hate rpms, they are evil

order… hmmm
good enough

downloading and installing .exe’s is worse. who wants to click through all that crap… and then having to google for your software and downloading it fro a wbe page.
thats so old shcool

to be honest I would rather download and install an exe than an rpm

ever use apt-get or yum ?

because at least the exe comes with everything it needs, shit rpms are just a trail of installing random rpms

apt-get install [package]
gg

yeah i’m not going to argue that rpms are total crap.

I love apt-get, I try to avoid yum as its slow and fills my screen up with downloaded header messages

they’re terrible, but i’d still rather just have to type one or 2 commands to install something hten google, download, unzip etc.

`cb I’m just saying I hate rpms, you should use a package management system
but overall my favorite package management system is freebsd’s ports tree

yeaaah, im not really interested in compiling and whatnot

I really liked gentoo
’s portage
just got sick of compule times.

mac spoiled me D:

I have an array with a bunch of ID’s in it. Is there a way I can run a query with the WHERE statement matching *ANY* of the ID’s within that array?

¿?
lols

IN ()

`cb I like it for servers because then you are always right there to change the make files to what you need

implode to a comma sep string first

SELECT * FROM table_name WHERE id IN(2,4,5,,8,12,43);
err, ignore the double comma above

oh! nice… thanks guys :-)

after the intel switch I love apple, my macbook is by far my favorite laptop I have ever used

exactly

Anybody know of any places that you can submit your database structure too and a database architect will take a look and give their feedback?

Is there a way to pull data from a pdf with a php script

yeah right here, but I charge $50 an hour

depends on the PDF

And I love my Vaio’s keyboard that people keep thinking was an Apple thing, when Apple really just lifted the idea from the Vaio X505.

$50/hr is all?

chewy.. I’d be willing to pay that

`cb, What am I looking at for issues? What matters?

As long as you can guarentee it won’t exceed X amount of hours

takes balls to buy a sony product now-a-days

run your queries with EXPLAIN too. helps you optimize the,
..the structure a bit

In PHP regexps, escaping just a space (and not any whitespace as with \s) is just backslash space, right?

Thecks well the amount of time it takes is completely dependent on the complexity of your db, but I can give you a rough estimate

`cb: Oh, hell no. I’ll never buy a different brand laptop. My first Vaio lasted 5 years, I beat the crap out of it. Second one survived two liquid attacks before finally giving in.

Anyone use PHPGTK here?

`cb: They does not screw around when they build a solid product.

http://www.devshed.com/c/a/MySQL/MySQL-Optimization-part-1/2/

all i know is the last few dvd players, tvs, and other assorted stuff have been pretty crappy

i use it quite abit, but not enough to be able to help anyone

mattmcc, I believe they’re one of the few companies that actually have a laptop factory too

`cb: Ah, yeah. That stuff is virtually a different company.

Can I specify character set for file functions (like require, fopen). I mean the charset that is used to encode file names, not the content. I ask because I’ve problem with filenames with non-ASCII letters (I use UTF-8 in my script, but filenames are [probably] encoded in windows
encoding).

Just play around with it or?

nah, just my apps end up sucking :P

craigbass1976 I had a buddy who parsed pdfs using ruby and he was able to get a text dump and regex the data out of pdfs that were locked, I don’t remember what he was using to get the data out of the pdfs tho

Indeed. Gateways and HPs are all outsourced, iirc, along with most Dells.

All dells

:P , I was just wondering if it would be worth learning and playing around with it. Obviously I wouldn’t be building any large scale app with it :-p

I was amused a couple years ago when Gateway & Dell had a line of laptop that were completely identical.

they might throw hard drives and more ram, but they dont’ make anything

yeah, but it’s 5mb and open source if you want to distribute it

These days they try harder to have slightly different offerings, so that you can’t make apples-apples comparisons.

does anyone have a function that will strip all special characters from a variable?

ahh

because magic quotes is broken
the thing is

I probably won’t learn it, most likely end up learning C++ or Python.

I only want/need letters and numbers from any input from the user anyway

special characters for HTML or for insertion into a SQL query or wat

DARKGirl, html_strip_special_chars I think

mattmcc, http://gen-x-pc.com/laptopmanu.htm
there is also a chart somewhere I saw of who buys from who

…are you sure that function is not broken?
because they told me that I would be better writing my own

html_strip_special_chars() is non-existant

right now I use “mysql_real_escape_string”
but they said that is not fool-proof

Damn/.

mysqL_real_escape_string is fine, so long as you check for magic_quotes first
otherwise you can get some nasty things like \\\\\\\\\\\\\\\\\\\\\\\\’ appearing in your content

Heh
are you doing something like user registration?

thats right

and you awnt to restrict to like alphanumeric?

are there any special characters that are not dangerous?

ah… if you only want to allow certain characters, validate against regex
for passwords, just hash, and allow whatever characters they want

ctype_alnum checks for alphanumeric, returns true if yes, returns false if special characters.
http://us2.php.net/manual/en/function.ctype-alnum.php

oh, I dont strip the passwords, because they are immediately MD5′d

PHP-WTF: http://rafb.net/p/YDiIVc43.html

nice !

holy crap

heh that function is not really helpful because I am looking for something to strip the chars, not just check if something is there

oh ok. sorry.

please tell me what’s wrong with this code? http://pastebin.ca/669727

DARKGirl what chars are you trying to strip?

if you strip, and do not warn, they will not be able to log in

its should be returning “img there” because the $_SESSION['profimg'] session is set

and you will be accused of releasing a broken product D:

`cb: haha, fnny

it’s set to show img there if the session is NOT set.

well I am stripping any user input fields before I actually process them

stripping them of what?

doh! thanks

:P

that said, usernames can only be alpha-numeric

how can you validate them if you strip them beforehand?

what about preg_replace(array(‘a’,'b’,'c’,'etc’),array(”,”,”,”,”), $input)

How to get know which encoding filenames are in?

also, not sure if your a fan but, check out ‘Terany Operator’.

never heard of it

= ? : ;
3

`cb: how? well they are not allowed to create usernames with special characters anyway

ternary yay!

yeah ternary operators are good times

so, if they try to create one, make it fail validation, so they can change it

except php is kind of weird when dealing with nested ternary operators

http://us2.php.net/operators.comparison

don’t change it for them

do you mean ternary?

Magic quotes is not dependable and many shared hosting servers do not allow users to use ini_set

sorry, thought that’s what i put :-p

i don’t nest ternary in php

what does it do?

`cb: that is already in place

`cb yeah neither do I, I always have issues with it

i try not to nest ternary in anything really
so whats the problem?

http://us2.php.net/operators.comparison Check out the heading Ternary Operator

thanks

i was just wondering if thats all I needed

I like to use them in sprintfs when you don’t want several levels of if statements

Im having real trouble with conditional tags, anyone see anything which looks wrong? http://www.nomorepasting.com/getpaste.php?pasteid=2985

does a session end when you close your browser window?

It usually does
you can specify the settings in php.ini
or using the session functions in php

by default I mean

default is kinda vague, depends on your distro’s default settings
butt, usually yes

hehe you said butt

hehe

It was meant more of a but….
should have used …

distro?

butt distro… I like it!!!

distro refers to your distribution of linux. Many distributions come with php bundled by default and have their own settings
depends

hmmm
’cause I’m setting a session variable in a page that I haven’t gone to yet, but its showing that variable form the previous session I was in
how do I delete a session variable then?

unset
the variable

it would be easier if it deleted when I closed my browser window….

wouldn’t it?
so, set it

can I do that?

yes

go on…

you can do anything you put your mind to

lol

use google man
come on
why do I have to spoonfeed you
just google php + setting session properties
something along those lines

that is the purpose of a session
it carries over to pages you haven’t gone to yet
if you have previous sessions, perhaps a call to session_destroy() might help you

thanks

closing the window won’t do anything, you need to quit the browser

want to empty your session data, simply perform $_SESSION = array ();

yeah, also what sean` said

thanks

hmmm… anyone see why preg_match(‘/^CREATE TABLE (\[dbo\]\.)?\[([A-Za-z]+)\] \(/’, $line, $matches) isn’t matching CREATE TABLE [dbo].[CC] (

`cb, what if it’s the last window of the browser :p

so if someone forgets to logout, it will clear the date

swimrr, if you forget to remove the session data, it will stay as long as its ment to be there

its failing on the [dbo].

sean`: if you are using Winblows, it quits
but not on mac

`cb, I stand corrected :p 50% at least :P

I can match create tables with the [dbo]. but I’m failing on any that have it

swimrr, assuming there isn’t anything else that interferes, like emptying the local cookie data

hmmm

sorry it matches any without [dbo]. but it fails with them

eh

any ideas?

my regex method is the ‘trial and error’ method

hmmm – right now, if I log in as one user…then go to the site again, log in as user2 – it keeps some of the session data from user1

you aren’t cleaning sessions on logout?
are you using cookies or session saving extensions / addons?

‘cb – that’s just it, what if they don’t logout?
they just leave it there?
you know how users can be

session eventually timeout

oh….
okay

ok this is starting to irritate me, any ideas on this guys?

how long?

hmmm… anyone see why preg_match(‘/^CREATE TABLE (\[dbo\]\.)?\[([A-Za-z]+)\] \(/’, $line, $matches) isn’t matching CREATE TABLE [dbo].[CC] (

variable, depending upon server
you can set in php.ini iirc

thanks

or more specifically why (\[dbo\]\.) doesn’t match [dbo].

it should match just fine

hehe yeah thats what I thought too, but I’ve got empirical evidence to the contrary

you’ve peaked my interest

Check your variable I guess.

piqued

I can match CREATE TABLEs without the [dbo]. but it fails on any that have it

chewy, whats up

why are you regex’ing on that string?

http://pastebin.ca/669748 – when I ran that on my localhost, it echo’d true.

I’m trying to use preg_match(‘/^CREATE TABLE (\[dbo\]\.)?\[([A-Za-z]+)\] \(/’, $line, $matches)

why?

CREATE TABLE [dbo].[CC]

chewy, strpos (‘create table [dbo]‘, $string)

JymmmEMC because I’m trying to write a converter from mssql create table sql files to mysql

oh, duh

sean` well the regex matches any create tables that don’t have the [dbo]. in them

chewy, so.. your point?
You’re telling me you can’t achieve this with strpos?
strpos ($string, ‘create table [dbo]‘) * mixed them up

I’m sure there is a lot of ways to do it, but a regex works just fine as long as I figure out whatever syntax error is there

chewy, it doesn’t seem to work.. so why don’t you go for the approach that will work 100%?

lol

silly

sometimes I wish PHP/RegEx were explosives…. one lil mistake and no more problems.

chewy, I’m not saying you should not investigate the error i fyou’re interested, but why let it stop your work.. continue with your work and think about it some other day, maybe when your mind’s a bit more clear

well first off, I like regex more than strpos, second off its more convenient, 3rd off it should work 100% of the time

lol @ jymmy

because I need this working right now

what Sean said

heh

then use string functions
try your hand at regex when you have learned how
!+mre

http://www.weitz.de/regex-coach/, or http://www.ilovejackdaniels.com/regular_expressions_cheat_sheet.png

heres the thing, I don’t want to rewrite this using somethign less useful and less convenient because theres a stupid syntax error, thats a lame way of quiting

chewy, so.. I like a 100$ bill more than a 50$, but if you hand me 2 50’s I’m not gonna say no cause they aren’t 100’s

hahahaha yeah you’re right I don’t know any regex
I think you don’t know any regex if you’re idea to fix that is to stop using regex and automatically assume I’m some random noob who knows nothing about regex

So you want to TRUST something that you are not 100% proficiant with?

yes as a matter of fact I do

chewy, we aren’t assuming you’re some random noob, nor are we assuming you don’t know regex (however you just told us)

http://dev.ngisedesign.com/test.phps
chewy:

because I write regex all the time, and I would say I’m at least 72% regex proficient

We’re just giving you a feasable and easy to integrate solution


FIGHT

Usaing regex as a “cure all” is not the right approach, lots of overhead, use the right tool for the job,no more, no less.

chewy, is your ego that big, that us helping you upsets you?

chewy, i think you are high, cuz it works fine on my box

I’m not looking for an alternative solution, I’m looking to know why the fuck (\[dbo\]\.) doesn’t match [dbo]

chewy, watch the language -.-
Anyway, good luck, I’ve got better things to do

then stop trying to tell me I’m a noob regex tool trying to use a grenade to blow my foot off because I have a subtle error in my regex
this is a rather simple regex that isn’t working

chewy, stop saying stuff that hasn’t been said

if it was a subtle error and you know what you’re doing, then why have you asked repeatly in here?

because I am not subtle today, I’m exhausted, overworked and I have to work tomorrow on my day off
you want to see some fun regex? :%s/\($this-\([a-z]\+\)Values.*\)\@=\($indexed\[[0-9]\+\]\) \/\*\([a-zA-Z0-9_]\+\*\)\*\//$this-getFeats(\3, ‘\4′, ‘\2′) \/*\4*\//g thats some vim regex I wrote this week

and your point is?

haha

DAMN, you’ve really got some issues

chewy use www.regexpal.com

http://dev.ngisedesign.com/test.php // http://dev.ngisedesign.com/test.phps

it’s a great tool and helps with testing

nothing wrong w/ that regex

JymmmEMC I’ve already made my point, and my point being it doesn’t work, but we’re way past that now

There are more ways to rome, remember that

Does anyone see why this is returning 0? http://pasteosaurus.com/415

!+doesn’t work

Look buddy, doesn’t work is a strong statement. Does it sit on the couch all day? Does it want more money? Is it on IRC all the time? Please be specific! Examples of what doesn’t work tend to help too. Finally, showing us the code is helpful (after you’ve explained your problem). /msg php-bot
pastebin for more information

JymmmEMC what have you contributed to this conversation? you’ve done nothing but tell me to rebuild what I’ve already built and that I don’t know what I’m doing… you said what you’ve had to said and you keep reiterating that you’re just trolling
because I’ve already said several times before that it failes on [dbo].

!+go

it doesn’t

but whatever, I’ll figure it out

[GO] Gross Overgeneralization. Everything that we tell you in ##PHP is what we consider “best practices”. Of course, only YOU know your own requirements, so you may feel you need to do something we told you not to. Just don’t say we didn’t warn you.

lay off the pipe, sir

hey, thats a nice one
@ GO

hahah yes because OMG STAY AWAY FROM REGEX NOOB is your official best practice

chewy, who in here actually called you a noob?

using php native functions is good practice

JymmmEMC

I call em, as I see em.

haha yeah and you’ve established that you have 123/89 vision
get your eyes checked

chewy: So you want to TRUST something that you are not 100% proficiant with?

-.-

arguing about this issue won’t solve your problem

yes because no one is 100% proficient with anything

you must realize you’re in an IRC room and nobody’s perfect

chewy, we are actually giving you a better, faster and easier way of achieving your goal..

so, let’s try to solve your problem

ASnyde1, liar!

lol

what sean` said

and you can then decide to take our advice or not. That’s your decision. But realize that you’re coming into a room of strangers that are willing to help you.

Jymmm, wish me luck

it’s best to not create enemies

hey guys what do you think of this idea? http://www.doctorrescue.com/

I just turned 21 and tonight’s the night my work buddies take me out
I may not survive, but my IRC connection will

pregnant? (You, not your female half)

InuZ|afk thanks for the help, I know its matching on some, but not all of them

Ah, well congrats. GOT BAIL MONEY?

wtf…. is that english?

sorry

i forgot to update my nick

Jymmm, got bail money + my medical insurance card on me

sorry I’m not trying to be argumentative guys, I just got a little irritated when you guys told me my method is flawed, that I’m not the master regex master of the world, and that you’re alternative solutions are strictly better despite the fact that you don’t know what I’m trying to
accomplish

In an envelope in my pocket, labeled “In case of emergency, tear here”

lol\

chewy, you are trying to check if a string does NOT contain your string

you obviously dont want our help, so………

no no yoou can’t bail yourself out, someone else has to

and we’ve given you a solution for that using strpos

one of the key things I’m using preg_match for is to get the matches array, because I’m not just checking the string, but I need to parse the string

Is it next to the Pocket Shot?

Oops
Yeah.. I have three priorities tonight, in order:

and I have several other working regexes covering the rest of the code

sean`: ^ at the beginning of a regex marks begnning of the astring

1) keep my clothes on 2) do not make passes at female (or male) co-workers 3) do not throw up all over the bar

`cb, I am not looking at the regex, but at what he said

ah

sean` no what I’m trying to do is parse every line of a file, divide it up into distinct cases that give me different data from each line so I can rebuild it

Bad Boys Bail Bonds – Because Your Mama Wants You Home 1-800-BAIL-OUT
http://www.badboysbailbonds.com/html/index.html

chewy, and what do you want to achieve with regex?

Expect to throw up, just also expect photos to be posted at work too

Julian|Work, YOUTUBE :P

Order a Cadillac Margarita, on the rocks, with salt

JymmmEMC, just drinjk 15 tequillas, works good fo rme
some mix-drinks, and the perfect night is almost there

sean` what do you mean? I’m using regex to classify each line and then pull the desired data out of that line

sean`: http://www.drinksmixer.com/drink7393.html
sean`: a href=”http://www.drinksmixer.com/drink7393.html”http://www.drinksmixer.com/drink7393.html/a
Ok seriously…. Do NOT mix alcohol, stay with one type, run, vodka, tequilia, wine, etc. A beer in there is okey. Avoid eating sweets too.

chewy, and what do you want to extract from create table lines?

sean` bah I figured it out, give me 2 mins and I’ll show you what I’m up to

good to hear

Jymmm, that’s good advice, but may be hard, since people will be buying me drinks
I’ll wear a shirt that says “VODKA ONLY” or something

2 asprin + a glass of milk before you begin.

Darker liquors and drinks that taste like candy will be particularly bad combinations.
And food. Eat stuff.

Yeah, I’m picking up some bready food on the way

heavy stuff, chili, burger, etc
mexican food will be the best
the hot sauce will sweat out the alcohol too

But the worst coming up, hah
Alright, it’s time to go

HAPPY BIRTHDAY!!!

I’d say, have a good day and happy birthday Julian|Work

Thanks guys, take care
I’ll report back one day

I’ll watch the newspaper in the morning for ya

‘one day’ :p

!pastebin

Close enough

ok here you guys go
http://hashphp.org/pastebin?pid=27526
thats why I was using regex
so I’m curious if you guys still don’t think regex was the viable solution for that

i am having a little trouble with escaping characters in php, I have a textarea which posts its contents to a php script which escapes it with the mysql_real_escape_string and then puts it in a database, another page then retrieves it with a SELECT mysql_query and then directly puts its value
inside a textarea

my problem is that a single quote will come out the other side as a \’ in the textarea, what did I do wrong?

I think its getting escaped twice
often the server automatically does addslashes() and stripslashes() without you knowing

[fields], that was my thought too, but its not… i have checked so many times

gpc_magic_quotes is off?

I need some desperate help, can someone private chat me to help debug a PHP script?

either way, throw a stripslashes before outputting to your textarea and the problem is gone

[fields], just to clarify mysql_real_escape_string will only put one \ in front of a ‘ and that is not actually stored in the database, it just makes sure that the ‘ is stored in there right….? am I right?

sure
I don’t know. I haven’t needed to use mysql_real_escape_string

[fields], havent needed to use it? im curious how that is….

You REALLY don’t want me to answer that.

I remember the days of php3 where I needed to addslashes() and stripslashes() on just about everything

JymmmEMC no actually I do, you have a more effecient method to perform that same task?

I’m having a bit of problem with this PHP script:
http://pastebin.com/m4056d0a0
Can anyone tell me how to make my server show the error message?

which one, ragon?

well, i really dont want to just strip out backslashes…. there has to be a reason for this, does mysql_query() or mysql_fetch_array() escape characters…?

never mind, it was set to report all error messages
Can anyone debug this script anyway? http://pastebin.com/m4056d0a0

on post it happens

Ragon_, if ($check != “FALSE”); is a bad statement
use if (!$check) or if ($check !== FALSE) instead

[fields], so posting data will escape it?

yep

err. use if (!$check) or if ($check == FALSE) instead

[fields], on the clientside or the serverside?…

serverside
thats why you’re getting doubled

[fields], you’re sure?

dude… test it for yourself for proof

[fields], so, is it php that does it or apache?…

I think its php
yeah, its php

[fields], just a general escaping… or one specifically for mysql?

every server I’ve used since 2001 automatically escapes post data

[fields], perhaps i should turn it off. ill look it up online, do you know if there is a name for this feature?

see, before that, you had to addslashes() to every single damn variable, oh that was time consuming
gpc_magic_quotes

i see
interesting
so, i really dont need to be using mysql_real_escape_string to all my input then….

exactly!
but if you must…
then use stripslashes() too

odd, i was just always taught to totally distrust input, but if php pre-escapes it then…
huh

you’re gonna love it when magic quotes is removed :P

haha

It dies in PHP6

InuZ|afk, probably good

i cant wait

i’m using php5

you in france?

means you don’t have to do stripslashes on all input at least

think I should disable it in php.ini then, i assume i can?

In the UK

magic quotes is a good thing. Its real annoying to addslashes() on all your input before putting in the database and stripslashes() on all your database queries/variables
but if you want to, have fun
reminds me of 1999
party like its 1999

technically, it’s not. addslashes doesn’t always do the same thing as mysql_real_function name I forget.. afaik anyway.
so depending on the DB type you’re gonna use, you’d have to use stripslashes first anyway

mysql_real_escape_string

yeal, that thing. that function name bugs me I wish it’d just been mysql_hawt_escapage or something. oh wells.

InuZ|afk thanks for the help a while back, sorry I couldn’t reply as I don’t have a registered nick, so I can’t send private messages

i dont understand stip slashes, why would I use that?

oh really? forgot about that. glad you got it all working anyway

yeah it was a stupid little error, I was missing an _ in one of my character classes

ah

i want to just get the raw exact data from the post, and then use it, if i am going to use it in a mysql query, i want to use mysql_real_escape_string before using it in the query, then when I retrieve the string, it should be exactly the way it was before the mysql_real_escape_string…
right?

but hey, now I have a script to convert mssql sql files into mysql sql files
_Quintus_ yes the data should come out of the db without the extra escapes

chewy, so it sounds like i want to disable gpc_magic_quotes in php.ini and then use it the way I have been using it, with mysql_real_escape_string… does that sound right?

Anyone know of a way to discover the tablename of a particular query from a mysqli_result object? Don’t suppose it’d be possible, eh?

fieldnames yes.. table name.. don’t think so

I’m not too sure, I haven’t use magic quotes that much, but as long as you do any escapes before you run mysql_real_escape_string then mysql should handle it just fine

darn. thanks anyhow.

or sorry, if you _don’t_ do any escapes, and only do mysql_real_escape_string you should get the data out fine, but if you escape it before mysql escape you’ll get things like foo\\\\\\\\\’bar and that won’t come out of the db properly

So… I guess it’s not possible to override magic_quotes_gpc on a shared hosting server (not my own), am I right?

might be, htaccess php_flags I think it’s called

Most likely not. You can simply undo its effects, however, with stripslashes and get_magic_quotes_gpc.

if you have permissions to change php.ini you can probably change it with ini_set

No, it’s too late by the time ini_set is seen.

mattmcc so you can’t change that on the fly?

you can override any of those server settings with .htaccess

From within a script? No.
Magic quotes has already been applied (If it’s on) by the time your script is executed.

[fields]: how often does a hoster allow that, though?
I can try it, but I’m assuming my hoster won’t allow such a thing.

mattmcc ahhh ok, yeah I haven’t played with magic_quotes much, but I have used ini_set fairly often to change other ini settings

I don’t see why a host would disallow .htaccess

Not htaccess in general, but allowing to edit php settings.

matmcc, chewy, ah ok. So stripslashes is used to just undo gpc_magic_quotes on servers where people dont have access to their php.ini, but for a dedicated machine its fine just to disable gpc_magic_quotes?

[fields] its pretty common to disallow both, or at least that you have to get htaccess enabled by your host

If you can disable it, by all means do so.
If you can’t, then naturally you’re stuck just undoing its effects.

if you run phpinfo() you’ll see there’s two columns, one server side (php.ini) the other is local (optional .htaccess modified)

mattmcc, ok, thanks for the help!

Is Perl a dependency for pHP?
PHP*

don’t think so

Hm. FreeBSD ports seems to think so.

Why would it be?

Not sure.
B-deps: autoconf-2.59_3 autoconf-wrapper-20070404 libiconv-1.9.2_2 libxml2-2.6.29 m4-1.4.9 perl-5.8.8 pkg-config-0.22

Hm, magic_quotes_gpc says Off On now, but it still adds slashes. Does that mean it failed?

that would be funny if php runs all its pregs through perl
but if it did, then you would be able to do non fixed with lookbacks, so I don’t know what perl is required for
s/with/width/

It’d make them more functional.. PCRE doesn’t have quite everything.

yeah that would be helpful

What is the ‘Suhosin protection system’?

Do you think its worth taking courses to get the qualification for Project management.. Its not a case of learning the stuff but getting the qualification.

Nevermind, got it.
http://www.freshports.org/security/php-suhosin

bloop

I’m building a newsletter sending system. When an admin clicks “Send,” the PHP script will send to perhaps thousands of addresses… we want to send to a set number of addresses (say, 200), then sleep for two minutes so the server doesn’t melt
how can I impliment this without having the user wait for the page to finish loading after the entire queue is run?
I was thinking I would fork another process and run it from there… but process working in web apps is bad

use a cron job
also make sure you don’t send 200 message all at teh same time

in other words, put the messages in a queue then have a cron job process the queue?
how can I ensure I’m not sending 200 at a time? I guess I’d foreach through the queue and run mail() for each?

I think there is a sleep command
http://php.net/sleep

yes, I was going to use that… but you said not to send 200 at once, which is what I’m processing each iteration (after each sleep)
yea

well, what I was trying to say, don’t try to send 200 mail messages as fast as possible

oh, yeah :-)

also do a MX lookup for each domain and make sure you don’t spam one mail server with 200 messages/minute
so you spread that a bit

ohh, good idea

fopen(‘./’$user’.txt’, “a”);

no

is that what the manual says?

No

fopen(‘/.’.$user.’.txt’,”a”);

Thank you

read about the concatentation operator

Sorry I am new to PHP

that’s what the manual’s for

php3333

why not fopen(“/.{$user}.txt”,”a”);
Not sure what path you are actually trying to use…

./myusername.txt
Thats the path

Why use files for users? MySql is the best 333

why is mysql if you can use files

Except I need to use txt files, my sistuation is a bit tricky
And now… Parse error: syntax error, unexpected T_STRING in register.php on line 28

Comments off

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »