Search Results

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

Page 169/255 | < Previous Page | 165 166 167 168 169 170 171 172 173 174 175 176  | Next Page >

  • VC++ how to change a picturebox from header file

    - by JimboJones
    HI, Just ran into a problem. How to I change a picturebox's picture from within a different header file. If I do it in the same .h file as the Form I am working on I use: sq1-Image = bi; (which loads in a bitmap) but when I do it from another header (i've included the correct header file), I get "sq1 is an undeclared identifier" and "left of '-image' must point to a class/struct/union/generic" What I'm looking for is something like Form1::sq1-Image = bi; Basically I just want to point the program to change picturebox from another location....Is this possible? How can I do this? Cheers!

    Read the article

  • R: how to make a unique set of names from a vector of strings?

    - by Mike Dewar
    Hi, I have a vector of strings. Check out my vector, it's awesome: > awesome [1] "a" "b" "c" "d" "d" "e" "f" "f" I'd like to make a new vector that is the same length as awesome but where, if necessary, the strings have been uniqueified. For example, a valid output of my desired function would be > awesome.uniqueified [1] "a" "b" "c" "d.1" "d.2" "e" "f.1" "f.2" Is there an easy, R-thonic and beautiful way to do this? I should say my list in real life (it's not called awesome) contains 25000ish mircoarray probeset identifiers. I'm always nervous when I embark on writing little generic functions (which I'm sure I could do) as I'm sure some R guru has come across this problem in the past, nailed it with some incredible algorithm that doesn't even have to store more than half an element in the vector. I'm just not sure what they might have called it. Probably not uniqueify.

    Read the article

  • design patterns for hierarchical structures

    - by JLBarros
    Anyone knows some design patterns for hierarchical structures? For example, to manage inventory categories, accounting chart of accounts, divisions of human resources, etc.. Thank you very much in advance EDIT: Thanks for your interest. I am looking for a better way of dealing with hierarchical items to which they should apply operations depending on the level of hierarchy. I have been studying the patterns by Martin Fowler, for example Accounting, but I wonder if there are other more generic. The problem is that operations apply to the items must be possible to change even at run time and may depend on other external variables. I thought of a kind of strategy pattern but would like to combine it with the fact that it is a hierarchical scheme. I would appreciate any reference to hierarchical patterns and you'll take care of them in depth.

    Read the article

  • Drupal Views limiting content posted by group membership

    - by digital
    Hi, I have various different content types and I want to filter by using views. So say a block only displays content posted in groups that you are a member of. I've created my generic view which so far displays all content of that type, but I'm struggling with linking this to content only posted in groups your a member of. I've looked at the Organic Groups filters but no luck there. I suspect I might need to use some sort of relationship but I'm stuck there. Any help would be greatly appreciated.

    Read the article

  • jquery animating different img widths

    - by romeozor
    Hi there, I've been searching for an answer for a long time with no avail, so it's time to ask. I'm trying to use .animate() to change the size of an image once clicked. The first state of the image would be a thumbnail size, which would animate to the image's original size, then to a thumbnail again. The problem is, not all the images have the same "original" size so I need a way to tell one generic function to switch to the current image's original size. This is my current code which loads on $(window).load: $('img[class=resize]').click(function (){ if ($(this).width() != 150) { $(this).animate({width: '150px'}, 400); } else { $(this).animate({width: ''}, 400); } }); Now this obviously doesn't work the way I want it, because .animate() thinks when I say width: '' I want to make the width = 0. Any suggestions how I should go about this?

    Read the article

  • How to raise CComponent event in Yii

    - by srigi
    Let's assume I have Component (say Graph like Yahoo Finance) rendered on the page. Component view template contains bunch of a_hrefs which I wanto to switch period in graph. I created Event and Event handler in Component. I have two questions: How to raise event on Graph Component via those a_hrefs (should they be part of Graph?)? How to redraw Graph without loosing curent page context (section, filter - specified as $_GET values)? My Graph Component look like this: Yii::import('zii.widgets.CPortlet'); class Graph extends CPortlet { private $_period; /* ********************** * * COMPONENT PROPERTIES * * ********************** */ public function getPeriod() { return $this-_period; } public function setPeriod($period) { $this-_period = $period; } /* ********************** * * GENERIC * * ********************** */ public function init() { parent::init(); // assign event handlers $this-onPeriodChange = array($this, 'handlePeriodChange'); } protected function renderContent() { $this-render('graph'); } /* ********************** * * EVENTS * * ********************** */ public function onPeriodChange($event) { $this-raiseEvent('onPeriodChange', $event); } /* ********************** * * EVENT HANDLERS * * ********************** */ public function handlePeriodChange($event) { // CODE } }

    Read the article

  • Generics and reflection in Java

    - by Ragesh
    This is probably a very basic question, but I'm really new to generics in Java and I'm having a hard time altering my thought process from the way things are done in C#, so bear with me. I'm trying to build a generic repository in Java. I've created an IRepository interface that looks like this: public interface IRepository<T extends IEntity> And a Repository class that looks like this: public class Repository<T extends IEntity> implements IRepository<T> Now, from within the constructor of my Repository class, I'd like to be able to "divine" the exact type of T. For example, if I instantiated a repository like this: IRepository<MyClass> repo = new Repository<MyClass>(); I'd like to know that T is actually MyClass. This is trivial in C#, but obviously generics are a totally different beast in Java and I can't seem to find anything that would help me do this.

    Read the article

  • Implement VOIP in iphone and ipad.

    - by user339994
    Hi, Does anybody is aware of implementing VOIP feature in iphone and ipad. The Things for which i need clarity is, By using which third party library/protocol can i implement this feature? or is der any in built classed available in objective c which i can make use of?? Is there any Apple store accepted iphone application which uses VOIP iplementation?? If so where can i get implementation details of it. This is a generic question. Can we use any third party's in our iphone application or do we need to get any special permission from Apple reg the usage of third party's used. Please let me know if needed more details reg this. Thanks , Santhana

    Read the article

  • When is it useful to define your own delegates instead of using the generics?

    - by Carlos
    I've been going through some old code, where I came across some custom defined delegates, which are used thus: private delegate void ListenDelegate(UdpClient listener, bool multicast); private void ListenOn(UdpClient listener, bool multicast) { new ListenDelegate(_ListenLoop).BeginInvoke(listener, multicast, null, null); } With some of the new .NET framework versions, you can do the following: private void ListenOn(UdpClient listener, bool multicast) { new Action<UdpClient, bool>(_ListenLoop).BeginInvoke(listener, multicast, null, null); } This ought to be exactly the same. Is there any point in defining your own delegates, when the generic delegates seem to do the same job with less space? Or have I missed something about the generics that makes them not equivalent?

    Read the article

  • How to solve this Java type safety warning? (Struts2)

    - by Nicolas Raoul
    Map session = ActionContext.getContext().getSession(); session.put("user", user); This code generates a warning: Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map should be parameterized. Map<String, Serializable> session = (Map<String, Serializable>)ActionContext.getContext().getSession(); session.put("user", user); This code generates a warning: Type safety: Unchecked cast from Map to Map. The getSession method belongs to Struts2 so I can't modify it. I would like to avoid using @SuppressWarnings because other warnings can be useful. I guess all Struts2 users in the world faced the same problem... is there an elegant solution?

    Read the article

  • How to detect crashing tabed webbrowser and handle it?

    - by David Eaton
    I have a desktop application (forms) with a tab control, I assign a tab and a new custom webrowser control. I open up about 10 of these tabs. Each one visits about 100 - 500 different pages. The trouble is that if 1 webbrowser control has a problem it shuts down the entire program. I want to be able to close the offending webbrowser control and open a new one in it's place. Is there any event that I need to subscribe to catch a crashing or unresponsive webbrowser control ? I am using C# on windows 7 (Forms), .NET framework v4 =============================================================== UPDATE: 1 - The Tabbed WebBrowser Example Here is the code I have and How I use the webbrowser control in the most basic way. Create a new forms project and name it SimpleWeb Add a new class and name it myWeb.cs, here is the code to use. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Security.Policy; namespace SimpleWeb { //inhert all of webbrowser class myWeb : WebBrowser { public myWeb() { //no javascript errors this.ScriptErrorsSuppressed = true; //Something we want set? AssignEvents(); } //keep near the top private void AssignEvents() { //assign WebBrowser events to our custom methods Navigated += myWeb_Navigated; DocumentCompleted += myWeb_DocumentCompleted; Navigating += myWeb_Navigating; NewWindow += myWeb_NewWindow; } #region Events //List of events:http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser_events%28v=vs.100%29.aspx //Fired when a new windows opens private void myWeb_NewWindow(object sender, System.ComponentModel.CancelEventArgs e) { //cancel all popup windows e.Cancel = true; //beep to let you know canceled new window Console.Beep(9000, 200); } //Fired before page is navigated (not sure if its before or during?) private void myWeb_Navigating(object sender, System.Windows.Forms.WebBrowserNavigatingEventArgs args) { } //Fired after page is navigated (but not loaded) private void myWeb_Navigated(object sender, System.Windows.Forms.WebBrowserNavigatedEventArgs args) { } //Fired after page is loaded (Catch 22 - Iframes could be considered a page, can fire more than once. Ads are good examples) private void myWeb_DocumentCompleted(System.Object sender, System.Windows.Forms.WebBrowserDocumentCompletedEventArgs args) { } #endregion //Answer supplied by mo. (modified)? public void OpenUrl(string url) { try { //this.OpenUrl(url); this.Navigate(url); } catch (Exception ex) { MessageBox.Show("Your App Crashed! Because = " + ex.ToString()); //MyApplication.HandleException(ex); } } //Keep near the bottom private void RemoveEvents() { //Remove Events Navigated -= myWeb_Navigated; DocumentCompleted -= myWeb_DocumentCompleted; Navigating -= myWeb_Navigating; NewWindow -= myWeb_NewWindow; } } } On Form1 drag a standard tabControl and set the dock to fill, you can go into the tab collection and delete the pre-populated tabs if you like. Right Click on Form1 and Select "View Code" and replace it with this code. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using mshtml; namespace SimpleWeb { public partial class Form1 : Form { public Form1() { InitializeComponent(); //Load Up 10 Tabs for (int i = 0; i <= 10; i++) { newTab("Test_" + i, "http://wwww.yahoo.com"); } } private void newTab(string Title, String Url) { //Create a new Tab TabPage newTab = new TabPage(); newTab.Name = Title; newTab.Text = Title; //create webbrowser Instance myWeb newWeb = new myWeb(); //Add webbrowser to new tab newTab.Controls.Add(newWeb); newWeb.Dock = DockStyle.Fill; //Add New Tab to Tab Pages tabControl1.TabPages.Add(newTab); newWeb.OpenUrl(Url); } } } Save and Run the project. Using the answer below by mo. , you can surf the first url with no problem, but what about all the urls the user clicks on? How do we check those? I prefer not to add events to every single html element on a page, there has to be a way to run the new urls thru the function OpenUrl before it navigates without having an endless loop. Thanks.

    Read the article

  • How do I *really* justify a horizontal menu in HTML+CSS?

    - by flight
    You find plenty of tutorials on menu bars in HTML, but for this specific (though IMHO generic) case, I haven't found any decent solution: # THE MENU ITEMS SHOULD BE JUSTIFIED JUST AS PLAIN TEXT WOULD BE # # ^ ^ # # There's an varying number of text-only menu items and the page layout is fluid. # # The first menu item should be left-aligned, the last menu item should be right- # # aligned. The remaining items should be spread optimal on the menu bar. # # # # The number is varying,so there's no chance to pre-calculate the optimal widths. # # # # Note that a TABLE won't work here as well: # # - If you center all TDs, the first and the last item aren't aligned correctly. # # - If you left-align and right-align the first resp. the last items, the spacing # # will be sub-optimal. # Isn't it strange that there is no obvious way to implement this in a clean way by using HTML+CSS?

    Read the article

  • Using Visual Studio to create web application in Sharepoint 2010

    - by bryan0010
    Hello, I am looking for pointers, examples, etc. to create a basic application in sharepoint 2010 using visual studio. The application would show a list on page 1 (driven by linq entities). When you click a row, it shows a details page. I've gone through the tutorials but could not find a basic crud-like example as explained above. Any help would be greatly appreciated. If I missed something in one of the tutorials, please let me know. To summarize, in a very generic way; I am looking for information on how to display two web application pages and have the user click a link or control to move through pages. Regards, Bryan

    Read the article

  • Simplest LINQ in C# troubleshooting.

    - by Jay
    I'm trying to learn a bit of LINQ but I'm having compile issues right off the bat. Is there any specific reason why this won't work? using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace HelloLINQ { class HelloLINQ { public static void Main() { Example1(); } public static void Example1() { var numbers = new int[] { 1, 5, 3, 7, 3, 8, 9, 3, 6, 6, 2 }; var under5 = from n in numbers select n; foreach (var n in under5) { Console.WriteLine(n); } } } } The error is: Could not find an implementation of the query pattern for source type 'int[]'. 'Select' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?

    Read the article

  • Handling exceptions, is this a good way?

    - by Jorge Córdoba
    We're struggling with a policy to correctly handle exceptions in our application. Here's our goals for it (summarized): Handle only specific exceptions. Handle only exceptions that you can correct Log only once. We've come out with a solution that involves a generic Application Specific Exception and works like this in a piece of code: try { // Do whatever } catch(ArgumentNullException ane) { // Handle, optinally log and continue } catch(AppSpecificException) { // Rethrow, don't log, don't do anything else throw; } catch(Exception e) { // Log, encapsulate (so that it won't be logged again) and throw Logger.Log("Really bad thing", e.Message, e); throw new AppSpecificException(e) } All exception is logged and then turned to an AppSpecificException so that it won't be logged again. Eventually it will reach the last resort event handler that will deal with it if it has to. I don't have so much experience with exception handling patterns... Is this a good way to solve our goals? Has it any major drawbacks or big red warnings?

    Read the article

  • Polymorphic classes in templates

    - by soxarered
    Let's say we have a class hierarchy where we have a generic Animal class, which has several classes directly inherit from it (such as Dog, Cat, Horse, etc..). When using templates on this inheritance hierarchy, is it legal to just use SomeTemplateClass<Animal> and then shove in Dogs and Cats and Horses into this templated object? For example, assume we have a templated Stack class, where we want to host all sorts of animals. Can I simply state Stack<Animal> s; Dog d; s.push(d); Cat c; s.push(c);

    Read the article

  • Is there a standard .NET exception to throw when a class doesn't implement a required attribute?

    - by a typing monkey
    Suppose I want to throw a new exception when invoking a generic method with a type that doesn't have a required attribute. Is there a .NET exception that's appropriate for this situation, or, more likely, one that would be a suitable ancestor for a custom exception? For example: public static class ClassA { public static T DoSomething<T>(string p) { Type returnType = typeof(T); object[] typeAttributes = returnType.GetCustomAttributes(typeof(SerializableAttribute), true); if ((typeAttributes == null) || (typeAttributes.Length == 0)) { // Is there an exception type in the framework that I should use/inherit from here? throw new Exception("This class doesn't support blah blah blah"); // Maybe ArgumentException? That doesn't seem to fit right. } } } Thanks.

    Read the article

  • Create a WebPart which displays people who have rights on lists

    - by cocoggu
    I want to develop a WebPart in C# to display peoples who have a certain right on the list of the SharePoint page. So I began by creating a "Visual Web Part" in VS2010, and in the View Designer I add a DataList because I think it is the most relevant. But now, I don't know how to link my data with this DataList. It ask me for an XML file but which one choose ? And where can I take it ? After all, how to make this WebPart generic with all my SharePoint pages which implements one list ?

    Read the article

  • Where are graphically pleasing examples of Lists

    - by slim
    Anyone know of good code examples of how to make lists look different than your everyday average black list or more graphically pleasing than you usually see in android apps. I've looked through google code but haven't found too many. I'm looking for different and eye catching lists. I hope this question isn't too generic. Also i'm open to anything, code, examples, blog posts, etc, you name it. I've really struggled with lists and making them look more snazzy. I'm talking more the code level not the graphics or icons used.

    Read the article

  • Using xsl param (if exists) to replcae attribute value

    - by Assaf
    I would like an xsl that replaces the value attribute of the data elements only if the relevant param names are passed. Input <applicationVariables applicationServer="tomcat"> <data name="HOST" value="localhost"/> <data name="PORT" value="8080"/> <data name="SIZE" value="1000"/> </applicationVariables> So for example if passing in a param HOST1=myHost and PORT=9080 the output should be: <applicationVariables applicationServer="tomcat"> <data name="HOST" value="myHost"/> <data name="PORT" value="9080"/> <data name="SIZE" value="1000"/> </applicationVariables> Note that HOST and PORT where replaced but SIZE was not replaced because there was no parameter with name SIZE Since the list of data elements is long (and may change), i would like a generic way of doing this with xsl

    Read the article

  • Website access per client and each client having multiple users Sample Application

    - by windson
    I'm interested in building a web application in .NET that is scalable to multiple Clients and each and every Client has users associated with them. Suppose that my website is xyz.com and I have 3 clients "abc", "klm", "pqr" and I want to give access to features of xyz.com under the link as follows www.xyz.com/abc www.xyz.com/klm www.xyz.com/pqr and Client abc has N users and I want to set 3 roles for every client's user role. Is there any sample application in .NET that support this kind of website access per client having multiple users? And If I use ASP.NET Membership will that be a suitable membership solution or Do I need to opt for any other type of Membership defined by my own or already available in open source market for .NET. Edit: All the clients will have same functionality. I would like to build a generic model for www.xyz.com/{whatever} so that in future if a new client want to register with me he/she just have to give client name and up on adding client name all the features avaiable to exising clients will be applicable.

    Read the article

  • Avoid stuck calling callback

    - by andlomba
    Hello all, This is a question about generic c++ event driven applications design. Lets assume that we have two threads, a "Dispatcher" (or "Engine"...) and a "Listener" (or "Client"...). Let's assume that I write the Dispatcher code, and release it as a library. I also write the Listener interface, of course. When the Dispatcher executes (after Listener registration) listenerInstance.onSomeEvent(); the event handling code will actually be executed by the Dispatcher thread, so if the person that implements the Listener writes something like void Listener::onSomeEvent() { while(true) ; } The Dispatcher will stuck forever. Is there a "plain old c++" (I mean no boost or libsigc++) way to "decouple" the two classes, so I can be sure that my Dispatcher will work fine whatever the Listeners does in the callbacks? bye and thanks in advance, Andrea

    Read the article

  • Remove items from one list in another

    - by coffeeaddict
    I'm trying to figure out how to traverse a generic list of items that I want to remove from another list of items. So lest say I have this as a hypothetical example List<car> list1 = GetTheList(); List<car> list2 = GetSomeOtherList(); I want to traverse list1 with a foreach and remove each item in List1 in List2. I'm not quite sure how to go about that as foreach is not index based.

    Read the article

  • Finding Windows printer driver name using API

    - by Scott Bussinger
    I can't seem to find an API call that returns the driver name for a Windows printer. Note that I'm not talking about the friendly name of the printer in the printer folder, I'm talking about the name of actual driver being used as shown on the "Advanced" tab when you look at the printer properties: I'm trying to detect when I'm printing to the "Generic / Text Only" driver regardless of what name the user chooses for the printer. It doesn't seem like this should be hard, but I can't find it in the DEVMODE structure or anyplace else I've thought to look for it. Thanks for the help!

    Read the article

  • How to check with PHP does a SQL database already have

    - by Dan Horvat
    I've tried to find the answer to this question but none of the answers fit. I have two databases, one has 15.000.000 entries and I want to extract the necessary data and store it in a much smaller database with around 33.000 entries. Both databases are open at the same time. Or at least they should be. While having the big database open and extracting the entries from it, is it possible to check whether the value already exists in the smaller database? I just need some generic way which checks that.

    Read the article

< Previous Page | 165 166 167 168 169 170 171 172 173 174 175 176  | Next Page >