Automatically import new SVGs to Inkscape

Question: I want to write an extension or find some way to automatically import to an Inkscape document the new files that appear in a given folder. I don't want to simply update the SVG/XML document because Inkscape has to be open for another extension (AxiDraw) to work.
My problem is that I cannot find a way to make my extension work "in the background", either it goes into an infinite loop that crashes the program or, if I use for example the Timer from threading it just stops after the first execution.
Also using the command line doesn't seems to work since there is not an import command and verbs don't work in shell mode.
Is there some relatively easy way to work around these problems without having to dig into the c++ source code?
Answer: Well, turned out it is not possible. From the answer to my same question on the Inkscape forum:

Python extensions currently work by 'halting' the Inkscape main
  process. Then they modify the document, which is then loaded back into
  Inkscape.
So this cannot work. You'd need to run it manually in regular
  intervals, or set up some 'click bot' that does that for you.


Guiding or seeding town growth in OpenTTD

Question: Is there a way I can assist the AI in being better about its town/city expansion? Currently the cities look a bit disjointed in terms of road connectivity.
Answer: Personally, I prefer a simpler method:
In Advanced Settings, there's a setting to control the town roads: 2x2, 3x3, Original or Improved.
Personally, I always play with 2x2, because it fits neatly with my network of rail; and when playing using a 2x2 or 3x3 grid layout, the city placer during generation will align all cities on the grid, meaning that as cities grow, they will join together neatly.
The setting is found under

Economy > Towns > Road layout for new towns

Also of interest is

Economy > Towns > Towns are allowed to build roads

if you insist on building the grid yourself.
Edit:
Omokoii raises a valid point: Using the 2x2 grid does consume a lot of space and slows down city development, because more growth cycles are dedicated to growing roads.
However, a workaround exists for this: Increase city growth speed; essentially reclaiming the lost growth cycles:

Economy > Towns > Town growth speed

Depending on your play style, grid size and other factors, either "Fast" or "Very Fast" might be suitable.
If the issue is one of station catchment areas, my answer to this question might be illuminating, especially the second method regarding non-adjacent stations.
Comment: +1 Yup, forcing towns to grids is a much easier way to achieve this than having to build a grid for each and every town yourself.
Comment: For sure a lot easier if you can live with the downside: There is a lot (too much?) real estate taken up by roads if you don't go with the 3x3 grid, but then you have that center plot that don't connect to any road. But as you said it's mostly a matter of preference. Edit: oh, and +1 for "Economy > Towns > Towns are allowed to build roads"
Comment: @Omokoii: If the real estate taken up by 2x2 is too great, you're playing on too small a map. :P
Answer: Here's how I do it, basically just make sure you build and own all roads in the city.

Catch the town while it is still tiny.
Delete all roads and replace them with your own organized grid of roads. Build the grid so that it extends beyond the current size of the city.
When the city expands it will follow your grid of roads. Occasionally they will also try to construct their own roads, just delete them.

The point of constructing the road grid yourself is that the AI have a tendency to waste a lot of space, putting roads where it instead could put buildings that generate traffic/profit.
Also buy any land where you plan to build roads when the city expands even further. To limit the expantion of the town you can surround it with bought land that you sell off when you are ready to expand.
Comment: Do you know of any optimal grid spacing for the roads?
Comment: I don't know if there's an optimal spacing. I usually go for 2x3, 2x4 or 2x5 sized blocks. Then all plots have road access and it looks quite natural.
Answer: I feel it's better to build your own road network. Certainly, turn on the so-called 3x3 grid, which places initial roads on tiles any multiple of 4. But Advanced Settings > Economy > Towns > Towns are allowed to build roads: OFF. Then build to the grid.
After all, roads are cheap enough to build and then you decide where and when. Also, you have rights on your own company-owned roads that you may not on town-owned roads (depending on other settings) or roads owned by competitors.
If you're serious about the town grid, be prepared to do a little landscaping; which may require some demolition of existing town roads and buildings. Ideally, the grid is flat; next best is a steady, smooth, gradual incline. If you're running a lot of local bus service you'll want to make sure roads connect at all junctions; and irregular topography frustrates this. Keep Local Authority happy by making changes slowly and meanwhile providing plenty of service. After a round of landscaping and road building, Purchase Land ('u' hotkey) strategically to forbid new buildings in places where you'll want to do more landscaping after the locals have cooled off. This will also keep grass, trees, and farmer's fields from growing on newly bared land; so limiting your costs.
One especially exasperating feature is the tendency of towns to build useless bridges that block grid-aligned expansion. If you have the money and a good local rating, demolish these, landfill the water, and complete the grid.
If you do allow towns to build roads, I strongly suggest you at least turn Advanced Settings > Economy > Towns > Towns are allowed to build grade crossings: OFF. Otherwise you may have frequent road/rail crashes and these look bad to the locals. Expand the road grid across rails with bridges or tunnels; town will not do this.


Max Char in TextBox C#?

Question: Just wondering how many char can C# Textbox multiline hold?
Comment: @Kim Gräsman: how do you know that this question concerns winforms?
Answer: Look at the MaxLength property of the TextBox - it stores the maximum number of characters the control can take; as per the documentation, it is changeable. Usually the default is big enough, though. (Although I imagine that since you're asing the question, it may not be!)
From the docs, you can see that the maximum value for MaxLength is 2147483646. This is, of course, limited by the memory of the target machine.
Comment: According to the docs, MaxLength is NOT the amount of characters the TextBox can hold; it's the amount of characters that can be entered by the user. Programmatically added characters can go above the MaxLength limit.
Comment: I ran in to this issue today. For some reason, my textboxes were set to a default of 32K, and I was trying to paste in a 54K SQL query to a custom tool. The paste was failing about 2/3 of the way in: the data was simply truncated.

I tried manually editing at the tail end; I could delete text, but not edit or add text until I backed up to the 32K limit.

So if you find that text is being cut off, check the MaxLength property and make sure it's set properly.
Answer: The other answers seems to assume WinForms development.
If the case that you are doing ASP.NET development, please be aware that the MaxLength property of the System.Web.UI.WebControls.TextBox class is ignored when TextMode = Multiline. The reason is simple: the <textarea> HTML element does not provide any way to restrict the length of its contents.
You will need to do some client scripting in order to enforce a max length on a textarea.
Answer: for Windows NT 4.0, Windows 2000, Windows 2000 Professional, Windows 2000 Server, Windows 2000 Advanced Server, Windows XP Home Edition, Windows XP Professional x64 Edition, Windows Server 2003 Platform :-

If the MaxLength property is set to 0, the maximum number of
      characters the user can enter is 2147483646 or an amount based on
      available memory, whichever is smaller.

for Windows Millennium Edition Platform :

If the MaxLength property is set to 0, the maximum number of
  characters the user can enter is 32,766 or an amount based on
  available memory, whichever is smaller.

for more information see this link
Comment: You seem to have forgotten to include the link in the last sentence!
Answer: I don't think there's any fixed limit on the size of text you can put in a Windows.Forms.TextBox (specifying C# is irrelevant). I've thrown several megabytes of character data in there at times, and it's worked in a satisfactory manner.
However, there may be practical limit - the control isn't oriented towards handling large amounts of text, so performance goes down as the volume goes up.
Depending on the hardware of your users, this may or may not be an issue.
If you need to provide good editing of multi-megabyte text areas, using a properly designed editing control would be a good idea.
Comment: Sorry, no WinForms recommendations - I've not been working in that space recently. AvalonEdit (http://wiki.sharpdevelop.net/AvalonEdit.ashx) is a good open source one for WPF. There are commercial ones for both platforms.
Comment: Any recommendations for "a properly designed editing control" ?

Max Char in TextBox C#?


Epenthesis of /u/ before the syllabic sonorant "l"

Question: Why does Old Russian have epenthesis of /u/ only before the syllabic sonorant "l"? (before the syllabic sonorants "r,m,n" the epenthesis is /i/)? I thought earlier that only Proto-Germanic zero-grade have this epenthesis.
The examples:
вълкъ /wolf/
пълнъ /full/
Comment: do you have any particular example words in Old Russian?
Answer: Epenthesis with /u/ is also seen in Lithuanian (near labiovelars) with all syllabic resonants, and in Albanian (with unclear conditioning) for both l & r, whilst Sanskrit uses a /u:/ (or /u/) in its reflexes of long syllabic l & r  (*l̥H & *r̥H and *l̥l &r̥r respectively) near labials. Additionally, Slovene vȏłk & pȏłn and Kashubian wôłk & pôłny also show rounded reflexes.
Lithuanian apparently depending on the existence of labiovelars would require a very early rounding of the epenthetic vowel (before the merger of labiovelars with plain velars, so well before Proto-Balto-Slavic), but this seems inconsistent with the Slavic outcomes which depend on other factors and so require a later (post Proto-Slavic split).
It's possible there was dialectal variation within early Balto-Slavic with Pre-Lithuanian undergoing this early split, and East Slavic (and also Slovene & Kashubian amongst others) rounding the epenthetic ǐ (or ь depending on transcription) in slightly different environments at a later stage, likely due to the cross-linguistically common trend for coda l to velarise to ł and cause rounding (or vocalise completely, losing any lateral character cf Polish <ł> /w/).
For what it's worth, wiktionary gives Proto-Slavic (and Proto-Balto-Slavic) reconstructions of both words (*vь̑lkъ, *pь̀lnъ) with ǐ, citing Vasmer, Max (1964–1973), in Этимологический словарь русского языка [Etymological Dictionary of the Russian Language] (in Russian), translated from German and supplemented by Oleg Trubachyov, Moscow: Progress. I do note however that despite wolf having a labiovelar, the Lithuanian does not show a rounded vowel.
Answer: There has never been any sound u before the syllabic sonorant l in the Slavic words for "wolf" and "full".
Proto-Balto-Slavic (PBS) *wilkás ("wolf") and *pilnas ("full") begat Proto-Slavic (PS) *vĭ̯l̥kŭ and *pĭ̯l̥nŭ respectively:

PBS *wilkas > Early PS *vĭlkŏs > Late PS *vĭ̯l̥kŭ
PBS *pilnas > Early PS *pĭlnŏs > Late PS *pĭ̯l̥nŭ

The change was conditioned by the law of increasing sonority within a syllable a.k.a. the law of the open syllables which appeared in Proto-Slavic. According to this law, in every syllable the sonority could only rise, the voiceless fricatives being of the least sonority and the vowels of the greatest sonority, which made every syllable open, no closed syllables were allowed anymore. Consequently, l couldn't directly precede k within the same syllable, since l is more sonorous than k. To fix the situation, l became syllabic l̥, that is, the most sonorant sound of the syllable, and i became non-syllabic reduced (ultra-short) glide ĭ̯ ('ь̯'), that is, less sonorant than the following syllabic liquid: Early PS *vĭl-kŏs > Late PS *vĭ̯l̥-kŭ. Later this ĭ̯ stopped to be pronounced at all and only the syllabic liquid remained, that is the stage we see in the Old Church Slavonic [vl̥kŭ] and [pl̥nŭ]. This syllabic liquid l̥ < *ĭ̯l̥ didn't have a special letter in Cyrillic and was written with digraphs ль, лъ, ъл, the choice of the type and position of the reduced vowel letter in the digraph was irrelevant since the vowel letter was silent anyway:

[vl̥kŭ] — влькъ, влъкъ, вълкъ
[pl̥nŭ] — пльнъ, плънъ, пълнъ

Later, when the reduced vowels ("the yers") disappeared and the law of the open syllables ceased functioning, a new sound change called pleophony (also known as "polnoglasie" or "full vocalization") occurred in the East Slavic (ES) languages. During this stage the change [l̥] > [ol] occurred which was reflected in writing as using only ъл: вълкъ, пълнъ.
As you can see, there was no [u] of any kind in these words, the letter ъ (ŭ) being just an orthographic convention there. However, while describing the development of the PBS liquid diphthongs with high vowels (*ir, *il, *ur, *ul) Wikipedia says that

there is a divergence of opinion, with some scholars assuming that the high-vowel liquid diphthongs evolved into syllabic sonorants early in the Common Slavic period (even before the metathesis of the mid-vowel liquid diphthongs), while others assume that the change to syllabic sonorants was one of the last changes in the Common Slavic period and did not occur at all in many languages (e.g. East Slavic).

As for me, it is quite problematic to agree that "the change to syllabic sonorants did not occur at all in East Slavic", since if we agree, we will have to acknowledge the change of Early PS *ĭ to Early East Slavic *ŭ which is very unlikely in general and practically impossible in PS dialects since they held a consistent distinction between *ĭ and *ŭ. That is why the two Old East Slavic words you list never had any u-like sound in their first syllables, the development was like this:

PIE *l̥ > PBS *il > Early PS *ĭl > Late PS *ĭ̯l̥ > Early ES *l̥ > ES ol (ъл)


Sepolia Testnet

Question: I am using Sepolia testnet to work and develop my dapp. I created the contract and deployed to the Sepolia network. I will be making several transactions in this similar manner. I know it is possible to check individual transaction using tx hash. But, is it possible to access the entire file where blockchain and its transactions is stored? I want to analyze the transactions I have made. If it is not possible here? Is there any other test networks I can use to develop my dapp  that will allow me to download the entire blockchain. Any help in this regard is highly appreciated.
Answer: I guess Sepolia Testnet also works in the same manner compare to other blockchain. If you search on the 'etherscan.io' with your transaction address, then you can find your contract by each transaction. Is this an answer that you want?
Answer: I think you may not fully grasp how a Blockchain works.
A Blockchain is a chain of blocks, stored in a decentralized manner in thousands of nodes and therefore there isn't a file where blockchain and its transactions are stored, but thousand of copies of a Blockchain, block by block. I think the Ethereum Blockchain for instance weighs 720Giga as of today.
A Blockchain is a ledger. Etherscan is basically an API that accesses the Ethereum Blockchain and searches a particular tx in all the blocks of a Blockchain.
There is no such thing as a Blockchain file.
In general as a good practice for developing a Dapp developers will first deploy on local testnet for speed, accessibility and readability.
There are 3 main Smart Contract development frameworks that come with their own test network:

Hardhat
Truffle suite
Foundry

They all have their own set of tools, advantages and disadvantages.
However to a beginner smart contract dev i would personally recommend the use of Ganache from the Truffle suite. It comes with a GUI that is for a starter a great way to get the hands on it, vizualize and grasp the key concepts and inner workings of transactions, a blockchain ...

Disclaimer: the next sentences only reflect my own opinion.
I personally would see Truffle as the perfect entry point for a beginner Smart Contract developer, to then moving on to Hardhat that is more complex but has more tools or extensions and is faster, to finally end with Foundry which is the most complex but , in my opinion,the fastest, the most complete and powerful for Smart Contracts development.
Answer: To download and explore the entire blockchain history you have to run Full Archive Node of preferred network.

Sepolia Testnet


Can we display facebook application on user profile?

Question: I have a Facebook application which is displayed on canvas page like all other Facebook applications but I want to display application on users profile page like Facebook's find friends,messages applications so that left panel displaying Favourites, Apps,groups are visible to user.
Answer: No - this is not possible.  Tab applications can only appear on Facebook Pages.


Toggle between fullscreen editor and terminal in VS Code

Question: As a Windows systems admin, I use PowerShell quite a lot. With the release of PS Core, and the implication that the ISE is dead, I've started to try to use VS Code as my day to day tool. One feature I'm missing from ISE is the ability to swap between the editor and the terminal in fullscreen. I usually kept ISE open and maximized, and used Ctrl+R to swap between editor and terminal as needed. I haven't found a way to maximize the terminal, and swap easily between terminal and editor. I know I can make the terminal take up most of the screen, but a) this still leaves about 2 lines of editor open at the top, and b) there doesn't seem to be an easy way to then maximize the editor. Is there a way to minic the ISE behaviour that I haven't found yet?
Comment: Three and a half years later and I'm still getting +1's on this. :-) I would like to mention, however, that I don't do this anymore; since I'm writting system admin scripts, it seems to me that as a security best practice, I run VS Code as my day-to-day (non-admin) user, and run a separate PowerShell console as my admin account on my second monitor to run and test my scripts, as well as test out cmdlets to put into the script. I can't use the integrated debugger this way, but I honestly haven't needed it.  FWIW and YMMV and all that, of course.
Comment: similar question: [In VS Code, how can I toggle maximization of the current workbench part / editor group?](https://stackoverflow.com/q/58885067/11107541)
Answer: To toggle between a full screen editor and a nearly full screen terminal you can use:
{
    "key": "ctrl+alt+m",
    "command": "workbench.action.toggleMaximizedPanel"
}

with your keybinding of choice to replace the Ctrl-Alt-m : that is mine.  You just need to "maximize" the terminal first - pull it up as far as it goes.  It will remember that between sessions.

Revisiting this :
As of v1.38 this is now pretty simple.  There are two commands that will toggle the panel/editors to full screen.
Pick some keybinding to use for the toggle trigger:
{
    "key": "ctrl+alt+q",
    "command": "workbench.action.toggleMaximizedPanel",
    // "command": "workbench.action.toggleEditorVisibility"  either one
    "when": "!terminalFocus"
},

The above will expand the panel or editor to full height, but toggling back will return the panel to its original size but not to nothing.  If you want the terminal to bounce between full open and full closed try both of these keybindings:
{
  "key": "ctrl+alt+t",  // you could use     "key": "ctrl+`",  if you wish
  "command": "workbench.action.closePanel",
  // "when": "terminalFocus"
},
{
  "key": "ctrl+alt+t",
  "command": "workbench.action.toggleMaximizedPanel",
  "when": "!terminalFocus"
},

The order of the above 2 keybindings is important.

v1.50 is adding the setting panel.opensMaximized - I tried its different options but couldn't get a simpler result than the two keybindings ctrl+alt+t version I showed above.  In any case, start with the panel closed for it to work well.
Comment: That's close; it bring the console to (mostly) maximized like you said.  However, when I toggle it again, the editor isn't maximized; I'm left with a half-half editor and console.
Comment: Best alternative till microsoft decides to introduce this feature officially. Thank you.
Comment: I think you just have to play with the initial positioning of the terminal - it works for me.  Set a starting position when "maximized" and another when almost closed and it seems to remember those positions - it's not perfect but pretty close to maximizing each in turn.
Comment: I had tried that, but I moved the bar all the way to the bottom.  I suppose that closed the bottom section, rather than actually moving the divider, because that's how I got the behaviour I mentioned. If I leave a line of console on the bottom, you're right, it does appear to be close to what I want. I'll leave this for a day or two, and if no-one gives me a better answer that's exactly what I want, I'll accept this one.
Comment: Whups, I spoke too soon.  If the focus is in the terminal, it doesn't work.  If the focus stays in the editor, the two swap as described.
Comment: You're doing it wrong.  ;>}   I see no difference in behavior depending on where focus starts.  I suppose you could make a macro to ensure focus shifts to the "maximized" panel. Or use another keystroke for terminal focus toggle.
Comment: Hrm, looks it's more the keybinding I'm using; I had replaced Ctrl + J in VSCode, but it seems there's a Ctrl + J binding in the PowerShell console itself getting in the way. If I change it to Ctrl + Alt + M like you have, it works fine. :-S I'm liking VS Code less and less; ISE seems to have been a better sysadmin tool. The console is such an afterthought in VS Code (not surprising, given VS Code's origins), it doesn't seem to be nearly as useful as the ISE console was.
Comment: Well, this looks to be the best answer I'm going to get.  I'll accept it on that basis.
Comment: This works for toggling between full screen terminal and closed terminal, but I am not sure how to automatically focus on editor window after I close the terminal. Anyone who knows how to do this?

  ```json
{
    "key": "ctrl+m",
    "command": "workbench.action.togglePanel",
    "when": "terminalFocus"
  },
  {
    "key": "ctrl+m",
    "command": "workbench.action.toggleMaximizedPanel",
    "when": "!terminalFocus"
  }
```
Comment: Thank you! In case of warning "`Maximizing the panel is only supported when it is center aligned.`", it should possible to set it to center via context menu on the panel tab section (e.g. on `Terminal` tab itself). Related: https://stackoverflow.com/a/77354988/5113030 , https://github.com/microsoft/vscode/issues/141094
Answer: The below outlines my solution after reading @Mark 's answer, as it's slightly different. I use ctrl-alt-m to switch between a full-sized terminal and full-sized editor.
note: this includes the mentioned integrated terminal and vscode application menu bars.
For posterity's sake, I'm on vscode version 1.40.1.
Implementation
You'll need to add to your keybindings within vscode and execute a manual step.
keybindings.json
Add this to your keybindings.json file, accessible via the Keyboard Shortcuts editor:
    {
        "key": "ctrl+alt+m",
        "command": "workbench.action.toggleMaximizedPanel",
        "when": "!terminalFocus"
    },
    {
        "key": "ctrl+`",
        "command": "-workbench.action.terminal.toggleTerminal",
        "when": "!terminalFocus"
    },
    {
        "key": "ctrl+alt+m",
        "command": "workbench.action.terminal.toggleTerminal",
        "when": "terminalFocus"
    }

Slide down the integrated terminal
Once you've done this and saved your keybindings.json file you need to manually slide down the integrated terminal all the way off the screen on the bottom, after opening from your editor with ctrl+`.
Afterwards, you should be able to use ctrl+alt+m in your editor and your terminal to get a full-screen-ish experience moving between them.
I've tested this on Ubuntu and Fedora locally as hosts and using remote-ssh to an Ubuntu remote from a Windows 10 host. This has the added benefit of allowing you to get the by-default smaller terminal from within your editor using ctrl+` but use a single command, ctrl+alt+m, for switching between editor/terminal. YMMV!
Comment: how to return the focus back to the editor after toggling the terminal?
Comment: upvoted for mentioning where to actually put the change (keybindings.json)
Comment: @rahulKushwaha I just use the combo `ctrl+\``. That last character is a _backtick_, per the second `"key"` value, `"ctrl+\`"`, in the second block, above.
Answer: Solution 1: Create Terminal in new Tab and Switch Between Tabs
Ctrl+Shift+P > Terminal: Create New Terminal in Editor Area create a terminal as a new Tab (A.k.a. Editor). It looks like:

Now you can toggle between Tabs (A.k.a. Editors) and Terminal (Which is in a new Tab) using View: Quick Open Previous Recently Used Editor in Group
Solution 2: Create Terminal in new Editor Group and Switch Between Editor Groups
Ctrl+Shift+P > Terminal: Create New Terminal in Editor Area to the Side create a terminal in new Editor Groups. It looks like:

Now you can toggle between window and terminal using View: Navigate Between Editor Groups
NOTE:
You can add keybinding to the commands as per your convenience. For example, in case of Solution 1:
{
    "key": "ctrl+`",
    "command": "workbench.action.createTerminalEditor"
},
{
    "key": "ctrl+tab",
    "command": "workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup",
    "when": "!activeEditorGroupEmpty"
},
{
    "key": "ctrl+w",
    "command": "workbench.action.terminal.killEditor",
    "when": "terminalEditorFocus && terminalFocus && terminalHasBeenCreated && resourceScheme == 'vscode-terminal' || terminalEditorFocus && terminalFocus && terminalProcessSupported && resourceScheme == 'vscode-terminal'"
}

Here, Ctrl+W & Ctrl+Tab are set by default. I just modified Ctrl+`.
The above keybinding will

Create terminal when you press Ctrl+`
Close terminal when you press Ctrl+W
Toggle between fullscreen editor and terminal when you press Ctrl+Tab
Comment: Note that unlike the other answers, this method actually creates a terminal-as-editor which is not part of the panel. In particular this means you can have another part of the panel open while you use the terminal, although it also means there won't be a quick shortcut like `ctrl-\`` to get back to the terminal.
Comment: I'm not sure how that works. `Quick Switch Window...` moves me between VSCode windows (workspaces), not tabs within a window.
Comment: @BallpointBen Thank you very much for your feedback. I have updated the answer. Please let me know if you have any more issues.
Answer: Opening the terminal in VS Code in full screen
This solution will replace the standard keybindings in VS Code so the terminal toggles in full screen.
Implementation
Open command palette ctrl+shift+p and search for Preferences: Open Keyboard Shortcuts (JSON) and paste this between the square brackets.
{ "key":"ctrl+j", "command":"workbench.action.toggleMaximizedPanel","when":"!terminalFocus" },
{ "key": "ctrl+oem_3", "command":"workbench.action.toggleMaximizedPanel", "when":"!terminalFocus" }

Comment: For peeps on macOS the "key" section should be "cmd+j"
Answer: There is now an extension for exactly this. It is the "maximizeterminal" extension by Samuel T Scott. It redefines ctrl+` for opening terminal full-screen. The above keybinding methods, are also great, but in my experience they tend to not work properly once you start opening files by using cli like "code app.js". While using the extension such problems do not occur.
Answer: For macOS users, you can set the shortcut in the same keybindings.json file.

You can access the file using the shortcut cmd+shift+p, then write/select Preferences: Open Keyboard Shortcuts (JSON).

In keybindings.json, paste the following code between the square brackets:
{ "key": "cmd+alt+m",
   "command": "workbench.action.toggleMaximizedPanel",
   "when": "!terminalFocus" }

You can change the shortcut to whatever suits you (mind rewriting any of the default ones!), but I set mine to the same as others suggested (cmd+option+m) to keep a "standard".
Answer: Right click on the terminal instance name at the top as seen below and then select "move terminal into editor area". This will allow you to have a full workspace view within VS Code.
Image of process
Answer: I love this question, I believe I figured out something or at least got the behavior I was looking for.
Using the workspace setting here: https://github.com/microsoft/vscode/issues/107624
(enter ctrl+, and search "openmaximized" and set the dropdown to "always")
From there I set the keyboard shortcut for "Toggle Terminal" to ctrl+j (or whatever you may prefer) and now when I toggle my terminal it goes from full screen to toggled off
Comment: This is the way.
Answer: ⇧+⌘+↩ (Shift + Command + Return) toggles maximised terminal in Version: 1.81.1 (Universal) on MacOS.
Other useful default keybindings:

⌘+J toggles panel visibility, i.e. show/hide terminal
⌘+B toggles left side bar visibility
Answer: In Visual Studio Code, you can toggle between minimizing and maximizing the terminal window using the following shortcuts:
Windows/Linux: Ctrl + (backtick)
I also found Ctrl + j works
Answer: For MacOS I found useful cmd+option+m


What do you call the diagonal part of some barbed wire fences on the top?

Question:
What do you call the diagonal part of some barbed wire fences on the top? I am wondering if there's a particular word for it or not, because it's something common, but I don't recall it having a particular word. The best phrase I could come up with is "diagonal barbed extension."
Answer: You could describe that part as an "overhang", and some fence manufacturers do use that to sell such fences https://www.fenceall.com/product/barbed-wire-overhang/
Answer: Searching on the phrase

barbed wire fence angled part on top

gives some results, with lots of pictures. The links suggest the angled parts, which come in great variety, are sometimes called "arms".
For example,
google search fence accessories


Win-Tab not working

Question: I was showing a friend the neat effect of Win-Tab on Windows 7, but when he tried it, it didn't work!  All it does is bring up the Start menu!  What could be causing this?
Comment: Some time ago I installed vista on a laptop with a pretty puny video card - a 64MB ATI - and while aero worked and remained enabled, windows automatically disabled some of the more resource intensive effects, including flip3d.  I recall a message being shown shortly after I installed the OS indicating that the graphics card was a "highly contentious resource", and some effects were being disabled as a result (or something to that effect).  Unfortunately I do not know how to check whether or not this aero is in this degraded state.
Answer: Check that Desktop Composition (i.e. Aero) is enabled:
<code>Control Panel -> System and Maintenance -> System
Advanced system settings
Advanced tab
Performance -> Settings
</code>
Answer: Does he have Aero enabled?
Windows Flag+Tab does not work when Aero is disabled.
I think due to this, it does not work on Vista Home Basic or Windows 7 starter either.
Comment: If your tweaking custom settings, I found I had to apply new settings then toggle "desktop compostion off/on" to get WIN + TAB  to work again. (Historical note, and tested on Vista Business SP2)
Answer: Is your friend holding down Win when hitting Tab?
Even on my XP work machine, holding Win and pressing any other key doesn't pop up the Start menu; the start menu only pops up if you press Win and then release it without pressing anything else.
Answer: Mouse over something in the taskbar. If no image appears above it, either Aero is disabled or — as stated earlier — you have Vista Home Basic. You can confirm this by right-clicking on computer and selecting properties. Aero Glass isn't available in this version of Vista.

Win-Tab not working


Is it possible to realize a general compact Riemann surface in $\mathbb CP^2$?

Question: Let $X$ be a compact Riemann surface with smooth boundary $\partial X$. Is it always possible to realize $X$ as a complex submanifold of $\mathbb CP^2$? In other words, is it true that there exists a Riemann surface $Y \subset \mathbb CP^2$ with boundary $\partial Y$ and a bijection $f \colon X \to Y$, $f(\partial X) = \partial Y$ such that $f$ and $f^{-1}$ are both analytic?
Comment: I'm not sure about the case with boundary, but without boundary the answer is no--you cannot even embed all elliptic curves. It turns out the answer is yes thought if you replace $2$ by $3$. I can't seem to find a reference, but I think it is due to Narashima (spelling?).
Comment: Dear @Alex, I'm not sure what you mean, but every elliptic curve **can** be embedded into $\mathbb P^2$: any divisor of degree 3 on X is very ample and will do the job.
Comment: @AlexYoucis Then in general it isn't also true in the case with boundary. Is there a name for compact Riemann surfaces with boundary that can not be extended to a closed Riemann surface? Maybe something like "transcendent Riemann surface"?
Answer: a) Every compact Riemann surface (without boundary)  $X$ can be embedded into $\mathbb P^3$.
Indeed, if $X$ has genus $g$ and $x\in X$ is an arbitrary point,  the divisor $D=(2g+1)\cdot x$ is very ample and embeds $X$ into $\mathbb P^{g+1}$.
If $g\geq 2$ it is easy to project the obtained embedded Riemann surface into a linear subspace $P^3\subset \mathbb P^{g+1}$ of dimension $3$ and thus obtain the composed  embedding $X\hookrightarrow P^3\cong \mathbb P^3$.
b) However Riemann surface of genus $g\geq 2$ cannot in general be embedded  in the plane $ \mathbb P^2$:
one obstruction is that the genus of a smooth plane curve of degree $d$ is $g=\frac {(d-1)(d-2)}{2}$ and , of course, most integers are not of this form!
For example Riemann surfaces of genus $2,4,5,7,8,9,...$ can never  be embedded into $ \mathbb P^2$ .
Comment: Dear @Georges, the question wasn't about Riemann surfaces without boundary, see also my comment to Alex. Maybe it is always possible to embed in $\mathbb C P^2$ such compact Riemann surfaces with boundary that can not be extended to a closed Riemann surface?
Comment: Dear @Nimza: you are right. Let's say that the answer summarizes the case where the boundary is empty! But  could you please explain exactly what the charts and change of coordinates for these Riemann surfaces with boundaries  are? And  what is a Riemann surface $Y\subset \mathbb P^2$ with boundary ? Is there  a reference for those notions (I have never heard of them)? I suppose a Riemann surface with an open disk deleted  is a Riemann surface with boundary ?
Comment: I use the following definitions: the "near-boundary charts" are $\{ z \in \mathbb C \colon |z| < 1, \; \Im z \leq 0 \}$ and transition functions are supposed to be extendable to biholomoprhic functions in some neighborhood of $\Im z = 0$. But I've seen the definitions where it is a $C^\infty$ $2$-manifold with boundary with a class of conformally equivalent metrics or with a smooth section $J$ of $\mathop{\mathrm{End}} TX$, satisfying $J^2 = -Id$. I don't know if first and two last definitions agree.
Comment: Thanks for the clarification, Nimza. I would guess (but do not guarantee) that both definitions are equivalent since almost complex structures are integrable in complex dimension one. More to the point: I know nothing about these structures in either definition!
Comment: (I think that the first definition may be more strict since extendibility may require the boundary to be more good than just $C^\infty$, e.g. real analytic, but I'm not sure)


Change annotation background colors in eclipse?

Question: So in eclipse whenever there is an error it's underlined in red, and when you hover over it is displays an annotation with tips on how to fix the error.  On my Windows OS it is correct and the background is a tanish color but on Ubuntu the background is black and I want it tanish like Windows.  I know there is an annotation area under Preferences > General > Editors > Text Editors > Annotations, but I don't see a section to change background colors. Please help.
Comment: Any luck? I would love to be able to change this!
Answer: Oddly, colors and fonts are very poorly implemented in Eclipse.  Quite a number of things are either extremely difficult to figure out or impossible.  Looks like this one is impossible to modify.  Perhaps there's an OS way to make those changes?
That said, I found an Eclipse plugin, Annotions Ruler Background.  It looks like it should do the trick, but was designed for Indigo (3.7) and doesn't seem to work on Juno (4.2). Sigh.
You can install it from the usual way in Eclipse (help->eclipse marketplace->search, etc.).  Their website is here.
If you're still on Indigo, give it a try.
Answer: I find this page, it works. http://ubuntu-user-tricks.blogspot.tw/2012/09/3-things-to-do-after-installing-eclipse.html
It change the theme tooltip background color, and foreground color if need.
You can install tool gnome-color-chooser or modify the configure directly (default at /usr/share/themes/Ambiance/gtk-2.0/gtkrc). If  After you modify the theme configure, you need reload theme to use new config.


Can you keep money from an unknown source?

Question: I have recently rewatched Breaking Bad, and something that happened in the last  season had me wondering. Jessie tries to give $2.5M each to Mike's granddaughter and the family of the boy that was killed. Saul states that in both cases, this suspicious money would be seized instantly and advises against this plan. My question is, in a similar, real situation like that, would the authorities actually take all of the money if there was no clear source if a legitimate origin isn't known, but they also couldn't conclusively prove its the product of criminal activity? What legal reason would they have for taking it, provided the recipients were willing to report the income and pay the necessary tax?
Comment: It depends what you do with the money, making this hard to answer. If you keep it under your bed, you're fine. Anything involving banking, investment, or finance will probably result in you coming up against anti-money laundering legislation. You may want to use it to buy different things, when you may or may not run into people who are legally obliged to ask where you got it.
Answer: The process would play roughly as follows.

Jessie gives $2.5M to Mike's granddaughter as a gift.
Mike's granddaughter files this as income. I believe the appropriate tax law would be inheritance law and as they are not related the tax would be quite high.
The tax office notices that this is highly unusual and suspicious but not illegal per se. Hence they investigate to find out more.
They find out that Jessie did not legally own the $2.5M he gave (because it was illegal drug money). Hence Jessie was not in a position to make this gift and they can and will confiscate it from Mike's granddaughter.

Note that if Jessie can prove that he legally owned the money there is no crime and he is free to give it to whoever he pleases.
Comment: This is incorrect at step #2. Most gifts are neither taxable nor reportable as income. It's the gift *giver*, not the receiver, who must file and pay tax. Mike's daughter wouldn't file this as income, Jesse would have to file it as a gift.
Comment: Jesse = He https://www.imdb.com/title/tt0903747/characters/nm0666739?ref_=tt_cl_c_2
Comment: @NuclearHoagie I think this is jurisdiction dependent. In German law the recipient needs to file the gift as income. If in the US this is the job of the gift giver I don't know how or why the strategy would fail or how the tax office would find out.
Answer: You can keep unless they can take. The police cannot, for example, randomly enter my house and seize my property – any seizure must be reasonable. They cannot arbitrarily seize my bank accounts. Unless we're dealing with property in my possession when I am arrested, there probably has to be a warrant to search and seize, supported by some kind of evidence that there is evidence of a crime to be found.
Once the police are in possession of your property, they can (details vary by state) initiate a legal process of civil forfeiture, where they sue the property for its criminality, and if they win in court, they get to keep the money (or other property). The government has to prove by a preponderance of evidence that the money is the fruit of criminal activity. That means that the owner has to prove that the property is "legal". The specific legal requirements vary by state, here is a study of what the requirements are, though New Mexico is not one of those states that makes civil forfeiture easy and profitable for the police.
Comment: *"The police cannot, for example, randomly enter my house and seize my property – any seizure must be reasonable."* **This is just not true.**  Many police jurisdictions can and do routinely seize money and goods that ***might*** be linked to criminal activity.  They never have to prove it; the burden to prove it is legal is on the victim of ["civil asset forfeiture"](https://www.aclukansas.org/en/know-your-rights/civil-asset-forfeiture)
Comment: Yeah that all makes sense. But I specifically meant if you decided to declare it to the IRS, pay income tax on it, and try and put it in a bank account. Of course like the above comment says, you're definitely going to get some trouble with anti-money laundering legislation snd the authorities would take possession of it. The main part of my question is after a trial, where you could not prove the origin and this mi ey because you genuinely didn't know where it came from but the authorities also could not prove it to be the fruit of illegal activities, what would happen next?
Comment: Assuming that the government sued the money for being illegal and offered a smattering of evidence that it could be the fruit of illegal activity, then because you can't disprove their claim, they keep the money.
Comment: So what, then, would happen if by some miracle the government could produce a modicum of evidence as to the nature of this money. If the source was completely unknown, they could not find a link to any person, organisation, or any known crime whatsoever, the only suspicion being the lack of a known legitimate source. Then would you be able to keep it, providing you followed the required legislation on income/inheritance tax, whatever would be appropriate?
Comment: There's a problem with the first two sentences in your comment: the source of the money is not completely unknown, if they have a modicum of evidence that the money is connected to a crime. As the owner of the money, you have to disprove that modicum of evidence. Also, incidentally, if the police cannot find a link to you (no proof of ownership), it's not your money so you wouldn't get to keep it. Any fact that you can use to your advantage in the lawsuit, they can also use.


How to increase the number of authors followed in Google Scholar?

Question: I have created alerts in google scholar (one alert per researcher). The number of authors I can follow is limited (to 200) and thus I am not able to add more authors. Is it possible follow more authors?  How?
Comment: You mean that google scholar limits the number?
Comment: @WolfgangBangerth Yes. It is limited.
Comment: How many alerts can you create at the most?
Comment: @adipro 200 alerts.
Answer: Following multiple authors (or journals, or documents, or keywords) is in my view, much easier using a saved search rather than 'following' multiple different authors:
"A. A. Author 1" OR "B. B. Author 2" OR "C. C. Author 3"
and so on. That way, you can pack as many authors in as you like which avoids restrictions (but there will probably be a search string limit somewhere). Also, you won't receive two separate emails about the same paper if it contains two authors you follow. Reducing the number of alerts to one per category (authors, documents, sources) also cuts down on the emails you will receive.
Personally I use Scopus to do this. I have an author alert and also a journal alert. The reason I use Scopus is because authors and sources are assigned a unique ID which makes it more precise.
Simply edit the alert to add/remove authors/journals/documents when the need arises. I keep a list of the authors and sources that are currently inside the alerts, with their associated Scopus code, so I can easily swap out or add if I need to.
In Gmail (where my institutional email is redirected), I have labels set up for 'Author Alerts' or 'Journal Alerts' etc. Keeps everything tidy and separated from personal stuff.


How can I atomically reorder array items in MongoDB?

Question: I have a playlists collection. Each document in the collection contains an entries field, that is an array.
How can I change the order of entries in a playlist, atomically?
(e.g. If another user tries at the same time to $push a new entry, I want to make sure that the new entry is $pushed only after the reordering has happened)
If I do a find(), then reorder in PHP, then update(), I might lose the new $pushed entry if the operation is not atomic.
This is a sample playlist object:
{
    "_id" : "playlist1",
    "title" : "Playlist One",
    "entries" : [
            {
                    "class" : "song",
                    "identifier" : "song1"
            },
            {
                    "class" : "song",
                    "identifier" : "song2"
            },
            {
                    "class" : "song",
                    "identifier" : "song3"
            }
    ]
}

Edit:
I think I found a possible solution, using execute():

Running JavaScript in the database takes a write lock, meaning it blocks other operations.

(from http://php.net/manual/en/mongodb.execute.php)
I just need to execute the code (find() + reorder() + update()) on the MongoDB Server.
Still, if you have another idea that doesn't involve "code within a string" (e.g. $func = "function() { do_something(); return \"something else\" }"), please share it.
Thanks!
Answer: Using eval() to block operations is a side effect of the current implementation, not a feature to rely on.
The MongoDB wiki has a page with information on Atomic Operations.
A relevant strategy for your use case would be "update if current":

Fetch the object.
Modify the object locally.
Send an update request that says "update the object to this new value if it still matches its old value".


How do I run a cron job on a Mac?

Question: How can I make my Mac (running the most recent OS) do a task automatically once a day? For example, I'd like to have it automatically download a copy of this open source algebraic geometry textbook once a day. I have a feeling that some combination of wget and cron should work, but, after googling and reading the cron documentation, I just couldn't get it to work right.
Comment: I suggest you don't use Crontab and instead learn to use Launchd as already suggested.
Comment: My problem is that *both* cron and launchctl/launchd only permit precise time specs ie. "This hour, minute and second". My Mac is not on all the time - I need something like *anacron* in the Unix/Linux world, to run tasks "daily" no matter when I wake up and turn on the computer.
Answer: I think in OS X you should use launchctl for "cron jobs".
But otherwise your task should be easy to do with a cronjob
sudo crontab -e
55 23 * * * wget http://www.math.columbia.edu/algebraic_geometry/stacks-git/book.pdf
This should run everyday at 23:55
Update
You should specify the output location of WGET with -O /path/to/file
Comment: If using launchd, see http://apple.stackexchange.com/questions/3030/how-to-run-something-automatically-when-the-system-boots-or-a-use-logs-on
Comment: You don't necessarily need sudo. Individual users can have their own crontabs
Answer: The cron daemon can be activated by a simple:
sudo touch /private/etc/crontab

Then it's advisable to enter the full path of your /usr/local/bin/wget (or wherever it lives). Cron does not know of your user's $PATH. Hope it helps.
Comment: This should be the accepted answer, most useful part was "Cron does not know of your user's $PATH", that's very useful and this lead me to solve it on my side.  Thanks!
Answer: You may use Cronnix which is a free graphical interface for cron :
http://www.macupdate.com/app/mac/7486/cronnix/
Comment: *cronnix* has been officially discontinued upstream.
It may stop working correctly (or at all) in recent versions of macOS.
Answer: If you're finding the command line syntax (etc) too confusing/arcane, you might lok at GUI tool for viewing/editing/creating these jobs.
In the past I've used Lingon, which has been made available on the Mac App Store now too. I don't need to use it very often, but it's very useful when I do!
Answer: A more elegant solution (than cron) is to use iCal notifications + Applescript.
First, launch AppleScript Editor (located under /Application/Utilities) and paste the following code:
set the destination_file to ("~/Downloads/book.pdf")

set the contentLink to "http://www.math.columbia.edu/algebraic_geometry/stacks-git/book.pdf"

tell application "URL Access Scripting"
    download contentLink to destination_file replacing yes
end tell

Save the script and quit applescript editor.
Open your iCal and create a new event for today, setting the time you want, select "repeat: Every day" and as an alarm "Run script" and select your applescript.
If you want to notified for every download, you may add another alarm with a "Message with Sound", "on date".
Answer: I recommend Macaroni. Its advantage is that when you set a job to run once a day, it runs whenever your computer is on, regardless of the time. So you won't miss a job because the computer was off at the specified time.

Macaroni is a tool which handles regular maintenance for Mac OS X, including the Mac OS X repair privileges process as well as Unix-style maintenance. You could do this yourself, but don't you have more interesting things to do with your time?

How do I run a cron job on a Mac?


s/mime decrypt with sender's private key

Question: I made a few sets of certificates for s/mime encryption using openssl (for various email addresses I have). When account 1 sends an encrypted message to account 2, account 2's private key successfully decrypts the email. However, account 1's private key can ALSO decrypt the email.
I've tested this using two methods I know of that let me select a specific key to decrypt with: the android app FairEmail, and plain old openssl.
My understanding is that the sender uses the receiver's public key to encrypt the message. Therefore, the receiver's private key is the ONLY one that can decrypt the message. Based on the above, this seems not to be true. Am I missing something?
Answer:
My understanding is that the sender uses the receiver's public key to encrypt the message

Not exactly. The sender uses the receiver's public key to encrypt a symmetric key (such as an AES or RC2 key), which is then used to encrypt the actual message.
(See "hybrid encryption" or "hybrid cryptosystem" for an explanation why.)

Therefore, the receiver's private key is the ONLY one that can decrypt the message.

The message has multiple encrypted copies of the same symmetric key – one encrypted to the recipient's public key and one encrypted to the sender's own public key.
Similarly, if you send the message to five recipients it will have a single copy of the 3DES-encrypted message data, but six copies of the RSA-encrypted 3DES key – one for each recipient, plus one for the sender.
Comment: I see. That makes sense. I took a look at the *.p7m and it indeed shows keys for all the recipients and the sender. Thanks!
Comment: Correct, although AES should be used instead of 3DES. [CVE-2016-2183](https://nvd.nist.gov/vuln/detail/CVE-2016-2183) disclosed a major security vulnerability in DES and 3DES encryption algorithms. NIST has deprecated 3DES for new applications in 2017, and for all applications by the end of 2023.
Comment: @not2savvy: While true in general, "approximately four billion blocks" makes the vulnerability extremely inapplicable to email, unless you send 256GB-sized messages. As far as I've read so far, 3DES is still strong as a cipher in general (i.e. there's no specific "break" for it like there is for RC4 or single-DES), so S/MIME implementations often don't see adding AES support a priority. I think Outlook still can't read such messages?
Comment: As far as I know, all MUAs use AES, but of course still support 3DES in incoming emails. I believe, that's even including Outlook! :)


Without IP address, are there any other identities considered for banning nodes

Question: Does a node only ban the IP address of a malicious node? or, there are other identities included. I mean, if a malicious user can generate multiple IP addresses to send fake tx, what will be the countermeasure then? Suppose, the other node, which will verify this tx, also a malicious attacker.
Answer: First of all, IP addresses are not stored in transactions nor can a node just "generate IP addresses".
How banning works is that nodes connect to each other via TCP sockets which are stream sockets so both nodes know the IP address of the other node. So when a node is banned, the banning node refuses to open a connection to the banned node. Nothing else is involved in banning, so if a node connects through another IP address (not by "generating IP addresses", that's not a thing, but rather by using proxies or VPNs), it would not be banned.


Is working for Facebook & Google haram and even take online courses for certificationfrom such companies offering for future job?

Question: I'm really confused and I need a clear answer. I'm in a doubt whether I should take this Google's project management course and it's certification for future job offers or not? And is it haram to work for Google & Facebook since most of their revenue comes from advertisement?? And isn't most of their advertisement including bad stuff??? What should I do? Should I not go for the course Google is offering? And is working with such companies haram? Please explain clearly with evidence from the Shari'ah
Answer: I don't think its haram to work at FB or Google or studying Courses from there

1.About Taking Courses
All You are doing is just taking ilm(Knowledge) from them, for e.g. many our Muslim students study in countries like Germany, UK, USA etc. by non Muslim teachers in numerous different field like Engineering, Medical, etc. So does that mean they all are doing haram?. The answer is NO! they aren't, so its an example that we sees everyday.
Imam Ali ibn Abu Talib, 4th Caliph (may Allah be pleased with him), once said, "I would be slave of a person who teaches me a letter"
So we can see that how much knowledge is important in Islam and from Imam Ali karamallahwajahul kareem's blessed statement we can see that it is not important who  teaches you ilm, its more important that you should acquire ilm as much as you can.
2.About Working For them
From Various Islamic Sources we can see that many Sahaba Ikram worked for the non Muslims. E.g. Imam Ali karamallahwajahul kareem worked for a jewish men in his Date farm So its not haram to work under a non Muslims and about bad things in FB/google ads its not something you should worry cause they are doing the bad thing not you so its not haram to work for them as long as you are not doing the same thing.


Magento Multivendor seller admin panel not working in the magento 2.3.3

Question: I have installed the  Marketplace Multi Vendor extension.Both  production and staging installed but staging is working  fine.but the production has  some error shown.The issue is creating the  one seller in front end is created , but the back end notification only show no back end admin panel visible  on the particular seller  and not approve the option.kindly give me any solution for all.
Answer: You have to approve that seller (which was created from the frontend) from the admin backend panel.
Admin -> Marketplace Management -> Manage Seller -> Select that seller and approve from the action dropdown.
Make sure in the Configuration setting, "Allow seller separate dashboard" = Yes


Force Feeding Medicines To Kitten

Question: It is my first pet. Due to Diarrhea , vet has asked me to force feed the kitten 4 days. Before feeding, the behavior seems to be normal but after force feeding, the kitten's behavior seems like it just hates every one and becomes sad(whenever it is laying on the ground, I touch him and he leaves the place and finds another place where no one is around). Is it normal or am I being so harsh on this little buddy ?
Comment: Don't touch the kitten whenever it is laying on the ground. It possibly don't like it and it will get worse. Ignore it most of the time and try to have some positive experiences a day. Play with him or give him treats. And give him time. Much time. Trust always needs time.
Answer: First, I think it would depend on how much you are force feeding your kitten, too much at one time could be giving him or her an upset tummy. If you are sure that you are not overfeeding, it is possible that the kitten is just tired of getting handled and would like to be left alone. I would also take into consideration that if you are having to force feed the kitten, then it stands to reason that they are already sick and not going to feel better just yet. I think that if you have reached a point where you are force feeding it, it just isn't going to feel well until it starts to heal. I wouldn't expect the kitten to show signs of happiness and wellness until it gets over whatever it has, sometimes, as with children, the cure hurts. Good Luck and I can assure you that you will see a change in behavior when the kitten starts to feel better.

Force Feeding Medicines To Kitten


Accidentals in atonal scores

Question: What are the rules for annotating accidentals in atonal scores, especially in 12-tone row compositions? For instance, if you use F sharp once, should that note always be scored as F sharp and never as G flat? Should the rule "sharps up, flats down" be followed, and if so, strictly or loosely? Are there any other rules?
Answer: You would typically stick to all sharps or all flats to keep the rows identifiable in your composition. Whatever your prime tone row is, those 12 notes should be in every row with the same spelling.
The 12 tone rows when being created are just enumerated notes so the typical ideas of like "sharps up, flats down" don't mean much. The focus is much more on the transformations like inversions, retrograde, retrograde-inversions.
Comment: Sticking to all sharps or all flats in your matrix makes some sense, though this certainly isn't a requirement.  But on the score, this would lead to heartache and woe.  You should be focusing on making the score maximally readable for the performer, not easily analyzable for the theorist.  That means avoiding spellings that create augmented or diminished intervals whenever possible.
Comment: This seems to make sense-- using a mixture of spellings depending on "context" would imply a relationship between a tone and the preceding one that wouldn't be expected in serial compositions.
Comment: @ibonyun is spot on. Once the row goes through transformations, it's much easier to read when adhering to principles outlines in [When to use flat or sharp in atonal music / accidentals rules for atonality?](https://music.stackexchange.com/q/87692/70803). Even the prime row itself may benefit from including both sharps and flats. For example, the segment [2 6 5 1] may well be easier to read as [D F# F Db] than [D F# F C#].
Answer: It's not even necessary for the same note to have the same note in a tonal piece! It will depend on what function that note is playing. A quick example - G♯ as part of an E chord leading to Am will have to have the same sounding note written as A♭ when, in the same piece, it's part of an Fm chord.
From a reader's point of view, it does make sense to keep to sharps or flats, but that's not always technically possible - guitarists may argue that one! But, writing the dots for others necessitates making what's written as easy to read, if occasionally technically incorrect, to win.
Answer: Atonal music can be very hard to read. It makes sense to make it easier for the musicians and change notes enharmonically to produce something that looks more like tonal music. There is no need to be dogmatic about about always spelling a particular note the same way. The rule "sharps up, flats down" can be very useful.

Accidentals in atonal scores


Does mass inserted between point a and b in space increase the distance between a and b?

Question: If you have a point "A" in space, and another point "B" in space, 10 light years away in relatively flat space with regard to gravitational waves. Then you place a neutron star directly in the middle of point A and B. Now the distance between point A and point B is greater than 10 light years because of time dilation. Is that right?
Comment: It's worth noting that the light actually observed at the far end doesn't take a straight path (there being a solid object in the way on the symmetry axis and nearby geodesics not connecting the two ends). So it comes a bit the "long way around". Asking about the spatial distance along the straight line is possible but requires you to chose a frame of reference in which to ask it as there is no unique answer.
Comment: Presumably a follow up to http://physics.stackexchange.com/questions/283377/if-mass-density-curves-space-time-then-why-isnt-density-at-each-x-y-z where Paul says a few words about the motivation in a comment.
Comment: Thanks. I'm aware of gravitational lensing of light.  And I agree that light observed at B from A wouldn't take a straight path (in simple x,y,z coordinate terms).  I'm not trying to calculate the distance or time, I know that is relative and requires the choice of a frame of reference.  I need to find a better way to phrase my question.
Answer: Your question If mass density curves space-time, then why isn't density (at each $x$, $y$, $z$) considered a dimension in space-time? about a more dimension for gravitational potential is a reasonable question I want to try to explain on an example what perhaps do you mean.
Take a thin and flat metal sheet and heat it up at one edge. The sheet will not be more flat, it will be humpbacked. The density of the heated material is lower than of the cold(ear) material and the expansion of the hotter material is humpbacked.
What @dmckee suggested in his answer to your question befo this one is to add coefficients to the dimension and by this way to describe the space. For my example this means that the coefficients are functionally connected with he heat distribution on the sheet. But the sulu tigon is much more complicated. Even for a round sheet and a hot spot in the centre you have to include at minimum the really existing stress of the sheet. (And only if you perform special stress before heating (say by hammering radial pattern into the sheet) you can be sure - more or less - that the sheet under heating will be humpbacked how you calculated it before.)
Einstein has suggested the same for gravitational potential. In his model the speed of light is a constant value. What often is missed that this means that we will measure the same value for any positions in space with different gravitational potential, but a third observer in space with a different potential will admit a difference in how fast clocks are running. Than higher the potential than slower the clock runs. For your example the light takes longer if there is a massive body near your path between the masses A and B for two reasons: the light gets deflected by the third body and is not more straight and the lights speed - for an "observer in the high" this is measurable - is slower than it was before the third body was placed.
But as @dmckee commented

Asking about the spatial distance along the straight line is possible but requires you to chose a frame of reference in which to ask it as there is no unique answer.
Comment: Right now I'm trying to figure out how to ask questions on this forum and which of my assumptions I have to explicitly state, to reach a consensus, on something I believe to be true.  For, instance, I should have stated that there was an observer either at A or B and that, by distance, I mean the "speed of causality per second" over that path.  As soon a I asked, I think that speed of light was assumed and that includes whether a photon could pass a massive object, which muddies the water.  You've effectively answered my question though.  Thanks for your patience with me.


A-Frame for a hoist?

Question: I need to move a heavy-ish piece of concrete, a part of a garden sculpture, weighing about 300lbs, to about chest height. I'd like a hoist, but don't know the equipment I'd need to assemble an A-Frame-style hoist. What would I need to build a small, easy to move hoist for awkward sized rock and concrete formations? I need it to work in dirt, so wheels / casters are possibly not viable (like a mechanics crane has).
Comment: Is this something you'll be doing often?  That is, is this something you'll use once and then throw away or do you plan to use it repeatedly?
Comment: I only have this specific task I want to complete, maybe a one time deal.
Comment: Take the wheels off of a mechanic's crane and put wood blocks underneath?
Answer: Rent or purchase an engine hoist. The definition of a small easy to move hoist, and pretty inexpensive, with some level of engineering built in (while you can still hurt yourself with improper use, at least you remove one area of hurting yourself with improper kludging of a lifting mechanism.)
They store pretty compactly and most can be easily taken apart for easier moving or storage in pieces. They have wheels, though small wheels will require some sort of base to run on or they are useless. Planks can provide that base on dirt, or you can not worry about moving it with a load on.
Never put yourself in a position where the thing you are lifting will crush you if it slips free (especially with rocks, which can be hard to get a reliable grip on.)
Comment: Thank you. I agree this is probably the best option. I was thinking alternately of creating a tripod from 2x4 and putting a hoist in the middle above the sculpture, but that doesn't speak to being able to lift it from the ground safely, only for placing down once lifted.
Comment: I would be very leery of using wood of any kind in the application.  Both the wood itself and the fastening techniques are just too unpredictable, especially with no engineering.  It may fail suddenly and in unpredictable ways (think broken pieces of wood flying around).  An engineered steel tool designed for this very service, like an engine hoist, seems to be the way to go.  Perhaps you could modify the hoist by adding appropriate wheels to it for moving around.

A-Frame for a hoist?


Fatal Java error on starting Cassandra on Windows

Question: When I start Cassandra 3.11.6 using cassandra -f from cmd, I get error
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000010014ed4, pid=29376, tid=0x0000000000007aa4
#
# JRE version: Java(TM) SE Runtime Environment (8.0_281-b09) (build 1.8.0_281-b09)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.281-b09 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [sigar-amd64-winnt.dll+0x14ed4]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\MChadha\Documents\manu\apache-cassandra-3.11.6-for-scalardb\bin\hs_err_pid29376.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

What might be causing this error?
My Java version is
java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode)

Answer: Issue with Java. I was using java 1.8.0_271 and getting same error. Had to downgrade to 1.8.0_251 to make it work.
Answer: You did not mention Windows version. However you can check Java if this is a bug as mentioned in https://bugs.openjdk.java.net/browse/JDK-8182156
Or try to enable minidumps in your Windows envionment.


The value of $g$ in free fall motion on earth

Question: When we release a heavy body from a height to earth. We get the value of $g=9.8 \ ms^{-2}$. Now, I'm confused about what it means. For example, does it mean that the body's speed increases to $9.8$ every second? Or, does it mean that the speed of the body is $9.8 \ m/s$?
Answer: It means the speed increases by $9.8$ m/s every second.
At the beginning (when you release the body) its speed is $0$.
After $1$ second the speed is $9.8$ m/s, after $2$ seconds the speed is $19.6$ m/s, and so on.
Answer: It means the speed of the falling body increases with 9.8 m/s each second.
Answer: The other guys here (@Thomas Fritsch and @AWanderingMind) are perfectly right, and just to see that: g is an acceleration, and acceleration is change of velocity with time, or velocity per time. Like velocity itself is distance per time.
Answer: You can see that $g$ has units of acceleration, namely $\frac {m}{s^2}$ or $\frac {m}{s} \left (\frac 1s \right )$. Last form gives an easy interpretation,- speed change per 1 second. Additionally, there are couple of assumptions in use:

Earth is assumed an ideal sphere, otherwise $g$ would depend on radius $R$ at exact $\varphi, \lambda$ (Latitude, Longitude) coordinates on surface.
Free-fall has to be in  pure vacuum, otherwise gravitational acceleration would be opposed by air resistance (air drag force), which would make net acceleration dependent on such parameters like falling body cross-section, velocity, etc.
Finally, mass distribution in Earth along axis parallel to the surface normal is assumed to be uniform, namely- density variation function $\rho(R)$ has same profile along any coordinates $\varphi, \lambda$. Otherwise, you would need to account for local mass distributions in $g$ calculations.
Answer: $$F=-G\frac{Mm}{r^2}$$
$$\frac{F}{m}=-G\frac{M}{r^2}$$
$$a=-G\frac{M}{r^2}$$
Force divided by mass is by definition  acceleration. This is denoted as g, as in, the acceleration due to gravity
For the surface of the earth this value is around $-9.81$.
As such the standard definition of acceleration applies. Acceleration is the rate at which velocity changes, a constant acceleration of x, means that every second, the velocity of the body increases by x, or in a formula: $v=at$
Look at the units $$\frac{m}{s} \frac{1}{s}$$
Distance traveled per second, per second


How to install Java and which version of it?

Question: I'm on Ubuntu 11.10 and I wanna know which version (OpenJDK or Sun's one or whatever) is the best to develop applications and use it with Eclipse, and how to install it.
Thank you.
Answer: You can have various JDK side-by-side in the same machine. This is needed because sometimes you are on a 64-bit machine but need to run a specific 32-bit stuff. Also there are others JVM availables, some (open source): JamVM, Cacao, JatoVM. They are usually made for a specific niche and unfortunately are not complete as the reference JVM (from Sun/Oracle). The official JVM (from Oracle/Sun), due to it's completeness, is your best bet in almost all occasions.
Since you pretend to develop Android applications I highly recommend using the Sun (Oracle) 1.7 i386 JDK. Why? Not only it's the official JVM but due to android not having a 64-bit SDK.
This link provides  a step-by-step installation of the Sun (Oracle) 1.7 JDK:

How do I install Oracle Java JDK 7?
How do I install Java?
Answer: OpenJDK or Sun's Oracle's JDK... it depends on what kind of applications you're going to develop. There is plenty of Java software that currently won't play well with OpenJDK. (eg. Android SDK, IntelliJ Idea, PyCharm, etc).
For casual Java learning, OpenJDK should suffice. You'll just know when/if you need Oracle's JDK, then you can look at solutions like this or this.
Comment: I'll develop Android apps, so I guess I'll go with Oracle's JDK since I'm looking for the best compatibility. Thank you.


How to uncompress a .bin.gz file?

Question: I have a file named like file.bin.gz.
I tried using gzip -d f.bin.gz to uncompress it, and got a .bin file.
Is the correct way to uncompress .bin files to use gzip -d? Also, .bin is a binary file, right?
Comment: `.bin` is a binary file, yes. It is generally just used to mean one of two things: either the programmer has not documented the format, or for some reason they wish to disguise it.
Answer: Yes, what you did was one of the correct ways. To un-gzip a .gz file, use gunzip or gzip -d.
If your gzipped file is file.bin.gz, you can decompress it with:
gunzip file.bin.gz

This decompresses it to file.bin. If the operation succeeds, the original file.bin.gz is automatically removed. This is to say that the gzipped file is replaced with the decompressed file.
If you want to keep the original, pass the -k/--keep flag:
gunzip -k file.bin.gz

gzip behaves like gunzip when it is invoked with the -d/--decompress/--uncompress flag.  So this works too:
gzip -d file.bin.gz

As with gunzip, the default behavior of gzip -d is to replace its input file once it succeeds. You can pass both -d and -k if you want to keep the input file.
(All of this applies regardless of what kind of file you want to decompress; none of it is specific to the file having .bin in its name--that's just part of the example I've used, to better match your situation.)
You can run man gunzip for more information, or gunzip --help for a summary of options.

As for what the .bin in the filename is likely to mean, you have surmised correctly that a file named .bin is usually a binary file. However, there are several different kinds of files that are sometimes named this way and, furthermore, the vast majority of binary files do not have .bin in their names.
To get more information about what file.bin is, run file on it:
file file.bin

(This is not specific to file.bin having file in its name. In general for a file abc you can learn about what kind of file it appears to be by running file abc.)
(This is also not specific to the .bin part of the filename having Any Meaning At All)
Comment: binwalk is sometimes useful if file is not enough.
Comment: And please, do not run the .bin file to find out what it is ^_^
Answer: If you really need to identify the type of file you can use the file program after decompressing:
file file.bin

will consult a database looking for known markers of file types (like the string '' or 'GIF89a') and output what kind of file it thinks it is. As stated before, sometimes programmers will use .bin to disguise a standard file type by just changing the extension.

How to uncompress a .bin.gz file?


Customise Restrictions passcode on iphone

Question: I know you can customise the iPhone main passcode to strengthen the security but there doesn't seem to be that option when doing the same when setting up restrictions. After I have written it down somewhere I don't want to remember the passcode, and I definitely will if't it only 4 numbers.
Is it possible to write an app for something like that?
Answer: Very much doubt Apple would allow any app to access that API.
The restrictions passcode is so hard you need to wipe the phone & start over if you forget it.
If you really don't want to know what the code is, get someone else to set one & not tell you what it is. You then have the opportunity of changing your mind later, assuming they remember it.


Can I create a chat room for 3 different clients for Gtalk service?

Question: I'm using Adium on my Mac and I wish to communicate with several people. My friend on Linux uses Pidgin. Another friend is using Gtalk client and all using gtalk service. It's possible to create a chatroom to contain these clients similar to how Skype does group room chat?
Answer: In Adium:

Right click on one of the contacts, and use "Initiate Multiuser Chat with (name)@gmail.com"
You should now join a group chat yourself, and an invitation will be send to that contact.
Right click on the other contact, and select "Invite to Chat" → (The name of the private chat you created).
Now the other contact gets an invitation they should accept.


What do you call the leathery part of a armor that protects your genitals?

Question:
To be honest, I don't know if it's intended to protect anything, because it could be that it's used for ornamental purpose. I am talking about the red leathery thing between the legs. What is it called?
Answer: Actually this is just a fantasy convention.  Many medieval knights went into combat on horseback.  It's more or less impossible to wear hardened groin armor and still ride a horse comfortably.  The hip and leg armor was normally sufficient protection, even if the knight was unhorsed.
On modern reenactment armor, where the combatants fight on foot, the rules normally require both men and women wear a hard metal cup called a codpiece or a groin cup, or at least a modern athletic cup under their clothing (because getting whacked in the nadgers is never a good time).
Side note:  When talking about the conventions of drawing this kind of fantasy armor, I have heard the strip of cloth hanging in front of the groin area called, sarcastically, the crotch cape.  It's a decoration that looks good in pictures, but (like all the spiky bits) was not a normal feature found in historical suits of armor.
Answer: It's only for decoration, and according to this guy on YouTube, it's called a scapular. He seems like an authority on the subject: https://youtu.be/esBX_SAyj2U
Comment: A "scapular" is a cloth apron which hangs from the shoulders, the "scapulae" https://en.wikipedia.org/wiki/Scapular
Comment: Oh man, his accent got me. That's the real-life version which has been adapted into fantasy apparently.
Answer: There are a number of things that might be:

In fashion or armour, it is a codpiece. Wikipedia
In sport, it is a box (UK) or athletic cup
In New Guinea, Vanuatu etc, penis gourd or penis sheath wikipedia
Native Americans (and others), a cloth hanging from the waist is a  loincloth or breechcloth wikipedia

There are imported words specific to other cultures, eg "koteka", "namba", "lonka lonka" for penis gourds of various places.  wikipedia
I believe they are all specifically for men except "loincloth" and "breechcloth".
Answer: I had been looking for the exact same thing for the longest time, but after what i would say extensive research i got somewhere close. It might not be exact, but checkout the meaning of >tasset
Comment: Welcome to the site! Would you mind editing the definition of _tasset_ into your answer, or at least providing a link to the definition? The ideal is to provide as much useful information as possible in the answer itself, so people don't have to go hunting elsewhere.


Phrase for snipping of scissors between actual cuts that a barber makes

Question: A barber generally keeps on snipping the scissors in between the actual cuts. There is a particular phrase for this behavior. I have come across this phrase before, but can't recollect it now. The phrase was a generic term for such involuntary acts and the barber's one was a good example for it. The closest I can some up with now is "fidgeting", but I don't think that was the word.
Two close phrases I came across today are "muscle memory" and "automaticity"
Comment: I always thought they were clearing their scissors from stray hairs. They don't continually snip all the while they have scissors in their hands, so I wouldn't have thought it was muscle memory.
Comment: Would this be similar to how people hammering at an anvil often hit the target, then bounce off the anvil, then hit the target again?
Comment: @Davo There seems to be a real reason for doing that, not just a fidget.
Comment: Blacksmiths do this to keep rhythm. If they need to think about where to hit it next, they tap the anvil until they are ready
Comment: *"A barber generally keeps on snipping the scissors in between the actual cuts."* - They do? Not in my experience as a customer. (I'm assuming I would have noticed, given that scissors make a noise, and I'm generally watching them in the mirror the whole time.)
Answer: How about "idling the scissors"?  "Idling" is typically used in conjunction with cars or motors for running without a load, so while it is not the professional term, it's pretty idiomatic.  If it is supposed to free the scissors from cut hair, "clearing the scissors" would probably work.
I think the actual motivation is that the screw in professional scissors is self-adjusting, so if you cut a number of thick strands in succession, it might become too loose for good cutting.  Clattering the scissors "without load" would serve to readjust the tension.
So another word that might match the purpose is "priming" the scissors.
Comment: Welcome to ELU.  You can make suggestions but they should include a reference that shows their validity.  And, good answers usually stick to one suggestion at a time.
Answer: Tics, perhaps? (This is often part of 'nervous tics', though not all tics are nervous ones.)
It sounds like a complex motor tic.
(Edited to clarify "nervous" and link to definition.)
Comment: @DavidRicherby: Although _tic_ doesn't necessarily indicate nervousness. Not that we'd know this from the answer, since there's no actual definition or reference.
Comment: Is that word actually used to describe this? Almost all barbers seem to do this, and it seems unlikely that they're all nervous about their work.
Answer: It sounds like this action is similar to dry firing a weapon.
Dry firing is done for a variety of reasons.  Often, it is done for the purpose of maintaining a movement without making a flinch.
In the case of a barber, they're dry snipping the scissors in order to maintain their rhythm and muscle memory for the action.
However, you may also be misinterpreting their actions. They're often point cutting which is a means of thinning out the ends of the hair or snipping away strays after making their main cuts.


Image sample rate

Question: How to understand sample rate in case of images, it is clear to me when we are talking about the audio, but how these two are related? Is it more complex than the audio sampling?
Comment: A pixelized image has a sampling resolution in X and Y in pixels per linear unit (or perhaps better, pixels per angular unit).   A movie also has a sampling interval in time...
Comment: do you mean the image itself, wich is sampled in pixels. or sampling images to get a movie?
Comment: As an example think of the times you have seen the wheels appear to rotate backwards in movies on cars or wagons (westerns) - this is due to the rotation of the wheel and the effective camera sampling in terms of frames taken per second.
Comment: Images and audio can relate in sample rates. @SolarMike has a pretty good analogy. They both have aliasing and sample rates. Anything with a signal like audio or video has a sample rate. Think of it has your hand trying to grab as many jelly beans in a jar. The size of your hand can determine how many jelly beans are taken out of the jar at a particular time. So the higher the sample rate, the higher quality of a signal you'll hear or see.
Answer: Sample rates in videos can be seen by how many intervals of... well, samples it takes in one particular time period. The chart and picture below is a good demonstration of this. It's very similar on how it works with audio as well.

In calculus, you talk about the definition of integration by drawing rectangles under a curve and taking the area under that curve. However, if you make the width of the rectangles smaller, you're able to fit more rectangles under the graph and the area under the curve will be more accurate. This is true for sampling as well. The more samples you have in a given time period, the higher and cleaner quality you'll see in the video and pictures.
Comment: I think that sample width is also important as much as number of samples. Yes you are right, higher sample rate can reconstruct signal in a more smoothier way.

Image sample rate


IR risk sensitivity to curve instruments

Question: I need to understand if the 2 approaches are equivalent:
assume I am constructing a yield curve with N instruments. I would like to compute IR delta for a product using this curve. One approach is to move every instrument's quote by 1bp, reconstruct the curve and revalue. Another one is to do one at a time, compute the impact of that particular instrument and sum the results across. Would those be equivalent? I don't get the same answers and I would like to confirm if this is due to FDM error or there is a math reason for the difference.
Answer: It sounds like you expect the sum of the single impacts to be equal to the impact you get when you move every instrument by 1bp. In theory this should be the case because
(assuming two curve instruments for simplicity which happen to have same levels $x$)
$$
\frac{d}{dx}f(x,x)=\frac{\partial}{\partial x_1}f(x_1,x_2)\Big|_{x_1=x_2=x}+\frac{\partial}{\partial x_2}f(x_1,x_2)\Big|_{x_1=x_2=x}\,.
$$
In practice however you are approxmating these derivatives by finite differences so that there will rarely be an equality. What you can expect is that the results are close. If they aren't you can try a move smaller  than 1bp.


The integral $\int_{0}^{\sqrt\frac{\pi}{2}}\int_{x}^{\sqrt\frac{\pi}{2}}\sin(y^2) \, \, \mathrm{d}y \, \, \mathrm{d}x$

Question: How do we go about computing the above integral? I figured we could write it as follows
\begin{equation}
\int_{0}^{\sqrt\frac{\pi}{2}}\int_{0}^{\sin(x^2)}\sin(y^2) \,
 \,\mathrm{d}y \,  \,\mathrm{d}x
\end{equation}
But I really doubt that'd help in the first place. And am also not familiar with complex analysis :/. Would appreciate any assistance.
Comment: Have you tried changing the order of integration from $dydx$ to $dxdy$, and adjusting the bounds accordingly?  As a reminder, one way that this can be done is to begin by sketching the region of integration.
Answer: by chainging the order : $\int_{y=0}^{y=\sqrt{\frac{\pi}{2}}} \int_{x=0}^{x=y}  \sin(y^2)~dx~dy = \int y\sin(y^2)dy = \frac{-\cos(y^2)}{2}|_{0}^{\sqrt{\frac{\pi}{2}}} = \frac{1}{2}$
Comment: Oh wait nevermind I think I got it.
Comment: Could you explain how you adjusted your boundaries there? I don't see how $x$ runs from $0$ to $y$


Looking for an efficient way to check for file existence on Windows with files on a SAN

Question: I have a large set of files located across a series of directories on a windows 2003 server. There are upwards of a million files in each directory. The Windows server uses iSCSI to connect to an Equalogics SAN.
I have an application that needs to determine if a set of files exists - the application needs to check for the existence of up to a million files per directory.
I have tried a variety of techniques / scripting languages including perl, vbscript, dos batch files and  I can not obtain greater than about 250 files checks per second. This works out to almost 50 minutes to check for 800,000 files. I tried multithreading a perl program to check for multiple files at a time, but this did not help.
I have also tried to list all of the files in the directory using dir, ls, find (via cygwin), and it takes many minutes for it to start outputting any file names at all. This isn't a great approach anyway, because there are more files than I actually need to check for.
Is there a way I can force windows to do a "read ahead" on the directory, and get the files into a cache?
Is there a better way to approach this find of a problem?
Answer: I would probably avoid any interpreted language such as VBScript et al for precisely the reasons you've specified - just not going to work as well in a scenario where performance is an issue.
Now, as my formal caveat for my suggestion, I'm assuming that over the expected time such an application would run that the set of propsective files (the search target) remains relatively stable such that the risk of a false positive presence check from the application due to file set changes occuring after the scanning application started is minimal.
It's not elegant, but I would at least suggest exploring a Win32 (not .NET) console-type app that recursively searches the directory tree into a memory-mapped file, then search that file for your required pattern. That limits the disk access to just the effort required to accumulate the results, and then puts the searching against the presumably (much) faster memory-backed file. Now, I may be underestimating the size and/or complexity of your fileset contents, but that's what I would offer as a starting point.
I recommend a Win32 app over a .NET app to avoid the overhead of the framework runtime, but the obvious caveats about a non-managed app apply.
Hope that's helpful, or at least stirs the pot for you a bit. Good luck.
Answer: Each individual check requires the operating system to read through the directory until it finds (or fails to find) the file you're asking for.  In other words, each check reads on average more than half of the contents of the directory, so reading the complete directory once will almost certainly be much more efficient.
However, you shouldn't do this by spawning out to another program.  Use FindFirstFile/FindNextFile or a .NET equivalent.  You can check each file against your list as you find it - you might want to organize your list first, put it in a b-tree or something.
You might want to try GetFileInformationByHandleEx with the FileIdBothDirectoryInfo option instead of FindFirstFile/FindNextFile to see which is faster.
Answer: When you check each file individually you're limited by the latency of the request and response. It's doubtful you can find a way to speed that up unless you use asynchronous requests and run many simultaneously, but that approach will put a strain on the file system.
While getting a full directory listing seems like overkill, it's likely to be the fastest method unless your search list is much smaller (say 100 times smaller) than the full directory.