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

12:00 AM
your test data makes no sense. sometimes the start is higher than the end
 
give me a sec
 
make a fiddle
 
> Experience with Vue.js preferred.
nope
 
and add your attempt
 
12:11 AM
added my bad attempt
but I don't know if it is the right approach I was think i might need to hash
 
hashing is for passwords and breakfast.
save your changes.
 
your test data still overlaps. it's not clear how it should work
and some of it is still end < start
 
if you look at the sorted list you will notice how the end always has a start beneath it that matches
 
12:17 AM
but in your sorted sample output 16-30 comes AFTER 18-42
So, I can't figure out what you want with that.
 
Sup guys
(and gals)
 
🌮
 
the start is not important only it's corresponding end to start values
so 18 does not matter
only 42 and 42
 
i see. In that case, you can't do it with a simple sort.
 
30 and 30
 
12:20 AM
you'll need two pass.
 
ok what would you suggest? reduce
 
When given two random items to compare (like sort does) you don't always know the order they should be in if they aren't supposed to end up next to each other.
 
so sort with never help when coupling pairs
 
sort sorts.
 
I thought there might be some clever way to pass 0
 
12:23 AM
pass 0?
 
0 means don't do anything
inside of sort
 
when you do that you tell sort that these two items are equal
it will use that info to know how to place items.. you can't lie to it or it won't work
What is the real thing you are doing, btw? What is this?
 
They are nodes I am trying to match together
 
A less abstract explanation.
 
give me a sec
Is is basically a random shuffling of information I need to reconstitute, a1 and a2 etc.. are really much larger numbers
 
12:28 AM
"shuffling of information I need to reconstitute" is not really less abstract.
I think you are being evasive because this is homework or a test.
 
he he he, I don't know much more than that
homework come on, who would get homework like this
 
people learning programming.
 
you really think this is a programming problem, were you ever given programming problems like this?
 
every day.
 
ok well maybe you did consider you have been doing this since you were twelve , but this is not homework
 
12:33 AM
ok.. so you have a job where you are asked to come up with ways to sort or match random lists of very simple data that you know nothing about.
 
^ so common lol
sorting a list of users based on lead numbers as we speak.
 
yea, it's common, that why i said 'every day', but I sort because I need to sort for the bigger task at hand
i'm not given, without explanation, these random tasks that look like homework (this is similar to but slightyl more complex than the last time)
Anyway.. I'll try to help with it, but i won't write code.
Are you guaranteed to have a match for every item? Are there ever gaps?
 
If it was simply ordering the values in that order I could do it, but I need to know if it could be done more efficiently
YOu don't have to write code just point me in the right direction
 
ohh, if you know how, then get it working and i'll help make it more efficient
if not, answer my question, please.
 
ok ill do it, and ill show it to you
 
12:40 AM
Is this the same issue that's been going on for days?
 
looks new to me. his other sorting was a little different
... if memory serves
 
why are guys hating on my sorting questions
they are awsome questions
 
you try posting on main then? :P
 
better than all that package manager stuff
 
I'm not 'hating on', but I think you are being dishonest about what they are. Something smells.
 
12:42 AM
When did me asking a sorting turn you into Columbo Luggage
What could possibly smell
 
we all smell, you just stink
 
Nice one Loktar...
 
Gosh, I wonder the documentation has documented it. — Sterling Archer 8 secs ago
gosh.
 
golly
 
gee
 
12:47 AM
wow wee
 
@Arrow How do you know what item is first?
(if there are gaps)
 
You know which is first because it has no matching end
 
so no gaps, guaranteed?
 
no gaps guaranteed
shuffled information
 
so, it's like a doubly linked list, just with keys instead of references and out of order.
 
12:52 AM
O dam
wait
I feel like can be done without such an involved implementation like a doubly linked list
 
yea. My thought it to loop once to make a Map of all the starts and ends, so that you can look them up when you encounter them.
 
ill solve it and show you my solution and maybe you can see it if can be optimized
 
because, remember, sort() can get two random items. If you give it 2-3 and 6-1 for inputs, it won't know which is first. So you need to look up the matching item as you need it
ok
 
will do, as much as you would like to deny it no one else really knows how to solve these problems efficiently.
and since I can't ask questions on SO....
 
1:11 AM
wiat why can't you ask questions on SO?
 
question ban
 
ah
 
1:24 AM
Ok updated jsfiddle
 
interesting. I don't see how it splits the a's and b's.
@Sheepy !
 
;)
Omg where is Sheepy
 
right behind you
ok, so this is good. I would definately change the variable names. All the one-letter variables are hard to keep track of in my mind
The main inefficiency is that it's O(n^2)
(it loops inside a loop. the filter is a loop)
 
I know :(
 
looping twice, while it feels wrong sometimes, is way better than looping inside a loop.
 
1:33 AM
I think I would need three loops to get the final result
 
this is what I was hinting at with making a "map" (you said hash, which i forgot is used for this)
 
if they were not nested
 
yea, maybe three, but any fixed number is still O(n)
 
how would you do this with Map, do you mean a multimap?
 
I just meant a Map (or plain object) with something like:
{
    18: { id: "a1", start: 18, end: 42 }
}
 
1:34 AM
Because I tried the Map approach and got stuck, that what was my go to approach by the way
 
So that your .filter() can be replaced with a straight lookup
you also concat inside the filter. I see why you did that, but it makes it a little harder to re-write. I suggest trying to keep filter() to JUST filter.
 
I've read the question description, and yes I'd put them in two maps sorted by start and end. But I am currently supporting a family member's computer problem so I won't be able to bake code soon…
 
in fact.. that makes it much harder to re-write.. it's easy to forget that it's modifying data for every item that DOESN'T match the filter.
that plus the variables are making it hard to read (for me)
 
sorry, short variables name help me keep track of things
 
posted on June 27, 2017 by Michael Dawson

Summary The Node.js project will be releasing new versions across all of its active release lines (4.x, 6.x, 8.x) as well as 7.x the week of July 10th 2017 to incorporate a security fix. Denial of Service Vulnerability All current versions of v4.x through to v8.x inclusive are vulnerable to an issue that can be used by an external attacker to cause a denial of service. The severity of this vul

 
1:40 AM
short names are good… in the short term.
 
Sheepy all advice is welcome from you :)
 
holy shit balls, that's all versions of node vulnerable!
 
my variable names got progressively shorter over time
most of them are just "X" and "Y" nowadays
 
@Arrow I think Luggage is heading to the right direction. Looking forward to his solution :D
 
interesting that they disclose the node vulnerability before they release the patch though
 
1:45 AM
By the way, I need to complain to you about Luggage, he makes fun of my sorting questions all the time, he calls me mcsortsalot.
 
My style problem is not in using one-word var names, but rather the very high vertical compression. Here is an answer I made this week:
3
A: Solving crosswords

SheepyThe basic idea you have is pretty sensible: Identify slots on the board. Try each slot with each word that fits. If every slots can be filled without conflict, it is solved. It's an excellent plan. The next step is to translate it into a design. For small program like this we can go straight ...

 
oh yeah i love that kinda vertical compression too
 
nice that just got my vote
 
makes me wish i was programming in lisp so i don't have to deal with all these statements and braces
 
lisp is just Lots of Irritating and Stupid Parentheses
;p
 
1:50 AM
(: :)
 
my workmates mainly code allman-style braces, and they have their font size set to about double what i'd normally use,
so they only get like 20 lines on the screen, and most of it is blank space
 
thats how c# likes it
 
@Cauterite do haskell
 
i would if i could
 
any one fabric js expert here?? Please do reply me.
 
2:01 AM
your odds of finding one that way are pretty slim
 
@Cauterite Exactly the coding style that kills me.
 
}
else
{
 
omg blank space large font and unreadable alignment is the best
really forces you to pay attention
 
pay attention to what? the alignment?
 
I see the sarcasm is not lost on you derp
 
2:14 AM
you have to pay extra attention because the alignment is misleading (for instance)
also when some lines are indented with tabs and others with spaces, love it
 
ya, that's the hip thing these days. they call it the grunge of coding styles
you know what I'm talking about @derp?
 
i like that XMLSpy emails you its license keys in an XML file

> "enter license key to activate XMLSpy…"
"hmm, how can i read this XML file to get my license key?
i know, i'll open it in XMLSpy!"
> "enter license key to activate XMLSpy…"
 
i only code in minified code bases to minify my development efforts
 
2:29 AM
await badum();
Symbol('tshh');
 
 
1 hour later…
3:40 AM
I've got a great station in the wrong orbit and can't get it down to refuel. :(
 
nuke it
 
no can do, it's got doods on it
 
3:58 AM
Jeb knew the risks
 
4:21 AM
\o morning
 
send a rocket to push it
 
the refueling tanks have plenty of fuel to chase down the station with, luckily
 
Hey guys!
 
Here is your sorting algorithm. Do understand that the problem is not that no one knows how to solve it.
https://jsfiddle.net/qx751zmL/7/
 
4:36 AM
Thanks Sheepy you didn't need to do that
dam!
 
Well it's a nice little break from my day job of training a baby to stand and speak and my moonlight job of assisting a bunch of programmers who don't know what they are doing.....
 
well you got to take a break from the baby sometimes
:)
to deal with the bigger babies
wow this is going to take some time to absorb.
 
A manga that I've been reading has just released a new episode, where an AI "human" wants to re-live his "happy primary school days", and when he finds it boring he realise too late that he has outgrown that stage of his life.
And there goes my break. My LO just wake up. Take your time (and MDN) to absorb it :)
 
A K
hmm is it possible to have a clickable input?
a text that when clicked on, becomes an input field?
 
ya I've done that before
 
4:49 AM
althoguh you could equally add an event listener on the text and then do a bit of hiding and showing and js magic to do it
 
A K
wow, that is exactly what i was looking for
thanks mates
 
@Sheepy you are clearly a genius, this is awe inspiring code. little waste, so readable, so goddam efficient! I am going to commit it to memory.
 
it's nice code, but i think you're too easily impressed
 
easily impressed, well umm I wouldn't say that I'm easily impressed.
@Cauterite I've been banging my head aginst this problem for 4 hours and the best I could do was O(n^2)
 
¯\o/¯ i didn't read it closely enough to understand the algorithm
 
5:07 AM
exactly it ain't easy to understand
 
this company i work at, every time they want to embed an XML document in another XML document, they escape it as text,
 
lol hehe
 
&lt;elem&gt; ... &lt;/elem&gt;
but those embedded documents sometimes also contain escaped embedded documents themselves,
&amp;lt;elem&amp;gt; ... &amp;lt;/elem&amp;gt;
 
well they are just piling up the problems
they are paying for it too, they just don't want to acknowledge it.
 
though the real problem is using XML for data interchange in the first place
 
5:16 AM
SOAP is a thing
 
well they were probably using xml before json was popular
 
yep they use soap too
 
:S
is their approach to throw more programmers at the problem to make it go away?
 
ya right, programmers are not going to put their neck on the line for that kind of time
 
most of what they do is not very complicated, so it runs pretty smoothly
 
5:34 AM
morning
 
5:55 AM
i integrated this chart(amcharts.com/demos/animated-gauge) into my local it running successfully but i want to display two charts into a single page ..please help me how to do this??
 
6:12 AM
prototype is a property of an object that points to the object itself and proto is a reference to an object's(created by new keyword) parent's prototype. am i correct?
 
@MichaelScott No. You may be confusing the constructor with the created object.
 
i using to to integrate both charts into a single page using this reference(amcharts.com/kbase/two-or-more-charts-on-one-page) but it does not works..
 
Morning o/
 
6:27 AM
\o
 
6:46 AM
Here's a blog - from David Walsh - that talks about JS inheritance, that should clear up many confusions:
https://davidwalsh.name/javascript-objects
@KamilSolecki morning~
 
thanks..
 
7:09 AM
guys I am searching for a fun way to represent two teams . any ideas
One idea is put their names in two pirate ships
any other ideas ?
 
@FlyingGambit like.. sports teams? Programming teams?
 
programming teams, but my manager does not want to put it ina tree diagram
 
7:29 AM
in the mysql module this is where I get memory leak warning all the time
 
1 message moved to Trash can
@GandalftheWhite Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
1 message moved to Trash can
@GandalftheWhite Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
1 message moved to Trash can
@GandalftheWhite Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
Damn ctrl+k not helping at all
  connection.on('error', function() {
    connection.rollback(function() {
      connection.release();
      res(false);
      return;
    });
  }); //Connection.on error Ends Here
 
what's res ?
 
callback
via function
 
@FlyingGambit What's the use case?
 
7:35 AM
the parentfun(data, function(res)
@FlyingGambit Anagram with effects ;)
 
i mean, what's the body of res ?
what does it do ?
 
It's a function. It functions. Duh
 
:|
 
7:56 AM
just callback feature nothing else
true false response
to check if the process was completed properly
 
yeah but if you were reusing the connection (or using its pool) there, then it can cause a mem leak
 
@OliverSalzburg good enough for me. Ship it to pro!
@KarelG true, but if that were implied, you should also be required to pass the connection to res
 
not if res got defined /bound in the same scope as the conn pool
 
Not to say res couldn't attempt to use it just the same mind you
@KarelG it would be badly written if that were the case
 
badly written codes do exist
 
8:05 AM
True, though that doesn't mean you should code badly to balance it out
 
Any suggestion for good free js charts to use with react? +points if they have lots of different chart types
 
fun1(data, function(res)) - > call is made to function where mysql operation takes place
fun1 -> a connection is taken from the pool and then transaction begins
if an error is thrown abruptly (unhandled) then this code comes into play
 
1 message moved to Trash can
@GandalftheWhite Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
1 message moved to Trash can
@GandalftheWhite Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
 connection.on('error', function() {
    connection.rollback(function() {
      connection.release();
      res(false);
      return;
    });
  }); //Connection.on error Ends Here
rollback is done then connection is released and then false is sent back
@KarelG what am I missing?
 
That did not work as expected
 
8:21 AM
:/
there is obviously something which is being overlooked
but what is it?
 
The leak is not the connection, but the event listener
What is the error message exactly?
Something about more than 11 event listeners maybe?
 
@OliverSalzburg Just that one big team got split into teams. Team A by Capt A, Team B , Capt B
Oh my message did not get dilevred
 
@FlyingGambit That is not a use case
 
9:00 AM
I should not have clicked that
 
9:46 AM
Who downvoted this? This is actually a quite difficult optimization problem... However we need a general rule for pronoincing numbers to find a good solution — Jonas w 22 mins ago
 
@KarelG The main problem with ambiguity problems is something
 
Yeah the constraint are not stated clearly.
 
10:11 AM
Although the trend of SO users downvoting instantly unless they Get the question itself taped on their forehead written in bold font has been pretty dramatic in the recent year.
 
10:27 AM
lol ... just encountered a new answer where the person used a labeled loop (you can see that as a GOTO)
Had a flashback to my "Programming 1" college where we got introduced in java
 
come@me
 
They taught you GOTO in Java class?
That feels wrong
 
10:48 AM
@OliverSalzburg YES!
 
@GandalftheWhite That is likely a red herring
Node will complain when you attach more than 10 event listeners to something, because that is apparently completely insane
 
@BenFortune Yo are being under attack!
 
@OliverSalzburg simply means bad code I guess
 
@KamilSolecki Those are my votes :P
 
@BenFortune that's right. Thus, you are being under attack. By me!
I'll bring my kitchen knife and trust me, it is something to be afraid of
Let me give you a ref pic
 
10:56 AM
!!undo
you suck
 
ibb.co/gg1C2k - fear my mighty weapon
 
Are you a chicken?
 
I am of a reasonable size.
 
@OliverSalzburg they taught us the features of java and he had an example of a labeled loop
then he explained that it's a form of GOTO which you have to avoid. IIRC he ended with " You will hear more of that in another C++ course " :P
yet I got better explanation at my assembly courses <.<
 
Hi, what are the authentication concepts are available till now
1) when user logged in create a cookie, encrypt it - for my current projects I'm using this concept
is there any other concepts which does not uses cookie concept
 
11:05 AM
Hi guys gd evening
I am using ajax as source for datatable. Everything works except the response is not loading in the table. It's still showing processing. I checked the console there is no error and json response also fine. But if give ajax reload it works fine. Anyone know what the issue is?
I need to make it work in the first time itseld
 
@GandalftheWhite It means nothing, the limit is idiotic and cause of hundreds of unwarranted error reports
I really don't understand why such a core component has to complain so loudly about something this minor
 
11:32 AM
Another prime example of similar Node behavior: (node:13136) Warning: .then() only accepts functions but was passed: [object Undefined]
Where does one start looking for the source?
 
hey all
@OliverSalzburg the promise?
 
@bitten Woah. Because there is only one in my code...
 
._.
and bluebird is not logging like the stack trace?
pretty sure that's default behaviour
 
It's not a Bluebird promise. If there was more helpful information, I would read and follow it, not complain here about how useless the message is
 
@OliverSalzburg if there is no good information, try console.logging things and see if they happen before or after that
 
11:41 AM
Over 20 years of JS and we're debugging with console.log
 
we moved onto console.debug a few months ago
 
Whaaaa
 
it was tough to migrate the whole team but we got there
 
seriously?
 
/s
 
11:47 AM
it doesn't matter ?
@bitten I need to get an explanation for that
 
it's 2017, we shouldn't be using console.log to debug
 
Can anyone tell me the correct way in Webpack to build something to outside of the normal output directory? What i'm doing is I have a custom plugin, that I pass the directory I want it to output to, like this:
 
we should be using console.debug
 
new FooPlugin({
    path: path.resolve('./lib/'), // this correctly resolves to  /var/app/lib
}),
However in the plugin, when this code is run:
let filename = path + "/foo.txt"; // filename is now /var/app/lib/foo.txt

  compilation.assets[filename] = {
     source: function() {
       return contents;
     },
     size: function() {
       return contents.length;
     }
  };
It appends /var/app/lib to ./www which is where the assets are built to, and so writes the contents of the file to ./www/var/app/lib/foo.txt
 
@bitten * scratches hair * ... it's an alias for console.log
 
11:52 AM
I use console.debug to log
 
^.^
 
That's hardcore
 
i have this challenge : Given a string of even and odd numbers, find which is the sole even number or the sole odd number.
The return value should be 1-indexed, not 0-indexed.
Examples :
detectOutlierValue("2 4 7 8 10"); // => 3 - Third number is odd, while the rest of the numbers are even
detectOutlierValue("1 10 1 1"); //=> 2 - Second number is even, while the rest of the numbers are odd
so i have done d far is converted string to array and returned index for odd number , but for even numbers i get stuck.
function detectOutlierValue(input){
  let even=[],odd=[];
let array =  input.split(" ").map(Number);
for(let i=0;i<array.length;i++){
  if(array[i]%2!==0){
     even.push(array[i]);
     return i+1;
  }

 }
}

let output=detectOutlierValue("2 4 7 8 10");
console.log(output);
let output1=detectOutlierValue("1 10 1 1");
console.log(output1);
it returns now 3 1 .
 

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