StackOverflow.com

VN:F [1.9.22_1171]
Rating: 9.4/10 (10 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

Apply custom function to each row of a data.table and add result to the data.table

13 July 2025 @ 4:40 am

I have below code library(data.table) mm = matrix(1:4, ncol=2, dimnames=list(c("r1", "r2"), c("c1", "c2"))) as.data.table(mm) A_Custom_Function = function(x) c('Calc1' = mean(x) * 2 + var(x), 'Calc2' = min(x), 'Calc3' = max(x)) My goal is to apply A_Custom_Function function to each row and add the resulting vector as new columns to mm itself. Could you please help with some efficient procedure to achieve this. I have really big data, table with more that 10,000,000 rows. I am looking for some generic procedure to work with any custom function.

Explain mcp resource end to end workflow

13 July 2025 @ 4:40 am

I feel like I understand MCP tool. that is - when the user gives the prompt, using the available tools, mcp-client talks to LLM and gets the task executed along with parameters LLM provides using tool/call. Here LLM is responsible for providing which tool to call along with parameters. When mcp-server exposes resources, how does this work? lets say we have this resource "file://t-shirt/description" which has the product description. When the prompt is "can you summarize the t-shirt product features", should the LLM instruct the mcp-client to read the file? (It does not seem to work like this). It would be nice if you could explain the end to end workflow how mcp resource works.

React Native Expo dev-client on Android emulator only shows the large arrow splash screen and never loads my app UI

13 July 2025 @ 4:07 am

enter image description here I’m working on a bare React Native app with Expo’s custom dev client workflow, but when I launch it on the Android emulator I never get past the arrow splash screen. It seems to be the Expo Dev Launcher logo, and I can’t swipe or tap it to load my actual app. What I’ve tried Start the Expo Dev Server for dev-client npx expo start --dev-client In a separate terminal, build & install on Android npx expo run:android Build and install both succeed, but the emulator shows only this screen: I’ve tried: Clicking the arrow icon Swiping up with mouse drag and with adb shell input swipe Fetching dev servers from the Dev Launcher menu Nothing ever loads my JS bundle or displays my MainActivity/React Navigation screens. What I want Bypass or disable thi

Rails server crashes on Mac M2 with Bus Error

13 July 2025 @ 3:58 am

I have been struggling to set up a Rails 5.1.7 application on my MacBook M2 for months. I installed Rosetta, x86_64 brew, and my terminal app is set to run with Rosetta. ~ ❯ arch i386 ~ ❯ which brew /usr/local/bin/brew ~ ❯ brew list ==> Formulae abseil coreutils icu4c@77 lz4 pkgconf xz autoconf gdbm krb5 m4 postgresql@14 yarn automake gettext libffi mysql protobuf@29 zlib bison gh libnghttp2 node readline zstd brotli git libtool node-build redis c-ares glib libunistring nodenv ruby-install ca-certificates gmp libuv openssl@3 shared-mime-info chruby heroku libyaml pcre2 terminal-notifier ==> Casks ~ ❯

How to get peaks consistent with KDE in one-dimensional data using python?

13 July 2025 @ 3:24 am

Example data: a = [68, 63, 20, 55, 1, 21, 55, 58, 14, 4, 40, 54, 33, 71, 36, 38, 9, 51, 89, 40, 13, 98, 46, 12, 21, 26, 40, 59, 17, 0, 5, 25, 19, 49, 91, 55, 39, 82, 57, 28, 54, 58, 65, 2, 39, 42, 65, 1, 93, 8, 26, 69, 88, 32, 15, 10, 95, 11, 2, 44, 66, 98, 18, 21, 25, 17, 41, 74, 12, 4, 33, 93, 65, 33, 25, 76, 84, 1, 63, 74, 3, 39, 9, 40, 7, 81, 55, 78, 7, 5, 99, 37, 7, 82, 54, 16, 22, 24, 23, 3] Its KDE looks like this: enter image description here to produce this kdeplot: import matplotlib.pyplot as plt import seaborn as sns fig = plt.figure(figsize=(12, 6)) ax = sns.kdeplot(a, bw_adjust=0.5, fill=True, cut=0) ax.set_xticks(np.arange(0, 100, 5)) I want to get the highest 2 peaks in the KDE plot. The 1st one i

How do I use the jQuery each function?

13 July 2025 @ 2:01 am

This jQuery should loop through and grab the href attribute from each href link and display the different href in each of the #link divs. But the problem is that I get all three URLs printed in the first #link div, like this: enter image description here jQuery(document).ready(function() { $("h3.post-title a").each(function(){ var thelink = this.href; jQuery("#thelink").append(thelink); }); }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min

Using std::move with Constructor(Type t) or Constructor(Type&& t). What's the difference?

12 July 2025 @ 11:21 pm

I'm studying std::move semantics and I would like this to be clarified to me: Say I have: // Message.h class Message { private: std::array<uint8_t, BUFFER_SIZE> buffer; std::queue<Packet> packets; public: Message(Packet p) { packets.push(std::move(p)); } } Now I have: Packet p; p << data; // put data into the packet Message m(p) // wrap the packet in a message. So this code generates unnecessary copies for my use case, because I will never use p ever again. So I'd like to use the std::move semantics to avoid every copy possible. What I don't understand is the following: If I do: Packet p; Message m(std::move(p)); While the constructor of Message is still

Flutter: in app web view causes app to be killed in windows

12 July 2025 @ 10:30 pm

I'm building a flutter app on windows, i have tried different packages for in app web view like flutter_inappwebview and webview_cef. The problem is when the application goes to the webview screen , the application get killed on the tester machine (the app closes unexpectedly). i don't know why or what i have missed, it's working on my machine but closes on tester machine. Although the recommended way to initialize the web view is applied within the initiate method of the webview screen : void initState(){ super.initState(); initiate(); } void initiate()async{ if (!kIsWeb && defaultTargetPlatform == TargetPlatform.windows) { final availableVersion = await WebViewEnvironment.getAvailableVersion(); assert(availableVersion != null,

How to inject images from native app to webview and opload to server

12 July 2025 @ 9:21 pm

I have the following code. I want upload images to server in webview in my application but doesn't work. How to inject images from native app to webview and upload to server? My Screenshot @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode==123 && resultCode==RESULT_OK) { // Checking whether data is null or not if (data != null) { // Checking for selection multiple files or single. if (data.getClipData() != null) { // Getting the length of data and logging up the logs using index for (int index = 0; index < data.getClipData().getItemCount(); index++) { // Getting the URIs of the selected files and logging them into logcat at debug level Uri uri = d

File is not showing the the slack channel

12 July 2025 @ 8:37 pm

Using Node.js, how can I send a file to a Slack app using the Slack API? I tried the method using Slack docs, but the message I tried to send using postMessage is working. However, for sending files, we should use a different approach as per the Slack docs. That same approach I have followed, but on Slack, I didn't see any file that I tried to upload, but the code is successfully running. Please help if I should add any params or should I call any other methods. https://api.slack.com/methods/files.upload const messageRes = await web.chat.postMessage({ channel: "#jr-developers", text: "🚨 Incident detected! Please check the attached report below.", }); console.log("Message sent:", messageRes.ts); // console.log(messageRes); // Step 3: Upload file content to the URL using axios const fileName = "continent.

jsfiddle.net

VN:F [1.9.22_1171]
Rating: 9.0/10 (2 votes cast)

A playground for web developers, use it as an online editor for snippets built from HTML, CSS and JavaScript. The code can then be shared with others, embedded on a blog, etc.

SmashingMagazine.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (6 votes cast)

Digital media magazine for designers and developers
Web design plus tips and tricks.

Unmasking The Magic: The Wizard Of Oz Method For UX Research

10 July 2025 @ 10:00 am

The Wizard of Oz method is a proven UX research tool that simulates real interactions to uncover authentic user behavior. Victor Yocco unpacks the core principles of the WOZ method, explores advanced real-world applications, and highlights its unique value, including its relevance in the emerging field of agentic AI.

Droip: The Modern Website Builder WordPress Needed

8 July 2025 @ 10:00 am

Traditional page builders have shaped how we build WordPress sites for years. Let’s take a closer look at [Droip](https://droip.com/), a modern, no-code visual builder, and explore how it redefines the experience with cleaner performance, full design freedom, and zero plugin dependency.

Design Guidelines For Better Notifications UX

7 July 2025 @ 1:00 pm

As always in design, timing matters, and so do timely notifications. Let’s explore how we might improve the notifications UX. More design patterns in our Smart Interface Design Patterns, a friendly video course on UX and design patterns by Vitaly — from complex data tables and nested filters to FAQs and error messages.

CSS Intelligence: Speculating On The Future Of A Smarter Language

2 July 2025 @ 1:00 pm

CSS has evolved from a purely presentational language into one with growing logical powers — thanks to features like container queries, relational pseudo-classes, and the `if()` function. Is it still just for styling, or is it becoming something more? Gabriel Shoyombo explores how smart CSS has become over the years, where it is heading, the challenges it addresses, whether it is becoming too complex, and how developers are reacting to this shift.

Turning User Research Into Real Organizational Change

1 July 2025 @ 10:00 am

Bridging the gap between user research insights and actual organizational action — with a clear roadmap for impact.

Never Stop Exploring (July 2025 Wallpapers Edition)

30 June 2025 @ 12:00 pm

July is just around the corner, and that means it’s time for a new collection of desktop wallpapers. Created with love by artists and designers from across the globe, they are bound to bring some good vibes to your screen. Enjoy!

Can Good UX Protect Older Users From Digital Scams?

25 June 2025 @ 12:00 pm

As online scams become more sophisticated, Carrie Webster explores whether good UX can serve as a frontline defense, particularly for non-tech-savvy older users navigating today’s digital world.

Decoding The SVG <code>path</code> Element: Curve And Arc Commands

23 June 2025 @ 10:00 am

On her quest to teach you how to code vectors by hand, Myriam Frisano’s second installment of a `path` deep dive explores the most complex aspects of SVG’s most powerful element. She’ll help you understand the underlying rules and function of how curves and arcs are constructed. By the end of it, your toolkit is ready to tackle all types of tasks required to draw with code — even if some of the lines twist and turn.

Meet Accessible UX Research, A Brand-New Smashing Book

20 June 2025 @ 4:00 pm

Meet “Accessible UX Research,” our upcoming book to make your UX research inclusive. Learn how to recruit, plan, and design with disabled participants in mind. Print shipping in August 2025. eBook available for download later this summer. Pre-order the book.

CSS Cascade Layers Vs. BEM Vs. Utility Classes: Specificity Control

19 June 2025 @ 3:00 pm

CSS can be unpredictable — and specificity is often the culprit. Victor Ayomipo breaks down how and why your styles might not behave as expected, and why understanding specificity is better than relying on `!important`.

stackblitz.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (2 votes cast)

Create, edit & deploy fullstack apps — in just one click. From Angular to React or even just HTML, JS and CSS.

firebase.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (2 votes cast)

An on-line real-time database for your apps.

#FirebaserFriday: Frank van Puffelen

18 March 2022 @ 3:58 pm

Paulette McCroskey Social Media Manager, Advanced Systems Group, LLC

How Firebase Performance Monitoring optimized app startup time

9 March 2022 @ 4:58 pm

Viswanathan Munisamy Software Engineer

Using Machine Learning to optimize mobile game experiences

15 February 2022 @ 4:58 pm

Sachin Kotwani Senior Product Manager Elvis Sun Software Engineer Mobile app and game developers can use on-device machine learning in their apps to increase user engagement and grow revenue. We worked with game developer HalfBrick to train and implement a custom model that personalized the user's in-game experience based on the player's skill level and session details, resulting in increased interactions with

Accept Payments with Cloud Firestore and Google Pay

11 February 2022 @ 8:00 pm

Stephen McDonald Developer Relations Engineer, Google Pay Back in 2019 we launched Firebase Extensions - pre-packaged solutions that save you time by providing extended functionality to your Firebase apps, without the need to research, write, or debug code on your own. Since then, a ton of extensions have been added to the platform covering a wide range of features, from email triggers and text messaging, to image resizing, translation, and much more. Google Pay Firebase Extension We're now

Everything you need to know about Remote Config’s latest personalization feature

26 January 2022 @ 6:22 pm

Jon Mensing Product Manager An important part of turning your app into a business is to optimize your user experience to drive the bottom line results you want. A popular way to do this is through manual experimentation, which involves setting up A/B tests for different components of your app and finding the top performing variant. Now, you can save time and effort - and still maximize the objectives you want - with Remote Config’s latest personalization feature. Personalization harnesses the power of machine learning to automatically find the optimal e

What’s new at Firebase Summit 2021

10 November 2021 @ 5:31 pm

Kristen Richards Group Product Manager

Automate your pre-release testing with the App Distribution REST API

8 November 2021 @ 5:59 pm

Liat Berry Product Manager

Improving the Google Analytics dashboard in Firebase

5 November 2021 @ 6:03 pm

Sumit Chandel Developer Advocate If you’ve visited the Firebase console’s Analytics section recently, you might have noticed something new… an updated Analytics dashboard, a new Realtime view and a few other UI enhancements.

How to get better insight into push notification delivery

27 October 2021 @ 3:45 pm

Charlotte Liang Charlotte Liang Software Engineer

Pinpointing API performance issues with Custom URL Patterns

20 October 2021 @ 3:45 pm

Ibrahim Ulukaya Ibrahim Ulukaya Developer Advocate

bitbucket.org

VN:F [1.9.22_1171]
Rating: 8.4/10 (5 votes cast)

The alternative to Github, private and open git repositories.