Posts

Scheme (DrRacket) - Calling Generalized / Abstracted Function with Another Function -

for reference programming scheme using drracket. for problem making generalized / abstracted function (which aren't using higher-order functions and/or lambda) called tally-by of function tally-by-place-points defined below: (define listofcandidates (list "blake" "ash" "bob" "will" "joey")) ;; signature: tally-by-place-points: ;; list-of-candidates list-of-votes -> list-of-voting-tallies ;; purpose: consumes list of candidate names , list of votes , ;; produces list of voting-tallies. ;; (points-per-place strategy). ;; tests: (check-expect (tally-by-place-points empty empty) empty) (check-expect (tally-by-place-points listofcandidates listofvotes) (cons (make-voting-tally "blake" 7) (cons (make-voting-tally "ash" 3) (cons (make-voting-tally "bob" 5) (cons (make-voting-tally "will" 1...

Spark - How to do summary statistics on SchemaRDD? -

i want calculate the summary statistics on log count per user , rdd used from: val filerdd = sc.textfile("s3n://<bucket>/project/20141215/log_type1/log_type1.*.gz") val jsonrdd = sqlcontext.jsonrdd(filerdd) rdd.registertemptable("log_type1") val result = sqlcontext.sql("select user_id, count(*) the_count log_type1 group user_id order the_count desc") how can apply statistics functionalities provided spark mllib on result ? since log count of each user important, have summary of following form: mean: 3.245 (user-id-abcdef) min: 1 (user-id-mmmnnnkkk) median: 15 (user-id-xyzrpg) max: 950 (user-id-123456789) how can can this? looks there's no maprdd in spark's api.

javascript - Issue with Bootstrap Footer -

Image
i using bootstrap app here . i want stick footer till bottom of page shown below above, footer doesn't come @ bottom of page. i have searched stackoverflow , tried number of solutions none resolves problem. please help try add following css .footer-v1{ position: absolute; width: 100%; bottom: 0px;}

c++ - Why function fun is not qualified for ADL? -

i have simple namespace , has 1 variable , 1 function. in main try call function without namespace qualifier, , variable namespace qualifier. namespace sam { int p = 10; void fun(int) { cout<<"fun gets called"; } } int main() { fun(sam::p);//why sam::fun not called? return 0; } i not able call fun, why not qualified adl (argument-dependant name lookup)? i getting following error in visual studio. 'fun': identifier not found if use sam::fun , works. adl adopted type , not variable , e.g. namespace sam { struct p {}; void fun(p) { cout<<"fun gets called"; } } int main() { sam::p p; fun(p); return 0; } in c++ programming language, argument-dependent lookup (adl), or argument-dependent name lookup, applies lookup of unqualified function name depending on types of arguments given function call. reference: argument-dependent name lookup...

iphone - iOS taking login id from setting not from app login -

i facing problem while facebook post ios app. in ios there made 2 ways login 1st setting in iphone , other app. when post thing facebook through xcode @ time taking facebook login id settings facebook login not app login. i want facebook login id used in app login not setting. is there solution problem. if ar using uiactivity controller sharing, take setting login id, if need take app login may have implement own custom method sharing on facebook using, facebook sdk, you can refer below link implementing own share https://developers.facebook.com/docs/ios/share

javascript - Jquery not working while process dynamically -

the below code works me function gethotelsbydestination(dest_id) { $.ajax({ url: "controller/gethotels.php", datatype: "json", data: "id=" + dest_id, success: function(data) { $("#divid").html(""); $.each(data, function(index, item) { var val = item.id; var text = item.name; $("#divid").append( $('<option></option>').val(val).html(text) ); }) } }); } but when use below code not returns anything.divv id of dropdown passed php page function gethotelsbydestination(dest_id, divv) { var divdrp = "$('#" + divv + "')"; $.ajax({ url: "controller/gethotels.php", datatype: "json", data: "id=" + dest_id, success: f...

gravity forms plugin - Icon should appear when button selected (via HTML) -

Image
currently when button selected, font goes "bold" , dot appears in spot. i'd make small icon (a tick) appear also/instead. or i'm open other ideas. i'm using gravityform. here site click here . i'm talking button next text "icon appear". here screenshot requirement: icon appear next button when has been selected/clicked. is there simple way html achieve this? use below code : label > img {display: none;} input[type=radio]:checked + label > img{display:inline-block;} for prevent global impact, use classes / ids accordingly like... #section label > img {display: none;} #section input[type=radio]:checked + label > img{display:inline-block;}