Jump to content

smus

Members
  • Posts

    177
  • Joined

  • Last visited

Everything posted by smus

  1. smus

    Table Sort

    ? It continues sorting the column with numbers as if it's text, despite the conversion (text to number)
  2. smus

    Table Sort

    Hi, I need your hint. I am using table sort from this w3schools example: https://www.w3schools.com/howto/howto_js_sort_table.asp There is a table with 2 columns, the first contains text data, the second - numbers. I want the second one to be sorted as integers, but it doesn't work when I convert a string to number like this: if(n === 1){x = parseInt(x.innerHTML)} or number(x.innerHTML) n is the column id starting from zero
  3. justsomeguy is right, if you have complex data, better to store it in a database, server-side or client-side. Even HTML5 (using JS) has a way to store data called webstorage. Choose the way that suits you best
  4. Can you explain what you want?
  5. <input type="text" onkeyup="thenameofthefunction()"> <input type="text" onclick="thenameofthefunction()">
  6. smus

    Web Workers

    HTML Web Workers are using JavaScript code to run. Why Web Workers need to be used only under a server then? I tried launching .html file separately and they don't work.
  7. Yeah, true, same info is on StackOverflow: different implementatoins of recursive approach. Strange that ES6 doesn't have a built-in function or method for it. Object.hasOwnProperty is only for the upper-level keys which makes it useless for structured objects.
  8. const data = { level1: { level2: { level3: 'some data' } } }; Is there a way to get the names of all the keys (at any level) in that object without using a recursion? (level1, level2, level3)
  9. smus

    Hex to ASCII

    Yeah, I agree. It's pretty straightforward
  10. But it's fast! Have any of you tried AkelPad? I like it. It is simple, fast and if you need any of that options as highlighting, they are represented as plug-ins, so you can switch them on.
  11. <button onclick="someFunction()">button</button> Have you added the quotes? The function starts on the page load?
  12. smus

    Hex to ASCII

    It is, but to be honest, I couldn't find the solution. Unfortunately, classic ASP is not really popular nowadays.
  13. I want to create full-functional web interface on node.js which uses mysql database. Node greatly interacts with MySQL (adding, editing data), but when it comes to returning the data from a database after submitting it, ordinary page reload is not enough. How am I better to perform it? Should I use some additional modules? I am pretty new to Node.js. So how is it usually done by node.js developers?
  14. Please help me with the complicated query that I should complete. Can't get the right result because 'having' has to have a static value to compare and 'where' doesn't work with aggregate functions. Is there an alternative way to solve it? Maybe inner join can help?
  15. smus

    Hex to ASCII

    Yes, exactly, VBScript. I've found the way to perform the opposite action (ascii into hex): dim x x = 1 response.write hex(asc(x)) //31 but have no idea about the backward conversion.
  16. smus

    Hex to ASCII

    Couldn't find the information how on how to convert the hex values into ascii ('31' > '1', '32' > '2' etc.). Could anyone remind me which method/function I should use?
  17. smus

    JSON and object

    No other way? No kinda search method for big and complex objects?
  18. smus

    JSON and object

    Why is map() method often used for these reasons? Might that be because the structure is complex and I know the name of the property and I am not sure about its hierarchical disposition? For example, a = { first : ['propertyOne' = 'po', 'propertyTwo' = 'pt'], second : [smallObj = {s1:'s1', s2: 's2', s3: 's3'}, smallObj2 = {s1:'s1'}, ['a1', 'a2']], third : ['t1', [{'whatIWantToFind':'someInfo'}], t3, 'abcdef'] } I have to find the 'whatIWantToFind' property inside a object. I know it is inside the object, but I don't know where exactly it is. Do I need to use a map() or any other method for it?
  19. If I have a JSON data, can I apply to it as if it is a JS Object, or I should use JSON.parse() first? Will it skip the property names quotes? ("name":"value" or name:"value") If there are some associative arrays inside and the structure is complex, is it easier to use array.map() method or it is better to apply to the properties directly?
  20. smus

    equation solver

    It's a part of a more complex task. 5 is already a result, it is a GCD (greatest common divisor) of those 2 integers (210,65). They are function input parameters, but now it has to return x and y, not only GCD.
  21. smus

    equation solver

    yes, it's needed to be solved by js
  22. How do I solve the equation: 210x+65y=5 x and y must be integers
  23. smus

    Code optimization

    Where n is the amount of nested loops? According to your explanation, it is better to have several independent loops, than one nested loop: for(){} for(){} for(){} for(){} would be faster than: for(){ for(){} }
×
×
  • Create New...