teleren/devto huggingface dataset:
Convert XML to JSON in 1 line of code using ColdFusion
Tags: xml, java, coldfusion, cfml
Published: 2023-03-13 18:44:43

I was researching methods of converting XML to JSON using ColdFusion. I didn't want to use [xmlParse()](https://cfdocs.org/xmlparse) because I didn't want to have to iterate over an XML object. CoolUtils offers a GUI/commandline [Total XML Converter](https://www.coolutils.com/TotalXMLConverter) that is capable of converting XML to JSON, CSV and SQL code. (Very cool indeed!)  I found a couple other possibilities like [Xidel](http://www.videlibri.de/xidel.html), but it required that I provide a fair amount of information in order to convert.

I found a java blog entry titled "[Java library to convert XML to JSON](http://heshans.blogspot.com/2014/01/java-library-to-convert-xml-to-json.html)" and thought it was worth checking out. While adding the JAR to my server, I noticed that it worked without having to reboot.  I thought it may have loaded automatically, but soon determined it was due to the fact that CF2016's "cfusion/lib/closure-compiler.jar" already supports the same "org.json.xml" class files.  This means that I only need to download the [most recent JSON jars](https://search.maven.org/search?q=g:org.json%20AND%20a:json&core=gav) if I wanted to upgrade a couple of older CF10 servers.

I've tested it with some USPS, real estate and RSS XML files and it seems to work ok.  I noticed that some numeric values were converted to scientific notation in the JSON file and I'm going to review to determine if this is normal or not, but other than that it was extremely fast and will hopefully be easier to consume and make it easier to exchange data with other APIs.

Here's some sample CFML code.

https://www.trycf.com/gist/00bb362672f772fab56d26f3e01ad3fa/acf11


While testing this online in order to share, I noticed that the official Adobe [CFFiddle](https://cffiddle.org/) doesn't allow `createObject()` which means you can really only test this on [TryCF.com](https://www.trycf.com/). I also noticed that it didn't work on Lucee, but only because they don't have the supporting Java libraries installed.

NOTE: If you want to retain XML numbers, you'll need to use JavaLoader and use a newer version of JSON-Java that supports a secondary "true" argument. This will safely convert number values to text strings instead of converting to scientific notation or rounding.

Here's the CFML source code on gist.

https://gist.github.com/JamoCA/00bb362672f772fab56d26f3e01ad3fa

{% gist https://gist.github.com/JamoCA/00bb362672f772fab56d26f3e01ad3fa %}


2019-11-13: I tested this technique against some [OWASP malicious XML samples](https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing) and the good data was parsed without any error while the bogus data appeared to be ignored. Both ColdFusion's [xmlparse](https://cfdocs.org/xmlparse) and Foundeo's [SafeXMLParse](https://www.forgebox.io/view/safexmlparse) encountered parsing issues and returned an error.

2023-07-25: This approach to consuming XML is not susceptible to the XML External Entity (XXE) vulnerability.
https://foundeo.com/security/guide/xml-external-entities/
Sean Paul jaiz
Published: 2023-03-13 18:38:21

[https://www.bankfanz.com/jaiz-bank-transfer-code/](https://www.bankfanz.com/jaiz-bank-transfer-code/#utm_source=backlinks&utm_medium=search&utm_campaign=darry+ring+us&utm_content=Michelle)

https://plaza.rakuten.co.jp/jaizbankcode2023/diary/202303130000/
https://peatix.com/user/16383428/
https://www.provenexpert.com/what-is-jaiz-bank-ussd-code-20233/
https://www.producthunt.com/@jaizbankussdcode5
https://www.divephotoguide.com/user/Jaizbankussdcode5
https://wakelet.com/@Whatisjaizbankussdcode2023666
https://vocal.media/authors/what-is-jaiz-bank-ussd-code-2023-e94ci01vf
https://www.lifeofpix.com/photographers/jaizbankussdcode5/
https://seedandspark.com/user/what-is-jaiz-bank-ussd-code-2023-2
https://rosalind.info/users/Jaizbankussdcode5/
http://phillipsservices.net/UserProfile/tabid/43/userId/204660/Default.aspx
https://app.roll20.net/users/11731462/what-is-jaiz-bank-ussd-code-2
https://speakerdeck.com/jaizbankcode5
https://social.msdn.microsoft.com/Profile/What%20is%20Jaiz%20bank%20ussd%20code%202023%205
https://camp-fire.jp/profile/Jaizbankussdcode5/
https://plazapublica.cdmx.gob.mx/profiles/Jaizbankussd5/activity
https://www.metal-archives.com/users/Jaizbankussdcode5
https://storium.com/user/jaizbankussdcode5
https://trabajo.merca20.com/author/jaizbankussdcode5/
https://www.intensedebate.com/people/Jaizbankcode5
https://www.mifare.net/support/forum/users/jaizbankussdcode5/
https://pinshape.com/users/2592014-jaizbank5
http://foxsheets.com/UserProfile/tabid/57/userId/123994/Default.aspx
https://www.kompasiana.com/jaizbankcode5
https://leanin.org/circles/what-is-jaiz-bank-ussd-code-2023-5
https://www.credly.com/users/what-is-jaiz-bank-ussd-code-2023.3933c226/badges
https://www.myminifactory.com/users/Jaizbankussdcode5
https://www.sqlservercentral.com/forums/user/jaizbankussdcode5
https://www.longisland.com/profile/Jaizbankussdcode5
https://guides.co/a/jaiz-bank-ussd-code-307270
https://myanimelist.net/profile/Jaizbankcode5
Caching Repetitive UDF Access to Request Scope Using Argument Stringified+Hashed Key
Tags: coldfusion, cfml
Published: 2023-03-13 18:30:22

While viewing [FusionReactor](https://www.fusion-reactor.com/) logs for a ColdFusion app, I noticed lots of repetitive JDBC entries in a request that contained the same exact SQL statement and was taking **42ms** per execution.  I checked the UDF that was performing the query (using [QB](https://github.com/coldbox-modules/qb)) and the query was configured to be cached for 5 minutes... but overhead-wise, it was still taking **42ms** each time. The "Number of Queries" for the request was 57 and most of the queries were similar cached 40ms lookups and it started adding up to **1,452ms** overall.  I wondered if there was anything I could do to add self-contained caching to UDFs that could benefit from them. I didn't want to save the response to the session (YIKES! I've seen some code that does this) or use `cachePut`/`cacheGet` since the caching only needs to live for a single request of "repetitive access".

I've been playing with the java `hashCode()` function to convert strings to a unique signed integer and wondered if I could stringify the arguments passed to create a cacheable key and very temporarily store the result in the request scope. This works (for me) and I'm happy with the results, but I wonder if there are any potential issues or side effects that I'm not considering (besides the rare chance of hashing entropy).

Here's a sample UDF with some slow/fake business logic (emulated using `sleep(1000)`). The first request is normally slow (as expected) whereas all repeat accesses with the same exact arguments are **0ms**. I believe that this approach may also work in environments that use multithreaded processing on a single request, but I'm not 100% sure. (ie, in a multithreaded environment, would it be recommended to use `CFLock` with request scope locking?)


## Source Code

https://gist.github.com/JamoCA/62f8535cfcf5dacd4e7f5ea678038330

{% gist https://gist.github.com/JamoCA/62f8535cfcf5dacd4e7f5ea678038330 %}
How to fix 'zsh: command not found: python' when using pyenv on macos
Published: 2023-03-13 18:19:01

1. Start by installing pyenv via brew `brew install pyenv`
2. Install desired version of python `pyenv install <version>` and set it as global `pyenv global <version>`
3. Update the environment variables to use the version of Python installed through pyenv: `echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.zshrc`
4. Restart your terminal or run the following command: `source ~/.zshrc`
5. Alias python installed via pyenv `echo "alias python=$(pyenv which python)" >> ~/.zshrc`
[AWS] RDS Will Start DB Instance After Stopped Seven Days Automation
Tags: awsrds, autostartdbinstance, dbinstance
Published: 2023-12-30 12:34:48

---
title: [AWS] RDS Will Start DB Instance After Stopped Seven Days Automation
published: true
date: 2023-03-13 17:39:12 UTC
tags: 
- AWSRDS
- AutoStartDBInstance
- DBInstance
canonical_url: https://www.kmp.tw/post/rdswillstartdbinstanceafterstopped7daysautomation/
---

# Situation

### AWS RDS Will Start DB Instance After You Stopped DB Instance Seven Days Automation For That Doesn’t Fall Behind Any Required Maintenance Updates.

### [Ref](https://docs.amazonaws.cn/en_us/AmazonRDS/latest/UserGuide/USER_StopInstance.html)

# How To

- ### You Can Delete DB Instance After Take Snapshot, If You Want Use That DB, You Can Restore DB Instance From Snapshot.
- ### You Can Write Lambda Function With Schedule To Stop DB Instance.

# Write Lambda ~

### Create IAM & Lambda

### IAM Policy
```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "rds:StartDBCluster",
                "rds:StopDBCluster",
                "rds:ListTagsForResource",
                "rds:DescribeDBInstances",
                "rds:StopDBInstance",
                "rds:DescribeDBClusters",
                "rds:StartDBInstance"
            ],
            "Resource": "*"
        }
    ]
}
```

### Lambda Code For Stop Tagged DB Instance (Python)
```
import boto3
rds = boto3.client('rds')

def lambda_handler(event, context):

    #Stop DB instances
    dbs = rds.describe_db_instances()
    for db in dbs['DBInstances']:
        #Check if DB instance is not already stopped
        if (db['DBInstanceStatus'] == 'available'):
            try:
                GetTags=rds.list_tags_for_resource(ResourceName=db['DBInstanceArn'])['TagList']
                for tags in GetTags:
                #if tag "autostop=yes" is set for instance, stop it
                    if(tags['Key'] == 'autostop' and tags['Value'] == 'yes'):
                        result = rds.stop_db_instance(DBInstanceIdentifier=db['DBInstanceIdentifier'])
                        print ("Stopping instance: {0}.".format(db['DBInstanceIdentifier']))
            except Exception as e:
                print ("Cannot stop instance {0}.".format(db['DBInstanceIdentifier']))
                print(e)

if __name__ == "__main__":
    lambda_handler(None, None)

```

### In Lambda Schedule
```
cron(00 00 ? * SUN *)
```
Is it wrong to be afraid?
Tags: discuss, community
Published: 2023-03-13 17:37:01

With all of the news breaking out right now about SVB and how it might affect other banks it has me a little scared about the future. 

I'm currently enrolled in a bootcamp with the hope that I can break into the tech industry with a better paying job to support myself. The headlines and the news articles are scary and I just want to know what other people are feeling and to know if it's all a little inflated and if this is more of a hiccup or a sign of total downhill for tech.
Essential SQl Commands
Published: 2023-03-13 17:31:56

SQL (Structured Query Language) is a programming language used to manage relational databases. Here are some basic SQL commands:

SELECT - used to select data from a database
Example:
SELECT column1, column2 FROM table_name;

INSERT INTO - used to insert new data into a database
Example:
INSERT INTO table_name (column1, column2) VALUES (value1, value2);

UPDATE - used to update existing data in a database
Example:
UPDATE table_name SET column1 = value1, column2 = value2 WHERE some_column = some_value;

DELETE - used to delete data from a database
Example:
DELETE FROM table_name WHERE some_column = some_value;

CREATE DATABASE - used to create a new database
Example:
CREATE DATABASE database_name;

CREATE TABLE - used to create a new table in a database
Example:
CREATE TABLE table_name (column1 datatype, column2 datatype, column3 datatype);

ALTER TABLE - used to add, modify or delete columns in an existing table
Example:
ALTER TABLE table_name ADD column_name datatype;

DROP TABLE - used to delete a table from a database
Example:
DROP TABLE table_name;

Note: These are some of the basic SQL commands, but there are many more advanced commands that can be used to manage databases.
Just ask the commandline: "hey can you convert all the files in downloads/images to jpg" 😎
Tags: chatgpt, productivity, cli, opensource
Published: 2023-03-13 17:20:31

Hey! Yeah another GPT util ;) I hope i did well on the execution part. This will help you with running commands in the command line, including the ones with difficult to remember arguments like ffmpeg. 

## Features 🚀
- ❓ Question to command
- 🎬 Response streaming
- 🔄 Lets you run multiple commands (always asks before and shows you the command)
- 📤 Optionally send output of command back to chatgpt for explanation
- ⚠ Tags it as dangerous if needed
- ⬆️ Lets you go arrow up for command history
- 🔍 Cmd+r to search through command history
- 💬 Chat mode, just acts more like a normal chat gpt session
- 🌈 Syntax highlighting of code


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zl8hf9v487g9h7fzw3c.gif)


https://github.com/lennardv2/hey-chatgpt-cli
A perspective from a new developer
Tags: webdev, javascript, react
Published: 2023-03-13 17:11:03

**The confusion with platforms**
As a new developer, I think the most confusing thing about platforms is when to use which one. There are so many different platforms and each of them have different strengths and weaknesses. While a lot of them do the same thing, it might be quicker, faster, or better developed if you pick the right platform. 

**Learning web components and VanillaJS in an approachable way**

As a student learning about web components and VanillaJS, there is a lot to learn, and a lot of ways to learn it. My idea on how these things can be taught in a a way that is more approachable would be for there to articles on step by steps, including possible errors. How to publish to npm, using open environments, all can be confusing but with screenshots and steps, it can be very helpful. 

**Easiest to work with on first stab**

I think the easiest thing to work with on first stab was open wc. The reason being that it was easy to see how the code works for the logo. And then that made it easy to see where to put my code, and how to run it and see what to fix. It also helped to see it in a web browser. 

**Tooling, what was easy, what wasn't**

I think that the most confusing part about tooling was the terminal (npm start). I was unsure of what it was doing and iy confused me for a while. Editing in VScode clicked easily for me and version control with Git also made a lot of sense to me.

**Readings to better understand**

I did readings on the differences between angular, react, and svelte. How each platform is different and what each is primarily used for. I also read on version control using Git in the command line, but realized that using Github desktop GUI did a lot of those actions for me.
Senior devs collaborate more
Tags: developer, productivity, codenewbie, management
Published: 2023-03-13 17:07:12

Did you know that you can tell the seniority 🧓 of a developer based on the ratio of time they are spending on collaboration vs code?

We analysed over 35,000 developer datasets across Gitlab, Github, Slack, and Google Calendar. This is what we found. 

More senior developers are spending up to 30% more time on collaboration tasks such as Slack messages and meetings than junior devs 👶 .

What does that mean for you?

Well, if you are aiming for a promotion to the managerial level you might want to increase the proportion of time you allocate to those activities.

The key?

The collaboration activities must be rendering you "visible" within the team. This means that its often better to answer a question on a public Slack channel than a private message.
Tale of Two Journeys, Customer Experience vs. Customer Journey
Tags: startup
Published: 2023-03-13 13:57:13


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

**The customer experience and customer journey are two concepts that businesses often use interchangeably. **

However, they are two different aspects of customer satisfaction that require separate attention. The customer experience is the sum of all interactions a customer has with a business, while the customer journey refers to the steps a customer takes to reach a goal.

##Customer Experience
The customer experience includes every interaction a customer has with a business, from browsing the website to contacting customer support. It is a holistic view of a customer's entire experience with a business, and it can be influenced by many factors.

Businesses that prioritize the customer experience understand the importance of every touchpoint with the customer. They focus on creating a seamless and consistent experience across all channels. This approach leads to increased customer satisfaction, loyalty, and advocacy.

##Customer Journey
The customer journey refers to the steps a customer takes to reach a goal. It can include researching products, comparing options, and making a purchase. The journey can vary based on the customer's needs, preferences, and past experiences.

Businesses that prioritize the customer journey understand the importance of understanding their customer's needs and preferences. They use customer data and feedback to optimize the journey and make it as smooth as possible. This approach leads to increased conversion rates and customer loyalty.

##The Importance of Both
While the customer experience and customer journey are different concepts, they are both important for achieving customer satisfaction. A positive customer experience can lead to customer loyalty and advocacy, while a seamless customer journey can increase conversion rates.

Businesses that prioritize both aspects of customer satisfaction can create a competitive advantage in their industry. They can differentiate themselves from competitors by offering a superior customer experience and journey.

Read more:
https://churnfree.com/blog/tale-of-two-journeys-customer-experience-vs-customer-journey/
Catch up on JavaScript 3: Clack, ipx, smtp-tester, and much more
Tags: webdev, javascript, testing, typescript
Published: 2023-03-13 16:02:49


![Photo by Brett Jordan on Unsplash](https://cdn-images-1.medium.com/max/10368/0*BBYTDRghfTkFkJVO)

## [Clack](https://github.com/natemoo-re/clack)

Elegant CLI primitives and ready-to-use CLI components.

![https://github.com/natemoo-re/clack](https://cdn-images-1.medium.com/max/2400/0*vtHiTCTGlbPgpEaJ)

## [ipx](https://github.com/unjs/ipx)

Ever wanted to create an endpoint for manipulating images? It’s easy with the package below.

![https://github.com/unjs/ipx](https://cdn-images-1.medium.com/max/2400/0*eRMALNK4ZxJAExaI)

## [smtp-tester](https://github.com/deitch/smtp-tester)

SMTP Tester creates the SMTP server locally you can use to send e-mails during tests. This way you can catch these e-mails and test them or retrieve information like magic-link for integration testing

![https://github.com/deitch/smtp-tester](https://cdn-images-1.medium.com/max/2400/0*g9vMXzur5xhrXS0I)

## [Try™](https://github.com/bdsqqq/try)

Get away from try-catch hell with this simple lib.

![https://github.com/bdsqqq/try](https://cdn-images-1.medium.com/max/2400/0*-SNHT4aqWg6VlfeP)

## [HouseForm](https://github.com/crutchcorn/houseform)

If Formik and hooks have a baby it will be house form. Made on top of these libraries, supporting validation as first-class

![https://github.com/crutchcorn/houseform](https://cdn-images-1.medium.com/max/2400/0*IEkpMy21aOFIZIR-)

Please react to this post or leave a comment and let me know what you think. Check [my Twitter](https://twitter.com/marcin_codes) where I post these libraries daily.

## Stay up to date with my writing

You can stay up to date by following me in one of these ways:

- Follow me on [Medium](https://medium.com/@marcin-codes)

- Follow me on [Twitter](https://twitter.com/marcin_codes)

- Follow me on [Dev.to](https://dev.to/marcin_codes)

- Follow me on [Mastodon](https://mas.to/@marcin_codes)

- Add [my blog](https://marcin.page/) to the [RSS feed](https://marcin.page/feed.xml) reader
Why not to support AI development...
Published: 2023-03-13 16:51:24

I really think that AI is going to ruin the world. It is going to replace us at our jobs, make us lazy, and much more. Also, I really believe in movie theories, which are that robots with top-class AI in the future are going to make us their slaves, by outsmarting us. Yes, the development of technology is great, but in my opinion, it MUST have limits. And the new AI this CHAT GPT is just the tip of the Ice Burg because there will be more developed once. Even though, if you have another opinion to say feel free to say thank you.
Build a realtime board game with Nextjs, Socket.io, Tailwind, Nodejs, Typescript
Tags: react, typescript, javascript, nextjs
Published: 2023-03-13 16:34:43

I have made a real-time board game that can be played and mainly to learn new knowledge and new technologies.
Now I want to share with you guys its source code both FE and BE, the BE is a bit dirty though (because I'm FE developer), sorry guys.
The project has many undeveloped functions (I have noted in Readme file), anyone who wants to play around can tell me.
Thanks.
Here is the demo: https://jungle-board.vercel.app
Github link: https://github.com/nttanh6299/jungle-board

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m7woe908mlduwtk1zyx4.png)
What are your Goals for the Week of March 12 - 18?
Tags: discuss, motivation
Published: 2023-03-13 16:25:59

What are your goals for this week?
 
- What are you building? 
- What will be a good result by week's end?
- Are you attending any events this week?
- Did you meet your goals last week?

I'll start with how I did last week.

**Last Week's Goals**

- [:x:] Update Portfolio.
- [:white_check_mark:] Continue Job Search. Sent DMs, and applied to a couple positions. Attended virtual meetings.
- [:white_check_mark:] Continue new project. Made some progress. Used pomodoro technique to stay focused.
- [:white_check_mark:] Blog.
- [:white_check_mark:] Yard work

**Monthly Goal**

- Gain more followers here. I would like to have more followers on DEV than I had on the bird site.

 **** Getting closer on this about 30 to go. 

**This Week's Goals**

It's my son's Spring Break and Axe_con, so there's an added challenge.

- Continue Job Search.
- Continue new project.
- Blog.
- Yard work.
- Attend Axe-Con Wed and Thursday.

**This Month's Goals**
- Gain more followers here. I would like to have more followers on DEV than I had on the bird site. 


You've read my goals so I'll throw that question back to you.

What are your goals for the week?

```
-$JarvisScript git push
```