|
You might be "forecasting"; but nailing one small amount to a given month is meaningless unless it has some significance to it, like "Mother's Day".
If anything, the accounting person may also be "depreciating" or modeling the life cycle of a marketing campaign or product.
Maybe it's all on a "need to know" basis...
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
public static int LastIndexOf<T>(this IReadOnlyList<T> s, IReadOnlyList<T> t, int startIndex,
IEqualityComparer<T> comparer) where T : IEquatable<T>
{
Validate(s, t, startIndex);
if (t.Count == 0) return 0;
if (s.Count == 0 || s.Count < t.Count) return -1;
if (comparer == null) comparer = EqualityComparer<T>.Default;
if (t.Count == 1) return LastIndexOf(s, t[0], startIndex, comparer);
var table = BuildTable(t, comparer);
var i = 0;
while (startIndex - i >= 0)
{
if (comparer.Equals(t[t.Count - i - 1], s[startIndex - i]))
{
if (i == t.Count - 1)
return startIndex - t.Count + 1;
i++;
}
else
{
if (table[i] > -1)
{
startIndex -= i;
i = table[i];
}
else
{
startIndex--;
i = 0;
}
}
}
return -1;
}
Full source code can be seen here[^].
The method works like String.LastIndexOf which searches string from the last character. The BuildTable method is exactly same with normal KMP algorithm.
I'm not sure if this is the best solution though.
|
|
|
|
|
I would have just reversed the 2 strings and compared those.
(KMP: Keep Me Partying).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
If y'all don't mind, I'd love some input on this idea I have laid out below and an algorithm/process to make it come to life.
When you were a child did you ever making up a language with your friend so that when you wrote messages to each other only you two would be able to understand it? It was always simple stuff like a = "1", b = "!", c = "+", and etc. Basically, I want to mimic the thought process used to create a made-up language, but on a more complicated level. I would like to create a learning agent that will find correlations between a set of number strings and a set of common English words, so that the number strings and English words can be translated to and from one another. For example:
The agent would take in a set of strings of numbers like this: 010001110100111111, 10011101110, and 0111100101100000. And a set of English words like this: "banana", "apple", and "pear".
After reviewing both groups of data, the agent could match the numbers/letters like this: a = 10, b = 0100, e = 01110, l = 0011, n = 101, p = 0111, and r = 0111111
So that when translated, the numbers from above are as follows: 0100011110100111111 = "bear", 10011101110 = "ape", and 101011100111100011 = "nepal". And, when translated the words from above are as follows: "banana" = 0100101011010110, "apple" = 100111011101101110, and "pear" = 011101110100111111.
What are your thoughts on this idea? I know it would be a complicated process, if it's even possible at all. Would it be beneficial to include letter frequency statistics? Or even weight the words, for example weight "the" higher than "cat" since "the" is used so often in conversation. I realize that inevitably there would most likely be some number-to-word translations that would just result in garbage, but I hope that I could create this agent in such a way that those results don't happen very often. Would supervised learning pertain to a problem like this?
Thank you for your input! Also, this is just for a personal project - no assignments or projects or anything. I just think it'd be cool.
|
|
|
|
|
Since everything in a computer is a bunch of 0s and 1s, this already exists. For example banana = 011000100110000101101110011000010110111001100001.
|
|
|
|
|
Hi Richard, thank you for the response! I know that it's possible to translate strings into binary, as you have above, but I would like to create a new and different kind of "language" to translate strings to. I hope that makes sense?
Basically what I would like to achieve is a program that takes a string, translates that string to binary (a string of 0s and 1s), and then translates that binary string into a new string so as to make the original message look totally different. It's really like a secret code in a way! (I'm really into spy movies, so I love stuff like this haha)
The program would work like this, for example:
1. "hello world" would be translated to binary "011010000110010101101100011011000110111100100000011101110110111101110
0100110110001100100"
2. the binary string is then translated to the new string using the new translation formula created with the intelligent agent, such that (for example) "0110..." = "goodbye space"
So, I want to see if I can create an intelligent agent that can find a new correlation between a long binary string and common English words. I hope that makes sense!
|
|
|
|
|
You're talking about a cipher.
Specifically, you're talking about a sort of steganography, the classic method of hiding a message in plain sight. This can apply to text or images or even audio.
There's your google keywords. Go forth and enjoy!
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Sweet, thank you so much!
|
|
|
|
|
Sometimes you just "go"; it's an iterative process that might lead (nowhere?).
Seems I would be looking at "primitives" and "building blocks" (in this case).
Starting with "tokens".
Then cataloging "nouns", "verbs", prepositions, etc.
Can't very well translate "verbs" to "nouns", for example.
Perhaps some readings on compilers and interpreters; particularly the "lexical analysis" phase.
|
|
|
|
|
Thank you so much for your input! I'll definitely do some research on these points.
|
|
|
|
|
It depends what you mean by "intelligent agent". As it stands you cannot 'correlate' between two distinct phrases, even going via a binary array.
|
|
|
|
|
I think I understand what you're saying.
To clarify I've been researching if it's possible to use machine learning to find a plausible cipher that would translate binary strings to different English words. And I'm definitely still researching haha
So do you mean that it's impossible to do so? I understand if so, because most of the ideas that I've had thus far are essentially rule-based algorithms.
|
|
|
|
|
There are already many ciphers around, but they are all two-way. You cannot just feed a lot of binary strings in and expect proper words to come out.
|
|
|
|
|
Can someone send me a code with an implementation of the original version of Tiny Encryption Algorithm with simple encryption and decryption of texts. Thank you!
|
|
|
|
|
All you had to do is writing 'Tiny Encryption Algorithm' in Google...how sad...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
No Repost !
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
I'm a student currently taking up a Thesis subject, and our Research Title is "An Investigative study of Tiny Encryption Algorithm Security and Encryption Level". We're searching for some programs with an implementation of TEA (original version) with simple encryption and decryption of texts in C/C++/PHP. Can you help me?
|
|
|
|
|
Rhonnn wrote: our Research But you want someone else to do your work.
|
|
|
|
|
Rhonnn wrote: We're searching for some programs with an implementation of TEA (original version) with simple encryption and decryption of texts in C/C++/PHP.
Google is your friend. Learn to use it, a very much needed skill.
Rhonnn wrote: Can you help me?
Will I get credit and diploma ?
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
Hi everyone,
If there is anything you don't understand in what I'm about to explain, feel free to express it, as english is not my mother language.
I'm working on a bus routing problem. I've been reading few papers about vehicule routing problem, network designing and stuff like that, in order to pick the algorithm that will fit the most what I want.
Seems like genetic algorithm is the most used for that kind of problem. However, I don't know if it fits with my specific demand, cause I have less constraints than in the applications covered in the papers, so I was wondering maybe there are "simpler" algorithms out there that can do the job.
Thing is I don't have no constraints regarding traffic or vehicle capacity nor designing the network itself : in fact, my input data are :
- Predefined bus lines with all the stops
- Distance between each point
- Schedules for each lines
So my work consists in determining how much buses do I need to optimize use time and distance for each bus used.
My real question is, should I keep looking into genetic algorithms even if I have less constraints than in the applications of it i've seen, or do you feel that there can be a more effective algorithm.
Thanks a lot for reading this
|
|
|
|
|
You should read about Linear Programming.
Linear programming - Wikipedia[^]
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
modified 21-Nov-16 13:09pm.
|
|
|
|
|
I would find it hard to pick an algorithm until I had defined what it means to "optimize use time and distance".
That's the type of statement a "salesman" would come up with; and which winds up sinking a project because nobody knows what it means (although everyone assumes everyone else knows what it means).
|
|
|
|
|
Hey guys,
Im stuck on this algorithm or problem for which I have to come up with a solution and create psuedocode for this. Any help would be appreciated.
"The Big British Brass Barrel Consortium (BBBBC) has a lot of barrels (made of brass). Every day they receive a large set of orders from other companies for their barrelling needs. Each company will send them a list of different fluids that they have, for which they need barrels to transport the fluids. The various amounts of fluids will be specified in terms of their volume in cubic metres. The BBBBC have a large stock of barrels and they store the height and diameter of their barrels in a database. Every day they need to work out if they have enough barrels in stock to fulfil the orders. If they don’t then they need to compile a list of the number and capacity of barrels that they’ll need to borrow from their competitors. Propose a solution to solve this problem."
Thats what I got to DO!
Also, Private messages would be appreciated.
|
|
|
|
|
A public message: this is your homework so you are expected, at the very least, to make an effort to solve it yourself.
|
|
|
|
|
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.
As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better.
When you just ask for the solution, it is like trying to learn to drive a car by having someone else training.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|