teleren/devto huggingface dataset:
Getting the Traceback as a String in python
Published: 2023-10-19 05:19:23

When Python encounters an error, it produces a treasure trove of error information called the traceback. The traceback includes the error message, the line number of the line that caused the error, and the sequence of the function calls that led to the error. This sequence of calls is called the call stack. Open a new file editor window in IDLE, enter the following program, and save it as error.py
```

def spam():
    bacon()
def  bacon():
    raise Exception('This is the  error message.')

spam()
    

```


When you run error.py, the output will look like this

```
Traceback (most recent call last):
  File "/home/tommi087/Desktop/Development/code/phase-3/Automatingstuff/debugging/ErrorExample.py", line 6, in <module>
    spam()
  File "/home/tommi087/Desktop/Development/code/phase-3/Automatingstuff/debugging/ErrorExample.py", line 2, in spam
    bacon()
  File "/home/tommi087/Desktop/Development/code/phase-3/Automatingstuff/debugging/ErrorExample.py", line 4, in bacon
    raise Exception('This is the  error message.')
Exception: This is the error message.
```
The traceback is displayed by Python whenever a raised exception goes unhandled. But you can also obtain it as a string by calling traceback.format_exc(). This function is useful if you want the information from an exception’s traceback but also want an except statement to gracefully handle the exception. You will need to import Python’s traceback module before calling this function. For example, instead of crashing your program right when an exception occurs, you can write the traceback information to a log file and keep your program running. You can look at the log file later when you’re ready to debug your program. Enter the following into a new file called errorExample.py:

```
import traceback

try:
    raise Exception('This is the error message.')
except:
    errorFile = open('errorInfo.txt', 'w')
    errorFile.write(traceback.format_exc())
    errorFile.close()
    print('The traceback info was  written to  errorInfo.txt.')
```
This will be the output when the file is executed.

```
The traceback info was  written to  errorInfo.txt.
```
Completed Successfully Hactoberfest 23' :) #hactoberfest2023 #opensource #digitalocean
Published: 2023-10-19 05:18:30

🚀 Exciting News! 🎉 I've successfully completed #Hacktoberfest 2023! 🌟

It's been an incredible journey throughout this month, contributing to open source projects, collaborating with fellow developers, and learning so much along the way. 🖥️💡

I'd like to express my gratitude to the open source community for providing such amazing opportunities. It's heartwarming to see the collective effort put into making the digital world a better place. 🌐

Here are a few highlights from my #Hacktoberfest2023 experience:

🌐 Contributions: I had the privilege of contributing to various projects, from improving documentation to fixing bugs and adding new features. The feeling of knowing that my code can help someone, somewhere, is truly fulfilling.

🤝 Collaboration: The beauty of open source is the sense of camaraderie and collaboration. I've met wonderful people from different corners of the world, all united by a shared passion for technology.

📚 Learning: Every pull request was a learning opportunity. I've honed my coding skills, explored new technologies, and enhanced my problem-solving abilities.

🌟 Recognition: Getting that pull request merged and those green squares on my GitHub profile was indeed rewarding. It's a tangible measure of progress.

🙏 Thank you to @digitalocean_staff  and GitHub for organizing #Hacktoberfest, and thanks to the maintainers of open source projects for their dedication and guidance.

If you're new to open source, I highly recommend participating in future #Hacktoberfest events. It's a fantastic way to give back to the community, improve your skills, and connect with like-minded individuals.

Let's continue the spirit of open source and collaboration all year round! 

🌎💬 #OpenSource #Programming #Contributions #Community #Coding #HacktoberfestCompleted
Driving Innovation and Growth with SAP Analytics Cloud
Published: 2023-10-19 05:05:06

**Real-Time Data Analysis:** SAC empowers organizations to make data-driven decisions in real-time. This capability is crucial for innovation, as it allows companies to quickly identify emerging trends and customer preferences. By harnessing real-time data, businesses can tailor their products and services to meet evolving customer needs, fostering innovation.

**Predictive Analytics:** Predictive analytics is at the heart of innovation. SAC leverages machine learning and predictive modeling to anticipate future trends, helping organizations identify growth opportunities and potential risks. This proactive approach allows companies to stay ahead of the curve.

**Integration of Data Sources: **Innovation often involves thinking outside the box and combining data from various sources. SAC provides the flexibility to integrate data from multiple sources, including on-premises and cloud-based systems. This comprehensive view enables businesses to uncover new insights and opportunities that can drive growth.

[SAP Analytics Cloud Consulting](https://vizioconsulting.com/sap-analytics-cloud-consulting-services/) is a powerful platform that empowers organizations to drive innovation and growth. By providing real-time data analysis, predictive analytics, collaborative decision-making, and a user-friendly interface, SAC equips businesses to make data-driven decisions that spur innovation.
Effect Days conference on Feb 23, 2024 in Vienna
Tags: effect, typescript, effectdays
Published: 2023-10-19 05:00:07

Join us for the first-ever Effect Days conference on Feb 23, 2024 in Vienna. 

Only 100 tickets available!

In addition to the conference day, we're also hosting a hands-on Effect workshop on Feb 22nd. 

Get your ticket and secure your spot now 🎟️
https://effect.website/events/effect-days
ALINGNMENT KING AUTO SERVICES
Published: 2023-10-19 04:36:11

Are you tired of constantly googling reliable car mechanic in Calgary? Look no further than Alignment King. We pride ourselves on delivering quality service to every customer who walks through our doors. Our team of highly trained technicians is dedicated to ensuring your vehicle runs smoothly and safely on the roads. With state-of-the-art technology and the latest equipment, we provide expert diagnostics and repairs for all makes and models. At Alignment King, we understand the importance of transparency and trust, which is why we prioritize clear communication with our customers. Your satisfaction is our top priority. Don't wait any longer; book your appointment today and experience the Alignment King difference.

Visit: https://www.alignmentking.ca/

Email : alignmentkingauto@hotmail.com

Phone : 4036171461

Address : UNIT #8 2180 PEGASUS WAY NE UNIT 8, CALGARY, Alberta, T2E 8M5, CANADA
789winclubco - Link vào nhà cái mới nhất 2023
Published: 2023-10-19 04:22:45

789win 789winclubco là một trong những nhà cái cá cược trực tuyến hàng đầu trên thị trường đang thu hút sự chú ý của người chơi từ khắp nơi trên thế giới. Với hơn một thập kỷ hoạt động trong ngành, 789win đã xây dựng được một danh tiếng vững chắc và uy tín không thể phủ nhận.
789win nổi tiếng với sự đa dạng trong các loại cược, từ thể thao đến casino trực tuyến và game bài. Người chơi có thể thỏa sức đặt cược trên các sự kiện thể thao hàng đầu từ khắp nơi trên thế giới, bao gồm cả các giải đấu lớn như bóng đá, tennis, bóng rổ và nhiều môn thể thao khác. Hệ thống cá cược đa dạng và linh hoạt cho phép bạn lựa chọn cược theo sở thích cá nhân, đảm bảo bạn luôn có nhiều cơ hội để thắng lớn.
Nếu bạn yêu thích sòng bạc, 789win cung cấp một trải nghiệm casino trực tuyến đỉnh cao. Bạn có thể tham gia vào các trò chơi phổ biến như blackjack, roulette, baccarat và nhiều trò chơi slot hấp dẫn. Với giao diện thân thiện và những người chia bài chuyên nghiệp, bạn sẽ có cảm giác như đang ở trong một sòng bạc thực sự ngay tại nhà.
789win cam kết đảm bảo an toàn và bảo mật cho dữ liệu cá nhân và tài khoản của người chơi. Họ sử dụng công nghệ mã hóa tiên tiến để đảm bảo rằng mọi giao dịch và thông tin cá nhân đều được bảo vệ một cách tối đa. Điều này giúp người chơi yên tâm tận hưởng trải nghiệm cá cược mà không phải lo lắng về vấn đề bảo mật.
789win hiểu rằng hỗ trợ khách hàng là rất quan trọng. Họ cung cấp dịch vụ chăm sóc khách hàng 24/7 thông qua chat trực tuyến, email và điện thoại để đảm bảo rằng bạn luôn có sự hỗ trợ khi cần.
789win đã chứng minh mình là một lựa chọn đáng tin cậy cho người chơi cá cược trực tuyến với sự đa dạng trong cược, trải nghiệm casino sôi động, và cam kết đảm bảo an toàn. Nếu bạn đang tìm kiếm một nhà cái uy tín để tham gia vào thế giới cá cược trực tuyến, 789win là sự lựa chọn hàng đầu mà bạn không nên bỏ lỡ.
Địa chỉ: 111/4/13 Đ. Vườn Lài, Phú Thọ Hoà, Tân Phú, Thành phố Hồ Chí Minh
Postcode: 760516
SDT: (+63) 945377459
Email:789winclubco@gmail.com
Website: https://789winclub.co
#789win#789winlink #789winapk #Code789win #789winweb
 
Social Links:

https://www.facebook.com/789winclubco/

https://www.pinterest.ph/789winclubco/

https://500px.com/p/789winclubco?view=photos

https://www.youtube.com/@789winclubco

https://www.reddit.com/user/789winclubco

https://www.blogger.com/profile/04017384140147639539

https://789winclubco.blogspot.com/

https://www.tumblr.com/789winclubco

https://bbs.now.qq.com/home.php?mod=space&uid=5925736

https://linktr.ee/789winclubco

https://www.twitch.tv/789winclubco/about

https://ok.ru/winclubco789/statuses/156612844730419

https://profile.hatena.ne.jp/winclubco789/profile

https://issuu.com/789winclubco

https://www.liveinternet.ru/users/winclubco789/

https://dribbble.com/789winclubco/about

https://about.me/winclubco789/

https://ko-fi.com/789winclubco

https://www.provenexpert.com/789win-clubco/

https://hub.docker.com/u/789winclubco

https://independent.academia.edu/789winclubco

https://profile.ameba.jp/ameba/789winclubco

https://sketchfab.com/789winclubco
What is Private field in JS (JavaScript)
Tags: webdev, javascript, programming, typescript
Published: 2023-10-19 04:20:55

In JavaScript, the term "private field" typically refers to a concept related to encapsulation and access control in object-oriented programming. JavaScript traditionally lacked native support for private members in classes, but with the introduction of ECMAScript 2015 (ES6) and subsequent versions, private fields and methods became possible.

in easy language, In JavaScript, a "private field" is like having a secret inside a special box. Imagine you have a box, and you want to keep something hidden inside it so that others can't mess with it. That hidden thing is a private field.

Private fields are used to encapsulate data within a class, making it accessible only from within that class. They are declared using the `#` symbol as a prefix to the field name. Here's a simple example:

```javascript
class MyClass {
  #privateField;

  constructor(value) {
    this.#privateField = value;
  }

  getPrivateField() {
    return this.#privateField;
  }

  setPrivateField(newValue) {
    this.#privateField = newValue;
  }
}

const myObject = new MyClass(42);

console.log(myObject.getPrivateField()); // Output: 42
myObject.setPrivateField(99);
console.log(myObject.getPrivateField()); // Output: 99
console.log(myObject.#privateField); // Error: Private field '#privateField' must be declared in an enclosing class
```

In this example, `#privateField` is a private field of the `MyClass` class. It can only be accessed or modified from within the class methods. If you try to access it directly from outside the class, an error will occur.

Private fields help in achieving encapsulation, which is an important principle in object-oriented programming. Encapsulation involves bundling the data (fields) and methods (functions) that operate on the data within a single unit, i.e., a class. This helps in hiding the internal details of the class and exposing only the necessary functionalities.

It's worth noting that private fields are a feature of modern JavaScript, and older browsers or environments may not support them. Always consider the target environment when using language features introduced in newer specifications.

Thank you for reading. I encourage you to follow me on Twitter where I regularly share content about JavaScript and Typescript, as well as contribute to open-source projects and learning Typescript. I am currently seeking a remote job or internship.

Twitter: https://twitter.com/Diwakar_766

GitHub: https://github.com/DIWAKARKASHYAP

Portfolio: https://diwakar-portfolio.vercel.app/
From dropout to developer.
Tags: webdev, motivation, career
Published: 2023-10-19 04:13:53

**2018**
A college dropout, broke, in debt, completely clueless about life.

**2023**
A well-paid Software Engineer, helping others learn to code.

Here is what made it possible:

**1/ Willingness To Learn**

I was/am always willing to learn.

Don't see challenges as obstacles but an opportunity to learn new things.

Growth mindset, not fixed mindset.

**2/ Building Social Presence**

I had an active blog from the beginning, even when I was just learning.

Don't wait to learn everything before you show your skills to the world.

Have a blog from the start.

You won't believe how many opportunities I have received just because of my blog.

Building a social presence doesn't mean having 1000s of followers. You are just putting your work out in the world.

(My blog: https://swastikyadav.com)

**3/ Law Of Average**

The more you do something, more are the chances of you getting the desired result.

A friend of mine (whom I taught to code) literally gave 500+ interviews before he finally got selected.

Each failure takes you closer to success.

**4/ Community**

There were times when I felt like giving up but being in a community of dedicated learners helped me keep going.

Collaboration not Competition.

–––––––––––––––––––––––

Was it easy? Not at all.
If there is a secret that I learned through my experience then it is this:

Consistency + Intensity

–––––––––––––––––––––––

Thanks a lot for reading.

If you liked this
1. Follow me on [X (Twitter)](https://twitter.com/swastikb380) and [LinkedIn](https://www.linkedin.com/in/swastikyadav/)

See you next time with more valuable life and developer lessons.
- Swastik Yadav
3 Easy Morning Habits in 3 Minutes
Tags: productivity, habits, mentalhealth, beginners
Published: 2023-10-19 04:10:39

Starting a new habit can be difficult, especially when and where to get started. Having tried a variety of habits over the years, below are three morning habits that have helped started my journey toward a better lifestyle.

In the morning, I would

1. **Drink Water**
When I wake up, I often feel dehydrated and need to drink some water. Having a bottle or cup of water beside your bed can prompt you to drink water and also wake you up as you struggle to fight off the urge to back to sleep. 

2. **Wash your Face**
I don’t know about you but I often need to use the bathroom when I wake up. After that, I already feel I need to wash my hands. Here is the perfect opportunity to put water and soap on your face and begin washing. Nothing like a cold splash of water to shock you.

3. **Write an X**
One thing that most people forget when setting a new habit is rewarding yourself for doing them. Writing an X right after drinking water or washing your face can provide a fun, visual way to see your progress. For every set of habits you do, write an X on a nearby piece of paper, in a journal, or even on your phone. 

While these habits seem small and not very important, they are easy to start with and can lead to more impactful habits that I’ve discovered later on this journey. 

Readers, what are some small habits that already got you started on your own journey?
Llama 2 in Apple Silicon Macbook (3/3)
Published: 2023-10-19 04:02:31

This chapter is testing the Llama 2 easily.

I am going to deploy web service using FastAPI and Llama 2.

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

# Run web server

```
git clone https://github.com/choonho/llama_server.git

cd llama_server
pip3 install llama-cpp-python langchain
pip3 install fastapi uvicorn
```
# Prepare Llama 2 model file

In step 2, we created Llama 2 model file, copy to "models/7B/ggml-model-q4_0.bin"

# Run Server

```
python3 server.py
```

# Test (Q&A)

Open the web browser, https://localhost:8000/docs

FastAPI provides easy way to test API.


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

Click "Try it out"


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

In the "Request body", ask your question.



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

# Series
Llama 2 in Apple Silicon Bacbook (1/3)
https://dev.to/choonho/llama-2-in-apple-silicon-macbook-13-54h

Llama 2 in Apple Silicon Bacbook (2/3)
https://dev.to/choonho/llama-2-in-apple-silicon-macbook-23-2j51

Llama 2 in Apple Silicon Bacbook (3/3)
https://dev.to/choonho/llama-2-in-apple-silicon-macbook-33-3hb7
SQL Query Interview Questions and Answers for Practice
Tags: sql, mysql, tutorial, programming
Published: 2023-10-19 03:46:45

## Question No. 1
Suppose you have a database for an online store with two tables: Customers and Orders. The Customers table contains customer information, including customer_id, customer_name, and customer_email. The Orders table contains order information, including order_id, customer_id (which is a foreign key linking to the customer_id in the Customers table), and order_date.

Write an SQL query to retrieve the names and email addresses of customers who have placed an order in the year 2023. Your query should include a JOIN operation to connect the two tables and a WHERE clause to filter the results.

### Solution - 
```sql
-- Create the Customers table
CREATE TABLE Customers (
    customer_id INT PRIMARY KEY,
    customer_name VARCHAR(255),
    customer_email VARCHAR(255)
);

-- Create the Orders table
CREATE TABLE Orders (
    order_id INT PRIMARY KEY,
    customer_id INT,
    order_date DATE,
    FOREIGN KEY (customer_id) REFERENCES Customers(customer_id)
);

-- Insert sample data into the Customers table
INSERT INTO Customers (customer_id, customer_name, customer_email)
VALUES
    (1, 'Pankaj Chouhan', 'pankaj@codeswithpankaj.com'),
    (2, 'Nishant Chouhan', 'nishant@codeswithpankaj.com'),
    (3, 'Kiran Johnson', 'kiran@codeswithpankaj.com');

-- Insert sample data into the Orders table
INSERT INTO Orders (order_id, customer_id, order_date)
VALUES
    (101, 1, '2023-03-15'),
    (102, 2, '2023-04-10'),
    (103, 1, '2023-05-20'),
    (104, 3, '2022-12-05'),
    (105, 2, '2023-08-30');

-- Retrieve the names and email addresses of customers who placed an order in 2023
SELECT c.customer_name, c.customer_email
FROM Customers c
JOIN Orders o ON c.customer_id = o.customer_id
WHERE YEAR(o.order_date) = 2023;

```
Output:

```sql
+--------------------+-----------------------------+
| customer_name      | customer_email              |
+--------------------+-----------------------------+
| Pankaj Chouhan     | pankaj@codeswithpankaj.com  |
| Nishant Chouhan    | kiran@codeswithpankaj.com   |
+--------------------+-----------------------------+
```
投資教育専門家小野 正裕のキャリア
Tags: 小野正裕
Published: 2023-10-19 03:39:03

小野正裕
Ono Masahiro

1975年（昭和50年）生まれ、
出身地：名古屋市   現住所：東京都千代田区

学歴：日本東京大学経済学部卒業
2002年ケンブリッジ大学(博士号取得)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8tfceqgawj1dzn9z0q3d.jpeg)
仕事の経歴：ケンブリッジ大学卒業後、米国フィデリティ・インベストメンツ(Fidelity Investments Inc.)に入社し、フィデリティ退職と投資教育研究所ディレクターを務めました。 各種アンケートや統計データを用い、定年後の運用資産の扱い方を運用面だけでなく、仕事や移住など様々な側面から分析し、啓蒙活動を行いました。 その後、CMA、証券経済学会、行動経済学会の会員を歴任しました。 
海外では、米国、英国に加え、彼はアジア金融市場にも業務を拡大しています。

2006年みずほ銀行（現瑞穗銀行）に入行し、日本の金融業界で20年近い経験を有しています。主に日本の政府系ファンド、信託、債券、株式市場において、営業からトレーディングまで様々なマーケット関連の総合職に携わります。 
2008年に国内外の金融機関と格付け機関で金融研究に従事しました。機関投資家志のグローバルアナリストランキングでは、銀行業でトップにランクされています。政府デジタル調査暫定行政委員会、金融制度委員会、規制改革円滑化委員会、中小企業庁金融サービス小委員会、ロンドン証券取引所金融サービス機構アドバイザーグループ（LSEG）の委員を歴任しました。

アメリカで働いて生活している間に、大量の投資教育と退職基金の合理的な使用方法などの面での仕事経験を蓄積し、アメリカの裕福な投資在任中にベンチャーキャピタルとヘッジファンドのために年金基金、機関投資家と超高純の個人にマーケティング、製品開発とコンサルティングを提供しました。
在任中にも異なる金融機関間の友人と知り合い、比較的広い人脈と業界資源を蓄積し、資本と経済市場の運営規則に精通しました。 また、各種類の金融投資市場にも精通し、投資市場に対して嗅覚が鋭く、豊富な資産管理経験を持っています。 投資技術において、ギャン理論、Boll指標、SMAチャート型分析などの技術分析に対して高い造詣と研究があり、市場動向の研究は非常に専門的です。
Invalid CMake cache in Flutter
Published: 2023-10-19 03:25:52

AndroidStudio - and `flutter build` - gave me this error on an FFI project:

```
"../poc/flutter-native-arrays/example/linux/CMakeLists.txt" does not match the source  ".../poc/flutter-native-arrays/linux/CMakeLists.txt" 
```

It seems like invalid cache.
* `flutter clean` did **not** help
* _Invalidate Caches_ in AndroidStudio did **not** help

What did help was:
* deleting the **build** directory from the project
🚀 API Maker - Database migration
Published: 2023-10-19 03:15:54

##⭐ List of Feature ⭐


✅ Maintain state of database
 ▸ Useful for maintain particular state of database.


✅ Why database migration ?
▸ when we deploy code across different environments, introduce a new feature to our application, or change any table or field of database.
▸ For accomplishing all of this stuff, it is necessary.


✅ Learn only Java-script 
▸ API Maker migration uses simple java-script code to perform all the migration tasks for us. We don't need to learn any extra database language for it.


✅ N-number of migration script 
▸ API Maker allows users to create, update and delete multiple migration scripts with ease and without any limitation.


✅ Copy - paste script
▸ Users can easily copy and paste their database queries from some popular or well known database GUI tools.


✅ Leverage all AM feature
▸ The user can leverage all the APIs of API Maker as user can do in custom APIs code.


✅ Debugging & Testing
▸ User can debug & modify code using testing framework.


✅ More specific details
 ▸ User can see the list of all migration script, with single click of execute script functionality.


----------------------------------



## Youtube video link
https://youtu.be/06yObrVADd0


## Websites
https://apimaker.dev


## API Docs link
https://docs.apimaker.dev/v1/docs/features/database-migration.html


## Follow on twitter
https://twitter.com/api_maker


## Linked In
https://www.linkedin.com/company/api-maker