Jump to content

Ingolme

Moderator
  • Content count

    13,569
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by Ingolme

  1. Ingolme

    calendar arithmetic

    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.
  2. Ingolme

    How can i get right image src code from ftp server

    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.
  3. Ingolme

    How can i get right image src code from ftp server

    Where are your sources?
  4. Ingolme

    How can i get right image src code from ftp server

    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.
  5. Ingolme

    How can i get right image src code from ftp server

    I see no advantage to using absolute URLS, for SEO or any other reason.
  6. Ingolme

    html - custom divs structure

    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.
  7. Ingolme

    Doubts about this example.....

    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
  8. Ingolme

    request about a script

    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.
  9. 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.
  10. Ingolme

    request about a script

    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.
  11. Ingolme

    request about a script

    No, it is not possible. If it was, then the encryption would not be doing its job since anybody can decrypt it.
  12. Ingolme

    jquery issue

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

    jquery issue

    The files are corrupted. Download the files from that site that is working, and upload them to the other site.
  14. 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.
  15. Ingolme

    Webpage doesn't work on iOS

    It would help to know the exact message it showed.
  16. Ingolme

    Webpage doesn't work on iOS

    What do you mean by "doesn't work"? What is the expected result and what is the result you are actually getting?
  17. Ingolme

    redirect into three different level website from login

    The issue is not related to PDO. The reason your code is not working is that your logic is wrong. This is the structure your code has: $username = $_POST['username']; $password = $_POST['password']; if($username && $password) { } elseif ($username && $password) { } elseif ($username && $password) { } else{ } You're making the exact same comparison three times in a row. If the comparison is true, only the first one will run, if the comparison is false then only the else block will run. The solution to your problem is to do one single query and pull out values from all three fields: Administrator, License, and Scorer. After these values have been pulled out, read these values and make a decision based on them. You are using prepared statements wrong, you should not put variables into the SQL string, put placeholders and then assign values to the placeholders, as shown in the tutorial page: https://www.w3schools.com/php/php_mysql_prepared_statements.asp If you do not fix that, your page is wide open to being hacked, people will be able to log in without knowing the username or password. You are also making the mistake of storing passwords in plain text in your database. This is a bad idea because if anybody manages to reveal the contents of your database, every single user will have had their password revealed which will be used to hack into their accounts on any number of sites. In PHP, you should use password_hash() and password_verify() when managing passwords. If those are not available, you will need another form of cryptographic hashing, such as PHP's crypt() function.
  18. Ingolme

    smooth scrolling and scrollspy doesn't work

    You need a script tag for the scrollspy plugin in addition to the jQuery one.
  19. Ingolme

    How to create a sprite using an image from my computer

    You would not use an animated GIF, you would have to use a static image with all of the animation frames on it, then manually slice pieces of the image based on the amount of time that has passed. Your game needs a loop that runs every fixed amount of time. You can do this using requestAnimationFrame(). MDN has a guide on how to use requestAnimationFrame here: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_animations. In the loop, the game needs to read inputs, calculate values and then display something on the canvas. For reading inputs, you are going to need one variable for each button in your game. In your current project, UP, DOWN, LEFT and RIGHT. You can add more buttons if you need them. Each of these variables starts off false, gets set to true when the onkeydown event fires and gets set back to false when the onkeyup event fires. During the game loop, if the program sees DOWN set to true, it will add 10 to the yPos variable. To keep things more organized, you should start using objects. You need a Controller object and a Character object. The controller contains information about which buttons are pressed and the character contains position information. The character could also contain information about the sprite, such as a reference to the image and the current animation frame. The following is a potential structure for these objects: var Controller = { UP : false, DOWN : false, LEFT : false, RIGHT : false }; var Character = { x : 0, y : 0, sprite : { image : document.getElementById("character"), width : 40, height : 40, currentFrame : 0 } }; We could go further into object-oriented programming and add methods to update the button values and to calculate the coordinates of the sprite.
  20. Ingolme

    Good IDE for web development with built-in compilers/debuggers?

    What you're asking for does not exist, to my knowledge. You can find a good back-end IDE, you can probably find a decent front-end code editor, but there isn't an IDE that mixes them together because the architectures and environments for front-end and back-end development are very different from each other. The most complete IDEs I can think of for PHP are Netbeans and Eclipse, but both of them were originally built for Java programming, so the PHP support is not perfect. I think Eclipse can integrate with version control, I haven't checked for that in Netbeans. For front end development specifically, a popular editor is Brackets. It is built with code completion for front end languges like HTML, CSS and Javascript and has a browser preview button. I'm not sure of all the features because I don't use it. Nobody has built compilers or debuggers for front end languages that I'm aware of and the reason is pretty clear to me: Browsers are updating all the time, the very best environment to compile and debug front-end languages is the browser itself. It would be a nightmare to maintain an independent front-end compiler/debugger because it would have to be updated every time any browser has an update. Browsers have built in tools for debugging Javascript, monitoring server requests and analyzing HTML elements and the CSS rules that are applied to them.
  21. Ingolme

    Strange Issue: Canvas will not open in iOS

    At this point I would start debugging using the alert() function. To start off, put in alert() right at the beginning of the click5() function to see if it is even being called. If that works, try alerting different variables in the function to see if they contain what they are supposed to. Since you don't have a Javascript console available on the iPhone, you can set up a small script to show the errors in alert boxes like this: window.onerror = function(message, file, line) { alert("Error in " + file + " on line " + line + ": " + message); } Be sure to remove it after all issues are solved.
  22. Ingolme

    = vs like

    If the string is not exactly 30 characters long, use VARCHAR instead of CHAR. CHAR adds additional null bytes as padding if the string is not long enough for the field.
  23. Ingolme

    = vs like

    The semi-colon will not break the query, it will simply be ignored. The = operator will only return a row if the entire field exactly matches what is being searched. If you want to find rows that contain the search string along with more content then you must use the LIKE operator. If you think the fields do match exactly, make sure that they don't actually have spaces, tabs or other invisible characters that might be interfering with the search.
  24. Ingolme

    session_start(): cannot send session cache limiter

    According to the error message, output started on line 1. It could be that your file is encoded as UTF-8 with a Byte-Order Mark (BOM). The BOM are three bytes that appear at the beginning of the file and may be invisible in your editor. To make sure this does not happen, open the file in a code editor and make sure that the encoding of the file is UTF-8 without a BOM.
  25. Ingolme

    knowing what is the hex number

    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.
×