« first day (1053 days earlier)      last day (4120 days later) » 

09:00
@dystroy - There isn't anything different at all, I've really had a good look at this as I don't like to ask questions lightly
@DaveRandom - it's running on my local machine :( could screenshare it on skype if you would like but that might be a bit much
@HanningtonMambo Using JSON files as storage is common but reading a file isn't usually faster than querying a database.
Sam
Sam
@mikedidthis Hell Did :)
@Sam urm... hi
@dystroy here is the when.js benchmark running on node 64 bit results pastebin.com/nA3YVsdy
is it possible to see which function is called when using a website ( js function ) ?
09:03
@martincarlin87 There must be something different or it would be working. Computers do precisely what you tell them to ;-)
I had to change some elements on a website but now 1 thing isn't working anymore and I would like to see in a previous version when that function got called so I can solve the problem.
I stull suck at x-sequence because I am doing it recursively which is a big no-no
@Esailija And when are you doing the github repository and the shiny web page ?
@martincarlin87 Where would you put it when it works? Can't you create a subdir on the server for a public demo?
@dystroy in the weekend probably :D
09:04
Where's the "stull" sucking bench of x-sequence ?
still*
Sam
Sam
@mikedidthis urm
by "x-sequence", you mean "defer sequence" ? Or what ?
defer sequence and promise sequence
I am doing well on defer sequence because my async enforcing class is superb
@DaveRandom - it's running on my local machine and live server is internal use only but give me a few minutes and I'll try and create something you can access
09:06
thanks, dystroy
it allows you to defer function calls with literally no cost
@martincarlin87 If you pastebin the HTML file and the JS file that should be OK
10000 chained promises is the kind of things I would be interested into
@DaveRandom - ok, coming right up
in real code there is no more than 20 items in a sequence at best
09:07
i used json to access some bulk data on a site before; it was blistering fast! I thought it couldnt have been getting it from a database that fast... eg using datareader to get 10,000 records in a json text...?
the example I showed had 4
or 5
10000 would be quite ridiculous and probably never even achieved since an error happens for sure in one of them
:D
@Esailija How is expressed using the promise semantic a loop generating 10000 asynchronous actions ?
10000 parallel promises, not sequential
but if the order is important (there are side effects) ?
doesn't matter
you will only use sequence when there is a real sequence like read users then read their data
09:10
that's what happens
basically there is dependency on having users before being able to read their data
@DaveRandom - HTML: http://pastebin.com/rEb8FdQR (it's fairly big, sorry, but wanted to be complete)

JS - http://pastebin.com/csDdfX0V

Example Server Response from Ajax Request: http://pastebin.com/Ssyp0ZwH
@dystroy can you give me an example where there is sequential dependency with 10000 items
@martincarlin87 kk no worries, I'll look at it in a few mins
if you just want to get 10000 requests done and get the results in-order in array, you can use Promise.when
09:13
@ThorA.Pedersen 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.
the promises will be parallel so there is no recursion
another names are Promise.all, whenAll etc
I'm trying to adapt to the semantic. Let's say you have 10000 files (handling order important). For each of them you have to read them and do a few sequential db operations and write the results (order dependant) in a local object structure. How would you write this ?
create my datareader, loop through the rows of data, perform operations inside the loop (if necessary), and display the result at the end of the loop...
Can Promise.when ensure a sequential order of execution by contract ?
Promise.when( files.map(function( fileName ){
    return doRead(fileName)
})).then( function( filesData ) {
    return Promise.when(filesData.map(function( fileData){
        return readDataBase(fileData);
    });
}).then( function( databaseResults) {
    //Do something with 10000 results
});
is that what you mean
09:17
I have a problem.
if there is no sequential dependency you can just run them in parallel
wow! that is completely new term to me
I didnt realise you were talking to me at first; well interesting concept
In your story there is no sequential dependency, you can create an array of 10000 items and have the promises run in parallell and then after they are done, you have the data structure (10000 items in array)
Great! MUST try.
the sequential dependencies are reading a file and then reading database after that = 3 sequential promises if we use error handler
09:20
but you have excited me to open up another closest of what i think is my worst code in this project, too
I have drawn a map on canvas in html5.
I'm ok with your answer but sometimes you need to do 10000 things in order : suppose you write in a stream that you immediately push the results of the reading of the files, and you need to respect the order of the files.
it has 250,000 lines of code to render. takes about a 3 seconds to render on local machine
they are in order
ok. It's by contract ?
.when is not specced
I have some quick implementation for it
Promise.when = function( promises ) {
    if( !isArray( promises ) ) {
        promises = [].slice.call( arguments );
    }
    var ret = Promise.pending();
    var len = promises.length;
    var values = new Array( promises.length );
    var total = 0;
    function succeed( val ) {
        values[ indexOf( promises, this ) ] = val;
        total++;
        if( total === len ) {
            ret.fulfill( values );
        }
    }
    function fail( reason ) {
        ret.reject( reason );
    }
    for( var i = 0; i < len; ++i ) {
09:23
does javascript have a way of keeping that memory so it is does nto have to run through the entire code with every page refresh?
the indexOf preserves the order.. but it could be slow with 10000 :D
Wouldn't it be cheaper, with a big number of promises, to pass the index using a closure ?
I haven't thought about it at all, I am still doing core
I am following/enjoying your conversation...
Is this optimization important ?
var values = new Array( promises.length );
09:26
yes
it's a fixed size array and I know the size
yes, I understand that, I just often wonder if it might be worth the pain
well same as in Java
new ArrayList() vs new ArrayList(capacity)
the former will resize dynamically quite a lot if you have like 100k items
in Java the underlying code is clear and visible. V8 magic is less evident to me.
it's an obvious thing to do
like .substr not allocating new string beacuse strings are immutable
any reasonable browser will preallocate
09:30
OK, I must leave to hunt some tomatoes. See you later.
@JanDvorak probably even interpreters did something with it.. it's just completely useless feature at language semantic level
if it didn't preallocate
@DD. 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.
DD.
DD.
hello @all, i'm getting ( ReferenceError: Can't find variable) even though i have added css and js files in the respective folders. any idea on this ?
@DD. use a browser debugger like firebug and find exactly what line and variable it supposedly cant find
DD.
DD.
09:45
<script>
var mySwiper = new Swiper('.swiper-container',{
pagination: '.pagination',
paginationClickable: true
})
</script> this is the place where i get that error, @jsky
@DD. yeh im not sure. it cant find mySwiper? should there be a semicolor after the new Swiper();
semicolon*
@sharath 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.
user235273
Where is Swiper defined? Is it included?
how to implement twitter login in website using only js?
i have really tried a lot
and got a js called codebird
but it is a two step auth
i need a single step auth
like in teetsharp
tweetsharp
It's probably two-step because you can't have one-step auth
09:51
no there is single step auth
i have seen in many sites
@sharath Well try those then
but i dont have any js file available
i ment i have seen sites using single step suth
*auth
i need a plugin
DD.
DD.
tried with swiper(); also, still same result @jsky
i'm able to get the "photo swipe" output when i run that as a seperate project, but after including the same code in my project i'm not able to get the full page swipe, instead all the images are populated in one slide @kadaj
can i ask knockout.js problem here
?
10:06
0
Q: Please help to make my js code better

setbackAny suggestions how to make this code better? I'm novice in coding...)) In this code I'm want to show some hint depending of browser type on semi-transparent overlay. I'm detecting browser type (I'm need - Firefox, Chrome, IE 9 and higher), create all nessesary elements, append this elements to a...

@Neil do you know?
how to do it?
anybody?
its a great challenge guys
i have searched for it really har
hard
http://stackoverflow.com/questions/18589580/free-server-for-running-socket-based-application
@sharath No, sorry
somebody??
please
its been 3 days now
i am soo desperate
@sharath I am the one who knows twitter login the best in here i guess
and i FUCKING GAVE UP ON DOING IT CLIENT SIDE ONLY
lets see they ask you to ENCRYPT EVERY REQUEST
and SIGN IT WITH YOUR ACCESS_SECRET
if you do it client side you will essentially give your client id and client secret to the user
and ... then you can be hacked with ease!
so listen up on an advice
10:16
ok
DO IT IN PHP and implement an OAuth2.0 like workflow wrapping their OAUTH 1.0
No no, i don't want to get text, i want to change it: 'Hello world! to <a href="#helloworld">hello world</a> So: another part of html need keep away from change — Anh Tú 4 mins ago
Pfft
and get it hosted on a free host :P
Why do people keep asking stuff then change the requirements
// For us we did the same on our api server
but still you wont be able to make requests :P
so yeah just use any php based lib and use XHR to call it
10:18
@AbhishekHingnikar i asked this twitter login using js because i need to use android phonegap
in android phonegap i can use either a twitter login plugin or using js
i cant get a working phonegap plugin
so i am trying for this js
i am finding it really hard
i cant find any
@TBA 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.
TBA
TBA
Hi friends, can anyone please help me with AJAX?
@TBA you can't cheat the time, if that's what you're trying to do
TBA
TBA
@JanDvorak Sorry I dint get :(
@TBA show us your code ;-)
TBA
TBA
10:23
k sure :) @jan
@AbhishekHingnikar is there any way i can get a js to make twitter login
WHAT DID I FUCKING SAY
TBA
TBA
@JanDvorak Please find the code function GetMinMax(code) {
    debugger;
    var minKey = code + 'MinValue';
    var maxKey = code + 'MaxValue';


var href1 = '@Url.Action("GetMaxMinFromConfig","Account")';

            $.ajax({
                type: "GET",
                url: href1,
                async: false,
                cache: false,
                dataType: "text",
                traditional: true,
                contentType: 'application/json',
                data: { minValueKey: minKey, maxValueKey: maxKey },
NO NO NO NO NO NO NO NO NO NO NO NO
!!tell tba format
10:26
@tba Format your code - hit Ctrl+K before sending and see the faq
THERE IS NO SAFE WAY TO DO IT .. yet
@TBA why are you using async: false?
@AbhishekHingnikar ok so i am doomed
TBA
TBA
@JanDvorak Well I need to wait for the result before moving to the next line.
@sharath WHY CANT U GET A SERVER ?
10:27
@TBA how come? You should refactor your code so that you don't need to
@TBA most likely you should send the neccessary config during the initial load
TBA
TBA
@JanDvorak oky , the problem was I might have a DB hit on the MVC controller, hence it may take some time. Since I am calling this on a drop down change. On change I should get some values from web.config file.
is the web.config too big to send at once?
@AbhishekHingnikar dude i told you . i am trying to do an android app using phonegap and i can use only js
thats why
TBA
TBA
@JanDvorak no the real problem is lets say I have countries in drop down list. For each country I have a min and max value defined in the web.config value. Hence on change I should get that web.config entry to continue the calculation
@sharath and why can't u have a server-side ?
why ?
whats wrong with it ?
10:33
@TBA <option value=... data-min=... data-max=...> wouldn't do?
costs : since all u need is login, costs should be free with a php host -> if u grow then get a bigger server , if this is for work tell them to fucking give u a server
TBA
TBA
@JanDvorak Sorry I din get that?
@JanDv
@TBA you could send the min/max for each value in the dropdown during the initial load
TBA
TBA
@JanDvorak Min and MAx should be configurablke.
and update at realtime when someone changes them?
10:39
setInterval(function(){ document.body.style.background = '#' + Math.floor((Math.random() * 16)).toString(16) + Math.floor((Math.random() * 16)).toString(16) + Math.floor((Math.random() * 16)).toString(16) ; },10);
I dare u to run in any tab
@AbhishekHingnikar cute
@GrigoryKalabin 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.
La zorra café veloz salta sobre el perro perezoso
is that spanish?
10:46
yes
its Google.Translate.Spanish
10:58
Is the capture option required in an addEventListener("eventType", functionHandle, capture) method?
!!mdn addeventlistener
nvm
What do you suppose the most standards-compliant browser is?
used to be Opera
now I think GC+FF are pretty much tied
Do they have the full implementation?
what level of standards?
11:06
All
@yantrakaar 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.
then no
Chrome doesn't support input type=date, IIRC
Here's an offbeat question: can you assign an object to an input type=hidden's value?
Or just text
why would yoou?
Not sure, just popped up.
11:10
you can't send such object from the server or to the server.
Is there a site that runs a comparison of w3 standards against the browser implementation?
yes
apart from the acid tests, you mean?
ooo where where?
I have no idea what an acid test is.
!!tell logical google ACID tests
11:13
#1
I created a jQuery plugin and I want to put it into a cdn... How can I do this?
which CDN?
I don't care... Just to be fast and to be able to access it..
What site runs the comparison?
I'm guessing the acid test is a run-through of the implementation on the browser.
11:17
@JanDvorak Do you have an answer for me..?
@Johnツ step #1: choose a CDN
@JanDvorak Which are the options? I want a free cdn.
there's no such thing as a free CDN
maybe Gooogle App Engine
@Jan Thank you. I didn't even know about some of these things.
How can I stop my web page make a server request for next 45 sec if the request was made now and showing same page for that interval on every refresh ?
11:21
I'm guessing that IE11 will have better HTML5 support.
than who?
@yantrakaar setTimeout(function() {clearInterval(intervalName)}, 45000); would probably work.
Than 10
@JanDvorak Thank you, then I will not use a cdn...
        var data = $("#initialsPaymentsData").serialize();

    $('.cash').on('click', function (e) {
data.push({
        name: "PM_Type",
        value: "Cash"
    });
});

$('.creditCard').on('click', function (e) {

data.push({
        name: "PM_Type",
        value: "Credit Card"
    });
});

$('.cheque').on('click', function (e) {
data.push({
        name: "PM_Type",
        value: "Cheque"
    });
});
Can we use it like this ?
If you're not talking about an interval, use a variable switch and go setTimeout(function() {switch = false}, 45000) and if (switch == true) {make request}
11:27
@LogicalAngel I mean when the user refresh my web page . coz all the scripts will be loaded again right ?
Yes. Just to make sure, do you want to make it to where you can only request once every 45 seconds?
@LogicalAngel yes , even if the user refresh his page in that 45 second interval he should see the same page . if he refreshes the page on the 46th second then server request should be made .
@LogicalAngel The timer in the setTimeout will keep running even if the user refresh the page , right ? and wont reset even if the user refresh page manually ?
I have no idea. If you refresh the page, all intervals and timeouts will be cleared. If you have server write access, maybe you could write "true" to a text file, and check to see if the file's contents = "true"
@MBehtemam 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.
It would be kind of complicated to do, I think.
11:33
@LogicalAngel ok so in my case setTimeout is not the solution
ok . will do some google search . thanks :)
Hold on a sec.
Can you write files to your server?
I am doing it on localhost . so probably yes .
Okay. Maybe you can write the time to a file, and compare the time in the file to the current time and if there is not a 45-second difference, then execute your expressions.
A cookie might work, as well.
Instead of writing to a file. Would make more sense to use a cookie, I guess.
11:38
Yes , but I will have to do it on server side . I mean by using php or other backend language?
If you write to a file, you'd have to use PHP or some other language, yes. It would be a lot simpler to write the time to a cookie, instead.
cookie
nice idea
thanks thats should work I guess and with no server request :D
munch munch
Or maybe, just set a cookie with a 45-second expiration date.
Would spare you the effort of comparing times.
much better thanks :)
!!summon 29074
11:45
@mikedidthis Registered; need 0 more to execute
!!summon 29074
@mikedidthis Already registered; still need 0 more
@CapricaSix silly bot.
11:49
!!summon 29074
@JanDvorak thank you.
Room owners only can summon?
Says or two unprivledged users
shrug
makes sense
@JanDvorak yep, it does. Thanks for the summon.
Maybe the 0 was like an array 0. Hm
11:53
@LogicalAngel I presume 0 / 1 are the switched for privledged
Anyone know Firebase API?
@IlliaRatkevych 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.
Well, it was in the context of needing n more, and it worked with the second user's attempt.

« first day (1053 days earlier)      last day (4120 days later) »