teleren/devto huggingface dataset:
Python Doesn't Care About The Extension!
Tags: python, programming, facts
Published: 2021-12-09 16:36:17

Once upon a time (don't go away, this isn't a story!), I wrote a python script to generate random phone numbers to as mock data for testing my express API (Yes Python helping JS!). I thought that it was a very simple script, so why not write it out in notepad instead of something like VS Code or PyCharm. So I wrote it down, and by mistake I saved it as text file and not python file (main.txt), and I even ran it. So as a dev, very quickly I opened up Powershell, just wrote `cd Des`, hit tab and enter. Then just wrote `python m`, and a quick tab and enter and to my surprise I got an error. Now you might say that, ok you ran a text file with python, what else do you expect except an error. But guys, the error wasn't that, the error was related to a bug in my script! And as I mentioned, I just typed `python m` and hit tab, it showed `python main.txt`, and I was surprised with that. Python running a text file!

Then I thought Programming languages just see the text in the file and don't care about the extension. So I tried a similar program in Java, and it didn't work... So I thought may be its just with Python. Now I didn't try it out with other languages, but I am sure that Python doesn't care about your file extension. I tried the same with `.mp3` file as well and it worked!!!

So let's try it now:

1. Open up the simplest text editor possible on your machine, that is Notepad on Windows, TextEdit on MacOS, or Gedit, Mousepad, or Text Editor on Linux.

2. Write any python code inside it. I will write the code to take a number as input and print out its square.

![Python code...](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5szq2fgu91ds8fm65kvu.png)
 
3. Now let's save this file, but give any other extension except .py or .pyc as they are for Python specifically. I will give it the extension of sqlite3. (Yooo!)

![Python in SQL](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xicrbf22ms10xk9bi01t.png)
 

4. Finally use any CLI to run the code...
![Python code runs with sqlite3 extension!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ro7l09oq6ab9wpoxlp0t.png)
 
And it works....

Now I don't have a good conclusion for this post, but I know you enjoyed the content, and liked the fun fact...!!

And yes, if any of you pythonistas know the reason for this, please put down in comments below!
Bootstrap: Make Images Mobile Responsive
Tags: javascript, beginners, programming, css
Published: 2021-12-09 16:13:20

* Continuing with the next lesson that FreeCodeCamp provided us. 
* First we need to add a new image below the existing one. We have to set its src attribute to `https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg`.
* For the image to be exactly the width of our phone's screen, since we're learning Bootstrap all we need to do is add the `img-responsive` class to our image.

* Code:
```html
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }
</style>

<div class="container-fluid">
  <h2 class="red-text">CatPhotoApp</h2>

  <p>Click here for <a href="#">cat photos</a>.</p>

  <a href="#"><img class="smaller-image thick-green-border" src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>

  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="https://freecatphotoapp.com/submit-cat-photo">
    <label><input type="radio" name="indoor-outdoor"> Indoor</label>
    <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
    <label><input type="checkbox" name="personality"> Loving</label>
    <label><input type="checkbox" name="personality"> Lazy</label>
    <label><input type="checkbox" name="personality"> Crazy</label>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</div>
```

* Answer:
```html
<a href="#"><img class="smaller-image thick-green-border" src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
  <img class="img-responsive" src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg">
```

Larson, Q., 2019. Frontend Development Libraries. [online] Freecodecamp.org. Available at: https://www.freecodecamp.org/learn/front-end-development-libraries/Bootstrap
Starting with Flutter: Asset usage on app
Tags: flutter, dart, beginners, tutorial
Published: 2021-12-09 16:05:57

If your app needs some kind of graphics or file to work, your best option is to add assets to your application. With assets you can have images, audio, fonts and videos inside your flutter app. The great thing is that adding them is pretty easy and retrieving them is still a breeze!

### Pubspec.yaml

Every asset must be nominated into the project `pubspec.yaml` file. Fortunately you don't need to add every file singularly but you can write down only the folder in which there is. To add them you should write down this under the "flutter" section of the `pubspec.yaml` file.

```
flutter:
  assets:
    - myfolder/
    - myfolder/myGraphics
    - myfolder2/myGraphics2

```

The path always starts from the main folder of the project so you only need to add the relative one. 

### Retrieving assets

Widgets should **expose methods** to use assets, like Image does (`Image.asset("PATH")`). The path to add is the absolute one starting from the project directory with the file name at the end with the extension. Considering the example above:

```
Image.asset('assets/myfolder/image.png')
```

### Some tricks

-   Create a function which will get a file name and will return the full asset path with the file at the end.
-   Use the iOS typical folder structure, Flutter will retrieve automatically the correct asset.
    -   Use the default folder for 1.0x then add 2.0x and 3.0x assets
-   You can add custom fonts to assets folder, files... It's not only for audio and images. Remember always to add additional folders/files to the `pubspec.yaml` file.
Configure Listeners for Salesforce events in webMenthods.io Integration
Tags: webmethods, integration, cloudstreams, connectors
Published: 2021-12-14 09:54:40

---
title: Configure Listeners for Salesforce events in webMenthods.io Integration
published: true
date: 2021-12-09 15:52:22 UTC
tags: webmethods, integration, cloudstreams, connectors
canonical_url: https://tech.forums.softwareag.com/t/configure-listeners-for-salesforce-events-in-webmenthods-io-integration/253824
---

 **Summary:**

This article describes the step-by-step process of configuring listeners for Salesforce events in **[webMethods.io](http://webmethods.io/) Integration**

**Pre-requisites:**

- The user needs to have a active **Salesforce** account.

- Active **[webMethods.io](http://webmethods.io/) Integration** cloud tenant.

**Steps:**

1. Switch to **Configurations** tab.

2. Navigate to **FlowService → Triggers → Listeners**.

3. Click on **New Listener**.  

4. Select the **API version** of your choice and click **Next**.  

5. Fill in Listener Name.  

6. Specify **Endpoint URL , Event reply option** and the **Subscription channel**. Select the pre-configured account if it is available or create a new account by clicking on **+** icon.  

7. Provide the **Event subscription channel** in default value as per your choice.  

8. Select the **FlowService** to invoke on receiving events from Salesforce.

9. Select the **User** to execute the FlowService specified in previous step.  

10. Review the Listener configuration and save.  

11. Enable the Listener.  

We are done, FlowServices gets invoked whenever listener receives the events from Salesforce. Monitor the Flowservice execution results under Monitor section.

[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/9/6/9693c6c012c3ad7e0286cab3f85c78047eff9aee_2_690x233.png)](https://aws1.discourse-cdn.com/techcommunity/original/3X/9/6/9693c6c012c3ad7e0286cab3f85c78047eff9aee.png "image")

_Refer [webMethods.io developer guide](https://docs.webmethods.io/integration/developer_guide/listeners/#gsc.tab=0) for more details._

[Original Article](https://tech.forums.softwareag.com/t/configure-listeners-for-salesforce-events-in-webmenthods-io-integration/253824)
Android 12L Beta1 test drive
Tags: android, foldable, tablet
Published: 2021-12-09 15:46:38

Google recently published Android 12L beta 1. This feature drop focuses on devices with large screens, for example tablets and foldables. Being a foldable owner myself (a Surface Duo, at the time of writing still stuck with Android 10), I am naturally very excited about Googles efforts for this device category. So I took beta 1 for a test drive using the Android Emulator. Naturally, beta versions may contain bugs or may not show the final behavior. Consequently, my observations are merely snapshots, and may become obsolete with later versions or the final product. Also, an emulator is not a real device, so there certainly may be considerable differences. Having said all this, let's jump right in.

The first screenshot shows the Android Emulator configured as an 8 inch foldable, opened at an angle of 240 degrees.

![Android Emulator configured as an 8 inch foldable, opened at an angle of 240 degrees](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9t3tu873k1t65773rqn.png)

When you open settings, they present themselves using a two column layout. I think this looks very nice. A similar approach has been advocated for tablets, however the distribution of master and detail used to be 33:66 instead of 50:50, which certainly is not good for foldables, as they will likely split the screen into two equally big parts. This will usually be true for two-screen-devices, too. Using the Jetpack WindowManager library, apps can easily detect screen sizes and the location of the hinge, and configure the layout to work smoothly. To learn more, please look at my posts [Folding composables](https://dev.to/tkuenneth/folding-composables-12go), [Revisiting Jetpack WindowManager](https://dev.to/tkuenneth/revisiting-jetpack-windowmanager-3mnm) and [Hacking the hinge](https://dev.to/tkuenneth/hacking-the-hinge-4a5m).

Have you noticed the app icon bar (task bar) at the bottom of the screen? By dragging an app icon to the left or right side of screen, you can show the corresponding app there.

![Easily enabling split screen mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ue8bzeftkqb05gnfl1v5.png)
 
Certainly, split screen mode is nothing new, it debuted on Android 7.0. But the way it is activated certainly gets much simpler. I only wish I could drag *any* app there, not just the ones pinned to the task bar. One way to do this would be to add an icon which opens the list of all apps, from which I could drag the required one.

To return to the home screen, tap on an empty area of the task bar and move your finger upward fast. a Slower movement opens the recent apps list.

![the recent apps list](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kf0v1kp6rz1dhj8y6b9x.png)
 
The notification panel will also use two columns:

![notification panel in two column mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqxerqj590wflagaqo6w.png)
 
This concludes my brief test drive. What do you think about Android 12L? Please share your thoughts in the comments.
Webinar: How to localize your mobile app and drive your app store optimization (ASO) strategy
Tags: android, ios, localization, webinar
Published: 2021-12-09 15:44:29


Did you know that including #applocalization in your app store optimization strategy could boost your app downloads?
You can learn more about this topic at our online webinar.

Join Crowdin on December 22 at 11 AM EST / 5 PM CET for a webinar on mobile localization.

Attend this free webinar to learn:

- How to get started with app localization
- Why context is essential when translating short copy
- Publishing new translations over-the-air with no need to update the app
- Driving your app store optimization strategy (ASO)
- Agency VS community translations

Our Partnerships Manager Bohdan Sitarskyi and a special guest, Localization Project Manager Guillermo Umpiérrez, will discuss how you can make localization a part of your app store optimization strategy and drive more downloads.

Localize your mobile apps with Crowdin and get relevant translations, provide translators with context, and update texts faster using automation features.

**Register now**: https://bit.ly/3dx47zU 

## About Crowdin:

Crowdin is a cloud-based localization management software. With 2M registered users and 100K+ localization projects from all over the world. Efficiently create and manage all your multilingual content in one place. Localize your apps, websites, games, help documentation, designs, and all that create a native experience for your customers around the globe.

Trusted by GitHub, Avast, GitLab, Buffer, Calendly, and Wrike, and other companies creating multilingual products.

Crowdin integrates with GitHub, GitLab, Bitbucket, Azure Repos, and 100+tools. You can use our API, CLI, webhooks, apps and customize your experience depending on your needs.
The Power of PolarDB | Backup TB Level Data in 10s
Tags: database, cloudnative, cloudskills, programming
Published: 2021-12-09 15:43:08

For those who have massive data to maintain, I believe it's a nightmare every time you need to back up your production environment, taking hours or even days to complete.

Well, is there a way out? The answer is absolutely yes, otherwise I won't waste my time writing this.

Let's just go straight.

By using PolarDB lockless backup feature on Alibaba Cloud, you can easily handle TB level data backup in just 10 seconds. Wanna witness it all? Follow me 👇
[Watch on YouTube >](https://youtu.be/47SQpZZ-fEU)
[![](https://img.alicdn.com/imgextra/i1/O1CN01jAKGEb25rgu4vb5we_!!6000000007580-2-tps-1916-1072.png)](https://youtu.be/47SQpZZ-fEU" type="video/mp4)

In case you want to try this by your own hand, we offer Always Free PolarDB to everyone. Please feel free to take this chance.
[Apply now](https://www.alibabacloud.com/product/polardb#J_5764451150)
How To Hide Module in Prestashop 1.7 from Visitors/Guests
Tags: webdev, prestashop, learning
Published: 2021-12-09 15:32:45

For the past week or so I've been trying to solve this issue:
How to hide a module from someone not logged-in to a Prestashop 1.7 store. I'm newer to Prestashop so I've not gotten very deep into more advanced customization yet.

My specific use case was trying to hide the "IQITSEARCH" module search bar and the search results to anyone not logged-in. I tried removing access to the module in the admin panel for the Guest and Visitor groups, but no dice.

This is how I finally figured it out:

First you need to look into the relevant theme code .tpl files. The template files are written in Smarty. You can wrap what you want hidden like this:

```
{if $customer.is_logged}
// Things to only show if logged in (widget, etc)
{/if}
```
In my use case that was the theme-specific header tpl file.

Be sure to recompile the theme in Admin Panel → Advanced Parameters → Performance → Smarty → Template compilation. This way your changes actually go through and can be seen in your shop.

Please note that when the files are overwritten during an update to your template, you'll need to redo the customization.

If there are any Prestashop experts who have some tips to share, I'm eager to read what you have to say on the subject.
React practices for Beginners
Tags: webdev, beginners, productivity, codenewbie
Published: 2021-12-09 15:25:10

React is arguably one of the most used Frameworks out there today and everyday people are opting this framework for its UI first approach. It's safe to say that the React Library and the whole ecosystem has matured over the years and is still growing. So here are some practices that you can opt and avoid while getting comfortable in the React bubble.
#1. Importing Order ++
Code readability is something that every developer should take care of and importing everything in order can help a lot with this. Usually its a good practice to import in the following order:
Built-in
Internal
External
#2. JSX without Parentheses --
Always wrap a component in parentheses if it crosses more than one line.
#3. Ternary Operators ++
To reduce the amount of lines in your code, you can opt for Ternary operators if the condition involves two values.
#4. Function inside Render --
The best practice would be to keep the logic inside the renderer to a bare minimum and avoid defining a function in there as well.
#5. Fragment ++
In order to save the Virtual DOM from creating unnecessary nodes, always go for a Fragment instead of Div. Just remove `div` from `<div>` and you’re left with a fragment i.e <>
#6. Reserved Prop Naming –
Avoid the use of DOM component prop names when you have to pass props between as these names might not be expected by the others.

 #7. Memo ++
To help the compiler avoid unnecessary rendering, you can go with `Memo` and `React.PureComponent`. It will drastically improve the overall performance of your application.
#8. CSS outside Javascript --
Most of the developers know that organizing CSS is harder than Javascript so its best to avoid the use of raw Javascript during the development phase of React Apps.
#9. Template Literals ++
For a nice and clean code, try using template literals for large strings. It can also reduce the string concentration in your code.
#10. Explicit return --
Prioritize writing beautiful and easy to understand code. Instead of adding {return},  you can use Javascript’s implicit return to format your code in a nice way.
#Conclusion
So this wraps up my personal picks for the best Practices for beginners starting out with React Framework. Let me know your favorites!

Happy Developing!
24X7 Wellness Concierge. Our team is available to assist you day or night, with all your health and wellness needs.
Tags: healthydebate
Published: 2021-12-09 14:40:34

[](https://github.com/LifeUno
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jyjezi2kqbimtw5ypd75.jpg))
Virtual Dressing Room Experience Online
Tags: machinelearning, ai
Published: 2021-12-09 14:28:15

One of the biggest victims of the pandemic has been the ubiquitous [virtual dressing room](https://vue.ai/products/virtual-dressing-room/) in brick and mortar fashion stores. Strict hygiene requirements turned the shopping experience and the retail industry in 2020 on its head. But with the entry of the vaccine, brick and mortar stores are fast reopening in full swing in the US and UK. So what does this mean for shoppers who are likely to be uncomfortable about entering dressing rooms? How do eCommerce brands up their game? Can they offer a [virtual dressing room](https://vue.ai/products/virtual-dressing-room/) for their online shoppers?
Closing the gap
The most glaring difference between physical and online shopping experiences is the inability for shoppers to determine fit. The problem of ‘touch and feel’ has been solved to an extent with product information and high quality photography. But the experience of actually checking fit as well as styling the product with other items from the store has been one of the biggest draws of the physical retail experience.
The Problem of Fit
Today, one of the top reasons for returns is that the product was not as described — or didn’t look like it did in the image.
Most female editorial models are 5 feet, 9 inches tall and quite slim. Whereas the average American woman is about 5 feet, 4 inches tall and veers between size 16 and 18. When consumers are shopping online and see these tall and thin models, one of two things happens. They may shop aspirationally, which often leads to returns because of fit problems and costs eCommerce retailers a lot in return shipping and restocking. Or, the consumer refrains from making the purchase. Had she seen the garment on a model of her size, she may have been convinced to buy it!
Case in point: The Good American does size variation well and has a more diverse range of models. Shoppers can see models of sizes 0, 8 and 16. Inclusivity has been the brand’s anchor from its inception — resulting in sales that crossed $1 million on its first day (the biggest denim launch in history!)
If a fashion eCommerce platform isn’t showcasing relatable models, it should consider the impact it could have on the bottom line.
Read more about [Virtual dressing room](https://vue.ai/products/virtual-dressing-room/)
Work meetings
Published: 2021-12-09 14:27:44

>  Los Ingenieros de software deben odiar las reuniones. Si te atrapan disfrutando de una reunión, puedes entregar tu carnet de desarrollador.

Los programadores somos personas creativas como artistas, pintores o diseñadores. Si pensamos en un pintor seguramente lo ubiquemos mentalmente en un cuarto **solo** escuchando a Beethoven mientras mueve sutilmente el pincel.
Y el proceso de programar no difiere mucho del mencionado. Al menos en la esencia creativa. Necesitamos momentos de fuerte concentración.

![Working from home?](https://media.giphy.com/media/l0K4hO8mVvq8Oygjm/giphy.gif)

Los programadores no decimos que no nos gustan las reuniones arbitrariamente. En vez de eso, lo que realmente estamos comunicando es que nos gustan las reuniones ineficientes, mal planificadas o que interrumpan nuestro trabajo.

![It's a long time](https://media.giphy.com/media/229Pljon180JF07BaX/giphy-downsized.gif)

Soluciones
- Usar vías alternas de comunicación como el correo electrónico o mensajería instantanea.
- Aumentar la transparencia del proyecto.

> "Por lo general, si hay una reunión, es porque un medio de comunicación se ha roto o aún no existe. Siempre le digo a mi equipo que nuestras llamadas de estado podrían ser casi inexistentes si actualizan sus tickets ..."

- Establecer un inventario de reuniones vitales para el funcionamiento del equipo.
--  _(Reunion del Sprint cada dos semanas, Reunion mensual para ver el trabajo de cada ingeniero... etc)_

--- 
Fuentes:

- https://dzone.com/articles/too-many-meetings-a-devs-cry-for-help-5-things-tea
- https://www.ted.com/talks/jason_fried_why_work_doesn_t_happen_at_work#t-898921