« first day (2050 days earlier)      last day (3121 days later) » 

05:09
anyone interested in debugging a scrabble game?
If it's vanilla JS, I am.
And.. not ES6.
hey guys. morning
Norming.
what does sudo -E bash - mean
this is on the installation page for nodejs
by that you mean its pure js?
05:12
yeah
curl -sL deb.nodesource.com/setup_6.x | sudo -E bash -
i dont get the second part after the pipe
there is only a drag drop library used...
I am not so interested in the UI
I wanna figure out the engine
Hi someone please tell me is there a way to do this...
var actualValue = deletingValue.innerHTML;
@Ming pipe to bash, and run as su, basically
@littlepootis if i am this
root@b1d01113b0c7:/# curl -sL deb.nodesource.com/setup_6.x | sudo -E bash -
bash: sudo: command not found
can i remove the last part?
05:14
yes
Remove sudo -E
keep the bash -?
yeah, keep the bash -
alright. thanks. btw what does -E mean? is it environment?
Looks like that script installs to /usr so you need root.
Yeah, it's preserve environment ... by deafult it's changed... for security reasons..
@littlepootis No way! As part of the js team you must join us! When a clueless newbie bash in and ask how to do 1+1, we educate him why he must use ES6 and introduce browserify and babel!
05:16
@Sheepy lol
That's actually very considerate given that we are moving to ES7. Yup.
@cswl yeah
@cswl But installing node and npm as root is not really recommended
@astrosixer What do you want to do? You statement may work fine, so there should be some context it is missing. Do you want to recover data from deleted DOM node?
So, when you install it from a repository as su, make sure you will be able to use it without being su.
@Ming After installing nodejs, do this: stackoverflow.com/a/21712034/1947276
Okay, that script sets up apt repository.. you need root rights for that.. .
05:21
@littlepootis thanks for the help :)
I havent debian in a long time... and Archlinux has package for.. . but you would use a node version manager anyway....
nvm is great for dev
I have a form containing 6000 input fields, I want to Ajax post in chunks of 800(or around) - any ideas? Tried to search without luck
What the f
What kind of forms have 6000 input fields?
05:26
@Jacta why?
The best kind.
@Jacta just stream it
I didn't make it, it's a lot of rules in a system in some tabs
@littlepootis For dynamically generated forms, that is not unheard of. But it may actually hit PHP's limit and be corrupted.
05:27
well that's really stupid
@Sheepy 6000 friggin input fields?
wow wtf
I've worked with 10,000 inputs form before
@Sheepy I'm hitting the limit, that's why I have to split in chunks
@littlepootis In the case I debugged, most of them are hidden. I think It's the category management page and it actually submits everything - name, order, hierarchy, status (many), etc.
hey guys, so I'm reading through the JS documentations. And I'm working on a tutorial where there's this code:

<script type="text/javascript">
            $(document).ready(function(){

            });
            function sendPushNotification(id){
                var data = $('form#'+id).serialize();
                $('form#'+id).unbind('submit');
                $.ajax({
                    url: "device_sendmsg.php",
                    type: 'GET',
                    data: data,
                    beforeSend: function() {
05:29
@SamIbraheem I read that tutorial too, however it was a trap
@Jacta While you can submit a form part by part, it may be easier to turns the form data into a json and transmit that instead.
@Sheepy If most of them are hidden, why even generate them?
@EnglishMaster can't stream, needs to be Ajax post
Now my questions is: what does this $('form#'+id).unbind('submit);
do exactly?
@En
that's a trap code
don't follow
05:30
@littlepootis For example, each category has "parent" and "order" which can be changed by drag and drop. And the buttons will change things like "enabled", "hot", "new". When you in multi-lingual text with a big tree...
@EnglishMaster I'm sorry I don't understand?
!!google it's a trap!
@EnglishMaster what does Admiral Akbar has to do with anything?
@Sheepy But they aren't filled up at once, are they?
> While you can submit a form part by part
I second this
05:38
@littlepootis The whole form is submitted. At once. I am pretty sure it is WordPress. But I forget which page it is or whether it is an extension.
Modified the original project for debug purposes...
also changed the shuffle logic for debug convenience...
I am trying to understand its move generation strategy
Did Javascript internally converted in c++ at runtime?
@Joshna Welcome to the JavaScript chat! Please review the room 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.
@Joshna No. Not at all. And your CPU does not run C++, either.
Then how it uses V8 which is written in c++.
05:41
You can regard V8 as a compiler that compiles JavaScript to assembly code.
The compiler can be written in C++, but it can also be done in other language. Java also has a built-in engine that compiles JavaScript to Java bytecode.
@Sheepy Thank you :)
@deostroll That's nice, arun. It's big, it'll take time.
@Sheepy Have a list item. Upon deleting its count or sl no should update.. Here is my code ...
function deletNremove(value){

                  var countTrelements = document.getElementsByTagName("tr");

                  var numberOfitems = countTrelements.length;

                  var deletingValue = document.getElementById("de_"+value).firstChild;

                  var actualValue = deletingValue.innerHTML;
                  alert(actualValue);
                  for(var k=actualValue;k<=numberOfitems;k++){
                      var valueOf = +k+1;
                      alert(valueOf);
@Sheepy That's awful. Tens of thousands of variables?
@Joshna You are welcome. Please be aware that JavaScript doesn't need to be compiled. In the early days JavaScript is simply interpreted, so there is no conversion at all (at least not into another language).
05:45
@Joshna machine code
@littlepootis Thousands of input fields. Doesn't mean each of them is an individual variable after the input is parsed.
Here is how i call the abv function...
1 message moved to Trash can
@astrosixer Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
@Sheepy So Javascript is interpreted into Machine code using V8. Am I right?
05:46
@Sheepy do you have an idea? Serializearray and splice? Anything else?
@Joshna You can write JIT-c for JS in JS, but it wouldn't be as fast.
@Joshna I see that I am confusing you lol. V8 compiles JS into machine code. That's it. :)
@Joshna compiled, on the fly
 <table>
                    <thead>
                        Shortlist
                    </thead>
                    <tbody id="needOnupdate">
                       <?php
                         for($i=1; $i<10;$i++){

                       ?>
                        <tr id="de_<?php echo $i;?>">
                            <td style="padding-left: 5px;"> <?php echo $i;?></td>
                            <td style="padding-left:5px; ">RockStar</td>
                            <td style="padding-left: 5px;">Minnaram</td>
@Jacta stream it
05:48
@littlepootis I can't stream it, needs to be posts
@astrosixer Sorry I think I have spend enough time here and I am eager to get back to work... hope someone else can help you.
thnx.. hope next time you will ...
@Sheepy
@littlepootis compiled on the fly is nothing but interpreting. Am I right?
@littlepootis I can provide some info on that part...
@Jacta Like I said, first thing I'd try is turn it into one json. (deflate it if necessary). If you insist on splitting it, there are many ways. Good luck~
05:50
onPlayerMove thats a good place to start I think...
@Joshna no
!!tell Joshna google compiler vs interpreter
you guys what do we mean by $(some_string)??
Depends on context
@littlepootis good, waht does $('#form').unbind() do?
05:53
@SamIbraheem removes event handlers bound to #form
It's jQuery
@littlepootis so when this is executed the submit button can't do anything anymore?
It depends on your markup.
If it's like
`<form method="post" action="/sub">[...]<input type="submit">`, it'll POST to `/sub`
@littlepootis the form doesn't mention any actions? it's just method, name and onsubmit?
what does the ubind do in this case?
If you have a .onsubmit (you shouldn't, when you're using jQuery), the onsubmit will be executed.
anyone here who can help me regarding typeahead ui-bootstarp?
06:00
Dear Excel 2016: If I type '000000 into a cell, I want a number stored as a text. It's not an error. Stop shoving it to my eyes everytime I do that. When I click "ignore this error", I don't mean "in this cell".
@littlepootis sorry does that mean that the unbind here is useless?
... also stop removing those goddamned dependency lines just because you're bored!
@littlepootis I can't be more thatnkful
so when we write: $(document).ready(function(){

});
does that do anything?
@SamIbraheem Yes, whatever you include between those braces will be executed when DOM is ready.
06:13
@littlepootis cool, does it do anything like malicious or harmful, I mean is it unsafe??
sorry for the stupid questions, the tutorial I'm following is written like that
@SamIbraheem $(function($) { ... }); is equivalent to $(document).ready(function($) { ... });
jQuery(function($) { ... }); is the safest, because it tolerates $ being overwritten, and puts $ in scope in the callback, and guarantees you wont get messed up by code loading another jquery. You will use the jQuery that existed at the moment your script ran
if you set event handlers or use .data and something else loads jquery again, you're screwed if you don't capture one jquery reference and keep it
@doug65536 thank you so much for caring, would you please check out this code?
 <script type="text/javascript">
            $(document).ready(function(){

            });
            function sendPushNotification(id){
                var data = $('form#'+id).serialize();
                $('form#'+id).unbind('submit');
                $.ajax({
                    url: "device_sendmsg.php",
                    type: 'GET',
                    data: data,
                    beforeSend: function() {

                    },
                    success: function(data, textStatus, xhr) {
ok. what about it?
$(document).ready(function(){ }) doesn't really do anything
Dear Microsoft, stop breaking my Back button with your help pages!
@SamIbraheem it is a selector that selects form with id id
06:26
Now I know that we're forming a URL that passes data through GET, but I have some questions:
1- $('form#'+id).unbind('submit'), what does the form#+id mean?
oops, edited
the form part is superfluous
superfluous?
pointless. useless. has no effect
but what if we have an HTML form after that?
please use jsfiddle. dont flood chat with code
or gist.github.com if it has no chance of running. doesn't matter
thanks
@SamIbraheem if a selector is tag#id such as form#foo then the browser really does a lookup for id foo, and if it finds it, makes sure it is a form, and if it isnt a form, no matching elements
the tag is pointless, it doesnt help the browser, it makes it do more unnecessary checks
and don't piece together ids
everyone is doing $('#thing' + i), and that is a terrible way to do it. it's getting annoying to constantly say it
use a class
06:35
@SamIbraheem The questions you asked can't be understood without a good idea on how JavaScript works. You may want to give it a proper study: Eloquent JavaScript
@doug65536 Or eval( 'window.thing' + i )
good morning everybody
@Sheepy :O
Morning~ Just finished my curry salmon lunch box. :D
8 hour difference
/me grazing at GMT+8.
06:42
@SamIbraheem does it not work?
@doug65536 I hit run and nothing is happening
nothing calls that function
I hope you arent using onsubmit or other ancient crap
whose brilliant idea was it to make devs scatter fragments of code through the html that runs at global scope
isnt it bad to store a list of json data in a global variable and doing the iteration again. Lets say there is a json response which have country,state and city. Actually I have 3 drop down in a html page named country,state and city. When a country is selected then the respective states will be displayed. Upon selecting a particular state,respective cities should be displayed. So I asked for 3 webservices but instead they gave me a single websevice which is having all couuntry,states and cities
and told me to store the whole json in a global variable and iterate accordingly
@SpringLearner It is not bad to give you a list of json. The number of cities in a country is relatively low, and is pretty static, so it saves you and them the trouble of lots of small requests by sending you the full list.
thats is how i do to set the token to the header
response.set('token', token);
how can i access it in nodejs?
06:49
@SpringLearner nothing is forcing anything to be global
you can store it, the global part is just thrown in for the hell of it
@Sheepy so you say its ok
you would need a gigantic object for it to become a problem
You can store it in a local if you want. Just make sure your onchange can access it.
js property access is pretty fast. nanoseconds
@doug65536 I am for now storing the response json in a variable
and every on change I am accessing it
06:51
great, sounds fast
you are essentially caching a lookup table
globals is a concern, but a few globals is pretty practical. You can also store it in some storage or a global Map object for storing ajax lists.
you have an IIFE scope around your js right? put it at that scope
no need for global
Or that. Yeah.
I wouldn't actually do that though, since it is async
asana moved to react
06:54
if you cheat and stick async data in a variable, you will screw up
lol when did that happen
@doug65536 could you please explain more this statement
angular 1 sucks seriously
it's a very slow JS framework
structure, yes, you get structure out of angular 1
but no performance
@SpringLearner IIFE. are you using jquery?
praise jQuery for simplifying DOM selector code
06:57
@doug65536 yes I use jquery
do you do $(function() { ... }); around the whole script, or some variation of that?
spring learner, do you mean you learn spring by "season spring" or "spring framework"?
@SpringLearner
@EnglishMaster why would I learn season spring. I am not a weather forecaster. Its spring framework
shit
i didn't know
I like Spring
"Nobody codes in Java anymore, they code in Spring" _ SpringLeaner
07:00
your reverse is true
I mean core java is really needed in all framework
let it be spring or hibernate or struts or jsf
anyway, if you get data from ajax, store the promise and use .then to use the response. dont sneak async data into some cheater variable that magically sets itself out of nowhere
@SpringLearner
As I said I have 3 drop downs, I am calling the below function when user selects the first drop down
function	 loadAllDTIDeviceDetails(){  $('#ctloading').show();
	 $.ajax({
		    type: "get",
		    url: "getAllOEMModelModelNo",
		    data: {"oem" :"2"},
		    datatype:"json",
		    success: function(response){


	    			totalJson=JSON.parse(response);
	    			getoemlist(); $('#ctloading').hide();$('#myModal1').modal({show:true})

		    },

		    error: function(e){
		      console.log(e); $('#ctloading').hide();
		    }
	  	});
	 }
you will run into a bug where it will not be set yet. then what? then you're basically screwed. use a promise
07:05
is the above proccess ok?
no
not okay at all. extremely bug prone. might work 500 times and fail catastrophically when important clients are watching
I am really confuses what promise you are talking about
do totalJson = $.ajax...
then dont even touch it in success:
then somewhere that needs the response, do: totalJson.then(function(totalResponse) { ... })
it is guaranteed to work, even if totalJson ajax request hasnt finished yet
$.ajax returns a promise which resolves when the response is received
would you mind if I start another room with you?
07:10
You would?
@littlepootis no I wouldn't mind
> "Can you clarify the last bit please? " Me: "The last bit is a 1."
*inner nerd snorts in laughter*
you made sure last ascii value had bit 0 set? that would be true nerddom
@doug65536 that would be the first bit of the last ascii value
bit 0 is far right
place values?
thousands, hundreds, tens, ones...
07:23
Depends on big or little endian
no, that is byte order
dude, is the number 500 writeable as 005?
Also I suppose it depends on your definition of first
of course not, bigger places on the left
the least significant digit is on the right, regardless of base
@doug65536 first can mean first bit read, not ones place
ever notice that << and >> have meaning?
07:25
guys i set the header by using setheader response.setHeader('token', token); shouldnt it be that when to access i need to write response.token??
because lowest place valiue is on the right because it is a number
...
......................
calm down
There are several interpretations here of first.
decimal: 135 <--- 1 hundred, 3 tens, 5 ones
binary: 110 <--- 1 four, 1 two, 0 ones
07:27
I think I'd know which interpretation I meant
LSB is rightmost
>> 1 divides by 2 because bit 0 is on the right
@doug65536 nobody is claiming the contrary on that point
ok cool then :)
We're nerds
but absolutely, the lowest byte could come first, or highest. endianness is an issue if you play with nodejs buffers
big-endian is the way we write numbers with a pen... little endian allows you to interpret a 32-bit variable as a 16-bit variable without changing the address
if you tried to use the low half of a 32 bit big endian number as a 16 bit value, you would need to bump the pointer forward 2 bytes
so, while it feels backwards, little endian makes slightly more practical sense
07:39
Heh, the GoT spoiler kick was enforced?
</slowpoke>
Also, mornin'
@Cerbrus o/
I haven't told a soul
Not even my wife, but mostly because she isn't interested in got
07:55
@Kob_24 what?
Someone here good with innodb recovery? I have a .frm and .ibd files for a wordpress database, and I need to dump all the data. Don't want to reconstruct the entire database/tables, just want to get as much data from it as possible. The files are from a MySQL on Windows server, and my recovery environment is linux :|
mysqldump
makes a gigantic source file in SQL language that recreates database (if you execute it)
Do you still have the chance to back it up properly?
mysqldump does not modify the database, it just generates SQL source code that would recreate the database if you ran it
Jesus saves \o/
07:58
@littlepootis It is properly backedup
@doug65536 Not sure how'd I do that :/ can elaborate a bit more or point to appropriate docs? Would be very very helpful :)
man mysqldump seems very scarce on readable help
it lets you just rebuild the db in fresh non-messed-up files
wait, your database server is still working?
What are you trying to do? Migrate?
08:00
Percona did it right
mysqlcheck is also relevant
@doug65536 hmm, just to ensure we are on the same page, I have the different table files like wp_users.ibd, wp_pages.ibd etc. so it will take one table file and dump the data for that table, right?
mysqldump dumps whole database
backups are at the DB level
08:02
a database has several tables
@doug65536 but I don't have all the tables from the database :( only 3
if you dont want some, no problem, just delete the giant create table statement / insert for unwanted ones
mysqldump generates sql source code, you can read it
it is human readable
He doesn't have access to the server.
He has .ibd, .frm files.
08:05
I don't think you can do anything with them.
The scenario is that windows crashed (how surprising) and with great pain I have recovered these files from a clone of the ntfs volume on a clean linux environment. fortunately the ntfs volume was in a clean state and shutdown when the crash occured, so the state of these files is guaranteed to be usable by inno if the tablespace ids are matched. but... I don't know how to do that :P
With no access to the server, those are pointless. You could spin up a local instance, copy the files and do an SQL dump
But you can't hear me so fuck it
hmm, there must be something he can do
@BenFortune I am using my custom chat client, no ignore support, and no plan to implement :P <3 ya
08:10
Yay. What made you ignore me anyway?
my guess is that since the data is still in these files, there has to be a way to just see that data in plain text
@room - anyone experienced a problem with drag and drop div's when the elment is positioned in the bottom right?
@CiaranSynnott Welcome to the JavaScript chat! Please review the room 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.
@AwalGarg They're most likely binary files that only mysql understands
08:11
@doug65536 yes but inno can still read it and decode to plain text for me, right?
Also I think .ibd files are encrypted
if you can convince it that the table exists, sure
if the server from which they were recovered can read them and convert them to plain text, what is stopping me from doing the same?
@BenFortune have username and password and all the passwords/keys of the server
@BenFortune they can be encrypted, compressed and fragmented AFAIR
@AwalGarg Ooh just remembered, innobackupex from Percona works directly with .frm and .ibd. Maybe you could try that?
08:12
PROFIT
@AwalGarg If you don't mail me source code I'll kill you
@AwalGarg Yeah
@doug65536 i generate a token when user try to login, i add this token to header and try to access it from app.js file
this is how i set the header
response.set('token', token);
console.log(response);
08:15
I implemented direct replies since then but still a wip
and from app.js file i am tryig to ge the header useing respinse.getHeader('token);
its allways empty
@AwalGarg Is that an IRC bridge?
app.js file is on the server side
@BenFortune nope, it is a simple chat client implemented from scratch. uses the websockets etc. from this chat.
@BenFortune looks like a SO chat client
08:17
a server proxies the socket connection and other things to the client
wait what, there is a API for chat?
@AwalGarg AMAZING
Not official, but I made one.
@AwalGarg through a CORS proxy ?
08:18
I don't need to use X anymore
you're using a browser just for us <3
@doug65536 no, it is running on my vps right now and isn't open-source either. I'd do it in summer holidays
but anyways, need to recover shit right now :P
0
Q: Drag and Drop at particular Locaion + Occupy space available in Main Div

Yo YoAs You can see in Figure 1 . I have a Main Div - which is Droppable With Four Draggables namely A , B , C , Fit. On drag Of A , B and C div into the droppable Main Div - It occupies the space as shown in Fig 2.Now if I drag another div (A , B or C) then it should occupy the space with respect...

08:35
@AwalGarg Why are you running WordPress (!) on a Windows Server (!) ?
is he? o.O
08:55
Hey anyone good with google
Nope. They hate me.
This has nothing to do with programming but I'm trying to find a picture of a last supper where a guy is surrounded by girls
Black and white t shirt guy on the left side of the screen.
He is smoking and staring at a computer.
... how to get scarred by an image without ever seeing it.
I don't understand does it make you feel bad? I like the analogy.

« first day (2050 days earlier)      last day (3121 days later) »