|
Hi,
I am trying to build email spam filtering .I have already done when email has text only but the problem when deal with images
Any help how to install tensorflow and deal with images.
Thanks
|
|
|
|
|
|
anyone would like to try a program on this. i have some practice material. Also would love to see what you are all upto. share your work too.
The running time of the program should be less than 4 seconds.
Mina wants to go on a trip during the a summer vacation.
She has to pay in advance several things such as airfare, lodging, car rent, show tickets,
etc. To pay them, she wants to use her mileage points from her credit card, airline, cell
phone, etc.
She can divide mileage points from one source (ex. airline mileage) to pay multiple things
(ex. airfare and tickets). Also she can merge mileage points from multiple sources (ex.
airline and cell phone) to pay one thing (ex. car rent).
However, there can be a limitation in applying certain mileages to certain type of payments.
For example, suppose she has 100,000 (in Korean Won) airline mileage and 50,000 cell phone
mileage, and she wants to pay 90,000 for airfare and 70,000 for car rent 1 , there can be a
limitation that she can use airline mileage for both airfare and car rent, but she only can
use cell phone mileage for car rent.
With that limitation, it is not a good idea to use only airline mileage to pay for car rent,
because, after that, she needs to pay 60,000 for car rent (after she use 90,000 for airfare
and 10,000 for car rent from 100,000 airline mileage). Instead, it is a reasonable choice to
use 50,000 cell phone mileage for car rent first, and then use 100,000 airline mileage for
airfare and car rent, which results her to pay 10,000 for either car rent or airfare.
Now given a set of mileages, a set of payments, and lists of feasible payments for each
mileage, calculate the minimum amount of money that Mina has to pay.
Input
2 <-- # of mileages
10 5 <-- mileage #0 and #1
2 <-- # of payments
9 7 <-- payment #0 and #1
0 1 <-- mileage #0 can be used for payment #0 and #1
1 <-- mileage #1 can be used for #1
Output
1 <-- minimum of payment 1 is needed
|
|
|
|
|
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hello,
I need to print statement of account of my clients. I have a table that contains my invoices and another table that contains my payments. Each month I will have to print the history of invoices and payments with last month balance the calculate the new balance.
Date of transaction Reference Invoice Payment Balance
2016-02-25 09:23 FLO1602001 2281.2700 0 2281.2700
2016-02-25 09:51 FLO1602002 18860.1000 0 21141.3700
2016-04-14 09:39 RV16040100 0 -20205.3700 936
Could you advise me? What is the best practice? 1. I create a new transaction table and each month I fill this new table with my invoice and payment tables. Or 2. I re-calculate each month my last month balance ?
|
|
|
|
|
Accounts payable (AP) or receivable (AR)?
"Best practices" utilizes "journals"; to which daily transactions are "journalized"; which are then "posted" to "sub-ledgers" that maintain current balances; and monthly closing / opening balances.
The AP and AR (sub)ledgers typically contain one account per vendor / customer; with "sub-accounts" representing invoice debits and credits.
The AP and AR ledgers roll-up their totals to the "general ledger"; as (total) payables and receivables (per period; and current balances).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Thank you for your reply. Do you have a link to a tutorial or more documentation?
|
|
|
|
|
|
The other response is good.
However if in fact this is only for you, then it is just going to be easier if you do exactly what you suggested, recalculate each month for the previous month.
Creating a new table each month would not be a good solution.
|
|
|
|
|
Hello.
There's an algorithm I've been asked to implement, from a paper called:
A chaotic image encryption algorithm based on perceptron model .
It was introduced in this paper.
I've spent quite some trying to implement it, but so far without success.
First of all I'd like to point to example results the authors are presenting - they say that for the Lorenz System their starting point was
X = 0, Y = 0, Z = 10^(-10) , but in the system if initial points of X and Y are equal to 0 then they will remain so, no matter the step we take. And actually mainly X and Y points from the system are used in the algorithm while Z's role is to increase randomization/variety of whole process.
The second thing which is unclear to me is in 2nd step, it says there to choose 8 bits in Z8 to create m, whereas Z8 is the Z coordinate from a point obtained through Lorenz System, but those are actually floating point values, would that mean I should be using bit representation of double/float type and choose the 8 bits from that?
In my implementation, as the m value will be later used for XOR operations with wj, wi, and those will have values within [0-255], I've been using bit representation of the Z8 (double type in my implementation) and in a 8-times loop I've been doing XOR operation on n-th bit of wi/wj with randomly chosen bit from Z8. Would that be correct?
And the last thing is the threshold value - θ - which is obtained through XOR operation on w'1 and w'2, but those are made from w1 and w2, which are obtained through same keyX value... so in the end w'1 and w'2 have same values, doing XOR on them I will always have 0, so what's even the point of having to add/subtract that threshold value if it's always gonna be 0 anyway?
For a reference I've set up a GitHub repo with my implementation and example results - encoded images and histograms. There you can find that I also tried using normal distribution instead of Lorenz System - then results are actually a bit similar to those presented in the article, but that's only if I use pure random distribution omitting the 2nd step and simply generating random numbers for the X, Y and Z without taking any step/choosing new starting points.
I've spent bunch of time trying to figure out this algorithm but I didn't manage to obtain results as those in the article.
I'd highly appreciate any help, maybe I'm confusing something or making wrong assumptions?
I'd like to also add, that I'd already tried to contact two of the paper authors but unfortunately I have not received any response.
|
|
|
|
|
Hi guys.
My google foo seems to have left me this morning as well as my cognitive abilities.
Lets say I have a list of 3 numbers, say (31549, 20468, 17625), that together add up to 69642. Say I have another list of numbers, (10211,8821,6894,6497,6482,5623,5594,5132,4471,4326,3245,2346), that also add up to 69642. I need to select the numbers from the second list that add up to the individual numbers in the first list.
In my example the result I would expect would be
10211 + 5623 + 6894 + 8821 = 31549
3245 + 6497 + 5132 + 5594 = 20468
21346 + 6482 + 4326 + 4471 = 17625
Hope someone has some ideas to help.
Thanks in advance
Everyone dies - but not everyone lives
|
|
|
|
|
Create an array of the second numbers. Take each of the first set in turn and loop through the second arraylooking for the combination that sums to the selected number. You will need to loop through the array taking each number in turn and adding one or more of the others looking for a combination that makes the sum.
|
|
|
|
|
Ah! the brute force approach. Sometimes the obvious escapes you. Many thanks for kickstarting my brain this morning.
Much appreciated
Everyone dies - but not everyone lives
|
|
|
|
|
|
Anyone here understand the following question?
SET sum TO 0
FOR i=1 to size
FOR j=1 to size
sum=sum +1
H
Any help is appreciated! TY
modified 18-Apr-17 9:14am.
|
|
|
|
|
Yes. Probably most of us. But ...
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Hiya. I am not requesting answers, Nor is it my " homework ", all i'm enquiring about is just brief guidance on how to logically approach the question. All the tutorials on you tube seem irrelevant to this type of scenario. Does anyone know any GOOD sources that may aid me in this question?
|
|
|
|
|
Perhaps you should think "a little bit" logical.
The answer to the question comes from the difference of the both code-snippets.
Perhaps you try to imagine what the both double-loops are doing in the code-part 1 and what the difference is to code-part 2.
One part of "your" solution is to realize how much total loops are done in each code-part (and of course the understanding how to find it out) ...
So ... if you want further help : give me/us the answer to my last sentence ...
|
|
|
|
|
Pick an arbitrary time to complete operation "sum = sum + 1" and proceed from there.
It's all relative.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I worked out the answers to be O(N) for A and 0(N^2) For B. Any ideas how i could use this to now to calculate how long it would take the algorithm to solve a problem with the size of 1 million operations
|
|
|
|
|
On which hardware, implemented in which language?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Update: the answer to A was wrong and i changed it.
All i know is that it's capped at 1 million operation per second, the rest is unknown to me.
|
|
|
|
|
Member 13133031 wrote: All i know is that it's capped at 1 million operation per second, the rest is unknown to me. You stated in the original question that "size" becomes one million "operations".
SET sum TO 0
FOR i=1 to 10
FOR j=1 to size
sum=sum +1
In that case, the word "operation" is confusing. If you increase the iterations, you'll be executing more instructions.
Since you can count the instructions, you can calculate how long it takes if you know the instructions per second. Shouldn't be too hard to implement this in a BASIC-language and simply see what happens if you change the "size".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
i have script for encrypt dan decrypt...
Public Shared Function Decrypt(ByRef Msg As String, ByRef Key As String) As String
Dim str As String
Dim builder As New StringBuilder
Try
Dim num5 As Integer = (Msg.Length - 1)
Dim i As Integer = 0
Do While (i <= num5)
Dim num3 As Integer = Strings.Asc(Conversions.ToChar(Msg.Substring(i, 1)))
Dim num2 As Integer = Strings.Asc(MFunction.GetKey(Key, i))
Dim charCode As Integer = (num3 - num2)
builder.Append(Strings.Chr(charCode))
i += 1
Loop
str = builder.ToString
Catch exception1 As Exception
ProjectData.SetProjectError(exception1)
Dim exception As Exception = exception1
Throw New Exception(("Public Function Decrypt(ByRef Msg As String, ByRef Key As String) As String Error : " & ChrW(13) & ChrW(10) & exception.Message.ToString & ChrW(13) & ChrW(10)))
Finally
builder.Length = 0
End Try
Return str
End Function
Public Shared Function Encrypt(ByRef Msg As String, ByRef Key As String) As String
Dim str As String
Dim builder As New StringBuilder
Try
Dim num5 As Integer = (Msg.Length - 1)
Dim i As Integer = 0
Do While (i <= num5)
Dim num3 As Integer = Strings.Asc(Conversions.ToChar(Msg.Substring(i, 1)))
Dim num2 As Integer = Strings.Asc(MFunction.GetKey(Key, i))
Dim charCode As Integer = (num3 + num2)
builder.Append(Strings.Chr(charCode))
i += 1
Loop
str = builder.ToString
Catch exception1 As Exception
ProjectData.SetProjectError(exception1)
Dim exception As Exception = exception1
Throw New Exception(("Public Function Encrypt(ByRef Msg As String, ByRef Key As String) As String Error : " & ChrW(13) & ChrW(10) & exception.Message.ToString & ChrW(13) & ChrW(10)))
Finally
builder.Length = 0
End Try
Return str
End Function
what algorithm is used?
Please advise...
|
|
|
|
|
91191109 wrote: what algorithm is used? It's your code, you tell us.
|
|
|
|
|