teleren/devto huggingface dataset:
My first non-responsive page
Tags: css, html, frontend, webdev
Published: 2023-06-09 20:36:18

I've been off the grid on this blog, but I've got to get going again. It happened that I had such a major saga with this fever all through April and a good part of May. It was a back-and-forth thing and I was literally unable to sit down with programming successfully for almost two months! But for every tunnel, there's got to be a light at its end right? A major break came at the tail end of May, and I was able to complete the project that I was working on before the illness. It wasn't an uphill task but a call to duty for me. 
I have to explain what it means for a page to be non-responsive for the sake of those who aren't into tech. A non-responsive page in the simplest of terms is one that won't display effectively on all devices. For example, I developed this page on my PC, and the screen orientation for an average PC is landscape mode. As a result, every single thing on this page will function normally, but it won't work well on other devices because the page was not built to respond to other devices but a PC and the landscape mode on devices. I have tried to load the page on my phone, which is on portrait mode by default but it did not respond well, but the response was better when I rotated my screen to the landscape mode. 
This is what it means for a page to be responsive anyway. But pages have to fit into all viewports on the several devices available, don't they? A viewport is simply the screen of your device, no matter the kind of device you use. I am currently learning how to make my page responsive, and the first point of action in this course is the Bootstrap session. I am relatively new to the prospect of using Bootstrap to make my pages responsive, but I am learning bit by bit.
I remember how I was immediately stranded when I started the module. I kept missing the simplest stuff about the Bootstrap section. All I had to do to get started was either to copy the CSS code for the Bootstrap directly from the website and then add it to my project on my text editor or to download the CSS/JS file from the Bootstrap website, copy the code and add it to the text editor as well. I learnt the value of having shoulders to lean on from this saga. Thank God for having a tech-sis like Esther.
Please do not attempt to go through the race of life alone, no man is ever an island. I strongly believe that God created humans for positive and productive interactions. I had to go on a mini adventure with her on this particular day and I showed her what I was facing. All she did was give me a few tips on how to get an external explanatory video on YouTube, which I did. What seemed to be an immovable mountain for a while turned out to be the simplest stuff ever! It does pay to have wise counsel around you in life.
This is the progress so far anyway, I am currently unravelling the mystery of using Bootstrap to build a responsive page. I will also put up the link to the non-responsive page that I built below; 

https://doyinaluko.github.io/intermediatecss/
Job(Hourly contract): CSS developer
Tags: html, css
Published: 2023-06-09 20:34:39

I'm seeking for HTML/CSS developer who can help me with my html frontend project!
If you developer/freelancer from Europe or America, please DM me for this exciting.

Skype ID:       live:.cid.b64830812c410bb4
Discord ID:     magnatar#2442
Telegram ID:    @tindertalent

If you don't have any chatting app use this e-mail.
my e-mail: coryitpro@gmail.com
CineTickets Desktop Application
Published: 2023-06-09 20:20:31

this was the java pproject we have done. here are few technologies we used,

- MySql
- JavaSpringBoot
- dsvkdfvj
- sfg

check the following link to find more about the project. [www.random.com](url) 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2rb5cbe9menf4x0zpqmn.png)
Let's create a secret word game with python to understand the use of "if and while statements"!
Tags: python, beginners, gamedev
Published: 2023-06-09 20:15:00

```
secret_word = "Whileloop"
guess =""
guess_count = 0
guess_limit = 3
out_of_guesses = False

while guess != secret_word and not out_of_guesses:
    if guess_count < guess_limit:
        guess = input("Enter your word: ")
        guess_count += 1
    else:
        out_of_guesses = True
if out_of_guesses:
    print("out of Guesses, You looooooose the game 🫠")
else:
    print("You win🎉🎉")
```
Single-Digit Spotlight v3
Tags: singledigit
Published: 2023-06-09 20:11:14

Welcome to "Single Digit" Spotlight, a selection of articles published **_within the last week_** that have **_fewer than 10 total reactions_** (at the time of the post's publishing).

The goal is to highlight posts published on DEV that haven't yet received the attention they may deserve 🌱

Hope you enjoy!

{% embed https://dev.to/gc_psk/introduction-to-nextjs-server-actions-2leg %}

{% embed https://dev.to/ycmjason/typing-partially-applicable-functions-1oa4  %}

{% embed https://dev.to/0xkoji/customize-react-simple-keyboard-layout-1dcb  %}

{% embed https://dev.to/aaronksaunders/building-mobile-app-mvp-renderatl-522l %}

{% embed https://dev.to/mbarzeev/is-nodejs-test-runner-dev-ready-4gm8 %}

{% embed https://dev.to/elasticrash/drawing-images-on-the-terminal-1din %}

Shout out to @gc_psk, @ycmjason, @0xkoji, @aaronksaunders, @mbarzeev, and @elasticrash.

---

<a href="https://www.freepik.com/free-photo/golden-number-one-with-gold-crown-top-floor-champion-winner-yellow-background-by-3d-render_25829004.htm#query=spotlight%20on%20a%201&position=38&from_view=search&track=ais">Image by DilokaStudio</a> on Freepik
HTML, CSS, and JavaScript Projects
Tags: html, css, javascript, frontend
Published: 2023-06-09 20:02:25

Are you ready to take your HTML, CSS, and JavaScript skills to the next level? If you've completed your studies and want to put your knowledge into practice by working on real projects, then this post is for you!

---

In this article, we'll explore various websites that offer pre-designed templates specifically tailored for web development. Whether you're looking for free options or don't mind investing in a paid template.

---

By utilizing these templates, you can open up the live demos of the websites you're interested in building and apply them yourself. And don't worry if you encounter any roadblocks along the way – most of these templates provide access to their source code. This means you can dive into the codebase, examine how different challenges were solved, and gain a deeper understanding of web development principles

---

So, let's dive in and discover the exciting world of building projects with HTML, CSS, and JavaScript!

---

HTML5Up
https://html5up.net

Templatemo
https://templatemo.com

freehtml5
https://freehtml5.co

Styleshout
https://lnkd.in/dnQn8vtM

Start Bootstrap
https://lnkd.in/dK8bVA6q

Zerotheme
https://www.zerotheme.com

html5xcss3
https://lnkd.in/d6mVkKD5

Colorlib
https://lnkd.in/dKnbFUyt

Free-CSS
https://lnkd.in/dTeSpapj

Hubspot
https://lnkd.in/dFkDkkxx

Mobirise
https://lnkd.in/db9RYz-Q

Bootstrap Made
https://bootstrapmade.com

Theme For App
https://themesfor.app

Bootstrap Taste
https://lnkd.in/dwWsbA9U

One Page Love
https://onepagelove.com

Tool Plate
https://www.tooplate.com

Cruip
https://lnkd.in/dgGjsH8P

UIDeck
https://uideck.com

---

💡 Stay connected with me: 
- [LinkedIn](https://www.linkedin.com/in/dev-alisamir)
- [Telegram](https://t.me/se_alisamir)
- [Facebook](https://www.facebook.com/alisamir.dev)
- [Instagram](https://www.instagram.com/alisamir.dev)
How to Generate web apps in minutes with AI
Tags: webdev, javascript, programming, ai
Published: 2023-06-09 19:50:52

IntelliNode is open source module to connect to any AI model and switch between them without changing your code. You can choose to generate the images from stable diffusion or DALL·E, or text from Openai and cohere without impacting your business app logic.

Following is an [app](https://show.intellinode.ai/coder) example that that uses IntelliNode to generate web pages from a user prompt:
**Register page generation**
![generate registration pages](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n27skrz80r3giacm09kv.png)

Another use case is the ability to convert csv files to elegant diagrams without coding:
**Dashboard html**
![generate diagrams](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/63za9htsx2kao29tbxfo.png)

The module provides a Gen function that generates tuned business case content in one line:
**Generate blog post**
`const blogPost = await Gen.get_blog_post(prompt, openaiApiKey);`

**Or generate html pages**
`await Gen.save_html_page(text, folder, file_name, openaiKey);`

**For advanced capabilities**, you can use the controllers behind the Gen function:

**Image generation function**
```
async function generateImage(imageText, apiKey, modelBackend) {
  const imgModel = new RemoteImageModel(apiKey, modelBackend);
  const imageInput = new ImageModelInput({
    prompt: imageText,
    numberOfImages: 3,
    width: 512,
    height: 512
  });
  return await imgModel.generateImages(imageInput);
}
```
Generate image with  stable diffusion:
`const images = await generateImage(imageDescription, MyKeys.stability, SupportedImageModels.STABILITY);`

Or switch to DALL·E 2:
`const images = await generateImage(imageDescription, MyKeys.openai, SupportedImageModels.openai);`


To download the node module:
`npm i intellinode`

You can interact with the module using the show case application:
https://show.intellinode.ai/

Or connect the capabilities to your apps using the github repo:
https://github.com/Barqawiz/IntelliNode

Which functions or capabilities you would like to add to the node module?
What's in Ruby class Array
Tags: ruby, array, documentation
Published: 2023-06-09 19:36:17

---
title: What's in Ruby class Array
published: true
description: 
tags: #ruby, #array, #documentation

---

In the last two or three years, I've written "What's Here" sections for about 20 Ruby core and standard library classes and modules.

Here's the one for class Array:  https://docs.ruby-lang.org/en/master/Array.html#class-Array-label-What-27s+Here.

It's not a tutorial;  it's an overview.  It's meant to help readers become acquainted with the methods in the class.
Creating thumbnails for multi-page Pdfs in Carrierwave 2.2.3 and Rails 7
Tags: carrierwave, ruby, rails, imageprocessing
Published: 2023-06-09 19:16:14

Prerequisites:

1. Have set up Carrierwave to upload files
2. Know what `version :thumb` does
3. Have `imagemagick` and `ghostscript` installed on the host machine.

Please review this Carrierwave Uploader as the final solution.  The documentation should be worthy enough to explain what's going on.

```ruby
class VersionUploader < CarrierWave::Uploader::Base
  include CarrierWave::MiniMagick
  include CarrierWave::RMagick
  storage :fog

  # @doc Specifies the position on remote hosting to save the file
  def store_dir = "shared/system/#{klass}/#{attachment}/#{id_partition}/#{style}/"

  # @doc Returns the model class name, camel_case and pluralized.
  # @example 
  #   irb(main):038:0> MyModel.first.file.file.klass
  #   => "my_models"
  def klass = model.class.name.underscore.pluralize

  # @doc Specifies the uploader's association name that is mounted on the model.  In the model `MyModel.rb`, we mount an uploader called VersionUploader, and we call that mount `file`.  This is considered the `attachment`
  # @example
  #   irb(main):039:0> MyModel.first.file.file.attachment
  #   => "files"
  def attachment = mounted_as.to_s.downcase.pluralize

  # @doc Creates a section of the final path partitioned by the id's of the model
  # @note
  #   These appear to be the id of the model, with a weird operation done to them.
  #   I sourced this code from the paperclip compatibility source code of Carrierwave's github as in my situation, I was converting from Paperclip to Carrierwave
  def id_partition = ("%09d" % model.id).scan(/.{3}/).join("/")

  # @doc Specifies the style of file for storage directory purposes
  def style = :original

  # @doc Returns the first page of a file
  version :thumb do
    process :to_array
    process :front
    process convert: "jpg"
    def full_filename(filename = model.file.filename) = "#{filename.split(".").first}.jpg"
    def style = :thumb
  end

  private

  # @doc Utilizes minimagick to split the uploading file from it's temporary path into an array
  # @note This code was sourced from https://github.com/janko/image_processing/wiki/Splitting-a-PDF-into-multiple-images, though I've made a few edits
  def to_array
    MiniMagick::Image.new(path).pages.count.times.map{ |page_number|
      ImageProcessing::MiniMagick
        .source(path)
        .convert("jpg")
        .colorspace("RGB")
        .loader(page: page_number).call
    }.first
  end

  # @doc Used in conjunction with `to_array` to return the first page of the array of pages
  # @note This utilizes the module CarrierWave::RMagick in some way...
  def front
    manipulate! do |frame, index|
      frame if index.zero?
    end
  end

end
```

Hopefully I've made this journey easier than mine was, thanks!
#DEVDiscuss: WWDC 2023
Tags: devdiscuss, wwdc2023, discuss, news
Published: 2023-06-09 19:11:54

Hey Devs, happy Friday 🦥💚

As always, it's been an eventful week in the tech industry. We've got a lot to talk about! And today I want to discuss...**Apple's Worldwide Developer Conference (WWDC) 2023**.

This year's conference came with one big, exciting announcement: Apple Vision Pro 🤯

Our community members @ben, @thorstenhirsch, and @theklr had some interesting [initial reactions](https://dev.to/ben/whats-your-initial-reaction-to-apple-vision-pro-3715) to the groundbreaking news...

{% embed https://dev.to/ben/comment/275dc %}

{% embed https://dev.to/thorstenhirsch/comment/275ep %}

{% embed https://dev.to/theklr/comment/275f3 %}

But Vision Pro wasn't the only news from the conference (even if the feed was acting like it 👀) — check out this very good point from @sebastian_wessel.

{% embed https://dev.to/sebastian_wessel/one-more-thing-apples-push-on-web-apps-on-macos-2052 %}

So, what did you think of WWDC 2023?
- Have your thoughts on Apple Vision Pro changed over the past few days?
- Are there other bits of news from the conference we ought to be talking about?
- Is the whole conference overhyped anyway? (Team Android, anyone?)

Share your thoughts in the comments and let's discuss!

---

_Want to submit a question for discussion, or even ask for advice? Visit [Sloan's Inbox](https://docs.google.com/forms/d/e/1FAIpQLSc6wgzJ1hh2OR4WsWlJN9WHUJ8jV4dFkRDF2TUP32urHSAsQg/viewform?usp=sf_link)! You can choose to remain anonymous._
Asynchronous Programming in C# and .NET: A Guide
Tags: programming, csharp, dotnet
Published: 2023-06-09 19:08:16

Asynchronous programming is a powerful concept in C# and the .NET framework that allows developers to create more efficient and responsive applications. By leveraging the Task Parallel Library (TPL) and utilizing async/await keywords, we as developers can write code that performs multiple tasks concurrently without blocking the execution of other code.

## Understanding Asynchronous Programming

At the core of asynchronous programming in C# and .NET is the concept of tasks. A task represents an asynchronous operation that may or may not return a result. Using the `async` and `await` keywords, we can define asynchronous methods and await the completion of these tasks.

## Key Steps in Asynchronous Execution

When the runtime encounters an `await` keyword within an asynchronous method, several steps are involved in the execution process:

1. **Execution Suspension**: The execution of the current method is paused at the `await` keyword.

2. **Task Creation**: The expression following the `await` keyword is evaluated, typically representing an asynchronous operation that returns a `Task` or `Task<T>` object.

3. **Task Continuation**: If the task is not yet completed, the runtime registers a continuation, which is an action that will execute when the task completes.

4. **Releasing the Current Thread**: The current thread is released, allowing it to perform other tasks while waiting for the awaited operation to complete.

5. **Context Preservation**: Before releasing the thread, the current execution context is captured, including information about the synchronization context and execution context.

6. **Thread Return**: The released thread returns to the thread pool, ready to be used for other tasks.

7. **Completion of Awaited Task**: When the awaited task completes, the registered continuation is executed.

8. **Task Scheduler**: The task scheduler associated with the task is responsible for executing the registered continuation.

9. **Context Restoration**: The captured execution context is restored, ensuring the method resumes execution in the same context as before the `await` statement.

10. **Execution Resumption**: The method's execution resumes at the point immediately after the `await` statement.

## Benefits of Asynchronous Programming

Asynchronous programming offers several benefits, including:

- Improved Responsiveness: By allowing concurrent execution of multiple tasks, applications remain responsive even during time-consuming operations.

- Efficient Resource Utilization: Asynchronous programming utilizes threads more efficiently by releasing them when waiting for task completion, enabling better utilization of system resources.

- Scalability: By leveraging asynchronous operations, applications can handle multiple requests or operations without blocking threads, resulting in better scalability.


For further exploration, refer to the official Microsoft [documentation](https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/) on asynchronous programming in C# and the .NET framework.
Moodle: from (auto) registration to teacher in no time (no one else involved)
Tags: moodle, tutorial, opensource, training
Published: 2023-06-09 18:12:15

For a special Moodle instance, I needed to allow a new user to be an editing teacher in a course, actually, in several courses if needed. At the same time, this should apply to some users only, meaning not everyone would have the same rights.

Nothing unusual except for the fact that no manager or admin should intervene in the process.

I immediately thought about the [course request feature](https://docs.moodle.org/402/en/Adding_a_new_course#Course_requests) which I didn't know very well besides it exists. Luckily there's also a small plugin to allow [course requests to be automatically approved](https://moodle.org/plugins/tool_courseautoapprove) by [David Mudrák](https://github.com/mudrd8mz) himself- it's a simple [Moodle's scheduled task](https://github.com/mudrd8mz/moodle-tool_courseautoapprove/blob/master/classes/task/approve_course_requests_task.php). Exactly what I needed!

With the auto-approval requirement taken care of, it was only a matter of thinking about the workflow. So, anyone can register on the site but only some users should be able to request courses. This meant **I had to add a user custom field to differentiate users upfront** and ask for this information in the registering process. As an example, the field can be named "Position" and the options "Manager", "Officer" and "Assistant". Let's assume only managers should be allowed to request courses.

![Custom Field example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jczxk2sgihnemq6vskl9.png)

The next step was to use the [Auto Cohort plugin](https://moodle.org/plugins/local_cohortauto) to gather all users of a given position on its cohort. It's a great plugin by Catalyst that gives me peace of mind. After that, we need to use another plugin to assign cohort users a specific system role. Once again HQ member maintains an excellent solution: [Cohort role synchronization] (https://moodle.org/plugins/local_cohortrole). This simply loads cohorts members and assigns them a given system role, in my case the course requester role! Finally, the workflow is complete.

So when a user autoregister having the position of "Manager" is added to the manager cohort, and then, since is a member of that cohort, is assigned the system context course requester role.

In my case, there were additional requirements that I won't address here, but lead me to develop an alternative course request system, mostly because I needed to validate the requests against some rules, and because I needed a new request form. Of course, I wouldn't change Moodle core, so I developed a new local plugin, with new tables, tasks, and events (more on that in my next post).

**What I wanted to share is that by mixing Moodle Core's own functionalities and 2 trustful plugins, one can dismiss managers or admins** (for the process of registration and enrolment!!)
How to check if a temporary table exists and delete it if it does before creating a temporary table?
Tags: mssqlserver, tsql
Published: 2023-08-30 18:54:32

---
title: How to check if a temporary table exists and delete it if it does before creating a temporary table?
published: true
date: 2023-06-09 18:30:00 UTC
tags: MSSQLServer,TSQL
canonical_url: http://www.codetolive.in//ms%20sql%20server/How-to-check-if-a-temporary-table-exists-and-delete-it-if-it-does-before-creating-a-temporary-table/
---

You can check if the previously created temporary table exists before creating the same table again in your stored procedure. Drop them if they exist.

**_Code:_**

```
// checks that the temporary table 'results' exists in the SQL tempdb.
IF OBJECT_ID('tempdb..#Results') IS NOT NULL DROP TABLE #Results
GO

```