|
Thank a lot for the reply.
I'm gonna using C# .
|
|
|
|
|
I have a rectangle(all sides are known). I want to draw X(known number) small rectangles in it.but all of sub rectangles must have same size and a predefined proportion.
This should use maximum area in main rectangle when deciding columns and rows.
i.e If my rectangle is 800x320 and i want to draw 32 sub rectangles in it.All 32 sub rectangles must have ratio (4:3)
What will be the number of columns and rows and width/height of sub rectangles?
modified on Friday, March 20, 2009 3:08 AM
|
|
|
|
|
skelet0n wrote: i.e If my rectangle is 800x320 and i want to draw 32 sub rectangles in it.All 32 sub rectangles must have ratio (4:3)
Columns 8, rows 4, dim ={100, 75}.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
. I bet that was helpful .
|
|
|
|
|
Superb reason is that this 800x320 was just an example and i put this question in algorithm section, because i want an algorithm to solve it. As every time this algorithm will get different inputs, such as rectangle size, sub controls count and sub controls ratio. and the out put will be (row x columns) and their size.
I guess some trigonometry will surely do it...but can't figure it out so far.
|
|
|
|
|
In fact I used and algorithm (no trigonometry involved). Hint: [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
So can you explain that algorithm?
|
|
|
|
|
A hint on the procedure.
You should maximize the sum of the rectangle areas with some constraint (hence the use of Lagrange multipliers).
You requirements give the following constants (supposing all rectangles have the same size):
N the total number of rectanglesw and h , giving the ratio of each rectangle, i.e. ratio w:h W and H , the width and the height of the bounding rectangle
and the following variables
r the number of rows of the rectangle gridc the number of columns of the rectangle gridx defined so that x*w = rectangle width and x*h =rectangle height
You should maximize the total area, i.e. N*h*w*x , while obeying to the following constraints:
N = r*c W >= c * w * x H >= r * h * x
Using (generalized ?) Lagrange multipliers you may write the function L :
L(x,r,c,j,k,l) = N*h*w*x - (r*c - N)*j - (c*w*x - W)*l - (r*h*x -H)*k
where j,l,k are the Lagrange multipliers.
Now you've to find an extreme of it (i.e. all first derivatives with respect the parameters x,r,c,j,k,l should be zero) and verify it's a solution for your problem.
I hope I didn't make silly mistakes.
Good luck.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
No mistakes. This should give him what he wants!
|
|
|
|
|
Thank you for revising it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I thought I'd do the math myself. This is a useful problem for rectangle packing.
(Haven't had time to do it just yet)
|
|
|
|
|
How about if the rectangle is 750x325? Assume the material is uniform so that a 3x4 and 4x3 rectangle are equivalent. What's the optimal way to get 32 rectangles then?
|
|
|
|
|
You're a friend of skelet0n, aren't you? Given the algo [^], you can easily figure out the result (you've just to change N from constant to variable).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You're a friend of skelet0n, aren't you? Given the algo [^], you can easily figure out the result (you've just to change N from constant to variable).
No, I'm just me. If rotation is allowed, however, the algorithm given won't take optimal advantage of it. For example, the dimensions I gave allow 30 rectangles of size 100x75 or 75x100 to be placed, but only if some are rotated 90 degrees relative to others. What would be the optimal algorithm to deal with that?
|
|
|
|
|
Hi I am doing my final year B.Sc.,(Computer Science)
I am doing "Search Engine" as project.
Please any one help me how to get search results of some popular search engine in my own page(ASP.NET)
Thanks in Advance...
|
|
|
|
|
SaravananXSC wrote: Please any one help me how to get search results of some popular search engine in my own page(ASP.NET)
the details are left for the genius to figure it out.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
You're displaying the results of some application in your own page?
What school?
I are troll
|
|
|
|
|
Hi Eddy.. Thank's for your reply..
I am doing my degree in St.Xavier's College, Palayamkottai, India.
I am developing a web based application in which i have to display results from popular search engines according to the keyword entered by the user... The number of results to be displayed must be user's choice..
|
|
|
|
|
Founded in 1923, as it reads. So you're going to use an existing search-engine? Google would seem the be the obvious choice there. They've got extensive documentation on how to do these kind of things here[^].
Your part lies in making the call to the site for the correct searchquery, reading back the results, and displaying those that you want - I don't expect you to have any problems as it's a rather basic task.
Good luck
I are troll
|
|
|
|
|
Well, you could always host google in an iframe.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
I don't get it. You are doing project "Search engine", so I guess you should build your own (prolly simple) engine, right? Some web crawler that would index data etc. And what you want to do is host 1 search engine in your page? Dude..., that's bravery .
|
|
|
|
|
I am doing my degree in St.Xavier's College, Palayamkottai, India.
I am developing a web based application in which i have to display results from popular search engines according to the keyword entered by the user... The number of results to be displayed must be user's choice..
|
|
|
|
|
|
It is really needed me to proof my little cryptographic scheme because of i have used an own created cryptographic scheme to make secure for the mobile data transaction in a database system, and our lectures, who are professional on this cryptography, said "If it is used any created cryptographic algorithm to make secure for something then it would be done for proper cryptanalysis to prove that the algorithm is not hackable and to proof strength of algorithm first then it is possible to say as secure model. Otherwise it is not considered as secure.
I have heard about that cryptographic scheme is built after the mathematic justification is done but it is already done for programing implementation before the mathematic justification on the scheme/algorithm is done because of that time i had no idea about that all. If it is needed to rebuilt the scheme/algorithm again, it really hard for me to restart new one.
Cryptographic algorithm metric literature (1997), I've found, suggested about a few important metrics such as type, functions, key size, rounds, complexity, attack and strength but If it is new modern metric came out ready, i have not found it yet.
It is really needed justification on the proper cryptanalysis to prove that the scheme/algorithm is not hackable and to proof strength of algorithm as well
General detail of the algorithm follows as listed below.
Type: Symmetric
Functions: Confidentiality and authentication
Key size: 256 bit
Round: 3
Complexity: encryption, decryption and key setup include the expansion, bit operations, modular multiplications and modular exponentiations.
Attack: have not started to test it yet.
Strength: not started.
Additional info
encryption and decryption schemes work on numbers only because of data transaction in the database system uses numbers (not text and any other symbols)
Encryption
Input: 32 bits
Output: 128 bits
what need to do is better? If Any body, who are Phd, Prof and experts on the cryptography and were doing this before, please advice me?
Thank you
|
|
|
|
|
Probably easier to prove its broken. Encrypt some plaintext with your scheme and then feed the results into the NIST random number test suite. If your results aren't random then the scheme is probably weak.
|
|
|
|