CodeBlocks debugging global variables

I love CodeBlocks IDE for my C language projects… But biggest blunder of CodeBlocks IDE is that you must manually add to ‘Watch’ global variables every @#$% time when debugging. Eg in C++ Builder and other IDEs there is no such problem… Why, why they did it?..

Ok, ok.. “One should avoid to use global variables”, – many will say. But using globals for tiny programs it’s actually the most convenient way to do fast tasks. And AFAIK most of the projects which use CodeBlocks is actually enthusiasts projects.. So it’s really out of scope feature there.

Posted in IDE (en) | Leave a comment

Returning the old terminal after Windows 11 update KB5019509

Got the update for Windows today – KB5019509 and the terminal’s arm was torn off. That is, it stopped displaying console programs like my Roguelike game. The update that broke it, adds tabs to the console, while breaking everything else… well, not the point (by the way, to see the latest Windows updates, type wmic qfe list into cmd).

To fix it:

Click on the header of the terminal window -> Properties

In Default Terminal Application put Windows Console Host

Restart the console and hallelujah! We got our oldschool console back. Old Billy’s nose lost the game again ;P

Posted in Windows 11 (en) | Leave a comment

Add “New” .txt in Windows 11 to the context menu

Add “New” .txt in Windows 11 to the context menu

Windows Registry Editor Version 5.00
 
[-HKEY_CLASSES_ROOT\.txt\ShellNew]
 
[HKEY_CLASSES_ROOT\.txt\ShellNew]
"NullFile"=""
 
[-HKEY_CLASSES_ROOT\txtfilelegacy]
 
[HKEY_CLASSES_ROOT\txtfilelegacy]
@="Text File"
 
[HKEY_CLASSES_ROOT\txtfilelegacy\shell]
 
[HKEY_CLASSES_ROOT\txtfilelegacy\shell\printto]
"NeverDefault"=""
 
[HKEY_CLASSES_ROOT\txtfilelegacy\shell\printto\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6e,00,6f,00,\
  74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,20,00,2f,00,70,00,74,\
  00,20,00,22,00,25,00,31,00,22,00,20,00,22,00,25,00,32,00,22,00,20,00,22,00,\
  25,00,33,00,22,00,20,00,22,00,25,00,34,00,22,00,00,00

Run it, kill the explorer and enjoy the ability to create .txt files 😉

Continue reading

Posted in Windows 11 (en) | Leave a comment

Remove “New” file types from the context menu in Windows 11

I switched to Windows 11 with a crunch. Terrible interface. Billy, why?!

In general, one of the crutches that you have to substitute in order not to go crazy – removing @#$% file types from the context menu “New”. It’s done like this (works on Win 10 as well):

  • regedit
  • HKEY_CLASSES_ROOT
  • look for the right extension, e.g. .odg (OMG, why does LibreOffice add his holey hats there).
  • There, look for the ShellNew section and delete the hell out of it (Billy, they’re waiting for you there with a really hot pan).
Posted in Windows 11 (en) | Leave a comment

What do you program in Python? Real-world applications with library examples

When I started learning Python, I got curious about what people write in this language. If you look at it from a general perspective, it seems like Python is used everywhere – it’s such a super universal language that you can write computer games, create a social network with pictures, make a website, and whatever else you want. Just learn Python and you can program whatever you want,
anything you want. It’s like saying that it’s like an entire house is built out of plaster… it’s only covered in plaster, but it’s built with concrete, for example. Python is plaster in that sense.
Continue reading

Posted in Python (en) | Leave a comment

Top 3 programming languages for beginners. Which first programming language should I choose?

As a beginner programmer you have probably already racked your brains thinking about which programming language to choose. I have chosen three options, and now I will explain which one is right for you.
 
Three of the best first programming languages right now:
 
  • C language
  • Python
  • JavaScript

Continue reading

Posted in Programming (en) | Leave a comment

Assembly cheatsheet

Assembler is a low-level programming language. Below it there is only machine code (zeros and ones).

Why learn assembler?

  1. To understand how a computer works. Any programmer must know C. Any programmer who knows C must know Assembler.
  2. The ability to reverse engineer software (we live in a copyist world). For me this is first of all the vintage games of the 90s, the sources of which have not survived.
  3. ok. commercial development. If your device doesn’t have enough memory. – You write in asm. Microcontrollers, loaders, embedded software. If you need everything to run faster than lightning for a particular system – you also write directly to the processor, this is more efficient.
  4. WebAssembly (wasm) 🙂 This is not a programming language, but a technology that is now taking over the web. You don’t have to write in assembler there, but it is useful to understand assembler for code optimization.
  5. And analysis of all sorts of viral crap. Computer security and anti-virus labs are where assembler comes in handy.

Continue reading

Posted in Assembly | Leave a comment

Hello World in Assembly x86

Hello World in assembly language. How much fun is in that! For starters, here’s what we’re going to dig into in asm, the classics:

#include <stdio.h>
int main(void)
{
    printf("Hello, world\n");
    return 0;
}

On GNU assembly it would be something like this:
Continue reading

Posted in Assembly | Leave a comment

C language: “can’t bind to the port” problem (Windows)

Sometimes your program process can stuck and trigger error like this:

Couldn’t bind to the port

Ok, we have such check in out sockets C code:

if (bind (socket_desc, (struct sockaddr*)&server_addr, sizeof(server_addr)) < 0)
printf("Couldn't bind to the port\n");

And it return negative value.. How to fix it?

  1. find which process using this port via cmd:
    netstat -ano | findstr :<port number>
    For example:
    C:\Users\n>netstat -ano | findstr :2000
    You will see such message:
    TCP 127.0.0.1:2000 0.0.0.0:0 LISTENING 3560
  2. last number is ID of process. To kill process:
    taskkill /pid <process ID> /F
    Example:
    C:\Users\n>taskkill /pid 3560 /F
    SUCCESS: The process with PID 3560 has been terminated.

Enjoy!

Posted in C language (en) | Leave a comment

C language: NCURSES basics

NCURSES – it is a C library which control process of sending a series of bytes by terminal. It’s quite oldschool approach, but it’s widely used even right now as internet works the same way: packets sending just series of bytes. So internet is kinda ‘big’ terminal thingy 🙂

So… NCURSES (1993) – rewrite of old non-free CURSES terminal which were made to develop Rogue game (1980).

Basically it’s all about terminal’s cursor control. This article based at tldp NCURSES guide and some other resources. Let’s start!

Continue reading

Posted in C language (en), Programming (en) | Leave a comment

C language: compile and run in Notepad++

In top menu press “Run” and enter there… Example:

cmd /c cd "C:\Users\n\Desktop\" && gcc 1.c -o 1.exe && 1.exe

There we say to Notepad++:

cmd – run terminal

/c means to close cmd terminal after program finished; you can make it /k (so it won’t close)

cd "C:\Users\<USERNAME>\Desktop\" go to place where we have our source code file (in our case – Windows desktop).

&& – run next command

gcc 1.c -o 1.exe – compile source into executable binary file

1.exe run executable file (for testing purposes)

My video instruction (there will be a bonus – how to run the command by hotkey!):

Continue reading

Posted in C language (en), Notepad++ (en) | Leave a comment

HEX editor for Windows

I’ve been looking for a good fast open-source HEX editor for a long time. Finally I found it: https://sourceforge.net/projects/wxhexeditor/

Enjoy 🙂

Posted in Soft and instruments | Leave a comment

Python: string generation with concatenation

Task is to generate 50 strings of such kind:

hello 1 world
hello 2 world
hello 3 world
hello 4 world
...

Tried such clumsy way (I forgot Python really):

Continue reading

Posted in Python (en) | Leave a comment

Inundated with spam

About 70 spam comments came in on my wp blog… How to deal with spam on a wordpress blog? Read below.

Continue reading

Posted in Wordpress (en) | Leave a comment

Spam protection works!

I got shat on in the comments 24 times last night. Those norkadillers attacked again. Apparently this botnet has put my blog firmly on their spam lists. However, they got excited early, because…

Continue reading

Posted in Wordpress (en) | Leave a comment

How do I set up Google Analytics?

I came across the fact that I had to help someone put Google Analytics on his site. Until recently I myself had never even heard of this service. I saw that it is actively talked about on the forums and decided to see what’s what.
 
So, you have a website – a blog, a portal, a business card – no matter…

Continue reading

Posted in Wordpress (en) | Leave a comment

What is SEF ?

Search Engine Friendly URL (SEF) is a method used in CMS that can automatically convert dynamic links (example: http://skobki.com/index.php?option=com_content&task=view&id=11&Itemid=21) to static links (https://skobki.com/something_nice). It is used for correct optimization by search engines.

Continue reading

Posted in CMS (en) | 1 Comment