Search Results

Search found 8286 results on 332 pages for 'defined'.

Page 95/332 | < Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >

  • R library for discrete Markov chain simulation

    - by stevejb
    Hello, I am looking for something like the 'msm' package, but for discrete Markov chains. For example, if I had a transition matrix defined as such Pi <- matrix(c(1/3,1/3,1/3, 0,2/3,1/6, 2/3,0,1/2)) for states A,B,C. How can I simulate a Markov chain according to that transition matrix? Thanks,

    Read the article

  • in python: can i pass class method as and a default argument to another class method

    - by alex
    i want to to pass class method as and a default argument to another class method, so that i can re-use the method as a @classmethod @classmethod class foo: def func1(self,x): do somthing; def func2(self, aFunc = self.func1): # make some a call to afunc afunc(4) this why when the method func2 is called within the class aFunc defaults to self.func1, but i can call this same function from outside of the class and pass it a different function at the input. i get NameError: name 'self' is not defined

    Read the article

  • Inference engine to calculate matching set according to internal rules

    - by Zecrates
    I have a set of objects with attributes and a bunch of rules that, when applied to the set of objects, provides a subset of those objects. To make this easier to understand I'll provide a concrete example. My objects are persons and each has three attributes: country of origin, gender and age group (all attributes are discrete). I have a bunch of rules, like "all males from the US", which correspond with subsets of this larger set of objects. I'm looking for either an existing Java "inference engine" or something similar, which will be able to map from the rules to a subset of persons, or advice on how to go about creating my own. I have read up on rule engines, but that term seems to be exclusively used for expert systems that externalize the business rules, and usually doesn't include any advanced form of inferencing. Here are some examples of the more complex scenarios I have to deal with: I need the conjunction of rules. So when presented with both "include all males" and "exclude all US persons in the 10 - 20 age group," I'm only interested in the males outside of the US, and the males within the US that are outside the 10 - 20 age group. Rules may have different priorities (explicitly defined). So a rule saying "exclude all males" will override a rule saying "include all US males." Rules may be conflicting. So I could have both an "include all males" and an "exclude all males" in which case the priorities will have to settle the issue. Rules are symmetric. So "include all males" is equivalent to "exclude all females." Rules (or rather subsets) may have meta rules (explicitly defined) associated with them. These meta rules will have to be applied in any case that the original rule is applied, or if the subset is reached via inferencing. So if a meta rule of "exclude the US" is attached to the rule "include all males", and I provide the engine with the rule "exclude all females," it should be able to inference that the "exclude all females" subset is equivalent to the "include all males" subset and as such apply the "exclude the US" rule additionally. I can in all likelihood live without item 5, but I do need all the other properties mentioned. Both my rules and objects are stored in a database and may be updated at any stage, so I'd need to instantiate the 'inference engine' when needed and destroy it afterward.

    Read the article

  • Rails: how can I access the request object outside a helper or controller?

    - by rlandster
    In my application_helper.rb file I have a function like this: def internal_request? server_name = request.env['SERVER_NAME'] [plus more code...] end This function is needed in controllers, model, and views. So, I put this code in a utility function file in the lib/ directory. However, this did not work: I got complaints about request not being defined. How can I access the request object in a file in the lib/ directory?

    Read the article

  • Response is not available in this context when creation cookie's

    - by Sadegh
    hi i defined one class to create cookie by received parameter's from user. when i want to add cookie to context i receive an exception. My Class public static class ManageCookies { public static void Create(string name, string value) { HttpCookie cookie = new HttpCookie(name); cookie.Value = value; cookie.Expires = DateTime.Now.AddYears(1); HttpContext.Current.Response.Cookies.Add(cookie); } } Occured Exception: Response is not available in this context.

    Read the article

  • Tutorials and Introductions to C++ Expression Templates

    - by grrussel
    What are good introductions to the creation of C++ expression template systems? I would like to express arithmetic on user defined types while avoiding temporary values (which may be large), and to learn how to do this directly rather than applying an existing library. I have found Todd Veldhuizen's original paper and an example from the Josuttis C++ Templates book, and an article by Kreft & Langer. I am looking for simple, clear expositions.

    Read the article

  • xsd and wsdl incorrect file

    - by Gandalf StormCrow
    How to fix corrupted xsd and wsdl files, is there any IDE which can suggest what is wrong? such as eclipse for java code when pressing CTRL + 1 , or where can I find books tutorials to understand formatting of these file types better? thank you Here is concrete message error I have [ERROR] 'item' is already defined line 223 of file:/C:/project/src/main/resources/schema.xsd [ERROR] (related to above error) the first definition appears here line 22 of file:/C:/project/src/main/resources/schema.xsd

    Read the article

  • Best Practices with MVC Route

    - by codemnky
    if this is asked before just point me in the right direction I am a OO and MVC newbie. I am following along the MVC Storefront(a little outdated now) where they are talking about routes and adding them to global.asax.cs My question is this. wouldn't it be better if only 1 route is defined and after that everything is done programatically? I dont want the user to navigate using the address bar thank you

    Read the article

  • Problem with include guard

    - by isurulucky
    When I add an include guard to my header file for a Visual C++ project, it gives me the following warning and error: warning C4603: '_MAPTEST_H' : macro is not defined or definition is different after precompiled header use Add macro to precompiled header instead of defining here .\MapTest.cpp(6) : use of precompiled header** // the precompiled header stdafx.h is included in this line .\MapTest.cpp(186) : fatal error C1020: unexpected #endif but when I add the precompiled header before the include guard, no warning or error is emitted. What is the reason for this?

    Read the article

  • How to change behavior of items in Firefox context menu

    - by tom
    Hi, I'm trying to change the behavior of in placesOverlay.xul. My goal is to disable the Properties entry upon conditions that I need to figure out using Javascript. I am new to XBL bindings and handlers and don't know how to register such a handler for an existing/browser-defined XUL element. Or is there a simpler way? Thanks.

    Read the article

  • One IBOutlet for two UILabels

    - by Mike Rychev
    I have two views within one .xib (one view for landscape, another for portrait). How can I use the same IBOutlet I've defined in @interface section for both labels if they have the same functionality. (ctrl+dragging to both of them does'n help-each time I drag to second, the first one loses its outlet).

    Read the article

  • Integer overflow exploitable?

    - by wuntee
    Does anyone have a detailed explanation on how integers can be exploited? I have been reading a lot about the concept, and I understand what an it is, and I understand buffer overflows, but I dont understand how one could modify memory reliably, or in a way to modify application flow, by making an integer larger than its defined memory....

    Read the article

  • trouble to connect with AppStore in my InAppPurchase application(iPhone)

    - by riteshkumar1905
    There is problem to connect AppStore in my application. All things run fine in Simulator.But When i go with iPhone then AppStore is not connected.. I am also enclose the code which i call on button....... import "BuyController.h" import "InAppPurchaseManager.h" import "SKProducts.h" define kInAppPurchaseProUpgradeProductId @"com.vigyaapan.iWorkOut1" @implementation BuyController (IBAction)buy:(id)sender { /* get the product description (defined in early sections)*/ //[self requestProUpgradeProductData]; { if ([SKPaymentQueue canMakePayments]) { InAppPurchaseManager *Observer = [[InAppPurchaseManager alloc] init]; [[SKPaymentQueue defaultQueue] addTransactionObserver:Observer]; //NSURL *sandboxStoreURL = [[NSURL alloc]initWithString:@"http://sandbox.itunes.apple.com/verifyReceipt"]; //[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"http://sandbox.itunes.apple.com"]]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://phobos.apple.com/WebObjects/ com.vigyaapan.iWorkOut1?id=9820091347&;amp;amp;amp;amp;mt=8"]]; //[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=301349397&;amp;amp;amp;amp;mt=8"]]; SKPayment *payment = [SKPayment paymentWithProductIdentifier:@"com.vigyaapan.iWorkOut1"]; [[SKPaymentQueue defaultQueue] addPayment:payment]; } else { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"MyApp" message:@"You are not authorized to purchase from AppStore" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil]; [alert show]; [alert release]; } //return [SKPaymentQueue canMakePayments]; } SKPayment *payment = [SKPayment paymentWithProductIdentifier:kInAppPurchaseProUpgradeProductId]; [[SKPaymentQueue defaultQueue] addPayment:payment]; //[self requestProUpgradeProductData]; /* get the product description (defined in early sections)*/ } /* // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle )nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; }/ // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; } // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } (void)dealloc { [super dealloc]; } @end

    Read the article

  • comparing data via a function

    - by tigermain
    I have two sets of data (locations) in seperate tables and I need to compare if they match or not. I have a UDF which performs a calculation based upon 5 values from each table. How do I perform a select with a join using this udf? my udf is basically defined by.... ALTER FUNCTION [dbo].[MatchRanking] ( @Latitude FLOAT , @Longitude FLOAT , @Postcode VARCHAR(16) , @CompanyName VARCHAR(256) , @TelephoneNumber VARCHAR(32) , @Latitude2 FLOAT , @Longitude2 FLOAT , @Postcode2 VARCHAR(16) , @CompanyName2 VARCHAR(256) , @TelephoneNumber2 VARCHAR(32) ) RETURNS INT

    Read the article

  • When does Visual Studio call target AfterBuild & BeforeBuild? And how is it handled when these targe

    - by Nam Gi VU
    Hi Fiburt, Today I meet a similar problem and it reminds me about this thread. In Visual Studio, if we open the .csproj file, we see that they tell us to uncomment the two targets AfterBuild and BeforeBuild so as to execute them after and before the build of the current project accordingly. My questions are: Where are these two targets called in Visual Studio? And how is it handled if the targets are not defined (be commented out) ?

    Read the article

  • NServiceBus Retry Delay

    - by mattcodes
    What is the optimal way to configure/code NServiceBus to delay retrying messages, in its default configuration retry happens almost immediately upto the number of attempts defined in the config file. I'd ideally like to retry again after an hour etc.. Also how does HandleCurrentMessageLater() work, what does the Later aspect refer to?

    Read the article

< Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >