Search Results

Search found 1591 results on 64 pages for 'implementations'.

Page 37/64 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Get a list of Android phone contacts only on Eclair and above?

    - by Rob Kent
    I want to show the user a flattened pick list of all their contacts phone numbers and it must work from versions 1.6 up. I have read the related questions on SO and the Android documentation for Eclair (http://developer.android.com/resources/articles/contacts.html#legacy). The problem is, even splitting my code into a factory class and specific implementations does not work for me because using Contacts.CONTENT_URI only shows contacts not individual numbers. What I need is this for version 1.6 Intent intent = new Intent(Intent.ACTION_PICK, Phones.CONTENT_URI); startActivityForResult(intent, REQUEST_PICK_CONTACT); And the equivalent for 2.0 and above. Even if I get their example to work, by building against the 2.1 API am I not stopping my app being visible on the Market to users with earlier versions of the OS? I can't launch it against a 1.6 emulator, for example.

    Read the article

  • Reverse proxy for Tomcat

    - by aauser
    I got following infrastructure. Site A - Tomcat. Can be access by url www.sitea.com Site B - php backend( or probably it will be just static html pages ). Can't be access directly. I want to forward all request comming to www.sitea.com/doforward/... (Tomcat) to php backend. And all other requests with other urls should be handled by Tomcat itself. I know i can add another web server in front of tomcat, for example nginx, and based on url forward request to php backed or tomcat backend. But i want tomcat to serve requests itself and forward it to another backend. Probably there are ready implementations for servlet containers like mod_proxy for apache. Thank you

    Read the article

  • what's the "best" approach to creating the UI of an audio plugin that will be both audio unit and VST for OS X and Windows?

    - by SaldaVonSchwartz
    I'm working on a couple audio plugins. Right now, they are audio units. And while the "DSP" code won't change for the most part between implementations / ports, I'm not sure how to go about the GUI. For instance, I was looking at the Apple-supplied AUs in Lion. Does anyone know how did they go about the UI? Like, are the knobs and controls just subclasses of Cocoa controls? are they using some separate framework or coding these knobs and such from scratch? And then, the plugs I'm working on are going to be available too as VSTs for Windows. I already have them up and running with generic interfaces. But I'm wondering if I should just get over it and recreate all my interfaces with the vstgui code provided by Steinberg or if there's a more practical approach to making the interfaces cross-platform.

    Read the article

  • iPhone noob - different method types?

    - by codemonkey
    My apologies in advance for what is probably a really dumb question. I'm familiar (or at least getting familiar) with instance and class methods in objective-c, but have also seen method implementations that look like this: #import "Utilities.h" #import "CHAPPAppDelegate.h" #import "AppState.h" @implementation Utilities CHAPPAppDelegate* GetAppDelegate() { return (CHAPPAppDelegate *)[UIApplication sharedApplication].delegate; } AppState* GetAppState() { return [GetAppDelegate() appState]; } @end What are these? While I'm sure this is documented somewhere, I don't know what term to use in searching for an explanation of what's being done here. I like the syntax methods like this let me use when calling them, but I'm not sure exactly what I'm doing, what the implications are, how to send parameters to these types of functions, etc? To clarify how I ended up in this position, I started using these methods in a "utilities" class of mine after reading some online blog describing the author's preference for declaring these functions this way. Now I can't seem to track down a more detailed explanation of what exactly the differences are, etc.

    Read the article

  • Static vs Non Static constructors

    - by Neil N
    I can't think of any reasons why one is better than the other. Compare these two implementations: public class MyClass { public myClass(string fileName) { // some code... } } as opposed to: public class MyClass { private myClass(){} public static Create(string fileName) { // some code... } } There are some places in the .Net framework that use the static method to create instances. At first I was thinking, it registers it's instances to keep track of them, but regular constructors could do the same thing through the use of private static variables. What is the reasoning behind this style?

    Read the article

  • Ruby implementation of conversion between Latitude/Longitude and OS National Grid Reference point?

    - by Harry Wood
    For converting between Latitude/Longitude and UK's Ordnance Survey National Grid eastings and northings, this seems to be the most popular explanation and reference implementation in JavaScript: http://www.movable-type.co.uk/scripts/latlong-gridref.html The web is littered with other implementations in different languages. Making the conversion via PostGIS queries is another alternative. ...but did anyone implement this maths in ruby? OSGridToLatLong is the direction I'm looking for just at this moment, but I would have thought a library for converting in both directions must surely be available in a gem somewhere. I'm just not searching for the right thing.

    Read the article

  • Misc. Naming: Can I place underscores instead of camel casing in modern languages?

    - by Bubba88
    Hi! I would like to ask some kind of permission (I hope that doesn't sound strange) from the people who have influence on the naming conventions in modern languages like F#, Scala, etc. My problem is - I just can't read camelCased code and wish I could write underscored_names at least in my internal implementations (not in API interface). This applies to just everything - local var names, method names, params.. (Not class names I think) It seems that now the camel-casing is preferred for example for the names of object methods, but could that be not the only way? What would you say; Can I go with underscored names in languages like I mentioned (F#, Scala)?

    Read the article

  • What's the best way of using a pair (triple, etc) of values as one value in C#?

    - by Yacoder
    That is, I'd like to have a tuple of values. The use case on my mind: Dictionary<Pair<string, int>, object> or Dictionary<Triple<string, int, int>, object> Are there built-in types like Pair or Triple? Or what's the best way of implementing it? Update There are some general-purpose tuples implementations described in the answers, but for tuples used as keys in dictionaries you should additionaly verify correct calculation of the hash code. Some more info on that in another question. Update 2 I guess it is also worth reminding, that when you use some value as a key in dictionary, it should be immutable.

    Read the article

  • Anonymous types based in Interface

    - by Bhaskar
    Can I create anonymous implementations of an interface , in a way similar to the way delegate() { // type impl here , but not implementing any interface} Something on the lines of new IInterface() { // interface methods impl here } The situations where I see them to be useful are for specifying method parameters which are interface types, and where creating a class type is too much code. For example , consider like this : public void RunTest() { Cleanup(delegate() { return "hello from anonymous type"; }); } private void Cleanup(GetString obj) { Console.WriteLine("str from delegate " + obj()); } delegate string GetString(); how would this be achieved if in the above code , the method Cleanup had an interface as a parameter , without writing a class definition ? ( I think Java allows expressions like new Interface() ... )

    Read the article

  • Markdown to text/plain and text/html for multipart email

    - by fphilipe
    I’m looking for a solution to send DRY multipart emails in Rails. With DRY I mean that the content for the mail is only defined once. I’ve thought about some possible solutions but haven’t found any existing implementations. The solutions I’ve thought about are: load the text from I18n and apply Markdown for the html mail and apply Markdown with a special output type for the text mail where links are put in parenthesis after the link text bold, italic and other formatting that doesn't make sense are removed ordered and unordered lists are maintained generate only the html mail and convert that to text according to the above conditions Is there any available solution out there? Which one is probably the better way to do it?

    Read the article

  • How to handle failure to release a resource which is contained in a smart pointer?

    - by cj
    How should an error during resource deallocation be handled, when the object representing the resource is contained in a shared pointer? Smart pointers are a useful tool to manage resources safely. Examples of such resources are memory, disk files, database connections, or network connections. // open a connection to the local HTTP port boost::shared_ptr<Socket> socket = Socket::connect("localhost:80"); In a typical scenario, the class encapsulating the resource should be noncopyable and polymorphic. A good way to support this is to provide a factory method returning a shared pointer, and declare all constructors non-public. The shared pointers can now be copied from and assigned to freely. The object is automatically destroyed when no reference to it remains, and the destructor then releases the resource. /** A TCP/IP connection. */ class Socket { public: static boost::shared_ptr<Socket> connect(const std::string& address); virtual ~Socket(); protected: Socket(const std::string& address); private: // not implemented Socket(const Socket&); Socket& operator=(const Socket&); }; But there is a problem with this approach. The destructor must not throw, so a failure to release the resource will remain undetected. A common way out of this problem is to add a public method to release the resource. class Socket { public: virtual void close(); // may throw // ... }; Unfortunately, this approach introduces another problem: Our objects may now contain resources which have already been released. This complicates the implementation of the resource class. Even worse, it makes it possible for clients of the class to use it incorrectly. The following example may seem far-fetched, but it is a common pitfall in multi-threaded code. socket->close(); // ... size_t nread = socket->read(&buffer[0], buffer.size()); // wrong use! Either we ensure that the resource is not released before the object is destroyed, thereby losing any way to deal with a failed resource deallocation. Or we provide a way to release the resource explicitly during the object's lifetime, thereby making it possible to use the resource class incorrectly. There is a way out of this dilemma. But the solution involves using a modified shared pointer class. These modifications are likely to be controversial. Typical shared pointer implementations, such as boost::shared_ptr, require that no exception be thrown when their object's destructor is called. Generally, no destructor should ever throw, so this is a reasonable requirement. These implementations also allow a custom deleter function to be specified, which is called in lieu of the destructor when no reference to the object remains. The no-throw requirement is extended to this custom deleter function. The rationale for this requirement is clear: The shared pointer's destructor must not throw. If the deleter function does not throw, nor will the shared pointer's destructor. However, the same holds for other member functions of the shared pointer which lead to resource deallocation, e.g. reset(): If resource deallocation fails, no exception can be thrown. The solution proposed here is to allow custom deleter functions to throw. This means that the modified shared pointer's destructor must catch exceptions thrown by the deleter function. On the other hand, member functions other than the destructor, e.g. reset(), shall not catch exceptions of the deleter function (and their implementation becomes somewhat more complicated). Here is the original example, using a throwing deleter function: /** A TCP/IP connection. */ class Socket { public: static SharedPtr<Socket> connect(const std::string& address); protected: Socket(const std::string& address); virtual Socket() { } private: struct Deleter; // not implemented Socket(const Socket&); Socket& operator=(const Socket&); }; struct Socket::Deleter { void operator()(Socket* socket) { // Close the connection. If an error occurs, delete the socket // and throw an exception. delete socket; } }; SharedPtr<Socket> Socket::connect(const std::string& address) { return SharedPtr<Socket>(new Socket(address), Deleter()); } We can now use reset() to free the resource explicitly. If there is still a reference to the resource in another thread or another part of the program, calling reset() will only decrement the reference count. If this is the last reference to the resource, the resource is released. If resource deallocation fails, an exception is thrown. SharedPtr<Socket> socket = Socket::connect("localhost:80"); // ... socket.reset();

    Read the article

  • How to specify unique container styles for heterogenous hierarchies using SL3 and TreeView control

    - by rcecil
    Hello, Just look for strategies that have been successful in rendering hierarchies that represent inheritance structures using SL3/4 TreeViews. I need to render certain nodes differently than others, depending upon what kind of container they are (a choice between things, or simply a list of related things, etc.) So far, I've been very successful with the DataTemplate route: I've been able to use a technique described in Ted Glaza's post "Easy DataTemplateSelectors in Silverlight" (you may have retrieve a Google cache of this page). SO what I'm trying to discover is something on the order of a StyleSelector, not a DataTemplateSelector. I'm considering leveraging my current implementations of Glaza's pattern of selector objects to somehow detect the node type and set the ItemContainerStyle there, but it doesn't seem clear right now. Thanks for your thoughts.

    Read the article

  • Design interoperable web services

    - by Zyd
    Hi everyone, I'm designing a set of web services to allow our clients to connect from their apps to one of our systems. Our clients have their apps developed in all varieties of frameworks (.NET, Java, PHP, Python and even the occasional all JS app), so obviously WS is the way to go. Investigating a little about truly interop WS I've found that the way to go is to design first the WSDL and XSD and derive the implementations from there. What i'm really looking for is guidance if this is really the way to go. I've read that WCF creates interoperable WS but i'm not a fan of MS creating something standard. Should i use WCF or there is a good set of tools for designing WSDL and XSD without the pain i'm expecting. Thanks in advance

    Read the article

  • Tracing\profiling instructions

    - by LeChuck2k
    Hi Y'all. I'd like to statistically profile my C code at the instruction level. I need to know how many additions, multiplications, devides, etc,... I'm performing. This is not your usual run of the mill code profiling requirement. I'm an algorithm developer and I want to estimate the cost of converting my code to hardware implementations. For this, I'm being asked the instruction call breakdown during run-time (parsing the compiled assembly isn't sufficient as it doesn't consider loops in the code). After looking around, It seems VMWare may offer a possible solution, but I still couldn't find the specific feature that will allow me to trace the instruction call stream of my process. Are you aware of any profiling tools which enable this?

    Read the article

  • how to get an instance of an XMLEventAllocator?

    - by kostja
    I am trying to follow the recommended way of parsing XML with StAX using sun's Cursor-to-Event Example for Java EE 5. You are supposed to traverse the XML via the Cursor API and allocate an XMLEventusing an XMLEventAllocator when necessary. Awkwardly, sun's own example does not compile (at least not with JDK 1.6, even with 1.5 code compliance). The example tries to instantiate an allocator via new, but the according implementation classes in the JDK are not accessible externally. After reading the JavaDocs and searching the web I have found literally nothing. One could implement the XMLEventAllocator interface from scratch, but it seems really wrong, when there are perfectly good implementations in the JDK, besides not being an expert in StAX makes it difficult to get it right.

    Read the article

  • Is there a reliable way to activate / set focus to a window using C#?

    - by gtaborga
    Hey everyone, I'm trying to find a reliable way to activate / set focus a window using C#. Currently I'm attempting to achieve this using the following Windows API calls: SetActiveWindow(handle); SwitchToThisWindow(handle, true); Previously I also had ShowWindow(handle, SW_SHOWMAXIMIZED); executing before the other 2, but removed it because it was causing strange behavior. The problem I'm having with my current implementation is that occasionally the focus will not be set correctly. The window will become visible but the top part of it will still appear grayed out as if it wasn't in focus. Is there a way to reliably do this which works 100% of the time, or is the inconsistent behavior a side-effect I can't escape? Please let me know if you have any suggestions or implementations that always work. Thank you for your time.

    Read the article

  • Available options for hosting FTP server in .NET application

    - by duane
    I need to implement an FTP service inside my .NET application (running as a Windows Service) and have not had much luck finding good/current source code or vendors. Ideally it needs to be able to respond to the basic FTP Protocol and accept the data stream from an upload via a stream, enabling me to process the data as it is being received (think on the fly hashing). I need to be able to integrate it into my service because it will stack on top of our current code base with an existing custom TCP/IP communication protocol. I don't want to write (and then spend time debugging and performance testing) my own protocol, or implementation. I have already found plenty of ftp client implementations, I just need an acceptable server solution.

    Read the article

  • Forcing GWT to assume List is implemented as ArrayList

    - by joecks
    For some reason I'm stucked with model classes using List as Collection Type and I would like to use the model on the client side. However GWT of course fails serializing java.util.List. However all implementations of List in this model are based on ArrayList. So is it possible to tell GWT to assume List is ArrayList? Edit GWT fails on compile time, since a possible candidate for List is also java.util.Collections.SingeltonList - which can not be compiled. I'm using GWT 2.1 and Java 1.6 .

    Read the article

  • Methodologies or algorithms for filling in missing data

    - by tbone
    I am dealing with datasets with missing data and need to be able to fill forward, backward, and gaps. So, for example, if I have data from Jan 1, 2000 to Dec 31, 2010, and some days are missing, when a user requests a timespan that begins before, ends after, or encompasses the missing data points, I need to "fill in" these missing values. Is there a proper term to refer to this concept of filling in data? Imputation is one term, don't know if it is "the" term for it though. I presume there are multiple algorithms & methodologies for filling in missing data (use last measured, using median/average/moving average, etc between 2 known numbers, etc. Anyone know the proper term for this problem, any online resources on this topic, or ideally links to open source implementations of some algorithms (C# preferably, but any language would be useful)

    Read the article

  • Facebook Api - Local development, Testserver, Liveserver ... How?

    - by Thijs Kaspers
    I'm working on a new website that uses the Facebook API for users to login and several implementations of the graph Api. My workflow usually is: Development on localhost Development using MAMP/XAMPP or similar software Push to server - testing domain A team of people can test the changes for a few days to see if everything works as planned. Push to server - live domain Changes are live for public Facebook uses the site URL in the appsettings and for security reasons, they will only redirect to that url... Problem is.. I have localhost and 2 different domains. How can I make this work? Ofcourse I could edit the hostsfile, but that only fixes it for localhost.. Still no solution for the testdomain. Please tell me this is somehow possible! I'm getting more and more depressed with the Facebook API.

    Read the article

  • Playground for Artificial Intelligence?

    - by Dolph Mathews
    In school, one of my professors had created a 3D game (not just an engine), where all the players were entirely AI-controlled, and it was our assignment to program the AI of a single player. We were basically provided an API to interact with the game world. Our AI implementations were then dropped into the game together, and we watched as our programs went to battle against each other. It was like robot soccer, but virtual, and with lots of big guns. I'm now looking for anything similar (and open source) to play with. (Preferably in Java, but I'm open to any language.) I'm not looking for a game engine, or a framework... I'm looking for a complete game that simply lacks AI code... preferably set up for this kind of exercise. Suggestions?

    Read the article

  • OpenID PAM module

    - by Harvey Kwok
    I am looking for a PAM module that can use OpenID to do the authentication. My idea is that I want to logon my Linux box using my gmail account and password. I found there is a open source project in Google Code which seems to be doing the things I want but I don't see any code available for download. I saw there are so many examples or implementations but they are all about web apps. Is there any non-web based OpenID applications in the world? Is it technically possible to make a non-web based OpenID application? I naively think that it should be possible. I can emulate whatever packets the browser send out to the OpenID provider and get back the result. As long as my Linux box is connected to the Internet, I should be able to use my OpenID to login. Appreciate any comments, suggestions or pointers on how to make an OpenID PAM module. Thanks!

    Read the article

  • Ruby: Read large data from stdout and stderr of an external process on Windows

    - by BinaryMuse
    Greetings, all, I need to run a potentially long-running process from Ruby on Windows and subsequently capture and parse the data from the external process's standard output and error. A large amount of data can be sent to each, but I am only necessarily interested in one line at a time (not capturing and storing the whole of the output). After a bit of research, I found that the Open3 class would take care of executing the process and giving me IO objects connected to the process's standard output and error (via popen3). Open3.popen3("external-program.bat") do |stdin, out, err, thread| # Step3.profit() ? end However, I'm not sure how to continually read from both streams without blocking the program. Since calling IO#readlines on out or err when a lot of data has been sent results in a memory allocation error, I'm trying to continuously check both streams for available input, but not having much luck with any of my implementations. Thanks in advance for any advice!

    Read the article

  • NHibernate: discriminator without common base class?

    - by joniba
    Is it possible to map two classes to the same property without them sharing a common base class? For example, a situation like this: class Rule { public virtual int SequenceNumber { get; set; } public virtual ICondition Condition { get; set; } } interface ICondition { } class ExpressionCondition : ICondition { public virtual string Expression { get; set; } } class ThresholdCondition : ICondition { public virtual int Threshold { get; set; } } I also cannot add some empty abstract class that both conditions inherit from because the two ICondition implementations exist in different domains that are not allowed to reference each other. (Please no responses telling me that this situation should not occur in the first place - I'm aware of it and it doesn't help me.)

    Read the article

  • The shortest way to convert infix expressions to postfix (RPN) in C

    - by kuszi
    Original formulation is given here (you can try also your program for correctness) . Additional rules: 1. The program should read from standard input and write do standard output. 2. The program should return zero to the calling system/program. 3. The program should compile and run with gcc -O2 -lm -s -fomit-frame-pointer. The challenge has some history: the call for short implementations has been announced at the Polish programming contest blog in September 2009. After the contest, the shortest code was 81 chars long. Later on the second call has been made for even shorter code and after the year matix2267 published his solution in 78 bytes: main(c){read(0,&c,1)?c-41&&main(c-40&&(c%96<27||main(c),putchar(c))):exit(0);} Anyone to make it even shorter or prove this is impossible?

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >