Daily Archives

Articles indexed Monday October 29 2012

Page 2/15 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Where should I draw the line between unit tests and integration tests? Should they be separate?

    - by Earlz
    I have a small MVC framework I've been working on. It's code base definitely isn't big, but it's not longer just a couple of classes. I finally decided to take the plunge and start writing tests for it(yes, I know I should've been doing that all along, but it's API was super unstable up until now) Anyway, my plan is to make it extremely easy to test, including integration tests. An example integration test would go something along these lines: Fake HTTP request object - MVC framework - HTTP response object - check the response is correct Because this is all doable without any state or special tools(browser automation etc), I could actually do this with ease with regular unit test frameworks(I use NUnit). Now the big question. Where exactly should I draw the line between unit tests and integration tests? Should I only test one class at a time(as much as possible) with unit tests? Also, should integration tests be placed in the same testing project as my unit testing project?

    Read the article

  • How to survive if you can only do things your way as a programmer?

    - by niceguyjava
    I hate hibernate, I hate spring and I am the kind of programmer who likes to do things his way. I hate micro-management and other people making decisions for me about what framework I should use, what patterns I should apply (hate patterns too) and what architecture I should design. I consider myself a successful programmer and have a descent financial situation due to my performance in past jobs, but I just can't take the standard Java jobs out there. I really love to design things from scratch and hate when I have to maintain other people's bad code, design and architecture, which is the majority you find out there for sure. Does anybody relate to that? What do you guys recommend me? Open up my on company, do consulting, or just keep looking hard until I find a job that suits my preferences, as hard as this may look like with all the hibernate and spring crap out there?

    Read the article

  • Big Oh notation does not mention constant value

    - by user883561
    I am a programmer and have just started reading Algorithms. I am not completely convinced with the notations namely Bog Oh, Big Omega and Big Theta. The reason is by definition of Big Oh, it states that there should be a function g(x) such that it is always greater than or equal to f(x). Or f(x) <= c.n for all values of n n0. My doubt is the why dont we mention the constant value in the definition? For example. lets say a function 6n+4, we denote it as O(n). but its not true that the definition holds good for all constant value. this holds good only when c = 10 and n = 1. For lesser values of c than 6, the value of n0 increases. So why we do not mention the constant value as a part of the definition.

    Read the article

  • Open source ASP.NET MVC project for a SaaS application

    - by DotnetDude
    I am working on a personal project that offers a service online. I'd like put this out to the public. I don't want to reinvent the wheel and use an existing template/open source project and add my service specific functionality. The features I am looking for are: Support for different roles (I need to have an admin role, customer and preferred customer roles) An admin section where admins can manage user accounts, login as with users credentials for providing support Customer pages that are role specific (Ex: Some functionality can be used by preferred customers but not non preferred ones) Preferably a pricing/plans page with payment gateway integration These are some of the basic pages available in most of service sites online. Is there a MVC 3 (preferably 4) written in C# that I can use as a shell to build upon? Thanks

    Read the article

  • Is there any text editor for windows which can save files with code highlight for viewing

    - by user1713836
    I want some software for Windows where I can save code snippets and other daily usable commands in one file. Everyday I find some small code snippets which I want to save in a single file. Just like we have code snippet savers online, I want something offline on Windows, basically with all the features Microsoft Word has, but with code highlight. It should be lightweight like Notepad++. I mean if I select the code and then press some button, it should change the color according to the language. Currently I use Notepad++, but in it, I can't select small code snippets on one page. It either highlights the entire file or nothing.

    Read the article

  • Why do memory-managed languages retain the `new` keyword?

    - by Channel72
    The new keyword in languages like Java, Javascript, and C# creates a new instance of a class. This syntax seems to have been inherited from C++, where new is used specifically to allocate a new instance of a class on the heap, and return a pointer to the new instance. In C++, this is not the only way to construct an object. You can also construct an object on the stack, without using new - and in fact, this way of constructing objects is much more common in C++. So, coming from a C++ background, the new keyword in languages like Java, Javascript, and C# seemed natural and obvious to me. Then I started to learn Python, which doesn't have the new keyword. In Python, an instance is constructed simply by calling the constructor, like: f = Foo() At first, this seemed a bit off to me, until it occurred to me that there's no reason for Python to have new, because everything is an object so there's no need to disambiguate between various constructor syntaxes. But then I thought - what's really the point of new in Java? Why should we say Object o = new Object();? Why not just Object o = Object();? In C++ there's definitely a need for new, since we need to distinguish between allocating on the heap and allocating on the stack, but in Java all objects are constructed on the heap, so why even have the new keyword? The same question could be asked for Javascript. In C#, which I'm much less familiar with, I think new may have some purpose in terms of distinguishing between object types and value types, but I'm not sure. Regardless, it seems to me that many languages which came after C++ simply "inherited" the new keyword - without really needing it. It's almost like a vestigial keyword. We don't seem to need it for any reason, and yet it's there. Question: Am I correct about this? Or is there some compelling reason that new needs to be in C++-inspired memory-managed languages like Java, Javascript and C#?

    Read the article

  • Ubuntu runs really slow on netbook

    - by Tim
    so I installed Ubuntu through Wubi in my netbook (Compaq Mini, 1.6 GHZ Atom, 1 GB RAM, 250 HDD, Windows 7 Starter) and decided to keep the original OS and run both... The thing is that, after I installed Ubuntu (really hyped: a couple of friends told me this OS was amazing, much faster and eaiser to use than Windows) and selecting it from the boot menu, I find that it runs really slow, sometimes freezing for a sec... For what I know, there must me be a partition in C:/ and a lot of HDD space for the Installation Size to make things faster, but I am sure I got those things right... Any help?? Also, why doesn't Wubi ask you for the DVD or bootable USB drive?? I'm just new in all this guys...

    Read the article

  • I have a ESXi 5.0 installed and when I am Installing Ubuntu Server 12.04 LTS it is giving an error saying grub installation failed?

    - by Rishee
    I have a ESXi 5.0 installed and when I am Installing Ubuntu Server 12.04 LTS (32 bit) it is giving an error saying grub installation failed? Please check the below screenshot of the error. I have other Ubuntu servers running fine on this esxi server, so I don't think problem is with ESXi. I have 32 GB of ram spare on this ESXi and have given 2 GB of RAM to this 12.0 LTS VM. I have given 2 cores of processor. I have tried supplying different ISO Image to this VM as I thought the 1st image that I downloaded has errors.. But defiantly that's not the case as all 3 different ISO images that I downloaded of Ubuntu server 12.04 LTS (32-bit) can't be corrupt!! Just to make sure that the Image does not have problem I used that Image to install it for testing on stand alone system. it works fine there!! This is a production ESXi server with which I can't play with, how ever I can play whith the Ubuntu Server 12.04 LTS (32-Bit) VM that we have created on that ESXi. I need help on this as soon as possible. go live date of this server is really close. (This Question is already there on Super user and Server Fault.)

    Read the article

  • Upgrade to 12.04 LTS failed, unable to boot

    - by stargazergal
    I was trying to upgrade to 12.04 LTS, but the upgrade froze in the process (it was stuck for over 8 hours) and I had to do a hard reboot. Now when I boot up, I get the following: mountall /lib/x86_64-linux-gnu/libc.so.6 version 'glibc_2.14' not found. I'm not sure what I need to do from here. Do I need to go back to the previous version? Or can 12.04 still be installed? I don't want to lose any of my files. I am still new to Linux, so please give detailed step-by-step instructions.

    Read the article

  • What is the current state of Ubuntu's transition from init scripts to Upstart?

    - by Adam Eberlin
    What is the current state of Ubuntu's transition from init.d scripts to upstart? I was curious, so I compared the contents of /etc/init.d/ to /etc/init/ on one of our development machines, which is running Ubuntu 12.04 LTS Server. # /etc/init.d/ # /etc/init/ acpid acpid.conf apache2 --------------------------- apparmor --------------------------- apport apport.conf atd atd.conf bind9 --------------------------- bootlogd --------------------------- cgroup-lite cgroup-lite.conf --------------------------- console.conf console-setup console-setup.conf --------------------------- container-detect.conf --------------------------- control-alt-delete.conf cron cron.conf dbus dbus.conf dmesg dmesg.conf dns-clean --------------------------- friendly-recovery --------------------------- --------------------------- failsafe.conf --------------------------- flush-early-job-log.conf --------------------------- friendly-recovery.conf grub-common --------------------------- halt --------------------------- hostname hostname.conf hwclock hwclock.conf hwclock-save hwclock-save.conf irqbalance irqbalance.conf killprocs --------------------------- lxc lxc.conf lxc-net lxc-net.conf module-init-tools module-init-tools.conf --------------------------- mountall.conf --------------------------- mountall-net.conf --------------------------- mountall-reboot.conf --------------------------- mountall-shell.conf --------------------------- mounted-debugfs.conf --------------------------- mounted-dev.conf --------------------------- mounted-proc.conf --------------------------- mounted-run.conf --------------------------- mounted-tmp.conf --------------------------- mounted-var.conf networking networking.conf network-interface network-interface.conf network-interface-container network-interface-container.conf network-interface-security network-interface-security.conf newrelic-sysmond --------------------------- ondemand --------------------------- plymouth plymouth.conf plymouth-log plymouth-log.conf plymouth-splash plymouth-splash.conf plymouth-stop plymouth-stop.conf plymouth-upstart-bridge plymouth-upstart-bridge.conf postgresql --------------------------- pppd-dns --------------------------- procps procps.conf rc rc.conf rc.local --------------------------- rcS rcS.conf --------------------------- rc-sysinit.conf reboot --------------------------- resolvconf resolvconf.conf rsync --------------------------- rsyslog rsyslog.conf screen-cleanup screen-cleanup.conf sendsigs --------------------------- setvtrgb setvtrgb.conf --------------------------- shutdown.conf single --------------------------- skeleton --------------------------- ssh ssh.conf stop-bootlogd --------------------------- stop-bootlogd-single --------------------------- sudo --------------------------- --------------------------- tty1.conf --------------------------- tty2.conf --------------------------- tty3.conf --------------------------- tty4.conf --------------------------- tty5.conf --------------------------- tty6.conf udev udev.conf udev-fallback-graphics udev-fallback-graphics.conf udev-finish udev-finish.conf udevmonitor udevmonitor.conf udevtrigger udevtrigger.conf ufw ufw.conf umountfs --------------------------- umountnfs.sh --------------------------- umountroot --------------------------- --------------------------- upstart-socket-bridge.conf --------------------------- upstart-udev-bridge.conf urandom --------------------------- --------------------------- ureadahead.conf --------------------------- ureadahead-other.conf --------------------------- wait-for-state.conf whoopsie whoopsie.conf To be honest, I'm not entirely sure if I'm interpreting the division of responsibilities properly, as I didn't expect to see any overlap (of what framework handles which services). So I was quite surprised to learn that there was a significant amount of overlap in service references, in addition to being unable to discern which of the two was intended to be the primary service framework. Why does there seem to be a fair amount of redundancy in individual service handling between init.d and upstart? Is something else at play here that I'm missing? What is preventing upstart from completely taking over for init.d? Is there some functionality that certain daemons require which upstart does not yet have, which are preventing some services from converting? Or is it something else entirely?

    Read the article

  • How to connect Nexus 7 with Ubuntu

    - by gotqn
    I want to move some files from my PC to Nexus 7. The tablet is connected to my PC's USB port and it is successfully charging. Unfortunately, the PC is not detecting the devices - what I expected is to be shown the Nexus 7 tablet as external devices (like my USB flash memory). As the tablet is connected to the my home internet network, I have checked if it will appear in the "Networks" section but it does not. I am using Ubuntu 12.4 LTS. Is there a easy way to connect the devices to my PC and move some information between them?

    Read the article

  • Atheros 9250 wireless card keeps on disconnecting

    - by Vizi Balázs
    So I bought a Lenovo G575 laptop for learning purposes and found that the connection just simply disconnects if i'ts in use for downloading and it also does disconnect in every 2-5 minutes while browsing.I tested the card with Win7, it worked nicely.Since then I searched through all the topics connected to this card, also tried using older distros, Maverick ended up with the same results as the actual 12.04 distribution.I dont think it's the router cause i could access it from Win7.It's causing me a trouble using an external usb, cause it's taken from another PC in the house.I would be really grateful if someone could explain what should i do to fix it. Thanks in advance for the help

    Read the article

  • rt2800 wireless keeps disconnecting

    - by Matthew Fumi
    My HP dm1 laptop has a rt2800sta wlan driver. My wireless doesn't usually have a problem connecting to a network, yet sometimes it does. The biggest issue I have found is that when it does connect, it doesn't stay connected. It continually connects and disconnects to the network. Does anyone know why this is happening, and how I would go about fixing the issue? Thank you and look forward to trying your solutions.

    Read the article

  • No splash screen on hibernate

    - by Marky
    Hibernate is working fine. A bit slow when resuming from a hibernate but I can bear with it just so that I have all open applications on the desktop as I left it. Then again the "slowness" might be because of the 4GB RAM, although I'm assuming only what is used gets swapped and not the entire memory. Going back, my question is has anyone been able to make Ubuntu show a splash screen or some kind of indicator/progress bar to show while hibernating or while resuming? I remember with SuSE on my HP Compaq Presario notebook it had messages appear during and after. Better than nothing, I guess. Thanks in advance! :D

    Read the article

  • I need beginner help on loading an image (2D). I have an error

    - by Seth Taddiken
    I keep getting a "NullReferenceExeption was unhandled" with "Object reference not set to an instance of an object." written under it. I have all of the images (png) correct with names and added to references. protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); backGround = Content.Load("Cracked"); player1.playerBlock = Content.Load("square"); player2.playerBlock = Content.Load("square2"); }

    Read the article

  • How to access variables of uninitialized class?

    - by oringe
    So I've gone with a somewhat singleton approach to my game class: #include "myGame.h" int main () { myGame game; return game.Execute(); } But now I need to define a class that accesses variables in the instance of myGame. class MotionState { public: virtual void setWorldTransform (...) { VariableFromMyGameClass++; //<-- !? ...} }; I'm trying to integrate this class into my project from an example that just uses globals. How can I access variables of myGame class in the definition of new classes? Should I give up on my singleton approach?

    Read the article

  • Z Order in 2D with orthographic projection and texture atlas

    - by Carbon Crystal
    I am working with a 2D game in OpenGL ES and have a question about z-order together with a texture atlas. I am using an orthographic projection because I want pixel-perfect rendering of 2D sprites, however from what I can determine the draw order is really the only thing that will determine which textures (sprites) appear above or below their neighbors. That is, the "z-index" is a function of the order in which the textures are drawn as opposed to the z coordinate on the vertex array being drawn. So.. I have a texture atlas to save binding multiple textures for each draw call but this immediately creates a problem if there is more than one atlas in play. If I need to draw textures from more than one atlas (typically the case if I have too many sprites to fit in a single atlas of a reasonable size), then I can't maintain a "draw order" across atlases unless I want to bind/unbind the atlas textures more than once.. which kinda defeats the purpose. Does anyone have any clues as to what the best approach is here? Currently I'm running under an assumption that I will have to declare different fixed "depths" (e.g foreground, background etc) in my 2D scene and assume that the z-order for sprites at a given depth is the same. Then I can have as many atlases as I need at each depth and simply draw the depths in order (along with their associated atlases) I'd love to hear what other people are doing.

    Read the article

  • Actor and Sprite, who should own these properties?

    - by Gerardo Marset
    I'm writing sort of a 2D game engine for making the process of creating games easier. It has two classes, Actor and Sprite. Actor is used for interactive elements (the player, enemies, bullets, a menu, an invisible instance that controls score, etc) and Sprite is used for animated (or not) images with transparency (or not). The actor may have an assigned sprite that represents it on the screen, which may change during the game. E.g. in a top-down action game you may have an actor with a sprite of a little guy that changes when attacking, walking, and facing different directions, etc. Currently the actor has x and y properties (its coordinates in the screen), while the sprite has an index property (the number of the frame currently being shown by the sprite). Since the sprite doesn't know which actor it belongs to (or if it belongs to an actor at all), the actor must pass its x and y coordinates when drawing the sprite. Also, since a actors may reset its sprite each frame (and usually do), the sprite's index property must be passed from the old to the new sprite like so (pseudocode): function change_sprite(new_sprite) old_index = my.sprite.index my.sprite = new_sprite() my.sprite.index = old_index % my.sprite.frames end I always thought this was kind of cumbersome, but it never was a big problem. Now I decided to add support for more properties. Namely a property to draw the sprite rotated, a property to draw it flipped, it a property draw it stretched, etc. These should probably belong to the sprite and not the actor, but if they do, the actor would have to pass them from the old to the new sprite each time it changes... On the other hand, if they belonged to the actor, the actor would have to pass each property to the sprite when drawing it (since the sprite doesn't know which actor it belongs to, and it shouldn't, since sprites aren't just meant to be used by actors, really). Another option I thought of would be having an extra class that owns all these properties (plus index, x and y) and links an actor with a sprite, but that doesn't come without drawbacks. So, what should I do with all these properties? Thanks!

    Read the article

  • nonparametric regression method using R

    - by user1782652
    I need to find the certain driver variables for unit sales & their impact on sales. My data is such data the error does not follow normal distribution & the unit sales is also not following any particular statistical distribution. Given such condition, it is difficult for me to use simple liner regression or GLM. Can any of you please suggest me some non parametric regression technique which I can use in R to model the relationship? Thanks,

    Read the article

  • Is my fragment usage correct, seems to be slow on adnroid

    - by Robertoq
    My app structure is that i have a menu with 5 menu-point om the left side, and the content on the right side. MainActivity.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <fragment android:id="@+id/fragmentMenu" android:name="com.example.FragmentMenu" android:layout_width="@dimen/MenuWidth" android:layout_height="match_parent" /> <LinearLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent" android_layout_toRightOf="@+id/fragmentMenu" android:orientation="vertical"/> </RelativeLayout> MainActivity.java public class FragmentActivityMain extends FragmentActivity { @Override protected void onCreate(final Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.fragment_activity_main); FragmentManager fm = getSupportFragmentManager(); FragmentMenu fragmentMenu = (FragmentMenu) fm.findFragmentById(R.id.fragmentMenu); fragmentMenu.init(); } } And certainly I have a FragmenMenu class, public class FragmentMenu extends ListFragment { @Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_menu, container, false); return view; } public init() { FragmentManager fm = getFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); FragmentNowListView lw = new FragmentCarListView(); ft.add(R.id.content, lw); ft.commit(); } } The FragmentCarList is a simple list, now with static test data, only five items in a List My Problem: Slow. I tested the app on my phone (Galaxy S3) and I see white screen when app starting, around 0,5 second and this is the log: 10-29 11:43:44.093: D/dalvikvm(29710): GC_CONCURRENT freed 267K, 5% free 13903K/14535K, paused 10ms+2ms 10-29 11:43:44.133: D/dalvikvm(29710): GC_FOR_ALLOC freed 215K, 6% free 13896K/14663K, paused 12ms 10-29 11:43:44.233: D/dalvikvm(29710): GC_FOR_ALLOC freed 262K, 6% free 13901K/14663K, paused 12ms 10-29 11:43:44.258: D/dalvikvm(29710): GC_FOR_ALLOC freed 212K, 6% free 13897K/14663K, paused 13ms 10-29 11:43:44.278: D/dalvikvm(29710): GC_FOR_ALLOC freed 208K, 6% free 13897K/14663K, paused 12ms 10-29 11:43:44.328: D/dalvikvm(29710): GC_FOR_ALLOC freed 131K, 4% free 14098K/14663K, paused 12ms 10-29 11:43:44.398: D/dalvikvm(29710): GC_CONCURRENT freed 20K, 3% free 14559K/14919K, paused 1ms+4ms And when I tested on Xperia Ray, the whit screen appear longer time. How can I optimize my fragments? Thx

    Read the article

  • How to show ModelState.AddModelError when the Model is Empty in MVC4

    - by kk1076
    I am displaying a shopping cart. I need to check for empty values in Shopping cart and display a message like "The Shopping Cart is empty". When I use ModelState.AddModelError in myAction, it throws an exception as there is null reference in Model. How to display the ErrorMessage. My Action public ActionResult Index() { string id = Request.QueryString["UserID"]; IList<CartModel> objshop = new List<CartModel>(); objshop = GetCartDetails(id); if (objshop.Count > 0) { return View(objshop.ToList()); } else { ModelState.AddModelError("", "Your Shopping Cart is empty!"); } return View(); } My View @{ @Html.ValidationSummary(true) } <th > @Html.DisplayNameFor(model => model.ProductName) </th> <th > @Html.DisplayNameFor(model => model.Quantity) </th> <th > @Html.DisplayNameFor(model => model.Rate) </th> <th > @Html.DisplayNameFor(model => model.Price) </th> @foreach (var item in Model) { <td> @Html.DisplayFor(modelItem => item.ProductName)</td> <td> @Html.DisplayFor(modelItem => item.Quantity)</td> <td> @Html.DisplayFor(modelItem => item.Rate) </td> <td> @Html.DisplayFor(modelItem => item.Price) </td> } Any suggestions.

    Read the article

  • How to control virtual memory management in linux?

    - by chmike
    I'm writing a program that uses an mmap file to hold a huge buffer organized as an array of 64 MB blocks. The blocks are used to aggregate data received from different hosts through the network. As a consequence the total data size written in each block is not known in advance. Most of the time it is only 2MB but in some cases it can be up to 20MB or more. The data doesn't stay long in the buffer. 90% is deleted after less than a second and the rest is transmitted to another host. I would like to know if there is a way to tell the virtual memory manager that ram pages are not dirty anymore when data is deleted. Should I use mmap and munmap when a block is used and released to control the virtual memory ? What would be the overhead of doing this ? Also, some colleagues expressed concerns about the performance impact of allocating such a big mmap space. I expect it to behave like a swap file so that only dirty pages are to be considered.

    Read the article

  • Apprequest Dialog stopped working (FB-AS3 API)

    - by warran
    I'm writing ActionScript game and wanted to integrate it with FB, so I used http://code.google.com/p/facebook-actionscript-api/ with custom dialog function I've found in same issue thread. It goes like this: protected function dialog(method:String, callback:Function, stageReference:Stage, stageWebView:StageWebView, params:* = null):void { dialogCallback = callback; stageRef = stageReference; webView = stageWebView; webView.stage = stageReference; webView.assignFocus(); dialogWindow = new DialogWindow(handleDialog); dialogWindow.open(method, applicationId, webView, params); } I've written module to handle all the FB stuff and it worked perfectly. But few days ago I've noticed that dialog shows up, but when I select friends and try to send apprequest to them i get error: An error occurred with your app. Please try again later. API Error Code: 2 API Error Description: Service temporarily unavailable Error Message: User can't send this request: Unknown error I've checked it, and found out, that after selecting friends and clicking send dialog changes location to http://www.facebook.com/dialog/apprequest, the error occures, and than after clicking "ok" it changes location to redirect_uri. Do you have any ideas? Is this my fault or facebooks'?

    Read the article

  • Issues with start activity for result

    - by rodkarom
    I have written an Activity using Theme.Holo.Dialog so that it works as an AlertDialog as a login/password notice. I've started this activity with startActivityForResult(...) using a request code I defined. The thing is, whenever I start the activity ´onActivityResult(...)´ is triggered immediately, the buttons get loaded and everything, but once I press them, even though I know the Activity is working because login does happen, there is no result sent back to the first Activity and I am calling setResult(...) and finish() after the buttons are pressed. Thanks in advance, first time using startActivityForResult so I'm sure I must be missing something.

    Read the article

  • How to stop moving the image in objective c?

    - by user1589452
    I have done a coding to check whether the image crossed particular area or not, -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { CGPoint loc=[touch locationInView:self.view]; if (touch.view==img2Obj) { NSLog(@"image2"); img2Obj.center=loc; currentx1=img2Obj.frame.origin.x; currenty1=img2Obj.frame.origin.y; //NSLog(@"top left corner x and y is %.1f and %.1f",img2Obj.frame.origin.x,img2Obj.frame.origin.y); [self isImg1InPos]; }} -(void)isImg1InPos { int dx,dy; dx=currentx1-x1; dy=currenty1-y1; if (abs(dx)<5 && abs(dx)<5) { NSLog(@"Image must stop moving after this!!!"); [img2Obj setUserInteractionEnabled:FALSE]; } //NSLog(@"unsigned int is %d",abs(dx)); } I want the image to stop moving when when it passes the condition. [img2Obj setUserInteractionEnabled:FALSE]; But its not working, can anyone tell me how to solve this problem Many thanks in advance

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >