Search Results

Search found 139 results on 6 pages for 'yan zhou'.

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

  • How can I link glibc statically with qt

    - by yan bellavance
    I have built a static version of qt and download a static version of glibc. Now I would like to link glibc statically to my qt application. I know about going into the .pro and adding the line LIBS += -L path/to/static_lib but I am wondering if these that is enough? Will it still link glibc statically even though the OS I am building on has the dynamic libraries also? The reason I am doing this is to deploy the application in a standalone manner. (After installing and updating Red Hat 5.3 glibc_2.9 was not found on the target computer)

    Read the article

  • what is the oldest glib version that a qt application can run with

    - by yan bellavance
    I am trying to build a standalone qt application (built on ubuntu and deployed on Red Hat 5.3, both 64 bits) after building a qt application that is statically linked to the qt library I tried to run the program on red hat and got an error saying libc.so.6 was not found and that GLIBC_2.9 or GLIBC_2.10 is not installed and needed. I tried doing a yum install glibc but then I get a message saying that glibc is up to date (its version is 2.0) I guees I am going to restart the build process but this time from a red hat installation. What do you sugges I should do in this case. My goal is to build a standalone qt application that only needs to run on red hat 5 (im pretty sure there is also going to be an issue with fontconfig.so but I can simply provide this library directly in the same directory as the app)

    Read the article

  • Use auto_ptr in VC6 dll cause crash

    - by Yan Cheng CHEOK
    // dll #include <memory> __declspec(dllexport) std::auto_ptr<int> get(); __declspec(dllexport) std::auto_ptr<int> get() { return std::auto_ptr<int>(new int()); } // exe #include <iostream> #include <memory> __declspec(dllimport) std::auto_ptr<int> get(); int main() { { std::auto_ptr<int> x = get(); } std::cout << "done\n"; getchar(); } The following code run perfectly OK under VC9. However, under VC6, I will experience an immediate crash with the following message. Debug Assertion Failed! Program: C:\Projects\use_dynamic_link\Debug\use_dynamic_link.exe File: dbgheap.c Line: 1044 Expression: _CrtIsValidHeapPointer(pUserData) Is it exporting auto_ptr under VC6 is not allowed? It is a known problem that exporting STL collection classes through DLL. http://stackoverflow.com/questions/2451714/access-violation-when-accessing-an-stl-object-through-a-pointer-or-reference-in-a However, I Google around and do not see anything mention for std::auto_ptr. Any workaround?

    Read the article

  • Multiple Tables or Multiple Schema

    - by Yan Cheng CHEOK
    http://stackoverflow.com/questions/1152405/postgresql-is-better-using-multiple-databases-with-1-schema-each-or-1-database I am new in schema concept for PostgreSQL. For the above mentioned scenario, I was wondering Why don't we use a single database (with default schema named public) Why don't we have a single table, to store multiple users row? Other tables which hold users related information, with foreign key point to the user table. Can anyone provide me a real case scenario, which single database, multiple schema will be extremely useful, and can't solve by conventional single database, single schema.

    Read the article

  • jquery serial format

    - by Yan
    I have a website that prompt the users to enter serial number for a product. I have one text box the user need to enter the serial in this format: xx:xx:xx:xx:xx:xx there is any compment that will enter the : after every to chars ? or mybee i should split the text box to 6 text boxes ? or there anything else that you can suggest?

    Read the article

  • QPainter declared inside a run function creates artifact.

    - by yan bellavance
    I am rendering a QPixmap inside of a QThread. the code to paint is inside a function. If I declare the painter inside the drawChart function everything seems ok but if I declare the painter inside the run function the image is wrong in the sense that at the edge of a black and white area, the pixels at the interface are overlapped to give a grey. Does anyone know why this is so? Could it be because of the nature of the run function itself? //This is ok void RenderThread::run() { QImage image(resultSize, QImage::Format_RGB32); drawChart(&image); emit renderedImage(image, scaleFactor); } drawChart(&image){ QPainter painter(image); painter.doStuff()(; ... } //This gives a image that seems to have artifacts void RenderThread::run() { QImage image(resultSize, QImage::Format_RGB32); QPainter painter(image); drawChart(painter); emit renderedImage(image, scaleFactor); } drawChart(&painter){ painter.doStuff()(; ... }

    Read the article

  • How can I update fontconfig to a newer version in Red Hat 5.3?

    - by yan bellavance
    I want to update fontconfig to a newer version but it seems that the OS is still finding the old fontconfig and I need the newer version to build qt. How do I make Red Hat 5.3 see the newer version? I do not know if this helps but when I did a search for fontconfig I found some files in a folder called cache. When I do yum update it tells me everything is up to date but that version is too old and is missing FcFreeTypeQueryFace. Just send me a comment if this is wrong site and ill change it.

    Read the article

  • Changing the color of a QTextBlock that is within a QTextDocument

    - by yan bellavance
    Is there any other way to change the QTextLayout of a QTextBlock that is within a QTextDocument without having to subclass QAbstractTextDocumentLayout and call its documentChanged? I know that on a call to QTextBlock::layout() const ; the returned QTextLayout object can only be modified from the documentChanged implementation of a QAbstractTextDocumentLayout subclass but I was wodering if there was any other way before I implemented it.

    Read the article

  • SWFLoader - "SWF all over the place"

    - by Yan
    I need to load in an swf component but I want it to be an exact width and height, problem is that when I set width and height it doesn't matter, content of that swf still goes out of predefined bounds. How can I tell it not to do so, so it will work exactly as in html document embed?

    Read the article

  • Help to Install Eclipse for A Netbeans Users

    - by Yan Cheng CHEOK
    I had been using Netbeans all the while to develop Swing application. So far, I am a Happy Netbeans User Currently, I had a project (GWT, J2EE and Swing), which I need to use Eclipse (Please do not ask Why) Here is the step I had been taken. Download Eclipse IDE for Java EE Developers (190 MB) from http://www.eclipse.org/downloads/ I thought this should be the correct choice, as I see most features are found in that edition http://www.eclipse.org/downloads/packages/compare-packages After struggling a while to get use to the user interface of Eclipse, I still cannot find a Visual GUI Editor! After doing some Googling, I realize I need to install something called Plugins However, tones of plugins which had similar features has confused me, as I found http://www.cloudgarden.com/jigloo/index.html http://www.eclipse.org/vep/WebContent/main.php http://code.google.com/p/visualswing4eclipse/ This makes me even more confuse? Which plugin I should use to develop a Swing based application? Most of them seems not up-to-dated. Or, is there any complete bundle I can download, where 1 click, will install all the necessary Swing development tools for me? I just miss my Netbeans :( I really appreciate their team, who make the installation work so easy. One click button install, all the necessary tools just come to me

    Read the article

  • Google liked drop down menu

    - by Yan Cheng CHEOK
    Hello, whenever we go to Google Page and click on the "more", a menu will be dropped down. I would like to have the following effect on my web site too. May I know which JavaScript library can help me to achieve the similar effect?

    Read the article

  • optimizing widget painting.

    - by yan bellavance
    I am painting a widget and I want to optimize the process. Basically i will be sliding the image in the x direction and I only want to fill the newly exposed area. Is there a way to translate the pixels of a widget without calling update or using paintevent? I know of pixmaps and such but I am wondering If I can for example draw a pixmap once and then translate what I have drawn without having to paint anything else or draw pixmaps anymore.

    Read the article

  • char array to LPCTSTR

    - by Yan Cheng CHEOK
    May I know how I can perform the following conversion? // el.strCap is char[50] // InsertItem is expecting TCHAR pointer (LPCTSTR) // How I can perform conversion? // I do not have access in both "list" and "el" source code // Hence, there is no way for me to modify their signature. list.InsertItem(i, el.strCap); And No. I do not want to use WideCharToMultiByte They are too cumbersome to be used.

    Read the article

  • Best Pratice to Implement Secure Remember Me

    - by Yan Cheng CHEOK
    Sometimes, I came across certain web development framework which doesn't provide authentication feature as in Authenication ASP.NET I was wondering what is the security measure needs to be considered, when implementing "Remember Me" login feature, by hand coding? Here are the things I usually did. 1) Store the user name in cookie. The user name are not encrypted. 2) Store a secret key in cookie. The secret key is generated using one way function based on user name. The server will verify secret key against user name, to ensure this user name is not being changed. 3) Use HttpOnly in cookie. http://www.codinghorror.com/blog/2008/08/protecting-your-cookies-httponly.html Any things else I could miss out, which could possible lead a security hole.

    Read the article

  • Case Insensitive Ternary Search Tree

    - by Yan Cheng CHEOK
    I had been using Ternary Search Tree for a while, as the data structure to implement a auto complete drop down combo box. Which means, when user type "fo", the drop down combo box will display foo food football The problem is, my current used of Ternary Search Tree is case sensitive. My implementation is as follow. It had been used by real world for around 1++ yeas. Hence, I consider it as quite reliable. My Ternary Search Tree code However, I am looking for a case insensitive Ternary Search Tree, which means, when I type "fo", the drop down combo box will show me foO Food fooTBall Here are some key interface for TST, where I hope the new case insentive TST may have similar interface too. /** * Stores value in the TernarySearchTree. The value may be retrieved using key. * @param key A string that indexes the object to be stored. * @param value The object to be stored in the tree. */ public void put(String key, E value) { getOrCreateNode(key).data = value; } /** * Retrieve the object indexed by key. * @param key A String index. * @return Object The object retrieved from the TernarySearchTree. */ public E get(String key) { TSTNode<E> node = getNode(key); if(node==null) return null; return node.data; } An example of usage is as follow. TSTSearchEngine is using TernarySearchTree as the core backbone. Example usage of Ternary Search Tree // There is stock named microsoft and MICROChip inside stocks ArrayList. TSTSearchEngine<Stock> engine = TSTSearchEngine<Stock>(stocks); // I wish it would return microsoft and MICROCHIP. Currently, it just return microsoft. List<Stock> results = engine.searchAll("micro");

    Read the article

  • Handling Google clientLogin Captcha Example

    - by Yan Cheng CHEOK
    I have a desktop application. I try to perform authentication using http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html However, whenever I get a Captcha challenge, I use a HTTP GET request (I test using web browser) to get the image to present to user. https://www.google.com/accounts/Captcha?ctoken=Y-DrsDJRiWNOP3gR7fq0PAq4Yxvi3UXewu7P7jgAKjk0eZKQ358nbh27-JZ3-nlzXvfKOD3JvZNXwmlRunyz8jPKzqmkOLw2LYb3ZWjg-tE%3A0gMUFttsSH7QwganSJd1aw However, I always get the images : Sorry, we are unable to handle your request at this time. Please try again later. Any idea what I had did wrong? Thanks!

    Read the article

  • Prevent Cross-site request forgery - Never Rely on The SessionID Sent to Your Server in The Cookie H

    - by Yan Cheng CHEOK
    I am reading the tutorial at http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ It states Remember - you must never rely on the sessionID sent to your server in the cookie header ; look only at the sessionID that your GWT app sends explicitly in the payload of messages to your server. Is it use to prevent http://en.wikipedia.org/wiki/Cross-site_request_forgery#Example_and_characteristics With this mythology, is it sufficient enough to prevent to above attack?

    Read the article

  • Make Map Key Sorted According To Insert Sequence

    - by Yan Cheng CHEOK
    Without help from additional container (like vector), is it possible that I can make map's key sorted same sequence as insertion sequence? #include <map> #include <iostream> using namespace std; int main() { map<const char*, int> m; m["c"] = 2; m["b"] = 2; m["a"] = 2; m["d"] = 2; for (map<const char*, int>::iterator begin = m.begin(); begin != m.end(); begin++) { // How can I get the loop sequence same as my insert sequence. // c, b, a, d std::cout << begin->first << std::endl; } getchar(); }

    Read the article

  • Combination of JFreeChart with JXLayer with JHotDraw

    - by Yan Cheng CHEOK
    Recently, I had use JXLayer, to overlay two moving yellow message boxes, on the top of JFreeChart http://yccheok.blogspot.com/2010/02/investment-flow-chart.html I was wondering, had anyone experience using JXLayer + JHotdraw, to overlay all sorts of figures (Re-sizable text box, straight line, circle...), on the top of JFreeChart. I just would like to add drawing capability, without changing the JFreeChart source code. So that, JStock's user may draw trending lines, annotation text on their favorite stock charting. The code skeleton is as follow : // this.chartPanel is JFreeChartPanel final org.jdesktop.jxlayer.JXLayer<ChartPanel> layer = new org.jdesktop.jxlayer.JXLayer<ChartPanel>(this.chartPanel); this.myUI = new MyUI<ChartPanel>(this); layer.setUI(this.myUI); public class MyUI<V extends javax.swing.JComponent> extends AbstractLayerUI<V> { @Override protected void paintLayer(Graphics2D g2, JXLayer<? extends V> layer) { // Previous, I am using my own hand-coded, to draw the yellow box // // Now, How can I make use of JHotDraw at here, to draw various type of // figures? } @Override protected void processMouseEvent(MouseEvent e, JXLayer<? extends V> layer) { // How can I make use of JHotDraw at here? } @Override protected void processMouseMotionEvent(MouseEvent e, JXLayer<? extends V> layer) { // How can I make use of JHotDraw at here? } } As you see, I already got Graphics2D g2 from paintLayer method. How is it possible that I can pass the Graphics2D object to JHotDraw, and let JHotDraw handles all the drawing. My experience in using JHotDraw are with org.jhotdraw.draw.DefaultDrawingView org.jhotdraw.draw.DefaultDrawingEditor I am able to use them to draw various figures, by clicking on the toolbar and click on drawing area. How is it possible I can use DefaultDrawingView and DefaultDrawingEditor within MyUI's paintLayer? Also, shall I let MyUI handles the mouse event, or JHotDraw? Sorry, I start getting confused.

    Read the article

  • Sort CMap Key by String Length

    - by Yan Cheng CHEOK
    Previously, I am using STL map to perform the mentioned task. struct ltstr { bool operator()(std::string s1, std::string s2) const { const int l1 = s1.length(); const int l2 = s2.length(); if (l1 == l2) { // In alphabetical order. return s1.compare(s2) < 0; } // From longest length to shortest length. return l1 > l2; } }; std::map<std::string, int, ltstr> m; How can I perform the same task using CMap? // How to make key sorted by string length? CMap<CString, LPCTSTR, int, int> m;

    Read the article

  • Convert CString to string (VC6)

    - by Yan Cheng CHEOK
    I want to convert CString to string. (Yup. I know what am I doing. I know the returned string will be incorrect, if CString value range is outside ANSI, but That's Is OK!) The following code will work under VC2008. std::string Utils::CString2String(const CString& cString) { // Convert a TCHAR string to a LPCSTR CT2CA pszConvertedAnsiString (cString); // construct a std::string using the LPCSTR input std::string strStd (pszConvertedAnsiString); return strStd; } But VC6 doesn't have CT2CA macro. How I can make the code to work as well in both VC6 and VC2008?

    Read the article

  • Is it possible to prevent out-of-order execution by using single volatile

    - by Yan Cheng CHEOK
    By referring article, it is using a pair of volatile to prevent out-of-order execution. I was wondering, is it possible to prevent it using single volatile? void fun_by_thread_1() { this.isNuclearFactory = true; this.factory = new NuclearFactory(); } void fun_by_thread_2() { Factory _factory = this.factory; if (this.isNuclearFactory) { // Do not operate nuclear factory!!! return; } // If out-of-order execution happens, _factory might // be NuclearFactory instance. _factory.operate(); } Factory factory = new FoodFactory(); volatile boolean isNuclearFactory = false; The reason I ask, is because I have a single guard flag (similar to isNuclearFactory flag), to guard against multiple variables (similar to many Factory). I do not wish to mark all the Factory as volatile. Or, shall I fall into the following solution? void fun_by_thread_1() { try { writer.lock(); this.isNuclearFactory = true; this.factory = new NuclearFactory(); } finally { writer.unlock(); } } void fun_by_thread_2() { try { reader.lock(); Factory _factory = this.factory; if (this.isNuclearFactory) { // Do not operate nuclear factory!!! return; } } finally { reader.unlock(); } _factory.operate(); } Factory factory = new FoodFactory(); boolean isNuclearFactory = false; P/S: I know instanceof. Factory is just an example to demonstrate of out-of-order problem.

    Read the article

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