Sunday, 15 January 2012

apache poi cellIterator skips blank cells but not in first row -



apache poi cellIterator skips blank cells but not in first row -

i creating java programme read excel sheet , create comma separated file. when run sample excel file, blank columns, first row works perfectly, rest of rows skip blank cells. have read code changes required insert blank cells rows, question why first row work ????

public arraylist openandreadexcel(){ fileinputstream file = null; hssfworkbook workbook = null; arraylist <string> rows = new arraylist(); //open file seek { file = new fileinputstream(new file("fruity.xls")); } grab (filenotfoundexception e) { // todo auto-generated grab block system.out.println("could not open input file"); e.printstacktrace(); } // open input stream workbook seek { workbook = new hssfworkbook(file); } grab (ioexception e) { // todo auto-generated grab block system.out.println("can't open hssf workbook"); e.printstacktrace(); } // sheet hssfsheet sheet = workbook.getsheetat(0); // add together iterator every row , column iterator<row> rowiter = sheet.rowiterator(); while (rowiter.hasnext()) { string rowholder = ""; hssfrow row = (hssfrow) rowiter.next(); iterator<cell> celliter = row.celliterator(); boolean first =true; while ( celliter.hasnext()) { if (!first) rowholder = rowholder + ","; hssfcell cell = (hssfcell) celliter.next(); rowholder = rowholder + cell.tostring() ; first = false; } rows.add(rowholder); } homecoming rows; } public void writeoutput(arraylist<string> rows) { // todo auto-generated method stub printstream outfile ; seek { outfile = new printstream("fruity.txt"); for(string row : rows) { outfile.println(row); } outfile.close(); } grab (filenotfoundexception e) { // todo auto-generated grab block e.printstacktrace(); } }

} ----- input in .xls file (sorry don't know how insert excel table here ) name >>>>>>>>>> country of origin >>>>>>>>> state of origin >>>>>>> grade>>>>>> no of months apple >>>>>>>> usa >>>>>>>>>>>>>>>>>>>>>> washington >>>>>>>>>>>>>> >>>>>>>>> 6 orange >>>>>> usa >>>>>>>>>>>>>>>>>>>>>> florida >>>>>>>>>>>>>>>>> >>>>>>>>> 9 pineapple>>>>> usa >>>>>>>>>>>>>>>>>>>>>> hawaii >>>>>>>>>>>>>>>>>> b >>>>>>>>> 10 strawberry>>>> usa >>>>>>>>>>>>>>>>>>>>>> new jersey>>>>>>>>>>>>>> c >>>>>>>>>> 3 my output text file name ,country of origin,state of origin,,,grade,no of months apple,usa,washington,a,6.0 orange,usa,florida,a,9.0 pineapple,usa,hawaii,b,10.0 strawberry,usa,new jersey,c,3.0

notice 2 commas before grade column... because have 2 blank columns there.<br/>

these commas missing in rest of output.

i using apache poi-3.9-20121203.jar

you should have read through iterating on rows , cells documentation on apache poi website.

the celliterator homecoming cells have been defined in file, largely means ones either values or formatting. excel file format sparse, , doesn't bother storing cells have neither values nor formatting.

for case, must have formatting applied first row, causes them show up.

you need read through documentation , switch lookups index. allow total command on how blank vs never used cells handled in code.

apache-poi

php - CDbCriteria condition from another CDbCriteria -



php - CDbCriteria condition from another CDbCriteria -

i don't if want possible or not, have 2 models want info 1 model using status another.

$criteria1=new cdbcriteria; $paramids = $s['param_id']; $stress = model1::model()->find($criteria1); $mycondition= ($stress->stress_value); echo $mycondition ; // value , want utilize // status next cdbcreteria $criteria2=new cdbcriteria; // status $criteria2->addcondition(array('pressure_value' > $mycondition)); // can't perform status $criteria2->order = "pressure_value desc"; $pressure = model2::model()->find($criteria2);

any thought ? code wrong or want not possible in way ?

many thanks

thanks @Örs

your solution work me making compare statement in cdbcreteria after condition

$criteria2->params = array(':value' => $mycondition)

php yii

Not Getting External Font in Android -



Not Getting External Font in Android -

i not getting external font, creating new class, defined external font.

fontstyle.java

public class fontstyle extends activity{ public final static string roboto_regular = "fonts/roboto_regular.ttf"; public typeface font_roboto_regular = typeface.createfromasset(getassets(), roboto_regular); }

and mainactivity.java

public class mainactivity extends activity { fontstyle font_style; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); fontstyling(); } private void fontstyling() { textview test= (textview) findviewbyid(r.id.tv_test); test.settypeface(font_style.font_roboto_regular ); }

i getting error or logcat:

java.lang.runtimeexception: unable start activity componentinfo{com.test/com.test.mainactivity}: java.lang.nullpointerexception

please guy right me: in advance.

first need pass activity context in fontstyle access getassets method. if fontstyle not activity no need extends activity it. alter fontstyle class as:

public class fontstyle { context context; public final static string roboto_regular = "fonts/roboto_regular.ttf"; public fontstyle(context context){ this.context=context; } public typeface getttypeface(){ typeface font_roboto_regular = typeface.createfromasset(context.getassets(),roboto_regular); homecoming font_roboto_regular; } }

now alter activity code set custom font textview :

public class mainactivity extends activity { fontstyle font_style; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); font_style=new fontstyle(mainactivity.this); fontstyling(); } private void fontstyling() { textview test= (textview) findviewbyid(r.id.tv_test); test.settypeface(font_style.getttypeface()); }

android fonts

Uploading image to a submit form via PHP and curl -



Uploading image to a submit form via PHP and curl -

i have upload set of images submit form in page. think can done php , curl. when checked submit form action file, noticed using post request payloads upload images.

can help me in telling how add together payload post request. need basic knowledge along sample code how images uploaded server etc. tried number of codes here , there on so, none of them worked out case. so, thought going through basics more of import ! able write case.

updates :-

i have come solution

function curl_post_request($url, $data, $referer='') { $data = http_build_query($data); $c = curl_init(); curl_setopt($c, curlopt_url, $url); curl_setopt($c, curlopt_returntransfer, true); curl_setopt($c, curlopt_header, true); curl_setopt($c, curlopt_post, true); curl_setopt($c, curlopt_postfields, $data); curl_setopt($c, curlopt_referer, $referer); curl_setopt($c, curlopt_useragent, "mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.8.1.1) gecko/20061204 firefox/2.0.0.1"); curl_setopt($c, curlopt_header, $headers); curl_setopt($c, curlinfo_header_out, true); curl_setopt($c, curlopt_verbose, true); $output = curl_exec($c); var_dump(curl_getinfo($c, curlinfo_header_out)); if($output === false) trigger_error('erreur curl : '.curl_error($c),e_user_warning); curl_close($c); homecoming $output; } if(isset($_get['go'])) { $data = array( 'file_0' => "@".realpath('rupee.png'), 'file_1' => "@".realpath('sel.jpg') ); $url = 'http://demo.ipol.im/demo/my_affine_sift/input_upload'; print_r($data); $a = curl_post_request($url, $data); var_dump($a); } else { print_r($_post); print_r($_files); }

output of code can seen here

issue being, files uploading should have attribute filename. also, unable add together attribute it. tried changing $data array using. solution ?

further update :-

added filename attribute , still the receiving end not able filename :(

$data = array( 'file_0' => '@'.realpath("rupee.png").';filename='.$filename1, 'file_1' => '@'.realpath("sel.jpg").';filename='.$filename2 );

thanks !

php curl image-uploading

javascript - jQuery is unexpectedly executed in new tab once element is clicked -



javascript - jQuery is unexpectedly executed in new tab once element is clicked -

i tried have navigation slide in on-screen in viewport after beingness off-canvas via jquery when css3 transitions not supported.

however, happening ( 1 time jquery event occurs ) new tab opened contains same page jquery executed.

in other words, when list-icon clicked new tab opened , navigation slides in in new tab. want slide in in current window / tab.

i appreciate , help in achieving this.

here running live example: http://db.tt/gykxa5nf

javascript jquery modernizr

iphone - Constraints issue in Xcode -



iphone - Constraints issue in Xcode -

i'm having issues constraints in app. here how looks on iphone 4 (that's how want look, , how setup interface, proper approach or not?)

now, when switch iphone 5 screen looks

and can see, bluish dots (which uibuttons) not placed want them be. made constraints rely solely on right side of view (since 1 re-sizing, found in order you'r views align accordingly, doesn't help align them left side). don't know how prepare this. finding new iphone screen real pain in arse. advice on how work new screen without lot of headache appreciated :)

thanks on advance

it looks me still same distance right side of view, said set them be, while background has stretched fit new size. suspect it's background isn't doing want (keep same aspect ratio , show more stuff on left), or seek keeping buttons relating left , right remain aligned stretched background image.

iphone ios objective-c xcode constraints

vb.net - DataTable Column.Expression Throw Error -



vb.net - DataTable Column.Expression Throw Error -

i have info table contains few row below

ch1 ch2 ch3 ch4 ch5 1 2 1 2 3 3 3 1 2 3 3 3 1 1 2 1 3 3 3 3 1 2 3 3 0 3 3 1 2 0 3 3 1 1 2

then seek add together new column like

dim col new datacolumn("vch1", gettype(decimal),"(ch1+ch2+ch3)/ch5") dtreadings.columns.add(col)

at time give me error : attempted split zero. because of ch5 have 0 values, need add together dynamic column different look @ run time ,how avoid such type of error thought please help.

expression value not fixed,user create look dynamic column. not handle split 0 error ,to handle type of computing error

the expression syntax allow utilize of iif statement build datacolumn using kind of syntax expression

col = new datacolumn("vch1", gettype(decimal), "iif(ch5 = 0, 0, (ch1+ch2+ch3)/ch5)")

of course, beingness look string property build look dynamically based on particular requirement have @ moment. iif or isnull build string on fly before adding column. pseudocode

dim currentexpression string = buildcurrentexpression() col = new datacolumn("vch1", gettype(decimal), currentexpression)

vb.net winforms datatable

c - Writing a function to print a string stored in an array -



c - Writing a function to print a string stored in an array -

im writing programme stores user-input strings in array. pass array function print sec element. realise programme crashes whenever print within function executed.

my sample code below:

main() { int num, count; char strstorage[10][10]; printf("\nenter how many strings: "); scanf( "%d" , &num); fflush(stdin); ( count = 0 ; count < num ; count++) { printf("enter string: "); gets(strstorage[count]); fflush(stdin); } //this works printf("%s", strstorage[2]); printmyarray(strstorage); } void printmyarray(char *myarray[ ]) { //this doesnt work printf("%s", myarray[2]); }

im doing in order larn how arrays passed functions. appreciate if can help me this.

thanks

the problem should pass double array double array, , not array of pointers.

void printmyarray(char *myarray[ ])

becomes

void printmyarray(char myarray[][10])

c arrays function

putty - git bash asks for password when trying to pull or fetch. -



putty - git bash asks for password when trying to pull or fetch. -

i have received ssh-2 key converted ssh-1 through puttygen. load every time create pull or fetch tortoise git gui , doesn't inquire me password. want utilize git bash instead, when seek pull or fetch git bash asks password. guess need load key git bash or disable password protection @ all. can help, please?

as mentioned in "tortoisegit openssh key not authenticating using ssh-agent" (which opposite of case: tortoisegit doesn't work, while git bash work), create sure of value of home environment variable.

windows doesn't define home, , need have referring directory includes .ssh/....

so check out value of home in tortoisegit settings, , create sure set home in git bash session ssh-related operation work.

git putty

php - how to change html button class and functionality? -



php - how to change html button class and functionality? -

simply want to change button class , value in order alter button functionality.

what happening value , class changed successfully functionality remain same old class why?!

does browser store jquery code somewhere , load it?! , how can refresh in case??

here's piece of code: (i'm using jquery ajax html , php)

var target_button; // global variable store target button $(".activatebutton").click(function(){ var serial_number = $(target_button).attr("id"); var cvc = $("#cvc").val(); $.ajax({ type: "get", url: '../ajax/tag.php', data: { s: serial_number, c: cvc } }).done(function(data) { var result = jquery.parsejson(data); if (result == "1") { $("#message").text('tag activated'); $("#overlay_form").fadeout(500); $(target_button).attr("value", "disable"); $(target_button).removeclass("popactivatebutton"); //<---------- replacing class $(target_button).addclass("enabledisablebutton"); //<---------- }

here's buttons:

if($tags[$i]['status'] == 1){ $button = "<input type=\"button\" class=\"enabledisablebutton\" id=\"".$tags[$i]['serialnumber']."\" value=\"disable\"/>"; } if($tags[$i]['status'] == 2){ $button = "<input type=\"button\" class=\"popactivatebutton\" id=\"".$tags[$i]['serialnumber']."\" value=\"activate\"/>"; }

when utilize selector selects elements match @ time execute code. called selectors - if cached - not dynamically update when new elements match them added page.

if you've bound event handlers elements, they're going remain there until a. remove event handler(s), or b. remove element entirely. changing class isn't going magically alter event handlers bound.

i'd suggest using event delegation instead:

$(document).on('click', '.enabledisablebutton', function() { //your code enabledisablebutton }).on('click', '.popactivatebutton', function() { // code popactivatebutton });

with event delegation selector checked when event triggered, rather when code executes, will reflect changes page.

note i've used document in code illustration above. however, should instead utilize selector static element (one won't removed) contain elements want execute event handler function for; closer in dom construction dynamic elements better.

php jquery ajax html5

ios - Wrong JPEG library version: library is 80, caller expects 70 -



ios - Wrong JPEG library version: library is 80, caller expects 70 -

how solve bug: when trying load jpg file (png, bmp, .. fine), see in console error

wrong jpeg library version: library 80, caller expects 70

and jpg file not loading.

i using libjpeg 7.0 version , error come in image decode function @ code line:

jpeg_create_decompress(&cinfo);

but, in illustration project fine. interesting

solved. removed project file , create new xcode project file , add together him resources , sources.

now, works @ fine.

ios jpeg

mmap - Detect mprotected memory address -



mmap - Detect mprotected memory address -

is there function observe whether given virtual address mapped mmap protected mprotect? accessing such address result in segmentation fault if prot_none set. i'd first observe whether they're protected or not.

it's improve if don't need introduce signal handlers. if there isn't such function, other lightweight solution fine. thanks.

mmap mprotect

login - Log in user after accept invitation using rails with devise_invitable -



login - Log in user after accept invitation using rails with devise_invitable -

i utilize devise_invitable rails , need help. want create user logged in after take invitation. here invitationscontroller

class invitationscontroller < devise::invitationscontroller def update if user.accept_invitation!(user_params) # log in user here redirect_to dashboard_show_path, notice: t('invitaion.accepted') else redirect_to root_path, error: t('invitation.not_accepted') end end private def user_params params.require(:user).permit(:invitation_token, :password, :password_confirmation) end end

you can see comment in code

# log in user here

here want log in user has take invitation.

thanks.

the method looking sign_in, seek this:

def update if user.accept_invitation!(user_params) sign_in(params[:user]) redirect_to dashboard_show_path, notice: t('invitaion.accepted') else redirect_to root_path, error: t('invitation.not_accepted') end end

however should note devise_invitable, default, signs in users after have accepted invitation. see default update action here, if wish utilize default functionality phone call super method or don't implement update action @ all.

ruby-on-rails login devise devise-invitable

python - Psycopg missing module in Django -



python - Psycopg missing module in Django -

i have pip installed psycopg2, when seek runserver or syncdb in django project, raises error saying there "no module named _psycopg".

edit: "syncdb" command raises: django.core.exceptions.improperlyconfigured: importerror django.contrib.admin: no module named _psycopg

thanks help

make sure you've enabled psycopg2 , not psycopg in settings.py file:

databases = { 'default': { 'engine': 'django.db.backends.postgresql_psycopg2',

and not:

databases = { 'default': { 'engine': 'django.db.backends.postgresql_psycopg',

python django pip psycopg2 psycopg

sql server - MSSQL Access From Zend2 via Linux -



sql server - MSSQL Access From Zend2 via Linux -

i'm upgrading application presently runs on zendframework1(zf1) zendframework2(zf2). i'm having problem getting db results homecoming zf2 connection.

in zf1 test works perfectly:

$db = zend_db::factory('pdo_mssql', array( 'host' => 'servernamefromfreetdsconfig', 'charset' => 'utf-8', 'username' => 'myusername', 'password' => 'mypassword', 'dbname' => 'database_name', 'pdotype' => 'dblib' )); $stmt = $db->prepare("select * products"); $stmt->execute(); $result = $stmt->fetchall(); $stmt->closecursor();

however, i've been trying in zf2 i'm not getting anywhere. in config\autoload\global.php have:

return array( 'db' => array( 'host' => 'servernamefromfreetdsconfig', 'charset' => 'utf-8', 'dbname' => 'database_name', 'username' => 'myusername', 'password' => 'mypassword', 'driver' => 'pdo', 'pdodriver' => 'dblib', ), );

and in module.php file:

public function onbootstrap(mvcevent $e) { $eventmanager = $e->getapplication()->geteventmanager(); $moduleroutelistener = new moduleroutelistener(); $moduleroutelistener->attach($eventmanager); $config = $e->getapplication()->getservicemanager()->get('configuration'); $dbadapter = new adapter($config['db'], new sqlserver()); globaladapterfeature::setstaticadapter($dbadapter); }

then in model\products.php

class products extends abstracttablegateway { protected $table; protected $featureset; public function __construct($table = 'products') { $this->table = $table; $this->featureset = new featureset(); $this->featureset->addfeature(new globaladapterfeature()); $this->initialize(); } //test connection. public function getproducts() { $result = $this->getadapter()->query("select * products", adapter::query_mode_execute); die(var_dump($result)); } }

it looks connecting because "var_dump" above returns ["fieldcount":protected]=> int(7) right (there 7 columns in table). however, not returning results. might need work in zf2? need somehow extend zend\db\adapter\adapter using code zf1 zend_db_adapter_pdo_mssql.php file? or there simple solution i'm missing?

thanks insight.

i think dont need mention user name , password

resources.db.adapter = "sqlsrv" resources.db.host = "localhost\sqlexpress" resources.db.dbname = "databasename" resources.db.isdefaulttableadapter = true resources.db.driver_options.returndatesasstrings = true

sql-server linux zend-framework2

performance - MySQL change column name on EMPTY table, takes very long -



performance - MySQL change column name on EMPTY table, takes very long -

running local mysql instance. in db, misspelled column name (stret street). wrote query:

alter table address alter stret street varchar(20);

this table has been created , contains 0 records. know there various threads asking why take long of tables has 100,000+ rows. have nothing! why did query take 1 hr 13 min 15.76 sec?

i know have dropped , recreated table, curious why "simple" alter take long?

edit: found out reason. debugging programme uses db , stopped in middle (without terminating program) alter column name. 1 time stopped tomcat instant again. presumably table locked query held up. using innodb. everyone.

before might want truncate table address (very fast reset auto_increment column counters) or optimize table address (a bit slower, doesn't alter data) in order flush out left-over info deleted not vacuumed database.

an alternative create table _address address, run alteration clone, switch _address address using rename table.

mysql performance

r - an alternative Quantmod ZigZag overlay -



r - an alternative Quantmod ZigZag overlay -

i'm using quantmod zigzag overlay , noticed calculated bit differently original overlay. i've demonstrated difference in next picture of rdwr using zigzag(5%) quantmod , different program. can see quantmod missing allot of important points peaks , highs. can see difference pretty when using stockcharts.

i think it's because of way quantmod smooth trend. algorithm should using both high & low values , not average cost or other regression. wondering if quantmod or maybe ttr provide alternative zigzag overlay produced desired output (illustrated in upper part of picture).

thanks.

the code displaying quantmod output in image

s<-get(getsymbols('rdwr'))["2012-07::"] chart_series(s) add_ta(zigzag(s,5),on=1)

the problem ?zigzag says input should high/low cost series , provided ohlcva series. works correctly if provide high/low series.

s <- getsymbols('rdwr', auto.assign=false) chart_series(s, subset="2012-07::") add_ta(zigzag(s[,2:3],5),on=1)

r quantmod

share - Sharing files without letting the end users store them into their PC -



share - Sharing files without letting the end users store them into their PC -

we got pdf files allowed viewed in office. users maintain files in flash drive disk , bring them home or send them email. what'd best way prevent situation. taking screenshot of screen still enabled.

network : 100 mbps lan-based number of concurrent users view file : around 50 @ time.

if user can read file, can re-create it. need piece of software deed go-between. there few software solutions out there utilize drm encryption protect pdf files. claim prevent screen captures well.

in situation, want have drm software check license certificate server on network ensure @ office before letting them open file. allow them still utilize take-home thumbdrives , laptops work done.

try searching "pdf drm" , see find.

file share

java - Inserting multiple data into an excel sheet at a time using JXL -



java - Inserting multiple data into an excel sheet at a time using JXL -

i have scenario have insert multiple lines of info excel sheet. using jxl api purpose. problem that, lastly set of info in loop beingness written in excel sheet. can please help me in achieving or provide code snippet or example?

thanks lot.

int ccount = ws.getcolumns(); int rc = ws.getrows(); int rnum = rc - 10; for(int i=1;i(lesser symbol)3; i++){ rnum++; string srnum = string.valueof(rnum); wsheet.addcell(new jxl.write.label(1, rc, srnum, wcf1)); wsheet.addcell(new jxl.write.label(2, rc, "b", wcf1)); wsheet.addcell(new jxl.write.label(3, rc, "c", wcf1)); wsheet.addcell(new jxl.write.label(4, rc, "d", wcf1)); system.out.println("executing..........."); wsheet.addcell(new jxl.write.label(5, rc, "e", wcf1)); wsheet.addcell(new jxl.write.label(6, rc, "f", wcf1)); wb.write(); rc++; }

here, wcf1 refers writablecellformat have defined in method. in sheet, have inserted info till row number 11 , need insert multiple info after that. used loop. not giving result properly. please help me out this.

i can't inquire more detail straight (low rep) on question. write output obtain?

i'm not sure ws.getrows() work correctly. have printed out value of rc?

following code obtain like

|a |b |c |d |e |f | ...|....|...|...|...|...|...| x |bla |bla|bla|bla|bla|bla| x+1|x-10|b |c |d |e |f | x+2|x-9 |b |c |d |e |f |

java excel jxl

assembly - What exactly does the lb instruction do? -



assembly - What exactly does the lb instruction do? -

i have exam coming up, , 1 of practice problems was:

assume $t0 contains value 0x12121212 , $t1 contains address 0x1000000.

assume memory data, starting address 0x1000000 is: 88 77 66 55.

what value of $t0 after next code executed:

lb $t0, 0($t1)

a) 0x00000088 b) 0x88121212 c) 0xffffff88 d) 0x12121288

the reply gave a, because byte lb instruction read (by understanding of instruction does) 88. 88 stored in $t0, value 0x00000088. reply given c. sense have fundamental misunderstanding how lb works - can please explain why reply c?

the reply c) 0xffffff88. lb instructions sign-extends byte 32-bit value. i.e. important bit (msb) copied upper 24 bits.

0x88 == 0b10001000, i.e. msb 1. upper 24 bits 0b111111111111111111111111 == 0xffffff.

assembly mips

iphone - Store and Manage Data for Simple App -



iphone - Store and Manage Data for Simple App -

i create simple game app store info user progresses in levels. example: each level has number of sub-levels, sub-level stores 3-4 properties (strings , arrays) depending on user's progress.

the app simple , not lot store (about 150 levels , sub-levels maximum little amount of info in each) , not want create complicated multiple classes representing levels , sub-levels plus sqllite database. thought of simpler approach plenty manage info through gamemanager singleton.

recommend approaches @ needs store , manage info type of app. perhaps 1 of these or else:

nsuserdefaults + nsdictionary coredata + sqllite etc...

just want create sure not missing anything

it's much improve , less painful utilize core data. why sqlite?? core info saving objects in sqlite file on ios device , in xml in cocoa app. utilize plist files kind of strange, think. can set simple array, , if want display photos besides simple array? preferred way core info - 50% less code, apple says. utilize nsfetchedresultscontroller , you'll good!

iphone objective-c core-data plist nsdata

c# - Custom Paging With LinqDataSource & Formview -



c# - Custom Paging With LinqDataSource & Formview -

i trying to utilize linqdatasource's selecting event filter info in formview, can't seem page properly. can manage 1 record show in formview paging controls not show up. have next code in linqdatasource selecting event:

e.arguments.startrowindex = 0; e.arguments.maximumrows = 1; var result = db.personnels.asqueryable(); if (!string.isnullorempty(txtfirstname.text)) { result = result.where(r => r.first_name.contains(txtfirstname.text)); } if (!string.isnullorempty(txtlastname.text)) { result = result.where(r => r.last_name.contains(txtlastname.text)); } e.arguments.totalrowcount = result.count(); e.result = result.skip(fvmain.pageindex).take(1);

as mentioned above, code works 1 record displayed , paging controls don't show on formview. have tried modify e.result following, object reference not set instance of object. exception:

e.result = result;

what right way page formview using linqdatasource's selecting event?

edit 1

as requested, here formview , linqdatasource's markup:

<asp:formview id="fvmain" runat="server" cssclass="full" datakeynames="worker_id" datasourceid="ldsmain" defaultmode="edit" allowpaging="true" onitemupdating="fvmain_itemupdating"> <edititemtemplate> <table class="pad5 full"> <tr> <td class="field-name" style="width: 100px">worker id:</td> <td style="width: 80px"><asp:textbox id="txtworkerid" runat="server" text='<%#eval("worker_id") %>' readonly="true" style="width: 75px" /></td> <td class="right"><input type="button" value="injuries/lta/wcb person" onclick="openmodalcolorbox('injuries.aspx?id='+$('#plcmain_fvmain_txtworkerid').val(), 'injuries')" /></td> </tr> </table> <table class="pad5 full"> <tr> <td class="field-name">type of person:</td> <td colspan="3"> <cc1:databinddropdownlist id="cbotypeofperson" runat="server" appenddatabounditems="true" datasourceid="ldspersontypes" datatextfield="type_of_person" datavaluefield="type_of_person" selectedvalue='<%#bind("type_of_person") %>'> <asp:listitem text="" value="" /> </cc1:databinddropdownlist> <asp:linqdatasource id="ldspersontypes" runat="server" contexttypename="pride.pridedatacontext" entitytypename="" orderby="type_of_person" tablename="personnel_types"> </asp:linqdatasource> </td> </tr> <tr> <td class="field-name">employee number:</td> <td><asp:textbox id="txtemployeenumber" runat="server" text='<%#bind("employee_number") %>' /></td> <td class="field-name">sin:</td> <td><asp:textbox id="txtsin" runat="server" text='<%#bind("sin") %>' /></td> </tr> <tr> <td class="field-name">last name:</td> <td><asp:textbox id="txtlastname" runat="server" text='<%#bind("last_name") %>' /></td> <td class="field-name">previous lastly name:</td> <td><asp:textbox id="txtpreviouslastname" runat="server" text='<%#bind("previous_last_name") %>' /></td> </tr> <tr> <td class="field-name">first name:</td> <td><asp:textbox id="txtfirstname" runat="server" text='<%#bind("first_name") %>' /></td> <td class="field-name">marital status:</td> <td> <cc1:databinddropdownlist id="dropdownlist1" runat="server" appenddatabounditems="true" selectedvalue='<%# bind("marital_status") %>' datasourceid="ldsmaritalstatuses" datatextfield="marital_status" datavaluefield="marital_status"> <asp:listitem text="" value="" /> </cc1:databinddropdownlist> <asp:linqdatasource id="ldsmaritalstatuses" runat="server" contexttypename="pride.pridedatacontext" entitytypename="" orderby="marital_status" tablename="list____employee__marital_status"> </asp:linqdatasource> </td> </tr> <tr> <td class="field-name">division:</td> <td> <cc1:databinddropdownlist id="cbodivision" runat="server" appenddatabounditems="true" selectedvalue='<%# bind("division") %>' datasourceid="ldsdivisions" datatextfield="division" datavaluefield="division"> <asp:listitem text="" value="" /> </cc1:databinddropdownlist> <asp:linqdatasource id="ldsdivisions" runat="server" contexttypename="pride.pridedatacontext" entitytypename="" groupby="division" orderby="division" select="new (key division, areas)" tablename="areas"> </asp:linqdatasource> </td> <td class="field-name">dob:</td> <td> <asp:textbox id="txtdob" runat="server" text='<%#bind("dob", "{0:dd mmm yyyy}") %>' /> <asp:calendarextender id="calendarextender1" runat="server" targetcontrolid="txtdob" format="dd mmm yyyy" /> </td> </tr> <tr> <td class="field-name">department:</td> <td> <cc1:databinddropdownlist id="cbodepartment" runat="server" appenddatabounditems="true" selectedvalue='<%# bind("department") %>' datasourceid="ldsdepartments" datatextfield="department" datavaluefield="department"> <asp:listitem text="" value="" /> </cc1:databinddropdownlist> <asp:linqdatasource id="ldsdepartments" runat="server" contexttypename="pride.pridedatacontext" entitytypename="" groupby="department" orderby="department" select="new (key department, areas)" tablename="areas"> </asp:linqdatasource> </td> <td class="field-name">terminated:</td> <td> <cc1:databinddropdownlist id="cboterminated" runat="server" selectedvalue='<%# bind("terminated") %>'> <asp:listitem text="" value="" /> <asp:listitem text="yes" value="yes" /> <asp:listitem text="no" value="no" /> </cc1:databinddropdownlist> </td> </tr> <tr> <td class="field-name">occupation:</td> <td> <cc1:databinddropdownlist id="cbooccupation" runat="server" selectedvalue='<%# bind("occupation") %>' appenddatabounditems="true" datasourceid="ldsoccupations" datatextfield="occupation" datavaluefield="occupation"> <asp:listitem text="" value="" /> </cc1:databinddropdownlist> <asp:linqdatasource id="ldsoccupations" runat="server" contexttypename="pride.pridedatacontext" entitytypename="" orderby="occupation" tablename="list____employee__occupations"> </asp:linqdatasource> </td> <td class="field-name">team:</td> <td> <cc1:databinddropdownlist id="cboteam" runat="server" selectedvalue='<%# bind("shift") %>' appenddatabounditems="true" datasourceid="ldsshifts" datatextfield="shift" datavaluefield="shift"> <asp:listitem text="" value="" /> </cc1:databinddropdownlist> <asp:linqdatasource id="ldsshifts" runat="server" contexttypename="pride.pridedatacontext" entitytypename="" orderby="shift" tablename="list____employee__shifts"> </asp:linqdatasource> </td> </tr> <tr> <td class="field-name">lock number:</td> <td><asp:textbox id="txtlocknumber" runat="server" text='<%#bind("lock_number") %>' /></td> <td class="field-name">address:</td> <td><asp:textbox id="txtaddress" runat="server" text='<%#bind("address") %>' /></td> </tr> <tr> <td class="field-name">city:</td> <td><asp:textbox id="txtcity" runat="server" text='<%#bind("city") %>' /></td> <td class="field-name">company:</td> <td><asp:textbox id="txtcompany" runat="server" text='<%#bind("company") %>' /></td> </tr> <tr> <td class="field-name">province:</td> <td><asp:textbox id="txtprovince" runat="server" text='<%#bind("province") %>' /></td> <td class="field-name">company contact:</td> <td><asp:textbox id="txtcompanycontact" runat="server" text='<%#bind("company_contact") %>' /></td> </tr> <tr> <td class="field-name">postal:</td> <td><asp:textbox id="txtpostal" runat="server" text='<%#bind("postal") %>' /></td> <td class="field-name">phone:</td> <td><asp:textbox id="txtphone" runat="server" text='<%#bind("phone") %>' /></td> </tr> <tr> <td class="field-name">hcn:</td> <td><asp:textbox id="txthcn" runat="server" text='<%#bind("hcn") %>' /></td> <td class="field-name">hcn province:</td> <td><asp:textbox id="txthcnprovince" runat="server" text='<%#bind("hcn_province") %>' /></td> </tr> <tr> <td class="field-name">comments:</td> <td colspan="3"> <asp:textbox id="txtcomments" runat="server" text='<%#bind("comments") %>' textmode="multiline" rows="3" /> </td> </tr> </table> <h2>h.r.i.s.</h2> <table class="pad5 full"> <tr> <td class="field-name">nok name:</td> <td><asp:textbox id="txtnokname" runat="server" text='<%#bind("nok_name") %>' /></td> <td class="field-name">nok relation:</td> <td> <cc1:databinddropdownlist id="cbonokrelation" runat="server" selectedvalue='<%# bind("nok_relation") %>' appenddatabounditems="true" datasourceid="ldsnokrelations" datatextfield="relationship" datavaluefield="relationship"> <asp:listitem text="" value="" /> </cc1:databinddropdownlist> <asp:linqdatasource id="ldsnokrelations" runat="server" contexttypename="pride.pridedatacontext" entitytypename="" orderby="relationship" tablename="list____employee__relations"> </asp:linqdatasource> </td> </tr> <tr> <td class="field-name">nok address:</td> <td><asp:textbox id="txtnokaddress" runat="server" text='<%#bind("nok_address") %>' /></td> <td class="field-name">nok city:</td> <td><asp:textbox id="txtnokcity" runat="server" text='<%#bind("nok_city") %>' /></td> </tr> <tr> <td class="field-name">nok province:</td> <td><asp:textbox id="txtnokprovince" runat="server" text='<%#bind("nok_province") %>' /></td> <td class="field-name">nok postal:</td> <td><asp:textbox id="txtnokpostal" runat="server" text='<%#bind("nok_postal") %>' /></td> </tr> <tr> <td class="field-name">nok phone:</td> <td><asp:textbox id="txtnokphone" runat="server" text='<%#bind("nok_phone") %>' /></td> </tr> </table> <div class="center"> <asp:button id="btnsave" runat="server" text="save changes" onclick="btnsave_click" /> </div> </edititemtemplate> <pagersettings mode="nextpreviousfirstlast" firstpagetext="&amp;lt;&amp;lt; first" lastpagetext="last &amp;gt;&amp;gt;" nextpagetext="next &amp;gt;" previouspagetext="&amp;lt; previous" position="topandbottom" /> <pagerstyle cssclass="pager" /> </asp:formview> <asp:linqdatasource id="ldsmain" runat="server" contexttypename="pride.pridedatacontext" enabledelete="true" enableinsert="true" enableupdate="true" entitytypename="" tablename="personnels" onselecting="ldsmain_selecting"> <updateparameters> <asp:parameter convertemptystringtonull="true" name="employee_number" /> </updateparameters> <insertparameters> <asp:parameter convertemptystringtonull="true" name="employee_number" /> </insertparameters> </asp:linqdatasource>

from msdn can see autopage property of linqdatasource set true default. docs:

when autopage property set true, linqdatasource command retrieves plenty records 1 page in data-bound control. uses skip<tsource> , take<tsource> methods retrieve records current page.

the consequence of need alter few things paging working.

currently setting e.arguments.startrowindex = 0;. don't need everytime interfere paging. doing e.result = result.skip(fvmain.pageindex).take(1); not necessary either. e.result = result; should fine.

i think combination of 2 things causing issue. however, need handle case 1 of filters kicks in.

the first problem need persist applied filter in viewstate, otherwise unable tell when filter has been applied , when existing one.

inspired after applying filter linqdatasource connected gridview ,clicking edit bring me old data, add together property page (you need 1 lastly name):

public string firstnamefilter { { homecoming (string)this.viewstate["firstnamefilter"] ?? string.empty; } set { this.viewstate["firstnamefilter"] = value; } }

then in selecting event handler, run code:

var result = db.personnels.asqueryable(); if (!string.isnullorempty(txtfirstname.text)) { if (this.firstnamefilter != txtfirstname.text) { this.firstnamefilter = txtfirstname.text; e.arguments.startrowindex = 0; } if (!string.isnullorempty(this.firstnamefilter)) { result = result.where(r => r.first_name.contains(txtfirstname.text)); } } if (!string.isnullorempty(txtlastname.text)) { if (this.lastnamefilter != txtlastname.text) { this.lastnamefilter = txtlastname.text; e.arguments.startrowindex = 0; } if (!string.isnullorempty(this.lastnamefilter)) { result = result.where(r => r.first_name.contains(txtlastname.text)); } } e.arguments.totalrowcount = result.count(); e.result = result;

c# formview linqdatasource

copy paste - Simulate ctrl+v event on javascript -



copy paste - Simulate ctrl+v event on javascript -

i seek simulate ctrl+v in javascript. utilize firefox in linux. is:

var pressevent = document.createevent ("keyboardevent"); pressevent.initkeyevent ("keypress", true, true, window, true, false, false, false, 86, 0); var accepted=atarget.dispatchevent (pressevent);

somebody knows why doesn't work??

thanks

copy , paste , clipoard protected. unless there explicit user action won't work simulations. if create script simulates paste within inputbox submit server, might private info people clipboards. so...no, won't work knowledge. love or else prove me wrong , share solution.

but tell you're planning , maybe there's workaround doesn't involve simulated action.

javascript copy-paste keyevent

clojure - is it possible to have type hints without LET? -



clojure - is it possible to have type hints without LET? -

this code (an example):

(def foo (.java_method java_object)) (debug "result of method bar() on object foo: " (.bar foo))

i warning (foo of type footype in java):

reflection warning, example/test.clj:2 - phone call bar can't resolved

i can remove warning type hint:

(def foo (.java_method java_object)) (debug "result of method bar() on object foo: " (.bar ^footype foo))

this works, have type hinting every time utilize foo. solution utilize let, creates indentation level, i'd avoid. possible like?:

(def foo (.java_method java_object)) (set-type foo footype) (debug "result of method bar() on object foo: " (.bar foo))

no. associating compile-time metadata type-hints named values, utilize let.

clojure

java - Focusing a JTextArea in a JTabbedPane -



java - Focusing a JTextArea in a JTabbedPane -

i'm programming chat client in java, i'd have 1 single jdialog open chats. decided work jtabbedpane tab represents single chat.

i set jpanel every tab, contains jtextpane message history , jtextarea users input messages.

for improve usability implemented feature focuses jtextarea when

a new chattab opened the user changes between chattabs (the changelistener of jtabbedpane fires)

i have class chatwindow, extends jdialog , displays jtabbedpane. implemented changelistener.

private jtabbedpane chattabpane; private list<chattab> chattabs; public chatwindow() { chattabs = new arraylist<chattab>(); jpanel chatwindowpanel = new jpanel(new borderlayout()); chattabpane = new jtabbedpane(jtabbedpane.top); chatwindowpanel.add(chattabpane); this.add(chatwindowpanel, borderlayout.center); chattabpane.addchangelistener(new changelistener() { @override public void statechanged(changeevent arg0) { focusinputfield(); } }); } public chattab addchattab(contact contact) { chattab newchattab = new chattab(); chattabs.add(newchattab); chattabpane.addtab(contact.tostring(), null, newchattab.getpanel()); homecoming newchattab; } public void focusinputfield() { (chattab chattab : chattabs) { if(chattab.getpanel() == chattabpane.getselectedcomponent()) { chattab.focusinputfield(); } } } public jtabbedpane getchattabs() { homecoming chattabpane; } }

the method focusinputfield() in class chattab looks this:

public void focusinputfield() { inputfield.requestfocusinwindow(); inputfield.requestfocus(); }

okay, that's focus when tab changed. beside that, have implemented jtextarea focused when new chat tab created. handled in class chatwindowcontroller. there method setchatvisible() phone call when add together new tab chatwindow class:

public void setchatvisible() { if(!chatwindow.isvisible()) { chatwindow.setvisible(true); chatwindow.focusinputfield(); } }

so here problem: focus works when open new chattab. in cases works when user changes tabs, not focus when opened more 1 new chat tab , switch between tabs first time. jtextarea of tab switched not focus. however, when switch 1 time again works time.

does know problem be? i'm out of ideas.

intermittent failure may result wrong synchronization. several thing should examined critically:

verify build gui elements on event dispatch thread (edt).

as certainly using multiple threads, verify updates occur on edt, example.

you can utilize invokelater() order events on edt, shown here.

prefer requestfocusinwindow() on requestfocus(), don't utilize both.

java swing focus jtabbedpane changelistener

ios - Textfield disappears behind keyboard when start editing -



ios - Textfield disappears behind keyboard when start editing -

i have textfield within scrollview. when tap textfield add together text, keyboard pops , textfield disappears behind keyboard. how solve this? scrollview should scroll downwards textfield still visible while typing.

i found several solutions objective-c project. unfortunately, using mono touch/c#.

i created delegate textfield. should add together method "public override void editingstarted (uitextfield textfield)" create work?

public class closetextfielddelegate : uitextfielddelegate{ private newreportscreen controller; public closetextfielddelegate(newreportscreen newreportscreen) { controller = newreportscreen; } public override bool shouldreturn (uitextfield textfield) { textfield.resignfirstresponder(); homecoming false; } public override void editingstarted (uitextfield textfield) { //do (make textfield visible doesn't disappears behind keyboard) } }

as example, how solved objc. here move view contains textfield visible (maybe can translate code mono/c#.

- (void)textfielddidbeginediting:(uitextfield *)textfield { if (textfield == mytf) { cgrect rect = inputfieldsview.frame; rect.origin.y = -100;//move view contains textfiled inputfieldsview.frame = rect; } }

ios monotouch

C Compare Array Elements in Function -



C Compare Array Elements in Function -

this going pretty basic question i'm confused on how implement this.

for class i'm taking on c need take 2 arrays can vary in length , compare elements in separate function. (this function takes arrays parameters, not sizes) element in both arrays need set array , homecoming array (note: each array set in no elements repeat in same array). have looked how implement little bit , here of issues i'm running into.

how know end of array is?

i think saw might able {0} element in array null element. if true don't know compare element in order check null.

i think i'm supposed pass pointers first element of array because don't think c allow values of array passed, little unsure.

if pass arrays pointers, how can access arrays elements data?

when returning array main function, how can homecoming resulting function without memory beingness cleared up?

should create resulting array global, or there improve way of handling it?

thanks in advance.

your question bit vague. looks want implement set intersection have 2 sets, represented arrays, , output array implemented array.

1. how know end of array is?

in c, there no way tell. if cannot pass length function not able robust solution. need similar #2.

2. think saw might able {0} element in array null element. if true don't know compare element in order check null.

you can add together null character, value 0. check, need compare 0. not know each of array elements consist of, 1 thing watch of none of value allowed 0 anymore since reserved end of array marker.

3. think i'm supposed pass pointers first element of array because don't think c allow values of array passed, little unsure.

yes. pass pointed first element, in c array symbol.

int a[10]; // pass

4. if pass arrays pointers, how can access arrays elements data?

say passed pointer a, can access elements simple indexing a[i], grab element i.

5. when returning array main function, how can homecoming resulting function without memory beingness cleared up?

in function writing, can malloc array , pass pointer array created malloc. malloce'd memory not deleted when function exits.

c arrays function int

c++ - Django as a mysql proxy server? -



c++ - Django as a mysql proxy server? -

i'm in process of building django powered site backed mysql server. mysql server going accessed additional sources, other website, read , write table data; such programme users run locally connects database.

currently programme running locally using mysql/c connector library connect straight sql server , execute queries. in final release public seems insecure, since exposing connection string database in code or in configuration file.

one alternative i'm considering having queries sent django website (authenticated user's login , password) , site sanitize , execute queries on user's behalf , homecoming results them.

this has number of downsides can think of. webserver under much larger load processing sql queries , potentially exceed limit of host. additionally, have figure out way of serializing , transmitting sql results in python , unserializing them in c/c++ on client side. decent amount of custom code write , maintain.

any other downsides approach people can think of?

does sound reasonable , if does, ease working on it; such python or c libraries help develop proxy interface?

if sounds bad idea, suggestions alternative solutions i.e. python library specializes in type of proxy sql server logic, method of encrypting sql connection strings can securely utilize current solution, etc...?

lastly, valid concern? database doesn't hold terribly sensitive info users (most sensitive email , site password may have reused source) in future cause concern if it's not secure.

this valid concern , mutual problem. have described creating restful api. guess considered proxy database not referred proxy.

django great tool utilize use accomplish this. django has couple packages assist in speedy development, django rest framework, tastiepy, , django-piston popular. of course of study utilize plain old django.

your django project thing interfaces database , clients can send authenticated requests django; clients never connect straight database. give fine grained permission command on per client, per resource basis.

the webserver under much larger load processing sql queries , potentially exceed limit of host

i believe scaling webservice going lot easier scaling direct connections clients database. there many tried , true methods scaling apps have hundreds of requests per seconds databases. because have django between , webserver can implement caching requested resources.

additionally, have figure out way of serializing , transmitting sql results in python , unserializing them in c/c++ on client side

this should moot issue. there lots of extremely popular info interchange formats. have never used c/c++ quick search saw couple of c/c++ json serializers. python has json built in free, there shouldn't custom code maintain regarding if utilize premade c/c++ json library.

any other downsides approach people can think of?

i don't think there downsides, tried , true method. has been proven decade , popular sites in world expose through restful apis

does sound reasonable , if does, ease working on it; such python or c libraries help develop proxy interface?

it sounds reasonable, django apps mentioned @ origin of reply should provide boiler plate allow started on api quicker.

c++ python mysql c django

Include Underscore.js with jQuery no-conflict -



Include Underscore.js with jQuery no-conflict -

i need include underscore.js in platform uses prototype.js , has jquery in noconflict mode.

how it? backbone illustration shows can point jquery using backbone.$ = $j.

but underscorejs.org doesn't seem have info around it.

thanks,

you don't need special if have both backbone , jquery (in no-conflict mode or not) on page.

here part of backbone code (as of backbone 0.9.10) backbone.$ assigned:

backbone.$ = root.jquery || root.zepto || root.ender;

what means backbone.$ set utilize "jquery" variable if exists (and should whether you're in noconflict mode or not), , if isn't there seek utilize zepto or ender libraries instead.

source: https://github.com/documentcloud/backbone/blob/21a875b2c50b8a69760b4e6a80495a153e5065b3/backbone.js#l44

if you're asking underscore , jquery, please aware underscore has no dependency on jquery @ -- backbone has dependency on (or 1 of other libraries mentioned).

jquery underscore.js

jquery - How to change default highlighted "today" date in datepicker -



jquery - How to change default highlighted "today" date in datepicker -

i'm using datepicker selecting dates in 2 date fields (from date , date).

in those, default highlighted date today date. need alter default highlighted date other day in sec datepicker. (as illustration today + 8 days).

how can correctly ?

following datepickers,

$(function() { $( "#datepicker" ).datepicker(); $( "#datepicker" ).datepicker("option", "dateformat", "yy-mm-dd"); // iso 8601 $( "#datepicker2" ).datepicker(); $( "#datepicker2" ).datepicker("option", "dateformat", "yy-mm-dd"); });

thanks.

---------------------------------- update -----------------------------------------------

following screen shot michael,

i set following,

$( "#datepicker2" ).datepicker("option", "defaultdate", +2);

you can see still 21 day (today) highlighting , 23 bordered black line. need see 23 looks 21 hi lighting. no need highlight 21.

$( "#datepicker" ).datepicker("option", "defaultdate", +8);

source: http://api.jqueryui.com/datepicker/#option-defaultdate

edit: current date highlighted part of datepicker. there no alternative turn off feature. create clear user "today" is. can override graphical appearance of w/ css:

.ui-datepicker-today a.ui-state-highlight { border-color: #d3d3d3; background: #e6e6e6 url(/themeroller/images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;; color: #555555; } .ui-datepicker-today.ui-datepicker-current-day a.ui-state-highlight { border-color: #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; color: #212121; }

working jsfiddle: http://jsfiddle.net/epwud/

this assumes you're using default theme - can same practice theme. override styles code above. css incomplete, however. you'll need create overrides other cases, :hover state.

jquery datepicker

pattern matching - How do I use ">" and "<" inside "Cases" Mathematica function? -



pattern matching - How do I use ">" and "<" inside "Cases" Mathematica function? -

how utilize ">" , "<" within "cases" mathematica function?

e.g., cases end in greater 2 next nested list:

lst = { {1, 0, 0}, {1, 1, 1}, {1,1,4} }

i like

cases[lst, {_, _,>2} ]

what right way express ">2" above?

the straightforward prepare approach probably

cases[lst, {_, _, x_ /; x > 2}]

see documentation /; or condition.

wolfram-mathematica pattern-matching

sql - Database - How to manage high quantity of data over time with different refresh rates ? -



sql - Database - How to manage high quantity of data over time with different refresh rates ? -

i need design sql server database capable of logging different info on different time scale .

basicaly have log info battery cells lots of battery @ anytime.

here basic model of database. datatypes on images not 1 use.

i utilize tinyint of them (2 bytes)

time 3 bytes date 2 bytes

so imagine :

1 cell study file emitted every 24 hours. but:

each attribute of cell don't refresh @ same frequence.

for instance :

time attribute refresh every second amps attribute refresh every second temp1 attribute refresh every minute date refresh every day

and cell reporting 24/7 on years.

if there 1000 battery around world linked database, , each battery have let's 20 cells.

20 000 cells reporting 24/7

so here problem :

if 1 attribute alter don't want whole line re stored. if 20 000 cells need 1to year. (and null stored instead of non refreshed values).

i hope explaination clear enough, don't hesitate inquire farther information

as usual apologize english language :/

thank you.

you need 20k inserts per sec doable shows how much info is. no problem @ bulk-insert @ rate, have maintain info around time. that's going lot of rows , tbs.

i'd consider storing in custom format: store 1 binary blob per battery , per hour. in blob free encode changes way want. can store non-changing columns efficiently not storing them @ all. can compress blob before storing.

this scheme still gives indexing on battery , time. time resolution decreased 1 hour. app has decode blobs , extract needed info them.

the info compressible because redundant. compression there fast schemes lzo, lz4 , quicklz. can more compression things 7z.

sql sql-server database-design logging model

flash - SWF to PDF batch convert -



flash - SWF to PDF batch convert -

i have hundreds of files in swf format (it's ebook), want batch covert them pdf (to read them on ipad).

i tried few econverter (didn't work error swfdec), may not batch coversion.

swftool, worked well, poor quality. can't read letters.

swf printer pro 1 time again poor quality

ffmpeg gave error "compressed swf format not supported"

it'll great if guys help me out find solution. thanks

if want read them on ipad, can do:

create orb book in finder.

package of swf files 1 .orb file. (one swf per page)

http://rintarou.dyndns.org/2014/09/13/create-an-orb-book-in-finder/

download orb viewer ipad (lite free ads , open first .orb file).

use read .orb file on ipad.

http://rintarou.dyndns.org/works/orb-viewer/

if need convert them pdf, can purchase orb reader mac.

it'll read .orb on mac , convert pdf.

ps. author of these apps mentioned above.

flash

error in python program -



error in python program -

i tried simple python program:

x == 3 print x

but error:

traceback (most recent phone call last): file "", line 1, in nameerror: name 'x' not defined

why?

== comparison, not assignment. you're asking if x equal 3, haven't told python x yet.

you want this:

x = 3 print x

python

php - Getting a specific URL using simple_html_dom based on the end of the URL -



php - Getting a specific URL using simple_html_dom based on the end of the URL -

i need grab url using simple_html_dom based on end of url. url has no specific class create unique. thing unique ends specific set of numbers. cannot figure out proper syntax grab specific url , print it.

any help?

example:

<table class="findlist"> <tr class="findresult odd"> <td class="primary_photo"> <a href="/title/tt0080487/?ref_=fn_al_tt_1" ><img src="http://ia.media-imdb.com/images/m/mv5bnzk2ote2njyxnf5bml5banbnxkftztywmjywndq5._v1_sy44_cr0,0,32,44_.jpg" height="44" width="32" /></a> </td>

that code origin of table. first href 1 want grab. table continues more links, etc, that's not relevant want.

for first href ending in 1:

$dom->find('a[href$="1"]', 0);

php html simple-html-dom

javascript - Toggle CSS on mouseup -



javascript - Toggle CSS on mouseup -

i have console setup on tool i've created. console can minimized when clicked , maximized when clicked again.

the issue 1 time maximize it, minimizes when complete. options?

$('#consolebutton').mouseup(function() { if ($('#footconsole').height(200)) { $('#footconsole').animate({ height: 14 }, 100) } else if ($('#footconsole').height(14)) { $('#footconsole').animate({ height: 200 }, 100); } });

(i realize checking height of div, setting height of div , problem.)

http://jsfiddle.net/vadbw/3/

try this...

$('#consolebutton').mouseup(function() { var $footconsole = $('#footconsole'); if ($footconsole.height() == 200) { $footconsole.animate({ height: 14 }, 100) } else { $footconsole.animate({ height: 200 }, 100); } });

it comparing against height (rather set it), , set variable value of $("#footconsole"), rather maintain searching it.

javascript jquery html css

Recover curropt Sharepoint page -



Recover curropt Sharepoint page -

i've modified aspx page using sharepoint designer , can't re-open page. everytime try, error message below. other searches appear spd has corrupted file , how won't open again. can open text file can't see or don't have knowledge see corrupted.

can suggest how can prepare this, otherwise means ever have 1 alter change page, frankly rubbish.

problem event name: appcrash application name: spdesign.exe application version: 12.0.6606.1000 application timestamp: 4e2f96b3 fault module name: ntdll.dll fault module version: 6.1.7601.17725 fault module timestamp: 4ec49b8f exception code: c015000f exception offset: 00084621 os version: 6.1.7601.2.1.0.256.1 locale id: 2057

additional info problem:

lcid: 1033 brand: office12crash skulcid: 1033

can 1 thing,

browse sharepoint site locate site actions. click site actions, , click site settings. on site settings page, click reset site definition under , sense option. on reset page site definition version page, type url page, , click reset.

let me know if helps you.

sharepoint-2007 sharepoint-designer

.htaccess - Is this possible with an htaccess rewrite -



.htaccess - Is this possible with an htaccess rewrite -

i wondering if possible .htaccess rule.

my origin url: http://cmfi.org/wherewework/missionary/?missionary=ttaho%2c

what want end with: http://cmfi.org/wherewework/missionary/ttaho

the ttaho alter according page.

thanks input.

don't think asking code me...just asking if possible. have tried few things , couldn't them work. %2c encoded part of url added plugin using.

i figure out. no worries.

.htaccess

google apps script - How to use an array value as a variable name? -



google apps script - How to use an array value as a variable name? -

i have piece of script here creates object constructor, buildlist() takes info spreadsheet , spits out array containing section names. i'm trying in buildobjects() utilize array create object each section , fill various values pertaining department. i'm having problem line var adcnames[i] = new adc(adcnames[i]);

function adc(name) { this.name = name; } function buildobjects () { var adcnames = buildlist('adc', 1); var adcarray = []; (var in adcnames) { var adcnames[i] = new adc(adcnames[i][0]); adcarray.push(<<the variable created>>); } homecoming adcarray; }

i'm new using objects there may simpler way i'm missing. help appreciated.

all have rename variable.

try

function buildobjects () { var adcnames = buildlist('adc', 1); var adcarray = []; (var in adcnames) { var tempadc = new adc(adcnames[i][0]); //do whatever else need object. adcarray.push(tempadc); } homecoming adcarray; }

google-apps-script

javascript - Jquery Sortable and Draggable between parent and child frame -



javascript - Jquery Sortable and Draggable between parent and child frame -

i trying implement jquery draggable|droppable|sortable between parent , kid frame. have prototype there weird behavior happening

win = document.getelementbyid('frame').contentwindow; element = win.document.getelementbyid('sortable'); $(element).sortable(); console.log(element); $( "#draggable" ).draggable({ connecttosortable: $(element), iframefix: true, helper: function() {return $("<div/>").css('background-color','red');} });

the iframe page contains

$("#sortable").sortable();

here jsfiddle http://jsfiddle.net/vxazs/5/

it works fine when seek drop element on iframe when seek sort elements on iframe element sticks click event of both pages think (so doesn't dropped until click on both parent , iframes). think .sortable() phone call in both parent , iframe if remove droppable stops working.

ok, here how doing one.. create drag on element parent frame , drop in sortable list in iframe, created draggable on element of parent frame within iframe

win = document.getelementbyid('<identifier iframe>').contentwindow; win.jquery(dragelement,parent.document).draggable({ connecttosortable : $("#sortable") )}

works charm!

javascript jquery jquery-ui jquery-ui-sortable jquery-ui-draggable

progress 4gl - What is the easiest way to 'dump' a temp-table into SQL format -



progress 4gl - What is the easiest way to 'dump' a temp-table into SQL format -

version: 10.2b

so lets have table dogs in progress:

table: dogs fields: name, age, breed

i want load them oracle database using standard load utility. table in oracle looks this

table: dog fields: name, age, date_last_updated

so if create temp-table matching this, there way 'dump' temp table sql? (so can load oracle)

if not, fine reply too.

thanks help!!

edit: 'sql dump' mean:

insert dog values (max, 5, feb 18, 2013)

is there way table in format other exporting words "insert into" file.

using database management tool odbc back upwards (dbeaver example) can connect progress databases , export tables , views sql inserts.

progress-4gl openedge

local - I can't connect to SQL Server Management Studio Express version9 -



local - I can't connect to SQL Server Management Studio Express version9 -

i've installed sql server management studio express on scheme , visual studio 2008 installed on scheme before.

but problem can't connect sql server management studio express

i've tried filling server namre combobox \sqlexpress or . or (local)\sqlexpress or (local) , somethings else

but face different errors please help if can

sql-server local connect

php - How do I convert $_GET/$_POST params to URL segments in CodeIgniter? -



php - How do I convert $_GET/$_POST params to URL segments in CodeIgniter? -

very simple. how can convert this:

index.php/person/byage?age=5 or index.php/person/byage (with $_posted data)

to this:

index.php/person/byage/5

i using codeigniter 2.1.3

for specific issue shouldn't need edit .htaccess (if happy still include index.php in urls). have @ codeigniter uri class here

their documentation best thing framework imo, , explain of far improve could.

in particular out command:

$this->uri->segment();

this function allows homecoming particular segment of url. in case calling byage method of person controller. phone call $this->uri->segment(3); homecoming 5.

php codeigniter

java - eclipse removes -javaagent as vm argument -



java - eclipse removes -javaagent as vm argument -

i want edit vm arguments of spring project in eclipse. default vm arguments are:

-xx:maxpermsize=256m -xmx512m

then want add together javaagent arg this:

-xx:maxpermsize=256m -xmx512m -javaagent:${settings.localrepository}\org\springframework\spring-instrument\${org.springframework.version}\spring-instrument-${org.springframework.version}.jar

i added necessary variables. click apply (everything still ok) click ok , closes dialog. when reopen same run configuration, -javaagent arg has dissapeared... , old config of

-xx:maxpermsize=256m -xmx512m

is back. can explain me what's going on? i'm using eclipse version: 4.2.1 maven , spring plugins , configuration gwt project.

gwt version: 2.5

google plugin version: 3.1.3

eclipse version: 4.2.1

maybe downgrading 1 of these help, ideas?

java eclipse spring javaagents google-plugin-eclipse

iphone - Working with the Kal calendar -



iphone - Working with the Kal calendar -

currently have implemented kal calendar within 1 of tabbarviewcontrollers , layout perfect. want create button user clicks , calendar instantly highlights current day in monthly calendar view, button "today".

the layout 1 time again perfect, lastly line of code listed below gives problems.

*** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[secondviewcontroller showandselecttoday]: unrecognized selector sent instance 0x927e6f0'

here implementation have made secondviewcontroller class superclass of uiviewcontroller.

- (void)viewdidload { kalviewcontroller *calendar = [[kalviewcontroller alloc] init]; [self.view addsubview:calendar.view]; [self addchildviewcontroller:calendar]; [[self navigationcontroller] initwithrootviewcontroller:calendar]; calendar.navigationitem.rightbarbuttonitem = [[uibarbuttonitem alloc] initwithtitle:@"today" style:uibarbuttonitemstylebordered target:self action:@selector(showandselecttoday)]; }

goal: give "today" functionality not through app delegate seperate class, secondviewcontroller.

note: holiday illustration app "today" behave holiday illustration project implements today button behaviors within app delegate.

you need store kalviewcontroller instance variable (let's assume _calendar) , implement next method in secondviewcontroller:

- (void)showandselecttoday { [_calendar showandselectdate:[nsdate date]]; }

iphone ios xcode ios6 kal

events - Wait for akka actor system to become available -



events - Wait for akka actor system to become available -

i using akka 2.1 scala 2.10.

i need multiple machines start actor systems , instantiate number of actors. after this, each scheme needs access other systems , collect references actors using "actorfor(...)".

however, need way actor scheme wait on other systems boot before connects, otherwise errors.

if actor scheme connects b while b offline, programme fails. however, if connects b , obtains remote actor reference before exists on b, programme continues fine 1 time b instantiates actor.

in nutshell, need somehow await creation event @ b before seek connecting it. there way in scala+akka?

you might want cluster back upwards akka. allows hear events when other machines bring together cluster , become available communication.

events scala akka actor remote-actors

javascript - doPostback Error -



javascript - doPostback Error -

i trying execute javascript function on page load , postback phone call function in code behind. getting time zone info , trying pass them arguments __dopostback. here have (abbreviated):

in .aspx file

<body onload="getlocaltime()"> .... function getlocaltime(){debugger var d = new date(); var tzoffset = d.gettimezoneoffset(); var hfoffset = document.getelementbyid('<%=hfoffset.clientid%>'); var hftzname = document.getelementbyid('<%=hftzname.clientid%>'); var tzname = gettimezonename(); hfoffset.value = tzoffset; hftzname.value = tzname; __dopostback('tzsessionvars', tzoffset, tzname); }

in code behind's page_load(), if ispostback true:

string starget = request["__eventtarget"]; if (starget.equals("tzsessionvars")) { string sarg = request["__eventargument"]; settzsessionvars(sarg); // parse argument , set session vars }

when trace javascript, when hits __dopostback, says:microsoft jscript runtime error: object expected

the parameters tzoffset , tzname ok , have valid values.

you can utilize __eventargument explained in article.

doing or raising postback using __dopostback() function javascript in asp.net

try passing concatenated values single __eventargument , split @ server actual arguments

javascript asp.net

java - org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Table Authorities doesn't exist -



java - org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Table Authorities doesn't exist -

i have spring 3.1, hibernate 4 , primefaces application. works fine on local machine when deploy ant generated war file on web host, iget error when seek login.

org.hibernate.engine.jdbc.spi.sqlexceptionhelper - table 'brutteng_adaptiveonlinetesting.authorities' doesn't exist

i have created database @ web host has authorities table. took matter web host back upwards team suggested due case of table uncertainty not using table name anywhere. used hibernate capital 'a' in authorities table name.

looking forwards help :)

possibly right , table names case-insensitive in database on local machine , case-sensitive in web host. explain why problem not occur in local setup, case in script not matter much.

capitalize first character of table name in script , work in both.

java hibernate

iphone - How to print in Console Xcode? -



iphone - How to print in Console Xcode? -

i using afnetworking parse json data. want print info on console.

how print

self.videometadata = [json valueforkeypath:@"data.items.video"];

i tried this

nslog(@" info %@",videometadata);

it works when have

nsarray *videometadata = [json valueforkeypath:@"data.items.video"];

as mentioned in comments have utilize nslog(@" info %@", self.videometadata); log data. there no variable called videometadata.

having said that, might want have how examine objects , variables using debugger. have @ example: http://www.cimgf.com/2012/12/13/xcode-lldb-tutorial/

there videos on lldb wwdc 2012 on developer.apple.com (you have registered developer in ios or mac developer program)

iphone objective-c xcode json afnetworking

mono - MonoDroid device registeration for push notifications using PushSharp -



mono - MonoDroid device registeration for push notifications using PushSharp -

in monodroid application have problem registering devices force notifications using pushsharp. general force notification setup works fine on newer devices such sgs2, sgs3 , nexus7, on legend , hero running 2.2 , 2.2.1 registration fails in release (works fine in debug). have narrowed downwards problem startservice call:

var intent = new intent(gcmconstants.intent_to_gcm_registration); intent.setpackage(gsf_package); intent.putextra(gcmconstants.extra_application_pending_intent, pendingintent.getbroadcast(context, 0, new intent(), 0)); intent.putextra(gcmconstants.extra_sender, senders); context.startservice(intent);

the manifest file looks fine:

<uses-sdk android:minsdkversion="8" android:targetsdkversion="10" /> <uses-permission android:name="android.permission.internet" /> ... <!-- google cloud messaging (gcm) force messages --> <permission android:name="my.package.name.permission.c2d_message" android:protectionlevel="signature" /> <uses-permission android:name="my.package.name.permission.c2d_message" /> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name="com.google.android.c2dm.permission.receive" /> <uses-permission android:name="android.permission.wake_lock" />

the intent looks fine (act=com.google.android.c2dm.intent.register pkg=com.google.android.gsf) , senderid correct, gcmintentservice onreceive method never triggered...

sometimes next error message can seen using logcat (although not consistently):

e/c2dmregistrar( 302): [c2dmreg] handlerequest caught java.io.ioexception: ssl shutdown failed: i/o error during scheme call, broken pipe.

i not sure how solve problem , appreciate help.

thanks peter

you don't need these permissions should set within pushsharp code...

<permission android:name="my.package.name.permission.c2d_message" android:protectionlevel="signature" /> <uses-permission android:name="my.package.name.permission.c2d_message" /> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name="com.google.android.c2dm.permission.receive" />

mono monodroid google-cloud-messaging pushsharp

php - CodeIgniter htaccess and URL rewrite issues -



php - CodeIgniter htaccess and URL rewrite issues -

i have never used codeigniter before, allow lone php framework , thought give try. going fine except cannot seem remove index.php url , still access pages.

i have never used mvc construction learning go, forgive me if i'm doing wrong.

i trying access view created called 'about_page.php' typing in localhost/ci/about can access using localhost/ci/index.php/about

the controller page is: /application/controllers/about.php model page is: /application/models/about_model.php , view page is: /application/views/about_page.php

i have searched solution issue, haven't been able find one. here have searched:

codeigniter - removing index.php codeigniter - how remove index.php url? http://www.farinspace.com/codeigniter-htaccess-file/

codeigniter comes .htaccess file in 'application' folder contains allow deny all. created new .htaccess file in root directory, http://localhost/ci/.htaccess , added code it:

rewriteengine on rewritebase /ci rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l]

when .htaccess file in root directory 500 internal server error. when re-create exact same file applications folder 500 error goes away, still cannot access page using localhost/ci/about

i have changed $config['index_page'] = 'index.php'; $config['index_page'] = ''; , tried changing $config['uri_protocol'] = 'auto'; $config['uri_protocol'] = 'request_uri'; still getting internal server error.

i went httpd.conf file , uncommented mod_rewrite.so module know mod_rewrite active.

does have ideas why isn't working or how can work? know there alot of questions on stackoverflow on subject couldn't find 1 answered question.

am doing right? should able access page visiting localhost/ci/about or have create 'about' directory in 'application' directory?

there 3 steps remove index.php

1.make below changes in application/config.php file

$config['base_url'] = 'http://'.$_server['server_name'].'/your ci folder_name'; $config['index_page'] = ''; $config['uri_protocol'] = 'auto';

2.make .htacces file in root directory using below code

rewriteengine on rewritecond $1 !^(index\.php|resources|robots\.txt) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l,qsa]

3.enable rewrite mode (if rewrite mode not enabled)

i. first, initiate next command:

a2enmod rewrite

ii. edit file /etc/apache2/sites-enabled/000-default

change allowoverride none allowoverride all.

iii. restart server next command:

sudo /etc/init.d/apache2 restart

php .htaccess codeigniter

iphone - iOS : How to enable Audio directions on Google Maps -



iphone - iOS : How to enable Audio directions on Google Maps -

i using below code open google maps ios application passing starting , end point of places.

it navigates correctly start point end point not guide through audio (voice).

i want enable voice guidance facility.

please help

clientstate *clientstate = [clientstate sharedinstance]; cllocation *currentlocation = clientstate.currentlocation; nsstring *googlemapsurlstring = [nsstring stringwithformat:@"maps://maps.google.com/?xyz=xyz&saddr=%1.8f,%1.8f&daddr=%@,%@", currentlocation.coordinate.latitude, currentlocation.coordinate.longitude, trip.pickuplatitude, trip.pickuplongitude]; [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:googlemapsurlstring]];

the maps app handle sound guidance you. not need enable it. if open apple maps url scheme or google maps app, guide user via sound if have sound turned on. voice directions work on phones apple maps app. iphone 5 , 4s have voice direction, while iphone 4 , 3gs not. there no siri on iphone 4, there no siri voice navigation.

see this thread on apple discussion.

iphone ios objective-c ipad google-maps

html - How to a put a textarea next to an image and have it fill up rest of the space? -



html - How to a put a textarea next to an image and have it fill up rest of the space? -

i'm trying create nice comment box. want show image before textarea in 1 line/row. image size should fixed. textarea should fill rest of space. website has dynamic width, fixing textarea width doesn't work me.

but text area not go next image, go under it.

<img src="http://i2.wp.com/c0589922.cdn.cloudfiles.rackspacecloud.com/avatars/male200.png" style="float:left;"/> <textarea style="float: left; height: 200px; margin-left: 210px; width:100%"></textarea>

see fiddle.

any ideas on how accomplish this? check out comment box @ cnn.com see i'm talking about.

i think code want do:

<div style="position:absolute; left:100px; right:100px;"> <div style="position:relative;"> <img src="http://i2.wp.com/c0589922.cdn.cloudfiles.rackspacecloud.com/ avatars/male200.png" style="position:absolute;"> <div style="position: absolute; left:210px; right:0px; top:0px;"> <input type="textbox" style="width:100%; height:200px; display:block; padding:0;"> </div> </div> </div>

some fine-tuning may needed. reply based on post: http://jsfiddle.net/qawmn/2/.

html css image textarea

how can i ONLY inject a content script into the popup page of one chrome extension? -



how can i ONLY inject a content script into the popup page of one chrome extension? -

i want run content script page in popup page of extension, how can create in manifest.json or somewhere else?

google-chrome

android - Getting NullPointerException while parse JSON using GSON -



android - Getting NullPointerException while parse JSON using GSON -

i seek parse json using gson library. ref. link have used : link

json file:

{"details": [{"enddate": "01/11/2013 05:10:00","type": "numeric", "startdate": "12/12/2012 04:00:00", "utcdate": "12/31/2012 07:55:01", "min": "1000.00", "convertedstartdate": "12/12/2012 04:00:00", "convertedutcdate": "12/31/2012 07:55:01", "name": "user auto auction", "max": "3000.00", "convertedenddate": "01/11/2013 05:10:00" }], "result": [{ "allowtocomment": false, "rank": 1, "low": "5000.00", "detailsid": 51, "itemdetails": {"id": 28, "specificationfile": "", "itemdescription": "pristine white accord. 176k miles. runs great", "imagename": "http://64.151.125.199/auction/28/desert.jpg", "itemname": "1986 honda accord"}, "desc": "pristine white accord. 176k miles. runs great", "comment": "<null>", "detailsid": 78, "name": "1986 honda accord", "lowrank": 1 }, { "allowtocomment": false, "rank": 1, "low": "7000.00", "detailsid": 52, "itemdetails": {"id": 28, "specificationfile": "", "itemdescription": "black w/tan interior. 110k miles. new tires", "imagename": "http://64.151.125.199/auction/28/penguins.jpg", "itemname": "1989 isuzu trooper"}, "desc": "black w/tan interior. 110k miles. new tires", "comment": "n/a", "detailsid": 100, "name": "1989 isuzu trooper", "lowrank": 1 }]}

itemdetails.java

public class itemdetails { public int id; public string specificationfile; public string itemdescription; public string imagename; public string itemname; }

result.java

public class result { public boolean allowtocomment; public int rank; public string low; public int detailsid; public boolean showcompetingbid; public itemdetails itemdetails; public string desc; public string comment; public int detailsid; public string name; public int lowrank; }

detail.java

public class detail { public string enddate; public string type; public string startdate; public string utcdate; public string min; public string convertedstartdate; public string convertedutcdate; public string name; public string max; public string convertedenddate; }

responce.java

public class responce { public list<detail> details; public list<result> results; }

main java code

public class gsonparsingactivity extends activity { private progressbar bgprocess; private string server = "url"; private string tag = "largejson"; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.activity_gson); bgprocess = (progressbar) findviewbyid(r.id.progressbargson); new getdetail().execute(); } private class getdetail extends asynctask<string, string, string> { @override protected void onpreexecute() { // todo auto-generated method stub super.onpreexecute(); bgprocess.setvisibility(view.visible); } @override protected string doinbackground(string... params) { // todo auto-generated method stub seek { map<string, string> mmap = new hashmap<string, string>(); mmap.put("id", "28"); mmap.put("participantid", "2"); mmap.put("companyid", "5"); inputstream source = getdataforsimplemap(server + "getlist", mmap); gson gson = new gson(); reader reader = new inputstreamreader(source); auctionresponce responce = gson.fromjson(reader, responce.class); list<result> results = responce.results; log.d(tag, ">>>>>>>>>>>>>> " + results.size()); (result result : results) { log.v(tag, " ==================> "+ result.biddetailsid); } } grab (exception e) { e.printstacktrace(); } homecoming null; } @override protected void onpostexecute(string result) { // todo auto-generated method stub super.onpostexecute(result); bgprocess.setvisibility(view.invisible); } } @suppresswarnings("rawtypes") private inputstream getdataforsimplemap(string strurl, map<string, string> params) { seek { // jsonobject jarray = null; inputstream stream = null; iterator iterator = params.entryset().iterator(); jsonobject info = new jsonobject(); while (iterator.hasnext()) { map.entry mentry = (map.entry) iterator.next(); string key = mentry.getkey().tostring(); string value = mentry.getvalue().tostring(); data.put(key, value); } stream = getjsonfromurl(strurl, data); homecoming stream; } grab (exception e) { e.printstacktrace(); homecoming null; } } private inputstream getjsonfromurl(string strurl, jsonobject data) { seek { inputstream stream = null; httpclient httpclient = new defaulthttpclient(); httpconnectionparams.setconnectiontimeout(httpclient.getparams(), 120000); httppost httppost = new httppost(strurl); httppost.setheader("content-type", "application/json"); if (data != null) { stringentity entity = new stringentity(data.tostring(), http.utf_8); httppost.setentity(entity); } httpresponse response = null; response = httpclient.execute(httppost); if (response != null) { stream = response.getentity().getcontent(); } else { stream = null; } homecoming stream; } grab (exception e) { e.printstacktrace(); homecoming null; } } }

but unfortunate getting next error:

02-11 12:10:01.075: w/system.err(587): java.lang.nullpointerexception 02-11 12:10:01.094: w/system.err(587): @ com.example.largejson.gsonparsingactivity$getauctiondetail.doinbackground(gsonparsingactivity.java:80) 02-11 12:10:01.094: w/system.err(587): @ com.example.largejson.gsonparsingactivity$getauctiondetail.doinbackground(gsonparsingactivity.java:1) 02-11 12:10:01.094: w/system.err(587): @ android.os.asynctask$2.call(asynctask.java:185) 02-11 12:10:01.094: w/system.err(587): @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:306) 02-11 12:10:01.105: w/system.err(587): @ java.util.concurrent.futuretask.run(futuretask.java:138) 02-11 12:10:01.105: w/system.err(587): @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1088) 02-11 12:10:01.115: w/system.err(587): @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:581) 02-11 12:10:01.115: w/system.err(587): @ java.lang.thread.run(thread.java:1019)

android json gson