Search Results

Search found 8397 results on 336 pages for 'implementation'.

Page 119/336 | < Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >

  • Speed boost to adjacency matrix

    - by samoz
    I currently have an algorithm that operates on an adjacency matrix of size n by m. In my algorithm, I need to zero out entire rows or columns at a time. My implementation is currently O(m) or O(n) depending on if it's a column or row. Is there any way to zero out a column or row in O(1) time?

    Read the article

  • Lightbox image / link URL

    - by GSTAR
    Basically I have a slightly non-standard implementation of FancyBox. By default you have to include a link to the large version of the image so that the Lightbox can display it. However, in my implementation, the image link URLs point to a script rather than directly to the image file. So for example, instead of: <a href="mysite/images/myimage.jpg" rel="gallery"> I have: <a href="mysite/photos/view/abc123" rel="gallery"> The above URL points to a function: public function actionPhotos($view) { $photo=Photo::model()->find('name=:name', array(':name'=>$view)); if(!empty($photo)) { $this->renderPartial('_photo', array('photo'=>$photo, true)); } } The "$this-renderPartial()" bit simply calls a layout file which includes a standard HTML tag to output. Now when the user clicks on a thumbnail, the above function is called and the large image is displayed in the Lightbox. Now if the user right clicks on the thumbnail and selects "open in new tab/window" then the image is displayed in the browser as per normal, i.e. just the image. I want to change this so that it displays the image within a layout. In the above code I can include the following and put it in an IF statement: $this->render('photos', array('photo'=>$photo)); This will call the layout file "photos" which contains the layout to display the image in. I have a specific limitation for this - the image URL must remain the same, i.e. no additional GET variables in the URL. However if we can pass in a GET variable in the background then that is OK. I will most likely need to change my function above so that it calls a different file for this functionality. EDIT: To demonstrate exactly what I am trying to do, check out the following: http://www.starnow.co.uk/KimberleyMarren Go to the photos tab and hover over a thumbnail - note the URL. Click the thumbnail and it will open up in the Lightbox. Next right click on that same thumbnail and select "open in new tab/new window". You will notice that the image is now displayed in a layout. So that same URL is used for displaying the image in the Lightbox and on its own page. The way StarNow have done this is using some crazy long JavaScript functionality, which I'm not too keen on replicating.

    Read the article

  • Which run-time charting tools produce the best time axes?

    - by eft
    I need to generate and embed a time series chart into an ASP.NET application. Most run-time charting tools generate poor time axes, especially if the time scale is dynamic ie the user may choose to view data over a time scale of days, weeks, months or years. I'm looking for recommended tools that can be integrated into my app. Two that show promise are Chart Director and Google's annotated timeline visualization. Both are quite different in their implementation and have pros/cons.

    Read the article

  • WPF binding not updating until after another action

    - by Matthew Stanford
    I have an observable collection bound to a listbox in WPF. One of the options in the window is to use an OpenFileDialog to add an item to the listbox with certain properties. When I use the OpenFileDialog it immeditaely sets two of the properties of the new item in the observable collection. I am using INotifyPropertyChanged to update the listbox. These two new properties are set correctly and now the listbox should display the title contained in the new title property and the title textbox which is bound to the listbox should display the new title as well. However, neither displays the new title upon the closing of the OpenFileDialog and when I click on another item in the listbox and come back to the item I have just changed it updates the title textbox but the title displayed in the list box is not changed until i move the item in the list box that I want to change. Here is the Binding code. ItemsSource="{Binding Path=MyData, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" And here is the implementation of the browse button that is not working (L1 being the listbox) private void browse_Click(object sender, RoutedEventArgs e) { OpenFileDialog opf = new OpenFileDialog(); opf.ShowDialog(); MyData[L1.SelectedIndex].Title = System.IO.Path.GetFileNameWithoutExtension(opf.FileName); MyData[L1.SelectedIndex].Command = opf.FileName; } When I simply type in the text boxes and click out of them it updates the list box immediately with the new information I have put in. I also have a create new button and upon clicking it, it immediately adds a new item to the list box and updates its' properties. The only one that is not updating correctly is this peice of code I have given you. Thanks for your help. EDIT: Here is my implementation of INotifyPropertyChanged private OCLB _MyData; public OCLB MyData { get { return _MyData; } set { _MyData= value; FirePropertyNotifyChanged("MyData"); } } OCLB is the obserable collection. Here is the function FirePropertyNotifyChanged public event PropertyChangedEventHandler PropertyChanged; private void FirePropertyNotifyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } Each of these are in the partial class MainWindow for the wpf form. I also have a class for the MyData files (with 4 get/set functions) that are stored in the OCLB(observable collection). There is also a class with functions for the OCLB.

    Read the article

  • Get text of button from IBAction - iPhone

    - by Organiccat
    When an IBAction is called: -(IBAction) onClick1: (id) sender; What is passed in the sender? Since it's hooked up through the IB, I'm not really sure. My question is how to get the text of the button to be the passed object (NSString most likely) so that I could call it inside the action implementation. -(IBAction) onClick1: (id) sender { NSLog(@"User clicked %@", sender); // Do something here with the variable 'sender' }

    Read the article

  • Help: Instance Variables & Properties [iPhone]

    - by Devoted
    In something like this: @interface Control_FunViewController : UIViewController { UITextField *nameField; UITextField *numberField; } @property (nonatomic, retain) IBOutlet UITextField *nameField; @property (nonatomic, retain) IBOutlet UITextField *numberField; I understand that "UITextField *nameField;" is an instance variable and "@property ..." is a property. But what do these individual things do? I guess what I'm really asking is how the property is used for example in the implementation file (.m)

    Read the article

  • where can I find the diff algorithm?

    - by dole doug
    Does anyone know where can i find an explanation and implementation of the diff algorithm. First of all i have to recognize that i'm not sure if this is the correct name of the algorithm. For example, how Stackoverflow marks the differences between two edits of the same question? ps: I know C and PHP programming languages. ty

    Read the article

  • How to use erubis with mamp

    - by devlim
    i found out erubis, the "fast, secure, and very extensible implementation of eRuby", now after install through gem install erubis, my question is how to run in on mac? especially on mamp? i been no luck finding answer on google so anyone know how?

    Read the article

  • Multiple View App shows Blank Screen in Simulator

    - by Brett Coburn
    Hello; I am developing a simple app that first shows a menu screen, and when a button is pressed, a game screen appears. I was able to develop the game screen without any issues, but when I changed the code to first display the menu, the simulator showed a blank screen. I've read all the articles on connecting views with IB but I can't figure this out. Any help would be appreciated. This is my code: // Pong_Multiple_ViewAppDelegate.h // Pong Multiple View // // Created by Brett on 10-05-19. // Copyright __MyCompanyName__ 2010. All rights reserved. // #import <UIKit/UIKit.h> @class MenuViewController; @interface Pong_Multiple_ViewAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; MenuViewController *navigationController; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet MenuViewController *navigationController; @end // // Pong_Multiple_ViewAppDelegate.m // Pong Multiple View // // Created by Brett on 10-05-19. // Copyright __MyCompanyName__ 2010. All rights reserved. // #import "Pong_Multiple_ViewAppDelegate.h" #import "MenuViewController.h" @implementation Pong_Multiple_ViewAppDelegate @synthesize window; @synthesize navigationController; - (void)application:(UIApplication *)application{ // Override point for customization after application launch [window addSubview:[navigationController view]]; [window makeKeyAndVisible]; } - (void)dealloc { [navigationController release]; [window release]; [super dealloc]; } @end // // MenuViewController.h // Pong Multiple View // // Created by Brett on 10-05-19. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> #import "GameViewController.h" @interface MenuViewController : UIViewController { GameViewController *gameViewController; IBOutlet UIButton *gameButton; } @property(nonatomic, retain) GameViewController *gameViewController; @property(nonatomic, retain) UIButton *gameButton; -(IBAction)switchPage:(id)sender; @end // // MenuViewController.m // Pong Multiple View // // Created by Brett on 10-05-19. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import "MenuViewController.h" #import "GameViewController.h" @implementation MenuViewController @synthesize gameViewController; @synthesize gameButton; -(IBAction)switchPage:(id)sender{ if (self.gameViewController==nil) { GameViewController *gameView = [[GameViewController alloc]initWithNibName:@"GameView" bundle:[NSBundle mainBundle]]; self.gameViewController= gameView; [gameView release]; } [self.navigationController pushViewController:self.gameViewController animated:YES]; } .... @end My code also includes classes: GameViewController.h, GameViewController.m, and nib files: MenuView.xib, and GameView.xib Thanks, B

    Read the article

  • Customer Support Identifier-How to get this?

    - by megala
    I was trying to create an account in this site which gives you complete functional implementation of the Oracle Applications 11i ( http://vis11510.solutionbeacon.net/OA_HTML/AppsLocalLogin.jsp?requestUrl=APPSHOMEPAGE&cancelUrl=http%3A%2F%2Fvis11510.solutionbeacon.net%3A80%2Foa_servlets%2Foracle.apps.fnd.sso.AppsLogin ) . The site asks me to provide Oracle CSI (Customer Support Identifier) any idea how i can obtain one?

    Read the article

  • Generic JMS Client

    - by Damo
    Does anyone know if it is feasible to write a Generic JMS client - ie. one that works with JMS from different providers (eg. Sonic, IBM SIB, Jboss etc)? Every time I've written JMS client code it is always very implementation specific with dependent JARs and Context classes. Thanks.

    Read the article

  • How to represent different entities that have identical behavior?

    - by Dominik
    I have several different entities in my domain model (animal species, let's say), which have a few properties each. The entities are readonly (they do not change state during the application lifetime) and they have identical behavior (the differ only by the values of properties). How to implement such entities in code? Unsuccessful attempts: Enums I tried an enum like this: enum Animals { Frog, Duck, Otter, Fish } And other pieces of code would switch on the enum. However, this leads to ugly switching code, scattering the logic around and problems with comboboxes. There's no pretty way to list all possible Animals. Serialization works great though. Subclasses I also thought about where each animal type is a subclass of a common base abstract class. The implementation of Swim() is the same for all Animals, though, so it makes little sense and serializability is a big issue now. Since we represent an animal type (species, if you will), there should be one instance of the subclass per application, which is hard and weird to maintain when we use serialization. public abstract class AnimalBase { string Name { get; set; } // user-readable double Weight { get; set; } Habitat Habitat { get; set; } public void Swim(); { /* swim implementation; the same for all animals but depends uses the value of Weight */ } } public class Otter: AnimalBase{ public Otter() { Name = "Otter"; Weight = 10; Habitat = "North America"; } } // ... and so on Just plain awful. Static fields This blog post gave me and idea for a solution where each option is a statically defined field inside the type, like this: public class Animal { public static readonly Animal Otter = new Animal { Name="Otter", Weight = 10, Habitat = "North America"} // the rest of the animals... public string Name { get; set; } // user-readable public double Weight { get; set; } public Habitat Habitat { get; set; } public void Swim(); } That would be great: you can use it like enums (AnimalType = Animal.Otter), you can easily add a static list of all defined animals, you have a sensible place where to implement Swim(). Immutability can be achieved by making property setters protected. There is a major problem, though: it breaks serializability. A serialized Animal would have to save all its properties and upon deserialization it would create a new instance of Animal, which is something I'd like to avoid. Is there an easy way to make the third attempt work? Any more suggestions for implementing such a model?

    Read the article

  • Getting Data From Webpages?

    - by fuzzygoat
    When looking to get data from a web page whats the recommended method if the page does not provide a structured data feed? Am I right in thinking that its just a case of doing an NSURLRequest and then hacking what you need out of the responseData(NSData*)? I am not too concerned about the implementation in Xcode, I am more curious about actually collecting the data, before I start coding a "hunt & peck" through a list of data. gary

    Read the article

  • how can I future-proof migration of a ADO.net local data layer to a future web based interface (web-

    - by Greg
    Hi, BACKGROUND: I am working on a .NET WinForms application now (C#) with an ADO.net database for the data layer. QUESTION: How an I develop this now such that it would be easy to migrate to a model where the data layer is abstracted via a HTTP web-service or REST interface? For example would just use of a standard C# interface with a Factory to obtain a concrete implementation of the interface where this uses ADO.net be the best? thanks

    Read the article

  • Error in creating template class

    - by Luciano
    I found this vector template class implementation, but it doesn't compile on XCode. Header file: // File: myvector.h #ifndef _myvector_h #define _myvector_h template <typename ElemType> class MyVector { public: MyVector(); ~MyVector(); int size(); void add(ElemType s); ElemType getAt(int index); private: ElemType *arr; int numUsed, numAllocated; void doubleCapacity(); }; #include "myvector.cpp" #endif Implementation file: // File: myvector.cpp #include <iostream> #include "myvector.h" template <typename ElemType> MyVector<ElemType>::MyVector() { arr = new ElemType[2]; numAllocated = 2; numUsed = 0; } template <typename ElemType> MyVector<ElemType>::~MyVector() { delete[] arr; } template <typename ElemType> int MyVector<ElemType>::size() { return numUsed; } template <typename ElemType> ElemType MyVector<ElemType>::getAt(int index) { if (index < 0 || index >= size()) { std::cerr << "Out of Bounds"; abort(); } return arr[index]; } template <typename ElemType> void MyVector<ElemType>::add(ElemType s) { if (numUsed == numAllocated) doubleCapacity(); arr[numUsed++] = s; } template <typename ElemType> void MyVector<ElemType>::doubleCapacity() { ElemType *bigger = new ElemType[numAllocated*2]; for (int i = 0; i < numUsed; i++) bigger[i] = arr[i]; delete[] arr; arr = bigger; numAllocated*= 2; } If I try to compile as is, I get the following error: "Redefinition of 'MyVector::MyVector()'" The same error is displayed for every member function (.cpp file). In order to fix this, I removed the '#include "myvector.h"' on the .cpp file, but now I get a new error: "Expected constructor, destructor, or type conversion before '<' token". A similar error is displayed for every member as well. Interestingly enough, if I move all the .cpp code to the header file, it compiles fine. Does that mean I can't implement template classes in separate files?

    Read the article

  • Best UI to be shown to User while his request is still in process behind the scenes ?

    - by Rachel
    I am currently involved with an Application where I need to design the UI part of the Application and current I am in the process of implementation of UI which would be displayed to end user while his or her request is being processed behind the scenes. So my question is that: What is the best UI approach/symbol/suggestions to be displayed to end User while his or her request is still being processed behind the scenes ? Thanks.

    Read the article

  • Easiest way to implement RSS reader on Google Android?

    - by user291888
    Hi guys, This is my first time on stack overflow, so I apologize if this question has been asked before, but is there an easy way to implement an RSS reader on the Google Android (API 1.5)? I'm searched far and wide with the code sources I know of, and I've only found one implementation which takes 6 different classes and doesn't seem to compile on the current Android SDK's. If I end up having to write my own, I'll be sure to post it here later on. Thanks a lot.

    Read the article

  • silverlight 4 net tcp binding security

    - by SLfan
    This document talks about how to send username and password from SL4 app to a web service. It assumes that HTTPS will be used for transport. However, I want to use NET TCP because of its speed. Is that possible because another article says net tcp in SL4 does not provide transport level security. If that's incorrect then how do I convert the https implementation to net tcp?

    Read the article

  • String generation with regex criteria

    - by menjaraz
    I wonder wether it is feasible to implement an optimal string generator Class meeting the following requirements: Generation criteria using regex Lexicographical order enumeration. Count propetry Indexed access I don't feel comfortable with regular expression: I cannot come up with a starting piece of code but I just think of a naive implementation using a TList as a base class and use a filter (Regex) against "brute force" generated string. Thank you.

    Read the article

  • Getting the name of a Clojure struct type?

    - by j-g-faustus
    When defining a struct type and instance, I can print the value and get the "struct" implementation type: (defstruct person :name :age) (def p (struct person "peter" 30)) user=> p {:name "peter", :age 30} user=> (type p) clojure.lang.PersistentStructMap But is it possible to tell whether p is an instance of the struct type "person"?

    Read the article

< Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >