« first day (1287 days earlier)      last day (3658 days later) » 

8:02 PM
I just wrote "In the following, let pi = 1 ..."
I feel so evil
 
lol
 
<nevermind>
 
@Fabien 10 mins, changing computers
 
@DaveRandom Worth sorting I take it?
No worries
 
8:23 PM
Hello everyone
What is the possible ways to make switch between two languages in a web site?
 
@Fabien so first off, moving your router to the master socket won't make the slightest difference unless you sort out the wiring. The root of the problem is that the telephone wiring in your house is a gigantic induction loop that sucks up interference from the electronic devices around it (this is an especially big problem with ring topology internal wiring configurations)
 
Is that what I have?
 
The feed that comes in to the system is, in theory, relatively clean, if you pass it through a master NTE, which has some electronic components which (if you get a good one) will work with the components at the exchange to eliminante the interference on the line
However there are a couple of caveats to that even with good equipment:
1) many exhanges still have line terminating equipment that was built before ADSL existed, which means it's tuned to filter some of the high and low frequencies out. This means the DSLAM will be rigged up on the wrong side of the noise cancelation filters (otherwise DSL just plain wouldn't work) which means no matter how good your NTE is, you won't get any benefit from it
 
Not ideal
 
2) There is still a sizable amount of aluminium cabling in this country (if you're interested, this is because of the relatively short period in the mid-80's where copper prices rocketed so high that the value of the copper in a penny was worth more than a penny, which is in no small amount the Thatcher government's fault). Aluminium has a completely different noise absorption profile to copper, but because the majority of the cabling is a copper and chances are at least some of your line is...
coppper, that's what it's tuned to
stupid message length limit
 
8:35 PM
heh
 
@mbx: If Animal also implemented Parrot, it would be a Polly-morphing animal. — RenniePet Sep 13 '13 at 23:31
 
Regardless of this, it's still worth sorting out your internal wiring because regardless of the feed signal quality, internal interference can cut it in half. Plugging the DSL equipment into the "master" socket of an unmastered system will have no effect, because everything is effectively the master socket
Next important thing to note here is that no matter what you do, you will never see an instant speed boost with DSL as it is implemented in the UK
 
By internal wiring we mean no further than the socket itself?
 
This is because of the non-standard and somewhat bizarre way in which bandwidth is supplied, which is a product of the shitty infrastructure that we had for a long time - the majority of the reasons for it don't exist any more but the consumer supply market hasn't really moved with the times (although, despite the way that some people descibe the issues it is getting a lot better very quickly)
@Fabien If you find that wire that has ~55v on it when you disconnect it and none of the others have any voltage, technically Openreach's responsibility ends therre
 
As in it's the buildings fault
 
8:46 PM
Technically yes, but I wouldn't go down that road if I were you. That wiring looks like telephone wiring done by an electrician - there's nothing fundamentally wrong with it from an electronic point of view, but it's horrifying from the point of view of modern analogue telephony
 
So recommended course of action?
 
What you want, in an ideal world, is an master NTE with an extendable configuration (in this country that equates to an NTE5 box), where the feed is terminated directly onto the feed terminals and all extensions are run from the front.
The feed consists of precisely 2 wires, the extensions consist of exactly 2 wires (run from pegs 2 and 5, polarity unimportant)
Any additional connected wires do nothing except collect interference
However
Here's where it gets interesting and somewhat beyond my understanding of the physics of the system: even though you only use 1 pair, the best configuration for avoiding interference if to use 4-pair cable (unless you buy shielded cable and earth it properly)
Annoyingly, cat5/e is sub-optimal for this as well, the pairs are twisted too tightly (apparently)
But since we're not in the business of replacing the internal wiring in your house I guess this is somewhat irrelevant :-P
 
yes.
It went beyond my understanding a little while ago :P
 
Yes. I have no idea what you're talking about.
 
@TOOTSKI We're talking about analog telephony, something that has changed surprisingly little since Alexander Graham Bell stole the design the best part of 150 years ago
Fun fact: the classic yoghurt port telephone experiment that children do can be turned into a "real" telephone with an extra bit of string, some water, a 9v battery and two pennies (it can also transmit an audible, if muffled, signal over half a mile in this configuration)
 
9:01 PM
@NikiC looks nicer on the x scale when working with trigonometric functions :-)
 
@Fabien In practical terms: 1) find the feed pair 2) terminate it onto the feed side an extendable master socket (NTE5) 3) reconnect the 2/5 pair of all extensions to the extension side of the NTE5 4) ? 5) profit!
 
So all on the master socket?
 
really the master socket is where is all happens, yes
You can help the situation by disconnecting the 1/6 and 3/4 pair on the extension sockets, but not by nearly as much
 
Fair enough.
 
But from you picture it looks like whoever has wired it up in the first place as done some interesting bridging on 2/5 and 3/4, which is going to make it more interesting to work out what is what
 
9:09 PM
So I need a NTE box and a Falcon Punch tool.
 
Ideally I would suggest continuity testing the cables work out what is the other end of what and and starting agian, but it can be a bit hard to keep track of
But step 0 is to figure out which cable is that actual master feed
 
announcement: opcache is wank ...
 
how's my spelling holding up btw? I'm now drunk enough that the letters are all somewhat swimming round the screen...
 
master feed being the 55v one
 
@Fabien Yes, crucially the one that still has voltage on it after you disconnect it, and nothing else does
Yay wrong ping
 
9:14 PM
these days i feel doing more javascript than php :(
 
Javascript is a great language and I will not hear a bad word said about it
No, wait, the other thing
 
@shortCircuit .. unless you are actually doing "jquery programming"
 
not jquery. but to be honest, i started making a chatbot today. and i had to use jsonp in jquery.
had no idea how to do it in javascript
 
wtf
 
while using the google search api
 
9:18 PM
stop saying things ... javascript and jquery aren't different things ...
 
@DaveRandom How much at risk I am of shocking myself doing all this?
 
@shortCircuit var s = document.createElement('script'); s.src = yourJsonpUrl; document.head.appendChild(s);, in a nutshell
@Fabien Telephone line shocks are 55V but not really capable of delivering any meaningful current. They are unpleasant, but they aren't dangerous unless you have a particularly dodgy pacemaker
 
i was using callback=? in the url . but i don't know why there was no o/p . maybe i should check it again.
 
The things we do for better latency...
 
Where is @PeeHaa? Is he already celebrating kingsday?
 
9:25 PM
@Fabien ISDN30 on "long" lines (> 2mi) is 220V. I was once rewiring one and as I had previously experienced one of these I separated the two wires by a couple of feet to avoid a shock. I was crouching down and hold one of the wires (unless you bridge the wires or earth yourself you can touch one of them just fine) when I lost my balance and fell backwards.
I imagine you can see where this is going.
My builders crack landed on the other wire that I had put "out of the way", and I got a 220V shock from my fingers to my arse, which was probably the least pleasant sensation I have ever experienced.
6 hours ago, by PeeHaa
ALL HAIL TEH KING!
 
hehe
 
@shortCircuit Sorry I missed this, what do you mean by o/p?
 
what is saw on the console. No Access Cross Control Origin .. sorry i dont remember the sequence.. but i know what it is.
in php it was solved with curl
 
@DaveRandom LOL. Isn't anything over 220 potentially fatal?
 
9:37 PM
@Fabien 5 volts can be fatal
current and energy delivered is what matters, not voltage
 
it depends on the current.. 1Amp current is enough to kill someone i guess
 
@shortCircuit There's no reason why that should cause cross origin issues. What you are basically doing there is adding this element to the document: <script src="http://your/jsonp-url"></script> - and evaluating the response as JS. So the basic principal is that you tell the remote server the name of a function that you have previously defined, and it calls that function with an argument of the response
 
@ircmaxell So it seems. Scary stuff.
Shan't tell my wife.
 
@ircmaxell @Fabien this
Also the path it takes matters a lot
(hence the reason many people per year take a direct lightning hit and live to tell the tale)
 
And this is why I try to avoid dealing with electricity. I'd be too nervous a wreck doing anything with it.
 
9:41 PM
Lighting, by the way, has voltages in to 7 figures, and is capable of delivering several amps of current, albeit very briefly, but if it doesn't cross your heart there's a good chance you'll survive
 
I've taken 400v DC across the chest. Knocked me out for a minute or 2
 
They say you're supposed to curl in to a ball and touch your knees to your chest
Also your hair getting positively charged (standing on end) is a sign lightening is about to strike where you are
 
@Fabien If you are on top of a hill that's probably a good idea, otherwise just move away from the really tall thing you are next to
 
I usually am the really tall thing around me.,
 
^ that is possibly the coolest piece of film ever captured
 
@Fabien This web page is not available
 
@DaveRandom And they say that GOD doesn't exist...
 
@DaveRandom would you xplain this. "So the basic principal is that you tell the remote server the name of a function that you have previously defined, and it calls that function with an argument of the response"
the url i have is "https://ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=large&q=stack"
 
@shortCircuit Which parameter in that URL is the jsonp parameter?
 
9:47 PM
@DaveRandom can you explain how come the tree like structure is slow, and the vein like is god speed?
 
@TOOTSKI I can, but I'd basically be regurgitating what-if.xkcd.com/16
 
@DaveRandom Explain as in link, thanks :)
 
By the way, what-if.xkcd.com is both awesome and an epic time vacuum
 
i think none.. i should've added a callback=? ?
 
It's amazing.
 
9:50 PM
@DaveRandom I've read them all… they're great!
 
@shortCircuit OK so you know how JSON is just a Javascript literal? So the basic idea is that I say "give me some JSON, and wrap it in a function call", so you supply the function name as an argument to the web server. So imagine you have a "regular" JSON API call that returns [1,2,3]. If I supply ?callback=foo to that API the service will instead return the string foo([1,2,3]) (note that neither the argument name or value are pre-defined, both are implementation specific)
So, if instead of fetching that response as a string via ajax, you simply tell the document to load that script, it will load a script that attempts to call the global function foo() with an argument of the response
 
Been playing this flash game far too long Thunder Pool
 
Now, obviously, there are some security issues here (you're basically calling eval() on the response of an HTTP request), and it requires that that function be defined as a global entity, which sucks a bit
hence the jQuery abstraction where you pass callback=?, and it converts that ? to a randomly generated function name that doesn't collide with anything that already exists
 
@shortCircuit syntax error
 
10:00 PM
oops.
 
(too many quotes)
 
console.log(data); <-- wrote :
 
@shortCircuit btw, if I fix the errors in that it works exactly as I describe
@shortCircuit Note that there are also too many quotes line 5
 
o yesh.
typing mistakes
:P
 
Well if I fix those issues and copy/paste that code into my console, it works as expected
 
10:03 PM
thats great. that means i understood what you said.
 
OK cool :-)
 
lol
 
Image not found
 
Lies
Your interwebz is broke
 
@Fabien haha, that's great
 
10:05 PM
@DaveRandom Probrem is you.
 
It does seem to be behaving oddly in chat, but I'm browsing the rest of teh intarnetz with no issues :-(
Oh, suddenly now working
 
what about imgur?
Dave + Beer
 
@Fabien = Deer
 
Yes Dear.
 
but its a bot, which will initiate a google search for some command like !!google hello or like !what is grass . isn't it bad to create a script tag for each search?
 
10:08 PM
I really hope I meet your wife one day so I can tell her what you are really like
 
@shortCircuit that sounds like Caprica
 
@DaveRandom As far as reasons go for internet people to meet my wife, that's an okay one.
 
yeah. Caprica , duckduckgo . watevaz u want to compare to
 
@shortCircuit If you really want you could remove it from the DOM in the callback (I imagine jQ probably does) but honestly in a modern browser you'd probably have to do a lot before it would cause a problem, if it would at all - JSONp is so common these days that it wouldn't surprise me if browsers have idiot detectors built in
 
10:11 PM
ok
 
@Fabien That is epic
 
https://www.google.com/search?q=5+%2B+(-sqrt(1-x%5E2-(y-abs(x))%5E2))*sin(100*((10-x%5E2-(y-abs(x))%5E2)))%2C+x+is+from+-1+to+1%2C+y+is+from+-1+to+1.5%2C+z+is+from+1+to+6
FU Markdown
https://www.google.com/#q=exp((-(((x-4)%5E2%2B(y-4)%5E2)%5E2))%2F1000)%2Bexp((-(((x%2B4)%5E2%2B(y%2B4)%5E2)%5E2))%2F1000)%2B0.15*exp(-(((x%2B4)%5E2%2B(y%2B4)%5E2)%5E2))%2B0.15*exp(-(((x-4)%5E2%2B(y-4)%5E2)%5E2))&safe=off
LOL
 
Bed time. Night all.
 
nite
 
10:24 PM
/me sleeps nite all
 
10:41 PM
gn8
 
10:55 PM
@DaveRandom you there?
 
@shortCircuit approximately
 
oscargodson.com/posts/… i cannot understand a few parts of this code.
1. the lines of code in the function window[generatedFunction] .
2. window.JSONP = JSONP near the last line.
how are they executed?
 
link is incomplete...
 
OK give me a minute or two
 
11:00 PM
take your time :)
 
0
Q: Duplicates MKII, Canonicals, more aggressive duplicate prevention

Second RikudoThis question is another take on the duplicates problem. It steals is inspired by ideas from the verious posts and feature-reqeusts posted here on meta. Disclaimer: In this post, I am referring to the "Users" or "The People" or "The Gang" or "Everyone". What I actually mean is the bunch of folks...

 
@shortCircuit OK so do you know how array access syntax relates to object properties in JS?
As in, a.foo and a["foo"] refer to the same thing
 
yes. either array['name'] or array.name
i want to know how does it work.
 
right OK, so around point all you are really doing is assigning a function to a property of the window (i.e. global) object, this function calls the callback that was passed in and then deletes itself
The window.JSONP = JSONP; line is redundant, the same effect could be achieved by writing window.JSONP = function() ... instead of var JSONP = function() ...; window.JSONP = JSONP;
(that's not always true, but in this case it is)
@shortCircuit for the record, I would alter that slightly:
var jsonpScript = document.createElement('script');
window[generatedFunction] = function(json){
  callback(json);
  jsonpScript.parentNode.removeChild(jsonpScript);
  delete window[generatedFunction];
};

if(url.indexOf('?') === -1){ url = url+'?'; }
else{ url = url+'&'; }

jsonpScript.setAttribute("src", url+method+'='+generatedFunction);
document.getElementsByTagName("head")[0].appendChild(jsonpScript);
That way not only is the function self-deleting from the global scope, it also removes the associated <script> element from the DOM when it is called
 
ok. this makes more sense.
sorry. that was a bad question
 
11:13 PM
np
 
no but still
callback is still what we had in the parameter list. or is this a separate function as a whole
 
I'm using Laravel & the query builder. How can I define a custom key for the array returned?
 
The idea is that you are wrapping that callback that was in the parameter list, so that you can add extra functionality to it
 
I'm a total newbie to Laravel, so I wanted to run it by you guys first before I asked a question (and sounded like an idiot)
 
So basically you intercept the actual callback, call the function that user passed in, and perform some cleanup aftewards
 
11:16 PM
ok
 
@daviesgeek Not sure if you'll get any Laravel love in here (at the moment, at least, everyone is drunk and/or asleep)
 
@DaveRandom haha ok
:)
thanks
IRC is dead too :(
 
Yea, people with their "real lives" and shit
What losers
 
Lol haha
Oh I forgot, it's Friday…for some weird reason I thought it was Saturday
that's why!
 
Everybody know's on Friday night the real action is PHP programming in room 11
 
11:18 PM
@cspray inorite. On a totally unrelated subject, you've presumably finished work by now. Drink?
 
@DaveRandom I have finished work. I'm about to pop open the second brewski
 
@cspray that's when all the "real work" gets done ;)
 
@cspray Excellent. I'll skin up.
(if only :-()
 
in the example here.. JSONP('http://site.com','jsoncallback',function(json){ console.log(json) });
how is the callback(json) replaced in the window[generatedFunction] . this looks so confusing. :( , the wrapping part .
 
@shortCircuit a simpler example:
function foo(callback)
{
    callback(1);
}

foo(function(arg) {
    console.log(arg);
});
 
11:23 PM
@DaveRandom This must be some UK term
 
ok
icy
 
@cspray I'm reasonably certain it isn't
 
thanks
 
@shortCircuit all you are really doing is passing a function as an argument, and having the recieving function call it. This is quite an important pattern in JS because it's very async-oriented
 
@DaveRandom Well, I guess I'm just not cool enough to have ever heard it before :P
 
11:27 PM
@cspray It refers to the action of creating a cigarette using rolling papers ("skins"), narcotic in nature, from marijuana
 
yesh i see it now.
 
@DaveRandom Ah, I see
 
It's also something I happen to be fairly good at, if somewhat under practiced
 
@DaveRandom yeah, you certainly summed it up well.......fark not in before edit.
 
typing, on the other hand, is not something I am good at
@Danack Took me a second to get that. I think I need more to smoke.
 
11:32 PM
btw I'm currently on the ferry from France back to blighty - I really wish the bar didn't close at 12:30 when there's another 6 hours of journey to go.
 
@Danack That does stink. Although I wouldn't mind the whole "being in France" thing
 
@cspray France is unfortunately full of french people....
 
@Danack 12:30 UK (real) time?
 
@Danack This is very true. However, I want to visit Europe again now that I'm old enough to better appreciate it.
 
30 seconds ago.....they announce the bar is closing by dropping the shutters.
Luckily I was a boy scout.
 
11:35 PM
@Danack /cc @FlorianMargaine
:-P
 
4 cans in the bag - hey-YO
 
can that be called a closure? var JSONP exists outside the function.
 
@cspray I think I definitely prefer Germany - friendlier people, better beer, and sausage as far as the eye can see. NTTAGWT.
 
That's where I spent most of my time when I was in Europe.
Definitely wanna go back and visit a lot of it
 
@shortCircuit That's what a closure is - an anonymous function that inherits the parent scope at the time of declaration (it "closes over" the parent scope, hence the name)
 
11:37 PM
I actually wouldn't mind working in Europe for a couple years. Gain a different perspective on how things are done than just America. Hard to do that just visiting.
 
PHP doesn't actually have "real closures", the use() construct is a bit weird in that respect
 
@DaveRandom Yea, but I couldn't imagine PHP without anonymous functions
I got into PHP in 5.3 so when I see and hear about PHP 5.2- the one thing I'd miss the most would be anonymous functions.
 
isn't the use of use is to use variables that are in parent scope. i mean declared outside the function
 
Try imagining PHP without them, or visibility, or statics, or implicit by-ref passing of objects, and your entering the world of the last piece of code I wrote
 
@DaveRandom The by-ref passing of objects would also probably drive me insane
 
11:40 PM
(I've been writing for PHP4 this evening)
 
@DaveRandom I am so incredibly sorry. If I was close enough I'd skin one up for you
But alas you're an ocean away
I think I used that term correctly but it sounds way dirtier than it should
 
if i used window.JSONP = function(url,method,callback){..} would JSONP be still available in the parent scope?
 
No statics wouldn't bother me. I can't remember the last time I wrote a static method
 
Actually, as horrible as it is in many ways, it's kind of nice to be freed from the tyranny of visibility and static typing. Duck typing has its advantages, it makes you remember that sometimes "if you break it, you bought it" does actually work quite well
 
11:43 PM
I got into Ruby and write a little Ruby at work
The Duck typing is something I haven't gotten used to yet
 
@shortCircuit No, but it's not referenced in the inner scope
 
I like writing and designing interfaces and type hinting dependencies against them. Not doing that has been...hard
 
emm..
 
I also see so many examples of the first line being something along the lines of "throw errors unless obj is a T"
 
@cspray I do as well, and I totally get what you mean. And yes, it's nice to have the complier bollock you for Doing It Wrong™, but actually docblocks are all you (and your IDE) really needs
 
11:46 PM
Then what's really the point of Duck typing? I realize that's just a peculiarity of the system but seems like a symptom of other things as well
Well, I think it also helps with the code that you're calling as well
If I start saying "here's this object and the calling code can call whatever it wants on it" it just seems like it is enabling poor design
Of course that's just what works for me and I see the value in the Duck typing thing
 
@cspray The point is that you stop caring. You assume that the user passed in something sane, and if they didn't then it's their fault when they get a fatal. And if you want, you can call method_exists before you call something - but most of the time, if you are a dick then your code won't work. And you know why? It's because you're a dick.
 
Of course I think of it more from the context of Ruby where it really is the typing system and not something you adhere to on design principle
 
@DaveRandom I don't know. I guess I just don't buy into that argument. I've worked in multiple codebases and they're all pretty bad. Maybe I'm not a dick programmer and will treat your Duck just right. However, I don't know that the rest of the team or the people calling that code are just as much of a not-dick as I am.
But, again, I don't want to get into a religious argument about it either. I see the value in both and I know a lot of my arguments are just my bias kicking in :P
 
@cspray and I totally get that, and when I'm writing "normal" code I write for a baseline of 5.4 (shortly to become a baseline 5.5) and write strict type systems just like everyone else. But actually, for the average application where every contributor can be assumed to be using an IDE that can act as a compile-time type system, you don't need the engine to check for you.
 
11:53 PM
how is it not referenced in the inner-scope? because of (window) in the end?
 
@shortCircuit in essence:
 
@DaveRandom I hope I get to work in a codebase like that one day
 
yolo
 
0
Q: How can I set the array key returned by Laravel's query builder?

daviesgeekI have two tables, page and edit. page +----+-----------+ | id | page_name | +----+-----------+ | 1 | page | +----+-----------+ edit +----+---------+------+ | id | page_id | name | +----+---------+------+ | 1 | 1 | home | | 1 | 1 | side | +----+---------+------+ Right n...

trying to get this figured out. Anyone got ideas?
 
@CSᵠ For some reason that reminds me of some snack food in my area...Yolo Nuts. I'm just wondering why they decided to market their food product with that. The last thing I want to be thinking as I eat your food is "you only live once"
 
11:55 PM
function foo() {
    var f = function() {
        // if I referenced f in here, there would be a point in making it another var
    };
    // as long as I don't make reference to f inside these braces ^
    // there's no need to have the separate var
    window.f = f;
}
 
@cspray you only live once, so just eat our crap and whatevs...
 
@cspray Really? I would be quite happy to say "if you aren't using a sensible IDE, you deserve what you get"
 
ok.
where did you read all these!!
 
I have written a lot of JS in my time
 
anyone worked with mongodb?
i find the js engine inside it a quite interesting feature
wondering about performance still
 

« first day (1287 days earlier)      last day (3658 days later) »