« first day (1724 days earlier)      last day (3217 days later) » 

12:51 AM
Wow IE
how do i murder you ?
 
You need a time machine.
 
@Luggage this browser is maniacal
 
the old ones are pretty bad.
 
transitions will work if you apply them via css
but not if you do inline style
// react-style thus fails terribly
 
you still want to use css with react
 
12:53 AM
@Luggage no i am making a component
the one like the ui pattern i added above
 
you only put the dynamic bits in react
 
its almost done (almost)
actually i personally feel i should make it a web-component :-x
but then meh.
 
1:35 AM
@Abhishrek Microsoft beat you to it
 
whats the best way to state.go to a view, and reload it when get there
i tried
$state.go('app.Searcg',{},{reload: true});
with not much luck
 
@rodling using ui.router?
and you've got a typo
 
requires injecting ng route into newer angular, any without it? or is that main choice
ya, i changed the name last second, its correct in the code
 
what do you mean "Reload it when get there"?
 
basically get to a fresh page, reloaded. Not just view but the controller too
 
1:52 AM
hey. I haven't been in this chat in forever
 
@rodling Define "reloaded"
The controller will be newly instantiated regardless
@turnt welcome back
 
@SomeKittens i thought so too, but its not
i have a simple check, first time it runs. When i navigate away and come back to it, it doesnt initiate.
 
I don't think I remember anyone...
 
what's your "Simple check"?
 
Either that or everyone changed their names...
 
1:54 AM
if (current_user.id === undefined) {
		$timeout(function() {
      $scope.modal.show();
		}, 100);
	};
pops up login screen basically
@turnt yaap, massive conspiracy around here.. had to change names
 
@rodling not quite what I'd call simple
So what is current_user.id at that point?
 
I have this code:
$(function() {
  if ($("div.check").length) {
    $("div.g-friends.global a").click(function() {
      var check = $(this).find("div.check > input[type=checkbox]");
      if (!check.is(':checked')) check.prop('checked', true);
      else check.prop('checked', false);
    });
  }
});
 
jsfiddle.net/h3cq8sx4 Hi could anyone tell me why this doesn't execute in order? I'm trying to understand how to use Promise
 
and it's messing up the checkbox. The label next to it is now clickable. But clicking on the checkbox checks it and immediately unchecks it.
 
@SomeKittens wouldnt even know, it is not hitting all things in the controller
 
1:58 AM
Like you can keep clicking it, and it won't check.
 
Put it in a fiddle
 
i have console log with name of the controlller as first line, nada
 
@rodling so you're not getting any logs at all
 
yes, as if controller never gets reloaded
 
2:02 AM
@rodling can you create a small example?
 
not too eager, as I make more errors in making angular plunkers than solving errors with them
 
I want the console log to show [Object {} , 2] and then []
Instead I am getting [] and [Object {}, 2] which means the function call is async
 
user406009
@anath2 If you want a special ordering, you have to use .then
 
user406009
At least I am assuming that's what you are looking for when you ask "[Object {} , 2] and then []"
 
user406009
2:13 AM
Also, you probably want to add an else statement with reject to xhr.onload. A good rule of thumb is that you should always either reject or resolve.
 
2:29 AM
In React I have a dropdown that closes when somewhere else on the page is clicked. I also have a click event on individual that removes the message from the dropdown. However this seems to sometimes close the dropdown if the message is removed before the global click event occurs. Is there a better way to structure this? My code looks something like this:
// Close the dropdown if somewhere else on the page was clicked
handleGlobalClick: function(e) {
    if (!React.findDOMNode(this).contains(e.target)) {
        this.setState({dropdownOpen: false});
    }
},
// Remove a messsage when an (x) button is clicked inside the dropdown
handleCloseMessage: function(i) {
    var currentNotifications = this.state.notifications;
    currentNotifications.splice(i, 1);
    this.setState({notifications: currentNotifications});
},
// Add a global click listener
 
user406009
2:40 AM
One thing to try is using the xy coordinate of the click rather than .contains
 
user406009
@joshhunt You might also want to look into using the second form setState for handleCloseMessage. setState calls are batched, so you might have two calls of handleCloseMessage (with stale data) if someone clicks the x button really fast.
 
Hmmm xy seems a bit trickier but I'll look into it, thanks.
also not sure what this means "using the second form setState"?
 
user406009
setState has two forms. One where you pass it an object. Another where you pass it a function. You can see the example on facebook.github.io/react/docs/component-api.html.
 
user406009
When you pass it a function, react is able to do that update atomically.
 
user406009
Let me illustrate with that code you pasted.
 
user406009
2:47 AM
Imagine that this.state.nofications = [1,2,3];
 
user406009
Someone calls handleCloseMessage(0) and handleCloseMessage(1)
 
user406009
That results in calls to setState([2,3]) and setState([1,3]) accordingly.
 
user406009
React takes the last result, so now this.state.nofications = [1,3].
 
user406009
In essence, you lost the first handleCloseMessage(0)
 
user406009
Although in retrospect, you need to use a unique key (not the index) in order for it to work properly.
 
user406009
2:49 AM
As the indexes change when you remove items from the array.
 
right that makes sense, good explanation thank you. So anything that relies on the current state should use a function, yes?
 
user406009
Yes.
 
thanks for your help
 
3:24 AM
@Lalaland Thanks you're a lifesaver
 
As an innocent bystander, that helped me, too. I had no idea that you could pass a function into setState. Thanks
 
3:44 AM
@Lalaland I ended up using document.contains() which seems to work. Like so:
handleGlobalClick: function(e) {
    if (!React.findDOMNode(this).contains(e.target) && document.contains(e.target)) {
        this.setState({dropdownOpen: false});
    }
},
 
4:16 AM
morning
@SomeKittens that's a really nice intro
 
Oh, the reactive thing?
yeah, I really liked it
 
yep
 
4:33 AM
Currently writing a bunch of TS with observables
it's been a very long time since I've been this over my head
 
5:15 AM
nice
 
@AwalGarg mooooooorrrzzzzing
 
@argentum47 yo. Did you manage to not miss the gym yesterday? :P
 
Hi friends
from being one week am suffering with one problem
can you guys please help me out
 
@Aparna Please state the nature of medical emergency.
 
@AwalGarg suffering with the issue in javascript
lol
 
5:22 AM
@AwalGarg yup .. and then I came back, tried to read pacman source, slept, and wokeup, read a little Rxjs and made a wikipedia search . and now I am back to my boring life... \office/
 
1
Q: How can I hide or pass particular data in URL using router.navigate

AparnaI am new to backbone.js . My requirement is I need to post some data to server in ajax call. For that I am binding data into json format and posting it to server like below var BookMarkData = JSON.stringify(postData); self.app.router.navigate('#hotels/' + BookMarkData, true); postdata contain...

this is my issue
 
@argentum47 :D
@Aparna why is your question tagged javascript and java together?
 
maybe java is backend
 
@argentum47 some java guys may gone through this kind of isse
thats why
@argentum47 yes exactly
 
First of all, you can't "hide" anything from the client.
so it is not possible to send information to server, without the client knowing.
 
5:25 AM
@AwalGarg ok . But can I route and navigate separately in backbone.js
 
Possibly. But I don't use backbone.js, I just aimed at the second part of your question.
 
@Aparna typically, your route would map to some resource.
via some sort of id
 
here I am passing the information like this . self.app.router.navigate('#hotels/' + res, true);
 
once you route to it, you'd do a request based on that ID, for that resource
 
@phenomnomnominal yes I am doing request with one ID
 
5:28 AM
@Aparna why have you posted the same question here as well: stackoverflow.com/questions/31167068/…
with an accepted answer commented with "didn't work" :/
 
@AwalGarg as I am not gtting any replys from one week
 
-_-
 
bymistkly i clicked
so can u tell me the solution for this
 
@phenomnomnominal I imagine you have CV privileges. Can you dupe vote the newer one?
 
@AwalGarg done
 
5:30 AM
done
 
You're pretty close to 3k
 
thanks :)
yeah I am. but I have kinda lost interest in rep :/
 
yeah after sometime, reps just find their way to Awal
 
^ true story. didn't do anything after gaining 1k rep, still have 2.3k.
 
5:55 AM
Hello guys
 
yeah hi @shankar.parsanamoni
 
Greetings sir/madame
 
Hello
 
6:28 AM
hello
 
What's up?
 
the old ceiling with an fricking frozening ac
 
I with the ceiling ac was the aggressive one. The ones by the window are giving me a cold >_<
 
so... we should not mix styling with content right? wtf is "col-4 btn-red" then? how the fuck is that not styling?
 
using classes is Okay
 
6:36 AM
explain FFS
 
I mean still you are stying using css. you are just referring the class name in html.
 
/me ready popcorns
 
so styling in the "style" attribute is bad but styling in the "class" attribute is ok?
 
not bad but should be avoided
 
and so should "btn-red". our's is a flawed community.
 
6:38 AM
wtf is "btn-red" ?
 
a red button .. should be btn-danger
 
I am thinking it as a class though
 
the class name heirarchy style followed by 85% of "modern" css/html
 
yeah people mostly follow that
including me
 
and you think it is not styling?
 
6:39 AM
/me nods in agreement
 
it is styling but you are keeping the styling code somewhere
but some devs using other attributes to style. check this amcss.github.io
 
I dunno , isn't the point of using .class #id and styling them in css is to keep things dry ?
 
so basically "<p onclick="something()">" is also ok because we are keeping the "something" code somewhere else.
 
I can't comment on JavaScript but using that in css with class attribute is ok
I do that always and I am sure others do the same
 
I know others do it as well. But it is not following what people think they are following "separation of concerns".
"btn-red" in a class name is no better than "color: red" in the style attribute.
 
6:44 AM
It's not the problem of class. It is how you use them. btn-red is purely style. btn-alert is less style. And if you can use dialog.alert button instead, even better.
 
@AwalGarg but why do you want to write styles in html as well as css?
Keep the code in layers
 
I think Awal Garg is saying we shouldn't.
 
we should all give up and go back to CLIs
 
@Sheepy Can you give an example of usage of the last example while maintaining the flexibility of the "btn-red" thingy?
 
or we should give up programming
 
6:46 AM
@Mr_Green that can be done
 
@AwalGarg Well, if you want a red button style that you can put at arbitrary location, you are really doing styling, are you not?
 
BECOME AN ARTIST LIKE MY MOTHER WANTED
 
Don't think artists are free. They have as much constrains as we do.
@AwalGarg Or do you want to teach that sometimes you can't help but to mix them up?
 
@Sheepy I think that the present situation is like that. And I am trying to find my way out.
I think if we borrow the idea of interfaces from OO backend languages, we might solve this.
then we will have 2 layers of markup and 1 layer of styling.
 
@AwalGarg For your reference, even Java has given up and JavaFX desktop applications are now styled with CSS.
 
6:52 AM
@Sheepy Yes, same with GTK.
 
@AwalGarg GTK too? Now that's big.
 
But GTK CSS is saner. They have variables and mixins for colors.
 
Well, CSS does have variables. Gecko supports them.
 
And GTK has the best separation of markup and styling right now.
 
That's some feat! :D
Any example?
 
6:57 AM
@Sheepy yeah, github.com/awalGarg/KA/blob/master/src/ui/message_wrapper.xml basically gtk allows extending on base elements from your code.
so that allows you to abstract away any repeating logic. you can import an element, and define behavior on it, and use it as an element and a component together.
 
Ok. A bit like shadow DOM?
 
pretty much. but this has some drawbacks. your code becomes heavier.
and the present markup definition is also a bit clunky. reason why I had to write this: github.com/awalGarg/KA/blob/master/tools/xmlBuilder.js
 
Can't be avoided. Delegation, separation, modualisation, they all means more code.
Oh...
 
http://jsfiddle.net/Lqeznhdv/1/

how can I keep my text to right
 
You did your best, I suppose.
 
7:01 AM
for class value
 
@Learner jsfiddle.net/Lqeznhdv/2 Like this?
 
@Sheepy ewww no
let me draw it
 
If we can figure out some way to target elements without any IDL like definitions in markup, that'd be big.
 
7:08 AM
@AwalGarg exactly what I want but it won't going to work in IE-8, let me find a substite thanks tho
 
I recommend the same solution. Flex is simple. Finding substitute will cost you extra time and effort and development cost - does your client know that?
 
So there is reactjs, reactive, ractive...
 
@Sheepy my client is my manager with rigid requirements - no negotiations :(
@Mr_Green ta, seems to be working
 
@Learner Remember, they overlap when Bio is over 150px. Flex does not.
 
7:12 AM
but still I will recommend display flex.. bcos we should move with new features
 
How to know if a facebook like box plugin has loaded successfully?? I have to re-adjust layout if facebook like box plugin is loaded completely, I have included function to re-adjust layout in function adjust_layout() .. So adjust_layout() function should run exactly after facebook like box plugins have successfully loaded??
 
-1
Q: Javascript game library supporting multi-touch?

Sarim Javaid KhanAfter a tiring research, I am getting back here for the problem I am stuck in. Following is the problem: I am making a game that should work on minimum 30 multi-touch points at the same time. I need to make the game using javascript. I found a game library named "phaser" but it supports maximum ...

> I want a library that support up to 30 points multi-touch"
 
@Cerbrus Wow. A game for Cthulhu?
 
Aside from the insane request:
Apparently, I can use all my appendages and my nose, and I'd still be short 8 input "points"
 
anyone?
 
7:18 AM
@AashizPoudel Depend on how the "facebook like box plugin" is loaded. We don't even know what it is; if you don't know how to tell when it is loaded, we won't either.
 
@AashizPoudel It seems you are loading in an IFRAME
there are ways to load the click in html elements too.
you need to just pass the url to anchor element
do research, you may find it
 
facebook like box plugin is loaded by <div class="fb-root"/> method using facebook sdk... not using iframe method
 
@Sheepy multiplayer maybe?
 
@ivarni I think so. 30 points mean 6 hands. But it is still a library request...
 
7:20 AM
It is loaded asynchrously
 
Ah... so it's not "a plugin like facebook". You mean the "facebook like button".
!!tell AashizPoudel google facebook like button finish load
 
Hey those are not my results!
 
the code is like this,,, <div class="someblock"></div><div class="likebox"></div> ,, if likebox successfully loads , i want to put someblock and likebox in a same row,, but if does not loads, someblock should only be shown spanning entire row,,,
 
7:23 AM
y u no read the doc I linked :(
 
brb
 
ok am reading
 
@AwalGarg Nobody reads docs. That's why I never document anything I make
 
documentation is recursive, it never stops
here there are documentations for the documentation
 
@Mr_Green That's how I feel about mongodb documentation...
 
7:34 AM
I think I have read more docs than I have read codes...
 
I just code and read the docs when necessary. most of the times I end up writing huge code for simple manipulations. but who cares, I do the job. that is what matters.
 
@Mr_Green No that is only the beginning. A lot more things matter.
 
like?
 
@Mr_Green maintenance of the code.
 
I keep the code in structure, what to do this with the docs?
 
7:38 AM
I have a parent div and children divs..

<div style="height:500px;">
<div class="head"></head>
<div class="body" style="overflow:auto;"></head>
</div>
is overflow:auto possible without setting element's height ?
 
Structure alone doesn't make your code maintainable. You have to use APIs in a way that when you want to add/remove/modify a feature, it can be done sanely.
 
Just come into work and have been asked to a code review and "just ok" a commit that has created global variables and I can figure out why?!
 
body's height will be main div - head, but do i only option have is to use on load put height to body ?
 
@Mathematics nope. check max-height , that might help you
 
7:40 AM
I also keep my code in structure. Awal still said my code is obfuscated. :)
 
@MadaraUchiha old
 
> My code is in structure. A pile of rubble is a structure.
@AwalGarg Still gold though.
 
@MadaraUchiha thanks, will check it.
 
yeah it is pretty good though
 
Morning
 
7:45 AM
Morning~
 
@MadaraUchiha seems like the design principles don't go out of style?
 
@AwalGarg the name you're looking for is "open/closed principle"
the 2nd letter of solid
 
Hi. I might aiming too high. But assuming I write my signature ( draw signature) on a canvas. I believe i can save the actual signature as a function/series of functions (Fourier transform chunks) . so now - I can save only the function instead of the dots coordinates . have you ever seen something like this ? (Yes I know that vertical line is not a function , but if I save the function with different Axis POV so it is now a horizontal line which can be saved as a function)...
 
@RoyiNamir Do you mean Bézier curve instead of Fourier transform?
 
@FlorianMargaine right, that
 
8:07 AM
@Sheepy it has been 10 years since my soft engineer degree so i might be rusty. but you get the point. save my signature as an array of like :[{AxisPOV : 90(deg) , functions:x^2+5x}, .....]
( it will be array where each element can describe part /whole of signature)
 
@RoyiNamir imho for a signature, it's probably easier to save the coordinates
 
@RoyiNamir that only saves the stroke line. What about the pressure at various points that your hand exerts naturally?
The width of the stroke will be different at different points, and that matters.
 
Awal , no need. think organ . not piano :-)
(no pressure detection)
 
that's very weird but ok :-/
 
When you sign on a screen in a shop , with a digital pen , , there is no pressure.
all is (same)PX width
 
8:11 AM
sure there is. it is just not visible.
 
(for example)
@FlorianMargaine I think saving this as a functions will take less space than all coordinates
I might be wrong. it's just interesting me. nothing more
 
@RoyiNamir not really.
 
@AwalGarg Anyway it's not the point. the point of my question is translating it into functions. not the pressure issue.
 
@RoyiNamir The thought of something like that being legally binding is sickening
 
Yes. Saving the points as function either cause you to lost information (by smoothing out the points), or take up more spaces, or both.
 
8:14 AM
@RoyiNamir I meant your thought of "saving space"
that won't happen in most cases.
 
Just store the points. Then zip the data. Simple and works.
You can zip it at JS level or at storage level, your choice.
 
@Sheepy even if it is language agnostic, it doesn't matter. Curves are no longer "point 1" and "point 2" data.
 
@OliverSalzburg already is over here in UK when you go to post office you sign for by something like that
 
8:27 AM
@MadaraUchiha pastebin.com/zrjntuRh (let's take it here)
 
@Gemtastic I'm surprised. Shouldn't .fetch() be asynchronous?
 
Exactly
My code works, and I don't know why
It may be that the google http client isn't asynch, but why wouldn't it be asynch?
 
Looks like it really isn't async
And I honestly don't know why XD
 
EXACTLY!
 
I guess Google Script is designed to not be an asynchronous language.
 
8:30 AM
I tried googling the HttpFetchApp thingy and reading the API but it doesn't say :(
 
Although I'm not sure why because asynchronous is extremely powerful.
 
But my code works
 
It is all synchronous in the end anyways.
 
Well, my code somehow has to be since it works.
Talk about beginner's luck
Is it worth while making a question about it?
(Why does my code work?)
 
@DrogoNevets I always feel like that's getting entry to a system by guessing the first letter of the password
 
8:41 AM
Hello guys,

I want to summarize a lot of items from text shown below and then get each item value from a JSON file and summarize the amount of money that's been looted in total.

17:18: Loot of a dwarf soldier: 2 bolts, a soldier helmet
17:18: Loot of a dwarf guard: a white mushroom
17:18: Loot of a dwarf soldier: 4 bolts, 2 gold coins, a white mushroom
17:18: Loot of a skeleton: a bone, 4 gold coins

Now my question is, how would you guys get the items and the amount in an effective way without the performance suffering? I want to read up to maybe two thousand lines of similar kind like a
 
Them dwarves sure do love their mushrooms.
 
Since these messages shows up in the games server log, I've already written code to check if it's "loot" and what monster that dropped it. Just want to see how you would do with the loot.
 
@Gemtastic Nah
 
Haha they do @AvnerShahar-Kashtan xD
 
The reason is documented. The API is just synchronous.
 
8:44 AM
@JakobMillah I'm not really sure what you're asking. Is this data currently stored as objects in your code? Or is it just text?
 
@MadaraUchiha Will it be a bad question you think?
 
Just text. I read it line by line from textarea
 
@JakobMillah You likely want to have some sort of server-side aggregation.
 
@MadaraUchiha how come?
 
@JakobMillah which game is it ?
 
8:46 AM
@Mathematics Tibia. The software will be used as an overlay for my stream which will show what's been hunted today and how much profit made
 
Well, I asked it anyway. We'll see how much the community hates me for it.
 
RIP @Gemtastic
 
@JakobMillah Don't worry, I'll delete it after 3 downvotes.
 
They'll find you.... :/
 
If it generates at least one answer that can help me puzzle it together, it'll be worth losing a few reps.
RIP reps.
 
8:55 AM
rip in pieces
 
The wait is exciting
 

« first day (1724 days earlier)      last day (3217 days later) »