Search Results

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

Page 21/1801 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Looking for evolutionary music example code

    - by Dan Dyer
    I would like to implement an interactive evolutionary algorithm for generating music (probably just simple melodies to start with). I'd like to use JFugue for this. Its website claims that it is well-suited to evolutionary music, but I can't find any evolutionary examples. I already have a framework to provide the evolutonary machinery. What I am looking for is some simple, working code that demonstrates viable approaches for the musical part (e.g. suitable encodings and evolutionary operators for the evolved tunes). I have some ideas how it might be achieved, but I'm not particularly knowledgeable about music theory, so to start with I'd like to just reimplement something that is known to work. So does anybody have, or know of, any freely available code (any language is fine) that demonstrates one or more approaches to evolutionary music? EDIT: I'm specifically looking for evolutionary code rather than other techniques that could be used for music synthesis.

    Read the article

  • PublishPost method example for Actionscript API Facebook connect required

    - by freddelm
    I established an extended permission with Facebook connect, works like a charm, but i just can't seem to publish messages on my wall. i keep getting this error: error code 100: Invalid parameter my code: var message:String = "test facebookconnect"; var publishpost:PublishPost = new PublishPost(message, null, null, null); publishpost.addEventListener(FacebookEvent.COMPLETE, function(e:FacebookEvent) { MonsterDebugger.trace(this, e); }); publishpost.addEventListener(FacebookEvent.ERROR, function(e:FacebookEvent) { MonsterDebugger.trace(this, e); }); publishpost.addEventListener(FacebookEvent.CONNECT, function(e:FacebookEvent) { MonsterDebugger.trace(this, e); }); fldFacebook.post(publishpost); Any clear examples/tutorials would help a lot in how to use this publishpost with the actionscript API thanks in advance.

    Read the article

  • Concurrency Violation in NHibernate( c#) example

    - by vijaysylvester
    For quite some time , I was reading about the optimistic concurrency in NHibernate. If what i understood was correct then the below sample should hold good. Consider two transactions T1 and T2. When T1 and T2 are done simultaneously , the state(DB entries) gets updated with the values of the most latest update.(T1 or T2). Though it seems to be conceptually sound , how do i simulate this for the purpose of understanding and integration testing.? Can someone help me with a sample c# code.? Thanks , vijay

    Read the article

  • onFocusChange code example?

    - by Rich
    I have a form with 2 fields where you can enter in either months or years. How do I setup the form so that if you enter in the years, the months edittext field will be automatically calculated and entered into it's own box. Likewise, I want the years to be calculated if you entered in the months Can anyone give me sample code for this?

    Read the article

  • ServerAlias www.example.com is not recognized

    - by Tianzhou Chen
    Below is my config file: NameVirtualHost 12.34.56.78:80 < VirtualHost 12.34.56.78:80 ServerAdmin [email protected] ServerName domain1.com ServerAlias www.domain1.com DocumentRoot /srv/www/domain1.com/public_html1/ ErrorLog /srv/www/domain1.com/logs/error.log CustomLog /srv/www/domain1.com/logs/access.log combined < /VirtualHost < VirtualHost 12.34.56.78:80 ServerAdmin [email protected] ServerName domain2.com ServerAlias www.domain2.com DocumentRoot /srv/www/domain2.com/public_html1/ ErrorLog /srv/www/domain2.com/logs/error.log CustomLog /srv/www/domain2.com/logs/access.log combined < /VirtualHost The thing is when I put www.domain1.com into browser, apache2 doesn't retrieve the web page resides in /srv/www/domain1.com/public_html1/, instead, it gets the page from the default document root defined in another file. However, if I put www.domain2.com, everything works fine. I don't see any difference between two VirtualHost config block, so I wonder what does make the difference. BTW, I haven't put any .htaccess file under their document root. Thanks for your advice! Tianzhou

    Read the article

  • Integration Test Example With Rhino Mocks

    - by guazz
    I have two classes. I would like to verify that the properties are called on one of the classes. public classA { public IBInterface Foo {get;set;} public LoadData() { Foo.Save(1.23456, 1.23456); } } public classB : IBInterface { public decimal ApplePrice {get; set;} public decimal OrangePrice {get; set;} public void Save(decimal param1, decimal param2) { this.ApplePrice = param1; this.OrangePrice = param2; } } I would like to use Rhino Mocks(AAA syntax) to verify that ApplePrice and OrangePrice were set correctly. I assume I should begin like so but how do I verify that ApplePrice and OrangePrice have been set? var mockInterfaceB = mockery.DynamicMock(); ClassA a = new ClassA(); a.Foo = mockInterfaceB; a.LoadData();

    Read the article

  • ruby socket dgram example

    - by Bub Bradlee
    I'm trying to use unix sockets and SOCK_DGRAM in ruby, but am having a really hard time figuring out how to do it. So far, I've been trying things like this: sock_path = 'test.socket' s1 = Socket.new(Socket::AF_UNIX, Socket::SOCK_DGRAM, 0) s1.bind(Socket.pack_sockaddr_un(sock_path)) s2 = Socket.new(Socket::AF_UNIX, Socket::SOCK_DGRAM, 0) s2.bind(Socket.pack_sockaddr_un(sock_path)) s1.send("HELLO") s2.recv(5) # should equal "HELLO" Does anybody have experience with this?

    Read the article

  • axis2 maven example

    - by larrycai
    I try to use axis2 (1.5.1) version to generate java codes from wsdl files, but I can't figure out what is the correct pom.xml <build> <plugins> <plugin> <groupId>org.apache.axis2</groupId> <artifactId>axis2-wsdl2code-maven-plugin</artifactId> <version>1.5.1</version> <executions> <execution> <goals> <goal>wsdl2code</goal> </goals> <configuration> <wsdlFile>src/main/resources/wsdl/stockquote.wsdl</wsdlFile> <databindingName>xmlbeans</databindingName> <packageName>a.bc</packageName> </configuration> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2</artifactId> <version>1.5.1</version> </dependency> </dependencies> when I type mvn compile, it complains the Retrieving document at 'src/main/resources/wsdl/stockquote.wsdl'. java.lang.ClassNotFoundException: org.apache.xml.serializer.TreeWalker And if i try to find the TreeWalker, it is a mess to find a suitable jar files. can u someone give me a hints ? or give me correct pom.xml

    Read the article

  • Using the groupby method in Python, example included

    - by randombits
    Trying to work with groupby so that I can group together files that were created on the same day. When I say same day in this case, I mean the dd part in mm/dd/yyyy. So if a file was created on March 1 and April 1, they should be grouped together because the "1" matches. Here's the code I have so far: #!/usr/bin/python import os import datetime from itertools import groupby def created_ymd(fn): ts = os.stat(fn).st_ctime dt = datetime.date.fromtimestamp(ts) return dt.year, dt.month, dt.day def get_files(): files = [] for f in os.listdir(os.getcwd()): if not os.path.isfile(f): continue y,m,d = created_ymd(f) files.append((f, d)) return files files = get_files() for key, group in groupby(files, lambda x: x[1]): for file in group: print "file: %s, date: %s" % (file[0], key) print " " The problem is, I get lots of files that get grouped together based on the day. But then I'll see multiple groups with the same day. Meaning I might have 4 files grouped that were created on the 17th. Later on I'll see another unique set of 2 files that are also created on the 17th. Where am I going wrong?

    Read the article

  • Flex 3 "product store" example?

    - by Poni
    Hi! I'm looking for something like this: http://nwebb.co.uk/blog/?p=132 http://www.adobe.com/devnet/flex/samples/flex_store/ The first one doesn't provide the source code and the second one is for Flex 2, and I have no clue how to port it to Flex 3. At the second one Adobe writes: Minor changes in the description and code may be necessary before it can be applied to Flex 3. These guys are funny.......! Anyway does anyone here knows of something similar I can learn from? Thank you!

    Read the article

  • AudioQueue in-memory playback example

    - by Jonesy
    Does anybody know of any examples using AudioQueue that play from an in-memory source? All the examples I can find play from files (using AudioFileReadPackets) but in my particular case I am generating the data myself in realtime so ideally, I want to enqueue the data myself rather than sucking it out of a file using the callback. Any help much appreciated.

    Read the article

  • ODP.NET Code Example Critque or best practices

    - by andrewWinn
    I currently have a DataAccess Layer in Vb.Net. I am not too happy with my implementation of both my ExecuteQuery (as DataSet) and ExecuteNonQuery functions. Does anyone have any code that I could see? My code just doesn't look clean. Any thoughts or critiques on it would be appreciated also. Using odpConn As OracleConnection = New OracleConnection(_myConnString) odpConn.Open() If _beginTransaction Then txn = odpConn.BeginTransaction(IsolationLevel.Serializable) End If Try Using odpCmd As OracleCommand = odpConn.CreateCommand() odpCmd.CommandType = CommandType.Text odpCmd.CommandText = sSql For i = 0 To parameters.Parameters.Count - 1 Dim prm As New OracleParameter prm = DirectCast(parameters.Parameters(i), ICloneable).Clone odpCmd.Parameters.Add(prm) Next If (odpConn.State = ConnectionState.Closed) Then odpConn.Open() End If iToReturn = odpCmd.ExecuteNonQuery() If _beginTransaction Then txn.Commit() End If End Using Catch txn.Rollback() End Try End Using

    Read the article

  • Bad Code example

    - by Anantha Kumaran
    i am sure all of us must have written some bad code at some point in their life. I am a kind of guy who would love to learn from other people mistakes. So can you give some examples of bad code you have written and the way you corrected it.

    Read the article

  • image slideshow example in android?

    - by UMMA
    dear friends, i want to create image slideshow in android. i have many images in android gridview now i want to open manual slideshow if any image is clicked so that i could view it by moving finger left or right next and previous images like android built in gallery. any one guide me how to achieve this? any help would be appriciated.

    Read the article

  • ruby, rails, railscasts example gone bad

    - by Sam
    If you saw the railscasts on nested forms this is the helper method to create links dynamically. However, after I upgraded to ruby 1.9.2 and rails 3 this doesn't work and I have now idea why. def link_to_add_fields(name, f, association) new_object = f.object.class.reflect_on_association(association).klass.new fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder| render(association.to_s.singularize + "_fields", :f => builder) end link_to_function(name, h("add_fields(this, \"#{association}\", \"#{escape_javascript(fields)}\")")) end here is the javascript function add_fields(link, association, content) { var new_id = new Date().getTime(); var regexp = new RegExp("new_" + association, "g") $(link).up().insert({ before: content.replace(regexp, new_id) }); }

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >