teleren/devto huggingface dataset:
Reverse engineering C code with Cflow - GNU project (to trace back calling)
Tags: reverse, coding, programming, hackathon
Published: 2024-01-14 17:42:09

Install the program in Linux (Ubuntu used for this test case) using the below command:

```bash
apt search cflow
sudo apt install cflow
```

After this, go to the specific project folder. To run the analysis, you can run the following command.
```bash
cflow --verbose --tree main.c
```

In this example, we can analyze `main.c`. Changing the file name allows us to check other files as well. The output is printed on ASCII tree format with quality details. Now, you can use this information to draw on the software design applications such as PlantUML or StarUML manually if you would like to have a graphical presentation of your reverse analyzed C code.

Here's the example printout:

```bash
+-main() <int main (int argc, char *argv[]) at main.c:26>
  +-printf()
  +-serial_open()
  +-WitInit()
  +-WitRegisterCallBack()
  +-SensorDataUpdata() <void SensorDataUpdata (uint32_t uiReg, uint32_t uiRegNum) at main.c:100>
  +-AutoScanSensor() <void AutoScanSensor (char *dev) at main.c:142>
  | +-serial_close()
  | +-serial_open()
  | +-WitReadReg()
  | +-Delayms() <void Delayms (uint16_t ucMs) at main.c:136>
  | | \-usleep()
  | +-serial_read_data()
  | +-WitSerialDataIn()
  | \-printf()
  +-serial_read_data()
  +-WitSerialDataIn()
  +-Delayms() <void Delayms (uint16_t ucMs) at main.c:136>
  | \-usleep()
  \-serial_close()
```

The source is from Linux C SDK for Witmotion IMU sensor. Here's the link for documentation: [https://support-73.gitbook.io/witmotion-sdk/wit-standard-protocol/](https://support-73.gitbook.io/witmotion-sdk/wit-standard-protocol/)
GitHub Commits Color Scheme: Lets commit to commit.
Tags: github, commit, githubcommits, organize
Published: 2024-01-14 17:36:08



![Color Scheme for GitHub Commits](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7kus1y1frt03ev54mj01.png)

After spending nights searching for ways to make my GitHub commits look better, I realized I should just create my own solution.

   The most important thing is committing to commit. 

It's also important to consider the brightness of the color scheme and the number of commits needed. After an hour, I had the color scheme for GitHub commits. I did it so you won't have to.

- light color   === 3 - 6  commits
- medium color  === 9 - 12 commits
- darker color  === 15 -18 commits
- the DARKEST   === anything over 20 commits

some of the examples of what you can make:

![pixel GitHub love](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/64yf9reh7jhiqdnn3fpl.png)

![pixel GitHub animals](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zt2zti7il9w753yv0zi7.png)

Let's prettify together!!!
Setting Up RubyMine with asdf in a WSL Environment
Tags: rubymine, wsl, ruby
Published: 2024-01-14 17:29:41

1. Open the "Settings" menu.
2. Navigate to "Languages & Frameworks > Ruby SDK and Gems."
3. Click the "+" button.
4. Choose "Remote Interpreter or Version Manager".
5. Select WSL.
6. In the Linux Distribution section, choose your preferred distribution.
7. In the Ruby or version manager path, add the following: "/home/`<user>`/.asdf/installs/ruby/3.3.0/bin/ruby".
PQ vs SET
Published: 2024-01-14 17:22:36

Understanding time complexity of Dijkstra priority queue vs set vs queue-->

Dijkstra's Algorithm using Priority Queue:
vector dijkstra(int V, vector> adj[], int S) {
priority_queue, vector>,
greater>> pq;
vector distTo(V, INT_MAX);
distTo[S] = 0;
pq.push({0, S});
while (!pq.empty()) {
int node = pq.top().second;
int dis = pq.top().first;
pq.pop();
for (auto it : adj[node]) {
int v = it[0];
int w = it[1];
if (dis + w < distTo[v]) {
distTo[v] = dis + w;
pq.push({dis + w, v});
}
}
}
return distTo;
}

Dijkstra's Algorithm using Set:
vector dijkstra(int V, vector> adj[], int S) {
set> st;
vector dist(V, 1e9);
st.insert({0, S});
dist[S] = 0;
while (!st.empty()) {
auto it = *(st.begin());
int node = it.second;
int dis = it.first;
st.erase(it);
for (auto it : adj[node]) {
int adjNode = it[0];
int edgW = it[1];
if (dis + edgW < dist[adjNode]) {
if (dist[adjNode] != 1e9)
st.erase({dist[adjNode], adjNode});
dist[adjNode] = dis + edgW;
st.insert({dist[adjNode], adjNode});
}
}
}
return dist;
}
Comparison:

Data Structure Used:
The first version uses a priority_queue to efficiently extract the minimum distance node.
The second version uses a set to maintain nodes in ascending order based on distances.

Complexity:
The first version (with the priority queue) usually has better time complexity in practice as compared to the second version.
The second version has a higher time complexity due to the overhead of searching and erasing elements from the set.

Code Length:
The first version is generally more concise and easier to read.
The second version involves more lines of code, mainly due to handling set operations.

Efficiency:
The first version is generally more efficient for large graphs due to the efficient extraction of the minimum element from the priority queue.
The second version may be less efficient for large graphs due to the overhead of set operations.

In conclusion, while both versions implement Dijkstra's algorithm, the version using the priority queue is typically more efficient and concise. The version using the set might be useful in certain scenarios or for educational purposes, but for practical implementations, the version with the priority queue is often preferred.
Priority Queue vs Set
Tags: cpp, dsa, graphs
Published: 2024-01-14 17:18:43

**Understanding time complexity of Dijkstra priority queue vs set vs queue-->**

Dijkstra's Algorithm using Priority Queue:
vector<int> dijkstra(int V, vector<vector<int>> adj[], int S) {
    priority_queue<pair<int, int>, vector<pair<int, int>>, 
    greater<pair<int, int>>> pq;
    vector<int> distTo(V, INT_MAX);
    distTo[S] = 0;
    pq.push({0, S});
    while (!pq.empty()) {
        int node = pq.top().second;
        int dis = pq.top().first;
        pq.pop();
        for (auto it : adj[node]) {
            int v = it[0];
            int w = it[1];
            if (dis + w < distTo[v]) {
                distTo[v] = dis + w;
                pq.push({dis + w, v});
            }
        }
    }
    return distTo;
}

Dijkstra's Algorithm using Set:
vector<int> dijkstra(int V, vector<vector<int>> adj[], int S) {
    set<pair<int, int>> st;
    vector<int> dist(V, 1e9);
    st.insert({0, S});
    dist[S] = 0;
    while (!st.empty()) {
        auto it = *(st.begin());
        int node = it.second;
        int dis = it.first;
        st.erase(it);
        for (auto it : adj[node]) {
            int adjNode = it[0];
            int edgW = it[1];
            if (dis + edgW < dist[adjNode]) {
                if (dist[adjNode] != 1e9)
                    st.erase({dist[adjNode], adjNode});
                dist[adjNode] = dis + edgW;
                st.insert({dist[adjNode], adjNode});
            }
        }
    }
    return dist;
}
Comparison:

Data Structure Used:
The first version uses a priority_queue to efficiently extract the minimum distance node.
The second version uses a set to maintain nodes in ascending order based on distances.

Complexity:
The first version (with the priority queue) usually has better time complexity in practice as compared to the second version.
The second version has a higher time complexity due to the overhead of searching and erasing elements from the set.

Code Length:
The first version is generally more concise and easier to read.
The second version involves more lines of code, mainly due to handling set operations.

Efficiency:
The first version is generally more efficient for large graphs due to the efficient extraction of the minimum element from the priority queue.
The second version may be less efficient for large graphs due to the overhead of set operations.

In conclusion, while both versions implement Dijkstra's algorithm, the version using the priority queue is typically more efficient and concise. The version using the set might be useful in certain scenarios or for educational purposes, but for practical implementations, the version with the priority queue is often preferred.
LibreCounter Stats
Tags: stats, analytics, website, webdev
Published: 2024-01-14 17:15:00

Do you have an open source website hosted on GitHub pages or GitLab pages, and want to have some basic website analytics? Are you tired of Google Analytics and similar stats packages that force you to add a cookie warning? I want to present to you my latest project: LibreCounter skips all that with its dead-simple stats, one-line installation on your favorite site.

I created LibreCounter because I was fed up with Google Analytics, its bizarre interface and its inane antics. Also, I didn't want to have a cookie warning as if _I_ was collecting info about my visitors.

LibreCounter provides free, libre and open website statistics. GDPR compliant: no cookies, no tracking done in the browser, no IP addresses stored, no marketing or advertising done (or even possible). LibreCounter provides website traffic analysis and statistics for free at librecounter.org.

How to Use: Simply add the following snippet to your website, in all pages that you want analyzed:

```
<a href="https://librecounter.org/referer/show">
<img src="https://librecounter.org/counter.svg" referrerPolicy="unsafe-url" />
</a>
```

After that stats will be collected for every page view, and users clicking on the logo will be taken to `https://librecounter.org/[site]/show`, replacing `[site]` with your domain name. Stats will be public for all your visitors to see.

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

Compliant with the most stringent EU [ePrivacy directive](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX%3A32002L0058).
Throw away your code
Tags: programming, javascript, development, beginners
Published: 2024-01-14 16:59:46

_"Throw away your code if you can't implement the feature in a day"_ - Toni Lütke, **Shopify CEO**

When I first heard this phrase in conjunction with the claim it helped Toni write the best code he has ever written during the early days of building the Shopify platform, I was confused. 

I've had many features that have taken days and days, sometimes weeks, to implement... line after line of code. Toni's approach was very different, if you can't complete the implementation in a day - delete the source code, leaving behind the unit tests and try again tomorrow. 

I stared at my phone, the reel repeating itself over and over again, trying to understand the comment. As I mulled over the phrase it began to make a lot of sense. 

The idea is creating a time limit to write the code and forcing yourself to start again if you exceed the limit. Limiting the time limits the amount of code you can write, resulting in more efficient code being written. Throwing away code forces you to write better code. 

It's a fascinating concept and I'm looking forward to trying it out, will I improve the code that I write. 

What are your thoughts on this concept?
Hows Yours Weekends 😁
Tags: discuss, weekends
Published: 2024-01-14 16:40:07

Hi 👋, This post is little casual how's your weekends?

Mine is quick and Short weekend, huh? 😁 Getting set for Monday morning – gearing up for the week?

### How about yours ?

```
                   Tell in comments.
```

---

![Image](https://media.giphy.com/media/3ov9jRt4tz63NQwRSU/giphy.gif)
Yoast Set Up Errors - SEO Data Optimization
Published: 2024-01-14 16:22:30

For a couple of days, I have been having some errors while setting up Yoast and running the SEO Data Optimization. Even ChatGPT couldn't help!

Digged deeper, checked the Chrome Deev Tools Network tab, and found that it was a not found error. It could not resolve a 'prepare' route.

Decided to set up my WP permalinks to `Post name` and that solved the issue!

I hope this helps someone out there facing same issue.
Query Performance Optimization in PostgreSQL and AGE
Tags: postgres, apacheage, age
Published: 2024-01-14 15:47:51

PostgreSQL's **pg_stat_statements** extension is a powerful tool for database administrators and developers, offering insights into executed SQL statements to aid in query performance analysis. This article explores the setup and utilization of **pg_stat_statements** to identify and optimize poorly performing SQL queries, ultimately enhancing the overall performance of your PostgreSQL database.

**Introduction**
Query performance is a critical aspect of any database system, and PostgreSQL provides the **pg_stat_statements** extension to track and analyze SQL statements executed on the server. This extension collects valuable information about query execution, allowing administrators to identify bottlenecks and optimize queries for improved database performance.

**Setting Up pg_stat_statements**
**Enabling the Extension:**
Modify postgresql.conf:
Open the postgresql.conf file and add or uncomment the following line:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1bkl1ujeq64xs054vd1m.png)
**Restart PostgreSQL:**
Restart the PostgreSQL server to apply the changes.

**Creating Extension:**
Connect to the database and create the extension:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qkwi31tbblvo7obwdawm.png)
**Utilizing pg_stat_statements for Query Performance Analysis**
**Key Aspects to Explore:**
**Viewing Statistics:**
Access pg_stat_statements view to see statistics about executed queries:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uampalaeaiiln9107fb3.png)
**Analyzing Execution Counts:**
Identify frequently executed queries:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aqlwtqly3g299syboeh9.png)
**Identifying Slow Queries:**
Find queries with longer execution times:

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

**Refernces:**

[https://www.postgresql.org/docs/current/pgstatstatements.html](https://www.postgresql.org/docs/current/pgstatstatements.html)
My Story
Published: 2024-01-14 15:45:35

Boardroom whispers followed me like wind in the canyons. They saw a rookie, fueled by ramen and code, not the data-driven maverick who’d alchemized a startup into a billion-dollar dream. Vantage Plus, a titan burdened by its own history, was my Everest. Aviation giants, drowning in inefficiencies, whispered for AI oracles to predict turbulence and guide their fleets. Fintech, bruised by fraud and friction, craved the swift blade of AI to slice through financial shadows.

Forget boring boardroom jargon. I spoke in symphonies of algorithms, breaking down silos like walls under a wrecking ball. Marketing became a laser tango, data the music guiding us to customers’ hearts. Production lines, once sluggish beasts, danced with new efficiency, every movement a finely tuned note.

But this wasn’t just about numbers on a screen. It was about stories — pilots landing safely, families buying their dream homes, students learning at their own pace. Sustainability became our mantra, data the lens through which we saw not just profit, but our impact on the world.

This isn’t just Vantage Plus’s story; it’s a revolution waiting to unfold. I empower CEOs, not with fancy titles, but with the tools to see through the fog and unlock the potential buried within their data. It’s an invitation to join the orchestra, to wield data as a brush painting a brighter future.

The future is a blank canvas, and I, the data-driven artist, hold the brush. But this symphony needs more players. CEOs, visionaries, dreamers like you. Are you ready to take the stage, to make your mark on the world, one byte at a time?

Let’s rewrite the future, together. Data is the rhythm, AI the conductor, and humanity the harmony that binds us all. So, pick up your instrument, raise your voice, and let the music begin.

Best Regards & All the best for everyone who consumed his time while reading through My Story.

W. Jadoon

CEO — Vantage Plus

www.vantageplusanalytics.com
SaaS Landing Page
Tags: webdev, design, beginners, productivity
Published: 2024-01-14 15:24:22


do you want design free then contact me

📩 Simply comment your email id and send me a [LinkedIn](https://www.linkedin.com/in/danialhabib/) connection request, and I'll promptly provide you with access to the design.



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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n0lgmskgeufoyebmp77a.png)
Request Management and Variables in Postman
Tags: apitesting, postman, softwaretestinginsights, beginners
Published: 2024-01-14 14:57:50

🔍🚀Exploring API Testing Essentials with Postman!

👩‍💻 In the world of API testing, mastering tools like Postman is a game-changer. Today, let's unravel key aspects like saving requests, utilizing variables, and decoding query parameters.

💡🌐It's a journey where precision meets flexibility. Ready to dive in? Let's make API testing a breeze!
**
Saving Requests**
The key to handling requests efficiently is to create collections.

Before saving a request in Postman, you must start a collection.

These collections act as organized repositories, designed for a specific API or customized for a specific purpose.

Imagine them as carefully curated libraries that contain the complex interactions of APIs, guaranteeing a methodical approach to testing.
**
Storing and Creating Variables**
To improve our testing skills, we can utilize variables.

We start by emphasizing the base URL, which is an essential part of any API request.

By simply clicking on the 'set variable' button, Postman enables us to effortlessly create and store variables within the collection.

This not only makes the testing process more efficient but also provides us with the ability to modify variables as required.
**
Modifying Collection Variables**
In the ever-changing world of testing, being adaptable is crucial.

Postman understands this and offers a convenient way to modify collection variables.

By going directly to the collection, we can make instant changes, ensuring that our testing environment stays flexible and responsive to changing needs.
**
Query Parameters**
As we explore the API landscape, query parameters play a vital role in exchanging data.

The use of a question mark indicates the start of query parameters, and it is important to consider their sensitivity to uppercase and lowercase letters.

Postman, acting as the messenger, sends only the specific parameter category to the API.

Behind the scenes, the API utilizes this parameter to filter through the data.
The Importance of Hiring a Professional Tile Contractor
Published: 2024-01-14 15:05:05

San Francisco, CA is known for its stunning architecture and beautiful homes, and one of the key elements that makes these properties stand out is the use of tiles. From kitchen backsplashes to bathroom floors, tiles can add a touch of elegance and sophistication to any space.
If you're considering a tile project for your home in San Francisco, CA, it's important to hire a professional tile contractor. Here's why:
1. Expertise and Experience: A professional tile contractor has the knowledge and experience to handle any type of tile project. They have the skills to properly measure, cut, and install tiles, ensuring a flawless finish.
2. Quality Materials: Professional tile contractors have access to high-quality materials that are not readily available to the general public. This means you can expect your tiles to be durable and long-lasting.
3. Time and Cost-Efficient: Attempting a tile project on your own can be time-consuming and costly. A professional tile contractor can complete the job efficiently and effectively, saving you time and money in the long run.
4. Proper Tools and Equipment: Tile installation requires specific tools and equipment that professional contractors have on hand. This ensures that the project is done correctly and with precision.
5. Design Expertise: A professional tile contractor can also provide valuable design advice and suggestions for your project. They can help you choose the right tiles for your space and create a cohesive look that complements your home's style.
6. Insurance and Guarantee: Hiring a professional tile contractor also provides you with insurance and a guarantee for their work. This gives you peace of mind knowing that your project is covered in case of any issues.
In conclusion, when it comes to tile projects in San Francisco, CA, it's important to hire a professional contractor for a seamless and successful installation. Their expertise, access to quality materials, efficiency, design expertise, and insurance coverage make them the best choice for your tile needs. Don't risk a subpar installation by attempting the project yourself. Trust the professionals for a beautiful and long-lasting result.
🚀 Exciting Open-Source Opportunities in 2024! 🌐
Tags: opensource, contributorswanted, github, career
Published: 2024-01-14 14:52:53

Hey Dev Community! 👋

Excited to explore the realm of Open Source in 2024? Here's a rundown of some incredible programs to be a part of. 🚀

1. Google Summer of Code (GSoC)

💰 Stipend: $1500 (short-term) to $3000 (long-term)  
⏰ Duration: 12 weeks  
📅 Application: March to April  
🚀 Project Period: May to August

2. Google Season of Docs (GSOD)

💵 Stipend: $3000 to $6600  
⏰ Duration: 12 weeks  
📅 Application: February to March  
🚀 Project Period: June to November

3. Outreachy

💸 Stipend: Up to $7,000  
⏰ Duration: 12 weeks (3 months)  
📅 Application: Jan to Feb & Aug to Sep  
🚀 Project Period: May to August OR December to March

4. Linux Foundation Mentorship Program (LFX)

💵 Stipend: $3000 (min for India) to $6600  
⏰ Duration: 12 weeks  
📅 Application: Opens approx. 4 weeks before start date  
🚀 Project Period: Varies with organizations

5. Major League Hacking (MLH) Fellowship

💡 Tailored stipends  
⏰ Duration: 12 weeks  
📅 Application: July to August  
🚀 Project Period: Starts in September

6. Alibaba Summer of Code (AliSoc/ASoC)

🎓 Scholarship, Certificates, and a Fast Pass for Alibaba Internship/Recruitment  
⏰ Duration: 12 weeks  
📅 Application: March to April  
🚀 Project Period: May to August

7. LFN Mentorship Program

💼 Paid opportunities for Linux developers  
⏰ Duration: 12 weeks  
📅 Application: Jan to Feb  
🚀 Project Period: June to August

A massive shoutout to [Syed Imtiyaz Ali, sir](https://www.linkedin.com/in/imtiyaz-sde?utm_source=share&utm_campaign=share_via&utm_content=profile&utm_medium=android_app) for the inspiration! 🙌

Ready to make 2024 the year of open-source contributions? Follow [Farha Kousar] (https://www.linkedin.com/in/farhakousar16) on [GitHub](https://github.com/FarhaKousar1601) for more updates and let's code together! 🚀👩‍💻👨‍💻 #opensource #GSoC #GSOD #techskills #github #projects #developer #opensourcecommunity