Search Results

Search found 224 results on 9 pages for 'dau thanh hai'.

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

  • how a view controller know when it is dismissed or poped out of the navigation controller stack?

    - by Thanh-Cong Vo
    Hi all, My view controller needs to know when it is poped out of the navigation controller stack, so that it can retain itself, wait and release itself later with another notification. I intend to do like that when the view is sent dealloc message: - (void)dealloc { if (self.isPerformingSomeTask) { self.isPopedOut = YES; [self retain]; return; } [super dealloc]; } But I think this is not a good solution? Any idea?

    Read the article

  • Mimicking a HBox / VBox with CSS

    - by Daniel Hai
    I'm an old school tables guy, and am pretty baffled when it comes to modern HTML. I'm trying to something as simple as vertical / horizontal layouts (i.e. Flex's hbox/vbox), but am having major difficulty replicating them. An old table would look something like this for an HBox: <table width="100%" height="100"> <tr valign="middle"> <td nowrap style="background-color:#CCC">I am text on grey</td> <td width="50%" valign="top">displays top</td> <td width="50%" align="right">Autosize Fill (displays bottom right)</td> </tr> </table> Now I'm trying to do this with div's, but to no avail. When using display:inline, I cannot set a percentage width -- it only takes explicit widths. When using float:left, settings 100% percentage width causes it to really be 100% and pushes the next div down. Here's the code I've been playing with: <html> <head> </head> <style type="text/css"> div.test { background-color: #EE9; padding:5px;} body { font-family: Arial; } ul { list-style-type:none; } ul li { float:left; } .hboxinline div { display: inline; } .hboxfloat div { float:left; } .cellA { background-color:#CCC; width:100%; } .cellB { background-color:#DDD; min-width:100; } .cellC { background-color:#EEE; min-width:200; } </style> <body> A = 100%, b = 100, c = 200 <div class="test">old school table <table cellpadding="0" cellspacing="0"> <tr> <td class="cellA">A</td> <td class="cellB">B</td> <td class="cellC">C</td> </tr> </table></div> <br/> <div class="test"> float:left <div class="hboxinline"> <div class="cellA">A</div> <div class="cellB">B</div> <div class="cellC">C</div> </div> </div> <br/> <div class="test">ul / li <ul class="ulli"> <li class="cellA">A</li> <li class="cellB">B</li> <li class="cellC">C</li> </ul> </div> <br/> <div class="test"> display:inline <div class="hboxfloat"> <div class="cellA">A</div> <div class="cellB">B</div> <div class="cellC">C</div> </div> </div> </body> </html>

    Read the article

  • logger chain in python

    - by Zaar Hai
    I'm writing python package/module and would like the logging messages mention what module/class/function they come from. I.e. if I run this code: import mymodule.utils.worker as worker w = worker.Worker() w.run() I'd like to logging messages looks like this: 2010-06-07 15:15:29 INFO mymodule.utils.worker.Worker.run <pid/threadid>: Hello from worker How can I accomplish this? Thanks.

    Read the article

  • Boost Binary Endian parser not working?

    - by Hai
    I am studying how to use boost spirit Qi binary endian parser. I write a small test parser program according to here and basics examples, but it doesn't work proper. It gave me the msg:"Error:no match". Here is my code. #include "boost/spirit/include/qi.hpp" #include "boost/spirit/include/phoenix_core.hpp" #include "boost/spirit/include/phoenix_operator.hpp" #include "boost/spirit/include/qi_binary.hpp" // parsing binary data in various endianness template '<'typename P, typename T void binary_parser( char const* input, P const& endian_word_type, T& voxel, bool full_match = true) { using boost::spirit::qi::parse; char const* f(input); char const* l(f + strlen(f)); bool result1 = parse(f,l,endian_word_type,voxel); bool result2 =((!full_match) || (f ==l)); if ( result1 && result2) { //doing nothing, parsing data is pass to voxel alreay } else { std::cerr << "Error: not match!!" << std::endl; exit(1); } } typedef boost::uint16_t bs_int16; typedef boost::uint32_t bs_int32; int main ( int argc, char *argv[] ) { namespace qi = boost::spirit::qi; namespace ascii = boost::spirit::ascii; using qi::big_word; using qi::big_dword; boost::uint32_t ui; float uf; binary_parser("\x01\x02\x03\x04",big_word,ui); assert(ui=0x01020304); binary_parser("\x01\x02\x03\x04",big_word,uf); assert(uf=0x01020304); return 0; }' I almost copy the example, but why this binary parser doesn't work. I use Mac OS 10.5.8 and gcc 4.01 compiler.

    Read the article

  • Android Bitmap.createBitmap returns negative mHeight

    - by Hai Bi
    Modifying the Snake example. An exception was created from the bitmap class. So I debug the original Snake, and found that in TileView there is a function loadTile, Bitmap bitmap = Bitmap.createBitmap(mTileSize, mTileSize, Bitmap.Config.ARGB_8888); after the above assignment, the bitmap had -1 for mHeight and mWidth. Then how does the Snake even work? I am just use the Eclipse and the virtual machine, not a real android phone.

    Read the article

  • FragmentActivity doesn't see activity in onActivityCreate(), after screen orientation changed

    - by hai bison
    I'm using Android support library v13. There is a strange thing I couldn't understand. When creating new activity, I load fragment as: Main activity layout: ... <FrameLayout android:id="@+id/fragment_1" ... /> In onCreate() of main activity: mFragment = (FragmentActivity) getSupportFragmentManager().findFragmentById(R.id.fragment_1); // if screen orientation changed, no need to create new instance of fragment if (mFragment == null) { mFragment = ...; // create new instance of fragment FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fragment_1, mFragment); // because this is called ONCE, we can use this method ft.commitAllowingStateLoss(); } Now, everything works perfectly in emulators 1.5, 1.6 and 2.2. I have a phone 2.2.2. But there is an exception: if the app is running, and screen orientation changed. Inside onActivityCreated(), getActivity() sometimes returns null. This only happens in emulators 1.5/ 1.6/ 2.2. My phone 2.2.2 works very well, I test hundreds of times but never catch that bug. Even other emulators 3.x, 4.x work well too. Unfortunately I don't have phone 1.5/ 1.6/ 2.2. So did you have experience with this? Is that a bug of the support library, or emulators? Could you please help me? Thank you in advance.

    Read the article

  • nginx - how do I get rewrite directives to execute before index directives?

    - by Daniel Hai
    I'm trying a simple internal rewrite with nginx to navigate to a sub-directory depending on the user_agent -- mobile browsers go to /mobile, otherwise they go to /www however it seems that when I rewrite these urls, the index directive is processed before the rewrites, so I end up getting 403 forbidden. # TEST FOR INDEX index index.php # TEST PHONES if ($http_user_agent ~* '(iPhone|iPod)') { rewrite ^(.*)$ /mobile$1 break; } # OTHERWISE WE ARE DONE rewrite ^(.*)$ /www$1 break; when I turn off the re-writes and hit the hostname (http://www.somehost.com/) the index is displayed correctly. When they are on, I have to explicitly navigate to somehost.com/index.php to get the script to run ... Do I have to explicity test for directories, and then re-write to an index.php file, or is there a simpler solution?

    Read the article

  • Batch file script for Enable & disable the "use automatic Configuration Script"

    - by Tijo Joy
    My intention is to create a .bat file that toggles the check box of "use automatic Configuration Script" in Internet Settings. The following is my script @echo OFF setlocal ENABLEEXTENSIONS set KEY_NAME="HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" set VALUE_NAME=AutoConfigURL FOR /F "usebackq skip=1 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO ( set ValueName=%%A set ValueType=%%B set ValueValue=%%C ) @echo Value Name = %ValueName% @echo Value Type = %ValueType% @echo Value Value = %ValueValue% IF NOT %ValueValue%==yyyy ( reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d "yyyy" /f echo Proxy Enabled ) else ( echo Hai reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d "" /f echo Proxy Disabled ) The output i'm getting for the Proxy Enabled part is Value Name = AutoConfigURL Value Type = REG_SZ **Value Value =yyyy** Hai The operation completed successfully. Proxy Disabled But the Proxy Enable part isn't working fine the output i get is : Value Name = AutoConfigURL Value Type = REG_SZ **Value Value =** ( was unexpected at this time. The variable "Value Value" is not getting set when we try to do the Proxy enable

    Read the article

  • Excel Macro to concatenate

    - by Harish
    Need help in creating an Excel Macro.I have an Excel sheet.The Excel sheet is not consistent. I am planning to make it uniform and structured. Eg. A B C D 1 test tester tester 2 hai test 3 Bye test tested 4 GN test tested Fine A B C D 1 test testertester 2 hai test 3 Bye testtested 4 GN testtestedFine Basically I have to find the last cell where element is placed so based on that I can write my CONCATENATE funciton. In this case it would be Column D and hence my concatenate function would have been =CONCATENATE(B1,C1,D1) Again I would like the result to be in B1 but not a problem if I have to hide. Can anyone help me in doing this?

    Read the article

  • .NET Single Line Logging (ala Trace.Write/WriteLine) using Instrumentation.Logging

    - by KnownColor
    Hello Everyone, My question is whether it is possible to get line/multiline (very unsure of correct term for this) behaviour of the Trace.Write and Trace.WriteLine methods but using the Microsoft Instrumentation Logging framework in .NET 2.0. Desired Output Hello World! Oh Hai. What I Currently Have Trace.Write("Hello "); Trace.WriteLine("World!"); Trace.Write("Oh Hai."); I would prefer to use instrumentation to log rather than writing to a log file using Debug.Trace. EDIT: By Instrumentation Logging I mean using a 'loggingConfiguration' block in my App.config and writing Log Entries using using Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(LogEntry logEntry); Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0 for example. Ta, KnownColor

    Read the article

  • ExpressionEngine 2 module "tag cannot be processed"

    - by Phil Sturgeon
    So I have turned my hand to ExpressionEngine and while the backend crud was easy enough getting the frontend working with template syntax is proving difficult, even at the "hello world" level. expressionengine/third_party/rest/mod.rest.php class Rest { var $return_data = ''; function Rest() { $this->EE =& get_instance(); return $this->return_data = 'HAI'; } } // END REST Class /* End of file REST.php */ /* Location: ./application/libraries/REST.php */ Then im calling it directly in a new empty template: {exp:rest} So I'm expecting to see "HAI" but I get: Error The following tag cannot be processed: {exp:rest} Please check that the ‘rest’ module is installed and that ‘rest’ is an available method of the module Any ideas? The module is installed and the backend is running fine.

    Read the article

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