« first day (2042 days earlier)      last day (2922 days later) » 

12:00 AM
That would make me feel really old if I gave a fuck.
 
how old are you?
 
41
 
not too old. :D
 
I think. 2016 - 1974, give or take ... yeah 41. My memory is going!
 
ha, I always go by the year. never my actual birthday
I'll be 30 this year.
easier that way
 
12:04 AM
year - 2000 + 20 for me.
 
@rlemon I'll say happy birthday now, cos I won't remember later. :-)
 
I don't have an easy calculation except for ***6 years
 
that's how I remember/calculate. I am 2016 - 2000 = 16, 16 + 20 = 36.
 
:D thanks
 
that's wrong for 1 month / year, but who cares.
 
12:08 AM
Speaking of gigs, and age, are there any nearly dead people I need to see soonish? Dylan maybe.
 
Prince.
but.. i have some newpapers to catch up on. i'm a couple weeks behind. gotta go read.
Dear god.
 
:-D
 
I'm at the age where I'm older than every dog :/
so are both of you, but I'm just there
 
i'm at the age where ogling 21 year old girls breaks the rule. :(
ohh, no, that rule is just for girlfriends. i can still look all I want. Whew.
 
12:15 AM
Denim doesn't "fade", it just gets better
 
@SterlingArcher painful puns
 
user5992646
I'm really desperate to know c++
 
user5992646
I really really really really want to be developing games
 
Welcome to the JavaScript room.
 
user5992646
lol I'm not new here.
 
12:24 AM
:-)
 
user5992646
its alright
 
@TodoPertin You don't need C++ to make games
 
user5992646
do you happen to know c++ too @kding mob?
 
user5992646
@KendallFrey yes I do
 
user5992646
12:25 AM
so what you suggest I learn?
 
Exactly what I said
 
@TodoPertin Not enough to understand its compiler errors.
 
There's nothing about games or C++ that makes them go well together
@TodoPertin JS
 
user5992646
@KingMob ok
 
user5992646
@KendallFrey I'm learning JS too now that I know concepts of programming.
 
user5992646
12:27 AM
@KendallFrey I work using PHP, learning JS, looking to learn C++ with JS.
 
The main advantage JS has is RAD; you get a lot of the plumbing for free with HTML and the browser
 
user5992646
work=trying to do something useful
 
user5992646
@KendallFrey I don't know but everybody suggests learning JS, so I'm learning it. If I can make cool fun games using it, I'm very happy.
 
user5992646
huge bonus.
 
@TodoPertin Yeah, HTML5 canvas is super powerful
 
user5992646
12:30 AM
@KendallFrey I know only html4. how hard is html5 going to be for me?
 
it's just HTML
 
user5992646
to learn
 
it's... average?
 
user5992646
@KendallFrey ok. just with performance and features increase?
 
features, mainly
 
user5992646
12:31 AM
@KendallFrey cool. thank you. actually can't thank you enough for your time. really. :)
 
user5992646
what languages you use apart from JS?
 
C# professionally
Haskell sometimes for fun
I've used a variety of others in the past
 
user5992646
really really cool.
 
user5992646
c# for windows application softwares?
 
yep
desktop software
 
user5992646
12:34 AM
really cool.
 
I highly recommend learning basic Haskell if you want to learn some useful concepts
 
user5992646
programmers are amazing. I'm not one yet.
 
haven't tried it yet
sounds kinda cool
 
user5992646
@KendallFrey ok. JS, C++ and Haskell basics simultaneously.
 
@TodoPertin maybe best to stick to one at a time
 
user5992646
12:36 AM
I love programming now. I don't use force.
 
C++ and Haskell are very different languages
 
user5992646
so multiple is probably going to be ok.
 
user5992646
@Meredith different!=immpossible to learn. :)
 
Also, rather than learning C++, I suggest C. It's simpler, and helps you get a better grasp of low-level concepts
 
Are you in university?
 
12:37 AM
C++ isn't so useful anymore, there are plenty of "nicer" languages
 
user5992646
somebody said to make games I have to learn C++ and C later to understand machines which will be easier after learning C.
 
user5992646
@Meredith yep
 
You don't need C++ to make games
 
C will teach you low-level programming, JS will teach you mainstream programming, with a bit of OOP and FP, and Haskell will teach you very high-level programming.
 
In fact, I know people who have written games in haskell
 
12:39 AM
14 mins ago, by Kendall Frey
@TodoPertin You don't need C++ to make games
 
user5992646
I lack Haskell instructors around me.
 
worth repeating thrice
@TodoPertin You've got us
 
In fact, if you're new to making games
I'd recommend staying away from C++
 
user5992646
@KendallFrey ok.
 
user5992646
@Meredith ok.
 
user5992646
12:41 AM
thank you KendallFrey
 
morning
anyone good with puns?
 
in what sense?
 
I am running for sophomore class president next year
and I need to come up with a good pun as my campaign slogan
 
28 mins ago, by Kendall Frey
@SterlingArcher painful puns
 
youtube uses flash... any alternative?
 
12:50 AM
youtube uses HTML5
 
^
I've flash disabled and youtube works fine
 
Any slogan is probably better than that.
 
how? every time I open it, there's a window saying 'Vulnerable Plugin - please update' or something, and when I click 'allow now', my web browser crashes.
 
stop using a potato
 
12:52 AM
Sounds like you went to the wrong porn site
 
and what plugin is it referring to?
 
flash
its youtube, i'm sure
 
it isn't
 
Want me to take a screenshot?
 
you don't need flash to use youtube
it really isn't worth the time, this is a published fact.
they migrated to HTML5 a while back.
 
12:56 AM
Small regex problem. I am trying to match a patter that does NOT start with a / regex101.com/r/rI1cT4/1
 
But I am unable to use youtube...
 
add \b to both ends
borders of the matches
 
ahh, ok. yes. ty.
 
1:12 AM
@AwalGarg Hahaha. Not happening :p
At least you got your tl;dr anyway
 
HAHAHAHAHAHAHA HAHAHAHAHAHA HAHAHHAHAHAHAHAHA LOLOLOL ROTFL LOLOL HAHAHA
 
lol, that's good
 
@thepiercingarrow i.imgur.com/9sxHPBx.jpg .
seriously bro...
 
1:22 AM
1 message moved to Orphan GIFs
 
why
I think you're just a dick
 
don't leave gifs oneboxed when the chat is slow
also be polite, all I did was move the message
 
1:54 AM
Is there any software to input a number based on inches to output a line on the screen in a cad software or no ?
Or is blender the only software for ubuntu , forgot to say for ubuntu
 

 Ask Ubuntu General Room

Normally: General discussion around Ask Ubuntu, Ubuntu & offic...
did you ask here?
 
he hates us with italic names and thinks we are a bunch of power-hungry blow-hards.
ohh, man my chat was way outdated. it just updated.
 
@Luggage re: my message move?
 
yea.
 
figured
 
1:59 AM
for me, it's true
 
I just don't like seeing the same gif 100 times
don't know why that is an issue
 
If I've got an array of objects, {from:"A",targ:"B"}, and I want to check the objects in the array against other objects in the same array to see if from and targ match or from===to and to===from, how should I do that? I've tried with a 2d array loop but I'm having trouble with duplicate values showing up, I'm not quite understanding where I'm tripping myself up
 
huh?
you want to compare objects in an array?
for what goal?
 
he wants to match up companion objects.
the from of one === the to of another
 
ahhh
 
2:02 AM
(or she)
 
so pairwise but on from/targ
 
if I've got an array [{id:0,from:"A",targ:"B"},{id:99,from:"A",targ:"B"}] I want to compare all the objects in the array, check if from==from && targ===targ || from===to && to===from
IE if they are connected bi-directionally
I'm confusing myself with 2d loops and I think I just need fresh perspective, tried fussing with filter, reduce, and foreach and not getting what I expect
 
can you give a input and expected output?
 
is it a guaranteed 1-to-1?
 
I'm dense and work better that way
 
2:06 AM
lets say array above is X, i want to compare all the objects in the array, against other objects in that array (not themselves), if they match another objects from/targ fields I want to add push them to a results1 array, if an object has NO matches it needs to go to results2 array
its not 1-1 , there are going to be other properties that don't matter for the matching portion
 
arr.forEach(item => {
  if( compare(item, arr) ) res1.push(item);
  else res2.push(item);
});
?
still not sure what to put in compare
 
so for [{id:0,from:"A",targ:"B"},{id:99,from:"A",targ:"B"},{id:22,from:"X",targ:"Y"}]
results1 should be [{id:0,from:"A",targ:"B"},{id:99,from:"A",targ:"B"}]
and results2 would be [{id:22,from:"X",targ:"Y"}]
because the object in results 2 has no matches
{id:0,from:"A",targ:"B"},{id:99,from:"B",targ:"A"} would also go into results 1 because it still counts as a match
if they were swapped like that
 
returns [ [A, [MatchesOfA]], [B, [MatchesOfB]], [C, [MatchesOfC], ...]
 
errors when I added {id:22,from"X",targ:"Y"}
nm
lol
 
it needs a lot. de-duplication, the rest of your comparison, etc.
but a .map(.filter) is a general pattern that should work
 
2:39 AM
Array.from( [{id:0,from:"A",targ:"B"},{id:99,from:"A",targ:"B"},{id:22,from:"X",targ:"Y"}]
.reduceRight( ( map, e, i ) => ( i = `${e.from}\t${e.targ}`, map.has(i)?0:map.set(i,[]), map.get(i).push(e), map ), new Map() )
.values() ).filter( e => e.length > 1 )
 
I was just looking at MDN Reduce Right as you posted that haha
 
Not the best way to write it, but should give you some idea I hope.
 
hey guys. morning.
quick question.
I have this code from nodejs. it creates a readStream.
rs._read = function() {
	rs.push(String.fromCharCode(c++));
	if(c > 'z'.charCodeAt(0)) rs.push(null);
};
why must read have an _ (underscore)?
full code
var Readable = require('stream').Readable;
var rs = Readable();
var c = 97;
rs._read = function() {
	rs.push(String.fromCharCode(c++));
	if(c > 'z'.charCodeAt(0)) rs.push(null);
};

rs.pipe(process.stdout);
output
$ node readableStream.js
abcdefghijklmnopqrstuvwxyz
 
Note: Implement this method, but do NOT call it directly.

This method is prefixed with an underscore because it is internal to the class that defines it and should only be called by the internal Readable class methods. All Readable stream implementations must provide a _read method to fetch data from the underlying resource.
 
@Event_Horizon ah thanks. didnt notice it in the docs.
 
2:55 AM
It is a common way in JS to mark internal methods.
 
@Sheepy not sure what this line is doing, could you explain a little, the commas are throwing me off a bit i = ${e.from}\t${e.targ}, map.has(i)?0:map.set(i,[]), map.get(i).push(e), map )
nm I read up on comma operator I think I get it, it returns the MAP at the end as the value for i right?
 
3:11 AM
function foo(a,b="",c="") { }

foo("value",c: 'value');
guys where i am wrong ?
 
c:"value" should be {c:"value"} from what I can tell
 
I just got 415 reputation network wide o.O what
 
also default values for parameters aren't supported across the board atm your function should look like function foo(a,b,c){b=b||"";c=c||"";} as well
 
@Event_Horizon thank you. thank you. thank you.
 
@AndrewL great moves, keep it up, proud of you!
 
3:15 AM
Thanks Michelle!
 
anyone who can help with this question stackoverflow.com/questions/37264902/…
 
Who do you think I am? Ethan?
 
nah, just Joshin around
don't even know what would give points network wide
 
@Event_Horizon My friend method called but variable didnt get my new value
 
3:18 AM
Got 100 on 4 communities
and 15 for accepted answer :)
 
@AndrewL you answered the question i posted? :)
 
@Event_Horizon Yes. It's just a convenience way to write a single expression lambda. When done properly it should be 4 different statements. On 4 lines.
 
Let me take a look :D
 
@gtzinos if you are trying to assign to c in the function you have to assign to b since default params aren't supported on most browsers
or you have to reorder your params around
 
chrome didnt support it ?
 
3:20 AM
or use an options object
 
hmm object i think is better solution
 
function foo(options){//do whatever with options.a/options.b/options.c}
foo({a:10,c:30});
 
I need a better profile pic. Any ideas?
 
@Event_Horizon Depends on your definition of "most". IE and Safari don't support it, but Chrome, Edge, Firefox, Opera, WebKit all do.
 
he must be using one that doesn't support it then if he had an issue assigning to c
I consider something supported atm when Safari, Firefox, and Chrome have it, since IE was so far behind the times and Edge is still a baby
 
3:26 AM
Ok. I think the problem is in foo("value",c: 'value'). I think it is not ES6 and, as far as I know, not ES7.
 
@Sheepy never seen that pattern before funnily enough, I almost that it was a destructuring pattern for variable assignment since I haven't played with ES6 much
 
destructuring syntax resembles object or array. This is neither.
 
yeah I know, but thats the only thing I've seen in other languages that uses comma operator like that, I thought it might have been shorthand or something
 
Some languages allow you to pass "named parameter". This looks like an attempt at that.
 
are we talking about his issue or the comma operator you had when you were helping me, because I know what hes doing haha
 
3:31 AM
His issue. If you know what he's doing than great.
Comma operator is pretty old. ES3 and before, I think.
 
yeah like I said just never seen it used for multiple expressions like that on assignment, and if I take the i= section above the return and just return i it fails, not sure why
 
reduce and reduceRight will take the callback's returned value and pass it to next call. So in our case we want it to pass on the same map.
(If I get it wrong, can I have a look at your code?)
 
its not wrong per se, I'm getting a array with all multiples in one array, but all singles in their own array (thats fine), I'm just trying to understand the logic so I can insert a section to make the singles into 1 array and not an array for each single
 
My code's logic is, for each entry, creates a key (i) from its from and targ, create an array in the map with that key (if not exists), and add entry to it.
So you'll another pass (or two) to find and consolidate the singles, outside and after the reduceRight.
 
with a filter to find all the length<2 ones
 
3:45 AM
Length of each array in the map must always be >= 1, so you can check length === 1
 
3:55 AM
@Sheepy could you possibly convert that i= line into the multiline version I keep trying but get errors one way or the other
 
Sure.
Array.from( [{id:0,from:"A",targ:"B"},{id:99,from:"A",targ:"B"},{id:22,from:"X",targ:"Y"}].reduceRight( ( map, e ) => {
   const key = `${e.from}\t${e.targ}`;
   if ( ! map.has( key ) ) map.set( key, [] );
   map.get(key).push(e);
   return map;
}, new Map() ).values() ).filter( e => e.length > 1 )
@Event_Horizon There you go~
 
ok thank you, I that makes it way more clear
 
4:54 AM
If I want to import something, use it, and re-export it, is there a nicer way than this:
'use strict';

import { ParserService } from './parser.service';

export * from './parser.service';

export const PROVIDERS = [
    ParserService
];
 
 
1 hour later…
6:05 AM
Hey. Does anyone know how to use NodeJS streams to stream data into mongoDB.
my script is a web scraper that will periodically grab data from the web. i want to pipe it to mongo. Any ideas?
 
user3119231
Good morning, ladies.
 
6:38 AM
But...I'm not.. a lady :c
 
good morning girls
 
is it ok to user custom filters in angular to create pagination?
 
Good morning to all the genders around
 
o/
 
@ZetCoby Everything goes
 
7:09 AM
@Ming .on('data', (d) => db.write(d))?
or whatever the mongo command for writing things into it is
mongo API is terrible
 
user3119231
@BartekBanachewicz () => {} es6 or?
 
what else
 
Hi All
I have a requirement where I need to restrict the user to shift or minimize browser tab. It is a quiz site. The user can only come out of that restriction is by clicking on "end session" button or "submit quiz" button. How should I handle this situation?
 
@Mr_Green This isn't something web is meant for.
Fundamentally impossible.
 
I know but there might be a alternative
 
7:17 AM
@Mr_Green I have two screens. What now?
@Mr_Green Or assume I open the quiz page with my browser window on half of my screen
 
I was assigned this task with ownership to choose technologies as necessary
 
Or assume I have another freaking PC next to me
@Mr_Green Then tell them to buy a plane and fly people into the classroom. Or pay for people to talk to people taking quiz on skype instead of doing silly tests.
 
@BartekBanachewicz Don't bother about that. Consider there is only one PC and I should restrict user to do anything other than doing the quiz
 
You can't.
Plain and simple.
 
I heard it can be done by creating chrome add-on
@BartekBanachewicz
 
7:22 AM
@Mr_Green what can be done? Restricting the user to only do the quiz? Nope.
Imagine I have a VM. How will you tell then?
Or am I misunderstanding you and you control the whole machine and every bit of software on it?
 
Ok to narrow down the context, the PCs will be provided by us.
 
Because then sure you can restrict it to only show your quiz
 
yeah
 
oh that changes things
well step a) don't use a web browser
 
@BartekBanachewicz any leads to where to look at?
ok
 
7:24 AM
@Mr_Green books on programming embedded user-facing systems like ATMs should help
because it's literally the same thing
also consider restricting physical access (physically locking the box)
 
you mean to say to create Electronic interfaces?
 
The quiz should be on PC or laptop.
 
on a laptop you can typically disable the USB ports
use one that has PS/2 ports preferrably for the mouse
in general you want to expose as little to possible to the user
 
@BartekBanachewicz I didn't get you. I understand till that we should disable the usb ports and consider PS/2 ports. and then what next?
 
7:29 AM
@Mr_Green In general disable everything you don't need
 
ok. As I understood. If I disable the internet, there is no need to restrict the user to just write the quiz.
 
Not necessarily
Depends on what the quiz is about too. For all you know, your OS has manuals that would help people cheat
 
So what should I do? I don't know anything to start my research on
@SomeGuy @BartekBanachewicz
 
You shouldn't be doing this if you don't know how to do it
 
11 mins ago, by Bartek Banachewicz
@Mr_Green books on programming embedded user-facing systems like ATMs should help
Yeah, and what pootis said. If you don't know how to do it, you probably won't do it well enough
 
7:36 AM
Do you have experience building linux systems?
It's not that hard if you do.
 
@littlepootis I have been assigned a job as I am employee. can't say NO :)
@littlepootis nope I am just good with HTML, CSS and JavaScript
I think I should ask question on programming.SE
 
No, it'll be closed as off-topic.
 
then where can I ask?
 
This is not really related to programming.
 
@SomeGuy I didn't get this comment.
 
7:40 AM
Then google it
 
I did.. still can't understand
 
You know what an ATM is, yeah?
 
yeah
!! google programming embedded user-facing
 
They usually run an OS too
 
What I'd do is build a linux, run this quiz thing as an electron app.
 
7:41 AM
On any decent ATM, though, you can't access the OS's general features, can you? You can only access the user-facing software
Bartek is suggesting you look into how that is done
 
ATMs around here usually run Windows XP
you can see it sometimes, the ATM is rebooting
 
This cannot be done with knowledge of just HTML, CSS and JS. No.
 
Ok now I get it. they create an interface on PC or laptop
 
Not always.
 
@FlorianMargaine Haha, yeah, I've seen a few with BSoDs too!
 
7:43 AM
@littlepootis this is confusing. You guys suggesting me to look on how to create a interface on PC right?
 
What interface?
 
programming embedded user-facing systems
 
@SomeGuy same
 
I mean Desktop app by means of Interface
 
Build a small linux system, install X, install nodejs, run your app.
 
7:44 AM
@littlepootis Is that done on PC or laptop?
 
Disable ttys.
 
@littlepootis And lock it all down
 
@Mr_Green It's done on.. any computer.
 
ok I will check to know more about it. Thanks
 
@rlemon Oh wow, nice one!
 
7:46 AM
@Mr_Green I don't know what those enterprise terms mean. Sorry.
 
even I don't know :P
that was used by bartek
 
an ATM is an embedded user-facing system
"embedded" is a broad term for "hardware/software sold together", where "hardware" is not a classic PC
 
Apple's iPhone?
 
(although it may technically be, you won't use it with a keyboard/mouse.)
 
how can I create change function in this layout.
Design you see is created, I just want when an image in successfully uploaded an browse button should be overlapped on change, but I am not able to do that.
how can I achieve this with CSS or JS ?
 
7:48 AM
I understood that but what I don't is "user-facing" system. which sounds like some Interface
 
@Mr_Green an ATM is used by users
 
@ChristophBühler ping
 
so, it is "user-facing"
 
@Mr_Green "user-facing" means something that's facing the user
 
7:49 AM
@Shashi <p style="font-family:sans-serif; font-size:16px; font-style: italic; color: #999">Image not found</p>
 
@FlorianMargaine A computer is used by users. so why it is not "user-facing"?
 
Just like "street-facing" is the wall of the house facing the street.
 
I don't know that terminology
 
@Mr_Green It is, are you building a computer now?
 
no
 
7:50 AM
So you don't care :D
 
here is the iamge
 
I am assuming user-facing system means writing code. but not building things.
 
But you asked me to reproduce this:
 
@Mr_Green it is, but when someone hears "embedded system", they don't necessarily think about user-facing ones
like factory machines
 
that was relief to know that it is related to coding.
 
7:53 AM
Not necessarily.
 
In quiz context (which is mine)
 
@littlepootis Programmers.SE isn't about programming
 
^ yeah
 
@littlepootis Actually, I have already created the design (screenshot is from the design itself). I need a input type file to be shown on top of it and then I will fire a JS on change of that but, I am not able to do that as the image is being added dynamically on successful image upload.
I believe the image is self explanatory...if not let me know.
I want a input-type file on top of change button
 
so why don't you guys just say me to create a Desktop app?
Desktop app !== user-facing system ?
 
7:55 AM
Because you want something more intrusive than a desktop app.
 
@Mr_Green because if we did you might jump straight to coding, disregarding many important things you should think about.
 
@BartekBanachewicz ok thanks for considering that. It means desktop app right :D ?
 
@Mr_Green It can be seen as such. However, from a broader perspective, you're just trying to use a full PC and lock it down so that it can only perform your quiz. It becomes less relevant what technology you use, and more relevant what's actually presented to the user. You're selling, as Florian pointed out, a complete machine, hardware and software, and you have to look at it as a complete product; it can't be just a software view.
@Mr_Green A desktop app could be a part of your overall solution
 
ok I am just limited to develop but not build hardware stuff.
I am unable to connect you guys because I don't know these things
 
I am not telling you to build a PC. I am telling you to consider the PC your app will run on, the OS it will run on, and what potential problems that might pose.
@littlepootis I think I agree with you here
 

« first day (2042 days earlier)      last day (2922 days later) »