Posts

Showing posts from April, 2014

create table - How to allow members to view their personal referrals in php -

i trying create referral list/table in php every member can see referred. 2 columns display are: name , email. this code counts each members' personal referrals fine. i'm showing see if can branch off or not <? } } function middle() { include "config.php"; $id=$_session['username_session']; $rs = mysql_query("select * users username='$id'"); $arr=mysql_fetch_array($rs); $email=$arr[7]; $username=$arr[8]; $password=$arr[9]; $name=$arr[1]; ?> of today, have <b><font size="3"><? $rs1=mysql_query("select * users ref_by='$username'"); echo mysql_num_rows($rs1);?></b></font> personal referrals.</font> this code having trouble in creating table/list of personal referrals per member. said above, code calls members in system not want. want personal referrals per member. maybe code can edited differently work, or use above code make work. im not sure.. help appreci

php - Add multiple timestamps together from mysql db then get hours and minutes -

what's best way retrieve start_time , end_time times mysql db using php , add them total of hours , minutes? example military time in db is: 18:35:19 22:05:14. easier standard or military time? in advance. carlos, some further information such format data stored within mysql have been helpful, there mysql queries this. seeing you've tagged php, following in php: convert time unixtimestamp using mktime ( http://php.net/manual/en/function.mktime.php ) $unixtimestamp_start = mktime($hour,$minute,$second,$month,$day,$year); $unixtimestamp_finish = mktime($hour,$minute,$second,$month,$day,$year); minus start time finish time. $timediffseconds = $unixtimestamp_finish - $unixtimestamp_start; you have amount of seconds between finish , start. you can divide 60 have minutes $timediffmins = $timediffseconds/60; you can divide 60 again have hours. $timediffhrs = $timediffmin/60;

android - Text file outputted via FileOutputStream -

how output text file see individual lines of text in logcat. file in res/raw/ directory , need basic on how this. have code required information provided fileoutputstream unsure how read in first place. to read text file raw resource folder can use following snippet: bufferedreader br = new bufferedreader(new inputstreamreader(getresources().openrawresource(your_resource_id))); string line = null; while ((line = br.readline()) != null) { // whatever read line here // write logcat e.g. use log.i("tag", line); } br.close();

MYSQL Putting Option Menu in One Table -

is necessary put option menu status, civil status, gender , kind of status answerable boolean or 0-9 in 1 table only. or necessary separate them in different tables table_civil_status, table_gender, , like.... the question isn't how many tables have. question entities database represents. from question, seem have person entity, has various information person. in case, make sense put attributes person in 1 table.

CSS Image Sprite - Invalid Property Value -

learning use sprite menu right following tutorial. reason, chrome giving me 'invalid property value' on of background-position lines. first one, position 0 0 works fine, other 2 -33 0 , 0 -33 won't work, means site showing 1 button right , hover isn't applied. picture using right 197x65 #sidebar .content .follow { display: block; float: left; height: 32px; background-image: url('http://s23.postimg.org/8ltupgj0r/follow.png'); text-indent: -9999px; margin-right: 5px; } #sidebar .content .follow a.fb { width: 32px; background-position: 0 0; } #sidebar .content .follow a.twit { width: 32px; background-position: -33 0; } #sidebar .content .follow a.fb:hover { background-posi

python - Unable to bind to pyxb classes with nested (anonymous) types -

i followed instructions this thread , , xml: <?xml version="1.0" encoding="utf-8" ?> <my_report> <something> <foo> yes </foo> </something> <something_else> <id>4</id> <foo>finally</foo> <score>0.2</score> </something_else> </my_report> i created following xsd schema using this tool online . <xs:schema attributeformdefault="unqualified" elementformdefault="qualified" xmlns:xs="http://www.w3.org/2001/xmlschema"> <xs:element name="my_report"> <xs:complextype> <xs:sequence> <xs:element name="something"> <xs:complextype> <xs:sequence> <xs:element type="xs:string" name="foo"/> </xs:sequence> </xs:complextype> </xs:element> <xs:element n

Javascript notifications in Chrome -

i'm trying make sort of alarm clock web application , noticed having problem audio file wouldn't play , title-bar wouldn't flash if chrome or web application's tab wasn't in focus. i found answer here saying chrome runs in separate processes or threads, need inter-process programming or something, couldn't find examples how this, find ways pause javascript in background until focus given tab or chrome. obviously, useless, point of application provide notifications while tab or chrome not focused. the application works fine in other browsers, not chrome. know how can make titlebar flash , play audio file if chrome or web app's tab not in focus?

Javascript Loop Program -

i'm trying make javascript loan calculator program. can't seem loop put different numbers on each line. it's suppose show amount of money paid off starting @ 24 months, 36 months, 48 months, , 60 months. i'm using function calculations i'm getting results 24 months. know got change nummonths 36, 48, , 60 have no idea that. thought loop add 12 months each time loops. how format numbers currency? i'm getting long number @ end. tried doing parsefloat on calculate() i'm getting error. here code: <html> <body bgcolor="#ffc0cb"> <head> <title>chapter 6 assignment 2</title> </head> <body> <h1>loan calculator</h1> <script type="text/javascript"> var vehicleprice = window.prompt("what vehicle price?", ""); var downpayment = window.prompt("what amount of down payment?", ""); var annualinterest = window.prompt("what annual interest rate lo

c# - Implicitly Convert Type -

i doing in wpf , using entity-framework . this query code in crud class file : public class questionhint { public int? questionno { get; set; } //change type accordingly public int? activityid { get; set; } //change type accordingly public int? taskid { get; set; } //change type accordingly public string answer { get; set; } //change type accordingly public string questioncontent { get; set; } //change type accordingly public string joined { get; set; } //change type accordingly public string joinoption { get; set; } //change type accordingly } public ilist<questionhint> getlistkeys(int listtask, int listactivity) { ilist<questionhint> lstrecords = context.questionhints.groupby(x => new { x.questionno, x.activityid, x.taskid }).tolist().select(g => new questionhint() { questionno = g.key.questionno, activityid = g.key.activityid

subquery - How can I filter with a derived table in MS SQL Server? -

sql server management studio 2005 i wrote query allow user search on various categories such description, country of origin, brand name, , grow method. user able input data many filters , results returned based on inputted. below working version of query; how ssms reformatted original query wrote before. need try , figure out how wrote before can add 2 more columns filter: select distinct mastercorporategtin.supplierno, mastercorporategtin.gtin, mastercorporategtin.description, mastercorporategtin.commodity, mastercorporategtin.variety, mastercorporategtin.coo, mastercorporategtin.packsize, mastercorporategtin.brandname, mastercorporategtin.growmethod, mastercorporategtin.grade gtins mastercorporategtin inner join (select distinct supplierno, gtin, description, coo, packsize, brandname, growmethod, grade gtins mastercorporategtin (description '%' + @productdescription + '%') , (brandname '%' + @bran

objective c - How to implement -draw for custom NSImageRep subclass -

i'm interested in creating nsimagerep subclass can hold double precision values. standard nsbitmapimagerep can hold single precision floats, chokes on doubles. nsbitmapimagerep exposes data buffer manipulation, , i'd retain ability manipulate data in place rather manipulate separate buffer i'll need convert image display. i think subclassing straight forward except i'm not sure how handle basic part: drawing image. documentation lists -draw method need implement, makes sense, best way draw bitmap? i saw 1 hesitant suggestion draw lots of little rectangles, 1 per pixel presumably: how implement custom image representation nsimage is there more efficient approach? i've looked , can't find worked example of custom nsimagerep bitmap data-- examples use vector data. also, find interesting method implement -draw, , not form of bounded draw. there way determine current clipping region within nsimagerep or avoid drawing parts of image aren't necessa

python - Django memcache low level api giving less performance than cache middleware -

this first time posting question here please ignore deviations standard format... here setup . nginx --> uwsgi --> django --> (memcached/ mysql) i have set of apis in django return json response. earlier using memcached 2 part middleware auto caching. more control ,i have moved low level apis. use celery create pickled data sets , insert data in memcached once day , apis fetch data memcached. i using nginx , uwsgi( 16 workers) in production environment , getting speed of 8k requests 2 part middleware approach. first request used slow. lower level cache getting 1/10th speed . initially thought due middlewares , custom code getting executed, have trimmed also. moved pickle cpickle not think bottleneck. using apache benchmark conduct tests. i attaching memcached ( -vv) logs both middleware approach , low level cache api. if can point me right direction........ thanks i saw catche-middleware code django. seem saving django httpresponse object in cache. middleware

python - Can someone explain to me the difference between a Function Object and a Closure -

by "function object", mean object of class in sense callable , can treated in language function. example, in python: class functionfactory: def __init__ (self, function_state): self.function_state = function_state def __call__ (self): self.function_state += 1 return self.function_state >>>> function = functionfactory (5) >>>> function () 6 >>>> function () 7 my question - use of functionfactory , function considered closure? a closure function remembers environment in defined , has access variables surrounding scope. function object object can called function, may not function. function objects not closures: class functionobject(object): def __call__(self): return foo def f(): foo = 3 functionobject()() # raises unboundlocalerror a functionobject not have access scope in created. however, function object's __call__ method may closure: def f(): foo = 3

linkedserver SQL/ORACLE - An error occurred while preparing a query for execution -

my problem same... have code use in db utils class make query. public dataset sqlcommandselect(string command) { try { dataset objdataset = new dataset(); string strorders = command sqlcommand objordercommand = new sqlcommand(strorders, myconnection); sqldataadapter objordadapter = new sqldataadapter(); objordadapter.selectcommand = objordercommand; objordadapter.fill(objdataset); objordercommand.dispose(); objordadapter.dispose(); return objdataset; } catch (exception ex) { log.error("sqlcommandselect : " + command + " " + ex.message + " " + ex.stacktrace); return null; } } now trying make query (that work greats on sql editor) select * openquery(oracdgmi,'select * cic.anagrafica ') oracdgmi linkedserver sql/oracle give me error

html - Code being removed in browser after file uploaded -

i'm trying add facebook button, have follwed steps fb developers site, placed needed be, tried various other solutions button not showing up. can 1 please explain why after upload file server, @ source code in browser code facebook button no longer there? entire div tag surrounding code missing. when @ file on server contains code button browser doesn't seem recognize it. i have read having create api key(app id), have heard it's not necessary. also, if facebook account has settings country restrictions, mess whether button shows page i'm trying set facebook page on site. missing? please help! here's have in code: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#"> some more stuff in body... <div class="sidefigures"> <div class="like"> <iframe src="//www.facebook.com/plugins/like.php?href=https%3a%2f%2fwww.facebook.com%2fentertainmentindustryintroducti

spring - Annotation @JoinTable How to use scala programming -

using annotation @jointable in scala programming got errror i import import javax.persistence.jointable the code @beanproperty @manytomany(fetch = fetchtype.lazy) @jointable(name = "lw_user_role", joincolumns = { @joincolumn(name = "useraccount_id") }, inversejoincolumns = { @joincolumn(name = "role_id") }) here got compilation error ---^ ^------ , here var roles:list[role] compilation error multiple markers @ line - expected start of definition - annotation argument needs constant; found: { <empty>; (){<error>} } {<error>} - type mismatch; found : unit required: array[javax.persistence.joincolumn] - expected start of definition - annotation argument needs constant; found: { <empty>; (){<error>} } {<error>} - type mismatch; found : unit required: array[javax.persistence.joincolumn] i use annotat

php - Rewrite condition is not working -

how rewrite url search page in opencart like http://ip/opencart/index.php?route=product/search&filter_name=24 but need display like http://localhost/opencart/product/search/42 orelse in formate userfreindly.i have tried like rewriteengine on rewritebase /opencart rewriterule ^sitemap.xml$ index.php?route=feed/google_sitemap [l] rewriterule ^googlebase.xml$ index.php?route=feed/google_base [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !.*\.(ico|gif|jpg|jpeg|png|js|css) rewriterule ^([^?]*) index.php?_route_=$1 [l,qsa] rewritebase /opencart rewriterule ^search$ index.php?route=product/search [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !^/search$ rewriterule ^([^?]*) index.php?route=$1 [l,qsa] how this: rewritebase / rewriterule ^opencart/([^/]*)/([^/]*)/([^/]*)$ /opencart/index.php?route=$1/$2&filter_name=$3 [l] please note slash in rou

sql server - sql case statement with date values -

Image
i have date column in database table. select sdestructiondate tbldocumentheader below result of above query i need print empty date value '1991-01-01' i expect result set below. i tried below query still print '1991-01-01' date. select case convert(date,h.sdestructiondate,103) when '01/01/1991' '' else convert(date,h.sdestructiondate,103) end 'sdestructiondate' tbldocumentheader h i don't want convert result varchar value. below query gives me result need return date format. select case convert(varchar,h.sdestructiondate,103) when '01/01/1991' '' else convert(varchar,h.sdestructiondate,103) end 'sdestructiondate' tbldocumentheader h i first convert null: select case when h.sdestructiondate = '01/01/1991' null else h.sdestructiondate end sdestructiondate tbldocumentheader h then reporting tool present blank if value null mixing data presen

lucene - Solr 4.3.1 error "you must pass fillFields=true to IndexSearcher.search" on using group.query -

i`m using solr-4.3.1 on ubuntu , start solr on jetty. have custom schema.xml , fields of query in it. collection "collection1" consists of 8 shards try grouping data field , use: http://solr-node1:8983/solr/collection1/select/?q=*:*&group=true&group.field=rgn_str solr correct answer , provides results, when try use group.query http://solr-node1:8983/solr/collection1/select/?q=*:*&group=true&group.query=rgn_str:test an error "shard 7 did not set sort field values (fielddoc.fields null); must pass fillfields=true indexsearcher.search on each shard" the documentation solr not find how specify parameter. how it? to repeat problem, following start node1 of solrcloud (4.3.1 default configs) (java -dbootstrap_confdir=./solr/collection1/conf -dcollection.configname=myconf -dzkrun -jar start.jar) import collection1 -> shard1 data try group.query e.g. node1:8983/solr/collection1/select?q= : &group=true&group.query=somefiled:some

objective c - NMSSH Linker errors when building for iOS Device -

Image
i'm using nmssh in app, , having problems. i've followed installation procedure written in github page, , works fine on ios6.1 simulator. however, when build onto ipod touch device running ios5.1, following errors: undefined symbols architecture armv7: "_inflate", referenced from: _comp_method_zlib_decomp in nmssh(comp.o) "_deflate", referenced from: _comp_method_zlib_comp in nmssh(comp.o) "_inflateend", referenced from: _comp_method_zlib_dtor in nmssh(comp.o) "_deflateinit_", referenced from: _comp_method_zlib_init in nmssh(comp.o) "_deflateend", referenced from: _comp_method_zlib_dtor in nmssh(comp.o) "_inflateinit_", referenced from: _comp_method_zlib_init in nmssh(comp.o) ld: symbol(s) not found architecture armv7 clang: error: linker command failed exit code 1 (use -v see invocation) a suggestion thread said include libz, included libz.1.2.5.dylib , ran with

repository design - How to combining similar git repositories? -

i have migrated big old cvs repository git. in project have several different development teams, need access same or different repository folders. idea separate central repository several repositories, each team have access 1 repository folders need. behind these repositories integration repository necessary. so problem there project folders several teams need access. example: team-repo 1: foldera, folderb, folderd team-repo 2: folderc, folderd -->shared repo (repo1 + repo2): foldera, folderb, folderc, folderd in example folder d has combined. possible in git implement such concept? my intention is, each development team need clone 1 little repository instead of big one. you need have each "folder" in own repository (at least each independant folder). then use concept of submodules ( http://git-scm.com/book/en/git-tools-submodules ) "modules" repository : repoa, repob, repoc, repod "project" repository, using git submodule :

javascript - HTML text input - Prevent Windows 8 touch keyboard? -

is there way prevent on-screen keyboard popping default when html text input field gets focus on windows 8 touch screen pc? the application in question barcode/rfid scanning web application. it preferable if user still pop on-screen keyboard manually if need it. preferably solution avoids changing global settings of machine. more info: text input field needs able receive focus , accept keyboard input bar-code , rfid scanners attached terminal. try $("#textbox1").attr("readonly", "readonly"); or $("#state").attr("readonly", true); thanks ab

c# - Avoid Scanning EntireRichtextbox Highlighting -

this question has answer here: richtextbox syntax highlighting in real time--disabling repaint 3 answers im working on code editor , came set of codes: public class test2 : form { richtextbox m_rtb = null; public static void main() { application.run(new test2()); } public test2() { text = "test2"; clientsize = new size(400, 400); m_rtb = new richtextbox(); m_rtb.multiline = true; m_rtb.wordwrap = false; m_rtb.acceptstab = true; m_rtb.scrollbars = richtextboxscrollbars.forcedboth; m_rtb.dock = dockstyle.fill; m_rtb.selectionfont = new font("courier new", 10, fontstyle.regular); m_rtb.selectioncolor = color.black; controls.add(m_rtb); parse(); m_rtb.textchanged += new eventhandler(this.textchangedevent); } void parse() { string inputlanguage = "// comment.\

Android Sliding Puzzzle Game: the slide effect -

i'm trying make android puzzle game out of picture. i've done 'till is: -i've cut picture in how many parts edittext field; -i've put cut pictures in gridview , got puzzle table; -i've used collection.suffle(list) suffle images in gridview; now, trying implement sliding effect on 2 images gridview. want achieve sliding effect similar candycrush app or 1 http://www.youtube.com/watch?v=quop87fnb8w . mean, want hold image , drag top should slide top. if click picture , slide bottom, should change picture below , on... here code: reset = (button) findviewbyid(r.id.breset); splitno = (edittext) findviewbyid(r.id.edsplitby); splitby = integer.parseint(splitno.gettext().tostring()); imgno = splitby * splitby; puzzle = (gridview) findviewbyid(r.id.puzzle); rootimg = (imageview) findviewbyid(r.id.source_image); splitimage(rootimg); formpuzzle(smallimages); reset.setonclicklistener(new onclicklistener() { public

Can't set custom font for pdf for PdfContentByte - DroidText/iText library -

i'm trying use custom font, don't error doesn't take account. rectangle pagesize = basepdf.getpagesize(i); pdfcontentbyte pdfcontentbyte = stamper.getovercontent(i); // use custom font if (!fontfactory.isregistered(futura_light)) { filehelper.copyfilefromassetstointernalstorage(mcontext, font_path_in_assets); fontfactory.register(mcontext.getfilesdir() + "/" + font_path_in_assets, futura_light); } font myfont = fontfactory.getfont(futura_light); basefont font = myfont.getbasefont(); pdfcontentbyte.savestate(); pdfcontentbyte.stroke(); pdfcontentbyte.restorestate(); // start add text pdfcontentbyte.begintext(); pdfcontentbyte.setfontandsize(font, 6); if (fontcolor != null) { pdfcontentbyte.setcolorfill(fontcolor); } pdfcontentbyte.showtextaligned(pdfcontentbyte.align_center, message, pagesize.getwidth() / 2, 40, 0); pdfcontentbyte.endtext(); i've checked , font indeed registered, doesn't apply pdf. i found accident, trying

Simple matplotlib Annotating example not working in Python 2.7 -

code import numpy np import matplotlib.pyplot plt fig = plt.figure() ax = fig.add_subplot(111) t = np.arange(0.0, 5.0, 0.01) s = np.cos(2*np.pi*t) line, = ax.plot(t, s, lw=2) ax.annotate('local max', xy=(2, 1), xytext=(3, 1.5), arrowprops=dict(facecolor='black', shrink=0.05), ) ax.set_ylim(-2,2) plt.show() from http://matplotlib.org/1.2.0/users/annotations_intro.html return typeerror: 'dict' object not callable i manged fixed with xxx={'facecolor':'black', 'shrink':0.05} ax.annotate('local max', xy=(2, 1), xytext=(3, 1.5), arrowprops=xxx, ) is best way ? caused problem ? ( know started python 2.7) so if know more, please share. since code looks fine , runs ok on machine, seems may have variable named "dict" (see this answer reference). couple of ideas on how check: use pylint . if suspect 1 specific builtin, try checking it's ty

jQuery: Set cookie on one page and retrieve from another -

i have 2 html pages. setcookie.html : <script> if($.cookie('order_by') == null){ $.cookie('order_by', 'name'); } console.log($.cookie('order_by')) //works fine </script> now, want retrieve cookie on other page not able do. now, there link in setcookie.html takes me getcookie.html . getcookie.html : <script> console.log($.cookie('order_by')) //doesn't work </script> as cookie set(and it's never expiring), should able retrieve value on other page. right? how can so? edit: this whole html of getcookie.html . <ul class="filter-by"> <li> filter by<br /><script>$('.filter-by li').append('<strong>'+$.cookie('order_by' , { path: '/' })+'</strong>');</script> <ul class="filter-items-list"> <li>name</li> <li>views</li> <li>latest</li>

javascript - How to 'chain' JS function after the first is fully done -

i have functions should run 1 after other, such: function cuttomatoesalone(kg){ // slice stuff } function cooktomatoes(minutes){ // boil stuff } i call them such: cuttomatoesalone(15) // 15kg, need 3 hours! cooktomatoes(10); // need 10 minutes but cooktomatoes(10) finish before cuttomatoesalone(15). how run cuttomatoesalone(15) first , when finished, run cooktomatoes(10) ? edit: cuttomatoesalone() load external json. cooktomatoes(10) work on it. learn promises , deferred objects . every ajax function in jquery returns promise, can chain function calls. for example: function cuttomatoesalone(kg) { return $.getjson(...); // return promise provided $.getjson } // called cuttomatoesalone(15).then(function() { // attach callback cooktomatoes(10); }); in case of ajax call, promise resolved once response retrieved.

python - Is there a limit on TextBlob translation? -

i have been using textblob, package python ( https://pypi.python.org/pypi/textblob ) translating articles different language . after reading docs, got know textblob makes use of google translate. since google translate not free service, wanted know whether there usage limit on translating articles using textblob services? google states on pricing page google translate api need set billing in order able utilize translate api. in other words, there isn't free usage tier. important: google translate api v2 requires billing information accounts before can start using service. this text available on https://cloud.google.com/translate/v2/pricing . so, shouldn't able use translate api @ unless have account set up. the google documentation lists https://www.googleapis.com/language/translate/v2 api endpoint. having around source code textblob, couldn't find endpoint mentioned anywhere. instead, textblob seems using http://translate.google.com/translate

How to create a new table from multiple spatial searches in SQL Server? -

i wondering if help. asked colleagues create postcode lookup table them , takes me considerable time using desktop gis. wondering if possible create table using sql server create lookup me? the lookup table based on finding relevant boundaries postcode sample table this: table postcode school ward polling district bh15 2ru st peters elmsdale pd all of information school, ward , polling district coming different tables. each of these tables has geometry column (as has postcode table). i can run select statement simple join (say postcode school) , create table, run of separate spatial queries in 1 large query create singular table. have 20 or different tables boundaries required large lookup table. i hope makes sense! any appreciated. first you'll need create table, one-off process: create table [example] ( postcode varchar(8) not null, school varchar(50), ward varchar(50) -- repeat each row (setting appropriate length / typ

java - Is Maven better than the ant building tool for deploy an EAR project -

i using ant 1.8 in ear project jboss 4.0.5 technology using jee 1.5 struts 1.2 i have 3 jars deployed in ear directory of jboss. currently ant used building project , takes around 30second build 1gb project. i want change building tool ant maven ? will maven more full , faster ? i think, in case, gradle suits particular needs better maven. faster builds will maven more full , faster ? incremental builds feature helps making build faster, maven doesn't support them. know there exists plugins offers out of box incremental builds have not use them. instead gradle scales well , offers state-of-art in incremental building: "incremental builds" other multi-project builds feature big time saver larger builds. reusing ant deploy targets i have 3 jars deployed in ear directory of jboss. don't worry if think gradle isn't mature maven when comes release deployment: gradle first build integration tool . can reuse favourite reliab

jquery dynamically change data attribute value and calculate arithmetic operation(addition) -

this script $(document).on('click', '.cnt', function(e) { e.preventdefault(); var wa = $('#te').data('vals'); va = wa + 1; console.log(va); $('#te').data('vals', va); $('#te').attr('data-vals', va); }) and here <a href="" class="cnt">click me</a> <div id="te" data-vals=1>count</div> the above script not working expected. please find fiddle here you can use .attr() instead of .data() using unary plus + before value parse wa value integer in order increase number: $(document).on('click', '.cnt', function (e) { e.preventdefault(); var wa = $('#te').attr('data-vals'); va = +wa + 1; console.log(va); //$('#te').data('vals', va); // not updating once $('#te').attr('data-vals', va); // updating once }); up

java - Null Pointer Exception: Trying to make an android app for 3x3x3 tic tac toe -

i checked logcat , saw nullpointerexception error. beginner @ programming pls me out. last time had similar problem had not initialised array. cant figure out whats wrong time. package com.example.test2; import android.app.activity; import android.os.bundle; import android.view.menu; import android.view.view; import android.widget.button; import android.widget.textview; public class mid extends activity { char[][][] a=new char[3][3][3]; char b=' '; int i=0,j=0,k=0,l=0,o=0; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.mid); for(j=0;j<3;j++) {for(k=0;k<3;k++) {for(k=0;k<3;k++) { a[j][k][l]=' '; } } } button btnt1 = (button)findviewbyid(r.id.btnt1); button btnt2 = (button)findviewbyid(r.id.btnt2); button btnt3 = (button)findviewbyid(r.id.btnt