Tuesday, 15 January 2013

android - how to set heap size to minimum when application was closed -



android - how to set heap size to minimum when application was closed -

i developing 1 android application using more images resolution 640*960 approximately. these images loaded bitmaps proper scaling factor.

when loading bitmpas heap size increasing , not decreasing though recycling bitmpas. read few theory's regarding issue maximum says 1 time heap increased not decreased @ all.

my problem if close application when heap size 10mb , , when reopen application heap starts 10mb. causes vm exceeds maximum heap memory , out of memory after time.

what have this, , guarantee application never close out recycling bitmaps.

can 1 please suggest me how minimze heap memory , solve oom.

even faced same problem....you can refer link loading bitmaps http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

once heap size has exceeded limit garbage collector runs...and cleans unwanted object.so improve not phone call garbage collector run automatically.

applications running on api level 11+ can have android:largeheap="true" on element in manifest request larger-than-normal heap size

in oncreate method in activity can utilize this(i did'nt seek this) dalvik.system.vmruntime.getruntime().setminimumheapsize(yournumberhere);

android bitmap out-of-memory heap-memory

Paypal failed to login in Android 4.0 -



Paypal failed to login in Android 4.0 -

private class paypalintegrated extends asynctask<void, void, void> { @override protected void doinbackground(void... params) { seek { paypalpayment newpayment = new paypalpayment(); newpayment.setsubtotal(new bigdecimal( coinprices[positionclicked])); newpayment.setcurrencytype("myr"); newpayment.setrecipient("xxxxxxxxxxx"); newpayment.setmerchantname("draw me not"); paypal pp = paypal.getinstance(); if (pp == null) pp = paypal.initwithappid(coinscene.this, "my_app_id", paypal.env_sandbox); intent paypalintent = pp.checkout(newpayment, coinscene.this); coinscene.this.startactivityforresult(paypalintent, 1); } grab (exception ex) { } homecoming null; } @override protected void onpostexecute(void result) { } }

i tested different devices galaxy mini 2, 2.3.6 , htc sensation, 4.0.4.

however, mini 2 can proceed payment , checked in sandbox business relationship appear transaction not htc.

htc homecoming error with

error code = 10004

error message = please create sure fields have been entered

i think os version impact result.

is there solution?

android paypal

ruby - How to find out why rails server hangs at 100%? -



ruby - How to find out why rails server hangs at 100%? -

can think of way find out our rails production server hangs? cpu @ 99% assume gets lost in while/for/each loop. unfortunately can't find candidate loop.

the problem not occur in development , our test suit has 100% code coverage.

we attaching ruby via gdb, didn't know go there. ideas?

once have attached gdb busy looping process phone call rb_backtrace gdb:

> phone call rb_backtrace()

the output rb_backtrace similar crash report, , output go log files similar standard ruby error backtrace.

from there should step closer solution since see in ruby code process stuck.

you can check out more tips here: http://isotope11.com/blog/getting-a-ruby-backtrace-from-gnu-debugger

ruby-on-rails ruby debugging gdb

java - Suppressing GPG signing for Maven-based continous integration builds (Travis CI) -



java - Suppressing GPG signing for Maven-based continous integration builds (Travis CI) -

i'm using travis-ci provide continuous integration builds few java open source projects i'm working on.

normally works smoothly, have problem when pom specifies gpg signing, e.g.

<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-gpg-plugin</artifactid> <version>1.4</version> <executions> <execution> <id>sign-artifacts</id> <phase>verify</phase> <goals> <goal>sign</goal> </goals> </execution> </executions> </plugin>

this causes travis build fail - apparently because not have passphrase available while running mvn install. see this build example.

what best way configure maven and/or travis skip gpg signing ci test builds, still perform gpg signing when proper release build?

you need create profile & create sure run when release build.

remove current plugin, , add together in profile this:

<profiles> <profile> <id>release-sign-artifacts</id> <activation> <property> <name>performrelease</name> <value>true</value> </property> </activation> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-gpg-plugin</artifactid> <version>1.4</version> <executions> <execution> <id>sign-artifacts</id> <phase>verify</phase> <goals> <goal>sign</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles>

and when need release, add together property mvn command:

mvn -dperformrelease=true ...

java maven continuous-integration gnupg travis-ci

mysql - Introducing a column of numbers that count from 1-381 -



mysql - Introducing a column of numbers that count from 1-381 -

i have table 381 records columns id,name,dept_id.

how introduce column called row_id numbers count 1-381 (to uniquely identify each row , need auto-increment point afterwards).

i need write in mysql. other way can think of manually entering take long.

add new column alter table table_name add together column row_id int() execute command select @i:=0;update table_name set row_id = @i:=@i+1then create primary key , set auto increment

mysql phpmyadmin

c# - Steps for using Google custom search API in .NET -



c# - Steps for using Google custom search API in .NET -

i trying utilize google custom search api in .net project. have api key provided company. have created custom search engine using google business relationship , copied 'cx' value.

i using next code:

string apikey = "my company key"; string cx = "cx"; string query = tbsearch.text; webclient webclient = new webclient(); webclient.headers.add("user-agent", "only test!"); string result = webclient.downloadstring(string.format("https://www.googleapis.com/customsearch/v1?key={0}&cx={1}&q={2}&alt=json", apikey, cx, query));

i getting next error: "the remote server returned error: (403) forbidden. "

i have tried next code too:

google.apis.customsearch.v1.customsearchservice svc = new google.apis.customsearch.v1.customsearchservice(); svc.key = apikey; google.apis.customsearch.v1.cseresource.listrequest listrequest = svc.cse.list(query); listrequest.cx = cx; google.apis.customsearch.v1.data.search search = listrequest.fetch(); foreach (google.apis.customsearch.v1.data.result result1 in search.items) { console.writeline("title: {0}", result1.title); console.writeline("link: {0}", result1.link); }

here next exception @ fetch():

google.apis.requests.requesterror access not configured [403] errors [message[access not configured] location[ - ] reason[accessnotconfigured] domain[usagelimits]

is cx parameter required? getting error because using key provided company , using cx parameter custom search engine using google account?

is there other way of getting 'cx'? don't want display google ads.

thank much in advance help.

i'm not sure if still interested in this.

to results without ads need pay it. info @ google

and yest cx required because specifies google custom search engine want utilize search. can create custom search engine this google page

and here current code retrieve search results current api version 1.3.0-beta

string apikey = "your api key"; string cx = "your custom search engine id"; string query = "your query"; var svc = new google.apis.customsearch.v1.customsearchservice(new baseclientservice.initializer { apikey = apikey }); var listrequest = svc.cse.list(query); listrequest.cx = cx; var search = listrequest.fetch(); foreach (var result in search.items) { response.output.writeline("title: {0}", result.title); response.output.writeline("link: {0}", result.link); }

hope helps

c# .net google-custom-search

html - Footer stick to the bottom with jQuery -



html - Footer stick to the bottom with jQuery -

i tried div.col-wrapper stick bottom on firefox on high res screens using position absolute reason messing jquery slide effect. ran out of possible solution except in jquery create stick bottom.

jquery

$(document).ready(function(){ $(".box").show(); $(".list").hide(); $(".wbut").click(function(){ $(".wbut").hide("fade"); $(".box").hide("fade"); $(".list").show("slide", { direction: "down" }, 1000); }); $(".wbut2").click(function(){ $(".box").show(); $(".wbut").show(); $(".list").hide("slide", { direction: "down" }, 1000); }); });

css

.list { background: #d1d1d1; } .col-wrapper { width: 100%; position: relative; bottom: 0; left: 0; background: #d1d1d1; box-shadow: 0px -5px 8px #777; }

i added position absolute wrong element. should .list not .col-wrapper

jquery html css firefox