Search Results

Search found 56 results on 3 pages for 'rohan dhruva'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Some regular expression help?

    - by Rohan
    Hey there. I'm trying to create a Regex javascript split, but I'm totally stuck. Here's my input: 9:30 pm The user did action A. 10:30 pm Welcome, user John Doe. ***This is a comment 11:30 am This is some more input. I want the output array after the split() to be (I've removed the \n for readability): ["9:30 pm The user did action A.", "10:30 pm Welcome, user John Doe.", "***This is a comment", "11:30 am This is some more input." ]; My current regular expression is: var split = text.split(/\s*(?=(\b\d+:\d+|\*\*\*))/); This works, but there is one problem: the timestamps get repeated in extra elements. So I get: ["9:30", "9:30 pm The user did action A.", "10:30", "10:30 pm Welcome, user John Doe.", "***This is a comment", "11:30", "11:30 am This is some more input." ]; I cant split on the newlines \n because they aren't consistent, and sometimes there may be no newlines at all. Could you help me out with a Regex for this? Thanks so much!!

    Read the article

  • Google chrome extension: local storage

    - by Rohan
    Hi there I'm developing an extension for Google Chrome, and have run into some trouble.I created an options.html page and added it to the manifest.json file.The page shows properly. I saved the options, and then went back to the page on which the extension is supposed to run. Unfortunately, the Local storage for the options was returning a 'null' instead of the option. If I set the local storage option directly from the extension's JS script, it works fine but not if it was set from the options page. Any idea how i can access the options.html local storage values from my Javascript file in the extension? thanks!

    Read the article

  • Apply limit in mapreduce function in php?

    - by Rohan Kumar
    How to apply limit in php, mongodb when using mapreduce function? I tried this $cmd=array(// codition array "mapreduce" => "user", "map" => $map, "reduce" => $reduce, "out" => array("inline" => 1), "limit"=>2 ); $db=connect(); $query = $db->command($cmd);// run command But its not working it gives 2 documents.I can't use limit on sub documents. If I have 100's of sub documents and then I want paging in sub documents.Then it fails.Is it possible to apply limit on sub documents?

    Read the article

  • How to modify my Response.Document XSD for getting author name form Sharepoint

    - by Rohan Patil
    Hi, This is my XSD currently <?xml version="1.0" encoding="Windows-1252"?> <xsd:schema xmlns:tns="urn:Microsoft.Search.Response.Document" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:Microsoft.Search.Response.Document" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:import namespace="urn:Microsoft.Search.Response.Document.Document" schemaLocation="Microsoft.Search.Response.Document.Document.xsd" /> <xsd:annotation> <xsd:documentation> </xsd:documentation> <xsd:documentation> Defines a Query Respnose from a Windows SharePoint Services 3.0 Query Service. </xsd:documentation> </xsd:annotation> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Root Element: Document --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - --> <xsd:element name="Document"> <xsd:complexType> <xsd:sequence> <xsd:element name="Title" type="xsd:string" minOccurs="0" /> <xsd:element name="Action"> <xsd:complexType> <xsd:sequence> <xsd:element name="LinkUrl"> <xsd:complexType> <xsd:simpleContent> <xsd:extension base="xsd:string"> <xsd:attribute name="size" type="xsd:unsignedByte" use="optional" /> <xsd:attribute name="fileExt" type="xsd:string" use="required" /> </xsd:extension> </xsd:simpleContent> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="Description" type="xsd:string" minOccurs="0" /> <xsd:element name="Date" type="xsd:dateTime" minOccurs="0" /> <xsd:element xmlns:q1="urn:Microsoft.Search.Response.Document.Document" ref="q1:Properties" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="relevance" type="xsd:unsignedByte" use="optional" /> </xsd:complexType> </xsd:element> </xsd:schema> I want to able to get the author name.. Please help..

    Read the article

  • Perl - Check if contents of one file exist in another and print to output file explaination in descr

    - by golwalkar.rohan
    Requirement:- File1 has contents like - ABCD00000001,\some\some1\ABCD00000001,Y,,5 (this indicates there are 5 file in total in unit) File2 has contents as ABCD00000001 So what i need to do is check if ABCD00000001 from File2 exist in File1 - if yes{ print the output to Output.txt till it finds another ',Y,,X'} else{ No keep checking} Anyone? Any help is greatly appreciated.

    Read the article

  • Ajax with Jsf 1.1 implementation

    - by Rohan Ved
    I am using JSF1.1 in that, have this code_ <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@ taglib uri="http://www.azureworlds.org" prefix="azure"%> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="x"%> <%@ taglib uri="http://www.asifqamar.com/jsf/asif" prefix="a"%> ... <x:selectOneMenu value="#{hotelBean.state}"> <f:selectItem itemLabel="Select One" itemValue="" /> <f:selectItem value="#{hotelBean.mapStates }" /> <x:ajax update="city" listener="#{hotelBean.handleCityChange}" /> </x:selectOneMenu> <h:outputText value="City* " /> <x:selectOneMenu id="city" value="#{hotelBean.city}"> <f:selectItem itemLabel="Select One" itemValue="" /> <f:selectItem value="#{hotelBean.mapCities }" /> </x:selectOneMenu> line x:ajax update="city" listener="#{hotelBean.handleCityChange}" is not working , i searched but got JSF1.1 not support for Ajax. then what can i do for this? and i have less knowledge of JS. Thanx

    Read the article

  • Javascript Split: without losing character

    - by Rohan
    I want to split certain text using JavaSscript. The text looks like: 9:30 pm The user did action A. 10:30 pm Welcome, user John Doe. 11:30 am Messaged user John Doe Now, I want to split the string into events. i.e.: 9:30 pm The user did action A. would be one event. I'm using RegEx for this: var split = journals.split(/\d*\d:/); Thing is, the first two characters are getting lost. The split appears like this: 30 pm The user did action A. How do I split so that the split maintains the first two/three characters (ie 9: or 10:) etc? Thanks!

    Read the article

  • Logic for rate approximation

    - by Rohan
    I am looking for some logic to solve the below problem. There are n transaction amounts : T1,T2,T3.. Tn. Commission for these transactions are calculated using a rate table provided as below. if amount between 0 and A1 - rate is r1 if amount between A1 and A2 - rate is r2 if amount between A2 and A1 - rate is r3 ... ... if amount greater than An - rate is r4 So if T1 < A1 then rate table returns r1 else if r1 < T1 < r2;it returns r2. So,lets says the rate table results for T1,T2 and T3 are r1,r2 and r3 respectively. Commission C = T1 * r1 + T2 * r2 + T3 * r3 e.g; if rate table is defined(rates are in %) 0 - 2500 - 1 2501 - 5000 - 2 5001 - 10000 - 4 10000 or more- 6 If T1 = 6000,T2 = 3000, T3 = 2000, then C= 6000 * 0.04 + 3000* 0.02 + 2000 * 0.01 = 320 Now my problem is whether we can approximate the commission amount if instead of individual values of T1,T2 and T3 we are provided with T1+T2+T3 (T) In the above example if T (11000) is applied to the rate tablewe would get 6% and which would result in a commision of 600. Is there a way to approximate the commission value given T instead of individual values of T1,T2,T3?

    Read the article

  • Problems debugging using Cygwin gdb in Eclipse CDT(Helios)

    - by Rohan
    I am trying to debug an application using Eclipse CDT and cygwin gdb and I am facing a problem if my code calls Sleep(), it looks like whenever a sleep is encountered in the code the debugger seems to go in an infinite loop(I meant it never terminates or hit a breakpoint after sleep). On pressing pause the code is stuck on one of the thread on sigint::interrupt. Even my debugger console windows throw these error in the console output: [New thread 5968.0x1f98] Error: dll starting at 0x774a0000 not found. Error: dll starting at 0x775c0000 not found. [New thread 5968.0x19e8] Any idea what are these errors about? It would be helpful if someone can help me out here as I am new to eclipse and I am used to using VS so it has made be lazy to be honest and expect things to work out of box. Here are more details if required Windows 7 x64 bit. Eclipse 3.6 Helios with CDT plug-in compiled from the CVS head. Cygwin latest from website, I think it is 1.71

    Read the article

  • Items Created via IB are not being displayed

    - by Rohan
    Hello, This is what i have done so far, Made a Custom view added few objects, as shown below @interface CommUICustomSignInView : CommUICustomView { IBOutlet NSButton *pBtn; IBOutlet NSTextField *pTextField; NSTrackingArea *pTrackingArea; NSCursor *pPonitHandCursor; } Added all IBoutlet correctly, Now thru Interface builder constructed a Window controller interface builder in which added a custom view and provided this class name in the interface builder, I hope i could able to visualize you guys, now whenever i loaded this view, the item whatever i created by IB are not being displayed, Am i doing something wrong, or something missing,

    Read the article

  • url not found in zend framework though working for index page

    - by Rohan Thakare
    i am trying to develop website using zend framework so i had created one index.php file where all my requests goes and c.reated two controller one is IndexController and other is TestController Class IndexController extends Zend_Controller_Action{ public function indexAction(){ echo "Index Index Jamla"; } public function displayAction(){ echo "Index Display Jamla"; } } now when i access the url http://test/ it correctly calls IndexController and its IndexAction function but when i access the url http://test/index/index it displays the message url /index/index was not found on this server same it does when i access http://test/test/index though http://test/ is equivalent to http://test/index/index

    Read the article

  • ftp : get list of files

    - by Rohan
    I am trying to get a list of files on FTP folder. The code was working when I ran it locally, but on deploying it I started receiving html instead of file name ArrayList fName = new ArrayList(); try { StringBuilder result = new StringBuilder(); //create the directory FtpWebRequest requestDir = (FtpWebRequest)FtpWebRequest.Create(new Uri(directory)); requestDir.Method = WebRequestMethods.Ftp.ListDirectory; requestDir.Credentials = new NetworkCredential(FTP_USER_NAME, FTP_PASSWORD); requestDir.UsePassive = true; requestDir.UseBinary = true; requestDir.KeepAlive = false; requestDir.Proxy = null; FtpWebResponse response = (FtpWebResponse)requestDir.GetResponse(); Stream ftpStream = response.GetResponseStream(); StreamReader reader = new StreamReader(ftpStream, Encoding.ASCII); while (!reader.EndOfStream) { fName.Add(reader.ReadLine().ToString()); } response.Close(); ftpStream.Close(); reader.Close();

    Read the article

  • How do I add line-height to a <select> using jQuery?

    - by Rohan
    I have a element <select name="dropdown" id="dropdown"> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> <option>Option 4</option> </select> Now if I add a CSS line-height property to the dropdown, it doesn't work. How would I use jQuery to style this? I prefer not to use plugins, because this is the only styling I wish to apply.

    Read the article

  • Javascript split with RegEx

    - by Rohan
    Hey again, I just asked a question about Regex, and received a great answer: http://stackoverflow.com/questions/3047201/javascript-split-without-losing-character Now, I have another question. My current Regex looks like this: var split = text.split(/(?=\w*\d*\d:\d\d)/); Basically, I'm trying to split using the timestamps (eg - 9:30 or 10:30, the difference between them is the extra digit in the latter). How do I go about this? Currently, if I have these two: 9:30 pm The user did action A. 10:30 pm Welcome, user John Doe. The splits are : 9:30 pm The user did action A. ---- 1 ---- 0:30 pm Welcome, user John Doe. How do I add an optional check for the first character in the timestamp? Thanks!

    Read the article

  • How do I add line-heigh to a <select> using jQuery?

    - by Rohan
    I have a element <select name="dropdown" id="dropdown"> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> <option>Option 4</option> </select> Now if I add a CSS line-height property to the dropdown, it doesn't work. How would I use jQuery to style this? I prefer not to use plugins, because this is the only styling I wish to apply.

    Read the article

  • Using XMLHttpRequest ??

    - by Rohan
    Hey I'd like to know how to use XMLHttpRequest to load the content of a remote URL and have the HTML of the accessed site stored in a JS variable. Say, if I wanted to load and alert() the HTML of http://foo.com/bar.php, how would I do that? Thanks!

    Read the article

  • How to convert a PHP object to a string?

    - by Rohan
    I get this error: Catchable fatal error: Object of class stdClass could not be converted to string So, my question is, how do I convert an object to a string in PHP? I don't want to serialize it though. Just a note: the code I use works in PHP 4, but not in PHP 5 Thanks!

    Read the article

  • Replacing innertext of XML node using PHP DOMDocument

    - by Rohan Kumar
    I want to replace innertext of a XML node my XML file named test.xml is <?xml version="1.0" encoding="utf-8"?> <ads> <loop>no</loop> <item> <description>Description 1</description> </item> <item> <description>Text in item2</description> </item> <item> <description>Let play with this XML</description> </item> </ads> I want to change the value of loop and description tag both, and it should be saved in test.xml like: <?xml version="1.0" encoding="utf-8"?> <ads> <loop>yes</loop> <item> <description>Description Changing Here</description> </item> <item> <description>Changing text in item2</description> </item> <item> <description>We will play later</description> </item> </ads> I tried code in PHP: <? $file = "test.xml"; $fp = fopen($file, "rb") or die("cannot open file"); $str = fread($fp, filesize($file)); $dom=new DOMDocument(); $dom->formatOutput = true; $dom->preserveWhiteSpace = false; $dom->loadXML($str) or die("Error"); //$dom->load("items.xml"); $root=$dom->documentElement; // This can differ (I am not sure, it can be only documentElement or documentElement->firstChild or only firstChild) $loop=$root->getElementsByTagName('loop')->item(0);//->textContent; //echo $loop; if(trim($loop->textContent)=='no') { echo 'ok'; $root->getElementsByTagName('loop')->item(0)->nodeValue ='yes'; } echo "<xmp>NEW:\n". $dom->saveXML() ."</xmp>"; ?> I tried only for loop tag.I don't know how to replace nodevalue in description tag. When I run this page it shows output like: ok NEW: <?xml version="1.0" encoding="utf-8"?> <ads> <loop>yes</loop> <item> <description>Description 1</description> </item> <item> <description>Changing text in item2</description> </item> <item> <description>Let play with this XML</description> </item> </ads> It gives the value yes in browser but don't save it in test.xml any reason?

    Read the article

  • PHP arrays & keys - fetching particular ones

    - by Rohan
    Hi Lets say I have an array with a structure like this: $arr= Array( array( "id"=>"a" "type">"apple"), array( "id"=>"b"), array( "id"=>"c"), array( "id"=>"c" "type"=>"banana") ); now I want to have a foreach loop which fetches all the array elements which have a key in them named "type". Something like foreach(all arrays which have type in them as $item) How would I do that? many thanks.

    Read the article

  • A pointer member variable having different values

    - by Rohan Prabhu
    Ok, to begin with, this is my code: HyperSprite::HyperSprite() { _view = 0; } void HyperSprite::publish(QGraphicsView* view) { _view = view; } void HyperSprite::getKFrame() { if(_view != 0) { qDebug()<<(void*)_view; } } Now, if I call HyperSprite::getKFrame() from within main(), I get the output: 0xbf8ffb84 I have a TCP server, which requires this QGraphicsView* variable. So whenever a new connection is made, HyperSprite::getKFrame() is called. However, whenever I make a connection to my server, this is the output: 0x1e425ff I honestly don't understand this. Shouldn't the value of a member remain same throughout? Why is the pointer value changing? As is obvious, whenever I try to use the _view pointer to access any of its members, a Segmentation Fault occurs. I tried using QSharedPointer, but it also results in the same problem. The data of the QSharedPointer automatically changes. Why is this happening?

    Read the article

< Previous Page | 1 2 3  | Next Page >