Search Results

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

Page 12/1913 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • IP Address Validation Help

    - by Zubair1
    I am using this IP Validation Function that I came across while browsing, it has been working well until today i ran into a problem. For some reason the function won't validate this IP as valid: 203.81.192.26 I'm not too great with regular expressions, so would appreciate any help on what could be wrong. If you have another function, I would appreciate if you could post that for me. The code for the function is below: public static function validateIpAddress($ip_addr) { global $errors; $preg = '#^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}' . '(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$#'; if(preg_match($preg, $ip_addr)) { //now all the intger values are separated $parts = explode(".", $ip_addr); //now we need to check each part can range from 0-255 foreach($parts as $ip_parts) { if(intval($ip_parts) > 255 || intval($ip_parts) < 0) { $errors[] = "ip address is not valid."; return false; } return true; } return true; } else { $errors[] = "please double check the ip address."; return false; } }

    Read the article

  • Does Mac address base restriction is possible over Internet???

    - by sahil
    Hi Frineds, I want to restrict the access into my server on MAC Address base over internet... does it possible??? or there any other way of restriction over internet instead of IP address possible?? (My users are connection into my adito base ssl vpn server and i want to give them access on base of MAC address or any other possible method not by there IP address...because they are on roaming Internet IP. thanking you, sahil.

    Read the article

  • wget return downloaded filename

    - by Matthew
    I'm using wget in a php script and need to get the name of the file downloaded. For example, if I try <?php system('/usr/bin/wget -q --directory-prefix="./downloads/" http://www.google.com/'); ?> I will get a file called index.html in the downloads directory. The page will not always be google though, so I need to find out the name of the file that was downloaded. I'd like to have something like this: <?php //Does not work: $filename = system('/usr/bin/wget -q --directory-prefix="./downloads/" http://www.google.com/'); //$filename should contain "index.html" ?>

    Read the article

  • ABGroupAddMember - Cannot Add Contact to Group (iPhone Address Book)

    - by cookeecut
    Hi, I wonder if someone can help me out on this: I'm writing some code to copy a set of contacts received through a web application into the Address Book. I want to put all these new contacts under a certain group. My code successfully creates the group and adds the contacts into the address book. However, the 'ABGroupAddMember' operation fails. It fails without an error and the result it returns is true, meaning that according to the debugger the contact should have been added to the group. However, this does not work. The portion of my loop code that adds the contact to the address book and then assigns it to the group is this: ABAddressBookAddRecord(addressBook,person, &anError); ABAddressBookSave(addressBook,&anError); ABGroupAddMember(fusionLiveGroupRef,person, &anError); ABAddressBookSave(addressBook,&anError); All references are valid. No errors are returned. All operations return true. What is going wrong?

    Read the article

  • Python print statement prints nothing with a carriage return

    - by Jonathan Sternberg
    I'm trying to write a simple tool that reads files from disc, does some image processing, and returns the result of the algorithm. Since the program can sometimes take awhile, I like to have a progress bar so I know where it is in the program. And since I don't like to clutter up my command line and I'm on a Unix platform, I wanted to use the '\r' character to print the progress bar on only one line. But when I have this code here, it prints nothing. # Files is a list with the filenames for i, f in enumerate(files): print '\r%d / %d' % (i, len(files)), # Code that takes a long time I have also tried: print '\r', i, '/', len(files), Now just to make sure this worked in python, I tried this: heartbeat = 1 while True: print '\rHello, world', heartbeat, heartbeat += 1 This code works perfectly. What's going on? My understanding of carriage returns on Linux was that it would just move the line feed character to the beginning and then I could overwrite old text that was written previously, as long as I don't print a newline anywhere. This doesn't seem to be happening though. Also, is there a better way to display a progress bar in a command line than what I'm current trying to do?

    Read the article

  • Pick Return Values of Stored Procedure

    - by Juergen
    Hi, I have a stored procedure that returns a result with 250!!! columns. But I only need 3 out of the 250. I want to call the SP and put only the 3 column values in a temp table. I don't want to define a temp table with 250 columns! This is how I would like to do it, but this doesn't work of course: create #myTempTable (id int, value1 int, value2 int) insert into #myTempTable exec myBigFatStoredProc Can it be done anyhow? Bye Juergen

    Read the article

  • Getting base address of a process

    - by yoni0505
    I'm trying to make a program that read the timer value from Minesweeper. (OS is windows 7 64bit) Using cheat engine I found the base address of the variable, but it changes every time I run Minesweeper. What do I need to do to find out the base address automatically? Does it have something to do with the executable base address? Here's my code: #include <windows.h> #include <iostream> using namespace std; int main() { DWORD baseAddress = 0xFF1DAA38;//always changing DWORD offset1 = 0x18; DWORD offset2 = 0x20; DWORD pAddress1; DWORD pAddress2; float value = 0; DWORD pid; HWND hwnd; hwnd = FindWindow(NULL,"Minesweeper"); if(!hwnd)//didn't find the window { cout <<"Window not found!\n"; cin.get(); } else { GetWindowThreadProcessId(hwnd,&pid); HANDLE phandle = OpenProcess(PROCESS_VM_READ,0,pid);//get permission to read if(!phandle)//failed to get permission { cout <<"Could not get handle!\n"; cin.get(); } else { ReadProcessMemory(phandle,(void*)(baseAddress),&pAddress1,sizeof(pAddress1),0); ReadProcessMemory(phandle,(void*)(pAddress1 + offset1),&pAddress2,sizeof(pAddress2),0); while(1) { ReadProcessMemory(phandle,(void*)(pAddress2 + offset2),&value,sizeof(value),0); cout << value << "\n"; Sleep(1000); } } } }

    Read the article

  • Returning superclass of return type from remote EJB method

    - by fish
    Let's say I have remote interface A: @Remote public interface A { public Response doSomething(); } And implementation: @Stateless public class B implements A { public BeeResponse doSomething() {...} } Where: BeeResponse extends Response. Response is located in the EJB-API jar and BeeResponse is in the implementation jar. Response and BeeResponse have different serialVersionUID. My assumption is that the unmarshalling of the response from B will fail, am I correct?

    Read the article

  • Rails 4 json return on API

    - by El - Key
    I'm creating an API on my application. I currently overrided the as_json method in my model in order to be able to get attached files as well as logo from Paperclip : def as_json( options = {} ) super.merge(logo_small: self.logo.url(:small), logo_large: self.logo.url(:large), taxe: self.taxe, attachments: self.attachments) end Then within my controller, I'm doing : def index @products = current_user.products respond_with @products end def show respond_with @product end The problem is that on the index, I don't want get all the attachments. I only need it on the show method. So I tried it : def index @products = current_user.products respond_with @products, except: [:attachments] end But unfortunately it's not working. How can I do to not send :attachments? Thanks

    Read the article

  • multiple return values from PHP with jQuery AJAX

    - by benhowdle89
    I'm using this jQuery code: $.ajax ({ type: "POST", url: "customerfilter.php", data: dataString, cache: false, success: function(html) { $(".custName").html(html); } }); How can i do something like this: $(".projDesc").html(html1); So i can split the returned results into two html elements? echo "<p>" .$row['cust_name']. "</p>"; thats the PHP i'm using and i want to echo another statement which i can put into another HTML element Does this make sense?

    Read the article

  • Scala return type for tuple-functions

    - by Felix
    Hello Guys, I want to make a scala function which returns a scala tuple. I can do a function like this: def foo = (1,"hello","world") and this will work fine, but now I want to tell the compiler what I expect to be returned from the function instead of using the built in type inference (after all, I have no idea what a (1,"hello","world") is) I thought I remembered the classname being something like Tuple3[Int,String,String] but that doesnt work for me. Suggestions? :D (ps: I love stack overflow!)

    Read the article

  • How to return a value into webpage

    Hello: I have a simple webpage that displays the credit balance for calling cards. So far without any problems, with HTML, PHP and mysql, I was able to retrieve the balance from a data base. But I have to display the result in ANOTHER PAGE, wich looks akward because the page must reload. Can I just load this value into a pre-drawed field under the input fields that collect the data from the customer? Such as : Account Number: 134556 PIN: * |send| Balance is: $12.36 Thanks in advanced

    Read the article

  • SQL Server Stored Procedure that return processed records number

    - by Ras
    I have a winform application that fires a Stored Procedure which elaborates several records (around 500k). In order to inform the user about how many record have been processed, I would need a SP which returns a value every n records. For example, every 1000 row processed (most are INSERT). Otherwise I would be able only to inform when ALL record are processed. Any hints how to solve this? I thought it could be useful to use a trigger or some scheduled task, but I cannot figure out how to implement it.

    Read the article

  • Rails how to return a list of answers with a specific question_id

    - by mytwocentsisworthtwocents
    Let's say I have two Models, Answers and Questions (there are others, but irrelevant to the question). The models are as follows: Answer.rb class Answer < ActiveRecord::Base attr_accessible :description, :question_id has_one :question, :through => :user, :dependent => :destroy validates :description, :presence => true end Question.rb class Question < ActiveRecord::Base attr_accessible :budget, :description, :headline, :user_id, :updated_at, :created_at belongs_to :user has_many :answers validates :headline, :description, :user_id, :presence => true end I'd like to display on a page a list of all answers associated with a question, and only those questions. I got this far. I believe this variable finds all the questions in the database by the question_id (foreign key): @findanswers = Answer.all(params[:question_id]) And this one grabs the the id of the current question (this code will reside as an ERB on the page where the current question is located): @questionshow = Question.find(params[:id]) And now I'm stuck. How do I put the two together so that I list all the answers with the current question id?

    Read the article

  • PowerShell function won't return object

    - by Dan
    I have a simple function that creates a generic List: function test() { $genericType = [Type] "System.Collections.Generic.List``1" [type[]] $typedParameters = ,"System.String" $closedType = $genericType.MakeGenericType($typedParameters) [Activator]::CreateInstance($closedType) } $a = test The problem is that $a is always null no matter what I try. If I execute the same code outside of the function it works properly. Thoughts?

    Read the article

  • Prolog returns Out = _G431 when it suppose to return a list of lists

    - by Mandah
    createSchedule([[math109]], fall, Out). [[cs485, cs485], [cs355, cs355, cs462, cs462, cs462], [cs345, cs345, cs352, cs352, cs352, cs362, cs362, cs362, cs396, cs396, cs396], [cs330, cs330, cs330], [cs255, cs255, cs255, cs268, cs268], [math114, cs245, cs245], [math112, cs145, cs146], [math109]] Out = _G431 this is what prolog returns and the list of lists is shown by using write(Out) in prolog. Any ideas why it is showing this? Thanks

    Read the article

  • How to copy the shipping address to billing address

    - by Jerry
    Hi all I like to know if I can copy the shipping address to billing address. I got most of the parts done but I am not sure how to copy select menu (states) value to billing address. I really appreciate any helps. My code $(document).ready(function(){ Jquery $('#same').click(function(){ if($('#same').attr('checked')){ $('#bfName').val($('#fName').val()); $('#blName').val($('#lName').val()); $('#baddress1').val($('#address1').val()); $('#baddress2').val($('#address2').val()); $('#bcity').val($('#city').val()); alert(($('#state option:selected').val())); //not sure what to do here $('#bzip').val($('#zip').val()); }; }); Html <td><select name="state"> //shipping states......only partial codes. <option value="">None <option value="AL">Alabama <option value="AK">Alaska <option value="AZ">Arizona <option value="AR">Arkansas <option value="CA">California <option value="CO">Colorado <option value="CT">Connecticut </select></td> <td><select name="bstate"> //billing state................only partial codes. <option value="">None <option value="AL">Alabama <option value="AK">Alaska <option value="AZ">Arizona <option value="AR">Arkansas <option value="CA">California <option value="CO">Colorado <option value="CT">Connecticut </select></td> Thanks a lot!

    Read the article

  • Allocated memory address clash

    - by Louis
    Hi, i don't understand how this happen. This is portion of my code.. int isGoal(Node *node, int startNode){ int i; . . } When i debug this using gdb i found out that 'i' was allocated at the memory address that have been previously allocated. (gdb)print &node->path->next $26 = (struct intNode **) 0xffbff2f0 (gdb) print &i $22 = (int *) 0xffbff2f0 node-path-next has been already defined outside this function. But as u can see they share the same address which at some point make the pointer point to another place when the i counter is changed. I compiled it using gcc on solaris platform Any helps would be really appreciated..

    Read the article

  • If an visitors IP address contains "google" or a similar keyword, does this mean they were a crawler?

    - by Roscoe
    Hi, I have a huge list of IP addresses recorded from various visitors to a website. A huge amount of the visitors, in some months over 70%, came from IP addresses that contained keywords such as google, yahoo, bot, crawler, etc. Does this mean that those users were infact search engine crawlers? If so, why are their so many crawlers in my visitor records in comparison to genuine human visitors? (and if not what's the explanation?) Thanks in advance.

    Read the article

  • How can I compile an IP address to country lookup database to make available for free?

    - by Nick
    How would I go about compiling an accurate database of IP addresses and their related countries to make available as an open source download for any web developer who wants to perform a geographic IP lookup? It seems that a company called MaxMind has a monopoly on geographic IP data, because most online tutorials I've seen for country lookups based on IP addresses start by suggesting a subscription to MaxMind's paid service (or their less accurate free 'Lite' version). I'm not completely averse to paying for their solution or using the free one, but the concept of an accurate open source equivalent that anyone can use without restriction appeals to me, and I think it would be useful for the web development community. How is geographic IP data collected, and how realistic is it to hope to maintain an up-to-date open version?

    Read the article

  • Java 7 API design best practice - return Array or return Collection

    - by Shengjie
    I know this question has be asked before generic comes out. Array does win out a bit given Array enforces the return type, it's more type-safe. But now, with latest JDK 7, every time when I design this type of APIs: public String[] getElements(String type) vs public List<String> getElements(String type) I am always struggling to think of some good reasons to return A Collection over An Array or another way around. What's the best practice when it comes to the case of choosing String[] or List as the API's return type? Or it's courses for horses. I don't have a special case in my mind, I am more looking for a generic pros/cons comparison.

    Read the article

  • IP fail-over address. Do i need it?

    - by Jon
    I received an email from my web hosting provider where i have 2 dedicated servers saying that from now on I have to pay for my IP fail-over addresses. The server we have hosts a tool used internally by our company. Traffic to it is quite low. No more than 3 people will use it at the same time. If something happens we can wait a day to have the tool up and running again. Is it worth having these fail-over addresses? thanks

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >