Daily Archives

Articles indexed Friday April 30 2010

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

  • Problems with Windows XP Plug and Play devices, maybe relating to MSVCR71.dll

    - by Richard
    I believe this question is unanswered as of now so I appologize if I've overlooked it. I have been having trouble some external devices with windows recently and I'm trying my darnedest to get to the bottom of it. At first, my Zero Tension USB mouse would stop working...as in the laser in the bottom of it would be on and would register movement, but the mouse on the screen wouldn't budge even an inch. At first this would happen randomly and then it would correct itself. As time went on, it became more and more frequent. At some point, the computer would make the "doo doo" sound of plugging or unplugging a USB device when the mouse stopped/started working. I dealt with it for a while and usually if I rebooted my machine, the mouse would work again for a day or two. As more time has gone on, the computer fully does not recognize the mouse AT ALL...I have another mouse that I use with the computer that works just fine and cannot seem to figure out why my Zero Tension mouse has failed. I tried plugging the Zero Tension mouse into my Mac and low and behold, it works without hesitation and never stops on me... Needless to say, I am stumped about this. I figured because I had another mouse I could deal with the loss of my fancy one for now...until my speakers stopped being recognized. I have a set of Logitec speakers that I have plugged into my sound card. Again, every now and again the audio devices would cease to be recognized by my computer, but a reboot would fix the problem. Now my speakers do not work at all with my computer and I feel like it's time to ask for help. My computer seems to be having a neural shutdown...where I can plug in devices and the computer doesn't seem to notice anything wrong, but none of the devices work. I hope this doesn't get any worse! Please help! Also, on a potentially (un)related note, when I start up my machine I get the message "This application has failed to start because Msvcp71.dll was not found. Re-installing the application may fix this problem." in reference to qbupdate.exe I don't know if that DLL being messed up has anything to do with my mouse or speakers, but I figure it might...anyway, thanks in advance for an answer and let me know if I need to clarify anything. Let me sum up: Zero Tension Mouse gradually stopped working Logitec Speakers gradually stopped working MSVCR71.dll seems to be messed up I don't know if any of those are related but any help would be much appreciated

    Read the article

  • What does "Set an Input handler" mean in Eclipse?

    - by Scrubbie
    In Eclipse, when configuring an external tool (Run-External Tools-External Tools Configurations...), specifically an Ant Build, under the Main tab there is a checkbox labeled "Set an Input Handler". This is checked by default. What does this do? When would you want to uncheck it and what would the benefits be?

    Read the article

  • Using jQuery, how to modify text outside of tags?

    - by Jacob
    Given a string of text that is both adjacent to a span and inside of a div, what are some methods to modify just that text, leaving the surrounding HTML intact? For example: <div id="my-div">modify this text<span id="my-span"></span></div> I have tried things like $('#my-div').html(function(i, elem){blah;}); but this seems to cause the span to be deleted and a new span to be added, because some styling is lost. I realize that it would be best to wrap the text string in its own HTML tags before applying client-side code, but that is out of my control.

    Read the article

  • ASP.Net Architecture Specific to Shared/Static functions

    - by Maxim Gershkovich
    Hello All, Could someone please advise in the context of a ASP.Net application is a shared/static function common to all users? If for example you have a function Public shared function GetStockByID(StockID as Guid) as Stock Is that function common to all current users of your application? Or is the shared function only specific to the current user and shared in the context of ONLY that current user? So more specifically my question is this, besides database concurrency issues such as table locking do I need to concern myself with threading issues in shared functions in an ASP.Net application? In my head; let’s say my application namespace is MyTestApplicationNamespace. Everytime a new user connects to my site a new instance of the MyTestApplicationNamespace is created and therefore all shared functions are common to that instance and user but NOT common across multiple users. Is this correct?

    Read the article

  • Javascript parse/evaluation order?

    - by Breck Fresen
    This is probably a nub question, but I don't understand why this works: <script type="text/javascript"> alert(foo); function foo() { } </script> This alerts "function foo() { }", but I expected the alert to be evaluated before the function foo was defined. Can someone explain what I don't understand about parse/evaluation order or point me to a resource that does? Thanks in advance, -- Breck

    Read the article

  • INSERT OR IGNORE in a trigger

    - by dan04
    I have a database (for tracking email statistics) that has grown to hundreds of megabytes, and I've been looking for ways to reduce it. It seems that the main reason for the large file size is that the same strings tend to be repeated in thousands of rows. To avoid this problem, I plan to create another table for a string pool, like so: CREATE TABLE AddressLookup ( ID INTEGER PRIMARY KEY AUTOINCREMENT, Address TEXT UNIQUE ); CREATE TABLE EmailInfo ( MessageID INTEGER PRIMARY KEY AUTOINCREMENT, ToAddrRef INTEGER REFERENCES AddressLookup(ID), FromAddrRef INTEGER REFERENCES AddressLookup(ID) /* Additional columns omitted for brevity. */ ); And for convenience, a view to join these tables: CREATE VIEW EmailView AS SELECT MessageID, A1.Address AS ToAddr, A2.Address AS FromAddr FROM EmailInfo LEFT JOIN AddressLookup A1 ON (ToAddrRef = A1.ID) LEFT JOIN AddressLookup A2 ON (FromAddrRef = A2.ID); In order to be able to use this view as if it were a regular table, I've made some triggers: CREATE TRIGGER trg_id_EmailView INSTEAD OF DELETE ON EmailView BEGIN DELETE FROM EmailInfo WHERE MessageID = OLD.MessageID; END; CREATE TRIGGER trg_ii_EmailView INSTEAD OF INSERT ON EmailView BEGIN INSERT OR IGNORE INTO AddressLookup(Address) VALUES (NEW.ToAddr); INSERT OR IGNORE INTO AddressLookup(Address) VALUES (NEW.FromAddr); INSERT INTO EmailInfo SELECT NEW.MessageID, A1.ID, A2.ID FROM AddressLookup A1, AddressLookup A2 WHERE A1.Address = NEW.ToAddr AND A2.Address = NEW.FromAddr; END; CREATE TRIGGER trg_iu_EmailView INSTEAD OF UPDATE ON EmailView BEGIN UPDATE EmailInfo SET MessageID = NEW.MessageID WHERE MessageID = OLD.MessageID; REPLACE INTO EmailView SELECT NEW.MessageID, NEW.ToAddr, NEW.FromAddr; END; The problem After: INSERT OR REPLACE INTO EmailView VALUES (1, '[email protected]', '[email protected]'); INSERT OR REPLACE INTO EmailView VALUES (2, '[email protected]', '[email protected]'); The updated rows contain: MessageID ToAddr FromAddr --------- ------ -------- 1 NULL [email protected] 2 [email protected] [email protected] There's a NULL that shouldn't be there. The corresponding cell in the EmailInfo table contains an orphaned ToAddrRef value. If you do the INSERTs one at a time, you'll see that Alice's ID in the AddressLookup table changes! It appears that this behavior is documented: An ON CONFLICT clause may be specified as part of an UPDATE or INSERT action within the body of the trigger. However if an ON CONFLICT clause is specified as part of the statement causing the trigger to fire, then conflict handling policy of the outer statement is used instead. So the "REPLACE" in the top-level "INSERT OR REPLACE" statement is overriding the critical "INSERT OR IGNORE" in the trigger program. Is there a way I can make it work the way that I wanted?

    Read the article

  • Flex/Flash 4 datagrid displays raw xml

    - by Setori
    Problem: Flex/Flash4 client (built with FlashBuilder4) displays the xml sent from the server exactly as is - the datagrid keeps the format of the xml. I need the datagrid to parse the input and place the data in the correct rows and columns of the datagrid. flow: click on a date in the tree and it makes a server request for batch information in xml form. Using a CallResponder I then update the datagrid's dataProvider. [code] <fx:Script> <![CDATA[ import mx.controls.Alert; [Bindable]public var selectedTreeNode:XML; public function taskTreeChanged(event:Event):void { selectedTreeNode=Tree(event.target).selectedItem as XML; var searchHubId:String = selectedTreeNode.@hub; var searchDate:String = selectedTreeNode.@lbl; if((searchHubId == "") || (searchDate == "")){ return; } findShipmentBatches(searchDate,searchHubId); } protected function findShipmentBatches(searchDate:String, searchHubId:String):void{ findShipmentBatchesResult.token = actWs.findShipmentBatches(searchDate, searchHubId); } protected function updateBatchDataGridDP():void{ task_list_dg.dataProvider = findShipmentBatchesResult.lastResult; } ]]> </fx:Script> <fx:Declarations> <actws:ActWs id="actWs" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/> <s:CallResponder id="findShipmentBatchesResult" result="updateBatchDataGridDP()"/> </fx:Declarations> <mx:AdvancedDataGrid id="task_list_dg" width="100%" height="95%" paddingLeft="0" paddingTop="0" paddingBottom="0"> <mx:columns> <mx:AdvancedDataGridColumn headerText="Receiving date" dataField="rd"/> <mx:AdvancedDataGridColumn headerText="Msg type" dataField="mt"/> <mx:AdvancedDataGridColumn headerText="SSD" dataField="ssd"/> <mx:AdvancedDataGridColumn headerText="Shipping site" dataField="sss"/> <mx:AdvancedDataGridColumn headerText="File name" dataField="fn"/> <mx:AdvancedDataGridColumn headerText="Batch number" dataField="bn"/> </mx:columns> </mx:AdvancedDataGrid> //xml example from server <batches> <batch> <rd>2010-04-23 16:31:00.0</rd> <mt>SC1REVISION01</mt> <ssd>2010-02-18 00:00:00.0</ssd> <sss>100000009</sss> <fn>Revision 1-DF-Ocean-SC1SUM-Quanta-PACT-EMEA-Scheduled Ship Date 20100218.csv</fn> <bn>10041</bn> </batch> <batches> [/code] and the xml is pretty much displayed exactly as is shown in the example above in the datagrid columns... I would appreciate your assistance.

    Read the article

  • How to paints a transparent circle like using CGContextClearRect to draw a transparent rectangle

    - by user177946
    Hello All, Do anyone know how I can draw a transparent circle on a CALayer just like using CGContextClearRect to draw a transparent rectangle? My requirements is that I need to draw a mask on a picture, in some cases, I need to erase it, but CGContextClearRect only allow to draw a rectangle, I wonder if there is another way to do the same thing and draw a tranparent circle. Regards, Anto

    Read the article

  • Data confusion - Selecting data in one DataGridView based on selection in another

    - by Logan Young
    This probably isn't the best way to do what I want, but I can't think of anything else to try... NB: I'm using Visual Basic.NET My form has 2 DataGridView controls. One of these is bound to a DataSet, the other isn't visible - at least not until the user selects a uniqueidentifier cell in the 1st grid. When the user makes this selection, the 2nd grid will become visible and display the row from another with the same id as the one selected in the 1st grid. So, basically, I want to dynamically display data in one grid based on user selection in another grid. My code looks like this so far... Private Sub RulesGrid_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles RulesGrid.CellClick Try FlagsGrid.Visible = True ''// MsgBox(RulesGrid.CurrentCell.Value.ToString()) Dim sql As String = "SELECT * FROM ctblMKA_Status_Flags " + _ "WHERE intStatusID = '" & RulesGrid.CurrentCell.Value & "'" DSFlags = GetDS(sql) DSFlags.DataSetName = "FlagsDataSet" FlagsGrid.DataSource = DSFlags ProgressBar.Visible = False Catch ex As Exception MsgBox(ex.ToString) End Try End Sub I feel like I'm missing something here... Any ideas anyone?

    Read the article

  • Website revision control system

    - by kylex
    I'm looking for the ability to use a revision control system for websites, but ALSO have the revisions go live immediately. Example: A developer submits to the repository, those changes are live immediately pulled from the repository. Any suggestions on available software?

    Read the article

  • NetBeans and Python

    - by spacemonkey
    When I run some python code in NetBeans, which raises an error, the output in NetBeans just gives an error message and no further information, such as line number. Is there any way to fix that?

    Read the article

  • Is there a limit on number of OLE objects that can be embedded in an excel sheet?

    - by Varun Mahajan
    I am adding OLE objects to an excel sheet through .net interop. However, after some calls, excel is not allowing adding more objects through code. Is there a limit? or am I doing something wrong. Dim Htmlshape As Microsoft.Office.Interop.Excel.Shape Htmlshape = xlWorkSheet.Shapes.AddOLEObject(, tmpFile, , True, strExplorerPath, 1, "") Running this code gives an error after say 1000 calls. So, am I crossing some limit here?

    Read the article

  • Receiving XML from Actionscript on Servlet - Invalid Stream Header

    - by John Doe
    I have an ActionScript File sending XML to my servlet. I am only getting empty arrays on output. In ActionScript I checked and I am in fact sending the correct XML. Anyone know what Exactly I'm doing wrong? Exception error is: java.io.StreamCorruptedException: invalid stream header package myDungeonAccessor; try { System.out.println("HEADERS: " + request.getHeaderNames()); ObjectInputStream in = new ObjectInputStream(request.getInputStream()); System.out.println(in); ObjectOutputStream out = new ObjectOutputStream(response.getOutputStream()); } catch(Exception e) { e.printStackTrace(); } Exception

    Read the article

  • ANDROID: inside Service class, executing a method for Toast (or Status Bar notification) from schedu

    - by Peter SHINe ???
    I am trying to execute a {public void} method in Service, from scheduled TimerTask which is periodically executing. This TimerTask periodically checks a condition. If it's true, it calls method via {className}.{methodName}; However, as Java requires, the method needs to be {pubic static} method, if I want to use {className} with {.dot} The problem is this method is for notification using Toast(Android pop-up notification) and Status Bar To use these notifications, one must use Context context = getApplicationContext(); But for this to work, the method must not have {static} modifier and resides in Service class. So, basically, I want background Service to evaluate condition from scheduled TimerTask, and execute a method in Service class. Can anyone help me what's the right way to use Service, invoking a method when certain condition is satisfied while looping evaluation? Here are the actually lines of codes: The TimerTask class (WatchClipboard.java) : public class WatchClipboard extends TimerTask { //DECLARATION private static GetDefinition getDefinition = new GetDefinition(); @Override public void run() { if (WordUp.clipboard.hasText()) { WordUp.newCopied = WordUp.clipboard.getText().toString().trim().toLowerCase(); if (!(WordUp.currentCopied.equals(WordUp.newCopied))) { WordUp.currentCopied = WordUp.newCopied; Log.v(WordUp.TAG, WordUp.currentCopied); getDefinition.apiCall_Wordnik(); FetchService.instantNotification(); //it requires this method to have {static} modifier, if I want call in this way. } } } } And the Service class (FetchService.java) : If I change the modifier to static, {Context} related problems occur public class FetchService extends Service { public static final String TAG = "WordUp"; //for Logcat filtering //DECLARATION private static Timer runningTimer; private static final boolean THIS_IS_DAEMON = true; private static WatchClipboard watchClipboard; private static final long DELAY = 0; private static final long PERIOD = 100; @Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } @Override public void onCreate() { Log.v(WordUp.TAG, "FetchService.onCreate()"); super.onCreate(); //TESTING SERVICE RUNNING watchClipboard = new WatchClipboard(); runningTimer = new Timer("runningTimer", THIS_IS_DAEMON); runningTimer.schedule(watchClipboard, DELAY, PERIOD); } @Override public void onDestroy() { super.onDestroy(); runningTimer.cancel(); stopSelf(); Log.v(WordUp.TAG, "FetchService.onCreate().stopSelf()"); } public void instantNotification() { //If I change the modifier to static, {Context} related problems occur Context context = getApplicationContext(); // application Context //use Toast notification: Need to accept user interaction, and change the duration of show Toast toast = Toast.makeText(context, WordUp.newCopied+": "+WordUp.newDefinition, Toast.LENGTH_LONG); toast.show(); //use Status notification: need to automatically expand to show lines of definitions NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); int icon = R.drawable.icon; // icon from resources CharSequence tickerText = WordUp.newCopied; // ticker-text long when = System.currentTimeMillis(); // notification time CharSequence contentTitle = WordUp.newCopied; //expanded message title CharSequence contentText = WordUp.newDefinition; //expanded message text Intent notificationIntent = new Intent(this, WordUp.class); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); // the next two lines initialize the Notification, using the configurations above Notification notification = new Notification(icon, tickerText, when); notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent); mNotificationManager.notify(WordUp.WORDUP_STATUS, notification); } }

    Read the article

  • Java Operator Precedence Comparison

    - by Andrew
    Does java have a built-in method to compare precedence of two operators? For example, if I have a char '/' and a char '+' is there a method I can call that compares the two and returns true/false if the first is greater than the second (e.g. true)?

    Read the article

  • How I do VCS

    - by Wes McClure
    After years of dabbling with different version control systems and techniques, I wanted to share some of what I like and dislike in a few blog posts.  To start this out, I want to talk about how I use VCS in a team environment.  These come in a series of tips or best practices that I try to follow.  Note: This list is subject to change in the future. Always use some form of version control for all aspects of software development. Development is an evolution.  Looking back at where we were is an invaluable asset in that process.  This includes data schemas and documentation. Reverting / reapplying changes is absolutely critical for efficient development. The tools I use: Code: Hg (preferred), SVN Database: TSqlMigrations Documents: Sometimes in code repository, also SharePoint with versioning Always tag a commit (changeset) with comments This is a quick way to describe to someone else (or your future self) what the changeset entails. Be brief but courteous. One or two sentences about the task, not the actual changes. Use precommit hooks or setup the central repository to reject changes without comments. Link changesets to documentation If your project management system integrates with version control, or has a way to externally reference stories, tasks etc then leave a reference in the commit.  This helps locate more information about the commit and/or related changesets. It’s best to have a precommit hook or system that requires this information, otherwise it’s easy to forget. Ability to work offline is required, including commits and history Yes this requires a DVCS locally but doesn’t require the central repository to be a DVCS.  I prefer to use either Git or Hg but if it isn’t possible to migrate the central repository, it’s still possible for a developer to push / pull changes to that repository from a local Hg or Git repository. Never lock resources (files) in a central repository… Rude! We have merge tools for a reason, merging sucked a long time ago, it doesn’t anymore… stop locking files! This is unproductive, rude and annoying to other team members. Always review everything in your commit. Never ever commit a set of files without reviewing the changes in each. Never add a file without asking yourself, deep down inside, does this belong? If you leave to make changes during a review, start the review over when you come back.  Never assume you didn’t touch a file, double check. This is another reason why you want to avoid large, infrequent commits. Requirements for tools Quickly show pending changes for the entire repository. Default action for a resource with pending changes is a diff. Pluggable diff & merge tool Produce a unified diff or a diff of all changes.  This is helpful to bulk review changes instead of opening each file. The central repository is not your own personal dump yard.  Breaking this rule is a sure fire way to get the F bomb dropped in front of your name, multiple times. If you turn on Visual Studio’s commit on closing studio option, I will personally break your fingers. By the way, the person(s) in charge of this feature should be fired and never be allowed near programming, ever again. Commit (integrate) to the central repository / branch frequently I try to do this before leaving each day, especially without a DVCS.  One never knows when they might need to work from remote the following day. Never commit commented out code If it isn’t needed anymore, delete it! If you aren’t sure if it might be useful in the future, delete it! This is why we have history. If you don’t know why it’s commented out, figure it out and then either uncomment it or delete it. Don’t commit build artifacts, user preferences and temporary files. Build artifacts do not belong in VCS, everything in them is present in the code. (ie: bin\*, obj\*, *.dll, *.exe) User preferences are your settings, stop overriding my preferences files! (ie: *.suo and *.user files) Most tools allow you to ignore certain files and Hg/Git allow you to version this as an ignore file.  Set this up as a first step when creating a new repository! Be polite when merging unresolved conflicts. Count to 10, cuss, grab a stress ball and realize it’s not a big deal.  Actually, it’s an opportunity to let you know that someone else is working in the same area and you might want to communicate with them. Following the other rules, especially committing frequently, will reduce the likelihood of this. Suck it up, we all have to deal with this unintended consequence at times.  Just be careful and GET FAMILIAR with your merge tool.  It’s really not as scary as you think.  I personally prefer KDiff3 as its merging capabilities rock. Don’t blindly merge and then blindly commit your changes, this is rude and unprofessional.  Make sure you understand why the conflict occurred and which parts of the code you want to keep.  Apply scrutiny when you commit a manual merge: review the diff! Make sure you test the changes (build and run automated tests) Become intimate with your version control system and the tools you use with it. Avoid trial and error as much as is possible, sit down and test the tool out, read some tutorials etc.  Create test repositories and walk through common scenarios. Find the most efficient way to do your work.  These tools will be used repetitively, so inefficiencies will add up. Sometimes this involves a mix of tools, both GUI and CLI. I like a combination of both Tortoise Hg and hg cli to get the job efficiently. Always tag releases Create a way to find a given release, whether this be in comments or an explicit tag / branch.  This should be readily discoverable. Create release branches to patch bugs and then merge the changes back to other development branch(es). If using feature branches, strive for periodic integrations. Feature branches often cause forked code that becomes irreconcilable.  Strive to re-integrate somewhat frequently with the branch this code will ultimately be merged into.  This will avoid merge conflicts in the future. Feature branches are best when they are mutually exclusive of active development in other branches. Use and abuse local commits , at least one per task in a story. This builds a trail of changes in your local repository that can be pushed to a central repository when the story is complete. Never commit a broken build or failing tests to the central repository. It’s ok for a local commit to break the build and/or tests.  In fact, I encourage this if it helps group the changes more logically.  This is one of the main reasons I got excited about DVCS, when I wanted more than one changeset for a set of pending changes but some files could be grouped into both changesets (like solution file / project file changes). If you have more than a dozen outstanding changed resources, there should probably be more than one commit involved. Exceptions when maintaining code bases that require shotgun surgery, in this case, it’s a design smell :) Don’t version sensitive information Especially usernames / passwords   There is one area I haven’t found a solution I like yet: versioning 3rd party libraries and/or code.  I really dislike keeping any assemblies in the repository, but seems to be a common practice for external libraries.  Please feel free to share your ideas about this below.    -Wes

    Read the article

  • Different cache concurrent strategies for root entity and its collection (Hibernate with EHCache)?

    - by grigory
    Given example from Hibernate docs and modifying it so that root level entity (Customer) is read-only while one of its collections (tickets) is read-write: @Entity @Cache(usage = CacheConcurrencyStrategy.READ_ONLY) public class Customer { ... @OneToMany(...) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public SortedSet<Ticket> getTickets() { return tickets; } ... } Would collection of tickets get refreshed when accessing customer from cache?

    Read the article

  • Disable selected automated tests at runtime

    - by squig
    Is is posable to disable selected automated tests at runtime? I'm using VSTS and rhino mocks and have some intergation tests that require an external dependancy to be installed (MQ). Not all the developers on my team have this installed. Currently all the tests that require MQ inherit from a base class that checks if MQ is installed and if is not sets the test result to inconclusive. This works as it stops the tests from running, but marks the test run as unsuccseessful and can hide other failures. Any ideas?

    Read the article

  • Comment Author Link on Wordpress

    - by knightrider
    Hello, At the wordpress form, when you leave comment as guest, there's a website field to fill your web address. If we fill in that box, we can get the link by calling this function <?php echo get_comment_author_link(); ?> But if you are logged in and you don't add the website at your profile, when you leave comment. It doesn't have the link on your username. What I want is, if the logged-in user doesn't have the website, there will be the link which will be carry them to their profile page which is something like http://www.example.com?author=21 Is there any function that i can use out there ? Please help me out. Thank you.

    Read the article

  • Can't change Joomla Default language

    - by Moak
    On this site http://www.bostonteaclub.com I want the default language to be Chinese. I set the default language to Chinese in the backend (it's got the star next to it) but when you went to the page you probably noticed that the site is in english. If you check the source code you will see on the very bottom hidden a var_dump of the language object, and by the looks of it the default is still en-GB ["_default"]=> string(5) "en-GB" Why is this? Thanks

    Read the article

  • SQL select descendants of a row

    - by Joey Adams
    Suppose a tree structure is implemented in SQL like this: CREATE TABLE nodes ( id INTEGER PRIMARY KEY, parent INTEGER -- references nodes(id) ); Although cycles can be created in this representation, let's assume we never let that happen. The table will only store a collection of roots (records where parent is null) and their descendants. The goal is to, given an id of a node on the table, find all nodes that are descendants of it. A is a descendant of B if either A's parent is B or A's parent is a descendant of B. Note the recursive definition. Here is some sample data: INSERT INTO nodes VALUES (1, NULL); INSERT INTO nodes VALUES (2, 1); INSERT INTO nodes VALUES (3, 2); INSERT INTO nodes VALUES (4, 3); INSERT INTO nodes VALUES (5, 3); INSERT INTO nodes VALUES (6, 2); which represents: 1 `-- 2 |-- 3 | |-- 4 | `-- 5 | `-- 6 We can select the (immediate) children of 1 by doing this: SELECT a.* FROM nodes AS a WHERE parent=1; We can select the children and grandchildren of 1 by doing this: SELECT a.* FROM nodes AS a WHERE parent=1 UNION ALL SELECT b.* FROM nodes AS a, nodes AS b WHERE a.parent=1 AND b.parent=a.id; We can select the children, grandchildren, and great grandchildren of 1 by doing this: SELECT a.* FROM nodes AS a WHERE parent=1 UNION ALL SELECT b.* FROM nodes AS a, nodes AS b WHERE a.parent=1 AND b.parent=a.id UNION ALL SELECT c.* FROM nodes AS a, nodes AS b, nodes AS c WHERE a.parent=1 AND b.parent=a.id AND c.parent=b.id; How can a query be constructed that gets all descendants of node 1 rather than those at a finite depth? It seems like I would need to create a recursive query or something. I'd like to know if such a query would be possible using SQLite. However, if this type of query requires features not available in SQLite, I'm curious to know if it can be done in other SQL databases.

    Read the article

  • Java force catch RuntimeException?

    - by wuntee
    Is it possible to force java to make you catch RuntimeExceptions? Specifically I am working with the Spring framework and the whole Exception hierarchy is based upon RuntimeExceptions. A lot of the times I forget to try and catch the Exceptions. A specific example is when doing an LDAP query, or an SQL call.

    Read the article

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