Hot answers tagged

34 votes
Accepted

Reasons not to assume device MAC address is unique

Based on your statements that you can confirm during provisioning that the manufacturer MAC is in fact unique within the network of devices you are creating (which is not in and of itself a certainty, ...
Frank Thomas's user avatar
  • 35.9k
10 votes

How do I create a Code Snippet in MS Teams using a Keyboard Shortcut

Use 3 consecutive backticks ```, on the latest MS Teams versions, seems we need a space after these backticks to make it work like ``` Examples: ``` ```python
Gopalakrishnan Balasubramanian's user avatar
9 votes

Reasons not to assume device MAC address is unique

MAC addresses are not unique There can be, and will be duplicates with MACs. There are several reasons for that, one being that they need not be (globally) unique. The MAC must be unique on the local ...
Damon's user avatar
  • 4,522
9 votes
Accepted

Why did this WhatsApp message freeze my phone?

The "box" in your text snippet contains these Unicode characters that repeat a bunch of times: LEFT-TO-RIGHT MARK (U+200E) RIGHT-TO-LEFT MARK (U+200F) There are ordinary spaces interspersed to give ...
Deltik's user avatar
  • 19.6k
9 votes

In Excel, how can I round or display numbers to 2 significant figures (the two leading non-zero digits of a decimal number)?

If rounding is required, you can also try this formula =ROUND(A1,INT(2-LOG(A1))).
Emily's user avatar
  • 3,464
8 votes
Accepted

syntax error near unexpected token `}'

So what in the world is wrong with my code? To check your shell scripts you can use ShellCheck. Here is the output from checking your code: You are missing a few fis. Adding the fis generates a new ...
DavidPostill's user avatar
  • 156k
8 votes

How to recover unsaved file (Visual Studio Code)?

You can recover you projects from the VSCode cache. In Linux it is located under /home/USER/.config/Code/User/History/ and under Windows it is /Users/USER/AppData/Roaming/Code/User/History/. Each file ...
Trigus's user avatar
  • 131
7 votes

In Excel, how can I round or display numbers to 2 significant figures (the two leading non-zero digits of a decimal number)?

Try, In B2 formula copied down : =0+LEFT(A2,MIN(FIND({1,2,3,4,5,6,7,8,9},A2&1/17))+1) Edit : 1] 1/17 =0.0588235294117647 which is called Pandigital number that contains digits from 0 to 9 2] A2&...
bosco_yip's user avatar
  • 841
6 votes

What is the shortcut to select everything between curly braces in Notepad++?

Ctrl+Alt+B does that (shows in “Search” drop down also).
denpick's user avatar
  • 61
5 votes

What does "gclid" in some URL's mean?

Gclid is a globally unique tracking parameter (Google Click Identifier) used by Google to pass information back and forth between Google AdWords and Google Analytics. If you enable URL auto tagging in ...
Dylan_R's user avatar
  • 788
5 votes
Accepted

I want to write down some notes in a .bat file. What codes can be added to the notes so that they will not be treated as commands to be run?

In cmd.exe scripts, comments are added using REM (or @REM to forcefully disable echoing). rem This is a comment. While not technically a comment prefix, :: can also be used the same way (it defines ...
5 votes

How to replace character "-" by "%_%" in a batch file?

Because of the way percents are used for variables it messes up what you are trying to do. One way around this is with delayed expansion. You also have to escape the percent by putting two of them in ...
Confuzing's user avatar
  • 551
4 votes
Accepted

AutoHotKey: How to make my script run only within a specific program?

You should have a look at the following references : #IfWin[Not]Active / #IfWin[Not]Exist The WinTitle Parameter & the Last Found Window SetTitleMatchMode According to your info the following ...
harrymc's user avatar
  • 476k
3 votes
Accepted

Visual Studio Code will be updated after it restarts

This sounds like a permissions error (oddly enough). Try running VSCode using administrator rights, and then update the program and see what happens upon restart.
Robert Dewitt's user avatar
3 votes

Found this code in index.php on an unreachable site of mine ... What does it do?

It's some obfuscated PHP code. I didn't bother (and don't see a use) to look any further than that. You can execute it from command line under an unprivileged account (or even better - from a VM so ...
ivan_pozdeev's user avatar
  • 1,902
3 votes
Accepted

Creating a function called IFTRUE that behaves as IFERROR but for a function returning TRUE. Worsheetfunction.if doesn't work. What am I doing wrong?

There is no Application.WorksheetFunction.If() Even if there was you would still need to push extra quotes into the test part of the if. for example if the fx resolved to "test" and condition was "=...
Scott Craner's user avatar
  • 23.1k
3 votes
Accepted

How can I format selected java code in sublime text .txt file?

I'd suggest that you use CoolFormatter. According to the description, it is: A Sublime Text plugin for Source Code Formatter. CoolFormat Source Code Formatter is a code formatter for C\C++\C#\CSS \...
Razetime's user avatar
  • 1,056
3 votes

Makes an blank 3s image section in ffmpeg

Use ffmpeg -i video -vf drawbox=t=fill:enable='gt(mod(t,60),57)' -c:a copy out.mp4 The drawbox filter defaults to black color and a 3-pixel hollow box surrounding the whole frame. I've set the ...
Gyan's user avatar
  • 36k
2 votes

Is there any useful style of MS Word for code?

You need to add Office-addin called Easy Syntax Highlighter from Insert tab click ... > Add-ins > search for Easy Syntax Highlighter > Add It will show as a new tab Setting > ...
Hany Afifi's user avatar
2 votes

How can I easily find a line of text which is on my website on the code in my server?

Assuming you have SSH access, you can use grep: grep -r "text you're looking for" /path/of/your/website You can add the -i flag for case insensitive search. You can add -n to get the line number of ...
Teun Vink's user avatar
  • 2,465
2 votes
Accepted

Setting up a task schedule with batch code

Look at schtasks.exe /? For example, to create a task that starts notepad five minutes after you log on, you can do this (only as an administrator, unfortunately): schtasks /create /tn "\Automatic ...
Christian's user avatar
  • 126
2 votes

In VBScript, I need a code to subtract 1 from searchResult.Updates.Count, so that Count = 0 and WScript.Quit will be run consequently

Hope this helps: Dim nMyRes : nMyRes = 20 MsgBox "nMyRes before loop: " & nMyRes For i = 0 To nMyRes-1 If i = 5 Then nMyRes = nMyRes - 1 If i = 10 Then nMyRes = nMyRes - 1 Next MsgBox "...
Leo Chapiro's user avatar
  • 15.5k
2 votes

I want to write down some notes in a .bat file. What codes can be added to the notes so that they will not be treated as commands to be run?

You could simply append to the end of the file if the last code is a Goto :Eof Cmd doesn't care about lines the code never reaches. With a unique marker the batch itself can determine the begin of the ...
LotPings's user avatar
  • 7,161
2 votes

Where should I insert this code?

That's a PowerShell command. You can run PowerShell by pressing Windows+R to bring up the Run dialog, typing powershell, and pressing Enter. Alternatively, you can search for powershell in the Start ...
Ben N's user avatar
  • 40.8k
2 votes
Accepted

How to make All 3 conditions in Autohotkey (how to code "AND")

The Autohotkey documentation on IfWinExist / IfWinNotExist / WinExist provides an example of multiple conditions. if WinExist("ahk_class Notepad") or WinExist("ahk_class" . ClassName) For your ...
Robbie W.'s user avatar
  • 311
2 votes

Reasons not to assume device MAC address is unique

Since the problem here is really an XY Problem, I'm going to address solving that: how to get a unique identifier for a piece of hardware the first time it boots without having to preload identifiers ...
R.. GitHub STOP HELPING ICE's user avatar
2 votes

Fitting More Code On Printed Page In Notepad++

First, answering your question about decreasing the font size in Notepad++ Go to Plugins -> NppExecute -> Execute (if you don't see this option, see below how to install it). Type the following: ...
psoo's user avatar
  • 111
2 votes

Fitting More Code On Printed Page In Notepad++

The following works for me. Go to Settings > Style Configurator. Set the font size to something slightly smaller than the current setting. In my case it was 11 pt, so I set it to 10. Make sure you ...
hdhondt's user avatar
  • 4,294
2 votes
Accepted

Which function is was used to correct bug of the wrong tower move position in Deep Blue vs Kasparov (1997)?

Agree with @Tetsujin - nice question! Maybe just a legend: Did a Computer Bug Help Deep Blue Beat Kasparov? Either at the end of the first game or the beginning of the second, depending on who’s ...
Leo Chapiro's user avatar
  • 15.5k
2 votes

Visual Basic - VBA code to skip or ignore rule if cell contains certain value

You can do that by adding an additional IF check. I've also optimized the code by going from 3 loops to 1 loop, so the code is 3 times faster, and placed the 3 checks into one select case so it reads ...
LPChip's user avatar
  • 60.7k

Only top scored, non community-wiki answers of a minimum length are eligible