Posts

Android -OutofMemory error- bitmap factory -

my code.. mimageview_photos.setimagebitmap(bitmapfactory.decodefile(picturepath)); my logcat.. 11-27 10:51:56.325: e/androidruntime(3879): fatal exception: main 11-27 10:51:56.325: e/androidruntime(3879): process: com.virtualmaze.golfelite, pid: 3879 11-27 10:51:56.325: e/androidruntime(3879): java.lang.outofmemoryerror 11-27 10:51:56.325: e/androidruntime(3879): @ android.graphics.bitmapfactory.nativedecodestream(native method) 11-27 10:51:56.325: e/androidruntime(3879): @ android.graphics.bitmapfactory.decodestreaminternal(bitmapfactory.java:620) 11-27 10:51:56.325: e/androidruntime(3879): @ android.graphics.bitmapfactory.decodestream(bitmapfactory.java:596) 11-27 10:51:56.325: e/androidruntime(3879): @ android.graphics.bitmapfactory.decodefile(bitmapfactory.java:376) 11-27 10:51:56.325: e/androidruntime(3879): @ android.graphics.bitmapfactory.decodefile(bitmapfactory.java:402) 11-27 10:51:56.325: e/androidruntime(3879): @ com.virtualmaze.golfelite.h...

c++ - Correcting a segmentation fault -

#include <iostream> #include <stdio.h> #include <math.h> #include <stdlib.h> using namespace std; int main(){ int i=0,n,h,k; k = (int)pow(10,5); int c[k]; scanf("%d%d",&n,&h); if((n>=1 && n<=(int)pow(10,5)) && (h>=1 && h<=(int)pow(10,8))){ int arr[n]; do{ scanf("%d",&arr[i]); if(arr[i] > h){ cout<<"error !"; exit(1); } i++; }while(i!=(n-1)); i=0; do{ /*the fault occurs somewhere here, probably*/ scanf("%d",&c[i]); i++; }while(c[i]!=0); if(i>(int)pow(10,5)){ cerr<<"error !"; exit(0); } } return 0; } i'm trying accept few numbers console on different lines using scanf() (with constraints on upper , lower limits of numbers) - problem ...

node.js - More than 2 levels of population with mongoose -

i trying use mongoose populate ability return 1 composite document. categories , questions expanded fine. answers array in questions not expanded. here's have been doing summaryschema.statics.loadfull = function(options, callback){ var self = this; self.findone(options).populate([{ path: 'categories' }]) .exec(function(err, res){ if(err || !res) return callback(err, res); self.populate(res, [{ path: 'categories.questions', model: 'question' }], function(err, res){ if(err || !res || !res.length) return callback(err, res); self.populate(res, [{ path : 'categories.questions.answers', model: 'answer' }], function(err, res){ callback(err, res); }); }); }); }; is there obvious mistake making or mongoose not support more 2 levels of population. fyi, structure s...

xslt 2.0 - match uncaught though declared in XSL -

i've below xml. <para indent="no"> <star.page>18</star.page> further same. </para> and when run below xslt. <xsl:template match="para"> <xsl:value-of select="./node()[1][self::star.page]|./label/node()[1][self::star.page]"/> <div> <xsl:choose> <xsl:when test="./@align"> <xsl:attribute name="class"><xsl:text>para align-</xsl:text><xsl:value-of select="./@align"/></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="class"><xsl:text>para</xsl:text></xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:apply-templates/> </div> </xsl:template> when run this, instead of printing <div class="para">18</div> , pr...

javascript - Unsubscribe in Observable KnockOutJS -

im using knockout js , conducted research when observable notified fire function function functiontosubscribe() { } var testobservable = ko.observablearray([]); testobservable.subscribe(functiontosubscribe); i subscribing functiontosubscribe in event im thinking there way unsubscribe it? in c#? when unsubscribing events have idea regarding this??? the subscribe function returns "subscription" object has dispose method can use unsubscribe: var testobservable = ko.observablearray([]); var subscription = testobservable.subscribe(functiontosubscribe); //call dispose when want unsubscribe subscription.dispose(); see in documentation: explicitly subscribing observables

Guava - disk backed large collections -

do guava's collection implementations flow data disk beyond size? i didn't find simple reference on this, though sounds natural/simple way of supporting large datasets... we can use other libraries map db of course...or more comprehensive setups voldemort...but wondering why guava doesn't have it... is architecture point of view, if 1 needs use such large dataset, better off splitting out data separate data store instance instead of putting in same jvm...? nope; guava sticks on-heap collections, ones in java.util. on-disk collections more or less out of scope guava.

(2002) Error:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (46) -

please help.. i using yahoo small business web hosting. have uploaded files server , database also. had given host name 'mysql'. still cant access site. with yahoo webservices mysql seems run on different machine code, need connect host mysql instead of localhost : see yahoo " why can't access database? "