Search Results

Search found 3176 results on 128 pages for 'parsing'.

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

  • Documenting software-updates semi-automatically in MacOS X by parsing log files?

    - by Martin
    I'd like to document changes I made to my computer (running MacOS 10.6.8) to be able to identify the sources of eventual problems. Mostly I install updates when a software notifies me about a newer version and offers me a dialog to download and install the update. Currently I'm documenting those updates "by hand" by noting in a text file, when I have e. g. installed a Flash-Player update or updated another 3rd party software ... I wonder if I could achieve that easier and semi-automatically by parsing system logfiles for certain texts like "install" and that way directly get the relevant information: what has been installed (Software and version) when has been installed where has it been installed/what has changed Is there a way to extract such information by a script from the existing logfiles?

    Read the article

  • NSXMLParser not parsing attributes. No NSXMLParser Error.

    - by Iris
    I am trying to parse the XML located at this URL: http://www.iglooseat.com/gis_iphone_xml.php?zip=06488 // 1) This method gets invoked when the user presses a button on the Iphone to retrieve the xml data (IBAction)getLocations:(id)sender { NSString *msg=nil; NSString *urlString= [[NSString alloc] initWithFormat:@"http://www.iglooseat.com/gis_iphone_xml.php?zip=%@",zipField.text]; // send the URL NSError *error; [siteList updateLocationsFromURL:urlString parseError:&error]; WPSite *w = [siteList siteAtIndex:0]; // alert user what's in the zipField msg = [[NSString alloc] initWithFormat: @"url to send: %@\n site name: %@" , urlString , w.name]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Debug" message:msg delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [urlString release]; [alert show]; [alert release]; [msg release]; } // 2) This function takes the URL and performs XML parsing on the data at that URL. (void)updateLocationsFromURL:(NSString )urlString parseError:(NSError *)error{ /* NSURL class that inherits from NSObject class that provides a way to manipulate URLs and the resources they reference. */ NSURL *url = [[NSURL alloc] initWithString:urlString]; /* initWithContentsOfURL: initializes a newly allocated data object initialized with the data from the location specified by a URL. */ NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:url]; // init bool to NO errorConnecting = NO; // release from mem the NSURfile://localhost/Users/icheung/Desktop/WPMap/Classes/WPSite.mL [url release]; // set parser delgate to self [parser setDelegate:self]; // don't process namespace [parser setShouldProcessNamespaces:YES]; // or namespace prefixes [parser setShouldReportNamespacePrefixes:NO]; /* don't care 'bout external (ex. don't perform I/O op's to load external DTD's (Document Type Definitions)) */ [parser setShouldResolveExternalEntities:NO]; // start the event-driven parsing operation [parser parse]; // get NSError object if an error occured during parsing NSError *parseError = [parser parserError]; if(parseError && error) { *error = parseError; NSLog(@"Error code:%d %@", parseError.code, parseError.domain); errorConnecting = YES; } // relase from mem the parser [parser release]; } // 3) In the parser:didStartElement:namespaceURI:qualifiedName:attributes: I attempt to extract the 'state' attribute from a 'marker' element in my xml. When I use the gdb debugger to inspect the contents of attributeDict it is empty and I'm not sure why. (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict { if(self.parserContentOfCurrentProperty == nil) { NSMutableString *tmp = [[NSMutableString alloc] init]; self.parserContentOfCurrentProperty = tmp; [tmp release]; } [self.parserContentOfCurrentProperty setString:@""]; self.parserNameOfCurrentProperty = elementName; if ([elementName isEqualToString:@"markers"]) { WPSite *tmp = [WPSite alloc]; self.parserCurrentSite = tmp; // retrive value for attribute NSString *stateAttribute = [attributeDict valueForKey:@"state"]; if (stateAttribute) { [self.parserCurrentSite setState:stateAttribute]; } // add this site to the site list [siteList addObject:self.parserCurrentSite]; return; } }

    Read the article

  • fail2ban log parsing too slow on Raspberry Pi - options? [migrated]

    - by Gordon Morehouse
    I'm running fail2ban on a Raspberry Pi at 950MHz which I cannot overclock further. The Pi is occasionally subject to SYN floods on particular ports. I've set up iptables to throttle the rate of SYNs on the port of interest; when the throttle limits are exceeded, hosts which send SYNs are dropped into the REJECT chain and the particular SYN packet which exceeded the limit is logged. fail2ban then watches for these logged SYNs and, after seeing a few, temporarily bans the host for a short time (this is a transient issue in the app I'm working with). The problem is that the SYN floods can occasionally reach rates which are too fast for fail2ban to keep up with; I'll see 20-40 log messages per second, and eventually fail2ban falls behind and becomes ineffective. To add insult to injury, it continues consuming a LOT of CPU as it tries to catch up. I have verified that DROP chained packets from hosts already banned by fail2ban are not logged, and thus do not add to its load. What are my options here? I have a few ideas, but no clear path forward. Could I make the log-parse regex "easier" so it takes fewer cycles? Would using iptables --log-prefix to put a token near the start of the log message, and/or otherwise simplifying/altering the fail2ban regex help? Here is the current fail2ban config line containing a regex: failregex = kernel:.*?SRC=(?:::f{4,6}:)?(?P<host>[\w\-.^_]+) DST.*?SYN Is there a faster way for fail2ban to watch for the packets exceeding the limits than parsing kern.log? Could fail2ban be run under PyPy instead of CPython with minimal nonstandard wizardry (the OS is Raspbian 7, so, mostly Debian 7)? Is there something better than fail2ban that I could use to watch for the packets which exceed the SYN limits, and after N exceeds in X seconds, temporarily put the offending IP into the iptables DROP bucket, and take it out when the ban timer expires? Again, I'd vastly prefer a solution that uses as much software available in Debian as possible, though I can build Debian packages in a pinch.

    Read the article

  • How do I recover from pushing a gitosis.conf file with parsing errors due to line breaks?

    - by Kasia
    I have successfully set up gitosis for an Android mirror (containing multiple git repositories). While adding a new .git path following writable= in gitosis.conf I managed to insert a few line breaks. Saved, committed and pushed to server when I received the following parsing error: Traceback (most recent call last): File "/usr/bin/gitosis-run-hook", line 8, in load_entry_point('gitosis==0.2', 'console_scripts', 'gitosis-run-hook')() File "/usr/lib/python2.5/site-packages/gitosis-0.2-py2.5.egg/gitosis/app.py", line 24, in run return app.main() File "/usr/lib/python2.5/site-packages/gitosis-0.2-py2.5.egg/gitosis/app.py", line 38, in main self.handle_args(parser, cfg, options, args) File "/usr/lib/python2.5/site-packages/gitosis-0.2-py2.5.egg/gitosis/run_hook.py", line 75, in handle_args post_update(cfg, git_dir) File "/usr/lib/python2.5/site-packages/gitosis-0.2-py2.5.egg/gitosis/run_hook.py", line 33, in post_update cfg.read(os.path.join(export, '..', 'gitosis.conf')) File "/usr/lib/python2.5/ConfigParser.py", line 267, in read self._read(fp, filename) File "/usr/lib/python2.5/ConfigParser.py", line 490, in _read raise e ConfigParser.ParsingError: File contains parsing errors: ./gitosis-export/../gitosis.conf (...) I have removed the line break and amendend the commit by git commit -m "fix linebreak" --amend However git push still yields the exact same error. It leads me to believe gitosis is preventing me from doing any further pushes. How do I recover from this?

    Read the article

  • HA Proxy Stick-table and tcp-connection configuration

    - by Vladimir
    I am using HA Proxy HA-Proxy version 1.4.18 2011/09/16 I am trying to insert the following into /etc/init.d/haproxy.cfg file # Use General Purpose Couter (gpc) 0 in SC1 as a global abuse counter # Monitors the number of request sent by an IP over a period of 10 seconds stick-table type ip size 1m expire 10s store gpc0,http_req_rate(10s) tcp-request connection track-sc1 src tcp-request connection reject if { src_get_gpc0 gt 0 } # Table definition stick-table type ip size 100k expire 30s store conn_cur(3s) # Allow clean known IPs to bypass the filter tcp-request connection accept if { src -f /etc/haproxy/whitelist.lst } # Shut the new connection as long as the client has already 10 opened tcp-request connection reject if { src_conn_cur ge 10 } tcp-request connection track-sc1 src I get the following error: [ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:36] : stick-table: unknown argument 'store'. [ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:37] : unknown argument 'connection' after 'tcp-request' in proxy 'http_proxy' [ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:38] : unknown argument 'connection' after 'tcp-request' in proxy 'http_proxy' [ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:41] : stick-table: unknown argument 'store'. [ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:43] : unknown argument 'connection' after 'tcp-request' in proxy 'http_proxy' [ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:45] : unknown argument 'connection' after 'tcp-request' in proxy 'http_proxy' [ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:46] : unknown argument 'connection' after 'tcp-request' in proxy 'http_proxy' [ALERT] 256/113143 (4627) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg [WARNING] 256/113143 (4627) : Proxy 'http_proxy': in multi-process mode, stats will be limited to process assigned to the current request. [ALERT] 256/113143 (4627) : Fatal errors found in configuration. [fail] Could you please tell me what is wrong with the code? Thanks!

    Read the article

  • Possible to modify DOM during/before initial DOM parsing?

    - by AMO
    Is it possible to modify the DOM during or before the initial DOM parsing? Or do I have to wait until the DOM is parsed and built before interacting with it? More specifically, is it possible to hinder a script element in DOM from running using userscripts/content scripts or similar in chrome or firefox? Tried using eventListeners on DOMNodeInserted before the DOM is parsed, but these are only fired after the DOM is built.

    Read the article

  • How to get the result for return statement from JSON parsing?

    - by blankon91
    I've follow the code for parsing the value with JSON from here, but I get the problem in my return statement. I want to put the parsing result into my return statement. How to do that? Here is my code: public String MASUK(String user, String password) { SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,OPERATION_NAME); PropertyInfo pi = new PropertyInfo(); pi.setName("ccduser"); pi.setValue(user); pi.setType(String.class); request.addProperty(pi); PropertyInfo pi2 = new PropertyInfo(); pi2.setName("password"); pi2.setValue(password); pi2.setType(String.class); request.addProperty(pi2); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS); try { httpTransport.call(SOAP_ACTION, envelope); SoapObject resultSOAP = (SoapObject) envelope.bodyIn; /* gets our result in JSON String */ String ResultObject = resultSOAP.getProperty(0).toString(); resultSOAP = (SoapObject) envelope.bodyIn; ResultObject = resultSOAP.getProperty(0).toString(); if (ResultObject.startsWith("{")) { // if JSON string is an object JSONObj = new JSONObject(ResultObject); Iterator<String> itr = JSONObj.keys(); while (itr.hasNext()) { String Key = (String) itr.next(); String Value = JSONObj.getString(Key); BundleResult.putString(Key, Value); // System.out.println(bundleResult.getString(Key)); } } else if (ResultObject.startsWith("[")) { // if JSON string is an array JSONArr = new JSONArray(ResultObject); System.out.println("length" + JSONArr.length()); for (int i = 0; i < JSONArr.length(); i++) { JSONObj = (JSONObject) JSONArr.get(i); BundleResult.putString(String.valueOf(i), JSONObj.toString()); // System.out.println(bundleResult.getString(i)); } } } catch (Exception exception) { } return null; }

    Read the article

  • Parsing Tabular cell data with space where there is td tag.

    - by Harikrishna
    I am parsing html tabular information with the help of the html agility pack. Now First I am finding the rows in that table like var rows = table.Descendants("tr"); then I find the cell data for each row like foreach(var row in rows) { string rowInnerText = row.InnerText; } That gives me the cell data.But with no spaces between them like NameAdressPhone No but I want the innertext like Name Address Phone No means where there is td tag I want to keep there one space between different column cell.

    Read the article

  • I want to compile a batch file into an exe using c++, i can get through parsing the batch file and w

    - by Nareshkumar Rao
    Ok, here's the thing, I am creating an application in DevC++ that will read in a batch file. then, one by one parsing it using: system(getline(myfile,line)); After setting everything up, I save the newly created file as "main.cpp". The problem is, I want to compile it into an exe, from my program, for the end user. So basically, I'm asking whether I can compile a C++ file from a C++ Exe..

    Read the article

  • Android "Hello World" tutorial program. Error: [Parse Error] There is a problem parsing the package

    - by ConfusedDeveloper
    Today I decided to start developing for the Android OS. I went on their website, downloaded all the required software (Eclipse, The Android SDK, ADT Plugin for Eclipse etc.). I followed the "Hello World" tutorial supplied (link text). I have it using the Android SDK 2.1. The program worked almost flawlessly. It runs fine on the Android emulator, but doesn't install on any Android phones. I don't own an Android phone, so I had three of my friends try to install the program on theirs. The phones we used were: ROOTED G1 running 2.1 Droid running 2.1 Another Droid running 2.1 I emailed the .apk to myself in gmail, and accessed it via the Android emulator. It ran and installed the package just fine. However, when my friends tried to install it on their phones, they were all met with this error: "[Parse Error] There is a problem parsing the package" I'm wondering if anyone has any suggestions as to what may be wrong. Thanks for your help.

    Read the article

  • RSS parsing last build Date. Fastest way to do so please.

    - by Paul
    Dim myRequest As System.Net.WebRequest = System.Net.WebRequest.Create(url) Dim myResponse As System.Net.WebResponse = myRequest.GetResponse() Dim rssStream As System.IO.Stream = myResponse.GetResponseStream() Dim rssDoc As New System.Xml.XmlDocument() Try rssDoc.Load(rssStream) Catch nosupport As NotSupportedException Throw nosupport End Try Dim rssItems As System.Xml.XmlNodeList = rssDoc.SelectNodes("rss/channel") 'For i As Integer = 0 To rssItems.Count - 1 Dim rssDetail As System.Xml.XmlNode rssDetail = rssItems.Item(0).SelectSingleNode("lastBuildDate") Folks this is what I'm using to parse an RSS feed for the last updated time. Is there a quicker way? Speed seems to be a bit slow on it as it pulls down the entire feed before parsing.

    Read the article

  • Linq to SQL and SQL Server Compact Error: "There was an error parsing the query."

    - by Jeremy
    I created a SQL server compact database (MyDatabase.sdf), and populated it with some data. I then ran SQLMetal.exe and generated a linq to sql class (MyDatabase.mdf) Now I'm trying to select all records from a table with a relatively straightforward select, and I get the error: "There was an error parsing the query. [ Token line number = 3,Token line offset = 67,Token in error = MAX]" Here is my select code: public IEnumerable ListItems() { MyDatabase db_m = new MyDatabase("c:\mydatabase.sdf"); return this.db_m.TestTable.Select(test = new Item() { .... } } I've read that Linq to SQL works with Sql Compact, is there some other configuration I need to do?

    Read the article

  • Can I use ANTLR for both two-way parsing/generating?

    - by Mike Q
    Hi all, I need to both parse incoming messages and generate outgoing messages in EDIFACT format (basically a structured delimited format). I would like to have a Java model that will be generated by parsing a message. Then I would like to use the same model to create an instance and generate a message. The first half is fine, I've used ANTLR before to go from raw - Java objects. But I've never done the reverse, or if I have it's been custom. Does ANTLR support generating using a grammar or is it really just a parse-only tool?

    Read the article

  • .ics Calendar File - Parsing Date Time - What is the time format?

    - by Josh
    I am coding in php, attempting to get the start\end dates and times for events. I am utilizing the following RegEx for parsing out the information: $pattern='/(?P<StartDate>[0-9]{8})T(?P<StartTime>[0-9]{6}) .+(?P<EndDate>[0-9]{8})T(?P<EndTime>[0-9]{6})/'; The sample event entry is here: BEGIN:VEVENT UID:34b09fd7-8e6e-4d56-86b0-445745b89d93 ORGANIZER;CN=*********:mailto:********* DTSTART;TZID="(GMT-06.00) Central Time (US & Canada)":20100413T130000 DTEND;TZID="(GMT-06.00) Central Time (US & Canada)":20100413T160000 STATUS:CONFIRMED CLASS:PRIVATE X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY TRANSP:OPAQUE X-MICROSOFT-DISALLOW-COUNTER:TRUE DTSTAMP:20100414T140711Z SEQUENCE:0 END:VEVENT 20100413T130000 and 20100413T160000 are the start and end points. The dates are straight forward, however how do I interpret the time part? This event starts at one and ends at four.

    Read the article

  • Is using a FSM a good design for general text parsing?

    - by eSKay
    I am reading a file that is filled with hex numbers. I have to identify a particular pattern, say "aaad" (without quotes) from it. Every time I see the pattern, I generate some data to some other file. This would be a very common case in designing programs - parsing and looking for a particular pattern. I have designed it as a Finite State Machine and structured structured it in C using switch-case to change states. This was the first implementation that occured to me. DESIGN: Are there some better designs possible? IMPLEMENTATION: Do you see some problems with using a switch case as I mentioned?

    Read the article

  • Is there a better way to deal with reserved characters when parsing XML/JSON data on the iPhone?

    - by Charles S.
    The following code works, but it's ugly and creates a bunch of autoreleased objects. I'm using similar code for parsing reserved HTML characters as well (for quotes, & symbols, etc). I'm just wondering... Is there a cleaner way? NSString *result = [[NSString alloc] initWithString:userInput]; NSString *result2 = [result stringByReplacingOccurrencesOfString:@"#" withString:@"\%23"]; NSString *result3 = [result2 stringByReplacingOccurrencesOfString:@" " withString:@"\%20"]; formatted = [[result3 stringByReplacingOccurrencesOfString:@"&" withString:@"\%26"] retain]; [result release];

    Read the article

  • Stuck with the math in a Flash project, would parsing engine help?

    - by VideoDnd
    I've been stuck with the math in a Flash project? It's a loose design pattern my director formulated. My goal is to keep the project object oriented, and get 'non Flash obstacles' off my plate. Do you recommend using parsing engines for processing math? XML values going to AS3, updating a changing acceleration formula. I don't hate math, but it just doesn't seem OOP or good project planning to have the math stuck in Flash. Your comments are welcome.

    Read the article

  • Is this Javascript object literal key restriction strictly due to parsing?

    - by George Jempty
    Please refer to the code below, when I "comment in" either of the commented out lines, it causes the error (in IE) of "':' expected". So then is my conclusion correct, that this inability to provide a reference to an object value, as an object key in a string literal; is this strictly an interpreter/parsing issue? Is this a candidate for an awful (or at least "bad") "part" of Javascript, in contrast to Crockford's "good parts"? <script> var keys = {'ONE': 'one'}; //causes error: //var obj1 = {keys.ONE: 'value1'}; //var obj1 = {keys['ONE']: 'value1'}; //works var obj1 = {}; obj1[keys.ONE] = 'value1'; //also works var key_one = keys.ONE; var obj2 = {key_one: 'value1'}; </script>

    Read the article

  • Best practices for parsing HTML from Wikipedia for iPhone viewing?

    - by ivanTheTerrible
    I am building an iPhone Wikipeida game app, that requires modifying the default Wiki HTML a little bit (mostly simplifying the page). So far I am directly downloading the HTML output from en.wikipedia.org/wiki/Article_Foo to a python Google App Engine, and then modify its CSS and HTML structure, cache it, and finally output to iPhone. It works but I find this method quite tedious, there must be a better method? Please note that I use App Engine not just for parsing the Wiki, but the game also requires it to keep the stores...etc, hence not a overkill. Also, I would prefer doing all the work with python on App Engine, to keep the iPhone client as thin and mobile as possible (XML on iPhone is a big no fun) Thanks a lot.

    Read the article

  • SvnDumpFilter 2,3: Error parsing header. How to fix?

    - by flashnik
    I use SVN from Collabnet, 1.6.9 version. I tried to separate my project on two parts with SvnDumpFilter and encountered an error because some folders (includeing the one I want to separate) had been moved. Then I googled that SvnDumpFilter 2 and 3 can solve this problem. I tried to use them but in both cases encountered an error: Error parsing header. Here is the beginning of source dump: SVN-fs-dump-format-version: 2 UUID: REP_GUID Revision-number: 0 Prop-content-length: 56 Content-length: 56 K 8 svn:date V 27 2008-10-28T07:01:45.445155Z PROPS-END Revision-number: 1 Prop-content-length: 151 Content-length: 151 K 7 svn:log V 48 ?±???·???µ??-?‡?°???‚??, ?????‚?????°?? ?±?‹?»?° K 10 svn:author V 8 flashnik K 8 svn:date V 27 2008-10-29T20:18:56.633888Z PROPS-END Node-path: Foo Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: Foo/Bar Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: Foo/Bar/example.doc Node-kind: file Node-action: add Prop-content-length: 59 Text-content-length: 181248 Text-content-md5: f14c77a031ab2de001ac5239427ceded Text-content-sha1: 95470e8d29bf76b00485c4fa33f4029f5c2386cb Content-length: 181307 K 13 svn:mime-type V 24 application/octet-stream ....Some binary code and so on SvnDumpFilter3 produces following part before dying: SVN-fs-dump-format-version: 2 UUID: REP_GUID Revision-number: 0 Prop-content-length: 56 Content-length: 56 K 8 svn:date V 27 2008-10-28T07:01:45.445155Z PROPS-END Revision-number: 1 Prop-content-length: 151 Content-length: 151 K 7 svn:log V 48 ?±???·???µ??-?‡?°???‚??, ?????‚?????°?? ?±?‹?»?° K 10 svn:author V 8 flashnik K 8 svn:date V 27 2008-10-29T20:18:56.633888Z PROPS-END What's wrong? How to fix it? Does it work with my subversion version?

    Read the article

  • Does Internet Explorer 7 have a CSS parsing issue with the "background-image" property?

    - by user312003
    Having CSS layout issues with Internet Explorer 7 (big surprise). Upon using the Developer Tools to inspect the CSS, I discovered that some properties defined in the stylesheet are not appearing in the parsed CSS structure... THEN I saw THIS being shown as the parsed value for the background-image property: background-image : url(/trunk/httpdocs/images/layout/HCBL_Homepage_01.jpg); WIDTH: 1200px; pretty much obliterating the width that was defined property. The actual code in the CSS file for this element: div#header { width: 1200px; height: 100px; margin-left: auto; margin-right: auto; background-image: url('/trunk/httpdocs/images/layout/HCBL_Homepage_01.jpg'); background-repeat: no-repeat; } If anyone could offer any insight, or provide a link describing this problem (and maybe a workaround...) I would be very appreciative. Also, I am only interested in this from a parsing of the stylesheet and CSS syntax perspective. I am not concerned with rendering and display issues at the moment; I simply want to get IE 7 (and I have a feeling IE 6 will have similar issues) to recognize and parse ALL of the CSS properties that have been defined in the stylesheet. Thanks in advance guys!

    Read the article

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