Posts

ruby - Rerouting to AWS hosted assets from a Heroku Rails app -

i have heroku hosted rails app has reached 300mb limit slug size , can no push heroku. fix issue, i've setup aws s3 account , want redirect assets being requested rails app new s3 location. rails app serving json files point static assets using relative url. ios app using rails json has hardcoded domain url, , appends path resources domain , requests assets needs. i want update heroku app , change asset locations without requiring update ios app in order change asset domain. so, need redirect static asset requests rails app aws server. in git repo, i've ignored assets in public folder i've moved aws server. asset files present on local machine, not part of git repo when uploaded heroku. so far i've tried changing config.action_controller.asset_host not seem work since these static assets , being returned web server before rails gets it. i tried using routes rules redirect different domain, these routes never seem captured. static files appear returned befo...

algorithm - Number of subsets of size 'k' whose sum when taken mod with 'p' gives 'x' -

given: set of size n integer elements in range [1,p] , integer k<=n suppose function f(a subset) = (sum of elements in subset)%p i need find each x such 0<=x<=p-1 how many subsets of size k have f( subset ) = x a dp solution complexity n p k trivial there n*p solution?

c - What is the full function of TCPIP_TCP_ArrayGet of Harmony Configurator? -

i read docs of tcpip module of harmony configurator it's lacking of documentation , wanna know if knows complete/detailed functionality of tcpip_tcp_arrayget function. please me out , kind me cause i'm newbie here on stackoverflow , on project i'm working on. thanks documentation tcpip_tcp_arrayget reads array of data bytes tcp socket's rx buffer/fifo. data removed fifo in process. uint16_t tcpip_tcp_arrayget( tcp_socket htcp, uint8_t* buffer, uint16_t* count ); precondition tcp initialized parameters htcp - socket data read. buffer - pointer array store data read. len - number of bytes read. returns number of bytes read socket. if less len, rx fifo buffer became empty or socket not connected. thanks help.

node.js - Images not pulled from AWS S3 to heroku nodejs app -

i have sails nodejs app running on heroku. have several images need pulled onto page i.e. logo. when had images pulled photobucket works. moved images aws s3. followed https://devcenter.heroku.com/articles/s3 . images accessible link i.e.: https://s3.amazonaws.com/kenguru/main/kglogoweb.png . not being pulled when page loaded. any suggestions appreciated.

html - Why is my website not using the fonts I specified? No access to the font? -

i using rails , have specified fonts follows: #application.html.erb includes in head: <link href='http://fonts.googleapis.com/css?family=indie+flower' rel='stylesheet' type='text/css'> #one of stylesheets includes: body{ font-family: 'indie flower', sans-serif; } i'm using bootstrap gem (which perhaps overriding above?). on development server, however, site not use fonts specified. think it's helvetica instead. doing wrong? i checked inspector, gives following information: for body says font-family: "indie flower",sans-serif; . for example, next div says same. the h3 within div says font-family: inherit; . same h5 within div . for p within div says font-family: "indie flower",sans-serif; so expect font indeed indie flower isn't. checked using font, , again text shows belief helvetica instead of font specified. what doing wrong? update: application.html.erb : <!doctype html...

objective c - how to get item from rac_sequence, reactive cocoa, ios -

i parsing needed links in header of response server. header looks like access-control-allow-origin → * age → 0 cache-control → private,must-revalidate connection → keep-alive content-encoding → gzip content-type → application/json date → sat, 13 jun 2015 15:58:56 gmt etag → w/"cb38bb07f1635fd6aba5969985bf0607" link → http://thisiscurrentlink&limit=24 ; rel="next", http://thisislastlink&limit=24 ; rel="last", http://thisisfirstlink&limit=24 ; rel="first",<>; rel="prev" server → nginx vary → accept-encoding x-total-count → 131 transfer-encoding → chunked by doing this, can links array contains links nsstring *linkheader = [(nshttpurlresponse *)operation.response allheaderfields][@"link"]; nsarray *links = [linkheader componentsseparatedbystring:@","]; then doing following links needed racsequence *sequence = [links.ra...

How can you create an iCloud Calender for an iOS app to use with swift? -

i've seen many people search user's calendars , grab first 1 that's writable , start throwing events on there. don't practice; prefer respect users little more. so how can make own calendar app use events creates? i came following function, assuming app allowed access users calendars: let eventstore = ekeventstore() func checkcalendar() -> ekcalendar { var retcal: ekcalendar? let calendars = eventstore.calendarsforentitytype(ekentitytypeevent) as! [ekcalendar] // grab every calendar user has var exists: bool = false calendar in calendars { // search these calendars if calendar.title == "any string" { exists = true retcal = calendar } } var err : nserror? if !exists { let newcalendar = ekcalendar(forentitytype:ekentitytypeevent, eventstore:eventstore) newcalendar.title="any string" newcalendar.source = eventstore.defaultcalendarforneweven...