Posts

asp.net mvc - KendoUI grid never fires destroy method -

my kendoui never fires destroy method ? doing wrong. grid show data fails delete record. $("#registration-grid").kendogrid({ datasource: { type: "json", transport: { read: { url: "@html.raw(url.action("list", "participant"))", type: "post", datatype: "json" }, destroy: { url: "http://localhost:53669/api/participant/", type: "delete", datatype: "json" } }, schema: { data: "data", total: ...

c - How to end an input when enter is passed -

#include <stdio.h> #include <string.h> int main() { int array[1000]={0}, n, c, d, swap; printf("enter number of elements\n"); scanf("%d", &n); printf("enter %d integers\n", n); (c = 0; c<n; c++) scanf("%d", &array[c]); (c = 0 ; c < ( n - 1 ); c++) { (d = 0 ; d < n - c - 1; d++) { if (array[d] > array[d+1]) /* decreasing order use < */ { swap = array[d]; array[d] = array[d+1]; array[d+1] = swap; } } } printf("sorted list in ascending order:\n"); ( c = 0 ; c < n ; c++ ) printf("%d\n", array[c]); int result= array[n-1]-array[0]; printf("the difference between largest , smallest: %d",result); puts(""); return 0; } this program bubble sorts inputs first , gives output of differ...

shell - How to execute a php script from another php script? -

i have php files called file1.php, file2.php, file3.php . now, want run these php files 1 one other php file called all.php . mean file2.php executed after file1.php completed. file3.php executed after file2.php completed. how ? can use exec function ? safe hosting ? using cpanel in shared hosting. there way safe content in hosting ? thank ! you can use include() include('file1.php'); include('file2.php'); include('file3.php'); or include_once() include_once('file1.php'); include_once('file2.php'); include_once('file3.php'); or require or require_once require 'file1.php'; require 'file2.php'; require 'file3.php'; => require() produce fatal error (e_compile_error) , stop script => include() produce warning (e_warning) , script continue

wait for finished asynchronous process for getting current location in iOS app -

i current location of ios device in app using cllocationmanager , cllocation . works fine me. delivered location params latitude , longitude want use self created function. problem function getting current location runs in asynchronous process , not finished while starting next function. i use delegates in view controller getting current location. here code in swift: var latitude:cllocationdegrees = 0.0 var longitude:cllocationdegrees = 0.0 override func viewdidload() { super.viewdidload() //get current location , set vars latitude , logitude right values self.getcurrentlocation() //compute distance current location given location //the result of getcurrentlocation() still not exists @ time //latitude , longitude still have value 0.0 , not real value set getcurrentlocation() self.computedistancetogivenlocation(anotherlatitude: 10.0, anotherlogitude: 15.0) } how possible wait until function getcurrentlocation() finished before going on in ...

c# - How do I split an array into two different arrays and also, how do i allow the user to only enter in part of the array and not the maximum amount? -

i can't figure out how split array correctly can pass 2 separate arrays multiple different methods. end array @ point without program giving user error. can give me direction on , me fix program? using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; namespace proj09lea { class program { // declare constant integer const int max = 10; static void main(string[] args) { // declare , array of integers int[] array = new int[max]; console.writeline("\nsaturday coder's bowling team"); console.writeline("enter in name , score each person on team."); console.writeline("for example, mary 143. hit enter when done.\n"); // fill array user input (int = 0; < array.length; i++) { // ask user enter data console.writeline(...

How to make soap post request using Volley library in Android -

i want make make soap post request using volley library. using following code , got error "http/1.1 400 bad request". in previous using soap library working fine need make request using volley library.i using following url " http://test.com/testapp/services/service.asmx?op=forgotpassword " public void forgotpassword(final string username,string url) { stringrequest sr = new stringrequest(request.method.post, url, new response.listener<string>() { @override public void onresponse(string response) { toast.maketext(mcontext, "success" + response, toast.length_short).show(); } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { showresponse(error); } ...

c# - Using Generic T to Determine Compiler-Chosen Overload -

i have following code. plan getsetting() call appropriate version of fromstring() , depending on type of t . public static t getsetting<t>(persistedsetting setting, t defaultvalue = default(t)) { return fromstring(registrysettings.getsetting(setting.tostring()) string, defaultvalue); } private static string fromstring(string value, string defaultvalue) { return value ?? string.empty; } private static int fromstring(string value, int defaultvalue) { int i; return int.tryparse(value, out i) ? : defaultvalue; } private static decimal fromstring(string value, decimal defaultvalue) { decimal d; return decimal.tryparse(value, out d) ? d : defaultvalue; } private static bool fromstring(string value, bool defaultvalue) { bool b; return bool.tryparse(value, out b) ? b : defaultvalue; } however, on line calls fromstring() , compile error: the best overloaded method match 'articlemanager.persistedsettings.fromstring(string, string)' ...