« first day (2494 days earlier)      last day (2453 days later) » 

12:02 AM
 
the list only captures a narrow subset of problem solvers and gives no credit for more specialized knowledge.
 
first biggish print
one of Reapers guns for my daughters cosplay
 
oh snap
nice
 
Thanks, priming it now which is making all the imperfections come out
but meh still looks cool
 
is that glue?
 
12:03 AM
no, wood filler for the cracks
It was printed in like 6 parts or so
 
sweet
 
the main line in the middle is the 2 main parts, but the handle + trigger were a few
 
I haven't done much with multipart prints
 
I just used super glue to glue them altogether though worked well
also has a wooden dowel inside of it
2 days or so to print everything lol
I need another printer! haha
 
the dowel holds it all in place?
 
12:04 AM
yeah mostly, all the pieces had a hole for a dowel or rod
then I super glued each section in addition
 
I was wondering about that
You should play around with welding the cracks together
 
yeah I was looking up stuff on doing that
 
I wonder if that would look at all good
 
seems so toxic though, all the stuff you can use
apparently with ABS though it's pretty easy to do I guess, but PLA is a bit more tricky
but yeah man loving this printer, Jacob is going to be McCree and my son Gavin is going to be Soldier 76
so tons of work ahead of me for the next 2 months lol
 
@Loktar I probably wouldn't try any solvent for PLA, I was thinking heat welding
I never got around to trying flame polishing
But it should work
 
12:08 AM
oh yeah there is this stuff, xtc3d I think it's called, it's this epoxy you can put over pla
I was thinking about trying it out as well, but it's more for the finish not structural
 
Have you seen the welding technique with a drill and a small stick of filament?
It's pretty sloppy, so you wouldn't want it for looks
 
no actually, I'll have to look that up
 
holy shit
that's pretty cool just put it in a dremel
 
12:44 AM
good morning lovelies
 
morn
 
1:31 AM
guys
im having trouble with my query with multiple condition.
 
does anyone know how to import html into a react component?
i've tried the html-loader web pack loader but i'm not having any success with it
the reason is i want to practice working on html/css in the context of an already existing react app i'm making
 
I have column machine,date,model.
machine has an array of machine. so ex:
select * from table where model='D10' and machine='1' or machine='2' and date between '2017-01-01' and '2017-01-10'
the problem is that some of the machine is not fulfilling the requirement of the query. Sopme model col has no value and the date is not accurate
 
assign it a variable and import it like you would anything else.
 
Select * from cnc_offset where NC='D03' or NC='D04'or NC='D05'or NC='D06'and Model_Name='FCJ' and Shijian between '2017-07-20' and '2017-07-30' order by Shijian
this is the sample query in the db
 
assign it a variable?
 
1:35 AM
var __html = require('./template.html');
 
does 't work
 
1 message moved to Trash can
@AlexBollbach Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
var a = require('./template.html');

class Hello extends React.Component {
  render() {
    return <div dangerouslySetInnerHTML={ {__html: a} } />
  }
}
i tried this - http://adrian.gaudebert.fr/blog/post/2015/12/24/how-to-include-html-in-your-react-app-with-webpack

but had no success
 
Use browserify if it is not React component
 
im using webpack
 
1:41 AM
show me your template.html
 
<div>test</div>
thats it
 
so put it in a string literal
 
so don't use a file?
i dont want to lose syntax formatting/coloring
 
!!>let html = "<div>test</div>"
 
@Arrow "undefined"
@Arrow "undefined"
 
1:44 AM
put it in a string and export it like you would any object
 
i was hoping to get the benefits of a file
with a config
 module: {
    loaders: [
      {
        test: /.jsx?$/,
        loader: 'babel-loader',
        exclude: /node_modules/,
        query: {
          presets: ['es2015', 'react']
        }
      },
      { test: /\.html$/, loader: 'html' }
    ]
  },
 
1 message moved to Trash can
@Arrow Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
You don't need to go through all that
 
to write the html as a file?
 
create a function which you can export that contains all your template strings, and reuse them that way, so when you export your function you are getting the strings you want to use.
that way you have it all in one place and it's dynamic. However, react lends left to that type of template structure. it seems redundant.
 
1:55 AM
i just wanted to be able to write some of my app in generic html/css
 
what you are attempting to do
 
Umm, if you're using React then why woudln't you just create your templates out of jsx?
 
so when i'm learning css grids or something i'm not having to convert the tutorial i'm reading from html to jsx
i'm still a n00b w.r.t. html/css so i want as little mental friction as possible when learning it
 
Just create dumb components then. JSX outputs html
 
again, i wanted to reduce mental friction while learning html/css
 
1:57 AM
export default class MyDumbComponent extends React.Compoennt {
  render () {
    <div>{/* Put whatever html you want here */}</div>
  }
}
You're making it harder for yourself then
This is literally what React is designed to do
 
The css does not have any bearing on that. CSS is separate. You would not be reducing mental friction just exasperating the problem.
 
user5738123
2:11 AM
since JS is async, how do i do DB logic without getting errors?
 
user5738123
scenario: function does 4 DB statements, but since JS is async, and not in order, i get error because the 3d DB statement relies on 1-2 finishing first
 
user5738123
how do i : 'statement 3: run if statement 1-2 are done'
 
@eBay Promise.then (or callbacks if you're old-fashioned)
 
user5738123
@KendallFrey thank you
 
user5738123
man.. i hate JS but i have to use it :/
 
2:21 AM
I find moving to an async architecture is hard and my brain struggles at times. But I can definitely see why js is appealing and only hope that I get better over time.
 
user5738123
2:31 AM
yea
 
user5738123
is there a c# js plugin?
 
user5738123
i want to code JS like i code c#
 
i love async it's the best way to program
 
@eBay look into typescript I guess
i havent used it myself, but it certainly looks more like c#
 
user5738123
like in jQuery: for(var a2 = 0;), in c# : for(int i = 0)
 
user5738123
2:35 AM
that's 1
 
Aw, he deleted all the spicy memes from github.com/JavaScriptRoom/culture/issues/45
 
user5738123
in JS: newArray = [];, in c# var x = new List<string>();
 
user5738123
i just like c# list creation better than js array creation
 
user5738123
and c# has linq T_T i miss linq
 
Is there a preference for undefined or null in an if statement, if you want it to evaluate to false?
 
user5738123
2:38 AM
i prefer c#'s way of handling it
 
user5738123
in js it's cancer
 
@Arrow if you want it to evaluate to false then just use false :S
 
I dont see any issue with js syntax
I do like linq, it's pretty good
but you can use things like lodash to emulate the collection/selection properties in js
 
wow, that was so obvious that it hurt. brain fart!
 
3:03 AM
does anyone use lokijs in-memory database? I am wondering if it is better to have a class level collection (db.getCollection('files')) for reuse, or if I can just grab the collection when I am reading/writing.
 
3:42 AM
next question lol. with express and chaining callbacks where do I set my response status? I have three callbacks, calling with next(). Not sure where I should set the status
 
4:13 AM
does it matter?
i mean as long as it gets set before the route handler right?
 
@hsimah You set it in the one that decides what status it should have?
 
if it calls next(), its middleware right?
 
yeah
i have an endpoint that accepts a zip file, unzips and moves the content and then returns select metadata about the internals of the zip
so there are various places that errors can occur, but I guess if you get an error just dump out with the appropriate status, and if all goes well return OK at the end of the callback chain
 
4:36 AM
hey david
 
Hey Rachel, how's it going?
 
really good, i launched my go server today and people have been playing
would u like to see it?
ive had about 140 visitors
 
Yeah!
wow nice
who have you told about it?
 
are people telling each other?
 
4:38 AM
i told a couple of people on reddit
i dont think so, but i asked them to review it
and i got some feedback and stuff
 
I have some feedback
 
I prefer minesweeper, could you make it be minesweeper
 
i could if it was my school project lol
 
wow you even have like a combat log so you can review the games
 
4:41 AM
yeh pretty neat ey
it went so much better than i expected, i only ran into 1 bug which was easily fixed and the server didnt crash once
 
this is really really impressive
 
thanks, i cant wait to show my teacher
 
5:05 AM
morning
 
morning linus
 
user5738123
has someone here asked for proof of you being a girl?
 
me? no they havnt lol
sometimes a random indian guy will start a room with us 2 and act weird tho
but thats about it
 
user5738123
happened to me
 
user5738123
i'l just say that dont give anyone anything
 
user5738123
5:10 AM
you dont go around asking for proof for anyone so they shouldnt either
 
for sure
idek why anyone would want proof
 
user5738123
like, i couldnt care less if you are a guy and named yourself a girl name and put a girl avatar, idgaf
 
user5738123
even if you vamp
 
i just signed up with my facebook so it did everything automaticly
 
@RachelDockter 20 years ago if someone claimed to be a girl no one would believe them, especially in irc chat rooms etc
there's an old meme about "there are no girls on the internet"
@eBay is right though, who cares who someone is behind their screen
 
5:13 AM
yea i noticed, 99% of the people in my class at school are guys
in the web design class there seems to be quite alot more girls though
not sure why, thats my favorite unit too
 
user5738123
some people make a big deal out of that
 
user5738123
that there isnt enough girls in those classes, to me, i dgaf
 
user5738123
if girls dont like to programm wtf do i care
 
i hear that alot that there needs to be more females in computer tech or stem subjects in general. i cant see why tbh
 
well you can go into various reasons why there aren't more females doing programming. I know I gravitated to it because computer fascinated me and while I had no friends at school I had many friends online all over the world.
 
5:15 AM
@eBay That isn't really the problem in general
 
so it was a natural step into programming at uni
 
They're usually driven away by discrimination
 
user5738123
depends on what country you are talking about
 
user5738123
in the US we promote equality
 
if a female is driven away by something as small as her friends making fun of her u gotta question how dedicated she was in the first place
 
user5738123
5:16 AM
exactly
 
user5738123
someones insults didnt keep ME away from getting what i want
 
I think it might be more snarky comments from men, and constantly being undervalued because of their gender
 
user5738123
the same happens with guys too, a stronger discriminating against a weaker male
 
@hsimah Right. It's a societal issue, not one of personal motivation
 
if anything its the oppersite, some companys will hire women over men to promote diversity
 
5:17 AM
eg I know when I was at uni there were 3 girls in my cohort. And one of them never did an assignment. As males, we'd fall over ourselves to 'help' her out.
 
in the long run that wont help her out tho, she will have a good degree but wont know anything
 
user5738123
the girl has a choice to deny the help and bust her ass to learn the subject
 
which is just as good as not having a degree at all tbh
 
now, if she graduates and goes to work - is she any good at programming? probably not.
 
user5738123
but she will face those consequences
 
user5738123
5:19 AM
same if it happened to a guy
 
no, it doesn't help her- and it doesn't reflect on anyone other than her. but those situations are how negative stereotypes are formed
 
user5738123
one should not care about stereotypes and just face the punches to succeed
 
no, you shouldn't, but the fact is these problems exist. we all have our own prejudices and you need to reflect on how you perceive and treat people.
 
user5738123
viewing it as a problem is not good though
 
user5738123
because it seems that the only solution is to make everyone 1 gender and controlled 24/7 by a chip
 
user5738123
5:21 AM
let's just make everyone 1 skin color, 1 language, 1 hair cut, 1 size, so 100% equal
 
user5738123
that's a terrible world
 
i think women only argue that there should be more women in stem subjects is because how well they pay
you dont see them arguing for more men in nursing homes
 
@RachelDockter @eBay @hsimah The JS room isn't quite the place for discussions of this kind (since not everyone will agree and it might be inflammatory). I'd recommend that you guys create a new room and continue discussing there. Sound good?
 
user5738123
convo died anyways
 
hard to beleive how reality might be inlammatory especially to people smart enough to be here but i understand
its kinda off topic
 
user5738123
5:24 AM
yea, to me it's that if new users join in they will feel left out
 
user5738123
this room welcomes people with js related questions
 
user5738123
and if we are talking about hot topics they will leave
 
user5738123
but what's good is that we can create a private chat
 
6:28 AM
Hellou o/
 
user5738123
my jam
 
Can I post a link to an SO question that I'm needing some help with?
 
user5738123
of course
 
1
Q: Playing doubly encoded audio using Javascript Audio API

McLemoreI'm working with a web service that accepts and sends doubly encoded audio. The encoding process looks something like this: raw audio -> Opus encoded audio -> Opus & base64 encoded audio. Now I need to take that output and decode it back to raw audio within a Chrome App. The base64 encoded audio ...

I've been facing the problem for awhile and don't really know how to proceed.
 
6:39 AM
hmm what's the best way to handle routing in express if i have a static folder and a a bunch of api routes?
so far i've got
app.use('/', express.static('build'));
and
app.get('/api/foo', function(req, res) {
  res.send('hello world');
});
however, because middleware happens before the route handler, the /api/foo never gets fired
 
@derp More general routes should be defined at the end.
There's no specificity resolution in Express, you need to do this work yourself.
 
@MadaraUchiha so should i do something like a !api regex in the app.use?
 
No
Just call app.use('/' after app.get('/api/foo'
 
I liked this quite a bit, and since some others here work with canvas I figured I'd share it dada-data.net/en/hub
 
6:45 AM
hmm, it still gets captured by the static middleware
const express = require('express');
const logger = require('morgan');

var app = express();
app.use(logger('dev'));

app.get('/api/foo', function(req, res) {
  console.log('firing route');
  res.send('hello world');
});

app.use('/', express.static('build'));


app.listen(3000);
 
that is amazing
 
@Julix did you do this?
 
oh wait...it might have something to do with that service-worker that comes with create-react-app
@MadaraUchiha thanks for your help. i think what was happening was on first load, react-router would load and then after that, it would capture every route change and hence the request never made it to the express server
 
7:05 AM
@derp That's very possible.
 
yup, i'm able to make the api call inside the react app
cool, TIL thanks @MadaraUchiha
 
7:30 AM
hi gys
guys*
can you help me here please
 
Hi guys
 
@Ahmad This is the JavaScript room
 
@MadaraUchiha But questions about typescript are allowed=
?
 
7:46 AM
@wλnnλhug Yes, TypeScript compiles to JavaScript (so same runtime) and the semantics are very similar.
C# and ASP.NET are very different.
There's a C# room.
 
@Ahmad Still?
Haven't you been doing that for about a month now?
 
@BenFortune He has a reputation in C# for that.
(for not reading what we suggest him / help him with and spamming the same things all over again) But, lets not make it a cross-room issue.
 
@BenFortune, worked on a lot of things this month , but just getting this
@KamilSolecki, this is a new thing , that you didnt look at
 
still, please keep this in the respective (C#) room.
 
Has anyone ever come across a project which uses @types/webgl ?
 
7:59 AM
var data = new DataView(buffer),
    code = data.getUint8(0),
    text = new Uint16Array(buffer, 1);
doesn't work, because the offset isnt 2 bytes (16 bits)
Is the only fix to use a for loop and call getUint16() over and over?? i.e:
for (var i = 1; i < buffer.length; i+=2) stringArray += buffer.getUint16(i);
I thought about writing the int8 code in little endian form, so I could apply appropriate padding while retaining its value, then I could have correct offset of 2 bytes. Would that work?
 
There seems to be a @types/webgl project on github but I cannot find any example implementations
 
@wλnnλhug Search for DefinitelyTyped webgl
The @types namespace belongs to that repo
 
8:18 AM
hello guys, please help me to solve this case: stackoverflow.com/questions/45669664/…
 
 
1 hour later…
9:33 AM
is anyone here familier with heroku?
 
10:09 AM
somewhat
 
@BenFortune so i went on my app this morning and it had been restarted. It cant have crashed because when it does it doesnt restart. Is there any reason it would randomly restart?
 
Are you on the free tier?
 
yeh, dont tell me they restart the app everyday if im on the free tier pls
just to anoy me into paying them
 
They spin down the instance when it's not in use
 
did the new update break autocomplete for typescript in Atom for anyone here?
 
10:13 AM
does that mean when theres 0 people on? so in theory if i left the tab open it would never restart?
 
6
Q: How can I avoid heroku stopping my dyno?

iweinI build MVP's for clients regularly. Often I deploy on Heroku so they can see if the product works and demo it to prospects and investors. Then I have an application deployed on heroku, and it works like a charm, if not for one little thing. The app takes about 30 seconds to start up and heroku ...

 
"Simple answer: You pay for it."
thought id see an answer like that lol
one answer is saying indexed by google which will ping it alot and it will never idle, thats a good shout
 
why is it restarting a problem?
 
well it just clears all the games that are going on currently. Like if 2 people are playing and they want to come back to it later and leave, the app will restart and clear their game
 
Don't store their session in memory then
 
10:21 AM
maybe you should persist that data?
 
are u saying to store it as cookies or something?
im not sure what persist means
 
!!define persist
 
!!live
 
@GNi33 I'm not dead! Honest!
 
im not sure how else i would store it if it wasnt saved in an array on the server
 
10:23 AM
@CapricaSix suuuuure
 
@RachelDockter well, I don't know much about your app, but persist basically means storing it somewhere that is not the memory, e.g. that doesn't get wiped if the machine reboots
 
like on another server? then the original server gets it from that or something? i mean it has to be stored somewhere
 
in your case probably a database
 
oh i see what you mean
 
usually the memory gets wiped on a reboot, not the hard drive
 
10:25 AM
Make sure the database isn't in-memory ;D
 
im sure i could save an array as a file
 
you don't have a db in your project?
 
no lol
 
add one, it's a fun learning experience
 
i used an sql database a while ago, but for this app theres no login or anything
everyone is just called guest 3 or guest 53 or whatever
 
10:26 AM
and I think it's a saner approach than trying to keep the server up all the time
 
for sure
 
what kinds of games are we talking about here?
 
the kind which you always lose...
 
its the board game GO, not sure if u heard of it
just for a school project
 
yeah, heard of it, never played it though
 
10:28 AM
it took me months to program lol
harder than it looks
 
so what would you need to save? the position of playing "stones"? (idk what they're called)
 
its alot more variables than that. about 14 arrays, like 10 booleans, the details about the players and some other misc variables
its all put into 1 object tho
per game
 
that should be pretty easy
 
would it even need to be a database? surly i can export an array into a .file or something
then just load it up when the server starts
 
of course you could add a "save" button that generates a file and stores that object in it serialized. Then you generate a random string that is associated with that file
players could then pass that string as parameter to the game which then loads the file and they can continue playing
that's just one of a lot of possible methods
 
10:34 AM
i didnt think of only loading 1 at a time, i was thinking load that file into an array when it starts and play like normal, when a new game is added, convert that array and save it into the file again
i mean its not gonna have more than 100 games on it realisticly
 
@RachelDockter not exactly sure what you mean by that
do you want to put all played games into one file?
 
so at the moment the server has 1 big array to store all the games right. So when the server begins to start, it will get the saved file and convert it into an array and put it in that big array on the server. Then when someone adds a game into that array, get the whole array, convert it to a file and save it again
yeh, well all the games are in 1 array so i figured might aswell
its probably a bad way to do it if the array has like 50k games in it but i figured it will only have a small amount so it would be fine
 
hm, I wouldn't do that but that's up to you. Where the games are stored on the server doesn't really have to relate to the architecture in the actual app
you can still store them independently and just get the game you really want
no point in loading games that aren't going to be played anyways
@RachelDockter this is a school project, right?
 
yeh thats true
it is yeh
 
I'd recommend still giving the whole architecture a thougt
even if its not going to be played that much, that's not a reason to implement it properly
after all, the point about it being that you learn something
 
10:40 AM
yeh i think the main reason is i dont want to break my app lol
but i still got 11 months or so till its due in so defo room for improvment
 
well, I suppose you have a dev environment?
 
would u like a quick look btw? its ok if your busy but im really proud of it
im not sure what a dev environment is
 
it's the place where you develop the app. It's where you can safely break as much as you want
this can be a VM, a remote server or just your local notebook
 
i can run it on local host to test yeh
i have 1 folder for heroku and 1 for local host
 
yeah, that would be your dev environment then
you have the same app in 2 folders?
You should really look up git
 
10:42 AM
pretty much, the heroku has a couple extra files in it
i think i have git, its needed for heroku
 
the basics are fairly easy to grasp and it will help you out tremendously
 
i have no idea what it does or anything tho
 
@GNi33 Into the rabbit hole again 😃
 
just a sec
aye
git-scm.com/book/en/v2/Getting-Started-Git-Basics <-- @RachelDockter give that a read
there are so many git basics tutorials it's crazy. might as well go with the official one
 
this looks so confusing lol
 
10:45 AM
alright, gotta go grab something to eat
 
ok thanks for the info gni33
 
something new always looks confusing at first
the basics are not that hard
just move through these chapters there, after finishing chapter 2 you should have a basic understanding what git is there for
 
alright sweet
 
10:57 AM
why is everything written backwards on the Madara starred message?
 
I have no clue why ‮
 

« first day (2494 days earlier)      last day (2453 days later) »