« first day (2113 days earlier)      last day (2835 days later) » 

6:06 PM
I need a new color for regexp's: snag.gy/ZWl1t9.jpg
I'm all out of distinctive colors.
 
tomato
That's a serious suggestion, by the way
 
I have red.
 
oh, hmm
 
ohh, i didn't include it. it's for booleans
 
met a nice old guy while walking to the pokestop
 
6:07 PM
HAMMERTIME!
 
I really really wanted to steal his dog
 
cyan?
 
lemme try
 
Cyan's a good one to use.
Sticks out, without being stupid harsh.
 
@Luggage #9e4f56
 
6:08 PM
Is it up on github? I'd like to fork it and maybe make another theme option for it
like a dark one
 
not yet. soon.
cyan does stand out..
 
but.. maybe swap that and boolean
 
that your cfdump clone?
 
yea
 
6:11 PM
eh, cyan looks fine to me
 
@rlemon Stealing that, 'cause those some bootifull colors.
 
I already use it on my "control test" page.
 
> Write them a letter demanding $75 an hour for the time it takes to get back where it was. I did, and they paid it happily rather than risk arbitration/court.
re: windows 10 sneaky upgrades
 
Where I test my various editors: snag.gy/JQO7Xl.jpg
 
@rlemon My office opted to keep us all on Win 7 instead of upgrading, despite a co-worker having his setup in Win10 and working fine.
 
6:16 PM
^ same here but Im on windows 8
 
it isn't a debate about win7/8/10 quality, it is the virus tactics MS implored to rape your pc
 
I get that Lemon, I do.
I had to uninstall the update that started windows molesting my machine and actually made it force update.
 
I updated to Windows 10, the Microsoft molestation was completed
 
so tl;dr if you mail MS with your billable hours for undoing what they did, they will pay out rather than go to arbitration
 
6:19 PM
how long I need to wait before re-asking a question? :P
 
in chat or main?
 
if chat, just re-link to the original question (it will onebox) -- and usually wait like half hour at least.
 
make sure some of the people have recycled
 
I recycle.
 
6:20 PM
+1
 
asking a question multiple times because it was lost in the conversion is not nearly as bad as just joining then dumping the same question to 5 rooms
 
Here's why I've had this song in my head all morning. Just paying it forward. p.s. you're welcome. https://t.co/aYTDn8aNMP
 
is this the drag/drop/ajax question above?
and you elaborate just a little?
 
yeah that is it.
 
Also, I wouldn't go around saying "send an ajax".
 
6:23 PM
I emailed my mom an ajax
 
you outlooked your mom.
 
I yahood your mom
 
send through Ajax? how you would I make my sentence?
 
here, have an ajax.
 
well, two problems mashed together. Tracking the current state of what is in the list and in what order, and then sending an ajax request with that data.
 
6:27 PM
 
I try to do my best in english.. :P I learn every day. I'll try to pay attantion with that.
@Luggage, yes. It is what I'm looking for.
 
@ssube still there?
 
@KevinB Did you really link -my- Friday link? I'm actually flattered.
 
but.. in this question.. am able to get the listing with jQuery like doing a foreach with child and build an array and send it in JSON.
but I would like to know if it have a better way to grab it
 
A better way would involve getting rid of jquery, so just do what you are doing.
 
6:33 PM
ok.
do you know if it have a good book with best practice in JS?
 
MDN
 
eloquentjavascript.net is free online.
!!resources
 
ho cool
thanks
 
Some of the content in eloquent JS isn't great
It will take experience to figure out what works best when and where
 
6:37 PM
now to add collapsed state to this bag..
 
hey so I have a JS date value that I pass into a moment.

On my local the value looks like this in 24hr format which is correct for converting to local:

28/07/2016 16:15:00

Then the same value when viewed on the hosting server is interpreted in 12HR format which is not the desired format as it has PM attached:

7/28/2016 4:15:00 PM

Any reason why this would happen when deployed to a server running UTC?
or maybe I just need to convert that value to 12hr format?
 
ask for it in the format you desire explicitly instead of depending on the server's locale.
 
Refresh my memory : @ipaddress [VARCHAR](15) = NULL sets the default value to null, assuming that nothing is passed in, right?
 
myMoment.format('YYYY-MM-DD HH:mm'), i think.
 
ok makes sense just spotted the difference now, I think that could be causing the error on my server deployment..
 
6:41 PM
@Trasiva that looks like SQL-ish, but what flavor?
 
@Luggage MSSQL
Sorry, meant to specify that.
 
ohh, shit, I forgot all my t-sql
 
on my local the value is converted fine to local, but on server not converted to local, could be owing to the different 12 HR format
 
@BrianJ you should verify the date at every stage. make sure it's being sent over the wire in a sensible format, too. Don't assume.
 
You know what I like a lot more than materialistic things? KNAWLEDGE
 
6:42 PM
Dates will cut you.
 
yes I should, trying to fix that now
had a nightmare of a week trying to figure this shiz out
 
yea. dates are a nightmare. Don't let them get out of control.
moment.js has all the tools you need, but it's still easy to have some assumptions bite you.
 
yes hopefully I can save my weekend and fix it tonight
fingers crossed
 
I hate dates. I want to make an app that doesn't have them at all.
 
why can't time just not exist, lel
make my life easier
 
6:46 PM
@ndugger gist.github.com/luggage66/2719cb55a7d37f325cd48f2d2fb8e05b I'll be a while before I have a 'real' repo with pre-built versions, etc.
also.. I am not sure I will keep the use of Immutable.js
 
how about using aphrodite for styles?
 
I think inline styles might actually make sense with this.
 
I can't seem to find any headphones that have great loud sound and can handle sweat :/
 
Are inline styles a performance issue? I plan to use this for some pretty big objects.
 
@Luggage How much refactoring/moving things around would you be ok with me making without it turning into a new project?
 
6:51 PM
I'm seeing a line of code like this in my codes: $(myfunction(this)); .. I wrote those codes a long time ago and I really cannot remember what's that. May somebody please tell me why we call a function into $() ?
 
@MartinAJ 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.
 
As much as you like.
Probably.
 
Alright, it's nothing big, just cleaning it up so it's not all in one file
 
@MartinAJ you were suffering from jQuery at the time
 
I'll play around with it now
 
6:52 PM
Nothing is sacred, there. I kinda like the style the way it is, but I'm not dead-set on anything.
 
@MartinAJ That would be jQuery, by wrapping it in $(), you make it a jQuery object.
 
@MartinAJ that code doesn't make much sense... unless myFunction returns a function. or collection of dom nodes.
 
@ssube So putting myfunction(this)into $() is useless?
 
@MartinAJ no
 
(both cases have a different result)
 
6:53 PM
@Luggage I thought this would convert the 12hr FORMAT TO 24hR
var outageStart_UTC = moment.utc('@Model.Escalation.OutageStart', 'DD-MM-YYYY HH:mm');
 
You shouldn't need to 'convert'. Just take a date and output it at your desired format.
 
Well still I don't know when exactly should I call a function into $() .. :-(
 
moment.utc( date ).format( w/e format u want );
u can do that..
 
@MartinAJ You are calling a function, then passing the return value into $().
it all depends what myfunction() returns.
 
you should "put" a function inside it if you want the function to be called after the dom is ready... you can "call" a function inside it if you wish for it's return value to be passed as a parameter to $() which is what the code you showed us does
 
6:55 PM
@BrianJ you shouldn't be using 12 hour formats anywhere
 
@ssube yes I just spotted that is the difference between my local and server
 
I think the question we should ask from @MartinAJ is, what is myFunction?
 
on local it's 24hr which works when converting to local, where as on server it's in 12HR format
 
unless Model.Escalation.OutageStart is a string in the standard format that moment takes (ISO-something), then you should make it that.
 
@Luggage myfunction() doesn't return anything .. just changes the color of an element.
 
6:56 PM
then your code makes no sense.
 
why?
 
there's no reason for it to be $(myFunction(this)) and not myFunction(this)
$(undefined) does nothing
 
oh guys trying to change to the 24hr format
 
$() takes either a CSS selector (a string) or a function. If your function that you are calling returns undefined, then you are just doing: $(undefined)
 
@KevinB ok, can you please tell me when should I put something into $() ?
 
6:57 PM
do you know what $ is?
 
Money!
 
I think I've come to the conclusion that wireless headphones just aren't up to snuff for workouts
 
hahah
 
Even as advertised :(
 
6:58 PM
gimme my $
 
I hate wired headphones. I can't box with them >.<
 
@KevinB not really, I just know I should use it like this: $('#id').on('click', ..)
 
yea, so why would you wrap a function inside $() unless the function returns an id or class name etc.
 
@fayzaan dunno ..
but my code works as well
 
and even if you return a selector, it doesn't seem to be doing anything to manipulate
 
6:59 PM
@ndugger my plans were to put in collapsing, then maybe auto-collapse after a ceratin depth. Then maybe handle larger data with something like react-virtualized.
 
try your function without the $() wrapping it
it should still work just fine
 
@MartinAJ right, it works, just like idonotexist(myFunction(this)) would still execute myFunction.
 
@KevinB So I have to pull that function out of $() ?
 
depends on what it does.
 
@ndugger ohh, and the "function" type needs to be done. Maybe even recognize "classes".
 
7:01 PM
@SterlingArcher That's why I said ages ago I don't listen to music when I workout. I'd rather just focus on the workout.
 
that should be it for the core types..
 
How do you tell the difference between a function and a "class" in JS? Programatically, that is
 
@Trasiva I need headphones to workout. Music gets me up and out
 
Why are you calling it with this?
 
the presence of .constructor, perhaps?
 
7:02 PM
I thin all functions have a constructor, though
I'll check
 
I see tons of people with the on ear beats, but I sweat hard and I'm scared I'll just break those too
 
@KevinB Because I need the value of this into the function
 
The only headphones that freaking work are apple headphones but those aren't loud enough
 
what is this?
 
@KevinB Here is my code in reality:
	// VoteUp
	$('[id^="voteup-"]').click(function(e) {
			e.preventDefault();

		if (logged != 1){
			$('.fast_login_form').fadeIn(100);
			return false;
		}

		else if(do_I_have_let==1)
		{
			do_I_have_let=0;
			$(".error").hide();
			clearTimeout(close_error_msg);
			$(voteup(this));
		}
	});
 
7:03 PM
@Luggage I think you can do if the constructor === Function
 
@MartinAJ think about it. Read up on what $ is (api.jquery.com/jquery)
with that information, do you still think you need $?
 
@KevinB no
 
then remove it.
:)
 
ok :-)
 
yea.. if you use new it has .constructor
but that's fine.
I am confusing a "class" with an instance.
 
7:05 PM
@KevinB look, my code works as well now .. honestly I afraid if I remove it, a bug occurs .. can I don't remove it?
 
you could keep it, but it isn't serving any purpose.
it's not breaking anything either
 
we're talking about $(voteup(this)); ?
 
yup
 
yea, drop the $() wrapper. It's confusing and wrong.
 
ok .. please let me keep it :-) I don't want to do a risk ;-)
 
7:07 PM
just test it after.
 
@Luggage I cannot test the whole of my website ..
 
Hmm, no, comparing the constructor against Function doesn't work either.
 
just test that line.
 
ok so doing the following will convert the OutageStart value passed in from server to 24hr format?
 
@Luggage look, you are right .. but I'm not sure it doesn't affect on the other lines .. You know, all fine now, why should I change anything? :-)
 
7:09 PM
well, just showing the other properties on a function, along with a name if that can be determined, is good
 
I just wanted to know what it does .. just that.
 
well, first myFunction(this) is executed.
 
var outageStart_UTC = moment.utc('@Model.Escalation.OutageStart').format("DD-MM-YYYY HH:mm:ss);
 
then, it returns undefined, and $(undefined) is execued.
 
which does nothing.
 
7:10 PM
$(undefined) does nothing, therefore removing it makes sense.
 
@KevinB ok .. lemme think about it :-)
 
Don't take this the wrong way, but if you can't change that line of code and test the result.. umm.. what are you doing?
How can you write any code in confidence at all?
 
Actually I have to present my project in 2 days and no time to get faced with a new problem ..
 
You could have tested it and been done by now.
 
@Luggage I removed it :-( .. I hope nothing bad happens ..
 
7:14 PM
omg, just go test that vote feature. don't hope.
 
ok :-)
 
After your demo, sit down and dig into jQuery. Learn what it does. You need to be able to use it with confidence or throw it away. You don't have to understand HOW it does what it does (though, that isn't as much as you think), just understand its use.
 
I have a really bad imagination about JS .. JS codes always have a bug .. even debugging them makes new bugs .. that's why I scare to change anything in my JS codes.
 
If it's a core tool you use on every page, you should know it well.
 
no I have just one .js file for all of my project ..
 
7:18 PM
@MartinAJ use the debugger and a good log library
maybe write some tests
 
JS has a bad past, but you CAN make clean reliable code in JS.
 
@ssube I'm using chrome .. it helps me a lot
 
@MartinAJ that's why you have bugs
 
There are a LOT of bad examples and info, though.
 
you have a bunch of spaghetti and you're complaining that there's sauce in it
 
7:19 PM
don't tell @JanDvorak I used 'is' where I should have used 'are'.
oops
 
Actually I'm not a programmer .. I'm just trying to finish my fucking university project .. After it, I never coding
 
me too
 
:)
 
@Luggage 40 years later
 
once this stupid lucrative career is over I am done.
 
7:23 PM
coding makes people old (and make their hair white)
 
eh, only if it isn't your thing. I enjoy coding, organizing a new project, refactoring an old, fixing bugs, etc
I hate data entry
 
I love refactoring. It's like picking off dead skin after a sunburn.
 
@KevinB they you are a robot :-)
 
I just can't stop
 
HAMMERTIME!
 
7:25 PM
What's the meaning of "refactoring" ?
 
taking code X and making it better
 
to reorganize code to make it: more readable, cleaner, remove usused bits, etc.
 
something you always mean to do but never actually do
 
like tending to a garden
weeding
 
@KevinB ah
 
7:26 PM
refactoring is what I do when I should be working
 
So "refactoring" means "optimising codes" or "improving codes"
right?
 
!!wiki code refactoring
 
Code refactoring is the process of restructuring existing computer code—changing the factoring—without changing its external behavior. Refactoring improves nonfunctional attributes of the software. Advantages include improved code readability and reduced complexity; these can improve source-code maintainability and create a more expressive internal architecture or object model to improve extensibility. Typically, refactoring applies a series of standardised basic micro-refactorings, each of which is (usually) a tiny change in a computer program's source code that either preserves the behaviour...
 
> like he's eating the best cheeseburger of all time.
 
7:30 PM
so I done some more debugging on the local and server and came up with the following. Still don't see why my server doesn't convert to local. Any ideas appreciated.






LOCAL MACHINE -

//Datetime value as rendered in Chrome dev tools on local debug from Visual Studio:
var outageStart_UTC = moment.utc('28/07/2016 16:15:00').format("DD-MM-YYYY HH:mm");


//code that then converts the date to local browser time, works fine here on local machine:
var localOutageStart = moment.utc(outageStart_UTC).local();
@luggage @ssube
 
> Howl at the moon
 
28/07/2016 16:15:00 is not a standard format. moment should be giving you warnings
 
16:15 is the format that is working fine, ie converting to correct local
 
no warning from moment?
 
it's the 4:15:00 PM format on server that isn't converting to local
don't see any, let me check
 
7:33 PM
> Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to github.com/moment/moment/issues/1407 for more info.
 
> If you hit your elbow, you've gone too far.
Uncontexted comment of the thread
This is hilarious
 
so your suggesting that I convert the value '@Model.Escalation.OutageStart' to js Date before calling moment on it?
@Luggage
 
@Model.Escalation.OutageStart is c#. It can't make JS dates. It CAN make a string in the right format, though.
This isn't your problem, but if you don't start being strict about dates you'll keep having issues.
moment.js expects a single standard format. Use that.
 
iso8601
 
oh.. when you say server, you meant a browser on the server?
 
7:37 PM
@Luggage Actually moment.js allows you to pass an array of accepted formats ;)
 
@ivarni but he isn't and moment should be screaming.
well. talking loudly.
 
@Luggage fair point so maybe I should convert the OutageStart c# value to .toISOString())

When I say server I mean when the website is published to a remote machine running on UTC
and I browse to it from my browser on my local machine
 
@SterlingArcher link
 
not a browser inside the server itself
 
7:39 PM
This thread is amazing lol
 
user1596138
@SterlingArcher That's the elbow lmgdao omg
 
The code on both server and local is the same when converting to a local Date, but server doesn't do the conversion.

Only thing I can see different on the server that could cause the issue is that my @Model.Escalation.OutageStart c# value is coming in as 12hr format instead of 24hr...although that shouldn't matter as I format it as 24hr format in the exact same manner as in my local code base
@Luggage
 
@SterlingArcher I feel like I could answer more of those questions than I should be able to.
 
> Finger pokes through toilet paper, smell finger. Instinct.
 
7:45 PM
@BrianJ the other difference is the month/day are in different orders.. hence the need for a standard format
are you sure it's getting the date right? it might be a daylight savings time issue when it gets the wrong day
although it shouldn't be able to mess up 7/28 and 28/7, since it's > 12.
one has PM one does not. There are many differences.
 
@SterlingArcher dude, I've been reading these to Holly for like 20 minutes already
come back and JS room is talking about it :D
awesome
 
> Men who are too afraid to have things in their butt are missing out.
We've reached a pinnacle. The upvotes are dwindling
 
@Luggage ok so should I be applying that format on the c# side or on the js client side where I'm already doing the format?
 
moment.utc('28/07/2016 16:15:00') resolves to "invalid date" for me, anyway
well, yes, start with giving in an ISO date and not randomly formatted ones.
it's not worth debugging any further until moment accepts a date as valid
 
7:51 PM
@SterlingArcher ...or so I hear
 
bruhh
 
The one that fucked me up the most: why do we smell our hands after scratching
I couldn't answer it to myself
 
@Luggage window.referenceTracker = referenceTracker; tisk tisk tisk
 
@SterlingArcher I don't understand that one. I don't.
Not deliberately anyway
 
7:53 PM
yeah, me neither
 
Like you can't answer it or you don't do it
 
@ndugger was for debuggin.
 
@SterlingArcher do it
 
Well then.
There are 2 types of men.
 
7:54 PM
Guys who smell their balls, and little girly canadians WHO DON'T
 
I think this video kind of explains that:
 
@SterlingArcher men who wash their balls and men who smell their hands
I know my junk smells good
 
tl;dw: We're curious about what our bodies do.
 
@KendallFrey like monkeys
 
@BrianJ also, you are formatting as a nonstandard date ("DD-MM-YYYY HH:mm") before passing that string back into a moment. needless work that also breaks things
 
7:55 PM
!!afk vape
 
@Luggage I think I should start then by converting the Outage value in client toISOString?
should work
 
in C#.
then stop re-fucking it in the client
 
and I should drop the .format("DD-MM-YYYY HH:mm"); on client
just pass in the iso formatted string from c#
 
@BrianJ convert less
 
no more talk until you fix line 1.
 
7:57 PM
moment loves ISO times
it hates everything else
 
in process of fixing now
 
@SterlingArcher wth is the '29th' crap on imgur
 
@rlemon SterlingArcher is afk: vape
 
@rlemon "upvote everything so the FP knows what usersub is like"
I saw so much weird shit today
 

« first day (2113 days earlier)      last day (2835 days later) »