@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)
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
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...
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
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
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
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
@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)
@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!
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
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
@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
@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.
@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
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
@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 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
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
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?
@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
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?
This 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...
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:
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 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
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.
@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)
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.
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
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
@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
@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.
@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.
I 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...
@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"
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;
}