Possibly Bug in Websharper Zafir-Libraries (Beta) - beta

I'm trying to create a Sitelet with SiteletBuilder in C#:
return WebSharper.Sitelets.Content.Page(...)
However, the class Websharper.Sitelet contains Content both as Struct and Class.
So, this does not compile.
Versions of Zafir-Libraries are
Zafir 4.0.152.29-beta5
Zafir.CSharp 4.0.152.29-beta5
Zafir.Html 4.0.56.95-beta5
Zafir.UI.Next 4.0.102.33-beta5
How to reference WebSharper.Sitelets.Content proberly?
Or is this indeed a bug?

Thanks for the report, created ticket: https://github.com/intellifactory/websharper/issues/645
I have been testing with having using WebSharper.Sitelets; and then using with shorter form Content.Page(...). C# can resolve this for some reason, although the name conflict indeed exists in WebSharper.Sitelets.dll

Related

Dart Polymer : Type X is not a subtype of type Y

I develop my application with Dart and Polymer on PyCharm. I currently have an error :
Exception: type 'ObservableList<DrugFilterItem>' is not a subtype of type 'ObservableList<DrugCompareItem>' of '__$orderFilterList#51385934'
ObservableList is from package:observe/src/observable_list.dart
DrugFilterItem is from package:synmed/drug_elements/views/drug_filter_menu.dart
ObservableList is from package:observe/src/observable_list.dart
DrugCompareItem is from package:synmed/drug_elements/views/drug_search_toolbar.dart
DrugFilterItem and DrugCompareItem are both custom classes, DrugCompareItem extends DrugFilterItem, and the line designed by the error is :
ObservableList<DrugCompareItem> orderFilterList = new ObservableList<DrugFilterItem>();
The problem suddenly happened today : I installed Pycharm 2016.3 and tried to code, but I had an error with the package shadow, which I solved. Since, I have this error which I supposed came from a problem with the packages as the code didn't change from before to after.
What I have found for now is nothing in fact, I read a lot of post on this kind of error, one of the recurrent subject was the imports but I didn't find any problem with this. I am using Dart 1.20.1 and
polymer: "<=0.16.4+1"
core_elements: "<=0.7.1+3"
paper_elements: "<=0.7.1"
Do anyone has any clue for me? Thanks!
Sounds like https://github.com/dart-lang/sdk/issues/14972#issuecomment-108402835
I believe this is working as intended. A List is not assignable to a List, even if it only contains Apples.
There are several ways to work around this:
iterable.map((x) => x) (removing the generic type),
new List<MethodMirror>.from(iterable)
new MyIterableWrapper<MethodMirror>(iterable) (where the iterable-wrapper that would need to be written).

SharpDX ShaderBytecode.CompileFromFile to PixelShader

Currently i am working on a migration from SlimDX to SharpDX. Some things are different between them, like loading shaders etc:
I have a problem creating the PixelShader class (same applies to the VertexShader class). The problem is, every example I found on this subject will not compile.
For example:
using (var pixelShaderByteCode = ShaderBytecode.CompileFromFile(filename, "PS", "ps_5_0", shaderFlags))
shader.PixelShader = new SharpDX.Direct3D11.PixelShader(device, pixelShaderByteCode);
The problem is, SharpDX.Direct3D11.PixelShader does not take a ComplilationResult as parameter. I could use the vertexShaderByteCode.Bytecode which is a ShaderBytecode, but this is also invalid.
There is a vertexShaderByteCode.Bytecode.Data which is a DataStream. I might create the byte[] from it, but I think this could be solved easier? Did I missed something?
using: SharpDX 3.1.1
I have found the problem:
Looks like i need to reference the SharpDX.D3DCompiler also, to compile for DX11. It was using the DX9 compiler.
SharpDX.D3DCompiler.ShaderBytecode(DX11) vs SharpDX.Direct3D9.ShaderBytecode(DX9)
I'll leave this for anyone who has the same struggles.
CompilationResult is returned by the compile and you can test if the bytecode is null, if it is, you can then check the error codes (Best in debug though :)).
HasErrors : boolean
Message : string
Check these also.

CSOM 2013 error: Unable to cast object of type 'System.Collections.Generic.Dictionary

I'm using this code to loop columns of a SharePoint 2013 List.
currentContext.Load(currentList.Fields);
currentContext.ExecuteQuery();
foreach (Field f in currentList.Fields) {
}
No problem with normal columns. But, when I arrive to a lookup column I have this error:
"Unable to cast object of type
'System.Collections.Generic.Dictionary`2[System.String,System.Object]'
to type 'Microsoft.SharePoint.Client.Field'."
I found for example this discussion
This issue came when we were working with TaxonomyFieldValue fields. For us changing references was not an option. This helped:
TaxonomyItem dummy = new TaxonomyItem(web.Context, null);
It will force program to load adequate libraries forcing correct type in runtime.
I had this same issue and updating the references fixed it for me. This question helped me figure it out.
I went from version 14 of "Microsoft.SharePoint.Client" and "Microsoft.SharePoint.Client.Runtime" to version 16 and no longer had the error.
Latest client download

Error with spring security plugin in grails 2.4.0.M1

i'm running into a compilation issue, using grails 2.4.0.M1 and spring-security-core:2.0-RC2
this is the error:
..../target/work/plugins/spring-security-core-2.0-RC2/src/groovy/grails/plugin/springsecurity/ReflectionUtils.groovy:
205: Apparent variable 'org' was found in a static scope but doesn't
refer to a local variable, static field or class. Possible causes:
You attempted to reference a variable in the binding or an instance
variable from a static context. You misspelled a classname or
statically imported field. Please check the spelling. You attempted
to use a method 'org' but left out brackets in a place not allowed by
the grammar. # line 205, column 18.
application = org.codehaus.groovy.grails.commons.ApplicationHolder.application
^
the problem seems to be around this method
private static GrailsApplication getApplication() {
if (!application) {
application = org.codehaus.groovy.grails.commons.ApplicationHolder.application
}
application
}
on the class ReflectionUtils.groovy,
does anyone else as ran into something like this? if so how do you fixed it?
I fixed this today - https://github.com/grails-plugins/grails-spring-security-core/commit/ef3aab05bfb0eb2f2cbb2c5945f4fc9ca2f0697d
You can make the change that #Bubuntux showed as a temporary workaround, and I'll be releasing 2.0 final in a couple of weeks with this fixed. Hopefully you're not planning on using a Grails M1 release in production, so the delay shouldn't be too much of an issue.
Seems like the ApplicationHolder class was deprecated a long time ago, and now removed on grals 2.4
so i just change the line
application = org.codehaus.groovy.grails.commons.ApplicationHolder.application
to
application = Holders.grailsApplication

F# AsyncWaitOne and AsyncReadToEnd

I am working ti old F# code from Expert F#. However, the example doesn't build anymore.
The following two calls don't seem to exist:
semaphore.AsyncWaitOne(?millisecondsTimeout=timeout)
and
reader.ReadToEndAsync()
Does anyone know what these have been replaced with or if I am just missing a reference?
It's now called Async.AwaitWaitHandle.
AsyncReadToEnd is in the F# PowerPack.
By now, FSharp PowerPack project has been broken up into smaller modules for any further development.
Specifically, the AsyncStreamReader class and the extension methods for the reading from a StreamReader, WebClient, etc. the new project is FSharpx.Async.
1) AsyncWaitOne is now called Async.AwaitWaitHandle.
2) AsyncReadToEnd() extension method does not exists anymore in the FSharp.PowerPack.
It has been replaced with the AsyncStreamReader dedicated type that contains proper asynchronous implementation of stream reading (like ReadToEnd, ReadLine, etc.)
It can be used like that:
async {
use asyncReader = new AsyncStreamReader(stream)
return! asyncReader.ReadToEnd() }
Note: Once you have installed FSharp.PowerPack, the AsyncStreamReader type will be 'injected' in the Microsoft.FSharp.Control namespace

Resources