Daily Archives

Articles indexed Wednesday January 12 2011

Page 14/37 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Multithreded UI desktop application issues

    - by igor
    I am involved into development a rich UI project: desktop windows application. Application uses asynchronous invocations and in its turn it should be ready to process external messages (events). The problem is clear: at first time it was built as a simple prototype and it was not stress tested and all was fine. Then application was grown: the number of calls to server and number of events from server are high and performance is low. What is more users noticed that sometimes performance is extremal low. Asynchronous invocations based on thread pool (BeginInvoke, EndInvoke), external events are going from WCF service (.NET 3.5). My goal is synchronization of all tasks and putting priorities to every executions in desktop application. My question is: is there any practice how to reach my goal: patterns, task priority list, others? What should I do at first, second and next times? Thanks

    Read the article

  • What are the advantages and Disadvantages of Using an Aspect Orientated Programming Paradigm

    - by JHarley1
    Ok so here is the question: What are the advantages and Disadvantages of Using an Aspect Orientated Programming Paradigm. My advantages and disadvantages thus far: Advantages: Complements object orientation. Modularizes cross-cutting concerns improving code maintainability and understandability. Disadvantage: Not the easiest of concepts to grasp - not as well documented as O-O O-O goes far enough in the separation of concerns... List item Would anyone like to challenge any of these/ add their own? Many Thanks, J

    Read the article

  • Force gdm login screen to the primary monitor

    - by Kirill
    I have two monitors attached to my video card. Primary monitor has a resolution equal to 1280x1024 and the second has 1920x1200. My gdm login screen always appears on the second monitor even if it is switched off. My question is how to force gdm to show the login screen always on the primary monitor with resolution 1280x1024? I use Nvidia GT9500 videcard in Twinview mode. I can't use Xinerama because vpdau doesn't work correclty in this mode.

    Read the article

  • How to ignore certain coding standard errors in PHP CodeSniffer

    - by Tom
    We have a PHP 5 web application and we're currently evaluating PHP CodeSniffer in order to decide whether forcing code standards improves code quality without causing too much of a headache. If it seems good we will add a SVN pre-commit hook to ensure all new files committed on the dev branch are free from coding standard smells. Is there a way to configure PHP codeSniffer to ignore a particular type of error? or get it to treat a certain error as a warning instead? Here an example to demonstrate the issue: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <div> <?php echo getTabContent('Programming', 1, $numX, $numY); if (isset($msg)) { echo $msg; } ?> </div> </body> </html> And this is the output of PHP_CodeSniffer: > phpcs test.php -------------------------------------------------------------------------------- FOUND 2 ERROR(S) AND 1 WARNING(S) AFFECTING 3 LINE(S) -------------------------------------------------------------------------------- 1 | WARNING | Line exceeds 85 characters; contains 121 characters 9 | ERROR | Missing file doc comment 11 | ERROR | Line indented incorrectly; expected 0 spaces, found 4 -------------------------------------------------------------------------------- I have a issue with the "Line indented incorrectly" error. I guess it happens because I am mixing the PHP indentation with the HTML indentation. But this makes it more readable doesn't it? (taking into account that I don't have the resouces to move to a MVC framework right now). So I'd like to ignore it please.

    Read the article

  • boost::asio::io_service throws exception

    - by Ace
    Okay, I seriously cannot figure this out. I have a DLL project in MSVC that is attempting to use Asio (from Boost 1.45.0), but whenever I create my io_service, an exception is thrown. Here is what I am doing for testing purposes: void run() { boost::this_thread::sleep(boost::posix_time::seconds(5)); try { boost::asio::io_service io_service; } catch (std::exception & e) { MessageBox(NULL, e.what(), "Exception", MB_OK); } } BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { if (fdwReason == DLL_PROCESS_ATTACH) { boost::thread thread(run); } return TRUE; } This is what the message box shows: winsock: WSAStartup cannot function at this time because the underlying system it uses to provide network services is currently unavailable Here is what MSDN says about it (error code 10091, WSASYSNOTREADY): Network subsystem is unavailable. This error is returned by WSAStartup if the Windows Sockets implementation cannot function at because the underlying system it uses to provide network services is currently unavailable. Users should check: That the appropriate Windows Sockets DLL file is in the current path. That they are not trying to use more than one Windows Sockets implementation simultaneously. If there is more than one Winsock DLL on your system, be sure the first one in the path is appropriate for the network subsystem currently loaded. The Windows Sockets implementation documentation to be sure all necessary components are currently installed and configured correctly. Yet none of this seems to apply to me (or so I think). Here is my command line: /O2 /GL /D "_WIN32_WINNT=0x0501" /D "_WINDLL" /FD /EHsc /MD /Gy /Fo"Release\" /Fd"Release\vc90.pdb" /W3 /WX /nologo /c /TP /errorReport:prompt If anyone knows what might be wrong, please help me out! Thanks.

    Read the article

  • Inline instantiation of a constant List

    - by Roflcoptr
    I try to do something like this: public const List<String> METRICS = new List<String>() { SourceFile.LOC, SourceFile.MCCABE, SourceFile.NOM, SourceFile.NOA, SourceFile.FANOUT, SourceFile.FANIN, SourceFile.NOPAR, SourceFile.NDC, SourceFile.CALLS }; But unfortunately this doesn't work: FileStorer.METRICS' is of type 'System.Collections.Generic.List<string>'. A const field of a reference type other than string can only be initialized with null. How can I solve this problem?

    Read the article

  • How to map coordinates in AxesImage to coordinates in saved image file?

    - by Vebjorn Ljosa
    I use matplotlib to display a matrix of numbers as an image, attach labels along the axes, and save the plot to a PNG file. For the purpose of creating an HTML image map, I need to know the pixel coordinates in the PNG file for a region in the image being displayed by imshow. I have found an example of how to do this with a regular plot, but when I try to do the same with imshow, the mapping is not correct. Here is my code, which saves an image and attempts to print the pixel coordinates of the center of each square on the diagonal: import numpy as np import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_axes([0.1, 0.1, 0.8, 0.8]) axim = ax.imshow(np.random.random((27,27)), interpolation='nearest') for x, y in axim.get_transform().transform(zip(range(28), range(28))): print int(x), int(fig.get_figheight() * fig.get_dpi() - y) plt.savefig('foo.png', dpi=fig.get_dpi()) Here is the resulting foo.png, shown as a screenshot in order to include the rulers: The output of the script starts and ends as follows: 73 55 92 69 111 83 130 97 149 112 … 509 382 528 396 547 410 566 424 585 439 As you see, the y-coordinates are correct, but the x-coordinates are stretched: they range from 73 to 585 instead of the expected 135 to 506, and they are spaced 19 pixels o.c. instead of the expected 14. What am I doing wrong?

    Read the article

  • Dynamic CCK fields population

    - by boogie
    Hi, How can I create two CCK fields where the latter has values based on the first selection? In my case I have a few programs which can be selected and then projects that are related to programs. I need to have two separate fields for them. Example: Programs: Program1 Program2 Projects: Project1 (related to Program1) Project2 (related to Program2) Project3 (related to Program2) If program "Program1" is selected, then the user should only be able to select "Project1" and in case of "Program2" is selected, the options should be "Project2" or "Project3". I'm using Drupal 6.20 and I've already tried using Conditional Fields and Computed Fields modules, but they don't really solve my problem. Any help is much appreciated!

    Read the article

  • How can I write an autostarting dock app for the Mac?

    - by TreeUK
    I have an application I'd like to build that starts when you start the mac and will appear in the dock. I have some experience with Objective-C and iPhone dev but none with Mac dev, I'm also a PC user normally so I'm not au fait with the norms of Mac usage. Any guidance here is appreciated. How do you get an application to autostart? Can you run an app in the tray bar? (with the clock etc in) or do apps only run in the dock?

    Read the article

  • Does template class/function specialization improves compilation/linker speed?

    - by Stormenet
    Suppose the following template class is heavily used in a project with mostly int as typename and linker speed is noticeably slower since the introduction of this class. template <typename T> class MyClass { void Print() { std::cout << m_tValue << std::endl;; } T m_tValue; } Will defining a class specialization benefit compilation speed? eg. void MyClass<int>::Print() { std::cout << m_tValue << std::endl; }

    Read the article

  • What is wrong with accessing DBI directly?

    - by canavanin
    Hi everyone! I'm currently reading Effective Perl Programming (2nd edition). I have come across a piece of code which was described as being poorly written, but I don't yet understand what's so bad about it, or how it should be improved. It would be great if someone could explain the matter to me. Here's the code in question: sub sum_values_per_key { my ( $class, $dsn, $user, $password, $parameters ) = @_; my %results; my $dbh = DBI->connect( $dsn, $user, $password, $parameters ); my $sth = $dbh->prepare( 'select key, calculate(value) from my_table'); $sth->execute(); # ... fill %results ... $sth->finish(); $dbh->disconnect(); return \%results; } The example comes from the chapter on testing your code (p. 324/325). The sentence that has left me wondering about how to improve the code is the following: Since the code was poorly written and accesses DBI directly, you'll have to create a fake DBI object to stand in for the real thing. I have probably not understood a lot of what the book has so far been trying to teach me, or I have skipped the section relevant for understanding what's bad practice about the above code... Well, thanks in advance for your help!

    Read the article

  • Visual Studio scratch disk behavior

    - by bobobobo
    I don't know if this feature exists, but I'd like a way to control Visual Studio 2010's scratch disk behavior (other than completely turning off intellisense). Right now it creates a massive .sdf file in the project folder (50MB+), and then it goes and creates an IPCH folder with 60MB+ of precompiled headers. All that's well and good while VS is running, but after it exits, I really would like the disk back. Is there a way to configure vs 2010 to Use the same location (%AppData%\VSScratch) for scratch disk files (so its easier to blow it away?) Automatically delete .sdf /ipch on exit? I know they don't delete them because its faster to startup.. but if you delete them yourself, startup time isn't that much increased..

    Read the article

  • CakePHP: How do I change page title from helper?

    - by Zeta Two
    Hello! I'm using a helper for static pages to add a part to the title on every page. Currently I have the following code at the top of every static page: <?php $this->set('title_for_layout', $title->output('Nyheter')); ?> The purpose of $title-output is to append " :: MY WEB SITE NAME". This works fine, but for simplicity I would rather just call: $title->title('Nyheter'); At the top of every page to set the title. The problem is that I can't call $this-set() from within the helper. Is there a way to something like this or am I completely on the wrong path here?

    Read the article

  • What goes into main function?

    - by Woltan
    I am looking for a best practice tip of what goes into the main function of a program using c++. Currently I think two approaches are possible. (Although the "margins" of those approaches can be arbitrarily close to each other) 1: Write a "Master"-class that receives the parameters passed to the main function and handle the complete program in that "Master"-class (Of course you also make use of other classes). Therefore the main function would be reduced to a minimum of lines. #include "MasterClass.h" int main(int args, char* argv[]) { MasterClass MC(args, argv); } 2: Write the "complete" program in the main function making use of user defined objects of course! However there are also global functions involved and the main function can get somewhat large. I am looking for some general guidelines of how to write the main function of a program in c++. I came across this issue by trying to write some unit test for the first approach, which is a little difficult since most of the methods are private. Thx in advance for any help, suggestion, link, ...

    Read the article

  • glTexParameter and filtering in OpenGL and GLSL?

    - by sharoz
    I have a couple questions about glTexParameter and filtering 1) What is the scope when applying a glTexParameter (specifically the filtering)? Here's a scenario: Bind a texture. Set the filters to LINEAR Set the texture to "Sampler1" of a shader Bind another texture. Set its filters to NEAREST Set that texture to "Sampler2" of a shader Draw When I use the textures in a shader, will one be linear and the other be nearest? Or will they both be nearest because it was called last? 2) Is it possible to set the filtering method in GLSL? Thanks in advance!

    Read the article

  • Please help with choosing CI build tool

    - by alexeypro
    Hello, I need to choose the right CI build tool which will: 1. Support groups of build configurations so we can use the standardized build process for all our projects 2. Support dashboard with "pretty" (for executive/director "eye" :-) reports. 3. Support Java, Maven, Ant, and be somewhat customizable for build process itself (though this is optional, as I can "fix" it with scripts) I'd prefer free and open source tool, but paid version is fine too. Please help :-)

    Read the article

  • When should I use String.Format or String.Concat instead of the concatenation operator?

    - by Kramii
    In C# it is possible to concatenate strings in several different ways: Using the concatenation operator: var newString = "The answer is '" + value + "'."; Using String.Format: var newString = String.Format("The answer is '{0}'.", value); Using String.Concat: var newString = String.Concat("The answer is '", value, "'."); What are the advantages / disadvantages of each of these methods? When should I prefer one over the others? The question arises because of a debate between developers. One never uses String.Format for concatenation - he argues that this is for formatting strings, not for concatenation, and that is is always unreadable because the items in the string are expressed in the wrong order. The other frequently uses String.Format for concatenation, because he thinks it makes the code easier to read, especially where there are several sets of quotes involved. Both these developers also use the concatenation operator and String.Builder, too.

    Read the article

  • How to set the default page for a .CHM file in HTML Help Workshop?

    - by mengchew0113
    When I open the help (.chm) application, I could see table of contents. By default, the first entry in the file is selected, however I couldn't see the corresponding page data. Instead, I see "This program cannot display the web page" (the default error message that comes in IE7).The page is displayed only when I click on any of the contents on the left side. Is there a way of showing the page by default without clicking on the entry? The following code is the .hhp file. [OPTIONS] Compatibility = 1.1 or later Compiled file=Config.chm Contents file=Config.hhc Default topic=D:\apps\bin\Debug\html\Databases.htm Language=0x409 English (United States) Display compile progress=No Title=ETL_Config Documentation [FILES] D:\apps\bin\Debug\html\Databases.htm D:\apps\bin\Debug\html\InstanceInformation.htm

    Read the article

  • Converted PowerBuilder to ASP.Net browsing Errors

    - by user493325
    I had a powerbuilder application which i converted to web application in the format of ASP.Net (aspx) files. after deploying and publishing the converted web application (copy it and add ASP.Net and network Service AND IUser permissions to enable users to access it) in IIS V6.0 over Windows server 2003 and The ASP.Net version is 2.0 The error messages I get when I browse default.aspx web page are as the following:- Server Error in '/' Application. Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off". <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration> Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL. <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> </configuration> Another error message appears on the server is:- Server Error in '/' Application. Configuration Error <roleManager enabled="true"> <membership> </roleManager> Thanks in Advance...

    Read the article

  • sql - duplicates

    - by Sebastjan
    Hey guys I'm putting data from website (json) to sql base. In db i have these rows. ID | PostId | Name | Message Id is auto-increment primary key. PostId also has a unique values. Name and Message are nothing special. When I run my script / click on the button in form / ... , the program saves all the values into database (lets say there are 25). Next time I'm going to press the button there will be added 25 more records (all duplicates), and so on... Is there a way that the program can check through 'PostIds' if the value already exists before adding it to the db? Thanks

    Read the article

  • JQuery Dynamic Element - In DOM but unable to bind

    - by Grant80
    Hi All, I'm new to using JQuery so bear with me. I had implmented some code based on a js file that I found online which enables a series of div tags within a nested structure on my page to step through and show each one individually on the page. This all works great when I define the div tags as static entries in the masterpage. I should add that this is being implemented in a SharePoint master page. Ultimately though, with a static collection of div tags ideally containing an image with some descriptive text, and a hyperlink its not very flexible. Roll on my changes to make this a little more configurable. I have implemented some additional code that will read from a SharePoint list via an ajax call to the lists web service. For each entry in the list I am building a div tag that contains the information required dynamically. For testing, I am only pulling the title through at present. I have used the following code: $('#beltDiv').append(divHTML) to append the divs in the loop that are created to my nested structure on the page. I figured that this would cause the fade code to work as expected but I was wrong. It doesn't do anything at all. When check the source on the page, the div tags are not shown. They are however available in the DOM model when viewed through the IE developer toolbar. The issue (I think) looks to be that the initiation of the featureFade code is not working due to the div tags being unavailable. Is there a way to address this? The code used is shown below: <script type="text/javascript"> $(document).ready(function() { var soapEnv = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \ <soapenv:Body> \ <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \ <listName>Carousel Items</listName> \ <viewFields> \ <ViewFields> \ <FieldRef Name='Title' /> \ </ViewFields> \ </viewFields> \ </GetListItems> \ </soapenv:Body> \ </soapenv:Envelope>"; $.ajax({ url: "_vti_bin/lists.asmx", type: "POST", dataType: "xml", data: soapEnv, complete: processResult, contentType: "text/xml; charset=\"utf-8\"" }); }); function processResult(xData, status) { $(xData.responseXML).find("z\\:row").each(function() { var divHTML = "<div id=\"divPanel_" + $(this).attr("ows_Title") + "\" class=\"panel\" style=\"background:url('http://devSP2010/sites/SPSOPS/Style Library/SharePointOps/Images/01.jpg') no-repeat; width:650px; height:55px;\"><div><div class=\"content\"><div><P><A style=\"COLOR: #cc0000\" href=\"www.google.com\">" + $(this).attr("ows_Title") + "</A></P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P></div></div></div></div>"; $("#beltDiv").append(divHTML); }); } featureFade.setup({ galleryid: 'headlines', beltclass: 'belt', panelclass: 'panel', autostep: { enable: true, moveby: 1, pause: 10000 }, panelbehavior: { speed: 1000, wraparound: true }, stepImgIDs: ["ftOne", "ftTwo", "ftThree", "ftFour","ftFive"], defaultButtons: { itemOn: "Style Library/SharePointOps/Images/dotOn.png", itemOff: "Style Library/SharePointOps/Images/dotOff.png" } }); The section where the div tags are dynamically appended is shown below. I've commented out the static div tags that work as expected. The only change is that these are implmented by the JQuery logic: <div class="homeFeature" style="display:inline-block"> <div id="headlines" class="headlines"> <div id="beltDiv" class="belt"> <!-- <div id="divPanel_ct01" class="panel" style="position:absolute;background-image:url('http://devsp2010/sites/spsops/Style Library/SharePointOps/Images/01.jpg'); background-repeat:no-repeat">Static Test 1</div> <div id="divPanel_ct02" class="panel" style="position:absolute;background-image:url('http://devsp2010/sites/spsops/Style Library/SharePointOps/Images/02.jpg'); background-repeat:no-repeat">Static Test 2</div> --> </div> </div> I'm stumped as to why it's not recognising the dynamically added elements in the DOM. Any help would be greatly appreciated on this. I'm happy to provide any further information on this. Thanks in advance, Grant Further to the answer recieved: I have modified the function call: function processResult(xData, status) { $(xData.responseXML).find("z\\:row").each( function() { /*alert($(this).attr("ows_ImagePath"));*/ var divHTML = "<div id=\"divPanel_" + $(this).attr("ows_Title") + "\" class=\"panel\" style=\"background:url('http://devSP2010/sites/SPSOPS/Style Library/SharePointOps/Images/ClydePort01big.jpg') no-repeat; width:650px; height:55px;\"><div><div class=\"content\"><div><P><A style=\"COLOR: #cc0000\" href=\"www.google.com\">" + $(this).attr("ows_Title") + "</A></P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P></div></div></div></div>"; $("#beltDiv").append(divHTML); } ); featureFade.setup( { galleryid: 'headlines', beltclass: 'belt', panelclass: 'panel', autostep: { enable: true, moveby: 1, pause: 10000 }, panelbehavior: { speed: 1000, wraparound: true }, stepImgIDs: ["ftOne", "ftTwo", "ftThree", "ftFour","ftFive"], defaultButtons: { itemOn: "Style Library/SharePointOps/Images/dotOn.png", itemOff: "Style Library/SharePointOps/Images/dotOff.png" } } ); }

    Read the article

  • Having an online highscore leaderboard for a Flash game

    - by Marco Fox
    Why, hello there. I'm trying to develop a simple Flash game using Actionscript 2 (I know its a bit dated, but its a simple project that doesen't benefict much from AS3), and I came up with an ideia of implementing an online leaderboard that records and shows the highscore of the player. This isn't anything too complicated, but I seem to be having problem finding resources online that explain how I should implement this. All I want is a call, probably to a PHP/MySQL database that records the player's name (which will be recorded via a input window) and its current score. It would also have to show the best all time scores, by order. I should remind you that I am working on a Actionscript 2 so Actionscript 3 solutions are probably not going to work. Can anyone out there help me out here? Did any of you already been through this?

    Read the article

  • How does AuthzSVNAccessFile work?

    - by grigy
    I have set up an SVN repo with WebDAV access. For some reason it does not let checkout. Here is my httpd.conf part: <Location /svn> DAV svn SVNParentPath /home/svn/repositories AuthzSVNAccessFile /home/svn/dav_svn.authz Satisfy Any Require valid-user AuthType Basic AuthName "Subversion Repository" AuthUserFile /home/svn/dav_svn.passwd </Location> I have two repositories named "first" and "second" and the content of dav_svn.authz is: [first:/] doe = rw * = r [second:/] doe = rw grig = rw * = r When I'm trying to checkout the second with user doe, I get this in error_log: user doe: authentication failure for "/svn/second": Password Mismatch In order to understand what can be the problem I would like to better understand how the AuthzSVNAccessFile is supposed to work.

    Read the article

  • Tomcat SSL integration issue

    - by small_ticket
    Hi all, I've bought a wildcard ssl certificate from a company, i sent them the csr file and they send me two certificate files namely CA.txt and com_sertificate. I've searched on web and find some tutorials about tomcat and ssl but i can not accomplish with these two files. All that tutorials mention about different files that i don't have. (I asked about this process to the company that i bought certificates but they said they don't have any knowledge about tomcat integration) Is there anyone that has an idea about this? p.s I'm using ubuntu 8.04 server, Java 1.6 and tomcat 6

    Read the article

  • Plesk 9 VPS - Doesn't reply to NameServer requests (nslookup, etc)

    - by Ben
    Hi, I'm trying to troubleshoot a problem with a new VPS i'm setting up. The VPS is running Plesk 9 on a CentOS 5 system. Everything works fine, except it doesn't serve dns requests. If I try something like nslookup [somedomain.com] the.ser.ver.ip to test a DNS query, i get the following error ;; connection timed out; no servers could be reached I can't telnet to it on port 42 either.. I'm guessing something is blocking the requests.. firewall maybe? the plesk firewall module is installed and the nameservers entry is green. Any other way I can check what's blocking it on the server? Any help/tip greatly appreciated. Note: http works, i can telnet to the server on port 80 and i can also ping the server Thanks

    Read the article

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