Nuget package versioning — DLL not found

Uncategorized
Question: I have a problem with the Nuget package Microsoft.Azure.ActiveDirectory.GraphClient. From Nuget Package Manager, I have added Version 2.1.0 of said Nuget package to my project, but it seems the DLL cannot be found: FileNotFoundException: Could not load file or assembly "Microsoft.Azure.ActiveDirectory.GraphClient, Version=2.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" or one of its dependencies. The system cannot find the file specified. I have checked that the DLL does exist, and found that it is "File Version 1.0.9342.13", "Product Version 1.0.9342.13". So I tried to add the file to the assemblyBinding in Web.config (although I'd expect VS to do that for me): but this didn't work. Why is there a discrepancy in versions and what do I have to do so my program finds the DLL and the dependent assemblies? Answer: Read more
Read More

In JS, can you rely on comparing stings with the “>” and “

javascript
Question: I am building an abstract table, each column in the table can contain either all numbers or all strings. Each column should be sortable by clicking on the column header. Currently I am using JS native sort and passing a compareFunction: const rows = [ {name: 'Adam', age: 27, rank: 3}, {name: 'Zeek', age: 31, rank: 1}, {name: 'Nancy', age: 45, rank: 4}, {name: 'Gramps', age: 102, rank: 2}, ] const compareFn = (x, y) => { const sortDirValue = this.state.sortDirection === 'DESC' ? 1 : -1 if (x[this.state.sortBy] === y[this.state.sortBy]) return 0 return x[this.state.sortBy] < y[this.state.sortBy] ? sortDirValue : -sortDirValue } this.state = { sortBy: 'name', sortDirection: 'ASC' } rows.sort(compareFn) console.log('---- Sorted by alphabetical name ----') console.log(rows) this.state = { sortBy: 'age', sortDirection: 'DESC' } rows.sort(compareFn) console.log('---- Sorted…
Read More

C program fast fourier transform error advice [duplicate]

Uncategorized
Question: This question already has an answer here:How do I obtain the frequencies of each value in an FFT? 5 answers How to get frequency from fft result? 1 answer How can I get DFT/FFT output frequencies in Hertz? 1 answer So I am bit confused about the error I am having with taking fft of a sine wave. Fft function is given to us; function has us fill in the first input array with 256 samples of magnitude then second input array with all 0. The function takes the fft in place and returns the index of peak frequency. So I am not sure how to convert the returned index to the actual frequency of the input wave. Equation was given where frequency = sampleFrequency * index / N.…
Read More

How to solve Only secure origins are allowed

Uncategorized
Question: I am using cordova geolocation plugin in Ionic app . when i ran the app inside emulator i found this bug Only secure origins are allowed . hence was unable to get the geolocation of inside emulator . but using locahost it works fine probably localhost comes under secure origin. browser im using is chrome. plugin https://ionicframework.com/docs/native/geolocation/ Answer: there is an issue opened for this problem https://github.com/ionic-team/ng-cordova/issues/1413 Accessing the user's location is deprecated with unsecure (HTTP) context. See https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features. Running your dev server on localhost instead should work. Read more
Read More

Regex to match MediaWiki template without certain named parameter

Uncategorized
Question: I’ll get to the point: I need a regex that matches any template out of a list that have a date parameter - so assuming that my (singleton for now) list of templates is “stub”, the things below that are in bold should be matched:{{stub}} {{stub|param}} {{stub|date=a}} {{stub|param|date=a}} {{stub|date=a|param}} {{stub|param|date=a|param}} Note: “param” means any number of parameters there. Additionally, it would be nice if it could also match if the date parameter is blank, but this is not required. The current regex I have so far is {{((?:stub|inaccurate)(?!(?:|.*?|)*?|date=.*?(?:|.*?)*?)(?:|.*?)*?)}} However it matches the fourth and sixth items in the list above. Note: (?:stub|inaccurate) is just to make sure the template is either a stub or inaccurate template. Note 2: the flavor of regex here is Python 2.7 module RE. Answer:…
Read More