Jump to content

polaryeti

Members
  • Posts

    54
  • Joined

  • Last visited

Everything posted by polaryeti

  1. Currently in my company, we're using VPN->Then RDP. And inside RDP, we access remote server. While some servers are directly accessible, some are not. We need to do tunneling for it. I'm failing to understand the point of tunneling. I've read articles after articles like this(https://www.gaia-gis.it/fossil/virtualpg/wiki?name=port-forwarding), but it's not entering my head. Can't anyone who knows the server IP and has company VPN; tunnel and get access to that server? I know they can, but what's the point of that tunnel? They could've just filtered by requests coming via a particular IP say xx.xx.xx.xx to be allowed and reject everything else. What's the point of tunneling? What's the problem that tunneling is trying to solve?
  2. 1) Oracle 1Z0-149 2) Oracle Database SQL 1Z0-071 3) Oracle Database 12c: SQL Fundamentals 1Z0-061 4) or any other oracle exams? I've no idea about it. I've finished learning a 20hrs sql course. It took me probably 100hrs to finish the course as I went slow. I'm confident with the basics. But few things I need more practice on(not that I don't know them but still confused). They're: 1) Aggregate functions and GROUP BY. 2) Transactions & concurrency control 3) Procedures, Views 4) Subqueries I thought the obvious next step would be take some oracle certification (I won't give exams as I don't earn that much, just study for the exam). If there are other DBA certification except Oracle, do tell me? We use microsoft sql server and mysql at work but I've already learnt enough sql for work. (we just need basic select query at work)
  3. I've read tidbits of pages from around 10 books, and I can safely say I am even more confused than before. Earlier I'd just set everything in .bashrc file. LOL. Say I've scenarios like these: 1) I want to set system variables for user "jacky", what should I use? 2) I want to set system variables for all users, what should I use? 3) I want to set alias for user "jacky", what should I use? 4) I want to set alias for all users, what should I use? What are interactive/non-interactive login/non-login shells? I've asked chatgpt but it gave me convoluted reply. So, it was not very clear.
  4. I'm still not clear about this topic. This is confusing as hell. How do I select a column to group by? What should be the properties of that column? Is it necessary for that column I choose to group by to functionally determine other columns presented in the select query except the aggregated column(eg, column where count is being used or sum is being used)?
  5. So if I want to find: 1) A file with setuid field set regardless of other permissions. Which command do I need to use?
  6. I want to know the exact difference between these commands with examples. I've read the man pages.
  7. I'm asking this question because I'm seeing multiple variants of this command. 1) find / -perm /u=s file_name or find / -perm -u=s file_name 2) find / -perm 4666 or find / -perm 4000 or find / -perm /4000 Source of my confusion: https://unix.stackexchange.com/questions/180867/how-to-search-for-all-suid-sgid-files
  8. We want to know the best customer of Northwind database by the highest total amount spent. https://brucebauer.info/assets/ITEC3610/Northwind/Northwind-Sample-Database-Diagram.pdf This is the northwind database diagram. My try SELECT contactname FROM customers WHERE orderid IN (SELECT orderid FROM orderdetails HAVING MAX(unitprice * quantity)); This is producing the below error: Error Code: 1054. Unknown column 'orderid' in 'IN/ALL/ANY subquery' This is the answer provided. SELECT * FROM customers WHERE customerid = (SELECT customerid FROM orders WHERE orderid = (SELECT orderid FROM orderdetails GROUP BY orderid ORDER BY SUM(unitprice * quantity) DESC LIMIT 1)); I am trying to understand sub queries since five hours, but nothing is getting into my head. Can you please guide me towards some good tutorials/books/courses that'd help me understand subqueries. I prefer books at this moment.
  9. https://linux-training.be/funhtml/ch18.html echo hello > greetings.txt I feel it's telling before counting the number of arguments, redirection operator is ignored. But later it says how it affects output erasing file case. [paul@RHELv4u3 ~]$ cat winter.txt It is cold today! [paul@RHELv4u3 ~]$ zcho It is cold today! > winter.txt -bash: zcho: command not found [paul@RHELv4u3 ~]$ cat winter.txt [paul@RHELv4u3 ~]$ So can you explain how zcho It is cold today! > winter.txt command processes internally? My estimate 1) > is ignored 2) Number of arguments are count. There are 2 arguments "It is cold today!" and winter.txt 3) then what? i don't know.
  10. I think you didn't get my question. I specifically want to use DESC in order by and find the fourth lowest salary. (I realize possibility of same salary but that's my next question).
  11. I've this database. https://brucebauer.info/assets/ITEC3610/Northwind/Northwind-Sample-Database-Diagram.pdf I want to find fourth lowest salary. SELECT * FROM employees ORDER BY salary DESC LIMIT 1 OFFSET (Number_of_rows_of_table-3); I can solve this by using order by ASC pretty easily with LIMIT 1 OFFSET 3. I'm wondering if there's an way to solve it via order by DESC? Here's my try which didn't work. SELECT count(*) as no_of_rows_of_table, salary FROM employees ORDER BY salary DESC LIMIT 1 OFFSET (no_of_rows_of_table-3);
  12. But if I order by orderid alone, it'll work, Why does it work? Should not it be producing the same error as above as not all non-aggregated query aren't present in group by clause ? Why does it work? Why rule of thumb not work here?
  13. Because you said you group by orderid...What's the rule of thumb for GROUP BY? Or an intituition of what I should be using in GROUP BY? Can you elaborate?
  14. So that means we should always GROUP BY Primary key? Why is such rule enforced in SQL? What's the benefit of such rule?
  15. Before you ask me to RTFM, Quoting from the manpages: But it's not very clear. I've read almost all stackoverflow and stackexchange questions about it and they've just complicated it for me. I want to know a real life use case of it. And please upvote the correct answer so that I can know it. Code: bash -c 'echo $SHELL $HOME $USER' env -i bash -c 'echo $SHELL $HOME $USER' This is an example scenario where bash -c has been used in my tutorial that I'm following. I want to know its deep meaning with usages and need of this altogether.
  16. I'm on Windows 10, MySQL Workbench. I'm on MySQL 8.0. Here's the dataset. northwind.sql. https://pastebin.com/bMgjXvfT Objective: Write a query to get the order ID, customer's name, grand total of each order, and the name of the employee who handled each order. See below the expected first four rows. Output should look like this. This is the database schema diagram. https://brucebauer.info/assets/ITEC3610/Northwind/Northwind-Sample-Database-Diagram.pdf It's northwind.sql database. This is my query. SELECT o.orderid, c.contactname, SUM(od.unitprice * od.quantity), CONCAT(e.lastname, ' ', e.firstname) AS emp_name FROM orders o INNER JOIN customers c ON o.customerid = c.customerid INNER JOIN orderdetails od ON o.orderid = od.OrderID INNER JOIN employees e ON o.EmployeeID = e.EmployeeID GROUP BY emp_name ORDER BY orderid LIMIT 4; But it was producing an error. Error Code: 1055. Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'northwind.o.OrderID' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by But if I order by orderid alone, it'll work, Why does it work? Should not it be producing the same error as above as not all non-aggregated query aren't present in group by clause ? What's the computer science(Database concept) behind all this? Can anyone explain it?
  17. function checkBoundaryCollision() { if (x - ballRadius <= 0 || x + ballRadius >= canvasWidth) { dx = -dx; } if (y - ballRadius <= 0 || y + ballRadius >= canvasHeight) { dy = -dy; } } Full code here: https://codepen.io/pelko/pen/gOjXdaq
  18. Here's the full code: https://codepen.io/pelko/pen/MWBpNmL When a ball collides with bat or walls, I want the ball to be reflected with an angle, how do I do it? I suspect there's lots of physics to it. So, should I stop this project here? I'd have to probably build a part of game engineā€¦Can anyone help here?
  19. <div class="body"> <div id="board"> <div id="bat" class="bat"></div> <div id="ball" class="ball"></div> </div> </div> This is my HTML. I've done CSS For all of them and generated this: Now, I want the bat to move left and right when I press arrow keys. window.addEventListener("keydown", function (e) { switch (e.key) { case "ArrowLeft": batDir.x = -1; batDir.y = 0; paintBat(batDir.x, batDir.y); break; case "ArrowRight": batDir.x = 1; batDir.y = 0; paintBat(batDir.x, batDir.y); break; } }) My goal is to paint the bat at new position. I'm wondering how to do it. The logic should be newBatPosition.x=oldBatPosition.x+batDirection.x newBatPosition.y=oldBatPosition.y+batDirection.y But what will do the job of painting newBatPosition.x and newBatPosition.y is what I'm not clear of. I'm not using canvas. Plus, what'll be the oldBatPosition? I've used CSS to paint them. So, I'm wondering how do I get oldBatPosition coordinates as well. I just made a similar project using tutorial and it's just disheartening that I can't make this project. https://codepen.io/pelko/pen/jOpBmPN
  20. This issue has been fixed, I forgot to add CSS class to snake.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.