Search Results

Search found 45013 results on 1801 pages for 'example'.

Page 25/1801 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • C++ WIN32: Short multitasking example

    - by Con Current
    I searched for examples on how to create a simple multithreaded app that does something similar to this: #include <iostream> using namespace std; int myConcurrentFunction( ) { while( 1 ) { cout << "b" << endl; } } int main( ) { // Start a new thread for myConcurrentFunction while( 1 ) { cout << "a" << endl; } } How can I get the above to output a and b "randomly" by starting a new thread instead of just calling myConcurrentFunction normally? I mean: What is the minimal code for it? Is it really only one function I have to call? What files do I need to include? I use MSVC 2010, Win32

    Read the article

  • C++ game loop example

    - by David
    Can someone write up a source for a program that just has a "game loop", which just keeps looping until you press Esc, and the program shows a basic image. Heres the source I have right now but I have to use SDL_Delay(2000); to keep the program alive for 2 seconds, during which the program is frozen. #include "SDL.h" int main(int argc, char* args[]) { SDL_Surface* hello = NULL; SDL_Surface* screen = NULL; SDL_Init(SDL_INIT_EVERYTHING); screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE); hello = SDL_LoadBMP("hello.bmp"); SDL_BlitSurface(hello, NULL, screen, NULL); SDL_Flip(screen); SDL_Delay(2000); SDL_FreeSurface(hello); SDL_Quit(); return 0; } I just want the program to be open until I press Esc. I know how the loop works, I just don't know if I implement inside the main() function, or outside of it. I've tried both, and both times it failed. If you could help me out that would be great :P

    Read the article

  • Need help deciphering JQuery example

    - by chobo
    I just started learning JQUery and OO Javascript, so I am trying to figure out which belongs to which and what they do. I came across this code in the JQuery documentation (function($sub) { $sub // a subclass of jQuery $sub === jQuery; //= false $sub.fn.myCustomMethod = function(){ return 'just for me'; } $sub(document).ready(function() { $sub('body').myCustomMethod(); //= 'just for me' }); })(jQuery.subclass()); Questions: Why is (function surrounded by () ? What does this mean (jQuery.subclass()); ? Is this a JQuery thing or part of regular javascript? Thanks

    Read the article

  • Why doesn't JQuery hover animate work in this example

    - by Christian
    When I hover over the box it doesn't change it's caller as I intent. What's wrong? <html> <head><title>test</title></head> <style type="text/css" > .box_type1{ width:560px; height:560px; background-color:#b0c4de; } </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.box_type1').hover( function () { $(this).stop().animate({backgroundColor:'#4E1402'}, 300); }, function () { $(this).stop().animate({backgroundColor:'#943D20'}, 100); }); }); </script> <body> </div> <div class="box_type1"> </div> </body> </html>

    Read the article

  • Unable to import example projects from book (newbie question)

    - by StayWett
    I am trying to import projects from a book "Beginning Android 2" but when I choose the root directory the "Finish" button is still grayed out. I've tried importing the project from scratch with no success, and I've also tried to create a template project with the same name and everything and then importing into that (Import existing projects into workspace) but it always says "No projects are found to import". The contents of the folder are: Res folder, src folder with .java file, the manifest, build, and default.properties files. I am new to android dev (obviously) so I appreciate the help.

    Read the article

  • Can get Sum() working in Northwind example

    - by Vince
    Hi, The following code is generating a runtime error and I have no idea why. from o in Orders group o by o.Employee into employeeOrders select new { employeeOrders.Key.EmployeeID, employeeOrders.Key.FirstName, Orders = from eord in employeeOrders orderby eord.OrderID select new { eord.OrderID, eord.OrderDate, OrderTotal=eord.OrderDetails.Sum (od => od.UnitPrice) } } The error is Member access 'System.Decimal UnitPrice' of 'LINQPad.User.OrderDetails' not legal on type 'LINQPad.User.Orders Thanks in advance

    Read the article

  • Error when connecting to hello world yesod example on Windows 8

    - by reltone
    I start the executable (after building it with cabal) and it says "Application launched, listening on port 3000." Next I connect to it with my web browser and the console says "threadWaitRead requires -threaded on Windows, or use System.IO.hWaitForInput." The web browser never connects. Not sure what this is actually recommending I do to resolve the problem. {-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses, TemplateHaskell, OverloadedStrings #-} import Yesod data HelloWorld = HelloWorld mkYesod "HelloWorld" [parseRoutes| / HomeR GET |] instance Yesod HelloWorld getHomeR :: Handler RepHtml getHomeR = defaultLayout [whamlet|Hello World!|] main :: IO () main = warpDebug 3000 HelloWorld

    Read the article

  • How to hide overflow in this example?

    - by Abe Miessler
    You can see the fiddle here: http://jsfiddle.net/easeS/4/ Here is the html/css I have: #main div { float:left; width:30px; margin-right:10px; } #main { overflow:hidden; width:100px; height:50px; border:1px solid; } <div id="main"> <div>test1</div> <div>test2</div> <div>test3</div> </div> I'm not sure why but it bumps the third div down to a new line instead of hiding it. Any suggestions?

    Read the article

  • simple JQuery example is causing me troubles for unknown reason

    - by cerr
    I'm relatively new to JQuery and would like to try something. I just followed a simple tutorial to start up with on http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery So I specified my script in the : <script type="text/javascript"> $(document).ready(function() { $("a").click(function() { alert("Hello world!"); }); }); </script> and included a test link in the : <a href="">Link</a> however, when I refresh thet document my browser keeps saying TypeError: Property '$' of object [object Window] is not a function which I can understand for "normal" JavaScript but I believe this kind of function is new in JQuery. Can someone assist mer here, please? links:http://wittmerperformance.com/site/

    Read the article

  • Ruby Search tree example confusion

    - by Senthil
    I've been trying to take apart this app which creates a search tree based on keywords, but I'm afraid its a bit too complex for me. Would anyone mind explaining it? The format is off, so here's a pastebin (is pastie.org down?) version of it. Any help is appreciated.

    Read the article

  • webtrends Rest API - Example ?

    - by Asap
    Hi! I have to build a custom dashboard that presents some data from a Webtrends account. Can i get this information via api ? : 1) View and visitors for all pages and View/visitors for a single page (in a period range) 2) Stored Pages ( a list of all urls saved for my site in webtrends .. so i can choose for which one get more information in point 1) ) 3) Overall like point 1) but from the start of the web site until now. Thank you!

    Read the article

  • Looking for example projects and "how to create" VB6 Active X EXE's

    - by Clay Nichols
    I'm learning how to create an VB6 Active X EXE. (I need to add the ability for a number of VB6 apps to "phone home" to a server and I'd like centralize this but don't want to do it with a DLL because I'd like to only need Firewall permission for one program (the "phone home ActiveX EXE). I've found a few tutorials but I'm looking for a downloadable project to "play around with".

    Read the article

  • ajax aspx example

    - by dbds
    Can anyone provide a simple use of AJAX in a vb aspx page, so I can just reload a part of the page and not have to reload the entire web page?

    Read the article

  • Haskell type signature with multiple type somethings (predicates?, for example Eq a =>)

    - by Andrew
    I'm not sure if type predicates is the right term, in fact I've never learned the word for this, so an edit to correct would be helpful - I'm referring to when you give the tipe of function f :: a -> b and you want to say a is a Eq and you say f :: Eq a => a -> b, the name for Eq a => - this is the thing i called a type predicate. My question, though, is how to have multiple of these, so if A is an Eq and B is a Num, I could say either f :: Eq a => a -> b or f :: Num b => a -> b. So, how can I have Eq a => and Num b => at the same time? f :: Eq a => Num b => a -> b, f :: Eq a -> Num b => a -> b, and f :: Eq a, Num b => a -> b all didn't do what I wanted.

    Read the article

  • Object reference not set to an instance of an object- Linked List Example

    - by Zoro Roronoa
    I am seeing following errors : Object reference not set to an instance of an object! Check to determinate if the object is null before calling the method! I'am new with C#,and I made a program for Sorted Linked Lists. Here is the code where the error comes! public void Insert(double data) { Link newLink = new Link(data); Link current = first; Link previous = null; if (first == null) { first = newLink; } else { while (data > current.DData && current != null) { previous = current; current = current.Next; } previous.Next = newLink; newLink.Next = current; } } It says that the current referenc is null while (data current.DData && current != null), but I assigned it current = first; Please Help ! The rest is the complete code of the Program! class Link { double dData; Link next=null; public Link Next { get { return next; } set { next = value; } } public double DData { get { return dData; } set { dData = value; } } public Link(double dData) { this.dData = dData; } public void DisplayLink() { Console.WriteLine("Link : "+ dData); } } class SortedList { Link first; public SortedList() { first = null; } public bool IsEmpty() { return (this.first == null); } public void Insert(double data) { Link newLink = new Link(data); Link current = first; Link previous = null; if (first == null) { first = newLink; } else { while (data > current.DData && current != null) { previous = current; current = current.Next; } previous.Next = newLink; newLink.Next = current; } } public Link Remove() { Link temp = first; first = first.Next; return temp; } public void DisplayList() { Link current; current = first; Console.WriteLine("Display the List!"); while (current != null) { current.DisplayLink(); current = current.Next; } } } class SortedListApp { public void TestSortedList() { SortedList newList = new SortedList(); newList.Insert(20); newList.Insert(22); newList.Insert(100); newList.Insert(1000); newList.Insert(15); newList.Insert(11); newList.DisplayList(); newList.Remove(); newList.DisplayList(); } }

    Read the article

  • Example of application to design with fingers (source code)

    - by STD
    Hi, i'm new user about this interesting forum! I want start develop application for android and before starting i want learn about some android feature... the first android feature is how to correlate finger motion in screen with java... Exist some source code that show how to realize application to draw with finger in android screen? can you suggest me where donwload it? thanks

    Read the article

  • Example applications and benefits of using "C" , "C++" or "Java"

    - by Waltzy
    Ok, I'm revising for my upcoming year 2 exams on a CS course and its likely something like this will come up. my question is what is an ideal application that would especially benefit from the program features of each of the three languages? I have a vague idea but getting a second opinion could really help. JavaPortability, easy - good for GUIs. C++Fast but may requite significant changes in order to be moved from system to system, good for image processing. CI'm unsure here small embedded applications? Some clarification on this would be really appreciated, thanks again StackOverflow

    Read the article

  • Impressive DocBook example?

    - by RD
    So far I've only come across very bland docbook examples. I'm sure DocBook can do a LOT but does anybody have examples where styling is done and a really impressive PDF can be generated?

    Read the article

  • Basic iphone timer example

    - by Rob
    Okay, I have searched online and even looked in a couple of books for the answer because I can't understand the apple documentation for the NSTimer. I am trying to implement 2 timers on the same view that each have 3 buttons (START - STOP - RESET). The first timer counts down from 2 minutes and then beeps. The second timer counts up from 00:00 indefinitely. I am assuming that all of the code will be written in the methods behind the 3 different buttons but I am completely lost trying to read the apple documentation. Any help would be greatly appreciated.

    Read the article

  • Printf example in bash does not create a newline

    - by WolfHumble
    Working with printf in a bash script, adding no spaces after "\n" does not create a newline, whereas adding a space creates a newline, e. g.: No space after "\n" NewLine=`printf "\n"` echo -e "Firstline${NewLine}Lastline" Result: FirstlineLastline Space after "\n " NewLine=`printf "\n "` echo -e "Firstline${NewLine}Lastline" Result: Firstline Lastline Question: Why doesn't 1. create the following result: Firstline Lastline I know that this specific issue could have been worked around using other techniques, but I want to focus on why 1. does not work.

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >