Posts

objective c - Ask to send crash report in ios? -

i writing codes project can not use several crash reporting tools due privacy issue. searching manage send email having crash report if crash occurs without involvement of third party reporting tool. in application delegate declare api like: void uncaughtexceptionhandler(nsexception * exception) { // here can: // 1. set boolean in user defaults app crashed. // 2. dump data (below) in file in documents directory. nslog(@"uncaught exception: %@", exception.reason); nslog(@"crashsymbols: %@", exception.callstacksymbols); } then set in "application:didfinishlaunchingwithoptions:": nssetuncaughtexceptionhandler(&uncaughtexceptionhandler); then when application next launches, if boolean (1) set in user defaults, read data (2) , email.

python - scipy: minimize vs. minimize.scalar; return F versus return F**2; shouldnt make a difference? -

i found behavior cannot explain. miss ? i have implicit function: def my_cost_fun(x,a,b,c): # x scalar; variables provided numpy arrays f = some_fun(x,a,b,c) - x return f i minimize function using: optimize.fsolve(my_cost_fun,0.2,args = (a,b,c)) optimize.brentq(my_cost_fun,-0.2,0.2,args = (a,b,c)) or mimimize function: optimize.minimize(my_cost_fun,0.2,args = (a,b,c),method = 'l-bfgs-b',bounds=((0,a),) the strange thing is: if use return f brent_q method , fsolve give same result , %timeit measures fastest loop ~ 250 µs l-bfgs-b (and slsqp , tnc) not change x0 @ , provides wrong result if use return f**2 : fsolve returns right solution converges slowly; 1.2 ms fastest loop l-bfgs-b returns right solution converges slowly: 1.5 ms fastest loop can explain why ? as mentioned in comments: here 1 possible explaination of why l-bfgs-b not working when use return f : if value of f can negative, optmize.minimize try find...

windows - package-refresh-contents hangs at Contacting host: elpa.gnu.org:80 -

i'm running emacs 24.4 windows (installed through chocolatey) , trying install cider. when run m-x package-install [ret] cider [ret] , [no match] . when run m-x package-refresh-contents [ret] , hangs on contacting host: elpa.gnu.org:80 . ~/.emacs.d populated github repo recommended braveclojure.com ( here ). i've reinstalled emacs , i'm still getting same problem. i had same problem on emacs elpa wiki set un elpa have modify emacs init file located @ ~/.emacs or _emacs or ~/.emacs.d/init.el me ~/.emacs-live.el since have version. i updated file following: (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") ("marmalade" . "http://marmalade-repo.org/packages/") ("melpa" . "http://melpa.org/packages/"))) seems needed configuration elpa going packages. after ran m-x package-refresh-contents [ret] , m-x package-install [ret] cid...

excel - Can VBA delete a row from a .txt file -

i have text file contains: date, price 3/12/2015, 755 3/13/2015, 1087 i have code inserting rows text file , have insert correction date. in example, let's real price want 3/12/2015 650 instead of 755. there way delete 755 row , insert row 3/12/2015, 650 new file like: date, price 3/12/2015, 650 3/13/2015, 1087 here code using write text file: filepath = "c:\desktop\path.txt" set ofile = fso.opentextfile(filepath, 8, true) ofile.writeline range("a13").text & "," & range("b13").value thank you.

javascript - getting value from input field and open a new link -

im new html && javascript coding im doing first steps , trying write search bar pass google input text <script src="func.js"></script> <form name="googleseach"> <p align="center"><input name="searchtxt" id="searchtxt" type=search placeholder="google search"> <input type="submit" value="find" onclick="test()"></p> </form> and javascript function test(){ window.open("https://www.google.ru/webhp?newwindow=#q="+document.getelementbyid('searchtxt').value,"_self") } well, thought should work no, not. what's proble? believe want use <form name="googleseach" onsubmit="test(event)"> instead of onclick. also handler should cancel submit action. use location.href instead of window.open since you're trying open new url in same window. http://jsfiddl...

javascript - Math Computation with Checked Boxes -

having trouble trying figure out how add value of checked box total. in case i'm trying add price of checked boxes price of original cost already. function totals cost of original cost correctly i'm not sure how add checked values function or create new one. in advance. <tr> <th> small pizza </th> <td> $9.00 </td> <td> <input type = "text" name = "smal" id = "small" size ="2" /> </td> </tr> <tr> <th> medium pizza </th> <td> $11.00 </td> <td> <input type = "text" name = "medium" id = "medium" size = "2" /> </td> </tr> <tr> <th> large pizza </th> <td> $13.00 </td> <td> <input type = "text" name = "large" id = "large...

Python 3.4 - Opening a file in a module with a different directory -

i have package looks following package/ __init__.py module.py in module.py have this def function(file_name): open(file_name) f: # stuff somewhere else in arbitrary directory have python file looks this import package package.function("some_file.txt") but upon running it, it's giving me filenotfounderror: [errno 2] no such file or directory: "some_file.txt" . the problem absolute path of some_file.txt may c:\users\user\documents\some_file.txt , in package.function path absolute path c:\users\user\documents\package\some_file.txt . there way can make calling package.function file outside package directory automatically includes absolute path of file want open? sorry if terminology ambiguous, i'm unfamiliar os stuff. edit: exact file setup have looks this: directory/ foo.py package/ __init__.py module.py another_directory/ bar.txt and foo.py looks this import package p...