Search Results

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

Page 57/1913 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • C# Visual Studio Unit Test, Mocking up a client IP address

    - by Jimmy
    Hey guys, I am writing some unit tests and I'm getting an exception thrown from my real code when trying to do the following: string IPaddress = HttpContext.Current.Request.UserHostName.ToString(); Is there a way to mock up an IP address without rewriting my code to accept IP address as a parameter? Thanks!

    Read the article

  • IP address of domain on shared host

    - by Ali
    I have domain on a shared hosting provider. How do I find the direct IP address of my domain using Python? Is it possible to post to a script on my domain using the IP address and not the website itself? Thanks.

    Read the article

  • Getting line by line in Apple Script from Address Books Note Field

    - by Axwack
    I have two lines in my address book's note field Test 1 Test 2 I would like to get each line as a separate value or get the last line from the notes field. I tried doing it this way: tell application "Address Book" set AppleScript's text item delimiters to "space" get the note of person in group "Test Group" end tell but the result is {"Test 1 Test 2"} I'm looking for : {"Test1","Test2"} What am I doing incorrect?

    Read the article

  • C instruction address

    - by aaa
    hello. Disclaimer, I not do anything in particular with regards this question, just curious. Is it possible to take address of instruction or block in C? in essence, is there jump equivalent in C? for example: void function() { int k; { // is a possible to go to this address from arbitrary point in code? int i, j; k += j+i; } } thank you

    Read the article

  • Is stack address shared by Heap addresses ??

    - by numerical25
    I read On most operating systems, the addresses in memory starts from highest to lowest. So I am wondering if the heap, stack, and global memory all fall under the same ordering..? If I created... pointerType* pointer = new pointerType //creates memory address 0xffffff And then created a local varible on the stack localObject object would localObjects address be 0xfffffe Or is heap and stack ordering completely different.

    Read the article

  • [C#] Get a domain name basing on the IP address

    - by Tony
    hi, I need to get a domain name if I have an IP address (e.g. I type 209.85.129.103 and the program should find out that is the Google address) As far as I've figured out is get the hostname: IPHostEntry IpToDomainName = Dns.GetHostEntry("209.85.129.103"); string HostName = IpToDomainName.HostName; //it returns "fk-in-f103.1e100.net" but it's not that I want. I don't know how to achieve that. Any ideas will be helpful

    Read the article

  • This code appears to achieve the return of a null reference in C++

    - by Chuck
    Hi folks, My C++ knowledge is somewhat piecemeal. I was reworking some code at work. I changed a function to return a reference to a type. Inside, I look up an object based on an identifier passed in, then return a reference to the object if found. Of course I ran into the issue of what to return if I don't find the object, and in looking around the web, many people claim that returning a "null reference" in C++ is impossible. Based on this advice, I tried the trick of returning a success/fail boolean, and making the object reference an out parameter. However, I ran into the roadblock of needing to initialize the references I would pass as actual parameters, and of course there is no way to do this. I retreated to the usual approach of just returning a pointer. I asked a colleague about it. He uses the following trick quite often, which is accepted by both a recent version of the Sun compiler and by gcc: MyType& someFunc(int id) { // successful case here: // ... // fail case: return *static_cast<MyType*>(0); } // Use: ... MyType& mt = somefunc(myIdNum); if (&mt) // test for "null reference" { // whatever } ... I have been maintaining this code base for a while, but I find that I don't have as much time to look up the small details about the language as I would like. I've been digging through my reference book but the answer to this one eludes me. Now, I had a C++ course a few years ago, and therein we emphasized that in C++ everything is types, so I try to keep that in mind when thinking things through. Deconstructing the expression: "*static_cast(0);", it indeed seems to me that we take a literal zero, cast it to a pointer to MyType (which makes it a null pointer), and then apply the dereferencing operator in the context of assigning to a reference type (the return type), which should give me a reference to the same object pointed to by the pointer. This sure looks like returning a null reference to me. Any advice in explaining why this works (or why it shouldn't) would be greatly appreciated. Thanks, Chuck

    Read the article

  • jQuery Address plugin: I want to manage the tracking on my own

    - by bfred.it
    I'm using the great (IMHO) jQuery Address plugin but it's been driving me insane since I didn't know that it automatically tracked the pages on Google Analytics. How do I keep it from doing it? I tried this but apparently it's never called. $.address.tracker(function(){console.log("hello")}) I guess I could somehow overwrite the function in the plugin but I hope there's a better way...

    Read the article

  • Django: Get bound IP address inside settings.py

    - by Silver Light
    Hello! I want to enable debug (DEBUG = True) For my Django project only if it runs on localhost. How can I get user IP address inside settings.py? I would like something like this to work: #Debugging only on localhost if user_ip = '127.0.0.1': DEBUG = True else: DEBUG = False How do I put user IP address in user_ip variable inside settings.py file?

    Read the article

  • Add image contact in address book

    - by Paska
    Hi all, how can i use kABPersonImageFormatThumbnail or something else to set an image to a contact in address book??? I want use a /resources file. Now i use ABMultiValueAddValueAndLabel(multiPhone, @"+39-02-1234567", kABWorkLabel, NULL); to set a value in address book. An image seems to be the same behavior, but what type need use? ABMultiValueAddValueAndLabel(multiPhone, ?????, kABPersonImageFormatThumbnail, NULL); Thanks A

    Read the article

  • Socket Programming : Inputstream Stuck in loop - read() always return 0

    - by Atom Skaa ska Hic
    Server side code public static boolean sendFile() { int start = Integer.parseInt(startAndEnd[0]) - 1; int end = Integer.parseInt(startAndEnd[1]) - 1; int size = (end - start) + 1; try { bos = new BufferedOutputStream(initSocket.getOutputStream()); bos.write(byteArr,start,size); bos.flush(); bos.close(); initSocket.close(); System.out.println("Send file to : " + initSocket); } catch (IOException e) { System.out.println(e.getLocalizedMessage()); disconnected(); return false; } return true; } Client Side public boolean receiveFile() { int current = 0; try { int bytesRead = bis.read(byteArr,0,byteArr.length); System.out.println("Receive file from : " + client); current = bytesRead; do { bytesRead = bis.read(byteArr, current, (byteArr.length-current)); if(bytesRead >= 0) current += bytesRead; } while(bytesRead != -1); bis.close(); bos.write(byteArr, 0 , current); bos.flush(); bos.close(); } catch (IOException e) { System.out.println(e.getLocalizedMessage()); disconnected(); return false; } return true; } Client side is multithreading,server side not use multithreading. I just paste some code that made problem if you want see all code please tell me. After I debug the code, I found that if I set max thread to any and then the first thread always stuck in this loop. That bis.read(....) always return 0. Although, server had close stream and it not get out of the loop. I don't know why ... But another threads are work correctly. do { bytesRead = bis.read(byteArr, current, (byteArr.length-current)); if(bytesRead >= 0) current += bytesRead; } while(bytesRead != -1);

    Read the article

  • Regarding address operator C/C++

    - by iSight
    Hi, What does address operator mean. say in the method below. what should be passed in the method as parameter value of integer or the address of an integer variable. void func1(int&)// method declaration void func1(int& inNumber)//method definition { //some code }

    Read the article

  • Accessing objects memory address in ruby..???

    - by levirg
    hey Folks, Is there any way in ruby to get the memory address of objects.. say.. (i = 5) is that possible to get the mem address of that object 5.. I have been trying to get this over some time.., Any answer would be really appreciated... thanks, Regards levirg

    Read the article

  • how to read mac address with sed vs python

    - by getjoefree
    before, i can read mac with awk tools in windows or winpe, but now it don't support winpe 4.0 64-bit. i want to get this result "set mac=A4BADB9D1E8E" with python 2.6, who could help to me. thanks a lot! 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

    Read the article

  • Unable to add IPv6 address to sendmail access list

    - by David M. Syzdek
    I am running Sendmail 8.14.4 on Slackware 13.37. I have the following in my /etc/mail/access file and it works without any errors: Connect:127 OK Connect:10.0.1 RELAY # Net: office Connect:50.116.6.8 RELAY # Host: glider Connect:96.126.127.87 RELAY # Host: kite The above configuration also allows me to send an e-mail via IPv6 to a local user on the mail server. However, it does not allow my office to relay via IPv6. I have tried two ways of adding IPv6 networks to my access file. Method 1: Connect:127 OK Connect:10.0.1 RELAY # Net: office Connect:IPv6:2001:470:b:84a RELAY # Net: office Connect:50.116.6.8 RELAY # Host: glider Connect:96.126.127.87 RELAY # Host: kite Method 2: Connect:127 OK Connect:10.0.1 RELAY # Net: office Connect:[IPv6:2001:470:b:84a] RELAY # Net: office Connect:50.116.6.8 RELAY # Host: glider Connect:96.126.127.87 RELAY # Host: kite However whenever I try using either method 1 or 2, I am unable to relay e-mail messages through the host. /var/log/maillog entry: May 31 11:57:15 freshsalmon sm-mta[25500]: ruleset=check_relay, arg1=[IPv6:2001:470:b:84a:223:6cff:fe80:35dc], arg2=IPv6:2001:470:b:84a:223:6cff:fe80:35dc, relay=[IPv6:2001:470:b:84a:223:6cff:fe80:35dc], reject=553 5.3.0 RELAY # Net:office Test session from telnet: syzdek@blackenhawk$ telnet -6 freshsalmon.office.example.com 25 Trying 2001:470:b:84a::69... Connected to freshsalmon.office.bindlebinaries.com. Escape character is '^]'. 220 office.example.com ESMTP Sendmail 8.14.4/8.14.4; Thu, 31 May 2012 11:57:15 -0800 HELO blackenhawk.office.example.com 250 office.example.com Hello [IPv6:2001:470:b:84a:223:6cff:fe80:35dc], pleased to meet you MAIL FROM:[email protected] 553 5.3.0 RELAY # Net:office What is the correct way to add an IPv6 address/network to the access file in sendmail? Update: Apparently my access file was not working regardless. Removing the comments at the end of the line seems to have fixed the problem. Here is the lines which worked: Connect:127 OK Connect:IPv6:::1 OK # Net: office Connect:10.0.1 RELAY Connect:IPv6:2001:470:b:84a RELAY # Host: glider Connect:50.116.6.8 RELAY Connect:IPv6:2600:3c01::f03c:91ff:fedf:381a RELAY # Host: kite Connect:96.126.127.87 RELAY Connect:IPv6:2600:3c00::f03c:91ff:fedf:52a4 RELAY

    Read the article

  • CentOS 5.8 dig is not resolving ip-address

    - by travisbotello
    I'm running centos 5.8 on a local machine at home. Today I was trying to analyze the DNS-Lookup via dig. $ dig +trace -t A www.heise.de. This is giving me something like this as a response de. 172800 IN NS f.nic.de. de. 172800 IN NS z.nic.de. de. 172800 IN NS s.de.net. de. 172800 IN NS n.de.net. de. 172800 IN NS a.nic.de. de. 172800 IN NS l.de.net. ;; Received 344 bytes from 192.58.128.30#53(192.58.128.30) in 49 ms In contrast my dedicated CentOS machine is returning the following de. 172800 IN NS a.nic.de. de. 172800 IN NS n.de.net. de. 172800 IN NS f.nic.de. de. 172800 IN NS z.nic.de. de. 172800 IN NS l.de.net. de. 172800 IN NS s.de.net. ;; Received 344 bytes from 192.58.128.30#53(j.root-servers.net) in 32 ms As you can see, the last line is different. Any idea why my dedicated machine is giving me the host name of the responding DNS-Server and my local machine is only returning the ip-address? Thanks in advance UPDATE The reverse DNS-Lookup is working without any problems. Also, I just checked this on my local mac and...exactly the same problem occurs. Is it possible that this has to do with the local router/modem/ISP?

    Read the article

  • How to return DropDownList selections dynamically in C#?

    - by salvationishere
    This is probably a simple question but I am developing a web app in C# with DropDownList. Currently it is working for just one DropDownList. But now that I modified the code so that number of DropDownLists that should appear is dynamic, it gives me error; "The name 'ddl' does not exist in the current context." The reason for this error is that there a multiple instances of 'ddl' = number of counters. So how do I instead return more than one 'ddl'? Like what return type should this method have instead? And how do I return these values? Reason I need it dynamic is I need to create one DropDownList for each column in whatever Adventureworks table they select. private DropDownList CreateDropDownLists() { for (int counter = 0; counter < NumberOfControls; counter++) { DropDownList ddl = new DropDownList(); SqlDataReader dr2 = ADONET_methods.DisplayTableColumns(targettable); ddl.ID = "DropDownListID" + (counter + 1).ToString(); int NumControls = targettable.Length; DataTable dt = new DataTable(); dt.Load(dr2); ddl.DataValueField = "COLUMN_NAME"; ddl.DataTextField = "COLUMN_NAME"; ddl.DataSource = dt; ddl.ID = "DropDownListID 1"; ddl.SelectedIndexChanged += new EventHandler(ddlList_SelectedIndexChanged); ddl.DataBind(); ddl.AutoPostBack = true; ddl.EnableViewState = true; //Preserves View State info on Postbacks //ddlList.Style["position"] = "absolute"; //ddl.Style["top"] = 80 + "px"; //ddl.Style["left"] = 0 + "px"; dr2.Close(); } return ddl; }

    Read the article

  • wsdl return an array of complex types

    - by Anand
    hi, I have defined a web service that will return the data from my mysql data base. I have written the web service in php. Now I have defined a complex type as follows: $server->wsdl->addComplexType( 'Category', 'complexType', 'struct', 'all', '', array( 'category_parent_id' => array('name' => 'category_parent_id', 'type' => 'xsd:int'), 'category_child_id' => array('name' => 'category_child_id', 'type' => 'xsd:int'), 'category_list' => array('name' => 'category_list', 'type' => 'xsd:int') ) ); The above complex type is a row in a table in my database. Now my function must send an array of these rows so how do I achieve the same My code is as follows: require_once('./nusoap/nusoap.php'); $server = new soap_server; $server-configureWSDL('productwsdl', 'urn:productwsdl'); // Register the data structures used by the service $server-wsdl-addComplexType( 'Category', 'complexType', 'struct', 'all', '', array( 'category_parent_id' = array('name' = 'category_parent_id', 'type' = 'xsd:int'), 'category_child_id' = array('name' = 'category_child_id', 'type' = 'xsd:int'), 'category_list' = array('name' = 'category_list', 'type' = 'xsd:int') ) ); $server-register('getaproduct', // method name array(), // input parameters //array('return' = array('result' = 'tns:Category')), // output parameters array('return' = 'tns:Category'), // output parameters 'urn:productwsdl', // namespace 'urn:productwsdl#getaproduct', // soapaction 'rpc', // style 'encoded', // use 'Get the product categories' // documentation ); function getaproduct() { $conn = mysql_connect('localhost','root',''); mysql_select_db('sssl', $conn); $sql = "SELECT * FROM jos_vm_category_xref"; $q = mysql_query($sql); while($r = mysql_fetch_array($q)) { $items[] = array('category_parent_id'=$r['category_parent_id'], 'category_child_id'=$r['category_child_id'], 'category_list'=$r['category_list']); } return $items; } // Use the request to (try to) invoke the service $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ''; $server-service($HTTP_RAW_POST_DATA);

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >