Posts

java - How to stop incrementing and decrimenting at the end of an array? -

i'm beginner in programming. want make android app 3 views. text view (display text), , buttons (forward , back). i made array of words one, two, three, four, five displayed. put one on xml . when user clicks forward shows two when click forward again shows three , when user clicks back shows two . can until poit. the problem when reaches five , user clicks forward , when reaches one , user clicks back crashes. i want button nothing, not goes one . want user know end of list. same problem back button. want stays on one . code. please help. public class aba extends appcompatactivity { int = 0; string[] mylist = { "one", "two", "three", "four", "five" }; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_aba); } //incremen...

html5 - Minify CSS included in html header with grunt task -

i have html file width css file included in head section has been minified cssmin, additionally html has been minified htmlmin grunt task succesfully, there little problem html minified, css , javascript included directly on head secction not minified htmlmin, obiously task if html, not css or javascript. how can minify css , javascript included in head section? for example: dummy initial html file: <!doctype html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>some title</title> <link href="mycss.min.css" type="text/css" rel="stylesheet"> <style> .class1 { color: black; /* other properties */ } .class2 { color: white; /* other properties */ } /* more , more classes */ </style> </head> <body> ht...

javascript - Return list to JSON to Angularjs -

it such must have sent content controller on angularjs shall come forth words such l in or e, goes in other words, of words let words sign has single letter. there no fault forward console , believe problem not specify value side. i have try here: a circular reference detected while serializing object of type 'subsonic.schema .databasecolumn'. load.js var app = angular.module('wordspreads',[]); app.controller('wordspreadslistvalue', function ($scope, $http) { $http( { method: 'get', url: '../profile/mwordspreads' }).success(function (response) { $scope.entries = data.list;; }); console.log("test");//it not appear in console log. }); controller: [httpget] public jsonresult mwordspreads() { wordsspreadslistvalue model = new wordsspreadslistvalue(); var db = helpertotables.dbvalue; model.list = db.wordspreads.tolist(); ...

python - numpy: Why is there a difference between (x,1) and (x, ) dimensionality -

i wondering why in numpy there 1 dimensional array of dimension (length, 1) , 1 dimensional array of dimension (length, ) w/o second value. i running quite frequently, e.g. when using np.concatenate() requires reshape step beforehand (or directly use hstack / vstack ). i can't think of reason why behavior desirable. can explain? edit: suggested on of comments question possible duplicate. more interested in underlying workings of numpy , not there distinction between 1d , 2d arrays think point of mentioned thread. the data of ndarray stored 1d buffer - block of memory. multidimensional nature of array produced shape , strides attributes, , code uses them. the numpy developers chose allow arbitrary number of dimensions, shape , strides represented tuples of length, including 0 , 1. in contrast matlab built around fortran programs developed matrix operations. in days in matlab 2d matrix. around 2000 (v3.5) generalized allow more 2d, never less. numpy...

php - App is not working on WAMP but It works in online server -

Image
i made basic login app using online sqlite database( http://demo3534535.16mb.com ) works fine on online server. want run on local server using wamp in gennymotion emulator. what change in code have do? working online code is: dbconnect.php <?php define('host','mysql.hostinger.in'); define('user','u756_userd'); define('pass','pass345'); define('db','u754113_demo'); $con = mysqli_connect(host,user,pass,db) or die('unable connect'); mainactivity.java public class mainactivity extends appcompatactivity implements view.onclicklistener { private static final string register_url = "http://192.168.1.102/user/register.php"; public static final string key_username = "username"; public static final string key_password = "password"; public static final string key_email = "email"; private edittext edittextusername; priv...

text - Python/Pygame Title Rendering -

i'm trying render title little project i'm working on. i've replicated same code used create options set (merely ease) yet isn't working. wondering if knows i'm going wrong? it's obvious i'm not experienced when comes python. here's code: import pygame class option: hovered = false def __init__(self, text, pos): self.text = text self.pos = pos self.set_rect() self.draw() def draw(self): self.set_rend() screen.blit(self.rend, self.rect) def set_rend(self): self.rend = menu_font.render(self.text, true, self.get_color()) def get_color(self): if self.hovered: return (255, 255, 255) else: return (100, 100, 100) def set_rect(self): self.set_rend() self.rect = self.rend.get_rect() self.rect.topleft = self.pos class title: hovered = false def __init__(self, text, pos): self.text = text ...

java - WebSphere 7 - How can I determine which objects are using up heap memory at runtime? -

issue: have intermittent out of memory issues websphere recovering. trying determine how can find out using of memory. have app dynamics not work websphere. is way way determine using of memory have heap dump out of memory crash? server: websphere 7.5 java version: ibm 1.6 you can generate heap dump (snapshot of heap @ point of time) , thread dump/javacore (list of threads in jvm @ point of time) while websphere application server running. to obtain dumps, need use wsadmin tool. start wsadmin tool , execute following commands. jacl version: set jvm [$admincontrol querynames websphere:type=jvm,process=<servername>,node=<nodename>,*] $admincontrol invoke $jvm generateheapdump $admincontrol invoke $jvm dumpthreads jython version (untested): jvm = admincontrol.querynames ('websphere:type=jvm,process=<servername>,node=<nodename>,*') admincontrol.invoke(jvm, 'generateheapdump') admincontrol.invoke(jvm, 'dumpthrea...