|
That's possible, but I really prefer understanding it first - and also, all that pointer magic doesn't make me too happy (it can't easily be removed, either, because it's used to change the start of an array several times)
|
|
|
|
|
harold aptroot wrote: I really prefer understanding it first
for a big article and a small snippet I'm often willing to reverse the order, so run it first, observe and understand it later.
harold aptroot wrote: pointer magic ... can't easily be removed
I noticed that; however, adding start parameters solves that, like so:
public bool sleq(int[] s1, int[] s2, int start1, int start2) {
for(int i=0; ; i++) {
if (s1[start1+i]<s2[start2+i]) return true;
if (s1[start1+i]>s2[start2+i]) return false;
}
}
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Ok well it can be removed of course, it just takes.. effort.
Are you sure you couldn't just explain step 3 quickly?
Otherwise I guess I'll work on converting that code..
|
|
|
|
|
harold aptroot wrote: Are you sure you couldn't just explain step 3 quickly?
No, not really. I am sure I could convert the code faster than you could make me understand it though. Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Fair enough, I'll convert it.
|
|
|
|
|
In the mean time, I have a TryAll.cs that compiles (and looks like it will generate a lot of output). I could mail it to you.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Yes please, my email is just my name @gmail.com (without underscores)
|
|
|
|
|
mail sent
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
changing the first line to
#define WITH_DEBUG_OUTPUT1 // WITH_xxx or WITHOUT_xxx
seems to generate decent results, assuming the command line holds two numbers, such as 3 5
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Hi,
in a directed graph with positive edge weighs, how can I computed all pathes from A to B with length less than a certain bound?
I could use a k-shortest path algorithm, but I don't know k in advance..
I want something like
while (l < bound) {
path p = graph.GiveMeNextPathInAscendingOrder(A,B);
l = p.length;
do something with p..
}
Best regards
-->Andreas
|
|
|
|
|
Easy; just do a depth-first search, backing up when you hit a dead end or exceed the bound.
|
|
|
|
|
I have a huge database (3 million records) that I need to de-duplicate by street address every month. With non-conforming addresses like (123 S. Ventnor Blvd, 123 South Ventnor Boulevard NW, etc.), de-duping is a pain. I'd like to find an algorithm with whatever lookup tables are necessary to convert all of the addresses to USPS format like you find in CASS certified addresses, so they can be compared. Anybody ever done that and have some clues?
|
|
|
|
|
hi,
I am to develop a 2d self assembler as my college project... I searched a lot and found some many papers on this subject. But all of them are full of theory and none of them said anything about the implementation part...
Could someone help me with these or atleast direct me to some specific place where I can more info on 2d self assemblers.
Thank you
|
|
|
|
|
Sai Yasodharan wrote: I am to develop a 2d self assembler as my college project
You do understand that this means YOU are expected to do the work?
MVP 2010 - are they mad?
|
|
|
|
|
Are you kidding? It means he has to find a way to get it done. For sure self does not refer to him?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
I know I must do the work... I m just here to get some help or guide from the experts, who already played with 2D SELF ASSEMBLERS, if any. Also help in the sense not the program, just some info on how to start and which way to proceed
|
|
|
|
|
Sai Yasodharan wrote: I know I must do the work.
Well you could start by doing some research; remember Google is your friend and also the best starting place. It is almost impossible for anyone to respond to your question, these forums are for technical questions rather than teaching. The tutorials can be found in the published articles which you should also take a look at.
MVP 2010 - are they mad?
|
|
|
|
|
|
Hello Sirs,
How to find the compression type of jpeg, when we give one sample input jpeg file the output result is this image contains (ex.) xxxx compression type. How to identify it .?
please replay
Failure is Success If we learn from it!!
|
|
|
|
|
Well it looks like you have to look up the Huffman table for the image it's marked at:
DHT 0xFFC4 variable size Define Huffman Table(s) - Specifies one or more Huffman tables.
A bit more can be found about this at this site:
JPEG Huffman Coding Tutorial[^]
The wiki explains it a little also:
JPEG Wiki[^]
|
|
|
|
|
Hi
I am planning to implement a custom version control system.
Is there anyway to represent physical directory structure in database?
Or should I represent them using 'tree' data structure?
If using tree data structure, how can I save the contents of tree to an external file??
thanks
fadi
|
|
|
|
|
Yes,
I have done this quite often there are several ways of doing this, it mostly depends on how you plan on searching the db or how you want to maintain the data. The obvious approach is to use a column file directory:
c:\mydir\thisdir\nextdir\and-so-on
This can make it a head ache if you need indexing.
The approach I used for indexing is to use a treemap where I had two colums a and b; a is the parent and b the child. you can build a directory structure this way easily. The problem with this approach is using SQL with it. You have to load the whole tree in memory in a tree map in the application then modify it and post it back or update the 'dirty' sections after you make changes to the tree.
|
|
|
|
|
i have model for intrusion prevention system i want to simulte it
|
|
|
|
|
What does this have to do with an algorithm? If you can explain that you might get an answer to your question.
|
|
|
|
|
I am attempting to symbolically determine the roots of the 6th and 7th order Legendre polynomials. I started this task by tackling the 6th order polynomial as follows:
P6 = 1/16 * (231x^6 - 315x^4 + 105x^2 - 5)
I first started solving this equation by substituting u=x^2 and went down the path of solving the resulting cubic equation for u, then taking the square root to convert the solution back to x. The first solution I came up with was:
±√[2/33 * (120 - ∛{-15/7 * [751323 - 11√(-3442911)]} - ∛{-15/7 * [751323 + 11√(-3442911)]})]
However, this equation yields the value 0.23982861022165, but the known good value is 0.238619186083197[^]
I tested the result I am getting using the calculator found here[^], and got the same result as my symbolic solution above (be sure to take the square root of the result to convert back to values of x instead of u). Does anyone know why I am coming up with the wrong answer here? I would really appreciate some assistance, as I have grown tired of staring at my solution, searching for the problem. Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
modified on Wednesday, January 13, 2010 4:32 PM
|
|
|
|