Posts

c# - A dependent property in a ReferentialConstraint is mapped to a store-generated column. Column: 'ID' -

c# - A dependent property in a ReferentialConstraint is mapped to a store-generated column. Column: 'ID' - i can't figure out why error when seek add together venue object , phone call savechanges(). difference in model venue objects 1 1..0 relation city. city city = processcitycache(ev, country, db); // after call, 'city' persisted. venue = new venue { ticketmasterurl = ev.venueseolink, name = capitalize(ev.venuename), city = city }; db.venues.addobject(venue); db.savechanges(); // exception thrown here. any insight appreciated! (open image in own tab/window see total size) i found problem. fault. had fk_venue_city relationship set city.id -> venue.id wanted city.id -> venue.cityid . made alter in database updated model. c# .net entity-framework entity-framework-4

php - Upload three versions of an image, full size, thumbnail and resized -

php - Upload three versions of an image, full size, thumbnail and resized - so far, i've been uploading 1 image hand (ftp server when live, locally moving file), , resizing them on fly using img tag's width , height properties resize them. well, images don't good, because need square, cropped 100px version thumbnail, , 800px wide version view image page, , full-size original image hd viewing, need apply watermark, total res version. , need help image upload script. sort of file upload, really. i've looked @ tutorials, , don't seem create much sense. furthermore, need drop 3 versions database row (which think can figure out). know need utilize $_file it, i'm confused actual usage , cropping/resizing/watermarking part has me stumped. solutions, anyone? file uploading upload using simple html form , utilize php manipulate image. example read images stored in directory , convert them in batch. example image re-sizing use imagemagick or gd l...

Cant access PHP generated files via FTP -

Cant access PHP generated files via FTP - i have form uploads files , stores them in uploads folder in httpdocs folder. however, if seek delete or rename 1 of files via ftp, wont allow me. why? the user web server runs ( apache , or perhaps www-data or httpd apache) owns php-created files. permissions on them may prevent ftp user writing them. php ftp

objective c - creating an object and setting a retaining property -

objective c - creating an object and setting a retaining property - how should set retained property when creating object using alloc , init? (without using autorelease) with line in header (and corresponding @synthesize line in implementation): @property(retain)uiwebview *webview; these 3 options have (i think): uiwebview *tempwebview = [[uiwebview alloc] init]; [tempwebview setdelegate:self]; tempwebview.hidden = yes; self.webview = tempwebview; [tempwebview release]; (this 1 seems best concerning memory management it's more lines of code , involves stupid variable name, decrease in readability) self.webview = [[uiwebview alloc] init]; [self.webview release]; [self.webview setdelegate:self]; self.webview.hidden = yes; (this 1 it's more obvious whats happening memory management doesn't seem great, xcode's analyser doesn't it) webview = [[uiwebview alloc] init]; [self.webview setdelegate:self]; self.webview.hidden = yes; (this 1 ...

objective c - releasing a NSMutableArray is causing EXC_BAD_ACCESS error -

objective c - releasing a NSMutableArray is causing EXC_BAD_ACCESS error - so when seek run next code, end exc_bad_access error. happens when seek release nsmutablearray retrievedanalysisdatalist. array list of retrievedanalysisdata objects. if seek either release info list or if set init autorelease, same result. i'm kinda guessing has sorting section of code since don't have issue retrievedanalysisidarray. any ideas? if (tempdict != null) { nsmutablearray *retrievedanalysisdatalist = [[nsmutablearray alloc] init]; nsmutablearray *retrievedanalysisidarray = [[nsmutablearray alloc] init]; (id key in tempdict) { retrievedanalysisdata = [[retrievedanalysisdata alloc] init]; retrievedanalysisdata.createdate = [[tempdict objectforkey:key] objectforkey:@"createdate"]; retrievedanalysisdata.id = [[tempdict objectforkey:key] objectforkey:@"id"]; retrievedanalysisd...

php - Drupal 7 date string block not translated to Arabic -

php - Drupal 7 date string block not translated to Arabic - i have custom block standard arabic content using php input format, , tested below no avail @ windows: setlocale(lc_all,'ar'); echo iconv('iso-8859-1', 'utf-8', strftime('%b', time())); // output july setlocale(lc_all,'ar'); echo date(t('f')); // output july, can not find string @ admin/config/regional/translate/translate setlocale(lc_all,'ar'); echo utf8_encode(strftime('%b')); // output july i expected يوليو or equivalent @ arabic. does have hint standard arabic date? i ended using http://api.drupal.org/api/drupal/includes--common.inc/function/format_date/7, , resolved problem. no need screw set_locale. don't have translate string, either. love drupal. php drupal

python - Subclass-safe class variable -

python - Subclass-safe class variable - i can do: class t(object): = 5 # utilize value somewhere in function def p(self): print id(i), t.i .. but, if happen subclass t .. class n(t): pass .. n.i in fact t.i . found way deal this: class t(object): = 5 def p(self): print self.__class__.i .. right , sure work? or can produce unexpected behavior in situations (which unaware of)? self.__class__.i right , sure work (although i poor naming choice). if method access i not utilize self, can create class method, in case first parameter class , not instance: class t(object): = 5 @classmethod def p(cls): print cls.i to read attribute, can utilize self.i safely too. alter value, using self.i = value alter attribute of instance, masking class attribute instance. python