Daily Archives

Articles indexed Friday May 14 2010

Page 22/116 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • C++ map performance - Linux (30 sec) vs Windows (30 mins) !!!

    - by sonofdelphi
    I need to process a list of files. The processing action should not be repeated for the same file. The code I am using for this is - using namespace std; vector<File*> gInputFileList; //Can contain duplicates, File has member sFilename map<string, File*> gProcessedFileList; //Using map to avoid linear search costs void processFile(File* pFile) { File* pProcessedFile = gProcessedFileList[pFile->sFilename]; if(pProcessedFile != NULL) return; //Already processed foo(pFile); //foo() is the action to do for each file gProcessedFileList[pFile->sFilename] = pFile; } void main() { size_t n= gInputFileList.size(); //Using array syntax (iterator syntax also gives identical performance) for(size_t i=0; i<n; i++){ processFile(gInputFileList[i]); } } The code works correctly, but... My problem is that when the input size is 1000, it takes 30 minutes - HALF AN HOUR - on Windows/Visual Studio 2008 Express (both Debug and Release builds). For the same input, it takes only 40 seconds to run on Linux/gcc! What could be the problem? The action foo() takes only a very short time to execute, when used separately. Should I be using something like vector::reserve for the map?

    Read the article

  • Multiple inclusion of header file c++

    - by iSight
    Hi, I have a problem regarding multiple inclusion of header file in C++ code. say for example, i have three class X,Y,Z. X and Y are derived from Base class Z. And i want to create an instance of X in Y. The code will go like this. class Z{some code} class X:public Z{some code};//here #include header of class Z added class Y:public Z //here #include header of class Z added as well as of X class {private: X* mX;//instance of X some code}; So in this multiple definition of all methods of base class arises. how can i cope with this problem

    Read the article

  • Microsoft.Practices.ObjectBuilder

    - by nishant
    I have installed the application on the client's server. Here's the issue though.. The client's server is running on medium trust. With medium trust godaddy does not give persmissions to certain files. If you go to the following URL : http://helpingyougethired.com/Introduction.aspx you will see the error : Could not load file or assembly 'Microsoft.Practices.ObjectBuilder. If I delete the "Microsoft.Practices.ObjectBuilder.dll" and "Microsoft.Practices.ObjectBuilder.xml", the pages load. But when I try to save the form, I get some error related to this dll. So I need to find an alternative for this dll. I cannot use this DLL. my save, delete, select process is depend on this dll plz provide any solution if u have. thanks in advance

    Read the article

  • Problems with multiple setIntervals running simultaniously

    - by Roel V.
    Hello, My first post here. I want to make a horizontal menu with submenu's sliding down on mouseover. I know I could use jQuery but this is to practice my javascript skills. I use the following code: var up = new Array() var down = new Array() var submenustart function titleover(headmenu, inter) { submenu = headmenu.lastChild up[inter] = window.clearInterval(up[inter]) down[inter] = window.setInterval("slidedown(submenu)",1) } function slidedown(submenu) { if(submenu.offsetTop < submenustart) { submenu.style.top = submenu.offsetTop + 1 + "px" } } function titleout(headmenu, inter) { submenu = headmenu.lastChild down[inter] = window.clearInterval(down[inter]) up[inter] = window.setInterval("slideup(submenu)", 1) } function slideup(submenu) { if(submenu.offsetTop > submenustart - submenu.clientHeight + 1) { submenu.style.top = submenu.offsetTop - 1 + "px" } } The variable submenustart gets appointed a value in another function which is not relevant for my question. HTML looks like this: <table class="hoofding" id="hoofding"> <tr> <td onmouseover="titleover(this, 0)" onmouseout="titleout(this, 0)"><a href="#" class="hoofdinglink" id="hoofd1">AAAA</a> <table class="menu"> <tr><td><a href="...">1111</a></td></tr> <tr><td><a href="...">2222</a></td></tr> <tr><td><a href="...">3333</a></td></tr> </table></td> <td onmouseover="titleover(this, 1)" onmouseout="titleout(this, 1)"><a href="#" class="hoofdinglink">BBBB</a> <table class="menu"> <tr><td><a href="...">1111</a></td></tr> <tr><td><a href="...">2222</a></td></tr> <tr><td><a href="...">3333</a></td></tr> <tr><td><a href="...">4444</a></td></tr> <tr><td><a href="...">5555</a></td></tr> </table></td> ... </tr> </table> What happens is the following: If I go over and out (for ex) menu A it works fine. If i go now over menu B the interval applied to A is now applied to B. There are now 2 interval functions applied to B. The one originally for A and a new one triggered by the mouseover on B. If I would go to A all the intervals are now applied to A. I have been searching for hours but and I am completely stuck. Thanks in advance.

    Read the article

  • iphone Rendering 3-D Object rendering

    - by Yoon Lee
    Hello, I'm a beginner 3-D Quartz thing but knows how to create application. I was looking over sample of GLGravity Source code given by apple today, I was wondering teapot.h file contains all contents of array file such as indices, vertices. Do you guys think this code has been provided by human or, program? if it so, any auto generate program exist written in c based? (cause teapot.h seemed to me obvious native c code) thanks.

    Read the article

  • Search Oracle date type column with hibernate, seach by everything in that day - ignore the time.

    - by Setori
    hi there <property name="batchCreatedDate" type="java.util.Date"> <meta attribute="field-description">batch create date</meta> <column name="BATCH_CREATED_DATE" length="7" not-null="true" /> </property> table column type is BATCH_CREATED_DATE DATE NOT NULL With the data in that date column being similar to this '2010-05-13 14:56:36.0' now I want to search for all items within the 24 hours of 2010-05-13, currently my call only returns all items with date "2010-05-13 14:56:36.0" exactly. What would my HQL statement look like to hand this kind of scenario? Thank you so much

    Read the article

  • can anyone please suggest some simple and short js for vertical multiple text scroll???

    - by developer
    I have a js running in my site that is for text scrolling.What is does is that it scrolls a text vertically upwards then holds for a second or two and then shows next text.Here you can have an idea of what i need and im using http://www.dynamicdrive.com/dynamicindex2/crosstick.htm What i need now is a simple and shorter dynamic js for this scrolling,somewhat around 2 kb or so......i have looked around internet but couldnt find one........please suggest some!!!

    Read the article

  • Closing a Dialog Box, Opening a New One and it is Grayed out (Colorbox)

    - by Scott Faisal
    $.fn.colorbox({width:"40%", inline:true,href:"#somediv", opacity:"0.50",transition:"none", height:"490px"}); On #somediv above I have a button that once clicked executes the following code: line#45 $.fn.colorbox({href:"http://www.facebook.com", width:"65%",height:"80%",iframe:true}); I see facebook.com however the overlay is grayed out. I even tried using the following code instead of line#45 : $(document).one('cbox_closed', function(){ setTimeout(function(){ $.fn.colorbox({href:"http://www.facebook.com", width:"65%",height:"80%", iframe:true});},2); }); Now all I see is a blank overlay. Any suggestion guys?

    Read the article

  • can i changed for loop index variable inside the loop in Matlab???

    - by shawana
    hi every one. i need to change my loop variable inside the iterationa as ihave to acces array elements in the loop which is changing w.r.t size inside the loop. ashort piece of code is that: que=[]; que=[2,3,4]; global len; len=size(que,2) x=4; for i=1:len if x<=10 que(x)= 5; len=size(que,2) x=x+1; end end que array should print like: 2 3 4 5 5 5 5 5 5 5 but it is printed in such a way: 2 3 4 5 5 5. how shuould it be accomplished in matlab? in visual c++ it happen correctly and print whole array of 10 elements which increases at run time plz reply me if have any ideaabout this as i m new into matlab

    Read the article

  • Best practices for an internal webservice

    - by sankara
    Experience says that using WSDL-SOAP based webservice for internal consumption is an overkill. There are too many service-based POJO classes that when let into the system complicates it way too much. One option would be use adapter pattern, map the request/response objects to internal domain classes and . But is it even required? Is there a better approach? What are your suggestions?

    Read the article

  • iCalcreator 2.6 event creation sent in an email w/o attachment

    - by Jonas
    G'day everyone, I am currently trying to send meeting invitations to Outlook recipients. After reading several blogs and various literature iCalcreator seems to be the most complete iCalendar PHP class available. And the documentation is just...crazily complete. If creating a iCal .ics file is OK, I can't find a nice way to send it by email to the attendees without having them to double click on an attachment. Just like Google Calendar and Outlook do, I would like to send emails that will automatically show the buttons Accept | Tentative | Decline upon reception without any other user action involved. If anyone ever had to realize that, I would be more than happy to get your feedback/help or even just relevant guidance. Thanks

    Read the article

  • What would a new web development tool need to succeed?

    - by boost
    If one wanted to bring a new web development tool to market, what would it have to be able to do that would differentiate it enough from all the others to attract people's attention? In what areas are all the other frameworks and languages falling down, such that if a new product addressed those issues, it would stand a chance of being adopted by significant user community?

    Read the article

  • ?????????IT???????5?13~14?

    - by kiyoshi.nira
    ???????????) (=???????) ???????? 10? IT EXPO ?????????? · ?????????????? · ????????????????2009??11?3??????????????? ???IT??????????????? · ???????????? ?????·?????? ???????????? · ?????????????????????????????????? ?5? RFID???????EXP ?19? ??????????? ?15? ?????????&CRM EXPO ?13? ???????????? ?12? ????????EXPO ?7? ????????EXPO ?4? ????? ???????EXPO ?4? Web&???? ??????? EXPO ?2? ????IT EXPO ?1? ???? ?????????EXPO ??????

    Read the article

  • How can i Rollback for files/folders corresponding to the changes done?

    - by OM The Eternity
    I am using PHP and Mysql I have PHP script in which I rollback all the data in the database such data all the old value be reset to the database if update is done, and all new value gets deleted if new insert has been done. Now my goal is to perform the same process with files/folders associated with the changes done, I am not able to create an idea for doing the rollback job with the files/folders associated with the Changes.. So can anyone of u help me or direct me to get the best idea?????

    Read the article

  • NamespaceContext and using namespaces with XPath

    - by Jherico
    Resolving an xpath that includes namepsaces in Java appears to require the use of a NamespaceContext object, mapping prefixes to namespace urls and vice versa. But I can find no mechanism for getting a NamespaceContext other than implementing it myself. This seems counter-intuitive. Is there any easy way to acquire a NamespaceContext from a document, or to create one, or failing that, to forgo prefixes altogether and specify the xpath with fully qualified names?

    Read the article

  • Using client time to calculate timezone

    - by Mike TK
    Hi Folks, Instead of asking a client timezone in registration form (to correctly format datetime, all server dates in UTC) I thought about fetching a time from client computer and calculating time offset between client and server. Anyone tried this? How often clients have something insane on their system clocks? Cheers!

    Read the article

  • KeybListener problem

    - by rgksugan
    In my apllication i am using a jpanel in which i want to add a key listener. I did it. But it doesnot work. Is it because i am using a swingworker to update the contents of the panel every second. Here is my code to update the panel RenderedImage image = ImageIO.read(new ByteArrayInputStream((byte[]) get())); Graphics graphics = remote.rdpanel.getGraphics(); if (graphics != null) { Image readyImage = new ImageIcon(UtilityFunctions.convertRenderedImage(image)).getImage(); graphics.drawImage(readyImage, 0, 0, remote.rdpanel.getWidth(), remote.rdpanel.getHeight(), null); }

    Read the article

  • how to call operator () in c++

    - by anish
    in c++ i have following code class Foobar{ public: Foobar * operator()(){ return new Foobar; } My quesion is how to call the (); if i do Foobar foo() the constructor gets called i am confused about behaviour of () can some explain me

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >