Daily Archives

Articles indexed Sunday January 9 2011

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

  • Mystery 0xc0000142 error on starting java from a service, as a different user.

    - by cpf
    This is a very convoluted setup, but effectively this is what goes down: Manager service (which I don't have control over) running as admin user X starts my executable, which then starts Java as user Y using the standard c# StartInfo.Username/Password controls. Now, from a basic (not elevated or anything, just admin) command prompt I can run that executable, and Java pops up and works fine, running perfectly under the user it should be. When the service runs the same executable, however, Java silently fails. The only hint I see is this series of events in the event viewer: Service starts "Application popup: java.exe - Application Error : The application was unable to start correctly (0xc0000142). Click OK to close the application. " (googling this reveals a lot of scam sites telling me to use their "free antivirus to fix 0xc0000142 errors easy!"... sigh) Service stops (the java shutdown propagated, which is supposed to happen) And here's what process explorer has for the failure: As you can see, everything shows as a success. Now, I think this might have something to do with the permissions (the user java.exe is running under has traverse permission for the entire drive and full permissions to Directory A, which is where the .jar is), but I just can't fathom how something that works fine from the command line (and, this is an upgrade, the previous system without the user-switching aspect works fine from the service) can fail with such a cryptic message and little showing up in logs.

    Read the article

  • Comparing zip/compression utilities

    - by Grant Palin
    I've used WinZip, WinRar, and 7zip for packaging and compression. I know the first two are payware, and the last is open source. Despite that, they all seem to serve the same overall purpose. Are there any other distinguishing characteristics that make any of the options stand out? I'm not really looking for a "best" package, but would like to know of noteworthy differences between the common tools. For what it's worth, I do seem to like WinRar. Not sure why, but there it is. If it matters, I'm using Windows 7.

    Read the article

  • Wireless router DSL connection problem help

    - by infoquad
    I recently bought a wireless DSL router to replace my wired one. After quick setup however, the router does not connect to the Internet. Wireless connection between laptop and router exists and Internet can be connected through laptop(manually) by using router as WAN miniport(PPPoE). What I want to do is connect the wireless router to Internet so that when laptop connects to router, I can start using the Internet. How do I do this? Please help.

    Read the article

  • Bypassing "Found New Hardware Wizard" / Setting Windows to Install Drivers Automatically

    - by Synetech inc.
    Hi, My motherboard finally died after the better part of a decade, so I bought a used system. I put my old hard-drive and sound-card in the new system, and connected my old keyboard and mouse (the rest of the components—CPU, RAM, mobo, video card—are from the new system). I knew beforehand that it would be a challenge to get Windows to boot and install drivers for the new hardware (particularly since the foundational components are new), but I am completely unable to even attempt to get through the work of installing drivers for things like the video card because the keyboard and mouse won't work (they do work, in the BIOS screen, in DOS mode, in Windows 7, in XP's boot menu, etc., just not in Windows XP itself). Whenever I try to boot XP (in normal or safe mode), I get a bunch of balloons popping up for all the new hardware detected, and a New Hardware Found Wizard for Processor (obviously it has to install drivers for the lowest-level components on up). Unfortunately I cannot click Next since the keyboard and mouse won't work yet because the motherboard drivers (for the PS/2 or USB ports) are not yet installed. I even tried a serial mouse, but to no avail—again, it does work in DOS, 7, etc., but not XP because it doesn't have the serial port driver installed. I tried mounting the SOFTWARE and SYSTEM hives under Windows 7 in order to manually set the "unsigned drivers warning" to ignore (using both of the driver-signing policy settings that I found references to). That didn't work; I still get the wizard. They are not even fancy, proprietary, third-party, or unsigned drivers. They are drivers that come with Windows—as the drivers for CPU, RAM, IDE controller, etc. tend to be. And the keyboard and mouse drivers are the generic ones at that (but like I said, those are irrelevant since the drivers for the ports that they are connected to are not yet installed). Obviously at some point in time over the past several years, a setting got changed to make Windows always prompt me when it detects new hardware. (It was also configured to show the Shutdown Event Tracker on abnormal shutdowns, so I had to turn that off so that I could even see the desktop.) Oh, and I tried deleting all of the PNF files so that they get regenerated, but that too did not help. Does anyone know how I can reset Windows to at least try to automatically install drivers for new hardware before prompting me if it fails? Conversely, does anyone know how exactly one turns off automatic driver installation (and prompt with the wizard)? Thanks a lot.

    Read the article

  • How to use "Automatically Add to iTunes" for podcasts

    - by user62037
    I am trying to get old episodes of podcasts accessible through iTunes and on my iPod. However, when I add these episodes to the "Automatically Add to iTunes" folder, they get automatically added, but to the wrong place - they are not getting classified as podcasts (despite their detailed info showing that they belong to the podcast genre). How can I get around this such that they get classified / filed as podcasts?

    Read the article

  • Hardware asset management systems

    - by Dave
    I need to track a bunch of specialized testing tools, They are hardware devices used for testing other equipement. Each device has a serial number and is sent out for use in testing. Occasionally they break and have to be sent to the manufacture for repair. I'm looking for an open source application (preferably a webapp) to help manage them. Right now we're using Excel and it's not scaling as we get more tools. They aren't computers so all the standard IT asset management systems don't really fit the bill. I found h-harmony, but that project seems dead?

    Read the article

  • Using Oracle Linux iSCSI targets with Oracle VM

    - by wim.coekaerts
    A few days ago I had written a blog entry on how to use Oracle Solaris 10 (in my case), ZFS and the iSCSI target feature in Oracle Solaris to create a set of devices exported to my Oracle VM server. Oracle Linux can do this as well and I wanted to make sure I also tried out how to do this on Oracle Linux and here are the results. When you install Oracle Linux 5 update 5 (anything newer than update 3), it comes with an rpm called scsi-target-utils. To begin your quest, should you choose to accept it :) make sure this is installed. rpm -qa |grep scsi-target If it is not installed : up2date scsi-target-utils The target utils come with a tool tgtadm which is similar to iscsitadm on Oracle Solaris. There are 2 components again on the iSCSI server side. (1) create volumes - we will use lvm with lvcreate (2) expose a target using tgtadm. My server has a simple setup. All the disks are part of a single volume group called vgroot. To export a 50Gb volume I just create a new volume : lvcreate -L 50G -nmytest1 vgroot This will show up as a new volume in /dev/mapper as /dev/mapper/vgroot-mytest1. Create as many as you want for your environment. Since I already have my blog entry about the 5 volumes, I am not going to repeat the whole thing. You can just go look at the previous blog entry. Now that we have created the volume, we need to use tgtadm to set it up : make sure the service is running : /etc/init.d/tgtd start or service tgtd start (if you want to keep it running you can do chkconfig tgtd on to start it automatically at boottime) Next you need a targetname to set everything up. My recommendation would be to install iscsi-initiator-utils . This will create an iscsi id and put it in /etc/iscsi/initiatorname.iscsi. For convenience you can do : source /etc/iscsi/initiatorname.iscsi echo $InitiatorName and from here on use $InitiatorName instead of the long complex iqn. create your target : tgtadm --lld iscsi --op new --mode target --tid 1 -T $InitiatorName to show the status : tgtadm --lld iscsi --op show --mode target add the volume previously created : tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/mapper/vgroot-mytest1 re-run status to see it's there : tgtadm --lld iscsi --op show --mode target and just like on Oracle Solaris you now have to export (bind) it : tgtadm --lld iscsi --op bind --mode target --tid 1 -I iqn.1986-03.com.sun:01:2a7526f0ffff If you want to export the lun to every iscsi initiator then replace the iqn with ALL. Of course you have to add the iqn of each iscsi initiator or client you want to connect. In the case of my 2 node Oracle VM server setup, both Oracle VM server's initiator names would have to be added. use status again to see that it has this iqn under ACL tgtadm --lld iscsi --op show --mode target You can drop the --lld iscsi if you want, or alias it. It just makes the command line more obvious as to what you are doing. Oracle VM side : Refer back to the previous blog entry for the detailed setup of my Oracle VM server volumes but the exact same commands will be used there. discover : iscsiadm --mode discovery --type sendtargets --portal login : iscsiadm --mode node --targetname iscsi targetname --portal --login get devices : /etc/init.d/iscsi restart and voila you should be in business. have fun.

    Read the article

  • Monitor won't enter power save mode

    - by Adam Monsen
    My LCD monitor won't enter power save mode. I've gone into System ? Preferences ? Screensaver, clicked Power Management, then set Put display to sleep when inactive for: to 10 minutes (for both On AC Power and On Battery Power), but the monitor still doesn't enter power save mode, even after an hour. Anyone have ideas on what to try? I'm using Ubuntu 10.04.1 LTS 64-bit desktop on a Dell Latitude E6400 laptop.

    Read the article

  • Stretching a Table's Width to fit web browser

    - by Techn0guy
    Okay so I have sowered the internet for a long time trying to solve my problem. I have a table with my whole site in it and would like for it to stretch to fit the user's web browser size. Here is all the site's code atm <body> <table width="100%" border="0"> <tr> <td width="525" rowspan="2"><img src="My Images/Speaker.png" width="525" height="772" ondragstart="return false" /> </td> <td width="697" height="16"> *Flash Video Here* </td> </tr> <tr> <td><img src="My Images/Vymil.jpg" width="822" height="597" ondragstart="return false"/></td> </tr> </table> </body> </html> Any helpful solutions would be greatly appreciated

    Read the article

  • Rails - default value in text_field but only for new_record?

    - by jyoseph
    On a Content model have an attribute named slug. When creating a new record, I want to use a helper to populate this field, but on an existing record I want to use the value from the database. Currently I have: <%- if @content.new_record? -%> <%= f.text_field :slug, :value => "#{generate_slug(6)}" %> <%- else %> <%= f.text_field :slug %> <%- end %> But that seems a bit verbose. Is this the best way, or is there no other way? (Rails newb just trying to find the "Rails way" on issues I'm unsure of) Edit I should note that the helper is currently in /app/helpers/application_helper.rb

    Read the article

  • Java regex return after first match

    - by user216915
    hi how do i return after the first match of regular expression? (does the Matcher.find() method do that? ) say I have a string "abcdefgeee". I want to ask the regex engine stop finding immediately after it finds the first match of "e" for example. I am writing a method to return true/false if the pattern is found and i don't want to find the whole string for "e". (I am looking for a regex solution ) thanks

    Read the article

  • Overlapping and Stacking in CSS

    - by ApacheCode
    Hello, I'm a programmer and learning new techniques in web development. I've ran into a problem if you could look at the link below. http://bailesslaw.com/Bailess_003/bailesHeader/header.html This example I made isnt fixed and it needs to be, which is becoming difficult. This looks fine on here, but when I put those layers on main website, index.html, place this code as the header, the banner moves in the documents position 0,0 . I need these boxes fixed, center page and I cannot get them to do that without messing up the layers order and content. Layer1-rotating images, js causes the rotation Layer2-blue triangle with backdrop effect overlapping layer 1, Layer 3-is a static image with a high z-index Below I including some code, the important part that needs 3 overlapped layers exactly matching in width and height, except it has to be fixed in center 780px wide. Code: <style rel="stylesheet" type="text/css"> div#layer1 { border: 1px solid #000; height: 200px; left: 0px; position: fixed; top: 0px; width: 780px; z-index: 1; } div#layer2 { border: 1px solid #000; height: 200px; left: 0px; position: absolute; top: 0px; width: 780px; z-index: 2; } div#layer3 { border: 1px solid #000000; height: 200px; left: 0px; position: absolute; top: 0px; width: 780px; z-index: 3; } </style> </head> <body class="oneColFixCtr"> <div id="container"> <div id="mainContent"> <div id="layer1"> </div> <div id="layer2"> <div class="slideshow"> <span id="rotating1"> <p class="rotating"> </p> </span> <span id="rotating2"> <p class="rotating"> </p> </span> <span id="rotating3"> <p class="rotating"> </p> </span> <span id="rotating4"> <p class="rotating"> </p> </span> </div> </div> <div id="layer3"> <table width="385" border="0"> <tr> <th width="81" scope="col"> &nbsp; </th> <th width="278" scope="col"> &nbsp; </th> <th width="12" scope="col"> &nbsp; </th> </tr> <tr> <td> &nbsp; </td> <td> </td> <td> &nbsp; </td> </tr> <tr> <td> &nbsp; </td> <td> &nbsp; </td> <td> &nbsp; </td> </tr> </table> </div> </div> <!-- end #container --> </div> </body> </body> </html> CSS: @charset "utf-8"; CSS code: #rotating1 { height: 200px; width: 780px; } #rotating2 { height: 200px; width: 780px; } #rotating3 { height: 200px; width: 780px; } #main { background-repeat: no-repeat; height: 200px; width: 780px; z-index: 100; } #test { width: 780px; z-index: 2; } #indexContent { background-color: #12204d; background-repeat: no-repeat; height: 200px; width: 780px; z-index: 1; } #indexContent p { padding: .5em 2em .5em 2em; text-align: justify; text-indent: 2em; } .rotating { float: right; margin-top: 227px; text-indent: 0px !important; } .clearfix:after { clear: both; content: " "; display: block; font-size: 0; height: 0; visibility: hidden; } .clearfix { display: inline-block; } * html .clearfix { height: 1%; } .clearfix { display: block; }

    Read the article

  • Getting a WebView to act exactly like Safari

    - by Kelly McDonald
    (edited to give a better description of the answer I gave) I have created a very simple browser in InterfaceBuilder consisting of a nav bar and a webview. Everything works fine except when I try to tab between input fields is the webview, the focus goes to the nav bar. I'm assuming I need to do something with the responder chain, but I haven't been able to figure out what. Any advice? Thanks, Kelly

    Read the article

  • "didChangeSection:" NSfetchedResultsController delegate method not being called

    - by robenk
    I have a standard split view controller, with a detail view and a table view. Pressing a button in the detail view can cause the an object to change its placement in the table view's ordering. This works fine, as long as the resulting ordering change doesn't result in a section being added or removed. I.e. an object can change it's ordering in a section or switch from one section to another. Those ordering changes work correctly without problems. But, if the object tries to move to a section that doesn't exist yet, or is the last object to leave a section (therefore requiring the section its leaving to be removed), then the application crashes. NSFetchedResultsControllerDelegate has methods to handle sections being added and removed that should be called in those cases. But those delegate methods aren't being called for some reason. The code in question, is boilerplate: - (void)controllerWillChangeContent:(NSFetchedResultsController *)controller { NSLog(@"willChangeContent"); [self.tableView beginUpdates]; } - (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id <NSFetchedResultsSectionInfo>)sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type { NSLog(@"didChangeSection"); switch(type) { case NSFetchedResultsChangeInsert: [self.tableView insertSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade]; break; case NSFetchedResultsChangeDelete: [self.tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade]; break; } } - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath { NSLog(@"didChangeObject"); UITableView *tableView = self.tableView; switch(type) { case NSFetchedResultsChangeInsert: [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade]; break; case NSFetchedResultsChangeDelete: [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; break; case NSFetchedResultsChangeUpdate: [self configureCell:[tableView cellForRowAtIndexPath:indexPath] atIndexPath:indexPath]; break; case NSFetchedResultsChangeMove: [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath]withRowAnimation:UITableViewRowAnimationFade]; break; } } - (void)controllerDidChangeContent:(NSFetchedResultsController *)controller { NSLog(@"didChangeContent"); [self.tableView endUpdates]; [detailViewController.reminderView update]; } Starting the application, and then causing the last object to leave a section results in the following output: 2011-01-08 23:40:18.910 Reminders[54647:207] willChangeContent 2011-01-08 23:40:18.912 Reminders[54647:207] didChangeObject 2011-01-08 23:40:18.914 Reminders[54647:207] didChangeContent 2011-01-08 23:40:18.915 Reminders[54647:207] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-1145.66/UITableView.m:825 2011-01-08 23:40:18.917 Reminders[54647:207] Serious application error. Exception was caught during Core Data change processing: Invalid update: invalid number of sections. The number of sections contained in the table view after the update (5) must be equal to the number of sections contained in the table view before the update (6), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted). with userInfo (null) As you can see, "willChangeContent", "didChangeObject" (moving the object in question), and "didChangeContent" were all called properly. Based on the Apple's NSFetchedResultsControllerDelegate documentation "didChangeSection" should have been called before "didChangeObject", which would have prevented the exception causing the crash. So I guess the question is how do I assure that didChangeSection gets called? Thanks in advance for any help!

    Read the article

  • What's wrong in this C program..? [closed]

    - by AGeek
    struct bucket { int nStrings; //No. of Strings in a Bucket. char strings[MAXSTRINGS][MAXWORDLENGTH]; // A bucket row can contain maximum 9 strings of max string length 10. };//buck[TOTBUCKETS]; void lexSorting(char array[][10], int lenArray, int symb) //symb - symbol, sorting based on character symbols. { int i, j; int bucketNo; int tBuckNStrings; bucket buck[TOTBUCKETS]; for(i=0; i<lenArray; i++) { bucketNo = array[i][symb] - 'a'; // Find Bucket No. in which the string is to be placed. tBuckNStrings = buck[bucketNo].nStrings; // temp variable for storing nStrings var in bucket structure. strcpy(buck[bucketNo].strings[tBuckNStrings],array[i]); // Store the string in its bucket. buck[bucketNo].nStrings = ++tBuckNStrings; //Increment the nStrings value of the bucket. } // lexSorting(array, lenArray, ++symb); printf("****** %d ******\n", symb); for(i=0; i<TOTBUCKETS; i++) { printf("%c = ", i+'a'); for(j=0; j<buck[i].nStrings; j++) printf("%s ",buck[i].strings[j]); printf("\n"); } } int main() { char array[][10] = {"able","aback","a","abet","acid","yawn","yard","yarn","year","yoke"}; int lenArray = 10; int i; printf("Strings: "); for(i=0; i<lenArray; i++) printf("%s ",array[i]); printf("\n"); lexSorting(array, lenArray, 0); } Well here is the complete code, that I am trying. since its been a long time since i have touched upon C programming, so somewhere i am making mistake in structure declaration. The problem goes here:- 1) I have declared a structure above and its object as array(buck[]). 2) Now when I declare this object array along with the structure, it works fine.. I have commented this thing right now. 3) But when I declare this object array inside the function.. because ultimately i have to declare inside function( as i need to build a recursive program, where objects will be created in very recursive call) then the program is throwing segmentation fault. Expected Output > [others@centos htdocs]$ ./a.out > Strings: able aback a abet acid yawn > yard yarn year yoke > ****** 0 ****** > a = able aback a abet acid > b = > c > . > . > y = yawn yard yarnyear yoke > z = Actual Output [others@centos htdocs]$ ./a.out Strings: able aback a abet acid yawn yard yarn year yoke Segmentation fault I have no idea, what difference I made in this. Kindly help. Thanks.

    Read the article

  • Windows cmd encoding change causes Python crash.

    - by Alex
    First I chage Windows CMD encoding to utf-8 and run Python interpreter: chcp 65001 python Then I try to print a unicode sting inside it and when i do this Python crashes in a peculiar way (I just get a cmd prompt in the same window). >>> import sys >>> print u'ëèæîð'.encode(sys.stdin.encoding) Any ideas why it happens and how to make it work? UPD: sys.stdin.encoding returns 'cp65001' UPD2: It just came to me that the issue might be connected with the fact that utf-8 uses multi-byte character set (kcwu made a good point on that). I tried running the whole example with 'windows-1250' and got 'ëeaî?'. Windows-1250 uses single-character set so it worked for those characters it understands. However I still have no idea how to make 'utf-8' work here. UPD3: Oh, I found out it is a known Python bug. I guess what happens is that Python copies the cmd encoding as 'cp65001 to sys.stdin.encoding and tries to apply it to all the input. Since it fails to understand 'cp65001' it crushes on any input that contains non-ascii characters.

    Read the article

  • Error 400 in urllib2 when using cookies

    - by Hempage
    I've had some success using a different method to load cookies, but now I'm wanting to use the cookielib.MozillaCookieJar method to open a cookies.txt file. Here's the snippet of code that does this. cookieJar=MozillaCookieJar() cookieJar.load(argv[2]) After creating an HTTPCookieProcessor opener, and installing it, whenever I use urlopen, I get an HTTP 400 error. However, if I don't use a CookieJar, the urlopen method succeeds (though the response doesn't contain the data I need). I'm not sure whether the cookies.txt file is malformed, or whether there's something else going on.

    Read the article

  • Maven dependency for Servlet 3.0 API?

    - by deamon
    How can I tell Maven 2 to load the Servlet 3.0 API? I tried: <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>3.0</version> <scope>provided</scope> </dependency> I use http://repository.jboss.com/maven2/ but what repository would be correct? Addendum: It works with a dependency for the entire Java EE 6 API and the following settings: <repository> <id>java.net</id> <url>http://download.java.net/maven/2</url> </repository> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> I'd prefer to only add the Servlet API as dependency, but "Brabster" may be right that separate dependencies have been replaced by Java EE 6 Profiles. Is there a source that confirms this assumption?

    Read the article

  • Pivot table from multiple spreadsheets

    - by vrao
    I am using excel 2010. I am trying to create pivot table between two worksheets 'Summary' and 'Summary2'. I have identical row of data ranging from cells B5 to F5 in row 5 in both worksheets. Data in the two worksheets looks like this: Summary worksheet: Issues,20,3,4,5 Summary2 worksheet: Issues,10,0,3,9 Worksheet referes to issues from location 1 and worksheet referes to issues from location 2. Col B has title 'issues', Col C refers to issues of customer 1, Col D refers to issues of customer 2, Col E refers to issues of customer 3, Col F refers to issues of customer 4 I go to a third worksheet and start pivot table and in the table range I give this: 'Summary:Summary2'!$B$5:$F$5. Then I Say OK. Gives error "data reference source is not valid". Can someone tell me how to select the row from two different worksheet in pivot table? Also I want to be able to add issues of customers between two locations and get % completion for each locaiton. Can someone please help?

    Read the article

  • WebView and HTML5 <video>

    - by brian moore
    I'm piecing together a cheapo app that amongst other things "frames" some of our websites... Pretty simple with the WebViewClient... until I hit the video. The video is done as HTML5 elements, and these work fine and dandy on Chrome, iPhones, and now that we fixed the encoding issues it works great on Android... in the native browser. Now the rub: WebView doesn't like it. At all. I can click on the poster image, and nothing happens. Googling, I found http://www.codelark.com/2010/05/12/android-viewing-video-from-embedded-webview/ which is close, but seems to be based on a 'link' (as in a href...) instead of a video element. (onDownloadListener does not appear to get invoked on video elements...) I also see references to overriding onShowCustomView, but that seems to not get called on video elements... nor does shouldOverrideUrlLoading.. I would rather not get into "pull xml from the server, reformat it in the app".. by keeping the story layout on the server, I can control the content a bit better without forcing people to keep updating an app. So if I can convince WebView to handle tags like the native browser, that would be best. I'm clearly missing something obvious.. but I have no clue what.

    Read the article

  • Exclude children based on content in XML with PHP (simplexml)

    - by Hakan
    Another question about PHP and XML... Is it posible to exclude children based on there childrens content. See the example below: If "title" contains the word "XTRA:" I don't want this "movie" to be listed. This is my PHP code: <? $xml = simplexml_load_file("movies.xml"); foreach ($xml->movie as $movie){ ?> <h2><? echo $movie->title ?></h2> <p>Year: <? echo $movie->year ?></p> <? } ?> This is mys XML file: <?xml version="1.0" encoding="UTF-8"?> <movies> <movie> <title>Little Fockers</title> <year>2010</year> </movie> <movie> <title>Little Fockers XTRA: teaser 3</title> <year>2010</year> </movie> </movies> The outcome of the code above is: <h2>Little Fockers</h2> <p>Year: 2010</p> <h2>Little Fockers XTRA: teaser 3</h2> <p>Year: 2010</p> I want it to be only: <h2>Little Fockers</h2> <p>Year: 2010</p>

    Read the article

  • What is the best design for these data base tables?

    - by Mohammed Jamal
    I need to find the best solution to make the DB Normalized with large amount of data expected. My site has a Table Tags (contain key word,id) and also 4 types of data related to this tags table like(articles,resources,jobs,...). The big question is:- for the relation with tags what best solution for optimazaion & query speed? make a table for each relation like: table articlesToTags(ArticleID,TagID) table jobsToTags(jobid,tagid) etc. or put it all in one table like table tagsrelation(tagid,itemid,itemtype) I need your help. Please provide me with articles to help me in this design consider that in future the site can conation new section relate to tag Thanks

    Read the article

  • Inner join and outer join options in Entity Framework 4.0

    - by bigb
    I am using EF 4.0 and I need to implement query with one inner join and with N outer joins I started to implement this using different approaches but get into trouble at some point. Here is two examples how I started of doing this using ObjectQuery<'T' and Linq to Entity 1)Using ObjectQuery<'T' I implement flexible outer join but I don't know how to perform inner join with entity Rules in that case (by default Include("Rules") doing outer join, but i need to inner join by Id). public static IEnumerable<Race> GetRace(List<string> includes, DateTime date) { IRepository repository = new Repository(new BEntities()); ObjectQuery<Race> result = (ObjectQuery<Race>)repository.AsQueryable<Race>(); //perform outer joins with related entities if (includes != null) foreach (string include in includes) result = result.Include(include); //here i need inner join insteard of default outer join result = result.Include("Rules"); return result.ToList(); } 2)Using Linq To Entity I need to have kind of outer join(somethin like in GetRace()) where i may pass a List with entities to include) and also i need to perform correct inner join with entity Rules public static IEnumerable<Race> GetRace2(List<string> includes, DateTime date) { IRepository repository = new Repository(new BEntities()); IEnumerable<Race> result = from o in repository.AsQueryable<Race>() from b in o.RaceBetRules select new { o }); //I need here: // 1. to perform the same way inner joins with related entities like with ObjectQuery above //here i getting List<AnonymousType> which i cant cast to //IEnumerable<Race> when i did try to cast like //(IEnumerable<Race>)result.ToList(); i did get error: //Unable to cast object of type //'System.Collections.Generic.List`1[<>f__AnonymousType0`1[BetsTipster.Entity.Tip.Types.Race]]' //to type //'System.Collections.Generic.IEnumerable`1[BetsTipster.Entity.Tip.Types.Race]'. return result.ToList(); } May be someone have some ideas about that.

    Read the article

  • [Android] GPS can't run inside TimerTask

    - by user568553
    Hi, I am trying to write an android app that acquires a GPS signal at a fix time interval, for example every 1 minute. Since the requestLocationUpdate function does not exactly implement that, I tried to use task to accomplished it. public class getGPS extends TimerTask{ public void run(){ System.out.println("Running a GPS task"); locHandler = new locationUpdateHandler(); myManager.requestLocationUpdates(provider, 60000, 0, locHandler); } } public void LoadCoords(){ Timer timer = new Timer(); timer.scheduleAtFixedRate(new getGPS(), 0, 60000); } However, from what I've seen, requestLocationUpdates would run fine if I put it inside LoadCoords(), but would not run if I put it inside the TimerTask (ie no green icon on the task bar to show that GPS is looking for a fix). Can anyone please suggest an alternative approach or pseudo-code, or correct my mistake if there is one ? Thank you in advance.

    Read the article

  • Trobleshooting extremely slow opening times in Win7 for documents on Win2k8 server

    - by Mazupan
    Hello. It's hard even to describe my problem. It seems there's only problem with extreme slow openings (up to 10 minutes) on Windows 7 (on XP things works fine) for files that are stored on Windows Server 2008. And now what I discovered up till now. If I open (some files, not all, not allways) .doc and .xls files with doubleclicking it takes up to 10 minutes to finaly open the file. In that time, file seems to be locked for all other users. If I cancel opening, file remains locked for some time. Owner on that files is the one who last wrote changes in them. If I change the owner to larger group, which I am member of file gets opened super fast. When opened file can be saved normaly and fast. That file reopens fast. One other user reports that there is only problem when opening the files for the first time in a day. When he openes first file he has no problems with other files at all (or so he says). He also states that when accessing files from home via VPN he has no such problems with files. And now: anybody has a clue where to start looking? I suppose that is misconfiguration problem. But where? File system? Permissions? DFS? VMWare network config? My setup is as follows: Physical server: HP Prolian ML350 G6 Virtual host: VMWare ESXi 4 Guest: Windows Server 2008 Standard Files are accessed via DFS shares. Please help me. Thanks. Mazupan

    Read the article

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