Search Results

Search found 47805 results on 1913 pages for 'return address'.

Page 4/1913 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Omit return type in C++0x

    - by Clinton
    I've recently found myself using the following macro with gcc 4.5 in C++0x mode: #define RETURN(x) -> decltype(x) { return x; } And writing functions like this: template <class T> auto f(T&& x) RETURN (( g(h(std::forward<T>(x))) )) I've been doing this to avoid the inconvenience having to effectively write the function body twice, and having keep changes in the body and the return type in sync (which in my opinion is a disaster waiting to happen). The problem is that this technique only works on one line functions. So when I have something like this (convoluted example): template <class T> auto f(T&& x) -> ... { auto y1 = f(x); auto y2 = h(y1, g1(x)); auto y3 = h(y1, g2(x)); if (y1) { ++y3; } return h2(y2, y3); } Then I have to put something horrible in the return type. Furthermore, whenever I update the function, I'll need to change the return type, and if I don't change it correctly, I'll get a compile error if I'm lucky, or a runtime bug in the worse case. Having to copy and paste changes to two locations and keep them in sync I feel is not good practice. And I can't think of a situation where I'd want an implicit cast on return instead of an explicit cast. Surely there is a way to ask the compiler to deduce this information. What is the point of the compiler keeping it a secret? I thought C++0x was designed so such duplication would not be required.

    Read the article

  • Difference between accessing a website using Local host and IP address

    - by Cdeez
    I have developed an ASP.NET website and deployed into my IIS server. Now to see that my IIS is installed fine, I type local host in my address bar, and I get the welcome screen of IIS and its documentation in a separate window. Now I gave the url of my website http://localhost/mysites/site2/Default.aspx I access my site. Also giving my IP address instead of local host like: http://192.168.1.46/mysites/site2/Default.aspx also works. Just out of curiosity I wanted to see what happens when I give my IP address in addressbar. It asks me a user name and password saying:The server 192.168.1.46:80 requires a user name and password. I donot know what user name and password it is asking, and as of my knowledge I thought localhost points to my own IP address internally. But what is the difference and also what username and password do I need for it? Update: On chrome and IE just giving localhost displays the welcome screen, but on mozilla, localhost is also asking for a username and password.

    Read the article

  • Method return values and exceptions

    - by dnagirl
    I have an interface called iIncident which defines a single method when(). when() should return a DateTime object. I'm trying to decide what to do if $object->when() has no DateTime to return as might be the case just after an object is instantiated and before all its properties are set. My choices are: return false throw some kind of Exception return some default DateTime like '9999-01-01' My inclination is to go with an Exception since $object really can't act as an incident until it knows when it occurred. I don't want to return a default DateTime because it complicates comparisons and it's not true. And I don't really want to return false because then I have to check for it every time I call the method- but if that is the preferred method, I guess I will. Is throwing an exception the best way? And is there a predefined exception type I should use (none of the SPL ones struck me as particularly appropriate- but that might just indicate my lack of experience)?

    Read the article

  • Return from parent sub in Perl

    - by JS Bangs
    I want to write a subroutine which causes the caller to return under certain conditions. This is meant to be used as a shortcut for validating input to a function. What I have so far is: sub needs($$) { my ($condition, $message) = @_; if (not $condition) { print "$message\n"; # would like to return from the *parent* here } return $condition; } sub run_find { my $arg = shift @_; needs $arg, "arg required" or return; needs exists $lang{$arg}, "No such language: $arg" or return; # etc. } The advantage of returning from the caller in needs would then be to avoid having to write the repetitive or return inside run_find and similar functions.

    Read the article

  • Permanently change IP address on SuSE 10

    - by Long Ngo
    I am trying to change IP address of a SuSE 10 machine that is running Tomcat. I need to create a shell script to do this so could not use YaST. As some sites suggested on my Google search, I edited the files in /etc/sysconfig/network/ifcfg-eth-* to change the IP address. After that, I restarted the network service by calling /etc/init.d/network restart. The network card restarting just fine. I, then, restarted tomcat web service. However, when I browsed the new IP address using browser, I got an "Request denied" message. Can anyone please tell me how I could do this? Thanks

    Read the article

  • Help changing MAC address in Windows 7 [closed]

    - by Niphoet
    Possible Duplicate: Change MAC Address I need to change the MAC address of my wireless adapter in Windows 7 (Ultimate RTM). I used to do this in XP both directly in the registry editor and with a .REG file I wrote. I have used each of these methods in Windows 7, as well as a few tools I found that are supposed to do this. Every time I change it, I disable and re-enable the network adapter in control panel, but upon running ipconfig /all it still shows my old MAC address. Any help? By the way, I do have Administrative Rights and UAC turned off.

    Read the article

  • Binding MySQL to run from the public or private LAN IP address - which one is faster

    - by Lamin Barrow
    So we have 2 servers all running at the same web host. We have bind MySQL to listen on the public ip-address of the database server and the web server connects to it from the public ip. Both servers run on the same private network. Currently, the DB connect method from our php script takes about 3ms to connect to the MySQL database server host. My question is, would MySql data interaction from the web server be faster if we bind it to listen on the private lan address on the database server instead of the public IP? or is it the same regardless and it wont make a different. i have moved this question to server fault http://serverfault.com/questions/438156/binding-mysql-to-run-from-the-public-or-private-lan-ip-address-which-one-is-fa

    Read the article

  • Apache configuration: choose a site to display according to visitor's IP address

    - by user64294
    Hi all. I would like to set a special configuration in our apache web server. I would like to display sites to the users according their IP addresses. We plan to upgrade our web sites. During the upgrade we'll put a maintenance site: so all the users which will connect to our web sites will get this site. but in order to test the upgrade i need to set apache to let only my IP address to access to asked site. If my IP address is a.b.c.d and if i ask for test_dot_com i want to see it. but all other users, having a different IP address, should get the maintenane site even if they look for test_dot_com. Is there a way to do this? PS: sorry As i'm a new user i can't use more than one link. so test_dot_com = test.com Thank you.

    Read the article

  • Detect an IP address of a Wireless Access Point device

    - by dempap
    I have a Wireless Access Point device (http://www.szedup.com/show.aspx?id=1706), which I am planning to put into BeagleBoard-xM, in order to achieve wireless communication (LAN). However, I can't find it's IP address. I mean, I have to know it's IP address in order to connect with BeagleBoard-xM via a terminal emulator. For the moment, I have this device connected via Ethernet on my router. My router's setting page shows I have this device connected, but no further information. Is there any way to find the IP address of the Wireless Access Point? I hope of being understood. Any help would be really appreciated.

    Read the article

  • Accessing server by dedicated IP address

    - by Sherwin Flight
    I'm having an issue with my hosting provider after migrating to a new account. It's taking some time to get the problem sorted out, so I am hoping someone here can shed some light on the situation. The server is running WHM/cPanel, and the site I am trying to access has a dedicated IP address. When I connect to the server like this http://IP.HERE instead of showing my the website the way I would expect, it is showing the contents of a subfolder. So, while I would expect it to load public_html/ it is loading public_html/somefolder/ instead. Any idea why this is happening instead of showing the sites homepage the way I would expect? EDIT It is not redirecting, so the url is just http://IP.ADDRESS/, but the files listed are from a subfolder. So, it LOOKS at though I went to http://IP.ADDRESS/subfolder, when the URL says it should be showing the main folder contents. When I access the site using the domain name, it works properly, so I assume the document root is set correctly.

    Read the article

  • How to model an address type in DDD?

    - by Songo
    I have an User entity that has a Set of Address where Address is a value object: class User{ ... private Set<Address> addresses; ... public setAddresses(Set<Address> addresses){ //set all addresses as a batch } ... } A User can have a home address and a work address, so I should have something that acts as a look up in the database: tbl_address_type ------------------------------------------------ | address_type_id | address_type | ------------------------------------------------ | 1 | work | ------------------------------------------------ | 2 | home | ------------------------------------------------ and correspondingly tbl_address ------------------------------------------------------------------------------------- | address_id | address_description |address_type_id| user_id | ------------------------------------------------------------------------------------- | 1 | 123 main street | 1 | 100 | ------------------------------------------------------------------------------------- | 2 | 456 another street | 1 | 100 | ------------------------------------------------------------------------------------- | 3 | 789 long street | 2 | 200 | ------------------------------------------------------------------------------------- | 4 | 023 short street | 2 | 200 | ------------------------------------------------------------------------------------- Should the address type be modeled as an Entity or Value type? and Why? Is it OK for the Address Value object to hold a reference to the Entity AdressType (in case it was modeled as an entity)? Is this something feasible using Hibernate/NHibernate? If a user can change his home address, should I expose a User.updateHomeAddress(Address homeAddress) function on the User entity itself? How can I enforce that the client passes a Home address and not a work address in this case? (a sample implementation is most welcomed) If I want to get the User's home address via User.getHomeAddress() function, must I load the whole addresses array then loop it and check each for its type till I found the correct type then return it? Is there a more efficient way than this?

    Read the article

  • How to correctly calculate address spaces?

    - by user337308
    Below is an example of a question given on my last test in a Computer Engineering course. Anyone mind explaining to me how to get the start/end addresses of each? I have listed the correct answers at the bottom... The MSP430F2410 device has an address space of 64 KB (the basic MSP430 architecture). Fill in the table below if we know the following. The first 16 bytes of the address space (starting at the address 0x0000) is reserved for special function registers (IE1, IE2, IFG1, IFG2, etc.), the next 240 bytes is reserved for 8-bit peripheral devices, and the next 256 bytes is reserved for 16-bit peripheral devices. The RAM memory capacity is 2 Kbytes and it starts at the address 0x1100. At the top of the address space is 56KB of flash memory reserved for code and interrupt vector table. What Start Address End Address Special Function Registers (16 bytes) 0x0000 0x000F 8-bit peripheral devices (240 bytes) 0x0010 0x00FF 16-bit peripheral devices (256 bytes) 0x0100 0x01FF RAM memory (2 Kbytes) 0x1100 0x18FF Flash Memory (56 Kbytes) 0x2000 0xFFFF

    Read the article

  • Where is a good Address Parser

    - by Brig Lamoreaux
    I'm looking for a good tool that can take a full mailing address, formatted for display or use with a mailing label, and convert it into a structured object. So for instance: // Start with a formatted address in a single string string f = "18698 E. Main Street\r\nBig Town, AZ, 86011"; // Parse into address Address addr = new Address(f); addr.Street; // 18698 E. Main Street addr.Locality; // Big Town addr.Region; // AZ addr.PostalCode; // 86011 Now I could do this using RegEx. But the tricky part is keeping it general enough to handle any address in the world! I'm sure there has to be something out there that can do it. If anyone noticed, this is actually the format of the opensocial.address object.

    Read the article

  • C++ return a "NULL" object if search result not found

    - by aduric
    I'm pretty new to C++ so I tend to design with a lot of Java-isms while I'm learning. Anyway, in Java, if I had class with a 'search' method that would return an object T from a Collection< T that matched a specific parameter, I would return that object and if the object was not found in the collection, I would return a NULL. Then in my calling function I would just check if(T != NULL) { ... } In C++, I'm finding out that I can't return a NULL if the object doesn't exist. I just want to return an 'indicator' of type T that notifies the calling function that no object has been found. I don't want to throw an exception because it's not really an exceptional circumstance. class Node { .... Attr& getAttribute(const string& attribute_name) const { //search collection //if found at i return attributes[i]; //if not found return NULL; } private: vector<Attr> attributes; }

    Read the article

  • Use external inline script as local function

    - by Aidan
    Had this closed once as a duplicate, yet the so-called duplicate DID NOT actually address my whole question. I have found this script that, when run inline, returns your IP. <script type="text/javascript" src="http://l2.io/ip.js"></script> http://l2.io/ip.js Has nothing more than a line of code that says document.write('123.123.123.123'); (But obviously with the user's IP address) I want to use this IP address as a return string for a function DEFINED EXTERNALLY, BUT STILL ON MY DOMAIN. That is, I have a "scripts.js" that contains all the scripts I wish to use, and I would like to include it in that list as a local function that calls to the 12.io function, but javascript won't allow the < tags, so I am unsure as to how to do this. I.e. function getIP() { return (THAT SCRIPT'S OUTPUT); } This is the topic this was supposedly a duplicate of, and it is very similar. Get ip address with javascript However, this DOES NOT address defining as a forwarded script it in my own script file.

    Read the article

  • How to read MAC address with python

    - by getjoefree
    Earlier, I could read MAC address with awk tools in Windows or Windows PE 4.0, but now it don't support Windows PE 4.0 64-bit. I want to get this result "set mac=A4BADB9D1E8E" with python 2.6, who could help to me. As follows: ipconfig -all|sed -nrf getmac.sed | sed -e "s/-//g" > D:\LOG\WINMAC.BAT getmac.sed: /Realtek/ { n; s/.*: ([-0-9A-F]+)/set winmac=\1/p; } and "ipconfig -all" command log as bellows ipconfig -all >mac.log Ethernet adapter Ethernet: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : WKSCN.WISTRON Description . . . . . . . . . . . : Realtek PCIe FE Family Controller Physical Address. . . . . . . . . : 24-B6-FD-1F-41-E7 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes --------------------------------------- we can get Physical Address when plug in lan cable, but not plug the network cable, it is impossible to obtain IP address.

    Read the article

  • Bind an ip address to Postfix as outgoing ip

    - by jack
    Is that possible to bind all available public ip addresses on a server to one Postfix instance as its outgoing ip pool and let it choose a random ip or specified ip from the pool each time it sends out an email? If above is not possible, can it be configured to listen on one public ip address per instance and each time it delivers a message, it use the binded one as outgoing ip address.

    Read the article

  • Get a user's current IP address from Skype

    - by Jonathan.
    This is assuming that you (/police/ISP) can get the [rough] location of a laptop based on IP address. If your laptop is stolen, and the thief unwittingly connects it to the Internet, and you have Skype on the laptop could you get the public IP address of the laptop and then go to the police and get it tracked? Or activate the webcam to see the surroundings, but without having Skype ring/notify the user?

    Read the article

  • Selecting which IP address to use for outgoing requests from behind a NAT

    - by iamrohitbanga
    Our organization has several external IP addresses. I am behind 2 layers of NAT and the servers choose which IP address to route my traffic to. Can I specify which IP address to use when finally leaving the organizations network. I know that source routing can be done in IPv4 by adding some options in the header. But can I configure my PC to add these options automatically. I have both a Windows and a Linux Machine.

    Read the article

  • http in web browser address bar

    - by Kumar P
    If we type a domain name in web browser address bar, How it will be add default ? Ex. If i type linkedin.com in web browser address bar, How it will be add www and http:// ----- http://www.linkedin.com/ ....... If i didn't mention ftp also it will add automatically add ftp://...... Based on what concept, it will work. I know it basic and simple question. But please tell about it as clear as possible

    Read the article

  • Spoof Mac Address from ip command.

    - by GuyNoir
    I'm trying to spoof my Mac Address on a modified version of linux (Android). The main problem is that because it has been stripped down, the ifconfig command has been stripped out, and I only can use the 'ip' busybox command. I've been trying to use ip link set address xx:xx:xx:xx:xx:xx dev tiwlan0 but I get the error, ip: socket: Operation not permitted Any help?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >