teleren/devto huggingface dataset:
Laravel ( WhereRaw HavingRaw OrderByRaw SelectRaw whereNotNull And whereNull )
Tags: laravel, php, programming, beginners
Published: 2021-11-26 09:22:42

Let's get started quickly We start with WhereRaw
```php
$products = DB::table('products')
             ->whereRaw('price > IF(state = "TX", ?, 100)', [200])
             ->get();
```
havingRaw
```php
Product::groupBy('product_id')->havingRaw('COUNT(*) > 1')->get();
```
orderByRaw

```php
User::where('created_at', '>', '2022-01-01')
    ->orderByRaw('(updated_at - created_at) desc')
    ->get();
```
Eloquent selectRaw() 
```php
User::select("*")
     ->selectRaw('amount + ? as amount_with_bonus', [500])
     ->get();
```
Another example
```php
User::select("*")
    ->select('*', DB::raw('amount + 500 as amount_with_bonus'))
    ->get();
```
Eloquent whereNotNull()
```mysql
select * from `users` where `email_verified_at` is not null
```
```php
User::select("*")
      ->whereNotNull('email_verified_at')
      ->get();
```
Eloquent whereNull()
```mysql
select * from `users` where `email_verified_at` is null
```
```php
User::select("*")
      ->whereNull('email_verified_at')
      ->get();
```
I hope you enjoyed the code.
Readymade Script For Building Fiverr Like Marketplace
Tags: beginners, webdev, programming, javascript
Published: 2021-11-26 08:54:03

Easily create your online marketplace with our readymade PHP script. Create your Fiverr clone and start earning! ADVANCED MARKETPLACE That's why we've created this Fiverr Clone Script to help you make your freelance marketplace for sellers and buyers.

This is a revolutionary online business platform where employers search for top talent and hire freelancers for their best skills. This is the online marketplace for freelancers and business people.


The <a href="https://www.suffescom.com/clone/fiverr-clone-app-development">Fiverr clone app</a> has impressive and innovative features. It is a cost and time-effective way to start a business with a small investment. To create your freelance website, use on-demand marketplace software.


Our Fiverr clone script can be seen in action by entrepreneurs and freelancers who want to create micro-jobs websites and mobile apps.

<b>Fiverr Clone Specs</b>


The Fiverr Clone allows users to buy and sell job services from the same account. As sellers, they can post gigs (jobs) on the site, and as buyers, they can search for them by category or keyword.

Using our readymade marketplace script, the buyer can browse the list of gigs they've searched for and view their details. They can put their favorite gigs in a cart and pay via a payment gateway.



Unlimited Gigs

Branded script

Search Filter

Dashboard AJAX

Social Media Login

Wallet Usability

Receptive web (mobile friendly)
Introduction to Binance Smart Chain
Published: 2021-11-26 08:44:27

You might known Binance as the world's latgest blockchain and digital assets exchange, but what's Binance Smart Chain? And what makes it so... smart? 👀

Binance Smart Chain (or BSC) is a blockchain network by Binance, launched in September 2020 for the developers to build decentralized applications, focusing on scalability. 

{% twitter 1300780718813921280 %}

Interestingly, BSC is based on Ethereum and features smart contracts along with a support for a wide range of DeFi protocols. By incorporating a consensus mechanism called Proof of Staked Authority (PoSA), a combination of Proof of Stake (PoS) and Proof of Authority (PoA), BSC makes the best of both worlds boosting the network performance. 

Some of the key-features of Binance Smart Chain are:
- Ethereum Virtual Machine (EVM) Compatibility, which means DApps running on Ethereum can be ported for BSC
- Cross-chain compatibility with Binance Chain
- Proof of Staked Authority
- Lightening-fast Block Time of ~3 seconds

### What's in it for BNB holders? 

BSC provides a staking functionality for BNB holders, which is the native token for Binance ecosystem. By participating in staking, the BNB holders receive rewards from BSC validators, along with staking interests. 

### Some Interesting Facts About Binance Smart Chain
- Binance Chain is completely different from BSC. The former was the original network by Binance, built to support Binance DEX, but it didn't offer smart contracts
- BSC was then introduced to offer scalability through smart contracts
- Binance Chain and BSC are interoperable
- BSC is independent, and can run even if Binance Chain goes down
- The liquidity on Binance exchange serves as a huge plus for BSC
- BSC widely contributes to bridging the gap between centralized and decentralized finance 
- There's BSC support on various leading wallets including Trust Wallet and MetaMask

### Use Cases

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17lba4joi28dqr3qhgki.png)

Using Binance Smart Chain, you can:
- Trade using DEX platforms such as PancakeSwap
- Create pegged tokens from other blockchains to make them compatible with BSC
- Perform yield farming using platforms such as Autofarm
- Create NFT marketplaces or trade on the existing ones


To learn more about Binance Smart Chain, head over to [Binance Academy](https://bit.ly/binanceacad). If you want to build on BSC, check out [Binance Docs](https://bit.ly/binancedocs).

--- 

> *Disclaimer: This blog is meant for educational purposes only and nothing from this blog should be taken as a financial advice. Please DYOR before investing.*
Set HTTP(s) Proxy in Windows Command Line / Mac Terminal
Tags: ubuntu
Published: 2021-12-04 10:57:11

---
title: Set HTTP(s) Proxy in Windows Command Line / Mac Terminal
published: true
date: 2021-11-26 08:36:21 UTC
tags: Ubuntu
canonical_url: https://stackallflow.com/ubuntu/set-https-proxy-in-windows-command-line-mac-terminal/
---

MISCPROXY

## Windows Command Line

In Windows Command Line environment (NOT powershell), you can use below commands to set http and https proxy.

```
set http_proxy=protocol://ip:port
set https_proxy=protocol://ip:port
```

For example, if you have a local socks 5 proxy (such as ShadowSocks), commands will be as below.

```
set http_proxy=socks5://127.0.0.1:1086
set https_proxy=socks5://127.0.0.1:1086
```

After setting, you can _echo_ these variables to confirm.

```
echo %http_proxy%
echo %https_proxy%
```

Set variable as empty to cancel the proxy

```
set http_proxy=
set https_proxy=
```

## MAC Terminal

```
export http_proxy=socks5://127.0.0.1:1086 # Set HTTP Proxy
export https_proxy=socks5://127.0.0.1:1086 # Set HTTPS Proxy
export all_proxy=socks5://127.0.0.1:1086 # Set HTTP & HTTPS Proxy
```

To cancel HTTP Proxy in MAC Terminal, use _unset_ command

```
unset http_proxy 
unset https_proxy
```

These setting are only validated for current session, not impact system or other sessions.

PS: If your are running Shadowsocks, just disable system proxy instead of selecting mode as PAC or Global.

The post [Set HTTP(s) Proxy in Windows Command Line / Mac Terminal](https://stackallflow.com/ubuntu/set-https-proxy-in-windows-command-line-mac-terminal/) appeared first on [Stack All Flow](https://stackallflow.com).
Why Choose Native Android📱 Developpment [1/3]
Tags: android, vscode, programming, mobile
Published: 2021-11-26 08:10:20

Today, we have lot of option to make mobile apps.
![Gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p8951j6t4nf2l2uzr5ji.gif)
All these options implies lot of choice to take.
Which platform : **Android** / *IOS*
Which technology : *Flutter* / **Native** / *React Native*...
Which pattern : *MVC* / *MVVM* / *Component*...


This article will explain why you should choose : Android ➡️ Native ➡️ Whatever you want 🐔

##Performance##
Obviously, native application are faster.
![Bench graph](https://miro.medium.com/max/1050/1*tCqV2lrsWL-NVY8G9BLo5Q.jpeg)

[Source : Medium article by inVerita](https://medium.com/swlh/flutter-vs-react-native-vs-native-deep-performance-comparison-990b90c11433)
As you can see Native is far faster than Flutter and React native.
But it's not not only faster, it's also battery friendly.

##THINK TO THE FUTUR##
Google will certainly continue in the direction they have been going for several years.
They will just nerf battery intensive features. It's already the case for services and job, if your background tasks are too intensive : they will be ⚰️.

Thanks for reaing me.
![Bye](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r6nv1nn5fzr1idemgi5c.gif)
Direct URL to Image in Google Drive
Tags: googledrive, appsheet
Published: 2021-11-26 08:03:42

Google Drive内の画像を共有リンクとして取得すると下記のURLが取得されます。

`https://drive.google.com/file/d/_image_id_/view?usp=sharing`

画像直接のリンクが欲しい場合、下記のように書き換えると利用できます。

`https://drive.google.com/uc?export=view&id=_image_id_`

参考リンク：
https://help.appsheet.com/en/articles/961605-displaying-images-and-documents
Training a Vision Transformer on Amazon SageMaker
Tags: deeplearning, opensource, computervision, aws
Published: 2021-12-03 08:10:30

---
title: Training a Vision Transformer on Amazon SageMaker
published: true
date: 2021-11-26 08:02:12 UTC
tags: deeplearning,opensource,computervision,aws
canonical_url: https://julsimon.medium.com/training-a-vision-transformer-on-amazon-sagemaker-90a5b30c12b0
---

In this series of three videos, I focus on training a [Vision Transformer](https://huggingface.co/transformers/model_doc/vit.html) model on [Amazon SageMaker](https://aws.amazon.com/sagemaker/).

In the first video, I start from the « Dogs vs Cats » dataset on Kaggle, and I extract a subset of images that I upload to S3. Then, using SageMaker Processing, I run a script that loads the images directly from S3 into memory, extracts their features using the Vision Transformer feature extractor, and stores them in S3 as Hugging Face datasets for image classification.

{% youtube jalopOoBL5M %}

In the second video, I start from the image classification dataset that I prepared in the first video. Then, I download a pre-trained Vision Transformer from the Hugging Face hub, and I fine-tune it on my dataset, using a training script based on the Trainer API in the Transformers library.

{% youtube iiw9dNG7JcU %}

In the third video, I start from the image classification dataset that I prepared in the first video. Then, I download a pre-trained base Vision Transformer from the Hugging Face hub, and I use PyTorch Lightning to append a classification layer to it. Finally, I train the model using the Trainer API in PyTorch Lightning.

Resources:

- Vision Transformer paper: [https://arxiv.org/abs/2010.11929](https://arxiv.org/abs/2010.11929)
- Dataset: [https://www.kaggle.com/c/dogs-vs-cats/](https://www.kaggle.com/c/dogs-vs-cats/)
- Code: [https://gitlab.com/juliensimon/huggingface-demos/-/tree/main/vision-transformer](https://gitlab.com/juliensimon/huggingface-demos/-/tree/main/vision-transformer)
- More Hugging Face on SageMaker notebooks: [https://github.com/huggingface/notebooks/tree/master/sagemaker](https://github.com/huggingface/notebooks/tree/master/sagemaker)

New to Transformers? Check out the [Hugging Face course](https://huggingface.co/course)!
Different About the Mac Iso Image in Ubuntu?
Tags: ubuntu
Published: 2021-12-03 17:30:28

---
title: Different About the Mac Iso Image in Ubuntu?
published: true
date: 2021-11-26 07:44:42 UTC
tags: Ubuntu
canonical_url: https://stackallflow.com/ubuntu/different-about-the-mac-iso-image-in-ubuntu/
---

<header>
<h1>Ubuntu – different about the Mac ISO image</h1>
</header>

isomacbook

[http://cdimage.ubuntu.com/releases/11.04/release/](http://cdimage.ubuntu.com/releases/11.04/release/)

At that location there is an ISO image which is described as “This image is adjusted to work properly on Mac systems.”

What specific problems on the Mac does this image address that the standard images don’t? I ask because I need to know which ISO to recommend to Apple Mac users.

#### Accepted Answer

In Ubuntu 10.10, we changed the normal `amd64` CD images to dual-boot on either BIOS or UEFI systems (UEFI, “Unified Extensible Firmware Interface”, is a different kind of firmware found on many newer systems). This was done using a technique known as a “multi-catalog” CD – it contains two boot images, and the specification says that the firmware is supposed to pick the one it can best use.

Unfortunately, even though Macs use a variant of EFI (an earlier version of what’s now called UEFI), they apparently can’t cope with multi-catalog CDs, and simply [refuse to boot them](https://bugs.launchpad.net/bugs/633983). This left us in rather a quandary: we needed to support UEFI systems, but we didn’t want to drop support for Macs either. I therefore created the `amd64+mac` CD images, which are exactly the same as the `amd64` images except that they only support BIOS booting. Macs are happy to boot these in their BIOS emulation mode.

(In fact, the name `amd64+mac` is a slight misnomer, because it later turned out that some systems other than Macs suffer from a similar problem – but I felt that a more technically accurate naming such as `amd64+nouefi` would be more likely to confuse than enlighten.)

While I would love to return to shipping just `amd64` images rather than both `amd64` and `amd64+mac`, at the moment there is no prospect of reunifying them unless somebody figures out how to make a multi-catalog CD image that Macs can boot. If you’re an expert on this, please do contact me by e-mail.

The post [Different About the Mac Iso Image in Ubuntu?](https://stackallflow.com/ubuntu/different-about-the-mac-iso-image-in-ubuntu/) appeared first on [Stack All Flow](https://stackallflow.com).
This is a pretty great shit 💩
Tags: programming, productivity, leadership
Published: 2021-11-26 07:46:09

## WTF? Oh, **Shit** 💩 

Yes it's exactly which you have just read, it's completely describe such a **Shit**, but why?, the question should be why is it called **shit**?
In this posts I will share you everything you need to known as a developer, I will tell you exactly as I have felt it without skimping anything. 😇


```js
let important = "If you are not interested please not continue reading";
console.log(`Hey 😄, ${important}`);
``` 

### Let me introduce it 😌

My *full name* is Emanuel (*you can call me Manu*), I was born in Uruguay but actually I'm located in **Spain** 🇪🇸, I suppose you think I'm older, but no 😜, at the moment I'm twenty years old, I started coding when I was 14 years old. Maybe you are asking for why I started coding at this age, the answer can be summarise in one word: 
**Curiosity** 😙.  

### What will this series talk about?

It's really important for me, I'm sure you have **already** heart that developer life is incredible, blah, blah blah 🤓, a lot of suppositions without any fundament, the **typical** phrase:

> Coding will be you millionaire 💰.

*All that glitters is not gold*, you have to take into accounts a **couple of things** you aren't known, really all of us are **ignorant** 🥸, we think we know everything, we think we are gifted, but no. I'm overwhelmed about the society's **ignorance**. Almost people get settle with their lives, making a cyclic and eternal life. I'm here 🤨 trying to show you why you shouldn't stop learning, how is exactly a software engineer life? 

Really, let me tell you, you do not have to be **agree with me** 🥲, it's only my point of view based in my *experience* and *knowledge*, this is why I have learnt in 7 years as software engineer, I will be more **transparent** to you than with my **family** 🤐. 

Every **Friday** I will post a new story in this series talking about all this topics, I recommend you subscribing to the newsletter to get up to date with my **latest post**. Run this code in your mind:

```js
let postReminder = Reminder("Shit Post 💩", "Manu will release a new post in his story", .urgently, .everyFriday);
me.setReminder(postReminder);
```

## Finally

I'm here to help you growing in your professional **career**, if you regarding any question, suggestion or complain please **do not hesitate** in contact me. I'm very glad in helping you 🤤
How to Make Xrandr Customization Permanent in Ubuntu?
Tags: ubuntu
Published: 2021-12-04 10:56:26

---
title: How to Make Xrandr Customization Permanent in Ubuntu?
published: true
date: 2021-11-26 07:45:33 UTC
tags: Ubuntu
canonical_url: https://stackallflow.com/ubuntu/how-to-make-xrandr-customization-permanent-in-ubuntu/
---

<header>
<p><span style="font-size: 1.2em; color: initial;">lightdm</span><span style="font-size: 1.2em; color: initial;">xrandr</span></p>
</header>

I used to edit the startup script for the GDM (/etc/gdm/Init/Default) to permanently change my display resolution.

How can I do this with LigthDM in Ubuntu Oneiric?

#### Accepted Answer

I think you can add the display modes to `/etc/X11/xorg.conf`.

If you don’t have a `xorg.conf`, then you can use the following as a basis. You need to replace the entries with the names `Modeline`, `Driver` and `Modes` with the correct entries for your system. Depending on your hardware, you may need additional entries, for example if your system has more than one graphic chip.

```
Section "Monitor"
    Identifier "Monitor0"
    Modeline "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync
    Modeline "1024x768_60.00" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "Card0"
    Monitor "Monitor0"
    SubSection "Display"
        Modes "1280x1024_60.00" "1024x768_60.00"
    EndSubSection
EndSection

Section "Device"
    Identifier "Card0"
    Driver "nvidia"
EndSection

```

If you don’t know the name of the video driver that your system is using then you may get the name as follows (if you have an intel graphic chip, the driver name is just “intel”):

```
lshw -class display | grep "driver"

```

The modelines can be generated with `cvt`:

```
cvt <h-resolution> <v-resolution> [refresh]

```

The post [How to Make Xrandr Customization Permanent in Ubuntu?](https://stackallflow.com/ubuntu/how-to-make-xrandr-customization-permanent-in-ubuntu/) appeared first on [Stack All Flow](https://stackallflow.com).
How to Set a Custom Resolution in Ubuntu?
Tags: ubuntu
Published: 2021-12-03 17:30:32

---
title: How to Set a Custom Resolution in Ubuntu?
published: true
date: 2021-11-26 07:45:06 UTC
tags: Ubuntu
canonical_url: https://stackallflow.com/ubuntu/how-to-set-a-custom-resolution-in-ubuntu/
---

<header>
<h1>Ubuntu – How to set a custom resolution</h1>
</header>

display-resolutionxrandr

I tried to use `xrandr` to set 1680×1050 as a new mode to VGA output, but it says:

```
sudo xrandr --addmode VGA-0 1680
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 18 (RRAddOutputMode)
Serial number of failed request: 35
Current serial number in output stream: 36
```

#### Accepted Answer

First generate a “modeline” by using **cvt**  
Syntax is: **cvt** _width height refreshrate_

```
cvt 1680 1050 60

```

this gives you:

```
# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
Modeline "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync

```

Now tell this to **xrandr** :

```
xrandr --newmode "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync

```

Then you can now add it to the table of possible resolutions of an output of your choice:

```
xrandr --addmode VGA-0 1680x1050_60.00

```

The changes are lost after reboot, to set up the resolution persistently, create the file `~/.xprofile` with the content:

```
#!/bin/sh
xrandr --newmode "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
xrandr --addmode VGA-0 1680x1050_60.00

```

The post [How to Set a Custom Resolution in Ubuntu?](https://stackallflow.com/ubuntu/how-to-set-a-custom-resolution-in-ubuntu/) appeared first on [Stack All Flow](https://stackallflow.com).
How to Let `Dpkg -I` Install Dependencies for Me in Ubuntu?
Tags: ubuntu
Published: 2021-12-03 17:30:23

---
title: How to Let `Dpkg -I` Install Dependencies for Me in Ubuntu?
published: true
date: 2021-11-26 07:40:53 UTC
tags: Ubuntu
canonical_url: https://stackallflow.com/ubuntu/how-to-let-dpkg-i-install-dependencies-for-me-in-ubuntu/
---

<header>
<p><span style="font-size: 1.2em; color: initial;">dpkg</span></p>
</header>

Say, I have `foo-1.2.3.deb` which depends on `perl` and `python`, however, running command:

```
dpkg -i ./foo-1.2.3.deb

```

won’t install these dependencies. So I must `apt-get install perl python` by hand.

How to make `dpkg -i` install these dependencies for me automatically?

#### Accepted Answer

After using `dpkg`, running the following command helped me to install the required dependencies:

```
sudo apt-get -f install

```

In all, your terminal should look like this:

```
$ sudo dpkg -i package_with_unsatisfied_dependencies.deb
dpkg: dependency problems prevent ... 
[additional messages]

$ sudo apt-get -f install
[apt messages]
Setting up [dependency]...
Setting up package_with_unsatisfied_dependencies...

```

**Notice** the line about `Setting up package_with_unsatisfied_dependencies`. This [fixes](http://manpages.ubuntu.com/apt-get) (and completes) the installation of `package_with_unsatisfied_dependencies.deb`.

The post [How to Let `Dpkg -I` Install Dependencies for Me in Ubuntu?](https://stackallflow.com/ubuntu/how-to-let-dpkg-i-install-dependencies-for-me-in-ubuntu/) appeared first on [Stack All Flow](https://stackallflow.com).
How to CD Into a Directory in the Home Folder in Ubuntu?
Tags: ubuntu
Published: 2021-12-03 17:30:19

---
title: How to CD Into a Directory in the Home Folder in Ubuntu?
published: true
date: 2021-11-26 07:39:34 UTC
tags: Ubuntu
canonical_url: https://stackallflow.com/ubuntu/how-to-cd-into-a-directory-in-the-home-folder-in-ubuntu/
---

<header>
<p><span style="font-size: 1.2em; color: initial;">cd-command</span><span style="font-size: 1.2em; color: initial;">command line</span><span style="font-size: 1.2em; color: initial;">directory</span><span style="font-size: 1.2em; color: initial;">home-directory</span></p>
</header>

How do I change directories to downloads, from the home folder, in the latest version Ubuntu 12.10? I tried `cd /downloads`, but it gave an error saying that there is no such directory.

#### Accepted Answer

```
cd ~/Downloads

```

Remember: Linux is case sensitive, so `Downloads` and `downloads` are different directories.

`~` is a “shortcut” to the home directory. Another one would be `$HOME`. If you’re already in your home directory you can just `cd Downloads`.

The post [How to CD Into a Directory in the Home Folder in Ubuntu?](https://stackallflow.com/ubuntu/how-to-cd-into-a-directory-in-the-home-folder-in-ubuntu/) appeared first on [Stack All Flow](https://stackallflow.com).
Historical Test Report Portal — How Developers Accelerate the Testing Process
Tags: testing, historicaltestreport, tester
Published: 2021-11-26 07:38:58

"Your testing team, from developers to testers, has put out a great amount of work to design test cases.

Knowing that an error-free testing process simply does not exist, when it comes to the test execution, this one fails, while the rest passes. Or, is one of them is taking much longer to complete compared to previous runs? How do you determine if your tests have slowed down or increased their probability of failing?

This requires context–historical logs from past sessions to be more specific. Without trends of test performance over time, decisions made and corrective measures could be misleading, resulting in wasted efforts, time, and the overall ROI for your project."
[Continue reading](https://www.katalon.com/resources-center/blog/historical-data-unit-test/
)
Entity Framework Core and DBcontext Configuration in Startup class
Tags: dotnet
Published: 2021-11-26 07:27:58

can someone give us the best way to configure DbContext in the Startup class , i have been working with C#.NET driver for MongoDB 
but now i am switching to SQL SERVER and EF core so i am looking for the best way to make it work  , what is the best way to configure the DBContext in STARTUP class and make generic repository , thanks