Daily Archives

Articles indexed Thursday March 25 2010

Page 33/127 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • SQLite on iPhone - Techniques for tracking down multithreading-related bugs

    - by Jasarien
    Hey guys, I'm working with an Objective-C wrapper around SQLite that I didn't write, and documentation is sparse... It's not FMDB. The people writing this wrapper weren't aware of FMDB when writing this code. It seems that the code is suffering from a bug where database connections are being accessed from multiple threads -- which according to the SQLite documentation won't work if the if SQLite is compiled with SQLITE_THREADSAFE 2. I have tested the libsqlite3.dylib provided as part of the iPhone SDK and seen that it is compiled in this manner, using the sqlite_threadsafe() routine. Using the provided sqlite library, the code regularly hits SQLITE_BUSY and SQLITE_LOCKED return codes when performing routines. To combat this, I added some code to wait a couple of milliseconds and try again, with a maximum retry count of 50. The code didn't contain any retry logic prior to this. Now when a sqlite call returns SQLITE_BUSY or SQLITE_LOCKED, the retry loop is invoked and the retry returns SQLITE_MISUSE. Not good. Grasping at straws, I replaced the provided sqlite library with a version compiled by myself setting SQLITE_THREADSAFE to 1 - which according to the documentation means sqlite is safe to be used in a multithreaded environment, effectively serialising all of the operations. It incurs a performance hit, that which I haven't measured, but it ridded the app of the SQLITE_MISUSE happening and seemed to not need the retry logic as it never hit a busy or locked state. What I would rather do is fix the problem of accessing a single db connection from multiple threads, but I can't for the life of me find where it's occurring. So if anyone has any tips on locating multithreaded bugs I would be extremely appreciative. Thanks in advance.

    Read the article

  • Best way to enforce inter-table constraints inside database

    - by FerranB
    I looking for the best way to check for inter-table constraints an step forward of foreing keys. For instance, to check if a date child record value is between a range date on two parent rows columns. For instance: Parent table ID DATE_MIN DATE_MAX ----- ---------- ---------- 1 01/01/2009 01/03/2009 ... Child table PARENT_ID DATE ---------- ---------- 1 01/02/2009 1 01/12/2009 <--- HAVE TO FAIL! ... I see two approaches: Create materialized views on-commit as shown in this article (or other equivalent on other RDBMS). Use stored-procedures and triggers. Any other approach? Which is the best option? UPDATE: The motivation of this question is not about "putting the constraints on database or on application". I think this is a tired question and anyone does the way she loves. And, I'm sorry for detractors, I'm developing with constraints on database. From here, the question is "which is the best option to manage inter-table constraints on database?". I'm added "inside database" on the question title. UPDATE 2: Some one added the "oracle" tag. Of course materialized views are oracle-tools but I'm interested on any option regardless it's on oracle or others RDBMSs.

    Read the article

  • maintain pageViews in global.asax (asp.net)

    - by nishant
    I need a function in global.asax file which gets called only once when user enter a page url. application_beginrequest gets called 50-60 times in a single page( as to render a page several requests go to server.) i though of a solution - I can write my fucntion in global.asax and call it on page load of other pages but in that solution I need to call it in every page. I would prefer something which is to be done only in global.asax

    Read the article

  • Ambiguous reference when getter/setter have different visibilities

    - by Warren Seine
    The following code raises an ambiguous reference to value at compile time: import flash.display.Sprite; public class Main extends Sprite { private var _value : Number = 0.; public function get value() : Number { return _value; } private function set value(v : Number) : void { _value = v; } public function Main() : void { value = 42.; } } I suspect some kind of bug in the compiler, though I didn't actually read the ECMA standard. Before someone asks those questions: Private setters do make sense. The ambiguity also exists with custom namespaces (which is the problem I'm facing).

    Read the article

  • More inside an IDE(eclipse cdt)

    - by symfony
    This is what I see in the Console when I clicked Project-Clean menu: g++ -O0 -g3 -Wall -c -fmessage-length=0 -osrc\hw.o ..\src\hw.cpp g++ -ohw.exe src\hw.o But I've no idea how is these command generated? Can someone elaborate the lifecycle of the command?

    Read the article

  • Zend Date -- day difference

    - by Nisanth
    Hi All, I have the below line of codes $day1 = new Zend_Date('2010-03-01', 'YYYY-mm-dd'); $day2 = new Zend_Date('2010-03-05', 'YYYY-mm-dd'); $dateDiff = $day2->getDate()->get(Zend_Date::TIMESTAMP) - $day1->getDate()->get(Zend_Date::TIMESTAMP); $days = floor((($dateDiff / 60) / 60) / 24); return $days; this will return 4 But if gave $day1 = new Zend_Date('2010-02-28', 'YYYY-mm-dd'); $day2 = new Zend_Date('2010-03-01', 'YYYY-mm-dd'); $dateDiff = $day2->getDate()->get(Zend_Date::TIMESTAMP) - $day1->getDate()->get(Zend_Date::TIMESTAMP); $days = floor((($dateDiff / 60) / 60) / 24); return $days; it will return -27 .. how will i get right answer

    Read the article

  • Several appdomains calling the same unmanged dll

    - by Mr. T.
    Our .NET 3.5 C# application creates multiple appdomains. Each appdomain loads the same unmanaged 3rd party dll. This dll reads a configuration file upon initialization. If the configuration changes during runtime, the dll must be unloaded and loaded again. This dll is not in our scope to rewrite correctly. Does each appdomain have access to a separtate copy of this unmanaged dll, or does Windows keep one copy of the dll and maintain a usage count? If the latter is is the case, how do we get each instance of the unmanaged dll to reflect its unique configuration?

    Read the article

  • Getting Visual Studio macros in console app

    - by Paul Steckler
    In a Visual Studio extension, you can get the default include paths for all projects with C# code like: String dirs = dte2.get_Properties("Projects", "VCDirectories"); where dte2 is the Visual Studio application object. Usually, those directories contain macros like $(INCLUDE). You can expand those macros by looking at dte2.Solution.Projects, finding the relevant project in that collection; from the project, look at project.Configurations, find the relevant configuration, and call its Evaluate method. In VS2005/VS2008, there's a .vssettings file that contains the VCDirectories. In VS2010, there's a property sheet with the same information. A console application can just parse those files -- great. But how can you expand the macros? As a first step, I tried instantiating a VCProjectEngine object in a console app, but that just resulted in a COM failure. So I don't know how to instantiate a VCProject object in order to follow the same strategy I used in a VS extension. Where are the macro bindings stored?

    Read the article

  • How to compile a program which needs a newer version of glib

    - by michael
    Hi, I am trying to compile Webkit on Ubuntu 8.04. But when i run autogen.sh, I get the following error saying it needs a newer version of glib. So what is the safest way to install glib without screwing up the rest of my OS (since the rest needs 2.16 while webkit compile needs 2.21)? checking for GLIB... configure: error: Package requirements (glib-2.0 >= 2.21.3 gobject-2.0 >= 2.0 gthread-2.0 >= 2.0) were not met: Requested 'glib-2.0 >= 2.21.3' but version of GLib is 2.16.6 Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.

    Read the article

  • setting up Windows 2008 STD EN on dedicated server

    - by sunny
    Dear experts, I just purchased a dedicated server and i need to setup for hosting my website. Please help me how do i setup the server step by step. server details : Windows 2008 STD EN SQL Server Web 2008 Core2 Quad 2.4GHz 6GB RAM Single-Power 150GB Velociraptor 10K RPM Please help me for : 1.Setting up server and hosting website 2.Email settings 3.How to set DNS as domain is from another host. regards, Sunny

    Read the article

  • Dump Trac DB on Windows/XAMPP

    - by Whiteknight
    I have a Trac instance running on a WindowsXP machine with XAMPP. I am trying to migrate the trac instance to a newer Linux-based machine. However, I'm having a hard time getting the database to cooperate. I try to dump the db with this command: sqlite3 C:\tracroot\db\trac.db ".dump" >> mysqldump.sql But the generated file is mostly empty: BEGIN TRANSACTION; COMMIT; So that's not right. For the record my trac instance is running now and appears to have full access to all the contents of the DB. But sqlite3 (located in C:\xampp\apache\bin) can't seem to get any information from the file. The DB file itself has the header "SQLite format 3", so that seems to be correct. I need to know one of two things: How to get this dump working OR An alternate way to migrate the Trac database to the new machine. Update: When I try to open the .db file in sqlite3, I get the error Error: unsupported file format. What format is it in, and why is it unsupported?

    Read the article

  • How can make firefox do this work?

    - by gylns
    I'm using Vimperator with firefox, and I find i always type the same URL, for example I type " http://gigapedia.info/1/@title C++ " to search a ebook with "C++" include in title, How can i just type "C++" and can get the complete URL?

    Read the article

  • How disable Apple iCal from popping up with every email invite/update?

    - by Sean
    My iCal has new behavior (since upgrading to SL). Every time I get an ical attachment in Mail, the iCal app flies up in my face. I don't see any way to turn off this behavior and it's amazingly disruptive when I'm busy with other activities. Help? EDIT: I want iCal to add the invitations, so when I cmd-tab to the app those items are in the queue awaiting approval. What I am hoping to learn is how to stop the popup action forcing the application to become the top-level window.

    Read the article

  • window services works after local account used before this account

    - by Gauls
    Hi All of a sudden my window services app after installation does not start(Some services stop automatically if they have no work to do) uses custom user, if i change the logon setting to use local system account and click start works fine, then when i go back and change to use this account (local user- custom user under user group) and then click start it works fine, why didn't work in the first place???????????? Thanks

    Read the article

  • show a new view after x seconds?

    - by user301496
    hey all, i'm quite new to objective c and i have this problem. i'm animating an image an show this in a imageview. after 15 seconds i want to show another view, thought of a "flying in view from the bottom". any hints fpr me how i could manage that? thanx in advance marcus

    Read the article

  • making python 2.6 exception backward compatible

    - by m2o
    I have the following python code: try: pr.update() except ConfigurationException as e: returnString=e.line+' '+e.errormsg This works under python 2.6, but the "as e" syntax fails under previous versions. How can I resolved this? Or in other words, how do I catch user-defined exceptions (and use their instance variables) under python 2.6. Thank you!

    Read the article

  • PHP form validation question?

    - by GeNx
    Is it necessary to validate a name or street address? when I have it coded in the following format. And if so why? $address = mysqli_real_escape_string($mysqli, htmlentities($_POST['address'])); $name = mysqli_real_escape_string($mysqli, htmlentities($_POST['name']));

    Read the article

  • sql Database to save different contact details for a message sending site

    - by jagan
    I am working for a project to create a database for saving different persons contact details in sql. For example, X person saves 10 contacts, Y persons save 15 contacts, z persons save 20 contacts and so on. I cant create seperate tables to save contacts of x,y,z and so on. But i just want to know the alternative method to do that. Is there any easy method to save different cotacts and is there any easy method to retrieve it. I'm just a student, i don't know much about sql and don't have much experience in this. So i need your help to know much about this.

    Read the article

  • LINQ2SQL and MS SQL 2000

    - by artvolk
    Good day! I have used LINQ2SQL with MS SQL 2005, but now I need to use it with MS SQL 2000. I have found only article on MSDN that tells about Skip() and Take() oddities on MS SQL 2000 (that's because it lacks ROW_NUMBER(), I suppose) and nothing more. Anyway, does anybody have expirience with LINQ2SQL and MS SQL 2000 combination. P.S. Just wondering: is it possible to model LINQ2SQL class on view, not a real table?

    Read the article

  • Java Media Framework always generating multicast packets with TTL=1

    - by Liam
    I need to generate a G711 multicast audio stream, and came across the AVTransmit2 sample as part of the Java Media Framework. Fundementally this works, however the multicast packets all have TTL set to 1. I found some documentation that suggested the SessionAddress could specify a TTL value, so I've tried changing that i.e. destAddr = new SessionAddress( ipAddr, port, 255); I also found some comments that the problems might be due to java defaulting to IPv6, so I've tried to force it to ipv4 by starting it like this: java -Djava.net.preferIPv4Stack=true -classpath "." AVTransmit2 javasound://8000 239.1.10.65 20480 However looking in wireshark, the packets still have TTL=1 I'm using JMF2.1.1e Any suggestions how to resolve this?

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >