Search Results

Search found 1736 results on 70 pages for 'photos'.

Page 12/70 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • JavaScript Array Problem

    - by JasonS
    Hi, This wasn't the question I was going to ask but I have unexpectedly run aground with JavaScript arrays. I come from a PHP background and after looking at a few websites I am none the wiser. I am trying to create a multi-dimensional array. var photos = new Array; var a = 0; $("#photos img").each(function(i) { photos[a]["url"] = this.src; photos[a]["caption"] = this.alt; photos[a]["background"] = this.css('background-color'); a++; }); Error message: photos[a] is undefined. How do I do this. Thanks.

    Read the article

  • How to see the lists of my videos in Shotwell?

    - by Joe Cabezas
    I made an import from my camera (photos and videos), and after imported them, the "last sync" item, shows me the photos and videos i've recently imported. But if I click any Event in the "Events" tree (left side), only shows my photos... How to see my videos imported that day also? using shotwell 0.12.3 (default in ubuntu 12.10) pics: Last import preview: http://i.stack.imgur.com/uVnQR.png Event preview: http://i.stack.imgur.com/WTuSg.png PD: sorry I have no rights yet to post pictures

    Read the article

  • shotwell does not copy, but import them without copying

    - by user65764
    I tryed to import photos from my external harddisk into shotwell. After doing this, I disconected the harddisk and the photos disapeared immediately. I saw that the photos had been importet into the database without being copied. Copying the whole file into the picturefile is possible, but I would like to have to same fileorder in my library. Not a mixed up (organised by date (shotwell) and organised by filenames (my old organisation). It has not been any problem copying photos from a dvd. Is there any possibility to have the same filestructure for all fotos or is there a bug in shotwell? Thanks

    Read the article

  • Paperclip and xhr.sendAsBinary

    - by Denis
    Hi, I use paperclip to add a file to my model. I want to use the new feature of firefox 3.6, xhr.sendAsBinary, to send a file with an ajax request. Here is how I build my request : var xhr = new XMLHttpRequest(); xhr.open("POST", "/photos?authenticity_token=" + token + "&photo[name]=" + img.name + "&photo[size]=" + img.size); xhr.overrideMimeType('text/plain; charset=x-user-defined-binary'); xhr.sendAsBinary(bin); name and size are saved in my model without problem but the file itself is not catched by paperclip. my model class Photo < ActiveRecord::Base has_attached_file :photo, :styles => { :medium => "300x300>", :thumb => "100x100>" } end the migration def self.up add_column :photos, :photo_file_name, :string add_column :photos, :photo_content_type, :string add_column :photos, :photo_file_size, :integer add_column :photos, :photo_updated_at, :datetime end and my controller # POST /photos # POST /photos.xml def create @photo = Photo.new(params[:photo]) respond_to do |format| if @photo.save format.html { redirect_to(@photo, :notice => 'Photo was successfully created.') } format.xml { render :xml => @photo, :status => :created, :location => @photo } else format.html { render :action => "new" } format.xml { render :xml => @photo.errors, :status => :unprocessable_entity } end end end Any idea how to solve this issue? Thanks

    Read the article

  • Building a community photography site, where can I store my photos online?

    - by thanos panousis
    I am in the process of laying down the requirements for a photography community site. An important feature to investigate would be allowing more fotos/account than rival sites around my country's internet. What are the possibilities out there? Should I go for something like amazon S3, or is there anything that offers more image-related features? I am mostly interested in low price per GB (storage and transfer out).

    Read the article

  • What can I do to avoid losing original resolution when uploading or exporting photos from Picasa?

    - by Janet Levin
    I'm not a programmer, and/but after multiple email discussions and google searches confirmed the problem I'm describing, and after making changes in picasa preferences with no change in resolution loss (from say, 800kb original image to 235kb after export or upload), I'm at a dead end and thinking the answer may lie among you folks, even though I barely understand the language here.

    Read the article

  • Trying to create a flash app that dispalys photos from facebook.

    - by Cam
    Hi there, i'm intending to create a flash app that pulls images from facebook and displays them in a slideshow format. Has some here tried this? or does anyone have suggestions/advice/links on where to find information on this. i have had a look at; http://components.zerofractal.com/FacebookBridge/ has anyone succesfully used this? i couldn't find examples. and http://www.adobe.com/devnet/facebook/ however most examples i found are created using flex. any help appreciated, Thanks Cam

    Read the article

  • In java web application, where should i store users photos?

    - by stunaz
    Hello, this questions may be stupid, but i dont really see how to resolve it : lest say that in my application, i have a user. This user edit his profile, and need to edit his avatar. Where should i store the avatar file? first of all i was saving all the files in src\main\webapp\resources , but each time i redeploy that folder empties. so i dedide to place in an other location : c:\wwwdir\resources, but i can't link local resources from remote pages, so i was not able to display any avatar . any idea? advise? link?

    Read the article

  • RESTful services architecture question

    - by abovesun
    This is question more about service architecture strategy, we are building big web system based on rest services on back end. And we are currently trying to build some standard internal to follow while developing rest services. Some queries returns list of entities, for example lets consider we have image galleries retrieving service: /gell_all_galeries, returning next response: <galleries> <gallery> <id>some_gallery_id</id> <name>my photos</name> <photos> <photo> <id>123</id> <name>my photo</name> <location>http://mysite/photo/show/123</location> ...... <author> <id>some_id</id> <name>some name</name> ....... <author> </photo> <photo> ..... </photo> <photo> ..... </photo> <photo> ..... </photo> <photo> ..... </photo> </photos> </gallery> <gallery> .... </gallery> <gallery> .... </gallery> <gallery> .... </gallery> <gallery> .... </gallery> </galleries> As you see here, response quite big and heavy, and not always we need such deep info level. Usual solution is to use or http://ru.wikipedia.org/wiki/Atom elements for each gallery instead of full gallery data: <galleries> <gallery> <id>some_gallery_id</id> <link href="http://mysite/gallery/some_gallery_id"/> </gallery> <gallery> <id>second_gallery_id</id> <link href="http://mysite/gallery/second_gallery_id"/> </gallery> <gallery> .... </gallery> <gallery> .... </gallery> <gallery> .... </gallery> <gallery> .... </gallery> </galleries> The first question, is next: maybe instead we shouldn't even use and types, and just use generic and for all resources that return list objects: <list> <item><link href="http://mysite/gallery/some_gallery_id"/></item> <item><link href="http://mysite/gallery/other_gallery_id"/></item> <item>....</item> </list> And the second question, after user try to retrieve info about some concrete gallery, he'll use for example http://mysite/gallery/some_gallery_id link, what should he see as results? Should it be: <gallery> <id>some_gallery_id</id> <name>my photos</name> <photos> <photo> <id>123</id> <name>my photo</name> <location>http://mysite/photo/show/123</location> ...... <author> <id>some_id</id> <name>some name</name> ....... <author> </photo> <photo> ..... </photo> <photo> ..... </photo> <photo> ..... </photo> <photo> ..... </photo> </photos> </gallery> or : <gallery> <id>some_gallery_id</id> <name>my photos</name> <photos> <photo><link href="http://mysite/photo/11111"/></photo> <photo><link href="http://mysite/photo/22222"/></photo> <photo><link href="http://mysite/photo/33333"/> </photo> <photo> ..... </photo> </photos> </gallery> or <gallery> <id>some_gallery_id</id> <name>my photos</name> <photos> <photo> <link href="http://mysite/photo/11111"/> <author> <link href="http://mysite/author/11111"/> </author> </photo> <photo> <link href="http://mysite/photo/22222"/> <author> <link href="http://mysite/author/11111"/> </author> </photo> <photo> <link href="http://mysite/photo/33333"/> <author> <link href="http://mysite/author/11111"/> </author> </photo> <photo> ..... </photo> </photos> </gallery> I mean if we use link instead of full object info, how deep we should go there? Should I show an author inside photo and so on. Probably my question ambiguous, but what I'm trying to do is create general strategy in such cases for all team members to follow in future.

    Read the article

  • How to load entities into private collections using the entity framework

    - by Anton P
    I have a POCO domain model which is wired up to the entity framework using the new ObjectContext class. public class Product { private ICollection<Photo> _photos; public Product() { _photos = new Collection<Photo>(); } public int Id { get; set; } public string Name { get; set; } public virtual IEnumerable<Photo> Photos { get { return _photos; } } public void AddPhoto(Photo photo) { //Some biz logic //... _photos.Add(photo); } } In the above example i have set the Photos collection type to IEnumerable as this will make it read only. The only way to add/remove photos is through the public methods. The problem with this is that the Entity Framework cannot load the Photo entities into the IEnumerable collection as it's not of type ICollection. By changing the type to ICollection will allow callers to call the Add mentod on the collection itself which is not good. What are my options? Edit: I could refactor the code so it does not expose a public property for Photos: public class Product { public Product() { Photos = new Collection<Photo>(); } public int Id { get; set; } public string Name { get; set; } private Collection<Photo> Photos {get; set; } public IEnumerable<Photo> GetPhotos() { return Photos; } public void AddPhoto(Photo photo) { //Some biz logic //... Photos.Add(photo); } } And use the GetPhotos() to return the collection. The other problem with the approach is that I will loose the change tracking abilities as I cannot mark the collection as Virtual - It is not possible to mark a property as private virtual. In NHibernate I believe it's possible to map the proxy class to the private collection via configuration. I hope that this will become a feature of EF4. Currently i don't like the inability to have any control over the collection!

    Read the article

  • Rails: AJAX Controller JS not firing...

    - by neezer
    I'm having an issue with one of my controller's AJAX functionality. Here's what I have: class PhotosController < ApplicationController # ... def create @photo = Photo.new(params[:photo]) @photo.image_content_type = MIME::Types.type_for(@photo.image_file_name).to_s @photo.image_width = Paperclip::Geometry.from_file(params[:photo][:image]).width.to_i @photo.image_height = Paperclip::Geometry.from_file(params[:photo][:image]).height.to_i @photo.save! respond_to do |format| format.js end end # ... end This is called through a POST request sent by this code: $(function() { // add photos link $('a.add-photos-link').colorbox({ overlayClose: false, onComplete: function() { wire_add_photo_modal(); } }); function wire_add_photo_modal() { <% session_key = ActionController::Base.session_options[:key] %> $('#upload_photo').uploadify({ uploader: '/swf/uploadify.swf', script: '/photos', cancelImg: '/images/buttons/cancel.png', buttonText: 'Upload Photo(s)', auto: true, queueID: 'queue', fileDataName: 'photo[image]', scriptData: { '<%= session_key %>': '<%= u cookies[session_key] %>', commit: 'Adding Photo', controller: 'photos', action: 'create', '_method': 'post', 'photo[gallery_id]': $('#gallery_id').val(), 'photo[user_id]': $('#user_id').val(), authenticity_token: encodeURIComponent('<%= u form_authenticity_token if protect_against_forgery? %>') }, multi: true }); } }); Finally, I have my response code in app/views/photos/create.js.erb: alert('photo added!'); My log file shows that the request was successful (the photo was successfully uploaded), and it even says that it rendered the create action, yet I never get the alert. My browser shows NO javascript errors. Here's the log AFTER a request from the above POST request is submitted: Processing PhotosController#create (for 127.0.0.1 at 2010-03-16 14:35:33) [POST] Parameters: {"Filename"=>"tumblr_kx74k06IuI1qzt6cxo1_400.jpg", "photo"=>{"user_id"=>"1", "image"=>#<File:/tmp/RackMultipart20100316-54303-7r2npu-0>}, "commit"=>"Adding Photo", "_edited_session"=>"edited", "folder"=>"/kakagiloon/", "authenticity_token"=>"edited", "action"=>"create", "_method"=>"post", "Upload"=>"Submit Query", "controller"=>"photos"} [paperclip] Saving attachments. [paperclip] saving /public/images/assets/kakagiloon/thumbnail/tumblr_kx74k06IuI1qzt6cxo1_400.jpg [paperclip] saving /public/images/assets/kakagiloon/profile/tumblr_kx74k06IuI1qzt6cxo1_400.jpg [paperclip] saving /public/images/assets/kakagiloon/original/tumblr_kx74k06IuI1qzt6cxo1_400.jpg Rendering photos/create Completed in 248ms (View: 1, DB: 6) | 200 OK [http://edited.local/photos] NOTE: I edited out all the SQL statements and I put "edited" in place of sensitive info. What gives? Why aren't I getting my alert();? Please let me know if you need anymore info to help me solve this issue! Thanks.

    Read the article

  • Open standard iPhone photo library application from iPhone app

    - by Vidas
    Hello, I need to open photo library from my iPhone app just like standard iPhone Camera application does. Is it possible? I don't want picking-style interface of UIImagePickerController - it has unnecessary controls like "Use" and "Cancel" buttons and does not have full photo library viewing functionality - zooming and sliding between photos etc. My goal is to navigate user to the photo library for viewing photos (with full functionality of viewing photos) and - when user has finished - return to my app - just like standard Camera application does when you preview last-taken photos.

    Read the article

  • iphone photo maximum size

    - by aditya
    Hi all i want to know there a limitation in size for an iphone to display an image? as the resolution of iphone is 320*480 px. i am developing an app which fetches photos from an URL and that URL contains some photos os size 600KB.So when i launch the app in simulator it behaves properly but in device the application crashes as soon as photos with higher resolution are displayed , and when lower resolution photos are displayed the app does not crash in the device.

    Read the article

  • NSXMLParser & memory leaks

    - by HBR
    Hi, I am parsing an XML file using a custom class that instanciates & uses NSXMLParser. On the first call everything is fine but on the second, third and later calls Instruments show tens of memory leaks on certain lines inside didEndElement, didEndElement and foundCharacters functions. I googled it and found some people having this issue, but I didn't find anything that could really help me. My Parser class looks like this : Parser.h @interface XMLParser : NSObject { NSMutableArray *data; NSMutableString *currentValue; NSArray *xml; NSMutableArray *videos; NSMutableArray *photos; NSXMLParser *parser; NSURLConnection *feedConnection; NSMutableData *downloadedData; Content *content; Video *video; BOOL nowPhoto; BOOL nowVideo; BOOL finished; BOOL webTV; } -(void)parseXML:(NSURL*)xmlURL; -(int)getCount; -(NSArray*)getData; //- (void)handleError:(NSError *)error; //@property(nonatomic, retain) NSMutableString *currentValue; @property(nonatomic, retain) NSURLConnection *feedConnection; @property(nonatomic, retain) NSMutableData *downloadedData; @property(nonatomic, retain) NSArray *xml; @property(nonatomic, retain) NSXMLParser *parser; @property(nonatomic, retain) NSMutableArray *data; @property(nonatomic, retain) NSMutableArray *photos; @property(nonatomic, retain) NSMutableArray *videos; @property(nonatomic, retain) Content *content; @property(nonatomic, retain) Video *video; @property(nonatomic) BOOL finished; @property(nonatomic) BOOL nowPhoto; @property(nonatomic) BOOL nowVideo; @property(nonatomic) BOOL webTV; @end Parser.m #import "Content.h" #import "Video.h" #import "Parser.h" #import <CFNetwork/CFNetwork.h> @implementation XMLParser @synthesize xml, parser, finished, nowPhoto, nowVideo, webTV; @synthesize feedConnection, downloadedData, data, content, photos, videos, video; -(void)parseXML:(NSURL*)xmlURL { /* NSURLRequest *req = [NSURLRequest requestWithURL:xmlURL]; self.feedConnection = [[[NSURLConnection alloc] initWithRequest:req delegate:self] autorelease]; [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; */ [[NSURLCache sharedURLCache] setMemoryCapacity:0]; [[NSURLCache sharedURLCache] setDiskCapacity:0]; NSXMLParser *feedParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL]; //NSXMLParser *feedParser = [[NSXMLParser alloc] initWithData:theXML]; [self setParser:feedParser]; [feedParser release]; [[self parser] setDelegate:self]; [[self parser] setShouldResolveExternalEntities:YES]; [[self parser] parse]; } - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { if ([elementName isEqualToString:@"articles"]) { self.finished = NO; self.nowPhoto = NO; self.nowVideo = NO; self.webTV = NO; if (!data) { NSMutableArray *tmp = [[NSMutableArray alloc] init]; [self setData:tmp]; [tmp release]; return ; } } if ([elementName isEqualToString:@"WebTV"]) { self.finished = NO; self.nowPhoto = NO; self.nowVideo = NO; self.webTV = YES; if (!data) { NSMutableArray *tmp = [[NSMutableArray alloc] init]; [self setData:tmp]; [tmp release]; return ; } } if ([elementName isEqualToString:@"photos"]) { if (!photos) { NSMutableArray *tmp = [[NSMutableArray alloc] init]; [self setPhotos:tmp]; [tmp release]; return; } } if ([elementName isEqualToString:@"videos"]) { if (!videos) { NSMutableArray *tmp = [[NSMutableArray alloc] init]; [self setVideos:tmp]; [tmp release]; return; } } if ([elementName isEqualToString:@"photo"]) { self.nowPhoto = YES; self.nowVideo = NO; } if ([elementName isEqualToString:@"video"]) { self.nowPhoto = NO; self.nowVideo = YES; } if ([elementName isEqualToString:@"WebTVItem"]) { if (!video) { Video *tmp = [[Video alloc] init]; [self setVideo:tmp]; [tmp release]; } NSString *videoId = [attributeDict objectForKey:@"id"]; [[self video] setVideoId:[videoId intValue]]; } if ([elementName isEqualToString:@"article"]) { if (!content) { Content *tmp = [[Content alloc] init]; [self setContent:tmp]; [tmp release]; } NSString *contentId = [attributeDict objectForKey:@"id"]; [[self content] setContentId:[contentId intValue]]; return; } if ([elementName isEqualToString:@"category"]) { NSString *categoryId = [attributeDict objectForKey:@"id"]; NSString *parentId = [attributeDict objectForKey:@"parent"]; [[self content] setCategoryId:[categoryId intValue]]; [[self content] setParentId:[parentId intValue]]; categoryId = nil; parentId = nil; return; } if ([elementName isEqualToString:@"vCategory"]) { NSString *categoryId = [attributeDict objectForKey:@"id"]; NSString *parentId = [attributeDict objectForKey:@"parent"]; [[self video] setCategoryId:[categoryId intValue]]; [[self video] setParentId:[parentId intValue]]; categoryId = nil; parentId = nil; return; } } - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { if (!currentValue) { currentValue = [[NSMutableString alloc] initWithCapacity:1000]; } if (currentValue != @"\n") [currentValue appendString:string]; } - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { NSString *cleanValue = [currentValue stringByReplacingOccurrencesOfString:@"\n" withString:@""] ; if ([elementName isEqualToString:@"articles"]) { self.finished = YES; //[content release]; } if ([elementName isEqualToString:@"article"]) { [[self data] addObject:[self content]]; [self setContent:nil]; [self setPhotos:nil]; [self setVideos:nil]; /* [content release]; content = nil; [videos release]; videos = nil; [photos release]; photos = nil; */ } if ([elementName isEqualToString:@"WebTVItem"]) { [[self data] addObject:[self video]]; [self setVideo:nil]; //[video release]; //video = nil; } if ([elementName isEqualToString:@"title"]) { //NSLog(@"Tit: %@",cleanValue); [[self content] setTitle:cleanValue]; } if ([elementName isEqualToString:@"vTitle"]) { [[self video] setTitle:cleanValue]; } if ([elementName isEqualToString:@"link"]) { //NSURL *url = [[NSURL alloc] initWithString:cleanValue] ; [[self content] setUrl:[NSURL URLWithString:cleanValue]]; [[self content] setLink: cleanValue]; //[url release]; //url = nil; } if ([elementName isEqualToString:@"vLink"]) { [[self video] setLink:cleanValue]; [[self video] setUrl:[NSURL URLWithString:cleanValue]]; } if ([elementName isEqualToString:@"teaser"]) { NSString *tmp = [cleanValue stringByReplacingOccurrencesOfString:@"##BREAK##" withString:@"\n"]; [[self content] setTeaser:tmp]; tmp = nil; } if ([elementName isEqualToString:@"content"]) { NSString *tmp = [cleanValue stringByReplacingOccurrencesOfString:@"##BREAK##" withString:@"\n"]; [[self content] setContent:tmp]; tmp = nil; } if ([elementName isEqualToString:@"category"]) { [[self content] setCategory:cleanValue]; } if ([elementName isEqualToString:@"vCategory"]) { [[self video] setCategory:cleanValue]; } if ([elementName isEqualToString:@"date"]) { [[self content] setDate:cleanValue]; } if ([elementName isEqualToString:@"vDate"]) { [[self video] setDate:cleanValue]; } if ([elementName isEqualToString:@"thumbnail"]) { [[self content] setThumbnail:[NSURL URLWithString:cleanValue]]; [[self content] setThumbnailURL:cleanValue]; } if ([elementName isEqualToString:@"vThumbnail"]) { [[self video] setThumbnailURL:cleanValue]; [[self video] setThumbnail:[NSURL URLWithString:cleanValue]]; } if ([elementName isEqualToString:@"vDirectLink"]){ [[self video] setDirectLink: cleanValue]; } if ([elementName isEqualToString:@"preview"]){ [[self video] setPreview: cleanValue]; } if ([elementName isEqualToString:@"thumbnail_position"]){ [[self content] setThumbnailPosition: cleanValue]; } if ([elementName isEqualToString:@"url"]) { if (self.nowPhoto == YES) { [[self photos] addObject:cleanValue]; } else if (self.nowVideo == YES) { [[self videos] addObject:cleanValue]; } } if ([elementName isEqualToString:@"photos"]) { [[self content] setPhotos:[self photos]]; //[photos release]; //photos = nil; self.nowPhoto = NO; } if ([elementName isEqualToString:@"videos"]) { [[self content] setVideos:[self videos]]; //[videos release]; //videos = nil; self.nowVideo = NO; } //[cleanValue release]; //cleanValue = nil; [currentValue release]; currentValue = nil; } - (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Error" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert release]; } -(NSArray*)getData { return data; } -(int)getCount { return [data count]; } - (void)dealloc { [parser release]; //[data release]; //[photos release]; //[videos release]; //[video release]; //[content release]; [currentValue release]; [super dealloc]; } @end Somewhere in my code, I create an instance of this class : XMLParser* feed = [[XMLParser alloc] init]; [self setRssParser:feed]; [feed release]; // Parse feed NSString *url = [NSString stringWithFormat:@"MyXMLURL"]; [[self rssParser] parseXML:[NSURL URLWithString:url]]; Now the problem is that after the first (which has zero leaks), instruments shows leaks in too many parts like this one (they are too much to enumerate them all, but all the calls look the same, I made the leaking line bold) : in didEndElement : if ([elementName isEqualToString:@"link"]) { // THIS LINE IS LEAKING => INSTRUMENTS SAYS IT IS A NSCFString LEAK [self content] setUrl:[NSURL URLWithString:cleanValue]]; [[self content] setLink: cleanValue]; } Any idea how to fix this pealse ? Could this be the same problem as the one mentioned (as an apple bug) by Lee Amtrong here :http://stackoverflow.com/questions/1598928/nsxmlparser-leaking

    Read the article

  • parsing xml with php, children

    - by moustafa
    Hello I successfully created my parser Everything is working great except one thing since my xml is formated a little different and I am totally lost on how to assign variable to the children of . xml portion <item> <url /> <name /> - <photos> <photo>1020944_0.jpg</photo> <photo>1020944_1.jpg</photo> <photo>1020944_2.jpg</photo> </photos> <user_id /> </item> PHP code <? global $insideitem, $tag, $name, $photos, $user_id; global $count,$db; $db = mysql_connect("localhost", "user","pass"); mysql_select_db("db_name",$db); $result = mysql_query("SELECT user_id FROM table,$db); while ($myrow = mysql_fetch_array($result)){ $uid=$myrow['user_id']; $UN_ID[$uid]=$uid; } $count=1; $count2=1; // ########################################################## // ************* START ELEMENT FUNCTION ********************* // ########################################################## function startElement($parser, $name, $attrs) { global $insideitem, $tag, $name, $photos, $user_id; if ($insideitem) { $tag = $name; } elseif($name == "ITEM"){ $insideitem = true; } } function endElement($parser, $name) { global $insideitem, $tag, $name, $photos, $user_id; global $count,$count2,$db,$UN_ID; if ($name == "ITEM") { if(!$UN_ID[$unique_id]){ $name=addslashes($name); $photo1=addslashes($photo); $photo2=addslashes($photo); $photo3=addslashes($photo); $photo4=addslashes($photo); $user_id=addslashes($category); $sql = "INSERT INTO table ( name, photo1, photo2, photo3, photo4, user_id ) VALUES ( '$name', '$photo', '$photo', '$photo', '$photo', '$user_id', )"; $resultupdate = mysql_query($sql); } $name=''; $photos=''; $user_id=''; } } function characterData($parser, $data) { global $insideitem, $tag, $name, $photos, $user_id; if ($insideitem) { switch ($tag) { case "NAME": $name .= $data; break; case "PHOTOS": $photos .= $data; break; case "USER_ID": $user_id .= $data; break; } } } $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); $fp = fopen("../myfile.xml","r") or die("Error reading RSS data."); while ($data = fread($fp, 4096)) // Parse each 4KB chunk with the XML parser created above xml_parse($xml_parser, $data, feof($fp)) // Handle errors in parsing or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); fclose($fp); // ########################################################## // *********************** FREE MEMORY ********************** // ########################################################## xml_parser_free($xml_parser); ?> The number of tags can range between 1-4. I have tried searching everywhere for info on how to do this and tried everything but I just cant get it. After several days of this giving me headaches I really hope some one can enlighten me.

    Read the article

  • Database solutions for storing/searching EXIF data

    - by webdestroya
    I have thousands of photos on my site (each with a numeric PhotoID) and I have EXIF data (photos can have different EXIF tags as well). I want to be able to store the data effectively and search it. Some photos have more EXIF data than others, some have the same, so on.. Basically, I want to be able to query say 'Select all photos that have a GPS location' or 'All photos with a specific camera' I can't use MySQL (tried it, it doesn't work). I thought about Cassandra, but I don't think it lets me query on fields. I looked at SimpleDB, but I would rather: not pay for the system, and I want to be able to run more advanced queries on the data. Also, I use PHP and Linux, so it would be awesome if it could interface nicely to PHP. Any ideas?

    Read the article

  • Improving MySQL Update Query Efficiency

    - by Russell C.
    In our database tables we keep a number of counting columns to help reduce the number of simple lookup queries. For example, in our users table we have columns for the number of reviews written, photos uploaded, friends, followers, etc. To help make sure these stay in sync we have a script that runs periodically to check and update these counting columns. The problem is that now that our database has grown significantly the queries we have been using are taking forever to run since they are totally inefficient. I would appreciate someone with more MySQL knowledge than myself to recommend how we can improve it's efficiency: update users set photos=(select count(*) from photos where photos.status="A" AND photos.user_id=users.id) where users.status="A"; If this were a select statement I would just use a join but I'm not sure if that is possible with update. Thanks in advance for your help!

    Read the article

  • Perf: Viewing thousands of images in Silverlight 3 on a 3D Wall

    - by Bob Holland
    I currently work on a very cool Silverlight app that displays photos in a 3D wall space like the Wall3D demo that is thrown in with Blend 3. The problem I am currently facing is performance. The app works like this: As you scroll right or left the 3d photo wall rotates As each movement is made, the next column of photos are downloaded, decoded into a BitmapImage and thrown into a 3D Wall Node. As you can imagine users (if you let them) will want to flip through the photos really quickly, but the problem I have is I cannot display the photos quick enough. In most cases it's a beautiful app that works really well, but when an album contains over 300 photos, you can imagine the sort of memory taken up by all the BitmapImage classes and how moving the slider can jump from photo 20 to photo 120 in a second. Of course we have algorithms in place to not download every photo in between, but I still can't work out a fast way to get the photos displayed. It may be a case that we need to throw away the 'great for show' 3D wall and go to a flat DeepZoom like wall like the Playboy archive one that Vertigo did. Still not sure, let me know your thoughts. P.S. We are using Kit3D for all the 3D work, it's using PerspectiveCamera, Model3DGroup, ModelVisual3D, RotateTransform3D & TranslateTransform3D. Cheers, Bob.

    Read the article

  • Facial recognition/detection PHP or software for photo and video galleries

    - by Peter
    I have a very large photo gallery with thousands of similar people, objects, locations, things. The majority of the people in the photos have their own user accounts and avatar photos to match. There are also logical short lists of people potentially in the photo based on additional data available for each photo. I allow users to tag photos with their friends and people they know but an automated process would be better. I've used photo tagger/finder from face.com integrating with Facebook photos and the Google Picasa photo tagger for personal albums also does the same thing and is exactly what I'm looking to do. Is there a PHP script, API for Google Picasa, face.com or other recognition service or any other open source project that provides server-side facial recognition and/or grouping photos by similarity? Examples: As you can see, various photo sharing sites offer the feature, but are there any that provide an API for images stored on my own server or something extensive enough to link into my own gallery and tagging system? viewdle - Face recognition/Tagging for video PHP - Face detection in pure PHP Xarg OpenCV Face.com - app for finding and tagging photos in Facebook Google Picasa - photo sharing TeraSnaps - photo sharing site Google Portrait - photo grouping from Google Image results FaceOnIt - Video face recognition PittPatt - Detection, Recognition, Video Face Mining BetaFace ChaosFace - Real-time Face Detector

    Read the article

  • Prroblem with ObjectDelete() in Entity Framework 4

    - by Tom
    I got two entities: public class User : Entity { public virtual string Username { get; set; } public virtual string Email { get; set; } public virtual string PasswordHash { get; set; } public virtual List<Photo> Photos { get; set; } } and public class Photo : Entity { public virtual string FileName { get; set; } public virtual string Thumbnail { get; set; } public virtual string Description { get; set; } public virtual int UserId { get; set; } public virtual User User { get; set; } } When I try to delete the photo it works fine for the DB (record gets romoved from the table) but it doesnt for the Photos collection in the User entity (I can still see that photo in user.Photos). This is my code. What I'm doing wrong here? Changing entity properties works fine. When I change photo FileName for example it gets updated in DB and in user.Photos. var photo = SelectById(id); Context.DeleteObject(photo); Context.SaveChanges(); var user = GetUser(userName); // the photo I have just deleted is still in user.Photos also tried this but getting same results: var photo = user.Photos.First(); Context.DeleteObject(photo); Context.SaveChanges();

    Read the article

  • Making A Photo-Sharing App For Android In Eclipse [on hold]

    - by user3694394
    I've only just started developing mobile apps, which is something that I've been wanting to learn for a while now. I'm from an indie games studio, making PC games for around the last 3 years, and I finally decided to move into android app development. The only problem I'm having is that I don't know where to start. The project which I'm aiming to create will be something similar to Instagram, basically a photo-sharing app which allows users to take new photos, or pull them from their device, and add filters to them, before posting them. I have a rough idea of how I could go about doing this, but I need pointing towards any tutorials available for each specific step. So, here's my idea: Create a UI in eclipse (this wont be a problem for me, I should be able to do this fine through xml files) Setup a server-side database to store all user info and uploaded images (the images will need to be converted into byte arrays, and I have no idea how to do this through a database). My best idea would be to use a MySQL database to do this. Add user interactions (likes, favourites, reposts, etc.). This would, again, have to be stored in the database (or, at least, i think it would). Add the ability to take new photos using the phone's camera (I can probably do this anyway, using the Camera API). Add the ability to pull existing photos from the device (again, pretty simple to do). Add the ability to add filters to any photos (I had a look around, and there are some repos and resources which allow you to do this, but they're mainly for iOS development). Add facebook/twitter integration (possibly) to allow phots to be shared to other social networks. Create a news feed which shows users all of the latest photos from their friends, and allows them to post their own images to it. Give all registered users their own wall/page which has their latest posts/images displayed on it. Add the ability to allow users to follow other users, and display their followed users posts on their news feed. Yep. It's not going to be easy, and I don't even know if it's possible for me to do alone in Eclipse. However, this is the plan, and I'm going to do my best to learn everything I need to know to do this successfully. My actual question would be how should I start doing this- where do I begin learning how to do all of this? I've had a look at snapify, which can be edited via Parse, but I won't be spending hundreds of dollars (since I'm 15 and just don't have the available funds) on software. I have extensive knowledge of Java (again, I've been making games for around 3 years, mainly in Java), and various scripting languages. So, hopefully, this will be of some use here. Thanks in advance, Josh.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >