« first day (1010 days earlier)      last day (3932 days later) » 

2:04 PM
1
Q: Application to find and replace based on Regex

wikiI usually use softwares like 'EmEditor' or 'Notepad++' for finding and replacing big texts based on regular expressions, but these softwares lack regex features like [\s\S]*,[\w\W]*,(.|\r)*; Any sugesstion for a suitable software(free or comercial) caplable of: 1. Handling very large texts; 2....

 
@edc Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
user1125394
SomeInnerClass h = someobject.new SomeInnerClass(); dirty java code no?
 
That shouldn't work
 
edc
I am trying to use dygraph in an iframe but I am getting a generic DOM Exception 12 when hovering over the chart. Anyone has idea on how to debug the problem?
 
user1125394
My_Play s= new My_Play(args);
My_Histo h = s.new My_Histo(args[9]);
 
user1125394
2:19 PM
but it's bad histo doesn't really need play stuff, got to change
 
user1125394
with more dependancy injection
 
blood spuurts
 
!this.gc && (this.gc = !(this.y < height && this.x > 0 && this.x < width));
 
in perfs the filter2 function is much faster than native filter
 
2:27 PM
@rlemon Change this ^
 
@Zirak no, it is beautiful.
 
This isn't a simple else, you can't justify it now.
 
also, the point i'm trying to get it how the hell do I do particle garbage collection
 
make a pool
 
set a flag and collect later using filter?
 
2:28 PM
and reuse particles
 
@rlemon The ES5 array methods aren't very fast, there's all kinds of extra logic involved.
 
@Loktar what if there is an indeterminate amount of particles.
 
increase the size of the pool as you go
 
user1125394
@rlemon is it supposed to have 3D effects?
 
user1125394
like the flow going towards you
 
2:29 PM
@Loktar so you are saying there is no way to do it efficiently.
 
perfs say it is must faster, but in reality I don't see it
 
user1125394
because if it's vertical, the particle should collide, anyway tat's not the big concern I know :p
 
using a pool is the most common method used
 
Yeah I've seen. for in over an array is iffy at best
 
2:31 PM
hrm.
... but that changes how I've always done this... now I have to change my style....
:(
you are no fun Mr. Brown
I need a msoke
 
I never use pools
even though I should
in Flash I used to, but js I never feel like it lol
 
So just making sure I'm not an idiot... When I assigning event handlers to multiple elements I generally do this:
for(var i=0; i<nodes.length; i++){
    (function(){
        nodes[i].addEventListener(...);
    }());
}
 
@Zirak talking about ES5 shim versions or core implementations ?
I think the core stuff is implemented reasonable fast
 
That's the best way to create a new scope for each right?
 
@twiz You forgot to pass in i, and check if you can use event delegation
@jAndy Built-in. The spec had you treat arrays as if they were sparse
And in the average case of dense arrays, this slows things down
I'm not saying it's not fast, it's definitely fast, but it could've been better.
 
2:39 PM
especially the implementation for Function.prototype.bind could be way better
its still about 52 times slower to invoke a bound method
which SUCKS
I love bind
 
It's pretty kickass
 
0
Q: Async function iterated calls

GaotterHi I'm new to using async calls in ajax. My problem is that I have two server "tasks" one that just checks if session is set (fast) and another that sets the session (slower). I want to check if the session is set and if not set it. And I want to try X number of times (I'm unsure if I really need...

 
@Zirak what do you mean about the event delegation?
and yea, I just forgot about passing in i
 
Hmmm I am a "dear"
Dear neal I am not looking for css class solution. Anyway thanks for the solution — HowToPlease 47 secs ago
 
@twiz often times you can attach events to shared parent nodes of all the elements you're attaching events to
 
2:42 PM
@Arshak92 Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@twiz Look into event delegation. If for example you're adding a listener to every child, think if you should only add a listener to the parent.
 
so you save a lot of functions
 
ohhhh ok
 
user1596138
@Neal That means you are "highly valued" or "precious."
 
@Jhawinsss hehe I have never been a "dear" on SO :-P
 
2:43 PM
like... ROOTElement -> child(fn) -> child(fn) -> child(fn) its ROOTElement(fn) -> child -> child -> child
 
@Neal Of course you are, you're my snickerdoodle.
(sorry twiz...)
 
hahaha
:-( you got my hopes up
 
Tough luck, bitch.
 
user1596138
So I have a Skype interview at 5pm today. Of course I got the laptop out last night and tested everything to make sure things go smoothly and I find out my mic is broken.
 
@Zirak Ummmmm
 
user1596138
2:45 PM
Nobody sells just a mic around here anymore. It's all headsets and such, or webcams with built in mics. So I had to buy a $30 webcam just for this interview.
 
Off to a good start.
 
you could have jjust propped up your phone...?
 
Weird that you don't have standalone mics
 
@twiz lol
 
user1596138
2:46 PM
@Neal 40 minute drive to the nearest bestbuy. Can't order one because it's at 5 and I only get out of work 45 before the interview.
 
@Jhawinsss any electronics store should have at least one
 
user1596138
@Zirak I voiced this opinion to the people working at Walmart and Radio Shack.
 
@Neal Apparently they didn't
 
@Jhawinsss haha oy
I am sorry
 
user1596138
@Neal The only thing within a half hour of me is Walmart and RadioShack. Neither had anything.
 
user1596138
2:47 PM
Eh. I can just return the webcam tomorrow.
 
user1596138
Unless I like it. I tried to pick one I thought I might actually like.
 
@Jhawinsss ha
 
Finally we can have decent internet sex
 
user1596138
@twiz Don't really want to use my phone... Haha.
 
user1596138
@Zirak :)
 
2:50 PM
0
Q: javascript insecure operation

Nejmeddine JammeliI have the folowing code : $("#btn_trans").click(function(){ var canvasData = c.toDataURL("image/png"); console.log("canvasData :"); var ajax = new XMLHttpRequest(); ajax.open("POST",'../rr.php',false); ajax.setRequestHeader('Content-Type', 'application/upload'); ajax.sen...

 
Good luck @jhawinssssssss
 
(see comments) And the winner iiiiiiis ?
 
@dievardump no one
 
user1596138
Thanks @Shmidddddty
 
I do not see why canvas-effect is pinned O_o
 
2:53 PM
@dievardump the terrorists?
 
@dievardump loktar wrote it
 
So that's awesome.
 
anyone feel like testing a stupid little chrome extension I made?
 
ArRrRrGGGggg
Dear neal I am trying to select only current element not parent using jQuery — HowToPlease 1 min ago
I am not a "dear" of this guy/gurl...
This OP has the silliest code...
 
@twiz Only if it works in Opera :P
 
2:59 PM
I'm the operator ... <sing> ... with my pocket calculator -- Ahhhhhwwgg catchy tune
 
@KendallFrey I mean I assume you can with that chrome extension extension thing...? ha
never used it though, so I have no clue how well it actually works
 
Chrome Extension Extension? O.o
 
A web page that allows all kinds of input (touch, mouse, keyboard) & to control a connected screen. http://www.forbes.com/sites/anthonykosner/2013/07/21/microsoft-internet-explorer-pushes-beyond-second-screen-to-companion-web/
 
Yea, supposedly you can use chrome extensions in Opera
 
@Loktar ok so assuming fuck particle pool (for now) - my gc approach is not horrible no?
how do you do it ?
 
3:04 PM
--
 
just make a list
 
> If there was one thing that iOS 7 should have copied from Windows (instead of all that flatness stuff) it would have been snap mode.
hahaha
 
add elements to the list
 
when they are dead, turn them off
when you need another particle, repurpose one from the pool
 
3:05 PM
anyway, microsoft just discovered websockets.
 
../rr.php I'm not sure this works. — Florian Margaine 13 mins ago
I think it acts according to the base if it's define in the HTML
So it could
But I might be wrong
 
I never remember if JavaScript XHR use <base />
 
user1596138
@FlorianMargaine Torch is pretty cool.
 
looks like it
 
user1596138
3:08 PM
But it feels like they're trying too hard.
 
user1596138
It's too good.
 
how does this sounds
Hosting the /tmp/StaticPagesWhichArePseudoDynamicForCaching
via Ngnix
generating them with jade and node.js
so node.js becomes just a small api server
nginx takes care of scaling and distributing its load [for static server] and node does what its best for :->
am i being a lil bit too tremendous ? Since i cant afford S3 / cloud hosting i am thinking of serving my pseudo dynamic pages like posts page / photos page etc via rendering them into the temp directory
and let the OS manage the space if the file isnt served for long it wont be touched and hence it will just be removed ... that way i can utilize proper caching , save my resources in a cost friendly manner... or is there a better way ?
 
Hey @FlorianMargaine I just found that
 
@Darkyen it's a good way
 
I think it's funny how torch's icon looks like firefox but it uses chromium
 
3:15 PM
@dievardump hahaha
 
@FlorianMargaine Just one question when is /tmp cleared ?
 
deleted :D
@Darkyen on reboot
 
is their any way to set it to autoclean every 7 day reboot or not ?
 
@Darkyen ever think of using something like cloudflare ?
 
@dievardump cant afford
 
3:16 PM
@Darkyen cron
 
@dievardump i have a budget of $20/mo for this app....
 
Even the free service ?
Better than nothing
 
true
but still i need a place to store my static pages :P
for cloudflare to get them ... right ?
i am making this proof of concept... i wil try to get sponsors or vps or donations or whatever helps me get s3 and cloudflare architecture in future.
if the app works well and people like it :->
 
then you can begin with a free plan
Like the nodejitsu one or appfog
Just to get the temperature and see if it worth anything to continue
 
^
 
3:22 PM
look at the banner
then look at the users prof pic for the Q neal was complaining about earlier
why do people nip random pictures of young girls for their prof pics.
it is 1) stupid, 2) creepy as shit if you are that girl
 
because attention
 
ask a good question and you get attention
 
"oh, a girl. She'll date me if I help her out"
 
want 1000+ views -> reddit with a catchy title
 
@dievardump well i am thinking of doing this : tell me what u think
 
3:25 PM
@rlemon Like "Pretty blond girl sitting on an upside down chair" ?
 
@Amaan Have you read Faust yet?
 
$5 x 2 servers vps's for api server
$10 x 1 server for db postgres

The api servers for now will have nginx and act as static storage space aswell,
using the *free cloudflare thingy* you suggested i can upscale my content delivery network
 
@Amaan Did you watch FLCL?
@Amaan What about Daria?
 
@rlemon lol wtf
 
@Amaan Did you watch Daria yet?
@Amaan And Evangelion? Have you finished?
@Amaan What about Firefly?
@Amaan Why aren't you answering me?
@Amaan Are you dead?
@Amaan FINE. ABANDON ME. JUST LIKE MR. TIDDLES.
@Amaan I guess you don't wanna know about our newborn babe!
 
3:26 PM
Zirak did you take your pills today ?
 
@Amaan Amaan Cheval Jr. can grow up with half a family then!
@Amaan I hope you're happy.
 
Oh, our newborn ? Are you British sir Zirak ?
 
@Amaan Actually, I hope you're very unhappy.
 
@Zirak What babe?
The babe with the power
What power?
The power of voo doo
Who do?
You do!
What?
Remind me of the babe!
 
@Amaan I'm moving to Hawaii.
@Amaan I found someone better.
@Amaan HE APPRECIATES ME FOR WHO I AM
 
3:29 PM
@dievardump any opinion on that model ?
 
@Zamboo Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
Am not that good concerning server needs.
 
stackoverflow.com/q/17791689/561731 reopen please <-- should be closed for typo and not as duplicate.
 
3:45 PM
@Neal it was op-deleted
 
@JanDvorak hmmm I see
 
There is an unsurprising number of libraries/files called "derp.js"
 
@Zirak Hahahaha, got to love this kind of welcome!
 
GUYS CAN WE DISCUSS THESE RESULTS? jsperf.com/aba/2
@Esailija @Esailija @Esailija
I summon thee with all my begging
all my begging power
to consider this probably-too-cute optimization
 
looking.
 
3:57 PM
The problem is that I have some classes with huge numbers of attributes
but in the most common cases
they are never, ever set from their default (null) values
so as I instantiate 5000 objects
that have many, many attributes
 
o/ Simon
 
I wonder if I can increase performance by virtualizing those sets of attributes so that they are only created when needed, in the uncommon case
@dievardump o/ Simon!
 
What if their default values are undefined?
Instead of null
 
Now I had tried something similar with undefined, and @Esailija showed that it was a bad idea, see here:
8
Q: Should I put default values of attributes on the prototype to save space?

Simon SarrisSuppose I've got a JavaScript function that I'm treating like a class - that is, I want to make many instances of it: function Blerg() { this._a = 5; } Blerg.prototype.getA = function() { return this._a; } Blerg.prototype.setA = function(val) { this._a = val; } This class has one attri...

 
By which I mean, what if you don't define them in the first place (don't even declare them)
 
3:59 PM
Right, thats what I did there
apparently that is quite bad to do, and this new way, each instance is still the same in terms of attribute count and specification
 
Do you care more about memory or performance?
Performance wise you'd like your object to be a C like array - that is sequential not too long memory containing only primitives.
You want to make reading and writing values super simple.
Lazy initialization has its benefits and pitfalls
 
@SimonSarris I would add a function prototype.placeholder(name, Optionnal val), and instead of always checking if (this._placeholder !== null) in all your getter/setters I would return this.placeholder('_q') and return this.placeholder('_q', val) and make the checks in placeholder() function
 
@SimonSarris What are you optimizing? Object initialization time? Is that your limiting factor?
If it is, and you're creating a lot of objects you might want to consider an object pool.
 
@BenjaminGruenbaum Yes, its largely an issue of initalization time of thousands of objects
 
@SimonSarris are you doing that over and over or only once?
 
4:03 PM
"Pure" is THE most annoying name for a library :) — Yotam Omer 34 mins ago
LOL
 
user1596138
Does anyone have shared-hosting with GoDaddy?
 
I use an object pool a lot for Points, Rects, Transforms, etc that are used temporarily in measuring/arranging/hit testing
but these are Nodes/Links/Panels/etc, object pool cannot apply here
 
user1596138
Lmao. jQuery is an "app" that you can install on GoDaddy's shared-hosting. How is that possible.
 
@SimonSarris Nodes as in graph nodes? What do you mean by panels?
 
user1596138
And jQuery is only supported on linux servers, according to GoDaddy.
 
user1596138
4:05 PM
I do not understand.
 
I make GoJS, and all the visual elements are Nodes or Links, which are made up of Panels (containers), TextBlocks, Shapes, etc
 
@SimonSarris I would do that, because of the number of your getters/setters jsperf.com/aba/3
 
You get thousands of elements?
Also, go-debug.js doesn't look very debugish on that website
 
user1596138
This doc at microshaft is completely wrong...
 
@goldsky Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
user1596138
4:19 PM
Not worth it.
 
Recommendations
For ECMAScript 5, I recommend to:
always use constructors
always use new when creating an instance
Controversial article hellooooooooooooo
 
@dievardump i love you and i owe you :->
thank you so much :-)
 
hummm... ok, well, you're welcome :)
 
@Darkyen ???
 
@SimonSarris Jealous much?
 
4:25 PM
What "???". Can't he love me ?
 
@SimonSarris he helped me a lot :->
 
@Zirak just wanted to know that to which he is referring!
alas alas
also I am jelly
 
i am having to make an app... $20 is the cost cap and i wanna scale it high
 
you love one simon but not the other
simonism, I calls it
 
i came out with a -okay- solution using 2 vps and 1 powerful vps for db
 
4:26 PM
omg you're jealous
 
the 2 vps will act as api as well as static
dievardump suggested me to use cloudflare <3
now the way my apps api is designed :P unless the content is changed it will save really really really high amount of requests for me :3
 
@ShoibMohammed Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
user1596138
GoDaddy just told me that they don't support any kind of compression on Windows hosting plans... But I just enabled it in web.config and it's compressed by 71% now... ?
 
@dievardump He doesn't base them on much, and he ignores Object.create
 
Hi all,
 
user1596138
I'm ready to switch hosts again. GoDaddy is the definition of stupid.
 
So another mediocre js article on the blogosphere, to be ranted on and ignored.
 
I'm having a hard time solving this jquery validate question: stackoverflow.com/questions/17739927/…
 
done using json almost..
 
any help would be greatly appreciated
 
user1596138
4:28 PM
Everyone needs to sign this petition to discontinue Internet Explorer.
 
@Jhawinsss Yeah, that'll show Chinese corporations and introverted companies wordwide.
 
Is that a petition or just trolling ? What would MS does with a petition showing that 50k web dev doesn't like IE ?
 
i didn't get your problem @jeremy
 
user1596138
It's a real petition. I posted it more as a joke haha. They would never discontinue it even if 100% of internet users signed it.
 
user1596138
Change.org is one massive joke. Those petitions do absolutely nothing, ever.
 
user1596138
4:33 PM
The actual letter even has "compliant" spelled as "complient."
 
Hrm. I may be a time traveller.
I thought "I'm thirsty", took the glass sitting near the monitor, and walked over to the kitchen. There, lay another glass, still cold, filled with the drink I was hoping for.
 
@Zirak We all are. What's hard is not travelling in time, unfortunally.
 
Options:
(1) I'm a time traveller
(2) Santa is real and decided to visit early (even though I've been a naughty boy, ask @Jhawinsss)
(3) I already poured myself a drink, but forgot to take it.
 
(4) All of the above
 
user1596138
^^
 
4:36 PM
Basically, I need the "Please complete the required fields" text to remain until the last invalid field has been cleared. @Shoib Mohammed
 
user1596138
@Zirak You said that was our secret :/
 
@Jhawinsss About that...I only said it so you'll agree to do #31.
 
-1
Q: does it make sense to use Go (golang) without Google App Engine?

Daniele BDoes it make sense to use the Go programming language without deploying it on Google App Engine? if so, which is the most convenient way to develop using a mac and automatically upload/deploy to a linux server? many thanks

 
user1596138
@Zirak Was that the one with the goat...?
 
@Jhawinsss awww yeah
 
4:39 PM
So... google has failed me. I've got jQuery mobile styling some stuff (not my choice to use jqMobile.) I'm trying to enable/disable select lists... I'm explicitly calling selectmenu() on these lists, then selectmenu("enable") selectmenu("disable") getting an error: Uncaught Error: cannot call methods on selectmenu prior to initialization; attempted to call method 'enable'
 
user1596138
This petition has been running for over a year and only has 2K signatures... Hahaha.
 
user1596138
@Shmiddty Fiddle? :P
 
m59
              var wait = setInterval(function() {
                if (!foo) {
                  clearInterval(wait);
                  getTemplate(item);
                }
              }, 10);
what's the fastest I should set that too?
without becoming a performance issue
Probably should never last more than 100ms total, but I need it to kick in asap.
 
@Jhawinsss can't recreate >.<
 
@m59 Hum... why you do that ? Because of async ?
 
4:46 PM
7658
 
user1596138
@Shmiddty Hmm... Well I've never tried to do it. Sorry man.
 
user1596138
Can anyone tell me why my website is 10kb larger when loaded with www.SITE.com vs just SITE.com???
 
user1596138
Reverse that.
 
@Jhawinsss No idea.
 
user1596138
It just doesn't make any sense to me.
 
m59
4:48 PM
@dievardump yeah. it's a pretty strange one too. I've been able to deal with it in more desirable ways in the past, but the other options end up costing more performance than this (I think)
 
user1596138
The www is registered as a CNAME in my dns panel. Because that's how I understand you are supposed to do it. I haven't messed with domains much. But it should be the exact same thing I thought, not smaller when it has www in front of it.
 
m59
actually, it may be less work with other options, but it slows down the display of certain things. I'd rather not do that.
 
@m59 why don't you use callback ?
If you have asyn, you have callback
 
m59
lolzzzz, that's the funniest part
 
I figured out why it's happening
jQuery mobile doesn't play nice with class names
 
m59
@dievardump yep, it's complicated. "Foo" IS a callback
 
user1596138
@Shmiddty That's wild. I tried it with an ID and it worked the way it's supposed to.
 
@m59 what ? No. You can not. Change your way of doing things man.
 
@Jhawinsss yeah, that's what I did first
thus ("can't recreate")
 
user1596138
4:53 PM
Weird...
 
aggravating
 
user1596138
God dammit!! GoDaddy is the worst host ever.
 
because my use-case doesn't make sense to use an ID
 
user1596138
I've had gzip compression working at 71% for an hour. Now it isn't doing anything.
 
m59
@dievardump The functions are kind of dependent on one another, so whichever gets to make the call first sets a callback that they can all check for. If one is already making the call, the others skip ahead, but then have to wait for the result
get what I mean?
other choice would be to hold up all of them to wait for the one result? why do that?
 
user1596138
4:55 PM
@Shmiddty Right. Doesn't it have something to do with the way jQuery uses $? Change it to the way normal jQuery works?
 
m59
Then you'd probably ask why not just move the code around, but that won't work either in this context.
 
user1596138
Nevermind.
 
user1596138
That works.
 
no, that's awful >.<
 
4:58 PM
Holy shit. You guys seen this? indiegogo.com/projects/ubuntu-edge
 
user1596138
No I meant the IDs. I hadn't seen this fiddle yet.
 
m59
@dievardump actually, I mis-spoke. They are all exactly waiting up for that one result, but this is kind of an automated angular thing I'm using. As far as I can tell, they can either all make the call and only use one result (the others won't be needed), or set a flag for them to wait if one is already getting it.
 
@twiz I'll believe it when it starts shipping
 

« first day (1010 days earlier)      last day (3932 days later) »