Daily Archives

Articles indexed Friday June 18 2010

Page 14/76 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Android ==> Simple 2d Animation ???

    - by aryaxt
    public void MoveMyButton (int x) //where the button suppose to move to { TranslateAnimation anim=new TranslateAnimation(this.getLeft() ,x, this.getTop() ,20)); anim.setFillAfter(true); anim.setDuration(1000); this.setAnimation(anim); anim.start(); } button's x at start is 1. I call the method to move it to 100, and it goes from 1 to 100 I call it to go to 200, and it goes from 1 to 200, instead of 100 to 200 Is there any way to make the animation to save the location of the button as it animates it? Thanks

    Read the article

  • OCUnit & NSBundle

    - by kpower
    I created OCUnit test in concordance with "iPhone Development Guide". Here is the class I want to test: // myClass.h #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface myClass : NSObject { UIImage *image; } @property (readonly) UIImage *image; - (id)initWithIndex:(NSUInteger)aIndex; @end // myClass.m #import "myClass.m" @implementation myClass @synthesize image; - (id)init { return [self initWithIndex:0]; } - (id)initWithIndex:(NSUInteger)aIndex { if ((self = [super init])) { NSString *name = [[NSString alloc] initWithFormat:@"image_%i", aIndex]; NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"png"]; image = [[UIImage alloc] initWithContentsOfFile:path]; if (nil == image) { @throw [NSException exceptionWithName:@"imageNotFound" reason:[NSString stringWithFormat:@"Image (%@) with path \"%@\" for current index (%i) wasn't found.", [name autorelease], path, aIndex] userInfo:nil]; } [path release]; } return self; } - (void)dealloc { [image release]; [super dealloc]; } @end And my unit-test (LogicTests target): // myLogic.m #import <SenTestingKit/SenTestingKit.h> #import <UIKit/UIKit.h> #import "myClass.h" @interface myLogic : SenTestCase { } - (void)testTemp; @end @implementation myLogic - (void)testTemp { STAssertNoThrow([[myClass alloc] initWithIndex:0], "myClass initialization error"); } @end All necessary frameworks, "myClass.m" and images added to target. But on build I have an error: [[myClass alloc] initWithIndex:0] raised Image (image_0) with path \"(null)\" for current index (0) wasn't found.. myClass initialization error This code (initialization) works fine in application itself (main target) and later displays correct image. I've also checked my project folder (build/Debug-iphonesimulator/LogicTests.octest/) - there are LogicTests, Info.plist and necessary image files (image_0.png is one of them). What's wrong?

    Read the article

  • Does anyone know where I could find a 2 input USB voltage meter?

    - by John O
    What we really need is a tiny UPS, of sorts. We'll be hooking up a solar cell and a battery to a single board computer. Currently, that SBC is a custom Pic32 device, and it does it's own UPS and voltage monitoring duties. I've been tasked with trying to replicate all of its features with off the shelf products... and for the most part I've succeeded. But I don't currently have any way to switch between two sources of juice, or monitor when they're getting low. These guys have something: http://www.mini-box.com/picoUPS-100-12V-DC-micro-UPS-system-battery-backup-system I really like it, the price is well within the budget. We might even work it in though it does 12V and I'll probably be using 5V... there are enough engineers on hand to figure out something. But I'd still have no idea what the voltage was for the PV or battery. I was hoping that there was some simple little USB multimeter thing that I could use to monitor this with, but I can't seem to come up with anything. I've found all sorts of cool hardware, but nothing that will help us. Does anyone know of anything?

    Read the article

  • What could cause a huge packet loss in Ubuntu 9.10, for both wired and wireless?

    - by xzenox
    I was previously using 9.04 fine (and in fact, I am posting this from my old 9.04 live cd). I tested the following install steps in a virtualbox vm prior to following the sames ones to upgrade my laptop: Download/burn ubuntu minimal cd (12mb one) Install ubuntu minimal sudo apt-get update sudo apt-get upgrade sudo apt-get ubuntu-desktop ubuntu-standard In the VM worked fine and I found myself with a working 9.10 ubuntu, network worked fine and I was able to test my backups and DropBox without a hitch (host was 9.04). When I followed the same steps on my laptop, everything worked up to after 9.10 being installed and working. As far as I can tell, everything besides eth0/wireless works. For some reason, I am unable to access the internet. Ping reports that over 99% of packets get lost (over an hour or so of pinging). This means for example that if I try hard enough, I can load a webpage but only at the cost of much patience... This happens both for a wired and wireless connection to my wrt310n (updated with latest firmware). At first I thought that it could be related to the ipv6 issues ppl have been experiencing however even after disabling ipv6 at the kernel level (through grub), I still get the issue. I do not think this is related to DNS issues or the likes since even when I ping my ISP's gateway IP, I have the same amount of packet loss. No DNS resolving should be required there. Access to my router works peachy with no packet loss there. I've tried different MTU values but to no avail. Note that this issue affects every web-enabled application: firefox, ping, synaptic, etc. The same hardware/router combo works with 9.04 but not with 9.10. In fact, when I did: sudo apt-get ubuntu-desktop ubuntu-standard after 9.10 minimal was installed, it downloaded over 400mb of packages without a hitch so my guess is that one of those packages either in ubuntu-desktop or ubuntu-standard is causing havok. Thoughts?

    Read the article

  • Capturing HTML input values using a BHO

    - by Meric
    Hi all, i am a complete nobbie to BHO and C++. This is what i want to achieve. Using various code samples, i have been successful in installing a BHO in my Internet Explorer. I am currently making use of the Invoke method to search for DISPID_HTMLDOCUMENTEVENTS2_ONCLICK and have been successful in capturing the event. How can i access a HTML input on the page is filled up with values? (eg. i navigate to www.gmail.com, key in some values into the username and password, and my BHO is activated upon the onclick event?) Code examples or link to documentation would be fantastic help regards Meric

    Read the article

  • Drupal SQL injection attacks prevention and apostrophe handling in Forms

    - by jini
    in typical PHP applications I used to use mysql_real_escape_string before I did SQL inserts. However I am unable to do that in Drupal so would need some assistance. And without any sort of function like that, user input with apostrophes is breaking my code. Please suggest. Thank You My SQL is as follows: $sql = "INSERT INTO some_table (field1, field2) VALUES ('$field1', '$field2')"; db_query($sql);

    Read the article

  • need help on wordpress feeds query parameters

    - by goh
    Hi guys, may i know how do i set the number of feeds displayed on a word press blog? for instance, i used http://beautifulreminisciencezz.wordpress.com/?feed=atom&year=2009 But it returns me only ten results. For blogger, I know the query parameter is 'max-results' However,t here's nowhere in wordpress where they mentioned the query parameters for this. Anyone have any idea?

    Read the article

  • How can I manage several programmers?

    - by Isamtron
    Hello, I will soon have to manage 4 programmers working on the same project. I'm wondering how will I be able to do that. The project will be done using PHP and MySQL databases. What's confusing me is how several programmers will be working on the same files. Please advise. Your help will be appreciated.

    Read the article

  • Why does javascript's "in" operator return true when testing if 0 exists in an array that doesn't co

    - by Mariano Peterson
    For example, this returns true, and makes sense: var x = [1,2]; 1 in x; // true This returns false, and makes sense: var x = [1,2]; 3 in x; // false However this returns true, and I don't understand why: var x = [1,2]; 0 in x; You can quickly test it by putting this in your browser's address bar: javascript:var x=[1,2]; alert(0 in x); Why does the "in" operator in Javascript return true when testing if "0" exists in array, even when the array doesn't appear to contain "0"?

    Read the article

  • Using an extended interceptor in struts2 does not work w/ action parameters

    - by Ricardo
    I have a default package w/ an interceptor configure, and i'm extending that package into another one and calling the same interceptor <action name="availability**"> <param name="subTab">availability</param> <interceptor-ref name="tabStack"/> <result>/WEB-INF/jsp/index.jsp?include=visibilit/availability.jsp</result> </action> The problem is that the param is not being read inside my interceptor code: Map params = invocation.getInvocationContext().getParameters(); subTab = params.get("subTab").toString(); //NULL exception Any idea how i can pass parameters to extended interceptors? Thanks!

    Read the article

  • SQL - First row inserted every day for the past X days

    - by okie.floyd
    A tough SQL question (I'm using postgres by the way). I need the first row inserted every day for the past X days. one of my columns is a timestamp, which i hold the time inserted, and another column is the row id. If it's not possible to get the first row inserted every day, i at least need a unique one; a single row for every day for the past x days. Any suggestions? Thanks okie

    Read the article

  • How should i center my page?

    - by acidzombie24
    I have two parts to my site. The main body and the sidebar. The body is 6in and sidebar will probably be 200px. How do i center my page? So there is equal space on the left and right side? It should center no matter the resolution. Using XHTML 1.0 Strict. Should work on all major browsers or at least Firefox and chrome.

    Read the article

  • How would you code a washing machine?

    - by Dan
    Imagine I have a class that represents a simple washing machine. It can perform following operations in the following order: turn on - wash - centrifuge - turn off. I see two basic alternatives: A) I can have a class WashingMachine with methods turnOn(), wash(int minutes), centrifuge(int revs), turnOff(). The problem with this is that the interface says nothing about the correct order of operations. I can at best throw InvalidOprationException if the client tries to centrifuge before machine was turned on. B) I can let the class itself take care of correct transitions and have the single method nextOperation(). The problem with this on the other hand, is that the semantics is poor. Client will not know what will happen when he calls the nextOperation(). Imagine you implement the centrifuge button’s click event so it calls nextOperation(). User presses the centrifuge button after machine was turned on and ups! machine starts to wash. I will probably need a few properties on my class to parameterize operations, or maybe a separate Program class with washLength and centrifugeRevs fields, but that is not really the problem. Which alternative is better? Or maybe there are some other, better alternatives that I missed to describe?

    Read the article

  • Convert arbitrary length to a value between -1.0 a 1.0?

    - by TheDarkIn1978
    How can I convert a length into a value in the range -1.0 to 1.0? Example: my stage is 440px in length and accepts mouse events. I would like to click in the middle of the stage, and rather than an output of X = 220, I'd like it to be X = 0. Similarly, I'd like the real X = 0 to become X = -1.0 and the real X = 440 to become X = 1.0. I don't have access to the stage, so i can't simply center-register it, which would make this process a lot easier. Also, it's not possible to dynamically change the actual size of my stage, so I'm looking for a formula that will translate the mouse's real X coordinate of the stage to evenly fit within a range from -1 to 1.

    Read the article

  • does it make sense to send password information during email communication from websites

    - by Samuel
    Most of the online sites on registration do send a link to activate the site and on any further correspondence with the end user they provide information about the site and also provide the login credentials with password in clear text (as given below) Username - [email protected] Password - mysecretpassword What would you do in such a case? From a usability perspective does it make sense to send the password information in clear text or should you just avoid sending this information. I was under the impression that most of the passwords are MD5 hashed before storing in the database and hence the service provider will not have any access to clear text passwords, is this a security violation?

    Read the article

  • Receiving "MERGE" 200 OK error when committing using trac-post-commit-hook

    - by Lyon Blecher
    When running a commit with the trac-post-commit-hook I receive a MERGE 200 OK error, I understand that this means that the commit has succeeded on the server but the file status has not updated on my local machine. But I can't find anyway to fix this issue. Would this be a problem with my setup or something in the script. I'm using stock standard script from the trac site, I'm committing through tortoiseSVN to VisualSVN Server which is hosted on a windows 2008 server. When I run the script through a command line I receive no errors, I only receive this error through TortoiseSVN.

    Read the article

  • Redirect everything except the homepage

    - by Alex
    Is there a way in nginx to redirect everything from domain1.com to domain2.com, except for the homepage? Right now I have: server { listen 80; server_name www.domain1.com domain1.com; rewrite ^ http://domain2.com$uri permanent; } This works, except that I'd like http://domain1.com (without any additional path) to be left alone and not redirected. Basically, I need to redirect everything, to avoid broken links, but I want to use the homepage of domain1 to serve a static file.

    Read the article

  • dig gets the right result from DNS server, but name still fails to resolve

    - by EMiller
    Under what conditions would the following occur? From a given OSX machine on an internal network: $~ cat /etc/resolv.conf nameserver 10.102.120.7 nameserver 10.102.120.2 From the same machine: $~ dig @10.102.120.7 in.local <snip> ... ;; QUESTION SECTION: ;in.local. IN A ;; ANSWER SECTION: in.local. 43200 IN A 10.102.123.30 <snip> ... And yet, this workstation cannot ping in.local, nor load pages hosted by apache on that machine. 10.102.123.30 is definitley up (2 OSX machines I know fail to resolve in.local - but other machines on the network can). I have also checked their /etc/hosts to see if anything there might interfere... Not sure what else to check...

    Read the article

  • Move the Public folders on Windows 7

    - by Omar Shahine
    This question is not about user folders, but rather the Public user folder on Windows 7. How do you map folders such as Music, Pictures, Video to a different location. If you right click, go to properties, and look at the location tab it's not editable on Windows 7.

    Read the article

  • eclipse IDE won't start in ubuntu 10.04 64bit with sun-java

    - by aeischeid
    i get this error when I try to run from CLI ** (Eclipse:2318): CRITICAL **: menu_proxy_module_load: assertion `dbusproxy != NULL' failed # A fatal error has been detected by the Java Runtime Environment: # SIGSEGV (0xb) at pc=0x00007f34511a4e74, pid=2318, tid=139863603410704 # JRE version: 6.0_18-b18 Java VM: OpenJDK 64-Bit Server VM (14.0-b16 mixed mode linux-amd64 ) Derivative: IcedTea6 1.8 Distribution: Ubuntu lucid (development branch), package 6b18-1.8-0ubuntu1 Problematic frame: C [libglib-2.0.so.0+0x41e74] g_main_context_prepare+0x164 # An error report file with more information is saved as: /home/aaron/opt/eclipse/hs_err_pid2318.log # If you would like to submit a bug report, please include instructions how to reproduce the bug and visit: https://bugs.launchpad.net/ubuntu/+source/openjdk-6/ The crash happened outside the Java Virtual Machine in native code. See problematic frame for where to report the bug. # I have sun-java installed and set in my PATH: ~: echo $JAVA_HOME /usr/lib/jvm/java-6-sun/

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >