Daily Archives

Articles indexed Friday May 28 2010

Page 15/107 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Git Use Remote Source Durring Push

    - by ThinkBohemian
    I have a local git repository a "central" repo at github. I'm working on a part of a project, while a friend is working on a related piece that is its entirely seperate repo, is it possible for me to simply link directly to my friends repo? For example, the app is called widgets. I have all my code in widgets/app/mycode and my friend is writing code that goes into widgets/plugins/awesome/hiscode. I want to be able to always have http://github.com/mycode/widgets/plugins/hiscode to be a direct link or clone to http://github.com/hiscode/awesome ? It could be possible i'm missing something basic in my question or knowledge of git, if so please ask, and i'll be happy to try to fill in the blanks. I am deploying to my production site via capistrano, so maybe a script of some kind may be easier?? I don't know (that's why i'm posting)!!

    Read the article

  • Installing PHP DOM functions on Apache

    - by user352556
    I have just moved my code over to a new server (running on Apache 2.2.3), and PHP's DOM functions are now returning "Fatal error: Class 'DOMDocument' not found". I did some research and it appears that the installation I am now on does not have PHP's DOM functions enabled. I need to enable these functions, so what is the quickest way to go about this? Is it doable from a configuration file or will it require installation of extensions? Thanks!

    Read the article

  • How do I detect unicode characters in a Java string to resolve sax parser exception

    - by Madhumita
    Suppose I have a string that contains '¿'. How would I find all those unicode characters? Should I test for their code? How would I do that? I want to detect it to avoid sax parser exception which I am getting it while parsing the xml saved as a clob in oracle 10g database. Exception javax.servlet.ServletException: org.xml.sax.SAXParseException: Invalid byte 1 of 1-byte UTF-8 sequence.

    Read the article

  • AppEngine BlobStore upload failing with a request that works in the Development Environment

    - by Joe Ludwig
    I have an AppEngine application that uses the blobstore to store user-provided image data. When I upload images to that application from a form in Chrome it works fine. When I try to upload an image from an Android application it fails. Both methods work fine if I am running against the development server, but the Android upload doesn't work against the live service. This is the request from Chrome: POST /_ah/upload/?userToken=11001/AMmfu6ZCyMQQ9YdiXal3SmSXIRTQIuSRXkNc-i3JmU0fqx_kJbUJ2OMLcS2lXhVJSK4qs7regViTKzOPz5ejoZYi0nAD5o8vNltiOViQw6DZO7_byZz3Ut0/ALBNUaYAAAAAS_lusgPMAGmpPrg0BuNsJyymX-57ob4i/ HTTP/1.1 Host: photohuntservice.appspot.com Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1064 Safari/532.5 Referer: http://photohuntservice.appspot.com/debug_newpuzzle?userToken=11001 Content-Length: 60360 Cache-Control: max-age=0 Origin: http://photohuntservice.appspot.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundarybl05YLmLbFRf2MzN Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 ------WebKitFormBoundarybl05YLmLbFRf2MzN Content-Disposition: form-data; name="userToken" 11001 ------WebKitFormBoundarybl05YLmLbFRf2MzN Content-Disposition: form-data; name="img"; filename="Photo_020908_001.jpg" Content-Type: image/jpeg <image data> ------WebKitFormBoundarybl05YLmLbFRf2MzN Content-Disposition: form-data; name="longitude" -122.084095 ------WebKitFormBoundarybl05YLmLbFRf2MzN Content-Disposition: form-data; name="latitude" 37.422006 ------WebKitFormBoundarybl05YLmLbFRf2MzN-- This is the request from my client (which is written in Java on Android, but I don't think that's relevant): POST /_ah/upload/?userToken=11001/AMmfu6Zf9an6AU4lT9UuhIpxOZyOYb1LMwimFpeSh8zr6J1sX9F2ddJW3Qlsw0kwV3oALv-TNPWRQ6g4_Dgwk0UTwF47bbc78Yl44kDeV69MydTuR3N46S4/ALBNUaYAAAAAS_mMr3CYqTg3aVBDjhRxP0DyyRdvotyG/ HTTP/1.1 Content-Type: multipart/form-data;boundary=----WebKitFormBoundaryhdyNAhmOouRDGErG Cache-Control: max-age=0 Accept: */* Origin: http://photohuntservice.appspot.com Connection: keep-alive Referer: http://photohuntservice.appspot.com/getuploadurl?userToken=11001 Content-Length: 2638 Host: photohuntservice.appspot.com User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4) Expect: 100-Continue ------WebKitFormBoundaryhdyNAhmOouRDGErG Content-Disposition: form-data; name="userToken" 11001 ------WebKitFormBoundaryhdyNAhmOouRDGErG Content-Disposition: form-data; name="img";filename="PhotoHunt.jpg" Content-Type: image/jpeg <image data> ------WebKitFormBoundaryhdyNAhmOouRDGErG Content-Disposition: form-data; name="latitude" 37.422006 ------WebKitFormBoundaryhdyNAhmOouRDGErG Content-Disposition: form-data; name="longitude" -122.084095 ------WebKitFormBoundaryhdyNAhmOouRDGErG-- In both cases the AppEngine Python code to catch the request is the same: class UploadPuzzle( blobstore_handlers.BlobstoreUploadHandler ): def post(self): upload_files = self.get_uploads( ) The problem is that when running on the production AppEngine service self.get_uploads() returns an empty list when the request is made from my client app. Both requests return what I expect (a list with one blob_info in it) on the development server, and Chrome returns what I expect in both cases.

    Read the article

  • Setting attributes of a class during construction from **kwargs

    - by Carson Myers
    Python noob here, Currently I'm working with SQLAlchemy, and I have this: from __init__ import Base from sqlalchemy.schema import Column, ForeignKey from sqlalchemy.types import Integer, String from sqlalchemy.orm import relationship class User(Base): __tablename__ = "users" id = Column(Integer, primary_key=True) username = Column(String, unique=True) email = Column(String) password = Column(String) salt = Column(String) openids = relationship("OpenID", backref="users") User.__table__.create(checkfirst=True) #snip definition of OpenID class def create(**kwargs): user = User() if "username" in kwargs.keys(): user.username = kwargs['username'] if "email" in kwargs.keys(): user.username = kwargs['email'] if "password" in kwargs.keys(): user.password = kwargs['password'] return user This is in /db/users.py, so it would be used like: from db import users new_user = users.create(username="Carson", password="1234") new_user.email = "[email protected]" users.add(new_user) #this function obviously not defined yet but the code in create() is a little stupid, and I'm wondering if there's a better way to do it that doesn't require an if ladder, and that will fail if any keys are added that aren't in the User object already. Like: for attribute in kwargs.keys(): if attribute in User: user.__attribute__[attribute] = kwargs[attribute] else: raise Exception("blah") that way I could put this in its own function (unless one hopefully already exists?) So I wouldn't have to do the if ladder again and again, and so I could change the table structure without modifying this code. Any suggestions?

    Read the article

  • Strange problem with UIDocumentInteractionController

    - by Tùng Ð?
    I don't know what wrong with this code but everytime when I run the app, after the Menu is shown, the app crash. NSString * path = [[NSBundle mainBundle] pathForResource:@"tung" ofType:@"doc"]; UIDocumentInteractionController *docController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:path]]; docController.delegate = self; //[docController presentPreviewAnimated:YES]; CGRect rect = CGRectMake(0, 0, 300, 300); [docController presentOptionsMenuFromRect:rect inView:self.view animated:YES]; Error I got: * Terminating app due to uncaught exception 'NSGenericException', reason: '-[UIPopoverController dealloc] reached while popover is still visible.' What should I do now ?

    Read the article

  • Get name and value from the input tag

    - by DroidIn.net
    Before you say "oh no, not again" here I'm stating my case. I'm parsing part of HTML output and the only thing I'm interested in is name and value attributes of each <input/ tag. HTML is actually HTML fragment, may not be well-formed. I don't have DOM or HTML parser and I don't try to parse nested elements anyway. The problem is that I don't know the order or number of attributes so it could be <input name="foo" value="boo"/> or <input type="hidden" name=foo> or <input id=blah value='boo' src="image.png" name="foo" type="img"/>. Is there a single regular expression that would get me values of name and value attribute in predictable order? I wouldn't have asked the question if I could assume that name attribute always precedes value but unfortunately this is not the case

    Read the article

  • Advanced Rails Routing of short URL's and usernames off of root url

    - by Michael Waxman
    I want to have username URL's and Base 58 short URL's to resources both off of the root url like this: http://mydomain.com/username #=> goes to given user http://mydomain.com/a3x9 #=> goes to given story I am aware of the possibilities of a user names conflicting with short urls, and I have a workaround, but what I can't figure out is the best way to set this up in rails. Can I do it in rails routes? Should I do something with a piece of Rack middleware? Should I set up a routing controller? Please let me know the best way to do this. Thanks so much!

    Read the article

  • Why does Python's 'for ... in' work differently on a list of values vs. a list of dictionaries?

    - by Code Duck
    I'm wondering about some details of how for ... in works in Python. My understanding is for var in iterable on each iteration creates a variable, var, bound to the current value of iterable. So, if you do for c in cows; c = cows[whatever], but changing c within the loop does not affect the original value. However, it seems to work differently if you're assigning a value to a dictionary key. cows=[0,1,2,3,4,5] for c in cows: c+=2 #cows is now the same - [0,1,2,3,4,5] cows=[{'cow':0},{'cow':1},{'cow':2},{'cow':3},{'cow':4},{'cow':5}] for c in cows: c['cow']+=2 # cows is now [{'cow': 2}, {'cow': 3}, {'cow': 4}, {'cow': 5}, {'cow': 6}, {'cow': 7} #so, it's changed the original, unlike the previous example I see one can use enumerate to make the first example work, too, but that's a different story, I guess. cows=[0,1,2,3,4,5] for i,c in enumerate(cows): cows[i]+=1 # cows is now [1, 2, 3, 4, 5, 6] Why does it affect the original list values in the second example but not the first?

    Read the article

  • Repeated Rake Task Using Delayed Job

    - by bob
    Hello, I am currently using the delayed_job gem and I was wondering how to run a rake task every 5 minutes. I want to run "rake ts:reindex RAILS_ENV=production" every 5 minutes but I'm not sure where to start. I really don't have much more I can say about this because I am VERY inexperienced in this area of rails development.

    Read the article

  • Loading...Please wait for UIWebView - iPhone

    - by niha7229
    Hi guys, In Safari and other browsers, there is a bar that would indicate the percentage of the loading progress, and I, myself, trying to implement something similiar on iPhone, when loading some content in UIWebView, I would like the app to indicate the percentage of the page being loaded. I tried some google search and realize we could use NSURLConnection to read only the header and get the Content-Length ( but don't know how to, I read the Apple's NSURLConnection docs but probably I missed something ... ). And the size ( kb ) which UIWebView had loaded, seem like UIWebView don't support it for the public API... I hope this would be complete in some other ways than I thought, so if you have any ideas, please throw it out, thanks for your patient reading. P.S : I could just show an Activities Indicator for users with the long loading progress actions of the UIWebView but I just want to go further with the loading percentage bar :). Regards.

    Read the article

  • Good use of recursion in chess programming?

    - by JDelage
    Hi, As part of a homework assignment, I have to program a simple chess game in Java. I was thinking of taking the opportunity to experiment with recursion, and I was wondering if there's an obvious candidate in chess for recursive code? Thank you, JDelage

    Read the article

  • Nested <a> and <span> challenge

    - by PaddyO
    Hi all, Trying in vain to get a nested link working within a nested span. This is a working test page for the code below to explain what I'm trying to do. Any ideas on how to get this working in valid html? I guess it's either a nesting order or style syntax thing but I am at a loss. Any thoughts much appreciated. <div id="greyback"> <ul id="scrollbox"> <li class="listcat">List header</li> <li><a class="menu" href="#freeze">List item 1<span><b>This text has popped up because you have clicked the list item, which has an "a" tag and now has :focus. That "a" tag is the first of two.</b><br><br>What I am trying to do is to set the second "a" tag as a DIFFERENT "embedded" link in this box<span style="color: blue; background-color: yellow;">eg, here<a href="http://www.conservationenterprises.com" target="blank">This is the second (nested) "a" tag in this html nest. It is a link to an external site. Instead of this being an always-visible link, I want it to sit within the yellow box in the first span (click the List item 1 to display).</a></span> </a></span> </li> </a></span> </li> </ul> </div> and the CSS: #scrollbox {margin: 0 auto; margin-top: 1em; margin-bottom: 1em; width:19em; height:auto; max-height: 21em; overflow:auto; border-bottom: 0.1em solid #FFA500; border-top: 0.1em solid #FFA500;} #scrollbox a {float: left; color:#000000; text-decoration:none; width:18em; height: auto; margin-bottom: 0.5em; font-family: Arial, sans-serif; font-size: 0.9em; text-align:left;} #scrollbox a.menu {} #scrollbox a span {display:none; position:absolute; left:0em; top:0;} #scrollbox a span img {float: right; border:0; max-width:7.5em;} #scrollbox a:hover {border: 0; color: #7ebb11; font-size:0.9em;} #scrollbox a:hover span {border: 0; color: #535353;} #scrollbox a span:focus {color: blue;} #scrollbox a:active {border:none; color: #535353; text-decoration: none;} #scrollbox a:focus {border:0em solid #000; outline:0;} #scrollbox a:active span, #scrollbox li a:active span, #scrollbox a:focus span, #scrollbox li a:focus span {display: block; width: 52.5em; min-height: 20em; height: auto; left: 1.5em; top:18em; z-index:10; font-size:0.9em; text-align: left; padding: 1em; padding-bottom: 0em; background-color: #c3FFe3; color: #535353; border: solid #FFA500 0.25em;} #scrollbox li a:active span span, #scrollbox li a:focus span span{display: block; width: auto; height: auto; min-height: 2em; left: 25em; top:10em; z-index:10; font-size:0.9em; text-align: left; padding: 1em; padding-bottom: 0em; background-color: transparent; color: #535353; border: dashed red 1px;} .ul#scrollbox {padding-left: 0.1em;} #scrollbox li {float:left; list-style: none; background: url(blank.png) no-repeat left center; margin-left: 0em; font-family:Arial, sans-serif; font-size: 0.9em;} #scrollbox li.listcat {float: left; text-align:left; width: 18em; margin-left: 0em; margin-top: 0.1em; margin-bottom: 0.3em; padding-top:0.5em; color: green; font-size: 0.9em; font-weight:bold;} Cheers Patrick.

    Read the article

  • how to write MPEG4 video files from stream in vc++ directshow

    - by maxy
    hai all... Am writing simple application for capturing video from camera and save in .WMV files using vc++ Directshow.i done this task.bt i need to write file as MPEG4 file type. can anyone help me. CAMERA---->SAMPLEGRABBER---->getting streams from sample graaper.. i get stream from camera like this. kndly help me thanks

    Read the article

  • PHP APC and Pecl upload progress returning false/null.

    - by Keyo
    This is a long shot. I believe this might be suhosin patch issue. Here is my php from codeigniter: public function uploadprogress($id) { if ($id) { header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); echo json_encode(apc_fetch('upload_'.$id)); exit(); } } public function uploader() { $this->load->view('myid/' . $this->router->class . '_uploader'); //phpinfo(); } script: <script type="text/javascript"> $(document).ready(function(){ var progress_key = $('#progress_key').val(); // this sets up the progress bar $('#uploadform').submit(function() { setTimeout(beginUpload,1500); return; }); function beginUpload() { $("#progressbar").progressbar({ value:0}).fadeIn(); var i = setInterval(function() { $.getJSON("/myid/videos/uploadprogress/" + progress_key, function(data) { alert('data'); if (data == null) { clearInterval(i); location.reload(true); return; } var response; eval ("response = " + data); if (!response) return; var percentage = Math.floor(100 * parseInt(response['bytes_uploaded']) / parseInt(response['bytes_total'])); $("#progressbar").progressbar({value:percentage}); }, 1500); }); } }); </script> Has anyone had strange troubles with this before? The upload key is the same on the view and the uploadprogress method. I've Tried apc and pecl upload-progress both return false or null. I wondering if it's just suhosin patch messing up everything?

    Read the article

  • Installing TKInter for Python 2.6.5

    - by Azfar
    Well today's been a bit of shock. After running port -v selfupdate followed by an attempt to run sudo port install py26-ipython MacPorts went around installing a whole host of stuff, including updating my Python from 2.6.4 to 2.6.5. It's nice but unexpected in a creepy way. So I tried to install TKInter using MacPorts with port search tkinter yielding: py-tkinter @2.4.6 (python, graphics) Python bindings to the Tk widget set py25-tkinter @2.5.4 (python, graphics) This is a stub. tkinter is now built with python25 Found 2 ports. So I tried sudo port install py25-tkinter and then it tries to install Python 2.5.5. There must be an easier way to install TkInter without being faffed around... help please?

    Read the article

  • Do you ever feel confident in your skills?

    - by Gary Willoughby
    As a self taught developer i always find myself questioning my skill and knowledge and always feel like i am falling behind in using new technology. Over a period of nearly 9 years i've studied most mainstream languages (especially C based ones), used lots of different OSes, read and absorbed many books and even written one myself. But i still feel i'm usless! Do professional developers ever get to the stage where they feel confident that they know what they are doing and are confident when submitting solutions/code? When do you know you're good enough?

    Read the article

  • Microsoft Reporting 2005 and Report Viewer Report ASP.Net Session Has Expired on Load

    - by ThaKidd
    At my job, I have been tasked with fixing an error with our reporting server. That error is ASP.Net Session Has Expired. This error occurs when the Visual Studio ReportViewer 2005 Control attempts to load a report. We are trying to host this report to users hitting our Internet exposed Windows 2003 Server running IIS 6.0. The reportviewer control is attempting to load this report from a second server running Microsoft SQL 2005 w/Reporting Services. The SQL server is not exposed to the Internet. Here is the weird thing. This error never occurs on the development box. When it is transferred to the production IIS server, the error starts to occur. It only happens every time the report is first loaded. If the browser's refresh button is clicked 5-10 times, the report will finally load correctly. I have reproduced this same error on the latest version of Mozilla Firefox, IE 7, and IE 8. The report only takes 10-20 seconds to load. I have tried timeouts in the 300+ second range on the reporting server/iis production server. I have tried a few options like Async (which causes images not to load properly) and setting the session mode to iproc with a high timeout value in the Reporting Server's web.config. I have also tried using the reporting server's IP address in the report viewer's code instead of the server name. I plan on verifying a picture loading issue which I also read about tomorrow when I get into work. I am unsure what service packs Visual Studio 2005 and the MSSQL server are running. Was an update released to fix this problem that I could not find? Does anyone have a fix for this?

    Read the article

  • How do I define my own operators in the Io programming language?

    - by klep
    I'm trying to define my own operator in Io, and I'm having a hard time. I have an object: MyObject := Object clone do( lst := list() !! := method(n, lst at(n)) ) But when I call it, like this: x := MyObject clone do(lst appendSeq(list(1, 2, 3))) x !! 2 But I get an exception that argument 0 to at must not be nil. How can I fix?

    Read the article

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