|
Really?
I'd have thought that it would pick up after the recession, besides, wouldn't that actually help the financial institutions get back on their feet faster?
I prefer going into Computational Biology, specifically into the modeling and forecasting of diseases and/or chemical reactions in biological entities systems.
You've given me food for thought.
In either case, because of the financial crisis, in the States, many universities have cut down the number of PhD students that they're willing to take on, but come this summer, I'm leaving Jordan to either carry on with the PhD or to get a better paying job in [western] Canada.
|
|
|
|
|
Yes. All investment banks are cutting back their quantitative positions. The increased regulation will mean more routine uses of derivative products and less need for people with quantitative backgrounds to invent new products.
It's already happening. In Zurich, for example, there are thousands with backgrounds in financial engineering on the job market. For each job posting they are getting so many applications they can't handle them all. Even the headhunter organizations are telling me not to expect anything until late next year at the soonest and, even then, there will be huge competition for limited positions - those with the most experience will be taken first. It's terrible. Most banks are waiting to see what the "new system" will mean for their risk management operations. That could be two years or more before there's a solid draft and implementation.
I'm trying to get into financial regulation so that when the banks start hiring I'll have some experience.
And it's worse in the U.S. The number of unemployed is in excess of 150,000.
|
|
|
|
|
Would you mind if I emailed you later on tonight when I get back home? I'd like to discuss this in greater detail if you don't mind. I would so totally appreciate it.
|
|
|
|
|
No problem. I'm GMT+1, so my response could be delayed due to time difference.
|
|
|
|
|
Great, I'm GMT +2 so we should be fine
|
|
|
|
|
how to calculate shortest path between houses. answer must take into account fully laden sleigh and naughty/nice rating of occupants. urgent!
CODE PLEASE!
Merry Christmas CodeProject
|
|
|
|
|
Mark Churchill wrote: how to calculate shortest path between houses
Dijkstra's algorithm for the nice! The longest path algorithm for the naughty!
( Is this a homework question? )
It's a bit past Christmas, so Happy Holidays, Mark!
|
|
|
|
|
<problem nothing="" to="" see="" here="">
modified on Monday, February 9, 2009 7:30 PM
|
|
|
|
|
I have a problem I can't seem to figure out. I'm trying to code an algorithm which calculates the longest path(s) from a given list of nodes and their neighbor nodes. I've learned a little bit about Djikstra's and the "traveling salesman" algorithms but those are both meant to calculate the shortest distance between two points. The problem statement would basically be "Given a list of nodes and their neighboring nodes (all one unit away), calculate the longest path(s) that can be taken using any given 'segment' only once in each path."
Here's an example. Given this list:
Node : Neighboring Node,Neighboring Node,Neighboring Node
0 : 1,2,9
1 : 0,5,6
2 : 0,3,-1
3 : 2,4,-1
4 : 3,5,-1
5 : 4,1,-1
6 : 1,7,-1
7 : 6,8,-1
8 : 7,9,-1
9 : 8,0,-1
('-1' means no neighboring node)
the algorithm should output:
"0-1-5-4-3-2-0-9-8-7-6-1"
"0-1-6-7-8-9-0-2-3-4-5-1"
"0-2-3-4-5-1-0-9-8-7-6-1"
"0-2-3-4-5-1-6-7-8-9-0-1"
"0-9-8-7-6-1-0-2-3-4-5-1"
"0-9-8-7-6-1-5-4-3-2-0-1"
"1-0-2-3-4-5-1-6-7-8-9-0"
"1-0-9-8-7-6-1-5-4-3-2-0"
"1-5-4-3-2-0-1-6-7-8-9-0"
"1-5-4-3-2-0-9-8-7-6-1-0"
"1-6-7-8-9-0-1-5-4-3-2-0"
"1-6-7-8-9-0-2-3-4-5-1-0"
I've been trying to code this in VB6 but it's gotten very messy and I think I'd like to try coding it in Python to get it working and then convert it to VB6.
My current method starts at a node and "jumps" to a neighbor node until it reaches a node that's already been used once in the current path, and then jumps backwards until it reaches a three-neighbor-node and takes the second "fork" of that node until it reaches that end. It does this until it's jumped all the way back to the starting node, and then it chooses another starting node and runs again until all three-neighbor nodes have been started from. I guess it's similar to a tree-searching algorithm except the branches can connect to each other.
I've spent a while Googling and haven't found much - most articles I've found deal with finding the shortest path. Any help would be appreciated!
|
|
|
|
|
Since you are using a sequence of nodes, you can use the constraint that no node in a potential path can be the same as the previous node. Then objective function is the length of the path.
I dug up some pseudocode:
Pseudocode for Longest Path
Nodes of graph have integer names
Node Extensible( sequence s )
Boolean found, Node endpoint
p = EndOfPath(s)
Set Inpath(x) = true for any x in s
y = LastUsed(p)+1
found = false, q = y
While q <= number of vertices And Not found
found = Not InPath(q) And IsEdge(p, i)
If Not found Then q = q + 1
End While
If Not found Then
Extensible = -1
Else
Extensible = q
End If
Sequence Truncate( sequence s )
'Reset Lastused for EndofPath of s and remove EndofPath
p = EndOfPath(s)
// p will be removed so reset Lastused
Lastused(p) = 0
If s.length = 1 then
// choose new start vertex
Truncate = s+1 // s is integer name for old start
Else
Truncate = all but last node of s
End If
Sequence Extend( sequence s )
p = EndOfPath(s)
q = Extensible(s)
If q = -1 Then
If s.Length > s*.Length Then s* = s
// backtrack
Extend = Truncate( s )
Else
Lastused(p) = q
Extend = s + q
End If
End If
|
|
|
|
|
In your pseudocode, when finding the next node to jump to, it says:
73Zeppelin wrote: // now find first vertex which is :
// not in use in s
// adjacent to p
// >= y
If I'm reading that correctly it will only use nodes which have not already been used in the current path. However, it shouldn't matter how many times any particular node is used but rather how many times each "road" between nodes is used.
In my example, "0-1-5-4-3-2-0-9-8-7-6-1" was a valid path. Node '0' is used twice, but each "road" leading to each of its three neighbors is used only once (0-1,2-0,0-9). Am I understanding your pseudocode correctly?
One more question - what does
73Zeppelin wrote: If s.Length > s*.Length Then s* = s
do? Thanks!
|
|
|
|
|
zenerguy32 wrote: If I'm reading that correctly it will only use nodes which have not already been used in the current path. However, it shouldn't matter how many times any particular node is used but rather how many times each "road" between nodes is used.
In my example, "0-1-5-4-3-2-0-9-8-7-6-1" was a valid path. Node '0' is used twice, but each "road" leading to each of its three neighbors is used only once (0-1,2-0,0-9). Am I understanding your pseudocode correctly?
Ah, okay. Yes, the algorithm allows traversal through a vertex only one time. You are allowing multiple traversals?
zenerguy32 wrote: 73Zeppelin wrote:
If s.Length > s*.Length Then s* = s
do? Thanks!
This is just used for backtracking.
|
|
|
|
|
Correct - I am allowing multiple traversals through each node, but only one traversal using each "road" (for any given path).
|
|
|
|
|
hi
I want to implement data versioning in a application...
I need a Delta algorithm component.
where can I find it?
thanks.
|
|
|
|
|
m-khansari wrote: hi
I want to implement data versioning in a application...
I need a Delta algorithm component.
where can I find it?
thanks.
Google, maybe?
|
|
|
|
|
thanks very very very much
who can help me such as you?
Mohammad Khansari
|
|
|
|
|
Hi,
I have a double value describing rotation angle for a text box object. I need to convert it to quaternion. I have searched the web, and all I get is converters that conver Euler angle to Quaternion.
I would appreciate any formulae or algorithm.
And this double value is the only information I have for rotation.
Regards,
Shoaib
Its never over !
|
|
|
|
|
shaibee wrote: have a double value describing rotation angle for a text box object. I need to convert it to quaternion. I have searched the web, and all I get is converters that conver Euler angle to Quaternion.
I would appreciate any formulae or algorithm.
And this double value is the only information I have for rotation.
You want to convert an axis angle, for example? A rotation around an axis in space can be converted to a quaternion Q(w,x,y,z) . If the rotation is given by a unit vector (ax, ay, az) and the angle theta is in radians, then the conversion is:
w = cos(theta/2)
x = ax * sin(theta/2)
y = ay * sin(theta/2)
z = az * sin(theta/2)
Make sure the axis is normalized before conversion. If there is no rotation, the quaternion is the rotation identity quaternion.
|
|
|
|
|
73Zeppelin wrote: rotation is given by a unit vector (ax, ay, az) and the angle theta is in radians
I believe I have theta , but I dont see any vector provided along with in the information object that I have. All it says is "angle in radians rotated from +ve world x-axis". Does this indicate any default vector that I can use for this conversion?
Its never over !
|
|
|
|
|
So it's a rotation about the x-axis? This means the rotations around the other axes can be taken as zero. So your rotation vector would be:
(ax, ay, az) = (theta, 0, 0)
Don't forget to convert to a unit vector[^] if necessary.
|
|
|
|
|
Semantics:
write_item(X): is the operation of writing the value of record X in the database
read_item(X): is the operation of reading the value of record X in the database
TS(T) : is the Time Stamp of a transaction in the database, each transaction may include many operations before it is either committed or rolled-back, e.g. write_item(X), read_item(Z), write_item(W)
write_TS(X): is the TS(T) of transaction T that has successfully written record X
read_TS(X): is the TS(T) of transaction T that has successfully read record X
Strict time stamp ordering
// read_item(X) by T
read_item(X)
{
while(true)
{
if( write_TS(X) > TS(T) )
{
abort(T); // break or return
}
else if( write_TS(X) < TS(T) )
{
wait until the transaction T', which TS(T) > TS(T'), has
either committed or aborted; // write_TS(X) == TS(T')
continue;
}
else
{
read_item(X);
read_TS(X) = max{ read_TS(X), TS(T) };
break; // or return
}
}
}
// write_item(X) by T
write_item(X)
{
while(true)
{
if( write_TS(X) > TS(T) || read_TS(X) > TS(T) )
{
abort(T); // break or return
}
else if( write_TS(X) < TS(T) )
{
wait until the transaction T', which TS(T) > TS(T'), has
either committed or aborted; // write_TS(X) == TS(T')
continue;
}
else
{
write_item(X);
write_TS(X) = TS(T);
break; // or return
}
}
}
<div class="ForumMod">modified on Wednesday, December 17, 2008 4:16 PM</div>
|
|
|
|
|
What do you want help with? You didn't actually ask a question.
|
|
|
|
|
I apologize for not providing the question.
The question is:
Is this pseudocode correct regarding the strict time stamp ordering protocol ?
( Strict TS protocol is used for ensuring conflict serializability, recoverability and cascade less roll-backs )
Some background knowledge ( I hope this to clarify things):
1 ) Conflict serializability -> This is ensured by the basic time stamp protocol
2 ) But the basic TS protocol does not ensure (1) recoverability and (2) cascadeless roll-backs.
3 ) This is were "strict" steps in and ensures the aforementioned 2 features.
e.g. Transactions TS(T1)<TS(T2)<TS(T3)
Assume that TS(T2) has performed a write_item(X) and has committed.
Additionally, let us assume that TS(T3) performed the following 2 operations after the previous commit:
Y=Y+X
write_item(Y)
but has not committed yet.
Then, transaction T1 does attempt to perform a write_item(X).
The basic time stamp protocol will force transaction T1 to abort (roll-back), because TS(T1) < write_TS(X), write_TS(X) == TS(T2)
However, since the transaction T2 has committed it is not recoverable through a roll-back anymore.
Furthermore, transaction T3 has to be rolled-back as well. If another transaction T4 had based its writes on T3 then it should also be rolled-back. This is were cascading roll-backs happen.
Thanks, for using your time to answer my question.
|
|
|
|
|
/ write_item(X) by T
write_item(X)
{
while(true)
{
if( write_TS(X) > TS(T) || read_TS(X) > TS(T) )
{
abort(T);
}
else if( write_TS(X) < TS(T) )
{
wait until the transaction T', which TS(T) > TS(T'), has
either committed or aborted;
continue;
}
else
{
write_item(X);
write_TS(X) = TS(T);
break;
}
}
}
Hmmm, on the indicated line above, shouldn't that be AND and not OR? Also, you might want to consider what would happen if the timestamps were equal.
Also, just to be clear, to avoid cascading rollbacks, you should only be reading committed values. So, given all that, shouldn't the pseudo-code look more like this:
if t >= wmax(X)
rmax(X) <- max(t, rmax(X))
wait for a committed value of X
perform read
else
abort
if t >= rmax(X) and t >= wmax(X)
wmax(X) <- t
wait until X value is a committed value and
pending reads are done
perform write
else
if t < rmax(X)
abort
else
do nothing
|
|
|
|
|
I have studied your answer carefully and your remarks are quite
insightful. I will incorporate them while implementing the algorithm.
Your willingness to answer my question is greatly appreciated.
Thanks!
|
|
|
|
|