Add static content to category in ASP.net ,write code

//Add static content to category

string categoryName = “Books”;

string staticContent = “Description of Books”;

using (var dbContext = new DatabaseContext())
{
var category = dbContext.Categories.SingleOrDefault(c => c.Name == categoryName);
if (category != null)
{
category.StaticContent = staticContent;
dbContext.SaveChanges();
}
}
You should now be able to manage orders from Magento through ShipStation.

How to add shipstation in magento 2

Log into your Magento Admin Panel and navigate to System > Integrations
Click the Add New Integration button
Enter a name for the integration and click the API tab
Copy the Access Token and API Key from your ShipStation account
Paste the Access Token and API Key into the appropriate fields in Magento
Click the Save button
Log into your ShipStation account and navigate to Settings > Selling Channels
Select the Magento store you just integrated with
Enter the URL of your Magento store
Click the Test Connection button
If the connection is successful, click the Save button

Update IDs in identity table in SQL server

  1. Create a temporary table with the same schema as the identity table.
  2. Copy the data from the identity table into the temporary table.
  3. Update the IDs in the temporary table to the new values.
  4. Truncate the identity table.
  5. Copy the data in the temporary table back into the identity table.
  6. Drop the temporary table.

CREATE TABLE #TempTable (
ID INT IDENTITY,
Column1 VARCHAR(50),
Column2 VARCHAR(50)
);

INSERT INTO #TempTable
SELECT * FROM IdentityTable;

UPDATE #TempTable
SET ID = NewValue
WHERE ID = OldValue;

TRUNCATE TABLE IdentityTable;

INSERT INTO IdentityTable
SELECT * FROM #TempTable;

DROP TABLE #TempTable;

Rust Programming

Technology landscape is evolving day by day and we too find ourselves surrounded by new, innovative and emerging open source platforms and programming languages all the time. Rust programming is a new development that has created a complete paradigm shift in the way we use open source platforms in our day to day lives. This is actually a top hit open source trend that will rise to popularity in 2020 for sure. It is a programming language that offers the exact performances of C and C++ but with more safety options available. This language excellently stops developers shooting themselves in the foot.

Most of the programming languages come with safety vs. control tradeoff but rust language doesn’t. This language offers cent percent control with compromising anything on safety and quality. The appealing feature about this language is that it has a distinctive approach called built-in testing which will be a viable choice for an open source language. Developers will certainly be benefitted from this option. This is also an effective and helpful choice to languages like python and C to write down secure code. The language’s ability to have good control over low level details adds more to its benefits.
rust-programming
This programming language gives you the option of storing all the data on the heap or the stack. It also helps determine the compile time when memory can be cleaned up or no longer needed. This open source programming language focuses mainly on memory, speed, safety and parallelism. By using this open source language, today’s modern developers create an array of new and innovative software implications like operating systems, browse components, file systems, simulation engines and game engines. In short, they score more in computer generated simulations.

Why should you go for rust?

Everyone today is so curious to know about the growing excitement for rust language in Microsoft. Generally, we need replacements in certain times both in our life and technology, right? This language too comes in the same way and offers a perfect replacement for C and C++. Not only does it offer apparent and compelling advantage over C and C++ but also over any language available today.

  • Rust is an empowering technology that can be unbeaten in today’s time since it comes with a high level of control, safe memory and extraordinary performance.
  • Coming to the performance criteria, rust is amazingly fast and memory efficient and it can power performance even critical services with no run time or garbage collector. It can also integrate easily with other languages and run efficiently on embedded systems too.
  • Dependability of this language is too high since its rich type system guarantee thread safety and memory safety which enables you to eliminate a collection of bugs at compile time.
  • This language has a friendly compiler with constructive error messages that add more to its productiveness. This is actually an integrated package manager and build tool that comes with auto completion, type inspections and auto formatter.
  • The main difference between rust and C++ is the emphasis on writing safe code. With safe code option available in rust language, the objects are excellently managed from the beginning to the end. Unlike C or C++ programs, this rust programming language doesn’t do any pointer arithmetic or manage memory and hence it is considered as a safe choice by the developers.
  • It also adds the quality of life features of many high level languages. Its low overhead enables it to run excellently on even constrained resources.
  • Since it needs no runtime, this is considered as one of the few modern programming languages perfect for low resource environments.

From the aforementioned things, it is clear that rust language is appearing to be decent choice for building web applications that cannot be made possible with other languages. Even the longstanding scripting language JavaScript can never be up to the mark framed by rust. Beyond performance, memory safety and control, the appealing feature of this language is that it is hard to talk about since it is hard to measure. Being an extremely loved language, this open source platform is used by hundreds of thousands of companies around the world for high performance, better safety and increased productivity. Developers prefer to choose rust mainly for low resource, fast and better cross platform solutions. Do you know renowned software like Dropbox, Firefox and Cloudflare use rust? From embedded services to scalable web services, startups to bigger organizations, rust offers excellent solutions and extraordinary benefits.

Reasons behind the increasing popularity of rust

Since this language is developer friendly, it is getting more and more popular in 2020. This language is totally user friendly and so developers can easily use it and find bugs. Rust documentation is highly understandable, so anyone can go onto the official webpage, open documentation and comprehend things clearly. Apart from user friendly syntax, thread safety and memory safety operations make it stand ahead of other programming languages. In languages like C and C++, you can find thread operations little more complicated and you can eventually be messed up in your codes, but it is not in the case of rust. Thread operations in rust are extremely safe and easy to use. Since rust is a hobbyist language, anyone can use this platform and get benefitted from it, even random web crawlers too. Its hobbyist nature garnered the attention of many major companies which made this open source platform gain in more popularity in 2020. It is not a mainstream language, but it has the ability to become a major and leading player in software development in the forthcoming years. In addition to the above mentioned factors, there are also some more that are listed here:

  • Dependency resolution
  • Cargo repository
  • Performance equaling o above C++
  • Better ownership semantics
  • Elimination of data races
  • Elimination of undefined behavior issues
  • Good support for concurrency
  • Strong threading operations
  • Easy embedding

Put succinctly, Rust is a potent language and a perfect upgrade to all the programming languages available today. The language is totally worth a shot and once you get the feel of it, you will certainly fall for it forever.

python 2020

In present day times, there are different sites that are made utilizing the Python programming language. Numerous famous combinations have planned and created fruitful, strong applications utilizing this language. No big surprise, Python is the programming language for the future to come.

Before we go into the patterns of Python that are overwhelming the year and the following, let us rapidly look through what Python is.

Key Trends 2020 That Indicate Why Python is A Must Have In The Coming Year

  • Continually Upgrading Python Frameworks Are a Highlight

Python framework have consistently been its mainstay of solidarity. The trio – Django, TurboGears and Pyramid are instrumental in giving quicker assistance, a readied course of action for application improvement along these lines decreasing the lines of code.

The coming year vows to have productive upgradations to the 3 frameworks – more current libraries, modules to use the capability of this superb language and increment client base, multi-overlay. Let us have a temporary take a gander at the trio and what is normal out of them in year 2020:

Django:

Being one of the most effective and adaptable Python structure, Django takes a gander at limiting the advancement endeavors and time for web applications. Since it is open source, there are customary very good quality updates on its modules to facilitate the whole strategy. There are changed outsider libraries that have expanded the prominence of this language among driving undertakings like Spotify, YouTube and so on.

The year ahead is required to feature more up to date forms and updates of database libraries and other significant segments to keep up its amazingness.

TurboGears:

It is a full stack system, made to smoothen and affix the web application improvement method. This structure relies upon Ruby upon Rails and was made with the MVC design. It encourages engineers to modify negotiating prudence all through stages and decrease the lines of code.

The year ahead makes certain to observe an advancement in its solidness and limit parts. There could be a microframework coming up that will help designers in making programming expediently and there by save money on schedule, cash and endeavors.

Pyramid:

Considered as the ‘start little, finish enormous, remain completed’ system by the taskforce behind it, Pyramid is well-suited for creating fundamental web applications rapidly and is lightweight and adaptable in nature. It depends on the crucial of effortlessness and subsequently is a most loved of engineers who have enough capacity. It may not speak to tenderfoots however.

The year 2020 will observer expanding utilization of this system, particularly by experienced designers since it has a moderate structure and offers a ton of opportunity.

On a Wrapping Note

Python unquestionably has a brilliant future and a more brilliant 2020. Do we currently need to say much else regarding why Python is very nearly an essential fixing in the product life cycle! The reasons are very clear as above. No big surprise it has been giving the friends an extreme run for their fame!

 

PHP Functions

A PHP function is a block of statements that can be used repeatedly in a program. It is not executed when page is loaded, instead implemented when a function is called.

 

Function Syntax

Function function _name ()
{
Code to be executed;
}
 

Example

Function test()
{
Echo “hello”;
}
Test();
 

Function with arguments

Arguments or parameters are a piece of information, which is passed to function for executing the code. Functions can have any number of arguments, just separate them by comma.

 

Function test($fname)
{
Echo $fname;
}
Test(“janani”);

 

Default Argument Value

The default argument will be set, if a function is called without parameters.

 
Function test($fname=50)
{
Echo $fname;
}
Test();
 

Return value function

Return value function is used when a function has to return a value after code execution.

 
Function test ($a, $b)
{
Return $a+$b;
}
Echo Test(2,3);

HTML video Tag

The <video width=”300″ height=”150″> tag specifies video, such as a movie clip or other video streams.

There are 3 supported video formats for the <video> element: MP4, WebM, and Ogg

Normal Video:

<video width=”320″ height=”240″ controls>

<source src=”play.mp4″ type=”video/mp4″>

<source src=”play.ogg” type=”video/ogg”>

Your browser does not support the video tag.
</video>

Autoplay Video:

<video controls autoplay>

<source src=”songs.mp4″ type=”video/mp4″>

Your browser does not support the video tag.

</video>

PHP Form Validation

<?php
// define variables and set to empty values
$nameError = $emailError= $genderError = $websiteError = “”;
$name = $email = $gender = $comment = $website = “”;

if ($_SERVER[“REQUEST_METHOD”] == “POST”) {
if (empty($_POST[“name”])) {
$nameError = “Name is required”;
} else {
$name = test_input($_POST[“name”]);
// check if name only contains letters and whitespace
if (!preg_match(“/^[a-zA-Z ]*$/”,$name)) {
$nameError = “Only letters and white space allowed”;
}
}

if (empty($_POST[“email”])) {
$emailError = “Email is required”;
} else {
$email = test_input($_POST[“email”]);
// check if e-mail address syntax is valid
if (!preg_match(“/([\w\-]+\@[\w\-]+\.[\w\-]+)/”,$email)) {
$emailError = “Invalid email format”;
}
}

if (empty($_POST[“website”])) {
$website = “”;
} else {
$website = test_input($_POST[“website”]);
// check if URL address syntax is valid (this regular expression also allows dashes in the URL)
if (!preg_match(“/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i”,$website)) {
$websiteError = “Invalid URL”;
}
}

if (empty($_POST[“comment”])) {
$comment = “”;
} else {
$comment = test_input($_POST[“comment”]);
}

if (empty($_POST[“gender”])) {
$genderError = “Gender is required”;
} else {
$gender = test_input($_POST[“gender”]);
}
}

function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>

<h2>PHP Form Validation</h2>
<p><span class=”error”>* required field.</span></p>
<form method=”post” action=”<?php echo htmlspecialchars($_SERVER[“PHP_SELF”]);?>“> 
   Name: <input type=”text” name=”name”>
   <span class=”error”>* <?php echo $nameError;?></span>
   <br><br>
   E-mail: <input type=”text” name=”email”>
   <span class=”error”>* <?php echo $emailError;?></span>
   <br><br>
   Website: <input type=”text” name=”website”>
   <span class=”error”><?php echo $websiteError;?></span>
   <br><br>
   Comment: <textarea name=”comment” rows=”5″ cols=”40″></textarea>
   <br><br>
   Gender:
   <input type=”radio” name=”gender” value=”female”>Female
   <input type=”radio” name=”gender” value=”male”>Male
   <span class=”error”>* <?php echo $genderError;?></span>
   <br><br>
   <input type=”submit” name=”submit” value=”Submit”> 
</form>

<?php
echo “<h2>Your Input:</h2>”;
echo $name;
echo “<br>”;
echo $email;
echo “<br>”;
echo $website;
echo “<br>”;
echo $comment;
echo “<br>”;
echo $gender;
?>


</body>
</html>


 

PHP Form Validation

* required field.

Name:
*
E-mail:
*
Website:

Comment:

Gender:
Female
Male
*


Your Input:

Name
Test@gmail.com
www.example.com
Test Comment
Female

Simple Capcha using php

Capcha Code:

Save this code as “capcha.php”

[php]

<?php
session_start();
$text = rand(10000,99999);
$_SESSION[“vercode”] = $text;
$height = 25;
$width = 65;

$image_p = imagecreate($width, $height);
$black = imagecolorallocate($image_p, 0, 0, 0);
$white = imagecolorallocate($image_p, 255, 255, 255);
$font_size = 14;

imagestring($image_p, $font_size, 5, 5, $text, $white);
imagejpeg($image_p, null, 80);
?>
[/php]

——————————————————————————————————
HTML:

<img src=”capcha.php” alt=”” align=”top” /> <input id=”vercode” class=”cap” name=”vercode” type=”text” align=”texttop” />
<div>

<input class=”sub” name=”subi” type=”submit” value=”Register” />

</div>

 

Must set session to use the capcha

PHP Code for the html page:

[php]
<?php if ($_POST[“vercode”] != $_SESSION[“vercode”])
{
header(“location:contact.php?ver”); //incorrect verification code }
?>
[/php]

Send an HTML Email Using PHP

PHP Mail Function:

The mail() function allows you to send emails directly from a script.

Syntax For E-mail:

 mail($to,$subject,$message,$headers);

[php]
<?php
$to = "someone@example.com, someoneelse@example.com";
$subject = "HTML email ";
$message = "<table><tr><td>Congrats</tr></td></table>";
// Always set content-type when sending HTML email//Very Very Important headers</h4>
$headers = "MIME-Version: 1.0" . "\r\n";</h4>
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";// More headers</h4>
$headers .= ‘From: &lt;webmaster@example.com&gt;’ . "\r\n";
$headers .= ‘Cc: mymd@example.com’ . "\r\n";
mail($to,$subject,$message,$headers);
?>
[/php]

Request a Free SEO Quote