Questions tagged [unify]

37 questions
40
votes
5 answers

How to replace different newline styles in PHP the smartest way?

I have a text which might have different newline styles. I want to replace all newlines '\r\n', '\n','\r' with the same newline (in this case \r\n ). What's the fastest way to do this? My current solution looks like this which is way sucky: …
Deckard
  • 2,384
  • 1
  • 19
  • 35
8
votes
1 answer

Implementing unify algorithm in haskell

I am trying to implement a unify function with an algorithm that is specified as unify α α = idSubst unify α β = update (α, β) idSubst unify α (τ1 ⊗ τ2) = if α ∈ vars(τ1 ⊗ τ2) then error ”Occurs check failure” else update (α, τ1…
fotg
  • 639
  • 1
  • 12
  • 25
8
votes
1 answer

Not all properties displayed

When we're trying to export data to other functions via the pipeline, we observe some strange behavior in PowerShell. Example code: $Array = @() $Obj1 = [PSCustomObject]@{ Member1 = 'First' Member2 = 'Second' } $Obj2 =…
DarkLite1
  • 13,637
  • 40
  • 117
  • 214
5
votes
2 answers

How can I suppress the prompt to "Unify Duplicated Vertices" when opening several meshes from regular GUI

I have a folder with hundreds of STL meshes and I want to merge them in meshlab using the flatten command. I´m using the regular GUI and when I go to file open and pick all these STL files, I´m prompted for each and every file if I want to "Unify…
Daniel Santos
  • 188
  • 2
  • 15
5
votes
2 answers

Why does SWI-Prolog unify a quoted and unquoted string (without spaces) to the same rule?

Assume I have the following rules: unify('test', 'this is a test'). run :- write('Enter something: '), read(X), unify(X, Y), write('The answer is '), write(Y). And then I run it as follows: ?- ['unify.pl']. % unify.pl…
Vivin Paliath
  • 94,126
  • 40
  • 223
  • 295
5
votes
1 answer

Partition a vector in Idris: why can't 0 and m+n be unified?

I would like to partition a vector in two new vectors. We cannot know what the length of the individual vectors will be, but the sum of the resulting vectors must be equal to the argument. I tried to capture this property as following: partition :…
Maarten Faddegon
  • 775
  • 5
  • 11
4
votes
2 answers

Unifying Types in Haskell

I'm kind of stuck with an assignement concerning my exams. I want to find out the types of those two functions by applying the unifying algorithm by hand: map map (\x -> x >>= (\y -> y)) Could someone point me to the right direction? The only…
s_qw23
  • 354
  • 2
  • 11
3
votes
1 answer

Purescript - Cannot unify type

I am new to Purescript (as well as Haskell) and I am stuck with a cannot unify error. Initially I had: newtype Domain = Domain String newtype Keyword = Keyword String type Result = { domain :: Domain, occurred :: Boolean, …
naruvimama
  • 109
  • 1
  • 7
3
votes
1 answer

Forward Chaining First Order Logic (Unification)

I'm studying for my final exam and I'm having trouble understanding this FC algorithm: I understand it up to the part where you standardize each rule. Then I think the next line is saying for each theta that satisfied the Generalized Modus Ponens…
2
votes
1 answer

python request payload without sorting

I am trying to use python request module to pass few values to server using the following code, but in the http request its changing the order of the payload values. payload3 = {'OSILA_LinkTo_Site': OSILA_LinkTo_Site, 'OSILA_LinkTo_Service':…
mikegray
  • 19
  • 5
1
vote
0 answers

How to select or activate main camera only in Android 10 custom ROM

What Android 10 source code must be modified to ensure only the main or rear camera is called by any application accessing the system's cameras? I have built a custom Android 10 ROM for my phablet which has only one camera. I would like to unify…
1
vote
1 answer

most general unifier of n(a,b) and f(x,y)

I know what means unification and I solved most questions but I could't really understand the mean of this questions. how can I unify these two functions. it looks a little weird.
zhang rui
  • 31
  • 2
1
vote
1 answer

Synchronizing different database types across different servers

We are having difficulty keeping our data in sync. We have been running a system on a UNIX machine for the last 20 years using a UNIFY Dataserver. There has been a push to move to Microsoft and are now also running a Microsoft SQL Server 2008 R2…
1
vote
2 answers

PHP: Better algorithm to strict typed identify duplicates in an array

While looking for a solution to identify duplicates in an array I stumpled upon many kinds of solutions counting on array_count_values or array_unique. But all of these solutions doesn't care about objects in the array. array_count_values throws an…
codekandis
  • 712
  • 1
  • 11
  • 22
1
vote
1 answer

Cannot call method error - Bootstrap Treeview

I am using Bootstrap Treeview in Unify templates. I am getting following error: bootstrap-treeview.js:1212 Not initialized, can not call method : expandNode when I try to expand node programmatically on page refresh to retain the expanded state…
subha
  • 1,050
  • 2
  • 15
  • 42
1
2 3