Creating Windows restore points is a good way to help to restore your computer if any troubles such as virus or advertising bots infection occur.
The restore point is a system image in which its current state is recorded (settings, appearance, installed programs). By creating and saving such a point, you can return your system to the recorded state at any time.
If you have opened a suspicious mail attachment accidentally, and now advertising banners appear on your computer screen (an advertising bot has been installed in your system) – with restore points you can return the system “back to the past” before the bot infects. Restore points are not absolutely troubles panacea, but very often, a “rollback” of the system saves the situation and returns the computer to a normal working state.
When developing online projects, it is often necessary to save the HTML page as a document that can be used separately, for example, sent by e-mail, viewed and edited offline. A convenient way is to export the HTML page to one of the most commonly used text formats – doc.
The free open-source PHP-module “html_to_doc” can be used to export the HTML page to the DOC document. It can convert the HTML to the DOC document, which will be correctly processed by the text editor MS Word. If the HTML page includes images, they will be embedded in the DOC document.
Let’s split the resulting list into two lists. In the first list, we put only the individual values. In the second – the values got from the ranges of numbers.
To shift values in a list (replace the value at the first place of the list to its last place and vice versa), you need to rearrange the list with two slices.
The shift for the list:
Python
1
lst=[1,2,3,4,5]
forward:
Python
1
2
3
4
lst=lst[1:]+lst[:1]
print(lst)
[2,3,4,5,1]
and backward:
Python
1
2
3
4
lst=lst[-1:]+lst[:-1]
print(lst)
[1,2,3,4,5]
If a cyclic shift is necessary, repeat this command the required number of times in “for” cycle.
Each object’s class to be stored in JSON in a convenient for viewing way must have the __repr__ function, which returns the text representation of the object.
Version control systems for today are almost mandatory for any project. One of the most popular version control systems is Git. Consider working with Git in conjunction with GitHub – the largest hosting server for the deployment of IT-projects of joint development. GitHub allows publishing open source projects for free.
In this article, we start to work with Git and GitHub on the Windows operating system.
What we need, in order to start our work with Git:
One of the for loops features in Python is that the iterated variable (counter) does not belong to the local scope of the loop.
For example, after executing the following code:
Python
1
2
3
4
5
6
7
a=0
print(a)
b=[1,3,7]
print(b)
forainb:
pass
print(a)
The “a” variable declared before the for loop will change its value if the variable with the same name “a” declared as the loop counter.
Python
1
2
3
4
# output
>0# print(a)
>[1,3,7]# print(b)
>7# print(a) after loop execution
It is necessary to remember about this feature, in order to avoid writing to the previously declared variable the values of the iterator of the for loop.
Symbolic links in Windows (starts from Vista) can be created using mklink command.
Let’s make a button in Total Commander to create a symbolic link from the selected file:
In a convenient location, for example in Total Commander plug-ins directory c:\TotalCommander\Plugins\ create a batch file mklink.cmd with the following content:
1
mklink%2%1
This command creates a symbolic link to the file transferred from the first input parameter and places it in a location from the second input parameter.
Create a button in Total Commander panel by dragging this file to this panel.
Right click on this button and select “Edit …”
In the “Settings” field specify:
1
%P%N%T%N
Save changes.
%P – path to the file under the cursor in active panel
%N – the name of the file under the cursor in active panel
%T – path to the location, open in a second (non-active) panel
As a result by pressing created button a symbolic link to the file under the cursor in the active Total Commander tab will be created in a location of the inactive tab with the same file name.