Posts

ios - Save data in two persistent stores -

i having app there search feature network request. uses same model framework entire app. this means when user searches need create managed objects found data, save them , display them. messes old records user recent data. i ideally save managed objects found in search in separate in-memory persistent store doesn't make disorder in main data. i haven't done before best way approach it? thank you! as has been suggested @stevesliva, not need involve complexities of maintaining multiple partially in-memory stores. way go here create child context , fetch online data context. once not need data more, discard context. if decide save downloaded data, can "push" changes main context via save: . @ point make necessary adjustments data fit user data. depending on model, 1 feasible solution create attribute on 1 of entities marks linked objects distinct user created objects.

php - Long lasting script prevents handling new requests -

i have php script on apache web server, starts several hours running php script. right after long-lasting script started no other php script requests handled. browser hangs eternally. the background script crawls other sites , gathers data ones. therefore takes quite long time. at same time static pages got without problems. @ same time php script started locally on server bash executed without problems. cpu , ram usage low. in fact it's test server , requests ones being handled. i tried decrease apache processes in order able trace of them see requests hung. when decreased amount of processes 2 problem has gone. i found no errors neither in syslog nor in apache/error.log what else can check? though didn't find reason of apache hanging have solved task in different way. i've set schedule run script every 5 minutes. web script i'm creating file necessary parameters. script check existence of file , if exists reads content , deletes prevent furth...

ios - Upload my App on Apple's App Store through Company's account -

i grateful if can me here in way possible. so scenario created app , client gave me access developer's account. have access certificates, downloaded. both developer , distribution certificate. i have access itunesconnect can upload app. my question how able use certificates , upload app on appstore. client's app id different mine, guess i'd have change mines , create new package. would use client's certificates , create provisioning profiles through developer account ? many thanks, can see questions, quite confused. best. below basic steps, recommend visit site getting started , , follow thoroughly. login developer account. install certificate on mac create new appid, should same bundle id now create development/distribution provision profile using appid created in step #3 use these profile (code signing) publish/distribute app. again, above quick view help, must follow site mentioned.

javascript - How can I slice out all of the array objects containing a value and storing them in a new array -

so have array , want make new array objects have swimming value in sports. var watchesarray = [ { model: "swim", image:"", price: 149.99, sports:["swimming", "running"] }, { model: "fr 10", image:"", price: 129.99, sports:["running"] }, { model: "fr 15", image:"", price: 199.99, sports:["running"] }, ]; so far have dont know how add on sliced array each go around in loop. how should this? (var = 0; < watchesarraylength; i++) { if (watchesarray[i].sports.indexof("swimming") > -1) { var runningwatcharray = watchesarray.slice(i); } } you can use .filter() method: watchesarray = [...]; var result = watchesarray.filter(function(watch) { retu...

c# - Implementing Entity Framework for Simple Data Entry App -

this has been asked , answered 1000 times, google has not been not friend morning. i'm making switch using stored procedures , business objects using entity framework. simplicity of generating pocos generated edm (database-first approach here). , how less typing is. i'm having hard time wrapping head around suitable design common application scenario (in world, anyway). basically, picture data entry application, let's online store's administrator (i'm doing in wpf, web-based). the admin want view list of customers (manage customers view) in data grid. each row, there button edit customer or delete it. @ bottom of grid there button create new customer. if delete customer, removed (after confirmation) data grid, back-end data store. if edit customer, window pops (edit customer view), displaying current data customer. can edit data, click either submit, or cancel. submit saves changes data store, , cancel discards changes. both buttons close window....

design patterns - Android widget change alarm interval -

i have created configure activity widget, user can choose various update frequencies.. until started alarm in onenabled() method, this: intent intent = new intent(clock_widget_update); pendingintent pendingintent = pendingintent.getbroadcast(context, 0, intent, pendingintent.flag_update_current); alarmmanager alarmmanager = (alarmmanager) context.getsystemservice(context.alarm_service); alarmmanager.setrepeating(alarmmanager.rtc, system.currenttimemillis(), 1000 * 60, pendingintent); the settings saved in shared preferences unique name (widgetid) , in onenabled() method can't retrieve settings here because can't widgetid yet. there's problem, user can change frequency anytime, method called once, @ beginning. think need start alarm in onupdate(), don't know how it, don't want make multiple instances of alarm accidentally ask advice. to answer second problem, calling setrepeating multiple times not create multiple alarm far provide same...

c# - EF6 Code First Key not auto incrementing -

i have class model: public class results { [key] [databasegenerated(databasegeneratedoption.identity)] public int id { get; set; } public int gameid { get; set; } public games game { get; set; } public string notes { get; set; } public virtual icollection<resultitems> resultitems { get; set; } } for reason id field not set auto increment per schema: create table [dbo].[results] ( [id] int not null, [gameid] int not null, [notes] nvarchar (max) null, constraint [pk_dbo.results] primary key clustered ([id] asc), constraint [fk_dbo.results_dbo.games_gameid] foreign key ([gameid]) references [dbo].[games] ([id]) on delete cascade ); go create nonclustered index [ix_gameid] on [dbo].[results]([gameid] asc); i've added: protected override void onmodelcreating(dbmodelbuilder modelbuilder) { modelbuilder.entity<results>().haskey(p => p.id).property(p => p.id).hasda...