Posts

Ruby On Rails, params lost after redirect -

i have page user pays fees, , on submit gets redirected same page showing payment done. i'm passing id on redirect, lost causing error. here controller action: def pay_all_fees @target_action='pay_all_fees' @target_controller='parent_wise_fee_payments' if params[:id].present? id = params[:id] else id = 4 end @students=student.find_all_by_sibling_id(guardian.find(id).ward_id) @guardian = guardian.find(id) @students.each |student| fetch_all_fees end if request.post? status=true multifeestransaction.transaction multi_fees_transaction= multifeestransaction.create(params[:multi_fees_transaction]) begin finance_transactions=financetransaction.create!(params[:transactions].values) rescue exception => e status=false end if status , (multi_fees_transaction.valid? && finance_transactions.all?(&:vali...

ios - How to manage many (>500) background URLSession downloads with AFNetworking 2.x? -

i have app on app store uses afnetworking 2.x download large files in background nsurlsession-based downloads, because user put app in background (it gets terminated after while of course, downloads finish same. wonderful). app working well. users downloading few files @ time. now need make similar app, time instead of few large files, user want download large number of smallish files: example, 500 files 1-5mb each. again, app put in background, want stay nsurlsessiondownloadtask unless there's reason not to. my question is, can create 500 nsurlsessiondownloadtasks @ once? afnetworking clever throttling not overload system? or ios it? or nothing it, , have painfully track & organize state of transfers across restarts of app (ie. because gets put in background terminated) ? if knows limits of how many nsurlsessiondownloadtasks can create reliably simultaneously, awesome... thanks! p.s. prefer obj-c swift, thx :) last checked (haven't looked @ ios 9 beta...

javascript - How to design client side data and business layers -

we designing enterprise application. we looking ideas our client side design (maybe existing lib, books, design patterns, experience) managing data , business layer in decoupled way chosen framework render dom (angular, react, etc.). our experience aiming write business in pure javascript , not on top of specific framework can more flexible , independent. some notices: the data/entities can shared between different components. each component can use data in own way, depending on business logic. the data/entities may refreshed several time.

hyperlink - Is it possible to attach a file to an MMS via an HTML link? -

i read here it's possible prepopulate sms body text via html link : how pre-populate sms body text via html link does know if it's possible add base64 image (becoming mms) (e.g) "&attachment=" parameter ? something : <a href="sms:?body=/* body text here */&attachment=data:image/jpg;base64,/* base64 image here */;"></a> and if it's not, idea how ? thanks

search - Python - How would I isolate and utilize the "answer" sometimes provided at the top of the page when something is searched in google -

for example, when phrase "liam neeson age" searched,displayed in bold font, @ top of page "63 years (june 7, 1952)." have tried toying concepts presented previous question( google search python app ) little success. can links , not actual "answers." ideally able input string , have return "answer" provided google. if there no "answer," searches, able know well. scrape javascript-enabled browser firefox , selenium webdriver .

php - Function name must be a string fatal error -

i have fatal error, i've been staring @ code hours.. think has nothing name of function action_send , must silly 'missing parenthesis' or something... can me please ? if (...) {} else if (!historic_exist($id)) { action_send($req, '0', (strpos($req['tag'], 'admd') !== false) ? $req['id_act'] : ''); //the error in line : if ((strpos($req['wf'],'install') !== false) && $req('id_equ') !== '') action_send($req, '', '0'); } in php can call functions dynamically using variables. in code using $req('id_equ') php considers function call. but $req array php parser throws fatal error: fatal error: function name must string in \..\file.php on line .. you must change $req('id_equ') $req['id_equ'] .

java - Inject Spel parameter on annotation parameter (like what is done with @Value on a field) -

i'm using annotation provided spring-starter-elastic-search to create document , inject parameter indexname dynamically: @entity @document(indexname = "myindex") public class stockquotation in bean have done using @value on field: @value("${elasticsearch.index.name}") public string indexname; however, have tried inject in same way in annotation , translation not done: @entity @document(indexname = "${elasticsearch.index.name}") public class stockquotation as exception: caused by: org.elasticsearch.indices.indexmissingexception: [${elasticsearch.index.name}] missing what appropriate approach this? thanks