Programming Leftovers

-
How can I encrypt/protect JavaScript source code
JavaScript is the most popular web programming language that comes with a lot of useful features. One of these features is immediate parsing i.e the browser executes the code as it downloads the content. This makes it browser interpreted or client side programming language. Therefore, it works on the client machine and hence making it difficult to hide the code from the client.
Immediate parsing has its perks but it also comes with major downsides. As the source code is easily visible, everyone can read it. This can cause major security risks and hence the code needs to be protected.Sometimes you want to protect your JavaScript code from hackers, and sometimes you want to showcase an application but at the same time you don’t want your code to be copied. In this article, we’ll learn how to protect your JavaScript code and decrease the security risk.
-
How to Show or Hide an Element on Website using JavaScript
Throughout web development, users need to hide or show some elements. These elements can be a button, some animation, or a navigation bar etc. Most of the time the user wants a button or a navigation bar to be visible for the desktop viewpoint but not for the mobile viewpoint.
With JavaScript, users can easily hide or show an element on the webpage, depending on the behavior of the user. In this article we’ll see how JavaScript is used for this purpose.
-
How to Remove Elements from an Array in JavaScript
Arrays allow us to store similar kind of data in a single variable. We can then iterate over the data stored in the arrays and perform different functions to manipulate the data according to our needs. A single piece of data in an array is known as its element. JavaScript gives us the option to add and remove elements from an array after we have declared and initialized it. In this post we will only focus on the methods which can be used removing an element from an array.
JavaScript provides numerous methods which can be used to remove array elements; In this post we will discuss four such methods.
-
How to Loop/Iterate Through an Array in JavaScript
Loops are key components of every programming language. They are used to run the same code or logic again and again in a cycle. Usually loops have an index value which is different each time the loop repeats. There are different kinds of loops available in JavaScript which help us iterate over an array. An array is a collection that is used to store different elements;
-
How to Minify (Compress) JavaScript Code
To compress or minify a code means removing all the irrelevant characters from your source code without changing its functionality. These characters include white spaces, comments, new line characters, semicolons etc. But why is minimization of your code necessary? Well, it reduces the size to lesser kilobytes. Hence, making the loading of your website faster and providing the user an amazing experience.
Various developers write well structured code with spaces and comments. This makes their code understandable. But, at the same time it creates extra space and hence increases the load time.
This is why minimization of code is extremely useful in JavaScript as it reduces the size of the page. This minimized version provides better functionality without any additional network traffic.
-
How to Read, Write and Parse JSON in JavaScript
The full form for JSON is JavaScript Object Notation and it is derived from the JavaScript programming language. A standard text format that defines the structured data is based on JavaScript object syntax. Transmission of data in web applications takes place through JSON. Have you heard about JavaScript object literal syntax? Yeah, JSON resembles it in a close manner. We are not limited to use it always with JavaScript.
-
How Do I Delete a Specific Row in PostgreSQL?
Whenever we talk about the data storage of any website or application, postgresql comes to our mind. This database supports both JSON and SQL querying. Postgresql is customizable, and you can add many services and plugins you think are not present in postgresql, and you need them for your project. If you want to select specific rows to be deleted, postgresql allows you to use the command having Delete statement with “where” command. We have quoted a sequence of examples here in psql and pgAdmin as well.
-
Can You Delete a Vector in C++?
Yes! Yes, but it does not go without constraints. There are two ways of deleting a vector. Again they do not go without constraints. One way of deleting a vector is to use the destructor of the vector. In this case, all the elements are deleted, but the name of the vector is not deleted. The second way to delete a vector is just to let it go out of scope. Normally, any non-static object declared in a scope dies when it goes out of scope. This means that the object cannot be accessed in a nesting scope (block). A nesting scope is an outer scope (block). A nested scope is an inner scope, which is still part of the scope of interest. These two ways of deleting a vector are discussed in this article.
-
C++ Vector Clear vs Erase
The C++ vector has many member functions. Two of them are clear() and erase(). clear() “removes” all the elements of the vector. erase() “removes” a single element or a range of elements. There are two overloaded variants of the erase() member function for the vector.
The title of this article is actually “Vector clear() Member Function versus Vector erase() Member Function, in C++”. This is a comparison of the two-member functions. It deals with when to use which, how to use which, and under which conditions either is used.
-
How I rediscovered Logo with the Python Turtle module | Opensource.com
When I was in high school, one of the very first programming languages I was introduced to was Logo. It was interactive and visual. With basic movement commands, you could have your cursor (“turtle”) draw basic shapes and intricate patterns. It was a great way to introduce the compelling concept of an algorithm—a series of instructions for a computer to execute.
-
Russ Allbery: DocKnot 5.00
This release is the culmination of a project that I've been wanting to do for two years, but nearly all the work was done in the past week. That experience made me rethink some of my skepticism, but I'll get to that part of the story later.
In March of 1999, I got tired of writing HTML by hand and wrote a small program called spin that implemented a macro language that translated into HTML. This makes it one of the oldest programs for which I have a continuous development history, predating podlators by three months. I think only News::Gateway (now very dormant) and Term::ANSIColor (still under active development but very stable) are older, as long as I'm not counting orphaned packages like newsyslog.
I've used spin continuously ever since. It's grown features and an ecosystem of somewhat hackish scripts to do web publishing things I've wanted over the years: journal entries like this one, book reviews, a simple gallery (with some now-unfortunate decisions about maximum image size), RSS feeds, and translation of lots of different input files into HTML. But the core program itself, in all those years, has been one single Perl script written mostly in my Perl coding style from the early 2000s before I read Perl Best Practices.
-

- Login or register to post comments
Printer-friendly version- 2817 reads
PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
digiKam 7.7.0 is released
After three months of active maintenance and another bug triage, the digiKam team is proud to present version 7.7.0 of its open source digital photo manager. See below the list of most important features coming with this release.
|
Dilution and Misuse of the "Linux" Brand
|
Samsung, Red Hat to Work on Linux Drivers for Future Tech
The metaverse is expected to uproot system design as we know it, and Samsung is one of many hardware vendors re-imagining data center infrastructure in preparation for a parallel 3D world.
Samsung is working on new memory technologies that provide faster bandwidth inside hardware for data to travel between CPUs, storage and other computing resources. The company also announced it was partnering with Red Hat to ensure these technologies have Linux compatibility.
|
today's howtos
|








.svg_.png)
Content (where original) is available under CC-BY-SA, copyrighted by original author/s.

Recent comments
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago