Computing desk | ||
---|---|---|
< June 8 | << May | June | Jul >> | June 10 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
Is there a name for the following principle in programming language design?
An example discouraged by this principle is the compound comparison in
Inform 6: x > 3 or y
means , whereas x == 3 or y
means . This makes it difficult to assign any meaningful semantics to the 3 or y
AST node: it is treated as an instruction to generate code to repeatedly apply the nearby operator. (One can salvage the situation by deeming it to represent a lazy sequence over which comparisons are mapped, but having such an entity appear in place of an expression is strange since it cannot appear in any other context where an expression is allowed.) In Haskell, by contrast, one could create a saturating monad from (x >)
or (x ==)
and apply it to each element of a list [3,y]
but that list has a
fixed set of semantics independent of the tests performed on its members.
The second point is related to the idea of using context-free grammars for programming languages, but differs in two ways:
I think I've seen something written about it, maybe even on Wikipedia, but my searching has been unsuccessful. Thanks for any pointers. -- Tardis ( talk) 04:03, 9 June 2018 (UTC)
I noticed my computer's time gets about 2 seconds behind per 24 hours. I'm running Windows 7 but I assume that has more to do with the hardware. Is that usual in your experience? Could it have anything to do with the stability of the frequency of the electric grid? Thanks. Basemetal 17:14, 9 June 2018 (UTC)
Steady clock drift from the xtal timebase being slightly inaccurate is easily compensated in software (hwclock command in linux, and there must be something like that in windows). You shouldn't have to use a soldering iron. There will still be some inherent variability but it should be much better than 2 sec/day. The other cause of drift is the OS sometimes not noticing timer ticks. I don't know why that happens but is a thing. 173.228.123.166 ( talk) 18:36, 11 June 2018 (UTC)
Computers used as local time servers occasionally use GPS or ultra-low frequency digital radio transmissions broadcast by a national standards organization (i.e. a radio clock).
However "radio clock" says that the only signals used are transmitted by either shortwave or longwave radio transmitters. This is because the buffering used in digital transmission delays the signal unpredictably. The National Institute of Science and Technology says the low frequency transmissions are analogue [1]. This is confirmed in the Application Note put out by Hewlett Packard [2] (at p. 72). Is there an error in one of the articles? 86.131.233.241 ( talk) 19:23, 12 June 2018 (UTC)
I had some files with an extension unknown to Windows so it asked me what program to open it with. I picked Notepad just to see what was in there. Now obviously Windows always opens files with that extension with Notepad. But I want to change that back to how it was before: I want to make that extension unrecognized back again the way it was, not change it so that it opens by default with some other installed program. Is there a way to do that? Basemetal 22:34, 9 June 2018 (UTC)
The Python library has a module for accessing MIDI devices, namely ossaudiodev but that apparently only exists for Linux. On the other hand the Windows specific module winsound from what I can tell only deals with raw audio, not MIDI. Does the standard Windows version of Python have a module for accessing MIDI devices? If not do you know of modules developped by third parties that allow you to do that? Thanks. Basemetal 22:57, 9 June 2018 (UTC)
Computing desk | ||
---|---|---|
< June 8 | << May | June | Jul >> | June 10 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
Is there a name for the following principle in programming language design?
An example discouraged by this principle is the compound comparison in
Inform 6: x > 3 or y
means , whereas x == 3 or y
means . This makes it difficult to assign any meaningful semantics to the 3 or y
AST node: it is treated as an instruction to generate code to repeatedly apply the nearby operator. (One can salvage the situation by deeming it to represent a lazy sequence over which comparisons are mapped, but having such an entity appear in place of an expression is strange since it cannot appear in any other context where an expression is allowed.) In Haskell, by contrast, one could create a saturating monad from (x >)
or (x ==)
and apply it to each element of a list [3,y]
but that list has a
fixed set of semantics independent of the tests performed on its members.
The second point is related to the idea of using context-free grammars for programming languages, but differs in two ways:
I think I've seen something written about it, maybe even on Wikipedia, but my searching has been unsuccessful. Thanks for any pointers. -- Tardis ( talk) 04:03, 9 June 2018 (UTC)
I noticed my computer's time gets about 2 seconds behind per 24 hours. I'm running Windows 7 but I assume that has more to do with the hardware. Is that usual in your experience? Could it have anything to do with the stability of the frequency of the electric grid? Thanks. Basemetal 17:14, 9 June 2018 (UTC)
Steady clock drift from the xtal timebase being slightly inaccurate is easily compensated in software (hwclock command in linux, and there must be something like that in windows). You shouldn't have to use a soldering iron. There will still be some inherent variability but it should be much better than 2 sec/day. The other cause of drift is the OS sometimes not noticing timer ticks. I don't know why that happens but is a thing. 173.228.123.166 ( talk) 18:36, 11 June 2018 (UTC)
Computers used as local time servers occasionally use GPS or ultra-low frequency digital radio transmissions broadcast by a national standards organization (i.e. a radio clock).
However "radio clock" says that the only signals used are transmitted by either shortwave or longwave radio transmitters. This is because the buffering used in digital transmission delays the signal unpredictably. The National Institute of Science and Technology says the low frequency transmissions are analogue [1]. This is confirmed in the Application Note put out by Hewlett Packard [2] (at p. 72). Is there an error in one of the articles? 86.131.233.241 ( talk) 19:23, 12 June 2018 (UTC)
I had some files with an extension unknown to Windows so it asked me what program to open it with. I picked Notepad just to see what was in there. Now obviously Windows always opens files with that extension with Notepad. But I want to change that back to how it was before: I want to make that extension unrecognized back again the way it was, not change it so that it opens by default with some other installed program. Is there a way to do that? Basemetal 22:34, 9 June 2018 (UTC)
The Python library has a module for accessing MIDI devices, namely ossaudiodev but that apparently only exists for Linux. On the other hand the Windows specific module winsound from what I can tell only deals with raw audio, not MIDI. Does the standard Windows version of Python have a module for accessing MIDI devices? If not do you know of modules developped by third parties that allow you to do that? Thanks. Basemetal 22:57, 9 June 2018 (UTC)