« first day (29 days earlier)      last day (4926 days later) » 

Tom
12:19 AM
@Raynos you've frightened it
 
Has anyone used aptana on ubuntu ?
 
@Raynos Here
 
@YiJiang my code assist colour scheme is unreadable
the foreground colour is white and the background colour is almost white
 
@Raynos Erm... what did you change?
 
@YiJiang nothing my ubuntu defaults make this horrible apparently
Its a font issue with ubuntu rather then aptana
 
12:29 AM
@Raynos Uh... go to System > Preference > Appearance and change the font option, likely you're looking for the anti-aliasing options
 
fixed it
 
Hrm...
I'm trying to emulate a browser within a browser. Anyone have any ideas?
`iframe`s won't work - Once they load (if they haven't loaded content from the same server) you can't get any data about the page (not even the url)
and an XHR won't allow me to fetch HTML files from other servers
 
Tom
@clarkf you cannot do that without a server sending you the data
 
Man....really?
 
Tom
@clarkf, of course, otherwise any website could just make you download whatever you don't want to download
 
12:39 AM
Well, I don't need anything more sophisticated than an IFrame
but I need to be able to discern the title and url of the page
 
Tom
@clarkf same thing, because you want to get the data from the external source client-side
 
:/
 
Tom
@clarkf well the url you can remember from when they entered it, the title you cannot get
you can obviousely load an iframe though
 
@Tom The original URL is in the src parameter of the iFrame
But if the user navigates within the current page you can't get the URL of the iframe
 
Tom
@clarkf correct
@clarkf you can do it with a java applet if you let the user accept all privileges
@clarkf you can route your traffic through this java applet
 
12:42 AM
Ugh
no java
 
Tom
@clarkf well, then there's no solution
 
`var b = {},
        a = b.lol = {};
That is invalid. why?
 
because b doesnt exist until the statement executes
you're trying to assign it with the same statement, which hasnt completed at the time of your assignment
 
Tom
@Matt you would think the statement would execute from left to right though
 
it doesnt matter because you're trying to do two operations in one statement
 
12:45 AM
@Matt even without that
 
it is as invalid as you switching the order
 
var b = {};
var a = b.lol = {};
thats still invalid
 
works for me.
 
then its just aptana going I cant parse that
 
yeah because if you run it in a javascript console it works fine
 
12:52 AM
obj.prop vs obj["prop"]. is there much efficiency difference?
 
@Raynos No
 
just tested in jsfiddle, and it seems not
 
@Raynos but one does let you use a loop to iterate over keys in a dictionary, since obj["prop"] and var str = "prop"; obj[str] are equivalent by my understanding
if you're going to test performance of javascript, use jfperf instead
 
@drachenstern I know but im using it for obj["function"] because obj.function looks ugly in my syntax highlighter :p
I want my lazy evaluations! :(
 
wow, I never worry that code looks bad in my syntax highlighter. Instead I change the syntax highlighting ...
 
1:25 AM
console.log.apply(null, arguments) whines at me. why?
Ah I see
the chrome console & the firebug console are different
why does console.log.apply(null, ["1"]) throw an error in chrome but not firebug?
Fixed it. it appears you need to run console.log.apply(console, ["1"]) persumably firebug goes woh! what are you doing ill make the context console because you clearly forgot and meant to do it anyway
 
2:05 AM
chrome insists that $(document).ready can happen before running of scripts in head tags.
 
@Raynos yes, that's true, it could
because one insists that the document be loaded, the other is a matter of things being processed
 
@drachenstern why does firefox run in the correct order though?
Its because of my require call backs. I see now
using require.ready instead of $.ready solves my issue :)
 
2:29 AM
goodnight.
 
 
1 hour later…
3:30 AM
what is the default setting for expires on cookie?
 
@wcpro I believe it's on browser close.
 
thanks
 
depends on the cookie, who set it? what platform?
 
@wcpro it can depend on the browser, I would assume
 
if you don't set an expiry then yeah, window close
 
3:44 AM
it was just a question on a test (:
i think i got it wrong
 
how did you answer?
 
422
Gday chaps n chappettes
If you guys get chance ( hopefully Drach can assist again ) , please take a look at jsfiddle.net/ozzy/6y7Jc , where it displays #price I am trying to display the price user submitted in the first input element, but formatted, as shown in the second input element, plus I would like to get rid of second input update element, and rather than a submit, would prefer that the #price value is shown, when we mouse click away from the first input field ..... breathe :)
@drachenstern you busy dude ? :)
 
4:05 AM
@422 already looking at it, hold just a second
do you see what I did there?
function Update() {
    var s = new String();
    s = CurrencyFormatted(document.testing.amount.value);
    s = CommaFormatted(s);
    document.testing.result.value = s;
    $('#my_display').append($('<div>').text(s)); //new-line
} // function Update()
 
422
just lookin and hi mate ( sorry had sound down )
 
mine's on mute ;-)
 
422
lol
so where would I add that ?
anywhere between the script tags
 
where would you add what?
 
422
K that works ACE
 
4:11 AM
everything you wrote?
 
422
sorry js was switched off lol
 
do you understand what I did?
 
422
yep
thats clever
 
it's important to understand what the syntax $('<tag>') does
 
422
just gotta now fire without onclick
I havent seen that syntax before, I am as you know crap with js
 
4:12 AM
so you could do onkeypress or onkeydown to grab the content in the textbox
 
422
< learning slowly tho
 
I know this is new to you, but you're doing good and catching on
 
422
okey dokey , sweet. Yeah its like learning hungarian lol
 
also notice I didn't look at any of the rest of your code, only the lines directly related to the submit button
lol@learning Hungarian, the Hungarian's on this site might have something to say about that ;) :P
 
422
lol
so : <input type="button" value="Update" onkeypress="Update()"> is wrong isnt it
 
4:14 AM
it is and it isn't.
 
422
cos i dont want a blinkin button
text
 
oh and onkeypress is wrong there
 
422
ops "text"
k
 
but with jQuery you're going to actually want to use the binding scripts like this: $(selector).click(functionName); or you can use an anonymous function (which is what most people do)
 
422
so format like: <input type="text" onkeypress="return noNumbers(event)" />
 
4:16 AM
I'll update the jsfiddle
 
422
thanks Drach
 
now study my changes
I update the button and the function
 
422
will do brb gonna check it now thankyou
 
422
4:43 AM
Thats cool, just reading thru it all
just trying to figure out how to remove submit button, and have the numbers displayed when i click outside of the field element
 
so you want to learn about onblur I believe
> The blur event is sent to an element when it loses focus
 
422
thanks. all these diff handlers, will get into this ... :)
 
lol, yeah there's a few
so do this
> working, brb
<input type="text" name="amount"> -> <input type="text" id="amount" />
then do this:
$('#updateButton').click(function() { -> $('#amount').blur(function() {
$('#amount').blur(function() {
    var s = new String();
    s = CurrencyFormatted(this.value);
    s = CommaFormatted(s);
    document.testing.result.value = s;
    $('#my_display').append($('<div>').text(s));
}); // function Update()
but I didn't test it yet
 
422
thanks, just looking :)
 
422
4:51 AM
how the heck do you do it soooo quick... I tried removing the button, but it crashed
 
practice ;)
 
422
lol beat me to it ace !
 
how do you get to Carnegie Hall?
 
422
sweet. can i prepend the number with $ , so looks like a price ?
 
be utiful
 
422
4:53 AM
carnegie hall, wheres that
 
lol, old joke
 
422
lol
 
Carnegie Hall ( , also frequently or ) is a concert venue in Midtown Manhattan in New York City located at 881 Seventh Avenue, occupying the east stretch of Seventh Avenue between West 56th Street and West 57th Street, two blocks south of Central Park. Designed by architect William Burnet Tuthill and built by philanthropist Andrew Carnegie in 1891, it is one of the most prestigious venues in the world for both classical music and popular music. Carnegie Hall has its own artistic programming, development, and marketing departments, and presents about 250 performances each season. It is al...
check about halfway down the article, there's a reference to a joke
 
422
lol
An old joke has become part of the folklore of the hall: A New Yorker (or in some versions Arthur Rubinstein) is approached on the street near Carnegie Hall and asked, "Pardon me, sir, how do I get to Carnegie Hall?" He replies, "Practice, practice, practice." The Directions page of the Carnegie Hall Web site alludes to the joke.[19] Various performers have told variations of the joke, including Emmylou Harris and The Roches. The pop band Sparks have a song called "How Do I Get to Carnegie Hall?" on their 2002 album Lil' Beethoven based on the joke.
 
Get the joke I take it?
 
422
4:56 AM
theres an irish version of that. Bloke asks where is Dublin Magistrates Court, paddy says... go down the rd 100m turn right, go along there for 200m turn right, then down that road for 100m then turn right, then down that rd for 200m and turn right, and you will see it right in front of ya.... bloke says that brings me right back to square 1. Yes said Paddy, its right behind ya, the moral of the story, you can go round in circles, and the answer faces you smack in the face
yer
 
lol
that's a cute joke
 
422
my typings a tad slow
:)
 
so you've got the onblur working, now here's the next trick. Can you format in place after they edit the field?
I'll give you a hint, you don't need the jQuery selector I gave you at the end, just this.value
 
422
hmm.. one mo lemme think
onblur="check(this.value)
?
 
hangon, I'm working on giving you a bit of a fancier function, give me just a moment
 
422
5:00 AM
sorry sure :)
 
that could probably be cleaner, but it's simple enough
and try this for field legibility (only works up to 6.2 numbers)
 
422
Thats absolutely fine, but... I want the value to remain for example 12345 instead of $12,345 so that when it gets passed to the db its cleaner to play with
 
so just apply the same "stripping" function when you goto the database
better yet, make it a method on its own where you pass a value in, like this (lemme update)
 
422
cheers, < we do really make this shit up as we go you know
pity your in the states, we could do with a freelance js fella working on this project, take the heat of us then...
brb
 
lol, I bet
 
5:08 AM
Hey all
 
422
gday @Diesal11
just looking now drach
 
Then when you goto the database, just use cleanMyAmount( $('#amount')[0].value ) and it's stripped
probably a fair simpler way to do that tho
 
422
thats cleaner ffs ! wicked
yeah we can sort the server side out a breeze, just client side i get stuck on lol
 
did you notice the inputbox formatting?
 
422
5:12 AM
hahah thats cool, you aint on email ( via here ) are you drach, could fwd private link to view the form i have made thus far
yes
 
use my nick here on gmail
 
422
#amount
okies, bear with me will update the file LIVE and send you link
 
422
you should have email :)
havent added the formatting, will do that later
 
the only thing I would change is the tags
 
5:19 AM
Morning, the early bird catches the worm... or something like that
 
if you have the option for them to be 1:many in the database then I would suggest
 
422
yer, they are a tad lame, was looking at whatshisnames from jquery..
remy sharps
gday @IvoWetzel
 
tagbox.blur(add new textbox below me for another tag if I am not empty)
tagbox.blur( if I am empty and I am not the last delete me)
 
422
I had considered that, but i actually got stuck. Bassasitance did similar with fields.
whats nice with your code, is onfocus it reverts back to inputted value
thats so sweet
 
so you've caught me as I'm getting ready to get off the net for the night and goto bed, but you've got the concept on blur and focus now, and you've got code to let you do classes.
 
422
5:22 AM
yer cheers for your help, really appreciate uit
it thanks
 
so use classes on the textfield instead of id's (since there should only be one id)
 
422
will do
bugger off and goto bed !
 
and onfocus do if ( $(class).length > 1 ) to find out how many there are
 
422
will check around see if i can samples of that
 
screw samples, play with it in jsfiddle
 
422
5:23 AM
< am a refiner not a designer
 
you've got all you need now, you'll need append
lol
 
422
ok
lol Uppend ur ass n goto bed
 
I'll go in a moment ;)
you know how we programmers get
 
422
just thinking....
the scripting, adds .00 to end of the numeric yeah
 
yarr, but try it with .91 or something
 
422
5:25 AM
so we would need to strip back everything after and inc. .00
sure, just thinkign about the strip before db stuff
the form element, wont accept characters, as no one lists a property for 123456.76
 
why not? seems a valid thing to do
but there's always Math.floor()
 
422
round down etc
 
422
k..reading
 
hey, anyone aware of a "relay" for web sockets? I have an existing socket server that i would like to interact with, but can't change it to accept a handshake
 
5:35 AM
@drachenstern Math.floor is valid
 
@YiJiang of course ;)
 
Also, that's a pretty long winded way to get the formatting you need
If you need to check for the validity of the input why not just isNaN(parseFloat(input))?
The question linked to in the comments should do the trick very nicely
 
which question and because I was doing it the naive way
in this case he wants parseInt tho
grrr stupid jsfiddle I just lost my last work :(
 
@422's, the one on formatting numbers into money
 
I only see jsfiddles, not questions
maybe I'm being obtuse here?
 
5:42 AM
1
Q: format number to price

422I have seen a few of these jquery things going on, and just wondered if there was a simple number formatting script. Essentially, all we wish to do, is format ( client side ) for checking purposes only, the number entered in a field. To show somewhere else on the page ( presumably in a div ) the...

I saw this question a couple of hours ago
I assume what he's asking about here is similar to that
 
oooh ok
 
Meh, @RyanDoom's answer is pretty bad
The OP to the question linked to in the comments gave a very neat solution
 
422
ooh back what have i done wrong lol
 
17
Q: How can I format numbers as money in JavaScript?

Daniel MagliolaI would like to format a price in JavaScript. Basically, I have a float variable, and I'd like to have a function that will receive that variable, and output: "$ 2,500.00" What's the best way to do this? EDIT: OK, since I haven't gotten any answers better than the code I implemented, plus my o...

or this one?
 
@drachenstern That's the one
 
422
5:44 AM
< prefer drachs version
 
  s = new String(i);
..... /facepalm
 
lol, @422 he's showing you a more elegant solution instead of the more naive solution
I was going for naive cos it was easy to read and understand line by line, but in javascript tighter is better
 
422
yer i had seen that solution, sorry wasnt critisizing. I dont need complex, just simple
 
like his suggestion for isNaN(parseInt(s)) was better
 
422
just a very simple client side solution
 
5:46 AM
@drachenstern parseFloat, we're working with floats here, eh?
 
it will strip out everything that's not an Int
@YiJiang no whole dollars
so 123.14 or 123.92 it's 123
 
-.-" And I though SFML was great...
 
422
our req.mnt is simple, we need to just convert say: 123456 to $123,456
 
They're missing friggin function to change the window caption!
World of hurt incoming...
 
@IvoWetzel Eh? What markup language is that?
 
5:49 AM
hey guys
 
@YiJiang A C++ Library for Windows/Graphics :P
 
422
SFML is a free multimedia C++ API that provides you low and high level access to graphics, input, audio, etc.
To know more about SFML, you can visit the features page.
 
I'm new to javascript, and have a simple question
 
422
nasser dont ask me LOL
 
@IvoWetzel Funny you're working in js then rendering to desktop applications
 
5:50 AM
ok, I'm off. Talk to ya'll in about 10 hours, probably. @422 I'll tell you now @YiJiang knows more about this than me ;)
 
@YiJiang I've got lots of game code and I don't want to port it to C :/
 
@NasserHadjloo around here we prefer if you just ask the question
 
I thought you'd get better performance if you use, say, something native to the Windows desktop
 
we can do pleasantries later
 
How to create a Yes/NO messagebox and write code for Yes and No button?
 
422
5:50 AM
lol < im just after a solution that works, but admit we need to get rid of the .00 thanks for your help @drachenstern
cheers buddy
 
night all
 
@YiJiang Well the wrappers are very thin, performance is already lightyears ahead of canvas
 
@NasserHadjloo A dialogue box like the one here: jqueryui.com/demos/dialog or the ones you get with alert()?
 
with 4 FSAA enabled
 
I just need a simple Yes/NO
For delete confirmation
 
422
5:52 AM
my wife says that all the time
 
@NasserHadjloo Try confirm('The question you'll be asking')
the value returned will the the user input true/false
 
and how to write code for yex / no buttons
 
@NasserHadjloo No need - that function is native to Javascript
 
wow- Thank you guys
 
5:53 AM
did anyone happen to see my question about websocket relay?
i just need to know if there is such a thing
if you have an existing socket server you want to interact with
 
Hey guys, Unfortunately, it doesn't work for me
it will delete the item no matter user select OK or Cancel
 
@NasserHadjloo Can you show us the code you're using
 
@BennyT I don't know of such a thing, but it should be trivial to do it in Node
 
function confirmation() {
confirm('Are You sure');
}
<asp:ImageButton id="imgBtnDelete" CommandName="Delete" ImageUrl="~/images/delete.png" Runat="server" OnClientClick="confirmation();"
ToolTip="Delete"></asp:ImageButton>
 
@NasserHadjloo return confirm('Are you sure')
 
5:58 AM
return didn't resolve my issue
 
@NasserHadjloo What does the actual HTML look like?
 
Actually the delete button placed in an UPDATE-Panel
in a gridview
 
I have no experience with ASP.NET, so I'm not sure what that code you have above will do
 
and I need a confirmation before delete
So what should I do
 
Can you inline the function?
 
6:00 AM
JS function?
 
OnClientClick="confirm('Are you sure?')"
 
let me check
Hey dude, It worked
what was the reason
whats the difference
 
@NasserHadjloo Not sure, there should be no difference, but I have no idea how the server side language work
Oh, and please, don't star that. Starring is for important messages - that message is meaningless to everyone else here
 
OK, Thank you dude.
 
422
leanr something new everyday
Never knew there was a star function
learn
 
6:12 AM
I need to create dynamic DOm Node from HTML like jQuery's $('<html>').
I am currently feeding the html string into innerHTML of a DIV. and then taking it as the Dom Element. Is this way good ? or I should I do it in a different way ?
 
422
ok so @YiJiang how do i remove the .00 from the pricing, we have coded here jsfiddle.net/ozzy/6y7Jc/13
should i change i = 0.00 to i = 0
k that didnt work
 
@422 If you're coming in from a string, like say "10.00", then parseInt should do
 
422
in input i am typing say: 123456
which converts to $123,456.00
will look at the fiddle again
 
If its stored is SQL Server in a Money Field
The Database Engine does the Conversion
 
422
no client side, we will de-engineer at the server
just for visual
 
6:26 AM
Then somewhere the underlying framework is doing the conversation
I donno .net
You better post in SO
However it seems an easy question though
 
422
i did earlier, we nearly have it sorted. As @YiJiang said, its parseInt but not sure on where to amend the code
note if you re edit, then click out it updates. But clicking back in to input element, it leaves a , in the field
 
then whats teh problem nwo ?
 
422
want to remove the .00
 
I think you need some kind of delegate that is triggered when the field gets focused
 
@IvoWetzel Ive never worked with node.js any pointers for references?
 
422
enter 42344
click outside of element, and converts to $42,344.00 and not $42,344 Thats problem 1. Problem 2, is go back and add to 42344 5678 so looks like 423445678 , click out and back in, and the value gets reamended incorrectly
brb
 
In your CurrencyFormatted()
Commenting the Line s += '.00'; solves the Problem
But your CommaFormatted() expects the DOT in numbers
even if its just .00 its expects one . atleast
 
@IvoWetzel ty
 
422
commenting out didnt fix it for me.
in script its just // to comment isnt it
/* in css and <!-- in html
well didnt know that multi line commenting with /* and */
in js
 
I wonder if this will work for you
It's a pretty naive implementation of the format currency function which is neither very readable nor efficient
 
422
thats it, just what i needed. It is purely for visual use
jeez u guys, thats 2 dead on versions. Both accomplish the task, which should we use lol
Thanks @user256007 and @YiJiang
 
Instead of writing a function that's reverse of the format currency function, you should just store the number away somewhere
 
422
we were gonna send the value to the db, and strip uneeded characters before inserting
 
Now someone Please Help me Out
I need to create dynamic DOm Node from HTML like jQuery's $('<html>').
I am currently feeding the html string into innerHTML of a DIV. and then taking it as the Dom Element. Is this way good ? or I should I do it in a different way ?
 
@user256007 Erm... what are you trying to accomplish here?
 
6:50 AM
myFunction('<div><a href="dfdf"></a></div>')
Hope its Clear ?
:)
Sadly I cant use jquery or dojo. I need to do this from scratch
 
@user256007 So you need to create a HTML fragment and feed it to a function
 
I need a function that creates HTML DomElement Out of HTML Fragements
 
var d = document.createElement('div'),
    a = document.createElement('a');

a.href = 'dfdf';
d.appendChild(a);

myFunc(d.outerHTML);
Unfortunately, outerHTML isn't available for Firefox
11
A: How do I do OuterHTML in firefox?

Sergey IlinskyThe proper approach (for non-IE browsers) is: var sOuterHTML = new XMLSerializer().serializeToString(oElement);

 
This answer has an alternative for outerHTML for Firefox
 
6:55 AM
No this way I need to parse the Huge HTML String and do createElements in the parse loops
and the way I am currently Doing is
 
@user256007 Oh, so you already have the HTML string
 
Yep
fakeDiv.innerHTML = htmlString;
now take the fakeDiv's children[0] as the domElement
 
@user256007 Okay, that's fine I suppose
I don't see any other way of doing this
 
Ya I do also think so. cause otherwise I need to parse the HTML strig and createElement() dynamically in the parseLoop()
string*
Just checking out is there already any complaints regarding this method
 
@user256007 There might be - I don't work with the DOM enough to collect enough experience for me to say for sure
 

« first day (29 days earlier)      last day (4926 days later) »