Posts

java - Passing $routeParams from angularjs to spring controller -

this have in angularjs controller .when("/mutualfriends:topicid", {templateurl: "mutualfriends", controller: "conmfriends"}) app.controller('conmfriends',function($scope,$routeparams){ $scope.otherid = $routeparams.topicid; }); this spring controller @requestmapping(value="/controlerm", method = requestmethod.get) public modelandview controlerm(httpservletrequest request, httpservletresponse response) throws exception { modelandview model = null; session=request.getsession(true); user = (user) session.getattribute("user"); list<ends1> ends=(list<ends1>) ifriendlistservice.getends(user.getid(),5); session.setattribute("mutualfriends", mutualfriends); model = new modelandview("ends"); return model; i able fetch topicid angularjs page in angularjs controller (with $scope.otherid), unable pass value spring controller, redirecting new page. please help.

JavaCC expects nothing and found nothing -

i'm trying bottom of parser problem, begin, i'd know why happens: encountered "" @ line 1, column 1. expecting 1 of: here subset of grammar causes problem: options { static = false; debug_parser = true; debug_lookahead = true; lookahead = 64; } parser_begin(myparser) package myparser; public class myparser { } parser_end(myparser) /* skip whitespace */ skip : { " " | "\t" | "\n" | "\r" } /* other symbols */ token : { < comma: "," > | < semicolon: ";" > | < left_paren: "(" > | < right_paren: ")" > | < left_bracket: "[" > | < right_bracket: "]" > | < left_brace: "{" > | < right_brace: "}" > } /* type specifiers */ token : { < type_specifier: "void" | "int" | "float" > } /* identifiers */ token [ignore_case] : { <id...

import - Using Dream Factory with Android Studio -

i'm trying use dreamfactory github android studio, attempts haven't been successful far. how can import library , use connecting dream.factory.cloud ? the guide eclipse, , not android studio. also, sample app not use gradle. don't know how fix this, , need pointers. the solution uploaded here me, followed instruction here after have download project here https://github.com/segunmicheal27/dreamfsctorysample-androidstudiosample/tree/master don't need modification need study code , modified want

php - readfile function returning file content in non ASCII characters -

when execute following code, image not displayed in browser , rather non ascii symbols , characters displayed instead.few lines follows: ����jfif��6photoshop 3.08bimgqaridey1blfs2krgbsou��icc_profilelcmsmntrrgb xyz �)9acspappl���-lcms desc�^cprt\wtpthbkpt|rxyz�gxyz�bxyz�rtrc�@gtrc�@btrc�@descc2textfbxyz ���-xyz 3�xyz o�8��xyz b����xyz $����curv��c�k�?q4!�)�2;�fqw]�kpz���|�i�}���0����c ! $( %2%(,-/0/#484.7 ./.��c what doing wrong here? <?php session_start(); if (isset($_session['logsyscuruser'])) { // logged in $id = $_session['logsyscuruser']; $imglocation = '/applications/xampp/im/'; include "include/specificproductdb.php"; $data = new specificpro(); $out = $data->select($query, $id, $pid); $count = count($out); } else { //not logged in header("location: loginsystem/login.php", true, 302); die(); } ?> <!doctype html public "-//w3c//dtd html 4.0 transitional//en" "http...

Android - Window leak error on ProgressDialog when device is in landscape -

i have looked @ many questions here , searched on internet couldn't find specific solution. main problem other questions refer is, window leak error when go portrait landscape or vice versa. , answer mainly, because activity destroyed , recreated, hence window leak error . but problem is, device in landscape, , app working fine, previous activities smoothly running, when try display progressdialog , window leak error thrown. exact same code works fine when in portrait orientation. class downloadyearchartasynctask extends asynctask<string, integer, boolean> { private string username; private string city; private resources resources; private location locationofcity = null; private progressdialog progressdialog; public downloadyearchartasynctask(string username) { this.username = username; } @override protected void onpreexecute() { super.onpreexecute(); resources = getresources(); setrequeste...

java - Creating only 1 instance or a Singleton -

i used class called 'city' & there 1 city in entire game; beneficial create instance, if 1 or singleton. the class contain methods won't static, & i've read singletons consist of static attributes , methods & can bad practice or mistaken? singleton common pattern , can deal 1 instance of object inside entire runtime environment. don't warry distinguish static , non-static methods... make of them non-static, because if invoke them city.getinstance().method() , sure method() (and other method) invoked on same instance. previous answer correct, have implement singleton in different way if in multi-thread environment (as web application) , need sure 1 instance created. infact, in prevoius code possible several concurrent threads create new city instance... threads created later use last instance (because overrides first 1 in static field). there several options overpass problem... common make synchronized getinstance() method: publi...

javascript - Place text/image on svg path centroid using D3 -

Image
ive looked , read suck in, im still having trouble centroid. similar question of mine, more precise. i need put text / image on centroid of these regions: the svg data in html file in format this: so need select path, , use centroid function on d attribute, , place dot/text/image etc. ive attached jsfiddle see regions, dont mind class´s/id´s. <svg id="gamemap"> <g> <path id='1613' class='faction2' d='m541.02,336.29l541.71,336.09l543.77,338.27l543.53,338.58l545.92,338.99l546.76,340.12l548.44,340.06l548.55,341.76l549.62,342.38l549.24,343.35l550.58,344.54l551.35,344.98l553.38,344.66l554.17,345.63l555.37,345.08l556.2,346.28l556.8,345.6l557.82,347.73l558.51,347.76l558.17,350.15l560.8,350.12l561.12,349.61l563.89,349.94l562.98,351.84l562.99,353.94l562.06,353.97l560.77,357.72l561.33,357.73l562.06,359l563.49,358.5l563.75,357.85l564.17,358.09l564.64,361.19l565.52,361.68l564.51,362.21l564.67,363.38l565.17,363.21l565.3...