For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
There are 2 types of tiles: Type 1: ** * Type 2: ** (where each star is a square block) Each tile can be rotated or flipped in all ways. There is a box with 2-by-n dimensions. So, for example, if n=10 then the box dimensions are 2 X 10 as shown below. ************ You have infinite supplies of Type 1 and Type 2 tiles. You have to cover the box with the tiles that you have. You can use any number of type 1 tiles and type 2 tiles. You can choose to use all tiles of same type and none tiles of the other type. But you cannot overlap the tiles. Also, when you cover the box with tiles, none of the tiles should be out of the boundaries of the box, and no part of the box should be empty (no block shud be empty). The tiles should perfectly cover the box with no holes and no protrusions. Your task is to write a program in python that will count the number of different ways (configurations) in which u can cover the box with tiles. 2 cofigurations of covering a box are different if the type or orientation (or both) of any tile of those 2 configurations are different. To clarify things further, there are following configurations of the tiles: 1) ** 2) * * 3) ** * 4) ** * 5) * ** 6) * ** If there are 2 tiles in the configuration that are of same type and placed in same orientation, then if you swap the positions of these 2 tiles, it WILL NOT be counted as a different configuration because all tiles of same type and same orientation are identical. Write a program that will accept an input, n, and produce an output, the total number of different configurations to cover the box of dimensions 2 X n. Example: If n=2, output should be 2. Because 1 configuration could be 2 type-1 tiles placed vertically, and another configuration could be 2 type-1 tiles placed horizontally. If n=3, output should be 5
That's a task, not a question. And your post is not a question that fits the purpose of this forum. You didn't ask for an explanation of a specific part of this task, so do you want the whole thing explained in even more words than it already consists of?
I suggest you try a bit harder understanding it and, if needed, come back with a more specific question.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
It would help if you fixed the formatting, but I get the general idea.
Unsurprisingly, it's a tiling problem. There is a rectangle that you have to fill with these shapes, filling it perfectly. Then you have to count in how many distinct ways that can be done, with "distinct" meaning exactly what you'd expect (but they spell it out for good measure).
I have the following problem:
Lets say I'm in a city with some friend we have a bunch of tasks to do. All persons start on a different position, for example (0/0), (10/5), (-20/0), ... , and every person can move x corrdinates per second.
Every task has:
A coordinate where it can be completed (for example (40/50))
A importance value ranging from 0 - X (for example importance = 5)
A time that is needed to complete this task
Also, some tasks can only be done if others are already completed.
Now comes the tricky thing: The group has a certain time, in which they can complete tasks. They now need to choose which tasks they want to complete, the goal is that the summarized "importance value" of the completed tasks is as high as possible. The group is also allowed to split up.
I tried to solve the problem in the past hours but i haven't come far and i'm burnt out. Please help
I have an array of several segments of a path with known start / end point. Direction of each segment is not known. It can be from start to end point or vice versa.
Each segment object is something like this:
PointA = p1
PointB = p2
pointA_is_connected = true (false for the first or last segment)
pointB_is_connected = true (false for the first or last segment)
I want to create a path from one end to another in one direction with all segments that can be connected to each other. All the segments in an array are segments of a ONE path.
Here is an image of what I have (in red) and what I want to have (in green)
What's the best way to achieve this? http://pgtehran.euphrat.es/pic.png[^]
You need to define a property that have to be 'comparable' and from wich result you can decide which segment choose.
I.e. defining coordinates for each starting and ending point of each segment you can choose an arbirtary small circle and search for those segments that are closer to your endpoint. The closest will be 'connected', then you will repeat the search with the opposite end of last connected segment until there are no more segments available.
Start and end point does have coordinates property.
Why choose an arbitrary small circle for checking? why don't check if the next point is exactly same as the start/end point of the current segment?
Now i'm very much what you guys would call a total amateur when it comes to math algorithms and any form of cryptography but i was just wondering if elliptic curve private keys usually rely on static values for all encrypted binaries being signed and verified can a atacker not recover K if DA shares the same public and private exponent?
The following code is a basic algorithm for hamming distance calculation, but due to the design of my application, it requires many times to use this algorithm, in order to improve application efficiency, I want to improve the efficiency of this algorithm, is there any appropriate methods? Assembly language possible?
Yes, well it depends which assembly language.
The most obvious thing is to use __popcnt64[^] to do 8 times as many popcnts in a cycle. Haswell can sustain 2 reads, a xor, a popcnt, an add and a fused sub/branch pair (hopefully the compiler will rewrite the loop logic) all together once per cycle, so that's pretty good.
You can also try the pshufb trick[^], the benchmark there shows it's a bit better. That takes more effort to make it really fast, doing as much vertical work as possible before doing a horizontal reduction and so on. May work better with AVX2, hard to say in advance.
Determine the incorrect statement below concerning the Union-Find data structure we
discussed in class (with union by rank and path-compression).
1. The union operation sometimes may not increase the height of
the resultant tree
2. The union operation can at most increase the height of
the resultant tree by one
3. The union operation always increases the height of
the resultant tree by one
4. The find operation sometimes may not increase the degree of
the root of
the resultant tree
5. The find operation requires two traversals f
rom node to root
I know this "isn't your homework" but we don't know what the Union-Find structure is as we weren't in the "class" where this was "discussed". If this was your homework I'd suggest getting additional help from your tutor if you need things explained, or arrange a study group with fellow students. But as this isn't your homework and we don't have access to the information needed to find a solution, there is nothing we can do to help.
I'm having trouble with the SPOJ problem below. While I'm new to C# I feel like I understand the concepts and am simply having trouble transferring it into code. More than anything the structure of the code is what I can't seem to picture in my head. To my understanding I need to find Brenda's optimal line first and then find out how best for Ann to react.
I'm at the point where I think I need less of a hint and more of a semi-solution so I can figure out where the gap in my understand is. Any help at all would be appreciated.
We have a project in which I am the head creator and we are in need of an algorithm. The algorithm must consist of multiple variables that will conclude the best possible option(s) based off of information collected by the user (if more details are needed please ask and I may be able to answer them based on the question). Can anyone help in creating the algorithm or direct us to someone who can help? Any guidance would be appreciated, thank you.
How do you expect us to ask you questions for details (not to say giving any answers) if you do not provide any details to start with...
What 'variables', what 'best possible option', what information collected', what 'user'?
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
I realize it was very general. I was more looking for someone who might be able to help with this and I can go into more details with that individual. I can explain a little more. We are working with some basketball coaches and part of the project is asking the question, how can a coach mathematically determine the best athlete for the program by the statistics each athlete provides while calculating what the coach needs to help their program? Also we would like to calculate the distance from the athlete to the program to give the probability of which player would be the best choice. I hope this provides a little more insight on the project.
I was more looking for someone who might be able to help with this
If you are trying to recruit a developer to write code for you then you are on the wrong site. Take another look at the link I posted in my previous response, which explains how to formulate a valid question.
Richard, could you be so kind and direct me to where I can find what I am looking for, rather then just a question? This is my first attempt and I don't want to be wasting anyone's time. I would appreciate your help, thank you.
Oops! I don't really think this is hacking. This is something which is not ilegal because if you ask operators for the unlock code, they will give you but sometimes they want you to use their service for a long time and they will delay your time. Perhaps, I want to start with modem and later learn the ones for phones that are shipped outside their country of operation since some of these phones come to my country and some become useless because the relatives of those who shipped the phones have no knowledge of this.
Unlocking with any means is not ilegal. Please check your laws and the meaning of hacking and compare them if they have a link. There is a calculator for that but it is online and I want to do this to help people who do not have internet connectivity always get the chance of calculating unlock codes.
Please understand this is not for my own selfish need. I just want to put my programming skills into use by helping those people. Unlocking is neither ilegal nor hacking.
Thank you for your suggestion but I don't really think they are going to give out that. If so, they are going to ask me for product details or question to verify I have bought from them which I don't have because when I use their products, I buy them from retailers who are not accredited dealers. Buddy, if you know this just help me out if you don't know too let me know.
I don't really think they are going to give out that. If so, they are going to ask me for product details or question to verify I have bought from them which I don't have because when I use their products, I buy them from retailers who are not accredited dealers
Whilst what you're doing might not be illegal (depending on your local laws), you do know that it is wrong and unethical. You're more likely to get answers to these kinds of questions on forums that are geared towards the lesser-ethical such as cracking forums and so on.
I'm looking to buid a program that works like a dating site and that matches you with the best options available for you. They usually show the results starting from the closest and then expanding the research larger and larger.
I'm doing my project in the US and Canada for my 1st test.
I'm woundering how can I set this up to be the smartest way possible.
Is it IP location, Latitude and Longitude, city....???
Do I need a complete database with all the distances between all the citites in the US and Canada?
Or maybe instead of a database with the cities, regroup the cities by urban Areas to make the matrix smaller?
I've been trying to work with a programmer and he says that to do what they do we would need a big computing power that for a little project can't be possible.
I'M confused and decided to come here for some help and see what you find coder have to say about all this.
I've been trying to work with a programmer and he says that to do what they do we would need a big computing power that for a little project can't be possible
Not based on your description.
- Determine a location. Ask them or attempt a service look up for IP (ask is probably better.)
- Then use a zip code location match to find a geo location for the zip code.
- Then 'draw' a box around the zip code - maybe based on user input miles from location.
- Then do a database geo look up to find others based on whether they are in the box or not.
More complex stuff than that happens on my personal development box every day.
For that matter you could just based it on zip code.
You'll need the lat and long of every zip code in the US\Canada\whatever. Where you get that data? I don't know, will it be free? Perhaps not. But that's beside the point.
If a user does a 10 mile search and their zip code is 1234 you find the lat\long of that zip, work out how much extra lat\long you add for 10 miles in all directions (you'll find the maths to convert lat\long to miles on-line if you search) and you search for users where the lat\long falls within this 10 mile "square" (eg if the user is at lat long 0,0 you search for users where the lat is between -10 and +10, and the long is between -10 and +10). That will give you all results in a 10 mile "square" around the user, but you *really* need a circle, not a square. You can leave the results as they are knowing some will be a little long, or you can do another set of processing on the initial results that fell within the "box" to eliminate the ones that are outside the 10 mile circle. You find this out using Pythagoras' theorem (again on-line if you need to search). Loop through every result and for each result calculate the "crow flies" distance between the two users using Pythagoras, and if that distance is > 10 remove it from the result set. If you want to show the exact distance between the user and the found user you'll need Pythagoras' theorem anyway. Doing this search as a two-step process will allow you to quickly eliminate most results using a standard, fast SQL query, and you then fine-tune the results in your code on that reduced result set.
The t array holds constants for each month, so the day can be calculated based on some recurring pattern of days within months. A look at the calendar should show you what this pattern is. The calculation using year, month and day yields some value, which is then divided by 7, giving the day of the week in the range [0-6].
Hi, I would be very glad if someone can help me with algorithm to solve following task.
We have a convoy of cars that are lined up in a row and must cross the bridge. Cars can´t overtake each other.
The bridge has limited capacity, which may not be exceeded.
Find the algorithm, which divides cars into groups so that the entire convoy cross the bridge in the shortest time.
Another group is allowed to enter only when the entire previous group cross the bridge.
Weight and speed of each car is known. The speed of group is determined by the slowest of car in the group.