Jump to content

flydev

Members
  • Posts

    1,365
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by flydev

  1. You can also generate desired image variations when you upload an image in the field: /** * // in ready.php * Image variations * Generate image variations on upload * Pageimage api ref: https://processwire.com/api/ref/pageimage/ */ $this->wire()->addHookAfter('InputfieldImage::fileAdded', function ($event) { $inputfield = $event->object; $image = $event->argumentsByName("pagefile"); // `image` field on `document` template if ($inputfield->hasField == 'image' && $inputfield->hasPage && $inputfield->hasPage->template->name == 'document') { // some custom options $defaultOptions = array( 'upscaling' => false, 'cropping' => false, 'quality' => 90, ); // generate image variations // See wire/config.php for $config->sizeName: https://github.com/processwire/processwire/blob/master/wire/config.php#L726-L789 $image->size('landscape'); // 16/9 defined size `landscape` from $config->sizeName $image->size(200, 250); // 4/3 thumbnails } }); For debugging => https://processwire.com/modules/tracy-debugger/
  2. Time to write your very first module click ??
  3. When this answer come, you already know the dev is confused. I will not even speak about React as it's a piece of software I cannot really understand but only that's the big elephant called Wordpress in the JS world, I feel like the folks was trying to make things complex for an obscure reason, maybe they worked for the DoD in the '70 when they realised they was writing code in something like 500 differents languages. "We need consistency and simple complex things". Look at this sample (React vs Svelte) and try to understand ?: svelte: --- <script> let a = 1; let b = 2; </script> <input type="number" bind:value={a}> <input type="number" bind:value={b}> <p>{a} + {b} = {a + b}</p> react: --- const [a, setA] = useState(1); const [b, setB] = useState(2); function handleChange (event, setValue) { const { value } = event.target; setValue(value); }; return ( <div> <input type="number" value={a} onChange={(e) => handleChange(e, setA)} /> <input type="number" value={b} onChange={(e) => handleChange(e, setB)} /> <p>{a} + {b} = { parseInt(a) + parseInt(b) } </p> </div> ); } ?‍♂️ (taken from logrocket.com) Not going into SSR things, but I must admit that since some years, I am mostly writing desktop software UI in JS where all complex things are not required, keeping a good architecture and making the user experience really far way above native UI, and even more when mixing real-time with 3D libs. About the backend side, it's worth mentioning Angular and an awesome framework inspired from it, NestJS. NodeJS is really fast. I Read in your previous thread you are using InertiaJS, what about rendering then ? Maybe you do not need it / care of it ? I couldn't resist to add a note for Svelte's size where source top at less than 4kb and less than 2kb compressed without brotli. It happened ? PS: The screenshots seem to be not viewables.
  4. I don't really get the point of the video, and associated with you question, it make me confusing, can you elaborate what you had in mind by asking ? ? (keep in mind I am not following the current bashing) I think I am in not the targeted audience. Like him I always ever been confused by people trying to reinvent the wheel, or trying to do in the frontend what the backend already do/ship, or even without it. A fact is (and I hope not a global one), among others, schools recruiters need to focus on the teachers they are recruiting to give good habits and knowledges to students. I have a real example as since one month as I have a trainee at home (first year of a Bachelor Digital School in France), she asked me to help make things about coding more clear in his head. I could see what she learnt in his first year making me not surprised that this kind of video pops. Experienced devs have no excuses anyway. edit: just a (maybe useless ) comment, this is what I like (even if I am not using it) about HTMX philosophy.
  5. Hi, this and this If you want a short and clear preview of lawyers insight of a really big company (website hosted in United Kingdom), check the cookie policy of this Engie website: https://www.fhc.co.uk/en/about/cookies-policy/
  6. Depending on your requirement, you could generate random URL. my best bet (because you ask free solutions) is to use a custom login form as I suggested yesterday, or going with @Juergen module lower/mitigate attacks: Shield NGINX @mitchellkrogza/nginx-ultimate-bad-bot-blocker You might be interested in (Pro) WireRequestBlocker / (Free) Blackhole Module: https://weekly.pw/issue/195/ for an intro, and
  7. Yes, that's what is good with this tool, you are not required to be stick with a fixed solution. You can implement what's you have in mind and how you want to implement it. Really glad to see where you already are on using ProcessWire, it seem you got the freedom philosophy it bring to you ?? The module FrontendForms from @Juergen look a good candidate to me as he maintain it and did a fantastic job on it. Also, I saw @AndZyk linked LoginRegister Module in other thread which could fit good here, for free. I remember we discussed years ago on some customization tricks that could give you ideas. Below you can find a thread about it, but keep it for later as I see you are short on your deadline ? The original blogpost for the Pro version, just in case: https://processwire.com/blog/posts/login-register-pro/ You will find also a lot of tips (generally using code from quite deep in the core) from @Robin S in the forum, there are so much of them that you will need google to find them ? PS: I am going to add a comment on your other threads about the spam protection.
  8. I will read my answer again tomorow on the morning, but just throwing an idea about the form. Instead of trying hard to fight bots and potential hackers, you could benefit from existing protections of the login process by using a custom login form, by storing the bookingID in a field of the template user, you could differentiate each user by generating a username, for example "user_`$bookingID`", the username is not important here, and the password (which could be generated from the bookingID and a salt), not important either. However, bots or hackers will have trouble getting through. You can also add a captcha like Mosparo to respect data collection.
  9. Hello, Start by checking the ProcessWire logs and then the logs of the webserver/PHP process. You might need to adjust ProcessWire's .htaccess file. Also, more info are needed for us to give you better support. Dev or prod environment, hosting type, version, etc.
  10. It's seem that "OVH/Hosteur/DigitalOcean" VPS are good candidates - I am not affiliated with them, I manage some dedicated bare metal servers and VPS on OVH - you could start with a ~$4 VPS, and upgrade it if you need more vCore and/or RAM without reinstalling the system. By using Ubuntu 23 (v22 support end on July 2023) you can get started in ten minutes if you are used to deploy LAMP/LEMP. On the backend side, you will get a response time of around 60ms, use Cloudflare on front, and your $4 VPS perfs will be really nices. You can check for example the guide on DigitalOcean to choose what suit your needs: concepts/choosing-a-plan
  11. Hi, if you open the developer console, do you see one or more network’s error like 404 or 403 http code ?
  12. When you will test it, do not hesitate to share some results, on my side, it's quite slow but I run it with an un-optimized computer unit. I realized this morning while talking about it with the boss that I was running it with only 1/3 of the RAM - so going to launch some more tests tomorrow.
  13. True! ? I can't quantify right now how many GPU-hours it will require... we will know it when we will have an idea of the dataset size. I would go with Weaviate because it's open-source and self-manageable if needed; it's worth noting that both of them support hybrid search (sparse and dense vector concepts), . No idea which one is the most performant, but this details on our level seem not important. As a note, in the experiments I talked about in my previous post, I am using Qdrant as it have support for storing documents, and the most important part for me, again, you can self-manage it.
  14. I am finetuning existing pre-trained models and using langchain toolchain. (About the later, I suggest you to try and keep an eye on a fork of PrivateGPT which is @su77ungr/CASALIOY). I like to be able to run it without the need to plug Internet wire, which is the most important requirement, and I also got really good results with CASALIOY after ingesting a small part of the company's knowledge base. I made some years ago a license plate recognition system deployed on our parks and I am able to ask a basic question in the context of our proprietary softwares and get a response like "Blabla you need to send this MSG_LPR_.. Windows Message with this LParam and WParam, the block will answer you the current amount due by the client in a JSON string stored in WParam... ". It can also explain what a settings do along with real example context, eg., "If the setting `blabla` is set to true, when a car approach, if it's a VIP or is annual fixed bill is paid, the barrier is opened...". It's really astonishing. I am using Vicuna-13b, not GPT, you can find more infos there: lmsys.org Last week I experimented a model called YOLOv7, which is an algorithm for detecting objects in an image. The challenge for us (I got it almost working) is to detect vehicle type in real-time to apply our logic, example, detecting taxis, ambulance, truck and opening the barrier. Look at that : Above, the AI is triggered in real-time on the picture sent by an IP camera already used in our LPR system. You might want to read this paper: https://arxiv.org/pdf/2212.10560.pdf You will find example of how to implement it on Github. After the release of my ongoing project, I had in mind to try to launch a project if Ryan and the mods team consent to, which consist of scrapping the entire forum and build a chat bot, I find it funny to build it, and I would like to see how good will be answer to issues like the ones that recently popped again, yo know, the "the forged session thing", "backend login crash expiration", etc, more than focusing on the core base code of the tool. We might collaborate to learn together ? Just adding that the main issue, is the hardware power...
  15. As you are on free plan, you are running on GPT 3.5 (fast) model trained. The goal is to trick GPT from the first prompt. For example, I suggest you to give a try to this awesome prompt which can transform ChatGPT into a high-quality programmer with a level 30 code proficiency on steroids ?? And then: ? $: programming: I have two words: foo and bar, I join those words with a dash. How many different strings can I get ? ? $: There is only one way to join the words "foo" and "bar" with a dash, which is "foo-bar". Therefore, there is only one possible string that can be obtained by joining these two words in this specific way. Explore/experiment on flowgpt's prompts, I am sure you will get something amazing for us ? guide link.
  16. Sure, but your prompt is a bit lame, do not hesitate to be highly specific. Especially if you need GPT to work with numbers as she suck with it. You are on 3.5 or 4 ?. The prompt is the key of getting a good result ?
  17. Yea it’s really pushing productivity to another level, using it every days. Building my own models at work as well..
  18. Hi, without more precise informations about like exact version of the setup, the type of hosting / server, etc, it's quite hard to give you an answer. The only hint I can provide you, as you are talking about MySQL v8 on Ubuntu 20 LTS, it's to look at this known bug: https://bugs.mysql.com/bug.php?id=99593 To test the workaround (second post from the dev team): SET GLOBAL internal_tmp_mem_storage_engine=MEMORY;
  19. What @gebeer said. It explain everything - the typo was provoking an assignment to the page's template passed to this condition. Good catch and thanks for getting back on this, bug killed?
  20. Have you tried what I suggested? Also, giving more details on the the type of hosting could help, as you are saying the client is also facing the issue, then the reason could be a system update on the hosting side. I say that because I remember I fixed this issue on a site of @pwired years ago after an update of Plesk on his hosting provider. The whole thread is:
  21. It seem something related to what @ErikMH faced recently, (see: this thread) and as funny thing I had the exactly same behavior on Windows / Chrome on the next morning, it was working with an incognito window, and got it working again by cleaning windows with the standard clean tool, a run of CCleaner. and a reboot. It maybe worth trying CCleaner in first instance, and maybe a Safari reset (from the menu). Please keep us updated.
  22. If you end up writing something with github action / webhooks / etc to automate things on a staging setup, and rockmigrating rolling back if your written test cases fail, please do not hesitate to share it with us (I am not sending subliminal messages) ? I would like to be able to give you more likes ??
  23. It's weird. Some suggested steps on what I would do if I were in your situation: Check read/write permissions on the server => check Clear browser cache, throwing a Modules Refresh and a Clear Compiled Files => test Logging in admin on a incognito window => test Disabling german language => test Exporting the bugged database and whole files, importing it on local dev to test the setup => test Upgrading Duplicator from dev-version branch, building a fresh package and restoring it again => test Exporting from command-line the database and comparing the export file against the local dev version with a diff tool => check Eating hot pepper ?️, sleeping and checking on next morning with a fresh ? Reporting tests made here
  24. I installed a setup with 10.6.11-MariaDB, Duplicator v1.4.21 and did a backup/restore from a utf8mb4 => utf8(mb3). It went good, no problem so far. For information, utf8mb3 is an alias of utf8 on MySQL where on MariaDB is spelled utf8mb3 for less confusion I want to say. So utf8mb3 == utf8 (Will be deprecated soon after MySQL 8 ). Also, you should check what @dragan suggested, and I was wondering if your setup is a multilanguage setup ? It could be a hook or even a module maybe. You could also try to spot the issue by exporting the distant bugged database and importing it on your local dev setting the same charset (utf8/utf8mb3) and see his behavior. Checking/diff the .sql distant/local files with, for example, Beyond Compare (trial test is ok) or MySQL Workbench
  25. I think it should work as the difference reside on utf8mb3 use a maximum of 3 bytes and utf8mb4, 4 bytes which is not really important on your issue (supposing it only..) I will test an utf8 export and restoring it on a mb3 db in less than a hour with Duplicator v1.4.26. Will report result here. Yes ok, you should just have to compare the `pages` table with your dev one to spot something. If you find something, please, keep us updated ? PS: @torf which version of ProcessWire we are working on ?
×
×
  • Create New...