Bug in SubSonic.Comparison.In - subsonic

With the following code:
IEnumerable<int> LocalityIds = new List<int>();
PersonCollection pc =
new PersonCollection().
Where(Person.Columns.AddressLocalityId, SubSonic.Comparison.In, LocalityIds).
Load();
Although the initial collection is empty Subsonic still returns all records?!?!?!?!? Is this a bug or am i doing something wrong?
Thanks

I don't think we've setup collections to do this even though the Comparison is there. Have you tried Select().From().Where(..).In(LocalityIds).ExecuteAsCollection();

Just checked V2.2 and this still happens, when I have a bit of time I will try to submit a patch

Related

Trouble upgrading to new ember-simple-auth

G'day all,
I've been having trouble upgrading to a more recent version of the ember-simple-auth module.
In particular I seem to have two challenges:
1) the application no longer transitions to the desired route after authenticating. the configuration looks like this:
ENV['ember-simple-auth'] = {
crossOriginWhiteList: ['http://10.10.1.7:3000'],
routeAfterAuthentication: 'profile',
//store: 'simple-auth-session-store:local-storage',
//authorizer: 'simple-auth-authorizer:token',
};
but it never gets to "profile".
2) I can't get the authenticated session to stick after a reload. I had been trying to use the local-store which I believed would do the trick, but it's not. Has something changed in the implementation?
The documentation seems to indicate that the configuration strings are right, but the transition and session store don't seem to be working.
Has anyone had a similar problem?
Thanks,
Andrew
you could try adding "routeIfAlreadyAuthenticated" to ENV['ember-simple-auth'] - or you could transition manually in index route "afterModel" hook, if session is already authenticated
have you configured a session store? https://github.com/simplabs/ember-simple-auth#session-stores - the way it's configured changed in 1.0, now you can add the desired session store to app/session-stores/application.js - maybe this solves #1 too.
OK. As the comments call out, there were two problems here:
1) I had written a customer authorizer for the old version of simple-auth which didn't work with the new version, and
2) I had a typo in the adapter code, where DataAdapterMixin was DAtaAdapterMixin.
Removing (1) and fixing (2) fixed the problem.

Adjusting AVAudioMix volume property has no effect in iOS9

I have an app which loads local files into an avPlayer via a AVMutableComposition, it may have as many as 6 audio and video tracks as part of the composition.
I have a UISlider which is used to adjust the volume of each track in the player.
Below is the code used to update the volume.
- (void)updateVolumeForTake:(Take *)take
{
NSInteger trackID = // method that gets trackID
AVMutableAudioMix *audioMix = self.player.currentItem.audioMix.mutableCopy;
NSMutableArray *inputParameters = audioMix.inputParameters.mutableCopy;
AVMutableAudioMixInputParameters *audioInputParams = [inputParameters filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:kTrackIdPredicate, trackID]].firstObject;
[audioInputParams setVolume:myNewVolumeFloat atTime:myDesiredTime];
audioMix.inputParameters = inputParameters;
AVPlayerItem *playerItem = self.player.currentItem;
playerItem.audioMix = audioMix;
}
This is is currently live in the appStore and has been since iOS6 and has always worked with no issue.
On a device running iOS9, the above no longer works at all. I have looked at the release notes and although there is some mention of AVFoundation, I didn't see anything regarding AVAudioMix.I have googled around and have not found anyone else with this issue.
I also tried creating a new project with nothing but an AVPlayer and UISlider and I saw the same behaviour.
My question is as follows, has anyone else experienced this issue?
Is anyone aware of a known bug related to this?
I have found a solution but unfortunately not an exact cause.
I can't say I fully understand why this fixed my issue but here is the solution and an attempt at explaining why it fixed the issue I was experiencing.
- (void)updateVolumeForTake:(Take *)take
{
AVMutableAudioMix *audioMix = [AVMutableAudioMix audioMix];
NSMutableArray *inputParameters = [self.inputParameters filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:kNotTrackIdPredicate, myTrackID]].mutableCopy;
AVCompositionTrack *track = (AVCompositionTrack *)[self.composition trackWithTrackID:myTrackID];
AVMutableAudioMixInputParameters *audioInputParams = [AVMutableAudioMixInputParameters audioMixInputParametersWithTrack:track];
[audioInputParams setVolume:myDesiredVolume atTime:kCMTimeZero];
[inputParameters addObject:audioInputParams];
audioMix.inputParameters = inputParameters;
AVPlayerItem *playerItem = self.player.currentItem;
playerItem.audioMix = audioMix;
self.inputParameters = inputParameters;
}
As you can see above, I have stopped using mutable copies of my AVAudioMix and its inputParameters and instead created a new AVAudioMix and NSMutableArray for inputParameters. The new inputParameters array is a copy of the existing inputParameters (referenced from a property 'self.inputParameters') minus the track matching the one I wish to change.
Secondly I create a new instance of AVMutableAudioMixInputParameters using the track with which I wish to edit the volume of (previously I was getting reference to the existing params with matching trackID and modifying them). I edit that add it to my new array and make that the audio mix of currentItem.
Again I can't say with any certainty why this fixes it, but it did for me, I wonder if all the mutable copies were not being discovered as different at all when I reassigned the audioMix of the playerItem and thats why I didn't hear any change in the volume. (although this seems doubtful).
Anyway my issue is fixed and I hope this can help anyone who has a similar issue.

How to make ZombieJS wait indefinitely for a site

I'm using zombieJS to scrape a veeeeeeeery slow site. I tried many things to make it go slower, but I'm receiving lots of
TypeError: Cannot use 'in' operator to search for 'compareDocumentPosition' in null
errors.
I tried to add to my pressButton function the following:
browser.wait({waitDuration: '700s', element: "pre"});
while initializing the browser with this configuration:
browser = new Browser();
browser.maxWait = 10000000;
browser.runScripts = false;
browser.loadCSS = false;
browser.waitFor = 500000;
but I'm still receiving the above mentioned error after a few seconds...
I think this might apply to you: Zombiejs jQuery nullTypeError 'compareDocumentPosition'
your site is so slow, that the tag cannot be found early enough from zombie. Would you please so kind, to open a new issue for assaf on github? We tried to track down the cause of this random-error earlier, but now I think it's caused because zombie should wait for the first dom element to be loaded
I also had similar problem and it got solved by removing debug option, while creating instance of browser. Also downgrade to v1.4.1 as 2.0 is in alpha stage

Mongoid pagination

I tried
#posts = Post.page(params[:page]).per_page(10)
and
#posts = Post.paginate(:page => 1, :per_page => 10)
but neither method works
undefined method `page' for Post:Class
undefined method `paginate' for Post:Class
How do you do pagination with mongoid?
You should use Kaminari https://github.com/amatsuda/kaminari
This works fine for me:
#posts = Post.paginate(:page => 1, :limit => 10).desc(:_id)
desc(:_id) is added so that latest posts could be listed first.
Still using will_paginate is also okay.
This thread has same issue: undefined method `paginate' for Array on Rails 3 with mongoid
The main point to fix the error is to add this line before the controller call paginate library:
require 'will_paginate/array'
It should be added to default config file if you use mongoid for the whole project.
Hope the explanation helpful.
Reference from origin gem source: https://github.com/mislav/will_paginate/wiki/Backwards-incompatibility at "WillPaginate::Collection" section.
P/S: this is just a work around if your query is not very large. If you want better performance, let's try mongoid-pagination gem, custom will_pagination gem or another pagination gem which supported Mongoid like kaminari.
A bit late, but for anyone else looking, I found 'will_paginate_mongoid'
https://github.com/lucasas/will_paginate_mongoid
Really straight forward and lets you simply do
collection.skip(20).limit(10)
Use the following gem.
Very helpful.
https://github.com/lucasas/will_paginate_mongoid
To update a bit the answers, now exists the Pagy gem, also much more performant (cpu/mem) than will_paginate and kaminari. This is a migration guide
silly thing, but it worked for me in sinatra after i added require 'mongoid-pagination'
to app.rb
Posting several years later, in case someone else faces the same challenge.
kaminari-mongoid was released in 2016, and is currently maintained.
https://github.com/kaminari/kaminari-mongoid
All the goodness of Kaminiari for Mongoid, including appropriate handling of Mongoid::Criteria results, which was possibly the cause of the OP's error.

sharepoint: Using a Content Editor Web Part this error occurred:"Cannot retrieve properties at this time."

I have a content editor web part. Whenever I edit the content and then click save, the following errors occurred:
"Cannot retrieve properties at this time."
"Cannot save your changes"
How do you fix this?
I tried googling it.. there are some similar cases but not exactly the same. I tried this link:
www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/MS-SharePoint/Q_21975446.html
and this one:
support.microsoft.com/kb/830342
and this one:
blogs.msdn.com/gyorgyh/archive/2009/03/04/troubleshooting-web-part-property-load-errors.aspx
I found the answer!! apparently using mozilla firefox it worked. Then I found out that there is a javascript error in IE, this javascript error doesnt happened in firefox. how ironic!
Are you doing anything to modify the URL in an HTTPModule? I ran into this problem on a publishing site where a module was hiding the "/pages" part of the URL. Modifying the CEWP via the page when accessed w/o the "/Pages" wasn't working, but with the "/Pages" it was.
Example:
Got error: http://www.tempura.org/webpartpage.aspx
Worked: http://www.tempuri.org/pages/webpartpage.aspx
I don't see how this is an answer -- "don't use IE".
In my case (and apparently many others) it has something to do with ISA + SharePoint + host headers. I will post the fix if I find one.
I have had problems with this before and have found recycling the Application Pool often corrects the problem.
Rodney
IE8 -->
Tools --> Compatiblity View Settings --> CHECK THIS : Display All Websites in ....
If you are editing a webpart page, make sure that it is checked out. Sometimes the document library the webpart pages are in will have a "force check out to edit" option and it will give you errors if the webpage itself isn't checked out.
I had this same error recently. In javascript, I had written some prototype overrides (see examples below) to add some custom functions to the string and array objects. Both of these overrides interferred with SharePoint's native JavaScript somehow in IE. I removed the references from the master page and this issue was FIXED. Currently trying to find a work-around so I can keep them because things like the string.format function is very nice to have...
//Trim
if (typeof String.prototype.trim !== 'function') {
String.prototype.trim = function(){
return this.replace(/^\s+|\s+$/g, '');
}
}
//Format
String.format = function() {
var s = arguments[0];
for (var i = 0; i < arguments.length - 1; i++) {
var reg = new RegExp("\\{" + i + "\\}", "gm");
s = s.replace(reg, arguments[i + 1]);
}
return s;
}
I also faced the same problem. Finally it worked for me using url /Pages/Contact-Us.aspx instead of clean URL. It worked only with IE browser. Don't know why this was happening but anyhow it worked with me.
Use IE browser
Use Pages in the URLinstead of clean URL.
to me,
compatibility mode in IE8, to work

Resources