Jump to content

G1K777

Member
  • Posts

    100
  • Joined

  • Last visited

Everything posted by G1K777

  1. I will not run a library of videos on a server like linus does. If the videos get lost, I have no problem with that. I would have a problem when I let my 1TB SSD write 100s of GB each day.
  2. I just replace it, what ever, if it sounds like this, I don't want it. It sounds like a damaged bearing.
  3. Hello everyone, I'm not sure if the word I'm looking for is called "dragging", it sounds like the "bearings" are rubbing. I'm using only SSDs and NVMe in my computer. I got myself a Seagate Constellation ES.2 3TB, SED, SATA 6Gb/s (ST33000651NS) drive and I'm not sure if it just sounds like this or if it's broken. It sounds like "crappy fans" where the bearing is rubbing (dragging?). It works, I've copied a 8GB clip on the 3TB HDD and it was writing with 145mb/s.
  4. Hold on, I'm confused, for some magic reason, it's working ?? I'm SOO CONFUSED why didn't it work before?! what the heck?!
  5. Hello, I'm making a small project something like a lib/framework or what ever it might be called. I'm using only Javascript to create HTML objects. This here creates the whole body. // Create Objects const header = new Nav("header"), nav = new Nav("nav"), main = new Element("main"), aside = new Element("aside"), footer = new Nav("footer"); // Add nodes to the body element. header.init(document.body); nav.init(document.body); main.init(document.body); aside.init(document.body); footer.init(document.body); init() is just an appendChild function with some things... This here adds a div element into the main element and then adds a span element into the div. main -> div -> span // Testing div insert. const div = new Element("div"); div.init(main.node) div.add(["span",{class:"hi"}, "hello"]); So far everything is working. But now the issue, when I do: // Testing form const signupForm = new Form("signup"); signupForm.init(main.node); // Maybe create labels if first param = "input" ? signupForm.add([ ["username"], ["password"], ["email"] ]); it's not working for some reason. After checking, it says that "this" is not a type of node. All the code is here: https://github.com/damiantoczek/frontend/tree/master/main/js Can anyone help me with it?
  6. Found it. http://www.motherboards.org/files/techspecs/atx2_1.pdf
  7. Is this a recursive function? I have no idea what you mean by recusive function. function create(x){ let element = x[0], child = x[1], node = document.createElement(element), i = 1; if (typeof child === "object" && child !== null && !isArray(child)) for (var attr in child) node[attr] = child[attr]; i = 2; let l = x.length; for (; i < l; i++) if( isArray(x[i]) ) node.appendChild( create(x[i]) ); else node.appendChild( document.createTextNode(x[i]) ); return node; }
  8. It protects the pins in your socket, put your CPU into the socket and the black cover will pop out No need to rip it off or anything.
  9. Hi, I'm looking for some motherboard (ATX/EATX) specs and each website says something else. I need to know the hole placement for ITX, mATX, ATX and EATX. Is this the latest spec?
  10. Is there any difference between: Array.prototype.slice.call(myArr); // vs myArr.slice(); // ? The prototype is way longer, does it affect the performance or something?
  11. Hi, can a function call itself? function create(element) { let prefix = element[0], suffix = element[1], node = document.createElement(prefix); // Check if suffix is a string. if( typeof suffix === "string" ) node.appendChild(document.createTextNode(suffix)); // Is the suffix is a array, call itself to create a function. if( element[1] instanceof Array ) { return create(this); // <-- ????? } return node; } var element1 = create(["div","hi"]); // Output: <div>hi</div> document.body.appendChild(element1); var element2 = create(["div",["p","My paragraph."]]); // Expected: <div><p>My paragraph.</p></div> document.body.appendChild(element2);
  12. Lets say I have two php files with session_start(); index.php login.php If I set some session variables for example: $_SESSION['username'] Can I access it on index.php or is a refresh needed on the index? If I include login.php inside index.php, is a refresh still needed? If for example there is no session_start(); in index.php can I still use all the session variables inside login.php?
  13. Hello, is anyone using sessions with ajax? I'm sending a login form to the backend "PHP" and it gets validated and now I'm trying to make a "session". I know how to make it the "non AJAX" way, by just refreshing the page or redirecting it to "loggedin.php" or something. But how is it done with AJAX? I can also get a response. Do I need to force a refresh on the page or can it be done without any refreshes/page reload?
  14. I have no clue what this config is for. net: port: 27017 bindIp: 127.0.0.1,IP_of_MongoHost all it says: To allow remote connections, we will add our host's publically-routable IP address to the mongod.conf file. what do they mean by "host's publically-routable IP address"? I'm using a Ubuntu server with golang and mongodb on it (for development) and not sure what this bindIP is for. Does it prevent access for everyone except the localhost?
  15. Trying to fix this since 6pm... 4-5h later still not working. Many hours later I just gave up and wont use go get. I wont spend 3 days fixing one thing that should work out of the box.
  16. Thanks for your response mate but I never added "git" to this command.
  17. Hi everyone, it slowly gets so annoying when things just don't work out of the box. Who the hell is coding this!? I've installed Go on a Ubuntu using SSH. Go works, I can start a simple listen server, git clone stuff. As soon as I type something like: go get -u github.com/gorilla/mux.git It doesn't work. Why am I trying to do? Installing this. It tells me "invalid version control suffig in github.com/ path."
  18. I'm doing few validations and checking before allowing someone to login. I'm using also "password_verify" and if it matches, I just echo a string like "Logged in" because I have no idea how to make the session. I made already a login system that worked except I had different php files. I'm using now only one php file, index.php. For checking and validation I'm using other php files, but I don't have files like profile.php, forum.php etc. only index.php. In my other login system, I was using "session_start()" on all php files and after someone was successfully logged in, he got redirected to profile.php (accessing profile.php is not possible if not logged in.). Would it work if I would add session_start() in my index.php and then instead of returning a string just set some session variables? index.php <?php session_start() ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <title>xyz</title> <link rel="stylesheet" type="text/css" href="/css/style.css"> <link rel="icon" type="image/x-icon" href="favicon.ico"> </head> <body> <noscript> <p>Foo</p> </noscript> </body> <script type="text/javascript" src="/test/hyperLoop/hyperLoop.js"></script> <script type="text/javascript" src="/js/pages.js"></script> <script type="text/javascript" src="/js/script.js"></script> </html> loginsystem.php if( password_verify($password, $row['password']) ){ $_SESSION['username'] = $username; $_SESSION['firstname'] = $firstname; }else{ return 'Wrong email or password.'; } #Edit The above doesn't work for some reason and it looks like it needs a refresh to make the session work on index. But it works when I make something like this. loginsystem.php if( password_verify($password, $row['password']) ){ return true; }else{ return 'Wrong email or password.'; } afterLogin.php if( $login->loginUser($email,$password) ){ $_SESSION['id'] = '123'; } This works when I'm tryint to return the session ID. How can I make this work?
  19. You mean something like a "Keep me logged in" thing? Where you get a login token/cookie? The token is saved in the database but I could do it with memcached instead of a database that will have a expiration date on it. Would that work? Does it make sense?
  20. I'm not talking about security here. I'm asking which "technology" should be used. This thread has nothing to do with Databases.
  21. Hello, I want to know how bigger websites handle huge amount of users. Is it a good idea to use PHP sessions combined with memcached or is it better to use something different?
  22. Option 2: GNU v3 FREE FOR ALL = Donations (+ maybe patreon... + bitcoins?).
  23. Hi, I'm trying to connect to my database and it doesn't work for some reason. Why isn't this working? Woke up at 2am and now sitting and doing the login system. userlist.php include_once 'dbh.php'; class Users extends Dbh { private $sql = 'SELECT id,username FROM users'; function __construct() { parent::__construct(); } public function getUsers(){ return $this->conn->query($this->sql); } } $users = new Users(); $result = $users->getUsers(); echo var_dump($result); dbh.php <?php class Dbh { private $host = '127.0.0.1'; private $port = '3306'; private $username = 'root'; private $password = '123'; private $dbname = 'loginsystemdb'; private $charset = 'utf8mb4'; protected $conn; function __construct() { try { $this->conn = new PDO("mysql:host=$this->host;port=$this->port;dbname=$this->dbname;charset=$this->charset", $this->username, $this->password); $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); return $conn; } catch (PDOException $e) { echo 'Mysql Connection failed: '.$e->getMessage(); } } }
×