« first day (2246 days earlier)      last day (2705 days later) » 

4:00 PM
@Loktar a hard one
 
@rlemon Is splice really the only option?
 
@jake no, you can split the array up with slice and concat it back after removing the single entry
splice is the best option tho
arr.slice(n,x).concat(arr.slice(j,y));
just take from before and after the index you want removed
but that is not as nice
 
var parser = new DOMParser ();
var doc = parser.parseFromString (response.responseText, "text/html");
var name = doc.flashvars.name;
console.log(name);
doesn't work
 
neat
 
@Trasiva from dr. strange?
 
4:03 PM
"doesn't work" isn't descriptive enough to help tho
 
how to get name from flashvars
 
@Neoares Mhmm, I was making fun of @SterlingArcher's watch fetish.
 
Why are you storing variables in HTML?
 
what is flashvars?
console.log(doc);
console.log(doc.flashvars);
console.log(doc.flashvars.name);
try this, see what's up
 
@rlemon Thanks, I'm having c++ flashbacks...linked lists...vectors....pointers...
I swore never again
 
4:06 PM
@jake I mean, there is probably a dozen more ways to do it. but they're tedious and not worth going over. just use splice
 
@copy Tell me when you're up for some killing, my body is ready
 
@littlepootis you're from india or in india?
 
yeah, splice will work fine
>probably a dozen more ways to do it
Thats what makes JS is great
 
@jake arr.filter((e,i) => i !== someNumber)
@nickborti both
 
console.log(doc.flashvars) //undefined
console.log(doc.flashvars.name) //blank

flashvars is the variable in javascript/cdata
 
4:08 PM
@littlepootis which part?
 
!!> ['a', 'b', 'c', 'd'].filter((e,i) => i !== 2)
 
@littlepootis ["a","b","d"]
 
@nickborti pootisland
 
@Larry21 doc is a dom tree
why do you think you can access things like that?
 
@littlepootis This was the first method I wanted to use, but my array values are not unique ¯\_(ツ)_/¯
 
4:09 PM
@littlepootis cool
 
@jake This thing removes the element at index i.
And returns a new array without it.
 
magic
 
My first message isn't really correct.
 
@littlepootis yea, that works. but filter returns a new array. might not be wanted.
might want to actually alter the array itself.
 
a = a.filter((e,i) => i !== n);
 
4:12 PM
yea, now you're reassigning a
still not the same array and you now have to let the array
 
well, i thought since i can access the dom tree, I'm able to access the javascript data? Is there no other way to access that?
 
both are valid approaches, but they do slightly different things
just pointing that out for @jake
 
what's a good example of flow with react that would be helpful for developers to reduce the chance of causing an error?
 
@rlemon Both are good to know.
 
4:18 PM
@corvid Not exactly React, but JSX does help with providing a standard for creating elements, and it does warn you if you try to add invalid attributes to elements, etc. Useful warnings in that regards, but React's purpose isn't really about creating less errors.
 
JSX doesn't do that.
react warns about invalid attributes.
 
you can lint it as well to enforce a standard
but still wont reduce errors, just make it purdy
our jr. dev creates bugs and errors all the time
but it's linted! :P
 
In programming, the thing that reduces errors is knowing what you are doing.
 
^
There is A LOT of coding by coincidence
in this case.
 
I think 80% of mobx's code is typescript declarations and interfaces..
by volume, not weight
 
4:31 PM
Please accept my documentation change stackoverflow.com/documentation/review/changes/… thanks fams
 
Any of you guys ever use bookshelf-modelbase? I'm having trouble figuring out how to call its "update" function from a function I added myself. I feel like it's a dumb problem, I just can't figure it out. stackoverflow.com/questions/41064663/…
 
I couldn't get splice to work
 
i use bookshelf. no idea what modelbase is
 
@Luggage It's a thing that seems theoretically useful: npmjs.com/package/bookshelf-modelbase, adds findOne, findAll, update, and a bunch of other boilerplate basic stuff.
 
those are all on the normal models
and you can extend normal models without anything specia
 
4:37 PM
Anyone else seeing weird node-gyp failures today?
 
well 'fetchAll', not 'findAll'
 
Like 80% of our builds are failing today because of failures to install/build bcrypt
 
@OliverSalzburg Should I hold off on npm install?
ah
 
I want a js repl which lets me use devtools like cool stuff
in command lineish environment
does one exist?
 
4:39 PM
@JasonC I fail to see what it brings to the table.
 
@ndugger thats stuck in browser
 
This is so fucking annoying. I need to push releases today and everything keeps failing because of some stupid download
 
cant do require('k')
there
 
@Luggage It's got some handy Joi-based parameter validation and stuff, too.
 
4:40 PM
@jake the fuck?
 
It doesn't add much, just a little. Still, usefulness aside, the problem seems to boil down to a basic thing where I don't know how to call functions added to a previously extended model.
 
// of questionable utulity
findAll: function (filter, options) {
  return this.forge().where(extend({}, filter)).fetchAll(options)
},
 
Yeah; it's just I'd rather type findAll than copy+pasting this.forge().where(extend({}, filter)).fetchAll everywhere, that's all it is. Shrug
 
Anyway.. sorry, I don't know how their extends works.
I just use ES6 class MyModel extends bookshelf.Model {} and it works perfenctly
 
I see, so there are different ways for extends to work? Sounds like I should maybe look at the modelbase code.
 
4:43 PM
I even have my own base model extension for similar helpers. Works perfectly iwth ES6.
 
@jake I like it!
 
they use bookshelf.Model.extend({...}) which should be similar.
if i recall..
 
@Abhishrek In all seriousness, check out gomix.com
 
@JasonC that example is even long form just:
new MyModel()
.where({})
.fetchAll();
(not need for forge(), it's just a function version of 'new')
 
Would this statement be accurate that I can use node.js instead of PHP OR alongside PHP?
 
4:45 PM
Meteor is so weird. I go to my dashboard: Mongo returns 1 user. I go to the admin dashboard, then back to the normal dashboard, mongo returns 5 users, then runs again and returns 1 user again
da fuq
 
@JasonC I have similar helpers, but I think it's worth writing them yourself. Check out thier code. it's nothing you couldn't whip up in an afternoon.
 
@Abhishrek mancy-re.pl ?
 
1 file, 170 lines, mostly comments.
 
@Luggage Oh wait, it looks like they add update and such through the second parameter to bookshelf's extend, so I guess they are class methods and not instance methods. That's where I'm going wrong I think.
 
@jake I have, I work at a kinda competitor webtask.io
 
4:47 PM
yea, they are class (static) methods.
 
hello everyone
could I get a little help with something?
 
@Alex Do we get to choose what you get help with?
 
I don't quite understand what node.js is. Some sites seem to imply that you can just use node.js as an extension of sorts alongside your IDE to be a type of runtime resource manager. Other sites seem to indicate that node.js is a competitor of PHP, python, or ruby. Still others seem to indicate it can serve the same role as IIS or Apache. Are they all right, one of them, none of them?
 
@Vap0r all are right. node.js is just a runtime. Just liek python
 
@Zirak <3! I shall send you a goat!
 
4:48 PM
@Luggage I believe javascript would be the solution. do you have expertise in other areas too? xD
 
but you can make a web server out of it.. or a build system, etc.
@Alex I was implying that you didn't ask a question, so we can't help.
 
@Alex in carrying stuff.
 
@Abhishrek You may also have luck with jupyter (which is ipython) + its node backend. Never tried it, can't say how good it is, but ipython's pretty good, so
 
@Luggage ok, sorry. just didn't want to simply arrive here and drop the question
 
@Vap0r what languages or system are you most familiar with, for comparison?
!!welcome Alex
 
4:50 PM
@Abhishrek (I love Auth0)
 
@Alex 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.
 
Nah @Zirak mancy is all I need
@jake :D
 
It's actually our rule. We are tired of saying 'yes, just ask the damn question', like I am doing now.
 
@Luggage @CapricaSix thanks
 
@Luggage pretty evenly familiar with LAMP systems prior to OOP PHP, and recently (what I'm trying to figure this out for) is MS stack (Visual Studio, C#/ASP.NET/Web API, IIS, Sql Server)
 
4:51 PM
ok, so, what can you do with c#?
 
I wanted to disable the submit button in a contact form (using Contact Form 7 plugin in WordPress). The button should be disabled from start and it would activate when all required fields are filled. Any idea how I can do this?
 
ugh, wordpress.
 
I already asked a question in Wordpress, thought I could get some help here too
 
@Luggage that feels like a trick question. Program with it?
Create applications?
Compile and run? etc?
 
@Vap0r it is a trick question. The same thing for node.js. Anything.
 
4:54 PM
@Luggage but I can't run a web server on C#, right?
 
Sure you can.
just becasue MS wants you to go through IIS, doesn't mean you have to.
(note: you can also run node.js behind IIS)
 
@Luggage you mean by custom-coding a web server in C#?
 
@Luggage Ah, easy fix. I just use Bookshelf's save instead. I knew it was something noob. It's sort of clear in retrospect re-reading the modelbase docs.
 
There are lots of pre-made libraries out there for running a web server directly in c#
 
Thanks for the hints.
 
4:55 PM
in fact, MS has thier own, now, ofr people that don't want IIS.
(though, IIS and other dedicated web servers have an important role)
 
@Zirak lol
>
 
Wow. I never knew.
 
function (){
console.log('l')
}
function (){
SyntaxError: Unexpected token (
lol
 
@Abhishrek Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
Thats not code Cap!
 
4:56 PM
@Luggage and react.JS requires node.js?
 
not really
 
no. react.js runs on JS. node.js is ONE js engine
 
Why do I need JS engines? I thought previously they were all in the client's browser...
I imagine in node's case it would be for server-side JS
So if I don't need SSJS then I don't need node?
 
the JS engine is like the .NET runtime.
yea, if you don't need server-side js, you don't need node
C# can make a nice backend.
 
well hello there
user image
3
 
4:58 PM
@Mosho sexy.
 
@Luggage have you ever had to deal with reactJS in an MS envrionment?
 
I died
 
No. If it's all front-end, then it's no different than anythign else.
If you want to use react on the backend (to pre-generate pages), then you'll need node.
 
@Luggage I thought you work with MS environment
 
I have many year experience with .NET and know react well, but never used them together.
 
5:00 PM
Are you familiar with Web API?
 
Right now, I work with node/postgres/redis on a mac. Not really a MS environment
though I do have some C# I run in Mono
I was. It's been a few years.
 
though*
@Vap0r google.com <3
 
@Abhishrek you act like I haven't spent the last 3 weeks searching all this.
 
well, I'll help you out. webapi has nothing to do with react.
nothing.
 
you act like I have 3 arms and 7 toes and a thirst for vengeance
 
5:02 PM
a front end that uses react for it's view can talk to a backend that is using webapi, no problem. They are unrelated, though
In the same way that my pants and my coffee are unrelated.
 
user2620028
or your pants and you
 
@Luggage I mainly ask because it seems like many MS stack users that implement reactJS do so via MVC with razor syntax, and I was wondering if an app that consisted of almost exclusively AJAX calls would still fit into the reactJS paradigm
 
razor and react are redundant. they both solve the same problem, but one is strictly server-side (razor) and one is client OR server (react)
 
I need a help on Gulp.
 
if it's all "AJAX calls", then drop razor (or jsut use it for the bare minumim) and go react.
asuming you get JSON (or other formatted data) from the ajax calls, and not html.
@YuvaRaj Be more specific, please.
 
5:06 PM
@Luggage that was the plan. And yes those would be JSON returns into JS classes.
 
Then react can deal with that, razor can not. razor is only on the server-side.
also, razor outputs html directly. React uses all JS to make the html on-the-fly.
(JSX looks like html, but it's not).
 
@Luggage thanks a bunch man believe it or not the last 5 minutes of information was extremely difficult to find coherently on google (at least for me)
Now you had mentioned that if I'm trying to use reactJS but not have it on the server-side that my front-end environment should be pretty standard. In this instance, what would "standard" be?
 
@Vap0r on a side note you might want to read an article explaining SPA's as a concept
 
Ok. .pipe(gulp.dest('.')) generates index.html at the same directory where i gulp file exists. I want to generate in some other folder with custom name. (like test.html)
 
React and Redux make a lot more sense once you understand SPA's
 
5:09 PM
I mean, it's normal and unrelated to the tech used on the server.
 
redux sucks
I've said it before I'll say it again
 
@Mosho you suck! Don't hate my reducers!
 
@Mosho no spamming.
j/k :)
 
elm is nice because the compiler understands and can point out all the stuff that make redux suck in javascript
 
@Mosho try eve :D
 
5:10 PM
yeah I saw that
maybe
 
I 've tried with .pipe(gulp.dest('/test/test.html')) but it creates like test/test.html/index.html. I wanted to create at test/test.html.
 
but what sucks about elm is that no one uses it
 
@Vap0r is this new development?
 
@Luggage yes
 
I assume eve would have that problem too
 
5:11 PM
is it an insternal app or a public-facing e-commerce site?
 
@Mosho I kinda like Eve
 
@Luggage internal
 
@Luggage Hi I've explained. Can you help me
 
Then, this is what I would do: Make a React SPA all on it's own. No Razor. IIS can hand out the static JS files that you have fromt hat and pass the webAPI calls to c#
 
@YuvaRaj have you tried changing it to .pipe(gulp.dest('/test/'))?
 
5:12 PM
so c# JUST deals with data. No html.
With this plan, you will use node.js for 'building'.
but no node.js server.
 
It can be really great language for teaching basics of programming
 
@Luggage do you have a good article I can read on SPA? Some of the things I've read indicate that I might not want an SPA
 
@Vap0r It creates test directory and index.html is inside in it. I need to have test.html inside of test directory.
 
There are plenty, i don't have on off-hand.
The reasons you might NOT want a SPA are if you want really really fast initial load times (like for a public e-commerce site).
 
@Abhishrek huh? That's indeed a syntax error
 
5:14 PM
And also, that's perfect that's the exact setup I was looking for in regards to C# creating the data.
 
If you can afford to load for 1-3 seconds, just when you push a new update, then a SPA is basically like a local application that just talk to the server for data.
 
new Partial in TS 2.1 is awesome
 
I know the way it reported made me chuckle
 
or if you need to have your pages indexed in a search engine. that won't work in an SPA without more work.
 
@Luggage that's a good way of thinking about it. Here's what makes me think I might not want it... The application's front page acts as a dashboard showcasing information largely irrelevant to the purpose of the application.
 
5:16 PM
but for a internal app, that is unlikely a problem
It's relevant to the application if you want it displayed there..
 
This is for our maintenance workers, and currently it shows them app-related notifications, work orders from our ticketing system, and calendar events pulled through exchange web services.
Ok.
 
:(
 
but you can do some combination server-generated html (traditional asp.net MVC w/ razor) and client-side react
it's just more complexity, potentially
 
@Luggage oh, duh! That would work well, I actually have been writing the front page out using vanilla JS just so I could establish the data connections to those secondary sources displayed in the dashboard.
 
@YuvaRaj gulp is configured to copy multiple files, keeping the names. search for "gulp rename file dest"
 
5:20 PM
@Luggage from everything I described, does this seem like a good use of react?
 
well, I like react and would rather use it than server-generate html.. but I can't really say for you.
with react, I can change small parts of the page easily with new data, with server-genreated html, I have to reload blocks.
 
@Luggage I'm in agreement about server-generated HTML, but if my current applications are setup in this exact way (C#, Web API endpoints) except that instead of using reactJS I use vanilla JS classes that handle all those intracacies as well, it really seems like I'm not getting a whole bunch of benefits.
 
I have used Razor for years. It's a decent templating language for C#, but.. I have moved on to all JS. Why make some html in C#< then modify in JS? Why use two languages for that one task?
So you are trying to do everythign by hand, from scratch, is JS? no wonder you get 'no benefits'.
same thing as doing it all in C# without using any pre-made libaries.
lots of work.
 
@Luggage it just feels second nature to me. I feel like the only benefit I would gain from reactJS (in this instance) would be the ability to use JSX.
 
JSX is jsut some sugar on top of the real thing react brings to the table, managing the DOM.
deciding what parts need to re-render, allowing composition, etc.
and letting you simply re-render a whole section, not caring about efficiency and letting react optimize out the redundant changes.
Disclaimer: I have a crush on react.
We made out once at a party and I haven't been able to get it out of my mind.
 
5:27 PM
you don't really need a disclaimer, that was obvious :P
 
Why won't it call me back?
 
@Luggage I like it too, but a lot of the granularity that you're talking about is easily achievable the way I get the data. I retrieve it as "object" object is passed as params object to class. Class is instantiated with object properties. If I need to print the print function has eventListeners for everything that might need to be done and updates the object itself. When looking to update the server I can just check those objects that have updated instead of sending them all
Now I can see the benefit of JSX in this scenario, because this code:
            function printWorkOrder(item) {
                var work_order = document.createElement("div");
                work_order.classList.add("workorder");
                work_order.setAttribute("data-ID", item.ID);

                var item_title = document.createElement("div");
                item_title.classList.add("title");
                item_title.innerHTML = item.title;

                var item_info = document.createElement("div");
 
If you are happy with that, use it.
 
@Luggage I'm not trying to argue for vanillaJS, I'm trying to figure out what I'm going to say to justify reactJS, in my case at least.
 
hm.. well. JSX, by itself won't help, too much, but..
 
5:29 PM
Ahhh meteor is weird. You have to subscribe to the collection first :/
that's so weird
 
@Luggage thanks
 
How do you specify that a function returns a promise with flow, anyway?
 
flow?
 
@Luggage other than less cluttered code, what would be the clear advantage of reactJS over my approach in that code?
 
ohh, like flowtype?
with react, you don't directly create the elements and append them. You describe them to react and it figures out how to append/change/delete, etc.
Also, it does special things with events to both make them more efficient (event delegation) and more uniform between browsers (synthetic events)
and allows your components to have lifecycle. Like.. you can know when the <WorkOrder /> is being mounted to a page, or leaving it.
 
5:33 PM
@Luggage Thanks man. I gotta go for lunch, but I appreciate the help. I guess my learning style is "argumentative" but it's just I have so many incorrect preconceptions that I almost need you to directly refute them to move past them.
 
@SterlingArcher rxjs is wonderful magic
 
react or redux?
 
@SterlingArcher I use rxjs from within angular2
The hardest part is most of the guides I found were outdated, had to use github.com/ReactiveX/rxjs/blob/master/…
 
Meteor's front end "mini mongo" is weird
 
5:49 PM
@SterlingArcher in what way? It does have a few "oddities", like having only a super small sub-section of functionality
 
@SterlingArcher ugh, watch this asshole break some kids ankles
 
just for shits and giggles.
 
i.imgur.com/KSxnsEF.gifv dude jumps off hoover dam.
 
@Vap0r what I am demoing there, is that instead of just modifying the contents on fo div, it actually re-renders the WHOLE thing when the "showMore" value is changed. React is smart enough to only change the one div (and button text), but you don't do that, you write ONE render function that accounts for ALL cases.
 
is socket.io-client's docs down for anyone else?
 
5:58 PM
so toggleShowMore doesn't touch the dom, only changes variables.
@corvid yes
 
@KendallFrey @rlemon Mexitine.
 
that's taco bell fry supreme
 

« first day (2246 days earlier)      last day (2705 days later) »