Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 06/17/2018 in Posts

  1. 1 point
    Sure, why not? <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title> HTML5 page </title> <!-- link rel="stylesheet" href="common.css" media="screen" --> <style> fieldset { width: 10em; } </style> </head> <body> <fieldset id="GC"> <legend>Group Count</legend> <input type="checkbox" value="4"> 2<sup>2</sup> <input type="checkbox" value="2"> 2<sup>1</sup> <input type="checkbox" value="1"> 2<sup>0</sup> </fieldset> <input type="button" value="Submit Group Count" id="submit"> <script> function summate() { var sel = document.getElementById('GC').querySelectorAll('input'), sum = 0; for (var i=0; i<sel.length; i++) { if (sel[i].checked) { sum += Number(sel[i].value); } } // return sum; alert('Sum: '+sum); } function init() { document.getElementById('submit').addEventListener('click',summate); } init(); </script> </body> </html>
  2. 1 point
    Every meaningful sequence of symbols comes from a source that should have documentation that describes how to interpret the symbols in the sequence. If you have a meaningless sequence of symbols, no meaningful information can come from it.
  3. 1 point
    Leading zeros do not change the value of the number. If you have 789 things, is 0000000000789 a different number? No, it's not, the zeros do not change the number. The hex value would be 0010 0011 0101, those are the three bytes, but if you put those together then you don't need the leading zeros. Also, this only matters if you are treating this as an actual number. Maybe those 2 leading zeros are part of the binary data, which means you would not remove them. If you're going to convert it to a number though, then you don't need leading zeros.
  4. 1 point
    Well, think about that question. All you have is a sequence of hex digits, right? Is there any other information there? Is there anything other than the actual hex digits? Because if there's not additional information about how to split that up or which digits go with each other, then is there a way to get any other information at all about the hex digits? I mean, take hex out of the equation if you want to. Here, base-10 digits: 513857634343546894648435486743543634 Now, if I tell you that the above is 3 numbers that are concatenated, how do you know what those 3 are? Is there any information in the above series of numbers which is telling you how many numbers there are or where they are separated or anything? What about letters: nauehdncifoendkdusydngkshcufwnwiiaksdhgk Now, that's 3 passwords concatenated. Is there any information there to tell you how to separate those? Why do you think hex is magically different? Why do you think a series of arbitrary hex characters contains some additional information that you're not seeing that would tell you which characters are part of groups?
  5. 1 point
    I'm not sitting there watching you, but when you are encrypting and decrypting data you are not dealing with "characters", you're dealing with binary data. If you open it in a text editor, the text editor will try to convert it to characters and show those, but it is not character data, it is binary data. You need to understand that, I've been trying to make the point that you are dealing with binary data, not text. If you copy and paste that binary data around you might be losing information depending on how you're copying it, because you're probably copying it from a program that is trying to display it as text. It is not text. It is binary data. Do not treat it like text. When you encrypt data, it does not change each character to a different character, it transforms the entire binary stream. It does not look at the data as a series of characters, it looks at the data as a series of bits. That is how you need to look at it. You keep looking at it like it's text. The encrypted data might not even be the same length as the original data. So, I'm not sure what the purpose of pasting this into a website to count the characters is, and there's no reason to try and paste it here. It's just binary data. The reason you are seeing different characters in different situations is, again, because you are treating it like it's text and it's not. Different programs might display binary data differently, especially if they're treating it like text. The only way to view binary data is in either binary or hex format, which are 2 different representations of the same data. With that text you pasted above, that contains Unicode characters. So, whatever you're using is treating it like Unicode text. Like I said, Unicode is a multi-byte character set. So, some programs might group the bytes into Unicode characters, and others might try to treat it as ASCII and show each byte as a character. That means they will have different lengths. Again, this is because you are treating the data like text when it is not. All of your confusion is due to the fact that you think you are looking at text. You are not. You are looking at a text editor trying to show you binary data, which it was not designed to do. Why would that ever happen? Why would encrypting or decrypting data result in characters that you should ignore? That seems like an awful quality in an encryption algorithm.
  6. 1 point
    That is how numbers are formatted, leading 0s will always be removed, unless you convert to text string.
  7. 1 point
  8. 1 point
    That looks fine, so what are you having problems doing? This doesn't look like an issue with recursion, but I don't know what you're trying to do that you're not able to.
  9. 1 point
    That's in a database, right? How do you have the database structured?
  10. 1 point
    Those aren't prepared statements, when you use prepared statements you do not put PHP variables in the middle of a SQL query. You prepare it with placeholders, then send the data separately. http://php.net/manual/en/pdo.prepare.php You need to initialize the array so that later you can add values to it: for ($i = 0; $i < count($periods); $i++) { $result[$periods[$i]] = ['sales' => 0, 'costs' => []]; Then when you get database results you add to sales, and add items to costs.
  11. 1 point
    I have no idea what that diagram is supposed to show, but if you're talking about recursion then depth-first means that you recurse before searching instead of after.
×