Search Results

Search found 2950 results on 118 pages for 'co lega'.

Page 77/118 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • How to ignore CDATA tags?

    - by Petre
    I'm trying to make an html parser, but when I load the html I get warnings like this Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Invalid char in CDATA 0x1C in Entity, line: 1302 Here is the code I use class Parser { public $url=null; public $html=null; public $tidy=null; public $head=null; public $head_xpath=null; function __construct($url){ $this->url=$url; $this->html=file_get_contents($this->url); $this->tidy=tidy_parse_string($this->html); $this->head=new DOMDocument(); $this->head->loadHTML($this->tidy->head()); $this->head_xpath= new DOMXPath($this->head); } } $x=new Parser("http://www.guardian.co.uk/politics/2012/mar/24/vince-cable-coalition-banking-row"); I searched around and found the LIBXML_NOCDATA constant, but I don't know how to set it. So how could i completely ignore CDATA?

    Read the article

  • Avoiding a NullReferenceException

    - by Nikhil K
    I have used this code for extracting urls from web page.But in the line of 'foreach' it is showing Object reference not set to an instance of an object exception. What is the problem? how can i correct that? WebClient client = new WebClient(); string url = "http://www.google.co.in/search?hl=en&q=java&start=10&sa=N"; string source = client.DownloadString(url); HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(source); foreach (HtmlNode link in doc.DocumentNode.SelectNodes("//a[@href and @rel='nofollow']")) { Console.WriteLine(link.Attributes["href"].Value); }

    Read the article

  • What is an SSH key?

    - by acidzombie24
    I signed up for github and notice the ssh key option which looked interesting. I originally expected something like an ssl key (name, co name, etc). After going through it i notice i only put a password and it is always myuser@comp-name (this is windows). Why? I thought it was a user/pass id and i can create separate keys for separate purpose for privacy reasons. Now i see i am required to use one to create a repository. Also i see something about a 'private key file' when looking at options. What exactly is an SSH Key and how can i create a separate user without creating a separate login in windows.

    Read the article

  • What is the best way when creating a Google Widget, to store the data for the Widget to be shared by

    - by Tim McJilton
    I know this may end up getting closed quickly. I could not find this in my searching through APIs. And this is probably a very simple question but here we go... How do you store data on a google application you create in which you and others in a specific group or more specifically the people who can edit a specific calendar, can reach this data? Person A,B,C have read/write access to a calendar, and lets say they want to co-ordinate information. I want this information to not be accessible to modify by all 3 though it is not stored in a calendar? (Though I thought about just creating an event in 1900 and then that fullfills that, but at the same time is a very hack way to do it) I would appreciate any insight you can give me when it comes to data handling in google applications, I am very new to it, but have been looking into it.

    Read the article

  • php - preg_replace not working when string contains a hashtag

    - by Steven
    I found a function online for turning a url within a string into a clickable link. However, when the url contains a hashtag it doesn't work. eg. http://www.bbc.co.uk/radio1/photos/fearnecotton/5759/1#gallery5759 Here's the part of the function concerned: $ret = preg_replace( "#(^|[\n ])([\w]+?://[\w]+[^ \"\n\r\t< ]*)#", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret ); $ret = preg_replace( "#(^|[\n ])((www|ftp)\.[^ \"\t\n\r< ]*)#", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret ); Any ideas? thanks

    Read the article

  • jQuery Sortable + Droppable z-index problem

    - by unknowndomain
    I am having a probelm with the z-index of my sortable object not being above my droppable. If you visit http://clareshilland.unknowndomain.co.uk/. Press Ctrl + L to bring up the login screen. Enter the username clare and the password shilland. It will then load in the admin bar and if you click manage gallery. A pop down thumbnail view will appear with all the photos from that gallery. The issue is that when you drag the 'polaroids' from the grid to the delete area they are under the delete area. I tried putting the delete area inside the same div as the grid but it makes no difference, I just don't know what to do at this point so any help would be a massive help!

    Read the article

  • PHP or Javascript or other - Draw simple shapes onto images?

    - by Tommo
    I basically have an image of a world map and i would like to place a pin image at a specified pixel co-ordinate ontop of this world map image. It's for a website, so ideally the solution should be in PHP or Javascript (i'm avoiding Java and Flash as i want it to be as simple as possible). I had a look at the processing.js library but it is way to big and bloated for just performing this simple task. Is there a pre-existing Javascript function which will allow me to do this? Or a more simple javascript library that i can use? (processing.js was a bit too advanced for me, i couldnt get it working lol) In terms of a PHP solution, i would prefer taking the load off the server and onto the client for this task, but i would still like to hear methods for doing it in PHP if they are suitable. Thanks!

    Read the article

  • How to sift idioms and set phrases apart from other common phrases using NLP techniques?

    - by hippietrail
    What techniques exist that can tell the difference betwen plain common phrases such as "to the", "and the" and set phrases and idioms which have their own lexical meanings such as "pick up", "fall in love", "red herring", "dead end"? Are there techniques which are successful even without a dictionary, statistical methods HMMs train on large corpora for instance? Or are there heuristics such as ignoring or weighting down "promiscuous" words which can co-occur with just about any word versus words which occur either alone or in a specific limited set of idiomatic phrases? If there are such heuristics, how do we take into account set phrases and verbal phrases which do incorporate promiscuous words such as "up" in "beat up", "eat up", "sit up", "think up"? UPDATE I've found an interesting paper online: Unsupervised Type and Token Identi?cation of Idiomatic Expressions

    Read the article

  • What unix text editor should I learn? [closed]

    - by sixtyfootersdude
    Maybe this should be a community wiki page... What unix text editor should I learn? My co-workers mostly use vi. I am thinking about vim because the syntax highlighting seems appealing. Is there any advantage to vi over vim? I know that there are a lot of emacs fans out there too? Is there any reason to learn a specific editor? Can you point me to some good learning references (for your suggested editor)? Thanks!

    Read the article

  • Django + WebKit = Broken pipe

    - by Saosin
    I'm running the Django 1.2 development server and I get these Broken Pipe error messages whenever I load a page from it with Chrome or Safari. My co-worker is getting the error as well when he loads a page from his dev server. We don't have these errors when using Opera or Firefox. Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 281, in run self.finish_response() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 321, in finish_response self.write(data) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 417, in write self._write(data) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.py", line 300, in write self.flush() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.py", line 286, in flush self._sock.sendall(buffer) error: [Errno 32] Broken pipe Can anyone help me out? I'm going crazy over this!

    Read the article

  • Geocoding non-addresses: Geopy

    - by Phil Donovan
    Using geopy to geocode alcohol outlets in NZ. The problem I have is that some places do not have street addresses but are places in Google Maps. For example, plugging: Furneaux Lodge, Endeavour Inlet, Queen Charlotte Sound, Marlborough 7250 into Google Maps via the browser GUI gives me However, using that in Geopy I get a GQueryError saying this geographic location does not exist. Here is the code for geocoding: def GeoCode(address): g=geocoders.Google(domain="maps.google.co.nz") geoloc = g.geocode(address, exactly_one=False) place, (lat, lng) = geoloc[0] GeoOut = [] GeoOut.extend([place, lat, lng]) return GeoOut GeoCode("Furneaux Lodge, Endeavour Inlet, Queen Charlotte Sound, Marlboroguh 7250") Meanwhile, I notice that "Eiffel Tower" works fine. Is there away to solve this and can someone explain the difference between The Eiffel Tower and Furneaux Lodge within Google 'locations'?

    Read the article

  • not getting output from parmiko/ssh command

    - by Matt
    I am using paramiko/ssh/python to attempt to run a command on a remote server. When I ssh manually and run the command in question, I get the results I want. But if I use the python (co-opted from another thread on this site) below, there is no returned data. If I modify the command to be something more basic like 'pwd' or 'ls' I can then get the output. Any help is appreciated. Thanks, Matt import paramiko import time import sys, os, select import select username='medelman' password='Ru5h21iz' hostname='10.15.27.166' hostport=22 cmd='tail -f /x/web/mlog.txt' #works cmd='' #doesn't work client = paramiko.SSHClient() client.load_system_host_keys() client.connect(hostname=hostname, username=username, password=password) transport = client.get_transport() channel = transport.open_session() channel.exec_command(cmd) while True: rl, wl, xl = select.select([channel],[],[],0.0) if len(rl) 0: # Must be stdout print channel.recv(1024) time.sleep(1)

    Read the article

  • Not able to override CSS within IFrame

    - by Madhur Ahuja
    I am using disqus comments for my jekyll blog with some CSS styles overriden in my stylesheet and used to work perfectly. Recently, disqus has introduced a new UI for their comments system which has completely broken the font colors. Since my site has dark background, I am trying to apply styles based on new disqus HTML structure generated. However, it seems that none of my styles get applied. It seems that is because disqus is loaded within iframe. Any ideas how can I fix the font colors. Example of the post: http://www.madhur.co.in/blog/2012/03/27/codeplexmovegit.html UPDATE Based on this question How to apply CSS to iFrame? it seems that you cannot style a child IFrame cross domain. I am wondering how it used to work earlier. Disqus even has documentation on it http://docs.disqus.com/help/69/

    Read the article

  • Drupal htaccess redirect - all files in directory to new directory

    - by hfidgen
    Hiya, I've moved a site to Drupal, but am now getting a lot of 404 errors due to the search engines taking their time to update the indexes. The 404 paths all look similar to this: recipedata/ccp1300006/633_L.jpg recipedata/ccp1500005/risotto.jpg recipedata/ccp1500006/haddock.jpg So I'd like to do some htaccess redirection with mod_rewrite to take care of this lot. All the images DO exist - the path has just changed to /sites/default/files/images/ I've edited a lot of redirects into my htaccess already, but because the ccpXXXXXX directory changes I can't quite figure out the regex. This was my last attempt, but yeah - doesn't work :) Can anyone give me some pointers? RewriteRule ^recipedata/(ccp+)/(.+)$ http://domain.co.uk/sites/default/files/images/$2 [R=301,L] This has to be in the context of the Drupal mod_rewrite rules which already exist <IfModule mod_rewrite.c> RewriteEngine on # Rewrite URLs of the form 'x' to the form 'index.php?q=x'. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] </IfModule> Thanks!

    Read the article

  • How is method group overload resolution different to method call overload resolution?

    - by thecoop
    The following code doesn't compile (error CS0123: No overload for 'System.Convert.ToString(object)' matches delegate 'System.Converter<T,string>'): class A<T> { void Method(T obj) { Converter<T, string> toString = Convert.ToString; } } however, this does: class A<T> { void Method(T obj) { Converter<T, string> toString = o => Convert.ToString(o); } } intellisense gives o as a T, and the Convert.ToString call as using Convert.ToString(object). In c# 3.5, delegates can be created from co/contra-variant methods, so the ToString(object) method can be used as a Converter<T, string>, as T is always guarenteed to be an object. So, the first example (method group overload resolution) should be finding the only applicable method string Convert.ToString(object o), the same as the method call overload resolution. Why is the method group & method call overload resolution producing different results?

    Read the article

  • What's a simple way to web-ify my command-line daemon?

    - by dreeves
    Suppose I have a simple daemon type script that I run on my webserver. I run it in a terminal, with gnu screen, so I can keep an eye on it. That works fine (incidentally, I use this trick). But now suppose I'd like to make a web page where I can keep an eye on my script's output. What's the easiest way to do that? Notes: This is mainly for myself and a couple co-hackers so if websockets is the answer and it only works on Chrome or something, that's acceptable. This question is asking something similar: http://stackoverflow.com/questions/1964494/how-to-make-all-connected-browsers. But I'm hoping for a simpler, quick-and-dirty solution, and especially a general way to quickly do this for any script I might want to keep an eye on from a browswer.

    Read the article

  • Reading chunked data from HttpEntity

    - by Gagan
    I have the following code: HttpClient FETCHER HttpResponse response = FETCHER.execute(host, httpMethod); Im trying to read its contents to a string like this: HttpEntity entity = response.getEntity(); InputStream st = entity.getContent(); StringWriter writer = new StringWriter(); IOUtils.copy(st, writer); String content = writer.toString(); The problem is, when i fetch http://www.google.co.in/ page, the transfer encoding is chunked, and i get only the first chunk. It fetches till first "". How do i get all the chunks at once so i can dump the complete output and do some processing on it ?

    Read the article

  • iframe/lightbox refresh issues

    - by user96828
    Hi Please check out: http://gherkin.co.nz/refresh/ and click on the purple box that says 'Membership chest' You should then see some form fields in an iframe in the lightbox. If you click on the "GO" button, the page will change (currently Not found, which is fine for now). If you click the dark area to close the box, then click the purple card again - it will take you back to the not found page. When called, I want the content to always go back to the page specified in the iframe src, not the last page. Can it go back to the first specified page on this second click? Does that make sense? basically I want the iframe/lightbox to refresh its content each time it is called.

    Read the article

  • Override transparency color when converting transparent PNG to JPG

    - by Alexander Malfait
    I'm using Dragonfly to generate thumbnail images in a Rails app. I'm serving all picture images as JPG's. Now the client is uploading transparent PNG files, like this one: http://www.ibanez.co.jp/products/images/eg2010/ART120_TRF_12_02.png Dragonfly uses RMagick to convert these images to JPG. The problem is that it converts the PNG images to JPG with a black background, and my site's design requires a white background. I've tried to override it like this: encoded_image = Magick::Image.from_blob(image.data).first if encoded_image.format.downcase == format image # do nothing else encoded_image.format = format encoded_image.background_color = "white" encoded_image.transparent_color = "white" encoded_image.to_blob end But the produced JPG images still contain a black background. Does anyone know how to beat RMagick into using a white background when converting the transparent layer? I know I could just serve as PNG, but then the images are 10 times as large, and the site is already pretty bandwidth heavy.

    Read the article

  • How to package up a Python 3 script with modules

    - by Brian
    I created a small script that uses a few 3rd-party modules. I'm not sure how to distribute it. I tried Pyinstaller, but that doesn't seem to work. It can't find the modules. When I give the binary to a co-worker, it says it is looking for files in my home directory ( not his ) and dies. I have found that Pyinstaller is not able to find most modules. I am running Python 3 and installed Pyinstaller with pip from Python 2. It did not work trying to use pip from Python 3. When, I give it a path to my modules, it complains that they are python 3 modules. Just looking for some clarification. Ultimately, I'd like to run this on a linux or OS X box where python and my modules probably won't be installed. I just started Python yesterday and have a ton to learn.

    Read the article

  • focus on page scroll navigation when using iPad

    - by user1154435
    I've used Page Scroller Lite http://pagescroller.com to set up a single-page site at http://www.thestitchshop.co.uk There seems to be an issue that scolling works only once when clicking on a menu item. It will only work again after one touched scrolls the page 'manually' by sliding the finger across the page. Apparently, the issue is that the content gets the focus after the scroll and tapping on navigation then actually taps behind it. I've tried contacting the author of pagecroller, but no luck. So, how do I fix it? I don't have any JS knowledge, so I need a little more help along the way. Many thanks. By the way,I've posted the same question here http://www.sitepoint.com/forums/showthread.php?886838-Problem-with-page-scrolling-on-iPad and I've tried adding the suggested code somehow, but without success.

    Read the article

  • Are there any widely-agreed upon guidelines for rating your language knowledge on a scale?

    - by DVK
    The question was imagined after a co-worker was complaining for an hour about some guy who could not answer basic Java questions on an interview after self-identifying himself as "8 out of 10" on Java. While that was an obvious fib, I personally always had major trouble defining my specific language skills on a sliding scale unless I'm given specific guidelines (remember 40 standard libraries by heart? Able to solve 10 random Project Euler problems in <30 mins each? Can write implementation of A, B and C data-structures from scratch in 30 mins? Know 30% of standard? Can answer 50% of questions on StackOverflow pertaining to the language?) So, I was wondering - is there some sort of commonly accepted methodology for translating such tangible benchmarks into "rate yourself on a language between 1-10"? "Kernighan gets an A, God gets a B, everyone else gets C and less" type jokes are not helpful :)

    Read the article

  • How to search SVN repository for a file when I'm not sure where I put it?

    - by Chris Thornton
    Co-worker is sure he checked in a file: foo_oustanding.dpr but isn't sure when/where (we have lots of "tools" and "utility" ancillary branches, lots of project branches, etc.. I need a way to search the entire repository for this file. I could check the whole source tree out to my HD, but that would take several hours. Is there a faster way? I tried the Repo Browser (Tortoise) and it didn't seem to have a search. I also thought about dumping the log, from the beginning of time. But that seemed silly. I have, at my disposal: Tortoise SVN 1.6 Subversion 1.5.6 running on Apache It runs on a Windows 2003 server. Remote Desktop access to the server, with admin rights. Thanks for any ideas.

    Read the article

  • Dual-line bilingual paragraph in LaTeX

    - by D W
    An interlinear gloss can be used to layout a translation of a document. http://en.wikipedia.org/wiki/Interlinear_gloss Usually this is done word-by-word or morpheme-by-morpheme. However, I would like to do this in a different way, translating entire paragraphs at a time. http://www.optimnem.co.uk/learning/spanish/three-little-pigs.php For now I am not interested in taking into account the order of words or phrases that change order between languages. That is, I don't mind if the words in the paragraph are not aligned or if the length of one paragraph is much longer than the other, causing an overhanging line. As far as I can tell, the following packages do not meet my needs: covingtn.sty cgloss4e.sty gb4e.sty lingmacros.sty - shortex

    Read the article

  • Error in SPUtility send email

    - by Faiz
    Hi, I am trying to send an email in the button click event in the webpart.However, the email sending is failed and error is logged in both sharepoint logs and event viewer of the machine. The error is : Cannot connect to SMTP host Outgoing email settings in central admin is already configured. Alerts are also working fine. Below is my code: StringDictionary headers = new StringDictionary(); headers.Add("to", "[email protected]"); headers.Add("from", "MySharePointEmail@myfatblog.co.uk"); headers.Add("subject", "How to use SendEMail from SPUtility"); headers.Add("content-type", "text/html"); string bodyText = "This is the body of my email, in html format."; SPUtility.SendEmail(SPContext.Current.Web, headers, bodyText); Thanks in advance

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >