teleren/devto huggingface dataset:
TIL custom order with .in_order_of
Tags: rails, ruby, activerecord
Published: 2024-06-26 09:15:41

---
title: TIL custom order with .in_order_of
published: true
description: 
tags: Rails,Ruby,ActiveRecord
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-06-26 09:04 +0000
---

Sometimes you need a custom, semantic order for things, usually statuses, types. Oftentimes this is achieved with an SQL CASE statement:

```
sql = <<~SQL
  CASE
    WHEN status = 'active' THEN 0
    WHEN status = 'draft'  THEN 1    
    ELSE 99
  END
SQL 

order(sql, :id)
```

Since at least Rails 7.1 there's a better way - `in_order_of`!

```
in_order_of(:status, [:active, :draft], filter: false).order(:id)
```

Interestingly, [v7.1 guide](https://guides.rubyonrails.org/active_record_querying.html) does not list this method at all, but it's available in [edge guide](https://edgeapi.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-in_order_of).

Small caveat emptor - the `filter: false` option does not seem to be available in v7.1 yet.
Scroll and Size
Tags: dom, scroll, size, javascript
Published: 2024-06-26 09:14:48

Understanding DOM scroll and size properties is essential for managing the layout and interactivity of web pages. Here are some key properties and methods related to scrolling and size in the DOM:

---

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ff85v063z4u1zq32cusf.png)

## Element Size Properties
1. **clientWidth** and **clientHeight**:
    - These properties return the inner width and height of an element, including padding but excluding borders, margins, and scrollbars (if present).
      ```
         let elem = document.getElementById('myElement');
         let width = elem.clientWidth;
         let height = elem.clientHeight;
      ```  
 
2. **offsetWidth** and **offsetHeight**:
     - These properties return the layout width and height of an element, including borders and padding but excluding margins.
       
      ```
         let elem = document.getElementById('myElement');
         let width = elem.offsetWidth;
         let height = elem.offsetHeight;
      ```
---

## Element Scroll Properties
1. **scrollTop** and **scrollLeft:**
     - These properties return the number of pixels that an element's content is scrolled vertically and horizontally.

      ```
         let elem = document.getElementById('myElement');
         let scrollTop = elem.scrollTop;
         let scrollLeft = elem.scrollLeft;
      ```
2. **scrollTo():**
     - This method scrolls the element to the specified coordinates.

     ```
        elem.scrollTo(x, y);
     ```
3. **scrollBy():**
     - This method scrolls the element by the specified number of pixels.

     ```
        elem.scrollBy(x, y);
     ```
Coolcam Screen Recording: A Week-Long Experience and Comparison
Tags: coolcam, screenrecording, livestreaming, softwarereview
Published: 2024-06-26 09:13:11

In the realm of screen recording and live streaming software, finding the right tool can make a significant difference in productivity and content quality. Recently, I had the opportunity to explore [Coolcam Screen Recording ](https://coolcam.coolcut.tv)for a week, putting it through its paces and comparing it with other prominent tools on the market. Here’s my take on whether Coolcam stands out as a good choice:

**User Experience and Interface**

Coolcam impressed me right off the bat with its intuitive interface. Setting up recordings and adjusting settings was straightforward, which made the initial learning curve minimal. The layout is clean, with all essential controls easily accessible, making it user-friendly for beginners and experienced users alike.

**Recording Quality and Features**

The quality of recordings with Coolcam was excellent. It captured smooth video and audio without noticeable lag or distortion, which is crucial for professional presentations or live streams. I particularly appreciated the customizable recording options, such as selecting specific screen areas or capturing full-screen mode, catering to diverse recording needs.

**Comparison with Competitors**

Comparing Coolcam with other live streaming and screen recording software like OBS Studio and XSplit, I found Coolcam to excel in simplicity and ease of use. While OBS Studio offers extensive customization and is favored by gamers and advanced users for its flexibility, Coolcam’s strength lies in its accessibility and streamlined approach. XSplit, on the other hand, provides robust features but can be overwhelming for beginners.

**Unique Features and Limitations**

Coolcam’s integration with social media platforms for live streaming is a standout feature. It allows seamless sharing of recordings directly to platforms like YouTube and Twitch, enhancing accessibility for content creators looking to reach a broader audience. However, it lacks some of the advanced features found in OBS Studio, such as complex scene transitions and plugin support.

**Final Verdict**

After a week of using Coolcam, I can confidently say it’s a solid choice for users looking for a straightforward and effective screen recording and live streaming solution. Its user-friendly interface, excellent recording quality, and integrated streaming capabilities make it suitable for a wide range of applications, from educational tutorials to professional presentations.

Whether you’re a novice content creator or a seasoned streamer, Coolcam provides a reliable toolset without overwhelming you with unnecessary complexities. For those who value ease of use and efficiency, Coolcam certainly holds its own among competitors in the screen recording software market.
Released SuperDuperDB v0.2
Tags: duckdb, machinelearning, softwaredevelopment, ai
Published: 2024-06-26 09:10:16

🔮Superduperdb v0.2!🔮

SuperDuperDB is excited to announce the release of superduperdb v0.2, a major update designed to improve the way AI works with databases. This version makes major strides towards making complete AI application development with databases a reality.

Scale your AI applications to handle more data and users, with support for scalable compute.

Migrate and share AI applications, which include diverse components, with the superduper-protocol; map any AI app to a clear JSON/ YAML format with references to binaries.

Easily extend the system with new AI features and database functionality, using a simplified developer contract; developers only need to write a few key methods.

https://www.linkedin.com/feed/update/urn:li:activity:7211648751113834498/
Released SuperDuperDB v0.2
Tags: oracle, database, python, opensource
Published: 2024-06-26 09:08:43

🔮Superduperdb v0.2!🔮

SuperDuperDB is excited to announce the release of superduperdb v0.2, a major update designed to improve the way AI works with databases. This version makes major strides towards making complete AI application development with databases a reality.

Scale your AI applications to handle more data and users, with support for scalable compute.

Migrate and share AI applications, which include diverse components, with the superduper-protocol; map any AI app to a clear JSON/ YAML format with references to binaries.

Easily extend the system with new AI features and database functionality, using a simplified developer contract; developers only need to write a few key methods.

https://www.linkedin.com/feed/update/urn:li:activity:7211648751113834498/
Build fully portable AI applications on top of Snowflake with SuperDuperDB
Tags: snowflake
Published: 2024-06-26 09:08:35

🔮Superduperdb v0.2!🔮

SuperDuperDB is excited to announce the release of superduperdb v0.2, a major update designed to improve the way AI works with databases. This new version makes it easier to:

Customize how AI and databases work together.
Scale your AI projects to handle more data and users.
Move AI projects between different environments easily.
Extend the system with new AI features and database functionality.
Check it out:
Blog: https://blog.superduperdb.com/version-02
Github: https://github.com/SuperDuperDB/superduperdb (leave us a star ⭐️🥳)

And join us in this journey to be part of the future of AI!

#AI #DatabaseIntegration #SuperDuperDB #TechNews #NewRelease
Pengertian Permainan Slot QQ
Published: 2024-06-13 06:33:08

Slot Jackpot Progresif: Ini adalah slot di mana jackpot meningkat secara bertahap seiring pemain bertaruh pada permainan. Sebagian kecil dari setiap taruhan berkontribusi pada jackpot, yang dapat bertambah hingga jumlah yang signifikan sebelum dimenangkan.
Slot Bermerek: Ini menggabungkan tema dari film populer, acara TV, atau selebriti, meningkatkan pengalaman bermain game dengan visual dan soundtrack yang familiar.
3. Gameplay dan Mekanik
Pemain biasanya memilih jumlah taruhan mereka dan memutar gulungan. Hasilnya ditentukan oleh Random Number Generator (RNG), yang memastikan keadilan dan keacakan dalam hasil.
Fitur bonus seperti simbol liar (menggantikan simbol lain), simbol pencar (memicu bonus atau putaran gratis), dan pengganda (meningkatkan kemenangan) menambah kegembiraan dan potensi hadiah.
4. Keamanan dan Keadilan
Platform QQ bereputasi memastikan permainan mereka adil dan aman melalui pengujian dan sertifikasi yang ketat oleh auditor independen. Mereka menggunakan enkripsi untuk melindungi transaksi keuangan dan informasi pribadi pemain.
5. Pertimbangan Hukum
Legalitas perjudian online, termasuk permainan Slot QQ, berbeda-beda di setiap yurisdiksi. Pemain harus memastikan bahwa mereka mematuhi hukum dan peraturan setempat sebelum berpartisipasi.

https://depangoldwin678.com/
Nooro Knee Massager (Controversial Exposed) Shocking Update You Must See!!
Published: 2024-06-26 09:04:12

I do use that term loosely as I'm always learning things germane to your kind of thing. My confidence in your cliché had become severely dented. They have unique qualifications. Not everybody is going to have Nooro Knee Massager Reviews guesses. I'll tell you more bordering on this later. It hasn't been a real breakthrough. 

I'm ready to use my Nooro Knee Massager Reviews. Undoubtedly, what would they want for that price? I feel that is an interesting way to build my technique. Through what agency do dudes come by inexpensive Nooro Knee Massager Reviews solutions? There is a massive supply of that. I'm astonished. I am not up to speed on that. It has been consummate. If you don't have a job, none of that other stuff matters. 

Truly, you finally arrived. So much for being informative. These are uncommon schemes. What I really dwelled on is how to move past using this. This basis is not the only way, although it is the easiest way. I'm going to tell you what they are. Anyone can use it, regardless of race, sex, age and social status. 

💥 Sale Is Live 😎 (Order Now) ┈➤  https://www.mid-day.com/amp/lifestyle/infotainment/article/nooro-knee-massager-reviews-legit-or-fake-consumer-reports-price-complaints--23325502 

⏬ Scroll Down for More Info:- ⏬

ⓕ https://www.facebook.com/Mozz.Guard.Mosquito.Official.Website/ 
ⓕ https://www.facebook.com/SoulmateSketchOfficialReviews/ 
ⓕ https://www.facebook.com/ZenCortexHearingSupportDrops/ 
ⓕ https://www.facebook.com/thedivineprayerreview/ 

👉 https://www.msn.com/en-us/health/other/mozz-guard-mosquito-zapper-review-mosquito-repellent-lamp-scam-or-worth-to-buy/ar-BB1oE7X4 
👉 https://sites.google.com/view/nooro-knee-massager-pain/ 
👉 https://groups.google.com/g/nooro-knee-massager-pain/c/cdxtJxk4ypA 
👉 https://realfactsabouthealth.blogspot.com/2024/06/nooro-knee-massager-warning-why-trust.html 
👉 https://medium.com/@keloindeylee/nooro-knee-massager-canada-pain-relief-2024-f64b897d25f4 
👉 https://sketchfab.com/3d-models/nooro-knee-massager-canada-pain-relief-cca8a683ff324dc0b8fe1ae8e9a0d5cb 
👉 https://zenodo.org/records/12526382 
👉 https://nooro-knee-massager-pain-relief.webflow.io/ 
👉 https://noorokneemassager.company.site/ 
👉 https://www.startus.cc/company/nooro-knee-massager-canada-pain-relief 
👉 https://startupcentrum.com/startup/nooro-knee-massager-canada-pain-relief-ingredients-benefits-where-to-buy 
👉 https://keloindey.clubeo.com/calendar/2024/06/25/nooro-knee-massager-is-it-worth-buying-must-read-before-trying 
👉 https://noorokneemassager60.godaddysites.com/ 
👉 https://views-denn-ciacks.yolasite.com/
Why do people still learn editing?
Tags: sora, video, viedoediting
Published: 2024-06-26 09:02:08


It's been a whole year since I started diving into the world of video editing.It all began with Coolcut, where I learned the ropes of slicing and dicing stories together. At first, it felt like I was stumbling in the dark, trying to make sense of timelines and transitions. But as time went on, I got the hang of it. [Coolcut](https:coolcut.tv) became my buddy, helping me craft videos that actually looked pretty decent.

Fast forward to a few months ago, I stumbled upon Capcut – everyone was raving about it. So, I thought, why not give it a shot? It had all these fancy features and filters that made my videos pop like never before. I was on cloud nine, thinking I'd finally cracked the code to making awesome content.

But then, just the other day, I stumbled upon this whole new thing: AI-generated videos. Like, seriously? I watched these videos that were stitched together by some computer wizardry, and they looked flawless. It got me thinking – all this time I've spent learning and perfecting my editing skills, and now AI can churn out videos that are just as good, if not better, in a fraction of the time.

I felt crushed, honestly. Like, what's the point of all my hard work if a machine can do it faster and probably better? It's like I've been running this marathon and suddenly, someone invents a teleporter. My efforts felt meaningless.
Exploring Betaface Face Recognition Technology: Features and Alternatives
Tags: ai, learning, machinelearning, python
Published: 2024-06-26 08:56:59

In the rapidly evolving field of biometric technology, face recognition has emerged as a powerful tool with a wide range of applications, from enhancing security to personalizing user experiences. One notable player in this space is Betaface, known for its advanced face recognition capabilities. In this blog post, we will delve into the features that make Betaface a standout technology and explore viable alternatives, such as Luxand.cloud, to provide a comprehensive understanding of the options available for integrating face recognition technology into various systems.

Learn more here: [Exploring Betaface Face Recognition Technology: Features and Alternatives](https://luxand.cloud/face-recognition-blog/exploring-betaface-face-recognition-technology-features-and-alternatives/?utm_source=devto&utm_medium=exploring-betaface-face-recognition-technology-features-and-alternatives)
Cshell Carts
Tags: cshell, carts
Published: 2024-06-26 08:51:36

Cshell Carts
Address: 2176 J and C Blvd, Naples, FL 34109
Phone: (239) 567-9137
Email: CSHELLCARTS@GMAIL.COM
Website: https://cshellcarts.com
GM Profile: https://www.google.com/maps?cid=13881391590954842564

Welcome to Cshell Carts, your premier destination for all your golf cart needs! Located at 2176 J and C Blvd, Naples, FL 34109, United States, our showroom is a haven for golf enthusiasts. At Cshell Carts, we specialize in both selling and renting top-of-the-line golf carts, ensuring you have the perfect ride for your next round on the greens.

Our commitment to quality and customer satisfaction sets us apart. Whether you're in the market for a sleek new golf cart to call your own or seeking a reliable rental for a day on the course, Cshell Carts has you covered. Our diverse selection of golf carts caters to various preferences, ensuring that you find the perfect fit for your style and needs.

Experience the convenience and joy of cruising in one of our premium golf carts, each equipped with the latest features for a smooth and enjoyable ride. At Cshell Carts, we not only provide vehicles but also offer a seamless and customer-friendly service, making your golfing experience truly exceptional.

Visit us today, or give us a call at +12395679137 to explore our inventory, ask about our rental options, and discover why Cshell Carts is the go-to destination for golf cart enthusiasts in Naples and beyond. Elevate your golfing experience with Cshell Carts - where quality, style, and service converge on the open greens! Welcome to Cshell Carts, your premier destination for all your golf cart needs! Located at 2176 J and C Blvd, Naples, FL 34109, United States, our showroom is a haven for golf enthusiasts. At Cshell Carts, we specialize in both selling and renting top-of-the-line golf carts, ensuring you have the perfect ride for your next round on the greens.

Our commitment to quality and customer satisfaction sets us apart. Whether you're in the market for a sleek new golf cart to call your own or seeking a reliable rental for a day on the course, Cshell Carts has you covered. Our diverse selection of golf carts caters to various preferences, ensuring that you find the perfect fit for your style and needs.

Experience the convenience and joy of cruising in one of our premium golf carts, each equipped with the latest features for a smooth and enjoyable ride. At Cshell Carts, we not only provide vehicles but also offer a seamless and customer-friendly service, making your golfing experience truly exceptional.

Visit us today, or give us a call at +12395679137 to explore our inventory, ask about our rental options.

Working Hours:
Monday-Friday: 10:00 AM–5:00 PM
Saturday 10:00 AM –2:00 PM
Sunday Closed

Keywords: Golf Cart Naples FL, CShell Carts Naples
Play, Stay, Win: Your Ultimate Casino Adventure Awaits!
Published: 2024-06-26 08:47:28

Ready for an unforgettable casino adventure in India? Discover the best casino destinations where you can enjoy exciting games, luxurious stays, and big wins. Whether it’s the vibrant casinos of Goa, the scenic spots in Sikkim, or the sophisticated venues in Daman, there’s something for every casino enthusiast. Perfect for beginners and seasoned players alike, these destinations offer a wide range of games, top-notch facilities, and thrilling entertainment options. Your next big win is just around the corner. Visit [diamondexchnewid.com](https://diamondexchnewid.com/) to learn more and embark on your casino adventure today!
SuperDuperDB v0.2
Tags: database, ai, python
Published: 2024-06-26 08:46:41

🚀 Announcing SuperDuperDB v0.2: The Ultimate AI and Database Integration Framework! 🚀

Hey Devs! 👋
We are beyond excited to unveil SuperDuperDB v0.2, a groundbreaking update that revolutionizes the way AI integrates with databases. This release is packed with cutting-edge features designed to supercharge your AI projects. Let’s dive into what makes v0.2 a game-changer:


🌟 Key Features of v0.2:

🔧 Flexible Architecture for Customization
Easily switch between various database types, use custom data types, and integrate third-party AI functionalities without specific code integrations. SuperDuperDB supports over 15 different databases!

📈 Unmatched Scalability
Integrating with [Ray](https://www.ray.io/), SuperDuperDB offers horizontal and vertical scalability, enabling effortless deployment of AI models directly on your databases. Scale your AI projects to handle more data and users seamlessly.

🚀 Deployment & Portability Made Simple
Introducing the "superduper Protocol," which simplifies the logistics of deploying AI applications. Serialize complex AI applications into a single configuration file, making your projects instantly portable across different environments.

🛠️ Extensive Extensions
With a clear developer contract, adding new AI functionalities and database backends is a breeze. Contribute and innovate within our vibrant open-source community!

🔜 What’s Next?
As we look ahead to v0.3, expect enhancements in compute efficiency, fail-safe mechanisms, and system security. Stay tuned for more groundbreaking updates!

🔍 Explore Our Use Cases
Discover practical applications of SuperDuperDB, from fine-tuning LLMs on databases to implementing multimodal vector searches. Each use case includes comprehensive walkthroughs to help you configure your production system effectively. Start exploring SuperDuperDB [Use Cases](https://docs.superduperdb.com/docs/category/use-cases/).

💬 Join Our Community
SuperDuperDB v0.2 is open-source and licensed under Apache 2.0. We invite developers to contribute to our discussion forums, issue boards, and pull requests. Let’s build the future of AI and database integration together!

🚀 Dive into the [docs](https://docs.superduperdb.com/docs/category/get-started), explore [use cases](https://docs.superduperdb.com/docs/category/use-cases), and get started with SuperDuperDB v0.2 today!

[Website ](https://superduperdb.com/)| [GitHub](https://github.com/orgs/SuperDuperDB/projects/10/views/1?pane=issue&itemId=67891993) | [Blog](https://blog.superduperdb.com/) | [Slack Community](https://join.slack.com/t/superduperdb/shared_invite/zt-1zuojj0k0-RjAYBs1TDsvEa7yaFGa6QA) | [LinkedIn](https://www.linkedin.com/company/superduperdb/) | [Twitter](https://twitter.com/superduperdb) | [YouTube](https://www.youtube.com/@superduperdb)
Experience the Thrill: Discover Top Casino Destinations!
Published: 2024-06-26 08:45:37

Welcome to our [Casino](https://diamondexchnewid.com/)! 🎰✨ Immerse yourself in the thrilling world of casino games as we explore the excitement, strategy, and glamour of the casino floor. Whether you're a seasoned gambler or a curious beginner, this board is your gateway to the ultimate casino experience.Looking to elevate your casino adventure? Discover a world of excitement and entertainment at [diamondexchnewid.com](https://diamondexchnewid.com/)! These premier online gaming platforms offer a vast selection of casino games, from classic table games like blackjack and roulette to cutting-edge slots and live dealer games. With secure gameplay, enticing bonuses, and round-the-clock support provides the perfect platform to indulge in your favorite casino games from the comfort of your own home.