25 Dec, 2024
In this artical we are discuss about what is modules and how to use modules in Python. The propensity of computer code is to expand. We can conclude that code…
The ACID properties—Atomicity, Consistency, Isolation, and Durability—are fundamental principles that ensure reliable transactions in a database. To know more about ACID Properties, This article focuses on two key properties: Atomicity…
MySQL has InnoDB storage engine, that strictly follow the ACID Model to prevent data corruption and results distortion from unexpected occurrences like hardware failures and software crashes. You don’t have…
A key idea in software development is the singleton design pattern, which offers a straightforward method of guaranteeing a class has a single instance and a global access point. This…
Within the profession of software engineering, design patterns are essential resources that help architects as well as developers effectively address common issues. The Factory Design Pattern is one such pattern…

How to lock the orientation to portrait mode in a iPhone/Andorid Web Application?

You can specify CSS styles based on viewport orientation: Target the browser with body[orient=”landscape”]  or body[orient=”portrait”] Try this via the CSS @viewport rule @viewport { orientation: portrait; } Or $(document).ready(function () { $(window) .bind(‘orientationchange’, function(){ if (window.orientation % 180 == 0){ $(document.body).css(“-webkit-transform-origin”, “”) .css(“-webkit-transform”, “”); } else { if ( window.orientation > 0) { //clockwise […]

Share your Love
1 min read

How to display image with javascript?

You could make use of the Javascript DOM API. In particular, look at the createElement() method. You could create a re-usable function that will create an image like so… function show_image(src, width, height, alt) { var img = document.createElement(“img”); img.src = src; img.width = width; img.height = height; img.alt = alt; // This next line […]

Share your Love
1 min read

Joomla Changing the site favicon

The file you created in this way will have the extension .ico. Copy the file to the /joomla/templates/<your template> directory andname it favicon.ico. My favicon is in another location <link rel=”shortcut icon” href=”http://yoursite.com/templates/your_template/icon/favicon.ico” /> Share your Love     

Share your Love
1 min read

Read file in Node.js

Asynchronously reads the entire contents of a file. var fs = require(‘fs’); var path = require(‘path’); exports.testDir = path.dirname(__filename); exports.fixturesDir = path.join(exports.testDir, ‘fixtures’); exports.libDir = path.join(exports.testDir, ‘../lib’); exports.tmpDir = path.join(exports.testDir, ‘tmp’); exports.PORT = +process.env.NODE_COMMON_PORT || 12346; // Read File fs.readFile(exports.tmpDir+’/world.csv’, ‘utf-8’, function(err, content) { if (err) { got_error = true; } else { console.log(‘cat returned […]

Share your Love
1 min read

Magento site down due to mysql error General error: 1030 Got error -1 from storage engine

This error is generated when InnoDB cannot write to its data files. I have seen reports of this when the disk is full. if the files or folder permission changed so you can’t write to them. try deleting the folders var/cache and var/session. Another report was when someone enabled innodb_force_recovery to a value greater than […]

Share your Love
1 min read

Creating File Links in Ubuntu: Simplify File Organization and Access

Efficiently linking files in Ubuntu allows for seamless file organization and easy access. This article provides a comprehensive guide on creating links between files, covering both symbolic links and hard links. By implementing these techniques, you can streamline your file management process and enhance productivity in the Ubuntu operating system. Symbolic links, also known as […]

Share your Love
2 mins read

To improve page load times and save bandwidth using the .htaccess

Improving page load times and saving bandwidth are crucial factors for a successful website. The .htaccess file, used by the Apache web server, can be a powerful tool in achieving these goals. In this article, we will explore various techniques and optimizations that can be implemented through the .htaccess file to enhance website performance. One […]

Share your Love
4 mins read

How to Leverage Browser Caching via .htaccess

Leveraging browser caching through the .htaccess file is an effective way to improve website performance by instructing the user’s browser to cache static resources. This reduces the number of requests made to the server, as the browser can retrieve cached files instead. To leverage browser caching, follow these steps: Open your preferred text editor and […]

Share your Love
3 mins read

how can I add comments to a batch file?

The REM statement This is the most common way to write comments. Any line in your bat-file that starts with REM is completely ignored by the command-processor. REM This bat-file moves all files in C:Incoming to C:ToProcess REM Written by Nikunj Kansara REM 05/01/2003 Double Colons Alternatively you can replace the word REM by two […]

Share your Love
1 min read