« first day (1754 days earlier)      last day (3195 days later) » 

12:00 AM
(2^53)-1, sorry. Bit of a difference
!!> Math.pow(2, 53)-1 == Number.MAX_SAFE_INTEGER
 
@Callum 9007199254740991
@Callum true
 
@overexchange It appears so, yeah
 
moduscreate.com/falcor-mvc-for-an-asynchronous-world < Falcor MVC sounds cool (it's by Netflix)
 
@Luggage the whole idea is to avoid current += step;
 
!!> (2.2222222222222224e+295) * 10
 
12:02 AM
@Callum 2.2222222222222224e+296
 
er.. it's gotta go somewhere?
 
Oh, we have xe+y syntax. Didn't know that.
 
does your keyboard blow up if you type those letters in sequence?
 
e+y is equivalent to 10 raise to y in human readable form
 
12:04 AM
I was aware, just didn't know we had that syntax in JS.
 
To not miss stuff like this in JAVA, we go for JLSpec. am not sure what spec is referred for JS? such details should never be missed when learning JS for the first time.
 
JLSpec?
 
you need to have a specialized architecture that can even handle arithmetic on maaaaaaaaaaassive numbers to just do sequential checks for primality
in case anyone is still into that discussion
 
The most support is for ES5,
So I'd go for that spec when writing production code.
 
any URL for specs in JS? for java , one refers docs.oracle.com/javase/specs
 
12:13 AM
try MDN
That's not specs, per se, but I'd say it's better than the specs.
 
instead it would be wonderful to predict primes, and test the predictions.
but I believe we're missing concrete detail on the distribution of primes to make concise lists of predictions
 
@Purag like in Minority Report?
 
Am I missing a joke here by not having seen it? :P
 
@Callum From topic wise reading, I will go thru Eloquent JS and subtle details for each topic , MDN can help me. As a beginner, Is that a good idea?
 
@ʞɔᴉN google tells me there was a technology in the film that predicted crime
 
12:20 AM
@Purag there are tests which can prove that something is a prime without having to know every prime that is smaller than squareroot of the target number
 
> it would be wonderful to predict crimes
that's how I read it haha
 
@tereško indeed there are, but aren't all of them arithmetically intensive?
 
Anyone familiar with regex
 
@Purag you can find few videos on that subject in youtube.com/user/numberphile/videos
 
Code School have a free Regex tutorial
 
12:24 AM
@ChristopherGrigg Welcome to the JavaScript chat! Please review the room pseudo-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.
 
@tereško ahhhh I love numberphile!
mersenne primes give a decent way of "predicting" them, but you miss a lot of primes if you just go testing every next mersenne prime
anyway, I don't know nearly enough about primes to discuss this at length, but it's definitely a really interesting subject
 
Hi everyone :)
 
o/
 
can anyone please look at this
0
Q: Editing the name and check for duplicates

PSDebuggerI am trying to edit an option of a dropdown and check if the newly edited option is already present in the dropdown. If it is it should give an alert else edit and add the new option in the dropdown. but there is a case when user clicks edit but then doesnt want to change the name and clicks OK...

 
12:43 AM
I think you need to make sure that the option with the same name isn't the option you are editing
You are getting false positives?
 
yes this is what I want to add. like i want to exclude the option which I am editing when comapring it in the list
how to do that :(
 
look sliek you are trying to edit the :selected option, so exclude that in the IsNameAlreadyPresent search
try jquery's :not() to do that
 
how can I add that condition(confused)
 
see the 'selector' in IsNameAlreadyPresent()?
a selector is the string you feed to jquery to find elements
 
1 message moved to Trash can
@PSDebugger Please don't post unformatted code - hit Ctrl+K before sending, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com or pastie.org
 
12:51 AM
don't paste in blocks of code, I can already see the code on SO
 
ok. can you please explain more on this
 
"#"+DropdownID+" option" <- this is the selector
 
Explain what that does.
 
so this checks all the options in the dropdown and matches with the name
 
12:54 AM
no it doesn't
 
if it matches it sets the flag true
 
What does that selector find?
 
its a for loop
 
no, it's a selector. It's some text describing what you want "html" you want to find.
 
$.each($("#"+DropdownID+" option"),function(i,e){
this one is my dropdown Id "#"+DropdownID+" -- #Dropdown
 
12:55 AM
It's the <option> elements inside a dropdown.
You need to understand how to write selectors if you plan to use jquery (or CSS).
 
my selector is right it will give you all the options of that partular id of dropdown
 
'#someId option', in plain english: "All the <option>s inside en element with id="someId".
 
yes
i know this
 
you have other selectors you use, too, like ":selected". What does :selected do?
 
but i am not sure how to exclude the option I am testing
 
12:57 AM
I'm getting there. I won't just write it for you.
I'm not trying to be a dick, but I have your answer but I'm trying to make you come up with it. I'll guide you.
 
can you give a hint
i have a clue
 
answer my question about :selected (oops)
 
i want to exclude that string
that is the selected option of that dropdown
 
ok. so.. you know how to select ALL options, and you know how to select just the one selected. Now, see ":not()" at api.jquery.com/not-selector
 
ohk so you mean I ll exclude the selected string ?
 
1:00 AM
I took down a tree tonight. gf was upset. it had to go
I didn't like it
was a lot of fucking work
 
"you're worthless tree, and you'll never amount to anything!" ?
 
well yes actually, it was ill placed
it wouldn't ever amount to anything full.
 
@Luggage am I right >?
 
but that didn't matter. 12 year old tree. gf was pissed
 
but how will I add that condition in my for each loop
 
1:02 AM
right about what? you never tried to write a new selector.
 
:not()
 
apply that, don't just repeat the keywords I gave you
you know that 'option' gets options, ':selected' gets selected things, and what does :not() do?
hint it's the first fucking sentence in the link I gave you
 
Selects all elements that do not match the given selector.
 
what do you NOT what to find?
 
ok let me try
thanks :)
$.each($("#"+p_sList+" option:not(:selected)"),function(i,e){
is this right @Luggage
 
1:08 AM
looks right, but you'll need to test.
 
yes testing
thanks for your help (you made me learn :not )
 
chat works different than stack overflow main. We don't write code here, just talk about it. :)
 
yes
but somehow this is not working too
man i m screwed
 
describe how it's not working? still tell you you have a duplicate?
 
working
 
1:14 AM
ah, good.
btw, you are hard-coding "dropdownid" in $('#DropdownId').find(':selected').text($('#txtName').val());
might not be what you meant.
ohh, maybe it is... that really is the id?
 
yep
 
1:44 AM
Doodling in Math: Spirals, Fibonacci, and Being a Plant youtu.be/ahXIMUkSXX0
 
@MadaraUchiha it should be indexOf(element) !== -1, as 0 is falsy.. and the mandatoryFields and Object.keys should be altered, then only your provided solution works.. hastebin.com/ijelelajox.coffee
 
2:09 AM
what are some decent affordable web hosts?
 
you can get a VM from DigitalOcean for $5/month
might be more than you need though
 
@Shea GitHub Pages
 
I'll check them both out, thanks
 
aw can't believe I forgot about github
 
Raspberry colocation
 
2:20 AM
I'm looking for something more traditional that supports PHP and uses FTP
 
Man up and run your own server
 
Girlfriend wants a blog, I've decided on WordPress (what she's familiar with), and I wanna be able to be able to customize it for her down to the core
I could, but I can't guarantee constant up time
or atleast, close to it
 
Try hostinger,
Very easy to install, you can actually use it for free,
 
I'm using ASmallOrange for simple web hosting.. not sure if it's the best deal but it's nice enough
 
nice I'll check it out, thanks
 
2:23 AM
If you want a referral link :)
 
I've previously used Network Solutions, but I figured it's 2015, and there's gotta be something cheaper than $30/m for the plan I had.
 
I'd recommend my hoster, but they don't pay me for referrals
 
Hostinger's referral scheme is quite good, IMO.
 
I had an ok free host once. Then shit hit the fan.
 
Referrals Needed, Referrals left, level description
3 2 Earn our premium unlimited hosting for free!
5 4 Get £3 by referring your friends to Hostinger!
15 14 Free .co.uk domain registration!
100 99 Earn £60 by referring your friends to Hostinger!
 
2:26 AM
Hostinger's free plan is actually perfect for starters
I'll probably upgrade to premium if I need more
 
I've been using Hostinger for ~1 year, never had any problems.
ahem ahem ahem
 
what's your referral?
okay got ya
 
hm whats that funny orange word in the middle
i must click
 
#BestMarketing2k15
@ʞɔᴉN I agree ;p
 
2:40 AM
hi
 
hello
 
Uh @ʞɔᴉN has a doppelganger
Working for a web hosting company, I didn't need to search for hosting. I need to start looking
 
@taco Which company do you work for?
 
I worked for PEER1 but I got laid off
Just started working at Turner Broadcasting Monday though, so all's well that ends well
 
Ah, congrats!
 
2:45 AM
Thanks!
nice pay bump, too
 
3:08 AM
@Shea Blogging on github pages is nice with Jekyll
 
0
A: Numbers within strings?

Bergi (and please don't post code as pictures)

 
@Shea I'm also very happy with hostgator shared hosting for small stuff. inexpensive, too.
 
@Bergi Can we stab the OP?
@Purag He's already signed up with Hostinger :p
 
Thanks, I'll check out Hostgator too, but Hostinger looks like a winner so far
Plus, I already signed up lol
 
@Callum Downvoting should suffice.
 
3:11 AM
I see you have a .ws domain. I always think of websockets when I see .ws
@Bergi D'awwwww.
 
Also, Github isn't gonna work, because my girlfriend is already familiar with WordPress, and I don't wanna have to make her change.
 
But if you find a way to stab him, I won't hold you back :-)
 
@Callum are the prices shown for Hostinger billed monthly, or does it give monthly prices that's are billed for the year?
 
@Shea On cpanel.hostinger.co.uk/order/accounts-order? Per month.
 
Well it says £2.55/m
 
3:18 AM
> Quarterly (Pay Every 3 Months)
> Biannually (Pay Every 6 Months)
> Annually (Pay Every 12 Months)
> Biennially (Pay Every 24 Months)
> Triennially (Pay Every 36 Months)
 
However the reason I ask is, because most of the web hosting services I've encountered while searching for a new host, all advertise monthly prices, but charge in a year lump sum
Yeah, that's what I was wondering
 
Although 3 referrals -> premium hosting, apparently, which includes a .co.uk domain too, apparently.
It does take a month for the referral to become "active", though.
 
Also, I wonder if there's going to be any issues in payment converting American Dollar to British Pound
I've only ever used American Dollars before, so I'm not quite sure how it works yet
 
If it is done through Paypal, nope.
 
Though I'm sure it's mostly automatic
 
3:52 AM
does node-pre-gyp no support iojs?
 
hey hye
hey hey
can anyone help me with little regex issue?
 
@iamtery perhaps
 
i want to remove || as well
 
Found this thread about Hostinger webhostingtalk.com/… ... guy doesn't seem to like them
 
@iamtery So what's the problem?
 
4:03 AM
@Callum i
results
01TESTkeep||
i want to delete || as well
 
^(\d+)\;([^;]+)\;[^;]+\;[^;]+\;[^;]+\;(.*)[\|][\|]$
Looks like it does that
 
@Callum huggies:)
thanks
 
Out of interest, why are you using RegEx there? Is "a;b;c;".split(";") not working?
I'd also note, that is RegEx within PHP, this is what you wanted?
 
im using simply on notepad++
just txt file
 
4:37 AM
 
@overexchange Sorry, I don't have the time to watch & review any video JS tutorial.
 
@overexchange We have generator and array comprehension in ES6 and ES7. Support varies, so not ready for production yet.
 
check it out...you can explore the parse tree for a math expression with this. collapsible! :)
 
This code
  var text = 'outside';
function logIt(){
    console.log(text);
    var text = 'inside';
};
logIt();
 
is printing undefined. Why not outside?
 
because you have var text in logIt.
 
ahh....this is called hoisting @Ant's
 
@Purag: Right, even with hoisting, text is a global var right? It should be accessible within logIt function correct?
 
you're defining a new variable with the same identifier in the scope, though
the interpreter does this
var text = 'outside';
function logIt(){
    var text = undefined;
    console.log(text);
    text = 'inside';
};
logIt();
 
4:51 AM
oh
@Purag any tools available to see the interpreted js code ?
 
Is this valid syntax? ~arr.indexOf(el)?
 
@Callum Yes.
@Ant's Since you have var text in logIt, text is a local variable. The order does not matter.
 
Waow, didn't know there was a ~ operator
 
@Ant's No. That "interpreted code" is a simple way to say "this is how js works". The interpretor does not actually convert your code.
 
If it converted your code it'd be called a converter not an interpreter :P
 
4:56 AM
@Sheepy: Thanks it helps. Just now learned, how bad js can be!
 
hoisting is just one aspect of the language. javascript is very powerful and pretty cool
 
It is improving.
 
and hoisting protects from using uninitialized memory.
 
@Ant's JS is awesome, (ง ͠° ͟ل͜ ͡°)ง
 
But this hoisting behaviour will not change.
 
4:58 AM
it's a distinguishing factor between system languages and a higher level interpreted language
 
React vs Angular, which one will help? We are currently refactoring our legacy 10 yrs old js code to new standards of js. Which one will help?React or angular?
 
Never done this before, but anyone know if I can set a domain to forward to a different website, and have a sub domain parked to a host?
 
Well, hoisting was a behaviour resulted from one of the early interpretor implementations. There wasn't much reason for it other than backward compatibility. Now there are three or four highly optimised JS engine that works with hoisting, it is safe to say this behaviour is now written in stone.
@Shea Yes. Sub domains can all point to different servers. The so-called domain is itself a kind of subdomain.
@Ant's Depends on whether you like Facebook or Google more. You can also say they are both evil and use neither.
 
Vanilla JS is what I swear by, in most cases.
 
5:13 AM
Lol. Good site. Vanilla JS is a fast, light-weight, cross platform framework!
Not that I'd call it a framework. Anyway, React is better than Angular in this regard. Google often try to create a totally new and alien system (ex: GWT, Android Java, Dart). React is simpler, closer to vanilla.
Hey, it even has a functional download button!!!!!!
vanilla.js (0 bytes)
 
I didn't know they were having a laugh when I first saw it, I was utterly confused as to the file size.
 
"Your users' browsers will have Vanilla JS loaded into memory before it even requests your site" "Native support for HTML5" "Vanilla JS make everything an object." Hey you forgot to mention high performance prototype OOP!
It's a good laugh. "0 bytes uncompressed. 25 bytes gzipped."
That should be a strong hint XD
 
python is strongly typed dynamic language. What about JS?
 
JavaScript has dynamic type. You cannot specify a type at all.
 
Let's see. let a = "hello", b = 1, c = 3.141
 
5:22 AM
you can explicitly enforce types but it's not that convenient.
the trick for integers is to |0 everything
 
Python is strongly typed, because objects don't change type. Python is dynamic typed, because we pass around references and don't check the type until the last possible minute.
 
asm.js uses the OR 0 trick to enforce int types
 
MDN says: JavaScript is a loosely typed or a dynamic language. I did not get this.
 
You see, I can't really say JS is untyped, because you say typeof( '' ) and it'll say 'string'. But it is certainly not strongly typed. So that leaves dynamic typed.
 
when I see,
typeof(a)
"number"
Is number a class?
 
5:25 AM
!!> typeof Number
 
@overexchange You are not alone. en.wikipedia.org/wiki/Strong_and_weak_typing
 
cap dead again?
 
@overexchange JavaScript has no class. I will repeat. JavaScript does not have class.
 
It has syntax for classes, but is shorthand.
 
That syntax suger does not result in real class, and many people are very confused because they think it is a class.
 
5:27 AM
If I have a span/div with contentEditable true, can I somehow have the Enter key (with attached event handler) act as the submit button instead of traditional line break?
 
so what is typeof(a) > "boolean" ?
 
boolean, number, object, symbol etc. are JS types. Real types. Boolean, Number, String, Object, Function etc. are JS objects. Real objects.
Note that types do not include function or string, and objects do not include symbol.
So they are not the same.
 
@DemCodeLines you want to bind a function to the "onkeyup" event of the element
or probably onkeypress
typeof is not a function y'all. typeof a, not typeof(a)...
 
when we say JS type, Is it primitive type?
 
5:34 AM
@Purag ^^
Anyway, I'mma be gone 'till Sunday. Bai Gais ^_^
@Nick I'll make sure to take a picture of haggis for you x
 
cool! have fun @Callum!
 
Bai
 
If I do a document.getElementById and bind a onclick to it, will it be implemented upon page load or will the browser try to find associated code when the user deals with the element?
 
@Purag Thanks, will do.
 
@overexchange Depends on what do you define as "primitive type". For example your "1" may be 64 bit, but when you ~ it, it becomes 32 bit....... and they are all "number".
 
5:36 AM
!!mdn Primitive type
 
ttj
input type="text" links correctly with ng-model, but input-type="email" fails to link. why?
 
is the bot alive?
 
@overexchange But yes, they are is the primitive type in the traditional sense, I think.
 
so for JS, MDN is the Bible? provided by mozilla, one of the vendor?
 
@overexchange Yes. And yes. Just remember that it is not the specifications. MDN is the best non-spec JS doc we have now.
 
ttj
5:40 AM
i figured it out
 
@overexchange For your reference, wikipedia defines two types of primitive data. JS type is like the first, and certainly not the second.
 
i think primitive types in JS behave similar to C/java primitive types.
 
in what ways?
this is a great exercise for you :)
 
The problem with JS is, type is hidden. They exist in spec and execution, but not in the code you write. Type is, at language level, a behaviour. And this behaviour extends to non-primitive types like string, generator etc.
So it is hard to draw to line.
 
5:46 AM
MSN says, A primitive (primitive value, primitive data type) is data that is not an object and has no methods. but str = 'xyz'; str.charAt(1); works.
 
See?
 
what does it mean to say str is not an object?
 
Good question. Like Purag said, go figure. It is a good type exercise. :)
I stand by what I said. At coding level, JS type is just behaviour.
Here is a brain teaser:
( function whatIsType ( para ) {
alert( 'this = ' + this + ' (' + typeof( this ) + ')' );
alert( 'para = ' + para + ' (' + typeof( para ) + ')' );
} ).call( 1, 1 )
 
to guide you in the right direction, @overexchange, check out "autoboxing." Java has this, too, if you're familiar with it.
 
I think the exercise is about Distinction between string primitives and String objects mentioned here
 
user3119231
6:00 AM
morning
 
@overexchange A good first step. Note that this 'primitive string' is a real object and not a fundmental js type. The article is describing the behaviour of typeof and little else, which is caused by backward compatibility.
i.e. 'mea'.__proto__ === new String('mea').__proto__
 
user3119231
isn't vanilla-js.com just normal js? o.O
 
@Sheepy any object is generated from functions in JS, for example new String('xyz') is calling a function in window dictionary for key String. Is that correct?
 
night guys
 
6:16 AM
@Sheepy Is this not a spec for JS ? es5.github.io
 
6:32 AM
wrote an array/JSON printer: github.com/purmou/print_json
 
good, we almost ran out
5
 
hahaha.
the one I was using kept printing member functions as null. So I wrote one to ignore that, and also to look better. also, this came out of an SO answer.
 
cool :P
 
I need two panels in a parent div, 50/50 initially, but then I want to add a button in middle, so user can hold the button and increase decrease height of panels using mouse up and down movement
what should i call it ?
trying to search on google but nothing coming up
moveable divs ?
dragable divs ?
 
6:48 AM
resizable
 
hi
 
Bob the button
 
press the fuck out of it
 
But seriously, I can't think of a single name that would describe that functionality
 
Bob the button
Skeomorphic Mess
@ivarni How about
buttonToOpenSomething ?
@Mathematics you can do that using frames :P
and if you don't want frames (as you shouldn't)
you can roll your own using css flexbox
 
6:58 AM
@Abhishrek what would i call it to search it on google
 

« first day (1754 days earlier)      last day (3195 days later) »