Search Results

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

Page 215/336 | < Previous Page | 211 212 213 214 215 216 217 218 219 220 221 222  | Next Page >

  • Objective-C property getter

    - by Daniel
    What is technically wrong with the following: @property(nonatomic, assign) NSUInteger timestamp; @property(nonatomic, readonly, getter = timestamp) NSUInteger startTime; @property(nonatomic, assign) NSUInteger endTime; I am sure I can find a better way to organise this, but this is what I ended up with at one point in my project and I noticed that accessing the startTime property always returned 0, even when the timestamp property was set to a correct timestamp. It seems having set the getter of startTime to an existing property (timestamp), it is not forwarding the value of timestamp when I do: event.startTime => 0 event.timestamp => 1340920893 All these are timestamps by the way. Just a reminder, I know the above should have happened in my project but I don't understand why accessing startTime doesn't forward onto timestamp property. UPDATE In my implementation I am synthesising all of these properties: @synthesize timestamp, endTime, startTime; Please check an example object to use that demonstrates this at my gist on GitHub: https://gist.github.com/3013951

    Read the article

  • Objective-C why doesn't my array of array works?

    - by Quetsche
    This is probably a completely stupid question, but i'm pretty new at objective-C and programing in general. i'm trying to make an array of arrays but can't manage to make it work : @interface ArraysAndDicts : NSObject { NSMutableArray * mySimpleArray; NSMutableArray * myComplicatedArray; } the implementation : -(void)generateValueForArrayOfArrays { [self generateValueForArray]; //this generates an array with 5 elements 'mySimpleArray' [myComplicatedArray addObject:mySimpleArray]; NSMutableArray * mySecondaryArray = [[NSMutableArray alloc] init]; [mySecondaryArray addObject:@"twoone"]; [mySecondaryArray addObject:@"twotwo"]; [myComplicatedArray addObject:mySecondaryArray]; (i edited out all the NSLogs for clarity) When running my app, the console tells me : mySecondaryArray count = 2 mySimpleArray count = 5 myComplicatedArraycount = 0 So, i know there are other ways to make multidimensional arrays, but i'd really like to know why this doesn't work. Thank you.

    Read the article

  • c# class design - what can I use instead of "static abstract"?

    - by Ryan
    I want to do the following public abstract class MyAbstractClass { public static abstract int MagicId { get; } public static void DoSomeMagic() { // Need to get the MagicId value defined in the concrete implementation } } public class MyConcreteClass : MyAbstractClass { public static override int MagicId { get { return 123; } } } However I can't because you can't have static abstract members. I understand why I can't do this - any recommendations for a design that will achieve much the same result? (For clarity - what I am trying to do is provide a library with an abstract base class but the concrete versions MUST implement a few properties/methods themselves and yes, there are good reasons for keeping it static.)

    Read the article

  • In XHR, is it possible to distinguish network errors from cross-origin errors?

    - by greim
    http://www.w3.org/TR/access-control/ Reading the CORS spec linked above, it seems to be the case that it's impossible to reliably distinguish between a generic "network error" and a cross-origin access denied error. From the spec: If there is a network error Apply the network error steps. Perform a resource sharing check. If it returns fail, apply the network error steps. http://www.w3.org/TR/access-control/#simple-cross-origin-request0 In my testing, I couldn't locate any features of Firefox's implementation that seem to indicate that the resource sharing check definitely failed. It just switches readyState to 4 and sets status to 0. Ultimately I'd like the ability to pass a success callback, a general fail callback, and an optional cross-origin fail callback, to my function. Thanks for any help or insight.

    Read the article

  • Print number series in java

    - by user1898282
    I have to print the series shown below in java: ***1*** **2*2** *3*3*3* 4*4*4*4 My current implementation is: public static void printSeries(int number,int numberOfCharsinEachLine){ String s="*"; for(int i=1;i<=number;i++){ int countOfs=(numberOfCharsinEachLine-(i)-(i-1))/2; if(countOfs<0){ System.out.println("Can't be done"); break; } for(int j=0;j<countOfs;j++){ System.out.print(s); } System.out.print(i); for(int k=1;k<i;k++){ System.out.print(s); System.out.print(i); } for(int j=0;j<countOfs;j++){ System.out.print(s); } System.out.println(); } } But there are lot of for loops, so I'm wondering whether this can be done in a better way or not?

    Read the article

  • Project hosting on Google Code. Files are cached?

    - by Frexuz
    I do not really understand how Google Code handles file versioning. I am building a jQuery plugin that anyone can access. Like so: <script type="text/javascript" src="http://jquery-old-browser-warning.googlecode.com/files/jquery.browser-warning.js"></script> This script accesses other files on the same project (via ajax). The problem is, that when I upload a new file, it just seems like there aren't any changed to it. Google recommends that new files should have new names. But then I would have to change the filenames that the script loads. But then I would have to change the script file as well, and that would break everybodys implementation (with the script-tag above) Is there a way to force a file to change when uploading with the same filename? PS: If I go directly to the project page's file list. Then I do get the file with the updated content. But as I said, not when getting it through ajax.

    Read the article

  • Exception and Inheritance in JAVA

    - by user1759950
    Suppose we have this problem public class Father{ public void method1(){...} } public class Child1 extends Father{ public void method1() throws Exception{ super.method1(); ... } } Child1 extends Father and override method1 but given implementation Child1.method1 now throws a exception, this wont compile as override method can't throw new exceptions. What is the best solution? Propagate the required exception to the Father.. to me this is against encapsulation, inheritance and general OOP ( the father potentially throw and exception that will never happen ) Use a RuntimeException instead? This solution wont propagate the Exception to the father but I read In Oracle docs and others sources states class of exceptions should be used when "Client code cannot do anything" this is not that case, this exception will b useful to recover blablabla ( why is wrong to use RuntimeException instead? ) Other.. thanks, Federico

    Read the article

  • OSGI bundle (or service)- how to register for a given time period?

    - by Alec
    Hello, all! Search did not give me a hint, how can i behave with the following situation: I'd love to have 2 OSGI implementations of the same interface: one is regular, the other should work (be active/present/whatever) on the given time period (f.e for Christmas weeks :)) The main goal is to call the same interface without specifying any flags/properties/without manual switching of ranking. Application should somehow switch implementation for this special period, doing another/regular job before and after :) I'm a newbie, maybe i do not completely understand OSGI concept somewhere, sorry for that of give me a hint or link, sorry for my English. Using Felix/Equinox with Apache Aries.

    Read the article

  • how to implement a web site like youtube?

    - by ranganaMIT
    Hi Guys, I'm doing a language web site for my university language center, where students login and see videos to learn English. i have to do it like this, person is logging in to the system, search using a search area and find the details,lessons and videos relevant to that videos. this functionality exactly matches the youtube scenario. for implementing twitter like functionality we can use status-net, is there a similer library, statusnet like famous implementation for youtube or a some kind of platform or a framework like codeigniter that we can use to implement youtube like site very easily?? please suggest some options?? a open source one or a commercial one ??? and what is the best video format to use in a such web site?? flv?? mp4?? or mov??? regards, Rangana

    Read the article

  • How to build custom sqlite with provider under Android?

    - by dr4cul4
    Hi, I have a really strange problem. I need to build custom sqlite3 database engine under Android OS, but I also want to use database provider implementation. Unfortunately when examining sources of Android 1.6 I noticed that it's not so easy. Many classes including android.database.; packages use original provider, also many other parts of framework use android.database.sqlite.; packages directly, wich ofcourse make this abstraction a bit confusing and unnesesary. But going to my question. If there is any way that I could extend database interfaces to use custom implmentation of sqlite (or any other database)?

    Read the article

  • User Interface. Multiple select with priority.

    - by Andrew Florko
    I'm designing user interface and want to ask your advises how to make it more user-friendly. Please tell any suggestions and if you have ever seen implementation of something familiar please share the link. University. There are 40+ specialities grouped into 5 faculties. User choose several he is interested in and than orders them by priority. For example I am interested in "programming microcontrollers", "system analysis" and "experimental physic". I must find them quickly in "programming faculty", select them and then order - what I prefer most and what I prefer less then others I select. Any ideas welcome :)

    Read the article

  • How to generate JPA 2.0 metamodel?

    - by yamsha
    In the spirit of type safety associated with the CriteriaQuery JPA 2.0 also has an API to support Metamodel representation of entities. Is anyone aware of a fully functional implementation of this API (to generate the Metamodel... as opposed to creating the metamodel classes manually)? It would be awesome if someone also knows the steps for setting this up in Eclipse (I assume it's as simple as setting up an annotation processor, but you never know). EDIT: Just stumbled across Hibernate JPA 2 Metamodel Generator . But the issue remains since I can't find any download links for the jar

    Read the article

  • Unique visitor counting in ASP.NET MVC

    - by Max
    I'd like to do visitor tracking similar to how stackoverflow does it.. By reading through numerous posts, I've figured out some details already: Count only 1 IP hit per 15 minutes (if anonymous) Count only 1 unique user-Login (per day?) Now that leaves the question of the real implementation.. Should I log the two factors live into a table (and increase count) | IP | timestamp | pageurl | Or do the counting AFTERWARDS (e.g. using IIS log files - which don't include the user, right? I know there're some similar posts outside, but NONE really has a great solution in my opinion yet..

    Read the article

  • How to implement low pass filter using java

    - by chai
    Hello Everyone, I am trying to implement a low pass filter in Java. My requirement is very simple,I have to eliminate signals beyond a particular frequency (Single dimension). Looks like Butterworth filter would suit my need. Now the important thing is that CPU time should be as low as possible. There would be close to a million sample the filter would have to process and our users don't like waiting too long. Are there any readymade implementation of Butterworth filters which has optimal algorithms for filtering. Regards, Chaitannya

    Read the article

  • Get the Time Interval without ITimer

    - by ronag
    In my application I am hosting a flash activex control, based on the following implementation. However I need to know in what fps the control is running in when it is "ticked". The only way I know of to do this is to implement ITimerService and ITimer to get the vtimeInterval argument from ITimer::Advise. However, I do not want to control my own custom ITimer, instead I want the control to be timed using the default timer (basically sends WM_USER + 1 messages to the message queue at proper intervals) which is used when a custom ITimer is not provided. How can I read the vTimeInterval while still using the default timer?

    Read the article

  • CoreData Model Objects for API

    - by theiOSguy
    I am using CoreData in my application. I want to abstract out all the CoreData related stuff as an API so that the consume can use the API instead of directly using CoreData and its generated model objects. CoreData generates the managed objects model as following @interface Person : NSManagedObject @end I want to define my API for example MyAPI and it has a function called as createPerson:(Person*)p; So the consumer of this createPerson API needs to create a Person data object (like POJO in java world) and invoke this API. But I cannot create Person object using Person *p = [Person alloc] init] because the designated initializer for this Person model created by CoreData does not allow this type of creation. So should I define corresponding user facing data object may be PersonDO and this API should take that instead to carry the data into the API implementation? Is my approach right? Any expert advise if design the API this way is a good design pattern?

    Read the article

  • c++ design question: Can i query the base classes to find the number of derived classes satisfying a

    - by vivekeviv
    I have a piece of code like this class Base { public: Base(bool _active) { active = _active; } void Configure(); void Set Active(bool _active); private: bool active; }; class Derived1 : public Base { public: Derived1(bool active):Base(active){} }; similarly Derived 2 and Derived 3 Now if i call derived1Object.Configure, i need to check how many of the derived1Obj, derived2Obj,derived3Obj is active. Should i add this in the "Base" class like a function say, GetNumberOfActive()? And If the implementation is like this: class Imp { public: void Configure() { //Code instantiating a particular Derived1/2/3 Object int GetNumberOfActiveDerivedObj(); baseRef.Configure(int numberOfActiveDerivedClasses); } prive: Derived1 dObj1(true); Derived2 dObj2(false); Derived3 dObj3(true); }; should i calculate the numberOfActive Derived Objects in Imp Class? THanks

    Read the article

  • Match a word with similar words using Solr?

    - by fayer
    I want to search for threads in my mysql database with Solr. But i want it to not just search the thread words, but for similar words. Eg. if a thread title is "dog for sale" and if the user searches for dogs the title will be in the result. and also if a user searches for "mac os x" the word "snow leopard" will appear. and the ability to link words the application thinks is related eg. house and apartment. how is this kind of logic done? i know that you can with solr look up words in a dictionary file you create/add, so solr will look for dogs and see what related words there are (eg. dog). but where do you find such a dictionary? i have no idea about this kind of implementation. please point me into right direction. thanks

    Read the article

  • GWT : NULL Session

    - by jidma
    I'm using spring4gwt in my project. I have the following login service implementation: @Service("loginService") public class LoginServiceImpl extends RemoteServiceServlet implements LoginService { @Override @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) public UserBean checkUser(String userName, String password) throws Exception { HttpSession httpSession = getThreadLocalRequest().getSession(); } } When i call the loginService.checkUser("test","test") (In hosted mode), I get a null pointer exception, as getThreadLocalRequest() returns NULL instead of the actual session. I didn't try in web mode yet. Why would I get a null session ? Does it have something to do with spring4gwt ? Thank you

    Read the article

  • Is this a good approach to execute a list of operations on a data structure in Python?

    - by Sridhar Iyer
    I have a dictionary of data, the key is the file name and the value is another dictionary of its attribute values. Now I'd like to pass this data structure to various functions, each of which runs some test on the attribute and returns True/False. One approach would be to call each function one by one explicitly from the main code. However I can do something like this: #MYmodule.py class Mymodule: def MYfunc1(self): ... def MYfunc2(self): ... #main.py import Mymodule ... #fill the data structure ... #Now call all the functions in Mymodule one by one for funcs in dir(Mymodule): if funcs[:2]=='MY': result=Mymodule.__dict__.get(funcs)(dataStructure) The advantage of this approach is that implementation of main class needn't change when I add more logic/tests to MYmodule. Is this a good way to solve the problem at hand? Are there better alternatives to this solution?

    Read the article

  • How to implement message passing in GNUradio?

    - by xuandl
    I need to implement message passing, my idea is to make some sort of message source (I inherit from public gr_sync_block) that works as a controller for another block (it has to send a message each 6 minutes). I read that is necessary to inherit from gnuradio::block -and by the way, installing grextras is mandatory-. In the .h file I added the #include and inherited from block"class JDFM_API jdfm_control : public gr_sync_block, public gnuradio::block". I know that I have redefine some things like the gnuradio::block constructor but I dont know what msg_signature is, I also don't get the relation between block's parameters and work parameter, the last thing that I am not sure is if I still can use gnuradio-companion if I create a block like this. I haven't been able to find a simple example of messages implementation. If anyone can guide me or show me an example, it would be awesome. Thanks in advance.

    Read the article

  • How to simplify the code?

    - by Tattat
    I have objectA, and objectB.... also I have objectAs, and objectBs. the objectA is only have the init method, and ObjectAs have somethings like this: #import "ObjectAs.h" @implementation ObjectAs @synthesize objectAs; -(id) init{ if( (self=[super init])) { self.objectAs = [[NSMutableArray alloc] init]; } return self; } -(int)getObjectAsNumber{ return [self.objectAs count]; } -(void)addObjectA:(ObjectA *)newObjectA{ [self.objectAs addObject:newObjectA]; } -(id)getObjectAByIdx:(int)objectAIdx{ return [self.objectAs objectAtIndex:objectAIdx]; } -(void)dealloc{ [super dealloc]; [objectAs release]; } @end The objectBs have similar have, I know that I can copy and paste, and replace it. Is there any way to simplify the objectBs, and objectAs? thz a lot.

    Read the article

  • Objective-C: Cannot Change Value of Instance Variable Inside a Function

    - by user262325
    Hello everyone, I cannot change the value of an instance variable inside a function. I have defined a class: // info.h #import <Foundation/Foundation.h> @interface NSMyObject : NSObject { NSInteger i; } -(void) setI:(NSInteger)v; @end #import "info.h" @implementation NSMyObject -(void) setI:(NSInteger)v ; { i=v; } - (void)dealloc { [super dealloc]; } @end I call a function 'myFunction' with parameter temObj which is a NSMyObject instance. myFunction(temObj);//temObj is NSMyObject In the function, I can change the value of the instance variable of parameter obj. -(void)myFunction:(NSMyObject*) obj; { [obj setI:0]; } ... expecting this to change the content of temObj. But when I check the results of operation on obj in function myFunction the value of temObj.i has not changed. Welcome any comment Thanks

    Read the article

  • Request/Response objects

    - by Dan
    I'm planning on using CXF's rest implementation. I'm thinking of simply annotating my entity classes with jaxb annotations, such as @XmlRootElement, in order to create response objects. The benefit being avoidance of code duplication. As for the (client) request object, which will be used by a separate web app, I'm thinking of 'copying' the entity classes, removing the orm annotations, and adding jaxb annotations. Based on the above: Are there any dangers of creating request/response objects from entity classes? My entity classes contain relational properties, if I were to annotate them with @XmlRootElement, how can I stop the relational properties from being added (or considered apart of) to the response object? Is there a better/easier way to create request objects rather than copying the entity classes, removing/adding annotations?

    Read the article

  • App crashing on open on Motorola Backflip only

    - by anakin78z
    I have recently published my second app on the Android Market. I've gotten a few e-mails about the app crashing on open, and all users were using the Motorola Backflip. It seems to work fine on all other devices. The app shows the background image, but crashes right after that. Is there something different I have to do when coding for that device? The strange thing is that it is very similar to my first app, which seems to work just fine for them. The major difference is that my second app is a paid app, and uses Android Licence Verification. My implementation should catch any license errors though, and I've tested this on my device. Users have uninstalled and reinstalled the app without success. I'm stumped. The other thing they're reporting is that the icon doesn't even show properly, but rather is a gear in a box, which makes me think that something goes awry very early in the installation process.

    Read the article

< Previous Page | 211 212 213 214 215 216 217 218 219 220 221 222  | Next Page >