@Tiffany that was basically just a linear calculation, iirc. If you move forward with it I would really like it if you commit all your solutions to all the problems on github when it all ends, I would really like to see how others will approach the same problem as me. /cc @MadaraUchiha @kelunik and anyone else who is participating
[Ways to Stay Motivated When You’re in a Rut](https://www.nytimes.com/2018/11/25/smarter-living/4-ways-to-stay-motivated-when-youre-in-a-rut.html?platform=hootsuite) (this is with using escaping) ... this is without Ways to Stay Motivated When You’re in a Rut
One of the best tricks I can't believe I didn't know all this time: mv foo.{txt,js} is equivalent to mv foo.txt foo.js, similarly mv {dir1,dir2}/file.js is equivalent to mv dir1/file.js dir2/file.js
i have this query "INSERT INTO table (name, count, lot) VALUES (:name, :count, :lot)" I want to everytime i execute this query it increment the column count to +1
@LeviMorrison 'correctness_proved, error_proved, correctness_unproved. Except they are too easy to misread. maybe error_correctness_unproved, to make it both easier to distinguish, and more neutral.
@515948453225 apropros of nothing, if you click someone's handle/name, you can put them on ignore. This is useful say when you ask a reasonably reasonable question, and they try to just shit on you instead of answering the questions.
@Danack We're missing context here. Why do you need an incrementing column? If it's an ID, use an auto-incrementing type. If it's for actually counting the number of rows you have under certain circumstances, do it with SELECT. If it's too slow, add indices, or use materialized views.
The use-case for counting columns in a rational database is very slim, and seeing it is usually an indicative of either a misunderstanding of the context, or a misunderstanding of the tools.
@MadaraUchiha No. what is wrong with doing it with on update increment? if that works, it works. You need to give a better reason than "it's silly" when you say don't do something.
here is the magic question: what happens when he runs that "insert loop" the second time ... what count is used then ... and what happens if you delete a row
But this isn't, we're talking about a relational database, where you have a rich querying language, indices, views, and a whole bunch of tools to make querying easy and powerful.
And it's not idiomatic to store meta data like this when you can easily query for it.
i have this query "INSERT INTO table (name, count, lot) VALUES (:name, :count, :lot)" I want to everytime i execute this query it increment the column count to +1
BTW, "It's homework" is a perfectly valid context for this question, one where I would not advise to use a SELECT COUNT instead, since obviously that's not what the problem universe is about.
@515948453225 Long story short is instead of inserting the count instead when you SELECT then you want to add a virtual column like this...SELECT name, lot (SELECT COUNT(*) FROM Table) AS count FROM Table.
I have a database named cascade ... I didn't know that it was reserved word in mysql until trying to create a database on another server, following the same instructions I had
@tereško Do you think getting an Email (or SMS, depends on the registration kind) contains "you've received n comment/answer for you question after your last seen being online on our website, please take a look at them" would be annoying or useful?
Yup, iirc the first one to get a star gets 100 points for it, the second one gets 99, and so on. It doesn't seem fair if you're not up at 12am though, but oh well.
@Shafizadeh it would depend on how you implement the rules for when notification gets sent. For example, if user was online 20 min ago and you spam said user about each answer, that would enrage people. The way you should use those notifications is for ensuring that users return to the site (let's say user has not been online for couple days, gets an answer on the question - you send out a message an hour later).
There also would need to be good options to opt-out of such feature (in account settings)
hey, I need some quick answer - I'm creating a standalone php file that fetches information from an opencart database. It's opencart 2.3, and the image that si saved in the db does not work. Needs to be resized or use the core which I unfortunately can't use..
anyone had this problem and maybe know a good solution?
btw @tereško, as a technical question, do you remember what design-pattern did you use for our project? (I'm talking about that dead branch). singletone? Factory? Strategy pattern?
@Allenph This would not be a row count, is just a "count" i will use just one row for it, and i was wrong i will not INSERT into ... +1 i will UPDATE ... +1
@515948453225 You're doing it wrong for sure. If you can clearly explain what problem you're trying to solve with the code/query and what you're doing in general I can help.
deos not work - does not load. As opencart uses a function that converts files in a cache folder and only retrives those files the "stock"file path does not result in an image
@Shafizadeh I do not write "in patterns". The design patterns are what emerges, if you apply S.O.L.I.D. principles to the codebase. The general architectural patterns that I used could be described as "simplified mvc" (with no separation in UI layer, but with fleshed out model layer).
@Tiffany that was basically just a linear calculation, iirc. If you move forward with it I would really like it if you commit all your solutions to all the problems on github when it all ends, I would really like to see how others will approach the same problem as me. /cc @MadaraUchiha @kelunik and anyone else who is participating
I was expecting them to be really difficult, but I love that they're programming language agnostic and anyone can do them, you just have to be imaginative (at least with the first two and what I'm reading about the third)
Also you always use a prefix in your commits, like "Fixed", "Improved", "Minor". Is that a specific standard? Is there any list of all those words? @tereško
Should be able to deal w/ standard packages (tar.gz) but also git repositories and allow standard normalization tasks (whitespace, line endings, unix file modes, subtrees) and easy review (differences, version differences) and if possible patchsets (e.g. re-apply older changes to upstream on new upstream versions).
@hakre annoying thing is I can't search php package manager -composer because I distinctly remember the front page of the package manager stating "why you should use this package manager instead of composer" or some variation thereof. But it only managed a handful of packages, maybe a dozen at most.
@Allenph Point in case is that the actual sources are shipped that way. Which is, sources, which is to be managed for dependencies. Additionally the target directory for each package needs to be specified (and the package format might vary per each dependency) which is anything but not possible w/ composer. Composer requires the composer.json to be available for each dependency. If you need to deal with dependencies from a time where they have not been ported to composer, this is an issue.
@Allenph Bash scripts I use so far, lately a bit supported w/ a JSON formatted file that defines the libraries. And no, this has nothing to do w/ CMS, it's just a bunch of PHP libraries copied into an application git repository.
The application is just a larger PHP app, not public, and the libs had been copied into the tree manually in the past. Work of today is to decipher which versions are truly from upstream (at those dates), if there are any changes, and if yes, if these changes are necessary.
I haven't received a prescription for a medication... I called last week asking them to mail it to me because I was having car trouble and couldn't pick it up at the time... entire week, nothing in the mail. I call today, "oh, it's up at the front for you to pick up..." ... -_-
@hakre Kind of seems like a flawed design in all the cases I can think of, but I don't know what you're doing. I would be surprised if you didn't have to write something custom for this.
What you're asking for reminds me a lot of plugins in WordPress or whatever Drupal has.
@Allenph Well you could call it a flawed design, but rest assured, if you would know about how many years the dependencies are outdated, you won't philosophize about design flaws any longer. It's just a mess to maintain and I'm looking forward for some (existing) tooling that can help along the road.
@hakre I specifically asked them to mail it to me because I was having car trouble and couldn't pick it up. ... I spent the entire week on caffeine. Granted, yes, I should've called like around Thursday to figure out where the fuck it was, but my brain is not consistent without medication.
god, I could've fucking picked it up when I was at therapy on Thursday ... -_-
I never said it was a flawed design, I just said in all the cases I can think of. It may be a totally valid design, I just don't get why you would do that is all @hakre.
I could've asked my sister I suppose, but my car was working by Wednesday, and I thought they had mailed it out, so I was waiting to receive it in the mail.
@Allenph Well, if an app lacks of dependency management in a controlled manner, I would consider the overall design flawed as well. What I just meant is, that it's over the point of being a design flaw or not, for sure there are design flaws, I'm just trying to put away some of the pressure those design flaws produce.
In the end this migrates all to composer. I just would like to have some support for the pre-composer phase (and I'm also not always confident the team is actually able to deal with composer, there is so much not knowing what I'm doing but it's all sooo awesome, best practice and what not)
The hard thing to teach is dependency management. How to use a third party library in a project, how to do the life-cycle management, how to choose a library, how to wrap it so that the important code is shielded from it and so on and so forth.
If yet it was not possible to maintain a dependency without composer, why should composer make a difference here?
@Allenph Yes you can as long as the package is a composer package, either a genuine one, or one supported by the installers extension.
And while we're talking about the tooling and the depth of integration here: As it is not possible to manage Docker containers to run differently than under root, for sure all scripts and extension are disabled when invoking container non-interactively on remote systems to support the integration and build of the application.
So I just had an error on laravel.
Call to a member function getName() on null
I was running this code
view()->composer('*', function ($view)
{
$view->with('route_name', ucfirst(explode(".", \Route::current()->getName())[1]));
});
This code only broke in the first place on one of my ...
@Allenph what many don't know in a container enviroment, users are not in the container, they are shared. so root in the container is root outside the container and vice/versa.
@hakre not sure if it would solve your issue, but you could add a classmap to your composer to load classes from files even if they don't follow any psr
@Trowski Composer is not NPM and doing things a bit better here (which is also some thing cultural in the community), but if you don't keep copies of vendor/ revisions (e.g. when not putting int under git and not having an asset creation process for continuous builds), you can actually looose things.
I only experienced it once personally. Not even directly personally, but I passed over a job to a colleague and one and a half year later one of the dependencies was actually deleted upstream and then missing. So he contacted me and I tried to help digging up some caches and what not. Don't remember if in the end we were able to recover, at least not fully.
@pmmaga It's not about the vendors. You can't know of today which vendor will always behave in your interest. Better is you keep mirrors of all the sources. It's pretty manageable as of today.
@hakre I don't put dependencies under git, but I also never run composer update on production. That's probably obvious to many, but I'm willing to bet that happens often.
For the current project what I plan to do is to keep revisions via the composer.lock file which should speed up packaging as it would spare redundant builds. Basically hashing the file and keeping the vendor folder under this hash.
But yeah, in the end of the day, nothing like actually reviewing the changes when you update some dependency. If you only do it when you need it it's also manageable
If I put my answer on the github, should it also translate the original data into an array? I use a regex replacement with Sublime to get it into an array, but I can do it with PHP for the sake of posting the answer.
> The difficulty and subject matter varies throughout each event. Very generally, the puzzles get more difficult over time, but your specific skillset will make each puzzle significantly easier or harder for you than someone else.