Search Results

Search found 5 results on 1 pages for 'janko'.

Page 1/1 | 1 

  • nginx clean url router/rewrites

    - by Janko
    im having difficulties with a relativity simple rewrite rules / router in nginx config. All I want to do is, if requested dir or file 'host/my/request/path[/[index.php]]' does not exist, rewrite to 'host/my/request/path.php' Current rewrite works for: host host/ host/my/request/path But wont work for: host/my/request/path/ Here is the rewrite part of the config: location = /(.*)/ { rewrite ^(.*)$ $1 permanent; } location / { try_files $uri/ $uri $uri.php; } Error log will report: Access forbidden by rule, request: "GET /my/request/path/ HTTP/1.0" Hm, is there a better way to solve this or get rid of the trailing slash? edit, rules more elaborative: host[/] > host/index.php host/index[/] > host/index.php host/my/path[/] > if /path/index.php exists: host/my/path/index.php else host/my/path.php

    Read the article

  • Give WPF design mode default objects

    - by Janko R
    In my application I have <Rectangle.Margin> <MultiBinding Converter="{StaticResource XYPosToThicknessConverter}"> <Binding Path="XPos"/> <Binding Path="YPos"/> </MultiBinding> </Rectangle.Margin> The Data Context is set during runtime. The application works, but the design window in VS does not show a preview but System.InvalidCastException. That’s why I added a default object in the XYPosToThicknessConverter which is ugly. class XYPosToThicknessConverter : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { // stupid check to give the design window its default object. if (!(values[0] is IConvertible)) return new System.Windows.Thickness(3, 3, 0, 0); // useful code and exception throwing starts here // ... } } My Questions: What does VS/the process that builds the design window pass to XYPosToThicknessConverter and what is way to find it out by myself. How do I change my XAML code, so that the design window gets its default object and is this the best way to handle this problem? I’m using VS2010RC with Net4.0

    Read the article

  • No-argument method on window.external is invoked when checking with typeof

    - by janko
    Hi, I am trying to display an HTML page with embedded JavaScript code inside a System.Windows.Forms.WebBrowser control. The JavaScript code is expected to interact with the embedding environment through the window.external object. Before invoking a method on window.external, JavaScript is supposed to check for the existance of the method. If it is not there, the code should invoke a generic fallback method. // basic idea if (typeof(window.external.MyMethod) != 'undefined') { window.external.MyMethod(args); } else { window.external.Generic("MyMethod", args); } However, checking for a no-argument method with typeof seems to invoke the method already. That is, if MyMethod accepts any positive number of arguments, the code above will work perfectly; but, if MyMethod is a no-argument method, then the expression typeof(window.external.MyMethod) will not check for its type but invoke it, too. Is there any work-around to this behavior? Can I somehow escape the expression window.external.MyMethod to prevent the method call from occurring?

    Read the article

1