|
Member 15952980 wrote: So does using Node mean you can skip learing php altogether? Yes
Member 15952980 wrote: Also, considering it is javascript based, are the server side scripts run entirely on the server as with php? Yes. One of the main advantages to Node too, is that you can have what's called an isomorphic application. Which is a fancy of way of saying you can run the same code on both the client and server. Stuff that accesses the DOM will be client only, but for algorithmic type routines it's the same code.
Member 15952980 wrote: Or are there client and server security concerns that put using it at disadvantage compared to using an entirely server side language such as php? No security concerns that PHP wouldn't also suffer. The main considerations are performance and available libraries. Google has put a lot of work into V8 (the JS engine Node is built on), so it's not nearly as slow as people would think. PHP can pre-compile into bytecode to speed up parsing prior to execution, but V8 also JITs in real time to native code in memory. Don't get me wrong, V8 will never be as fast as C/C++ or Rust and it's single threaded. But when compared to things like PHP, it does pretty well.
PHP vs Node js - Which programs are fastest?
PHP has a ton of built in functionality, like say for editing PDF files. Node doesn't. Fortunately, the community is huge for Node so finding a package to do most stuff is rarely a problem. In fact, it's so huge the real problem will be knowing which packages to avoid.
I say this as a dude who used to love PHP. I'll always have a fond soft spot for it, but times change.
Jeremy Falcon
|
|
|
|
|
Thank you very much Jeremy for taking the time to answer my questions and concerns.
I did do a course on PHP years ago, just before the laucnch of Node.js, and figured it would be easiest to just go back to learning that from scratch. But as you say times change.
You mention that PHP has a ton of functionality that Node doesn't.... My limited knowledge of php did leave me wanting to go forwards with certain capabilities. In a personal capacity I would like to build a music database. Would I be able to use Node, in conjuntion with mysql to:
- make directories (to, for example, store uploaded mp3 files)
- make pages (to, for example, print html code to make a html document)
Thanks in advance for your consideration
|
|
|
|
|
You'll be just fine in Node. It offers a bunch of modules to access things like the file system... on the server side. And there are plenty of ways to connect to a DB such as MySQL.
Jeremy Falcon
|
|
|
|
|
I need to do a small html code that looks like this: Imgupx - Upload and share your images[^]
I have tried some code, but it doesn't work:
<div>
<p>ER</p>
<img src="C:\Users\myname\Downloads\cici.png"/>
<p>341 Ohm</p>
<p>EN</p>
<img src="C:\Users\myname\Downloads\bibi.png"/>
<p>356</p>
</div>
|
|
|
|
|
For a personal web page only accessed from the same PC as the one it is being served from, you will have to use the 'file:' protocol (like http: / https: for remote sites). As you have it, it is looking for the 'C:' protocol - this is not a defined protocol. IIRC, the ':' after the 'C' needs encoding as a | e.g.
<img src="file:C|\Users\myname\Downloads\cici.png"/> For a web page accessed from a different location, you will have to save the images in a special folder (details vary based on the web server software - see your documentation) and the name will be relative to that server's root (and, in that instance, you can skipped putting the protocol component).
|
|
|
|
|
The image is for testing purpose only, the fact is the html page is like in the image: Imgupx - Upload and share your images[^]
How can I arrange multiple text and image anxt again like the image reveal ?
|
|
|
|
|
I have made it:
<div style="float:left;">
<p>ER</p>
<img src="C:\Users\myname\Downloads\cici.png"/>
<p>341 Ohm</p>
</div>
<div style="float:left;">
<p>EN</p>
<img src="C:\Users\myname\Downloads\bibi.png"/>
<p>356</p>
</div>
|
|
|
|
|
Your life will become much easier if you use a local web server for development.
- Install Node.js.
- Install a global npm package like local-web-server,
npm i -g local-web-server . - Go to your HTML files and run the web server in that directory,
ws .
If you ever do upload your work to a remote server, this will make your life much easier. Not to mention, things like cookies do not work when HTML pages are viewed over the file protocol.
Jeremy Falcon
|
|
|
|
|
How can I list several div's tags with the following pattern ?
Untitled hosted at ImgBB — ImgBB[^]
I have tried something like this:
.title{
display: inline;
}
.icon{
display: block;
}
.item-text{
float: right;
}
<div class="item-main">
<div class="title">
My title
</div>
<div class="icon">
<img src="...">
</div>
<div class="item-text">
Lorepsum imte ...
</div>
</div>
but don't work correctly.
modified 6-Mar-23 9:29am.
|
|
|
|
|
If you want the text to wrap, then float the image:
.title {
display: block;
}
.icon {
float: left;
margin-inline-end: .5em;
margin-block-end: .5em;
}
.item-text {
}
Demo[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Excellent, and if I would list several times that pattern, one under another ?
I did:
<div>
<div class="title">
Introduction To XHTML 1.0
</div>
<div class="icon">
<img src="http://dummyimage.com/200x200/f0f/fff" />
</div>
<div class="item-text">
Topics includes: Introduction To XHTML 1.0,
Introduction To Tag and Attribute Syntax,
Introduction To Element Content Syntax,
Document Structure and Head Level Tags,
Body Tag and Block Level Tags,
Understanding In-line Elements and Tags, etc
</div>
<div class="title">
Introduction To XHTML 2.0
</div>
<div class="icon">
<img src="http://dummyimage.com/200x200/f0f/fff" />
</div>
<div class="item-text">
222 2222 Topics includes: Introduction To XHTML 1.0,
Introduction To Tag and Attribute Syntax,
Introduction To Element Content Syntax,
Document Structure and Head Level Tags,
Body Tag and Block Level Tags,
Understanding In-line Elements and Tags, etc
</div>
</div>
but the pattern its not listed one under another.
|
|
|
|
|
Add clear: both; to the .title rule:
.title {
display: block;
clear: both;
} Demo[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you a lot Richard ! It works !
|
|
|
|
|
|
how we can can change a language English to Arabic integration in html
|
|
|
|
|
you need to add the dir and lang attributes to the tag in your HTML document.
The dir attribute specifies the direction of the text, and can have one of two values: rtl (right-to-left) for languages such as Arabic and ltr (left-to-right) for languages such as English.
The lang attribute specifies the language of the text, and should be set to the ISO 639-1 language code for the language you want to use, for Arabic, the language code is "ar".
Sample code will look something like this -
<!DOCTYPE html>
<html dir="rtl" lang="ar">
<head>
<meta charset="UTF-8">
<title>My Arabic Website</title>
</head>
<body>
<h1>مرحبا بالعالم</h1> <!--Hello World-->
<p>هذا هو موقعي الإلكتروني العربي.</p><!--This is my Arabic website-->
</body>
</html>
|
|
|
|
|
why doesn't the file I have submitted appear in the email?
|
|
|
|
|
You need to specify clearly which file did not show where, submitted how and in what email. What language, what code, where are the errors during debugging etc.
|
|
|
|
|
One or more of the following
You did not add it
It was too big
Something stripped it
You are looking in the wrong place
|
|
|
|
|
What are the scaling capabilities of Django?
|
|
|
|
|
When I enter the following into google it seems to return answers.
programming django scaling
|
|
|
|
|
Hello this is Gulshan Negi
Django, a high-level Python web framework, is capable of handling large amounts of data, but it depends on the specific use case and the infrastructure supporting it. Django's architecture is designed to be scalable and efficient, and it provides several features and tools to help manage large amounts of data, including:
1. Object-Relational Mapping (ORM): Django's ORM allows you to interact with databases in a high-level, Pythonic way, rather than writing raw SQL queries. This can make it easier to manage large amounts of data.
2. Database indexing: Django supports database indexing, which can improve the performance of queries on large amounts of data.
3. Caching: Django provides caching support, which can improve the performance of applications with large amounts of data.
4. Scalability: Django can be scaled horizontally, by adding more servers to a load-balanced cluster, to handle increased traffic and data.
Thanks
|
|
|
|
|
I have been working on a script trying to get images sent over to a telegram group. Though I assume it's requiring the use of http://localhost:32168/v1/vision/detection and this does not seem to be working. I have given it my best shot if anyone else can shine some light on this.
# Set the path to the folder of images
$imageFolderPath = "C:\images"
# Set the endpoint URL for the CodeProjectAI detection service
$endpointUrl = "http://localhost:32168/v1/vision/detection"
# Get a list of all the image files in the specified folder
$imageFiles = Get-ChildItem $imageFolderPath -Filter *.jpg,*.png
# Iterate through each image file
foreach ($imageFile in $imageFiles) {
# Read the image file into a byte array
$imageBytes = [System.IO.File]::ReadAllBytes($imageFile.FullName)
# Encode the image byte array as base64
$imageBase64 = [Convert]::ToBase64String($imageBytes)
# Set the POST body for the detection request
$requestBody = @{
image = $imageBase64
objects = @("human", "vehicle")
} | ConvertTo-Json
# Make the POST request to the detection service
$response = Invoke-RestMethod -Method Post -Uri $endpointUrl -Body $requestBody -ContentType "application/json"
# Check the response for detected objects
if ($response.objects) {
# If objects are detected, send the image to the Telegram group using CURL
# Replace YOUR_CHAT_ID and YOUR_BOT_TOKEN with the chat ID and bot token for your Telegram group
$curlCommand = "curl -s -X POST https://api.telegram.org/botYOUR_BOT_TOKEN/sendPhoto -d chat_id=YOUR_CHAT_ID -d photo=`"$($imageFile.FullName)`""
Invoke-Expression $curlCommand
}
# Delete the image file
Remove-Item $imageFile.FullName
}
modified 11-Jan-23 10:19am.
|
|
|
|
|
I have developed an online IDE to develop WEB applications. I just released version 1.0.0 Alpha. Does anyone know how I can find a group of users/people to test the tool to detect deficiencies? Is it allowed on this site to post the URL of my tool?
modified 24-Nov-22 17:41pm.
|
|
|
|
|