Search Results

Search found 208 results on 9 pages for 'hussain shah'.

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

  • Apply PHP regex replace on a multi-line repeted pattern

    - by Hussain
    Let's say I have this input: I can haz a listz0rs! # 42 # 126 I can haz another list plox? # Hello, world! # Welcome! I want to split it so that each set of hash-started lines becomes a list: I can haz a listz0rs! <ul> <li>42</li> <li>126</li> </ul> I can haz another list plox? <ul> <li>Hello, world!</li> <li>Welcome!</li> </ul> If I run the input against the regex "/(?:(?:(?<=^# )(.*)$)+)/m", I get the following result: Array ( [0] => Array ( [0] => 42 ) Array ( [0] => 126 ) Array ( [0] => Hello, world! ) Array ( [0] => Welcome! ) ) This is fine and dandy, but it doesn't distinguish between the two different lists. I need a way to either make the quantifier return a concatenated string of all the occurrences, or, ideally, an array of all the occurrences. Idealy, this should be my output: Array ( [0] = Array ( [0] = 42 [1] = 126 ) Array ( [0] = Hello, world! [1] = Welcome! ) ) Is there any way of achieving this, and if not, is there a close alternative? Thanks in advance!

    Read the article

  • Failed to save data at the server from memcached program

    - by zahir hussain
    hi i want to know why i cant store multi dimensional(array size is more than 1000) $memcache = new Memcache; $memcache->connect('localhost', 11211) or die ("Could not connect"); the above s working correctly... the below one have error... $memcache->set('key', $sear, false, 60) or die ("Failed to save data at the server"); if the $sear is string or object array then no problem for store data at the server.. but i store multi dimensional array in memcached,,i will get the error is Failed to save data at the server thanks and advance

    Read the article

  • Apply PHP regex replace on a multi-line repeated pattern

    - by Hussain
    Let's say I have this input: I can haz a listz0rs! # 42 # 126 I can haz another list plox? # Hello, world! # Welcome! I want to split it so that each set of hash-started lines becomes a list: I can haz a listz0rs! <ul> <li>42</li> <li>126</li> </ul> I can haz another list plox? <ul> <li>Hello, world!</li> <li>Welcome!</li> </ul> If I run the input against the regex "/(?:(?:(?<=^# )(.*)$)+)/m", I get the following result: Array ( [0] => Array ( [0] => 42 ) [1] => Array ( [0] => 126 ) [2] => Array ( [0] => Hello, world! ) [3] => Array ( [0] => Welcome! ) ) This is fine and dandy, but it doesn't distinguish between the two different lists. I need a way to either make the quantifier return a concatenated string of all the occurrences, or, ideally, an array of all the occurrences. Ideally, this should be my output: Array ( [0] => Array ( [0] => 42 [1] => 126 ) [1] => Array ( [0] => Hello, world! [1] => Welcome! ) ) Is there any way of achieving this, and if not, is there a close alternative? Thanks in advance!

    Read the article

  • How can I asynchronously monitor a file in Perl?

    - by Hussain
    I am wondering if it is possible, and if so how, one could create a perl script that constantly monitors a file/db, and then call a subroutine to perform text processing if the file is changed. I'm pretty sure this would be possible using sockets, but this needs to be used for a webchat application on a site running on a shared host, and I'm not so sure sockets would be allowed on it. The basic idea is: create a listener for a chat file/database when the file is updated with a new message, call a subroutine the called subroutine will send the new message back to the browser to be displayed Thanks in advance.

    Read the article

  • Python calling class methods with the wrong number of parameters

    - by Hussain
    I'm just beginning to learn python. I wrote an example script to test OOP in python, but something very odd has happened. When I call a class method, Python is calling the function with one more parameter than given. Here is the code: 1. class Bar: 2. num1,num2 = 0,0 3. def __init__(num1,num2): 4. num1,num2 = num1,num2 5. def foo(): 6. if num1 num2: 7. print num1,'is greater than ',num2,'!' 8. elif num1 is num2: 9. print num1,' is equal to ',num2,'!' 10. else: 11. print num1,' is less than ',num2,'!' 12. a,b,t = 42,84,bar(a,b) 13. t.foo 14. 15. t.num1 = t.num1^t.num2 16. t.num2 = t.num2^t.num1 17. t.num1 = t.num1^t.num2 18. 19. t.foo 20. And the error message I get: python test.py Traceback (most recent call last): File "test.py", line 12, in a,b,t = 42,84,bar(a,b) NameError: name 'bar' is not defined Can anyone help? Thanks in advance

    Read the article

  • follow of curl for java

    - by zahir hussain
    i want how to follow the link... for example the link : http://example.com/hi.php this will redirect another page to http://example.com/vi.php then this will redirect another page to http://example.com/ji.html so i need to get the page link "http://example.com/ji.html" i think, i cant in java.. so have possible in java curl? thanks advance

    Read the article

  • Perl: Asynchronous file monitoring

    - by Hussain
    I am wondering if it is possible, and if so how, one could create a perl script that constantly monitors a file/db, and then call a subroutine to perform text processing if the file is changed. I'm pretty sure this would be possible using sockets, but this needs to be used for a webchat application on a site running on a shared host, and I'm not so sure sockets would be allowed on it. The basic idea is: -create a listener for a chat file/database -when the file is updated with a new message, call a subroutine -the called subroutine will send the new message back to the browser to be displayed Thanks in advance.

    Read the article

  • mean of robots.txt at yahoo.com

    - by hussain
    i want to know the mean of yahoo robots.txt that website( http://www.yahoo.com/robots.txt ) have the following lines User-agent: * Disallow: /p/ Disallow: /r/ Disallow: /*? i dont know the mean of last line(Disallow: /*?) please let me know... thanks and advance

    Read the article

  • MySQL on Windows 7 multiple connections issue.

    - by Hussain
    I just installed MySql on windows 7 ... issue is i'm unable to get multiple connection to MySql . If I connect with command line than i'm unable to connect through any other client and vice versa. Previously I was using same version of MySql i.e. 5.1 on vista and it was working fine.

    Read the article

  • get entire line with java.util.scanner.hasNext(regex)

    - by Hussain
    I'm doing something in Java that requires input to be matched against the pattern ^[1-5]$. I should have a while loop looping through each line of input, checking it against the pattern, and outputting an error message if it does not. Sudo code: while (regex_match(/^[^1-5]$/,inputLine)) { print ("Please enter a number between 1 and 5! "); getNextInputLine(); } I can use java.util.Scanner.hasMatch("^[^1-5]$"), but that will only match a single token, not the entire line. Any idea on how to make hasMatch match against the entire line? (Setting the delimiter to "\n" or "\0" doesn't work.)

    Read the article

  • search and display string from group of string php

    - by zahir hussain
    hi i want to know how to search and display string from group of string like google display the word which we search... the following example from google search word is google books result Search and preview millions of books from libraries and publishers worldwide using Google Book Search. Discover a new favorite or unearth an old classic. i would like to do this type of one... thanks and advance

    Read the article

  • utf8 format in xml

    - by hussain
    i want to know how to store this è (this type of symbols) in xml file if i store this symbol in xml file.. the file shows this symbol like ? i was inserted in front of xml file is <?xml version="1.0" encoding="UTF-8"?> but that doest not shows correct thanks and advance

    Read the article

  • Send Click Message to another application process

    - by Nazar Hussain
    I have a scenario, i need to send click events to an independent application. I started that application with the following code. private Process app; app = new Process(); app.StartInfo.FileName = app_path; app.StartInfo.WorkingDirectory = dir_path; app.Start(); Now i want to send Mouse click message to that applicaiton, I have specific coordinates in relative to application window. How can i do it using Windows Messaging or any other technique. I used [DllImport("user32.dll")] private static extern void mouse_event(UInt32 dwFlags, UInt32 dx, UInt32 dy, UInt32 dwData, IntPtr dwExtraInfo); It works well but cause the pointer to move as well. So not fit for my need. Then i use. [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); It works well for minimize maximize, but do not work for mouse events. The codes for mousevents i am using are, WM_LBUTTONDOWN = 0x201, //Left mousebutton down WM_LBUTTONUP = 0x202, //Left mousebutton up WM_LBUTTONDBLCLK = 0x203, //Left mousebutton doubleclick WM_RBUTTONDOWN = 0x204, //Right mousebutton down WM_RBUTTONUP = 0x205, //Right mousebutton up WM_RBUTTONDBLCLK = 0x206, //Right mousebutton do Thanks for the help in advance, and waiting for feedback.

    Read the article

  • how to access method variables from within an anonomous function in javascript

    - by Hussain
    I'm writing a small ajax class for personal use. In the class, I have a "post" method for sending post requests. The post method has a callback parameter. In the onreadystatechange propperty, I need to call the callback method. Something like this: this.requestObject.onreadystatechange = function() { callback(this.responseText); } However, I can't access the callback variable from within the anonomous function. How can I bring the callback variable into the scope of the onreadystatechange anonomous function?

    Read the article

  • get all fields value from mysql using php

    - by zahir hussain
    hi i want to know how to get all fields value search by array. i have array that s my table is id content 1 zahr 2 hai . . . and so on $a = {2,3,4,5,43,32}; i have to take the contents by this id(from array "a"). i know, i can use "for" loop for getting each element from mysql. but i would like to use any filters or any predefined function thanks and advance

    Read the article

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