Search Results

Search found 2521 results on 101 pages for 'alex yan'.

Page 12/101 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Is there any need for me to use wstring in the following case

    - by Yan Cheng CHEOK
    Currently, I am developing an app for a China customer. China customer are mostly switch to GB2312 language in their OS encoding. I need to write a text file, which will be encoded using GB2312. I use std::ofstream file I compile my application under MBCS mode, not unicode. I use the following code, to convert CString to std::string, and write it to file using ofstream std::string Utils::ToString(CString& cString) { /* Will not work correctly, if we are compiled under unicode mode. */ return (LPCTSTR)cString; } To my surprise. It just works. I thought I need to at least make use of wstring. I try to do some investigation. Here is the MBCS.txt generated. I try to print a single character named ? (its value is 0xBDC5) When I use CString to carry this character, its length is 2. When I use Utils::ToString to perform conversion to std::string, the returned string length is 2. I write to file using std::ofstream My question is : When I exam MBCS.txt using a hex editor, the value is displayed as BD (LSB) and C5 (MSB). But I am using little endian machine. Isn't hex editor should show me C5 (LSB) and BD (MSB)? I check from wikipedia. GB2312 seems doesn't specific endianness. It seems that using std::string + CString just work fine for my case. May I know in what case, the above methodology will not work? and when I should start to use wstring?

    Read the article

  • Transferring binary file from web server to client

    - by Yan Cheng CHEOK
    Usually, when I want to transfer a web server text file to client, here is what I did import cgi print "Content-Type: text/plain" print "Content-Disposition: attachment; filename=TEST.txt" print filename = "C:\\TEST.TXT" f = open(filename, 'r') for line in f: print line Works very fine for ANSI file. However, say, I have a binary file a.exe (This file is in web server secret path, and user shall not have direct access to that directory path). I wish to use the similar method to transfer. How I can do so? What content-type I should use? Using print seems to have corrupted content received at client side. What is the correct method?

    Read the article

  • SSL Not Working on other network

    - by Yan
    Hi I am running windows server 2003 standard and have installed the ssl cert for the company website . Attempting to access the website securely outside of our network the page does not load. Thanks in advance!

    Read the article

  • Is it possible to add a menu bar to a widget

    - by yan bellavance
    I would like to add a QMenuBar to a window of my program (not the QMainWindow) from QtDesigner but I do not see this widget in there and it seems the only way to do this from designer is to use a mainwindow. Would I absolutely need to create this QMenu by hand coding it. Is it possible/ok to instead add a QMainwindow that is actually declared inside my main QMainwindow?

    Read the article

  • Should I use threeten instead of joda-time

    - by Yan Cheng CHEOK
    Hello all, I came across http://www.jroller.com/scolebourne/entry/why_jsr_310_isn_t. 1) I am currently migrating Java Calendar to joda-time. I was wondering, should I use threeten instead of joda-time? Is threeten production ready? 2) Can threeten library and joda-time libraries exist together in a same application? As I am using some 3rd parties libraries, which is using joda-time library too. 3) Will joda-time become an abandon project since there is threeten? Thanks.

    Read the article

  • Get ID of a clicked parent ID

    - by Yan Cheng CHEOK
    I try using evt.parent.attr("id") inside jsddm_close, but it doesn't work. <script type="text/javascript"> var ddmenuitem = 0; function jsddm_open() { // When "help-menu" being click, I will toggle drop down menu. ddmenuitem = $(this).find('ul').eq(0).toggle(); } function jsddm_close(evt) { // When everywhere in the document except "help-menu" being clicked, I will close the drop down menu. // How I can check everywhere in the document except "help-menu"? if (ddmenuitem) ddmenuitem.hide(); } $(document).ready(function() { $('#jsddm > li').bind('click', jsddm_open); $(this).bind('click', jsddm_close); }); </script> <ul id="jsddm"> <li><a href="#">Home</a></li> <li><a href="#" id="help-menu"><u>Help</u><small>xx</small></a> <ul> <li><a href="#">menu item 1</a></li> <li><a href="#">menu item 2</a></li> </ul> </li> </ul>

    Read the article

  • Any side effect of not using USES_CONVERSION

    - by Yan Cheng CHEOK
    Recently, I have a utilities function of // T2CA #include "ATLCONV.H" std::string Utils::CString2String(const CString& cString) { #if _MSC_VER > 1200 // Convert a TCHAR string to a LPCSTR // construct a std::string using the LPCSTR input CT2CA tmp(cString); std::string strStd (tmp); #else // Deprecated in VC2008. // construct a std::string using the LPCSTR input std::string strStd (T2CA (cString)); #endif return strStd; } I do several simple test it seems work fine. However, when I google around, I see most usage of T2CA in VC6, before they call, they will invoke USES_CONVERSION; Is there any thing I had missed out? Shall I invoke my function by : #else // Deprecated in VC2008. // construct a std::string using the LPCSTR input USES_CONVERSION; std::string strStd (T2CA (cString)); #endif

    Read the article

  • how to access android app's certificate from inside the app?

    - by Yan
    Hi All, Im trying to access the certificate/signature from inside an android app, so that I can do something with the certificate. I googled a bit and found the code below: Class c = getClass(); ProtectionDomain pd = c.getProtectionDomain(); CodeSource cs = pd.getCodeSource(); Certificate[] signingCertificates = cs.getCertificates(); String st = signingCertificates[0].toString(); but c.getProtectionDomain() returns null. anyone can help? many thanks.

    Read the article

  • Unicode version of base64 encoding/ decoding

    - by Yan Cheng CHEOK
    I am using base64 encoding/decoding from http://www.adp-gmbh.ch/cpp/common/base64.html It works pretty well with the following code. const std::string s = "I Am A Big Fat Cat" ; std::string encoded = base64_encode(reinterpret_cast<const unsigned char*>(s.c_str()), s.length()); std::string decoded = base64_decode(encoded); std::cout << _T("encoded: ") << encoded << std::endl; std::cout << _T("decoded: ") << decoded << std::endl; However, when comes to unicode namespace std { #ifdef _UNICODE typedef wstring tstring; #else typedef string tstring; #endif } const std::tstring s = _T("I Am A Big Fat Cat"); How can I still make use of the above function? Merely changing std::string base64_encode(unsigned TCHAR const* , unsigned int len); std::tstring base64_decode(std::string const& s); will not work correctly. (I expect base64_encode to return ASCII. Hence, std::string should be used instead of std::tstring)

    Read the article

  • Can I have multiple instance of the mandlebrot example in one program?

    - by yan bellavance
    Basically what I did is I took the Mandlebrot example and have 3 instances of it in my program. So the program would look like a mainwindow that has 3 mandlebrot widgets in it, one besides the other. Is it possible that GDB doesnt support debugging multiple intances of a classe that derives from qthread or is it thread-unsafe to do so? I don't have any problems at run-time but when I put breakpoints in a function called by the QThread run() function I get a segmentation fault. I can clearly see that the function doesn't complete before returning to the breakpoint ie I the program stops at the breakpoint, I step into the lines of codes one by one but after a couple of instructions another thread startS using the function(even though they are different instances).

    Read the article

  • Permuting output of a tree of closures

    - by yan
    This a conceptual question on how one would implement the following in Lisp (assuming Common Lisp in my case, but any dialect would work). Assume you have a function that creates closures that sequentially iterate over an arbitrary collection (or otherwise return different values) of data and returns nil when exhausted, i.e. (defun make-counter (up-to) (let ((cnt 0)) (lambda () (if (< cnt up-to) (incf cnt) nil)))) CL-USER> (defvar gen (make-counter 3)) GEN CL-USER> (funcall gen) 1 CL-USER> (funcall gen) 2 CL-USER> (funcall gen) 3 CL-USER> (funcall gen) NIL CL-USER> (funcall gen) NIL Now, assume you are trying to permute a combinations of one or more of these closures. How would you implement a function that returns a new closure that subsequently creates a permutation of all closures contained within it? i.e.: (defun permute-closures (counters) ......) such that the following holds true: CL-USER> (defvar collection (permute-closures (list (make-counter 3) (make-counter 3)))) CL-USER> (funcall collection) (1 1) CL-USER> (funcall collection) (1 2) CL-USER> (funcall collection) (1 3) CL-USER> (funcall collection) (2 1) ... and so on. The way I had it designed originally was to add a 'pause' parameter to the initial counting lambda such that when iterating you can still call it and receive the old cached value if passed ":pause t", in hopes of making the permutation slightly cleaner. Also, while the example above is a simple list of two identical closures, the list can be an arbitrarily-complicated tree (which can be permuted in depth-first order, and the resulting permutation set would have the shape of the tree.). I had this implemented, but my solution wasn't very clean and am trying to poll how others would approach the problem. Thanks in advance.

    Read the article

  • How to achieve to following C++ output formatting?

    - by Yan Cheng CHEOK
    I wish to print out double as the following rules : 1) No scietific notation 2) Maximum decimal point is 3 3) No trailing 0. For example : 0.01 formated to "0.01" 2.123411 formatted to "2.123" 2.11 formatted to "2.11" 2.1 formatted to "2.1" 0 formatted to "0" By using .precision(3) and std::fixed, I can only achieve rule 1) and rule 2), but not rule 3) 0.01 formated to "0.010" 2.123411 formatted to "2.123" 2.11 formatted to "2.110" 2.1 formatted to "2.100" 0 formatted to "0" Code example is as bellow : #include <iostream> int main() { std::cout.precision(3); std::cout << std::fixed << 0.01 << std::endl; std::cout << std::fixed << 2.123411 << std::endl; std::cout << std::fixed << 2.11 << std::endl; std::cout << std::fixed << 2.1 << std::endl; std::cout << std::fixed << 0 << std::endl; getchar(); } any idea?

    Read the article

  • how to update newly exposed area of a scrolled widget

    - by yan bellavance
    I have setAttribute(Qt::WA_OpaquePaintEvent,true) on a widget. From a mouseMoveEvent, I scroll the widget. Now what I need to do is to update the newly exposed area, but it seems that doing this from the paintevent function create an artifact because there is a delay created when the user keeps scrolling. In other words, the widget seems to have scrolled again between the call to scrool and the call or end of paintevent. For example, while the paint event is trying to draw the desired area, the widget is still scrolling

    Read the article

  • In Flex 4.. how??

    - by Yan
    http://stackoverflow.com/questions/950571/how-can-i-set-window-application-as-light-weight-in-flex-still-not-get-answe There's a solution but how to do it in flex 4 using spark? Because it says it can't find "window"...

    Read the article

  • Why do I have to use the "origin" for the pull to be successfull

    - by yan bellavance
    when I do : git pull BranchName it tells me everything is up to date but I know that is not true. When I do: git pull origin BranchName then I get the files I was expecting. Is there an easy way to answer this or do I need to provide more details. PS One thing I did do just to understant themechanics of git is give the branch name in my cloned repo a different name than on the remote repo. I did however put the right name in the config file like so: [branch "myUDPspinoff"] remote = origin merge = refs/heads/UDPspinoff this worked before on another repo but not this one. And when I put everything in the same name thenI did not need to use origin anymore.

    Read the article

  • Partitioning Webcast Details - 17/03/2010

    - by Alex Blyth
    Hi AllHere are the details for Wednesday's (17th March 2010) webcast on Partitioning:Webcast is at http://strtc.oracle.com (IE6, 7 & 8 supported only)Conference ID for the webcast is 6168728There is no conference keyPlease use your real name in the name field (just makes it easier for us to help you out if we can't answer your questions on the call)Audio details:NZ Toll Free - 0800888157 orAU Toll Free - 1800420354Meeting ID: 7914841Meeting Passcode: 17032010Talk to you all WednesdayAlex

    Read the article

  • Error during update 'Unable to connect to 192.168.43.1:8000'

    - by Alex R
    When I tried to update my Ubuntu through the update manager I received an error about some unknown resource. so i tried doing it from the terminal with sudo apt-get update but all I got is: 0% [Connecting to 192.168.43.1 repeating itself... and when I press Enter it shows: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-security/universe/i18n/Translation-en Unable to connect to 192.168.43.1:8000: E: Some index files failed to download. They have been ignored, or old ones used instead. How can I get this to work?

    Read the article

  • Oracle Security Webcast - today

    - by Alex Blyth
    Hi AllHere are the details for today's (12th May 2010) webcast on "Oracle Database Security"  -  beginning at 1.30pm (Sydney, Australia Time) :Webcast is at http://strtc.oracle.com (IE6, 7 & 8 supported only)Conference ID for the webcast is 6690429Conference Key: securityEnrollment is required. Please click here to enroll.Please use your real name in the name field (just makes it easier for us to help you out if we can't answer your questions on the call)Audio details:NZ Toll Free - 0800 888 157 orAU Toll Free - 1800420354 (or +61 2 8064 0613Meeting ID: 7914841Meeting Passcode: 12052010Talk to you all at 1.30CheersAlex

    Read the article

  • Upgrade to Oracle 11g Webcast - 14/04/2010

    - by Alex Blyth
    Hi AllHere are the details for Wednesday's (14th April 2010) webcast on "Upgrading to Oracle 11g" beginning at 1.30pm (Sydney, Australia Time) :Webcast is at http://strtc.oracle.com (IE6, 7 & 8 supported only)Conference ID for the webcast is 6690662Conference Key: upgradeEnrollment is required. Please click here to enroll.Please use your real name in the name field (just makes it easier for us to help you out if we can't answer your questions on the call)Audio details:NZ Toll Free - 0800 888 157 orAU Toll Free - 1800420354 (or +61 2 8064 0613Meeting ID: 7914841Meeting Passcode: 14042010Talk to you all WednesdayAlex

    Read the article

  • Can't exec "locale": No such file or directory

    - by Alex
    I am new in Linux. I was trying to install wine and after /i followed instructions from a youtube video i got to the point where I needed to install wine from Ubuntu Software Center. The problem is the Ubuntu Software Center doesn't work anymore, it ask me to reparir it, and when I push the Repair button it gives me this error: installArchives() failed: Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16. Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17. Preconfiguring packages ... Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16. Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17. Preconfiguring packages ... Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16. Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17. Preconfiguring packages ... dpkg: warning: 'ldconfig' not found in PATH or not executable. dpkg: error: 1 expected program not found in PATH or not executable. Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin. Error in function: SystemError: E:Sub-process /usr/bin/dpkg returned an error code (2) Please help me. Thank you :D

    Read the article

  • Roadshow Microsoft – Primeira Parada: Londrina, PR

    - by anobre
    Hoje (23/03) tivemos aqui em Londrina a primeira parada do Roadshow Microsoft, com apresentação de diversos produtos com aplicação em cenários técnicos. Como já é de costume, o evento reuniu alguns dos melhores profissionais de DEV e INFRA, com informações extremamente úteis sobre .NET Framework 4, Entity Framework, Exchange, Sharepoint, entre outras tecnologias e produtos. Na minha visão, o evento conseguiu atender a expectativa dos participantes, através dos cenários técnicos criados para a ficticia Adventure Works (acho que eu conheço esta empresa… :). Através da participação ativa de todos, as tracks de DEV e INFRA tiveram o sucesso aparente no comentário do pessoal nos intervalos e almoço. Depois das palestras, lá por 19h, tivemos um jantar com o pessoal da Microsoft e influenciadores da região, onde, até as 21h, discutimos muita coisa (até Commerce Server!). Esta aproximação com o time de comunidades da Microsoft, além de alguns “penetras” como o próprio Alex disse, é extremamente importante e útil, visto que passamos conhecemos a fundo as intenções e futuras ações da Microsoft visando as comunidades locais. Para concluir, algo que sempre digo: participe de alguma comunidade técnica da sua região. Entre em contato com influenciadores, conheça os grupos de usuários perto de você e não perca tempo. Ter o conhecimento perto de você, contribuir e crescer profissionalmente não tem preço. Obrigado novamente a todo time, em especial a Fabio Hara, Rodrigo Dias, Alex Schulz, Alvaro Rezende, Murilo e Renato Haddad. Abraços. OBS.: Lembre-se: em Londrina e região, procure o Sharpcode! :) OBS. 2: Se você é de Londrina e não participou, não perca mais oportunidades. Alias, se o seu chefe não deixa você ir, se você tem que participar de sorteio para ter uma chance de ir, ou se a sua empresa nem fica sabendo de eventos como este, acho que tá na hora de você pensar em outros opções né? :)

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >