Skip to content

u/foldor

In this archive from Feb 2009 to Jan 2020

2
posts
74
comments
1
media
293
score

If you read the article you'll find out why.

HHVM does boast some very impressive numbers, and compatibility, but it does require carefully rewriting portions of code that are incompatible. There is also the potential for subtle differences, and unknown places of incompatibility. So for developers who don't want to find out the hard way which methods are incompatible the switch over is difficult.

For most web sites that aren't at Facebook or Wikipedia scale, the performance difference isn't worth the potential headache.

16 points

I know, and I respect that you found data to back up your position. However, I value an antivirus that doesn't pester me more personally. I am not the average user falling susceptible to attacks, so I still feel comfortable with the level of protection offered my MSE.

If we're going for free and comprehensive, it looks like Avira is the best option.

1 points

Legacy Excel spreadsheets with complicated macros for one. Another at my work is we use the new Power View reporting built into Excel to create some dynamic graphs on the fly, and there are people who import data direct from MS SQL Server.

So there are unusual use cases that aren't covered in LibreOffice, but for the average person it covers everything and more.

2 points

Hmm, apparently that's fault. I used a ternary operator where it's apparently illegal. From the PHP documentation:

Note: Please note that the ternary operator is a statement, and that it doesn't evaluate to a variable, but to the result of a statement. This is important to know if you want to return a variable by reference. The statement return $var == 42 ? $a : $b; in a return-by-reference function will therefore not work and a warning is issued in later PHP versions.

So basically you need to have something like this (and it's ugly right now, but you can probably come up with a cleaner way to do it, this is just an example):

private function insertbulk(){            
    $dbh = $this->connect();
    $stmt = $dbh->prepare("INSERT INTO equipment (description, unitnum, year, make, model, serial_number) VALUES (:description, :unitnum, :year, :make, :model, :serial_number)");

    for($x=0; $x<(count($this->split))-1; $x++){
        $var = isset($this->split[$x]) ? $this->split[$x] : "";
        $stmt->bindParam(':description', $var, PDO::PARAM_STR); $x++;
        $var = isset($this->split[$x]) ? $this->split[$x] : "";
        $stmt->bindParam(':unitnum', $var, PDO::PARAM_STR); $x++;
        $var = isset($this->split[$x]) ? $this->split[$x] : "";
        $stmt->bindParam(':year', $var, PDO::PARAM_STR); $x++;
        $var = isset($this->split[$x]) ? $this->split[$x] : "";
        $stmt->bindParam(':make', $var, PDO::PARAM_STR); $x++;
        $var = isset($this->split[$x]) ? $this->split[$x] : "";
        $stmt->bindParam(':model', $var, PDO::PARAM_STR); $x++;
        $var = isset($this->split[$x]) ? $this->split[$x] : "";
        $stmt->bindParam(':serial_number', $var, PDO::PARAM_STR);
        $stmt->execute();
    }
}
1 points

Well you could definitely use a try/catch, but it depends on how you want to handle the error. If you want it to fail gracefully by assuming a non-existing value is just an empty string you could try:

private function insertbulk(){            
    $dbh = $this->connect();
    $stmt = $dbh->prepare("INSERT INTO equipment (description, unitnum, year, make, model, serial_number) VALUES (:description, :unitnum, :year, :make, :model, :serial_number)");

    for($x=0; $x<(count($this->split))-1; $x++){
        $stmt->bindParam(':description', isset($this->split[$x]) ? $this->split[$x] : "", PDO::PARAM_STR); $x++;
        $stmt->bindParam(':unitnum', isset($this->split[$x]) ? $this->split[$x] : "", PDO::PARAM_STR); $x++;
        $stmt->bindParam(':year', isset($this->split[$x]) ? $this->split[$x] : "", PDO::PARAM_STR); $x++;
        $stmt->bindParam(':make', isset($this->split[$x]) ? $this->split[$x] : "", PDO::PARAM_STR); $x++;
        $stmt->bindParam(':model', isset($this->split[$x]) ? $this->split[$x] : "", PDO::PARAM_STR); $x++;
        $stmt->bindParam(':serial_number', isset($this->split[$x]) ? $this->split[$x] : "", PDO::PARAM_STR);
        $stmt->execute();
    }
}
2 points

Well I guess it depends on the situation. I tend not to write full platforms, but plugins, like for Moodle or Wordpress. So views are something I don't handle myself. I guess I tend to see it from my perspective. I never use the heredoc for more than 10 lines or so max.

1 points

The reason I prefer it to normal HTML is you don't have to add in random PHP tags to output variables everywhere. I find if I have that style, and lots of variables to output, it really messes things up, and only further integrates PHP into my HTML.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.