Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Add "display:block" to the .button class. Remove all width, height, min-width and min-height properties from the .button class. Remove the <br> elements from between the list items.
  2. That code should run without error, as you can see in the documentation: https://docs.python.org/3/tutorial/datastructures.html#dictionaries Is that all of the code? There might be something you're not showing that is interfering.
  3. First, you haven't quoted your string, it should be reader.readAsText("C:\m.txt"); The second problem is that the browser is not allowed to read files directly from your filesystem. The third problem is that the readAsText method does not take a file path string as an argument, it takes a File object. You have to get the file object from a file input as shown in the example on this page: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onload var file = event.target.files[0]; // ... // ... reader.readAsText(file);
  4. Ingolme

    Em 7 Rem Confusion

    rem uses the font size of the root of the document, that's not <body>, it's <html>.
  5. Where did that screenshot come from? There is no standard in HTML or CSS that can do that, it might be some proprietary browser feature.
  6. Ingolme

    Em 7 Rem Confusion

    You seem to have mixed them up. An element set in rem is always relative to the root of the document and nothing else, all of its ancestors are ignored. The em is relative to the font size of the element's immediate parent.
  7. Your codepen example is working correctly in Firefox, Chrome and Internet Explorer. What browser are you testing in?
  8. The code you provided is doing just that. I am not experiencing any issues in any of the browsers I tested.
  9. I tested the code you provided and it works. The only problem I found with it, which might just be because of how it was pasted in the post, is that there are some strange invisible Unicode characters right in this part of the code at the end of the "width:auto" line. .ex-story-img{ width:auto; height:100%; Try deleting and then manually typing in these three lines manually into your CSS and see if that fixes the issue. If that does not fix it, then it means there are other styles interfering that you have now shown here.
  10. You create a date() object, and then you can use a timedelta() object to operate with it. Examples are shown here: https://docs.python.org/3/library/datetime.html#datetime.date A short program to add a number of days to a date might look like this: d = date(2018, 7, 20) delta = timedelta(days=5) d2 = d + delta There might be a shorter way to write it, but I don't work with Python very often so I'd have to look it up to make sure.
  11. I know a guy too. Anonymous sources cannot be trusted. You'll be hard pressed to find a top ranking site that doesn't use relative URLs.
  12. 1. Redirect all domains to the canonical site. If you're not doing that then you already have a bigger SEO problem. 2. Links relative to the site root do not have this issue. 3. Your backend software should be generating the absolute canonical links based on the current page URI. Yes, absolute URLs are used when the content of the tag will be converted to a link on another website, as in the case of OpenGraph and the canonical URL. 4. Your RSS feed should use the article's absolute URL for the same reason I described above. RSS feeds are not part of the website content and they should be generated by backend software. 5. That is not true. Search robots, like browsers, know exactly where they are and where they want to go. They're not human, so calculating URLs does not make them tired. 6. It takes 5 minutes to build a script to translate relative URLs. If somebody wants to copy your site, they will.
  13. I see no advantage to using absolute URLS, for SEO or any other reason.
  14. Wrap all the green blocks in a single container, give a left margin to the blue box equal to the width of that container. It's better not to use <div> elements when there are elements that better describe the contents, for example the red area could be a <header> element. The HTML might look something like this: <header class="site-header">Red block</header> <div class="sidebar"> <div>Green block</div> <div>Green block</div> <div>Green block</div> <div>Green block</div> <div>Green block</div> </div> <main> Blue block </main> The CSS to achieve the layout would be this: .sidebar { float: left; width: 30%; } main { margin-left: 30%; } If you want an element below the green and blue boxes, you should give "clear: both" to its CSS to force it below the green area. If the green and blue regions both need to be the same height, you could use a flex-box, but that is a bit more complicated to set up.
  15. By changing the prototype of a data type, you change every single object of that type. In this example, they are changing the prototype of the String object so that all strings have a trim() method. The trim() method removes spaces from the beginning and end of a string. The code you see in the replace() method /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g is called a regular expression, it is used to do complex manipulations with strings. There is a tutorial page about regular expressions here: https://www.w3schools.com/js/js_regexp.asp
  16. You have the decryption function, it's on the page you linked to earlier. http://www.howtocreate.co.uk/emails/test_RC4B64_js.htm The problem here is that you have two variables to find out. There are three parts of the equation, input, password and output; two of which you don't know. You have only the output and you are trying to determine the password, but in order to determine the password you also need to know the input. If you knew the input, the brute force algorithm would look like this: var Encryption = new Rc4B64Class(); var englishWords = [ /* ... List of all possible English words ... */]; var input = "This is the input message"; var output = "LgYkO2JSfWoA394oOvXrwO4mtuDkusLCzg=="; var password, test; for(var i = 0; i < englishWords.length; i++) { password = englishWords[i]; test = Encryption.Decrypt(output, password); if(test == input) { alert("The password is " + password); break; } } You don't know the input, so this brute force algorithm is not going to work. You also don't have a full list of English words, which would be at least hundreds of thousands of items long. If you want to build a program that reads the list from a file, you're going to have to learn a lot more Javascript, I am not going to explain that complicated process here when there are entire articles written about it all over the internet. If you have to ask how to do things like that, you still have not learned enough Javascript. I am going to reiterate that the task you have set out to do is impossible, if encryption were that easy to break we would have some serious security problems on the internet.
  17. Ingolme

    Dropping a table

    You can't just mix SQL and Python, you have to put the SQL in a string and pass the string into a database method. Try passing the "DROP TABLE" line as a string into the execute() method.
  18. I actually don't think you can easily brute force an encrypted string. Every attempt to decrypt it gives you an output message that could potentially be valid and you can't know for sure if the message you got is correct. You could do a check on the output to see if the it only contains characters that commonly appear in text, but that code might actually miss out on a valid output that happens to have unusual characters. Another possible way to test the output is to see if it has valid English words in it, but the message might not be in English. The other brute force attempt would test all possible inputs and all possible passwords to see if any of the input-password combinations give you the output message. It's pointless, you cannot brute force it. Don't even try.
  19. No, it is not possible. If it was, then the encryption would not be doing its job since anybody can decrypt it.
  20. Ingolme

    jquery issue

    The files are not the same, I downloaded and compared them. On one of the sites they got corrupted.
  21. Ingolme

    jquery issue

    The files are corrupted. Download the files from that site that is working, and upload them to the other site.
  22. Ingolme

    jquery issue

    It looks like your copy of jQuery is corrupted. Plugins.js and functions.js both have issues as well. You should contact the person who provided these files and tell them about it.
  23. It would help to know the exact message it showed.
  24. What do you mean by "doesn't work"? What is the expected result and what is the result you are actually getting?
×
×
  • Create New...