« first day (1129 days earlier)      last day (3818 days later) » 

6:00 PM
I would prefer if you don't contaminate this holy hall with .. Jav...
thanks :-P
 
Yeah for some reason in my mind the tag said JS
Monday hitting me hard
 
78
Q: What's the difference between JavaScript and Java?

GuyWhat's the difference between JavaScript and Java?

 
hitting you hard? I might not have a job as of next Tue! :P
 
One is essentially a toy, designed for writing small pieces of code, and traditionally used and abused by inexperienced programmers.

The other is a scripting language for web browsers.
hahahahahahaahha
thats a good one
 
wow..
 
6:02 PM
@Loktar wat?!
 
408
A: What's the difference between JavaScript and Java?

Shog9One is essentially a toy, designed for writing small pieces of code, and traditionally used and abused by inexperienced programmers. The other is a scripting language for web browsers.

lol
 
@RUJordan current company lost our contract
so I am in negotiations with the new company
they want to give me a pay cut.. either side is currently budging (myself and them)
 
> JavaScript was named this way by Netscape to confuse the unwary into thinking it had something to do with Java, the buzzword of the day, and it succeeded.
 
Oh I have a router that uses javascript for it's login page :S
 
@Loktar it sounds pretty tough to get a stable full-time contract over there
 
6:03 PM
@Loktar have you marketed yourself to other companies?
 
or don't you seek one at all
 
The password for the tech is in plain text
 
yeah I have. @jAndy yeah gov is a bit sketchy right now
tbh I havent been hitting the pavement hard yet
just waiting to see how this all plays out
 
@Loktar when you say pay drop, are you making enough as is that it wouldn't destry your budget or will the drop force you to make changes in your life?
/what are the benefits if any?
 
eh no it wouldnt kill me, its a 10k drop in salary
Its still decent pay, but I would have more responsibility now
 
6:04 PM
ahhh I just looked up your place and I immediately got remembered to...................
 
so it seems kind of crazy to give me less idk
 
Do you have any leverage to the situation, then?
10k for a harder job really isn't enticing.
 
ish. They need me, but they are also willing to throw in a random body too
so right now its a bit of a stalemate
 
@Loktar I thought it was 6?
 
6:06 PM
no I wish
Id take a 5-6k pay cut max
 
...did I just get a Facebook Notification from UPS?!
 
wow really?
nice
 
Not nice, it was an ad.
 
So everyone, can we start using javascript login pages with plain text passwords?
Also allow the cookies to store access like this:
 
6:08 PM
Developers?
 
@Loktar I hope all falls in your favor man :(
 
Is this the song?
 
thanks man :)
 
yea thats golden too
 
6:09 PM
LOL
 
@rlemon beat that man ^ thats gold plated
 
That's hot
 
when I first time saw that.. I could not hold myself and literally pissed myself when it came to "I have four words for you!" :D
 
@Loktar this is where you went wrong: you asked for realistic things. Next time you need to demand a football helmet full of cottage cheese.. you know, so you have something to give up to make them feel like they have won the 'negotiation' (but you have to act bummed when they do axe it)
 
Funny thing now Microsoft is now focused on profits rather than devs
 
6:10 PM
when you have watched the orignal speech before
 
@rlemon LOL
 
@Loper324 they were never focussed on profit
get it straight microsoft is a corporate money minter they focus more on better services for corporates and people (devs) working at corporates
 
user image
3
@Loktar you complete @JuzzCoding's head.
-_-
 
lol wtf
 
6:11 PM
@rlemon Doesn't look like it for me :s
 
thats crazy
 
seriously lol
 
@JuzzCoding guess what
 
 
every so often the user list surprises us
 
6:12 PM
kamal is assuming u aren't working and procliams he has finished 1 subject by now
and wants to rest
 
@rlemon IT'S A CONSPIRACY!
 
@Loper324 no, that user isn't here atm.
 
!!afk lunch
 
@RUJordan Nobody cares.
 
on wedenesday i will take my revenge on him.. ask why
and how ?
 
6:13 PM
when will you learn.
 
@AbhishekHingnikar how ??
 
@rlemon whoops :P
 
ok - this is my change to the boss code:
 
I'm not doing anything with those flags btw - @AbhishekHingnikar upto 4 now
 
var startUp = {};
	var myStatus = (function(){
		var loginPage = '/rtt_web/login.jsp';
		$.get('LoginServlet?action=loginCheck').done(function(response){
			startUp.loginCheck = true;
		}).fail(function(){
			window.location.replace('/rtt_web/login.jsp');
		});
	}());
 
6:13 PM
too much rap music... gotta stop it
 
oops - loginPage var is now gone - copy paste fail
 
how many flags does the system need before you are suspended?
 
I should be
 
I've never been able to figure that out
6 maybe?
 
goes off to ss13
 
m59
6:24 PM
var foo = 'blah(capture (all of) this)blah'; //capture (all of) this
How would you get the inner one with regex?
 
0
Q: replace paranthesis code

user32281I am trying to write a string or integer formula which will look a code between parentheses. My logic is this: Search for the first parentheses, find the last parentheses, and return everything in between. Im sure there is a string or integer function, but not exactly sure which one will do the...

 
m59
var regex = new RegExp(
  '\\('+
  '('+ //start capture
  '.+'+
  ')'+ //end capture
  '\\)'
);
LOLZ ^^^
that
 
/\((\(.+)\)\)/g
maybe
 
m59
tried it
 
ugh
 
m59
6:25 PM
This isn't going to help him anyway..I'm just curious now.
 
effing escaping
 
m59
It seems that the "g" is looking for matches after that one, not inside of it.
 
g is global
 
m59
right
 
@KendallFrey should know
he's a regexp master
 
6:33 PM
ohai my internet is magically back
@m59 /\(.*\)/ should do it
 
@KendallFrey that captures the outer ()
not the inner ()
 
m59
@KendallFrey afraid not :(
 
Why not?
 
he wants 'all of' to be returned
 
m59
It's not like...recursive?
 
6:36 PM
!!> 'blah(capture (all of) this)blah'.match(/(.*)/)
 
@rlemon ["blah(capture (all of) this)blah","blah(capture (all of) this)blah"]
 
m59
get the results and the results inside of them
 
!!> 'blah(capture (all of) this)blah'.match(/(.*)/)[0].match(/(.*)/)[0]
 
@rlemon "blah(capture (all of) this)blah"
 
What do you want returned, the first set or the second set?
 
m59
6:36 PM
both
 
Which one?
Can't be both
 
m59
'capture (all of) this' AND 'all of'
Have re-match the results, then?
write a function that will recursively match until no more results?
 
Oh, then use a capturing group
Does it need to be infinitely recursive?
 
m59
yep.
 
You're fucked.
If you want to use regex that is
 
m59
6:39 PM
Right, np
I was just trying to expand my abilities.
 
regex isn't recursive
Unless you use the .NET engine or similar
 
@m59 tell him to use REBEL
 
So, like JScript?
 
it is recursive
 
@rlemon But REBEL doesn't return anything.
Unless you pipe the output or something
 
6:44 PM
that is pretty cool
so when is your glass shipping :P
 
ok - my final login check - am I completely wrong?
(function(){
	$('#activePage').hide();
	$.get('LoginServlet?action=loginCheck').done(function(response){
		loadingModal(); // run loadingModal function
	}).fail(function(){
		window.location.replace('/rtt_web/login.jsp'); // go to login page if not logged in
	});
}());
 
Wow those were the most productive 30 minutes of my life
 
.done(loadingModal).fail(....)
 
besides i will try no to flame.
 
if you are not using the response or passing anything to loadingModal there is no need for the anon function @jbolanos
 
6:47 PM
@rlemon makes sense - was going for readability - but shorter is better
 
well you don't have to change it. I was just pointing it out
 
minor modification - and it makes sense so I changed it
I'm dynamically building a twitter bootstrap modal so I'm going to have plenty of code in my javascript file :)
 
> THIS CODE SUCKS. You don't have to fix it though.
 
resist boobs comment ..... resist!
 
in stackoverflow.com/a/12092919 solution, the result has unwanted html head and body tags. how can we strip those tags and get the actual result that is <img src="foo" />?
 
6:52 PM
should an anon function proceed or precede any function is calls? And why are proceed and precede differently ceeded?
 
regex?
 
@Annie I'd expect a method like findByCSS on the document object
 
Hi
 
or at least getFirstChild
 
hey! I'm a FirstChild!
 
6:54 PM
I'm a lastChild
 
@jbolanos proceed and precede mean two entirely different things.
 
@JanDvorak, the markup string is coming from new XMLSerializer().serializeToString()
 
hum - I need more coffee
or less... I'm at that point of the day
 
0
Q: Design advice for building pluggable componentry in AngularJS

user16549I'm currently working on a team that's developed several, extremely similar web applications in flash, and wants them ported into JavaScript. They also want a single application harness to host all of these applications, since they're all very similar. The application(s) are fairly standard. Eac...

 
I think I'm going to go wonder into traffic
 
6:55 PM
we can't use DOM methods on it :(
 
@Annie you can use DOM methods on the object you pass to the serializer
 
var f = document.createElement("div");
f.innerHTML= "<img src='foo' />";
alert(f.firstChild.getAttribute('src'))
Like this ^ ?
No need for a serializer imo
 
@jbolanos wonder and wander mean two entirely different things.
 
@BenjaminGruenbaum, the idea is to transform html's <img src="foo"> to XHTML's <img src="foo" />
 
@Annie now why would you do that?
 
6:58 PM
HTML doesn't need that slash
 
Worse, why would you do that in the client side on the fly?
 
I don't care anymore...
 
@JanDvorak yeah, it doesn't but I like it.
 
and if something in that statement doesn't mean what its supposed to I don't care about that either :p
 
/<img(.+)[^!\/]>/
 
6:58 PM
I am storing the markup content in XML, for further manipulation with C#, XHTML is relatively easy to parse..
 
will match <img ...... > but not <img ... />
 
@BenjaminGruenbaum I don't really care if it's a generated string, not written by me
 
@Annie Seriously? If you want to parse markup just use CsQuery - it's trivial, fast and expressive to parse HTML with it.
 
@Annie so should be HTML
 
It eats up malformed HTML for breakfast and you can feed it HTML and it'll spit XHTML for you.
 
6:59 PM
@Annie Yeah it is. I wrote a regex to do it.
huehuehue
 
/<img(.+)[^!\/]>/.test("<img src='foo.png'>");
true
/<img(.+)[^!\/]>/.test("<img src='foo.png' />");
false
Yisssss
 
@rlemon Can I break it pretty please?
 
@BenjaminGruenbaum go for it
@Annie also, don't use my solutions. I just enjoy trying to learn more regexp.
 
@rlemon, thanks
 
> Please don't actually live in my house. I only want to get better with toothpicks
 
7:02 PM
I found the solution, var result = new XMLSerializer().serializeToString(doc.firstChild.lastElementChild.firstChild);
 
@Annie you can solve this on the C# side in a better way.
 
it will fetch the valid xhtml markup
@BenjaminGruenbaum, I just don't want the third-party libraries (htmlAgilityPack or whatnot) in the .NET code to pollute my solution. :)
 
@Annie s/pollute/clean up/
 
@Annie htmlAgilityPack is pretty shit. CsQuery is a lot nicer.
 
@JanDvorak no, don't use my solution because as @BenjaminGruenbaum has said, this probably shouldn't be done with regexp.
 
7:05 PM
Also, there is a big advantage in not reinventing the wheel and trying to solve solved problems.
 
@rlemon building houses with toothpicks shouldn't be done either :-)
 
not unless you are learning how to design houses
 
@rlemon dammnit, now I have to say it should be done with regex in order to disagree... or agree in order to disagree with Jan. No matter what I say I end up agreeing with someone - you have trapped me Mr. Lemon, touche.
 
@BenjaminGruenbaum damned if you do damned if you don't
what is this?! a community for ants!?
inhabitat.com/… also worth a view
 
@rlemon it looks like a show off :-)
(pretty successful one, too)
 
7:13 PM
@RUJordan There goes the neighbourhood.
 
@rlemon it's going to have to be at least.. three times bigger!
 
especially the last one :D
 
@FlorianMargaine Ghost says they've got a whole analytics panel when some digging reveals that that it doesn't exist anywhere other than a bit 'todo' list.
 
7:29 PM
I see
 
So I bought an iPhone charger for work.. and the cable doesn't fit in my iphone.. whut
You had one job!
 
I would have been ok with it had the promo page included 'in the future' or some disclaimer that the panel was still being worked on.
 
stackoverflow.com/q/20055998/1348195 <- interesting question.
I think a queue of references might solve it.
 
hrm, this is sad. Since the new github UI changes I can't figure out how to download a wiki file.
 
@BenjaminGruenbaum that's a good question! It's upvotes are flying now lol
 
7:33 PM
@BenjaminGruenbaum yeah but how do you know if you don't have enough space left
 
@FlorianMargaine can Apache / HA_Proxy / NGnix
can run authorization stuff ?
 
With that logic - is there a way to allocate more storage to localStorage?
 
like, HTTP Basic authorization?
 
no like cookies and stuff ... i am not stupid enough to ask about HTTP_Basic .
 
7:34 PM
@FlorianMargaine exception, working on something
 
@AbhishekHingnikar more explaination..?
@BenjaminGruenbaum I see
 
@FlorianMargaine can we add modules to apache which intercept a request check for cookies check that in a database and add some stuff to the request while passing it to the app ?
 
and in english?
 
:-(
---- Request Comes -> [ Apache ( checks the session in a mongo db database.. adds user if finds one in the db) ] -> Passes it to a python / javascript api server
yeah i am sounding dead stupid ... i can just do it with node.js :-|
meh nvm
 
7:37 PM
apache has difficulties to connect with some database
 
0
Q: Need review and best practice tips for a Backbone project

ElmarI made a simple app that fetches the favourite programming language of a Github user, by simply inserting their username. The full code is uploaded on Github, please feel free to fork it from https://github.com/elmargasimov/lovelanguage. The stack: Yo Backbone generator from Yeoman Require.js...

 
@FlorianMargaine nvm i finally figured an architecture
or i hope so
just tell me one thing... Is there a tool that performs proxies depending on routes ?
 
Proof of concept
0
A: localStorage, limits and data expiration when limits are reached

Benjamin GruenbaumHere is a small proof of concept I just whipped up. It assumes an exception is thrown when you try to store items and have no space. Code is annotated var Storage = function (iden) { // a storage wrapper object var storage; // temp storage with variable if (localStorage[iden]) { // if w...

 
now make it a jQuery plugin and watch the panties drop.
2
 
7:41 PM
probably doesn't work - I typed it in SO
 
I'm always impressed when I come here lol
 
is it possible to just fork a folder out of a repo
can I git@github.com:user/repo.git/folder
no I haven't tried it, I'm just curious
17
Q: How to pull specific directory with git

bluefootI have a project with git, and I just want to clone or pull a specific directory, like myproject/javascript just like subversion does. make some changes, commit and push back again. It's possible?

should have just looked first
disregard..
 
user1596138
Ok, I have a database set up with calendar listings more or less. The info is all stored as separate values: Performer names, Venues, Genres, Times etc. . .
 
I love how the accepted answer has 2 upvotes
 
user1596138
Some of the performers/venues are advertisers, and they get links on their names. So "Guy with a spoon" is an advertiser, every instance of "Guy with a spoon" gets linked to "spoonguy.com". But every instance of "Guy with a fork" is just plain, because he doesn't advertise.
 
7:49 PM
0
Q: Executing function which is below calling

KyrbiI'm creating little text-based game and I know that I will get to this point where I will cry and suffer of not thinking before. Imagine this situation: callFunction(); function callFunction(){ console.log("Something"); }; If I do this, function won't be called, is there any way to make it ...

 
@rlemon use a submodule instead
 
user1596138
I have to come up with an efficient way of determining who is/isn't an advertiser.
 
user1596138
And I can't use a static array in my code. I need an updateable list of all current venues/performers, which I can enable/disable linking on.
 
> Functions get hoisted in JavaScript to the top of the containing scope. @BenjaminGruenbaum
Does that mean that you can declare a function anywhere basically?
 
@Jhawins fetch the list and then color.
 
user1596138
7:51 PM
Having trouble deciding how to do it. All the info comes from the database already, is it ok to run a second query determining advertisers when the data is parsed?
 
@RUJordan not anywhere, anywhere in the containing scope/functions.
@Jhawins is this for actual site articles?
You probably want to color on the serverside anyway
 
user1596138
@BenjaminGruenbaum For our calendar listings. We're an entertainment paper type thing. So this'll be on the website.
 
user1596138
Right now they have calendars up as static HTML pages. They're updated manually for every single day and then automatically uploaded at 3am.
 
user1596138
I'm converting the whole op to a database system that's almost totally automated.
 
user1596138
@BenjaminGruenbaum Color?
 
7:54 PM
@Jhawins link, whatever
Do it on the serverside imo, no need to put that logic in the client
 
user1596138
Can't be dealing with people not using JS not seeing the links, so I'm definitely doing it serverside.
 
user1596138
I just don't know exactly how to do it.
 
function foo() {
  function bar() {
    // I am not hoisted into the same scope as foo.
  }
}
@RUJordan if that example helps drive home that point
 
@Jhawins use a list
 
Have an array of keywords, and a map of keywords -> links, then parse the text to see if there is one of the keyowrds and replace with a link
 
7:56 PM
It's not hoisted because it's within another function, correct?
 
it is not hoisted outside of its scope
 
@RUJordan hoisted means that it's moved to the top of its scope
 
user1596138
I figure I can take the info while parsing and converting into an actual listing and search an array for the values, but I don't know how to supply the array with values. The list needs to be editable from within the browser in the DBMS system so that the non-tech people here can completely manage it on their own.
 
wtf, 1 btc is over 500$ now? why the hell didn't i buy some when they were at ~150?!
 
user1596138
@ThiefMaster Guess who did ;)
 
7:58 PM
Because trading with unstable currencies is retarded
2
 
user1596138
My $300 turned into over $900 :D. I'm done watching it though, I think it's time to cash out.
 
@ThiefMaster that's what people said when it got to 150
 
@ThiefMaster my brother had ~10+ (I think around 15) when they were not worth much. He sold them and bought himself a new gaming rig. He text me a few days ago bitching about this as well.
 
user1596138
@copy You didn't just make $600 doing nothing.
 
7:58 PM
@BenjaminGruenbaum pastebin.com/ugC21qSB
 
@Jhawins neither did you if you haven't cashed out and have an actual currency in your account
 
how about this ?
 
You were lucky (if you sell now). Some people win, some people (will) loose
 
user1596138
@Loktar I need to get on that... But it's still going up haha.
 
@copy yeah, but when you could get 1 btc for a few bucks it wouldn't have been that risky to spend e.g. 100€ on them
 
7:59 PM
I mean, it isn't a huge amount of money. but I would also be kinda peeved if I had mined over ten coins and sold them at like $100 a pop
considering the price now
 
@AbhishekHingnikar Ah cool, it's last used and not last insert, nice
 
@ThiefMaster That's right, but back the it wasn't a deal
 
@BenjaminGruenbaum it gracefully falls to first
 
bitcoin exchange feels like a stock market for kids/pigs
 
user1596138
I had >10 but I cashed out months ago when it hit $150.
 

« first day (1129 days earlier)      last day (3818 days later) »