deterministic

Why is [date] + ([time] - [offset]) non-deterministic in SQL Server 2008?

倾然丶 夕夏残阳落幕 提交于 2019-12-10 17:18:32
问题 I'm trying to do the following for my IIS logs table: ALTER TABLE [W3CLog] ADD [LogTime] AS [date] + ([time] - '1900-01-01') PERSISTED However, SQL Server 2008 tells me: Computed column 'LogTime' in table 'W3CLog' cannot be persisted because the column is non-deterministic. The table has this definition: CREATE TABLE [dbo].[W3CLog]( [Id] [bigint] IDENTITY(1,1) NOT NULL, ... [date] [datetime] NULL, [time] [datetime] NULL, ... ) Why is that non-deterministic? I really need to index that field.

STL within embedded system with very limited memory

﹥>﹥吖頭↗ 提交于 2019-12-08 15:19:12
问题 I'm currently in the process of building an embedded system, using an ARM Cortex M3 processor, with 64 KB of SRAM. At the moment, I'm looking for a way to ensure deterministic performance with STL containers, which includes ensuring that I cannot end up running out of memory at run-time. I'm primarily concerned with how STL containers perform dynamic memory allocation. Although I can utilize a custom allocator to have these structures get memory from a pool which I set aside, I would need to

How to merge two finite state automata?

故事扮演 提交于 2019-12-06 04:06:18
问题 Say I have two deterministic finite state automata represented by the following transition diagrams: FSA for keyword IF: IF ___ ___ _ / \ I / \ F // \\ >| 0 |----->| 1 |----->||2|| \___/ \___/ \\_// FSA for an ID: [A-Z][A-Z0-9]* ------------ ___ | _ LET | / \ LET // \\<------ >| 0 |----->||1|| \___/ \\_//<------ | NUM | ------------ What algorithm may I use to combine them into a single deterministic finite state automata with three final states, represented by the following transition

How to control whether C math uses SSE2?

依然范特西╮ 提交于 2019-12-05 12:32:37
问题 I stepped into the assembly of the transcendental math functions of the C library with MSVC in fp:strict mode. They all seem to follow the same pattern, here's what happens for sin . First there is a dispatch routine from a file called "disp_pentium4.inc". It checks if the variable ___use_sse2_mathfcns has been set; if so, calls __sin_pentium4 , otherwise calls __sin_default . __sin_pentium4 (in "sin_pentium4.asm") starts by transferring the argument from the x87 fpu to the xmm0 register,

What is a Deterministic Quicksort?

回眸只為那壹抹淺笑 提交于 2019-12-05 02:04:16
I have been reading about Quicksort and found that sometimes it' s referred to as "Deterministic Quicksort". Is this an alternate version of the normal Quicksort ? What is the difference between a normal Quicksort and a Deterministic Quicksort ? The ordinary ("deterministic") Quicksort can have very poor behaviour on particular datasets (as an example, an implementation that picks the first unsorted element has O(n^2) time complexity on already-sorted data). Randomized Quicksort (which selects a random pivot, rather than choosing deterministically) is sometimes used to give better expected

Split a string based on each time a Deterministic Finite Automata reaches a final state?

有些话、适合烂在心里 提交于 2019-12-04 18:34:33
I have a problem which has an solution that can be solved by iteration, but I'm wondering if there's a more elegant solution using regular expressions and split() I have a string (which excel is putting on the clipboard), which is, in essence, comma delimited. The caveat is that when the cell values contain a comma, the whole cell is surrounded with quotation marks (presumably to escape the commas within that string). An example string is as follows: 123,12,"12,345",834,54,"1,111","98,273","1,923,002",23,"1,243" Now, I want to elegantly split this string into individual cells, but the catch is

Is Box2D perfectly deterministic?

若如初见. 提交于 2019-12-04 09:42:16
I'm writing an Android game using LibGDX and Box2D. I'm planning on adding a turn-based multiplayer feature to it. Now, if on both clients I step the Box2D world at the same rate with the same time steps and I start a simulation on both clients with the exact same initial parameters, when the simulations are over, will the final state of both simulations be exactly the same? In other words, is a Box2D simulation perfectly deterministic? If it's not, then that means every time a simulation is over, one client acting as a host will have to tell the other to throw away its final simulation's

Code for member/2 with some Determinism

人盡茶涼 提交于 2019-12-04 04:11:58
问题 How can I code member/2 that has determinism for the last element. Currently I am using: member(X,[X|_]). member(X,[_|Y]) :- member(X,Y). When I query the following: ?- member(X,[1,2]). X = 1 ; X = 2 ; No The interpreter continues searching after returning 2 since there is still a choice point left. How could I implement member/2 so that this does not happen anymore? But the full semantic of member/2 should be preserved, i.e. answers such as: ?- member(X,Y) Y = [X|_1] ; Y = [_1,X|_2] ; etc..

How to control whether C math uses SSE2?

旧巷老猫 提交于 2019-12-03 22:23:53
I stepped into the assembly of the transcendental math functions of the C library with MSVC in fp:strict mode. They all seem to follow the same pattern, here's what happens for sin . First there is a dispatch routine from a file called "disp_pentium4.inc". It checks if the variable ___use_sse2_mathfcns has been set; if so, calls __sin_pentium4 , otherwise calls __sin_default . __sin_pentium4 (in "sin_pentium4.asm") starts by transferring the argument from the x87 fpu to the xmm0 register, performs the calculation using SSE2 instructions, and loads the result back in the fpu. __sin_default (in

User-Defined Functions SQL Server 2005 flagged incorrectly as non-deterministic?

时间秒杀一切 提交于 2019-12-03 20:20:11
Related to this question , I decided to check the UDFs in my data warehouse (which should largely have been deterministic), and I found several which aren't which should be. For instance: CREATE FUNCTION [udf_YearFromDataDtID] ( @DATA_DT_ID int ) RETURNS int AS BEGIN RETURN @DATA_DT_ID / 10000 END Shows up in this query: SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE IS_DETERMINISTIC = 'NO' AND ROUTINE_TYPE = 'FUNCTION' ORDER BY ROUTINE_NAME Why is this? Yikes - apparently, it REQUIRES SCHEMABINDING to be specified other wise it could cause performance problems ALTER FUNCTION [udf