Posts

Showing posts from June, 2012

php - Uncaught SyntaxError: Unexpected token on some hosting providers -

when vin number added in admin , button pressed data, in hosting providers i'm getting error , spinning loading wheel of death, while other providers , in localhost info correctly. why not consistent , can make work time? the error on google chrome console is: uncaught syntaxerror: unexpected token and if click on arrow expand error show [object][object]. here code: <?php add_action('wp_ajax_rw_api_data', 'rw_api_data'); function rw_api_data(){ if ( isset($_post["vin"]) && strlen($_post["vin"]) === 17 ){ $api_key = get_option('edmund_api'); $vin = $_post["vin"]; // basic details $url = sprintf( "https://api.edmunds.com/api/vehicle/v2/vins/%s?&fmt=json&api_key=%s" , $vin , $api_key ); $get_response = wp_remote_get($url); if( !is_wp_error( $get_response ) ) : $basic_data = json_decode( $get_response["body"], true); $style_id = i...

java - Android Studio LibGDX Game problems -

i'm finishing writing game, however, when run game, android studio complains following errors: error:(103, 8) gradle: error: illegal start of expressionerror:(103, 15) gradle: error: illegal start of expressionerror:(103, 26) gradle: error: ';' expectederror:(103, 43) gradle: error: ';' expected . here's code gamescreen class: package com.circlecrashavoider; import com.badlogic.gdx.gdx; import com.badlogic.gdx.graphics.gl20; import com.badlogic.gdx.graphics.texture; import com.badlogic.gdx.math.mathutils; import com.badlogic.gdx.math.vector2; import com.badlogic.gdx.physics.box2d.contact; import com.badlogic.gdx.physics.box2d.contactimpulse; import com.badlogic.gdx.physics.box2d.contactlistener; import com.badlogic.gdx.physics.box2d.manifold; import com.badlogic.gdx.physics.box2d.world; import com.badlogic.gdx.scenes.scene2d.stage; import com.badlogic.gdx.u...

php - How to change URLs in a Site developed using Laravel? -

i have website being developed using laravel 4 freelance dev. while developer has developed site standard url's each page, want able change words in url suite each of target markets. example, developer made url of 1 page: www.site.com/public/city/vehicles later, want able change www.site.com/rome/cars or www.site.com/sydney/bikes however developer says wont possible later on change urls limitation in laravel. can please shed light on , how this? why not possible ?? url can me made dynamic if want . using route route::get('/city/{slug}/{slug}',array('as'=>'city.vehciles','uses'=>'yourcontroller@yourmethod')); this output : www.site.com/city/rome/cars //if public folder removed url . //here `rome` , `cars` dynamic , value comes per slug value database. in above route slug thing can me made dynamic . keep place add slug while adding vehicle in dashboard add vehicles. also, if want explore more pleas...

c# - DataGrid Sorting By Any Column Only Sorts by First Column Criteria -

Image
i have been scratching head @ 1 quite while. xceed datagrid sorts acqid , nothing else, when select other columns strings, date, , numeric. see image of date sorting below. my object pretty complex, have no clue modify work. have less complex object list seems work fine sorting. seen before? for else stumbles on this... setting autocreateitemproperties="false" in collectionviewsource cause behavior.

How to select columns that are from different tables SQL -

i have table named items , table named orders. orders table need select artists column , orders table need select order_date , ship_date; how can this? in selecting columns in different tables can use join, left join, or right join connect 2 tables. in doing need 1 same column in both of tables. join select table1.colmun_name, table2.column_name table1_name table1 join table2_name table2 on table1.primarykey = table2.table1_primarykey for example: select items.artists, order.order_date, order.ship_date items items left join orders order on item.item_id=order.item_id item_id common column in table1 , table2 2 tables can connect each other. edit: changed table name as ^ need elaborate question clear want because can put changed table name in query.

how to set this animation for the android banner anybody can know -

Image
this banner know viewpager.setpagetransformer(boolean reversedrawingorder, pagetransformer transformer) ; but pagetransformer don't how set yes myself call ontransform(view view, float position) set view.settranslationx(position < 0 ? 0 : -view.getwidth() * position/2); ok

reflection - How to hook into an auto-generated Java method? -

edit: started low-priority question make work easier has become interesting exercise in java witchcraft. input, everyone! i'm working auto-generated java code (specifically, code generated anylogic) produces method called onchange() . i'd call own method when onchange() called. there way "hook into" onchange() via reflection or other standard java mechanism? one solution suggest using proxy objects. here tutorial might of you.

javascript - Variable is not reflecting update in view when variable is updated in the function -

i have angular app i'm trying update variable in view using function. in view have: <form ng-controller="scanctrl"> <div ng-click="method()">button</div> <p>{{alert}}</p> <p>{{working}}</p> </form> in controller have: .controller('scanctrl', function($scope, qb){ $scope.working = 'this update works'; $scope.method = function(){ $scope.alert = 'this 1 doesn't'; }; }); the "working" variable updated correctly, if clicked div , alert doesn't seem updated in view. i tried $scope.apply , throws error. here full code of controller: nojquery .controller('scanctrl', function($scope, qb){ $scope.scan = []; $scope.scan_code = function(){ console.log("scan function reached"); if (typeof $scope.scan.action != 'undefined') { console.log($scope.scan.action); } els...

ruby - Qt : Reading the text file and Displaying in LineEdit -

i have input file , batch file. when batch file executed using system command, corresponding outfile generated. now want particular text (position 350 357) outfile displayed on lineedit widget here part of code: system("c:/org_class0178.bat") now outfile generated file.open("c:/org_class0178_out.txt", 'r').each |line| var = line[350..357] puts var # test whether file being read. @responselineedit = qt::lineedit.new(self) @responselineedit.setfont qt::font.new("times new roman", 12) @responselineedit.resize 100,20 @responselineedit.move 210,395 @responselineedit.settext("#{var}") end when test whether file being read using puts statement, exact required output in editor. however, same text not being displayed on lineedit. suggestions welcome. edit: wired observation here. works fine when try read input file , display , not work output file. puts statement give answer in editor co...

java - p:editor is disabled in modal dialog with appendToBody="true" -

<p:commandbutton id="composebtn" icon="ui-icon ui-icon-document" oncomplete="composedlg.show()" update=":frmcompose ,:frmcompose:dlgpnl"> </p:commandbutton> <p:dialog widgetvar="composedlg" modal="true" id="dlgcompose" appendtobody="true" showeffect="fade" hideeffect="fade"> <h:form id="frmcompose" enctype="multipart/form-data"> <p:editor widgetvar="editor" value="#{newmail.body}" /> <p:separator> <p:commandbutton value="# erlbl['mailbox.cmdsend']}" ajex="false" action="#{pc_mailbean.submit()}" update=":frm:msg" oncomplete="composedlg.hide()" /> <p:commandbutton value="#{commonlbl['cmdcancel']}" oncomplete="composedlg...

html - Extracting a number from an XML node -

the best (so far) xpath extract following node: <li class="list-guests">&#13; <span class="icon guests"/>&#13; 3&#13; </li> i need extract number 3. there way in xpath? don't want start using complicated regex if can avoid it. you should able use text() function

php - Regex to match domain failing on input -

i created regex match domain name out of input: $pattern = '/\w+\..{2,3}(?:\..{2,3})?(?:$|(?=\/))/i'; $url = 'http://wwe.com'; if (preg_match($pattern, $url, $matches) === 1) { echo $matches[0]; } it works fine input: http://google.com // output:google.com but not able achieve these inputs: (if user enters www http://www.google.com // output:google.com http://www.www.google.com // output:google.com what missing? any on appreciated what this? <?php $urls = [ 'http://google.com', 'http://www.google.com', 'http://www.www.google.com', ]; foreach($urls $url) { $url = parse_url($url, php_url_host); $url = preg_replace('/^(www\.)+/', '', $url); echo $url . "\n"; } output: google.com google.com www.google.com

cordova - Setting Android Home path in ionic framework -

i want run ionic project in android device.so ran following commands ionic add ionic-platform-web-client ionic plugin add phonegap-plugin push ionic io init ionic platform add android all above commands executed.we tried run following command ionic run android i gives me error 'android_home' environment variable set non-existent path.try update manually point valid sdk directory.you may not have required environment or os run project. how fix now? set android development environment before can build android applications, must install android sdk. installing android sdk installs avd manager, graphical user interface creating , managing android virtual devices (avds). from android web site , download correct version of android sdk operating system. unzip archive location of choosing. example, on linux or mac, can place in root of user directory. see android developers web site additional installation details. configure android_home environm...

watchman - react native watchmanResponse unable to resolve root -

Image
there error when build react-native project version 0.20.0: looking js files in /users/rockyl/workspaces/react-native/tinysns [13:55:06] <start> building dependency graph [13:55:06] <start> crawling file system [13:55:06] <start> loading bundles layout [13:55:06] <end> loading bundles layout (1ms) [hot module replacement] server listening on /hot react packager ready. error unable resolve root /users/rockyl/workspaces/react-native/tinysns: failed opendir(/users/rockyl/workspaces/react-native/tinysns): no such file or directory {"watchmanresponse":{"version":"4.4.0","error":"unable resolve root /users/rockyl/workspaces/react-native/tinysns: failed opendir(/users/rockyl/workspaces/react-native/tinysns): no such file or directory"}} error: unable resolve root /users/rockyl/workspaces/react-native/tinysns: failed opendir(/users/rockyl/workspaces/react-native/tinysns): no such file or directory @ ...

url - nginx rewrites paths proxied to node.js -

i'm trying make nodejs website/server download website when user goes url looking this: http://example.com/test/http://google.com the problem nginx rewriting req.url /test/http:/google.com when should /test/http://google.com app.js: var express = require('express'); var http = require('http'); var app = express(); app.configure(function(){ app.set('port', 8080); app.set('views', __dirname + '/app/server/views'); app.set('view engine', 'jade'); app.use(express.logger('dev')); app.use(express.bodyparser()); app.use(express.cookieparser()); app.use(express.session({ secret: 'super-duper-secret-secret' })); app.use(express.methodoverride()); app.use(require('stylus').middleware({ src: __dirname + '/app/public' })); app.use(express.static(__dirname + '/app/public')); app.enable('trust proxy') }); app.configure('development...

C# - initialize static class as non-static class? -

i have class: [datacontract] public class connection { [datamember] public string username { get; set; } public connection(string username) { username = username; } } now need class as-is, in part of project use class this: public static class connection { public static string username { get; set; } static connection() { } } is there way of merging code together, can use both versions of class in project (somewhere want have static, single instance of connection, somewhere else want have list of connections)? you can merge code this: [datacontract] public class connection { [datamember] public string username { get; set; } public connection(string username) { username = username; } public static connection default { get; set; } static connection() { default = new connection("username"); } } ... , use this: list<connection> connections = new li...

django - Exception occurred processing WSGI script -

i trying install open-source django application ( osqa ) error: [tue sep 24 10:37:09 2013] [error] mod_wsgi (pid=82486): exception occurred processing wsgi script '/home/fuiba/webapps/osqa/osqa.wsgi'. [tue sep 24 10:37:09 2013] [error] traceback (most recent call last): [tue sep 24 10:37:09 2013] [error] file "/home/fuiba/webapps/osqa/lib/python2.7/django/core/handlers/wsgi.py", line 232, in __call__ [tue sep 24 10:37:09 2013] [error] self.load_middleware() [tue sep 24 10:37:09 2013] [error] file "/home/fuiba/webapps/osqa/lib/python2.7/django/core/handlers/base.py", line 42, in load_middleware [tue sep 24 10:37:09 2013] [error] raise exceptions.improperlyconfigured('error importing middleware %s: "%s"' % (mw_module, e)) [tue sep 24 10:37:09 2013] [error] improperlyconfigured: error importing middleware django.contrib.sessions.middleware: "no module named base" this osqa.wsgi : import os import sys sys.path.ap...

android - How to programmatically retrieve the child drawable of an InsetDrawable that was defined in XML -

how can drawable object defined within insetdrawable using android:drawable or having inner <bitmap android:src> tag programmatically? i want have levellistdrawable child of insetdrawable , need call setlevel(int) on it. insetdrawable.getcurrent() returns insetdrawable object itself, not child drawable. because have multiple references inset drawable defined in xml files, cannot use ids identify drawable, need retrieve right drawable getcurrent() , getdrawable() method calls. statelistdrawable, levellistdrawable, layerdrawable approach works well. how can insetdrawables? check out source class. there no way drawable. it's contained inside static inner class insetstate , there no getter method it. classes in same package (android.graphics.drawable) potentially access it, you're out of luck.

vb.net - handing the OnCreated event of FileSystemWatcher -

i implemented event of filesystemwatcher : private shared sub oncreated(source object, e filesystemeventargs) if e.name.toupper() == "mytextfile.txt" ' code ' end if end sub is there way monitor if created files in textbox similar this? private shared sub oncreated(source object, e filesystemeventargs) if e.name.toupper.contains(textbox1.text) ' code ' end sub having more 1 file in multiline textbox , every filename in separate line requires should split filenames individually , check each 1 file created. private shared sub oncreated(source object, e filesystemeventargs) ' array of files @ each line , remove spurious empty lines dim files() = textbox1.text.split(new string() {environment.newline}, _ stringsplitoptions.removeemptyentries) dim newfile = e.name.toupper() each file in files if file.toupper() = newfile ' code ' ...

java - Unable to send message using smslib -

i using simado gdt11 modem , prolific usb serial port driver. new connection appears in device manager > ports list. however, unable send messages using smslib. i using basic class specified in smslib examples, there error states there no response device. have added polling parameters because of use of usb port no avail. commtest utility able connect same port, don't think port number issue. stacktrace: log4j:warn no appenders found logger (smslib). log4j:warn please initialize log4j system properly. log4j:warn see http://logging.apache.org/log4j/1.2/faq.html#noconfig more info. org.smslib.timeoutexception: no response device. @ org.smslib.modem.amodemdriver$charqueue.get(amodemdriver.java:535) @ org.smslib.modem.amodemdriver.getresponse(amodemdriver.java:338) @ org.smslib.modem.amodemdriver.getresponse(amodemdriver.java:313) @ org.smslib.modem.athandler.athandler.getsimstatus(athandler.java:145) @ org.smslib.modem.amodemdriver.connect(amodemdriver.java:132) ...

c# - How to Add new rows programmatically to my WebDataGrid -

kindly let me know if possible add multiple row when clicking button event in infragistics webdatagrid. thanks datagrid.rows.add("value column1","value column2","value column3"); you can also... datagrid.rows[rowindex].cells[celindex].value = "your value"; and that's it.

sql - Some sqlplus errors -

when run following code, select count_ee_cnum.counts + count_eefaculty.counts + count_cs_cnum.counts + count_cs_faculty.counts ( select count(ex.cnum) counts enrolled ex ex.cnum in ( select distinct ex.cnum faculty fx, faculty fy, class cx, class cy, enrolled ex, enrolled ey fx.dept = 'ee' , fy.dept = 'cs' , cx.fid = fx.fid , cy.fid = fy.fid , ex.cnum = cx.cnum , ey.cnum = cy.cnum)) count_ee_cnum, (select count(fx.dept) counts faculty fx fx.dept = 'ee') count_ee_faculty, (select count(ey.cnum) counts enrolled ey ey.cnum in ( select distinct ey.cnum faculty fx, faculty fy, class cx, class cy, enrolled ex, enrolled ey fx.dept = 'ee' , fy.dept = 'cs' , cx.fid = fx.fid , cy.fid = fy.fid , ex.cnum = cx.cnum , ey.cnum = cy.cnum)) count_cs_cnum, (select count(fy.dept) counts faculty fy fy.dept = 'cs') count_cs_faculty; the sqlplus gives me error says where fy.d...

python - Convert hybrid nested list into linear dict -

given nested list: [1, (1, 2), [3, 4], {5: 6}] , write program make element of these element key , position of these elements value. my code: (read comments) #!/usr/bin/python def code(lst): ''' lst: nested hybrid list! type: list returns: linear dict ''' d = {} try: i, l in enumerate(lst): if isinstance(l, list): # know lists unhashable e in l: d[e] = elif isinstance(l, dict): # know dicts unhashable e in l.items(): d[e[0]] = d[e[1]] = else: d[l] = except typeerror, e: print "invalid key!" print "check nested values" except exception, e: # 1 should catch every possible exception else code fault printf "my code fault!" return d and working ! call: print code([1, (1, 2), {3: 4}, [5, 6]]) output...

r - Specifying `curve` plot height? -

Image
i have following code generates 4 plots, end squished (see image below). how fix this? par(mfrow=c(2,2)) curve(.5*exp(-.5*x),from=0,to=10,main="f(x)") curve(.25*exp(-.25*x),from=0,to=10,main="f(y)") curve(1-exp(-.5*x),from=0,to=10,main="f(x)") curve(1-exp(-.25*x),from=0,to=10,main="f(y)") three options: 1) use par(mar=c(bottom, left, top, right)) specify respective margins. 2) increase total output size , automatically increase plot size. 3) use ggplot facet_wrap , allow share axes maximize space.

xml - Send request for bank transactions using Open Financial Exchange (ofx) with PHP -

i want learn how download bank transactions using open financial exchange (ofx) file format. send request website using php. i have not found php examples of using ofx file format send request connect bank in order download bank transactions. have been able find examples of parsing data returned. i have found websites www.ofxhome.com provide urls (and other bank information) connect banks. not know how send request bank using ofx file format. for example, using information ofxhome.com link... http://www.ofxhome.com/index.php/institution/view/472 how can send request bank using ofx format , php? , how save ofx file returned may parse , use information returned? many help! update: found working example. looking for, ofx request using php. here link: http://www.ofxhome.com/ofxforum/viewtopic.php?id=47419 according ofx api documentation ( http://www.ofxhome.com//api.txt ) use xml. you may want research following: curl grab data api http://php.net/manual/en/boo...

scala - Application crashes after upgrading to play 2.2 -

after upgrading play 2.2, following error: org.xml.sax.saxnotrecognizedexception: feature 'http://javax.xml.xmlconstants/feature/secure-processing' not recognized. @ org.apache.xerces.parsers.abstractsaxparser.setfeature(unknown source) @ org.apache.xerces.jaxp.saxparserimpl.setfeatures(unknown source) @ org.apache.xerces.jaxp.saxparserimpl.<init>(unknown source) @ org.apache.xerces.jaxp.saxparserfactoryimpl.newsaxparserimpl(unknown source) @ org.apache.xerces.jaxp.saxparserfactoryimpl.setfeature(unknown source) @ play.api.play$.<init>(play.scala:45) @ play.api.play$.<clinit>(play.scala) @ play.core.server.nettyserver$$anonfun$12.apply(nettyserver.scala:152) @ play.core.server.nettyserver$$anonfun$12.apply(nettyserver.scala:151) @ scala.option.foreach(option.scala:236) @ play.core.server.nettyserver.<init>(nettyserver.scala:151) @ play.core.server.nettyserver$$anonfun$maindev$1.apply(nettyserver.scala:310) @ play.core.server.nettyserver$$anonfun$ma...

Rails + Devise HTTP header token -

i have in devise config following line enable token authentication in http header: config.http_authenticatable = [:token] however, whenever try access resource, receive 401 when running following: curl -v -h "accept: application/json" -h "content-type: application/json" -h "authorization: token token=\"c9g52z6n6lpgt5ls6omw\"" http://localhost:3000/api/v1/objects/ as proof token correct, following works: curl -v -h "accept: application/json" -h "content-type: application/json" http://localhost:3000/api/v1/objects?auth_token=c9g52z6n6lpgt5ls6omw has managed token authentication in http header working? can't find information on apart from: http://api.rubyonrails.org/classes/actioncontroller/httpauthentication/token.html https://groups.google.com/forum/#!topic/plataformatec-devise/o3gqgl0yuzo my implementation based on post , gist . user.rb class user < activerecord::base devise :database...

sql server - SQL Query using Partition By -

i have following table name jobtitle jobid lanaguageid ----------------- 1 1 1 2 1 3 2 1 2 2 3 4 4 5 5 2 i selecting records table except duplicate jobid's count > 1. selecting 1 record/first row duplicate jobid's. passing languageid paramter stored procedure , want select duplicate jobid languageid along other records also. if have passed languageid 1 output should come follows jobid lanaguageid ----------------- 1 1 2 1 3 4 4 5 5 2 i have tried using following query. with cte_rn ( select row_number() over(partition jobtitle.jobid order jobtitle.jobtitle) rn jobtitle inner join jobtitle_lang on jobtitle.jobtitleid = jobtitle_lang.jobtitleid ) but unable use clause in above query. different approch should followed. or else how can modify query desired output with cte_rn ( select jobid, lanaguageid, row_numbe...

javascript - Accessing POST variables in Mongoose model -

using mean stack (mongodb, expressjs, angularjs, , nodejs) mongoose, i'm setting simple registration form include email address , password fields, among others. i'm including password confirmation field ensure users know they've typed before completing registration. pretty typical. however, can't figure out how access posted form variables in model if they're not included in schema. don't want write password confirmation field's data db, use validation. have no doubt it's trivial issue, i've found searching has used fields included in schema, i've got handle on. i'm assuming need write schema method, , maybe virtual, how value of confirmpassword field? if brighter yours point me in right direction, i'd obliged. here's have far (note: omitted other controller methods, dependency declarations, etc. brevity): signup.jade (form) form.signup(action="/users", method="post") .control-group label.c...

javascript - Fade out/in two divs at different times on scroll -

basically i'm looking replicate similar effect site: http://www.falve.co.nz/collection/ when scroll down nav fades out pretty quickly, continue scroll hero text gently fades out according scroll position. when scroll top fade in again, hero text first nav. i'm trying replicate code below not work: // global vars var $artheaderinner = $('#scene'); var $nav = $('#prim'); var windowscroll; // functional parallaxing calculations function slidingtitle() { //get scroll position of window windowscroll = $(this).scrolltop(); //slow scroll of .art-header-inner scroll , fade out $artheaderinner.css({ 'margin-top' : -(windowscroll/3)+"px", 'opacity' : 1-(windowscroll/550) }); //fade .nav out $nav.css({ 'opacity' : 1-(windowscroll/400) }); }

razor - Checkbox and Hidden field in ASP.NET MVC -

html.checkboxfor generates hidden field false value , reasonable. need implement form http method. true , false values being sent server when submit form. problem mvc model binder cannot understand "true,false" value. the parameter conversion type 'system.string' type 'system.boolean' failed. see inner exception more information. how can workaround issue? actually problem in mvccontribgrid. see question: mvccontrib grid , checkboxes it combines query string values http://contoso.com?checkboxval=true,checkboxval=false http://contoso.com?checkboxval=true,false

rest - How to catch a 401 (or other status error) in an angular service call? -

using $http can catch errors 401 easily: $http({method: 'get', url: 'http://localhost/blog/posts/index.json'}). success(function(data, status, headers, config) { $scope.posts = data; }). error(function(data, status, headers, config) { if(status == 401) { alert('not auth.'); } $scope.posts = {}; }); but how can similar when using services instead. how current service looks: mymodule.factory('post', function($resource){ return $resource('http://localhost/blog/posts/index.json', {}, { index: {method:'get', params:{}, isarray:true} }); }); (yes, i'm learning angular). solution (thanks nitish kumar , contributors) in post controller calling service this: function phonelistctrl($scope, post) { $scope.posts = post.query(); } //phonelistctrl.$inject = ['$scope', 'post']; as suggested selected answer, i'm calling , works: function phonelistctrl($scope, ...

javascript - JSON.parse failing without reason -

i using nodejs, , following json.parse failing cant work out why: > s[0] '[["hands[0].session.buyin", "332"]]' > json.parse(s[0]); syntaxerror: unexpected token  @ object.parse (native) @ repl:1:6 @ replserver.self.eval (repl.js:110:21) @ repl.js:249:20 @ replserver.self.eval (repl.js:122:7) @ interface.<anonymous> (repl.js:239:12) @ interface.eventemitter.emit (events.js:95:17) @ interface._online (readline.js:202:10) @ interface._line (readline.js:531:8) @ the string in question has been loaded file. if copy past string console works, suspicion might way file encoded, cant work out what. json.parse's error messages distinctly unhelpful. it seem string includes byte-order mark . > s[0].charcodeat(0).tostring(16) 'feff' you'll have strip that out before json.parse() can manage rest. > json.parse(s[0].trim()) [ [ 'hands[0].session.buyin', '332...

ajax - Displaying Plone folder_rename_form with Diazo -

i have <notheme if="$ajax_load" /> in rules.xml, find have add <notheme if-path="folder_rename_form/" /> rename overlay actions menu display. rule, if go folder_contents, select item , hit rename there, unthemed page. rule can use have rename working in both places? i pulling in #portal-column-content, #content there.

php - How can I generate different color lines for each row added on a table generated from SQL? -

as code generates every line same color, how can make add darker shade every other line? i.e.: white beige white beige white beige so becomes more readable format. code below: if(mysql_num_rows($result) > 0){ while($row = mysql_fetch_array($result)){ $invoiceitemssql = mysql_query('select * tblinvoiceitems invoiceid = '.$row['id'].' limit 0,1'); $invoiceitems = mysql_fetch_array($invoiceitemssql); $html .= '<tr> <td><a href="invoices.php?action=edit&id='.$row['id'].'">'.$row['id'].'</a></td> <td>'.$row['firstname'].'</td> <td>'.$row['lastname'].'</td> <td>'.$row['companyname'].'</td> <td>'.$row['city'].'</td> <td>'.$row['phonenumber'].'...

NoClassDefFoundError when running java program in linux/ubuntu -

i'm unable run java program in linux/ubuntu. i've been working on problem whole day , can't seem find solution. wrote small java program using eclipse on windows 7 machine , works fine. here's code: //start of java program jsonreader package jsonreader; //imports needed run program import java.io.filenotfoundexception; import org.codehaus.jackson.map.*; import org.codehaus.jackson.*; in order import org.codehause.jackson.. work, had manually include in project jar file: jackson-all-1.9.11.jar //class jsonreader public class jsonreader { //start of main public static void main (string[] args) throws filenotfoundexception { the rest of program works fine. the next step project run on ubuntu - command line. did export on eclipses: file -> export -> general -> archive file -> , created zip file. this zip file transferred linux/ubuntu enviornment. there, unzipped file. directory structure: in home directory hav...

java - Sort subarrays according to their first element -

i have array of objects, let's each object of type grid. each grid object has x , y coordinates, grid temp = new grid(3, 5); // temp.x returns x, temp.y returns y. now have few arrays of grid grid[] thearray1 = new grid[5]; grid[] thearray2 = new grid[5]; grid[] thearray3 = new grid[5]; i fill arrays grid objects , sort them using arrays.sort. i join sorted arrays form thearray length 5+5+5=15. i want sort thearray first element of "subarrays" (elements 0, 5 , 10 in thearray) how achive this? also, if there simpler way achieve same result, nice. have start 3 arrays since gotten through iteration of for-loop. edit: example: let's sort x coordinated, smaller first. i'll make each grid[] of length 3 instead of 5 simplicity. grid[] thearray1 = new grid[]{new grid(2, 1), new grid(4, 1), new grid(0, 1)}; grid[] thearray2 = new grid[]{new grid(4, 2), new grid(3, 1), new grid(7, 1)}; grid[] thearray3 = new grid[]{new grid(1, 7), new grid(5, 3), n...