router

Finding out distance between router and receiver?

懵懂的女人 提交于 2019-12-01 06:39:37
A general question: is it possible to retrieve information about how far away e.g. a computer is from a wifi-router. For instance I want to get data on my computer if I'm 10 meters away from my home-wifispot or 2 meters. Any idea if that is even possible? Edit: How about bluetooth? Is it possible to get information about how far away bluetooth-connected devices are one from another? I would recommend a measuring line or just good-old-fashioned guesstimating. There is no "simple" way to do it (complex ways may involve building "accurate" signal maps ahead of time or trying to fit a better

How to inject data into Angular2 component created from a router?

人盡茶涼 提交于 2019-12-01 05:15:15
I'm currently trying to build an Angular2 prototype (based on alpha44) of our Angular1 app (pretty complex one) and I'm trying to find the best model/data architecture when using routes and child routes. In my example, from a child component created from a route, I want to access a property of the parent component (hosting the router-outlet ). But when you create a component from a router-outlet , you cannot use @Input and @Output anymore. So what is the best practice to inject some data/properties, except basic routeParams and static routeData ? How do you communicate with the parent

For how long a router keeps records in the NAT and can they be reused forwarding requests from other hosts?

▼魔方 西西 提交于 2019-12-01 04:41:24
There is an answer explaining in simple terms how a router works translating requests from the local network to outside and back ( https://superuser.com/questions/105838/how-does-router-know-where-to-forward-packet ) what is not clear - for how long a record in the NAT is kept? For example, if I send a UDP request to 25.34.11.56:3874 and my local endpoint is 192.168.1.21:54389 the router rewrites the request packet and adds a record to the NAT. Let's say the external endpoint will be 68.55.32.89:34535. Then the computer which received my request responds to the 68.55.32.89:34535 and the packet

Case Insensitive Routing in CodeIgniter

大憨熊 提交于 2019-12-01 04:25:56
问题 I've written this in the CodeIgniter's routers. $route['companyname'] = "/profile/1"; This is working fine but when I type "CompanyName" into the URL then it doesn't work. This is because upper case characters. I want to make this routing case insensitive. Please suggest the best way. 回答1: Just add expression " (?i) " Here example: $route['(?i)companyname'] = "/profile/1"; 回答2: If you want case-insensitive routing for all routes, you just need to extend CI_Router class, then modify _parse

ZF2: Get module name (or route) in the application layout for menu highlight

假如想象 提交于 2019-12-01 04:25:32
How can I get in ZF2 the current (selected) module name in the application layout? Purpose: My application layout include the main menu of the zf2 app, and every time a module is selected I need to highlight the menu voice of the module. Also I need to set the correct route (url, action) when the menu is made with this for. Every module has a menu voice: <ul class="nav"> <?php foreach ($menu_modules as $mod): $is_active = ($mod['name'] == $CURRENT_MODULE_NAME)?'selected':'';//GET MODULE NAME ?> <!-- class="active" --> <li><a href="#" <?php echo $is_active;?> ><?php echo $mod['title']; ?></a><

android socket programming behind a router

五迷三道 提交于 2019-12-01 03:59:55
Hey guys I have a question or problem. I am trying to make a p2p connection between two android phones. I have each phone connect to my server and I get their private (192.168.1.1) and public (76.123.288.22) IP and along with the ports that they connect to my server. I send a response when the phone connects to the server to open a server socket with a specific port. I also send the other phone the public IP and port of the open socket, but it does not connect. I have read multiple threads on here that it is not possible to do p2p connection if both phones or computers are behind two different

android socket programming behind a router

巧了我就是萌 提交于 2019-12-01 01:10:11
问题 Hey guys I have a question or problem. I am trying to make a p2p connection between two android phones. I have each phone connect to my server and I get their private (192.168.1.1) and public (76.123.288.22) IP and along with the ports that they connect to my server. I send a response when the phone connects to the server to open a server socket with a specific port. I also send the other phone the public IP and port of the open socket, but it does not connect. I have read multiple threads on

Property 'url' does not exist on type 'Event' for Angular2 NavigationEnd Event

谁说我不能喝 提交于 2019-11-30 20:23:59
this.subscription = this.router.events.subscribe((event:Event) => { console.log(event.url); ##### Error : Property 'url' does not exist on type 'Event'. } Typescript doesn't recognize the properties of the type Event that is built into the Angular Router. Is there something on tsd that I can use to solve this? Event is the super class of classes NaviagationEnd, NavigationStart You have to import { Event } from @angular/router; . Try moving console into the if block with condition. this.subscription = this.router.events.subscribe((event:Event) => { if(event instanceof NavigationEnd ){ console

Android port forwarding

ぃ、小莉子 提交于 2019-11-30 15:29:35
问题 How can I make a port forwarding from a android device to router using the IP from another device? I want to connect from android device externally to a routers public ip:port so that I can access the hardware device that is connected to the router.(Android -> external IP:Port) -> Router -> hardware Device(hardware device has its own IP and mac). Code: PortMapping mapping = new PortMapping(); UnsignedIntegerTwoBytes externalPort = new UnsignedIntegerTwoBytes(22555L); UnsignedIntegerTwoBytes

Backbone router with multiple parameters

馋奶兔 提交于 2019-11-30 14:15:47
I need to get this to work: routes: { ':product' : 'showProduct', ':product/:detail': 'showProductDetail' showProductDetail never gets called while the ':product' route is set even if it is set afterwards. I tried the following routes: { ':product(/:detail)': showProductOrDetail } But this will not get called when only the second parameter changes. It is important that I have the product itself or the product and detail in the url . Does anyone know how to fix this? There's a little hacky solution to your problem. I have a feeling there is a nicer way to do this but that should work: routes: {