Open the program with dnSpy (or drag and drop it):
At first inspection, we can tell there’s obfuscation due to the name of the entrypoint at line 4 (being so cryptic). Additionally, if you click on the “ConfusedTest.exe” node, you will see more attributes and the obfuscator name (ConfuserEx v1.0.0-4-g3fd0d55):
I bought myself the noise masking sleepbuds from BOSE to combat loisy upstairs neighbors who stomp all the time at night and early morning:
I tried them for two nights and I like the technology, unfortunately, I did not keep them because they were not comfortable for side sleepers.
The sleepbuds fit well in the ear and produce soothing music (you have a big selection from the phone app), however I found that any external speakers that can generate white noise can do the same effect.
When I got my first computer, I got attached to its keyboard (The Honeywell 101WN model). In fact, I kept the keyboard until I bought a new computer with no PS/2 ports on it.
It was a sad moment when I realized that I have to move on and find a new keyboard.
While I could have bought a PS/2 adapter, I needed the “Windows” key which is available on newer keyboards.
I think a big majority of programmers love their keyboards and their layout, just like me.
I am very picky when it comes to keyboards. If I don’t like the keyboard, I might not like the whole laptop for instance.
It took me a while to get used to the old MacBook Pro’s keyboards but just after I started liking their keyboards, Apple changed the mechanism to the butterfly mechanism and made the keyboards repulsing in my opinion. I won’t buy a new MacBook because of their keyboards. The same goes for Microsoft Surface laptops. I did not like their toy-like keyboards and therefore won’t buy, endorse or use a Microsoft Surface book or laptop . The most pleasant keyboards so far are the IBM / Lenovo keyboards. That’s why all of my PC laptops are a Lenovo X or T series.
To detect the Windows Operating system language, it is enough to query the registry. We use the “reg query” command and then parse the output.
for /F "usebackq tokens=3" %%a IN (`reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage`) DO (
:: 0409 English ; 0407 German ; 040C French ; 0C0A Spanish
if "%lang_id%"=="0409" (
echo English detected
) else if "%lang_id%" == "040C" (
echo French detected
) else (
echo Note: Unknown language ID %lang_id%!
You can learn about advanced Batch scripting techniques in the Batchography book.
Do you want to master Batch Files programming? Look no further, the Batchography is the best book on the topic and the most up to date!
A brother said to his sister: “I have as many sisters as brothers”
His sister replied: “I have twice as many brothers as I have sisters”
How many brothers and sisters exist in this family?
I figured that it’s a nice exercise for the Z3 theorem prover. All I had to do is express the riddle in a series of constraints and ask Z3 to try to find a solution.
The following is a Z3Py program that expresses the riddle:
# Create a solver instance
s = z3.Solver()
# Create two variables representing the total number of males and females (m and f)
m, f = z3.Ints('m f')
# The brother said: I have as many brothers as sisters
s.add(m - 1 == f)
# The sister said: I have twice as much brothers as I have sisters
s.add(2 * (f - 1) == m)
# Check for the solution
if s.check() == z3.sat:
sol = s.model()
print "Brothers: %d, Sisters: %d" % (sol[m].as_long(), sol[f].as_long())
When we run the solver, we get the following solution: 4 males, 3 females.
If you prefer the good old systems of equations, we can solve it like this:
The brother said:
m - 1 = f (1)
The sister said:
2 * (f - 1) = m (2)
So we have 2 equations, let's do some substitution:
-> f = m - 1 (1)
-> 2f - 2 = m (2)
--> m = 2f - 2 (2)
--> f = 2f - 2 - 1 (1)
--> f = 2f - 3
--> f - 2f = -3
--> -f = -3
--> f = 3
--> m = 2f - 2
--> m = 2*3 - 2
--> m = 6 - 2
--> m = 4