Search Results

Search found 7 results on 1 pages for 'ngan'.

Page 1/1 | 1 

  • How to add handler in dynamic datatemplate

    - by Phillip Ngan
    I am successfully declaring a data template in a code behind as follows: private static DataTemplate CreateTemplate(string sortMemberPath, HorizontalAlignment horzAlignment) { const string xamlFormat = "<DataTemplate xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" >" + "<StackPanel > " + " <TextBlock Margin=\"2,0\" VerticalAlignment=\"Center\" HorizontalAlignment=\"_HALIGNMENT_\" " + " Text=\"hello there\"> " + " </TextBlock> " + "</StackPanel>" + "</DataTemplate>"; return (DataTemplate) XamlReader.Load(xamlReturned); } But now I want to add a size changed handler by changing the line: + "<StackPanel > " to + "<StackPanel SizeChanged="SizeChangedHandler" > " I have the method "SizeChangedHandler" declared in the code behind. This results in a xaml parse error when the control attempts to load at runtime. I suspect that it can't find the handler "SizeChangedHandler". How can I specify this handler so that the xaml parser is happy.

    Read the article

  • GUI design for color blindness

    - by Phillip Ngan
    It is common to represent status of an item in a GUI using the colors: red, yellow, green, to mean error, warning, and OK (or something equivalent). However, 7-10% of men have difficulty distinguishing between red and green because of color blindness. So far I've looked at Color Scheme Designer which simulates how people with different color blindnesses would perceive a set of colors, but I'm interested in hearing how you have approached this problem and how successful it was.

    Read the article

  • Cannot execute "LOAD DATA LOCAL INFILE" Mysql query in Rails after a connection reconnection

    - by Ngan
    On Rails 2.3.8 (but I think Rails 3 might have this issue as well, not sure): I get an error when trying to execute a LOAD DATA LOCAL INFILE query after reconnecting to a database. I have a process that parses a file that can potentially take a bit of time. During the parsing, Mysql closes the connection due to timeout. This is fine, I do a ActiveRecord::Base.verify_active_connections! and I get the connection back (I do this in several places through my app). However, running a LOAD DATA LOCAL INFILE statement, I get this error: Mysql::Error: The used command is not allowed with this MySQL version It's not a permission issue, I know that for sure. Check out my test in console: ActiveRecord::Base.connection.execute("LOAD DATA LOCAL INFILE '/tmp/test.infile' INTO TABLE users") [Sat Jan 08 00:09:29 2011] (9990) SQL (1.7ms) LOAD DATA LOCAL INFILE '/tmp/test.infile' INTO TABLE users => nil > ActiveRecord::Base.connection.disconnect! => #<Mysql:0x104c6f890> > ActiveRecord::Base.verify_active_connections! [Sat Jan 08 00:09:58 2011] (9990) SQL (0.2ms) SET SQL_AUTO_IS_NULL=0 => {...connection stuff...} > ActiveRecord::Base.connection.execute("LOAD DATA LOCAL INFILE '/tmp/test.infile' INTO TABLE users") [Sat Jan 08 00:10:00 2011] (9990) SQL (0.0ms) Mysql::Error: The used command is not allowed with this MySQL version: LOAD DATA LOCAL INFILE '/tmp/test.infile' INTO TABLE users ActiveRecord::StatementInvalid: Mysql::Error: The used command is not allowed with this MySQL version: LOAD DATA LOCAL INFILE '/tmp/test.infile' INTO TABLE users from ~/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract_adapter.rb:221:in `log' from ~/gems/activerecord-2.3.8/lib/active_record/connection_adapters/mysql_adapter.rb:323:in `execute' from (irb):6 I am able to do other queries like SELECT and whatnot, and I will get the correct result. It's just this one that giving me the error. I even tested this with a fresh rails app. You'll notice that I am able to do the exact same query before the disconnect. Thanks for the help!

    Read the article

  • how to make Regular expression into non-greedy ?

    - by Rueta
    Hi everyone! I have made a Work with JQ. My Work is a string width a special character block begin and end of string. I want take the text in that special characters, i used regular expression for find in string, but how to make JQ find multi result when have two special character or more. My html here; <div id="container"> <div id="textcontainer"> Cu?c chi?n pháp lý gi?a [|co th?|nghi?m|] th? tru?ng [|test2|dây là test l?n 2|] ch?ng khoán [|M?|day la nuoc my|] và ngân hàng d?u tu quy?n l?c nh?t Ph? Wall m?i ch? b?t d?u. </div> </div> and my JQ $(document).ready(function() { var takedata = $("#textcontainer").text(); var test = 'abcd adddb'; var filterdata = takedata.match(/(\[.+\])/); alert(filterdata); //end write js }); my result is: [|co th?|nghi?m|] th? tru?ng [|test2|dây là test l?n 2|] ch?ng khoán [|M?|day la nuoc my|] . but this is'nt the result i want :(. How to get [text] for times 1 and [demo] for times 2 ?. pls help me !. thankyou :)

    Read the article

1