Posts

javascript - AJAX call sending JSON data -

i working on chat system refreshes automatically using ajax. first using jquery $.post function, since wanted return json data php script, want use $.ajax function. script worked using $.post function, can not return json. relevant code: javascript: $.ajax({ url: "pages/loadmessage.php", type: "post", data: {"c": geturlparameter("c"), "t": messagetime}, datatype: "json", success: function(pdata){ console.log(pdata); }, error: function(xhr, status, error) { alert(error + status); } }); php code: <?php require_once("../init.php"); header('content-type: application/json'); if (input::exists() && input::get("c") && input::get("t")) { $chat = new chat($user->data()->id, input::get("c")); $messages = $chat->getnewmessages(input::get("t"), $user->data()->id); if ($messages) ...

ios - Using enum With Integers in Swift -

i'd know how can limit set of values can pass function argument (or class property). or, in other words, logic want implement, actually, make function or class accept particular values. i've come idea use enum it. caveat here can't use pure integers 'case' so: enum measure { case 1, 2, 3 } is there way implement want? enum measure:int{ case 1 = 1 case 2 = 2 case 3 = 3 } //accept argument func mymethod(measure:measure){ switch measure { case .one:... case .two:... case .three } } //call method raw data mymethod(measure(rawvalue:1)!) //or call method mymethod(measure.one)

r - "zoom"/"scale" with coord_polar() -

Image
i've got polar plot uses geom_smooth(). smoothed loess line though small , rings around center of plot. i'd "zoom in" can see better. using scale_y_continuous(limits = c(-.05,.7)) make geom_smooth ring bigger, alter because recompute datapoints limited limits = c(-.05,.7) argument. for cartesian plot use coord_cartesian(ylim = c(-.05,.7)) clip chart not underlying data. can see no way coord_polar() any ideas? thought there might way grid.clip() in grid package not having luck. any ideas? what plot looks now, note "higher" red line: what i'd draw: what when use scale_y_continuous() note "higher" blue line, it's still not big.

Building ionic, cordova app I get an Error: Cannot find module 'sax' -

i following instrucitons on how start building cordova apps android using ionic. when "ionic platform add android" on command line error error: cannot find module 'sax' cannot find solutions that. have idea comes from? thanks! i did originaly install on powershell using npm install. i didn't find solutions uninstalled ionic , cordova , reinstalled them both. fixed issue.

c# - Currency Format Returns Invalid Characters in Azure -

i have double amount 5190.40 , when convert "swiss franc" gives 5'190.40 . however, when deploy changes azure, not convert correctly. converted currency 5Â 190.40 , incorrect. culture name german (switzerland) . i using following code convert currency internal static string formatcurrency(this double amount, string currencycode) { var culture = (from c in cultureinfo.getcultures(culturetypes.specificcultures) let r = new regioninfo(c.lcid) r != null && r.isocurrencysymbol.toupper() == currencycode.toupper() select c).firstordefault(); if (culture == null) return amount.tostring("0.00"); culture.numberformat.currencysymbol = string.empty; return string.format(culture, "{0:c}", amount).trim(); } i executing code in following manner: double amount = 5190.40; amount.formatcurrency("chf"); ...

sql - How to set an object as an out parameter? -

i have written procedure in pl/sql , want return emp type object. possible that? if yes, how can it? here code: create or replace procedure get_emp_rs (p_deptno in emp.deptno%type, p_recordset out emp_det) emp_details emp_det; begin open p_recordset select ename, empno emp deptno = p_deptno order ename; fetch p_recordset emp_details; --exit when p_recordset%notfound; --end loop; --for indx in p_recordset --loop emp_details.ename:= 'test'; --end loop; end get_emp_rs; / set serveroutput on size 1000000 declare l_cursor emp_det; --l_cur emp_det; --l_ename emp.ename%type; --l_empno emp.empno%type; l_deptno emp.deptno%type; begin l_cur:=get_emp_rs ('30', l_cursor); dbms_output.put_line('low'); /*loop fetch l_cursor l_ename, l_empno, l_deptno; exit when l_curso...

iphone - Unable to copy symbols from this device Using iOS 9.2.1 Xcode is 7.2 -

could not resize “/private/var/folders/_5/jhpy2pns35n0kljwt0l08q_40000gn/t/temporaryitems/(a document being saved xcode 3)/dyld_shared_cache_armv7s” (no space left on device) has figured out how solve issue? trying set iphone 6s xcode, , started happening. tried reinstalling xcode, did nothing. i had same problem, had lots of free space on iphone claiming no space left on device. i hadn't thought memory on mac affect once deleted few files app downloaded device correctly. i recommend: make sure device , mac have enough memory clean xcode reset xcode the combination of of these fixed issue me. credit @vinícius albino in comments getting me answer