Hi,
I'm needing to build multiple environments and tag them in subversion using a nant script. Is there a way that I can use nant to create the tags in svn with a variable I supply?
Thanks.
I have an applet which creates music using the JFugue API and plays it for the user. It allows the user to input a music phrase which the piece will be based on, or lets them choose to have a phrase generated randomly. I had been using the following method (successfully) to simply stop and start the music, which runs in a thread using the Player class from JFugue.
I generate the music using my classes and user input from the applet GUI...then...
private playerThread pthread;
private Thread threadPlyr;
private Player player;
(from variables declaration)
public void startMusic(Pattern p) // pattern is a JFugue object which holds the generated music
{
if (pthread == null)
{ pthread = new playerThread(); }
else
{
pthread = null;
pthread = new playerThread();
}
if (threadPlyr == null)
{ threadPlyr = new Thread(pthread); }
else
{
threadPlyr = null;
threadPlyr = new Thread(pthread);
}
pthread.setPattern(p);
threadPlyr.start();
}
class playerThread implements Runnable // plays midi using jfugue Player
{
private Pattern pt;
public void setPattern(Pattern p)
{
pt = p;
}
@Override
public void run()
{
try
{
player.play(pt); // takes a couple mins or more to execute
resetGUI();
}
catch (Exception exception)
{
}
}
}
And the following to stop music when user presses the stop/start button while Player.isPlaying() is true:
public void stopMusic()
{
threadPlyr.interrupt();
threadPlyr = null;
pthread = null;
player.stop();
}
Now I want to implement a feature which will allow the user to change parameters while the music is playing, create an updated music pattern, and then play THAT pattern. Basically, the idea is to make it simulate "real time" adjustments to the generated music for the user.
Well, I have been beating my head against the wall on this for a couple of weeks. I've read all the standard java documentation, researched, read, and searched forums, and I have tried many different ideas, none of which have succeeded.
The problem I've run into with all approaches I've tried is that when I start the new thread with the new, updated musical pattern, all the old threads ALSO start, and there is a cacophony of unintelligible noise instead of my desired output.
From what I've gathered, the issue seems to be that all the methods I've come across require that the thread is able to periodically check the value of a "flag" variable and then shut itself down from within its "run" block in response to that variable. However, since my thread makes a call that takes several minutes minimum to execute (playing the music), and I need to terminate it WHILE it is executing this, there is really no safe way to do so.
So, I'm wondering if there is something I'm missing when it comes to threads, or if perhaps I can accomplish my goal using a totally different approach. Any ideas or guidance is greatly appreciated! Thank you!
I am trying to understand the difference between this:
if (isset($_POST['Submit'])) {
//do something
}
and
if ($_POST['Submit']) {
//do something
}
It seems to me that if the $_POST['Submit'] variable is true, then it is set. Why would I need the isset() function in this case?
What is the best way to store the cards and suits in python so that I can hold a reference to these values in another variable?
For example, if I have a list called hand (cards in players hand), how could I hold values that could refer to the names of suits and values of specific cards, and how would these names and values of suits and cards be stored?
I have an xul file with a multiline textbox. When I resize the window, its width changes but its height is constant. How do I make its height variable?
I have the cursor with the query statement as follows:
cursor.execute("select rowid from components where name = ?", (name,))
I want to check for the existence of the components: name and return to a python variable.
How do I do that?
cut -d" " -f2 ${2} | $callsTo
hello, can somebody please explain can I pipe the result of cut to variable callsTo, and how will it be stored, as the string or list?
Hi,
what the syntax is in Action Mailer Basics rails guide ?
class UserMailer < ActionMailer::Base
def welcome_email(user)
recipients user.email
from "My Awesome Site Notifications <[email protected]>"
subject "Welcome to My Awesome Site"
sent_on Time.now
body {:user => user, :url => "http://example.com/login"}
end
end
How should i understand the construction, like
from "Some text for this field"
Is it an assignment the value to a variable, called "from" ?
How can I add a click event on the event and pass the day and event time as url variable to another page. Like when user click in the event I want to pass the date and event time to another page for processing. Any idea are welcome.
Thanks
Hey Guys,
I am wokring on a dialog, where in execution I want to round up all items that have a specific attribute and place an attribute value of their's into a comma delited list.
This is as far as I have gotten, which isnt far.
buttons: {
'Hook': function(){
$('.grid_pic:has(border=3)').(loop through id's, grab src, build variable with srcs comma delimeited)
}
Any ideas?
I have the cursor with the query statement as follows:
cursor.execute("select rowid from components where name = ?", (name,))
I want to check for the existence of the components: name and return to a python variable.
How do I do that?
I was wondering why the Vector variable defined within this self executing javascript function doesn't require a var before it? Is this just some other type of syntax for creating a named function? Does this make it so we can't pass Vector as an argument to other functions?
(function() {
Vector = function(x, y) {
this.x = x;
this.y = y;
return this;
};
//...snip
})()
The scenario is as follows:
Create an instance of a class (std::map) and
sore it as global variable.
Spawn threads.
Threads read and use the same global
instance of the class
All spawned threads quit
Global class instance is destroyed
No mutex, no thread modifies the global class instance.
Is this OK?
Thank You
In SQL Server, you can declare a table variable (DECLARE @table TABLE), which is produced while the script is run and then removed from memory.
Does Oracle have a similar function? Or am I stuck with CREATE/DROPs that segment my hard drive?
I've got a situation where an ini file is in memory (in a string variable) and I'd like to read values out of it without writing the ini file data to disk.
Is there any way to do that in VB6? Maybe with a Win API call?
What's the easiest way to change a text's color based on a variable?
For example: If $var is between 1-5, green. Between 6-10, Orange. Greater than 11, Red.
I have following problem.
in one request i am updating session variable.
in the other request, i am trying to access that session value, but it was blocked until the first request finish.
I am using C# with ASP.NET 2.0
Hello,
I am trying to use this query to return every instance where the variable $d['userID'] is equal to the User ID in a separate table, and then echo the username tied to that user ID.
Here's what I have so far:
$uid = $d['userID'];
$result = mysql_query("SELECT u.username
FROM users u
LEFT JOIN comments c
ON c.userID = u.id
WHERE u.id = $uid;")$row = mysql_fetch_assoc($result);
echo $row['username'];
i want to read a file which consists of 1's and 0's in each line, how do can i store a false in any bool variable after reading 0 from the file.
language c++
Hi all,
in C++, when you define a function which takes one argument, you have to define the data type of that variable:
void makeProccess(int request)
However, I want to implement a function which takes different data types rather taking statically defined integer type.
void makeProccess(anyType request)
How can I design a proccess like this, any idea?
Thanks.
Hello,
I am using compositionTarget_rendering function to do some stuff in silverlight. Now I want to implement some kind of timelime, with notifications, i.e add some markers, and when a variable X reaches the marker value, an event is raised .. How should be the best way to do this?
Thanks in advance
Let's say we have one or more environments and variables in them.
My question is how we access the values of these variables, parametrically.
rm(list = ls())
env1 <- new.env()
env1$var1 <- "value1"
env2 <- new.env()
env2$var2 <- "value2"
env <- ls.str(mode="environment") # We get the environments
var <- ls.str(eval(parse(text = env[1])))# We get the variables of an environment
eval(var[1]) # We fail to get the value of a variable
Thank you all, in advance
Hi, i would like to make 'skinnable' a web site written in asp.net...
I explain: for example, i have a 'div' element, and i would like to define a background-color using a variable, not a fixed value.
How can i do ?
Css ? Or other tecniques ?
Thanks