« first day (2312 days earlier)      last day (2653 days later) » 

12:14 AM
Why do I always answer coldfusion questions on main.. I hate coldfusion..
 
^ I have heard you state this more this once I think
 
...damn you adobe!
 
what did adobe do this time
 
lol adobe makes coldfusion -- look only $8.5K for enterprise access -- adobe.com/products/coldfusion-family.html -- why would anyone utilize this
 
hahah that is actually pretty hilarious
 
12:25 AM
$_$ (supposed to be two dollar sign eyes) :P
wonder if they got any coupons
 
hey Guys I have a quick Question if I have a href with javascript:alert("aa");
I have a code who prevent component to execute the href..
How should I execute my href without using element.click()..

I have thinking that should I take the href: var href = element.attr("href");
but I dont really know what should I do with it.. some guys tell me that eval is not a good option because it does some weird thing with it
ok.. its maybe not quick...
 
@Jean-philippeEmond set it to an invisible href and execute the click on that. Why can't you call element.click() to begin with?
 
hm... the .click() is a simulation of "user click" ?
Because for now.. if I click on the current element.. nothing appends.
happens*
 
@Jean-philippeEmond I assumed you were using jQuery
please create jsfiddle.net
 
@William, You'll maybe disgusted but .. it is a Wordpress in localhost. I'm working to a theme build by my predecessors.. and .. you know..
but its not bad.. maybe I'll try to generate a new anchor and trying to execute it on the fly. maybe it'll works
 
12:42 AM
@Jean-philippeEmond localhost is how most people development sites locally nothing to be disgusted at.
 
disgusted because its a wordpress haha
 
wordpress ah yeah well php has its negative parts
 
php has its bad parts, but wordpress is just.. bad..
 
@littlepootis wordpress runs like half the blogosphere I have read
it can't be that bad
 
1:05 AM
Last time I read WP's source code, I was 13.
I'm still undergoing chemo.
 
@littlepootis at least its fuctional
bad oop is worse in my opinion
 
1:22 AM
is there a way to observe css mutations made by inspector in chrome?
 
not sure what a mutation is exactly
 
I found this but it is for extensions.. developer.chrome.com/extensions/… and I cannot use extensions
I a using this at the moment, but does not detect CSS changes made from the inspector:
// select the target node
var target = document.getElementById('layout');

// create an observer instance
var observer = new MutationObserver(function(mutations) {
  mutations.forEach(function(mutation) {
    console.log(mutation.type);
    updateDataLabels()
  });
});

// configuration of the observer:
var config = {
	attributes: true,
	childList: true,
	characterData: true,
	subtree: true
};

// pass in the target node, as well as the observer options
observer.observe(target, config);

// later, you can stop observing
 
sup people, any tinymce guru here? stackoverflow.com/questions/42194032/…
 
@Crasher 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.
 
1:47 AM
Angular 2?
 
2:11 AM
I need to learn angular 2 on udemy
 
Dont
Not on there
Linda.com
Go with angular cli for typscript to javascript processing.
 
is it expensive the course on lynda? there are many free tutorials there right
 
Not free.
You can download them from torrents.
extratorrents.com
just make sure you have a vpn
 
well then I think I just need to download those pirated tutorials on warez-bb. :-)
I am in indonesia, piracy is legal here. LOL
 
haha
I believe information should be free.
Imagine the world where everyone had the same resources as the top computer science program. For free. Or any information in general.
 
2:20 AM
yes you're right. it seems right now that tutorials is as expensive as hollywood movies.
 
It seems that way maybe in your contry.
I been lucky enough to always know where to find good resources for free.
or Paid resources for free.
 
the only thing that should be paid on the internet is hosting only because it involves hardware. software and tutorials should be free.
 
Yes
They have monetized learning.
That itself is a road block.
There is so many capable people in the world.
That will never get a opportunity. Simply because they can't afford it.
 
good points
 
@SalOrozco smh
This is a public chatroom.
 
3:11 AM
0
Q: Karma config to exclude nested directories

Display NameI am using karma for unit testing my angular 2 application. I have following directory structure - Main/ todo/ js/ third-party/ shared/ tests/ stubs/ utils/ service/ I want to exclude all files under my main/todo/js/third-party/**/*.js ...

Anyone could help?
 
3:54 AM
@Zirak Come to Mexico, @BadgerCat will give a talk next month
 
@copy Ooh, what talk?
 
@SomeGuy Machine learning
 
checks flight prices
slowly backs away into the darkness
 
user6820627
wow. where?
 
What should we do for Valentine's day?
 
user6820627
4:00 AM
we should code
 
@LearnHowToBeTransparent You're not invited
Well, I'd need to ask her first
 
4:15 AM
I need to expand a bounch of x/y coordinates with the mouse
like in circle or something
I show labels at coordinates and they are overlapping (sometimes)
I wonder how I can enlarge them on mouse hover
like detect nearest points
move each point into a direction
like horizontally would be fine
 
@copy Can I come? I promise to wear pants!
 
buy roses and give it to a girl who wear skirt
 
4:39 AM
@monners But of course
 
@copy Second question: Where does one buy pants?
 
@copy Just because he has pants?! What do you have against pantslessness?
 
@monners What's pants?
 
@copy Did you see this? It was quite amusing newyorker.com/humor/daily-shouts/i-work-from-home
 
@copy I'll take 500 for something an exhausted dog does
 
4:44 AM
@SomeGuy Hah
 
4:56 AM
can anyone tell me what's wrong with this code. I am trying to read through a file in node.js jsfiddle.net/q2qcaLp2
the error says ReferenceError: e is not defined
 
console.log("Error:" + err.code + " (" + e.message + ")");
e.message is your issue
 
what's the issue?
 
(Same problem a few lines later)
@jacobian e is not defined, as you said
The error parameter is err, not e
 
and how to defined it?
I learnt it from this video on node.js but it seems I can't get it running
 
Do you understand how function arguments work?
 
4:59 AM
so I just need to change e to err?
 
How you define and call functions?
 
function name(param1, param2) {}
name(param3, param4);
that's how to define and call functions
well yes, I get it working. I just need to change e to err.
thanks though.
weird that in the tutorial the instructor uses e but can get it working. whilst me had to use err to get the code to work
 
@jacobian As long as you understand why, that's good
 
yeah thanks mate
 
hi..can any one clear me about `find(start + 5, "(" + history + " + 5) ") ||
find(start * 3, "(" + history + " * 3) ");` this code
 
5:06 AM
@user7104874 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.
 
5:36 AM
is ul li more like an array or an object?
 
5:47 AM
@neoDev Both, I guess? Like how light is both particle and wave.
 
I think so
everything can be everything (more or less) nowadays
 
@user7104874 Can you also post find () method in the question ?
 
@FlyingGambit here is my post question stackoverflow.com/questions/42197233/…
 
@user7104874 nvm, I just noticed the find method
 
@neoDev !!>var h=''; for(let i=1; i<999; i+=i*1){h+=i+' '}
@neoDev "1 2 4 8 16 32 64 128 256 512 "
@neoDev "1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 1073741824 2147483648 4294967296 8589934592 17179869184 34359738368 68719476736 137438953472 274877906944 549755813888 1099511627776 2199023255552 4398046511104 8796093022208 17592186044416 35184372088832 70368744177664 "
 
6:00 AM
When I'm pushing objects into an array using

`myArray.push({key: myObj})`,

the keys in myObj are automatically sorted in alphabetical order. Is there any way to avoid this?
 
@john 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.
 
keys in objects are, for all practical purposes, unordered
but not really
 
Yes, but the current order is important to me. Push always sorts the keys, which I want to avoid.
 
push doesn't sort the keys in objects pushed
Can you make a fiddle or something reproducing the behavior?
What does it mean for the keys in an object to be sorted?
Are you enumerating over the keys in myObj?
 
You're right, as seen here stackoverflow.com/questions/24241761/… it is Chrome sorting the keys. My bad !
 
6:23 AM
@user7104874 Did you get an answer ?
 
@FlyingGambit yes, but still not clear.
 
The return statement returns the result of the statement.
return 1;    // returns the result of 1;
return 1+2;  // returns the result of 1+2;
return Math.random(); // returns the result of executing Math.random()
With the OR operator
return false || true;  // returns true , it first found false so it when to check the second one
return true  || false; // returns true, it first found true so it did not check the second one
return false || false; // returns false, it first found false, second was also false so returned false
return true || true;   // returns true, it first found true, so it did not check the second one
We can also do the same thing with a function,
function t(){return true;}
function f(){return false;}

return f() || t(); // returns true;
return t() || f(); // returns true;
return f() || f(); // returns false;
return t() || t(); // returns true;
In Js, false, "", undefined, NaN, null, 0 are considered as falsy values
Anything other than this would be a truthy value
Recursive functions are functions that just call them-self, you would think that this would result in an infinite loop of function calls, however they are often checked for a condition, when this condition is met, the looped is breaked.
In your case,
return find(start + 5, "(" + history + " + 5) ") || find(start * 3, "(" + history + " * 3) ");


If find(start + 5, "(" + history + " + 5) ") returns null
then it will check for
find(start * 3, "(" + history + " * 3) ");
it will return whatever the result is
@user7104874 ^
 
@FlyingGambit awesome explaination. Thanks dude!
 
@user7104874 Your welcome
 
I find the explanation interesting and starred it
 
6:41 AM
who can I ask about Caprica Six?
 
6:52 AM
@neoDev Zirak.
 
@neoDev Or read the source github.com/Zirak/SO-ChatBot
 
I am reading the docs but I don't understand how to save a command and then exec it using a !!var
 
 
2 hours later…
9:01 AM
0
Q: solve numeric keypad puzzle using javascript

rodd marshi was attend an interview before some days and the company gave me an puzzle to solve using javascript. but i could not complete it. You can show the code here.. $(document).ready(function(){ $("#phone").find("button").mouseup(function(event){ var button_pressed = $(event.curr...

 
9:15 AM
any particularly inspiring codegolf examples?
like the c donut
 
@towc this one ?
#include <stdlib.h>   // card > aek.ppm
#include <stdio.h>
#include <math.h>
typedef int i;typedef float f;struct v{
f x,y,z;v operator+(v r){return v(x+r.x
,y+r.y,z+r.z);}v operator*(f r){return
v(x*r,y*r,z*r);}f operator%(v r){return
x*r.x+y*r.y+z*r.z;}v(){}v operator^(v r
){return v(y*r.z-z*r.y,z*r.x-x*r.z,x*r.
y-y*r.x);}v(f a,f b,f c){x=a;y=b;z=c;}v
operator!(){return*this*(1/sqrt(*this%*
this));}};i G[]={247570,280596,280600,
249748,18578,18577,231184,16,16};f R(){
return(f)rand()/RAND_MAX;}i T(v o,v d,f
 
what's it do?
 
try it: card > aek.ppm
 
I'm on the school windows computer..
 
(ppm is a graphical format)
 
9:19 AM
oh, TIL
 
Here, run this code snippet from a stranger that you don't understand! :D
 
(I'm preparing examples for a walk through the useless for a 5 min walk on Wednesday btw, am looking for something that has kind of enough resources for people to be able to better understand it)
 
just made a screenshot for you:
 
imgur don't work on school network :/
 
OK, Found again the article where I saw it deciphered
 
 
> I was so fascinated by the idea of Paul Heckbert's business card sized ray tracer idea that I had to try making one of my own. I'm pretty pleased with everything that I managed to cram into this. It pays homage to some classic ray tracing cliches and has the perfect file size.
 
Fun article
 
oh, someone remade it in js in one of the js1k entries I think
interesting. Still not what I'm looking for, not entertaining enough I guess :/
 
You have a raytracer which handles spheres and a plane. Animate it ;)
(a very fast CPU would be needed though)
 
9:27 AM
so much for shameless self promotion
and I do kind of need to send in the slides today
 
@towc build Google using COBOL
 
fun ? We don't see it the same way
 
it will be funny when Google finds out that it has a rival
 
any particularly interesting examples of golfing in ruby?
 
build a plant in ruby that grows when you say nice words to it and shrinks when you dont praise him enough
 
9:31 AM
I don't want to build anything now
stahp
 
HAMMAHTIME!
 
!!urban stahp
 
HAMMAHTIME!
@FlyingGambit stahp In memes simply stop, usually meaning stop doing something horribly wrong.
 
@towc Thats what I wanted to hear
The Tears of joy when something goes as planned
 
we have things to do gfy
 
9:36 AM
!!urban gfy
 
@FlyingGambit gfy Could mean either "Go fuck yourself" or "Good for you". Either one works quite effectivly.
 
which one is it towc ?
 
@FlyingGambit Ask yourself whether you were helpful enough to deserve the second one
 
I gave him good golfs but he could not cope up with the challenge
 
:P
fair enough
 
9:41 AM
@towc TBH I don't see how you can present an interesting code golf example in 5 minutes. It would have to be incredibly simple or focused on a very specific code point
 
@DenysSéguret it's just to get people laughing and inspired. Anything by aem1k is good game for example, but that's js only
fair game*
 
I lost the game
3
 
OH DAMN YOU
anyway, here are my current talking points: docs.google.com/document/d/…
 
a 2d game that looks 3d like the doom 2 game :D
 
@towc do you have experience with css flex ?
 
9:45 AM
@KarelG aye
 
I'm trying to have a nice "table" layout with css flex only
but as you can see, the height of the boxes (green red) doesn't fit well to the box around a name
 
@KarelG use a proper layout
using flex-wrap in this case is crazy
 
is it bad ?
 
oh wait, I was looking at the wrong thing
 
@KarelG Why not an actual table?
 
9:50 AM
oh, height: 50% without padding does the job
because it's not for tabular data
also hard to generate since the dimensions can vary
 
Looks pretty tabular to me, from the general looks of the thing
 
^
 
You can do it with flex elements but you'd better add elements (like separating contents from headers or wrapping the header text in an element to center it, etc.)
Without elements: jsfiddle.net/a5y8fz1v
(but really, additional elements would be cleaner)
 
do it in canvas
 
@DenysSéguret so like
<div class="event">
  <div class="top">top 1</div>
  <div class="bottom">bottom 1</div>
</div>
 
9:55 AM
That's one solution too
 
btw, the data from the db comes as top1, bottom1, top2, bottom2, ...
difficult to generate a table from that unless i sort the collection
 
the event element sounds logical, it matches the data structure
That's probably how I'd do it
 
@KarelG Doesn't sound very difficult, really. Example data?
 
it's for myself, to have a simple calendar view of one month per page so that i can see who's on work / working home / on vacation / ...
the api comes as { events: [ { name: foo, eventData: [{start: 2016-12-01 08:00, end: 2016-12-01 12:00}, {start: 2016-12-01 12:30, end: 2016-12-01 15:00}, {start: 2016-12-02 08:15, end: 2016-12-02 12:30}, ... ] }, ... } But some eventData objects spans over multiple days ... So it's far easier to put top1 - bottom1 - top2 - bottom2 if the data spans over 2 days (top = AM, bottom = PM). The divs won't get text, only tooltips and bg-color
like a week holiday, that's wrapped as {start: 2016-12-03 09:00, end: 2016-12-08 17:00} ...
 
10:25 AM
Does anyone knows something which will generate grid on go using JS ?
based on model, ot be more specific OData model
 
you can combine golang with js? how to do that?
 
@jacobian Copy & paste
 
XD
I dont see that many job offers for go-lang devs
 
I don't understand what the state object in the pushState() method in JS is
 
yes, the only job offers available is javascript and html5 for gaming creation
 
10:37 AM
I can put anything there?
 
golang is a system programming as they say
 
@Alesana yep, of course
 
but I don't really know what system.
 
@GNi33 should it be unique though?
Or can I just put {1:1} or something?
 
you can put an empty object as well.
It's there to save state information that you'll need
on popState for example, it would return the object you provided before
 
10:39 AM
Ah so it's just used for saving things for a session, kind of?
 
@Alesana It's actually more for saving a state, thus the name. Cue the State design pattern.
 
@jacobian Go isn't a system language at all. It's the perfect language for network and web applications right now, as well as GUI-less programs
 
Hah I guess I don't really understand what a state is :|
 
hm
I can't put it in good words right now
 
imagine a switch to turn on / off light. If the light is off, then the state is off. When you use the switch, it changes the state to on and the light is on.
 
10:42 AM
@FlyingGambit That didn't make much sense. Maybe you meant: stat, stats, steve, static, stars
 
!!urban state
 
@FlyingGambit state Something that stupid people argue about on UrbanDictionary.com
 
ofc you can have more complex states such as a digital watch which has a chrono, timer and current time. That means it has 3 states: Chrono / Timer / CurrentTime. If you're on CurrentTime and use a button to switch, it goes to the next state: Chrono. Use the same button again leads you to Timer. Used the button again brings you back to CurrentTime
My digital watch has 6 states
 
Ahh that last explanation made a lot of sense
 
so each state has its own functions and display :)
 
10:44 AM
So a pages states might be "step1","step2", and "step3" for example?
Lol I removed the brackets I don't know why I put them there
 
not much tutorials on golang in udemy. guess it didn't gain any traction. beside I can't find any chatroom in stackoverflow dedicated for golang.
 
@Alesana yep, although that's something you could theoretically get from the url as well. Having this in a state object is better though. And you can provide additional data in your state
for example if a user got there through a different context (more routes going to the same document) and you'll need to display something different based on this context
 
@Alesana Sorry about the state pattern thing. This state is not that state...
 
Haha I was very confused @Sheepy
Not a problem
 
The memento pattern is a software design pattern that provides the ability to restore an object to its previous state (undo via rollback). The memento pattern is implemented with three objects: the originator, a caretaker and a memento. The originator is some object that has an internal state. The caretaker is going to do something to the originator, but wants to be able to undo the change. The caretaker first asks the originator for a memento object. Then it does whatever operation (or sequence of operations) it was going to do. To roll back to the state before the operations, it returns the memento...
 
10:48 AM
ah memento ...
 
@Alesana ^ This is the correct pattern.
 
I'm not sure if this really helps
 
Me neither. I don't think the Gang of Four or the wiki is doing a good job, honestly :| But it's the best job we have for now?
 
with the history api, the state objects do not have to be the same
they can be completely different. Memento works based on a given object, it can just revert the values
 
Yeah. You can just put whatever you want in push state. Just trying to point to the most obvious use case to me...
 
10:52 AM
History provides a push/pop stack, where entries can have objects to provide additional information and the browser understands its purpose and is able to wrap it's navigation patterns around it. It's not really much more than that
 
Hi can someone help me with calling a property from a component
 
So, a use case for an HTML5 game could have a state object {"level":"2","lookposition":"up","x-position":"53","y-position":"62","inventory‌​":{"32","24"}...}?
 
@Mr.Blue 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.
 
Or am I way off?
 
you're pretty spot on I'd say
 
10:54 AM
Awesome
Thanks for explaining it to me guys ^^
 
if the player in this case closes the browser, reopens the page with the given url, you'll get this exact object through the history api and you can initialize your level
 
you have to check the url too or not ?
 
Im trying to connect my reactjs to backend which is in golang... I've done the ajax call, the only issue im having is the button which I have I'm not able to call as it isnt a property within a component
 
I would keep inventory info out of it though
 
(it's an optional arg)
 
10:55 AM
state should be general, i.e. the same for any player / user
inventory is something for localStorage etc.
in my opinion
 
i mean, if user closes browser, opens it, checks other pages before coming on your page with the history states
not sure if each domain has it owns states or that the browser stores all state pushes on one pile
 
What do you mean checks the other pages?
 
@KarelG you could just read history.state in the load-event
 
Ah check past history?
 
> You can read the state of the current history entry without waiting for a popstate event using the history.state property like this
TIL
 
11:00 AM
@GNi33 You would keep inventory out of it because then it could become too large of an object?
 
no, it's more about seperation of concerns
but yeah, the state object is not meant for big chunks of data either
 
Ah I understand
 
I think it's limited to 640k or something
which should be fine for an inventory, but still
 
I saw that
I could see how the "state" of the game would not include inventory, as it also wouldn't include username, bio, etc...
 
if I want to put a String with Spaces into a jquery data-attr, what would be the way to do this? Currently it is just cuttet after the first Space. Should I just replaces the spaces or is there a better option?
 
11:07 AM
Actually I guess username and bio were bad examples haha if I were actually making a game I could have came up with some better ones :P
 
Im trying to connect my reactjs to backend which is in golang... I've done the ajax call, the only issue im having is the button which I have I'm not able to call as it isnt a property within a component
 
If I have an angular directive like this: <form my-dir="doSomeFunc(1,5,12);">

How can I execute doSometFunc(1,5,12) on the $scope, when "the time is right"?
 
234
Q: How to call a method defined in an AngularJS directive?

mcbjamI have a directive, here is the code : .directive('map', function() { return { restrict: 'E', replace: true, template: '<div></div>', link: function($scope, element, attrs) { var center = new google.maps.LatLng(50.1, 14.4); $scope.ma...

 
11:32 AM
@ErwinOkken & binding in the directive maybe?
 
Hey all. i've been using "npm start" this whole time to run my angular 2 app. Now that i want to deploy on a server, I realise i dont even have basics for the directories. How do I set this up?
 
@OliverSalzburg But then I need to use isolated scoping, which I don't at the moment
 
@betarunex well I don't use angular 2 yet, but I setup angular 1 using express, and I just create a public directory where I put all those static files.
as far as how to setup your directories, I think setting them up by feature is the best, as opposed to setting up a folder for views, a folder for modules, a folder for directives, etc.
 
If you structure your project files by type, you're doing it wrong
Structure your project by purpose
@ErwinOkken I don't see why, but then again, I never use unisolated scopes
 
@OliverSalzburg I now use scope.$parent.. is that a bad practice then?
(With isolated scoping in the directive)
 
11:45 AM
@ErwinOkken Yes, it is, but I also use it when it makes my life easier ;D
 
Hehe =)
What should it be then, instead?
 
Oliver says it best.
"Structure your project by purpose"
I like that
 
@ErwinOkken Having an isolated scope only means there's no inheritance, you can still access the parent scope explicitly
Unless I'm mistaken here, I'm not 100% on that
In general, I use $parent with nested directives and transclusion, because that can generally be a pain without
I don't see why the & would have any impact on this though
 
anyone play with any p2p in the browser libraries?
 
Is it possible to compile only sass using webapck?
 
11:57 AM
@OliverSalzburg Thanks. For now I indeed use a &-binding and parent scope for some vars that I needed. Will figure out how to get rid of that $parent later on :)
 
user3119231
good day, gentleman. Is it possible to get the .wrapper divs under each section? I need to group them. -> i.imgur.com/G4pqiDR.png - 1. array[3 divs], 2. array[1 div], 3. array[1 div]
 
12:18 PM
!!sandbox
 
@FlyingGambit Please go and play in the Sandbox
 
12:32 PM
The profile pic Caprica is using, who is that ?
 
@FlyingGambit Caprica Six.
 
Thanks, She is hot
 
cc @rlemon Do you still have the link of the dude who tried to pick up Cap?
 

« first day (2312 days earlier)      last day (2653 days later) »