Search Results

Search found 3764 results on 151 pages for '$utils escapexml($entry author)'.

Page 17/151 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Is a code review which uses only code comments a good idea?

    - by gaRex
    Preconditions Team uses DVCS IDE supports comments parsing (like TODO and etc.) Tools like CodeCollaborator are expensive for budget Tools like gerrit are too complex for install or not usable Workflow Author publishes somewhere on central repo feature branch Reviewer fetch it and start review In case of some question/issue reviewer create comment with special label, like "REV". Such label MUST not be in production code -- only on review stage: $somevar = 123; // REV Why do echo this here? echo $somevar; When reviewer finish post comments -- it just commits with stupid message "comments" and pushes back Author pulls feature branch back and answer comments in similar way or improve code and push it back When "REV" comments have gone we can think, that review has successfully finished. Author interactively rebases feature branch, squashes it to remove those "comment" commits and now is ready to merge feature to develop or make any action that usualy could be after successful internal review IDE support I know, that custom comment tags are possible in eclipse & netbeans. Sure it also should be in blablaStorm family. Questions Do you think this methodology is viable? Do you know something similar? What can be improved in it?

    Read the article

  • Duplicating someone's content legitimately & writing HTML to support that

    - by Codecraft
    I want to add content from other blogs to my own (with the authors permission) to help build additional relevant content and support articles I've found useful that others have written. I'm looking into how to do this responsibly - ie, by giving the original content author a boost and not competing against them for search traffic which should go to their site. In order to keep my duplicate content out of search, and to hint to the search engines where the original content is to be found i've implemented: <head> <meta name='robots' content='noindex, follow'> <link rel='canonical' href='http://www.originalblog.com/original-post.html' /> </head> Additionally, to boost the original article and to let readers know where it came from i'll be adding something like this: <div> Article originally written by <a href='http://www.authorswebsite.com'>Authors Name</a> and reproduced with permission.<br/> <a href='http://www.originalblog.com/original-post.html' target='new'> Read the original article here. </a> </div> All that remains is a way to 'officially' credit the original author in the HTML for the search spiders to see. Can anyone tell me a way to do this possibly using rel="author" (as far as I can see thats only good for my own original content), or perhaps it doesn't matter given that the reproduced pages will be kept out of search engines? Also, have I overlooked anything in the approach?

    Read the article

  • Does this BSD-like license achieve what I want it to?

    - by Joseph Szymborski
    I was wondering if this license is: self defeating just a clone of an existing, better established license practical any more "corporate-friendly" than the GPL too vague/open ended and finally, if there is a better license that achieves a similar effect? I wanted a license that would (in simple terms) be as flexible/simple as the "Simplified BSD" license (which is essentially the MIT license) allow anyone to make modifications as long as I'm attributed require that I get a notification that such a derived work exists require that I have access to the source code and be given license to use the code not oblige the author of the derivative work to have to release the source code to the general public not oblige the author of the derivative work to license the derivative work under a specific license Here is the proposed license, which is just the simplified BSD with a couple of additional clauses (all of which are bolded). Copyright (c) (year), (author) (email) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The copyright holder(s) must be notified of any redistributions of source code. The copyright holder(s) must be notified of any redistributions in binary form The copyright holder(s) must be granted access to the source code and/or the binary form of any redistribution upon the copyright holder's request. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    Read the article

  • Book Review&ndash;Getting Started With OAuth 2.0

    - by Lori Lalonde
    Getting Started With OAuth 2.0, by Ryan Boyd, provides an introduction to the latest version of the OAuth protocol. The author starts off by exploring the origins of OAuth, along with its importance, and why developers should care about it. The bulk of this book involves a discussion of the various authorization flows that developers will need to consider when developing applications that will incorporate OAuth to manage user access and authorization. The author explains in detail which flow is appropriate to use based on the application being developed, as well as how to implement each type with step-by-step examples. Note that the examples in the book are focused on the Google and Facebook APIs. Personally, I would have liked to see some examples with the Twitter API as well. In addition to that, the author also discusses security considerations, error handling (what is returned if the access request fails), and access tokens (when are access tokens refreshed, and how access can be revoked). This book provides a good starting point for those developers looking to understand what OAuth is and how they can leverage it within their own applications. The book wraps up with a list of tools and libraries that are available to further assist the developer in exploring the APIs supporting the OAuth specification. I highly recommend this book as a must-read for developers at all levels that have not yet been exposed to OAuth. The eBook format of this book was provided free through O'Reilly's Blogger Review program. This book can be purchased from the O'Reilly book store at: : http://shop.oreilly.com/product/0636920021810.do

    Read the article

  • Can I distribute a software with the following permission notice

    - by Parham
    I've recently written a piece of software (without any other contributors) for a company which I part own. I was wondering if I could distribute it with the following permission notice, which is a modified version of the MIT License. Are there any obvious risks if I do distribute with this licence and does it give me the right to reuse the code in other projects? Permission is hereby granted, to any person within CompanyName (the "Company") obtaining a copy of this software and associated documentation files, excluding any third party libraries (the "Software"), to deal with the Software, with limitations restricted to use, copy, modify and merge, the Software may not be published, distributed, sublicensed and/or sold without the explicit permission from AuthorName (the "Author"). This notice doesn't apply to sections of the Software where copyright is held by any persons other than the Author. The Author remains the owner of the Software and may deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    Read the article

  • Does this licensing clause allow redistribution of this application?

    - by George Edison
    As a software developer, I find a frequent need to create icons for my applications. Nothing has ever worked as well as IcoFX for this purpose. Unfortunately, the program is no longer free - but I still have the installer for an older version. My question is whether or not I can distribute copies of the installer. The license agreement contains the following pertinent clauses: 6. All redistributions of the Software's files must retain all copyright notices and web site addresses that are currently in place, and must include this list of conditions without modification. 7. None of the Software's files may be redistributed for profit or as part of another Software package without express written permission of the Author. 10. The Author reserves his rights to modify this agreement in the future. The first two clauses would seem to suggest that I can legally distribute verbatim copies of the installer but the last clause has me confused. If the author modifies the agreement and removes the ability to distribute copies, does it apply to my copy that I downloaded a while back?

    Read the article

  • Importing a large dataset into a database

    - by peaceful
    I'm a beginning programmer in the relevant areas to this question, so if possible, it'd be helpful to avoid assuming I know a lot already. I'm trying to import the OpenLibrary dataset into a local Postgres database. After it's imported, I plan to use it as a starting seed for a Ruby on Rails application that will include information on books. The OpenLibrary datasets are available here, in a modified JSON format: http://openlibrary.org/dev/docs/jsondump I only need very basic information for my application, much less than what is provided in the dumps. I'm only trying to get out book titles, author names, and relationships between books and authors. Below are two typical entries from their dataset, the first for an author, and the second for a book (they seem to have an entry for each edition of a book). The entries seem to lead off with a primary key, and then with a type, before including the actual JSON database dump. /a/OL2A /type/author {"name": "U. Venkatakrishna Rao", "personal_name": "U. Venkatakrishna Rao", "last_modified": {"type": "/type/datetime", "value": "2008-09-10 08:44:01.978456"}, "key": "/a/OL2A", "birth_date": "1904", "type": {"key": "/type/author"}, "id": 99, "revision": 3} /b/OL345M /type/edition {"publishers": ["Social Science Research Project, Dept. of Geography, University of Dacca"], "pagination": "ii, 54 p.", "title": "Land use in Fayadabad area", "lccn": ["sa 65000491"], "subject_place": ["East Pakistan", "Dacca region."], "number_of_pages": 54, "languages": [{"comment": "initial import", "code": "eng", "name": "English", "key": "/l/eng"}], "lc_classifications": ["S471.P162 E23"], "publish_date": "1963", "publish_country": "pk ", "key": "/b/OL345M", "authors": [{"birth_date": "1911", "name": "Nafis Ahmad", "key": "/a/OL302A", "personal_name": "Nafis Ahmad"}], "publish_places": ["Dacca, East Pakistan"], "by_statement": "[by] Nafis Ahmad and F. Karim Khan.", "oclc_numbers": ["4671066"], "contributions": ["Khan, Fazle Karim, joint author."], "subjects": ["Land use -- East Pakistan -- Dacca region."]} The size of the uncompressed dumps are enormous, about 2GB for the authors list, and 18GB for the book editions list. OpenLibrary does not provide any tools for this themselves, they provide a simple unoptimized Python script for reading in sample data (which unlike the actual dumps comes in pure JSON format), but they estimate if that was modified for use on their actual data it would take 2 months (!) to finish loading the data. How can I read this into the database? I assume I'll need to write a program to do this. What language and any guidance on how I should do it to finish in a reasonable amount of time? The only scripting language I have any experience with is Ruby.

    Read the article

  • ** EDITED ** 'NoneType' object has no attribute 'day'

    - by Asinox
    Hi guy, i dont know where is my error, but Django 1.2.1 is give this error: 'NoneType' object has no attribute 'day' when i try to save form from the Administrator Area models.py from django.db import models from django.contrib.auth.models import User class Editorial(models.Model): titulo = models.CharField(max_length=250,help_text='Titulo del editorial') editorial = models.TextField(help_text='Editorial') slug = models.SlugField(unique_for_date='pub_date') autor = models.ForeignKey(User) pub_date = models.DateTimeField(auto_now_add=True) activa = models.BooleanField(verbose_name="Activa") enable_comments = models.BooleanField(verbose_name="Aceptar Comentarios",default=False) editorial_html = models.TextField(editable=False,blank=True) def __unicode__(self): return unicode(self.titulo) def get_absolute_url(self): return "/editorial/%s/%s/" % (self.pub_date.strftime("%Y/%b/%d").lower(), self.slug) class Meta: ordering=['-pub_date'] verbose_name_plural ='Editoriales' def save(self,force_insert=False, force_update=False): from markdown import markdown if self.editorial: self.editorial_html = markdown(self.editorial) super(Editorial,self).save(force_insert,force_update) i dont know why this error, COMPLETED ERROR: Traceback: File "C:\wamp\bin\Python26\lib\site-packages\django\core\handlers\base.py" in get_response 100. response = callback(request, *callback_args, **callback_kwargs) File "C:\wamp\bin\Python26\lib\site-packages\django\contrib\admin\options.py" in wrapper 239. return self.admin_site.admin_view(view)(*args, **kwargs) File "C:\wamp\bin\Python26\lib\site-packages\django\utils\decorators.py" in _wrapped_view 76. response = view_func(request, *args, **kwargs) File "C:\wamp\bin\Python26\lib\site-packages\django\views\decorators\cache.py" in _wrapped_view_func 69. response = view_func(request, *args, **kwargs) File "C:\wamp\bin\Python26\lib\site-packages\django\contrib\admin\sites.py" in inner 190. return view(request, *args, **kwargs) File "C:\wamp\bin\Python26\lib\site-packages\django\utils\decorators.py" in _wrapper 21. return decorator(bound_func)(*args, **kwargs) File "C:\wamp\bin\Python26\lib\site-packages\django\utils\decorators.py" in _wrapped_view 76. response = view_func(request, *args, **kwargs) File "C:\wamp\bin\Python26\lib\site-packages\django\utils\decorators.py" in bound_func 17. return func(self, *args2, **kwargs2) File "C:\wamp\bin\Python26\lib\site-packages\django\db\transaction.py" in _commit_on_success 299. res = func(*args, **kw) File "C:\wamp\bin\Python26\lib\site-packages\django\contrib\admin\options.py" in add_view 777. if form.is_valid(): File "C:\wamp\bin\Python26\lib\site-packages\django\forms\forms.py" in is_valid 121. return self.is_bound and not bool(self.errors) File "C:\wamp\bin\Python26\lib\site-packages\django\forms\forms.py" in _get_errors 112. self.full_clean() File "C:\wamp\bin\Python26\lib\site-packages\django\forms\forms.py" in full_clean 269. self._post_clean() File "C:\wamp\bin\Python26\lib\site-packages\django\forms\models.py" in _post_clean 345. self.validate_unique() File "C:\wamp\bin\Python26\lib\site-packages\django\forms\models.py" in validate_unique 354. self.instance.validate_unique(exclude=exclude) File "C:\wamp\bin\Python26\lib\site-packages\django\db\models\base.py" in validate_unique 695. date_errors = self._perform_date_checks(date_checks) File "C:\wamp\bin\Python26\lib\site-packages\django\db\models\base.py" in _perform_date_checks 802. lookup_kwargs['%s__day' % unique_for] = date.day Exception Type: AttributeError at /admin/editoriales/editorial/add/ Exception Value: 'NoneType' object has no attribute 'day' thanks guys sorry with my English

    Read the article

  • What is the best python module skeleton code?

    - by user213060
    == Subjective Question Warning == Looking for well supported opinions or supporting evidence. Let us assume that skeleton code can be good. If you disagree with the very concept of module skeleton code then fine, but please refrain from repeating that opinion here. Many python IDE's will start you with a template like: print 'hello world' That's not enough... So here's my skeleton code to get this question started: My Module Skeleton, Short Version: #!/usr/bin/env python """ Module Docstring """ # ## Code goes here. # def test(): """Testing Docstring""" pass if __name__=='__main__': test() and, My Module Skeleton, Long Version: #!/usr/bin/env python # -*- coding: ascii -*- """ Module Docstring Docstrings: http://www.python.org/dev/peps/pep-0257/ """ __author__ = 'Joe Author ([email protected])' __copyright__ = 'Copyright (c) 2009-2010 Joe Author' __license__ = 'New-style BSD' __vcs_id__ = '$Id$' __version__ = '1.2.3' #Versioning: http://www.python.org/dev/peps/pep-0386/ # ## Code goes here. # def test(): """ Testing Docstring""" pass if __name__=='__main__': test() Notes: """ ===MODULE TYPE=== Since the vast majority of my modules are "library" types, I have constructed this example skeleton as such. For modules that act as the main entry for running the full application, you would make changes such as running a main() function instead of the test() function in __main__. ===VERSIONING=== The following practice, specified in PEP8, no longer makes sense: __version__ = '$Revision: 1.2.3 $' for two reasons: (1) Distributed version control systems make it neccessary to include more than just a revision number. E.g. author name and revision number. (2) It's a revision number not a version number. Instead, the __vcs_id__ variable is being adopted. This expands to, for example: __vcs_id__ = '$Id: example.py,v 1.1.1.1 2001/07/21 22:14:04 goodger Exp $' ===VCS DATE=== Likewise, the date variable has been removed: __date__ = '$Date: 2009/01/02 20:19:18 $' ===CHARACTER ENCODING=== If the coding is explicitly specified, then it should be set to the default setting of ascii. This can be modified if necessary (rarely in practice). Defaulting to utf-8 can cause anomalies with editors that have poor unicode support. """ There are a lot of PEPs that put forward coding style recommendations. Am I missing any important best practices? What is the best python module skeleton code? Update Show me any kind of "best" that you prefer. Tell us what metrics you used to qualify "best".

    Read the article

  • validation using jquery

    - by fusion
    i'm trying to validate an html page using jquery, but nothing happens. it's a simple page, yet the textboxes aren't validated. this is the code: <link rel="stylesheet" type="text/css" href="style.css" /> <script type="text/javascript" src="~/jquery.js/"></script> <script type="text/javascript" src="~/jquery-validate/jquery.validate.js/"></script> <script type="text/javascript"> $(document).ready(function(){ var validator = $("#submitForm").validate({ debug: true, rules: { author: "required", quote: "required" }, messages: { author: "Name of Author required" quote: "Please enter Quote" }, errorPlacement: function(error, element) { error.appendTo( element.parent().top() ); } ); }); </script> <body> <div class="container"> <div class="center_div"> <h2>Submit Your Quote</h2> <fieldset> <form id="submitForm" action="qinsert.php" method="post"> <div class="error" style="display:none"></div> <div class="field"> <label>Author: </label> <input name="author" type="text" class="required" minLength=3> <span class="error"></span> </div><br /> <div class="field"> <label>Quote: </label> <textarea name="quote" cols=22 class="required" minLength=5></textarea> <span class="error"></span> <br /> </div> <input id="button1" type="submit" value="Submit" class="submit" /><br /> <input id="button2" type="reset" value="Reset" /> </form> </fieldset> </div> </div> what is wrong with the code? thank you!

    Read the article

  • logger chain in python

    - by Zaar Hai
    I'm writing python package/module and would like the logging messages mention what module/class/function they come from. I.e. if I run this code: import mymodule.utils.worker as worker w = worker.Worker() w.run() I'd like to logging messages looks like this: 2010-06-07 15:15:29 INFO mymodule.utils.worker.Worker.run <pid/threadid>: Hello from worker How can I accomplish this? Thanks.

    Read the article

  • How to access 'private functions' in a singleton from another object inside it.

    - by Cedric Dugas
    I am currently trying to create a test suite for my javascript apps. My problem is that, it seems I cannot get access to init() from my utils object, as you can see below: I have my app that follow a singleton pattern: var appModal = function () { var utils = Object.create(moduleUtils); function init(caller, options ) { } }(); My test suite is in moduleUtils, this is a object literal converted to a prototype moduleUtils.debug = { addSlideTest : function(){ /* this function cannot fire init() from appModal */ }}

    Read the article

  • Multiple column subselect in mysql 5 (5.1.42)

    - by rubber boots
    This one seems to be a simple problem, but I can't make it work in a single select or nested select. Retrieve the authors and (if any) advisers of a paper (article) into one row. I order to explain the problem, here are the two data tables (pseudo) papers (id, title, c_year) persons (id, firstname, lastname) plus a link table w/one extra attribute (pseudo): paper_person_roles( paper_id person_id act_role ENUM ('AUTHOR', 'ADVISER') ) This is basically a list of written papers (table: papers) and a list of staff and/or students (table: persons) An article my have (1,N) authors. An article may have (0,N) advisers. A person can be in 'AUTHOR' or 'ADVISER' role (but not at the same time). The application eventually puts out table rows containing the following entries: TH: || Paper_ID | Author(s) | Title | Adviser(s) | TD: || 21334 |John Doe, Jeff Tucker|Why the moon looks yellow|Brown, Rayleigh| ... My first approach was like: select/extract a full list of articles into the application, eg.SELECT q.id, q.title FROM papers AS q ORDER BY q.c_year and save the results of the query into an array (in the application). After this step, loop over the array of the returned information and retrieve authors and advisers (if any), via prepared statement (? is the paper's id) from the link table like:APPLICATION_LOOP(paper_ids in array) SELECT p.lastname, p.firstname, r.act_role FROM persons AS p, paper_person_roles AS r WHERE p.id=r.person_id AND r.paper_id = ? # The application does further processing from here (pseudo): foreach record from resulting records if record.act_role eq 'AUTHOR' then join to author_column if record.act_role eq 'ADVISER' then join to avdiser_column end print id, author_column, title, adviser_column APPLICATION_LOOP This works so far and gives the desired output. Would it make sense to put the computation back into the DB? I'm not very proficient in nontrivial SQL and can't find a solution with a single (combined or nested) select call. I tried sth. like SELECT q.title (CONCAT_WS(' ', (SELECT p.firstname, p.lastname AS aunames FROM persons AS p, paper_person_roles AS r WHERE q.id=r.paper_id AND r.act_role='AUTHOR') ) ) AS aulist FROM papers AS q, persons AS p, paper_person_roles AS r in several variations, but no luck ... Maybe there is some chance? Thanks in advance r.b.

    Read the article

  • scala 2.8 implict java collections conversions

    - by nablik
    I have problem with JavaConversions with 2.8 beta: import scala.collection.JavaConversions._ class Utils(dbFile : File, sep: String) extends IUtils { (...) def getFeatures() : java.util.List[String] = csv.attributes.toList } And then exception: [INFO] Utils.scala:20: error: type mismatch; [INFO] found : List[String] [INFO] required: java.util.List[String] [INFO] def getFeatures() : java.util.List[String] = csv.attributes.toList [INFO]

    Read the article

  • Regular Expressions Cookbook Is in The Money—Win a Copy

    - by Jan Goyvaerts
    %COOKBOOKFRAME%You may have heard some people say that most book authors never get any royalties. That’s not true because most authors get an advance royalty that is paid before the book is published. That’s the author’s main incentive for writing the book, at least as far as money is concerned. (If money is your main concern, don’t write books.) What is true is that most authors never see any money beyond the advance royalty. Royalty rates are very low. A 10% royalty of the publisher’s price is considered normal. The publisher’s price is usually 45% of the retail price. So if you pay full price in a bookstore, the author gets 4.5% of your money. If there’s more than one author, they split the royalty. It doesn’t take a math degree to figure out that a book needs to sell quite a few copies for the royalty to add up to a meaningful amount of money. But Steven and I must have done something right. Regular Expressions Cookbook is in the money. My royalty statement for the 3rd quartier of 2009, which is the 2nd quarter that the book was on the market, came with a check. I actually received it last month but didn’t get around to blogging about. The amount of the check is insignificant. The point is that the balance is no longer negative. I’m taking this opportunity to pat myself and my co-author on the back. To celebrate the occassion O’Reilly has offered to sponsor a give-away of five (5) copies of Regular Expressions Cookbook. These are the rules of the game: You must post a comment to this blog article including your actual name and actual email address. Names are published, email addresses are not. Comments are moderated by myself (Jan Goyvaerts). If I consider a comment to be offensive or spam it will not be published and not be eligible for any prize. If you don’t know what to say in the comment, just wish me a happy 100000nd birthday, so I don’t have to feel so bad about entering the 6-bit era. Each person commenting has only one chance to win, regardless of the number of comments posted. O’Reilly will be provided with the names and email addresses of the winners (and those email addresses only) in order to arrange delivery. Each winner can choose to receive a printed copy or ebook (DRM-free PDF). If you choose the printed book, O’Reilly pays for shipping to anywhere in the world but not for any duties or taxes your country may impose on books imported from the USA. If you choose the ebook, you’ll need to create an O’Reilly account that is then granted access to the PDF download. You can make your choice after you’ve won, so it doesn’t influence your chance of winning. Contest ends 28 February 2010, GMT+7 (Thai time). Chosen by five calls to Random(78)+1 in Delphi 2010, the winners are: 48: Xiaozu 45: David Chisholm 19: Miquel Burns 33: Aaron Rice 17: David Laing Thanks to everybody who participated. The winners have been notified by email on how to collect their prize.

    Read the article

  • Installing chrome in Centos 6.2 (Final)

    - by usjes
    I need to install chrome in a dedicated centos server where I only access via ssh, it doesn't have X or any windows graphical stuff. I need it to be able to pack extensions using google-chrome --pack-extension. I tried adding this to /etc/yum.repos.d/google.repo [google-chrome] name=google-chrome - 32-bit baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386 enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub And then yum install google-chrome-stable, but there's a huge list of dependencies problems: How can I install chrome without breaking anything else? UPDATE: Ok, I installed perl-CGI from .rpm because yum couldn't find it, now dependencies resolve and it show me this list of packages to install: Dependencies Resolved ============================================================================================================================================================================================================================================= Package Arch Version Repository Size ============================================================================================================================================================================================================================================= Installing: google-chrome-stable x86_64 19.0.1084.52-138391 google-chrome 35 M Installing for dependencies: ConsoleKit x86_64 0.4.1-3.el6 base 82 k ConsoleKit-libs x86_64 0.4.1-3.el6 base 17 k GConf2 x86_64 2.28.0-6.el6 base 964 k ORBit2 x86_64 2.14.17-3.1.el6 base 168 k bc x86_64 1.06.95-1.el6 base 110 k cdparanoia-libs x86_64 10.2-5.1.el6 base 47 k cups x86_64 1:1.4.2-44.el6_2.3 updates 2.3 M dbus x86_64 1:1.2.24-5.el6_1 base 207 k desktop-file-utils x86_64 0.15-9.el6 base 47 k ed x86_64 1.1-3.3.el6 base 72 k eggdbus x86_64 0.6-3.el6 base 91 k foomatic x86_64 4.0.4-1.el6_1.1 base 251 k foomatic-db noarch 4.0-7.20091126.el6 base 980 k foomatic-db-filesystem noarch 4.0-7.20091126.el6 base 4.4 k foomatic-db-ppds noarch 4.0-7.20091126.el6 base 19 M ghostscript x86_64 8.70-11.el6_2.6 updates 4.4 M ghostscript-fonts noarch 5.50-23.1.el6 base 751 k gstreamer x86_64 0.10.29-1.el6 base 764 k gstreamer-plugins-base x86_64 0.10.29-1.el6 base 942 k gstreamer-tools x86_64 0.10.29-1.el6 base 23 k iso-codes noarch 3.16-2.el6 base 2.4 M lcms-libs x86_64 1.19-1.el6 base 100 k libIDL x86_64 0.8.13-2.1.el6 base 83 k libXScrnSaver x86_64 1.2.0-1.el6 base 19 k libXfont x86_64 1.4.1-2.el6_1 base 128 k libXv x86_64 1.0.5-1.el6 base 21 k libfontenc x86_64 1.0.5-2.el6 base 24 k libgudev1 x86_64 147-2.40.el6 base 59 k libmng x86_64 1.0.10-4.1.el6 base 165 k libogg x86_64 2:1.1.4-2.1.el6 base 21 k liboil x86_64 0.3.16-4.1.el6 base 121 k libtheora x86_64 1:1.1.0-2.el6 base 129 k libvisual x86_64 0.4.0-9.1.el6 base 135 k libvorbis x86_64 1:1.2.3-4.el6_2.1 updates 168 k mailx x86_64 12.4-6.el6 base 234 k man x86_64 1.6f-29.el6 base 263 k mesa-libGLU x86_64 7.11-3.el6 base 201 k nvidia-graphics195.30-libs x86_64 195.30-120.el6 atrpms 13 M openjpeg-libs x86_64 1.3-7.el6 base 59 k pax x86_64 3.4-10.1.el6 base 69 k phonon-backend-gstreamer x86_64 1:4.6.2-20.el6 base 125 k polkit x86_64 0.96-2.el6_0.1 base 158 k poppler x86_64 0.12.4-3.el6_0.1 base 557 k poppler-data noarch 0.4.0-1.el6 base 2.2 M poppler-utils x86_64 0.12.4-3.el6_0.1 base 73 k portreserve x86_64 0.0.4-4.el6_1.1 base 22 k qt x86_64 1:4.6.2-20.el6 base 4.0 M qt-sqlite x86_64 1:4.6.2-20.el6 base 50 k qt-x11 x86_64 1:4.6.2-20.el6 base 12 M qt3 x86_64 3.3.8b-30.el6 base 3.5 M redhat-lsb x86_64 4.0-3.el6.centos base 24 k redhat-lsb-graphics x86_64 4.0-3.el6.centos base 12 k redhat-lsb-printing x86_64 4.0-3.el6.centos base 11 k sgml-common noarch 0.6.3-32.el6 base 43 k time x86_64 1.7-37.1.el6 base 26 k tmpwatch x86_64 2.9.16-4.el6 base 31 k xdg-utils noarch 1.0.2-17.20091016cvs.el6 base 58 k xml-common noarch 0.6.3-32.el6 base 9.5 k xorg-x11-font-utils x86_64 1:7.2-11.el6 base 75 k xz x86_64 4.999.9-0.3.beta.20091007git.el6 base 137 k xz-lzma-compat x86_64 4.999.9-0.3.beta.20091007git.el6 base 16 k Transaction Summary ============================================================================================================================================================================================================================================= Install 62 Package(s) Is it safe to continue and install all that or could I break something already installed?

    Read the article

  • apt-get is broken

    - by Amol Shinde
    I Cannot install any package in the server, As I am newbie in Server. In Morning I found that some, I am not able to install any package from command line in the server,Now every package is now manually downloaded packages and then installed in the server. Can any one Please tell me what is the issue and how could it be resolved. OS:- Ubuntu 10.04.4 LTS \n \l (64 Bit) Below is the error: iam@ubuntu$ sudo apt-get install pidgin Reading package lists... Done Building dependency tree Reading state information... Done pidgin is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 102 not upgraded. 32 not fully installed or removed. After this operation, 0B of additional disk space will be used. Traceback (most recent call last): File "/usr/bin/apt-listchanges", line 33, in <module> from ALChacks import * File "/usr/share/apt-listchanges/ALChacks.py", line 32, in <module> sys.stderr.write(_("Can't set locale; make sure $LC_* and $LANG are correct!\n")) NameError: name '_' is not defined perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_CTYPE = "UTF-8", LANG = "en_IN" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory Setting up shared-mime-info (0.71-1ubuntu2) ... /var/lib/dpkg/info/shared-mime-info.postinst: line 13: 21935 Segmentation fault update-mime-database.real /usr/share/mime dpkg: error processing shared-mime-info (--configure): subprocess installed post-installation script returned error exit status 139 dpkg: dependency problems prevent configuration of libgtk2.0-0: libgtk2.0-0 depends on shared-mime-info; however: Package shared-mime-info is not configured yet. dpkg: error processing libgtk2.0-0 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of chromium-browser: chromium-browser depends on libgtk2.0-0 (>= 2.20.0); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing chromium-browser (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of chromium-codecs-ffmpeg: chromium-codecs-ffmpeg depends on chromium-browser (>= 4.0.203.0~); however: Package chromium-browser is not configured yet. dpkg: error processing chromium-codecs-ffmpeg (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of chromium-browser-l10n: chromium-browser-l10n depends on chromium-browser (= 18.0.1025.151~r130497-0ubuntu0.10.04.No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already 1); however: Package chromium-browser is not configured yet. dpkg: error processing chromium-browser-l10n (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libevdocument2: libevdocument2 depends on libgtk2.0-0 (>= 2.14.0); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing libevdocument2 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libevview2: libevview2 depends on libevdocument2 (>= 2.29.5); however: Package libevdocument2 is not configured yet. libevview2 depends on libgtk2.0-0 (>= 2.20.0); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing libevview2 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of evince: evince depends on libevdocument2 (>= 2.29.5); however: Package libevdocument2 is not configured yet. evince depends on libevview2 (>= 2.29.No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already 5); however: Package libevview2 is not configured yet. evince depends on libgtk2.0-0 (>= 2.16.0); however: Package libgtk2.0-0 is not configured yet. evince depends on shared-mime-info; however: Package shared-mime-info is not configured yet. dpkg: error processing evince (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of firefox: firefox depends on libgtk2.0-0 (>= 2.20.0); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing firefox (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of gcalctool: gcalctool depends on libgtk2.0-0 (>= 2.18.0); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing gcalctool (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libgdict-1.0-6: libgdict-1.0-6 depends on libgtk2.0-0 (>= 2.18.0); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing libgdict-1.0-6 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of gnome-utils: gnome-utils depends on libgdict-1.0-6 (>= 2.23.90); however: Package libgdict-1.0-6 is not configured yet. gnome-utils depends on libgtk2.0-0 (>= 2.18.0); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing gnome-utils (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of gtk2-engines-pixbuf: gtk2-engines-pixbuf depends on gtk2.0-binver-2.10.0; however: Package gtk2.0-binver-2.10.0 is not installed. Package libgtk2.0-0 which provides gtk2.0-binver-2.10.0 is not configured yet. gtk2-engines-pixbuf depends on libgtk2.0-0 (= 2.20.1-0ubuntu2.1); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing gtk2-engines-pixbuf (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libedataserverui1.2-8: libedataserverui1.2-8 depends on libgtk2.0-0 (>= 2.14.0); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing libedataserverui1.2-8 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libgail18: libgail18 depends on libgtk2.0-0 (= 2.20.1-0ubuntu2.1); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing libgail18 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libgtk2.0-bin: libgtk2.0-bin depends on libgtk2.0-0 (>= 2.20.1-0ubuntu2.1); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing libgtk2.0-bin (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libgtk2.0-dev: libgtk2.0-dev depends on libgtk2.0-0 (= 2.20.1-0ubuntu2.1); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing libgtk2.0-dev (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libnotify-dev: libnotify-dev depends on libgtk2.0-dev (>= 2.10); however: Package libgtk2.0-dev is not configured yet. dpkg: error processing libnotify-dev (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of network-manager-gnome: network-manager-gnome depends on libgtk2.0-0 (>= 2.16.0); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing network-manager-gnome (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of openoffice.org-core: openoffice.org-core depends on libgtk2.0-0 (>= 2.10); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing openoffice.org-core (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of openoffice.org-draw: openoffice.org-draw depends on openoffice.org-core (= 1:3.2.0-7ubuntu4.4); however: Package openoffice.org-core is not configured yet. dpkg: error processing openoffice.org-draw (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of openoffice.org-impress: openoffice.org-impress depends on openoffice.org-core (= 1:3.2.0-7ubuntu4.4); however: Package openoffice.org-core is not configured yet. openoffice.org-impress depends on openoffice.org-draw (= 1:3.2.0-7ubuntu4.4); however: Package openoffice.org-draw is not configured yet. dpkg: error processing openoffice.org-impress (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of pidgin: pidgin depends on libgtk2.0-0 (>= 2.18.0); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing pidgin (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already Setting up update-manager (1:0.134.12.1) ... locale: Cannot set LC_CTYPE to default locale: No such file or directory dpkg: error processing update-manager (--configure): subprocess installed post-installation script returned error exit status 245 No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of update-notifier: update-notifier depends on libgtk2.0-0 (>= 2.14.0); however: Package libgtk2.0-0 is not configured yet. update-notifier depends on update-manager; however: Package update-manager is not configured yet. dpkg: error processing update-notifier (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of xulrunner-1.9.2: xulrunner-1.9.2 depends on libgtk2.0-0 (>= 2.18.0); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing xulrunner-1.9.2 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of xulrunner-1.9.2-dev: xulrunner-1.9.2-dev depends on xulrunner-1.9.2 (= 1.9.2.28+build1+nobinonly-0ubuntu0.10.04.1); however: Package xulrunner-1.9.2 is not configured yet. xulrunner-1.9.2-dev depends on libnotify-dev; however: Package libnotify-dev is not configured yet. dpkg: error processing xulrunner-1.9.2-dev (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of icedtea6-plugin: icedtea6-plugin depends on xulrunner-1.9.2; however: Package xulrunner-1.9.2 is not configured yet. icedtea6-plugin depends on libgtk2.0-0 (>= 2.8.0); however: Package libgtk2.0-0 is not configured yet. dpkg: error processing icedtea6-plugin (--configure): dependency problems - leaving unconfigured Setting up libgweather-common (2.30.0-0ubuntu1.1) ... No apport report written because MaxReports is reached already locale: Cannot set LC_CTYPE to default locale: No such file or directory dpkg: error processing libgweather-common (--configure): subprocess installed post-installation script returned error exit status 245 No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of libgweather1: libgweather1 depends on libgtk2.0-0 (>= 2.11.0); however: Package libgtk2.0-0 is not configured yet. libgweather1 depends on libgweather-common (>= 2.24.0); however: Package libgweather-common is not configured yet. dpkg: error processing libgweather1 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of openoffice.org-style-galaxy: openoffice.org-style-galaxy depends on openoffice.org-core (>= 1:3.2.0~beta); however: Package openoffice.org-core is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing openoffice.org-style-galaxy (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of openoffice.org-common: openoffice.org-common depends on openoffice.org-style-default | openoffice.org-style; however: Package openoffice.org-style-default is not installed. Package openoffice.org-style-galaxy which provides openoffice.org-style-default is not configured yet. Package openoffice.org-style is not installed. Package openoffice.org-style-galaxy which provides openoffice.org-style is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing openoffice.org-common (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already Errors were encountered while processing: shared-mime-info libgtk2.0-0 chromium-browser chromium-codecs-ffmpeg chromium-browser-l10n libevdocument2 libevview2 evince firefox gcalctool libgdict-1.0-6 gnome-utils gtk2-engines-pixbuf libedataserverui1.2-8 libgail18 libgtk2.0-bin libgtk2.0-dev libnotify-dev network-manager-gnome openoffice.org-core openoffice.org-draw openoffice.org-impress pidgin update-manager update-notifier xulrunner-1.9.2 xulrunner-1.9.2-dev icedtea6-plugin libgweather-common libgweather1 openoffice.org-style-galaxy openoffice.org-common E: Sub-process /usr/bin/dpkg returned an error code (1) While typing command in terminal, command is not auto-completing.

    Read the article

  • StyleCop XML Documentation Header - Using 3 /// instead of 2 //

    - by Adam Jenkin
    I am using XML documentation headers on my c# files to pass the StyleCop rule SA1633. Currently, I have to use the 2 slash commenting rule to allow StyleCop to recognize the header. for example: // <copyright file="abc.ascx.cs" company="MyCompany.com"> // MyCompany.com. All rights reserved. // </copyright> // <author>Me</author> This works fine for StyleCop, however I would like to use the 3 slash commenting rule to enable visual studio to understand the comments as XML and provide the XML functionality (highlighting, auto indenting etc) /// <copyright file="abc.ascx.cs" company="MyCompany.com"> /// MyCompany.com. All rights reserved. /// </copyright> /// <author>Me</author> The problem is that when using 3 slashes, StyleCop no longer see's the header and throws the SA1633 warning. Is there anyway to configure stylecop to understand the header is contained in XML using 3 slashes? Thanks, Adam

    Read the article

  • How do I reference Django Model from another model

    - by user313943
    Im looking to create a view in the admin panel for a test program which logs Books, publishers and authors (as on djangoproject.com) I have the following two models defined. class Author(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) email = models.EmailField() def __unicode__(self): return u'%s %s' % (self.first_name, self.last_name) class Book(models.Model): title = models.CharField(max_length=100) authors = models.ManyToManyField(Author) publisher = models.ForeignKey(Publisher) publication_date = models.DateField() def __unicode__(self): return self.title What I want to do, is change the Book model to reference the first_name of any authors and show this using admin.AdminModels. #Here is the admin model I've created. class BookAdmin(admin.ModelAdmin): list_display = ('title', 'publisher', 'publication_date') # Author would in here list_filter = ('publication_date',) date_hierarchy = 'publication_date' ordering = ('-publication_date',) fields = ('title', 'authors', 'publisher', 'publication_date') filter_horizontal = ('authors',) raw_id_fields = ('publisher',) As I understand it, you cannot have two ForeignKeys in the same model. Can anyone give me an example of how to do this? I've tried loads of different things and its been driving me mad all day. Im pretty new to Python/Django. Just to be clear - I'd simply like the Author(s) First/Last name to appear alongside the book title and publisher name. Thanks

    Read the article

  • problems with infinite loop

    - by Tom
    function addAds($n) { for ($i=0;$i<=$n;$i++) { while($row=mysql_fetch_array(mysql_query("SELECT * FROM users"))) { $aut[]=$row['name']; } $author=$aut[rand(0,mysql_num_rows(mysql_query("SELECT * FROM users")))]; $name="pavadinimas".rand(0,3600); $rnd=rand(0,1); if($rnd==0) { $type="siulo"; } else { $type="iesko"; } $text="tekstas".md5("tekstas".rand(0,8000)); $time=time()-rand(3600,86400); $catid=rand(1,9); switch ($catid) { case 1: $subid=rand(1,8); break; case 2: $subid=rand(9,16); break; case 3: $subid=rand(17,24); break; case 4: $subid=rand(25,32); break; case 5: $subid=rand(33,41); break; case 6: $subid=rand(42,49); break; case 7: $subid=rand(50,56); break; case 8: $subid=rand(57,64); break; case 9: $subid=rand(65,70); break; } mysql_query("INSERT INTO advert(author,name,type,text,time,catid,subid) VALUES('$author','$name','$type','$text','$time','$catid','$subid')") or die(mysql_error()); } echo "$n adverts successfully added."; } The problem with this function, is that it never loads. As I noticed, my while loop causes it. If i comment it, everything is ok. It has to get random user from my db and set it to variable $author.

    Read the article

  • How can I remove duplicate nodes in XQuery?

    - by Brabster
    I have an XML document I generate on the fly, and I need a function to eliminate any duplicate nodes from it. My function looks like: declare function local:start2() { let $data := local:scan_books() return <books>{$data}</books> }; Sample output is: <books> <book> <title>XML in 24 hours</title> <author>Some Guy</author> </book> <book> <title>XML in 24 hours</title> <author>Some Guy</author> </book> </books> I want just the one entry in my books root tag, and there are other tags, like say pamphlet in there too that need to have duplicates removed. Any ideas? Updated following comments. By unique nodes, I mean remove multiple occurrences of nodes that have the exact same content and structure.

    Read the article

  • Difference between KeywordQuery, FullTextQuerySearch type for Object Model and Web service Query

    - by Raghu
    Initially I believed these 3 to be doing more or less the same thing with just the notation being different. Until recently, when i noticed that their does exists a big difference between the results of the KeyWordQuery/FullTextQuerySearch and Web service Query. I used both KeywordQuery and FullText method to search of the the value of a customColumn XYZ with value (ASDSADA-21312ASD-ASDASD):- When I run this query as:- FullTextSqlQuery:- FullTextSqlQuery myQuery = new FullTextSqlQuery(site); { // Construct query text String queryText = "Select title, path, author, isdocument from scope() where freetext('ASDSADA-21312ASD-ASDASD') "; myQuery.QueryText = queryText; myQuery.ResultTypes = ResultType.RelevantResults; }; // execute the query and load the results into a datatable ResultTableCollection queryResults = myQuery.Execute(); ResultTable resultTable = queryResults[ResultType.RelevantResults]; // Load table with results DataTable queryDataTable = new DataTable(); queryDataTable.Load(resultTable, LoadOption.OverwriteChanges); I get the following result representing the document. * Title: TestPDF * path: http://SharepointServer/Shared Documents/Forms/DispForm.aspx?ID=94 * author: null * isDocument: false Do note the Path and isDocument fields of the above result. Web Service Method Then I tried a Web Service Query method. I used Sharepoint Search Service Tool available at http://sharepointsearchserv.codeplex.com/ and ran the same query i.e. Select title, path, author, isdocument from scope() where freetext('ASDSADA-21312ASD-ASDASD'). This time I got the following results:- * Title: TestPDF * path: http://SharepointServer/Shared Documents/TestPDF.pdf * author: null * isDocument: true Again note the path. While the search results from 2nd method are useful as they provide me the file path exactly, I can't seem to understand why is the method 1 not giving me the same results? Why is there a discrepancy between the two results?

    Read the article

  • Parsing xml with php and xpath

    - by Hyung Suh
    Hey guys, I'm trying to parse an xml file to return a item with a specific id only, but having trouble making it work. here's what I have in php $xml_str = file_get_contents("test.xml"); $xml = simplexml_load_string($xml_str); $albid = $_GET['id']; $nodes = $xml->xpath('//library/book[@id=1]'); foreach($nodes as $node) { echo $node['title'].'<br/>'; } First, the php is not returning anything from the xml file. What would I need to fix to return the data? Also, how would I enter $albid into the xpath so that the id will be retrieved from the link? Any pointers in the right direction would be appreciated. Thanks! --and here's the sample xml file-- <library> <book id="1"> <title>PHP and MySQL</title> <author fname="miguel" lname="alvarez">Miguel Alvarez</author> </book> <book id="2"> <title>JAVA 123</title> <author fname="william" lname="vega">WIlliam Vega</author> </book>

    Read the article

  • Authentication using cookie key with asynchronous callback

    - by greg
    I need to write authentication function with asynchronous callback from remote Auth API. Simple authentication with login is working well, but authorization with cookie key, does not work. It should checks if in cookies present key "lp_login", fetch API url like async and execute on_response function. The code almost works, but I see two problems. First, in on_response function I need to setup secure cookie for authorized user on every page. In code user_id returns correct ID, but line: self.set_secure_cookie("user", user_id) does't work. Why it can be? And second problem. During async fetch API url, user's page has loaded before on_response setup cookie with key "user" and the page will has an unauthorized section with link to login or sign on. It will be confusing for users. To solve it, I can stop loading page for user who trying to load first page of site. Is it possible to do and how? Maybe the problem has more correct way to solve it? class BaseHandler(tornado.web.RequestHandler): @tornado.web.asynchronous def get_current_user(self): user_id = self.get_secure_cookie("user") user_cookie = self.get_cookie("lp_login") if user_id: self.set_secure_cookie("user", user_id) return Author.objects.get(id=int(user_id)) elif user_cookie: url = urlparse("http://%s" % self.request.host) domain = url.netloc.split(":")[0] try: username, hashed_password = urllib.unquote(user_cookie).rsplit(',',1) except ValueError: # check against malicious clients return None else: url = "http://%s%s%s/%s/" % (domain, "/api/user/username/", username, hashed_password) http = tornado.httpclient.AsyncHTTPClient() http.fetch(url, callback=self.async_callback(self.on_response)) else: return None def on_response(self, response): answer = tornado.escape.json_decode(response.body) username = answer['username'] if answer["has_valid_credentials"]: author = Author.objects.get(email=answer["email"]) user_id = str(author.id) print user_id # It returns needed id self.set_secure_cookie("user", user_id) # but session can's setup

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >