Skip to main content

Posts

Showing posts from May, 2018

Difference between Text File and Binary File

Here you will learn about difference between text file and binary file. Text Files Text files are special subset of binary files that are used to store human readable characters as a rich text document or plain text document. Text files also store data in sequential bytes but bits in text file represents characters. Text files are less prone to get corrupted as any undesired change may just show up once the file is opened and then can easily be removed. Text files are of two types: Plain text files:  These files store End of Line (EOL) marker at the end of each line to represent line break and an End of File (EOF) at the end of the file to represent end of file. Rich text files:  These files also follow the same schema as the plain text files but may also store text related information like text colour, text style, font style etc. Because of simple and standard format to store data, text files are one of the most used file formats for storing textual data and are supported in

The year of Linux on the (Windows) Desktop - WSL Tips and Tricks

I've been doing a ton of work in bash/zsh/ fish lately - Linuxing . In case you didn't know, Windows 10 can run Linux now. Sure, you can run Linux in a VM, but it's heavy and you need a decent machine. You can run a shell under Docker, but you'll need Hyper-V and Windows 10 Pro. You can even go to https://shell.azure.com and get a terminal anywhere - I do this on my Chromebook. But mostly I run Linux natively on Windows 10. You can go. Just open PowerShell once, as Administrator and run this command and reboot: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Then head over to the Windows Store and download Ubuntu, or Debian, or Kali, or whatever. Ubuntu OpenSUSE SLES Kali Linux Debian GNU/Linux What's happening is you're running user-mode Linux without the Linux Kernel. The syscalls (system calls) that these un-modified Linuxes use are brokered over to Windows. Fork a Linux process? It a pico-process in Windows

4 Most Important SEO Factors for 2018

SEO is always changing. It’s hard to keep up with the new rules and strategies for boosting your search engine ranking. In 2018, optimizing your website for Google and other search engines is no longer optional. With so much competition online, you need to have a website that can appear highly in search engines. While there are a lot of resources available online claiming to know what’s best for your SEO, how do you know what information is best? Cut through the noise with these 4 most important SEO factors for your website in 2018. Image via Unsplash 1. Is your website optimized for mobile? One of the biggest factors of SEO today is mobile optimization. We’re all accessing the internet on different devices. Some might prefer desktops while others swear by tablets, but there’s no denying we now live in a mobile world. Users want to access your website on any screen size, and those that fail to work on smaller screens won’t stand a chance in this new age of smartphones. Most modern

Wikipedia API Python Tutorial

In this tutorial I’ll show you how we can implement Wikipedia API in Python to fetch information from a Wikipedia article. Let’s see how to do it. First we have to install Wikipedia. To install it, open your command prompt or terminal and type this command. pip install wikipedia That’s all we have to do. Now we can fetch the data from Wikipedia very easily. To Get the Summary of an Article import wikipedia print(wikipedia.summary("google")) It will fetch the summary of google from wikipedia and print it on the screen. To Get a Given Number of Sentences From the Summary of an Article import wikipedia print(wikipedia.summary("google", sentences=1)) Output: Google LLC is an American multinational technology company that specializes in Internet-related services and products, which include online advertising technologies, search engine, cloud computing, software, and hardware. Same way you can pass any number as a parameter to get the number of sentences y

Difference between Source Code and Object Code

Here you will learn about difference between source code and object code. Source Code Source Code, as the name suggests, it is the source of a program, the file original which is written by the programmer. The line above is sufficient if you are looking for a definition of the Source Code, adding to this, the following points will help in a better understanding of the topic. Source Code refers to file which is a text based document that is written by the programmer. The programmer writes the code for performing some task in the human readable language, almost English every time, and saves the file into a prescribed format. For Example – ‘.java’ for JAVA code, ‘.cs’ for C# code, etc. This file is written following some conventions and rules of a particular programming language that can be any high level language of programmer’s choice and is saved accordingly with the correct extension. The Source Code is human readable but machines can’t understand instructions given in English, or

Python LCM – 2 Ways to find LCM

In this article, we’ll see different ways to find LCM in Python with program examples. Basically LCM is a smallest number that is divisible by both numbers (or all). Let us see how we can find lcm of two numbers in python. 1. Using Loop First we find the larger number of two given numbers. Starting from it and will try to find the first number that is divisible by both, which is LCM. x=12 y=20 if x > y: greater = x else: greater = y while(True): if((greater % x == 0) and (greater % y == 0)): lcm = greater break greater = greater + 1 print ("Least common multiple = ", lcm) Output: Least common multiple =  60 In above program, first we’re finding greater number, then start a loop. Inside the loop we’ll find a number that can be divisible by both of given numbers n1 and n2. When we will get a that number we’ll store it into a new variable called lcm. If didn’t get then we’ll increase greater by 1. As we know the number wi

How to Find Best Free Data Recovery Solution for Windows

Imagine working hard on a project file for days and one day waking up with not even a single piece of data of the precious project. Or imagine an even worse scenario, going on a trip to Bahamas, capturing the unforgettable moments into your camera, returning home, connecting the camera to your respective PC and finding a blank memory. Sweating yet? No worries with the evolution of technology, various security measures have been introduced to keep your hard-earned data safe by using reliable data recovery software. Free data recovery software for windows are easily available online, but you must choose the best one in order to assure that Deep Scanning of data is achieved. How do we identify the best data recovery tool for windows? The data recovery software windows must contain the following features: Provide Deep Scans: The best file recovery program must provide intense deep scans that are able to trace all the hidden lost files, so that the lost partitions are also recovered

Python GCD – 4 Ways to Find GCD or HCF

Here I will show you 4 different ways to find GCD in Python using program examples. GCD also known as HCF (Highest Common Factor). So let’s see how we’ll do it. Method 1: Using Loop n1 = 48 n2 = 36 #find smaller if(n1>n2): smaller = n2 else: smaller = n1 #getting hcf i = 1 while(i<=smaller): if(n1%i==0 and n2%i ==0): hcf = i i = i+1 print("hcf = ", hcf) Output: hcf = 12 So in this program, first we assign values to n1 and n2, then we’ll find smaller number from both of the numbers.  After that we’ll start loop from 1 to smaller number to find a number which can be fully divisible with both of the numbers n1 and n2 and store into a new variable named as hcf.  At the end of the loop we’ll get the highest number stored in hcf variable which can fully divide both of the numbers n1 and n2. That highest number will be our hcf. Method 2: Using Recursion def find_hcf(n1,n2): if(n2==0): return n1 else: return find_hcf(n2,n1%

Things You Should Know About Wi-Fi Security

In recent years, there has been a sporadic increase in the number of free Wi-Fi access hotspots in hotels, malls, airports, and other public places. Nonetheless, this comes with its fair share of risks since public Wi-Fi networks are vulnerable to cyber-criminals whose intention may be to steal users information and spread malware. The features that typically make Wi-Fi hotspots popular among users also make them popular with cyber-criminals. Free Wi-Fi hotspots do not require any authentication for a connection to be established. This gives hackers a limitless opportunity to access the network whenever they want. Threats to Wi-Fi Networks Arguably, the main threat that faces free Wi-Fi hotspots is the fact that hackers can conveniently position themselves between users and connection points. Instead of directly communicating with the hotspot, users will be naïvely sending their information to hackers who then relay that information. These man in the middle  cyber-attacks are commo

Python Text to Speech Example

Here you will get python text to speech example. As we know, some people have difficulty reading large amounts of text due to dyslexia and other learning disabilities. Some people have basic literary levels. They often get frustrated trying to browse the internet because so much of it is in text form or on other hand some people prefer to listen or watch a news article (or something like this) instead of reading. So to solve all these problems a concept comes into mind that is ”text to speech”. So in this tutorial we are going to learn that how to convert text to speech in Python. Here we’ll show you two best and easiest ways to convert your text into speech Text to speech without internet connection (using pyttsx3) Text to speech having internet connection (using gTTS) Python Text to Speech Example Method 1: Using pyttsx3 Pyttsx3 is an offline cross-platform Test-to-Speech library which is compatible with both Python 3 and Python 2 and supports multiple TTS engines To use py

Announcing .NET Core 2.1 RC 1 Go Live AND .NET Core 3.0 Futures

I just got back from the Microsoft BUILD Conference where Scott Hunter and I announced both .NET Core 2.1 RC1 AND talked about .NET Core 3.0 in the future. .NET Core 2.1 RC1 First, .NET Core 2.1's Release Candidate is out. This one has a Go Live license and it's very close to release. You can download and get started with .NET Core 2.1 RC 1, on Windows, macOS, and Linux: .NET Core 2.1 RC 1 SDK (includes the runtime) .NET Core 2.1 RC 1 Runtime You can see complete details of the release in the .NET Core 2.1 RC 1 release notes . Related instructions, known issues, and workarounds are included in releases notes. Please report any issues you find in the comments or at dotnet/core #1506 . ASP.NET Core 2.1 RC 1 and Entity Framework 2.1 RC 1 are also releasing today. You can develop .NET Core 2.1 apps with Visual Studio 2017 15.7, Visual Studio for Mac 7.5, or Visual Studio Code. Here's a deep dive on the performance benefits which are SIGNIFICANT . It's also wort

How to Find Square Root in Python

Hello everyone, in this tutorial, I’ll show 3 ways to find square root in Python. Let’s see how to do it. 1. Using Exponent number = int(input("enter a number: ")) sqrt = number ** 0.5 print("square root:", sqrt) Output: enter a number: 64 square root: 8.0 In above program, first we’re taking a number from user as input and the entered value will be converted to int from string and will store into variable called number. Then we are using  exponent (**) sign, which is used to find out the power of a number. But we know that if a number have power ½ or 0.5 then it will represent to the square root of that number. That’s why we are using 0.5 as power here. So the number**0.5 will give us square root of that number and will be stored in variable named as sqrt. In last line we’re just printing the square root of the number. 2. Using math.sqrt() Method import math number = int(input("enter a number:")) sqrt = math.sqrt(number) print("square

Difference between Syntax and Semantics

Here you will learn about difference between Syntax and Semantics with example. The both terms might seem the same things but they are not, they are just interrelated concepts, which even exist as individuals. What is Syntax? When we talk about a language (not just a programming language), let’s say English (most common one), there are certain rules of grammar we have to follow if we want to practice this language in the real world. These rules actually define the structure of our sentence. A Simple rule: Noun + Verb + object To make sense and let others understand what we want to convey in certain language, we need these rules. They are the grammar of a language that the user must follow. Same is in programming, if we talk about any language like C, C++, Java, etc there are certain rules that we follow when coding to make the compiler understand what we want to convey. Some of these rules are: Command terminates with a semi colon. Code block starts with a opening curly brace

Caesar Cipher in Python

Hello everyone, in this tutorial you’ll learn about Caesar cipher in Python. If you have learned about cryptography then you should have known this term Caesar cipher. Well if you don’t know what is this then let me explain it to you. What is Caesar Cipher? In cryptography, Caesar cipher is one of the simplest and most widely known encryption techniques. It is also known with other names like Caesar’s cipher, the shift cipher, Caesar’s code or Caesar shift. This encryption technique is used to encrypt plain text, so only the person you want can read it. The method is named after Julius Caesar, who used it in his private correspondence. In this encryption technique, to encrypt our data,  we have to replace each letter in the text by a some other letter at a fixed difference. Let’s say, there is a letter ‘T’ then with a right shift of 1 it will be ‘U’ and with a left shift of 1 it will become ‘S’.  So here, the difference is 1 and the direction will also be same for a text. Either we

How to Start Your Own Freelance Programming Business?

Everyone’s doing it – in the new gig economy freelancing is an ever growing popular option and many programmers are itching to ditch the 9-to-5 cubicle for the freedom of working from home, or better yet, some paradise island while having the considerable perk of choosing which projects to work on. At the heart of freelancing lies two considerations: can you find clients and monetize your work? Let’s have a look at how to go about doing just that. Tips to Start Your Own Freelance Programming Business Job Boards Most new freelance programmers start at the bottom with online market places. The competition is fierce and there’s little hope of outbidding some corners of the world where very little money goes a long way, the same can be said for skills. Many far flung freelancers could program you under the table before you’ve had your morning coffee. However, it’s worth taking some of the skillset tests offered by these forums and browsing the jobs listed. You’ll quickly get a sense of

The Programmer's Hindsight - Caching with HttpClientFactory and Polly Part 2

In my last blog post Adding Cross-Cutting Memory Caching to an HttpClientFactory in ASP.NET Core with Polly I actually failed to complete my mission. I talked to a few people (thanks Dylan and Damian and friends) and I think my initial goal may have been wrong. I thought I wanted "magic add this policy and get free caching" for HttpClients that come out of the new .NET Core 2.1 HttpClientFactory, but first, nothing is free, and second, everything (in computer science) is layered. Am I caching the right thing at the right layer? The good thing that come out of explorations and discussions like this is Better Software. Given that I'm running Previews/Daily Builds of both .NET Core 2.1 (in preview as of the time of this writing) and Polly (always under active development) I realize I'm on some kind of cutting edge. The bad news (and it's not really bad) is that everything I want to do is possible it's just not always easy. For example, a lot of "hookin