6 kyu
Encrypt this!
267 of 23,276suic
Loading description...
Fundamentals
Strings
Regular Expressions
Arrays
Ciphers
Algorithms
Cryptography
Security
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
I have been solving this problem for two days. I've tried a lot of options. And yes! It started working in the development environment. And here (For input string: "") Added even a null exception and NOTHING! What did I leave out or is it not a complete description of what should be when entering an empty string.
The Issue label means: "something seems to be wrong with the exercise mechanism, the tests, or the description." If you're asking for help with your approach, use the Question tag.
Then, for a question, "what did I leave out?": you don't clearly describe what your difficulty is. Without being certain of that, I will point at the sample tests (in C, Java, Ruby, etc.) which show that the correct result with input
""
is""
.This comment has been hidden.
The condition doesn't say anything about changing spaces, it's a little confusing
Because you don't change spaces, only words, not a kata issue.
python new test framework is required. updated in this fork
Approved. Thanks!
loved this kata, so much fun <3
It was interesting to solve this kata
Good difficulty for 6 kyu; highly recommend!
remove the text, "https://www.codewars.com/kata/5848565e273af816fb000449/discuss" at the end of sample test
Thanks
I am learning Haskell currently, and this was certainly a challenge! I learned a lot about the language from this Kata.
I took me few hours, im not going to lie. i took the worst decision by choosing dictionary approach. but i stuck with it for some reason and ultimetly finished the kata. feels good. even tho the time complexity of my code is O(n^2), it doesn't matter ;). thank you for providing this amaizing kata.
I got this. The kata is very nice. I love it.
This comment has been hidden.
Don't post solutions in Discourse, please.
This comment has been hidden.
On the first test "A wise old owl lived in an oak" it's not "65 119esi 111dl 111lw 108dvei 105n 97n 111ka". "lived" is "108devi" not "108dvei" when encrypted
No, you're wrong, and the test is fine:
See?
all my tests passed but not accepted '650 119esi 111dl 111lw 108dvei 105n 97n 111ka' should equal '65 119esi 111dl 111lw 108dvei 105n 97n 111ka' or '83Kk 100uLqWP 65pqfADetviVWcrWXKaZ 105AJYCUadf 120m 106ydALFOpBFg 107xEhxdiyTsNYIzRZoGhr 65VNFzQVZTlHxYYj 115JmgMXuhBeTyJJxjo 68avmGgvmYmEaJj 116MM 107OFtcEJGxOINZvhtd 98qaVvs 114HrXUREvAhhFsARS 80HMNZEHHGwjWXLHusv 103gdFCVEU 81ONwZydcxCZSbByFIQM 98pgqgeBuOcPd 102uTaJYKotkVEjWgH 77mO 1010 107JhZFrCBxUIXmJH 1060 82hccrttydtyo 75gjQLKfco 111VHyfzLIeQ 84fLEgNwCw 65SjMweZvCBBIXyug 74NeuUBXjdCTInuFB 73uqXw 77hnjgWssPOwzdkAzjK 121HKtNndIzNFcHjq 80vO 117WtVSRfdCCnBpoHFmIET' should equal '83Kk 100uLqWP 65pqfADetviVWcrWXKaZ 105AJYCUadf 120m 106ydALFOpBFg 107xEhxdiyTsNYIzRZoGhr 65VNFzQVZTlHxYYj 115JmgMXuhBeTyJJxjo 68avmGgvmYmEaJj 116MM 107OFtcEJGxOINZvhtd 98qaVvs 114HrXUREvAhhFsARS 80HMNZEHHGwjWXLHusv 103gdFCVEU 81ONwZydcxCZSbByFIQM 98pgqgeBuOcPd 102uTaJYKotkVEjWgH 77mO 101 107JhZFrCBxUIXmJH 106 82hccrttydtyo 75gjQLKfco 111VHyfzLIeQ 84fLEgNwCw 65SjMweZvCBBIXyug 74NeuUBXjdCTInuFB 73uqXw 77hnjgWssPOwzdkAzjK 121HKtNndIzNFcHjq 80vO 117WtVSRfdCCnBpoHFmIET'
Those strings seem not to be the same. So you are not passing the tests.
No! all tests are passed!
i can see some issue
Different result of one function....
'650 ...' should equal '65 ...' are clearly different. I think your code needs some work.
This comment has been hidden.
The tests are fine, your function is returning a wrong answer. It's failing the second sample test, check your code.
This comment has been hidden.
learn regex :)))
Updated to Scala 3
Thanks!
I kinda hate how the solutions are either long and convuluted (like mine) or use a regex to shortcut everything. I do understand that regex is a strong skill to use in C#, but it is difficult to read and may be reducing the core of this challenge.
Sorry, I'm some confused. I have got this result. I don't understand what difference between two string expected '65 119esi 111dl 111lw 108devi 105n 97n 111ka' to equal '65 119esi 111dl 111lw 108dvei 105n 97n 111ka' Can you help me?
There
thank you for your help
I struggled a bit writing code for this kata and not very proud of my solution (47 lines (no regex), gonna spend some time to shorten it), but still enjoyed the process. Nice kata
this is great practice after "Decipher this!". thank you
This comment has been hidden.
Calling
Kata.encryptThis("A wise old owl lived in an oak")
on your code should also throw an error in eclipse.Code blocks are defined by either being indented by 4 spaces or need ``` above and below the code block.
Hey, thank you for your respond. I changed my code a little and its working now.
I just want to say I'm addicted to regex
My code passed all the conversion test but i keep getting a failed error message. What could be wrong?
Read this: https://docs.codewars.com/training/troubleshooting/
Your code should output the results like the ones in example tests of the description. The sample tests are executed in the form of a tuple with each element representing
(input, output)
respectively, so bear in mind to not return your result in the form of a tuple.This comment has been hidden.
This one was easy.. :)
In Python, you should import the solution and test framework explicity into Sample Tests
Not an issue. It works as it is.
Many of my tests are passing, but I noticed something very strang with the ones that aren't. Without giving too much away, when I convert my first letter into an ascii character there are some words that duplicate the conversion, it looks to happen when the letters are the same and close to each other. e.g that > ttah > 116116ah anyone run into this before, I am completely stumped.
I don't think its possible to help you without looking at what your code is doing
This comment has been hidden.
Not a kata issue, your code is adding a trailing space as you can see in the error message.
Please read this: https://docs.codewars.com/training/troubleshooting/
Thanks for taking the time to reply . I solved it thanks again <3
My results are adding a [] to the end , and then im failing because somehow im returning [ ] a print of my return variable right before the return does not have the [] i dont understand whats happening at all.
The brackets are added by JUnit to show where two strings are different, check for trailing spaces in your string.
yeah i figured it out thanks though!
How to figure out with ASCII code to use?
String.fromCharCode() https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode
This comment has been hidden.
Read this: https://docs.codewars.com/training/troubleshooting#post-discourse
About your code, there is one step that's wrong and also, how does your code work with a single letter or a two letters word?
Damn it made me sweat a bit. But solution was worth it!
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Not a kata issue.
Ruby 3.0 should be enabled, see this to learn how to do it
Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)
Done. Thanks for reporting. Regards, suic
Amazing! In other words, the submit in the "MRI 2.5" don't work even the test pass. But if you select "MRI 3.0" in the combo in the top of the page and you code is right, it will work!
This comment has been hidden.
OP solved it, closing
Python new test framework should be used and 3.8 enabled
Hi @suic , I saw you fix the Ruby version, can you fix this if you had the time, thanks a lot ~~ :)
Hi ejini战神, I expressed my opinion on custom test frameworks and particularly on the old/new Python test frameworks:
See here.
If you want, feel free to contribute to the kata by forking the translation or directly editing it. Regards, suic
I've forked the Rust translation in order to update it to Rust 1.49 and updated
rand::Rng::gen_range
to its new signature that takes astd::ops::Range
.The description now also contains a code block for Rust.
This comment has been hidden.
What error??
'65 119esi 111dl 111lw 108devi 105n 97n 111ka' should equal '65 119esi 111dl 111lw 108dvei 105n 97n 111ka' '84eh 109ero 104e 115wa 116eh 108sse 104e 115ekop' should equal '84eh 109ero 104e 115wa 116eh 108sse 104e 115eokp' '84eh 108sse 104e 115ekop 116eh 109ero 104e 104drae' should equal '84eh 108sse 104e 115eokp 116eh 109ero 104e 104dare'
not really an error, but it doesn't approve my code
108devi
should equal108dvei
115ekop
should equal115eokp
etc.Please check your code and assertion message carefully before raising issue.
Well that means your code is incorrect, which is not a kata issue. (also there's almost 3k python completions)
Well that information alone doesn't really help, it just means you return wrong result. You should specify the input that causes this assertion message. For example the first one you return '108devi', but it should be '108dvei'. (again without seeing the input it's too difficult to tell what's going on)
You should read this FAQ for general troubleshooting.
Feel free to reply if you still can't figure it out.
This comment has been hidden.
This comment has been hidden.
Not a kata issue.
nice kata, JS done
This comment has been hidden.
Print the input, read the error message:
This comment has been hidden.
No, your code doesn't work perfectly, that's why it doesn't pass the tests. Read this
This comment has been hidden.
Hello. Python. My code passes sample tests or example tests. (If necessary, I can send, but not here.) But, when there is a full test suite, it produces an almost random number of errors, from 25 to 40. Everything is always identical, except for the differences. The differences between my answer and the solution are always the following:
Answer - 82hbdOh My - 104RbdOh
Answer - 120YSuUNY My - 89xSuUNY
Answer - 89rjXpYJBzwwOUnCphr My - 114YjXpYJBzwwOUnCphr
Here people wrote about double spaces, but this is not a space. And about the fact that always if a word is two letters, then the letters should be interchanged, probably not true, because in the model tests this is not there, in the description either, and in more than half of the full tests there are no errors. I am writing as a last chance. Because I’ve been here for 3 hours on this error. Thanks for everyrhing.
you are messing up with the ASCII conversion and also you aren't removing the second element after moving it to the end
you have to SWITCH the second and last position elements
I will check. I’ll write as a result.
While I was busy with this error, I already solved the kata "DecipherThis".
I don't know if you solved this in the end, but it looks like you're swapping the first and second characters before doing the ascii conversion. It's only the second and the final character of each word that needs swapping. Based on the fact you seem to have the correct final letter, I'm going to assume you're swapping the second with the last, then swapping the first with the second, then turning the first into its ascii code.
This comment has been hidden.
This comment has been hidden.
You can see your code fails (here and there) when tested with the first sample test.
I'm getting a STDERR
main.rb:10:in []=': no implicit conversion of nil into String (TypeError)
Question: is there a way to see the test case that it's failing on, so that I can try to fix this?Coding in Ruby
yup:
puts input
at the beginning of your function (orputs input.to_s
if it's an iterable)assert.strictEqual(encryptThis("The more he saw the less he spoke"), "84eh 109ero 104e 115wa 116eh 108sse 104e 115eokp");
above spoke == 115eokp incorrect
spoke == 115ekop correct
spoke == 115eokp that's correct, read the description again.
For C Language:
I'm getting results that I've never seen here before. When it says "expected 65" received "blah blah blah", the kata is telling me I'm getting all of the test cases as a received. My function is returning a run-on combination of all of the strings that are found in the test cases. I'm using calloc for dynamic memory allocation. Is the Kata not wanting us to use malloc/calloc? I've been digging through the test functions and I cannot find how I would be getting this.
This comment has been hidden.
Check your stacktrace - it tells you that fails on this line:
int one = (int)temp[0];
Add some println to prove for yourself that
arr.length
is 1[""]
,temp.length
is 0,temp[0]
is out of bounds...Thank you so much)
Remember marking your post as having spoiler content when you post code like that.
I'm sorry. I didn't know
There is in test "The more he saw the less he spoke" double spaces (in JS version).
Please excuse my ignorance but I'm not sure from the below what the [n 97n] part of this expected outcome is actually referring to? I can't think what random input would create this output.
Print the input, those are two letters words, you're missing the
n
on both of them.ramdom test is failing. can anybody share the input for that random test
What language?
Its C#. but got the issue .Problem has solved. thanks for quick help
OK, I'm closing the issue. To you question: You can print the input with
Console.WriteLine
. Messages printed to the standard output are visible in the tests. Regards, suicjava.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47) at java.base/java.lang.String.charAt(String.java:693) at Kata.encryptThis(Kata.java:13) at TestSuite.fixedTests(TestSuite.java:13) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:40) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80) at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:71) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229) at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197) at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128) at io.qualified.junit5.RunTests.main(RunTests.java:25)
Does anyone know what is the problem with this error statement? The codes passed the Random Test but not the Fixed Test. The codes encrypted all the example provided correctly in JGraps without error. Is there any suggestion?
fourth: it's in your code, line 13 third: it's a
charAt
method first: index out of range, at index 0CCL: what's the string you're trying to index?
The string I'm trying to index is provided in the problem A wise old owl lived in an oak The more he saw the less he spoke The less he spoke the more he heard Why can we not all be like that wise old bird Thank you Piotr for all your help
Thank you for explaining the problem Blind4Basics
(more complete answer: "it's an empty string")
;)
thanks Blind4Basics. I have figured out the issues and fix the codes. My codes work now. Thanks for showing me how to read errors
This comment has been hidden.
Not an issue. Your code is the source of the error.
This comment has been hidden.
The sample tests in C declare
int encrypt_this(const char *str);
Should return
char *
Hi, thanks for reporting. I've changed it. Please check. Regards, suic
.
I don't understand if double space is a bug or a feature (Java);
expected:
but was:
I modified the random tests. They don't generate double spaces anymore. Regards, suic
gets the following error message:
solution.swift:7:26: error: value of type 'Character' has no member 'asciiValue'
What could be the reason? If I run it locally, it works.
Different Swift versions most probably.
expected:<65[ 119esi 111dl 111lw 108dvei 105n 97n 111]ka> but was: <65[ 119esi 111dl 111lw 108dvei 105n 97n 111]ka>
Can't get it really ? The implementation is on Java... Any suggestions ?
Maybe there are more spaces than needed there but can't be seen because you didn't use backticks to format the code. To increase the readability of comments or descriptions, see this page in the github wiki.
If you want I can show the code implementation.
Yes, use the markdown and mark your post as having spoiler content too so we can check what could be wrong.
This comment has been hidden.
I see the error message like this, it's related to how you replace the first character.
Thank you I fixed it.
This kata should be 5 kyu if random tests might generate empty strings as random words:
And this would work as expected (no random spaces before/between/after words):
Thanks for reporting. I've applied your suggestion to Scala random tests. Regards, suic
Test code for C doesn't provide useful output for errors in the randomized tests. It just tells you that "The expression (as strings) (one) == (two) is false." It's not clear to the user that "one" and "two" are variable names, not the expected and received values. See @Satielo's issue below. The error messaging needs to be reworked.
Updated C translation. Please review.
This comment has been hidden.
@clcraig: Thanks, it's approved.
@Satielo, running your code with the new error messaging clearly shows the issue. Give it a try. You're solution is almost correct, expect for a minor quirk in the randomized test data. It's a legitimate quirk, so I think it should be left in place. I've added a new case to the sample and fixed tests to help with debugging. Good luck!
in the kata encrypt this, with C languaje, theres is a kind of error, because teh kata says, firstable, the first character of each word must be replaced with its ascii code, and in one of the test it shows the next message:
The expression (as strings) (one) == (two) is false.
this cant be correct because "t" is not the ascii code for o, and "wo" can not be the reverted position of "ne", i tried to complete the kata, my code passed all the tests, except for this one.
one
andtwo
are variable, not valuesrandom tests are in place to prevent hard-coding
I don't understand the problem description. However, what if the problem is: your solution didn't pass all tests, so it's not correct. I bet that this is the case. Try to paste it here and mark it as spoiler.
Regards,
suic
It wasnt in random Tests but in the first tests, the solución passed all the random Tests
@Satielo, that error message is confusing. I've reopened this issue so the test code can be fixed. Your code is failing on the random tests. I don't know why without seeing your code. If you do post it in the discussion, then please mark it as
spoiler
. We'll get the test code updated so it's output is more useful.@suic, please see the issue I opened above.
There are still double spaces in random tests in python version.
it's not that hard to avoid double spaces
Check now. I've modified the random input generator.
It is not about avoiding the double spaces is hard or not mate. It is about specifications of the problem.
In JS too.
There are spelling mistakes even in the tests. For example "wise" is "119eis" not "119esi" unless you're reversing the letters in the entire string as well, which the instructions don't say.
Not at all, the test is ok:
wise
119ise
119esi
(second letter was i and last letter e)See?
This comment has been hidden.
Mention the language, maybe the problem exists in a language and not in another.
I don't understand what the issue is. As "There are no multiple spaces in the test cases." you don't need to care about them. If the issue is that there are languages with multiple or trailing spaces please raise a new issue and list the languages.
Regards,
suic
I do not know what happens with the tests, when I perform my function it does it in the correct way in the way it is in the instructions, but it tells me that it expects another value and it is the sentence with repeat cheracteres. What happen?
Can you paste here your code and mark it as a spoiler? Thanks, suic
This comment has been hidden.
I've made some changes in the JS tests. Your code is incorrect. Here's an example test output:
Regards,
suic
@suic: Could I suggest you make Node 8.1.3 the default version? There it shows the Expected and Actual values, in Node 10 it doesn't (only the error message).
@Chrono79: Do you know how? AFAIK it's not possible. Thanks
@Chrono79 Node 10 should show expected and actual values.
The error message should be something like
expected 'A' to equal '65'
. What do you see?With Node 10 I see this:
With Node 8.1.3 I see this:
Where one can click on Expected and Actual and see those values. The second is clearer.
I see. That's from Codewars test framework which we no longer use on Node 10+. I'll see if it's possible to port it.
That would be great, thanks.
thanks for the help guys, I don't think about the version node, and I will thinking again my code.
I can confirm the problem is in your code, check what it does with a 2 letters word for instance.
yeah men, the problem was my code well not, the problem was my logic in that moment, but I can do it the challengue. The problem was that I misunderstand the assert section. thanks for the help
In Javascript "Run Sample Tests", only the first test runs.
Actually all tests run but as they are in a single
it
block, only one line is reported. Try to modify any of the cases to get a failure (e.g. the last one) and you'll see that all of the run. Regards, suicAlso for JavaScript, is there a way to show another test case? The first one is empty so it is not helpful when trying to console.log() and check my work. (In other words, is there a way to have, say, the " ("A wise old owl lived in an oak"), "65 119esi 111dl 111lw 108dvei 105n 97n 111ka"); " be tested as opposed to " (""), ""); "? Also, clarification on what it means to "modify any of the cases to get a failure" would be greatly appreciated. Thank you!
You could just comment the first test and check the result of the next one.
Shouldn't the fact that the double spaces and the ones at beginning/ end of the string must disappear from the solution? or at least include these examples in the test cases?
Hi, in which language? Thanks, suic
python
python
Thanks for reporting this. I modified the random tests. Regards, suic
Thanks for reporting. I modified the random tests. Regards, suic
Scala translation ready for review.
Approved! Thanks.
This comment has been hidden.
Issue
's are kata-related, for help with code usequestion
's. You should also format your code correctly because it's impossible to tell what your code looks like with whitespace.Not at all. You're not placing second char at the end of the word, and you're not keeping chars at the indices
[2; len(word)-2]
at their original place. Maybe there're more problems, but it's hard to work out what this unreadable code does.This comment has been hidden.
Forked and fixed. Awaiting approval.
Approved. Thanks.
Ruby translation kumited -- please check and approve
Approved, thanks! :)
Köszi
You should probably add a test case for an empty string.
Good idea! I've added this test case to fixed and example tests. Thanks, suic
why not make the rules a bit more compact?
could be
The second letter needs to be switched with the last letter
only.Correct! I've changed it. Thanks, suic
The tests can't find the module SimpleEncryption - the default code needs module Kata to be renamed to module SimpleEncryption!
Thanks! It's fixed now. Regards, suic
Take a good look at those instructions again.
What's supposed to happen with the last letter?
Thanks, fixed.