Search Results

Search found 58 results on 3 pages for 'harsha k'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Platform game collisions with Block

    - by Sri Harsha Chilakapati
    I am trying to create a platform game and doing wrong collision detection with the blocks. Here's my code // Variables GTimer jump = new GTimer(1000); boolean onground = true; // The update method public void update(long elapsedTime){ MapView.follow(this); // Add the gravity if (!onground && !jump.active){ setVelocityY(4); } // Jumping if (isPressed(VK_SPACE) && onground){ jump.start(); setVelocityY(-4); onground = false; } if (jump.action(elapsedTime)){ // jump expired jump.stop(); } // Horizontal movement setVelocityX(0); if (isPressed(VK_LEFT)){ setVelocityX(-4); } if (isPressed(VK_RIGHT)){ setVelocityX(4); } } // The collision method public void collision(GObject other){ if (other instanceof Block){ // Determine the horizontal distance between centers float h_dist = Math.abs((other.getX() + other.getWidth()/2) - (getX() + getWidth()/2)); // Now the vertical distance float v_dist = Math.abs((other.getY() + other.getHeight()/2) - (getY() + getHeight()/2)); // If h_dist > v_dist horizontal collision else vertical collision if (h_dist > v_dist){ // Are we moving right? if (getX()<other.getX()){ setX(other.getX()-getWidth()); } // Are we moving left? else if (getX()>other.getX()){ setX(other.getX()+other.getWidth()); } } else { // Are we moving up? if (jump.active){ jump.stop(); } // We are moving down else { setY(other.getY()-getHeight()); setVelocityY(0); onground = true; } } } } The problem is that the object jumps well but does not fall when moved out of platform. Here's an image describing the problem. I know I'm not checking underneath the object but I don't know how. The map is a list of objects and should I have to iterate over all the objects??? Thanks

    Read the article

  • Correct way to inject dependencies in Business logic service?

    - by Sri Harsha Velicheti
    Currently the structure of my application is as below Web App -- WCF Service (just a facade) -- Business Logic Services -- Repository - Entity Framework Datacontext Now each of my Business logic service is dependent on more than 5 repositories ( I have interfaces defined for all the repos) and I am doing a Constructor injection right now(poor mans DI instead of using a proper IOC as it was determined that it would be a overkill for our project). Repositories have references to EF datacontexts. Now some of the methods in the Business logic service require only one of the 5 repositories, so If I need to call that method I would end up instantiating a Service which will instatiate all 5 repositories which is a waste. An example: public class SomeService : ISomeService { public(IFirstRepository repo1, ISecondRepository repo2, IThirdRepository repo3) {} // My DoSomething method depends only on repo1 and doesn't use repo2 and repo3 public DoSomething() { //uses repo1 to do some stuff, doesn't use repo2 and repo3 } public DoSomething2() { //uses repo2 and repo3 to do something, doesn't require repo1 } public DoSomething3() { //uses repo3 to do something, doesn't require repo1 and repo2 } } Now if my I have to use DoSomething method on SomeService I end up creating both IFirstRepository,ISecondRepository and IThirdRepository but using only IFirstRepository, now this is bugging me, I can seem to accept that I am un-necessarily creating repositories and not using them. Is this a correct design? Are there any better alternatives? Should I be looking at Lazy instantiation Lazy<T> ?

    Read the article

  • php programming

    - by HARSHA
    Hi, i am learning php,i downloded the xampp.and Apache server,Mysql are running properly in Xampp Control panel. I tried with a simple program that is hello world,i created a new folder in htdocs, and i saved my program in that new folder with .php extention. But when i run the program then is showing a error as follows ------ Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404 localhost 18-5-2010 11:51:44 Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1

    Read the article

  • Where can I legally obtain the 64bit version of Windows 8?

    - by Harsha K
    No, I am not looking to pirate. I bought a key through the Upgrade assistant (for just $15 due to the upgrade offer), but it downloaded an iso file that was between 2.3 and 2.5 GB. Which doesn't make sense to me, because the Evaluation version of Windows 8 x64 is closer to 3.4 GB in size. I assumed the Upgrade Assistant would be intelligent enough to realize that it is being run on a Windows 7 x64 machine and by extension, download the x64 code. Previously, I was able to legally download the ISOs (sans the keys, of course) from the Digital River host. I do not see an option to do that. I'm not interested in risking downloading a tampered ISO. I want to do it through Microsoft channels, but I just don't see how. As you may imagine, search terms such as "Windows 8 official download link" result in a plethora of obviously spyware infested piracy sites. If there's any non-exposing way for me to prove that I have legally purchased Windows and I'm genuinely looking for this answer, please let me know. For reference to what I am looking for it is similar to the answer given in this question for Windows 7: Where do I download Windows 7 (legally from Microsoft)?

    Read the article

  • Using unmanaged code from managed code

    - by Harsha
    Hi I have my project developed in MFC which is unmnaged code. Now i need to create a similar application in C#, by reusing most of the MFC classes. Is it possible to directly export class/struct/enum from MFC dll, so that i can import it in my C# using dllimport and use it.?

    Read the article

  • USB to Serial cables with CDC support

    - by Harsha
    Hi all, Are there are USB to Serial cables with CDC support? I recently bought these below mentioned cables which claims that they are CDC 1.1 complaint. However, when we received the cables on our verification we found that they were reporting vendor specific device descriptors. Manufacturer Barcode Part Number Quantity Link CABLEMAX 45643276422244 USB-1S1PQ 4 http://www.usbgear.com/USB-1S1PQ.html CABLEMAX USBG-US-232 USBG-US-232 4 linkhttp://www.usbgear.com/USBG-US-232.html linkhttp://www.made-in-china.com/showroom/trankoo/product-detailebsQoMuKExrj/China-USB-To-RS232-Cable.html Has anyone used USB to Serial cables with CDC support? Please advise! Thanks for your help.

    Read the article

  • USB Serial cable with CDC support

    - by Harsha
    Hi All, I bought a USB to Serial cable which claims to be CDC compliant. But the bInterfaceClass value in interface descriptor is 0xFF(which is vendor specific). I was expecting it to be 0x02 (Communications and CDC control). In the device manager, i found that the drivers being loaded are ser2pl.sys and serenum.sys. I had learnt usbser.sys is the windows CDC driver, but it was not loaded for my cable. I am pretty much new to this CDC, so i have following questions 1.Does this indicate that the cable is not CDC compliant 2.Can i make this cable CDC compliant (since CDC is a driver functionality), by loading usbser.sys. If yes how?

    Read the article

  • USB Endpoint Stalled Error

    - by Harsha
    Hi All, I am getting "endpoint stalled error" in my CDC device. The usb stack is detecting the cable. The state is set as running but the errorcode is set as 0x11 which indicates 'USB_ENDPOINT_STALLED'. I verified and found that the endpoints has been assigned properly. What would be scenarios when "endpoint stalled error" would be reported? How to handle this? Please advise!

    Read the article

  • MFC Dll with COM Interface

    - by Harsha
    Hi All, I am pretty new to managed/unmanaged interoperability and COM concepts. I received a suggestion of using COM Interop, for using my existing MFC code in C#. But the problem for me is, i have a MFC Dll which is not a valid COM component. How to make this MFC DLLs to have COM-accessible interfaces ready for use in .NET. I tried to search for any settings to make it COM accessible, but was not able to understand any!! Any suggestions or ideas are welcome. Thanks a lot!

    Read the article

  • Image Viewer application, Image processing with Display Data.

    - by Harsha
    Hello All, I am working on Image Viewer application and planning to build in WPF. My Image size are usually larger than 3000x3500. After searching for week, I got sample code from MSDN. But it is written in ATL COM. So I am planning to work and build the Image viewer as follows: After reading the Image I will scale down to my viewer size, viwer is around 1000x1000. Lets call this Image Data as Display Data. Once displaying this data, I will work only this Display data. For all Image processing operation, I will use this display data and when user choose to save the image, I will apply all the operation to original Image data. My question is, Is is ok to use Display data for showing and initial image processing operations.

    Read the article

  • How to use jasper reports to print something only on the first page ?

    - by Harsha
    How to use jasper reports to print something only on the first page. I am using jasper reports for printing invoices and only on the 1st page I need to print the Remit Payment To section with the address following it. Customer address is also present there. The way it is currently designed is that this goes into pageFooter section and we use printWhenExpression(PAGE_NUMBER = 1) so that this only gets printed on the 1st page of the invoice. But the downside of this approach is that the jasper engine reserves the size equivalent of the page footer on all the other pages (1..n) of the invoice. So we are able to use only about 2/3 rd of all pages. Remaining 1/3rd page which is for page footer is blank for all pages except the 1st page. This increases the number of pages. Any ideas for fixing this issue?

    Read the article

  • Image Viewer application, Image processing with Dispaly Data.

    - by Harsha
    Hello All, I am working on Image Viewer application and planning to build in WPF. My Image size are usually larger than 3000x3500. After searching for week, I got sample code from MSDN. But it is written in ATL COM. So I am planning to work and build the Image viewer as follows: After reading the Image I will scale down to my viewer size, viwer is around 1000x1000. Lets call this Image Data as Display Data. Once displaying this data, I will work only this Display data. For all Image processing operation, I will use this display data and when user choose to save the image, I will apply all the operation to original Image data. My question is, Is is ok to use Display data for showing and initial image processing operations.

    Read the article

  • What permissions are required to create a new work item type in TFS

    - by harsha
    I am new to creating work item types in TFS and want to create a new Work Item type. I looked at work item template option, but that is not sufficient for me. I need to add few new fields and have a customized form. From search I got information about Work Item Type definition but I am looking for some detailed example. Also I would like to know the permissions needed to add a new work item type. I got administrator privileges for my project, but not on TFS as a whole. With that can I add a new template for my project. Please provide me direction.

    Read the article

  • Console appliction with Multithreading on Single core.

    - by Harsha
    Hello all, I am reposting my question on Multithreading on Single core processor. Original question is: http://stackoverflow.com/questions/2856239/will-multi-threading-increase-the-speed-of-the-calculation-on-single-processor I have been asked a question, At any given time, only one thread is allowed to run on a single core. If so, why people use multithreading in a application. Lets say you are running console application and It is very much possible to write the application to run on the main thread. But still people go for multithreading.

    Read the article

  • How to use facebook connect with cakephp ?

    - by Harsha M V
    I am trying to integrate facebook connect with my cakephp application. i am not sure how facebook conenct works. can some one guide me over this. or provide me links to some tutorial. is there particular fields that you should have to get the facebook connect to work ?

    Read the article

  • Rating System Database Structure

    - by Harsha M V
    I have two entity groups. Restaurants and Users. Restaurants can be rated (1-5) by users. And rating fromeach user should be retrievable. Resturant(id, name, ..... , total_number_of_votes, total_voting_points ) User (id, name ...... ) Rating (id, restaurant_id, user_id, rating_value) Do i need to store the avg value so that it need not be calculated every time ? which table is the best place to store avg_rating, total_no_of_votes, total_voting_points ?

    Read the article

  • Display numbers from 1 to 100 without loops or conditions

    - by Harsha
    Is there a way to print numbers from 1 to 100 without using any loops or conditions like "if"? We can easily do using recursion but that again has an if condition. Is there a way to do without using "if" as well? Also no repetitive print statements,or a single print statement containing all the numbers from 1 to 100. A solution in Java is preferable.

    Read the article

  • Query having 2 Where Clause

    - by Harsha M V
    i am trying to login and want to validate username and password against the records in the database. I am not sure how to pass two Where clause public Boolean login(String username, String password) throws SQLException { Cursor mCursor = db.query(TABLE_USERS, new String[] { ID, KEY_NAME, KEY_USERNAME}, KEY_USERNAME + "=" + "'"+username+"'", KEY_PASSWORD + "=" + "'"+password+"'", null, null, null, null, null); if (mCursor.moveToFirst()) { return true; } return false; } Am getting a Syntax Error.

    Read the article

  • Getting All categories in external page.

    - by Harsha
    This is very basic magento question i guess. I want to first get all the store categories, then loop through them to get their sub-categories and products and similarly continue till the last sub-category. I will be using this in an external page having Mage::app() declared at the top of the page. I am not aware of the Magento API's(if thats wat they are called) to use to get this functionality. Remember I am not using this in any of the templates, so something like getCurrentCategory() will not work here i guess. Also please guide if there are any good resources to search for particular functionality in magento and API's to implement it, or am i doomed to go through their phpdoc to know the list of methods. Any help here will be greatly appreciated, Thanks.

    Read the article

  • Your favorite time-off between programming.

    - by Harsha
    I am sure all coding pundits here will have one (or multiple) ways of spending some time-off between hectic coding sessions just to relax. Would love to hear from you all as I am a newbie and want to take little breaks (non-physical) from coding and do things which actually help me focus again. Thanks.

    Read the article

  • How to delete child table records during the update of parent table using Hibernate

    - by Harsha
    I have a Parent Table A and child tables B,C with many to one relations. Lets say I have data like, for primary key 1 in parent table A I have 3 rows in child table B and 4 rows in child table C. Now if I want to delete the rows of the child table during an update of the parent table(that means Now, I want to update the table only with one row in each child tables and delete the other rows in them) then how to handle this scenario in hibernate?

    Read the article

< Previous Page | 1 2 3  | Next Page >