Angela  Dickens

Angela Dickens

1596106500

How To Use Inline and Block Elements in HTML

**Part of the Series: **How To Build a Website With HTML

This tutorial series will guide you through creating and further customizing this website using HTML, the standard markup language used to display documents in a web browser. No prior coding experience is necessary but we recommend you start at the beginning of the series if you wish to recreate the demonstration website.

At the end of this series, you should have a website ready to deploy to the cloud and a basic familiarity with HTML. Having a knowledge of how to write HTML will provide a strong foundation for learning additional front-end web development skills, such as CSS and JavaScript.

When arranging elements in an HTML document, it’s important to understand how these elements take up space on a webpage. Certain elements can take up much more space on the webpage than the content they contain. Understanding the behavior of different element types will help you anticipate how they affect the position of other elements on the page.

In general, there are two different types of elements—inline-level elements and block-level elements—whose spacing defaults behave differently from one another. Below, we’ll describe how the default settings of these elements determine their position on the webpage and relative to the position of nearby elements.

Inline-level Elements

Inline elements are elements whose horizontal width is determined by the width of the content they contain. The <strong> element and the <em> element we covered in the last tutorial are both examples of inline elements.

We can use Firefox’s Web Developer Inspector to inspect the size of HTML elements on a webpage. (If you are using Chrome, you can use the Developer Inspect Elements tool instead but this tutorial will give instructions for Firefox’s Web Developer tool.)

Return to the index.html file that you loaded in your browser. If you need to reload it and don’t remember how, refer to the instructions Loading an HTML File in your Browser from the last tutorial.

Then navigate to the Tools menu item in the top menu bar and select “Web Developer/Inspector.” Selecting this menu item will open up the Inspector interface that allows you to inspect the HTML and CSS of a webpage. Next, hover your cursor over the text My strong text, which should highlight the text in light blue. This highlighting shows the full extent of the space occupied by the element that your cursor is hovering over. As you may have expected, the element’s occupied space is just large enough to contain its text content:

This gif illustrates the process of using the Inspector tool as described in the paragraph above.

Unlike block-level elements, which we’ll cover in the next section, inline elements do not take up their own line of horizontal space. Thus, inline elements will rest side by side on a webpage if you do not specify a break with an additional HTML element, such as the line break <br> element. This sizing default is often convenient, as you may want to mark up single words in a paragraph with an inline element such as <strong> or <em> without pushing subsequent text to the next line.

Try adding the <br> tag in between your two lines of code in the index.html file. (You will need to return to your file in the text editor.) Note that the <br> element only requires an opening tag and does not wrap around any text:

<strong>My strong text</strong>
<br>
<em>My emphasized text</em>

Save and reload the document in your browser to check your results. You should receive something like this:

My strong text

My emphasized text

Your two phrases should now be on separate lines as they are now separated by the line break element <br>.

#html

What is GEEK

Buddha Community

How To Use Inline and Block Elements in HTML
Oral  Brekke

Oral Brekke

1675381680

Create Tic Tac toe with JavaScript (Free Code)

Do you want to make a Simple Tic-Tac-Toe game using JavaScript?

In this article you will learn how to create tic tac toe game using html css and javascript. If you are a beginner in JavaScript then Tic Tac Toe Game is perfect for you. This simple javascript game will help you improve your knowledge of javascript.

Create Tic Tac Toe with JavaScript

Earlier I shared another Simple Tic-Tac-Toe JavaScript game for beginners. So I made this design in a very advanced way. Here basically we will play with the computer that is we will play with the computer.

To create this tic-tac-toe javascript first I created the basic structure by html. Then I designed it with css and finally activated this project (tic tac toe javascript code against computer) with javascript.

Tic-tac-toe Game in JavaScript

JavaScript Tic Tac Toe is a simple game where two players take turns marking a grid of 3×3 squares, typically using X and O symbols. JavaScript is a programming language that can be used to create interactive websites and games, such as a Tic Tac Toe game.

A JavaScript implementation of Tic Tac Toe would involve creating a grid of squares using HTML and CSS, and then using JavaScript to handle the logic of the game, including determining the winner and allowing players to take turns.

As you can see above this is an advanced Tic Tac Toe game that I made with javascript. Like a normal JavaScript Tic Tac Toe game, there are 9 cells and two symbols.

Here I have defined symbol “0” for user and “X” for computer. But you can change it if you want. When you click in any one of those 9 cells, another cell will automatically be filled by the computer.

Besides, I have added different types of color FF in the project (tic tac toe javascript code against computer) to make this design more modern.

How to make tic tac toe in HTML CSS and JavaScript

Now if you want to build it then you can follow the tutorial below. I have explained the complete codes step by step keeping the beginners in mind.

Hope you know the rules of this game. It is a simple javascript game where two players take turns marking the spaces in a 3×3 grid with X’s and O’s, with the goal of getting three of their marks in a row, either horizontally, vertically, or diagonally. The player who succeeds in placing three of their marks in a row is the winner.

Step 1: Basic structure of Tic Tac Toe game

First I created a basic structure of this project using the following HTML and CSS codes. Besides, I have added a heading here mainly to enhance the beauty. This heading is created by H1 tag in HTML. 

<div class="container">
  <h1>Tic-Tac-Toe</h1>

</div>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #eee;
}

h1 {
  font-size: 4rem;
  margin-bottom: 0.5em;
}

Basic structure of Tic Tac Toe game

Step 2: Create a place to play Tic Tac Toe games

Now create a small area for this tic tac toe javascript. Within this box are nine smaller boxes into which players can input their symbols. Also we designed this area by some css.

<div class="play-area">

</div>
.play-area {
  display: grid;
  box-shadow: 0 0 20px rgba(0,139,253,0.25);
  grid-template-columns: auto auto auto;
  background-color: #fff;
  padding: 20px;
}

Create a place to play Tic Tac Toe games

Step 3: Results of the JavaScript Tic Tac Toe game

Now another heading we need to create is within this project(How to Build Tic Tac Toe with JavaScript, HTML and CSS). This heading is mainly for showing results. 

Although this heading is currently not visible to us because there is no information in the heading. We will add this information via javascript. Results will be available automatically after Tic Tac Toe game is over.

<h2 id="winner"></h2>
h2 {
  margin-top: 1em;
  font-size: 2rem;
  margin-bottom: 0.5em;
}

Step 4: Create the game's restart button

Now we have to create a button in this simple Tic-Tac-Toe game. This button will basically work as a reset button. When you click on this button, the game will restart from a new state.

<button onclick="reset_board()">RESET</button>
button {
  outline: none;
  background: rgb(8, 88, 208);
  padding: 12px 40px;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  border: none;
  transition: all 0.2s ease-in-out;
}

button:hover {
  cursor: pointer;
  background: green;
  color: white;
}

Results of the JavaScript Tic Tac Toe game

Step 5: Activate Simple Tic-Tac-Toe with JavaScript

Above we have designed this project(How to create a tic tac toe grid in JavaScript?). Now it’s time to make it work using JavaScript. We have used quite a bit of JavaScript code to make this game work. But don’t worry I will tell you all the codes step by step.

const player = "O";
const computer = "X";

let board_full = false;
let play_board = ["", "", "", "", "", "", "", "", ""];

const board_container = document.querySelector(".play-area");
const winner_statement = document.getElementById("winner");

With these variables, you’ve defined the player and computer as “O” and “X” respectively, and created an empty board to play on. The board_full variable will be used to check if the board is full and the game is over, and the play_board array will hold the state of the game. 

The board_container variable is used to select the element on the page where the Tic Tac Toe board will be rendered, and the winner_statement variable is used to select the element where the winner statement will be displayed.

check_board_complete = () => {
  let flag = true;
  play_board.forEach(element => {
    if (element != player && element != computer) {
      flag = false;
    }
  });
  board_full = flag;
};

The function is using the forEach() method to iterate over the play_board array, and it checks if each element is not equal to the player or computer. If any element is not equal to the player or computer, it sets the flag variable to false and breaks out of the loop. 

If the loop completes and the flag variable is still true, it means that all the elements are equal to the player or computer, and the board is full. Then the board_full variable is updated to reflect that the board is full.

You can use this function at the end of the player’s turn and computer’s turn, to check if the board is full and the game is over.

const check_line = (a, b, c) => {
  return (
    play_board[a] == play_board[b] &&
    play_board[b] == play_board[c] &&
    (play_board[a] == player || play_board[a] == computer)
  );
};

The function takes in 3 arguments, a, b, c, which represent the indices of the 3 cells on the board that need to be checked for a winning line.

The function uses the ternary operator to check if the values at the indices a, b, c in the play_board array are the same and not empty. If the values are the same and not empty, the function returns true, otherwise it returns false.

You can use this function in a larger function that checks for all the possible winning combinations on the board.

const check_match = () => {
  for (i = 0; i < 9; i += 3) {
    if (check_line(i, i + 1, i + 2)) {
      document.querySelector(`#block_${i}`).classList.add("win");
      document.querySelector(`#block_${i + 1}`).classList.add("win");
      document.querySelector(`#block_${i + 2}`).classList.add("win");
      return play_board[i];
    }
  }
  for (i = 0; i < 3; i++) {
    if (check_line(i, i + 3, i + 6)) {
      document.querySelector(`#block_${i}`).classList.add("win");
      document.querySelector(`#block_${i + 3}`).classList.add("win");
      document.querySelector(`#block_${i + 6}`).classList.add("win");
      return play_board[i];
    }
  }
  if (check_line(0, 4, 8)) {
    document.querySelector("#block_0").classList.add("win");
    document.querySelector("#block_4").classList.add("win");
    document.querySelector("#block_8").classList.add("win");
    return play_board[0];
  }
  if (check_line(2, 4, 6)) {
    document.querySelector("#block_2").classList.add("win");
    document.querySelector("#block_4").classList.add("win");
    document.querySelector("#block_6").classList.add("win");
    return play_board[2];
  }
  return "";
};

The check_match() function uses two for loops to check for all the possible winning combinations on the board, both horizontally and vertically. It also includes two if statements to check for the two diagonal winning combinations.

The function uses the check_line function you created earlier to check if a line is a winning line. If a winning line is found, the function highlights the winning cells by adding the “win” class to them. This class can be used in your CSS to change the appearance of the winning cells, for example by adding a different background color.

The function also returns the value of the first cell in the winning line, which should be either “X” or “O” depending on who won the game.

You can use this function in another function that checks for a win or a draw and updates the UI accordingly.

const check_for_winner = () => {
  let res = check_match()
  if (res == player) {
    winner.innerText = "Winner is player!!";
    winner.classList.add("playerWin");
    board_full = true
  } else if (res == computer) {
    winner.innerText = "Winner is computer";
    winner.classList.add("computerWin");
    board_full = true
  } else if (board_full) {
    winner.innerText = "Draw!";
    winner.classList.add("draw");
  }
};

This code looks like it’s checking for a winner in a javascript Tic Tac Toe game. The check_line function takes in 3 indices of the play_board array and checks if the values at those indices are equal to each other and if they are equal to either the player or computer. 

The check_match function uses the check_line function to check for a winner across the rows, columns, and diagonals of the Tic Tac Toe board. If a winning line is found, the check_match function adds a “win” class to the corresponding HTML elements of the Tic Tac Toe board and returns the winning player. 

The check_for_winner function calls the check_match function and checks the returned value. If the returned value is the player, it sets the winner statement to “Winner is player!!” and adds playerWin class.

const render_board = () => {
  board_container.innerHTML = ""
  play_board.forEach((e, i) => {
    board_container.innerHTML += `<div id="block_${i}" class="block" onclick="addPlayerMove(${i})">${play_board[i]}</div>`
    if (e == player || e == computer) {
      document.querySelector(`#block_${i}`).classList.add("occupied");
    }
  });
};

The render_board() function creates a grid of divs in the HTML, each one representing a cell in the Tic-Tac-Toe board. The addPlayerMove() function allows the player to make a move by clicking on a cell in the grid. 

The check_board_complete() function checks if the board is full and the check_for_winner() function checks for a winner or draw. It also uses the check_match() function to check if any winning combination is formed.

const game_loop = () => {
  render_board();
  check_board_complete();
  check_for_winner();
}

The game_loop function combines all of these functions together to create the game loop that updates the game state and renders the game board to the user. 

It calls the render_board function to render the current state of the game board to the user, check_board_complete to check if the board is full and check_for_winner which checks if there is a winner or a draw, and updates the UI accordingly.

const addPlayerMove = e => {
  if (!board_full && play_board[e] == "") {
    play_board[e] = player;
    game_loop();
    addComputerMove();
  }
};

The above code defines a Tic Tac Toe game in JavaScript that uses HTML and CSS for the game board and styling. The game’s state is maintained in the play_board array, and the game_loop function updates the state of the game, renders the board, and checks for a winner. 

The addPlayerMove function allows players to make a move by clicking on a block on the board, and the addComputerMove function allows the computer to make a move. The check_match, check_for_winner, render_board functions are also defined and used in the game loop to check for a winner or a draw, render the board and check if the game is complete.

const addComputerMove = () => {
  if (!board_full) {
    do {
      selected = Math.floor(Math.random() * 9);
    } while (play_board[selected] != "");
    play_board[selected] = computer;
    game_loop();
  }
};

Great! Your code is now complete and should be able to run a game of javascript Tic-Tac-Toe between a player and the computer. The player can make moves by clicking on the blocks on the game board, and the computer will randomly select an available space to make its move. The code also checks for a winner or a draw after each move, and updates the game board and the winner statement accordingly.

const reset_board = () => {
  play_board = ["", "", "", "", "", "", "", "", ""];
  board_full = false;
  winner.classList.remove("playerWin");
  winner.classList.remove("computerWin");
  winner.classList.remove("draw");
  winner.innerText = "";
  render_board();
};

This code defines a function called “reset_board” that sets the play_board array back to an empty array, sets the board_full variable to false, removes any classes related to winning or drawing from the winner element, sets the inner text of the winner element to an empty string, and then calls the render_board function to update the display. This function is likely intended to be used as a way to clear the game board and start a new game.

//initial render
render_board();

That’s it, you have created a complete Tic-Tac-Toe game using JavaScript. To start the game, the player can click on any of the empty blocks on the board and the computer will automatically make its move. 

The game checks for a winner or a draw after each move and updates the board accordingly. The game can also be reset by calling the reset_board() function.

Step 6: Basic design of simple Tic-Tac-Toe game with CSS

Above we enabled Tic-tac-toe in JavaScript by JavaScript. Now we need to design it with some more CSS. We know there are 9 small boxes in this game that are currently too small for us to see. So a fixed size must be defined for each box.

.block {
  display: flex;
  width: 100px;
  height: 100px;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
  border: 3px solid black;
  transition: background 0.2s ease-in-out;
}

.block:hover {
  cursor: pointer;
  background: #0ff30f;
}

.occupied:hover {
  background: #ff3a3a;
}

.win {
  background: #0ff30f;
}

.win:hover {
  background: #0ff30f;
}

Activate Simple Tic-Tac-Toe with JavaScript

As we can see in the above image there are 9 boxes created. But we want to hide some borders here. We will use the following CSS to hide those borders.

#block_0,
#block_1,
#block_2 {
  border-top: none;
}

#block_0,
#block_3,
#block_6 {
  border-left: none;
}

#block_6,
#block_7,
#block_8 {
  border-bottom: none;
}

#block_2,
#block_5,
#block_8 {
  border-right: none;
}
.playerWin {
  color: green;
}

.computerWin {
  color: red;
}

.draw {
  color: orangered;
}

We’ll make this project(Create a Tic-Tac-Toe with HTML and JavaScript) responsive  using a small amount of our own code. Here for Responsive only headings have been resized or reduced.

@media only screen and (max-width: 600px) {

  h1 {
    font-size: 3rem;
    margin-bottom: 0.5em;
  }

  h2 {
    margin-top: 1em;
    font-size: 1.3rem;
  }
}

Create Tic Tac Toe with JavaScript

Hope from this tutorial you got to know how I made this Simple Tic-Tac-Toe JavaScript game.

Not only this but earlier I have shared more advanced game tutorials. Earlier I shared another JavaScript Tic-Tac-Toe which is basically made by Simple Code. Where you can play with two users rather than with the computer. Be sure to comment how you like this project(How to Recreate Tic-Tac-Toe in Vanilla JavaScript).

Original article source at: https://foolishdeveloper.com/

#javascript 

Chloe  Butler

Chloe Butler

1667425440

Pdf2gerb: Perl Script Converts PDF Files to Gerber format

pdf2gerb

Perl script converts PDF files to Gerber format

Pdf2Gerb generates Gerber 274X photoplotting and Excellon drill files from PDFs of a PCB. Up to three PDFs are used: the top copper layer, the bottom copper layer (for 2-sided PCBs), and an optional silk screen layer. The PDFs can be created directly from any PDF drawing software, or a PDF print driver can be used to capture the Print output if the drawing software does not directly support output to PDF.

The general workflow is as follows:

  1. Design the PCB using your favorite CAD or drawing software.
  2. Print the top and bottom copper and top silk screen layers to a PDF file.
  3. Run Pdf2Gerb on the PDFs to create Gerber and Excellon files.
  4. Use a Gerber viewer to double-check the output against the original PCB design.
  5. Make adjustments as needed.
  6. Submit the files to a PCB manufacturer.

Please note that Pdf2Gerb does NOT perform DRC (Design Rule Checks), as these will vary according to individual PCB manufacturer conventions and capabilities. Also note that Pdf2Gerb is not perfect, so the output files must always be checked before submitting them. As of version 1.6, Pdf2Gerb supports most PCB elements, such as round and square pads, round holes, traces, SMD pads, ground planes, no-fill areas, and panelization. However, because it interprets the graphical output of a Print function, there are limitations in what it can recognize (or there may be bugs).

See docs/Pdf2Gerb.pdf for install/setup, config, usage, and other info.


pdf2gerb_cfg.pm

#Pdf2Gerb config settings:
#Put this file in same folder/directory as pdf2gerb.pl itself (global settings),
#or copy to another folder/directory with PDFs if you want PCB-specific settings.
#There is only one user of this file, so we don't need a custom package or namespace.
#NOTE: all constants defined in here will be added to main namespace.
#package pdf2gerb_cfg;

use strict; #trap undef vars (easier debug)
use warnings; #other useful info (easier debug)


##############################################################################################
#configurable settings:
#change values here instead of in main pfg2gerb.pl file

use constant WANT_COLORS => ($^O !~ m/Win/); #ANSI colors no worky on Windows? this must be set < first DebugPrint() call

#just a little warning; set realistic expectations:
#DebugPrint("${\(CYAN)}Pdf2Gerb.pl ${\(VERSION)}, $^O O/S\n${\(YELLOW)}${\(BOLD)}${\(ITALIC)}This is EXPERIMENTAL software.  \nGerber files MAY CONTAIN ERRORS.  Please CHECK them before fabrication!${\(RESET)}", 0); #if WANT_DEBUG

use constant METRIC => FALSE; #set to TRUE for metric units (only affect final numbers in output files, not internal arithmetic)
use constant APERTURE_LIMIT => 0; #34; #max #apertures to use; generate warnings if too many apertures are used (0 to not check)
use constant DRILL_FMT => '2.4'; #'2.3'; #'2.4' is the default for PCB fab; change to '2.3' for CNC

use constant WANT_DEBUG => 0; #10; #level of debug wanted; higher == more, lower == less, 0 == none
use constant GERBER_DEBUG => 0; #level of debug to include in Gerber file; DON'T USE FOR FABRICATION
use constant WANT_STREAMS => FALSE; #TRUE; #save decompressed streams to files (for debug)
use constant WANT_ALLINPUT => FALSE; #TRUE; #save entire input stream (for debug ONLY)

#DebugPrint(sprintf("${\(CYAN)}DEBUG: stdout %d, gerber %d, want streams? %d, all input? %d, O/S: $^O, Perl: $]${\(RESET)}\n", WANT_DEBUG, GERBER_DEBUG, WANT_STREAMS, WANT_ALLINPUT), 1);
#DebugPrint(sprintf("max int = %d, min int = %d\n", MAXINT, MININT), 1); 

#define standard trace and pad sizes to reduce scaling or PDF rendering errors:
#This avoids weird aperture settings and replaces them with more standardized values.
#(I'm not sure how photoplotters handle strange sizes).
#Fewer choices here gives more accurate mapping in the final Gerber files.
#units are in inches
use constant TOOL_SIZES => #add more as desired
(
#round or square pads (> 0) and drills (< 0):
    .010, -.001,  #tiny pads for SMD; dummy drill size (too small for practical use, but needed so StandardTool will use this entry)
    .031, -.014,  #used for vias
    .041, -.020,  #smallest non-filled plated hole
    .051, -.025,
    .056, -.029,  #useful for IC pins
    .070, -.033,
    .075, -.040,  #heavier leads
#    .090, -.043,  #NOTE: 600 dpi is not high enough resolution to reliably distinguish between .043" and .046", so choose 1 of the 2 here
    .100, -.046,
    .115, -.052,
    .130, -.061,
    .140, -.067,
    .150, -.079,
    .175, -.088,
    .190, -.093,
    .200, -.100,
    .220, -.110,
    .160, -.125,  #useful for mounting holes
#some additional pad sizes without holes (repeat a previous hole size if you just want the pad size):
    .090, -.040,  #want a .090 pad option, but use dummy hole size
    .065, -.040, #.065 x .065 rect pad
    .035, -.040, #.035 x .065 rect pad
#traces:
    .001,  #too thin for real traces; use only for board outlines
    .006,  #minimum real trace width; mainly used for text
    .008,  #mainly used for mid-sized text, not traces
    .010,  #minimum recommended trace width for low-current signals
    .012,
    .015,  #moderate low-voltage current
    .020,  #heavier trace for power, ground (even if a lighter one is adequate)
    .025,
    .030,  #heavy-current traces; be careful with these ones!
    .040,
    .050,
    .060,
    .080,
    .100,
    .120,
);
#Areas larger than the values below will be filled with parallel lines:
#This cuts down on the number of aperture sizes used.
#Set to 0 to always use an aperture or drill, regardless of size.
use constant { MAX_APERTURE => max((TOOL_SIZES)) + .004, MAX_DRILL => -min((TOOL_SIZES)) + .004 }; #max aperture and drill sizes (plus a little tolerance)
#DebugPrint(sprintf("using %d standard tool sizes: %s, max aper %.3f, max drill %.3f\n", scalar((TOOL_SIZES)), join(", ", (TOOL_SIZES)), MAX_APERTURE, MAX_DRILL), 1);

#NOTE: Compare the PDF to the original CAD file to check the accuracy of the PDF rendering and parsing!
#for example, the CAD software I used generated the following circles for holes:
#CAD hole size:   parsed PDF diameter:      error:
#  .014                .016                +.002
#  .020                .02267              +.00267
#  .025                .026                +.001
#  .029                .03167              +.00267
#  .033                .036                +.003
#  .040                .04267              +.00267
#This was usually ~ .002" - .003" too big compared to the hole as displayed in the CAD software.
#To compensate for PDF rendering errors (either during CAD Print function or PDF parsing logic), adjust the values below as needed.
#units are pixels; for example, a value of 2.4 at 600 dpi = .0004 inch, 2 at 600 dpi = .0033"
use constant
{
    HOLE_ADJUST => -0.004 * 600, #-2.6, #holes seemed to be slightly oversized (by .002" - .004"), so shrink them a little
    RNDPAD_ADJUST => -0.003 * 600, #-2, #-2.4, #round pads seemed to be slightly oversized, so shrink them a little
    SQRPAD_ADJUST => +0.001 * 600, #+.5, #square pads are sometimes too small by .00067, so bump them up a little
    RECTPAD_ADJUST => 0, #(pixels) rectangular pads seem to be okay? (not tested much)
    TRACE_ADJUST => 0, #(pixels) traces seemed to be okay?
    REDUCE_TOLERANCE => .001, #(inches) allow this much variation when reducing circles and rects
};

#Also, my CAD's Print function or the PDF print driver I used was a little off for circles, so define some additional adjustment values here:
#Values are added to X/Y coordinates; units are pixels; for example, a value of 1 at 600 dpi would be ~= .002 inch
use constant
{
    CIRCLE_ADJUST_MINX => 0,
    CIRCLE_ADJUST_MINY => -0.001 * 600, #-1, #circles were a little too high, so nudge them a little lower
    CIRCLE_ADJUST_MAXX => +0.001 * 600, #+1, #circles were a little too far to the left, so nudge them a little to the right
    CIRCLE_ADJUST_MAXY => 0,
    SUBST_CIRCLE_CLIPRECT => FALSE, #generate circle and substitute for clip rects (to compensate for the way some CAD software draws circles)
    WANT_CLIPRECT => TRUE, #FALSE, #AI doesn't need clip rect at all? should be on normally?
    RECT_COMPLETION => FALSE, #TRUE, #fill in 4th side of rect when 3 sides found
};

#allow .012 clearance around pads for solder mask:
#This value effectively adjusts pad sizes in the TOOL_SIZES list above (only for solder mask layers).
use constant SOLDER_MARGIN => +.012; #units are inches

#line join/cap styles:
use constant
{
    CAP_NONE => 0, #butt (none); line is exact length
    CAP_ROUND => 1, #round cap/join; line overhangs by a semi-circle at either end
    CAP_SQUARE => 2, #square cap/join; line overhangs by a half square on either end
    CAP_OVERRIDE => FALSE, #cap style overrides drawing logic
};
    
#number of elements in each shape type:
use constant
{
    RECT_SHAPELEN => 6, #x0, y0, x1, y1, count, "rect" (start, end corners)
    LINE_SHAPELEN => 6, #x0, y0, x1, y1, count, "line" (line seg)
    CURVE_SHAPELEN => 10, #xstart, ystart, x0, y0, x1, y1, xend, yend, count, "curve" (bezier 2 points)
    CIRCLE_SHAPELEN => 5, #x, y, 5, count, "circle" (center + radius)
};
#const my %SHAPELEN =
#Readonly my %SHAPELEN =>
our %SHAPELEN =
(
    rect => RECT_SHAPELEN,
    line => LINE_SHAPELEN,
    curve => CURVE_SHAPELEN,
    circle => CIRCLE_SHAPELEN,
);

#panelization:
#This will repeat the entire body the number of times indicated along the X or Y axes (files grow accordingly).
#Display elements that overhang PCB boundary can be squashed or left as-is (typically text or other silk screen markings).
#Set "overhangs" TRUE to allow overhangs, FALSE to truncate them.
#xpad and ypad allow margins to be added around outer edge of panelized PCB.
use constant PANELIZE => {'x' => 1, 'y' => 1, 'xpad' => 0, 'ypad' => 0, 'overhangs' => TRUE}; #number of times to repeat in X and Y directions

# Set this to 1 if you need TurboCAD support.
#$turboCAD = FALSE; #is this still needed as an option?

#CIRCAD pad generation uses an appropriate aperture, then moves it (stroke) "a little" - we use this to find pads and distinguish them from PCB holes. 
use constant PAD_STROKE => 0.3; #0.0005 * 600; #units are pixels
#convert very short traces to pads or holes:
use constant TRACE_MINLEN => .001; #units are inches
#use constant ALWAYS_XY => TRUE; #FALSE; #force XY even if X or Y doesn't change; NOTE: needs to be TRUE for all pads to show in FlatCAM and ViewPlot
use constant REMOVE_POLARITY => FALSE; #TRUE; #set to remove subtractive (negative) polarity; NOTE: must be FALSE for ground planes

#PDF uses "points", each point = 1/72 inch
#combined with a PDF scale factor of .12, this gives 600 dpi resolution (1/72 * .12 = 600 dpi)
use constant INCHES_PER_POINT => 1/72; #0.0138888889; #multiply point-size by this to get inches

# The precision used when computing a bezier curve. Higher numbers are more precise but slower (and generate larger files).
#$bezierPrecision = 100;
use constant BEZIER_PRECISION => 36; #100; #use const; reduced for faster rendering (mainly used for silk screen and thermal pads)

# Ground planes and silk screen or larger copper rectangles or circles are filled line-by-line using this resolution.
use constant FILL_WIDTH => .01; #fill at most 0.01 inch at a time

# The max number of characters to read into memory
use constant MAX_BYTES => 10 * M; #bumped up to 10 MB, use const

use constant DUP_DRILL1 => TRUE; #FALSE; #kludge: ViewPlot doesn't load drill files that are too small so duplicate first tool

my $runtime = time(); #Time::HiRes::gettimeofday(); #measure my execution time

print STDERR "Loaded config settings from '${\(__FILE__)}'.\n";
1; #last value must be truthful to indicate successful load


#############################################################################################
#junk/experiment:

#use Package::Constants;
#use Exporter qw(import); #https://perldoc.perl.org/Exporter.html

#my $caller = "pdf2gerb::";

#sub cfg
#{
#    my $proto = shift;
#    my $class = ref($proto) || $proto;
#    my $settings =
#    {
#        $WANT_DEBUG => 990, #10; #level of debug wanted; higher == more, lower == less, 0 == none
#    };
#    bless($settings, $class);
#    return $settings;
#}

#use constant HELLO => "hi there2"; #"main::HELLO" => "hi there";
#use constant GOODBYE => 14; #"main::GOODBYE" => 12;

#print STDERR "read cfg file\n";

#our @EXPORT_OK = Package::Constants->list(__PACKAGE__); #https://www.perlmonks.org/?node_id=1072691; NOTE: "_OK" skips short/common names

#print STDERR scalar(@EXPORT_OK) . " consts exported:\n";
#foreach(@EXPORT_OK) { print STDERR "$_\n"; }
#my $val = main::thing("xyz");
#print STDERR "caller gave me $val\n";
#foreach my $arg (@ARGV) { print STDERR "arg $arg\n"; }

Download Details:

Author: swannman
Source Code: https://github.com/swannman/pdf2gerb

License: GPL-3.0 license

#perl 

Angela  Dickens

Angela Dickens

1596090180

Commonly Used HTML Tags with Examples

HTML tags are keywords used in HTML to display web-pages with certain properties. They are further used for defining HTML elements. An HTML element consists of a starting tag, some content, and an ending tag. The web browser reads the HTML document from top to bottom, left to right. Each HTML tag defines a new property that helps in rendering the website.

HTML Tags

HTML Tags

The ‘<>’ brackets contain an HTML tag. There are two types of HTML tags- empty tags or singleton tags and container tags. Singleton tags or empty tags do not contain any content such as an image or a paragraph and hence do not need to be closed, whereas container tags should be closed.

Syntax

  1. Some Content

Examples of:

Empty tag: 
,


,etc.

Container tags: 

Paragraph

Link

  1. <!DOCTYPE>
  2. Paragraph

  3. Heading

  4. Bold
  5. Italic
  6. Underline

Output-

HTML Tags example

Head tags:

,<style>,<script>,<link>,<meta> and <base>. <p>Text-formatting tags:</p> <p><h>,<b>,<strong>,<small>,<pre>,<i>,<em>,<sub>,<sup>,<ins>,<dfn>,<del>,<div> and <span>.</p> <p>Link tags:</p> <p><a>, <base>.</p> <p>List tags:</p> <ul>, <ol>, <li>, <dl>, <dd> <p>Table tags:</p> <table> ,<tr> , <td>, <th>, <thead>, <tbody>, <tfoot>. <p>Form tags:</p> <form>, <input>, <select>, <option>, <button>, <label>, <fieldset>, <textarea>. <p>Scripting tags:</p> <script>, <noscript> Image and Object tags: <img>, <figure>, <figcaption>, <area>, <map>, <object>. Here is an alphabetical list of tags used in HTML.

#html tutorials #html image tags #html link tags #html list tags #html tags #html

Ava Watson

Ava Watson

1595318322

Know Everything About HTML With HTML Experts

HTML stands for a hypertext markup language. For the designs to be displayed in web browser HTML is the markup language. Technologies like Cascading style sheets (CSS) and scripting languages such as JavaScript assist HTML. With the help of HTML websites and the web, designs are created. Html has a wide range of academic applications. HTML has a series of elements. HTML helps to display web content. Its elements tell the web how to display the contents.

The document component of HTML is known as an HTML element. HTML element helps in displaying the web pages. An HTML document is a mixture of text nodes and HTML elements.

Basics of HTML are-

The simple fundamental components oh HTML is

  1. Head- the setup information for the program and web pages is carried in the head
  2. Body- the actual substance that is to be shown on the web page is carried in the body
  3. HTML- information starts and ends with and labels.
  4. Comments- come up in between

Html versions timeline

  1. HTML was created in 1990. Html is a program that is updated regularly. the timeline for the HTML versions is
  2. HTML 2- November, 1995
  3. HTML 3- January, 1997
  4. HTML 4- December, 1997; April, 1998; December, 1999; May, 2000
  5. HTML 5- October, 2014; November, 2016; December, 2017

HTML draft version timelines are

  1. October 1991
  2. June 1992
  3. November 1992
  4. June 1993
  5. November 1993
  6. November 1994
  7. April 1995
  8. January 2008
  9. HTML 5-
    2011, last call
    2012 candidate recommendation
    2014 proposed recommendation and recommendation

HTML helps in creating web pages. In web pages, there are texts, pictures, colouring schemes, tables, and a variety of other things. HTML allows all these on a web page.
There are a lot of attributes in HTML. It may get difficult to memorize these attributes. HTML is a tricky concept. Sometimes it gets difficult to find a single mistake that doesn’t let the web page function properly.

Many minor things are to be kept in mind in HTML. To complete an HTML assignment, it is always advisable to seek help from online experts. These experts are well trained and acknowledged with the subject. They provide quality content within the prescribed deadline. With several positive reviews, the online expert help for HTML assignment is highly recommended.

#html assignment help #html assignment writing help #online html assignment writing help #html assignment help service online #what is html #about html

Syu Swiy

Syu Swiy

1643124624

List Useful list of Codes for HTML Symbols or Special Characters

List of useful lists of Codes for HTML Symbols or Special Characters - For those of you who have hobbies as blog writers or admins as well as website creators, you may be familiar with Codes for HTML Symbols or Characters, the combination of the code is written in the html script writing section and when run on a browser will display a certain symbol or character. Its function is to add symbols or special characters in existing posts on web pages or blogs. The way it works is that the symbols or special characters are converted into certain character combination codes, which will later be translated by the browser into certain symbols or characters. Read more in ☞ https://artinfo.my.id/en/translate/MTM0NE1LNA==/list-daftar-berguna-kode-untuk-simbol-atau-karakter-khusus-html

#html_code #symbols_or_special_characters_html #html_character_code #html_character #html_code_symbol #list_html_symbol_code_list