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.

Flask - Storing multiple types of templates together

21 February 2024 @ 6:12 pm

My emails have a subject line, text content, and HTML content (which is built from MJML). Currently subject lines are stored in the Python code that renders the email, and text and HTML are stored in separate files. I want to know if there are any not-too-complex ways to store these together. For example, a Jinja template: {% block subject %}Subject line!{% endblock %} {% block html %} <mjml-text>Email content</mjml-text> {% endblock %} {% block text %} Email content. {% endblock %} This particular example is undesirable because Jinja makes it difficult to render individual blocks, and thus doing so would add significant complexity and fragility. What might I do to keep this content together?

ActionBarDrawerToggle doesn't open when I use below this code?

21 February 2024 @ 6:12 pm

xml class code : public class ScanActivity extends AppCompatActivity implements ZXingScannerView.ResultHandler { private ZXingScannerView mScannerView; private ImageView image1; private MaterialToolbar materialToolbar; private DrawerLayout drawerLayout; NavigationView navigationView; private static final int PICK_IMAGE_REQUEST = 1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mScannerView = new ZXingScannerView(this); // Initialize MaterialToolbar materialToolbar = new MaterialToolbar(this); //setSupportActionBar(materialToolbar); materialToolbar.setId(View.generateViewId()); RelativeLayout.LayoutParams toolbarParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); toolbarParams.addRule(RelativeLayout.ALIGN_PARENT_START); toolbarParams.addRule(RelativeLayout.ALIGN_PARENT_TOP); materialToolbar.setLayoutParams(to

Unnesting dataframe of lists (with empty values) into dataframe

21 February 2024 @ 6:12 pm

I have a dataframe with dates in the first columns and lists on the remaining columns. These lists are the same length. Howeverm, when I try to unnest them I get an error because they have different lengths due to some empty values. Here is my code. The sample data is given below. t1=unnest(Mylist,data,cnpj_fundo,valor_cota,perfil_cota,patrimonio,taxa_administracao,captacao,resgate) %>% group_by(data) Mylist = structure(list(data = "06/02/2024", cnpj_fundo = list(c("00.222.816/0001-60", "00.400.490/0001-13", "00.817.677/0001-17", "00.819.875/0001-10", "00.822.059/0001-65", "00.829.280/0001-45", "00.832.435/0001-00", "00.836.263/0001-35", "00.840.008/0001-66", "00.840.011/0001-80", "00.852.311/0001-89", "00.856.171/0001-17", "00.888.897/0001-31", "00.947.958/0001-94", "00.974.9

How to configure granular privileges in MarkLogic to permit updates to the configurations of a specific database only, while excluding all others?

21 February 2024 @ 6:11 pm

I'm seeking guidance on configuring granular privileges in MarkLogic to allow updates to database configurations for a specific database only, excluding others. For example, I have a user named 'custom-rest-admin' with the roles rest-writer, rest-admin, and manage-admin assigned for a specific REST API. The database in question is named MY_DATABASE_NAME. Using the following command, I successfully updated the database properties: curl --anyauth --user custom-rest-admin:pass -X PUT -d@"./database-config.json" -i -H "Content-type: application/json" "http://localhost:8002/manage/v2/databases/MY_DATABASE_NAME/properties" However, due to the broad scope of the manage-admin role, I found that I could also update properties for other databases, as demonstrated here: curl --anyauth --user custom-rest-admin:pass -X PUT -d@"./database-config

How to resample OHLC dataframe in Python without peeking into the future?

21 February 2024 @ 6:11 pm

I have a Pandas DataFrame with one second frequency datetime index and columns 'Open', 'High', 'Low', 'Close' which represent prices for a financial instrument. I want to resample this DataFrame to 15 min (or any frequency) but without peeking into the future and still keeping the original DataFrame with one second frequency but adding four new columns for each candle. The goal is to represent how candles form in real time. For example, for a 15 min candle, I would have four new columns in the original DataFrame named 'Open_15m', 'High_15m', 'Low_15m', 'Close_15m' which would update the values each second as a rolling OHLC. Keep in mind that a 15 min candle can only start at hh:00:00 or hh:15:00 hh:30:00 or hh:45:00. This means if for example our DataFrame starts at time 09:00:00, we have rolling OHLC from 09:00:00 until 09:15:00 then we reset and start over as a new 15 min candle starts forming at 09:15:00. I came up with the code to do

Redis cache spring boot with multy region

21 February 2024 @ 6:11 pm

I would like to ask one question. I have 2 regions on open shift b01 and b02. I have Java microservice which located in both region with different instances . If I will use redis cache ,will I have the same cache in both or instance of this micro or will have own cache for micro ? I tried create redis cache and service

No such file or directory found [duplicate]

21 February 2024 @ 6:03 pm

I'm having a problem opening .txt file in same directory, and file do exist there. No such file or directory: 'example.txt' f = open("example.txt", "r+") #vscode Both .py and .txt in same folder

Add struct to vector: "no matching constructor for initialization" error when compiling on macos

21 February 2024 @ 6:02 pm

I'm using emplace_back to add structs to a std::vector as follows: struct ConfigurableShaderParameter { std::string variableName; std::string description; float defaultValue; float min; float max; float step; float value; }; std::vector<ConfigurableShaderParameter> parameters; std::string variableName, description; float defaultValue, min, max, step; // Initialize the above variables parameters.emplace_back(variableName, description, defaultValue, min, max, step, defaultValue); The project is built using CMake and C++20 and it's cross-platform: it compiles fine under Ubuntu and Windows but I cannot get it to compile under macos-latest (I'm using github actions, I don't have access to a mac). This is the error message: /Users/runner/work/epoch/epoch/src/frontend/src/ConfigurableShader.cpp:41:30: note: in instantiation o

HTML Checkbox uncheck calls onfocusout event during onclick

21 February 2024 @ 5:59 pm

I am having an HTML checkbox with onfocusout and onclick event when I uncheck the checkbox the onfocusout event is triggered when the onclick event is triggered. I have added the onfocusout event when the user uses tab navigation for the checkbox. Since both the onclick and onfocusout calls the same function when I uncheck the checkbox it calls the same function twice. How can i avoid the onfocusout when the user clicks the checkbox ? function triggerCheckBox() { console.log('trigger checkbox got called'); } <input id="myCheckbox" type="checkbox" name="myCheckbox" onfocusout

How to include an "AND" operator and Exclusions in AdvancedFilter with one criteria column in VBA

21 February 2024 @ 5:58 pm

First time poster so I apologize if there are any normal posting procedures that I miss. I am trying to filter a large spreadsheet of data based on products' item codes. Basically the file is a print out of product data and a usage statement below it, so the goal at this point is to be able to filter out the usage statements and different products if possible. For reference: here are 6 lines of the column I want to filter: enter image description here I want to only show data for the 5 ...... 58 rows, excluding the 4 ..... 58 and the usages, &X00. &2P2. Currently I have a criteria range on a different sheet, and input: enter image description here And it seems like the list ac

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.

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.

A Practical Guide To Designing For Colorblind People

20 February 2024 @ 12:00 pm

Color accessibility is more than just ticking boxes. Even with good contrast, some color palettes can make interfaces challenging for users. Here are some practical guidelines to ensure more inclusive design for colorblind people. An upcoming part of Smart Interface Design Patterns.

Mobile Accessibility Barriers For Assistive Technology Users

19 February 2024 @ 10:00 am

Accessibility goes beyond making products user-friendly. It can significantly impact the quality of life for people with disabilities. Kate Kalcevich shares lessons she learned from assistive technology users — challenges and barriers they encounter on mobile devices.

How Accessibility Standards Can Empower Better Chart Visual Design

14 February 2024 @ 3:00 pm

Accessibility for data visualization extends well beyond web standards, at least if you’re trying to create an experience that’s actually useful. This article focuses on techniques for creating useful and accessible visualizations that extend well beyond compliance.

A Practical Guide To Designing For Children

13 February 2024 @ 12:00 pm

How to design for children aged 3–12, with insights into user behavior, considerations for parents, and practical UX guidelines.

How To Draw Radar Charts In Web

9 February 2024 @ 3:00 pm

A radar chart — also commonly called a spider chart — is yet another way to visualize data and make connections. Radar charts are inherently geometric, making them both a perfect fit and fun to make with CSS, thanks to the `polygon()` function. Read along as Preethi Sam demonstrates the process and sprinkles it with a pinch of JavaScript to make a handy, reusable component.

Frequently Heard In My Beginning Front-End Web Development Class

8 February 2024 @ 1:00 pm

What could we learn from entry-level students in front-end web development? As seasoned professionals, you might think you’ve seen it all, but the truth is that the newcomers are asking the most intriguing questions and making connections that those of us who have spent years on the front end may have never considered.

Web Development Is Getting Too Complex, And It May Be Our Fault

7 February 2024 @ 1:00 pm

An overwhelming number of frameworks and tooling available today gives the impression that web development has gotten perhaps too complex. Juan Diego Rodríguez explores if web development really is that complex and, most importantly, how we can prevent it from getting even more difficult than we already perceive it to be.

A Guide To Designing For Older Adults

6 February 2024 @ 8:00 am

With one billion people aged 60 or older worldwide, inclusivity is more important than ever. Learn how to create digital experiences that empower independence and competence for older adults while enhancing usability for all. An upcoming part of Smart Interface Design Patterns.

When Words Cannot Describe: Designing For AI Beyond Conversational Interfaces

2 February 2024 @ 1:00 pm

As Artificial Intelligence evolves the computing paradigm, designers have an opportunity to craft more intuitive user interfaces. Maximillian Piras examines how the latest AI capabilities can reshape the future of human-computer interaction beyond conversation alone.

29 Days Of Inspiration (February 2024 Wallpapers Edition)

31 January 2024 @ 12:30 pm

With February just around the corner, how about a little inspiration boost? We might have one for you: desktop wallpapers created with love by the community for the community. Enjoy!

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.

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 Whats new at Firebase Summit Here at Firebase, we believe developers play an instrumental role in helping people learn, live better, go places, and grow businesses. That’s why we’r

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

8 November 2021 @ 5:59 pm

Liat Berry Product Manager Lee Kellogg Software Engineer Getting feedback on your app's releases before they r

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 Peter Friese Peter Friese Developer Advocate

Pinpointing API performance issues with Custom URL Patterns

20 October 2021 @ 3:45 pm

Ibrahim Ulukaya Ibrahim Ulukaya Developer Advocate

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

The alternative to Github, private and open git repositories.

Forge for Bitbucket Cloud: Laying the foundation for infinite extensibility

16 February 2024 @ 2:49 am

Bitbucket Cloud is excited to announce the general availability release of our integration with Atlassian’s Forge extensibility platform, marking a significant… The post Forge for Bitbucket Cloud: Laying the foundation for infinite extensibility appeared first on Bitbucket.

Unified user management is generally available for new Bitbucket Cloud workspaces!

8 February 2024 @ 4:46 pm

We are excited to announce that unified user management is now generally available for new Bitbucket Cloud workspaces. Unified user management… The post Unified user management is generally available for new Bitbucket Cloud workspaces! appeared first on Bitbucket.

Custom Merge Checks in Bitbucket Cloud

20 December 2023 @ 3:49 am

Note:The Bitbucket Cloud team are initially releasing this capability under a “beta” structure in order to gather feedback, test ideas, and… The post Custom Merge Checks in Bitbucket Cloud appeared first on Bitbucket.

Automatically scale runners in Bitbucket Pipelines

7 December 2023 @ 11:56 pm

We are pleased to announce that the Runners Autoscaler feature from Bitbucket Pipelines has transitioned from beta to general availability. This… The post Automatically scale runners in Bitbucket Pipelines appeared first on Bitbucket.

New in pull requests: Batched comments 🎉

15 November 2023 @ 3:00 am

Streamline pull request feedback in Bitbucket Cloud with batched comments. The post New in pull requests: Batched comments 🎉 appeared first on Bitbucket.

Plan your move: Support for Bitbucket Server ends on Feb 15, 2024

10 November 2023 @ 6:53 pm

In 2020, Atlassian announced that support for our server products, including Bitbucket Server, would end on Feb. 15, 2024. Since the… The post Plan your move: Support for Bitbucket Server ends on Feb 15, 2024 appeared first on Bitbucket.

Introducing enhanced webhook security

25 October 2023 @ 2:17 am

We are excited to announce webhook secrets, a powerful new feature that will provide an extra layer of security for your… The post Introducing enhanced webhook security appeared first on Bitbucket.

Atlassian Intelligence features for Bitbucket Cloud are now in beta!

6 October 2023 @ 10:58 pm

We're excited to announce that Atlassian Intelligence features are now in beta and are available to all workspace admins to activate… The post Atlassian Intelligence features for Bitbucket Cloud are now in beta! appeared first on Bitbucket.

Stay focused by marking PR files as reviewed

6 October 2023 @ 8:12 pm

When you’re reviewing a pull request, it’s helpful to distinguish between files that you’ve already looked at, and ones that still… The post Stay focused by marking PR files as reviewed appeared first on Bitbucket.

Announcing the EAP of Forge in Bitbucket Cloud

28 September 2023 @ 1:45 am

We're extremely excited to be kicking off the next chapter in the Bitbucket Cloud story. We have a range of exciting… The post Announcing the EAP of Forge in Bitbucket Cloud appeared first on Bitbucket.

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

Useful resources and inspiration for creative minds (html, css, javascript)