Search Results

Search found 215 results on 9 pages for 'johan fredrik varen'.

Page 5/9 | < Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >

  • CommandBinding broken in inner Custom Control when nesting two Custom Controls of the same type.

    - by Fredrik Eriksson
    I've done a Custom Control in form of a GroupBox but with an extra header which purpose is to hold a button or a stackpanel with buttons at the other side. I've added the a Dependency Property to hold the extra header and I've connected the customized template. Everything works fine until I put one of these controls in another one. Now the wierd stuff begins(at least in my eyes xP), the command binding in the inner control simply isn't set. I tried to use Snoop to gather some data, the see if the inherits is broken and when I clicked on the buttons which isn't doing what I want it to, boom, breakpoint triggered. So in some wierd way the Command isn't set until something that I don't know what it is, happens, which snoops triggers. I've also tried to put the buttons in the regular Header property and that works fine, but not with my own made. I could just switch places with them to make it like I want but now I'm curious to know where the problem lies... Now I wonder, what can I've missed? The control class: public class TwoHeaderedGroupBox : GroupBox { static TwoHeaderedGroupBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TwoHeaderedGroupBox), new FrameworkPropertyMetadata(typeof(TwoHeaderedGroupBox))); } public static DependencyProperty HeaderTwoProperty = DependencyProperty.Register("HeaderTwo", typeof(object), typeof(TwoHeaderedGroupBox), new FrameworkPropertyMetadata()); public object HeaderTwo { get { return (object)GetValue(HeaderTwoProperty); } set { SetValue(HeaderTwoProperty, value);} } } And here is the Template (which by the way is created by blend from the beginning): <ControlTemplate TargetType="{x:Type Controls:TwoHeaderedGroupBox}"> <Grid SnapsToDevicePixels="true"> <Grid.ColumnDefinitions> <ColumnDefinition Width="6"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> <ColumnDefinition Width="6"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> <RowDefinition Height="6"/> </Grid.RowDefinitions> <Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="4" Grid.Column="0" CornerRadius="4" Grid.Row="1" Grid.RowSpan="3"/> <Border x:Name="Header" Grid.Column="1" Padding="3,1,3,0" Grid.Row="0" Grid.RowSpan="2" VerticalAlignment="Center"> <ContentControl Content="{TemplateBinding Header}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> </Border> <ContentPresenter Grid.ColumnSpan="2" Grid.Column="1" Margin="{TemplateBinding Padding}" Grid.Row="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> <Border BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="4" CornerRadius="4" Grid.Row="1" Grid.RowSpan="3"> <Border.OpacityMask> <MultiBinding ConverterParameter="7" Converter="{StaticResource BorderGapMaskConverter}"> <Binding ElementName="Header" Path="ActualWidth"/> <Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/> <Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/> </MultiBinding> </Border.OpacityMask> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3"> <Border BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/> </Border> </Border> <Border x:Name="HeaderTwo" Grid.Column="2" Padding="3,5,3,5" Grid.Row="0" Grid.RowSpan="2" HorizontalAlignment="Right"> <ContentControl Content="{TemplateBinding HeaderTwo}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" DataContext="{TemplateBinding DataContext}"/> </Border> </Grid> </ControlTemplate>

    Read the article

  • Creating WCF DataContracts dynamically from code

    - by Fredrik Tonn
    Given the fact that I have a fully dynamic object model, that is, I have no concrete classes defined anywhere in code, but I still want to be able to create WCF DataContracts for them so I can use them in operations. How can I achieve this? My concrete class "Entity" implements ICustomTypeDescriptor which is used to present the various properties to the outside world, but my expeimentation with WCF suggests that WCF does not care about ICustomTypeDescriptor. Is this correct or have I missed something? Is this possible? It cannot be so that the only way to create a DataContract is to actually have a concrete harcoded class, can it?

    Read the article

  • Symbol not found - CUnit on Snow Leopard

    - by Fredrik
    I just installed CUnit on Snow Leopard with MacPorts/DarwinPorts. The installed worked fine after installing the "Snow Leopard compatible" version of MacPorts. However, I get en error when trying to run och unit tests: dyld: Symbol not found: _acs_map Referenced from: /opt/local/lib/libcunit.1.dylib Expected in: flat namespace in /opt/local/lib/libcunit.1.dylib Trace/BPT trap Has anyone come across this problem or has anyone successfully got CUnit working on Snow Leopard some other way?

    Read the article

  • SSL_CTX_use_PrivateKey_file fail on Linux (part 2)

    - by Fredrik Ullner
    For some reason, my calls to OpenSSL's SSL_CTX_use_PrivateKey_file have started to fail (again) on Ubuntu. My previous post concerning this function; http://stackoverflow.com/questions/2028862/ssl-ctx-use-privatekey-file-fail-under-linux With the above fix, I have been able to use things fine until a couple of days ago. I have no idea why. The error string I'm now getting is error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib with 336265225 as error code. What is the problem? Additional info: The file passed to the function exist (SSL_CTX_use_certificate_file is passed the same file). The code in the callback function for the password is also not called (at least apparantly not according to the debugger). Everything works fine on Windows.

    Read the article

  • Looking for Eclipse plugin: Lock source tabs in place

    - by Fredrik
    When working with java code in Eclipse I can typically juggle between 20-40 different files, but there usually are just two that I actively work with at the time (test and code). Going back to the code where I want to work after having debugged through 5-10 classes can be a pain. So what I would like to do is to be able to right click on the tab of a class and choose to lock them in place. The classes would then always be available as the first and second tabs furthest to the left in the editor. All other classes (and other files opened in the editor) would then fight over the remaining space in the editor like today. Is there a plugin like this? My google-fu might not be strong enough, cause I find nothing.

    Read the article

  • Spaced repetition (SRS) for learning

    - by Fredrik Johansson
    A client has asked me to add a simple spaced repeition algorithm (SRS) for an onlinebased learning site. But before throwing my self into it, I'd like to discuss it with the community. Basically the site asks the user a bunch of questions (by automatically selecting say 10 out of 100 total questions from a database), and the user gives either a correct or incorrect answer. The users result are then stored in a database, for instance: userid questionid correctlyanswered dateanswered 1 123 0 (no) 2010-01-01 10:00 1 124 1 (yes) 2010-01-01 11:00 1 125 1 (yes) 2010-01-01 12:00 Now, to maximize a users ability to learn all answers, I should be able to apply an SRS algorithm so that a user, next time he takes the quiz, receives questions incorrectly answered more often; than questions answered correctly. Also, questions that are previously answered incorrectly, but recently often answered correctly should occur less often. Have anyone implemented something like this before? Any tips or suggestions? Theese are the best links I've found: http://en.wikipedia.org/wiki/Spaced_repetition http://www.mnemosyne-proj.org/principles.php http://www.supermemo.com/english/ol/sm2.htm

    Read the article

  • GCC ABI compatibility

    - by Fredrik Ullner
    As far as I've understood, it is not possible to link libraries that use different versions of GCC's Application Binary Interface (ABI). Are there ABI changes to every version of GCC? Is it possible to link a library built with 4.3.1 if I use, say, GCC 4.3.2? Is there a matrix of some sort that lists all the ways I can combine GCC versions?

    Read the article

  • Design - Where should objects be registered when using Windsor

    - by Fredrik Jansson
    I will have the following components in my application DataAccess DataAccess.Test Business Business.Test Application I was hoping to use Castle Windsor as IoC to glue the layers together but I am bit uncertain about the design of the gluing. My question is who should be responsible for registering the objects into Windsor? I have a couple of ideas; Each layer can register its own objects. To test the BL, the test bench could register mock classes for the DAL. Each layer can register the object of its dependencies, e.g. the business layer registers the components of the data access layer. To test the BL, the test bench would have to unload the "real" DAL object and register the mock objects. The application (or test app) registers all objects of the dependencies. Can someone help me with some ideas and pros/cons with the different paths? Links to example projects utilizing Castle Windsor in this way would be very helpful.

    Read the article

  • Opening console applications in powershell

    - by Fredrik
    Hi, I'm currently developing a win32 console application, and wondering if there is any way to make visual studio open it in powershell instead of cmd.exe when I'm debugging it. All I really want is a better shell, where I can copy/paste etc. without clicking. Thanks

    Read the article

  • Order hybrid mixed mysql search result in one query?

    - by Fredrik
    This problem is easy fixed clientside. But for performance I want to do it directly to the database. LIST a +------+-------+-------+ | name | score | cre | +------+-------+-------+ | Abe | 3 | 1 | | Zoe | 5 | 2 | | Mye | 1 | 3 | | Joe | 3 | 4 | Want to retrieve a joined hybrid result without duplications. Zoe (1st higest score) Joe (1st last submitted) Abe (2nd highest score) Mye (2nd last submitted) ... Clientside i take each search by itself and step though them. but on 100.000+ its getting awkward. To be able to use the LIMIT function would ease things up a lot! SELECT name FROM a ORDER BY score DESC, cre DESC; SELECT name FROM a ORDER BY cre DESC, score DESC;

    Read the article

  • "paste" listener on a SWT widget

    - by Fredrik
    I have an application with a SWT widget, say a org.eclipse.swt.widgets.Text, and want to add some control to the paste function. The idea is that if the user can paste a string of IDs, I detect that, run some code and paste the object that corresponds to the IDs. So I'm looking for some "ClipBoardListener" of some sort to add to my widget, but that doesnt seem to exist. A keylistener would only trap the pastes done by key and then you would have to deal with different key combos for pasting in different OS's. Based on this java 1.2 question I tried subclassing the text class and override the inser method, but that didnt work Exception in thread "main" org.eclipse.swt.SWTException: Subclassing not allowed Seemed like an ugly solution anyway.

    Read the article

  • Databinding in windows forms on an object graph with possible null properties?

    - by Fredrik
    If I have an object graph like this: class Company { public Address MainAddress {...} } class Address { public string City { ... } } Company c = new Company(); c.MainAddress = new Address(); c.MainAddress.City = "Stockholm"; and databind to a control using: textBox1.DataBinding.Add( "Text", c, "MainAddress.City" ); Everything is fine, but If I bind to: Company c2 = new Company(); c2 using the same syntax it crashes since the MainAddress property is null. I wonder if there is a custom Binding class that can set up listeners for all the possible paths here and bind to the actual object dynamically when/if I sometime later in the application set the MainAddress property.

    Read the article

  • Entity Framework and associations between string keys

    - by fredrik
    Hi, I am new to Entity Framework, and ORM's for that mather. In the project that I'm involed in we have a legacy database, with all its keys as strings, case-insensitive. We are converting to MSSQL and want to use EF as ORM, but have run in to a problem. Here is an example that illustrates our problem: TableA has a primary string key, TableB has a reference to this primary key. In LINQ we write something like: var result = from t in context.TableB select t.TableA; foreach( var r in result ) Console.WriteLine( r.someFieldInTableA ); if TableA contains a primary key that reads "A", and TableB contains two rows that references TableA but with different cases in the referenceing field, "a" and "A". In our project we want both of the rows to endup in the result, but only the one with the matching case will end up there. Using the SQL Profiler, I have noticed that both of the rows are selected. Is there a way to tell Entity Framework that the keys are case insensitive? Edit:We have now tested this with NHibernate and come to the conclution that NHibernate works with case-insensitive keys. So NHibernate might be a better choice for us.I am however still interested in finding out if there is any way to change the behaviour of Entity Framework.

    Read the article

  • Semi-generic function

    - by Fredrik Ullner
    I have a bunch of overloaded functions that operate on certain data types such as int, double and strings. Most of these functions perform the same action, where only a specific set of data types are allowed. That means I cannot create a simple generic template function as I lose type safety (and potentially incurring a run-time problem for validation within the function). Is it possible to create a "semi-generic compile time type safe function"? If so, how? If not, is this something that will come up in C++0x? An (non-valid) idea; template <typename T, restrict: int, std::string > void foo(T bar); ... foo((int)0); // OK foo((std::string)"foobar"); // OK foo((double)0.0); // Compile Error Note: I realize I could create a class that has overloaded constructors and assignment operators and pass a variable of that class instead to the function.

    Read the article

  • UDF function with library dependencies on MySQL 5.1

    - by Fredrik
    I'm having a problem with a MySQL UDF function (mychem.sourceforge.net) that's dependent on a large library (openbabel.org) which is in turn plugin based. The problem is that the format plugins to openbabel doesn't seem to load in MySQL 5.1 and I suspect it might be due to the plugin_dir setting. I have set plugin_dir to /usr/lib/ which is the location for both libmychem.so and libopenbabel.so as well as the directory openbabel that contains the format plugins. Is there a way to turn off the plugin_dir restriction in MySQL (preferably without compiling MySQL from sources) so that I can test this hypothesis or do you have a different idea on what might cause the problem? All this is done on Ubuntu 10.04 (but I had the same kind of problems on 8.04, where I managed to get it working after a lot of steps that I unfortunately have forgotten...) I have turned off apparmor during testing and it doesn't help either.

    Read the article

  • Disable AND Grey out an eclipse widget

    - by Fredrik
    I have a org.eclipse.swt.widgets.Composite that I want to be able to enable/disable programatically. The org.eclipse.swt.widgets.Control.setEnabled(boolean enabled) method works fine, but it does not give any visual information that the widget(s) are disabled. What I would like to do is to have the disabled state mean the widgets are greyed out. Right now they just enter a weird state where the user is unable to click or perform any action on them.

    Read the article

  • Eclipse ant build gives "Another singleton version selected", how can I stop that?

    - by Fredrik
    We run org.eclipse.ant.core.antRunner to build our plugins and RCP projects. In the build logs we get a ton of messages like: [eclipse.buildScript] Bundle org.eclipse.X: [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.X_1.0.4.v20081112-1019 The reason is clear; There are two different versions of a particular bundle and it chose the latest. We cannot change the Eclipse installation to remove the older plugins, so what can be done to get rid of these messages? Bonusquestion: What class prints out these messages? One option could be to create our own version where these messages are never shown.

    Read the article

  • write() in sys/uio.h returns -1

    - by fredrik
    I'm using Ubuntu Server 9.10 AMD Phenom 2 cpu g++ (Ubuntu 4.4.1-4ubuntu9) 4.4.1 trying to run the application pftp-shit v 1.11. The following code in tcp.cc is executed successfully: int outfile_fd = open(name, O_CREAT | O_TRUNC | O_RDWR | O_BINARY)) which returns a file descriptor int (in my case 6) - name is a char array containing a valid path to my file which successfully i created. and successfully running: fchmod(outfile_fd, S_IRUSR | S_IWUSR); and access(name, W_OK) The issue occurs during running the function (from sys/uio.h) write(outfile_fd, this-control_buffer, read_length) which returns -1. -1 is of returned if nothing was written and otherwise a non-negative integer is returned which is equal to the number of bytes written. Anyone having a clue how I can get the write function to work?

    Read the article

  • What can cause System.Move to occasionaly give wrong results?

    - by Fredrik Loftheim
    The last few days we have had some strange problems with our database components developed by a third party. There has been no changes to these components for months. The code that HAS changed the last few days is our own code and we have also updated our gui-components developed by another third party. After debugging I have found that a call to System.Move in one of the database component procedures occationaly gives wrong results! Please take a look at the code below from the database components and read my comments. How can this inconsistent behaviour happen? Can anyone give me an idea of how to procede to find the cause of this inconsistent behaviour? NB! I dont think there is anything wrong with THIS code, it is only shown to explain the problem "symptoms". My guess is that there is some sort of memory corruption or something, caused by our code or the updated gui-component-code. Edit: Take a look at the blogpost linked below. It seems that it could be related to my problem. At least as I read it it confirms that System.Move can give wrong results: http://blog.excastle.com/2007/08/28/delphi-bug-of-the-day-fpu-stack-leak/ Procedure InternalDescribe; var cbufl: sb4; //sb4=LongInt cbuf: array[0..30] of char; cbufp: PChar; //.... begin //..Some code repeat //...Some code to initialize cbufp and cbufl //On the 15. iteration the values immediately Before Move are always these: //cbufp = 'STDPRODUCTSTOREDELEMENTSCOUNT' //cbuf = ('S', 'T', 'A', 'T', 'U', 'S', #0, 'E', 'V', 'A', 'R', 'R', 'E', 'C', 'I', 'D', #0, 'D', 'U', 'C', 'T', 'I', 'D', #0, #0, #0, #0, #0, #0, #0, #0) //cbufl = 29 Move(cbufp^, cbuf, cbufl); //Values immediately After Move should then be: //cbuf = ('S', 'T', 'D', 'P', 'R', 'O', 'D', 'U', 'C', 'T', 'S', 'T', 'O', 'R', 'E', 'D', 'E', 'L', 'E', 'M', 'E', 'N', 'T', 'S', 'C', 'O', 'U', 'N', 'T', #0, #0) //But sometimes this Move results in this value( 1 in 5..15 times): //cbuf = ('S', 'T', 'D', 'P', 'R', 'O', 'D', 'U', 'C', 'T', 'S', 'T', 'O', 'R', 'E', 'D', #0, #0, #0, #0, #0, 'N', 'T', 'S', 'C', 'O', 'U', 'N', 'T', #0, #0) } until SomeCondition; //...Some more code end;

    Read the article

  • Why does local variable names take precedence over function names in JavaScripts?

    - by fredrik
    In JavaScript you can define function in a bunch of different ways: function BatmanController () { } var BatmanController = function () { } // If you want to be EVIL eval("function BatmanController () {}"); // If you are fancy (function () { function BatmanController () { } }()); By accident I ran across a unexpected behaviour today. When declaring a local variable (in the fancy way) with the same name as function the local variable takes presence inside the local scope. For example: (function () { "use strict"; function BatmanController () { } console.log(typeof BatmanController); // outputs "function" var RobinController = function () { } console.log(typeof RobinController); // outputs "function" var JokerController = 1; function JokerController () { } console.log(typeof JokerController); // outputs "number", Ehm what? }()); Anyone know why var JokerController isn't overwritten by function JokerController? I tested this in Chrome, Safari, Canary, Firefox. I would guess it's due to some "look ahead" JavaScript optimizing done in the V8 and JägerMonkey engines. But is there any technical explanation to explain this behaviour?

    Read the article

  • Enforce "equals" in an interface

    - by Fredrik
    I have an interface and I want everyone who implements this interface to implements an overrridden "equals" method. Is there a way to make sure that happens? The way I guess this will happen is that the class that implements my interface will automatically get the equals from Object therefore making the interface happy.

    Read the article

  • Why Your Android Phone Isn’t Getting Operating System Updates and What You Can Do About It

    - by Chris Hoffman
    Several times a year, Google releases a new version of Android with new features and performance improvements. Unfortunately, most Android devices in the wild will never get the update. New Android users are often disappointed to discover that their shiny new smartphone won’t get any updates – or worse, that it was running old software from the moment they bought it. Image Credit: Johan Larsson on Flickr Why Your Android Phone Isn’t Getting Operating System Updates and What You Can Do About It How To Delete, Move, or Rename Locked Files in Windows HTG Explains: Why Screen Savers Are No Longer Necessary

    Read the article

  • OCS Disaster Recovery – Part 1

    Office Communications Server stores its data in a variety of locations, which can make backing it up and disaster recovery a slightly tricky business. Thankfully, Johan Velduis is here to tell which databases and fileshares we need to worry about, and give us peace of mind.

    Read the article

  • A Deep Dive into Transport Queues (Part 2)

    Johan Veldhuis completes his 'Deep Dive' by plunging even deeper into the mysteries of MS Exchange's Transport queues that are used to temporarily store messages which are waiting until they are passed through to the next stage, and explains how to change the way they work via configuration settings.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >