UnicodeDecodeError, invalid continuation byte

In binary, 0xE9 looks like 1110 1001. If you read about UTF-8 on Wikipedia, you’ll see that such a byte must be followed by two of the form 10xx xxxx. So, for example: But that’s just the mechanical cause of the exception. In this case, you have a string that is almost certainly encoded in … Read more

How to create id with AUTO_INCREMENT on Oracle?

There is no such thing as “auto_increment” or “identity” columns in Oracle as of Oracle 11g. However, you can model it easily with a sequence and a trigger: Table definition: Trigger definition: UPDATE: IDENTITY column is now available on Oracle 12c: or specify starting and increment values, also preventing any insert into the identity column … Read more

Form inside a table

A form is not allowed to be a child element of a table, tbody or tr. Attempting to put one there will tend to cause the browser to move the form to it appears after the table (while leaving its contents — table rows, table cells, inputs, etc — behind). You can have an entire … Read more

Javascript Function that returns true if a letter?

You could just use a case-insensitive regular expression: If you are supposed to be following the instructions in the comments about greater than and less than comparisons, and you want to check that the input is a string of length 1, then: Expand snippet You’ll notice I didn’t use an if statement. That’s because the … Read more

How do you create a REST client for Java?

This is an old question (2008) so there are many more options now than there were then: Apache CXF has three different REST Client options Jersey (mentioned above). Spring RestTemplate superceded by Spring WebClient Commons HTTP Client build your own for older Java projects. UPDATES (projects still active in 2020): Apache HTTP Components (4.2) Fluent … Read more

Create your own MD5 collisions

These following two different 128 byte sequences hash to the same: MD5 Hash: 79054025255fb1a26e4bc422aef54eb4 The differences below are highlighted (bold). Sorry it’s kind of hard to see. d131dd02c5e6eec4693d9a0698aff95c 2fcab58712467eab4004583eb8fb7f89 55ad340609f4b30283e488832571415a 085125e8f7cdc99fd91dbdf280373c5b d8823e3156348f5bae6dacd436c919c6 dd53e2b487da03fd02396306d248cda0 e99f33420f577ee8ce54b67080a80d1e c69821bcb6a8839396f9652b6ff72a70 and d131dd02c5e6eec4693d9a0698aff95c 2fcab50712467eab4004583eb8fb7f89 55ad340609f4b30283e4888325f1415a 085125e8f7cdc99fd91dbd7280373c5b d8823e3156348f5bae6dacd436c919c6 dd53e23487da03fd02396306d248cda0 e99f33420f577ee8ce54b67080280d1e c69821bcb6a8839396f965ab6ff72a70 The visualization of the collision/block1 (Source: Links.Org) The visualization of the … Read more

Is there a Public FTP server to test upload and download?

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 3 years ago. What I want to do is measure broadband speed using c#. To do this, I use NetworkInterface.BytesReceived and BytesSent to get the … Read more