Archive for Uncategorized

hi i use scriptaculous autocompleter I make it scrolling using overflowauto Onfortunally if I have a long list

objElement.offsetHeight
should work imo
imo here jquery is what you want too there exist $(document).ready(function() {}; which is executed immediatly when domtree is loaded

hey everyone

is there a channel for lightwindow ?
or should i go to scriptaculous ?

jquery will kill javascript
:P

=/
way to nick alert me

sorry

for this i would try the event DOMContentLoaded. It doesn't work
so it wouldn't work with jquery either

Byan lol

is there a way to get normal error messages from IE6 ?

what is a good way to check if a key exists within an array?

if(array[key]){ /* it exists */ } could work, not sure
^

define 'normal' ?

if(key in array) works

mrkaps - normal : not only line number and character , but with file name too
for start

there's a firebug lite script that you can include for IE which will give you some extended info
but IE is setup to be used with a realtime attatched debugger
ie. Microsoft's Script Debugger app

that doesn't work

(pretty sure its still a free download)

as

what doesnt work?

huh? idk i started typing as my friend on the phone decided to confuse me -.-

lol ok
you can also download the web development portion of visual studio express, and use that to debug with IE, which will let you step through the script in realtime, add var watches, good stuff
http://msdn.microsoft.com/vstudio/express/
(free)

andrew_, stepping throught would be nice .. but , i get error at line 1500-something , and with no filename

hi all. can i affect newly opened tab in firefox ? if i have opened that tab and i have link to it

how can you open a page in a new tab? .

i bet it would be a long way to step through whole scriptaculous/prototype/lightwindow

nice =P

ehh

window.open do this. if firefox configured to open new window in tabs

oh
var blahblshfaslfsadfas=window.open(………); ?

aha

the firebug lite script might give you filename without stepping through
ie's script error reporting was designed around a stepthrough debugger, so if youre used to firefox's error reporting, then you'll prolly consider it limited. sadly theres nothing that im aware of to extend that

moin

mo

does the canvas tag support text?

canvas tag?

Yea

is there a foreac() in javascript? I need to loop through an associative array

yeah foreach (var key in myarr) { }

for (foo in bar) {} should work to
i dont think foreach is that well supported

there's no assoc. array in javaScript

just use objects

Ripley's believe it or not

var foo = {key : 'value', key : 'value',}

hi. i use scriptaculous autocompleter. I make it scrolling using overflow:auto. Onfortunally if I have a long list that I dismiss and make another long list without reloading, the div remains on the position inside the overflow area. So how can I reset that overflow area?

what is something like var myArr = new Array(); var myArr["something"] = "some data";

hi all

it's wrong

why?

because arrays have indexes, not keys
that's why they're arrays

ok what you call what I posted?

it's a way of abusing an array because it's also an object

abusing an array?

you should just use "var myHash = {}; myHash['something'] = 'some data';"

where is that documented, google doesn't return much

it's just an object

I wouldn't call it a hash tho

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Literals#Object_Literals
true, that's kind of misleading too

indeeds
associative-array best fits the description

well, i think hash maps is a better term for js objects in general
well, i think hash maps is a better term for js objects in general

bbiab
"hash maps" denotes implementatoin. ASsociative ARray does not.
…. why did I type that using PAscal CAsing? o.O

but the implementation is pretty transparent..
anyway, it doesn't really matter much what we call it, as long as we know how it works

hello!!
anyone here uses scriptaculos?
I have created a Sortable element and I get the sequence

hello

and then I later compare the sequence to the one I saved
I have used an alert and they are equal

so say I have some db info and I need to return multiple rows in an array. var myArr = new Array(); myArr[0] = new Object(); myArr.field1 = "hello"; myArr.field2 = "some more data";

but when I do a == it gives me false
anyone know why?

is thisi right? form name=formname action=blaha name=name href=# onclick="document.forms.formname.submit()"/form

nevermind
I am comparing objects

Acs, why aren't you using " around all your fields?
your could use this.form.submit() instead…

this.form.submits returns: this.form has no properties

Hello, I am learning the Ajax stuff. Can you test my work? http://jouts.net/GuessJouts.html

bha
no
too lazy to move my mouse ver your link :p
over

hi all

try to think it might be pr0n, you won't be lazy anymore
:P

Yns, yo man

is there any good method for debugging in javascript except firebug/firefox error console?

myArr[0].field1 = 'hello';

Yns the good ol' alert() debugging

Yns, try{ /* your code*/}catch(e){alert('an error happened! ' + e)}

VistaBear, thanks man.

why does it say this.form has no properties? the form has been defined

Thanks for the "boobs", no more players? http://jouts.net

dunno, PY1NB

is that in the form action? use just "this"

this.submit is not a function

show the line

Is this valid JS? "} catch( e if e == "RanklogEntryParseError" ){ " ?`

torarne2, no

hi csaba
SimpleSample here. Remember me?

brainy^: why would someone write that? is it part of another standard or language?

hi again

torarne2, i think only mozilla supports this

where were you? show the line this.submit

ok, thanks

torarne2, part of JS 1.5
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Referencetatements:try…catch#Conditional_catch_clauses

now can I loop through my new hash somehow, or whatever you want to call it

someone kicked my power cord
a name=receber href=\"#\" onclick=\"this.form.submit()\"checar contas a receber/a
the \" are for php print it finely

PY1N1, only inputs have a form property

conditional catch seems kinda useless

like that

and use style to make it appear as a link

oh boy

oi PY1N1

oi wnix, brasileiro? maraca?

sim, de bh
esse seu comando funcionaria só se fosse num botão de submit
me diga, sua página tem um formulário só ou mais de um?

vamos falar em portugues no pvt, pse

ok, pvt-me

yo wnix what's up?

;D
how are you?

i was watching family guy, only noticed you wrote cause the taskbar flashed

hmm, esse nick nao ta registrado. vc pode dar join no #py1nb ?

hum, great

tnx

hey, that jsdraw is amazing

`js ref

`js domref

huh? jsdraw? the dLL?

Hey all, I'm trying to change the cursor on a td to a pointer and then back to default with js.
document.getElementById('UseBackgroundColor').style.cursor = default this doesn't work.

use quotes
……cursor = "default";

Ah thanks!

this http://www.danga.com/misc/jsdraw/xmlhttp.html
use firefox

Ok guys, we need to plot an evil plan to teminate IE!

lol
I like IE
but like FF more ;]

]]]+
wrong channel

contaminate

or a href="javascript:blah();"?

(or is this offtopic)

I drew something for you

neither

element

beatiful eyes

pretty much any element can have an onclick
even better would be not to put those attributes into the HTML, but to use a javascript function to add your javascript handlers
that's pretty advanced though, so don't worry about that if you aren't that experienced

http://projectx.daedeloth.be/
I don't have a debugger, but could someone tell me what file and what line I should look at? :-)

nope, I'll go for it. thanks a lot

remember you can use the cursor:pointer CSS attribute to change the mouse cursor when it's over an element

yep of coure

for their onclicks because they don't know about that

course*
right

anyone here running windows?

daedeloth
req.xmlHttpCounter = xmlHttpRequestCounter;
line 52

k, thanks

in ajax.js

hm what should that be? var req.xmlHttpCounter ?

xmlHttpCounter isn't a property from req object

hm so I can't add new properties? I thought I could thread it like a general object?

in firefox, safari, opera yes
in ie7 I don't know
ie 6 or less no

hm, k. I don't really need it anyway, I'll remove it.
damn, those pngs look sucky in IE

req.prototype.xmlHttpCounter = xmlHttpRequestCounter;

hum

wouldn't that work?

try that vistabear says

ah, k. I'll give it a try

in IE 6 and less, use an activex
so, I don't know if it works fine

yep
oh well I'll just remove it, never mind.

are there anyone still running IE 5.X ? 0o

okay it's kindof working. any clues how I could fix those pngs?

daedeloth, you want them to be transparent?

yep

use alpha filter in css
(IE only shit)

compare IE's version to firefoxs version -

hi

daedeloth, http://www.nczonline.net/archive/2007/1/406
piXelshooter, hi there!
sup?

I'd linke to create a popup-window that does something with the last activated other browser window, exactly, with the url. So, I'd like to check the url of the last activated other window.
is that possible?

http://projectx.daedeloth.be/images.php

sorry, no, piXelshooter

oh… not good.

great system
congrats

there's the difficult option of POSTing the current URL to the popup, then PHPing it into the js

piXelshooter, like I wrote yesterday, this applies to urls also:

you cannot alter other pages other than the current one with javascript, and you cannot hide the adressbar unless you do it when opening the windows with window.open

hmm, I *think* I've seen scripts that manipulate other windows but I might be wrong

if you use window.open, you might have success
like var aWindow = window.open('url', …); aWindow.location.href = 'new location'

well, I think, that isn't actually what I think of:
I have a list of browser windows/tabs.
then I open my script page (ie, via bookmarklet)
the script shall do something with the url of the window I had open before.
til here, no problem
but now, I would it like more this way:
my window is open, and I change the url of the old window, ie per link.
now, my window should recognize that the url of the last used other window changed.

hello! why I get for document.createElement('embde') a typeof 'function
?
only in firefox

if I realize it, I wouldn't have to recall the code again and again.

add an onunload hanfdler, which reports back to the parent window?

did you mean 'embed'?

document.createElement('embed')

hm, or add an onclick handler on the links

yes

vistaBear, ok, i'll try it ;D
eer, and, is there something like onminimize (I know, it diesn't exist), that is called when the window is minimized?

if there is something, google will tell you, but i think there isn't (and i hope there isn't)

ok, but, why do you hope so?

piXelshooter - because I don't want your script to know when i minimize
that's a useragent behavior that should have nothing to do with what is going on inside the window

i don'T want any action to happen when i minimize, such as… prevent it, open a popup, play a sound, alert something, etc.
that actually enters in the "Don't mess with our browser" rule

hi

is this valid var groups = new Array();
var groups[0] = new Object();
to create an object within an array

I have a onclick event matched to a form's buttom and in the javascript function is like that http://pastebin.ca/655637

The paste 655637 has been copied to http://erxz.com/pb/4017

but the form is still sending even when fields are empty
I have got something like input type="submit" value="Save" onClick="edit();"//div
do I have to add a return?

hmmhesays, yes

and not in onclick in the input

because that does not sem to work

var groups = new Array(); groups[0] = new Object();
eval var groups = new Array(); groups[0] = new Object();

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

if I load a page into an iframe, how can I use the javascript called in that page to be used instead of the parent window's javascript?

You want to disable Javascript in the parent?

know, i just want to use to prototype.js in my iframe's env instead of the parent's
know = no

I think both will run.
I think it depends on the user agent though.

well, they seem to partly, although, I don't seem to have access to the Array methods that prototype.js offers in the iframe. I only seem to get those methods in the parent
even if I call prototype.js in the iframe

fozze, js in firefox has that natively
array.forEach

yah, but I have to get this to work in IE too

Then get it to work in IE too…
Should be a simple conditional.

hello. I am having some pretty simple issue with a script I've been working on… was hoping to find some help
this is the correct place to go to?

hey folks … how to retrieve part of some page and then to display info with js on other ?

ajax

functionName is not defined. even though it is indeed defined in the js

mefisto, any examples maybe ?

don't know if this will help you, but take a look: http://www.xul.fr
they have some pretty simple ajax examples
and what you described sounds like something simple enough that you can just copy their codes and make changes

hey..
does anyone know how I can scroll to an element?

not sure, but it might involve making an anchor

tnx atula

if I have post = document.getElementById('post1234'), how do I make that the "top" of the page?
…or the top of the viewing area

hey everyone

perhaps you can make that a div and then make it absolute positioning?

hmm. what if I alter window.location.hash?

and in stylesheet, make the necessary positioning place?

I dont have access to the stylesheet
it's a greasemonkey script

hmmmm then how can you get the id?

hello, how is the md5 function called that is buildin to javascript ?

you can set css in gm scripts too

you can do inline style too… div style="position:absolute; yadda"/div

rocketmagnet, http://www.myersdaily.org/joseph/javascript/md5.js

yeah, but i can't use position for this

wasn't there a function from javascript hosting ?

in js function 'md5' doesn't exists

can i specify utf8 encoding for js file?
i kinda have it in php hosting and have header application/x-javascript

?

so i can just add this .js file and use md5('somevalue') ?

yea)

dabear, window.scrollTo(0, post.offsetTop));

kronos, if web page is in utf8, its gonna kinda expect js in utf8 as well right?

grimboy, nice
I'll try that

i want restrict user input same maskedit in windows application any one can help me.

rimad, i think yes, but you can test it)

hi

hey enzo

imagine i have input id="foo", i have var foo_object = getElementById("foo"), with var foo_object, how can i get it's id name back ? (foo)

this placing dynamically created tables really sucks
they aren't going where I think they should

enum, foo_object.id
enzo, foo_object.id

should I be using span instead of div if I don't want paragraph breaks?

ok grimboy

is inline.

anyone here use Ajaxpro
the .NET library

inline

i'd like to know if i can tack properties onto the result object
the server side return value

what is an appropriate way to stop or at least handle dhtml applications when the refresh / back / forward buttons are used?

any example how to retrieve text content from td element and to make that text to be clickable ?

' + td.innerHTML +'/a'

dabear, it's for gm script … and i have like 20 td's on that page … but there's only one with "health" text in it

??

i have page that have 20 td on it … and i need only one … how to retrieve it's text ?

document.getElementById('table').cells[0].innerHTML

oh … nice … tnx

Hi, Can someone help me please? http://rafb.net/p/ESoXgF14.html This is working on FF, But not in IE, Does someone know what is wrong? (It must count how many emails are 'sent') (Sorry for my bad english btw)

what a horrible code O.o
Why you have in method in class echo function
blech

hmm..

create method is … heh
First. Don't use echo funciton in methods, you should return string and then write it in code.

i have var tab = [], i want to add an element in tab[2], how can i do that ? tab[2] is another array
maybe tab[2][] = 'foo' ?

enzo, that doesn't work in js
if tab[2] is an array, you can use tab[2].push('foo')

ok

anyone have any experience generating dynamic tables? I'm having some trouble appending them to my DIV tags and making them go where I want them to
layout wise

hmmhesays, avoid innerHTML…

avoid it where?
I'm only using inner html on cells, when the tables are generated they look just like I want to them

element too, otherwise the table wont get displayed in ie6

avoid using innerHTML when writing tables

like I said the tables look just like I want them to
however, for the life of me I cannot get them to sit side by side
when I generate the second table based on what the first table was clicked, it is always underneath

how do i detect for onsubmit in my header javascript?

is there a way to safely include external javascript file via javascript code?
!seen buubot
seen buubot

Sorry, I haven't seen buubot

seen Byan

way to nick alert me

thats what I can't figure out
I tried appending my tables to a div tag and span, same result

_

beer Byan

what is your opinion on SVG vs js+ dom ?

there is no vs for svg, dom and js
at least i cant see one

http://www.kevlindev.com/tutorials/basics/index.htm

"AhmedShaikhM" at 71.6.194.243 pasted "javascript code" (1 line) at http://erxz.com/pb/4018

so do you have any idea how I generate two seperate tables and make them sit side by side?

depends where the data is coming from that you want to display
and if it needs to be fast
generating svg with js+dom is quite easy but horrible slow
so, what do you want to do?

yep, probably svg is more sutable for real-time graphing
suitable
gfldex just exploring technology

i create stuff with inkscape and add some js for dynamic stuff to it

trying to identify svg's place

hard to tell atm
it's not really well supported and if you leave the warm and fuzzy mozilla realm you will be surprised quite often with svg
you can do quite a lot fancy stuff
like interaction between svg and the surrounding page

i think comparison should be done in js+svg vs flash
http://www.carto.net/papers/svg/comparison_flash_svg/

that exactly what you cant do anymore with flash
you can't access javascript objects of the html part from a flash on a page

Meh, svg. Canvas

even if they come from the same domain
but svg is a lot slower as flash

is there a way to safely include external javascript file via javascript code?
"javascript code" (1 line) at http://erxz.com/pb/4018

AhmedShaikhM eval ?

if you are used to xml and use xslt, css and such quite heavy and can convince your users to use mozilla or opera it's quite nice
and can save you a lot work

AhmedShaikhM, document.write("script")
AhmedShaikhM, Is the only portable way.

it hangs IE7

I suppose I could user css to place my div tags

is part of HTML

Oh?

http://erxz.com/pb/4018

Yeah, I saw. I just not sure what you're doing wrong.
you might be better off having a javascript build files cause otherwise you'll end up with a lot of superfluous requests.

i want to make a child window cause a submit on the parent window… how would i do this?

javascript build files?

You know. A small script to concatenate your scripts, minify them, pre-gzip them and give them a timestamp so you can get your webserver to sent some ridiculously long expires header.

"AhmedShaikhM" at 71.6.194.243 pasted "hey grimboy have a look at the code" (31 lines) at http://erxz.com/pb/4019

have a look at the new past
What I am trying to achieve is that, I want to add XHTML parts on link click so that TinyMCE editor get activate on some javascript based event

i can change the value of a form on a parent from the child window, but how can i make the parent submit too?
window.opener.document.main.displayPref.value="newSkool"; ….what other code can i put after that to make the parent submit

"SamuraiDio" at 71.6.194.243 pasted "How do i make this (the loop and the endsWith() ) without prototype?" (25 lines) at http://erxz.com/pb/4021

is window.opener.document.main.submit(); valid?

if main in the opener is a form, yes

i got the child to 1) change parent values of some fields in the parent form 2) force the parent to submit .. problem is the submit didn't "include" the modified values
which is strange, becaues you can visually see the change, for instance, in a drop down, you can see hte parent's value of hte drop down change, but the child making the parent submit, doesnt seem to keep this change

rook2pawn, What if you put a timeout on the submit?

what for, im not closing the popup. the child is used to make display adjustments on the parent

can anyone destermine the purpose of hte ? and the :…is that a ternary operator used in a regular expression? /(\d+)(?\.\d+)|)/

non-capturing-group construct.

the first (\d+) captures a series of digits, the second one doesn't capture but places into a group.

it's kindof superflous in that example

the reason why you would want a noncaptured group is so you can express more complicated matching patterns, such 5555.88888 or 5555.foo but not 5555

you could as easily write /(\d+)(\.\d+)|/

how do i convert a JSON string such as {"name":"test","image":"test.jpg"} to an object with the corresponding properties and values?

You use eval.

thanks

eval('var obj='+json_string); alert(obj)

Hi all!
Is there anyway I can tweak the CSS (visibility in my case) before the page is rendered using JS? When using onload() I get a moment of flickering when the black text is displayed.

thanks fatbrain, it worked… but doesn't eval() have problems in internet explorer?

rindolf, You can attach an onload to the element itself which might fire slightly quicker.

but I have many elements.

can you edit the css directly and control the classes assigned to the elements?

i have a popup change some values in the parent form, and i can visually see that the values are changed, but when i have the child make the opener parent submit, the changes are lost

yes, I can.
but I'd rather the page not be all with visibility : hidden if JS is disabled.

Why not do that then?
Oh

is there any other ways to load an XML document other than xmlDoc.load ?

rindolf, You could shove stuff inside noscripts

no.

you could look at YUI's onContentReady event and see how Yahoo is handling it.. it should be in the event library at http://developer.yahoo.com/yui/event
they have a few different events you could look at.. onContentReady, onDOMReady

how will this help me?

onDOM waits for all child nodes, onContent waits for the node to exist at all

rindolf, Stuff inside noscripts only display on browsers with no javascript/javascript turned off.

oh.

rindolf, hello

Hi pkrumins
what brings you to ##javascript ?
Well, nevermind, I'll use CSS.

interesting

rindolf, this:
http://www.catonmat.net/blog/learning-javascript-programming-language-through-video-lectures/
a href="http://www.catonmat.net/blog/learning-javascript-programming-language-through-video-lectures/"http://www.catonmat.net/blog/learning-javascript-programming-language-through-video-lectures//a

i need opbject oriented stuff anyway

I see.

my popup can change my parent's form values, but when i submit on the popup, the parent submits, but not with the data

fatbrain, ok i understand the noncapturing now, but what is this now. (?=pattern)

hi

section31, A zero-width positive look-ahead assertion.
for example "foo(?=bar)" would only match foo if it is followed by bar without including bar in the match

gotcha
thank you

You're welcome!

it is possible to work with prototype and mootools simultaneously, both?

only if they both have a function named "$"
/troll

karma vinse funny

how come you need both? seems like they have a lot of overlapping features … and i thought mootool's advantage was its small size, which you'd be negating if you're also including Prototype

vinse, mootools provide a effects..
its a question

all - how do i pull the text in an HTMLLiElement?

i want use it
but already use prototype

is the tofixed method supported by most browsers? where can i find the compatability of certain methods between diff browsers?

:w
hi all
plz
http://pastebin.ca/655920

The paste 655920 has been copied to http://erxz.com/pb/4022

he working on Firefox but not on IE
ie have some problem with getElementsByName function?

getElementsByName is a bad function. Don't use it.

I'm searching in the innerHTML of an element for any strings that could be links. I'm going to replace those strings with actual live links, so "Oh my god becky look at www.foo.com" would turn to "Oh my god becky look at a href=\"http://www.foo.com\"http://www.foo.com/a".
The reason I'm only using Javascript is because I cannot make any modifications to this "system" or "site", and this is actually my own Grease Monkey script.

and what I use to get all elements with same name ?

Here is the corresponding code, lmk if you have any questions..
http://rafb.net/p/wD0AZx45.html

Aankhen“: what is method to it, I need to count all elements with name 'marca_nome' that have text

Iterate through all the elements in the document, test their `name` attribute.

hello. how do I get an element in xml… the equivalent of .getAttribute("attr")?

ich mach jetzt feierabend. noch einen stressfreie nacht euch süßen ;P

yummy_sammich, here's some stylish code for you:
http://norskwebforum.no/pastebin/9263

one sec…
phone
brb
impressive
–n00b
thank you a lot

is there a way to use an object as an array key? http://pastie.caboo.se/87300

GMFlash, did you try it?

of course

and it didn't work?

i tried with both array and object

then you would need to assign them as values instead
like itemsByObject.push(items[i])

i need to get a link between the object reference and the array index though
so that wouldn't work

GMFlash, no, you wouldn't

itemsByObject[el] and have it return a number

because; var itemsByObject = []; itemsByObject.push(items[i]); itemsByobject[0] would be the object
so what about using the id of el instead?

they don't have ids

well, keys cannot be of type object, can they?

i thought they could be
i swear i've seen it before

so you have to make your self a function or something
ah, now I see
when you do bla[foo] = bla, you are converting your array to a hash
and a hash doesn't have a .length property

an actual type conversion takes place? so that subsequent calls to bla.length fail?

try this:
javascript:var t= new Object(); var arr = [];arr[t]='foo';alert(arr.length)
and then
javascript:var t= new Object(); var arr = [];arr[0]='foo';alert(arr.length)

i changed the array to a hash, it is partially working now
the only problem is that the value of each item in the hash is the last value of i
i'm guessing because they're all referencing the same instance of i ?

Is passing an FS Command through VB and then to JS not compatible with IE or FF?
http://pastebin.ca/655974

The paste 655974 has been copied to http://erxz.com/pb/4023

^Link to my document

gmflash the object you saw probably had a toString method, thas wjy it coul be used as an object key

you realize VBScript isn't supported in any other browser than IE, Kai_wp2 ?

Well its working in Opera.

A page with VBScript is working in Opera?
o.0

I can ensure you the vb-part is not executed in opera

ensure? heh. you mean assure?

ahh that appears to be the case

why do you explicitly specify that the args should be passed ByVal?

looks like i'll just have to give an id to each item

they are by default passed ByVal

Well the Flash passes a command to the VBScript which runs some JS and its working fine..
It doesn't work if I remove the VBScripts.

when used as keys, objects are converted to strings

Well I didn't write the VBscript so I left it.

so basically the only way to fix my problem is to set an id?

I couldn't find a way to pass vars from flash to JS so I used this.

deltab, hmm, empty strings in this case, are empty strings valid keys?

I geuss I could've used geturl();

length only counts the numbered properties of an array
they are

anyone has experience with google map api?

right, nice info, deltab

function definition inside a loop?

nah i just want to make a quick lookup/reverse lookup of an array
if i have 10 LI's in an array… index of 0-9 i want to be able to later on do something like: reverseIndex[el.id] and get a number 0-9
i thought i could just use the object reference as a key but apparently not

the object probably convert to the same string

so i'll just set an id
right it is, just found that out in a test

what do you want it for?

i'm emulating a multi-line select widget
with an ordered list, so i need to keep track of things via an index

why not use a real one?

it doesn't offer the flexibility i need

along with document.createTextNode, can you delete a text node?

note that you can add properties to the elements

or…should i just hide it?

Node:removeChild

yay
thank you

Whats the best way to pass a var to JS?
From Flash?

with mind powa
(or serverside language)

LOL A serverside language
Theres ExternalInterface.call("Function"); but it won't pass an arg

ever heard about ajax =P

ajax? what's that? sounds new and trendy

uhh

I don't like it but . Its really kewl

no don't use it, it will eat your soul

ajax is some kinda cleaner, people!

I thought it's a football club from the netherlands

use it to clean your windows or something

I thought its a kind of plane.
I use it to get to the city.

AJAX:
http://www.cleansweepsupply.com/pictures/standard/bcpm2166.jpg

JS running on the server or the lient?

I use Ariel

so that's ajax!

csaba, now its called Air =]

I won't accept this!

i dont even know why people call it ajax since it is also synchronous and can be used to pass more than just xml such as json and text

I don't really know a lot of people that call it ajax

only part that is needed in ajax is J

I use 'ajax' to mean partial replacement of a page using data requested from a server

no
wrong
you can do it with flash too

they should just call it XHR or XMLHttpRequest since that is the function name

I usually call it xmlhttp

GMFlash, i tried

that's what it's original name was

Looking for ideas on how to build a "drop zone" for files dragged from Windows explorer. I know it would be IE specific, and that there would be security concerns, but….

it's not just XML :-)

boss looked kinda strang on me

yeah i know even XMLHttpRequest isn't the correct term

you can push it directly

'ajax' is easier to pronounce

really it is just a "HTTP Request"

… used in a particular way, yes

ajax is just a word your manager uses to impress clients

and and easier to 'understand' in Marketing Section

what does json mean?

javascript object notation

ah yeah

good thing this AJAX stuff will be a thing of the past when web 3.0 is here

not really

i was just making fun of buzzwords

it was created before whole web2.0-fuss

i know for outlook web access

for that too
the same about blogs .. ppl were writing web journals at mid-90s too

everyone make sure to thank microsoft for XMLHttpRequest()

GMFlash, its hard , because it was only side effect for ActiveX

you could do ajax with images and cookies

or iframes
i'm really glad those days are gone

you can upload files too (which actually is one of coolest features )

tell me more
how?

=]

how do you go to the next iteration in a for loop ? in Perl its next()

continue;

I need a simple script that will make a label like "Searching.." appear when a form submit button is pressed
can i just do
onClick class=appear or something
i've used a class for hiding labels before so i know how to do it
i'll try it..

Saberu, why not change the text of the submit-button?

_$('submit_box_id').value = "Searching..";
assuming you are using prototype, or just have that useful function in there
function _$(x) { return document.getElementById(x); }

ah thanks didn't think of that
is there a simple way to do that?
document.getElementById('submit').value = 'Searching..'
like that?
assuming the id of my submit button was that

yes

now from usability point of view that is crazy to change search button's title to searching, what if i hit escape before the new content is returned
i would still be on the same page with that stupid searching.. button which has no longer anything to do with searching because none is going on

then I would reset the buttons value?

setTimeout

now that's better

besides, can you really reset an ajax-call using backspace?

but, how would you know the timeout to setTimeout
what if db was clogged up and search took more than usual

set a header with no-cache value, problem solved

dabear, with backspace?

how do i get the date 7 days ago?

from JS? I wouldn't…
talk to ##php

no
i need to do it client side

client side depends on the user's computer - it could be the wrong date

not using the current date

so you're just talking about some math? :p

pretty much
how do i get the date that is 7 days before a date?

but you don't want to make a matrix of how many days are in each month? :p

i dont see functions to do it in prototype or YUI

php, by writing an algorithm which subtracts 7 days from this date, duh.

blah

Question, I'm trying to refresh google ads w/o having to refresh the page. What I tried was just replacing the div with google's JS snippet with a new snippet..but apparently the JS isn't getting evaluated. Is there a way to do this?

IE6 is throwing me "object doesn't support this property or method" at a line in my code, which is "instructions.innerHTML = errorMessage;". Does anyone have a clue why this might be?

phpwner, var d = new Date();d.setTime(d.getTime()- (86400*7*1000));alert(d)
eval var d = new Date();d.setTime(d.getTime()- (86400*7*1000));write(d);

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

bha
works in the browser atleast

emm .. goal its to make it work in browsers
not just in one

yall can suck my toe

lol newb :p
@ phpwner hehe

mefisto, works, but not with buubot :p

maybe because of write(d);

eval write('foo')

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

^^

print ('foo');

foo1

eval document.write('foo')

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

new Date ();

{ }

ah well

eval document.write('foo');

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

hm, okay, probably was the bot in #prototype which used write..

hh

How to check checkbox status for checked/unchecked?

thebox.checked will be true or false depending on if it's checked or not

thank you!

how can i get this js to clear the html form after posting a comment, people keep clicking submit and posting more then once, here is my code snippet. http://pastebin.ca/656100

The paste 656100 has been copied to http://erxz.com/pb/4024

Why not disable the submit btn when pressed
onClick="this.disable();…"

ah, i could do that, would it be much harder to clear that form?

No, but usability wise it wouldn't be so nice.
It's nice to know that the information you just entered is still being submitted, and that you actually pressed the "SUBMIT" button, and not the RESET button.
know what I mean?

i guess, all of the ajax powered comments i've come accross clear the form

I always disable the submit button, and change it's inner text to something useful, like "Submitting"

ah, how can I clear the form? I will try both and see how i like them.

form.reset(), but that'll clear the values before the form is submitted, so it would be a very bizzare solution.

ah, how can i clear the values after it's submitted?

you can't

Yeah. Why are you so set on clearing the values?

because then the location would have changed
e.g you won't be on the same page

If you're waiting on an AJAX response, then clear the form with either .reset() or by clearing the values of each of the form's elements/inputs manually.

or the page is reloaded if you provide the same page in action=""

i basically want to clear the form after it's been submitted, this will stop users from clicking submit again and posting the same message. I have some pretty stupid users that will post 3-4x just because it's fun.

No. Disabling the submit button will stop users from submitting again.
clearing the form will simply…clear the form. not much else.

why not just make an array of the fields, and then for each field set the value to nothing?

hi folks

Hello chr0me.

how can i call a javascript function from php?

how do you mean?

there is an onclick event and i want to execute that js function on array elements

by putting it in output'ed html

without clicking on them

tags

make it in window.onload = funxtion(){}

onload event is usually what you want though

ok

!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"htmlheadtitle/title/headbody/body/html
oops, sorry

pkrumins, katru reizi kad tu nelieto strict, dievs nogalina ka7nu
=P

cik saveejo

oho

vells

3 gabali
pilniigi nereaali. pirmo reizi pa vairaakiem gadiem kaadu veel te satieku no .lv
tas ir freenodee, ne #js'aa

arii linuxisti biezhi gadaas attieciigajos kanaalos

Fj neviena cita te nav

aa, es par to neintereseejos, intereseejos tikai par programmeshanu, neesmu linux kanaalos, taapeec ari neesmu laikam ne1 saticis.

veel kaadi pieci toch ir satikti

nez , katr kur ir vismaz 100 cilvji, ir vismaz viens letiFa

sk.

mhm. mani veel peec latviskaa vhosta atpaziist, taapeec biezhaak samos sastopu
s/vhosta/hosta

jap
/who *.lv :P
ko darat, arii studenti esat?

7ipa , mainu augskolu
pdjs

no rtu uz lu?

aha

lu++

nez vai shii ir iistaa vietai lai to apspriestu
es ar stundents

lu?

Question, I'm trying to refresh google ads w/o having to refresh the page. What I tried was just replacing the div with google's JS snippet with a new snippet..but apparently the JS isn't getting evaluated. Is there a way to do this?

izbanos

onclick="this.disable = true"

bet no saakuma pabridinaas, tapec var.

that does not work for the submit button

mcknin, that's forbidden dude.

explain..
by google?

yeap

hmm interesting
sucks for those of us using nearly pure ajax…

you're inflating page views

well I understand the reasoning
but realistically, it's flawed

mcknin, that sounds like it's against the tos

if I have a site that navigates through a lot of different content, I should be able to change the ads

I am sure they have ways of telling that….

the fact that you are ramping up page views sucks too for google

yeap.

like I said, I understand the reasoning
but there must be some sort of middle ground
oh well, can't do much about it

I am sure they will be able to tell, or else everyone could do hundreds of thousands of hits for lawlhacks.google.com.mcknin.com

What would be the best method to resize the image to half of its original width and height by default and when you mouse over, restore its normal width and height?

is there any way to switch table cells (when first cell is going to be second and second cell replaces first) or only way is to switch their content?

can i put the onload even outside of input?
t

chr0me, yes
Slynderdale, you can set width/2 by default and width:auto on onmouseover

there's a way, but I couldn't tell you how

Isn't width:auto css?

Slynderdale, yes
but you can set CSS properties via JS

no, you cannot

obj.style.width="auto";

(starting flameware against self)

the problem is the width will be relative to its container's width

And for the shrinking it by half part, is that done via css as well or javascript?

not the img's innate dimensions
cssplay.co.uk has a lot of gallery playage

is there any way to just clear the form after it's been submitted like youtube does?
none of the onclick="" work

Slynderdale, you can calculate needed width and set it via JS.

input type="reset" ?
oh after it's been submitted :p
reisio++

yep

getelementsbytagname && value='' ?

hello, do you know a german js irc-channel? or is this the right place too

anyone?

undoubtedly some speakers of deutsch here

how can i get all elements that start with 'amount_'?
amount_ = start of name

Hmm, how do you add an atribute to a ag with javascript so you can do something like obj.newatrri = 'blah';
Hmm, how do you add an atribute to a tag with javascript so you can do something like obj.newatrri = 'blah';

you can add properties that way

is it possible to manipulate a (PNG) image using javascript?
one for "hair style" and one for the base. I want to edit the rgb values of the PNG with the hair style

hai, what is the style attribute that cuts off anything bigger than the object's size?
nvm , it's overflow

Is it possible to set onclick=".." with JS? Something like obj.onclick="newaction()"

yes.
(shal3r)

and how?

just like you did now :p

you actually just said it.
heh.

that`s not working

obj has to point to a node though

dabear, obj is document.getElementById('myid')

document.getElementById('yourelementid').onclick = "…"
That should work, unless the element isn't found.

BradleyB, nothing changes and no errors

Hmm, whats wrong with this? http://erxz.com/pb/4025

IE or FF, shal3r?

FF

Are you getting errors? And why not use setAttriubte, rather than createAttribute?
What kind of element is it?

A

Oh, and I believe the attribute names must be in a string format

I'm trying to sort an array of objects by one of the values it has… how do I do this?

getAttribute('oldwidth')

legind, you can use bubble method

any easier method?

it`s easy

Thanks and also whats the parameters for setattribute?

Slynderdale, mostly any html attribute

You know, these are all googleable things.
just look for setAttribute
it's setAttribute('attributename', attrval)

is it possible to get table cell`s position in table? Like row 0, col 1 or cellNr 32

setAttribute site:mozilla.org
tables have a rows collection, each row has a cells collection. A cell has a cellIndex property I believe
I know rows have a rowIndex.. just guessing on cells

thanks, i will look

hi all

obj.onclick = newaction;

i have a question about iframe. how can i execute an function on parent document in iframe

why are you using all those methods instead of just accessing properties?

acualy i want to send some messages with Json in iframe to parent document for file uploading…
or how can i handle form request (form is contain input file element)

I managed to figure it out already.

how have you chosen to do it?

i found, parent.functionName();

is there a bug with IE when loading an xml file?
xmldoc.documentElement returns null and xmldoc.responseXML/responseText say undefined
i get a readyState of 4 when i check it
i just can't get anything from it
how do you check if it's loading correctly? because xmldoc.hasChildNodes returns false
so i don't think it's loading anything :-S
and changing the loaded file name to one that doesn't exist doesn't give an error or anything

how do I get elements within a div? I want to get all the input elements within a div and disable them

div.childNodes

Hi !
who can i declare a static vars that belongs to a function in JS

no-can-do, helloRobot , atleast not until js 2
you can define a variable in the global scope though, which you can access in your function

doesn't firefox append the elements of a div to the dom, if its loaded via innerhtml?

how can i define a global var in javascript?

hey everyone

[domon], Variables are global by default.
Use var in the scope you want them for local variables.

okay, great!
so if i pass a var to one function, i can use it in another?

Still, you're always best off using a var in top-level code.
Or so I am told.

well my problem is tis
i have one function that displays a page
and i need to pass the variable that i passed to display to another function
thus i need a "global" var
here i'll give an example…

Err… you don't need a global variable if you're passing things in as arguemnts.
arguments

i have 3 functions…
someone will use function a
pass a variable to it
then they use function b (to login)
then i have to update the page after they login (function c) using variables passed to function a

define the variable with var varname=""; outside of the functions

In top level code as I said earlier.

got it :P

No need for the ="" though.

sorry, i'm more fluent in PHP than JS :P
and then to update the global var based on an argument….
global varname = arg; ?
or just varname = arg?

can IE not load an XML file when the file has a doctype?

just varname .. but make sure, you dont have used the same varname in the function or the function-header

yeah, i wont do that

-used+declared

last thing is….how can i determine if a var is defined…like php you can put function blah (arg1 = "default1", arg2 = "default2")

anyone?

[domon], if (arg2 === undefined) { arg2 = default}
You need 3 equals signs for a strongly typed comparison. Otherwise if arg2 is 0 it'll get rebound to default.

thx!

hey
anyone know how to get the correct height of IE's body content?
I can get the size of the window but not the content
anyone know?

document.body.clientHeight
iirc

mefisto won't work
gives me the size of the window
not the whole body

uno moment

oki
I am just trying to correct this bug in thickbox.js

it should be working
second is

it used 100% to create a div or something, but it only gets to the size of the window

document.body.scrollHeight

so if I scroll down it won't work
oohh, let's try that
gives the same thing
so it won't work

broser ?
*w

IE 6

oh

what?
are you using 7?

im using opera
lol

well I normally use FF
but I have to do this page and it has to working on both
screw opera :P

document.body.clientHeight is woring in IE6
mkey , im gonr
*gone

mefisto I know it works
the problem is it's not giving the correct size

how do i trigger a form reset?
OH
reset()

hello,everyone

'lo pp

lo

: )

hehe

hey

I am a chinese,Exhibitions
no body?

hrmm?

??
what's the mean

it means 'what does that mean?'

no means
why did not speak

?
/join #linguistics

ok

my guess is machine translation

yes

which one?

his english is poor

because my english is very poor

i think u are robot.

a chinese boy

i run http://ajaxtrans.com
it does Chinese/English translation (rather poorly, but somewhat workable)

i think http://stardict.org is good

me too

hello.. anybody know where I can found a script for a countdown?

hello
input id="print" TYPE="button" VALUE="Print" onClick="window.print();"
is there a way to just print a single DIV?
http://pastebin.com/m716febea
i'm trying to print a single DIV
could someone let me know what i'm screwing up?
i got this code from a site online

replace "innerhtml" with "innerHTML"

embedded css style tag. How can i use javascript to change the font?

Is there a reason you are embedding the style rather than specifying an id?

that worked, but I lost all of my CSS formatting?

css? where?

yes, because we have a library of css that we normally import, this way i handle one-time special cases

well, i'm using a CSS file to do all my formatting
its not in the part that i sent to pastebin

Vme, it's on the 9th line at code you pasted to pastebin
and 14th

Under what condition will you be changing the style?
Directed to rook.

yea
that part worked

you should insert the reference to the css file in the html of the opened window
or browser don't know if the new window use css

would any of you seriously like to post "5 things you'd like to see in Opera"? if yes, i'm just gonna link to your blog if you are interested

OT (kinda)… Need a simpler (than the HTML select box) multi-select interface for a box that has some 600 items. Was thinking autocomplete but need the multi-select bit.
Anyone see anything that might work with that?

hey
i need A dynamically expanding form element
and generate id=".." in them

Well, rook, the answer is you don't need a lot. YOu can user the onmouseover and onmouseout events to manipulate the style elements of the tag. You can either create a generic function to handle each one-off instance, or you can simply use the same DOM modification over and over.

for instance.

cheers
it will be sent in the post aswell ?

Ah

input type= submit onclick="window.opener.document.font=Font('Arial', 12)

but i imagine thats tied into the dom which i dont know anything about?

try style.fontFamily

Ah i noticed font is not actually a translated word from css, is this correct?
whereas there is a pattern of taking a css word like foo-bar into javascript-ease fooBar ?

it's better to change the element's classes, so hat you don't have to put some of the CSS in JS

can a child change the parent's definitions of the classes
im not sure i understand you
sorry let me s/child/popup

classes don't have (machine readable) definitions
say you have a class called 'hover'
the onmouseover handler can put the element into the hover class, and onmouseout can take it out
then you apply a style rule that matches that class

is none of this trivial? i mean, do i have to learn teh DOM model and actual javascript
is this the kind of thing you are talking about http://onlinetools.org/articles/unobtrusivejavascript/cssjsseparation.html

yes, though I wouldn't use that function
better to have one function for each operation

so this is far from an short hack?

span onmouseover="addClass(this, 'hover')" onmouseout="removeClass(this, 'hover')"

lets say i'm in a public function how do i assign something to a instance variable of the object… do i just define the variable as in var whatever; at the top of the class and then call whatever = 22 or do you self or this?

what language are you referring to?

javascript
i've created a singleton object

what do you mean by "class"?

i.e. var bla = function() { return { init: function() { } }()
there not called classes?
they are*

no

well, whatever it is i'm just trying to work out how to get scope from say the init function to another internal function

if they're called through an object using the x.y(z) syntax, x is available through 'this'

awesome thankyou

http://developer.mozilla.org/en/docs/A_re-introduction_to_JavaScript

with grey text that disappears when you click on it?

hello… I'm trying to debug an app that isn't working. I'm not good at javascript at all but just need some help with something. Basically, there is an "Element" object that is supposed to load but isn't because window.Element exists. What is window.Element ?

same thing

you talking to me?

yes
window is the global object

ah.. ok
and what is Element then?

something defined by a library you're using, most likely

ok then. I just have one other question:
is there a way I can dump all the object's varialbes and functions?
actually nevermind

use firebug's console.log and click on the object

ah! Ok cheers thanks

i have a from page that I insert into my site in an iframe (dont ask why, long story). after the form is submitted, it should redirect back to a page on my site (not in the iframe). it does, but inside the iframe, but I need it to be in the parent viewport

parent.location = newurl;
But ouch, frames

iframe
not frames

Same concept, same issues, just differently positioned

auto, etc. iframe is useful when you have no alternative

inside your iframe you must access parent

There's always an alternative to iframes — complete site design at its worst.
s/its/the/
Sorry, 0711

with unlimited budgets thres always alternatives.

— then it's undefined. Is there a way I can make that function have access to my element.Window?

ChrisC35, hmm? Site redesigns are free (presuming you're doing the work yourself)
misc–: You mean window.Element, not element.Window? :-)
misc–: It should already have access
misc–: Perhaps it's defined onload, and Lightbox.prototype.initialize() is called earlier?

time = money = budget

no… before that declaration, it exists. Then all of a sudden it doesn't exist

anyways, how would I actiave that javascript in my php code?
when I want to redirect

But alternatively, frames = accessibility problems = lost profits (ha, ha)

maybe. It's something that should work though. It's off a Joomla component (well, mambot) and it works on the demo site but now when I install it on my site. I think it's a bit over my head

You can't, you'd have to write it out to a page.

ic
ok so I can just put that in the onload event of the page I'm directing to?
uok so I can just put that in the onload event of the page I'm directing to?/u

onload is later than it needs to be

what you said sounds about right though. initialize() may be getting called ealier. I'll check

element in the head

cool

no. It gets defined before the initilize() runs

just that? or do I need some onload event?
i'm not great at js..

No, you don't need any onload events.

scriptparent.location = http://styleinform.com/join-success;/script
i put that in the head
Twey ?
maybe url in quotes
it just loads itself now repeatedly

parent.location = "http://styleinform.com/join-success"; /script

Where, I should add, the join-success page *is not* the page with the iframe.

ya hehe i figured that out
made the interim page and it works
thanks

Welcome

hey.. i got simple array question: http://pastebin.com/m328e07ab

Im having trouble seeing the POSTS and GETs performed in my firebug, has anyone seen this bug

Anyone know of a Firefox Add-on that allows me to modify the navigator.plugins collection? (To circumvent lame-incorrect plugin-detection-scripts)

I shall write one forthwith.
I'm bored.

hi, i have… some table like tabletdtrblah/tr/td/table, how to access that 'blah' through window.document method?

good

bianchi, easiest is to just give the tr an id

Or even the td

and use the getElementById-method

Then use .firstChild.nodeValue.

you'd want to switch the tr and the td too though

what is the maximum length of an email address?

Oh - yes.

ok, work now!

255 I think the RFC states

I've just found this
The maximum total length of a user name is 64 characters
The maximum total length of a domain name or number is 64 characters.
So that would be 64+64+@ ?

= 129

ok great
And what's this?
The maximum total length of a reverse-path or forward-path is 256 characters
Oh yeah, the Fw:

i am trying to combine variables in a certain way….
var title=(document.getElementById("ned").which+title.value);
which containts "left_block_"
i am trying to make up a variable "left_block_title"
any help would be appreciated
i mean i am trying to pick up values from "left_block_title"

And now this is confusing:
the total number of octets that represent a domain name (i.e., the sum of all label octets and label lengths) is limited to 255.
So basically a domain name CAN be 255 octets, but a domain name in an email can be only 64
So if you have a domain that's longer than 64 then it won't work with emails?

so i guess i need the syntax for that
i tried "which"+title
no joy

any idea why xmlDoc = document.implementation.createDocument("", "", null); would not work in ie?

hey, i have textfield, now when i press enter on textfield it should do something, how to do it?

use keypress event

praveen can you do little example?

onkeypress=

now report should check if keycode was enter?

thanks, can i report what key was pressed?

onkeypress="change_message_label(this)

whats the equivalent for onload for i.e. 6?
xmlDoc.onload

yes you can ..

is script.aculo.us still a framework to rely on and use if I have to start out from scratch with a project
?

How to get all the hidden values in form ?

Im trying something pretty basic. I have a popup window which i want to close after 5 seconds and refresh the parent window
http://pastebin.ca/656693

The paste 656693 has been copied to http://erxz.com/pb/4030

Codes not working, any tips?

Fx extensions are weeeird.

why i can't see… elements in frame
i'v got var a = window.frames[0].document;
and thtat return HTML document
bud… a.getElementById("pop");
return null, even if I had element "pop" in that .html that is source of my frame

Fx keeps insisting it can't install this basic test extension I build by some tutorial because "install-???..rdf" doesn't exist, where ??? is three seemingly random letters and numbers which change every time I try to install it :-\

what's problem?

You can't access documents on other domains. It's a security feature.

is script.aculo.us still a framework to rely on and use if I have to start out from scratch with a project

script.aculo.us isn't a framework, it's an effects library

evrything is on local disk… source of frame is src="../html/test.html"

It uses the Prototype framework
Personally, I don't like it.

why so?

Prototype imposes a very specific method of coding on you and doesn't let you code any other way

i have lost connection, Twey have you said something?

It also tends to break other code due to the methods it adds to various prototypes
And it values brevity over readability, which is a bad thing IMO.

Is top.window.refresh() valid?

top.location.reload()

Ah, thanks

top.window is pointless, since it refers to itself… you could go on forever, top.window.window.window.window.window.window…

Most other frameworks do the same things, just pick one and go with it. IMO prototype is one of the more readable once out there

i have an overflowing div and inside that div i am doing some drag'n'drop action (not using any library). how can i detect if the user has moved an object outside the div and if its necessary to scroll automatically?

I have a "lightbox" type script setup and i want to refresh the parent window after i automatically close the popup

onunload="opener.location.reload();"

bianchi if you're really getting null, there simply is no such element. You could verify that by referring to the element in the context of your test.html

Comments

I have this one PHP script for uploading images that used to work but now Firefox asks me what to do with instead

I do not see why you'd want to serialize things here though.
you usually use a database library to manipulate the data in the database

MikeSeth, I need to print that echo statement while() there are row in the table "pm" that have the column "to" set to $username.
make sense?

e.g. with ORM libraries like Doctrine or PEAR DBDO you'd have, let's say, an Order class that has a save() or update() method that stores it in the database

nonetheless thanks!

np

MikeSeth, yes. that I know (although symfony is using propel).

first there's a bug. You do not reuse the first result of the query
I dont know anything about propel. But generally speaking, you should be using propel's methods to store the data in the database, not serialization

MikeSeth, what do you mean?

see $isempty? a line above it there's a call to mysql_fetch_assoc()

MikeSeth, uha.

configure: error: xml2-config not found. Please check your libxml2 installation.

then check your libxml2 installation

and at the end of my xml path is a fresh and new libxml2 install

oh…

it fetches the first result of the query. The pointer of the result then moves to the second result. The first one isn't used anywhere.

but there is no such xml2-config file

libxml2-dev

it is compiled from source - so no need for a -dev ? (or am i mistaken here?)

echo "option value=$j"; - that is correct? or is it echo "option value=/"$j/""

you need -dev for header and configuration files needed for building other stuff

it is compiled from source so you do need a -dev

i cannot find any -dev tarball - only for precompiled packages

uuuuh, it's a package.
at least on Debian

And I am saying I am installing from source - and thus there should be headers and such - no need for an extra -dev
:o/

does anyone know how to get php 5 to work with apache 2.2?
the php hosting module doesn't even seem to be being invoked.
well, its loaded but scripts aren't parsed.

there -are-, but they are not installed unless you do so explicitly
mime type problem?

aha, so this is a configure option to libxml2 to include the -dev stuff?
that would explain it …

to be very honest, I am not sure. I stopped compiling things years ago.

I would too if I was not forced to work on three different platforms - and I only have root one the one that cannot be updated online

"LoadModule mime_module modules/mod_mime.so" how does that work on windows?
application/x-httpd-php php
application/x-httpd-php-source phps
that should work shouldn't it
anyway goodnight

bugger - I cannot see any options to libxml2 configure that included headers and stuff

it's a make target, not a configure option
probably make install-dev or something

http://24.64.110.182/share/files/G-man/72238

$geboortedatum=explode("/","1/1/1979");
that should work?

hm

MikeSeth, it seems that it only prints the first word of the message.

yes, but please never, ever use non-English variable names

I'm sorry, I just pasted it straight form my code

then fix your code and make it a habit to never use non-English names or comments in code
open the generated HTML source and check that everything is alright

MikeSeth, sorry my line dropped. I think you misunderstand me. I know how to save a table entry. The problem I have is finding information on best practice regarding this use case: an order sheet is related to a campaign (a couple of tables containing, pricing, products, commissions, etc.).
now when the order sheet is created a subsequent change of the campaigns information should NOT reflect in a change of the order sheet.

MikeSeth, forgot the double quotes :P

for($d=1;$d=31;$d++) {
if ($d==$geboortedatum[0]) { echo "option value=\"$d\" selected$d/option"; }
darn
sorry

MikeSeth, thanks man.

Thought, that should work?
*though

I understand. I do not know how they solve that with Propel, and my favourite Propel wizard isn't around to ask. But, generally speaking, you would rely on the database's derived table features, or write a set of sprocs/triggers to duplicate data, and train your ORM to be able to work on the
materialized set

MikeSeth, what do you mean with 'derived table features'?

I don't think MySQL supports it, but PostgreSQL for example allows to define a table prototype and inherited (derived in this sense, not in the subselect sense) tables

hm, it is not a target to make
so no make install-dev
or similar

read the makefile, it has to be there.
http://www.postgresql.org/docs/8.1/static/ddl-inherit.html

the only mentioning of dev in the make file is /dev/null

What wrong with this code?
http://rafb.net/p/yxSjZU64.html

hello… I have this one PHP script (for uploading images) that used to work, but now Firefox asks me what to do with instead of displaying it. All other PHP scripts seem to be working, I even have a similar script that executes well. What might be wrong with this one?

It's not putting the select correctly

sbn, the code works for me

Realy?
Here it doesn't

sbn, what does it do?

It explode the string 1/1/1979 into geboortedatum[0]=1 & geboortedatum[1]=1 & geboortedatum[2]=1979

yes.. but what goes wrong?

and then It creates 3 drop down list
but it should auto select the 1979
but it doesn't select it

aha
I see

On line 21, shouldn't it be $j instead of $m?

ok thats right

oh, ok. at the moment I am using php mysql web hosting and we can't jump over to posgresql at moment

ok kuja you fixed it xD

MikeSeth, thanx for your help. I'll just store the non-changeable data in a subtable of the order sheet …

And for a select that is static (alwayse the same value, just html hosting no php) how can I add the select there?(getting the id out of db)

MikeSeth, me?

it was a /notice

MikeSeth, what is better about agavi?

its not ugly and not fascist

MikeSeth, hmmm, isn't that the first thing an ugly and/or fascist entity would say?

just because we're hell bent on market domination doesn't mean we suck

MikeSeth, … well I'll have a look at it when it reaches version 1.0 and the website is finished

API is frozen till 1.0, so any code you write today won't break until 1.0. And either way its radically different from other frameworks.

MikeSeth, so what made you decide to reinvent yet another wheel?

How can I do the fellowing?
http://rafb.net/p/rc4Xss63.html

none of the previous wheels were sufficiently circular
note, I am not a core contributor, I'm just an user
echo $bla['something'];

MikeSeth, but that (not sufficiently circular) is what every framework gives as a reason. it makes it really annoying to find the 'suitable' one

selected="selected" ?
#mysql-nl
Nederlands.

yep. And this one clicked.

MikeSeth, ok. I'll have a look at it. thanx for the info

imme but how do I do it? Since I've got static hosting information (the groupnames)

Hi to all
I need some assistence about a smarty issue. I have a recordset and I would like to create a list in a template in the table there are 3 records
I'm using {section name=counter loop=$data} {$data[counter].fieldname}{/section} and in the php side I've assigned an ARRAY $this-smarty-assign('data', $dataset); Why I see 6 records??!? but in the array there are 3 items

why are you using section?
section is tricky and is needed for advanced splicing. Why not use other loops?

Good morning all,
Is there a way to check if the module mod_rewrite is enabled in Apache via PHP?

hey, can you remove a specific element from an array if it exists? ie $a = array("one","two","three"); array_remove('two', $a);

unset($array[$element]);

wrong person?

pardon

section is tricky and is needed for advanced splicing. Why not use other loops?

thanks, didn't think of that

I have used also the foreach
but the result is the same

pastebin

ok

(notice that typically if you ask Smarty questions here you get yelled at)

http://pastie.caboo.se/81107

aha, the php configure requires xml2-config to be in PATH
I think that is it

hi, how can i configure php host to support tls as a registered stream socket transport?

you should use foreach. Really.

but the result is the same

var_dump($dataset); make sure the data is right; then replace section with foreach.

the data are correct

either way, paste the generated HTML too

there are 3 items
but in the loop appears 6 items
how is it possible?!?!

paste the html.

ok
http://pastie.caboo.se/81107
ops

it's the same item.

yes but updated

php oughta implement better session handling in php6

Howdy all.

any idea?

ola
whats your problem

hey sean`, claude_monet_imp
yes but updated what?
oh

I've updated the pastie

then something is wrong somewhere else, it is the template itself that's being rendered twice
still, switch from section to foreach

but it is the same

appears twice

This is clear
but why!?

http://php.net/openssl

I don't know, check your PHP code.

I'm going crazy
I'have checked many times

again, you are likely executing the same code twice.
post the whole source

it is yet all source code!

no it isn't I don't see you creating the template and rendering it

echo $this-ProcessTemplate('hostingplans.tpl');

ProcessTemplate?
paste the WHOLE CODE

yes
I have updated the pastie

I don't see the change

F5

http://pastie.caboo.se/81107 - this?

yes

nope, still see the same.
open a new one

I've added 2 row
ok
http://pastie.caboo.se/81111

hey anyone know a good class/function for two way encryption?

blowfish?
god damn it, stop adding single lines, paste the whole source

you can do that in php?

http://il.php.net/mcrypt

I have only 3 pages
one for connection, one of the php processing and one for the template
it is all
the code that u can see is all the code that I have

its a public host so installing MCrypt is most likely a nono

then I can't help you. The problem is likely in that ProcessTemplate function
bthen I can't help you. The problem is likely in that ProcessTemplate function/b

hash()

he needs two way

oh

you really dont want encryption calculations in PHP.
so if anything, use an extension

lol
it doesn't need to be ultra secure really
its more of a deterrant than real protection

claude_monet_imp, whats going wrong?

I'm using SMARTY engine

still. Use extension or not at all
he wouldn't post the source so we can't know

claude_monet_imp, i can see that. just explain ur problem in brief.

an extension, as in has to be compiled with php?

MikeSeth, hmm…i c

!+typing english

##PHP does not allow aolbonics (or leetspeak) such as u for you, r for are, ic for i see — etc and typing like this will result in you being silenced; furthermore, inability to adapt may result in a ban.

yes.

can't

smarty write the output twice

then I can't think of anything good to advise

claude_monet_imp, ok

claude_monet_imp, are you exec output twice?

it's not smarty. It's the code you won't post.

I'm looking the template in the cache of the smarty

fine
so why shouldn't i do encryption in php?

slow

claude_monet_imp, http://pastie.caboo.se/81111 - is that what you're talking about?

yes

well I'll write a simple one I guess

http://pastie.caboo.se/81113

:|
just to obfuscate, lol

yes and there is nothing wrong with it. The problem is not in Smarty, it is IN YOUR CODE

claude_monet_imp, check the loop in ProcessTemplate function. Its executing twice. MikeSeth's right.

http://pastie.caboo.se/81114

Whaddyamean? Smarty is a problem by itself :P

yes, but he really can't blame it.

Damn.

claude_monet_imp, or the problem must be in the while ( while ($dbresult && $row = $dbresult-FetchRow()){$dataset[] = $row;} ). I'm pretty sure $dataset has a null row along with the result.

WE DONT WANT YOUR CACHE OR YOUR QUERY. POST THE SOURCE FOR THE FUNCTION

hey

twice in the output?

look at http://pastie.caboo.se/81114

MikeSeth, yes. i see so some loop is incorrect or the elements in some array are duplicated for some reason.

and he wont post the source to the code that is broken.
I am getting tired of this

claude_monet_imp, why cant you post the ProcessTemplate function?

I'm looking for it
the project is not mine

claude_monet_imp, so you have the source but you cant find the function? :O
MikeSeth, hehe.

$dude = 'basix'; unset($dude);

hi

hey mcbane

I have some trouble utilizing sessions. I have made up the following testscript: http://pastebin.com/d4b988bd5 from what I have learned, it should increment the value eatch time I reload the page. But instead it is allways zero. Can anybody help?
cookies are activated at the client machine
and I have tried Safari and Firefox, so it shouldn't be a client side problem.

without looking at the code, have you opened a cookie in the browser to peek what's in it/

a cookie is created at the browser and it contains the session id

mcbane, I am not sure if a variable is considered 'set' when it is false
try turn 0 into '1'

isset() would return false when variable is 0
so you are in an infinite loop of sorts

0 doesnt mean the number zero, but means boolean false.

I did. Now I get allways "1" in return if I reload the page.

correct me if Im wrong

you're wrong

Solved!

I am.

thanks guys

I just checked.

thanks

what was it?

isset only returns false on NULL

I am wrong.

I have written two time the same row :P

could there be a connection between the fact that php is running as cgi and not as module in apache?

when we invade your country, I'll make sure to take away some of your valuable properties
nothing is impossible. var_dump($_SESSION) right after session_start()

that gives me the following output "array(0) { }"

mcbane you dont close the browser in between reloading right?

no I don't

just checking ^^

I will do the same :P

then your sessions are probably not stored.
ask PHP where it stores'em

I have to ask the central department for electronic stuff at my University. Thanks for helping me to round up the problem.

will php_info() tell that?

phpinfo(), yes

nice, one moment

if you university doesnt support sessions you can always do something with cookies/db

I currently develop an application for teaching purpuses in medicine. They currently set up the server (we have to migrate from php4 to php5). It won't be a problem to get session support. I gues they missed it when configuring php.
session.cookie_path = "/"

alright

is that the path where the cookie data is supposed to be stored?

that is root I believe, I dont think they should be there
how is / called?

yeah, the user, who is running php host does not have write permissions in there.
I don't understand your question (I am not a native english speaker)

I thought the '/' folder in linux is called root, but then I was confused because the 'admin' account is also called root

yeah, root as user and the file root.

ok thanks

hello, has there anyone experiences with unpacking and working with RAR and ZIP archives through PHP?

Thank you very much for helping me out. I really appriciate it.

hey. im looking for a similar function to is_date() but i need to check if the time is ok (hours minutes secounds) … is there a somthing ready for it or i need to do if $hour is higher then 24 …

24)

and what about hours, minutes secounds?

php echo date("g:i:s"); ?
but ull need to convert to unix timestamp before comparing

G its means that if the whole time is ok in unixtime?

no g returns just the hour
http://uk2.php.net/strtotime
read that

60)

like that?

thats if the current minute is more than 60

Hello I am alter a validation to be a bit stronger. I have a 'datefrom' and 'dateto' (for a vacation script) which should be put forward as dd-mm-yyyy. How can I check that it's formed like that? At the moment, I'm just using if ($_POST['datefrom']=='')

strtotime, checkdate

teach, date ('d-m-Y', strotime ($string)) == $string
the date params should be others I think

$var = 'test' and then echo $var = $var ?

huh

hm?

$var = "test"; echo $var; ?

jerryrozz, tethink/rephrase that
you need variable variables, i guess

i will that he echo the name of the variable in this case $var

thanks

echo '$var'; ?

test

yes, so echo '$var :'.$var;

$value) { echo $item . " - " . $value) }

that should work i think :/

foreach $ ??

duno
ive never tried it
i might work
it*

afaik - nope

let me try

echo '$var :'.$var; willwork

AlexC_, logic says to me that $ should ben an array
Do you lack logic?

yeh variables are formed into an array

and MrWilson you do know you can't call $.. as it's an unexisting variable.. also you cannot set it

sean`: do you lack logic? $ will not work.

i dunno like i said it was just a guess

foreach($_GET as $item)
{
echo 'name:'.$item;
}

jerryrozz no

if you want to do that, MrWilson and sean` then use get_defined_vars()

$val) { echo $item . " - " . $val }

will list all the GET variables
that definatley works cause i use that in my script

He was speeding up the code, and used $ as a quick way, so I see it as valid, since it's just an example

hello

or he just did not know about not being able to use $

after I've posted form data to another page how do I then 'get/echo' that stored info?

sean`logic tells you that $ will work because it's an example?

cause any decent PHP'er will know that $ should be a REAL variabel

Thanks MrWilson

rick111 using $_POST['formid'] or $_GET['formid']

it works

as they by default should know that $ is a variable you cannot use

ohh thanks, did try GET, will try POST, cheers

sean`: then you miss understood what MrWilson said and what I said in response to that - he was wanting to use foreach( $ as … ); like that - by just using $

yeh
as in listing all varialbes in the array

for which you would use get_defined_vars() for that scope

foreach $ ??, which was quoted from you.. also invalid syntax, as you're not using parenthesis.. but we don't confront you with it do we?

yeh that works to AlexC_ lol

sean`: haha, bless.

guys, i was just givin a short example

cause logic tells us it should've been foreach ($ )
MrWilson, we know
we're just an active crowd

lol

post worked, thanks MrWilson

sean` you seem to like this Logic word, yet also seem to have none

yw rick111

AlexC_, you are so right *thumbsup*

anyone know what do i need to do to get PHP Command Line working, it's just displays and doesn't run a pl scripts

uhhh… pl != PHP

how to enable curl over php5/apache2/windows - xampp ?

shell# cd /usr/local/atmail/webmail/modules/ ; php migrate-pop3.pl /path/to/pop3users.txt
this is what i need to run

then use the proper languasge? Like Perl?

php migrate-pop3.pl
take out php and put perl
perl migrate-pop3.pl

spoilsport…. It shouldn't take a rocket scientists to figure out that one…

lol

hi all, i was here yesterday, i have php code that works on one server and not the other. the code is http://pastebin.com/m7f21179d . and the line is $manager_str = $this-session-get($this-getSessionKey()); (442). the type that goes in the function is
Services_Yadis_BBSession Object.. i am not sure whats the problem

so tell me guys, after i change php.ini under windows, what to do for it to take action of the change ?

were you looking for me earlier?

MikeSeth, yeah, yestarday

I was owning AI in galciv2

PHPadam, restart apache?

GuySoft, i realised i was editing the wrong php.ini file, i had a few

afaik you dont need to restart anything to apply changes to php.ini

um, yes allways make sure you are on the right file..

owning AI in galciv2 ?

but i'm not absolutely sure that's the case

GuySoft, i was on the right file apache wasnt

robert_, i needed here on debian.. maybe i am strage

yeah. It's a kick ass game!
you won't be an IGLU member now would you

PHPadam, point of view..

GuySoft

MikeSeth, i would ..infact i came here for help connected to the JLC server

oh.

i installed an openid modeule on the phpBB forum. and it works on my localhost.. but it wont on mirimar.net .
MikeSeth, i can't figure out what is disabled there.. did you see what i typed above

hi

?

hi, anyone experienced with phpmailer()? If I'm in shared environment and use phpmailer's smtp method. Will it be using mail() function inside the code that use cgi's sendmail or any OS's mail delivery function ?

generally speaking, we do not help people with phpbb host here. Either way, "doesn't work" is not really a fruitful description
SMTP means SMTP. It doesn't mean sendmail.

GuySoft, yeah, dont use it, cause it aint working

!+mail()

mail() is, like, virtually useless. It's really easy to misuse it to open a security hole, it doesn't provide any advanced facilities for character sets, attachments, etc, is problematic across platforms, and its direct use is discouraged. Instead, pick up a fully fledged mail
library.

well how about it stops php.. i get a blank page.. i located that line because "echo hello;" works before it, but after it it wont execute that

excute that?

mak sure display_errors is set to on in php.ini; set error_reporting(E_ALL); check apache log for error messages.

execute an echo command
MikeSeth, i carn't change the php.ini configuration, even with ini_set
i can see it thaugh
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT .. show all errors, except for notices

do you get an error?

Why do you need the last part?

MikeSeth, ill try now.. just did you get what i was saying about 'echo'?
i pasted the comment too

the typical blank page problem is caused by a fatal error/parse error and display_errors set to off. This is how you diagnose it. If it's not that then you would have to trace down where PHP stops.

MikeSeth, i did trace it down..

oh you pasted a link
one sec.

MikeSeth, if i echo before the line i pasted, it shows, if i paste after, it does not

php
$adizayn = htmlspecialchars(trim($_GET['adizayn']));
if(isset($adizayn ) AND $adizayn =="hakkimizda" ){
include ("hakkimizda.php" );
if(isset($adizayn ) AND $adizayn =="kampanyalar" ){
include ("kampanyalar.php" );
}elseif(isset($adizayn ) AND $adizayn =="referanslar" ){
include ("referanslar.php" );
}elseif(isset($adizayn ) AND $adizayn =="iletisim" ){

pastebin MAsterTURK!!

uhhhh

include ("iletisim.php" );
}
?
where is the problem?

nice one. Use a pastebin

between the chair and the keyboard.

Comments

I have a php script running on localhost and i want it to create a file in a folder in my desktop I have set the

so means I need to tear of "Other Server" from my figure… thanks guys

php - by retards for retards… Im so happy to write next project in c++ or java.

yay, one less whiny 12 year old php programmer

is it normal that changing locale brakes code (make code not compiling)?

no, calling function incorrectly and changing locale

make code??
geez

incorrectly?

the manual doesnt say FILE_GET_CONTENTS or File_Get_Contents it says file_get_contents

and?
thoes are build in functions, I ment own functions

and thats it

btw, this is funny as most for-dummies languages are case insensitive

if you define them capitalized, and they don't work capitalized, then you screwed up
make sure you didnt change anything along with the locale

yes I know how to fix it probably
set locale right at start
but this is a major WTF
its more lame the visual basic using case insensitive version of XML to communicate with a object pascal macro

submit your bug to blackhole@php.net

ur so funi.

just wondering, what function are we using to set locale?

setlocale

then lets try break some capitalization

hm?

this may be a wierd question, but is there a way with php to change for example A into A
if there is no built in method, does anyone know of a table to look those up perhaps?

why are you doing this?

no problems at all

hm?
set locale to TR_tr
tr_TR.UTF-8 for example

you mean to get the ascii code for a? or what is 65?

poutine, a stupid reason, I have written a serverstatus page, and someone wrote a program to crash servers that parses the IPs from my page, so if I 'obfuscate' them like this, it will break the server crasher

fix the serverstatus page…

nope

turning 1 byte into 5 bytes won't help anything

functions work with any case

sure rolfen, how can I get the ascii code in php for a given character

no

I will not answer this question, this is a silly solution

I am open to all suggestions poutine, how else do you suggest I stop this parser?

if you think you have to "obfuscate" things to fix them, you've got some other problems

well common, dont talk about silly solutions - we ARE using php anyway.

moparisthebest, Explain the problem fully
how are they using a program to crash your server?

ok poutine

let me check… i think there's a way

of course there's a way

http://www.moparscape.org/serverstatus.php

look into char() or sprintf()

anyone can post thier private server on it
and someone wrote a program to parse server hosting IPs and ports that are online and crash them
*attack them

see orp() : return the ascii value of a character
oops

ord

i mean ord()

it works in simple case. Btw I set locale in one of includes perhaps that contributes to the problem

ord rolfen menad

so they dont crash my server poutine, just people who advertise on my page

moparisthebest, So how will doing this work?

they crash people? call police

It's easy to get an ascii value from a number

but it will cause the parser to be re-written

not really
maybe 2 lines of code

heh, those crappy server crash themselves

if it's in PHP, all it'd take is one function call

s/"ord rolfen menad"/"ord rolfen means", lols

well, he released a binary to a lot of people
so all of those will be obsolete

You can'
t protect the world
caution the people who own the servers to secure them

I have banned him a few days ago, hopefully he already got bored of it

this is silly

I have already done that, they are too sorry to do so and whine to me, I get tired of it
this will break the first crasher that has been released, after this it is up to them

they show no other common behaviour?

randomly replace letters in the ip with html entities

what do you mean TehSausage ?

so, how to fix uppercase-locale problem

iterate through each string, rand(1,3) then get the value of it and replace with &x**;
i forgot the syntax for html entities :P

thanks for the suggestion, but I dont want to show all of my cards just yet
ill do this first, if he comes back with an updated parser then I will add that in

can I make php to stop fucking with function names cases
and just call exacly the function which name I written?

ah, �X;

does anybody here know anything about custom rss feeds tailored to the user? this would require the user be logged in, correct?

ah, yea TehSausage that is exactly what I was working on

i shall write a function for i have no life

just writing a method to change a whole string into that type of thing right now
that would be much appreciated, because I was still thinking of how to go about it

by definition since it is tailored per user that user must be logged in (or otherwise fingerprinted)

done

wait, TehSausage what about http://us.php.net/htmlentities
done already?

that does only the characters it needs to

tag and have a wild card like "body *"?

http://sausage.no-ip.org:88/tiamat/test

preg_match Kai_wp

I am using a session save handler to save users sessions in the database. Does anyone know what encoding does the data get stored as ? I am having a hard time get the data out in the right format to display a list of online users

very much appreciated TehSausage

it fails to recognize some of names dunno why. For example functions of class

the session itself is stored serialized…but it's best to separate out the data. For example, create another column on the session table (session_member_name or *_id) and populate that ONLY if they are logged in. At that point the SQL would be trivial to pull the list back out.

I read the PHP documentation on Preg_match but I'm confused as on how to use it.
I mean how do I specify a wildcard?

ill show you an example

learn PCRE :P

Bobby_Easland, so if I unserialize it I should get arrays of data ?

Kai_wp, if (preg_match("@/?[^]**@", $name)) {
echo "The name cannot contain HTML.br /";
return;

I don't recommend that method but it would work. Remember, that is a lot of overhead pulling each row then unserialing the data to get at one value

after changing locale, php doesnt recognize some of the functions/methods (randomly) how to fix it?

Bobby_Easland, I need to get several values… well actually the user id and the page they are viewing. I tried unserializing it but I still get some random character string

I understand that is sensitive data but if you could post an example (maybe strip the sensitive stuff?) it would help a lot

http://www.mininova.org/tor/791777, its a torrent containg an e-book
an e-book titled: Teach Yourself Regular Expression in 10 minutes. Its an easy reading.

well that was smart, i made the user apache, gave it permissions to the www folder then started apache as it

$record) { echo "{$record['SessionValue']}br /"; $array = unserialize($record['SessionValue']); print_r_pre($array); }

then i realised i forgot to give it permissions to apache XD

The locale information is maintained per process, not per thread. If you are running PHP on a multithreaded server api like IIS or Apache on Windows you may experience sudden changes of locale settings while a script is running although the script itself never called setlocale() itself. This
happens due to other scripts running in different threads of the same process at the same time changing the processwide locale using setlocale().
^— incredible O_o
This is trully amazing, how broken setlocale is….
is there some way to use gettext without this broken setlocale function?

that does seem messed up raf256

that is totally beyond any limits of incompetence and lamenes… who the f… designed that part of php

the great thing about Open Source Software is that you…YES YOU…can jump in and help make it better. Simply stop complaining about your perceived deficiencies with PHP and start improving the source code…

http://www.moparscape.org/serverstatus.php
raf256, the same person who introduced the triple equals sign === ?

well i assume their idiots who will spend weeks breaking your "encryption"

probably

shure, rewritting php its the way to fix my for-yesterday problem with "just get the locale working"

however ive found the way to deal with these people is to keep throwing up obstacles, eventually they just get tired and go away TehSausage

"no, sorry boss I cant" "why not" "because some totall idiot designed php and broken the setlocale beyond ANY BELIVE"

notice I didnt convert the port to entities yet

so… I would need to have TWO SERVERS one for each locale? lol…. :/

ill do that after they fix the first part :P

heh

raf256, there has to be some extremely dirty hack around it
there always seems to be some extremely dirty hack that can be used with php

how the hell can be set locale so terribly totally fucked up
if such a moron would work for me I would fire hiss ass immeditallelly.

I tend not to say the word "no" for any technical request from my boss…even if that means having my engineering staff (or myself) write custom extensions or modifying the source code

well, after smacking him on the head

raf256, personally I have never tried it, but I have heard nothing but good things about java web scripting

i have a php file i named config.php with some variables in it, i included it on script that has classes that take some of those variables, but it like it doesnt see them.

I would be hapy to write un-fucked-up version of 1) gettext 2) smarty
but that takes weeks if not months (incl. testing etc)

I think you have to declare them global in the imported script evilx
sort of import them?

we are 90% done of a project and now this raging incopetence of retarded php developers cames up as un-passable obsticle

wierd, because if i include it in a different script, it reads them fine, but i guess it might just because it a class tryin to use them

ah, well that wouldn't be feasible then to switch languages
never messed with OOP php evilx, ive heard nothing but bad things about it :/
raf256, locale changes things to different types of encoding correct?

the ability to solve the problem you are experiencing is exactly what separates script kiddies from coders…coders from developers…and developers from engineers. The bottom line is how each would aproach solving the root issue (which you have not identified yet)

*things == text

as I said and you chooed to ignore, I know how to solve this. But not it one day.
as it would require fixing part of a huge, fucked up, project (php itself) and that isn't trivial

why not make them all lower case and do a global search and replace

setlocale just doesnt work
because idiot stallman (gettext) fucked it up, and php devels based on that broken tool (AFAIK)
I need same script to be in locale say EN or say TR different for each query (each web user)
when I wrote own translating system I simply set a $lang and make my functions use that

moparisthebest, i just went back to making them with define(), it seems to work and they are static set variables anyways.

but here I must use setlocale to tell gettext (and smarty translations) what to use, and setlocale is borked

might be the easiest way to do it evilx

weird, gave apache read access to the whole partition and now it starts :P

how are you implementing your exception handling for that setlocale()??

Im not, why

I would think it's obvious at this point since you've been rambling about it nonstop…the reason is to detect and make actionable an exception

setlocale doesnt fail
it "works" but in addition it makes php not recognize some functions

setlocale will return a boolean false if it fails (i.e. - locale does not exist on your system)
that should have been the first thing tested…

it returns true. and/
it returns true. and?

it does not return true

tr_TR.UTF-8 to be exact
it doesnt fail, as I written
but instead now it fails to recognize some function names

geez

huh?
well.. do you have any helpfull comments on this issue?
Call to undefined method User

Comments

oh no I mean the script is from an outside source which I have no access to diggcom its writing about 5 lines

I am learning javascript and DOM, however the document object is confusing me a bit.. because they talk about it in javascript reference on netscape and in the mozilla developer documentation
I may have asked the question twice, sorry. but I am not sure if it was sent the first time since I wasn't authenticated yet

I can't run scripts on the server, all I have is plain html and a formmail.pl script

hello all
When assigning functions, is there a way to specify the parameters also?
rather, a way of specifying the parameter values

gregorycu, nope
but javascript hosting functions can be called with no params, even when function declaration includes them
function test (foo) { if (!foo) foo = "bar"; }

http://pastebin.ca/610465

The paste 610465 has been copied to http://erxz.com/pb/3496

luckiily it copied my description with the question in it too…
nope. it didn't. nice

can i update a div's content - which's parent page's div - from iframe?

is the document object considered part of javascript ?

yea

fearphage, but it is also in DOM, I am confused

you're operating on page's DOM tree in JavaScript
http://developer.mozilla.org/en/docs/About_the_Document_Object_Model

insin, can I say that DOM expanded the javascript document object ?

from what I can gather, javascript is the language, the DOM is one of the things the language can act on

the DOM specification defines how the DOM should work - javascript hosting has an implementation of that specification

insin, aah this pretty much clears my confusion
insin, but why there is nothing about document object in ecma specs

because the W3C defines the language binding for ECMAScript
http://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html

thanks a lot. checkign it now
insin, so you can say that the DOM specification is a specification for the DOM interfaces (classes, and structure) and appendixE specifies hows these DOM interfaces are implemented in javascript ?

i'm having some trouble loading xml data into a local script that has been rreived from a remote domain
when i alert responsetext i get the XML data
but i can't seem to access it via responseXML
nevermind, i did it
i DEFEATED THE MAC
by parsing the responsetext
AAAAAAAAAAAAHHHHHHHHHHHHHH
someone please help i'm going to go insane
i'm making a widget for the mac. it uses safari to render the html hosting in the widgets.
the html works fine in safari
but as soon as i load it as a widget it no longer works
it is a local html/javascript file that loads remote xml data and displays it

if you're saying that it displays fine in safari

yeah

then the chances are, it's either not a js issue

no errors and it displays the xml data

it's an issue with your widgit controller / displayer

is anyone here familiar with mac widgets???

I'm trying to load a json reply into an iframe (building a multi upload thingy) .. sending it as application/json or application/javascript works in all browsers except IE and older versions of Mozilla, sending it as text/plain works in all browsers save Safari .. any common mimetype I could
use that would work in all browsers?

and with "work" I mean that it doesn't pop up a save as dialog for the script file when the iframe loads

hi
my_var = (char)65; and then, my_var will contains "A", is it possible ?

String.fromCharCode(65)

A

thanks, I'm going to try it

Ok, so how does the Element know that it needs to update itself?

insin, and then if I want "AA", I need to do it char by char ?
or there is also a fonction

you can use regex

??
how N
?

that's a cue for some googling :P
regex is a way to say "does that string match this pattern"

mmh…

and such a pattern you want would look like \A{2}\ i think
haven't done much regex for a while

what are you working with, a list of numbers?

insin, yep

you'll have to do it char by char, yes

ok
thanks

if (!Array.prototype.map) { Array.prototype.map = function (f, obj) { var l = this.length; var res = []; for (var i = 0; i l; i++) { res.push(f.call(obj, this[i], i, this)); } return res; }; } [65, 65].map(String.fromCharCode).join("")

A

argh

Ok, so how does the Element know that it needs to update itself?

does anyone know how to delete properties in javascript?

is there another way to do a s = string1 + string2; without using a "+" ?

No. Why?

Jan-, a very special case… I need to do a cat, but I've no way to use "+"
there is no strcat() or similar ?

You could always write one.
Why can't you use the addition operator?

Jan-, yes but in the fonction I need to put a "+"…
Jan-, I'm trying an XSS attac

Why does it matter?

but the script is protected against "+"

foo = 'bar'; wibble='foo

Jan-: Error: Error: unterminated string literal at line 0: foo = 'bar'; wibble='foo

foo = 'bar'; wibble='foo'; foo.concat(bar)

Jan-: Error: Error: ReferenceError: bar is not defined at line 0: (null)

drat
foo = 'bar'; wibble='foo'; foo.concat(wibble)

Jan-: barfoo

there you go

thanks a lot

doesn't modify the original.

what ?

hello

in that example, foo is still
in that example, foo is still "bar"
it just returns the concatenated values

could any body tell me how can i get border width with dom (element.style. )

What sort of border?

foo = 'bar'; wibble='foo'; foo.concat(bar); foo

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

foo.concat(wibble)

oops, copied the wrong one

element border , like #id { border: solid black 1px }

foo = 'bar'; wibble='foo'; foo.concat(wibble); foo

bar

foo.style.border='1px solid black';

^^ this is what Jan is pointing out

and for getting only 1 for 1px ?
is there a way ?

I'm not sure what you mean.

for getting border size in px

you want to get it or set it?
Getting it is hard if you have set it in CSS.

i have set it by css …

It can be done.

and i just want to know it (not setting it)

But I don't know how. Try googling for getComputedStyle
That's the IE way to do it but I don't know about firefox.
There may be a library for it.

exec('var lol="foo";'); ?

ubitux_, wouldn't it be eval()?

eval(), that's it

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

thanks
huh ?

if a piece of code randomly generated assigned events to objects throughout a page, then those items in the page are deleted or over-written, how can the memory for those events be cleared up?

mmmh I think that's not the function
exec("alert('lol');");
do you see what I would like to do ?

you're looking for the eval function, I can see *what*, but not *why*

another way to bypass the protection I have
eval works ?

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

buubot, so wtf ?
erf
I'm talking to a bot…

eval 1+2+3

6

I see :p
thx
it seems to don't work

missing ) after argument listSource File: http://www.gigdates.com/venue.php?id=6967Line: 65, Column: 47Source Code: map.setCenter(new GLatLng(+41.878249,-071.369899), 15);
why am i getting this error
the green arrow is pointing to the . in the - value

DavidHKMrPowers, I don't know how I can use it in my script
var myvar="alert('lol');"; eval(myvar);
for example

oh i know
it doesn't like the plus

oups

how would I dynamically load an external JS file (instead of always including it in the page)

it works :/

grrr this is not it
this is going to have to wait, i need to SSS and go to work

tag from within javascript?

i would say you could load the css page using ajax

http://pastebin.ca/610716 - why am I said that the function is not defined?

The paste 610716 has been copied to http://erxz.com/pb/3497

document.getElementById("whatever") — but this returns undefined

also if I try to use document.form[0].blah it will also be undefined, as will document.formname.blah
I'm going crazy because this is such a simple thing and I can't seem to get it working…. and I need to have it done asap - can anyone please help me out?

the first thing to check is that the ID is unique

it is, 100%

then ensure your form is correctly introduced in the document (not between a table and a tr)

the only tag above the form tag is a div
So I think that's a 'check'

give a link to the test url

Unfortunatelly it's an internal employee portal thingamajig i'm developing
I don't really have a test URL

then this leave the last option

pastebin the code?

well if it's not too long

It's not, it's mostly HTML anyways
The javascript is about 5 lines

i was about to say "pray for someone else to come)… but your idea is correct :P

Here you go http://pastebin.ca/610828

The paste 610828 has been copied to http://erxz.com/pb/3498

I took out some of the content in terms of users and usernames from the table as well as the company name for privacy issues
but it shouldn't affect the outcome as there's no forms or id's inside the table
Also I just noticed that I had a mysql query in there which I was using to debug, which contains the characters "" and "" but this problem is still there after I took those out
Just throwing it out there….

the only thing i see is the form that don't have an action and method… and then may not be considered a correct for by the browser (guessing) but that's no reason not to select the element by id

Let me try giving it one… by default it should 'post' to itself which is what I want it to do

Arcanimus str_replace("", "<", $myresultvalue)
OMFG
stupid me

thanks, I know :P I just forgot to add it when I was debugging

i know the problem

Oh?

your JS is executed before the body is loaded
wrap that in a function and call it in body onload="myfunc();"

yeah that's what I was just thinking
thanks 3
Let me try it right now
erm.. no luck
also I was just thinking to myself that it wouldn't solve the problem because I'm still getting 'undefined' when I evaluate the statement in firefox's javascript error console

still says "box" has no properties ?

yup

repaste the new code

okay one second
http://pastebin.ca/610841\

The paste 610841 has been copied to http://erxz.com/pb/3499

err http://pastebin.ca/610841

The paste 610841 has been copied to: http://erxz.com/pb/3499

do you know of FireBug? http://getfirefox.com/

I left the inside of the table, just changed hosting company name this time - fake users anyways

er, http://getfirebug.com/

never heard of it

well beats me
but you might want quotes around the left hand operand here #
if(box.options[i].value == usercreate) {
#

Yeah it's totally strange… even has the same problem in MSIE
True, *adds it in*

erm
right hand
q2HIO`

Oh my god. that worked
Thanks for catching that
I don't know why the box was undefined
but for some reason it works fine now

firebug would've catched it

*caught
:p

oh
thanks
past tense exceptions…

np - thanks for the help. I can't believe I was wresting with this for like 40 minutes
my boss won't be too happy I wasted so much time on it but oh well
such is the cost of debugging
later guys

guys I forgot, where I change the system global variables like [ from java , etc ] ?

is there a javascript validator somewhere?

the what?
if the syntax is bad, the script will be ignored

like the var from java host to make it global
where I change that ?

change what?

the global vars

can you give an example of what you mean?

i thought was env
on command prompt but that´s linux i think
*in linux

in javascript?

no

hi
need a little help..
i want to know the FULL URL from ths "Get Results" Button
http://www.nseindia.com/content/equities/eq_scriphistdata.htm
i want to use bash script to get server data..
is it possible?

does anyone have an idea what this might be for:
http://www.js-x.com/page/javascripts__example.html?view=847

Is there a way to detect what segment (#…) the URL bar contains?

yes, hold on
window.location.hash

oh, thanks!
:-)

hey everyone

Hello! Is there a way to list all the current attributes of an object?

hm
you can list through all of them manually?

I don't know them in advance

search for print_r for JavaScript, maybe

ehhh
idk

ok, I'll try

http://www.phpbuilder.com/board/showthread.php?t=1029426
ack
invalid, wtf

for (i in obj) { i is name attribute, and obj[i] its value }

THANKS!!!

hi all
wymetyme?

hello everyone, i am trying to write OO javascript hosting function and when i try to access a attribute or a function of the object from inside the anon function, it says its not defined

"ohreally" at 71.6.194.243 pasted "says showerror method is not defined" (18 lines) at http://erxz.com/pb/3500

http://erxz.com/pb/3500
anyone?

document.content_right.style.height = document.content_left.style.height — if i have two divs with those respective id's (content_right, content_left), should that work in making their heights equal?

use document.getElementById(content_right).style.height
that's your better bet

thank you, but surprisingly still won't work

.

try storing it in a variable and then assigning it
you can then atleast debug if you did get a value
i have had this problem but trust me i got bigger problems at the moment :
bi have had this problem but trust me i got bigger problems at the moment :/b

well, alert(document.getElementById(content_left).style.height);, gives me absolutely nothing
could this be because i defined the height with css and not inline using height=""

yea i have had that problem before
i dont know what the solution was
think all i did was bang my head on the wall

and that worked?
IE, amazes me every time…

so anyway did anyone get a chance to look at my jscript?
http://erxz.com/pb/3500
i get error, i says the functin is not defined

for future reference: javascript!=jscript

but when i run it seperaetely it all works fine
yea yea shoot me

lol sorry, just sayin

Why does IE not like addEventListener/removeEventListener
?

sorry, kinda pissed off with JS and css problems all at the same time
addEvent
that works fine

`js addEvent

function addEvent(el,ev,fn){ if(el.addEventListener) el.addEventListener(ev,fn,false) else el.attachEvent('on'+ev, fn) }

`getElementById

any idea how to pass parameters to the method called in that?

`js getElementById

addEvent just implements addEventListener
I have a page in IE that is erroring on every instance of add/removeEventListener

to addEvent or to its "fn" arg?

you talking to me?

insin to its fn arg. I have a number of elements to which I want to attachevent and the only difference is the id that's pass to attachEvent, but when I use function() { doSomething(args) } the operation is always performed on the last instance created
to me

okie

use a closure

a closure?

function exampleClosure(arg1, arg2) { return function() { doSomething(arg1, arg2
whoops

urgh, this is getting messier and messier
inline is almost tidier

function exampleClosure(arg1, arg2) { return function() { doSomething(arg1, arg2); }; };
addEvent(el, "click", exampleClosure(arg1, arg2));
not messier, new conceptier

messier

can anyone see something wrong with this? :
this.main = document.createElement("table"); document.body.appendChild(this.main);

`js closures

http://jibbering.com/faq/faq_notes/closures.html or http://blog.morrisjohns.com/javascript_closures_for_dummies

thanks, looking at the first one right now. Looks…. like work
hold on, if I have evAdd(field,'focus',function (){ clearFormField(this,fieldDefault) },false); is that not already a closure?

no, all your functions reference the same variables, which is why the last value assigned to it used
*is used

ah, so I need an extra one?
urgh

s/urgh/powerful!/

s/powerful!/work and inelegance!
there goes my plan for one global js file
loading up on pages alone will be a lot!

it's not really that much extra work - you could write a generic function which lets you define the event handling function an its args

hmmm, true
although, I kind of have that, it's just extra layers on that now

it could use http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Function:apply to call the handler with some args
it could use a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Function:apply"http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Function:apply/a
to call the handler with some args

why can't I appendchild to the body-element?

can anyone help me writing OOP javascript, i an unable to access a method or a property form inside a function of a object

can I only do that onload and not in the row before /body?

is there a way to perform a function every time the browser window is resized

yes you can register the even window.onresize = myboject.foo

`js removeEvent

guys cmon' help me out, i am really stuck with this javascript problem

what's the inverse of addEvent?

thanks

its node.removeEventListener(eventType, function);

can i put the window.onresize in the body onload=""
?

excellent tutorial http://www.brainjar.com/dhtml/events/default.asp
i would suggest to keep the events seperate

that only works in FF
not IE

el.detachEvent("onmouseover", highlight2);

I guess I can write one real quick just like addEvent

word thanks

so anyone with OOPs javascript skills

http://rafb.net/p/6Vwhzn26.html anyone can read: wont work the line 36…. the function is called from onsubmit…. any advice?
a href="http://rafb.net/p/6Vwhzn26.html"http://rafb.net/p/6Vwhzn26.html/a anyone can read: wont work the line 36…. the function is called from onsubmit…. any advice?

Mmm.
Curry.

brr

.href is missing

charming

Jan gets dark purple

window.location.href

Huh?

I'm color-coding all of the IRC people

the addEvent that the jsbot spit out doesn't work in IE7
the function that is

Oh. Why?

can someone tell me how to get the javascript sort( function() ) to work in ie7, or a workaround?

Jan-: Makes it easier to follow rapid conversations, especially when multiple people have nicks that start with the same letter or are the same length

is there anyway to display redirects in child iframe, in parent?

Oh, OK.
Is this what you had in mind?
There's all kinds of things I could do with this, if you wanted….

does anyone know why IE6 doesn't read the rowspan property of a TD dom object?
and how to work around it?

does anyone know of a workaround for the javascript sort function in ie7?

"cappytoi" at 71.6.194.243 pasted "json code error" (17 lines) at http://erxz.com/pb/3501

ohreally, wont work same error…

what was the error agian?
geting the height thingy?

http://201.100.2.252:8080/extension/extension.php
window.location.href = "extension.php?tipo=" + document.getElementById('RbDepNom').value + "&valor="+ document.getElementById('TxtCadena').value;
these line not call the same page with the parameters
http://rafb.net/p/6Vwhzn26.html

does anyone could see any error in json code that i pasted into http://erxz.com/pb/3501

i would say first do a alert of what the concatinated string looks like
window.location.href is how you redirect so that's fine
its working printing and seeng the what the redirection is like
s/working/worth

http://rafb.net/p/VPYKaj35.html
the alert line wont display the message, then i think line 9 osubmit not working

what?
lol
do you use firebug?
that's a firefox extension, its amazing
or use aptana ide

sorry for my english
i use macromedia and IE

ok try firefox, install firebug on it, its great for debugging javascript
IE is scary man!!

ok
wich better firefox or aptana ?
for you

i use aptana when i do html files
firefox is good when you building php stuff as in aptana you cant see compiled code

ok

How would one go about creating a popup window then adding data to different element's with specific ids in them? var w = window.open(…); w.document.getElementById(..); w.appendChild(…) ?

hi leute
hi guys
i have a problem
i'm changing the website source with node.innerHTML
but then the dom isn't updated for other functions
so this functions don't run ok
so how can i update the dom?
so that functions changing form elements using dom for it (not innerHTML) can access the new source?

use createTextNode and then append it to the object
using innerHTML is quite risky as you never know what is supported
does that help?

w8 i must look for createtextnode
ok

?
is that a question or a statement?

you mean i should create my design with createElements?
and appendnode?

lol

i mean

if you know what you are dong and that too not at runtime why do you need to build it via dom

is there anyway to display redirects from child iframe, in parent?

unless your html hosting is one js file hahah!!
that will be crazy
document.parent.window.location.href
or something like that

ohreally installed firebug

the user can open as much formular elements as he want
and this elements must be in dom
and i would like to add it with innerHTML
cause its simpler
cause the code of the formular is dynamic
given from an server
and i only add it
replacing some ids in the string
but then i have to request it into the dom
for some functions
how is this possible?

yea everything is possible
document.createElement is your friend

ohreally my problem is an action not?

hmm

action="" ?

but then i have to parse the getted code
cause i have the code

nope

how then?
how can i add all this ellements
i don't know them
they are dynamic from the server
i get the code to add into an div as a string
how can i add this string

newli = document.createElement('li'); newli.value = "asd"; root.appendChild(newli);

with createElement, when every chield in this string must be registered in the dom?

actuly its not root.append its document.getElementById('list').appendChild(newli);

and i have to delete the elements too
how can i make this 2 things?

nm, i should have used innerHTML not value

hello, I am reading data from a stream, using php, and I need to write that data into a textarea
the problem is, the data is written just when the stream is closed
is there a way to write it at the moment I read it
?

not that anyone really cares
excellent!! cheers Jan-

:-)

wrong channel
lmao

ok, thanks

i want to escape this character which is originally single quote ' http://img240.imageshack.us/img240/5953/escapeef1.jpg

ohreally not found my problem….
any advice?

\
\'

http://rafb.net/p/6Vwhzn26.html
can you check
the onsubmit line56 not work, never call consultar function any advice?

does prototype provide a standard interface for setting form values?
for instance, checking a checkbox

never called ?

yes

document.getElementById("RbDepNom") has no properties

the alert not display

if you have a form with an input name="somename" if you pass the value of somename into a javascript as a var can you access document.forms[0].varname.value?

yes, no?

document.form1.RbDepNom.value - instead this, use document.forms['form1'].elements['RbDepNom'].value
and it fails because there is no element with id "RbDepNom"

thast the same for me too right

I want to include a remote js file in a greasemonkey script, what's the best way to do this?

yes, to you too

how can i destory a element based on id?

thanks yup

yup. testing

there is form control, named as "RbDepNom"

var el = document.getElementById("someId"); el.parentNode.removeChild(el);

yup yes check please the lines 59 and 63
input name="RbDepNom" type="radio" value="D" /
and other with input name="RbDepNom" type="radio" value="N" /
is si so/ is so so

to an onClick="dothis('yeah','blah')" and your function is like dothis(id1, id2){ you would access it by document.forms['formname'].elements[id2].value correct?

how can i get the last character of a string

yes
use this - window.location = "extension.php?tipo=" + document.forms['form1'].elements['RbDepNom'].value + "&valor="+ document.forms['form1'].elements['TxtCadena'].value;

ok

(encodeURIComponent(value) available? I don't know if that's prototype-specific or not)

var s = "abc"; s.charAt(s.length - 1);

c

function makeValidRequest(url,divid,newid) { var httpRequest; if(document.forms['form1'].elements[newid].value == ""){ .. still is giving me document.forms.form1.elements[newid] has no properties

"abc".split("//");

{ 0: abc}

it has to be the element's name, not its id

ohh
"abc".split("/./");

{ 0: abc}

im passing the element name with onClick="makeValidRequest('update.php?id=06405&qty=','Layer17',06405)"
DOHH no '
nope still doesnt work
newid should = the element name

paste your code

http://rafb.net/p/uDFYmX59.html and at adressbar i continue seeing: http://localhost/extension/extension.php not: extension.php?tipo=undefined&valor=contabilidad
any advice? yup?

"emence" at 71.6.194.243 pasted "error" (44 lines) at http://erxz.com/pb/3504

there it is
does that make sense at all?

nodes = document.forms['form1'].elements['RbDepNom'];
for (i=0; i nodes.length; i++) {
alert(nodes[i].checked);
}
name can not consist only from numbers

ok

now you can check if element is selected (checked)

so i need to put a letter in front of it somehwere

yes
name="_06405"

YUP THANKS
TESTING YOUR CODE, MUCH THANKS

works ?

i put a Z infront of it Z06405 and still get the no properties error

yup sorry for the caps

but if you want pass value of radio to server hosting you do not need to form url manually
it will be transmitted automaticaly when you submit form
at what line it fails ?

if(document.forms['form1'].elements[newid].value == ""){
document.forms['form1'].elements[newid] has no properties

have you changed name in both form element ant function call ?
img

yes sir

emence why dont you just give the input an id with the same value as the name or use document.getElementsByName('NR0001')[0]

because its dynaic data thats coming out of the database.
I cant hard code any of it

how do i make a var false and then test it? array[key] = false and = 0 doesnt seam to work then i test it in a for ( x in array) if (x)

document.getElementsByName(newid)[0]?

trying that now

please, alert(newid)

alert newid comes up right

what text ?

alert(document.getElementsByName(newid)[0]);
comes up as htmlinput something
the alert(newid) comes up as z06405

and what is the name of control ?

try alert(document.getElementsByName(newid)[0].value); ..

SWEEEEEEEEET
document.getElementsByName(newid)[0].value works like a charm

does your form have nane="form1"?

yup

and what is element name?
z06405 or Z06405
no .. sorry

Z06405 i hit the small z when i typed into IRC
it alerts the same way too

setTimeout doesn't appear to work correctly when the cursor is being moved, is this expected behaviour?

script type="te" (18 lines) at http://erxz.com/pb/3505

that works for me

gregorycu maybe if your pc is really slow? it should not have a influence on it afaik

thats uncanningly weird as heck.. seems to not work that way… lemme quadruplecheck my code

hello people! goodz evenin'
somebody could give a hand, plz?

just ask Flannel
FlashWolf

how can i control elements by its classes?

oops autocomplete rules ;p

xD

FlashWolf there are javascript frameworks which have a getElementsByTagName function
ehm i mean ClassName or Class

i wanna create a function called 'addRoundedCorners()'

this is a good light js library with getbyclasname http://www.robertnyman.com/2006/11/07/ej-the-only-javascript-library-youll-ever-need/

so, when i add a class called ’roundedCorners' to an element, it'll appear with rounded corners
i'll take a look, johnnyisleet, thx!

who has something better than selenium for ajax testing

happy_broccoli http://en.wikipedia.org/wiki/Ajax_framework

what kind of problems are you having with Selenium?

my team wants to see alternatives before going in any direction

do the alternatives have to work with many browsers?

someone can explain me what this thing and how i can read it?==http://saint-tomy.miniville.fr

hey everybody, I'm trying to get this function to detect what image is showing so that it doesn't run the animation on an image that's already shown. I do this by comparing the src of the image that is being shown to the href of the anchor that fired the event. the only problem is that the what
i use docgetbyid(img) and alert img.src, it shows the absolute path, where as the anchor shows the relative path. Any ideas? than
ks.
http://johngiannakos.com/WEB3/WEB3/work/index.html here's a link with two alerts showing the src's, just click a number on the right.
did that make any sense?

http://js.pastey.net/70563 returns 5, when i want it should return 4..

what is track ?
object ?

var track=new Array()

track[x] != false
x - index

start) { can i just do if (() && ()) {

yes
even without inner ()

whats faster 3ghz one core cpu or 1.8ghz dual core… would the 3ghz be faster for one process but the 1.8 dual be faster if I were running 5 simulataneously?

wymetyme!!!
hello

I'm not an expert, but I'd have to go with th 3ghz… it's got more raw power
there's no getting past the fact that they're both 1.8ghz

hey people
how can i make a function instanciable?

just call it with "new"

just this?!
didnt works…
i'm using local vaiables only

so… don't do that then

and so far i didnt got it works…

pastebin some code
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Operatorspecial_Operators:new_Operator

but i have to do…
i'm buildin my own js lib
fo my website
*fo
*for
www.impactoweb.info
the site is being updated
*there are some bugs*

isin, are the same guy from the php channel?
insin

unless someone has distorted the spacetime fabric to get the same username as me while I'm logged on… yes

uhahuahua

if I have function Test(){ ….alert(this instanceof Test)} and did new Test(); why it retuns false? shouldnt this be of type Test ?

aff

function Test() { this.test = this.constructor == Test; }; var t = new Test(); t.test;

yes I tried that myself and it returned true. but I didn't get why

bah, where's the bot gone
"parp"

freenode–

please would you mind explaining to me why ?

is there a place that i can see a example of how to have objects freely dragable? i want a butn of text boxes that can be draged around the window and snap together? i know its going to be realy complicated but id like to atlest attempt it

google home page?

id rather have something where you could put the boxes anywhere..

any of the dozens of js "web 2.0" libraries out there will have a DnD example

with stuff

so when you say example, you mean something you can cut-and-paste from? or an example to learn from? either way i'd just go to one of the libraries and check their example
i like YUI the best, but there's lots

lol this one is cool, but id like them to be able to snap verticly… http://www.walterzorn.com/dragdrop/dragdrop_e.htm
thanks, i look at YUI

I created an svg rect and wrote some code to move it in the mouse.. however there is some area in the rect that doesn't get the mousedown event.. any idea why?

true
parp

index.php#bar

HI .. Is there a way to seed the random number generator in Javascript? I would like to generate a list of random(ish) numbers but have the list remain the same each time

hey everyone

Well .. the same, depending on the seed that I give the generator

hey, Dr. MONO`

If not, maybe someone could suggest a simple routine for generating random numbers?

why do you call me dr.? lol

Yeah, hold.
http://phrogz.net/JS/Math.randomMax.js

Thanks Bradley, but that's not quite what I had in mind. What I'm looking for is a means to re-seed the random number generator such that after each call to (say) Math.seedRandom(n) the random number generator will produce an identical list of random numbers

is there a way for javascript to determine when a user changes between #hash links on a page? eg: index.php#foo index.php#bar … the page doesn't get reloaded .. just scrolls around to the different anchors.

Alternatively, I could use my own math routine (such a a Reimann-Zeta function) to generate pseudo random numbers
I'm not overly concerned with the range of the random numbers

Hm. In that case, I don't know.
Sorry Carleton.

OK, so the VLC activeX doesn't work in the slightest.
Next pointless task.

Carleton, if you are after long lists of identical but random numbers you could pre-generate all these lists and store them as javascript arrays. then you could load the javascript file containing the array of random numbers every time.

You must add $02 at the beginning of the code and $03 at the end - eg turn on = "$02,'PON',$03".
….about an RS232 stream, what do they mean by $02 and $03?
Literal strings, character numbers, what?

Jan-: try and see?

Can't.

that needs more context

OK.
The situation is that it's a fairly upmarket, industrial-grade Panasonic video projector.
I have raw access to the serial port with my script, and I can send characters to it

heh

It supports commands like PON, POFF, LAMPBRT, INPUT, etc
all fairly basic stuff.
far from rocket science
But I'm not sure what they mean by what they said there.

in that case I would go with the characters

his syntax is odd
"$02,'PON',$03".
what is that, C?

hi guys
i'm making an ajax desktop environment
and i'm wondering how i can be notified that the browser has downloaded all the images specified in the document?
i want to hide those elements until the images have been downloaded, and display a "Please Wait" or similar until its done
hello?

hello

so, my question…

Oh, right
*reads*
You could use script's DEFER attribute
Something like script type="text/javascript" defer="true"removePleaseWaitModal();/script

logankoester, if an element's visibility is set to hidden, does the browser still download the content, but just doesn't display it?

that's correct

or does it wait until the element is set to visible

there is onLoad emthod

It will download it and not display it

okay

is there any zlib tools for uncompressing a string in javascript?
(and compressing)

hi everyone

Hello! do you know the solution for the onblur="window.close()" on Internet Explorer? I want to close a pop-up window when the user click anywhere outside it but the behavior within IE is buggy

try not using a window
make your own window

yeah, but for now I can't

alpha(opacity=#); and then kill the element
why not?

http://tipling.dyndns.info:3030/ ?
:/

s|k, i like it … thou it hang a bit my ff … but maybe its because of firebug and many other tools

I need a loading dialog up front
or something

I have a gallery, I want to make it so that when you click the image that's already being shown, it doesn't re-load it. if I get the src of the current image, it gives me an absolute path, and when I get the src of the image that's been chosen to display, it's a relative path. any ideas on how I
can prevent the same image from re-loading? link: http://johngiannakos.com/WEB3/WEB3/work/index.html

hey guys if there's some javascript which is writing about 5 lines of text to a page I have, is there a way to prepend something to each line, such as a » ?
I doubt I can use CSS for that right

save the loaded image host in an array
check the array before loading images
the image name

anyone?

or soemthing
use the concatenate operator?
concatonate
sp
+

is there a way for me to get the relative path, I'd prefer not to use some kind of global declaration of the previous image being displayed

oh, no I mean the script is from an outside source which I have no access to (digg.com), it's writing about 5 lines to my page which I'm embeding it in, but I want to prepend each line with something such as », anyone have any idea?
guess not

hrm
I'd have to see the script
split the src string via "/" and then remove the base?
I don't know if there is anything prebuilt into javascript that does that
dojo does have something like that

var thing = document.createTextNode('»'); document.[diggID].appendChild(thing)
coudn't you use that?

http://digg.com/tools/diggjs/user/dugg/jorgepblank/9
that's the script

assuming you can the dig thing has some kind of id

(view source of course)

what do you want to right it before

yes sir, prepend it
so it writes 5 lines to my page, I went each line to have a » in front
or something, even a -

alguien habla español aqui?
o entiende?

maybe you can request that script via server side and then modify it
and then put in on your site
that's a generated script obviously

Thanks s|k and johnnyisleet, I was just wondering if there was a simple way to do it, else I don't really mind, thanks anyways guys.

no abla
habla*

I don't think it'd be that hard
but w/e

what do you suggest I do

my first instict would be to wrap it in a div, get it's ID, loops through all the containing div's that Digg createst, and then create a textnode with whatever you want, and append it before each div
but maybe others disagree?

how do I make these div's aligh http://202.10.86.59

yup
nah that's a good js way to do it
I think it would be easier to just do it server side :P

thanks
yeah I have a server-side script that does it

no prob, good luck

but it's not as instant
that script tells what stories i just dugg, and the server-side way isn't instant while the pure js way is

oh right

alguien sabe de algun canal javascript en español?

hey s|k my url has more then one '/'

is that really complicated? I have little js knowledge, though I do program in other languages, I just wouldn't know how to 'loop through all containing divs', etc.
but I guess I can figure it out

but you know how many right?

It's not too hard. wrap it in a div, use doc.getbyid(), one you get it's reference, go [reference].getElementsByTagName('div');

thanks

getelementsbytagname will store the divs in array syntax

that was odd..

sorry but wrap 'what' in a div?

the whole digg include

?

whatever code dig dumps into your page
where can I download this script your using.

alright
I'm supposed to embed this in the page, script language="JavaScript" src="http://digg.com/tools/diggjs/user/dugg/jorgepblank/1" type="text/javascript"/script
what's what dumps the lines
so the script is in http://digg.com/tools/diggjs/user/dugg/jorgepblank/1

riight. aright i'm gunna play a bit.

thanks I appreciate it
hold on, its
script language="JavaScript" src="http://digg.com/tools/diggjs/user/dugg/jorgepblank/9" type="text/javascript"/script
so the script's at http://digg.com/tools/diggjs/user/dugg/jorgepblank/9
my bad

hi everyone

thanks johnnyisleet, I appreciate any help you can give (as well as the one you've already provided)

I was wondering, Can I change elements properties with java before the page loads.. ?

with _Java"_ ?
/topic

I mean javascript

say 'javascript' next time :p
or 'js'
or just omit the name, and we'll assume
what do you mean before the page loads?
to what end?

blanky:it's annoying cuz it's just throws it in there.

don't worry about that man, it's alright
thanks anyways I appreciate it
later, johnnyisleet

reisio, well.. I have a page that have full sized images in one page, I want them to be thumbed automatically, this I have fixed.. but I need somehow to insert the image name in my xhtml code..
not sure how this could be done!

you want them to be replaced with thumbnail versions automatically, or just have their dimensions set very small?
the name?

hi, i'm using prototype and want to update innerHTML on a select object, but ran in to the IE bug making this a pain. i have worked around it in one place using outerHTML, but in another (complex, dynamically generated, array-of…) select, i have onchange handlers and can't let them die. how
hard is it to programatically attach an onchange() to an entire form? i tried this with HTML before but reached the conclusion i

replaced with my thumbnails that I create with a php script that i call on using ajax

i'm still workin on it, just for fun

alright, I'm going to go do something but I'll be back, if I'm not around when you msg me I'm logging the conversation so I'll message you back, if you have to leave or you couldn't figure it out, don't worry, I appreciate it anyways

haha aright later.

ah
well you could get their container with getElementById, then use getElementsByTagName to swap them out
but why not just use the thumbs by defualt?
default*

so getting their containers is the correct way of doing a task like this? Im new to js!

it's one way
doesn't seem like that bad of a way to me, but others might know spiffier ones

anyone use adobe apollo?

however, I think you should probably just use the thumbs by default
whasat?

I mean adobe air?

Yeah, feels like using the name by default seems the way to go..

whasat?
not the name
use the thumbnail images by default

considering I know what names the thumbs will get so that saves me alot of work

why replace the larger images with thumbs? :p

hmm, don't know actually, didn't give it that much tought more than I needed to make them small and load fast

so just use the thumbs by default :p
no need to swap them…

http://labs.adobe.com/technologies/air/

ok

horrible name for a software :p

tell that to adobe

I would if I cared about them

but the software itself is pretty cool

oh right I remember this

so that implies because you told it to me that you must care about me…. *blushes* :-*

well, it doesn't exactly imply the opposite, at any rate

Is there any cool script putting borders on images and stuff?

img { border: 5px solid fuchsia; }
:p

maybe not the best border color .. lol

:p

missing ) after argument listSource File: http://www.gigdates.com/venue.php?id=6967Line: 65, Column: 47Source Code: map.setCenter(new GLatLng(41.878249, -071.369899), 15);
what is the deal?
it is pointing to the right of the period next to -071.369899
map.setCenter(new GLatLng(41.878249, -071.369899), 15);

how to make a big cover before everything is loaded?
the problem is where i should put that cover function
..onload seems to be late

onload is run once everything is loaded

hmmm ok

you can put a script in the head part

you know this might help me too


but before body is loaded, no element can be display
displayed

is loaded?

hide
put everything in a div, and hide that div

gregorycu cool ! thanks body to be hiden

… /div

If you can do it to body, that would be better

ya, couldn't think od this method
btw, one more thing. how to auto resize images?

to what size?

an image seems to have no width, height befor it's loaded
to be within screen deltab
i've used a stupid method. i hide the image before it's onloaded
then i got height/width to resize it to be wthin screen and show it then
but is it possible to resize it before it's fully loaded?

set a width or height attribute or style property

deltab but i don't know the width/height of the image in advance

I thought you wanted to override the image's own size

img_ref.offsetHeight seems to work only after it's loaded
delta yes i want to override it in ratio

I'm back

set only one of the width and height, and the other is calculated by the browser

how do you link with javascript?

if the image is smaller than the screen…?
i don't need to resize it to fit screen
corevette script

link what?

what's wrong with a regular link?

script type="text/javascript", please

like if i want to do the action swapFade()

onclick = xxx();

a onClick='swapFade()'click here/a
?

can you store the image size in a database?

onclick=xxx; NOT onclick=xxx();
(unless you're talking html, in which case it's onclick="xxx()")

Woosta ya,,,he is talking about linkinf with html
*linking

So don't give him BS code :-D

heeh

deltab no..it's a file from filesystem
Woosta BS?
== bullshit?

`abbr bs

Bull Shit. What ever you said: it's bullshit. We don't believe you

heh

a href="#" onclick="swapfade();return false"CLICK ME WILD MAN/a

Grrrrr
`best practice

is auto resize of images a difficult task???

`js best

`js auto resize

`no @ DavidHKMrPowers

no: Don't make shit up.

learn best practice a href = a href="you_need_javascript.htm" onclick="doWhatever(); return false"

OK

what does return false do

(not href="#")

OK

it returns false

stops the href being actioned

so what would happen if i didn't hav eit

It will follow the href

hopefully to a page with as equivalent functionality as possible, rather than just saying "you need javascript"

(not href="#")

OK

the function is called and then the href is redirected
without false
without 'return false;'
i want to show an image within screen, how?

I did it.

really?!

haha yeah
hold on
i'll pastebin it

O'REALLY?!

.offsetHeight has no value until the image is loaded
so, i can't make it resized before it's loaded
any ideas please?

* display:none?

johnnyisleet me?

or, * visibility:hidden; get the offset, then change the visibility

get the size server-side and insert it into the script

sweet, thanks man!

yea, sounds pretty sketchy

johnnyisleet i'm using this method…but it's not good..

oh ok, srry didn't read up

johnnyisleet clients cannot view the image loading
deltab from server side!?

where can I post code.
paste

hold on

where the image is

http://paste.jorgepena.be ?

there she is
http://paste.jorgepena.be/5417

deltab it can be passed through server side but any easier method?
from filesystem

thanks johnnyisleet ! I'll figure out how to use it now
very much appreciated johnnyisleet

not that I know of

WTF are u guys talkin about

deltab thanks

find image size; send image size in HTML, CSS or JS

i'm on msn at johnnyisleet@hotmail.com
i'll explain you some of the code.

thanks
I added you, you didn't get any notification?

is blanky a girl?
johnnyisleet talk here otherwise
:P

huh
Is any good javascript IDE u guys can recommand?
Using notepad to code Javascript is obivously not good choice

you can try 'aptana'
which is really just a plugin to Eclipse, which is a Java" app
I have heard good things
really, though, you should only need an editor with decent syntax hilighting

heheh

with intelli-hint will be better

take it to twitter

what platform are you on?

U dont have to nmemories those member function anyway
I work on windows

right
then aptana
www.aptana.com

Am I have to download eclipse

..no

Thats software seems like huge

just get the .zip version of aptana, all you do is unzip, done, run the executable
yes, 50mbs

the best way to return false using a function is onclick = return whatever(); at the end of the function write return false;

are you on broadband?

*usually.

Sometimes eclipse will just crash on my mechine

..

Huh,yea

big difference, aptana .zip is just 45mbs I think, full latest Eclipse is 125mbs
aptana uses Eclipse libs
but is all in the .zip

Thats almost one-third of eclipse
Its very nice of u to tell me this
I think visual studio 2005 also works quite well

as well as Microsoft bunk works :p
`js ide

IDEs for use with Javascript: Try `js ide windows, or `js ide linux

`js ide windows
`js ide linux
`js ide windows

http://www.aptana.tv/movies/aptana_outliner/Outliner.html

okay then :p

or ChandlerBing http://www.aptana.tv/movies/aptana_overview/Overview.html

y'know what else is handy is firebug in firefox (or other browsers with firebug lite)

is rather a big package, but covers a lot of ground comparatively to most
`js debug

Try `js firebug, `js venkman, `ie debug

howdy. I can't seem to remember how to modify text within a table cell dynamically using javascript properly. Is the innerHTML the thing we should avoid, or use?

jnguy[w]: in this case, depends , why are you editing it for?

so basically I have a table filled with preferences.. Each row has a 'priority', but if you delete one, all the priorities below it should be minus 1… any ideas?
Thanks in advance.
I think I remember people saying that innerHTML is a necessary evil. Am I correct?

the aptana log is a sprocket?
that's one crap logo :p

nodevalue perhaps.

heheh

wow this guy types horribly :p

http://www.aptana.tv/ the whole bunch of flash videos :P
heheh

heh
do you know what engines Aptana can/does use for preview?

nevermind, nodevalue was not it.

How to code muti-browser website

these are nice - I'd never actually looked at Aptana in-depth
but now it looks like I can add it to my list of editors to suggest to newbies
the ones that ask for preview-ready ones
and code completion, too
and compatibility
(browser)

Asp.net AJAX

moo, he typed script

Seems like muti-broser stuff

ohh
hehe

wow he had to retype 'Sue' three times :p

primarily uses Firefox or Mozilla, either but preferably Firefox
when editing a html file, it gives a [preview] tab next to the [source]

anyone have an idea?

they also have a firebug patched, with joe hewitt permission and all, to integrate it with their IDE
the feature I use the most, is the OUTPUT window, since it objectifies in a tree-like parent-children objects, and you can jump back and forth with one click

he uses a strange indent style

reisio, so how can i do that in javascript?

I really wouldn't know where to start

innerHTML works. Thanks guys.

I know what I'd search for
'javascript image mask' or the like

ok

ask the channel, though

jnguy[w]: so, you're rewriting the values for all row cells on a change?

row cells? just a single cell in a row that has a higher 'priority' than the one deleted.


what are you trying to do?

i need to generate a mask of an image

jnguy[w]: I see, if you're not affecting the Table elements with DOM methods, use innerHTML, else use DOM to change their .nodeValue
define 'mask' :|

the part of the image that is opaque

?
images aren't opaque?

i need to generate a second image that has the same opacity mask
CommandPrompt, they can have transparent parts too
specially icons

so i want to generate a second image that has the same opacity mask, but a single color

why you need to be picking on pixels btw?

because i'm making an ajax desktop environment
and it has icons on the desktop
i need the icons to be highlighted blue when they are selected
so what i plan to do is:

suspense /

div(background is the mask) { img(icon pic) }
and i can toggle the opacity of the img element between 100% and 50%
to simulate highlighting

Thanks.
Is there a list of DOM methods?

right now, i have the entire background as a single blue color

jnguy[w]: yes

so that when you select the icon, a blue square appears
instead of just being blue where the icon image is opaque

err. Sorry if I sound like an idiot… but I don't really know javascript, just dabbling really.

are you sure js can't do the opacity setting on the image? without having to have a 2nd copy?

binding objects to functions… is this possible in javascript?
and, if not, what is a nice work around

CommandPrompt, it can, i'm already doing that

;google +dom2 +methods site:zvon.org @ jnguy[w]

jnguy[w]: http://www.zvon.org/xxl/DOM2reference/Output/Core/_methodIndex.html

the opacity mask is for the background that shows through once the img's opacity has been set to 50%

Thanks.

doeable, what do you have in mind?
not sure I follow you on how the 2nd image copy, comes in place :|

ok look
i have a div element
i've set the background of the div to a shade of blue
than i have an img element inside the div
the img element displays the icon file
and it covers the entire div

\n is NOT punctuation

now if the icon file is square
Woosta i know, i press enter where i would pause if i were talking
when it finishes a coherent thought

That's what a comma or a period is for

anyways…

It's damned annoying

CommandPrompt, so if the icon file is square, the background of the div does not show through

hehehe

CommandPrompt, because its completely covered by the img element

not very concise ^_^

coherence … I'm yet…. to get :|
I know it involves an image and a div :| … and some color scheme
so

divimg/div
thats the structure

a div wrapping a image, which provides a border around it too :|
so far all css and markup

the div has no border, no margin, no padding. just background color

so is just a wrapper, sooooooooo

the div has width = 32px, height = 32px. the img has width = 32px, height = 32px

how does the 2nd copy of the image help?

you'll see that for yourself once i describe the problem
imagine for now, that the img has a square image file loaded into it
its gonna be displayed as a 32×32 image in the browser right?
in its original color
correct?

seems to me you just want a …. grayed-shadow-like copy to be used when draggging and dropping


am i right, or am i wrong?

…. heehehe

can u answer the question please

is THAT what you're after?
seems to me you just want a …. grayed-shadow-like copy to be used when draggging and dropping

no no
i'm helping you to understand the problem right now

LOL

heheh
I'm back to square one, a Div with a 32×32 image

let me start over

Oh goody

div style="width: 32px; height: 32px; background: blue;"img src="icon.gif" width="32" height="32"/div
icon.gif is a 32×32 square image

I got that much

so what will be displayed?

hee
the image ^_^

yes
now if in my javascript code somewhere
the_img_element.style.opacity="0.5";

STOP USING \n EVERYWHERE. NOW.

NoorulIslaam.replace(/\n/g, ' ');

what happens to the displayed image?

nothing

hehe, how does the 2nd copy of the image plays any role on helping for any effect in a practical efficient way though?

in FF 1.5: nothing
what second copy of the image?

Woosta, assume we're running in a CSS3 compliant browser

LOL

CommandPrompt, i haven't mentioned any second image yet

hheh

You're expect to see a half-faded-to-blue image

Woosta, yes
CommandPrompt, do you understand that?

Woohoo!
What do I win?

he's writing a distribution of kinds, desktop something, now, he has the images icon.gif needed, the gifs are gif89, with transparency indexed images, he wants to on-the-fly make a 2nd copy of the image-ONLY-OPAQUE-pixels, leaving out the transparent or something like that

whuh?

so, in short, on-the-fly snapshot the .gif BUT only certain specific pixels from it, and not others

not going to happen

tis what I'm thinking

did you guys get my explanation so far?

but I think what you want, a cSS property or something else will do the work, and you don't need the extra overhead of a duplicate image copy

can we imagine for a moment

div style …. — that that was the first line i said?

and forget everything before that please?

I got the div and a 32×32 image

I got a whole shitload of newlines

the_img_element.style.opacity="0.5"; — did you understand this part as well?
Woosta, you got a problem you can put me on /ignore

Nah, I don't tend to /ignore people that annoy
I'm more one of those arsehole ops

I got the opacity part, but you're yet to show your 2nd image copy usefulness

CommandPrompt, okay
basically what my javascript code does is when the icon is not selected, it sets the_img_element.style.opacity = "1.0";
and to 0.5 when it is selected
forget about the 2nd image
that was just something suggested to me by reisio

Voluntary kick :-D

how do you get the height of a div, i tried to use document.getElementById('panel-draw-content').height but it came back as undefined

document.getElementById('panel-draw-content').style.height

offsetHeight
style.height will only have a value if you set a value

.. yeah.. :|

ok that worked a treat, thanks

hey guys

http://pastebin.ca/611984 . See if you can help.

The paste 611984 has been copied to http://erxz.com/pb/3506

I have some functions in an external javascript file I created, but how do I use them in an XHTML file?
I already did script language="JavaScript" src="digg.js" type="text/javascript"/script

it says it's undefined

in head?

oh, no, I'll put it there then thanks

yeah

tag in it (It takes it from another PHP file, etc.) so I just added one in myself, then called the function later on

tag in some other files then

no, still no dice

tag and then later on just did

make sure is below the .js inclusion code/tag

and it's still undefined

sorry?

fin…
ohhh
window.onload = findDigg;
no () from that scope

hehe

Comments

i have a php script that is called via javascript requests in the script i make a database connection then have

register( 'config', $config ); then anywhere you want - do $config = Registry

Comments

i cant seem to find a save-restore [or similar] system in Graphics2D how does swing recursively render widgets

they get a little defensive about that
pardon me, but duuuuuuuhr

I was thinking of doing something to my java applets to make them better on the web. Can an applet be rewritten to function in javaFX, and what is the benefit? Or is there something else I should consider?

javafx is an applet env

Does it start faster than an applet or is it the same? I saw it compaired to flash somewhere

not sure
I really need to look into javafx, don't I

The Art, Philosophy, and Science of Object-Oriented Programming" ?

I've been putting it off because it always seems like such a half-baked idea

I can't imagine it would be any faster to start up than an applet. Could conceivably be a little slower but probably not much.
The script seems pleasant.

does it? compared to what, and why?

Which script in the first place?

JavaFXScript (previously known as F3 before the marketing guys got ahold of it).

javafx has its own scripting language

Compared to say, java web hosting + XML. Seems to do a reasonable job of integrating declarative GUI design in with the scripting language and has some cute features for array/collection manipulation, etc.

I'll have to look into it more
I have to admit that javafx is way out of my normal problem domain

It's definitely not new, revolutionary and amazingly awesome. Just… pleasant. Integrates a few things nicely, reasonably nice languages and has some cute features.

whats that output stream that counts the num of bytes written?

which cute features?

DRMacIver, but do you think that we can use javafx instead of swing?

It's been a while since I've looked at it - I don't actually use it. The main one I remember is that it has some neat comprehension/query stuff for dealing with arrays and collections.

hmmm

Well, it works with Swing as far as I know. There shouldn't be any problem using Swing components in JavaFX.
And type inference. Type inference is nice.

heh

"Exception in thread "main" java.lang.UnsatisfiedLinkError: mouseGesturesBox.UnfocusedKeyPressedWrapJNI.isKeyPressed(I)Z" does this mean Java can't find the .dll or the wrapped method?

hello

hi

Netbeans 6 is yet a beta version /;
?

Clown-MG: yes, it hasn't been released yet.

jottinger thanks

version 5.5.1 is the released version.

ok
i got it

DRMacIver, uhm maybe but I give a rapid look at it and seems nice but I don't find a way to put dynamic content

i´m a java newbie

on such component like tree or list

well I'd use eclipse anyway ;P

Clown-MG: avoid IDEs until you grok the language some

~tell Overlook217 about tool

Overlook217, A tool is only as good as its user. Tool.

jottinger what do you recommend?

avoiding IDEs until you understand java some.

Like I said. I don't use it myself. Wrong person to ask.

Thanks 4 info

i disagree. I think eclipse api hosting has been a mighty help-along for me

compared to what?

i'm a newbie but my java project - http://redick.googlecode.com - has been a pleasure in conjunction with Eclipse

bit of a blue devils fan, huh

java is very much a language where you need to be able to browse large trees of source and docs to use and Eclipse is well-suited for it. Clown-MG - download Eclipse from http://www.EasyEclipse.org

and what else have you used?

no I dont like duke or college bball that much

just redick, huh

I have 8 years of Perl experience. all done without IDE
jj is nice

so you've used… eclipse for java, and what else?

jottinger i have been using Delphi Ide during last 12 years

I like NetBeans

I don't really consider this a positive thing though.

Clown-MG: irrelevant

Other than the fact that Netbeans consumes 120MB at any random time, its nice

Eclipse is a pure joy to use
and debugging with eclipse is amazing

again… compared to what? command-line?

doing java servlet hosting without ide its easy if you use ant or maven

compared to 8 years of debugging using print statements

AH yes

so you're comparing a one-eyed man to a kingdom of blind peasants?

Perl is fine without an IDE. In Java you really need one..

When I started using an IDE with GDB.. it was.. heaven

Great. If it works for you that's awesome. But advising others to pick the same choice should only be backed up by experience

I stopped all that printf at random parts

and it is my experience that I am speaking from

yes. But others have lots more experience… and have tried alternatives.
some of those people agree with you. More don't.

clearly opinions vary even amongst the experienced. as amongst us newbies… i'm just putting in my 2 cents

it's a personal preference; there's nothing wrong with eclipse in any absolute sense.
But when you've tried nothing else, making a recommendation seems kinda iffy to me.

Experience in terms of java combines with IDEs? Seems like you never used BlueJ, NetBeans, JBuilder, IntelliJ etc. blaaa.. Some even don't exist any more (thank god), but that was the point here: Recommending something after evaluating several choices is better than saying "X works for me.
Pick it."

all you're saying is "use an IDE, I do"
jbuilder's gone, jdeveloper isn't
bluej should be

i tried Netbeans hosting for awhile
i downloaded intellij but saw nothing in it for me.. eclipse host is free with tons of plugins
intellij costs a lot of money

heh, free means so little when you're a professional

yea, programming does pay well doesn't it

intellij paid for itself in time after about two hours

wow

eclipse is worth every penny, though
so is netbeans
(do the math. really.)

Hmm.. Not if your boss doesn't pay for it. I used it a while (and really like it), but I'm not going to spend my own money on my productivity tools

dont you have some code to write? this discussion is going nowhere

is an IDE integreated into Websphere?

my boss didn't pay for it. Not unless you consider the career advancement I got for being, like, productive.

No, actually I don't.

no. But there's an IDE that accompanies Websphere.
of course, I can get intellij for free now
since I work on various open source projects

I'm not yet entirely sold on the "IDEA is the bestest thing ever!!" school of thought.

Good point. I need to find one to a) have a new pet project and b) get my hands on that ide again

But it's definitely worth the license fee.

and for make guis with SWING hosting you do all by hand?

Aye

Matisse for eclipse is a good choise
s/choise/choice

what makes IDEA something I should look at over Eclipse?

of course, matisse for netbeans is an even better choice, since matisse is a netbeans package in inception
IDEA actually helps you code. Eclipse enables you to code.

but Visual Editor on Eclipse is a PAIN

The interface is noticably nicer to use and the refactoring support is a great deal stronger in a number of areas.

yeah, eclipse steals refactorings from IDEA all the time

refactoring? how does that work. I dont use that in Eclipse.

and IDEA can refactor even broken code
okay, suppose you write a block of code, then realise that it should be broken out into its own method

I particularly like the refactoring support as I'm currently aggressively refactoring.

"extract method" is a common refactoring

I rather like the live templates as well.

yeah, I keep forgetting that $other_ide doesn't have the same ones
drives me nuts

New Class and then paste the code over there

try refactoring it instead
it may surprise you at how capable it is, even in eclipse

and how about developing web apps? I guess IDEA has support for making that easy too?

yes
good support for the whole java ee/j2ee stack

To be honest, the refactorings I use the most in any IDE are "extract variable" and "rename"

Alt+R
ups, Alt+Shift+R

The only code I've wanted to seriously apply extract method to was so mangled as to be intractable.
(And I don't have to deal with that code anymore. Switching jobs++ )

hello there

jottinger please, wher do i must to start ?
*where

Clown-MG: the java tutorial
really

hehe

Clown-MG, #java-br

Hi! Using a Servlet 2.4 engine, can I access a session bean used in a JSP from a class implementing HttpSessionListener?

joaop obrigado
thanks

the sun java hosting tutorial got me going

(i.e. I have a jsp host page which uses a session bean to store some information, and as soon as sessionDestroyed() is called in the session listener I wrote I'd like to clean up a few things in my session bean containing the session data)
thanks in advance for any hints/pointers/google-keyword-hints

of course you can
I'm a little bit confused as to why you think it can't

simply by retrieving my session in sessionDestroyed I guess, but how do I get an object containing the specific bean I use then?

are you not storing a reference to it in the session?

well, I think it should be possible, I just don't know how
ah, that would be wise of course
how would I do that ideally? a hashmap containing a reference to the bean?

erm
why not session.putAttribute("refToBean", beanRef);

ah, that sounds much better
thank you very much

i hope today goes by fast
ok i either need to score a 3rd monitor or i need workspaces for windows

get rid of windows ;-)

wish i could
i was actually told they would never allow a mac on the network

hey people! and especially java programmers )
is there anybody having experience with CA?
certificate authorities for SSL?

jchauncey, O_O strange place… how about a linux box?

doubt a linux box would fly either, the it guys here only know how to fix windows machines =
~tell progreSSive about anyone

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

well, the problem is, i have created a certificate (a not trusted one ), and my client, while connecting to my web-service, is throwing an exception "javax.net.ssl.SSLPeerUnverifiedException: could not verify peer certificate:"
do you, people, know how to overcome this?
or how to add the certificate to the trusted-certificates list?
i've tried everything, i've read all the documentation on the "keytool", added the cert. to my java cacerts trusted list, but still the same problem )
or maybe you will suggest me any verified and cheap CA to buy a trusted certificate from!?
so, any suggestions??
here you go.. silence

hm, this is weird

foos = someobject.getFoos(); for (Foo foo : foos) {..} compiles, but for (Foo foo : someobject.getFoos()} {} complains that it expects type Foo instead of Object and points at the getFoos() call

and I cannot reproduce this with a simple example

?

yes, otherwise the first example wouldn't compile, right?-)

is it a typo that instead of a ")" you have a "}" at the closing end of your foreach,

no, and that would mostly likely cause a syntax error
the parens match properly, too

okok, just checking.

show us the actual code and the actual error. put it up on the pastebin.

yes, I'm in the process of minimizin this

getFoos most likely returns a Set rather than a SetFoo
The compiler will implicitly cast to a generic type in a number of cases, but the foreach loop isn't one of them,.

yes, that's what I thought - however it's specified to return SetFoo
specified in the source, I mean

Oh well. I'll wait to see your code before I comment further.

ha

Does anyone know which virtual keycodes in KeyEvent are the two Windows keys?

couldn't you write a small application that print out the codes for pressed keys and just check?

I missed the fact that someobject is an instance of BarT, but the someobject variable is only typed Bar
for some reason the genericity of the type causes the error, but I don't understand, how

Logi, that doesn't tell me the name of them

I'll post the test case

Bonjour.

Mixing erased and unerased types is black magic. Don't do it unless you Know What You're Doing.

Oh, there's a VK_WINDOWS in Java 5, that helps

indeed - I guess I should read up on the rules again too

is there some book which teaches me J2EE and websphere ?

hi all. Can somebody recomend me a good introductory book about j2ee. I already know java well. thanks in advance

http://rafb.net/p/FoMN2W33.html if someone wants to see the error for himself

hehe, we make a tag team

ah, right

yes DaBonBon… would you like to go to the bookstore with me

Found them in the Java 5 docs, I was looking at 1.4.2, thanks

it was nothing
literally

if you're in india, cool !

i'm in Uruguay

:-/

Can anyone tell me why, when Sun adds new API's to the language, that Sun does not typically rewrite internals of existing functions to utilize the newer ways of doing things?

so, any preferred books on j2ee ? using websphere would be an icing on the cake
MarkT-: err.. few sun employees you'll find over here, i think

MarkT-: Laziness, backwards compatibility, sheer size of the existing API.
MarkT-: Also I would guess that the people adding shiny new things are not the same as the people maintaining the existing APIs.

http://www.amazon.com/Beginning-Java-EE-Novice-Professional/dp/1590594703/ref=pd_rhf_p_2/103-3820306-5643832 and http://www.amazon.com/Sams-Teach-Yourself-J2EE-Second/dp/0672325586/ref=sr_1_18/103-3820306-5643832?ie=UTF8&s=books&qid=1187790523&sr=1-18

I've been perusing the source code for the JDK, and I've noticed that even long-since deprecated functions are still being called by other ones in the library.

thanks I will take a look….

MarkT-: of course, backwards compatibility

MarkT-: Feel free to submit a patch.

~openjdk

cheeser, openjdk is http://openjdk.dev.java.net

hello, is there some lib to make managing ssl/network connections easier? (trying to program a daemon that listens on a port and waits for our door opener to ask if access is granted - this happens over a ssl secured connection)

any hits
i really wish i could find some websphere + j2ee book :-/

can i ask a weird question about inheritance?

sure

MarkT-: Anyway, I don't mean to belittle your concerns. It's annoying. But there's not really a good answer other than "because" in most cases.

ok, say you have a class with a method, say it's called "sharedMethod()"

(Well, unless Sun have Deep And Important Reasons which for some bizarre reason they've neglected to tell me)

it's used by the subclass, and it calls another method called "uniqueMethod()" which the subclass overrides

you work for sun ?

the superclass has its own uniqueMethod() it calls
when sharedMethod() is called from the subclass, will it call the overrided version of uniqueMethod() or the original?

MarkT-: The deprecated stuff isn't going away (unfortunatley, as some may say). So changing wel-tested working and known good code just becauses it uses a deprecated method doesn't sound like a good way to psend ones time.

it will call the overriden method

No

when sharedMethod() calls a method it'll call the superclass' method, because it's a method of superclass

with 'public class FooT extends Foo', I can demand that 'T' is a subclass of Foo

that's what i think though .. i guess trying yourself is the best solution

(i.e: it will use the method that belongs to "this")

ahh, thank you

can I also do something to demand that 'T' implements some interface?

The "for some bizarre reason they've neglected to tell me" part was sarcasm intended to convey that I'm not exactly privy to their inner decision making process.

hehe ok
because if you did, i wanted to ask you for a book on j2ee :P

is there an easy way to do what i'm trying to do, have a common method call different methods based on its class?
i guess i could test for class.name or whatever

interfaces /

interfaces! ahhh

~tell tobins2 about inheritance

tobins2, inheritance is http://java.sun.com/docs/books/tutorial/java/concepts/inheritance.html , http://java.sun.com/docs/books/tutorial/java/javaOO/subclass.html and http://java.sun.com/docs/books/jls/third_edition/html/names.html#104101

have a common interface that declares that method, and all your classes implement it, DRMacIver ?

you can call a superclass method like this: SuperClass.this.method1()

It makes extending a class that might want to override and extend the newer way of doing things more awkward

err, i meant tobins2 and not DRMacIver

???
Either you seem to be confusing inheritance with inner classes or I've missed something serious…

thanks, that's a good idea, i never use interfaces really, this will be a good chance to learn them
bthanks, that's a good idea, i never use interfaces really, this will be a good chance to learn them/b

tobins2:
any hits ?
found any suitable books ?

On a slightly related note, is "Real Soon Now" slang for "when hell freezes over"?

i'm searching open books now. But i don't use websphere…
if A extends B then, in the context of A you can say B.this.method()

ok, but if you find any suitable on ee please tell me

is that the same as super.method() ?

yes is the same and you can do super.super.super things

this.this.this.this

No you can't.
You're confusing inner classes with inheritance.

I'm taking a look at http://java.sun.com/javaee/5/docs/tutorial/doc/

This only works for enclosing classes.

yeah i tried it too, but it was a bit slow and not captivating

oh then tobins2 nevermind. sorry my bad
yes and they use "Sun Java System Application Server Platform"

See, yet another sign of the need for proper closures

~tell MarkT- about rsn

MarkT-, rsn is real soon now, otherwise known as 'never'.

MarkT-: They were supposed to fix the NIO API to use covariant return with the advent of Java 1.5. Guess what we're still waiting on…
bMarkT-: They were supposed to fix the NIO API to use covariant return with the advent of Java 1.5. Guess what we're still waiting on… /b

in emule I have found IBM_WebSphere_j2EE_app_devel.pdf

can you please download it and pass it on to me ?

is that a free pdf?

if it's not too large

it's about 11mb

http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=FFW&q=IBM+WebSphere+j2EE+app+devel&btnG=Search

I don't know/care

i do. any warez in here and i'll ban you.

when you cancel() a TimerTask, does that block until the TimerTask's run method completes?

take a look at: http://www.gayanb.com/free_j2ee_books.php

Can't be bothered, as it doesn't really affect me. I rarely use NIO. I just use it as a commentary on Sun's slowness.
If I were set up to contribute to open JDK I probably would. But I'm not, and I don't really feel like doing so.

thanks cheeser

then stfu with the whining. 8^)=

thanks sgx___ , i'll see if i can find that book on emule myself

I'm "observing" rather than whining.

ed2k://|server|85.17.52.92|5000|/ is the server I used

ok, looking

ah. semantics is the game is it?
8^)=

Yep. Semantics is the study of meaning. And your meaning is wrong.
bYep. Semantics is the study of meaning. And your meaning is wrong. /b

How to hide String in java so that ppl won't see the content of the string when decompile.

you don't
so don't put passwords/private keys in your code

but I want

~tell poguy about sol

poguy, sol is Shit Out of Luck - in other words, no chance.

Uh…

well there are some java .class file obfuscators
try those ?

nope

Try the Java Cryptographic Extensions.

you can't obfuscate data values in code like that.

You can use symmetrical block encryption for that.
~tell poguy about JCE

http://java.sun.com/products/jce/

So here's what you do: write a Java class that encrypts/decrypts the code, and a custom class loader for the rest of your application. The custom class loader will load your sensitive classes and decrypt them in-memory.

but you'll still need to keep that key external to your system.

Yeah, but he can provide some external way of authentication, like a password (lame) or a biometric reader (better) or a combo pack.

that too much

Well, you wanted obfuscation, you have to be professional.

oh, i thought there existed some .. no idea

You also have to set the JVM extended options so that no memory swapping to disk occurs.
Check these out:
~tell poguy about JVM options

poguy, JVM options is http://blogs.sun.com/roller/resources/watt/jvm-options-list.html

Otherwise you risk exposing the keys or plain text to the public — not a good thing. So keep the whole thing in RAM.
You'll need some JNI extensions to disable the OS from mounting external file systems, like USB, Firewire drives, or USB keys.
That will prevent someone from introducing a sniffer for your sensitive data in the system.

or you could just ship them a custom built machine with a custom OS and VM with no external interfaces.

Last, disable all networking for your application through a firewall. You don't want any data going out.

i mean, to be *truly* secure.
8^)=

for … write a Java class that encrypts/decrypts the code, and a custom class loader for the rest of your application. The custom class loader will load your sensitive classes and decrypt them in-memory…. WHERE do you hide the key?

in your pocket?

In your pocket, in your head, use your thumbs or retinas, etc.
Lots of ways to keep the key secret. Technically, though, you'll need TWO keys: something you know and something you have.

on a CD that is also encrypted and password protected and locked in a vault

jchauncey++

jchauncey has a karma level of 1, pr3d4t0r

I see you're getting it. Another security expert is in da haus!
May I send you a private message?

at my college the person in charge of maintaining the socials had all kinds of crazy things he had to do to keep them safe
sure

Well, I've seen your work here and I'd say it's pretty secure.
jchauncey is very modest.

Just your everage paranoid geek

He's better at security than me.
The class loader will be easy.

it's the C2 certification that'll kill you.
8^)=

Also, encrypt the classes AFTER jar compresses them.
That reduces redundancy in the plaintext and makes your code less vulnerable to an attack.
So this is how it'd work:

Sensitive.class

just sue people with the dmca if they reverse engineer your code /sarcasm

I think that would be a good /topic for a thesis.

agreed

what's the C2 certification ?

and throw in a one time pad for added security
just make sure your build the perfect random number generator

   Heh

wow, great to see what sarcasm a simple question can induce .. regards, poguy
bwow, great to see what sarcasm a simple question can induce .. regards, poguy/b
bye, bbl ..

Well to the rest of us, that looked like joed laughed and was booted….
Well to the rest of us, that looked like joed laughed and was booted….

Heh

well just booted, not excommunicated

He liked it!

Yeah at the "perfect random number generator"
Yeah, I needed to wake up.

Anybody there know whits Free Java Dev. program I need to download on my linux ? sorry for my bad english

It was whatever characters you generated — they messed up my display

Hehe, it was actually just from a normal Colloquy window

cute.

Anybody there know whits Free Java Dev. program I need to download on my linux ? sorry for my bad english

heh

Long live irssi!

[TechGuy]: irssi doesn't do split windows like WeeChat

The JDK? java.sun.com

~tell Selveste1 about downloads

Selveste1, you can find the latest JDK and JRE downloads at http://java.sun.com/javase/downloads/index.jsp. Look under "Previous Releases" for older versions.

Hrm. I'll have to ping my one friend on that.

[TechGuy]: Check out WeeChat. Very nifty.

But slightly buggy.

[TechGuy]: irssi/vim = WeeChat/emacs

irssi splits windows very nicely

Not horizontally, only vertically.
You can't split your windows into quadrants in irssi. Only into bars.
s/bars/bands/

indeed. that's not enough for you?

instead of vim/emacs wars we are now going to enjoy an era of weechat/irssi wars :P

haha
cgi:irc !!!

I think I'd go bug-eyed trying to track channel quadrants in irssi

No.

pr3d4t0r, lawl!

~pastebin

http://rifers.org/paste

wait, who won the vim/emac war? definatley vim right…

don't go there

the flames still burn

See pr3d4t0r's post at http://www.rifers.org/paste/show/5304

http://www.rifers.org/paste/content/paste/5304/image
That's what my irssi window looks like.

dear lord…

Can someone explain why my jar file doesn't run?

with event listeners how do you get the flow of your program in one place, seems silly to have them all get back to the main class somehow when they could just do their junk and pass on to the next class in the flow… whats the norm?

shing`: only if you explain what the error is

whaley, there is no error, it doesn't do anything.
I tried a basic Hello World program, running in console, and nothing is outputted.

Hm

shing`: does your manifest file define a main class?

whaley, on the last page of the Eclipse export window, it said Select the Class of the Application Entry Point if thats what you mean.

shing`: yeah, if you are using eclipse, that would have done it.
shing`: you are running your jar via a command like `java -jar yourjarfile.jar` ?

whaley, I just double click it in windows

Oo

whaley, java -jar works in console, but is there a way I can get it to display a console when I double click it

shing`: run it via the command line, so you can actually see any output… chances are your console window is just dissapearing after the program exits

whaley, java -jar works in console, just typing test.jar doesnt

shing`: that's expected

console windows don't apply when running a JAR with javaw (e.g. "double-clicking them")

oh.

~[TechGuy]++

[techguy] has a karma level of 43, whaley

~[TechGuy]++

[techguy] has a karma level of 44, shing`

ty

thanks for that… we would have gone in circles because i haven't encountered that before :-(

interfaces only have method signatures?

First "tech guy" thats actually been able to fix anything for me

Yes

so are they just an OOP best practice, not really usable for getting rid of redundant code?

They're an OOP core tenant for enabling design contracts and allowing for replacable multiple implementations of a contract

you won't get code reuse by using interfaces… you will get polymorphism, however

ahh, thank you, i believe that's what i need, polymorphism

Perhaps you are rather interested in writing an abstract class

if i'm understanding correctly i have somewhat polymorphism through class inheritance, but do interfaces add like more capabilities to that?
if i understand it, an abstract class is one that you don't need to instantiate
like Math
Math.random()
i don't think it's what i need but i may be missing some of its value

not more… just the equivalent effect of just being able to refer to an object by its Interface and not its concrete type - analagous to the same relationship between super/subclasses

i'm having an issue with overriding a method that's called from a superclass method
i think the superclass method is calling the original method, not the overriding one?

is the method static?

hey, has anyone read "Java For Artists" ?

no
would that help?

did you put @Override on your method
no

i have a stack overflow that is happening when i need 6000 level recursion.. can i increase stack size?. or is there really an erro rin my method that makes it run forever?

don't put static on things unless you know what it means.
~tooldocs

cheeser, tooldocs is http://java.sun.com/j2se/1.5.0/docs/tooldocs

i already fixed it by not using recursion (but there is a corner case that i am ignoring)

@Override? i never heard of it?
i'll google it thanks

Sorry, you don't know the secret code

=(
tis ok

man, OOP seems like a simple concept at first until you get into these crazy things

Anyone know when "Consumer JRE" will be released?

concepts, no matter what domain really, seem simple until you actually try to apply them

i'm just glad i'm finally learning some of the things in java i missed in the past 5 years of using it

heh multiplication is a simple concept, but try telling someone how to multiply 2 two digit numbers. It is a lot harder than it seems

things like reflection, interfaces

always better late than never :P

.. interfaces ?

Damn girl….

so how exactly did you survive without interfaces ?

abstract classes

lots of ways
it's a tool i never had so i got along without it

You don't need interfaces really.
They're nice to have, but not indispensable. More robust languages than Java do without them.

certain parts of the language seemed just crazy to me, interfaces was one of them

thats kinda like saying its nice to be able to extend classes, but its not "really required" since copypaste!

in javascript, closures were crazy to me
confusing
java is so much nicer than javascript
except for Swing

oh, why is that ?

Swing?
i don't like it
but then again i don't really have a use for it
everything i make in java is on the server side
maybe i should use the GWT

meh, i rather have swing than make my own windowing system.

in JSTL

but there seems to be no cookie for me

requestScope.set…
iirc

I mean I want to check if this set contains a given number
not set something
c:if test="${mySet.contains(123)}"adaf/c:if

requestScope.set.contains(…)
though i'm not sure EL supports stuff like that.
thankfully i haven't had to do JSP work in a year or two now.

yeah I want to avoid jsp "scriptlets"

haha, JSP is my favorite

but I don't see any other way
it's pretty crippled

and you don't like swing? you're messed up.
use a taglib.

haha, maybe it's gotten better, i haven't used swing since like 2004

cheeser, which one

uh… you know you can write your own, yes?

plus back then i was a noob
now i code a lot better, but still learning

cheeser, yes I know but I only need "contains" in one place

so?

custom tags are so sweet

so I'm probably do a scriptlet anyway

that's what i love most about JSP

it's your funeral

?

cheeser, huh?

if you do, you deserve the hell you'll create for yourself.

There is nothing to love about jsp

scriptlets are bad bad bad

right

is there a Graphics2D equivalent to cairo's save/restore functionality?

haha, back in 99 winamp and napster made me so happy

good lord there's some java work in phoenix

phoenix?
there's nothing to love about swing

yeah, I'm supposed to be hiring a couple guys, but I took a look and I'm competed with a ton of companies for people right now
s/competed/competing

there's nothing to love about applets
well, some things

im more skilled in html/css so doing jsp work appeals to me more than swing =\

awe come on, the were fun in 96/97

same here
i love HTML/CSS
and getting more proficient with javascript
i think my problem here is that i was trying to be cheap and save a class
instead of having 1 class inherit from another class
i need to make 1 base class
and 2 subclasses

or maybe even an interface!

haha

haha, i could try
i still don't really grok it though
you have method signatures, but what's the good?

the fact you get the type, without inheriting the implementation
since that can be baggage

if i have a base class it'll be better than an interface though, no?

it may or may not be usefull or useless

because then instead of method signatures i can have actual methods
and those methods call other methods which are just empty in the base class

indeed, but also you force everyone to inherit form your class

tobins2, you can only extend one class but implements alot!

ahh, right… if i needed multiple inheritence
this is a very small program though

With full code coverage…

i won't need to inherit more than one class
wait, will i run into the same problem here, even with a base class?
i'm getting so confused with this one point, it's silly

what is your problem ?

method A() is inherited but the subclass, method A() calls method B() which has 2 different implementations in the subclass and superclass

i can't seem to find a save/restore [or similar] system in Graphics2D.. how does swing recursively render widgets [if it is given a single G2D for each OS level window or associated image buffer, and has to draw several widgets in it] without this?

which version of method B() is called from method A() in the subclass?
*by the subclass*
i just need to do a test
start a new project

well think about it this way

and do public class Monkey extends Animal
yes?

its just new layers on top of eachother
obviously you cant modify the layers before it, since if you did, they would break.

i'm not sure i understand

you can just override

you can't override the method and expect the new method to be called
someone suggested that
@override?

hi! does anyone know if there is some method to check if a JPA query is valid or not? (I mean the syntax is valid)

the new method wont be called from the superclasses, since they have their own method.

IDEA validates that for me.
and if you're using Hibernate and named queries, hibernate will validate at start up

yes but from inside the subclass, it won't call either right?
it'll call the superclasses version still?

if you arent overriding, it inherits it.

if the superclass calls a method that's overridden, it'll call the overridden version.
but only if the object is of the overridden type.

hmm, this is confusing

i.e., an A will only call A's methods.

yeah i know, but I've meant dynamic queries

B will call B's method?

but if you override something in B, those calls will use B's versions.

ahh, that's what i need it to do

in practice, I find little use for named queries :/

but i got scared
unsure of it

Hi i'm new to java ! I'm looking for functions that will scan or dir the files over a certain directory?

in practice, then, perhaps you should take a look at how your structure your system.
8^)=
~tell alexseif about javadoc File

alexseif, please see java.io.File: http://java.sun.com/javase/6/docs/api/java/io/File.html

~tell alexseif about io

alexseif, io is http://java.sun.com/tutorial/essential/io

but now, do i need to use @override or do i just write the new method with the same name and params in the subclass?

cheeser im starting to think you have that stuff scripted

using @Override tells the compiler to verify the original method exists

what do you mean?

Thank you , I'm just finding it hard to browse through the documentation while I'm still a rookie, I already looked through java.io

ahh thanks

i mean we use the hell out of named queries.
only rarely do we not use them.

alexseif, new File(dir).list();

gr8 thnx!

my problems with named queries: no way to adjust the sorting dynamically, no way to filter dynamically

i still think i should go with a base class and 2 subclasses just to make this code cleaner
it's too confusing

what is ?

having one class inherit from another and they're both in use

is there a site where I can browse the functions ?

i'd rather have a base class that is not used with the common functions

arnt named queries safer as well?

what functions?

seems clearer to me

yes

java functions in general

Howdy

java has no functions

sorry, methods

http://java.sun.com/javase/6/docs/api/

but to browse you want, yes the classes and interfaces

yes

java has some of the best docs of any programming language

I'm sorry I said I was a rookie

thankfully that passed
or are you still a rookie O_o ?

I don't understand
he he

~tell alexseif about RBI

alexseif, RBI is http://java.sun.com/docs/books/tutorial/reallybigindex.html

Anyone know when "Consumer JRE" will be released?

Runs Batted IN

hmm, where can i read up on what "mainloop:" does ?
never encountered that before..

how can I chmod a linux file from java?

yes I read that stuff, I guess I'm just used to C++ and php

mainloop: ?
bytecode stuff?

cheeser, im not sure to be honest..
it is present in a run() method i am reading..

Sounds like bytecode
oh wait…

I'm thinking turning over to JAVA for job opportunities any pointers

run() {mainloop: while() {}}
basically

EWWW
labeled breaks, continues, gotos, etc

I'm using netbeans and the java doc from the official site
and I have the java 2 complete reference

alexseif, that's good, the javadocs are nice

nay, java has no pointers.

netbeans is my personal fav too, but lots of people like eclipse and intelliJ IDEA

dont use an IDE when learning java..

lies. Use ide when learning java.

learn java using console and an editor…

yeah, that's how i learned

I guess I'm not familiar with packages and classes yet
but the RBI someone passed is helping

just dont use ide when learning how to compile, and how to use buildsystems :P

maybe get a lightweight java editor with syntax coloring

or rather make sure you understand what the IDE does for you if you insist on using it..

Will java ever see optional parameters like lisp has? Would it even be worth while?

ahh, like javascript too

I have eclipse but the netbeans seams more powerfull

Woflborg, well i can argue that codecompletion dont really teach you how to properly use the methods,

emacs!

i found netbeans to be simpler
i like it, and it'll help you learn, but you may at times find yourself fighting it

yes it sorts out somestuff I'm not familiar with
problem of every IDE and lazy human

if you run into trouble with it, you might consider going to command line to compile

how do you mean, it displays generally the javadoc page for the method.. what else could one need to learn how to use a certain method ?

no offense

Woflborg, depends on your ide i guess but sure if yolu actually read the javadoc then its decent

I agree with loesh but I don't jave time for that

a good newbie ide to use is jgrasp
if your just starting out

one thing people often run into with netbeans is that when you have files you want to write or read from, it puts it in a directory like Program Files/netbeans
which is stupid IMHO
it should go in the root directory of the project

no my problem is with examples

That /is/ craz
y

i could argue that if people arent reading what the javadoc says, they are going to meet quite a bit of errors in a hurry..

yeah you can change it but i always forget where the option is

since I don't know the building directories stuff well enough I don't know how to preview an example in the netbeans

read the doc

in that case you should really compile on the command line

I downloaded a couple of source code from source forge, but I use the notepad to see them

do you know how to use javac to compile .java files to .class files?

yes I tried it a couple of times
but not enough

isnt that more of a question of not knowing how to use netbeans, how would it help him to gain more knowledge on manipulating projects in netbeans… by using commandline ?

well it won't help him learn netbeans, but it'll help him get examples running faster

I know you javac from .java to .class
and then java your class

yeah

but that doesn't set as much directories

how do you mean set as much directories?
like you have inner folders you want to compile?

he probably means it doesnt work like the build system in netbeans..

ahh probably

well in netbeans you have like 6 folders after you compile and run
and is the source code from the stuf I dowloaded
I try new existing project and errors come out
undefined symbol and stuff

netbeans is simple enough, you just have to plop the code in the default package or plop the package in if it's in a package

indeed, its simple once you understand what packages and such are.

I gues I'll get the hang of it in a while
ok here is a question

i have a project started in java 1.4 and use xerces/xalan/xml-apis, java5 supposedly uses them, which jars can i get rid of?

when you start to make an application and you want a form you use a class or package

a package is basically like a folder
i'm not sure what you mean by "a form"

form with buttons ( desktop applications)

oh, that would be a class inherited from javax.Swing.JFrame or whatever
you need to use Swing most likely to make GUIs

heya soulreaper_

yes i know that netbeans opens up a package and then I make a seperate class from the wizard with a form
but the main class is in a package

what ftp clients do you guys use?

anyway thanx a lot

winscp

ahh, i never used any of the GUI creation tools

ssh

i don't really make desktop apps

how can I set permissions (equivalent of chmod) on a linux file from java?

Runtime.exec(), jbellis

no native alternative?

same here, SSH

that *is* native.
but no, there is no pure java approach

k, tx

on linux i use gftp

filezilla

hi Sou|cutter

ooh, i have to try firezilla

on linux (its still a beta, but it works fine=

i try to try as many mozilla and google products as i come across
i heard a rumor a while ago google wanted to buy opera, did that ever happen?

http://filezilla-project.org/nightly.php

who would want opera

opera's ok
better than IE

ie is magically looking more and more like opera by the year..

most browser are better than ie

new ie is ok though

hell, even ie has tabs nowdays

but i prefer firefox

does IE 7 block google adsense ads?

It don't have to be good, just to be better then IE

hmm, maybe that's another reason to switch to YPN?
if it doesn't also block those
it doesn't even block them nicely, i just have white squares on my black page
hmm maybe that's another reason to switch the background to white?
haha, no, i'm silly
love web dev though

Do anybody knows to this program netbeans ? it looks god !

You want my job? I hate it.

sure, i'll take it
i'm unemployed now

Well, I hate the front end sort of stuff…

almost done with my B.S. in comp sci

I like designing custom components and such

JSF?

About to start mine
No framework :-(

ahh, hardcore
i like it

I tried to push JSF on them, but couldn't get them to adopt it

but lately i've grown respect for frameworks and leveraging the work of others
soon i'll be cured of my NIH syndrome
Not Invented Here

hehe

I've been exposed to the code NIH-syndrom has generated at my current employer, and that has effectivly cured me of any such tendencies

wlfshmn++

wlfshmn has a karma level of 7, cheeser

haha yeah, that's one thing they can't teach you in college
but hopefully from my own projects i'll be almost cured of it by the time i actually enter a work environment

opera was a good option on linux for quite a while, before mozilla really started up
It was that or netscape

I'm so glad we have firefox now :-)

I did it the other way around.. I'm taking up college again after wokring for a bundle of years

I need to hurry up and make my first million before I get too old… I'm already 20!
I should have made it 2 years ago…

ahh, that's probably better, get a lot more out of classes that way

wanna know the secret to getting that million?
i learned this from warren buffet.

haha, sure

start with $1B and buy an airline.

haha

at my school they stress us out so much with programming that a lot of what you learn is just time management and how to deal with pressure

valuable skills though

but being from the working world you'll already know that and can focus on the real learning
yeah probably the best things i learned
so it is real learning
but on my own time i learn more about code than i do in class

I would like to say I choose this order due to some smart choices, but frankkly, I was just sick of school, did an attempt to get motivated, spent a yea rin college, realized I couldn't take it, and went to work instead

you probably got into at a good time, during the tech boom?
i got into computers only in 2002
so school was essential
at first i was only going to go for an associates degree

college is for fundamentals and sciences. specific languages and such are going to be obsolete, or have changed singificantly, before one graduates anyway.. it's not like I currently use a single sliver of my specific language skills I had when I started working, in todays
projects

but i loved it so much i transfered, essentially lost 2 years of my life, and now i'm almost done with bachelors

I started working in 2000, before the worst of it hit, and the job remained stable although the company got resized and bought up

yeah when i was a freshman in 2003 they taught us java, now they teach them python
also when i took web programming in 2004 there was no javascript, the teacher hated it, the next year came the AJAX craze and he started teaching that
or was that 2005?
i don't know, but i was like ahead of my time
i used some cool javascript tricks in my project before AJAX was a buzzword

well, there, "web programming" sounds like a typical course that maybe shouldnt' be taught at uni, or as an elective at most, sinc eit sounds like it's going to have a short expiration date

actually i think it was internet programming
but it was all about the web
JSP, XML
HTML CSS and XHTML

imagine looking back at your transcript in ten years and thinking "Which of these skills are still usefull to me today?"

no javascript though
that was one of the best classes i took
that, software engineering
which was like databases + web stuff
yeah, databases too, i learned a lot from that
useful stuff
but all the assembly language stuff i doubt i'll ever use again
in my last semester i'm taking compiler design

if web-related techniques are used as tools to teach more fundamental skills, that is fine though.. it's just teaching narrow skills I dislike..

i get to learn how to use javacc

anyway, I should be heading home…

ok later man

must you use javacc? oh i guess so for your course… I like SableCC personally

yeah, they tell us what tools to use
i might actually drop the class, it's scary

~hotspot

g[r]eek, hotspot is Sun's JVM http://java.sun.com/docs/hotspot/
g[r]eek, hotspot is Sun's JVM a href="http://java.sun.com/docs/hotspot/"http://java.sun.com/docs/hotspot//a

i might take principles of programming languages instead
which is like java prolog python and SML or whatnot
supposed to be easier
lots of little projects instead of a few huge ones
also i can start learning that stuff now
prolog
such a pain
write a text calculator in java that parses expressions
without using expr
or whatever
then change it to use postfix notation

there isn't an expr() in java.

oh, that's javascript
eval() ?
i forget
i'm confused
anyway
computers are fun
programming is the best thing to me
it's like a game
the best game ever
it's like second life but better

computers are not fun, and programming isnt either… wait till you get in the real world

~punctuation

joed, punctuation is hey, everybody loves it when you correct their punctuation, so give a helping hand!

hehe, hopefully it'll stay fun
you got burnt out on it?

I can think of worse professions than computers/programming.

not burnt out yet, havnt been out of college long enough. So can I, and I have done them. But staying in a cubicle all day sucks and having managment that has no idea what is good design can drive you insane.

good days / bad days just like anything else

that way it'll always stay fun?
maybe it's how prostitutes feel about sex

hahaha
i'll have to get employment some time.. and it'll probably be programming.. so maybe it won't be fun for long

lot's of suckier jobs out there
*lots

i'm seriously thinking of moving to a cheap apartment and getting a part time job that gives me health insurance and just programming as a hobby / second job

yeah i wouldn't mind that kind of lifestyle
i'll probably be doing something like that soon [sharing accomodation with a few friends, working in some kind of shop, or maybe computer repair]

that would be awesome
do hardware work during the day
programming at night
ever see the movie Primer?

nope

you should really see it
it's one of my favorite movies

[remember to reserve some time for partying and juvenile activities!]

haha, smoking pot and programming all night
doing LSD and writing LISP code at Berkeley
all night LISP coding sessions, fueled by LSD

bahaha
that could be interesting
coding stoned gives surprising results

haha i like it
i don't like smoking around people, i get nervous

guys please take this conversation in private

but when i have work to do all by myself it's perfect

once i wrote the foundations of a UI toolkit stoned, woke up the next day, thought "wow.. does it actually work?" and it was all fine

haha, nice

g[r]eek: hey it's a genuine coding technique!

we were only off topic for a couple minutes
we'll get back on

so.. does anybody know how to do cairo-like save/restore with Graphics2D? or how swing gets around the lack of it?
[3rd time lucky?]

cairo-like?
is cairo a program?

it's a graphics library
[written in C]

cairo is a software library used to provide a vector graphics based, device-independent API for software developers. Cairo is designed to provide primitives for 2-dimensional drawing across a number of different backends.
ahh ok
i don't know much about that stuff, sorry
i know how to generate PNGs
using Java
but that's all

haha
i'm pretty into 2D graphics at the moment

do you know anything about 3D graphics?
specifically UV mapping?
actually, i found the formulas i need i think

none at all really [except a little raytracing]

ahh yes
i was trying to make a web-based program to take a 2D image and turn it into a UV map
for use in Second Life and other 3D environments
but screw it
maybe you can just save the ColorModel or whatever that holds the pixel data?
or are you looking for a quicker solution?
bah, i cannot help you, sorry

a quicker solution.. save/restore is just a way to save information such as clipping and current colour, then restoring it later.. it's mostly of use for GUI toolkits i guess [where you have objects inside objects inside objects]
damnit, why can't java be smalltalk
i want 1) closures, 2) spare memory and 3) java

guys - who has experience with webservices?

hi pr3d4t0r
pr3d4t0r, still doing some cobol, no?

actually he's hunting aliens after that grand opening …

lol

Cobol - C w. Object Business Oriented Lexicon.

gimmeh random program idea

a program to generate random program ideas

Aftermath_ a program to read all directories on your harddisk.
and list it neatly

just tree /F

but its not .html

that's an idea :o

No.

Aftermath_, create a class name Ideas, then a random method like math

thanks a lot

I haven't touched COBOL since 1987 or so. And back then I learned only one instruction: CALL.

hoho

lol

pr3d4t0r, he he, was kidding my friend, lol
JavaCobol

oh I am afriad to google that

me 2

It's "too", not "2".
~tell freddysatellite about aolbonics.

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

~tell freddysatellite about Java literacy.

http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=469758086_051b1dd752

pr3d4t0r, i support that
came from other channels that encourage that

dude, my boss
he's a nice guy
but for 2 months this new guy started
and doesn't hvae an email address yet
and he needs it to do his job

haha!

and my boss has been told at least 6 times that he should set it up. Every time he's going to do it right away.
he doesn't understand the concept that 2 people working on is better than 1. if I were a boss, i'd prioritize the tasks that prevent others from doing work of anything else

*yawn*

Kill him and take his job?

that'd work
but the email password would die with him

I have a more laidback approach to chatting… I can socialize no matter the IQ of those I interact with… http://www.teralaser.net/cm/displayimage.php?pid=148&fullsize=1 :P

i'd set it up myself if it didn't have a password

you allow small creatures to crowd around you and fornicate with each other?

Offer doing it for him?

Yeah, I know … their tails shows they are not doing it really, though…

haha, didn't notice that
The girl in black does though

~persistent

joaop, I have no idea what persistent is.

~persistence

joaop, I have no idea what persistence is.

heh

i guess i'll do that
is tss down?

hrm really slow

ah now it's fast

i have a stack overflow that is happening when i need 6000 level recursion.. can i increase stack size?. i cut down some of my ussage by making sure i had less invakes per use.. but now i reached a new thing i need to process a little larger

~tell dmiles_afk about jvm options

dmiles_afk, jvm options is http://blogs.sun.com/roller/resources/watt/jvm-options-list.html

you can increase the stack, but 6k frames? that sounds a bit ridiculus? can you not rewrite your code?

thanks awesone url
i rewrote a little but to use a local variable for the "next" operatoin.. but there is one that i just cant seem to do that with

hi everyone
after an ajax call, how do you read the POST variables in java
i usually do get requests, so i jsut do request.getParameter
but this doesnt seme to be working for POST data
how do i read post data in java

ok -Xmx1024M -Xss16k -Xoss16k seemed to actually make it come earlier .. strange

post calls should work regardless with getParameter. Make sure your action is set to the right url

k thx

also you could try iterating over all the values sent to see if it is sending a null value or what exactly is happening

i think my params string might be wrong
cus in firebug it just shows the parameter string instead of listing the params in the post tab
the syntax is field1=value1&field2=value2 ect.. rite?

right
are you using input tags to submit data?

no im reading the data manually before sending it
and verifying it
with a submit butotn
the submit butotn does an ajax call instead of a form submit
cus the data requires some maniuplation before sending

ok so you are building a string and then sending that string to some processing page?

yea

using a jsp page to do the processing?

no the processing is done by a java page, im using struts

ah k
ive just always used a hidden iframe and submitted the data to a jsp page which is why i was asking

yea i dunno i think its definitly my params string syntax is off

Hello
Do you know how I can have a list of all nodes with jaxp?

it would look something like this something.jsp?param1=value1&param2=value2

you're doing an ajax call because the data needs manipulation before sending? Why don't you do that in your controller?
or in your model, depending
doing it in ajax is *probably* dumb and might be a security risk since I could use a program to send the data directly

~spring

joaop, spring is a Java/JEE Application Framework - http://www.springframework.org/

how do you run a .jar file?

~tell pianoboy3333 about jar

pianoboy3333, jar is Java ARchive. See http://java.sun.com/tutorial/jar and http://java.sun.com/javase/6/docs/technotes/guides/jar/index.html for more information. Also
see fatjar

"java -jar foo.jar"

I just downloaded azureus as a jar file, but I'm not sure as to how to run it
ok thanks

but that only works if the jarfile is runnable…

ok

Is FileInputStream.read super inefficient, even with a large byte[] buffer? I'm seeing 4000ms to read 5MB locally (w/ a 128KB buffer) which seems horribly slow

ok… it's not runable, now what do I do?

read the docs for the program…

thanks

FileInputStream.read(bigByteArray) is efficient

there a way to use a tray icon in java?

nope

reading 5 MB ought to take about .4 seconds if your hard disk has a speed of 60 MB/s (about normal for standard desktop), if the file is buffered you can get way faster results though…

not that i know of

so you see why i am puzzled

~tell AustLaw about javadoc SystemTray

AustLaw, please see java.awt.SystemTray: http://java.sun.com/javase/6/docs/api/java/awt/SystemTray.html

4s seems a bit long, yes…
since I do not see what you are doing it is hard to say what other silly thing that is taking time…
you may also want to look at the SystemTray info javabot gave…

i stripped everything else away
byte[] buffer = new byte[128 * 1024];
int bytesRead;
while ((bytesRead = fileInput.read(buffer)) != -1) {}

read the topic regarding pastes…
test case in pastebin?
how do you time it? the jvm statup time can be something like 3-4 seconds…

currentTimeMillis, so jvm startup is outside timer

how should one adjust the preferred size on a JPanel that they are drawing on since it won't have a layout manager?

Comments

im running jar from bash and using the -C option and also trying to specify all class files with * eg jar cfm

Management beans are 'defined' (e.g. identified) primarily by their name - they end in MBean or MXBean. What the fuck is that?!??? we don't do that in java, dickweeds. We use flag interfaces for that, have done for years.
Agrajag-: you can open them as InputStreams.
Agrajag-: Why would you want to address them as files? Normally java finds its class files in any of many ways. From directory, from jar file, over the network, generated, etc.
Agrajag-: and as far as directories go, no, it is completely impossible to do that within the existing java servlet hosting framework. You can only query resources, not contents of directories. You'd have to ship a file with a known name
that lists all other resources if you want that.

i didn't mean class files, i mean other files like media - pngs and such

Agrajag-: I'm aware of that, but do oyu understand the difference between a File and an InputStream?

yes

Agrajag-: one is limited to physical files. The other can be from any reasonable source - be it a jar host file, the file system itself, a database, network, generated, etc.

yep ok

Agrajag-: right, so my question is: Why do you need these to be FILES? Is InputStream enough?
because accessing files stored with your classes as INPUTSTREAMS - no problem. as files: impossible.

I think that's the least of problems with MBeans and MXBeans, though

Possibly. I'm working with them right now for creating some JConsole plugins, but so far I'm less than impressed.

because i'm using other packages that expect Files, i can't modify those packages. it's not necessary, it's just something i thought would be nice to do - so that i can just release one jar file rather than have to also package media directories and stuff

jconsole, that was impressive. the beans not so much
Agrajag-: then you're fucked.

nicely put

jconsole is impressive because of the user interface work, mostly

Agrajag-: if the programmers of those other packages were slightly less braindead when they wrote their methods this would have been no problem. I know what you mean though, a year or so ago I found an mp3 playing library that worked great, except the only input methods were either a string
(filename) or a File object. D'oh!

but *just* creating beans and automatically generating a user-interface for them seems to be a half-unsolved problem

I want to add a tab with my own stuff, and I thought it would be a good idea to transport the data from my jvm to jconsole using mx beans.
But even doing something as simple as creating my own Notification subclasses and including the class files for them in my jconsole plugin aint working. Shortsighted.

how would you have made the api?

using InputStream only, or if It was really important, a File and String-based 'helper' which just one-liners the creation of a new FileInputStream and calling the 'real' method (that takes an IS).
but the canonical method would always take an InputStream. Or a Reader if it was something based solely on character, not data, streams.
That mp3 library I talked about actually did that wrapper trick and then called a package private access method and never ever looked at the File object again. Talk about idiocy. So I hacked around it using a class with the same package name, but it wasn't really a nice clean solution.

i see
good to know for my api's
cause i often pass around File's

yeah. Don't do that unless the notion that it's a physical file is actually important. It almost never is.

yes, braindead APIs sometimes suck
I spent a couple of days hacking around the limitations of Ejb3Configuration of Hibernate

Agrajag-: You can actually copy the files to a temporary file then hand teh tempfile to your media libraries, but that's also not a very nice solution, especially not if the media files are large.

hmm yeah. it's not a big deal, just something i thought would be nice so that the packaging is a bit easier. i'll just leave them as real files in the filesystem for now

why did you have to hack around the limitations of Ejb3Configuration?

I wanted to load configuration from a location specified at runtime

you mean like persistence.xml?

the same information, yes

Agrajag-: In case you ever need to do this and inputstreams are acceptable, look into ClassLoader.getResourceAsInputStream

ok, cheers.

interesting. how did you manage to accomplish that? I also wish there was an easier way to specify the location of persistence.xml at runtime. Maybe an env variable or a better configuration api.

I load an empty persistence.xml from the default location for all the different runtime-configurations, to set up the initial Ejb3Configuration, and then insert all the required properties, entity classes etc. via the Ejb3Configuration methods

using the hibernate specific configuration api?

isn't that what Ejb3Configuration is?

yeah, I guess it is
I guess that would work. Not as elegant as just specifying the location of persistence.xml at runtime.

indeed not
or, as surial said, just being able to feed the persistence.xml as an InputStream

java isnt showing a loading bar for me

did you ask nicely?
yeah that would be useful too

this is about the browser java plugin, not neccessarily applets
the java logo doesnt show progress on its bar
i recently did a full security overhaul
could this have broken java?

~tell DarthJesus about applets

DarthJesus, Check the topic, read the Wiki… Essentially we try to avoid them

this isn't a java issue, it's a browser issue.

right now i am seeing if java hosting is blocked from tcp/ip

this would be local…
not remote

Are you running an applet or a Java Webstart application?

if java cant use tcp/ip it would explain why the bar is broke

What are yourunning?
Er, you running?

it doesnt show loading progress for either applets nor java binaries
i am running xp

Reinstall the JRE.

what would i use to reinstall it?

Start/Control Panel/Add-Remove Software/Java Runtime or equivalent.

you want to see if javaws.exe is blocked if webstart cant download things

first i am seeing if the JRE is blocked for tcp/ip right now

http://java.sun.com
a href="http://java.sun.com"http://java.sun.com/a

javabot tell DarthJesus about download

DarthJesus, download is http://java.sun.com/javase/downloads/index.jsp

that's the download site
(direct link)

has anybody ever come up with a good setup for inheriting and extending toString methods?

huh? defining a public String toString() method too good for you?

it's ok to just say 'i don't know'
but thanks for the input anyways

i'm serious. toString is defined in Object. it's virtually impossible short of making the class/method final or not calling super to NOT override/extend
s/override/inherit

I mean adding information to base class toString of course

return addExtraStuff(super.toString()); where addExtraStuff processes what the base implementation outputs and adds what you want

collect $75.

yeah hmm

http://eugeneciurana.com/pastebin/pastebin.php?show=3621

no wonder,, my hdd was full x.x

erm…

~r0bby++

r0bby has a karma level of 38, Fanook

right now i am literally uninstalling 100s of progrrams i no longer use
x.x

start with the porn :P

there is no porn o.o
nor any mp3s

…what the hell do you have on there

?

nor other audio/video

Is there a way to set up arrays (like you can with javascript) so you can do arrayName["test"] instead of having to do arrayName[0]?

programs and source code!

that's what Map is for

javabot tell dev- about arrays

dev-, arrays is http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html

who's trying to not override toSTring()?

meeper.

~wedgie meeper

mohadib, I have no idea what wedgie meeper is.

dev-: Not with arrays.
dev-: Look at hashtable.

hashmap

WHy?

pm

he never really gave a reason

i had 3 different usb wireless cards installed x.x

thanks pr3d4t0r

and we never ask

god damn it

s/we/I/

doing something in complicated in java that a database can do easy–

Huh?
~coffee tieTYT

a ha

i'm trying to make a report based off of header data and ip addresses

mofo print shop 22 is using 2.5 GB!!!

thanks for the update.

user-agent, isABot, unique-ip-addresses, unique-ip-addresses-by-first-2-octets-only

thats where all my space went o.o

ircbot?

user-agent, ip address
would you guys use java host to do this?

perl

##java isn't your blog, so we don't need a blow-by-blow account of what you're removing from the system.
Thanks.

cause i would prefer to use a database

I'd use awk

and how would that avoid complication?

Huh? It's worked since the beginning of dawn?
Otherwise, load it into a DB?

well you see, i already typed awk and it didn't solve my problem
nevermind i'm just pissed off

goodbye nearing 3GB of _CLIP_ART_
o.o

ignorelist++

i deleted 3 word documents and a mp3 today

3.7GB, free space: 823MB - HOW IS THIS POSSIBLE?
o.o
i just deleted AT LEAST 2.5GB!
is my hdd corrupt?

yes
id throw it away
right now!

start a blog, please….

i wish i had swordfights at work… http://xkcd.com/303/

lol

my blog actually has 5511 pages o.o

no doubt
and its all of 3 weeks old now?

how do i have a jtable that is not editable but selectable

look at the jtable api

actually its an 8 year blog

or check exampledepot

hi

sup

mt lattitude in about a week
my

thats fun
vista?

noe , moving
and its latitude
always thought it had double ts

i have double d's :P

Howdy all

yo

unit (scala) = void (java/c/etc.) ? what kinda silly keyword is that…
uunit (scala) = void (java/c/etc.) ? what kinda silly keyword is that…/u

im running jar from bash, and using the -C option, and also trying to specify all class files with *, e.g. jar cfm foo.jar Manifest -C bar/ baz/*.class - clearly bash isn't going to expand the * to include all class files. short of writing a script to generate a list of class files for me, is
there a way to tell jar that i want all class files in a directory?

a classpath doesn't include a .class file
it just includes the directory to find the classes.
~tell Agrajag- about classpath

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

i don't think you're answering my question..

ah, jar, not java. my mistake.

they sound alike

the number of times we get idiotic classpath host questions is boggling.
jar i believe functions just like tar.

I say we do away with the classpath altogether

so don't you just need to specify the top level directory?

not really, as there's files in other directories that i don't want
nevermind, i'll just do a script, i think that's the only way. not too hard anyway

I think you'll have to copy the files you want to a separate directory and tar from there
or jar, i should say

i'd actually use an xargs.
find . -name *.class | xargs jar cf foo.jar

ooo xargs…always forget about that one

ant++

heh. that too

hi, all. I have a question: Can I use jdb debug ejb in jboss? because I had read a little document about jpda, I don't like use IDE for test hello, hwo to use jdb for debug ejb in jboss?
thanks
who can help me?please
?

Where is fmod in Java?

fmod?

floating point modulo

%

that's not floating point.

I want to find a fastest way to r

er crap

i don't think java supports floating point modulo.

sorry

~tell r0bby about rif

r0bby, Reading Is Fundamental

~ridicule r0bby

Actually I just want to round up angles to the range of -pi..pi

hello, is there a regex guru here ?

~tell NeoEcoS about anyone

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

hi, guys, please give me a little hit? thanks

hylinux, did you ask in the #jboss channel?

had asked in jboss. but no body response me.

feel better?

Uhhh… My ideas is that. I first get x fmod 2Pi. If it's greater than Pi, -2Pi again…

why? mistake.

see http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/jdb.html

x+5×45z-3xy+6x, or 10 or x, or x34y23 ..etc

hint.

specifically, look at the -attach argument to jdb, I think that might get you what you need

No I hit you again, no mistake.

I mistake. about spell. it is "hint". ok?
hehe

and you'll need to add some extra arguments to your JBoss startup script

just ask your question.

I want to use jdb for debug ejb in jboss. how to do this?
I had made jobss run in debug model.
and I can attach jdb to jpda interface.
but how to debug ejb?
thanks

this is my pattern http://pastebin.com/d25c5e414 but if the string begin by x+anythings the program freezes

once you're attached to the jboss server, it should be just like debugging anything else using jdb

"((+|-)\d*(x|y|z))(\s*(+|-)\s*(\d*(x|y|z)))*" and no, i'm not going to explain it.

have a question, I had attach the jboss server, example: now I had a ejb named "helloword", so, can i run this bean?

Fanook, will you explain it to me?

no. go read the javadocs for Pattern

Fanook, is not necessary to explain it, :P

you'll need something that calls a method on the Bean. I don't know that there's any way to initiate that from the debugger. Just whip up a simple little command line program that looks up the interface and calls a method.

~Fanook ++

I guess the factoid 'be fanook' might be appropriate:

hahaha

Fanook, i was not so long from the Pattern

~Fanook++

fanook has a karma level of 29, joed

~joed++

joed has a karma level of 55, Fanook

or a servlet that you can hit with a browser, that calls whatever method you're trying to debug

ok. thanks. let me write a simple example for call that ejb.

that was priceless.

i'm fairly sure that was the first time that's been invoked by someone other than me

I don't think your regex is correct - it doesn't match 10, for example

which is why it's priceless…it was more the fact it was trying to increase your karma…maybe I have a weird sense of humor

from a unit : assertEquals(
"^.*\\s(19|20)\\d\\d([-/.])(0[1-9]|1[012])\\2(0[1-9]|[12][0-9]|3[01])(\\s+)(\\S+)(\\s)(\\S.+)",
m_factory.getForwardingRegexp());

ah, good point. need to add ? after the xyz groups

also the sign for the first coefficient needs to be optional

uh, yes. i kinda added that part last minute

haha mindCrime

cute saying

i've seen that posted here in the past

Pattern polynomyPattern = Pattern.compile("((\\Q+\\E|-)\\d*(x|y|z))(\\s*(\\Q+\\E|-)\\s*(\\d*(x|y|z)))*"); dosen't works

and that's only true if you're not a complete… nevermind I'm gonna be nice

wish I could take credit for it. I think it was jwz

also, I understood there were exponents in the required polynomials, but yours doesn't do exponents

I haven't bothered to learn regex

erg, yeah. the groups need to be expanded too
if it hasn't dawned on you yet, regex is a poor way to parse this kind of thing

Fanook, which other way i can use to do that ?
* can i use

i thought i would never say this, but StringTokenizer set up to return delimiters as tokens
string.split tosses the delimiters, and regex is really complicated, as you can see

Fanook, i like to learn regex, thanks by the help, will continue trying, will tell you if i got the regex working

Is there any reason for using float instead of double?

wtf is jusched.exe?

it's smaller
java updater scheduler

except for space?

none

oh i blocked it using my firewall

Good. So I think I can just use doubles

what is IeSHAz then?
or rather
what is IeSHaZ then?
iESHaZ - *
what is an antivirus channel on freenode?

I have an idea: it's probably the most inefficient: read it character by character and do a switch on the mathemetical delimiters +, -, *, /, %

Still too much to modify… Is there a way to automatically convert from float to double and back?

s/probably//

that's what i was getting at with the StringTokenizer. split on the operators, then parse the monomials

ah yeh
except, i wasn't going to use StringTokenizer *AT ALL*
just read the entire thing regardless

if t

pfft. easier to parse smaller things

If i wasn't so lazy, i'd type up a test case
and if this didn't scream homework

granted, StringTokenizer IS marked as obsolete, but this is one of the things it's better at than .split or regex

if i StringTokenizer, by + or - the regex for getting coef, and variables exponets works well
StringTokenizer never liked me
if prefer todo a String.split("+|-")

Fanook told you that may not work

do that and you'll lose whether you split on + or -

unless you split on +'s only and look for the -'s on your own….

agh… that's a real problem :$

what is the secure way to implement cookies in jsp?

that's where StringTokenizer is nice, you can tell it to return the delimiters as tokens

oh
Couldn't you split on +'s and then split again on -'s?

specially from xss

you grab a String right? String has a method charAt() which allows you to iterate the String, one character at a time, you have a switch case for '+','-'/' and '*' performing the intended operation each time you encounter those.

is it possible to pass references into a class after its been created?

yes, i hope you like really complicated loops though
sure. use a setter method or a public member

public member huh, never heard of

And i'll note as well that my solution is well…bad.

Fanook, not that complicated, just two loops…

buh bye!

sure, for only + and -. add the rest of the parsing

use a setter/getter to modify/retriuve a classes member variable
public variables can cause…unintended problems.

I'll try that thanks you two.

you and your encapsulation fetish public members are fine when the object will never contain logic

what if your class relies on a variable to _NOT_ be null, you go and you set the variable to null outside the class, then inside your class you go and reference that later on/
*fapfapfap*
little do you know, i actually broke encapsulation in a private host project I wrote to do just satisfy a curiosity of mine

good for you

you broke encapsulation!? omg everybody panic

http://eugeneciurana.com/pastebin/pastebin.php?show=3623
example.
imagine Bar was defined for this example.

so that changes the bar to null ?

the client.
foo.bar = null;

yeah

just realized
s/Bar()/Foo()/

Wtf?
My priest just died. ;_;

WoW?

but lets say my Foo class needs a special variable to be built up, how do I pass the value into Foo AFTER its already been made?

O-o
NetHack.

ah
use a setter method and a private/protected member

private int, then a set method to set the int from another class right ?
Im working on that now, lets see

public void setFoo(int i) { this.whatever = i; }
/jj3/me hugs Fanook
wrong hug

Is there a way to advise the JVM (through Java) that, if possible, you'd like particular classes or variables not to be stored on disk?
[eg by being swapped out]

not that i'm aware of

Thanks

Is there a way to call a function based on a variable? IE if I have a variable named %i with the value of "test", how would I call the function "test" using %i instead of "test"?

~reflection
stupid bot!
google java reflection

ok thanks

Reflection is an extrinsic conferred by the amulet of reflection, silver dragon scale mail, shield of reflection and longbow of diana. ¬_¬

javabot reflection

r0bby, reflection is http://java.sun.com/tutorial/reflect

aiyeeeeeeeeeeee javadoc works

~javadoc String

cheeser, please see java.lang.String: http://java.sun.com/javase/6/docs/api/java/lang/String.html

ok. i didn't hammer anything
8^)=

What's r0bby doing to poor javabot? :s

nothing.
’tis all me 8^)=

Oh noes!

Ah yeah it worked out just fine, tyvm r0bby

~javadoc Date

joed, please see java.sql.Date: http://java.sun.com/javase/6/docs/api/java/sql/Date.html
joed, please see java.util.Date: http://java.sun.com/javase/6/docs/api/java/util/Date.html

i tested that last night

Nah. it's broke.
Should have replied 'fucking does not make sense'

hehe
javadoc Pattern.split(*)
~javadoc Pattern.split(*)

Fanook, please see java.util.regex.Pattern.split(java.lang.CharSequence): http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html#split(java.lang.CharSequence)
Fanook, please see java.util.regex.Pattern.split(java.lang.CharSequence, int): http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html#split(java.lang.CharSequence,%20int)

stupid tilde

~javadoc String.regionMatches

I don't know of any documentation for String.regionMatches

~javadoc String.regionMatches(*)

aditsu, please see java.lang.String.regionMatches(int, java.lang.String, int, int): http://java.sun.com/javase/6/docs/api/java/lang/String.html#regionMatches(int,%20java.lang.String,%20int,%20int)
aditsu, please see java.lang.String.regionMatches(boolean, int, java.lang.String, int, int): http://java.sun.com/javase/6/docs/api/java/lang/String.html#regionMatches(boolean,%20int,%20java.lang.String,%20int,%20int)

test in privmsg?

holy javabot spam

I wish javabot would escape brackets in urls too
my irc client doesn't think the ")" is part of the url
also, it's not really spam, I wanted to tell everybody about my latest finding
somebody asked about a startsWithIgnoreCase a few days ago, it can be implemented very easily using regionMatches

string.toUpper().startsWith(other.toUpper()) ?

that's quite inefficient

and i'm sure firing up the regex stuff is *so* much faster

also, it's toUpperCase, and it doesn't work for the Georgian alphabet

have you even profiled it?
oh, dear lord.
you're going to quibble API typos?

what regex stuff?

regionMatches() uses regex, yes?
either way, i don't really care.

no, just a simple loop

it just looks like an engineering solution in search of a problem.
i'm actually on my way to bed…

that explains it then
good night

i feel i'm going near of the regex for polynomy :P

why are you doing this to yourself?

*yawn*
?

you're supposed to catch it

hm, about 2.5 times faster

Hola.

hola despredador

aditsu!

hrm. anyone running bea weblogic on an apt-based distro like ubuntu?

~anyone

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

:P

¡pr3d4tor!

~mohadib–

mohadib has a karma level of 89, eidolon

what god forsaken encoding are you using?

spanish encoding
~mohadib++

mohadib has a karma level of 90, aditsu

\o/

~aditsu–

aditsu has a karma level of 15, eidolon

haha

~mohadib–

mohadib has a karma level of 89, eidolon

aditsu++

aditsu has a karma level of 16, mohadib

neener.
~javabot–

javabot has a karma level of 99, eidolon

karma fight? that's lame

~hump eidolon about the leg area
/msg javabot eidolon–
er..

HAH

one time I — ricky_clarkson
he had a meltdown

heh

much lulz where had

where's he gone, anyway? haven't seen him in ages.

aye , he went back to VB

it breaks on my screen

he was in here yesterday, i think

~lastseen ricky_clarkson

I guess the factoid 'ricky_clarkson.clone()' might be appropriate:
eidolon, ricky_clarkson.clone() is MickMcMack

HAH

oh, I don't know.. I suppose it's sent out as UTF-8

!seen ricky_clarkson

2 GMT, saying 'Things like emacsen and lisps work quite well without global

meh

this is what i see: http://eugeneciurana.com/pastebin/pastebin.php?show=3624

that's probably UTF-8 interpreted as ISO-8859-1, or something like that

heh it's weird

looked fine here

irssi?

yep

¡pr3d4tor!

lol , guess that still wont look right for you..

¬_¬

ipr3d4t0r!

same.
anyways

googling for information on the jni seems to give me info from 2003 at best

~tell r0bby about fail

r0bby, http://img378.imageshack.us/img378/4934/failtx2.jpg
r0bby, a href="http://img378.imageshack.us/img378/4934/failtx2.jpg"http://img378.imageshack.us/img378/4934/failtx2.jpg/a

anyone worked with it in java 1.5 or 6 ?

oh sure, see, you don't give avegas the ~anyone line.

!seen whats_in_a_name

5 GMT, saying 'oh hi pr3d4t0r. i just got back from masterbating. yeah what am i apologizing for? i may, but i need to know what im guilty

~tell avegas about anyone

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

he is frequenting #c# (I think that's the channel name)

we like you more, it's an honor
##csharp

uhh. thanks. i think.

thanks

whaley, I'm just curious about horror stories / absence of horror stories

why i lurk there i have no idea

poser
:s

i have a friend there who works for ms
but i mostly speak to him on another irc network
i have no horror stories to tell

!seen cybereal

3 GMT, saying 'not the reality of the languages but the idea of using MS Paint as an

~flog pr3d4t0r

I guess the factoid 'bomb pr3d4t0r' might be appropriate:

meh..

What's up?
How was the drive back?

nothing much

am i being too noisy?

lol

I dunno. I just got here.

run pr3d4t0r is opped!
o
nvm

you can assume yes and be right 99% of the time

i assumed that because you opped, i was too loud

RBBY
oh, you can?

?
that fuckin guy
Hey aditsu, call pr3d4t0r a bitch.
see what happens.

show me

heh
nah

aditsu you broke pr3d4t0r's window i think

What did you paste here? It totally fucked up my screen.

all I saw were question marks.

hm.. then I wonder if anybody could actually read it

it was "r0bby probably can't read this", but in a weird font

~fanook++

fanook has a karma level of 30, aditsu

mirc v6.21

Same on a mac

it's not a different font, just a different set of unicode chars

gj
Nothing bad happened here, pft
Mayber pr3d4t0r's irc client sucks.

specifically, characters 0xFF00 to 0xFF5F

are they goofy surrogate pairs or some shit?
*sigh*
I need to be coding but I'm just not up to it tonight.

they're "Halfwidth and Fullwidth Forms" apparently

*yawn*
~coffee svm_invictvs
now stop complaining

SO I was so bored today, I wrote a program taht views an exception and its root causes in a Jtree.
actually…
it's supposed to read a shit load of exceptions from a file that ahve been serialized.
lol

Hrm, is there some reason why I can test whether a string variable starts with a string, but not whether it's equal to it using "=="?

because you've misunderstood what == does
A == B asks "are A and B the same object"
you want A.equals(B), which askes "Do A and B have the same content"

ah, thanks
I'm used to doing js stuff, so that change confused me a bit

dev-: you said "starts with"
~tell dev- about javadoc String.startsWith(*)

dev-, please see java.lang.String.startsWith(java.lang.String): http://java.sun.com/javase/6/docs/api/java/lang/String.html#startsWith(java.lang.String)
dev-, please see java.lang.String.startsWith(java.lang.String, int): http://java.sun.com/javase/6/docs/api/java/lang/String.html#startsWith(java.lang.String,%20int)
dev-, please see java.lang.String.startsWith(java.lang.String, int): a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html#startsWith(java.lang.String,%20int"http://java.sun.com/javase/6/docs/api/java/lang/String.html#startsWith(java.lang.String,%20int/a)

me too

groovy does

pnuts does too, in a way
what's up with sohail?

idiotic troll

!seen sohail

0 GMT, saying 'you should check the javascript

javabot tell aditsu about logs

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

search his nick

Hi

I can only find what people told him

Any Resin experts on?

aditsu:hold

anyway, I found something

you're slipping, shouldn't you have done "~tell qopit about anyone" yet?
you're too late, now i've lost a bet

huh? That one is lost on me…

I haven't been paying attention.

fine i'll do it!
~tell qopit about anyone

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

http://servlet.uwyn.com/drone/search?submission=search&submissioncontext=LlBVQi5TRUFSQ0g%3D&inputs=cGFzc19jaGFubmVsbgBiZXZpbmJvdCAtICMjamF2YXAAcGFzc19rZXl3b3JkbgBzb2hhaWw%3D&keyword=javascript&date=&beginDate=&endDate=&user=sohail&channel=bevinbot+-+%23%23java
that's why

thx… I have to confess (and scare people off) that this is my first time using IRC…

ok just dont paste code snippits and you'll generally be ok

thx…

read javachannel.net

Ok… I will

it has an FAQ, as well as tutorials that will answer _MOST_ questions.

this channel, though, is especially anal, they dont like aol-ish abbreviations (like "thx")

heed all of the bullet points on the front page of javachannel.net

Anal is good.

er… ok. Never heard that called AOL'ish before, but I'll abide…

what, you mean javascript is NOT a superset of java? :O /jk

some chicks are way too into it and eventually you miss plain old vanilla sex

wiki

or is that not what you menat?
s/menat/meant/

vinse++

vinse has a karma level of 37, pr3d4t0r

dude..
I said /jk

I know

it's not a subset, it's *inerpreted* java
duh everyone knows that
s/iner/inter/
i f'ed up my joke

don't meet sohail's fate

~tell r0bby test

tell nick about factoid - you missed out the 'about', qopit

oop

what?
don't do that unless you need to.

god so many rules
it's almost like people enjoyed telling otehr people what to do

he's just learning

but of course i'm sure it's not

I know..

hi

pr3d4t0r, http://www.officer.com/online/article.jsp?siteSection=1&id=37374

it's "~tell nick about factoid" w/o quotes; you'll learn the factoids as you become more of a regular
you cannot issue a ~tell command more than once within a 10 second period.

if you're enough of a borderline sociopath to become a regular, that is

(if cheeser push that?)
s/push/pushed/

And I care about it because….?
Anyway. Good night

pr3d4t0r, pull your head from your loins.. thought it was interesting…

you've become a model citizen

~tell javabot about ok… thanks. Assuming this worked…

javabot, I guess the factoid 'this()' might be appropriate:
javabot, this() is http://java.sun.com/docs/books/jls/third_edition/html/classes.html#78435

~tell qopit about message the bot

qopit, You can send me private messages, these annoy other users less. Note that in private messages, you don't need the "~".

that is how you do it. (consider doing it this way while you play with it)
(or maybe setting up your own; instructions to do so are on the javabot FAQ)

tell javabot about ok - thanks… that syntax seem very long, though. Apologies for the annoying new guy thing… shouldn't last more than a few minutes more, I hope

in case you haven't figured out yet, javabot is a bot, that is, a computer program; it doesn't really understand what you say

1) javabot is not a human, it's written in java. 2) stop doing that, use it when you need it, it floods the channel and annoys the crap out of people
~tell qopit about source

qopit, For a complete tutorial on how to get javabot up and running see http://javachannel.net/wiki/pmwiki.php/FAQ/RunningJavabot

go look at that if you don't believe me.

tell aditsu about Thanks - I had figured that was the case… just trying to get the private message syntax worked out (tilde or not, slash or not, "tell about" or not). Sorry all if this is flooding the channel. I can find a better one to spam and figure this out.

stop.

when you talk to people, just use their nick (not "tell … about"), like I am doing now

tell doesn't make javabot talk, it redirects factoid output to a specific user.

for private messages, try this: /msg javabot hi

with the colon like this? (at the risk of another annoying secure webmail web hosting line…)

then javabot will open a private conversation with you

you _CAN_ make javabot talk, but i'm not going to tell you, because you'd never stop using it

hahahah
seriously that's hilarious, you have the poor guy totally confused

yeah, for example; your irc client should help you with nick completion

you see how i'm addressing you, this is how you do it.

also, it's not polite to send private messages to people without asking them first

except javabot; that is the one exception.

because it's not a person

giggle? i'm in tears

sorry

"tell aditsu about Thanks" is one of my favorite things ever said in here
if it didnt require context i would suggest putting it in the topic

guys, please, enough with the pm

i apologize

I love being the new guy at something again… the peanut gallery responses are always entertaining! I'm glad I'm providing entertainment at least…

it may help to google about irc basics and etiquette

i just cant believe something so simple somehow got so confusing

I generally don't mind PMs if you're an established regular

it wasn't just you

i do though, you have to call my agent for an appointment
and he needs to clear it with my attorney

i didn't mean to bother you, it was more for my own amusement; anyways; back to java!
also, cheeser is really strict about staying on topic; so make sure everything you say has to do with the java programming language and/or java-related technologies.
anyways, i've given all the tips i can, good luck

thanks…
I'll just assume that application server questions are on topic, although not strictly a java language question… I expect to get lambasted if not, but what the hey, it isn't blacklisted on javachannel.net

I wonder

they are.
they're Java EE

~guffaw r0bby

svm_invictvs, I have no idea what guffaw r0bby is.

what the…

I wanted to javabot to let out a huge guffaw at you.

I'm trying to get Resin set up so that a base IP address will load up a specific webapp without needing to reference it… eg: http://192.168.1.1 should load up http://192.168.1.1/foo without the foo reference.
Does anyone know how to do this? I've tried putting the app in webapps/ROOT, but I end up getting a directory listing instead
uDoes anyone know how to do this? I've tried putting the app in webapps/ROOT, but I end up getting a directory listing instead/u

bah

what's wrong?

I'm trying to explain to my friend why her boyfriend is a douchebag, but I'm failing at it.

Maybe I should have stuck with Tomcat… I'll keep muscling away at Resin.

maybe he's only a douchebag to me.
although there is a high level of douche taht resonates from him.

maybe she
s so in love with him, she's blind to it

I think it should be configured in a similar way on diff. app. servers, but I don't really know how

meh

but this isn't java.

knows I'm trying to sleep with her.

So he's a douchebag to me whnever I talk to him.
And I just wanna punch him.

it's likely only to you.

ok - thanks. Maybe I'll just use web forward at my DNS to avoid the application server config problem all together, but I'd prefer not to.

no, a mutual friend of hers thinks the same thing.

and thanks for the help… time to go for me. If anything, tonight has been entertaining for getting to be the new guy. Good night.

ok, good night to you

hey guys
anyone run into problems with Vista's UAC yet?

lots of poeple, from what I can read on the 'net

My program allows users to load a file from the desktop and the file is copied into the program folder. The only way it works on vista is to right click the program and run as administrator
UAC is blocking it, but I don't know how to prevent this

you may have to read up on uac and vista specifics. it is really important that developers do. how is that program called? what is its manifest set to as far as privileges goes?
does the file have a shield icon?

WTF is UAC?

Clackwell, no

user account control, http://en.wikipedia.org/wiki/User_Account_Control

although either does netbeans or any other icon on my desktop!
lol, even avg doesn't
Clackwell, I've been looking for a place to read up on this related to java. I only find questions on sun's forum, no answers
Have any ideas?

UAC is http://ars.userfriendly.org/cartoons/?id=20070629 and http://ars.userfriendly.org/cartoons/?id=20070804

lol

what is happening when you run that file? what happens if the file is copied to the computer by some other way?

heh
~UAC is http://ars.userfriendly.org/cartoons/?id=20070629 and http://ars.userfriendly.org/cartoons/?id=20070804

Okay, aditsu.

that guy is talking about running as an admin, which still isn't the recommended way to use any operating system, not even vista. cheap laughs, bah
you get the "usual" sudo-style login popup for anything an admin must do, once everyone has adjusted to how things need to be done these days.

Clackwell, ok I get the file using JFileChooser, then rename it (basically moving it to the program files\my program folder
success = licenseFileName.renameTo(new File("Data", "CompanyInfo.enc"));

no cluew what you mean. what i said before was about executables.

The program runs fine. The only program is when I try to move a file. I can even load files fine. But if I have the program take a file from the desktop and move it to the program files folder nothing happens, no error thrown either.
I can copy the file using cut and paste just fine

me has no clue what goo1 is trying to do, he assumed that copying a *.exe file to some folder and trying to run it was the operation being attempted.

No, not copying an exe. I'm copying an encrypted xml file from within the program
I doubt the file type matters though

you are copying a file and that "does not work"?
brb

Exactly

more information than just "does not work"?
what is the absolute path on the computer in question? cprogram files\….?

cprogram files\home inspector pro\data\
There is no more info. The file never gets copied, no error is thrown
success in the line I pasted returns true
success = licenseFileName.renameTo(new File("Data", "CompanyInfo.enc"));
The file already exists in the folder
In xp , mac, 98, etc it overwrites the existing file
maybe that's the problem that it doesn't have permission to overwrite
When I right click on the program and run as administrator it runs fine

if you were a QA engineer and you were responsible for improving the code quality of your project, what kind of things would you implement

write a test program. keep in mind that the program files folder (among others) is NOT writable for the common user. and per-user software that writes into its own directory must not be installed there.

to ensure that?

instead, as on unix, such software should be installed into the home directory of the user.
we are wondering about that too. so far we have come up with coding guides, mostly taken from the nasa coding style guide. and we plan full unit testing as well as applying stuff like lint and co.

Clackwell, it's not meant to be per user software. It's meant to be common to all users and works that way in all previous windows version. I didn't realize that it's not supposed to be writable. The program can write to it fine when I'm saving using JFileChooser

I am the project leader and I am trying to enforce good quality code. We have good formatting guides and coding style guides

sleepster:we will probably go to the length of specifying a blacklist of programming constructs which must not be used under any circumstances and hopefully some (custom?) tool can check for those to enforce that.

Are there any good tools you are using Clackwell?
how do you use Lint to improve code quality?

(the project is about c, c++, however)

have you use statsvn?
it shows you a huge amounts of information

sounds wrong that the program can write to the program files location when not running with admin rights (which is not the same as running it as an admin, per se)

about which developer checked in the code for which packages etc.
the amount of code they checked in. the frequency of checkins.

we have only come to gathering those ideas, haven't looked at any tools in particular yet. we are fumbling about the build system at the moment (scons, python based).
we are using svn

statsvn is a pretty nice tool
I am trying to think of good means to utilizing this tool though

we aren't so much interesting in the numbers you mentioned there.
interested, rather

yo fellows
is there any way to include the classes of another jar file in my own jar file
e.g. some apache commons library

if using an admin account, make sure that when running the program after login as amdin you do not get asked wether you really want to do that in that UAC prompt, because the program gets full admin rights when you agree. and then it can write to program files for sure.

this is probably a horrible way to package software, but i just want a nice package

horrible and nice?
can't unpack them to package them all into a single jar?

jar cf MyJar.jar -C bin . -C c…\apache-commons-logging-1.1 apache-commons-logging-1.1.jar — doesn't work

Clackwell, it works fine when running as admin.

there is a way with a (custom) classloader, getting the jars as resources (getResourceAsBytes or whatever), but…
you are trying to put jar files into a jar file just because you can't manage to unpack and repack the existing jar files?
unpacking the jar files to where your own files lie around. jar the whole thing up, done.

clackwell, why should i unpack the existing jars? @_@ too much trouble

then you will have to have to write code to go the classloader route. good luck.

clackwell, ok ok, i'll just copy all apache jars to MyApp\lib and add them to classpath

signed or sealed jars can be a reason to want to have jars in jars.
also consider wether your own perception of having a single jar file with everything in it is really relevant to your target group. often it isn't, but the prorammer insists on his own personal feelings about the issue.
i didn't suggest to ship the jar files separately. misunderstanding?
if you have 2 zip files you can unzip them and throw the zip files away. then you can zip the files you got again. that's what i meant initially.
that way you still have a single jar file.
see you later

sounds like fatjar
~fatjar

Sou|cutter, fatjar is a jar file compiled from several other jars, see http://fjep.sourceforge.net/

ah thanks
this fatty jar seems nice
^.^

just remember, it's not over ’till the fat jar is signed :p

*giggle*

hi
which java technologies are suitable for clien/server apps?

none.

krustofski, i'm not joking please!!!

~vague questions

I guess the factoid 'smart questions' might be appropriate:
krustofski, smart questions is what you need to ask to understand a smart answer. See http://www.catb.org/~esr/faqs/smart-questions.html

hi

so?
any help?
which java technologies are suitable for clien/server apps?

you would probably need some kind of communication library

aditsu, yes,
aditsu, could you tell me some libraries that i can use?
for database access, i need jdbc

for sockets there's e.g. mina, or you could use jms, or other stuff

but for establishing communications between tiers; i'm really confused
aditsu, the problem is that i'm not pro with java. so if my questions are stupd; just be patient
aditsu, do you jboss?
do you know jboss?

no, I only use jboss-cache
many people hate jboss for some reason

microtux, just do java servlet tutorial and play with tomcat
that's my best advice if you are starting with java client/server

aditsu, so, what's the best framework for the middleware layer?
aditsu, jsp??

your questions are too vague microtux

first of all, does it have to be on the web?

it seems you don't have a clue of what you are talking about

andresgr, not exactly

i.e. http & html?

aditsu, i want to create an application client/server+database
for the database i'll use jdbc

that doesn't need to have any web stuff, from your description

for the server i'm confused. I don't know whether it's better to make a web based app or not?

do you know what you would pick for the task in some other language?

hello… I'm trying to compile a java app that uses javax.swing.GroupLayout but it says it can't find the symbol 'GroupLayout' (using javac). But I created this project in netbeans and netbeans compiles it fine. Why would that be, does anyone know?

there will be many tasks that i have to put in the server(middleware)
so i want to know if ot's better to have a web based app?

misc–: sounds like you are using some netbeans layout stuff :P

or should i create a GUI for clients and connect them to the server for computation tasks and for storage

yep correct… is that going to cause problems when I compile with javac?

tazle, aditsu andresgr any advise?

misc–: netbeans compiles with javac.. its just that it adds the special layout classes in the compilation.

ohh, right ok. So I should probably compile by using the same manifest or something?

microtux, yes, spend some days reading a good book about java ee.

it depends what the clients need to do
if it's simple stuff that can be done with web pages, then go ahead and make a web app

misc–: well, the classes are in a certain .jar file, which is probably hiding in one of your netbeans projects directories.. you just need to learn how to include that when you compile.

then communication will be http, and the clients will be browsers

aditsu, sending/retrieving data from server, displaying results. computation tasks will be in the server

ok thanks. I can't see any other jars but I will look into it

aditsu, it's a good idea building a web based app

misc–: or you could just stop using the netbeans specific layouts.

aditsu, and the server? ihave to use JSP then ?

if the communication style is request-response, and the UI can be done in html, then ok
jsp sucks

you don't *have* to use anything - you could implement a web server on plain old java sockets

I like those layouts though

I recommend the wicket framework

btw java works now that i reinstalled and uninstalled __ALL__ copies
(reverse order)
i had 3 versions installed :|
so i took em all off and reinstalled the latest i had already had
now applets and java binaries both work 100%
however the loading bar still doesnt work right on a specific applet
oh well,.

actually in the properties of the project, it's including the swing layout extensions

nothing in it works 100% .. ever

also the msg when it is done loading doesnt appear

misc–: its just a code generation thing. You can get the gui builder to generate "standard java 6 code" or "netbeans layout extension code".

i still have to test the sound loop glich for when the applet does not stop the audio manually

aditsu, thank you, but do you know other frameworks suitable for such apps?

thank you cya

misc–: it doesnt really change how the builder works, just what it outputs..

ohhh right ok. I'll check how to do that then

~web frameworks

Nowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short introductions to each. Also see http://java-source.net/open-source/web-frameworks for an exhaustive list.

^
the only problem is… there are too many :p

mmm, Grails should be added to the previous definition
web frameworks is Nowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, Grails and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short introductions to
each. Also see http://java-source.net/open-source/web-frameworks for an exhaustive list.

I already have a factoid with that name, andresgr

heh, http://docs.codehaus.org/display/TRAILS/2007/06/03/On+Grails,+Trails+and+Sails

aditsu, just some of theme, not all

too many "ails" :p

javabot, forget web frameworks

I guess the factoid 'web services tutorial' might be appropriate:
andresgr, web services tutorial is http://java.sun.com/webservices/docs/1.0/tutorial/doc/JavaWSTutorialTOC.html

you can do "~no, web frameworks is sayNowadays …"

~no, web frameworks is Nowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, Grails and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short
introductions to each. Also see http://java-source.net/open-source/web-frameworks for an exhaustive list.

Okay, andresgr.

aditsu, thanks

you left out the say

~web frameworks

andresgr, web frameworks is Nowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, Grails and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short
introductions to each. Also see http://java-source.net/open-source/web-frameworks for an exhaustive list.

he, ok. Last try.

just one other question… once I have found this .jar file, how do I get it to use this jar file? Can I import somehow or do I need to specify it on the command line with javac?

~no, web frameworks is sayNowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, Grails and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short
introductions to each. Also see http://java-source.net/open-source/web-frameworks for an exhaustive list.

Okay, andresgr.

~web frameworks

andresgr, web frameworks is sayNowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, Grails and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short
introductions to each. Also see http://java-source.net/open-source/web-frameworks for an exhaustive list.

damn it!

wow cant you do that in pms?

i could, but i need aditsu to tell me what i0m doing wrong

~tell misc– about classpath

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

hm, that's odd

thanks vinse

oh, sorry, I think it should be reply, try in pm

can I create a dynamic array that doesnt have a top bound ?

aditsu, no luck

reply, not replay
ArrayList?
or a MapInteger, Something

aditsu, victory! thanks

yay

I am trying to replicate the string .split() function which returns a string array

an ArrayList should be ok for something like that
I'm not sure why you want to replicate split though

I need to return a string array though. I am porting classes to J2ME which does not have split

use toArray

Also. J2ME does not have ArrayList

then use whatever List it has.. Vector or whatever

Only Vector - I am not sure of the performance issues I might get using it though

or make your own ArrayList

no .toArray in vector either.
sigh

hmm I did do java -cp swing-layout-1.0.jar Test.java but it still can't seem to find the GroupLayout (which is in the swing-layout jar)
oh well

well, you can do what ArrayList does
use an array, and when it fills up, allocate a bigger one (multiply the size by something) and copy it, discard the old one

aditsu, the usage of hibernateor JDO, allows data recovery, or journal creation?

data recovery, journal creation?! aren't those some internal database features?

aditsu, yes

then it's not related to the library you're using

aditsu, so what's the role of hibernate then?

~orm

andresgr, orm is Object Relational Mapping

~hibernate

andresgr, hibernate is a nice ORM [see orm] tool and can be found at http://www.hibernate.org/ and #hibernate

aditsu, isn't the data recovery?

no, it's for mapping objects to database records, managing connections, and caching

aditsu, ok. and who is better? hibernate or JDO?

toplink

I don't like hibernate personally, it's too abstracted; I don't know anything about jdo
I use ibatis, but it's your choice

aditsu, i see

jdo is really fine, but it has been discontinued, so hibernate would be the best choice for the future, or also ejb 3.0, think about it
microtux:see

hi. what's the usual way to monitor files on a file system?

b0r3d, uh?

through java i mean.. i want to monitor a file's date changes and trigger actions accordingly

chnarr, thank you

….good question

I don't think there's good support for that in the file options currently available unfortunately.
(I've not done anything like that myself, but it's come up before)

check date of last modify the file every x seconds in a thread…

I seem to recall the options as being either a) repeated polling (yuck) or b) Interfacing with the OS capabilities through JNI (also yuck)

b0r3d, you could try Mule
http://mule.codehaus.org/display/MULE/File+Provider
but i think it only checks for "new files"

I don't want to try a third party library.

smack andresgr
The easiest thing to do is just poll repeatedly in a thread as per chnarr's suggestion. It's ugly as hell though.

yes I agree, it was just first Idea, but using a nice thirdparty would be probably better

Sure. I'm not saying it was a bad idea. There isn't a non-ugly approach I know of.

~chnarr++

chnarr has a karma level of 1, andresgr

And using a nice third party library would indeed be the right approach.

unless you like new wheels…

Using a FULL FLEDGED ESB doesn't count.

ehem

"Damn, that fly is really annoying. I think I'll NUKE IT!"

Mule is very lightweight sir…
perfectly usable as a library, embbeded etc.

Uh huh

My question is how does actual application servers scan application directory changes to hot deploy apps ??
for example Jboss…who knows

It's almost certainly a variant of the thread which polls, probably using some sort of timer service rather than a dedicated thread.

mmmhmm

you can use quartz also

JBoss is certainly not to be used as an example of code which isn't ugly as hell though.
uJBoss is certainly not to be used as an example of code which isn't ugly as hell though. /u
uuJBoss is certainly not to be used as an example of code which isn't ugly as hell though. /u/u
I'm glad I don't have to do it again.

hah

quartz falls under "some sort of timer service" doesn't it?

so take weblogic as another example

This can very easily be resolved by looking at the source yourself you know.

Or to you point of view what would be the nice coded J2EE app server ?
uOr to you point of view what would be the nice coded J2EE app server ?/u

Comments

« Previous entries ·