Search Results

Search found 6987 results on 280 pages for 'examples'.

Page 9/280 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • QPrinter, QPrintDialog giving errors not encountered in code examples

    - by karunesh
    In the imageviewer example, QPainter and QPrintDialog objects are defined and used as following: #ifndef QT_NO_PRINTER QPrinter printer; #endif and QPrintDialog dialog(&printer, this); A QPainter object is then initialized with QPrinter (printer). When I tried to use the same code in my function, it looks like: void imageviewer::print() { ... #ifdef QT_NO_PRINTER QPrinter printer(this); //ERROR 1 QPrintDialog dialog(&printer, this);//ERROR 2 and 3 if (dialog.exec()) //ERROR 4 { //do the painting } #endif } The errors are: 1. variable 'QPrinter printer' has initializer but incomplete type 2. 'QPrintDialog' was not declared in this scope 3. Expected ';' before 'dialog' 4. 'dialog' was not declared in this scope What I am notable to understand is why are these errors arising when I am using them in my code, but not in the example. As a friend pointed out, I made sure that I used the right #include files and made sure that 'printer' and 'dialog' were not touched anywhere else in the example.

    Read the article

  • Rails: show some examples of code from controllers, models and views

    - by Totty
    Hy, my controller example: class FriendsController < ApplicationController before_filter :authorize, :except => [:friends] ############## ############## ## REQUESTS ## ############## ############## ################## # GET MY FRIENDS # ################## # Get my friends. def friends @friends = @my_profile.friends.paginate({:page => params[:page], :per_page => 3}) @profile = @my_profile end ################### # REMOVED FRIENDS # ################### # Get my deleted friends. def removed_friends @removed_friends = @my_profile.friends('removed_friends', params[:page]) end ################### # PENDING FRIENDS # ################### # Friend requests made by other profiles to me. def pending_friends @pending_friends = @my_profile.friends('pending_friends', params[:page]) end ############################ # REJECTED PENDING FRIENDS # ############################ # Rejected friend requests made by other profiles to me. def rejected_pending_friends @rejected_pending_friends = @my_profile.friends('rejected_pending_friends', params[:page]) end ##################### # REQUESTED FRIENDS # ##################### # The friend requests I've sent to others profiles. def requested_friends @requested_friends = @my_profile.friends('requested_friends', params[:page]) end ############################# # DELETED REQUESTED FRIENDS # ############################# # The requests I've sent to others # profiles and then canceled. def deleted_requested_friends @deleted_requested_friends = @my_profile.friends('deleted_requested_friends', params[:page]) end ############# ############# ## ACTIONS ## ############# ############# ########################## # ADD FRIENDSHIP REQUEST # ########################## # Add a friendship request. def add_friendship_request friendship = @my_profile.add_friendship_request(params[:profile_id]) render :json => friendship end ############################# # REMOVE FRIENDSHIP REQUEST # ############################# # Removes a friendship request I've done. def remove_friendship_request friendship = @my_profile.remove_friendship_request(params[:profile_id]) render :json => friendship end ###################### # PROCESS FRIENDSHIP # ###################### # Process friendship: accept or reject a friend. # This will make a new friend or # will make a new rejected pending friend. def process_friendship friendship = @my_profile.process_friendship(params[:profile_id].to_i, params[:accepted].to_i) render :json => friendship end ################### # REMOVE A FRIEND # ################### # Remove a friend from my friends by id. def remove_friend friendship = @my_profile.remove_friend(params[:profile_id]) render :json => friendship end end

    Read the article

  • Examples of when to use PageAsyncTask (Asynchronous asp.net pages)

    - by Tony_Henrich
    From my understanding from reading about ASP.NET asynchronous pages, the method which executes when the asynchronous task begins ALWAYS EXECUTES between the prerender and the pre-render Complete events. So because the page's controls' events run between the page's load and prerender events, is it true that whatever the begin task handler (handler for BeginAsync below) produces, it can't be used in the controls' events? So for example, if the handler gets data from a database, the data can't be used in any of the controls' postback events? Would you bind data to a data control after prerender? PageAsyncTask pat = new PageAsyncTask(BeginAsync, EndAsync, null, null, true); this.RegisterAsyncTask(pat);

    Read the article

  • Examples for Winsock?

    - by bobber205
    What do you guys recommend for a resource for winsock? I have an assignment that we have only have a few days to do that needs to send a simple packet using UDP (and receive the same type of packet). I am fairly familiar with C# sockets but nothing with C++. Any tips or resources?

    Read the article

  • NVIDIA CUDA SDK Examples Compilation Unsupported Architecture 'computer_20'

    - by Andrew Bolster
    On compilation of the CUDA SDK, I'm getting a nvcc fatal : Unsupported gpu architecture 'compute_20' My toolkit is 2.3 and on a shared system (i.e cant really upgrade) and the driver version is also 2.3, running on 4 Tesla C1060s If it helps, the problem is being called in radixsort. It appears that a few people online have had this problem but i havent found anywhere that actually gives a solution.

    Read the article

  • Using MOA to classify new examples?

    - by Sam Zetoloth
    I'm trying to use the java machine learning library MOA to train on a training data stream, then predict classes for a test data stream. The first part works fine, using (for example) java -cp .:moa.jar:weka.jar -javaagent:sizeofag.jar moa.DoTask "LearnModel -l MajorityClass -s (ArffFileStream -f atrain.arff -c -1) -O amodel.moa" But then I cannot figure out how to use the trained model (amodel.moa) on another stream (atest.arff) to predict the classes. Has anyone done this before?

    Read the article

  • portlet-mvc 3.0 + maven for websphere portlet: examples?

    - by Mike
    I'm trying to develop a websphere portal portlet using java, maven and spring-portlet-mvc 3.0.2.RELEASE but so far I'm not having a lot of luck. The problem that I'm having is that a lot of the tutorials are either outdated, incorrect, contradict eachother or a combination of all the above. Also I have to use RAD but the tutorials also contradict eachother, logically I'd think you'd choose new portlet project, but http://www.ibm.com/developerworks/websphere/library/techarticles/0802_patil-pt1/0802_patil-pt1.html says to use a dynamic webproject. So I was wondering if anyone had a nice example/good tutorial.

    Read the article

  • How do Tomcat examples work?

    - by Bialecki
    Alright, this is a very simple question. I just installed Tomcat 6 on my Mac to play around with it, and every tutorial I look at says the first thing to do to create a new web application is to add a line to the server.xml file with defines a new Context. Fair enough. However, my question is, I don't see a line in there for the example web applications, so how do those work?

    Read the article

  • jQuery UI autocomplete examples

    - by RUtt
    I'm hoping someone can help with this, I'm having a real difficult time getting jQueryUI's autocomplete to work with ajax in a asp.net app (not MVC). I can get it to make the ajax call but I'm not doing something right handling the response. Just for starters I'm trying to have autocomplete make an ajax call to 'GetSuggestions.aspx' which will return a hard coded string. I have it where it will make the call to GetSuggestions.aspx but I can't get it to return anything to the page. (My next step would be to have 'GetSuggestions.asxp' return a list of name/value pairs but I'll tackle that next). I'm using the example from here: http://jqueryui.com/demos/autocomplete/#remote with the exception of using 'source: "GetSuggestions.aspx" (instead of "search.php")

    Read the article

  • Entity Framework v4 examples and tutorials of conceptual model mapping

    - by Rody van Sambeek
    In an application I'm writing I have a fairly complicated Database model. I'd like to use EF4 to map this to a whole lot nicer conceptual model. However all the tutorials I've read are with samples of 2 or 3 tables which all map 1 on 1 to the conceptual model. I'd like to learn how to correctly map the database model to a different conceptual model using VS 2010. However I can't find any good tutorials or (preferabally) instruction video's. Somebody got any tips, links or even books?

    Read the article

  • Examples of useful or non-trival dual interfaces

    - by Scott Weinstein
    Recently Erik Meijer and others have show how IObservable/IObserver is the dual of IEnumerable/IEnumerator. The fact that they are dual means that any operation on one interface is valid on the other, thus providing a theoretical foundation for the Reactive Extentions for .Net Do other dual interfaces exist? I'm interested in any example, not just .Net based.

    Read the article

  • Examples of monoids/semigroups in programming

    - by jkff
    It is well-known that monoids are stunningly ubiquitous in programing. They are so ubiquitous and so useful that I, as a 'hobby project', am working on a system that is completely based on their properties (distributed data aggregation). To make the system useful I need useful monoids :) I already know of these: Numeric or matrix sum Numeric or matrix product Minimum or maximum under a total order with a top or bottom element (more generally, join or meet in a bounded lattice, or even more generally, product or coproduct in a category) Set union Map union where conflicting values are joined using a monoid Intersection of subsets of a finite set (or just set intersection if we speak about semigroups) Intersection of maps with a bounded key domain (same here) Merge of sorted sequences, perhaps with joining key-equal values in a different monoid/semigroup Bounded merge of sorted lists (same as above, but we take the top N of the result) Cartesian product of two monoids or semigroups List concatenation Endomorphism composition. Now, let us define a quasi-property of an operation as a property that holds up to an equivalence relation. For example, list concatenation is quasi-commutative if we consider lists of equal length or with identical contents up to permutation to be equivalent. Here are some quasi-monoids and quasi-commutative monoids and semigroups: Any (a+b = a or b, if we consider all elements of the carrier set to be equivalent) Any satisfying predicate (a+b = the one of a and b that is non-null and satisfies some predicate P, if none does then null; if we consider all elements satisfying P equivalent) Bounded mixture of random samples (xs+ys = a random sample of size N from the concatenation of xs and ys; if we consider any two samples with the same distribution as the whole dataset to be equivalent) Bounded mixture of weighted random samples Which others do exist?

    Read the article

  • Examples of networked Flash games

    - by videodnd
    Maybe I am asking the wrong questions, because I don't see any sample projects out there. I know Flash developers have done Kiosks and renovated arcade games. "Come on, we see Flash everywhere." Is there a sample project I could be pointed towards, it would be an ass-saver. Can I prepare my swf files like an image gallery and receive XML commands to load it? Where do I start? Flash/After Effects skills have got me through so far, but I need help!!! It would be fun if it wasn't so stressful. Criteria TCP/IP socket connection Flash package XML commands load swf file in to a container Additional Questions How do I prepare my Flash files and XML sheet to receive commands "any sample out there"? What about e.data, urlLoad, xmlSocket Class, XMLCP/IP XML socket connection to load Is binary or XML method better for loading and reloading swf files? Do I need Red5 or a media server? videoDnd, Ambitious Development Noob

    Read the article

  • Flex maps howto examples

    - by alessandro ferrucci
    Hello, I've stumbled upon this flash map http://www.washingtonpost.com/wp-srv/special/nation/unemployment-by-county/ it looks like they used this map to construct the website. http://commons.wikimedia.org/wiki/File:USA_Counties_with_FIPS_and_names.svg I am curious as to what people have done or any blogs that describe what can be done with flex and simple maps like this (not google maps style maps) but simple all-in-memory maps like this one. It would be cool to see what/ and how flex can do in terms of maps. thanks!

    Read the article

  • decent html5 offline storage and caching examples

    - by Nils
    I'm keen to test out html offline storage and caching with a view to developing a prototype to show off the offline web application capabilities of html5. I've found some webkit-specific samples, but I'm battling to find any decent code samples that even work at all in Firefox 3.6 For a sample, I'd be happy with something that works with the following: Our company uses jquery extensively so I'd prefer samples that use that library or pure javascript. It should at least work on firefox (3.6+ is fine) Can anyone point me to some links that provide some guidance and code samples?

    Read the article

  • visual c# 2008 database application examples

    - by Omar
    hi, i just have a few weeks programming with vc# (2008) and i'm trying to build an application (winforms) and i have the following problem... i need my application to work with and without connection to the mssql database, this sounds like piece of cake for our friend DataSet right? i can persist the data as XML or binary until i can reach the database and the DataSet will magically sync; all without bothering the user. The problem is... the few books i have read just mention that logic like a fairy tale but dont give any practical example of how to do it, can you point me to one example/demo/whatever i can read or download of an application with (equal or) similar logic?

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >