Search Results

Search found 671 results on 27 pages for 'stub'.

Page 16/27 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • KeyCode_Enter to next edittext

    - by soclose
    Hi, In edittext, after typing 'Enter' key, system make a new line inside it. I'd like to focus on next edittext, no new line. how to code? my code in xml is below <EditText android:id="@+id/txtNPCode" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="18sp" android:layout_alignLeft="@+id/lblNPCode" android:layout_below="@+id/lblNPCode" android:layout_centerHorizontal="true" /> <EditText android:id="@+id/txtCNPCode" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="18sp" android:layout_alignLeft="@+id/lblCNPCode" android:layout_below="@+id/lblCNPCode" android:layout_centerHorizontal="true" /> I also caputer key code in setOnKeyListener tCNPCode.setOnKeyListener(new OnKeyListener() { public boolean onKey(View v, int keyCode, KeyEvent event) { // TODO Auto-generated method stub if(keyCode == 66) { Toast.makeText(S_PCode.this, "Enter Key", Toast.LENGTH_LONG).show(); //tNPCode.setFocusable(true); } return false; } });

    Read the article

  • ASP.Net MVC 2 on nginx/mono 2.8

    - by mace
    Hi, I am trying to setup ASP.Net MVC 2 application on Linux environment. I've installed Ubuntu 10.10 on VirtualBox, then installed Mono 2.8 from sources. After that I have installed nginx and configure it as recommended here. Unfortunately, FastCGI shows me standard error 500 page: No Application Found Unable to find a matching application for request: Host localhost:80 Port 80 Request Path /Default.aspx Physical Path /var/www/mvc/Default.aspx My application is located in /var/www/mvc directory. I've tried to create some stub Default.aspx file and place it in root dir of my application, but it didn't help, same error occured. Thanks.

    Read the article

  • referencing ints from other classes

    - by user357032
    if i wanted to reference an int from another class how would i go about doing that??? public class Zoom extends View { private Drawable image; public int zoomControler=20; public Zoom(Context context) { super(context); image=context.getResources().getDrawable(R.drawable.icon); setFocusable(true); } @Override protected void onDraw(Canvas canvas) { // TODO Auto-generated method stub super.onDraw(canvas); image.setBounds((getWidth()/2)-zoomControler, (getHeight()/2)-zoomControler, (getWidth()/2)+zoomControler, (getHeight()/2)+zoomControler); image.draw(canvas); } } class HelloOnTouchListener implements OnTouchListener{ @Override public boolean onTouch(View arg0, MotionEvent arg1) { return true; } } in this case i want to reference the zoomControler from the first class in the second helloontouchlistener class

    Read the article

  • Why is my Extension Method not showing up in my test class?

    - by Robert Harvey
    I created an extension method called HasContentPermission on the System.Security.Principal.IIdentity interface: namespace System.Security.Principal { public static bool HasContentPermission (this IIdentity itentity, int contentID) { // I do stuff here return result; } } And I call it like this: bool hasPermission = User.Identity.HasPermission(contentID); Works like a charm. Now I want to unit test it. To do that, all I really need to do is call the extension method directly, so: using System.Security.Principal; namespace MyUnitTests { [TestMethod] public void HasContentPermission_PermissionRecordExists_ReturnsTrue() { IIdentity identity; bool result = identity.HasContentPermission(... But HasContentPermission won't intellisense. I tried creating a stub class that inherits from IIdentity, but that didn't work either. Why? Or am I going about this the wrong way?

    Read the article

  • How do I write a spec to verify the rendering of partials?

    - by TheDeeno
    I'm using rr and rspec. Also, I'm using the collection short hand for partial rendering. My question: How do I correctly fill out the the following spec? before(:each) do assigns[:models] = Array.new(10, stub(Model)) end it "should render the 'listing' partial for each model" do # help me write something that actually verifies this end I've tried a few examples from the rspec book, rspec docs, and rr docs. Everything I try seems to leave me with runtime errors in the test - not failed assertions. Rather than show all the transformations I've tried, I figured all I'd need if someone showed me one that actually worked. I'd be good to go from there.

    Read the article

  • What is wrong with Stubs for unit testing?

    - by MatthewMartin
    I just watched this funny YouTube Video about unit testing (it's Hitler with fake subtitles chewing out his team for not doing good unit tests--skip it if you're humor impaired) where stubs get roundly criticized. But I don't understand what wrong with stubs. I haven't started using a mocking framework and I haven't started feeling the pain from not using one. Am I in for a world a hurt sometime down the line, having chosen handwritten stubs and fakes instead of mocks (like Rhinomock etc)? (using Fowler's taxonomy) What are the considerations for picking between a mock and handwritten stub?

    Read the article

  • Can JNI handle any dll files (Windows)?

    - by henry
    I am new to JNI. And have a few questions : Can JNI handle every type dll exists in windows? I wanted to link a library but it gives me error. Is it possible JNI and the dll are not compatible? Excerpt from VB .NET (It works) Private Declare Function ConnectReader Lib "rfidhid.dll" () As Integer Private Declare Function DisconnectReader Lib "rfidhid.dll" () As Integer Private Declare Function SetAntenna Lib "rfidhid.dll" (ByVal mode As Integer) As Integer Full Code From Java public class MainForm { /** * @param args */ public native int ConnectReader(); public static void main(String[] args) { // TODO Auto-generated method stub MainForm mf = new MainForm(); System.out.println(mf.ConnectReader()); } static { System.loadLibrary("rfidhid"); } } Error code shown Exception in thread "main" java.lang.UnsatisfiedLinkError: MainForm.ConnectReader()I at MainForm.ConnectReader(Native Method) at MainForm.main(MainForm.java:13) Can anyone point to me where I might do wrong

    Read the article

  • Instantiating a python class in C#

    - by Jekke
    I've written a class in python that I want to wrap into a .net assembly via IronPython and instantiate in a C# application. I've migrated the class to IronPython, created a library assembly and referenced it. Now, how do I actually get an instance of that class? The class looks (partially) like this: class PokerCard: "A card for playing poker, immutable and unique." def __init__(self, cardName): The test stub I wrote in C# is: using System; namespace pokerapp { class Program { static void Main(string[] args) { var card = new PokerCard(); // I also tried new PokerCard("Ah") Console.WriteLine(card.ToString()); Console.ReadLine(); } } } What do I have to do in order to instantiate this class in C#?

    Read the article

  • Running activity from remote service

    - by Moshik
    Hi, iam trying to run an activity from diffrent package from my remote service: this is how i implement the service.java ublic class CurrencyService extends Service { public class CurrencyServiceImpl extends ICurrencyService.Stub { int CALL_PUSH_SERVICE_ACTIVITY=10; @Override public void callSomeActivity(int activityId) throws RemoteException { Intent pushActivity=new Intent("com.pushservice.PushActivity"); pushActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(pushActivity); .. ive also added a line in the manifest of the service: the service works fine, but i cant run the activity - PushActivity which is in diffrent package of diffrent application, thanks.

    Read the article

  • How to access a String Array location in android?

    - by Vamsi Challa
    Android 2.3.3 This is my code... String[] expression = {""}; //globally declared as empty somewhere in the code below, I am trying to assign a string to it. expression[0] = "Hi"; I keep getting the following error... 12-08 22:12:19.063: E/AndroidRuntime(405): java.lang.ArrayIndexOutOfBoundsException Can someone help me with this.. Can we access the index 0, directly as i am doing? Actual Code ::: static int x = 0; // global declaration String[] assembledArray = {""}; // global declaration assembleArray(strSubString, expression.charAt(i)); //Passing string to the method //Method Implementation private void assembleArray(String strSubString, char charAt) { // TODO Auto-generated method stub assembledArray[x] = strSubString; assembledArray[x+1] = String.valueOf(charAt); x = x+2; }

    Read the article

  • Pass a Delphi class to a C++ function/method that expects a class with __thiscall methods.

    - by Alan G.
    I have some MSVC++ compiled DLL's for which I have created COM-like (lite) interfaces (abstract Delphi classes). Some of those classes have methods that need pointers to objects. These C++ methods are declared with the __thiscall calling convention (which I cannot change), which is just like __stdcall, except a this pointer is passed on the ECX register. I create the class instance in Delphi, then pass it on to the C++ method. I can set breakpoints in Delphi and see it hitting the exposed __stdcall methods in my Delphi class, but soon I get a STATUS_STACK_BUFFER_OVERRUN and the app has to exit. Is it possible to emulate/deal with __thiscall on the Delphi side of things? If I pass an object instantiated by the C++ system then all is good, and that object's methods are called (as would be expected), but this is useless - I need to pass Delphi objects. Edit 2010-04-19 18:12 This is what happens in more detail: The first method called (setLabel) exits with no error (though its a stub method). The second method called (init), enters then dies when it attempts to read the vol parameter. C++ Side #define SHAPES_EXPORT __declspec(dllexport) // just to show the value class SHAPES_EXPORT CBox { public: virtual ~CBox() {} virtual void init(double volume) = 0; virtual void grow(double amount) = 0; virtual void shrink(double amount) = 0; virtual void setID(int ID = 0) = 0; virtual void setLabel(const char* text) = 0; }; Delphi Side IBox = class public procedure destroyBox; virtual; stdcall; abstract; procedure init(vol: Double); virtual; stdcall; abstract; procedure grow(amount: Double); virtual; stdcall; abstract; procedure shrink(amount: Double); virtual; stdcall; abstract; procedure setID(val: Integer); virtual; stdcall; abstract; procedure setLabel(text: PChar); virtual; stdcall; abstract; end; TMyBox = class(IBox) protected FVolume: Double; FID: Integer; FLabel: String; // public constructor Create; destructor Destroy; override; // BEGIN Virtual Method implementation procedure destroyBox; override; stdcall; // empty - Dont need/want C++ to manage my Delphi objects, just call their methods procedure init(vol: Double); override; stdcall; // FVolume := vol; procedure grow(amount: Double); override; stdcall; // Inc(FVolume, amount); procedure shrink(amount: Double); override; stdcall; // Dec(FVolume, amount); procedure setID(val: Integer); override; stdcall; // FID := val; procedure setLabel(text: PChar); override; stdcall; // Stub method; empty. // END Virtual Method implementation property Volume: Double read FVolume; property ID: Integer read FID; property Label: String read FLabel; end; I would have half expected using stdcall alone to work, but something is messing up, not sure what, perhaps something to do with the ECX register being used? Help would be greatly appreciated. Edit 2010-04-19 17:42 Could it be that the ECX register needs to be preserved on entry and restored once the function exits? Is the this pointer required by C++? I'm probably just reaching at the moment based on some intense Google searches. I found something related, but it seems to be dealing with the reverse of this issue.

    Read the article

  • Linux: Ways to communicate with kernel module from user space.

    - by Inso Reiges
    Hello, What are the ways to communicate with a kernel module from user space? By communication i mean sending information and commands between the module and a user space process. I currently know of two way: open/close/read/write/ioctl on published device node. read/write on exported and hooked /proc file. More specifically, can someone advice the best way to communicate with a kernel module that does not actually drives any hardware and therefore should not be littering /dev with stub nodes that exists solely for ioctl calls? I mostly need to check its various status variables and send it a block of data with a request type tag and see if the request succeeded. Inso.

    Read the article

  • Are there any OSGi web service / SOAP clients out there?

    - by James Carr
    I'm looking for any webservice client that can be run inside an OSGi container and connect to a simple web service using SOAP, doesn't sound so hard does it? Oh, and it has to work under Java 1.5, so the JRE jax-ws wont be present. The problem is I've tried a few solutions now, and although each solution works in standard Java using it from within OSGi doesn't. the springsource JAX-WS bundles seem to have dependency issues the CXF bundles get me as far as calling the service, but then can seem to find the stub methods in the proxy Is there anyone out there who has successfully created an OSGi webservice client?

    Read the article

  • Data not displayed first time in android after copying the file from assets to data folder

    - by Thinkcomplete
    Description I have used the code tip from http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ to copy a pre-filled data file to the target and handled this in a asynch task Problem : On starting the application it gives error and shuts down first time, starting again without any change it works perfectly fine. So first time after the file is copied, the error comes but after that no issues. Please help Code attached:.. private class CopyDatabase extends AsyncTask<String, Void, Boolean> { private final ProgressDialog dialog = new ProgressDialog(BabyNames.this); protected void onPreExecute() { this.dialog.setMessage("Loading..."); this.dialog.show(); } @Override protected Boolean doInBackground(String... params) { // TODO Auto-generated method stub try { namesDBSQLHelper.createDatabase(); return null; } catch(IOException ioe){ ioe.printStackTrace(); } return null; } protected void onPostExecute(final Boolean success){ if (this.dialog.isShowing()){ this.dialog.dismiss(); } } }

    Read the article

  • When is it appropriate to do interaction based testing as opposed to state based testing?

    - by Praneeth
    Hi, When I use Easymock(or a similar mocking framework) to implement my unit tests, I'm forced to do interaction-based testing (as I don't get to assert on the state of my dependencies. Or am I mistaken?). On the other hand if I use a hand written stub (instead of using easymock) I can implement state based testing. I'm quite unclear if I want to go with interaction based testing or state based testing. I'm biased and I want to use Easymock, but I'm not sure if there would be any side-effects that I may have to face in the future. Can anyone please throw some light on this? Thanks in advance!

    Read the article

  • launch android activity from non-activity class

    - by Alberto Barrera
    im New on Android. I know theres a lot of similar Questions but anyone is helping. Im using a 3rd party app that just launch a class that extends their own class. So from that class i would like to launch an activity. public class SkyTest extends VtiUserExit { @Override public VtiUserExitResult execute() throws VtiExitException { // TODO Auto-generated method stub logInfo("TEST"); return null; } } How do i launch an activity named MainActivity from here. i tryed this: Context context = null; Intent intent = new Intent(context, MainActivity.class); context.startActivity(intent); but its not working, i know i cant use the null context, but how do i create a context o how it works? Thanks

    Read the article

  • Java: How to test methods that call System.exit()?

    - by Chris Conway
    I've got a few methods that should call System.exit() on certain inputs. Unfortunately, testing these cases causes JUnit to terminate! Putting the method calls in a new Thread doesn't seem to help, since System.exit() terminates the JVM, not just the current thread. Are there any common patterns for dealing with this? For example, can I subsitute a stub for System.exit()? [EDIT] The class in question is actually a command-line tool which I'm attempting to test inside JUnit. Maybe JUnit is simply not the right tool for the job? Suggestions for complementary regression testing tools are welcome (preferably something that integrates well with JUnit and EclEmma).

    Read the article

  • Sharing a database connection with included classes in a Sinatra application

    - by imightbeinatree
    I'm converting a part of a rails application to its own sinatra application. It has some beefy work to do and rather than have a million helps in app.rb, I've separated some of it out into classes. Without access to rails I'm rewriting finder several methods and needing access to the database inside of my class. What's the best way to share a database connection between your application and a class? Or would you recommend pushing all database work into its own class and only having the connection established there? Here is what I have in in app.rb require 'lib/myclass' configure :production do MysqlDB = Sequel.connect('mysql://user:password@host:port/db_name') end I want to access it in lib/myclass.rb class Myclass def self.find_by_domain_and_stub(domain, stub) # want to do a query here end end I've tried several things but nothing that seems to work well enough to even include as an example.

    Read the article

  • Debug Linux kernel pre-decompression stage

    - by Shawn J. Goff
    I am trying to use GDB to debug a Linux kernel zImage before it is decompressed. The kernel is running on an ARM target and I have a JTAG debugger connected to it with a GDB server stub. The target has to load a boot loader. The boot loader reads the kernel image from flash and puts it in RAM at 0x20008000, then branches to that location. I have started GDB and connected to the remote target, then I use GDB's add-symbol-file command like so: add-symbol-file arch/arm/boot/compressed/vmlinux 0x20008000 -readnow When I set a breakpoint for that address, it does trap at the correct place - right when it branches to the kernel. However, GDB shows the wrong line from the source of arch/arm/boot/compressed/head.S. It's 4 lines behind. How can I fix this? I also have tried adding the -s section addr option to add-symbol-file with -s .start 0x20008000; this results in exactly the same problem.

    Read the article

  • RubyMotion Error When Using setTranslucent

    - by Sam Morris
    I'm getting the following error when trying rake a project I'm working on, and I can't figure out why. The message happens no matter what variable I sent it. Objective-C stub for message `setTranslucent:' type `v@:c' not precompiled. Make sure you properly link with the framework or library that defines this message Here's my app_delegate file for reference. class AppDelegate def application(application, didFinishLaunchingWithOptions:launchOptions) navigation_appearance @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) tableView = StopsController.alloc.init @window.rootViewController = UINavigationController.alloc.initWithRootViewController(tableView) @window.makeKeyAndVisible true end def navigation_appearance UINavigationBar.appearance.setBackgroundImage UIImage.imageNamed('navbar_bg.png'), forBarMetrics: UIBarMetricsDefault UINavigationBar.appearance.setTranslucent(true) UINavigationBar.appearance.setShadowImage UIImage.imageNamed('navbar_shadow.png') end end

    Read the article

  • I'm getting a ServerException when I try to send objects from a BlackBerry to a Server via a webserv

    - by DanG
    I'm trying to send an array of objects wrapped in an array object wrapper to a WS via JSR172 WS calls. Using the generated stub, I'm able to download objects from the server, but I'm not able to upload objects to the server. This currently happens on all simulators in house. This is all the information I can get out of the server exception: javax.xml.rpc.JAXRPCException: java.rmi.ServerException: Server cannot handle the message because of some temporary condition. Here are the server specs: Windows 7 IIS 7 or 7.5 .NET 3.5 for the WS code written in C#. If anyone knows how to solve this problem, or knows where to look, I'd love to know. Thanks!

    Read the article

  • Sqlite database entries pass to array list?

    - by Rjay Guillermo Baltazar
    This is my code in getting the question into SQLite Database . I want to pass the questions into array list ? is it possible to my code ? Thanks for your help . public String getquestions() { // TODO Auto-generated method stub String[] sqlSelect = { "0 _id", "question", "answer" }; String sqlTables = "mytables"; SQLiteDatabase db = getWritableDatabase(); SQLiteQueryBuilder qb = new SQLiteQueryBuilder(); qb.setTables(sqlTables); String result = ""; c = qb.query(db, sqlSelect, null, null, null, null, null); int id = c.getColumnIndex(ID); int question = c.getColumnIndex(ROW1); int answer = c.getColumnIndex(ROW2); c.moveToFirst(); result = result + c.getString(question) + c.getString(count); return result; }

    Read the article

  • JavaApplicationStub with CFBundleDocumentTypes

    - by mystro
    I'm trying to use CFBundleDocumentTypes to associate a custom file extension with my application. As far as I can tell, this seems to "work" -- my application launches when I double click the file. However, no callback is registered through the ApplicationListener events I setup in java. I used the code listed in http://stackoverflow.com/questions/1460193/set-default-file-association-mac-os-x-java-package-maker-installer to do the file association, and the file association itself appears fine, but it seems as if it is the application stub trying to launch the file, and thus fails. I added the Apple ApplicatinListener code to my java application at (similar to http://developer.apple.com/mac/library/documentation/Java/Reference/1.5.0/appledoc/api/index.html?com/apple/eawt/Application.html) but it doesn't seem like my application ever gets a call back. the code is similar to Application.getApplicatin().addApplicationListener( new ApplicationAdapter() { public void handleOpenFile(ApplicationEvent evt) { //some logging message here that I never get} }); Any help would be appreciated

    Read the article

  • JavaApplicationStub with CFBundleDocumentTypes

    - by mystro
    I'm trying to use CFBundleDocumentTypes to associate a custom file extension with my application. As far as I can tell, this seems to "work" -- JavaApplicationStub launches my application when I double click the file. However, no callback is registered through the ApplicationListener events I setup in java. I used the code listed in http://stackoverflow.com/questions/1460193/set-default-file-association-mac-os-x-java-package-maker-installer to do the file association, and the file association itself appears fine, but it seems as if it is the application stub trying to launch the file, and thus fails. I added the Apple ApplicatinListener code to my java application at (similar to http://developer.apple.com/mac/library/documentation/Java/Reference/1.5.0/appledoc/api/index.html?com/apple/eawt/Application.html) but it doesn't seem like my application ever gets a call back. the code is similar to Application.getApplicatin().addApplicationListener( new ApplicationAdapter() { public void handleOpenFile(ApplicationEvent evt) { //some logging message here that I never get} }); I should perhaps mention that I'm also using SWT... Any help would be appreciated

    Read the article

  • coldfusion class path for multiple services - only recognizing first directory

    - by ffc
    Hi, I am trying to use multiple web services on a single CF page. I have entered the stubs directory for each of the web services in the ColdFusion Class Path within administrator server settings java and jvm paths are listed separated by commas: c:\coldfusion9\stubs\ws1,c:\coldfusion9\stubs\ws2 for some reason, only the web service whose stub path is listed first will work. When I try to call the second web service, I get a "web service operation ... cannot be found" but if i switch the order of paths listed in the admin settings and restart the service, the web service listed first now will work. any ideas on how to manage multiple web services and their stubs ? thanks!

    Read the article

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