Daily Archives

Articles indexed Saturday May 22 2010

Page 6/81 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Thread vs async execution. What's different?

    - by Eonil
    I believed any kind of asynchronous execution makes a thread in invisible area. But if so, Async codes does not offer any performance gain than threaded codes. But I can't understand why so many developers are making many features async form. Could you explain about difference and cost of them?

    Read the article

  • Compiled git from source, cannot access subversion repositories using git-svn

    - by haydenmuhl
    I'm setting up a CentOS dev box, and need git. At first I tried to install git using yum, but I could not connect to a yum repository that had git. Next I downloaded the git source (version 1.7.1) and compiled it. When I run the following command git svn clone svn+ssh://... I get the following error. Initialized empty Git repository in /root/main_ec/.git/ Can't locate SVN/Core.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/libexec/git-core/git-svn line 41. It looks like git-svn uses perl in some manner, but I don't know packages I'm missing. Can anyone help?

    Read the article

  • How build my own Application Setting

    - by adisembiring
    I want to build a ApplicationSetting for my application. The ApplicationSetting can be stored in a properties file or in a database table. The settings are stored in key-value pairs. E.g. ftp.host = blade ftp.username = dummy ftp.pass = pass content.row_pagination = 20 content.title = How to train your dragon. I have designed it as follows: Application settings reader: interface IApplicationSettingReader { read(); } DatabaseApplicationSettingReader { dao appSettingDao; AppSettings read() { List<AppSettingEntity> listEntity = appSettingsDao.findAll(); Map<String, String> map = new HaspMap<String, String>(); foreach (AppSettingEntity entity : listEntity) { map.put(entity.getConfigName(), entity.getConfigValue()); } return new AppSettings(map); } } DatabaseApplicationSettingReader { dao appSettingDao; AppSettings read() { //read from some properties file return new AppSettings(map); } } Application settings class: AppSettings { private static AppSettings instance; private Map map; Public AppSettings(Map map) { this.map = map; } public static AppSettings getInstance() { if (instance == null) { throw new RuntimeException("Object not configure yet"); } return instance; } public static configure(IApplicationSettingReader reader) { instance = reader.read(); } public String getFtpSetting(String param) { return map.get("ftp." + param); } public String getContentSetting(String param) { return map.get("content." + param); } } Test class: AppSettingsTest { IApplicationSettingReader reader; @Before public void setUp() throws Exception { reader = new DatabaseApplicationSettingReader(); } @Test public void getContentSetting_should_get_content_title() { AppSettings.configure(reader); Instance settings = AppSettings.getInstance(); String title = settings.getContentSetting("title"); assertNotNull(title); Sysout(title); } } My questions are: Can you give your opinion about my code, is there something wrong? I configure my application setting once, while the application start, I configure the application setting with appropriate reader (DbReader or PropertiesReader), I make it singleton. The problem is, when some user edit the database or file directly to database or file, I can't get the changed values. Now, I want to implement something like ApplicationSettingChangeListener. So if the data changes, I will refresh my application settings. Do you have any suggestions how this can be implemented?

    Read the article

  • How to make multiple windows using Win32 API

    - by Steven Lu
    I see plenty of tutorials and articles showing me how to make a simple windows program, which is great but none of them show me how to make multiple windows. Right now I have working code that creates and draws a layered window and I can blit stuff using GDI to draw anything I want on it, drag it around, even make it transparent, etc. But I wanted a second rectangular area that I can draw to, drag around, etc. In other words, a second window. Probably want it to be a child window. Question is, how do I make it? Also, if anybody knows any good resources (online preferably) like articles or tutorials for window management in the Windows API, please share.

    Read the article

  • Flipping issue when interpolating Rotations using Quaternions

    - by uhuu
    I use slerp to interpolate between two quaternions representing rotations. The resulting rotation is then extracted as Euler angles to be fed into a graphics lib. This kind of works, but I have the following problem; when rotating around two (one works just fine) axes in the direction of the green arrow as shown in the left frame here the rotation soon jumps around to rotate from the opposite site to the opposite visual direction, as indicated by the red arrow in the right frame. This may be logical from a mathematical perspective (although not to me), but it is undesired. How could I achieve an interpolation with no visual flipping and changing of directions when rotating around more than one axis, following the green arrow at all times until the interpolation is complete? Thanks in advance.

    Read the article

  • initializing a vector of custom class in c++

    - by Flamewires
    Hey basically Im trying to store a "solution" and create a vector of these. The problem I'm having is with initialization. Heres my class for reference class Solution { private: // boost::thread m_Thread; int itt_found; int dim; pfn_fitness f; double value; std::vector<double> x; public: Solution(size_t size, int funcNo) : itt_found(0), x(size, 0.0), value(0.0), dim(30), f(Eval_Functions[funcNo]) { for (int i = 1; i < (int) size; i++) { x[i] = ((double)rand()/((double)RAND_MAX))*maxs[funcNo]; } } Solution() : itt_found(0), x(31, 0.0), value(0.0), dim(30), f(Eval_Functions[1]) { for (int i = 1; i < 31; i++) { x[i] = ((double)rand()/((double)RAND_MAX))*maxs[1]; } } Solution operator= (Solution S) { x = S.GetX(); itt_found = S.GetIttFound(); dim = S.GetDim(); f = S.GetFunc(); value = S.GetValue(); return *this; } void start() { value = f (dim, x); } /* plus additional getter/setter methods*/ } Solution S(30, 1) or Solution(2, 5) work and initalizes everything, but I need X of these solution objects. std::vector<Solution> Parents(X) will create X solutions with the default constructor and i want to construct using the (int, int) constructor. Is there any easy(one liner?) way to do this? Or would i have to do something like: size_t numparents = 10; vector<Solution> Parents; Parents.reserve(numparents); for (int i = 0; i<(int)numparents; i++) { Solution S(31, 0); Parents.push_back(S); }

    Read the article

  • Android OutOfMemoryError - Loading JSON File

    - by jeremynealbrown
    The app I am working on needs to read a JSON file that may be anywhere from 1.5 to 3 MB in size. It seems to have no problem opening the file and converting the data to a string, but when it attempts to convert the string to a JSONArray, OutOfMemoryErrors are thrown. The exceptions look something like this: E/dalvikvm-heap( 5307): Out of memory on a 280-byte allocation. W/dalvikvm( 5307): Exception thrown (Ljava/lang/OutOfMemoryError;) while throwing internal exception (Ljava/lang/OutOfMemoryError;) One strange thing about this is that the crash only occurs every 2nd or 3rd time the app is run, leaving me to believe that the memory consumed by the app is not being garbage collected each time the app closes. Any insight into how I might get around this issue would be greatly appreciated. I am open to the idea of loading the file in chunks, but I'm not quite sure what the best approach is for such a task. Thank you

    Read the article

  • Exception handling in Linq to SQL for customers without orders

    - by stackoverflowuser
    I have the following code to retrieve customer name, total (orders ), sum (order details) for reach customer in Northwind database. The problem with below code is that it raises an exception since a few customers dont have any entry in orders table. I know using the query syntax (join) the exception can be avoided. I want to know if the same can be handled with the extension method syntax. var customerOrders = db.Customers .Select(c => new { CompanyName = c.CompanyName, TotalOrders = c.Orders.Count(), TotalQuantity = c.Orders .SelectMany(o => o.Order_Details).Sum(o=>o.Quantity) });

    Read the article

  • Is it possible to change 2-3 times f->SetSensor() ?

    - by Asen
    Hello there ! i use cocos2d-iphone-0.99.2 and integrated in it box2d. i have 2 kind of sprites with tags 1 and 2. Also i created bodies and shape definitions for them. what i'm trying to do is to make sprite1 kinds to act as solid or act as not solid when sprite2 colides with them. i tried this code : for(b2Body *b = _world->GetBodyList(); b; b=b->GetNext()) { if (b-GetUserData() != NULL) { CCSprite *sprite = (CCSprite )b-GetUserData(); if (sprite.tag == 1) { b2Fixture f = b-GetFixtureList(); f-SetSensor(solid); } } } Where solid is bool. The first time when i change fixture to sensor everything is just fine but when i try to revert and change again to solid my app crashes with the following error : Assertion failed: (manifold-pointCount 0), function b2ContactSolver, file /Documents/myapp/libs/Box2D/Dynamics/Contacts/b2ContactSolver.cpp, line 58. Is it possible somehow to change fixture-SetSensor several times and if so ... how ? Any help is highly appreciated.

    Read the article

  • How can I provide users with the functionality of the DBUnit DatabaseOperation methods from a web in

    - by reckoner
    I am currently updating a java-based web application which allows database developers to create stored procedure regression test suites for database testing. Currently, for test setup, execution and clean-up stages, the user is provided with text boxes where they are able to enter SQL code which is executed by the isql command. I would like to extend the application to use DB Unit’s DatabaseOperation methods to provide more ways to setup the state of the database than just SQL statements. The main reason for using Db Unit rather than just SQL statements is to be able to create and store xml and xls DataSets on a server where they can be associated with their test cases and used for data setup. My question is: How can I provide users with the functionality of the DBUnit DatabaseOperation methods from a web interface? I have considered: Creating a simple programming language and a parser to read some simple syntax involving the DB Unit method names which accept a parameter being the file location to an xml or xls DataSet. I was thinking of allowing the user to register the files they need with the web app which would catalogue them and provide each file with an identifier which could passed as a parameter to the methods in this simple programming language. Creating an XML DTD which provides the user with the ability to specify operations and parameters. If I went this approach, how can I execute the methods and their parameters that I parse from the XML document? Creating a table in the database which stores the method and a FK relation to a catalogued DataSet file, however I don’t think this would be good solution due to the fact that data entry would be tedious. Thanks for your help.

    Read the article

  • How can I deal with No module named edit.editor ?

    - by Tomas Pajonk
    I am trying to follow the WingIDE tutorial on creating scripts in the IDE. This following example scripts always throws an error: import wingapi def test_script(test_str): app = wingapi.gApplication v = "Product info is: " + str(app.GetProductInfo()) v += "\nAnd you typed: %s" % test_str wingapi.gApplication.ShowMessageDialog("Test Message", v) Traceback (most recent call last): File "C:\Wing-pi\Scripts\test.py", line 1, in import wingapi File "C:\Program Files\Development\Wing IDE 3.1\bin\wingapi.py", line 18, in import edit.editor ImportError: No module named edit.editor Process terminated with an exit code of 1 I am launching the script in the Wing IDE as suggested by someone, but I keep getting the same result.

    Read the article

  • I didn't completely get 100% on a programming job interview, should I worry?

    - by user347598
    I recently had a phone job interview with a 1 hour Programming practical. It had two questions on it and I know I answered one completely correct and got most of the second correct. Should I worry about getting the Job just based on that? The actual phone job interview went very well and they told me that I answered their questions well and my questions I aimed at them were very good questions and some they had not heard before but should have in the past. so big question is should I worry? or is not 100% completion ok.

    Read the article

  • Advantages of Using Linux as primary developer desktop

    - by Nick N
    I want to get some input on some of the advantages of why developers should and need to use Linux as their primary development desktop on a daily basic as opposed to using Windows. This is particulary helpful when your Dev, QA, and Production environments are Linux. The current analogy that I keep coming back to is. If I build my demo car as a Ford Escort, but my project car is a Ford Mustang, it doesn't make sense at all. I'm currently at an IT department that allows dual boot with Windows and Linux, but some run Linux while the vast majority use Windows. Here's several advantages that I've came up with since using Linux as a primary desktop. Same Exact operating system as Dev, QA, and Production Same Scripts (.sh) instead of maintaining (.bat and *.sh). Somewhat mitigated by using cygwin, but still a bit different. Team learns simple commands such as: cd, ls, cat, top Team learns Advanced commands like: pkill, pgrep, chmod, su, sudo, ssh, scp Full access to installs typically for Linux, such as RPM, DEB installs just like the target environments. The list could go on and on, but I want to get some feedback of anything that I may have missed, or even any disadvantages (of course there are some). To me it makes sense to migrate an entire team over to using Linux, and using Virtual Box, running Windows XP VM's to test functional items that 95% of most of the world uses. This is similar but a little different thread going on here as well. link text

    Read the article

  • 503 (Server Unavailable) WebException when loading local XHTML file

    - by kcoppock
    Hello! So I'm currently working on an ePub reader application, and I've been reading through a bunch of regular XML files just fine with System.Xml and XmlDocument: XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(Path.Combine(Directory.GetCurrentDirectory(), "META-INF/container.xml")); XmlNodeList xnl = xmldoc.GetElementsByTagName("rootfile"); However, now I'm trying to open the XHTML files that contain the actual book text, and they're XHTML files. Now I don't really know the difference between the two, but I'm getting the following error with this code (in the same document, using the same XmlDocument and XmlNodeList variable) xmldoc.Load(Path.Combine(Directory.GetCurrentDirectory(), "OEBPS/part1.xhtml")); "WebException was unhandled: The remote server returned an error: (503) Server Unavailable" It's a local document, so I'm not understanding why it's giving this error? Any help would be greatly appreciated. :) I've got the full source code here if it helps: http://drop.io/epubtest (I know the ePubConstructor.ParseDocument() method is horribly messy, I'm just trying to get it working at the moment before I split it into classes)

    Read the article

  • Domain Keys, DKIM and Sendmail

    - by Daniel
    When I am using DomainKeys and DKIM together on a linux system, do I run both of them on the same port? DomainKeys: /usr/bin/dk-filter -l -p inet:8891@localhost -d example.com -s /var/db/ domainkeys/default.key.pem -S default DKIM: /usr/bin/dkim-filter -l -p inet:8891@localhost -c simple -d example.com -k /var/db/dkim/mail.key.pem -s mail -S rsa-sha256 -u dkim -m MSA Or do I do something like this: DomainKeys: /usr/bin/dk-filter -l -p inet:8892@localhost -d example.com -s /var/db/ domainkeys/mail1.key.pem -S default DKIM: /usr/bin/dkim-filter -l -p inet:8891@localhost -c simple -d example.com -k /var/db/dkim/mail2.key.pem -s mail -S rsa-sha256 -u dkim -m MSA Just wondering since information about DomainKeys and DKIM tell you to run them on the same port: http://www.elandsys.com/resources/sendmail/domainkeys.html http://www.elandsys.com/resources/sendmail/dkim.html I want to run both of them together, is this a bad idea?

    Read the article

  • Trouble Copying custom class initialization

    - by Parad0x13
    I have a custom class of type NSObject that contains a single NSMutableArray. This class is called Mutable2DArray and is designed to emulate a 2 dimensional array of type NSMutableArray. There is a custom init method - (id)initWithX:(int)x Y:(int)y that asks for the dimensions for the array and allocates the required arrays within the only array the class owns. My issue is when I try to copy an instance of Mutable2DArray I get an error saying the copyWithZone is an unrecognized selector. I thought copy was a base method of NSObject so I'm confused why I cant create a copy of the instance like this: Mutable2DArray *Array1 = [[Mutable2DArray alloc] initWithX:10 Y:10]; Mutable2DArray *Array2 = [Array1 copy]; Am I missing something so obvious here?

    Read the article

  • convert VB code to C# help please??

    - by ilkdrl
    var aktif=0, gosterim_adeti=5; var dizi = new Array(); $(document).ready(function(){ var boyut = $("#alan p").length; for(var i=0; i<boyut; i++) { dizi[i] = $("#alan p:eq("+i+")").html(); } $("#alan").html(""); for(var i=0; i<gosterim_adeti; i++) { $("#alan").append("<p>"+dizi[i]+"</p>"); } setInterval(degistir, 2000); function degistir() { aktif = (aktif + 1)%boyut; $("#alan").html(""); var ilk = aktif-1; if(ilk<0)ilk = ilk+boyut; $("#alan").append("<p>"+dizi[ilk]+"</p>"); for(var i=aktif; i<aktif + gosterim_adeti;i++) { $("#alan").append("<p>"+dizi[(i%boyut)]+"</p>"); } $("#alan p:first").slideUp(500); $("#alan p:last").css("height","0px").animate({height:"40px"},600);

    Read the article

  • Integration of aadvark with Gtalk - how does it work

    - by Gublooo
    Hi guys Not sure if anyone has used aadvark but it has a very nice integration with Gtalk. If you have signed up on aadvark - when any question is posted in your area of expertise - there will be nice pop-up in ur gtalk window asking if you are interested in answering - if you say Yes - it will ask you the question and you can answer in that window itself. Is that something they are able to do because Google bought them or does google have an API with which we can integrate it with our application to do something similar. Thanks

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >