« first day (1688 days earlier)      last day (3254 days later) » 

12:00 AM
@havingagoatit it is still the same page
 
@AwalGarg ok so i got it working if i replace (this) with the specific div name
@AwalGarg trick is now to allow for all the divs in the submenu I am guessing i could just state the names in the brackets eg (#mission #music #people #potential) and that should mean that it works for all
@AwalGarg some people on here who clearly have skill chose to be quite elitist about it imho but you have helped me on more than one occasion and for that i thank you sir
 
@havingagoatit 1. none of the regulars here are elitists. 2. you are more than welcome, but please make more use of the dev tools :)
 
@AwalGarg great advice thanks
 
regs here have been answering loads of (similar) questions for a long while so they have grown to care less. ask a new interesting question and you'll get a better response.
 
Hi
You have any links on how to begin to make a Form/Emailing platform for a website. I've already got the CSS and HTML work done just need to make it function/send email
?
This may not be a "interesting question". But would be helpful for me
hello?
@AwalGarg Nice chat bio btw
 
12:23 AM
ok
 
@AwalGarg You going to help with questions or nah?
 
1:31 AM
how do you say .body(but not#div).onclick
rlemon you and i is all that are in here
 
@havingagoatit so on click of something that doesn't have the id of div?
 
@SomeKittens on click of anywhere except #menu
 
Event Delegation
 
whats all that awesome box of tricks then ? :p
ya know when you have a sidebar menu and it pops out i want to basically say if anything on the body except #menu is clicked , close it
wtf is this ....
$(document).click(function(event) {
    if(!$(event.target).closest('#menucontainer').length) {
        if($('#menucontainer').is(":visible")) {
            $('#menucontainer').hide()
        }
    }
})
@SomeKittens if your really interested can you help me make the third one work ...
$(document).ready(function () {
    var $navToggle = $('.nav-toggle');
    $(".navbtn").click(function () {
        if($navToggle.hasClass('active')){
            $('#menu').multilevelpushmenu('collapse');
            $navToggle.removeClass('active');
            $(this).addClass('active');
        }
        else{
            $('#menu').multilevelpushmenu('expand');
            $navToggle.addClass('active');
            $(this).removeClass('active');
        }
    });

    //ALLOWS CLICK ON THE BODY TO CLOSE THE MENU//
 
@havingagoatit As a rule, I don't really jQuery
 
1:49 AM
@SomeKittens its a good rule
 
2:13 AM
@SomeKittens well ,.. I am still struggling to find an answer after much research
 
2:55 AM
I am stuck in an Angular nightmare,the data on my scope for ng-repeat is different from the data on the screen... everything goes wrong when i delete the data... github.com/vamsiampolu/angular-jspm-todo/blob/master/app/app.js
I have posted a question on this here: stackoverflow.com/questions/30509756/…
 
3:24 AM
@vamsiampolu try calling scope.$apply()
also, this:
for(var i =0;i<$scope.model.todos.length;i++)
    {
        if(todo._id === $scope.model.todos[i]._id)
        {
            console.log(i);
            $scope.model.todos.splice(i,1);
            break;
        }

    }
should be replaced with this:
var todos = $scope.model.todos;
todos.splice(todos.indexOf(todo), 1);
or this:
todos = todos.filter(function(t){t !== todo._id})
and this:
if (todoItem._id === todo._id) {
    console.log(i);
    return false;
} else {
    return true;
}
});
with this: return todoItem._id !== todo._id
although I guess you want that index printed
 
3:45 AM
@Mosho api.jquery.com/jquery.grep The filter function will be passed two arguments: the current array item and its index. The filter function must return 'true' to include the item in the result array.
 
which are the two possible evaluations of a boolean statement
a === b evaluates to either true or false
 
3:58 AM
Error: [$rootScope:inprog] $apply already in progress
errors.angularjs.org/1.3.15$rootScope/inprog?p0=%24apply
    at REGEX_STRING_REGEXP (localhost:3000/jspm_packages/github/angular/…)
    at beginPhase (localhost:3000/jspm_packages/github/angular/…)
    at Scope.$get.Scope.$apply (localhost:3000/jspm_packages/github/angular/…)
    at localhost:3000/app/app.js:198:13
with the code
$scope.$on('todo:deleted',function(event,todo){
					var todos = $scope.model.todos;
					todos.splice(todos.indexOf(todo), 1);
					$scope.$apply();
				});
i tried wrapping the statements removing the todo in an anon function which is passed to $scope.apply but that does not work
a screenshot of what happens,the value with title 190 is removed when i clicked delete on the item with title 160
 
4:35 AM
@vamsiampolu still having problems?
 
5:09 AM
@SomeKittens yes
 
Some clarifying questions:
why are you using eventing here?
 
because it need communication between directives...
 
That would be much better done by a service, not events
 
i am communicating between todo-cardui and todo-list to notify the list of the delete operation
 
user2620028
Oooo just watched the kittens angular talk
 
5:20 AM
@SomeKittens there is a service to crud from $pouchDb,can i extend that for communicating with todo-list directive?
 
@HatterisMad what'd you think?
@vamsiampolu paste the service?
 
user2620028
@SomeKittens very good information. Just seemed like a very fast talk :)
 
app.factory("TodoService",['$log','pouchDB','$window',function($log,pouchDB,$window){
	$window.PouchDB = pouchdb;
	var db = pouchDB('todos');
	var instance = {};
	instance.get = function get(){
		var res = db.allDocs({include_docs: true, descending: true})
		  .then(function(data){
		  		var pluck = function pluck(data,prop)
		  		{
		  			var res = [];
		  			for(var i=0;i<data.length;i++)
		  			{
		  				res.push(data[i][prop]);
		  			}
		  			return res;
		  		};
		  		var _res = pluck(data.rows,'doc');
 
user2620028
@Somekittens did you have to fill like a specific 5 minute time slot?
 
i guess i should have used pastebin pastebin.com/iFVFBbVh
 
5:23 AM
@HatterisMad Yeah, only wanted a 5 minute talk to start with. Then I tried to cram too much into it
@vamsiampolu I don't know too much about PouchDB and the patterns there
 
user2620028
@SomeKittens not really actually. I went into the video knowing absolutely nothing about the topic and went out with a working conceptual knowledge of what you were talking about :) So i would say that for me at least the way you explained things was great and you were not speaking too fast.
 
but typically, the service would fetch the items and store them internally, exposing the items themselves or getter/setters.
 
and your directives would inject the services, manipulating the data from there
@HatterisMad Glad to hear it! How much Angular did you know?
 
why does state manipulation seem more difficult with angular,one small change and the whole ui comes crashing down,the directives used scope:false before but i wanted hide-buttons attribute,so i changed it to isolated scope
 
user2620028
5:29 AM
@SomeKittens enough to understand your talk :P . Uhm i have made a couple crappy GUI modules with angular. But you answered the question i have had for quite a while about why do people manually .apply() and whether i should be doing that or not.
 
@Mosho WATCH MY TALK
^ speaking of
 
5:43 AM
stackoverflow.com/questions/30554013/… why do people upvote answers which clearly do not answer the question
 
@SomeKittens What about using require within the directive,will the parent controller be available in the child's controller instead of the link function??
 
user2620028
Because they have the power to.
 
@vamsiampolu require isn't an Angular thing
 
@rlemon Wow, major WATs there, but that was an interesting one
 
@SomeKittens The myPane directive has a require option with value ^myTabs. When a directive uses this option, $compile will throw an error unless the specified controller is found. The ^ prefix means that this directive searches for the controller on its parents (without the ^ prefix, the directive would look for the controller on just its own element).
 
5:51 AM
@vamsiampolu oh derp. I was thinking of Browserify.
but we were talking about services?
 
yeah,i want it such that if an item is deleted,it splices the item from the todoList scope automatically,how can I get the service to fire every time an item is deleted,do we need to use a $watch on the result of calling the service method repeatedly using setTimeout?
 
You're thinking about this wrong
(also, use $timeout. THIS WAS IN THE TALK)
The service should be where the data resides. When you manipulate the data, other components that have injected the service are pointing at new data, which will be updated on the next digest.
 
ok,maybe I can just set $scope.model.todos = null followed by going to the service and getting new data??
 
no
$scope.modal.todos = myService.todos;
 
morning, this is weird. is there a guideline about returning null or undefined? when do i chose null over undefined? and vice versa?
 
6:00 AM
Generally speaking, undefined means the variable is around but nothing has been set on it yet. null means we've set something, and it's nothing.
If that makes sense
 
it does :P wonder if people follow that rule strictly, or just return null most of times
 
ok,so the data should never be set directly on the scope...but the service returns a promise,all these operations are asynchronous
 
@Worf I don't think I've ever seen return null;
 
lol, really? so js people usually return undefined?
was thinking the opposite. at least that's what i do, but my style is derived by other languages
 
normally I just write return; which returns undefined
@Worf JS is weiiiiiird.
 
MLM
6:10 AM
What would be a good name for a class that exposes serial port data but also handles unplug/replug of devices to give you a seamless stream of data whenever it is available(device is actually connected)?
 
well, i have the feeling both undefined and null should exist in any language
 
@MLM sounds like your class is doing too many things
 
because sometimes you want to differentiate between "not set" and "set but nothing"
 
MLM
@royhowie serialport takes care of the dirty work
 
@royhowie I wouldn't say that, it's handling serial port data and nothing else
 
MLM
6:11 AM
And I use usb-detection does all of the detecting. I just combine it into something more usable in the app.
 
@MLM SerialPort, SerialPortConnector, SerialConnector
 
@SomeKittens a garage only handles cars, but that doesn't mean you don't need a Car class
 
@Worf right. I know a lot of C folks get reaaaal angry about multiple returns.
 
@SomeKittens uh? for example?
 
MLM
hmmm, SerialConnector('COM3') is the best so far
 
6:13 AM
function (blar) {
  if (!blar) { return; }
  // process blar
  return someValue;
}
@Worf ^
 
null is not actually a multiple return. in practice it is tho
some languages allow null to be used as placeholder for anything (like java) others consider it a completely different type
 
types? Fiddle-faddle!
 
MLM
"Always available serial port connector", something that embodies that but a better name
 
@SomeKittens damn js folks! :D
types are gold
 
6:18 AM
@MLM you've already spent too much time thinking about this
 
MLM
> SnitchPort, gives you data whenever it is available - from Costava
 
@Worf I've been using TypeScript lately, and it's been pretty nifty. Types when you need them.
 
you have types in raw js as well, but you guys usually don't use them
i always do unless i'm being very lazy
 
MLM
Thanks for the ideas, SomeKittens. I think I am going to go with SerialPortSnitch
 
@AwalGarg Do you have screenshots ? A link to the font ?
 
MLM
6:22 AM
The angular talk was great. My Angular experience goes as far as the PhoneCat tutorial but I walked away with something like Hatter
 
6:33 AM
stackoverflow.com/questions/30554577/… not a js question (but if anyone knows the answer, that'd be great)
 
6:59 AM
Good morning
 
7:18 AM
Do self-answered questions (the points on the answer) contribute to badges?
 
7:33 AM
^ asked a similar question on meta meta.stackoverflow.com/questions/295680/…
 
7:49 AM
$scope.$on('todo:deleted',function(event,todo){

					var todosPromise = TodoService.get()
					.then(function(data){
						$scope.model.todos = data;
					});
					//var todos = $scope.model.todos;
					//todos = todos.filter(function(t){t !== todo._id});
				});
this results in the same thing as before...how can i put data in service when it is coming in from a promise??
 
8:21 AM
good morning
 
8:36 AM
Is there a way to clear a previous code in jQuery?
let's say i have this: $('.content').children('h2').hide();
then i need to show it in a different section of the page
 
.show()
 
yes , but what if the hide is written after the show
idk, it doesn't work , i tried
 
so, you want jQuery to remember to ignore the next hide?
 
it's working when i'm doing it on the console
 
8:41 AM
but not in my page
 
perhaps you're doing it too soon?
 
i thought maybe there is an option to clear a previous code
 
you cannot "clear" a code snippet during run time
 
You can't just undo an operation. You can only do the opposite of what it did
 
8:42 AM
what you can do is doing the opposite action. Show <=> hide
 
and if you want to cancel a future operation, just remember not to do it
 
yes i know that
but it's not working, because it's like a same page
 
fiddle please
 
i wish i could
let me think
 
can you put your snippet here: jsfiddle, and share the link ?
 
8:45 AM
and if you can't remember not to do somehing, watch yourself do it, then undo it after yourself (yes, it's almost as stupid as it sounds)
 
is there a way do to it like css !important ?
 
yes, but it's a bad solution
 
what is it?
 
what you said
setting !important in CSS will essentially kill any javascript attempts to set the CSS property to anything else
 
that !important should be removed IMO
 
8:53 AM
yes
it was meant to be used by user styles only
 
i got it, it's not a jquery problem
thanks anyway
 
just fix your code instead of beating it up with bad CSS
 
@JanDvorak : he's using his js code incorrectly. see this. He could simply have redefined his selectors i think
 
is rails way a kindof standard in web dev,in terms of code organisation ?
 
 
1 hour later…
10:29 AM
Good Morning Gentlemen
 
Good Morning Gentleman
 
can I use jasmine in webpage's script ?
 
10:45 AM
el diablo!
 
11:03 AM
@MadaraUchiha nice!
@DenysSéguret linnk to font: google.com/fonts/specimen/Lato lemme screenshot too
 
THE
11:31 AM
any Angular here
 
@AwalGarg i think everybody knows lato
 
@Abhishrek dystroy apparently doesn't.
 
@THE No Angular here.
 
THE
i thought it was a cool thing and people would love it ?
 
Maybe, but it's not here.
 
11:37 AM
wh@THE hell do you mean? (scnr :P)
 
THE
i am trying to understand some angular code but it looks bit tough
 
@MadaraUchiha it's no where
*, *:before, *:after { box-shadow: 0px 0px 1px; } // insta wire frame
 
you really dont know css
 
^ true story
 
outline: 1px dashed red; ?
 
11:41 AM
@Abhishrek eww?
 
@AwalGarg why ew ?
 
looks horrible when overlaps with closely placed elements
 
@AwalGarg -_-
you are supposed to use it for debug
 
it should be usable even while debugging
 
> Outlines do not take up space, they are drawn above the content.
 
11:43 AM
Ah, outline, my bad
 
still looks horrible, compare on this very page with box shadow yourself
 
@AwalGarg you do realize where box shadow will be plotted right ?
 
@AwalGarg Transparent elements?
 
@MadaraUchiha yes
@Abhishrek ?
 
heh
where is the box-shadow drawn from ?
 
11:47 AM
you mean where does the rendering overhead go? I dunno :/
 
not that
 
"drawn from" what? relative to the box-model?
 
yep
 
it is on top of the stack, same as text-shadow
 
11:48 AM
and doesn't take space like outline
 
see the difference now ? ps outline wont take space either its not border its outline
the red is outline, the green is shadow
 
I am not sure what you are talking about. @MadaraUchiha do you?
 
background: rgba(100,1000,100,0.4);
nvm
it caps it on 255.
 
@Abhishrek why are your red lines visible separately from the green lines? o_O
 
@AwalGarg that is the difference :P
lemme demonstrate that better with a codepen example
 
11:54 AM
how?
 
just a minute
 
ok
 
Hi I have just had a look around and cant see what i am doing wrong. <img class="logo-border-img" src="images/logo/border.svg" onerror="this.src='border.png'; this.onerror=null;"> I am trying to have a fallback for svg's but on error does not seem to be working. I am testing in I.e.7/8
ahh
seen it
forget i posted that
 
ft.com/cms/s/0/… first portuguese guy to get famous
 
btw you will need the spread to be able to see the shadow in case of shadow with darker backgrounds
because without hte spread it will be transparent
but that aside, shadow is drawn on the bottom --- outline is drawn on the top
so when both are present you will only see the outline not the shadow
 
@Abhishrek not that I understand but ok, will use outlines :/
@Abhishrek oooh wait. I had to scroll down in the pen sorry :P
got it.
@Abhishrek atleast outline: 1px solid <insert really light grey shade here>, red looks so scary :(
 
oh btw @AwalGarg you can do some funny things with outlines iirc
 
After I learn to position elements correctly in CSS :'(
Is there no one else who is bad at css? :(
 
@AwalGarg outline also accepts invert
so you can completely forget the color
now i feel like doint something with magenta and boxes :-/ ugh
 
@FlorianMargaine How would you do to do a command line application in node.js / io.js without using non-bultin libraries?
I mean, I know that I should parse the process.argv, but what are the rules of a command line app?
What are the conventions, for the flags and the commands themselves.
What is the structure of the arguments in a command ?
 
12:22 PM
@FlorianMargaine link to your pgp thingy thing again?
 
for some reason when i remove the class active from the 2nd from last line the class doesn't get added or removed for any of the functions not sure why ?
$(document).ready(function () {
    var $navToggle = $('.nav-toggle');
    $(".navbtn").click(function () {
        if($navToggle.hasClass('active')){
            $('#menu').multilevelpushmenu('collapse');
            $navToggle.removeClass('active');
            $(this).addClass('active');
        }
        else{
            $('#menu').multilevelpushmenu('expand');
            $navToggle.addClass('active');
            $(this).removeClass('active');
        }
    });

$('body').on('click', function(e){
 
12:40 PM
1 message moved to Trash can
@vamsiampolu Please don't post unformatted code - hit Ctrl+K before sending, and see the faq.
1 message moved to Trash can
@vamsiampolu Please don't post unformatted code - hit Ctrl+K before sending, and see the faq.
 
<section class="ui three column doubling page grid">
	<div class="column" ng-repeat="todo in model.todos track by todo._id">
		<todo-item value="todo"></todo-item>
	</div>
</section>
 
.... and maybe someone will respond
 
i changed from track by $index to track by todo._id,but i dont understand what happened to make it work. here is the question stackoverflow.com/questions/30509756/…
 
Hello ! :)
or should I say "Morning"
I have a question
 
@ZahidSaeed Hi !
 
12:50 PM
@havingagoatit Hello :)
 
@ZahidSaeed how are you !
 
@havingagoatit I'm good. What about you ?
 
@ZahidSaeed I am ok but a bit confused with some new code I am trying to get working
 
I will surely help you
But first you help me
 
sure thing bro !
how can i help
 
12:52 PM
Do you know ajax and PHP ?
 
Can anyone run this in the console (on this page or sandbox or whatever chat.so page) and tell me how much ms it logs?
(function () {
var fd = new FormData();
fd.append('fkey', fkey().fkey);
function get (id) {
    var xhr = new XMLHttpRequest();
    xhr.open('POST', `chat.stackoverflow.com/chats/17/events?before=${id+1}&mode=Messages&msgCount=1`);
    xhr.send(fd);
    xhr.responseType = 'json';
    return new Promise(function (resolve, reject) {
    	xhr.onload = function () {
    		resolve(xhr.response.events[0]);
    	};
    });
}

var now = Date.now();
get(2000).then(function (val) {
	console.log(Date.now() - now);
It seems to be taking 7 seconds for me :/
 
I am not familiar with either of them unfortunately , Awal is very competent though although I don't know if he knows PHP , there is a PHP room i think
 
@AwalGarg nice try
 
@JanDvorak ?
 
What exacly are you making us post?
 
12:54 PM
This is my jQuery code
var i = -1;
			while(i < purchases_array.length){
				$.ajax({
					type: "POST",
					url: "../includes/functions.php",
					beforeSend: function(){
						i++;
					},
					data: {
						purchased_data: purchases_array[i]
					},
					success: function(data){
						console.log(data);
					}
				});
			}
 
@JanDvorak you are too good at javascript to ask that :P
@JanDvorak It gets the message object of the message id passed to it
 
And here is the PHP code
$array = array();
if(isset($_POST['purchased_data'])){
	$array[] = $_POST['purchased_data'];
};
 
@ZahidSaeed ew. Send one request with all the data
 
@AwalGarg 16926
 
@JanDvorak you can try it in incognito to protect cookies :P
@MadaraUchiha hmm, any idea why that endpoint takes so long to respond?
 
12:56 PM
I'm trying to append each value to $array
 
@AwalGarg Nope
 
But it clears the array again and then append the new value again
 
@MadaraUchiha ask in blue room? ^_^
 
@ZahidSaeed Yeah... each post request is handled by a different thread
 
While parsing arguments to make a command line application, should I accept any order of options / (needed-arguments) ?
 
12:57 PM
@AwalGarg ask in meta?
 
For example program -v -i www.google.com
 
@Catgocat yes
 
or program -v www.google.com -i
 
How do I solve it ?
 
@MadaraUchiha they will likely shut that endpoint down soon, then :P
 
12:57 PM
@ZahidSaeed send the entire array at once
 
Can you fix the bug @JanDvorak
 
@ZahidSaeed you do
 
["Bbbb", "Lhaorfe", "asldkj", "lkj", "dlkj", "8", "1", "2", "3", "5"]
 
@AwalGarg I don't understand what kind of information you're trying to get from that endpoint though
 
This is the array
I want to store each value in an array in PHP
See the js code that I sent above
 
12:59 PM
@JanDvorak But if the needed-arguments are 2 or 3, should I look for a sequence or pick what hasn't a dash before? For example program -v www.google.com -i www.google.uk -p www.google.pt
 
@MadaraUchiha I don't know how else to get message data as a clean json object.
 

« first day (1688 days earlier)      last day (3254 days later) »