Search Results

Search found 6357 results on 255 pages for 'generic relations'.

Page 166/255 | < Previous Page | 162 163 164 165 166 167 168 169 170 171 172 173  | Next Page >

  • iphone: Accessing Code for Elements Created in Interface Builder

    - by user362685
    I am attempting to create a basic tab-bar application using interface builder. I create a new project in Xcode selecting tab bar application. My question is how can I access the code that instantiates and pushes each of the views when the tab bar buttons are pressed? I would imagine that would be done by the tab bar controller, however when I write the class file from interface builder (filewrite class files), it just creates a blank generic TabBarController.h/TabBarController.m without the methods for pushing each of the views associated with the tab bar elements. I ask this because I would like to pass each view controller a reference to the data model when they are instantiated. Any help would be greatly appreciated, thanks.

    Read the article

  • correct way to store an exception in a variable

    - by Evan Teran
    I have an API which internally has some exceptions for error reporting. The basic structure is that it has a root exception object which inherits from std::exception, then it will throw some subclass of that. Since catching an exception thrown in one library and catching it in another can lead to undefined behavior (at least Qt complains about it and disallows it in many contexts). I would like to wrap the library calls in functions which will return a status code, and if an exception occurred, a copy of the exception object. What is the best way to store an exception (with it's polymorphic behavior) for later use? I believe that the c++0x futures API makes use of something like this. So what is the best approach? The best I can think of is to have a clone() method in each exception class which will return a pointer to an exception of the same type. But that's not very generic and doesn't deal with standard exceptions at all. Any thoughts?

    Read the article

  • An appropriate C API for inspecting attribute values

    - by uk82
    There are two obvious ways in C to provide outside access to internal attribute values (A) provide a generic interface that accepts a list of attributes that changes over time (some added / some die) or (B) a specific interface for each and every attribute. Example A: int x_get_attribute_value(ATT att) { if (a) return a_val; if (b) return b_val; } Example B: A_Enum x_get_a_type_attribute() {} B_Enum x_get_b_type_attribute() {} I recall that Eclipse's API is very much like A (I could be wrong). What I can't do is come up with a compelling argument against either. A is clean - any user will no where to go to find out a property value. It can evolve cleanly without leaving dead interfaces around. B has type checking to a degree - this is C enums! Is there a big hitter argument that pushes the balance away from opinion?

    Read the article

  • How to specify a web service URL within a Drupal module's simpletest?

    - by Matt V.
    I have a Drupal module that talks to a REST API on a separate server for user registration and authentication. The module runs on multiple sites which point to different servers which may run different versions of the REST API. Ideally, I'd like to be able to run each site against its own end-point, in case changes on the back end break things. Is there a way to dynamically specify a different end-point URL when running a test? Or do I have to edit the .test file for each site? I'm trying to keep the module's files as generic and flexible as possible. I guess I could have the .test file look for a .inc file that could override the URL, if needed for a particular site. Is there a better way though?

    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

  • Generics in custom configuration sections

    - by Jonn
    I tried making a custom configuration class that went on like this: WatcherServiceInfoSection<TWatcherServiceDetailElement> where TWatcherServiceDetailElement is a ConfigurationElement inside it. Now when I call the type in the ConfigSections area of AppConfig I get the error: An error occurred creating the configuration section handler for WatcherServiceInfo: Could not load type 'Library.Common.Utilities.ConfigurationHandler.WatcherServiceInfoSection<ASNDPService.Configuration.WatcherServiceDetailElement>' from assembly Is what I'm doing possible? Can I have generic types in the type attribute for a custom section element? EDIT Additionally, how about ConfigurationElementCollection objects? Like in the above example, how could I do a [ConfigurationProperty("WatcherServiceDetails", IsRequired = true, IsDefaultCollection = true)] [ConfigurationCollection(typeof(TWatcherServiceDetailElement), AddItemName = "WatcherServiceDetail")] public WatcherServiceDetailCollection<TWatcherServiceDetailElement> WatcherServiceDetails I'm aware that type parameters aren't allowed for attributes and that's what I want to know how to do.

    Read the article

  • How to prevent duplicates, macro or something?

    - by blez
    Well, the problem is that I've got a lot of code like this for each event passed to the GUI, how can I shortify this? Macros wont do the work I guess. Is there a more generic way to do something like a 'template' ? private delegate void DownloadProgressDelegate(object sender, DownloaderProgressArgs e); void DownloadProgress(object sender, DownloaderProgressArgs e) { if (this.InvokeRequired) { this.BeginInvoke(new DownloadProgressDelegate(DownloadProgress), new object[] { sender, e }); return; } label2.Text = d.speedOutput.ToString(); } private delegate void DownloadSpeedDelegate(object sender, DownloaderProgressArgs e); void DownloadSpeed(object sender, DownloaderProgressArgs e) { if (this.InvokeRequired) { this.BeginInvoke(new DownloadSpeedDelegate(DownloadSpeed), new object[] { sender, e }); return; } string speed = ""; speed = (e.DownloadSpeed / 1024).ToString() + "kb/s"; label3.Text = speed; }

    Read the article

  • What is the standard way to parse floats at runtime in C?

    - by Joel J. Adamson
    Hello, I have a scientific application for which I want to input initial values at runtime. I have an option to get them from the command line, or to get them from an input file. Either of these options are input to a generic parser that uses strtod to return a linked list of initial values for each simulation run. I either use the command-line argument or getline() to read the values. The question is, should I be rolling my own parser, or should I be using a parser-generator or some library? What is the standard method? This is the only data I will read at runtime, and everything else is set at compile time (except for output files and a few other totally simple things). Thanks, Joel

    Read the article

  • Get a queryset of objects through an intermediary model

    - by skyl
    I want get all of the Geom objects that are related to a certain content_object (see the function I'm trying to build at the bottom, get_geoms_for_obj() class Geom(models.Model): ... class GeomRelation(models.Model): ''' For tagging many objects to a Geom object and vice-versa''' geom = models.ForeignKey(Geom) content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() content_object = generic.GenericForeignKey() def get_geoms_for_object(obj): ''' takes an object and gets the geoms that are related ''' ct = ContentType.objects.get_for_model(obj) id = obj.id grs = GeomRelation.objects.filter( content_type=ct, object_id=id ) # how with django orm magic can I build the queryset instead of list # like below to get all of the Geom objects for a given content_object geoms = [] for gr in grs: geoms.append(gr.geom) return set(geoms) # A set makes it so that I have no redundant entries but I want the # queryset ordering too .. need to make it a queryset for so many reasons...

    Read the article

  • How can I search for an email using the zend framework?

    - by Ali
    Hi guys I need to build a functionality that involves searching through emails in an inbox for emails whose subjects match a certain user inputted keyword. SInce I'm using the zend framework I would like a solution that uses the zend framework libraries. Aside this I have noticed that the zend libraries are a bit limited with respect to my requirements for email handling. Is there any open library available in php which can be used for handling emails - when I mean handling emails I mean like: Ease to mark and flag emails Moving of emails from folder to folder. Parsing emails searching through emails SOrting emails etc - the stuff you would require if you wished to build a web client. EDIT ========= I'm looking for a generic solution here. The emails are in a regular email inbox on an IMAP server. I need a way to be able to read through and search for emails in the inbox using any specialized library to make it easier.

    Read the article

  • Hiring a project or development manager: what are good interview questions?

    - by Totophil
    What questions would you ask a candidate applying for a software project or development manager position? Please could you submit one question per answer (with multiple answer if necessary) or a sequence of related questions. This way eventually all questions will get ordered by how good we all think they are. Please also provide a short guidance for evaluating possible answers. UPDATE: It seems that a large proportion of the answers so far are aimed at generic management skills. What would you ask someone who is going to manage software development, let's say in your organisation? What knowledge, skills and attitude will you be looking for in the candidate replies?

    Read the article

  • Autoformat pom.xml without using m2eclipse plugin

    - by hashable
    I don't use the Eclipse maven plugin while developing in Eclipse. I generate my Eclipse classpath externally using the following command: mvn eclipse:eclipse This has worked fine for quite some time and I am not inclined to add a maven plugin. However, I would like to be able to "autoformat" my pom.xml file. My pom.xml is not showing up as a "Source" file and therefore the contextual "Source" menu doesn't show up. Control-Shift-F doesn't work either. Is there a way to do this without installing the m2eclipse plugin? Is there any other generic "XML Editor" plugin that can help with this?

    Read the article

  • Which is the UI technology of the future considering: eye-candy-effect, interactivity (gestures, voc

    - by user193655
    If you had to write a next-gen application, in which on the surface (UI) you need some "futuristic features", by considering the following aspects which is the choice you'd make? 1) eye-candy: cool UI, 3D, Effects, nice graphics, sound transitions... 2) user interaction: not only mouse and keyboard but touch, voice and more.... + user interactivity aspect, which is the technology you'd choose? 3) X-platform: this is to have some X-platform discussion. Of course single platform technologies (as WPF) have may be some more power, anyway in a general discussion considering X-platform as a resource is important 4) available components: of course the coolest technology with no available components is may be an option for a component developer but not for an application developer My question is generic, but anyway * have in mind data-driven apps, not pure multimedia apps, videogames, ....

    Read the article

  • os.path.getmtime() doesn't return fraction of a second

    - by haridsv
    I compile python 2.6.4 for centos 5.3 and find this issue that os.path.getmtime() or os.stat().m_time doesn't have the fraction part. As per docs, if os.stat_float_times() True, then it should return float value. In my case, I do see it as float, but no fraction part (it is 0). In [3]: os.path.getmtime('/tmp') Out[3]: 1268339116.0 In [4]: os.stat('/tmp') Out[4]: posix.stat_result(st_mode=17407, st_ino=508897L, st_dev=29952L, st_nlink=7, st_uid=0, st_gid=0, st_size=4096L, st_atime=1268101696, st_mtime=1268339116, st_ctime=1268339116) In [5]: os.stat_float_times() True In [6]: os.stat('/tmp').st_mtime Out[6]: 1268339116.0 It is also strange that the stat() output seems like an int. On windows, I do see a fraction part with the same python version. I am running centos on top of colinux, could that be playing a role, or is it some python build issue? I couldn't find any hits for generic colinux issue. May be it is how colinux configures the filesystem? What would I need to check in that case?

    Read the article

  • Problem in using C# generics with method overloading

    - by Siva Chandran
    I am trying to call an overloaded method based on the generic type. I've been doing this in C++ without any pain. But I really don't understand why am not able to do this in C# with generics. Can anybody help me how can I achieve this in C# with generics? class Test<T> { public T Val; public void Do(T val) { Val = val; MainClass.Print(Val); } } class MainClass { public static void Print(UInt16 val) { Console.WriteLine("UInt16: " + val.ToString()); } public static void Print(UInt32 val) { Console.WriteLine("UInt32: " + val.ToString()); } public static void Print(UInt64 val) { Console.WriteLine("UInt64: " + val.ToString()); } public static void Main (string[] args) { Test<UInt16> test = new Test<UInt16>(); test.Do(); } }

    Read the article

  • Send javax.mail.internet.MimeMessage to a recipient with non-ASCII name?

    - by phyzome
    I am writing a piece of Java code that needs to send mail to users with non-ASCII names. I have figured out how to use UTF-8 for the body, subject line, and generic headers, but I am still stuck on the recipients. Here's what I'd like in the "To:" field: "????????????" <[email protected]>. This lives (for our purposes today) in a String called recip. msg.addRecipients(MimeMessage.RecipientType.TO, recip) gives "?????S]" <[email protected]> msg.addHeader("To", MimeUtility.encodeText(recip, "utf-8", "B")) throws AddressException: Local address contains control or whitespace in string ``=?utf-8?B?IuOCpuOCo+OCreODmuODh+OCo+OCouOBq+OCiOOBhuOBk+OBnSIgPA==?= =?utf-8?B?Zm9vQGV4YW1wbGUuY29tPg==?='' How the heck am I supposed to send this message?

    Read the article

  • How to retrieve the file icons and file previews used by windows explorer?

    - by user193655
    I am developing a Delphi documents management application, so somehow I am giving the user some functionality similar to windows explorer. Currently I am using imagelists where I manually maintain the icons (like one for pdf, one for xls, ...) and when I need to display an icon for a filetype that I don't explicitly support I have a generic icon. Is there a way to retrieve the icon used by windows, like MyTImage := GiveMeDefaultIconForExtension('pdf'); In Vista and Seven this should be an icon with multiple resolutions I think. Moreover I would like to know if there is a way to get the preview used by windows explorer. For example windows explorer creates a small thumbnail for a pdf document for example, and displays it when the user chooses to view "big icons". Is there a way to retrieve that preview? MyTImage := GiveMePreviewForFile('C:\Test\File.pdf');

    Read the article

  • WordPress Monthly Archive by Year

    - by PaulDavis
    WordPress extraordinaires, I need your help! I need to be able to list the archives, but in a slightly different way than the WP codex, or an hour of Googling will show me. I need the months of the year, as the generic archive function, but only for one year at a time. So, list all the months in 2007. I'll need to be able to use this multiple times in the same template too, for different years. I've got a feeling query_posts might be the way, but I'm not too sure. Anyone got some ideas?

    Read the article

  • A c# Generics question involving Controllers and Repositories

    - by UpTheCreek
    I have a base repository class which contains all the common repository methods (as generic): public abstract class BaseRepository<T, IdType> : IBaseRepository<T, IdType> My repositories from this base e.g.: public class UserRepository : BaseRepository<User, int>, IUserRepository I also have a base controller class containing common actions, and inherit from this in controllers. The repository is injected into this by DI. E.g. public class UserController : BaseController<User> { private readonly IUserRepository userRepository; public UserController (IUserRepository userRepository) { this.userRepository= userRepository; } My question is this: The base controller needs to be able to access the repository methods that are defined in the base repository. However I'm passing in via DI a different repository type for each controller (even though they all inherrit from the base repository). How can the base controller somehow access the repository that is passed in (regardless of what type it is), so that it can access the common base methods?

    Read the article

  • asp.net login control with role redirection

    - by Eatdoku
    Hi, I am using a asp.net login control with one of my asp.net application to authenticate users. I also have roles defined as well. Some of the directories are setup so only users with ROLE "MANAGER" are able to access pages under those directories. If the user does not have "MANAGER" role, he will simply be redirect back to the login page. so my question is that for the out of box login control, is there a way to show the proper login fail error message? for user trying to login but does not have a proper ROLE assigned to them, instead of a generic error message saying "login failed" thanks.

    Read the article

  • Designing constructors around type erasure in Java

    - by Internet Friend
    Yesterday, I was designing a Java class which I wanted to be initalized with Lists of various generic types: TheClass(List<String> list) { ... } TheClass(List<OtherType> list) { ... } This will not compile, as the constructors have the same erasure. I just went with factory methods differentiated by their names instead: public static TheClass createWithStrings(List<String> list) public static TheClass createWithOtherTypes(List<OtherType> list) This is less than optimal, as there isn't a single obvious location where all the different options for creating instances are available. I tried to search for better design ideas, but found surprisingly few results. What other patterns exist for designing around this problem?

    Read the article

  • Floating point comparison in STL, BOOST

    - by Paul
    Is there in the STL or in Boost a set of generic simple comparison functions? The one I found are always requiring template parameters, and/or instantiation of a struct template. I'm looking for something with a syntax like : if ( is_greater(x,y) ) { ... } Which could be implemented as : template <typename T> bool is_greater(const T& x, const T& y) { return x > y + Precision<T>::eps; }

    Read the article

  • Django: Can class-based views accept two forms at a time?

    - by Hooman
    If I have two forms: class ContactForm(forms.Form): name = forms.CharField() message = forms.CharField(widget=forms.Textarea) class SocialForm(forms.Form): name = forms.CharField() message = forms.CharField(widget=forms.Textarea) and wanted to use a class based view, and send both forms to the template, is that even possible? class TestView(FormView): template_name = 'contact.html' form_class = ContactForm It seems the FormView can only accept one form at a time. In function based view though I can easily send two forms to my template and retrieve the content of both within the request.POST back. variables = {'contact_form':contact_form, 'social_form':social_form } return render(request, 'discussion.html', variables) Is this a limitation of using class based view (generic views)? Many Thanks

    Read the article

  • NHibernate Criteria Transform Result

    - by isuruceanu
    Hi I have an SecurityGroup entity witch has Memebers and Application properties. Application is a lookup. So securityGroups is in many-to-many relationship with User table and one-to-many with LookupApplciation (FK) Now I want to select all application linked to a specific user. I have follow criteria: public IList<LookupApplication> GetApplicationByUser(User user) { return this.Session.CreateCriteria(typeof(SecurityGroup), "sg") .CreateAlias("Members", "u") .CreateAlias("Application", "al") .Add(Restrictions.Eq("u.Id", user.Id)) .List<LookupApplication>(); } It trows an exception The value "Edi.Advance.Core.Model.Security.SecurityGroup" is not of type "Edi.Advance.Core.Model.Lookups.LookupApplication" and cannot be used in this generic collection. Parameter name: value and it is right. How can I transform the result to IList<LookupApplication>? Thanks

    Read the article

  • Extension method return using generics

    - by Steven de Salas
    Is it possible to return a generic type using extension methods? For example, I have the following method: // Convenience method to obtain a field within a row (as a double type) public static double GetDouble(this DataRow row, string field) { if (row != null && row.Table.Columns.Contains(field)) { object value = row[field]; if (value != null && value != DBNull.Value) return Convert.ToDouble(value); } return 0; } This is currently used as follows: double value = row.GetDouble("tangible-equity"); but I would like to use the following code: double value = row.Get<double>("tangible-equity"); Is this possible and if so, what would the method look like?

    Read the article

< Previous Page | 162 163 164 165 166 167 168 169 170 171 172 173  | Next Page >