Posts

c++ - Checking for collision -

i'm coding game our final project in our major using allegro issues collision. game battleships , did after loading screen, screen appear wherein can select coordinates of ships using arrow keys , lock space bar. , if coordinates chose occupied space bar doesn't work. my problem can't check ships' length , width collision before placing. ships length , width considered when you've placed ship , next ship can overlap other ships. i've tried issues. , not part of grid cannot chosen though it's empty. void shipplacement(){ //something cursor ship placement shipx = 0; shipy = 0; while(!placed) { allegro_event ev; al_wait_for_event(prepqueue, &ev); if(ev.type == allegro_event_key_down) { switch(ev.keyboard.keycode) { case allegro_key_up: key[key_up] = true; break; case allegro_key_down: key[key_down] = true; break; case allegro_key_left: key[key_left] = ...

Constructing do while loop to handle account numbers not working C++ -

i'm trying use while loop evaluate account numbers. valid account number has have 5 digits , start letters r or b, not case sensitive. valid account number examples: r90000 b10101 r88888 b77777 invalid account number examples: y90000 r888822 this loop i've made, , can't figure out what's wrong parameters that's causing repeat on , on again, never excepting account number. char accounttype; int accountnum; cout << "please enter account number." <<endl; cout << ">> "; cin >> accounttype >> accountnum; cout <<endl; { cout << "that not valid account number. please enter account number." <<endl; cout << ">> "; cin >> accounttype >> accountnum; cout <<endl; }while ( (accountnum <= 9999) || (accountnum >= 100000) && (accounttype != 'r') || (accounttype != 'r') || (accounttype != 'b')...

c# - How to create crystal report for an invoice which has many items -

Image
i want make crystal report invoice have many items shown below: but, problem if invoice have many items, invoice number repeating item. when create report in access same database report show image above. please me this. i working on visualstudio c#

android - activity.finish() is not stopped current activity -

i have created android apps using async task call web service, when authentication fail, user stop current activity , redirect login page. my problem when user redirect login page, toast text still showing, toast text under async thread onpostexceute() event. any solution problem? in webservice.cs catch (unauthorizedexception ua) { log.d(tag, ua.getmessage()); intent intent = new intent(activity, loginactivity.class); if(condition a){ intent.putextra("toast_text", r.string.a); }else{ intent.putextra("toast_text", r.string.b); } activity.finish(); activity.startactivity(intent); } return null; then in asynctask.cs protected jsonarray doinbackground(string... parameters) { connectivitymanager cm = (connectivitymanager) singleformactivity.this.getsystemservice(context.connectivity_service); networkinfo activenetwork = cm.getactivenetwork...

jquery - Change Css Class of Same Id which is more than one Id with same name in html page -

i want change css class same id appear more 1 in page. try when there 2 id same name reflect first id not other. i try: view page : <i id="{{obj.id}}"></i> controller $(getjson.id).removeclass('busy b-white bottom'); $(getjson.id).addclass('on b-white bottom'); so, how can achieve ? ► first of id must unique. when ever using id same name , try use class instead of that. your solution $('[id='+getjson.id+']').removeclass('busy b-white bottom').addclass('on b-white bottom'); this simple method tho select elements same id. $('[id=test]').removeclass('yellow').addclass('red') .yellow{ background-color:yellow; } .red{ background-color:red; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <p id="test" class="yellow">q</p> <p id="test" clas...

sql - Parse.com: Performing "SELECT FROM - INSERT INTO" operations in Classes -

i'm making changes in classes estructure in parse.com (before migration own sever). need move masively information 1 table another: i need query information user class i must insert result of step 1 in vehicles class if sql, like: insert vehicles (veh_brand, veh_line, veh_model, veh_cap) (select veh_brand, veh_line, veh_model, veh_cap user); is there way perform operation? i'm not understanding weel parse.com documentation. must run operation? thanks in advance. remove values keyword insert vehicles (veh_brand, veh_line, veh_model, veh_cap) select veh_brand, veh_line, veh_model, veh_cap user

wordpress responsive theme or twitter bootstrap -

i have been reading twitter bootstrap quite while now. gives pre-made functionality many things using css classes, can create anything. along lot of jquery plugins integrated in package. on other hand see there theme name responsive available in wordpress gives same functionality. confused choose should choose upcoming-project. going use wordpress project. need know following. which 1 easy learn? responsive documentation doesn't seem user friendly. is fine use bootstrap in wordpress theme? have customization responsive if use bootstrap ? will using responsive give me benefit on bootstrap , in future how can reuse responsive theme. i don't know responsive theme or types of customization referring to. while can't speak specific theme, can few things bootstrap. bootstrap offers lots of flexibility when comes responsive layout witnessed in docs . can use fixed or fluid layouts , nest , offset content. bootstrap offers lot of flexibility in aesth...