Posts

ios - How To implement double exposure for picking images? -

in app i'm having 2 imageviews, first imageview constant , second imageview ,after picking image zoom , can place in view , second image merged first image , after merging second imageview nil , first imageview having 2 images , can pic many images in second imageview , can move anywhere need pic single image @ single time.how implement this.?.thanks in advance. a simple image has 32bit of color information per pixel (rgb: ff ff ff), grayscale image has 8bit. should obvious conversion 32bit 8bit not reversible.

jquery - Group Events by Date using KnockoutJS -

update : provided best answer problem. feel free improve readability and/or efficiency. problem : using fullcalendar.io in requirejs set up, event objects (received ajax call .ashx handler) populated on calendar on every next/prev/view change. use json object on callback create list of events grouped startdate property. what i've done on calendar update, such new month, able set basic viewmodel populate new list of events observable array. part missing group by, such this example. since i'm looking group event object's start date , sort each group ascending start date, i'm not sure of best practices should take, such if necessary transform json data objects. continue update post learn more. reason not using linked example because not understand complete terminology behind handler, understand keywords $root @ point. ajax call , requirejs module load : fullcalendar var fullcalendar = ".calendar-module", viewmodel; function initfullcalendar() ...

python - Matplotlib multiple lines on graph -

i've been having issue saving matplotlib graphs images. images saving differently shows when call .show() method on graph. example here: http://s1.postimg.org/lbyei5cfz/blue5.png i'm not sure else do. i've spent past hours trying figure out what's causing it, can't figure out. here code in it's entirety. import matplotlib.pyplot plt import random turn = 1 #for x values class graph(): def __init__(self, name, color): self.currentvalue = 5 #for y values self.x = [turn] self.y = [self.currentvalue] self.name = name self.color = color def update(self): if random.randint(0,1): #just show if graph's value goes or down self.currentvalue += random.randint(0,10) self.y.append(self.currentvalue) else: self.currentvalue -= random.randint(0,10) self.y.append(self.currentvalue) self.x.append(turn) def plot(self): lines = plt....

How to get unique values from specific column in SQL Server? -

i have table tblfruit_id tblfruit_fruittype tblfruit_fruitname -------------------------------------------------- 1 citrus orange 2 citrus lime 3 citrus lemon 4 seed cherry 5 seed banana i can't set distinct tblfruit_fruittype column only, , if use group by (i want count function), getting error. my expected output: tblfruit_id tblfruit_fruittype tblfruit_fruitname ------------------------------------------------------ 1 citrus orange 4 seed cherry use window function ;with cte (select row_number()over (partition tblfruit_fruittype order tblfruit_id) rn, * tablename) select tblfruit_id, tblfruit_fruittype, tblfruit_fruitname cte rn = 1

ruby - Rails schema dump is putting string in for postgres point.. How do I fix this? -

i have point defined in migrations... when run migrations point in database.. perfect!! asked for. but.. see in schema.rb t.string? messes ci system, because builds database based on schema.rb. co-worker wants change type in database array, because easy. find leaves stink in code. q: how make schema.rb file show column point? completeness /20141120 ... .rb class addheadertouser < activerecord::migration def change add_column :users, :header_image_centre, :point end end /schema.rb t.string "header_image_centre", limit: nil this seems fixed in rails 4.2

Redbean php R::freeze(true) not working -

i have used r::freeze(true); in php application. don't know why redbean alters database table structure. noticed interger type column becomes text automatically. also have updated variable protected $isfrozen = true; in rb.php. no effect. without knowing php structure or framework (if any), it's impossible provide answer in relation that. in event, r::freeze( true ) correct syntax. make sure add statement in beginning of application. i have lot of slimphp applications using readbean , put @ top of index.php right after running r::setup(); <?php require 'vendor/autoload.php'; r::setup(); r::freeze( true );

ios - UIWebview Landscape support in Hybrid Application -

i developing hybrid application using uiwebview. html pages loaded local. have requirement 1 page should support both landscape , portrait mode. rest html page should support portrait mode only. have done following implementation that: - (nsuinteger) application:(uiapplication *)application supportedinterfaceorientationsforwindow:(uiwindow *)window{ if (isfullscreenplaying) { nslog(@"**********************************orienattion landscape%@",[window description]); return uiinterfaceorientationmaskallbutupsidedown; } nslog(@"**********************************orienattion portrait%@",[window description]); return uiinterfaceorientationmaskportrait; } i enabling isfullscreenplaying variable when have have url request equal full screen playing: **if([urlstring hasprefix:@"fullscreenvieweron://"]){ nslog(@"**********************************isfullscreenplayingyes"); isfullscreenplaying = yes; return no; }** but problem c...