Guest User

Untitled

a guest
Jul 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. Briefly, what is the difference between symmetric (single-key) and asymmetric (public-key or public/private-key) cryptography?
  2.  
  3.  
  4.  
  5. In Object Oriented programming, what is your favorite design pattern, and why? Some example design patterns are singletons, factories, and facades.
  6.  
  7.  
  8.  
  9. The following regular expression is supposed to match an IP address. What is wrong with it? Can you improve it?
  10. /[0-9]+.[0-9]+.[0-9]+.[0-9]+/
  11.  
  12.  
  13.  
  14. Can the following code's performance be increased at all, without changing the basic algorithm? If so, how? If not, why? Can you tell me what this function calculates?
  15. <?
  16. function someFunction($n) {
  17. $x = $n;
  18. $i = 0;
  19. while (true) {
  20. $i = $i + 1;
  21. if ($i == 5)
  22. break;
  23. $x = $x + $n*(1/$x);
  24. $x = 1/2 * $x;
  25. }
  26. return $x;
  27. }
  28. ?>
Add Comment
Please, Sign In to add comment