Daily Archives

Articles indexed Thursday May 20 2010

Page 10/120 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How can I extract just the elements I want from a Perl array?

    - by Flamewires
    Hey I'm wondering how I can get this code to work. Basically I want to keep the lines of $filename as long as they contain the $user in the path: open STDERR, ">/dev/null"; $filename=`find -H /home | grep $file`; @filenames = split(/\n/, $filename); for $i (@filenames) { if ($i =~ m/$user/) { #keep results } else { delete $i; # does not work. } } $filename = join ("\n", @filenames); close STDERR; I know you can delete like delete $array[index] but I don't have an index with this kind of loop that I know of.

    Read the article

  • main.out.xml error

    - by husainsn
    Hello I installed Eclipse and Android ADT. When I create android project and try to run, I get following on main.out.xml file: This document is empty. Right click here to insert content However, main.xml file has xml data for layout. Please help what I need to do after right clicking. Thanks

    Read the article

  • Disabling home button on iPhone/iPad

    - by alku83
    First of all, I'm completely aware that doing this will get my app rejected by Apple, that it's a poor user experience, and so on. My question is fairly simple, is there a way using private APIs to disable the home button? The aim is to effectively put an iPad into kiosk mode.

    Read the article

  • Can my Facelets converter depend on a `ui:repeat` loop var?

    - by harto
    The following doesn't work as I'd hoped: <ul> <ui:repeat var="i" value="#{fn:split('1,2,3,4', ',')}"> <li> <h:outputText value="1.2345"> <f:convertNumber minFractionDigits="#{i}" maxFractionDigits="#{i}" /> </h:outputText> </li> </ui:repeat> </ul> I was hoping to see: 1.2 1.23 1.234 1.2345 Instead I see: 1 1 1 1 What am I missing? My real use-case involves a RichFaces rich:dataTable component instead of a ui:repeat, but the gist is the same.

    Read the article

  • How does this iterative Tower of Hanoi work? C

    - by Nitesh Panchal
    Hello, while surfing google, i found this interesting solution to Tower Of Hanoi which doesn't even use stack. Can anybody explain me in brief, what is it actually doing? And this solution really acceptable? #include <stdio.h> #include <stdlib.h> int main() { int n, x; printf( "How many disks? " ); scanf( "%d", &n ); printf("\n"); for (x=1; x < (1 << n); x++) printf( "move from tower %i to tower %i.\n", (x&x-1)%3, ((x|x-1)+1)%3 ); return 0; }

    Read the article

  • Horizontal UITableView

    - by imran
    I want implement a layout in my ipad application that has a uitable view that scrolls left and right rather then up and down : So rather than row 1 row 2 row 3 ( scrolling vertically ) It would be : row 1, row2, row 3 (scrolling horizontally ) I've seen that UItableView is designed to only do vertical scrolling so doing a transform does not give the desired effect. Is there a standard way to do this taking advantage of a datasource provider like uitableview provides? I basically want to do somthing similar to what the BBC News reader app ( http://itunes.apple.com/us/app/bbc-news/id364147881?mt=8 ) on the Ipad does with the list of stories to select from. Thanks

    Read the article

  • Multiple infowindows - tearing my hair out

    - by thewinchester
    Ok, I'll admit I'm nowhere near the best programmer on the planet - and I'm used to the answer staring me right in the face but not making sense of it. Problem I need to display multiple markers on a map, each with their own infowindow. I have created the individual markers without a problem, but don't know how to create the infowindows for each. Steps so far I am generating a map using the V3 API within an ASP-based website, with markers being created from a set of DB records. The markers are created by looping through a rs and defining a marker() with the relevant variables: var myLatlng = new google.maps.LatLng(lat,long); var marker = new google.maps.Marker({ map: map, position: myLatlng, title: 'locationname', icon: 'http://google-maps-icons.googlecode.com/files/park.png' }); This is creating all the relevant markers in their correct locations. What I need to do now, and am not sure of how to achieve is give each of them their own unique infowindow which I can use to display information and links relevant to that marker. Source <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script language="javascript"> $(document).ready(function() { //Google Maps var myOptions = { zoom: 5, center: new google.maps.LatLng(-26.66, 122.25), mapTypeControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP, navigationControl: true, navigationControlOptions: { style: google.maps.NavigationControlStyle.SMALL } } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); <!-- While locations_haslatlong not BOF.EOF --> <% While ((Repeat1__numRows <> 0) AND (NOT locations_haslatlong.EOF)) %> var myLatlng = new google.maps.LatLng(<%=(locations_haslatlong.Fields.Item("llat").Value)%>,<%=(locations_haslatlong.Fields.Item("llong").Value)%>); var marker = new google.maps.Marker({ map: map, position: myLatlng, title: '<%=(locations_haslatlong.Fields.Item("ldescription").Value)%>', icon: 'http://google-maps-icons.googlecode.com/files/park.png', clickable: true, }); <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 locations_haslatlong.MoveNext() Wend %> <!-- End While locations_haslatlong not BOF.EOF --> google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); google.maps.event.addListener(marker, 'dblclick', function() { map.setZoom(14); }); });

    Read the article

  • Full text index requires dropping and recreating - why?

    - by Amjid Qureshi
    Hi all, So I've got a web app running on .net 3.5 connected to a SQL 2005 box. We do scheduled releases every 2 weeks. About 14 tables out of 250 are full text indexed. After not every release, but a few too many, the indexes crap out. They seem to have data in there, but when we try to search them from the front end or SQL enterprise we get timeouts/hangs. We have a script that disables the indexes, drops them, deletes the catalog and then re creates the indexes. This fixes the problem 99 times out of 100. and the one other time, we run the script again and it all works We have tried just rebuilding the fulltext index but that doesn't fix the issue. My question is why do we have to do this ? what can we do to sort the index out? Here is a bit of the script, IF EXISTS (SELECT * FROM sys.fulltext_indexes fti WHERE fti.object_id = OBJECT_ID(N'[dbo].[Address]')) ALTER FULLTEXT INDEX ON [dbo].[Address] DISABLE GO IF EXISTS (SELECT * FROM sys.fulltext_indexes fti WHERE fti.object_id = OBJECT_ID(N'[dbo].[Address]')) DROP FULLTEXT INDEX ON [dbo].[Address] GO IF EXISTS (SELECT * FROM sysfulltextcatalogs ftc WHERE ftc.name = N'DbName.FullTextCatalog') DROP FULLTEXT CATALOG [DbName.FullTextCatalog] GO -- may need this line if we get an error BACKUP LOG SMS2 WITH TRUNCATE_ONLY CREATE FULLTEXT CATALOG [DbName.FullTextCatalog] ON FILEGROUP [FullTextCatalogs] IN PATH N'F:\Data' AS DEFAULT AUTHORIZATION [dbo] CREATE FULLTEXT INDEX ON [Address](CommonPlace LANGUAGE 'ENGLISH') KEY INDEX PK_Address ON [DbName.FullTextCatalog] WITH CHANGE_TRACKING AUTO go

    Read the article

  • Can't enumerate LinQ results with left join

    - by nvtthang
    var itemSet = from item in da.GetList<Models.account>() join file in objFileStorageList on item.account_id equals file.parent_id into objFile from fileItem in objFile.DefaultIfEmpty() where item.company != null && item.company.company_id == 123 orderby item.updatedDate descending select new { Id = item.account_id, RefNo = item.refNo, StartDate = item.StartDate , EndDate = item.EndDate , Comment = item.comment, FileStorageID = fileItem != null ? fileItem.fileStorage_id : -1, Identification = fileItem != null ? fileItem.identifier : null, fileName = fileItem != null ? fileItem.file_nm : null }; It raises error message when I try to enumerate through collection result from Linq query above. LINQ to Entities does not recognize the method 'System.Collections.Generic.IEnumerable1[SCEFramework.Models.fileStorage] DefaultIfEmpty[fileStorage](System.Collections.Generic.IEnumerable1[SCEFramework.Models.fileStorage])' method, and this method cannot be translated into a store expression foreach (var item in itemSet) { string itemRef= item.RefNo; } Please suggest me any solutions. Thanks in advance.

    Read the article

  • Why isn't DBIx::Class::Schema::Loader creating my classes?

    - by Robert Wohlfarth
    I am trying to generate static schemas using DBIx::Class in Perl. The command shown below outputs a Schema.pm and no other files. Any idea what I'm doing wrong, or how to to debug this? U:\wohlfarj\Software\PARS>perl -MDBIx::Class::Schema::Loader=make_schema_at,dump_to_dir:.\lib -e "make_schema_at('PARS::Schema',{debug=>1},['dbi:ODBC:PARS','user','password',{AutoCommit=>0}])" Dumping manual schema for PARS::Schema to directory .\lib ... Schema dump completed. I'm using Strawberry Perl on Windows XP. The database is SQL Server 2000, accessed through an ODBC connection. I can successfully run queries using plain old DBI with the same ODBC connection.

    Read the article

  • SQLAuthority News Professional Development andCommunity

    I was recently invited by Hyderabad Techies to deliver a keynote for their 16-day online session called TECH THUNDERS. This event has been running from May 15 and will continue up to the end of the month May 30). There would be a total of 30 sessions. In every evening of those 16 day, there [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Where to put the SPF TXT record?

    - by YellowSquirrel
    I've set up Google apps for my domain: I've registered the domain with Google by adding the CNAME Google asked and I've apparently succesfully setup the MX Google mail servers. So far I haven't yet a dedicated server: I'm just having a domain at a registrar. Now I want to activate SPF and I'm confused. In the following short webpage: http://www.google.com/support/a/bin/answer.py?answer=178723 it is written that I must add a TXT record containing: v=spf1 include:_spf.google.com ~all Where should I enter this? Should this go in the zone (?) file, like I did for the CNAME and the MX records? So far I have something like this: @ 10800 IN A 217.42.42.42 @ 10800 IN MX 5 ASPMX3.GOOGLEMAIL.COM. @ 10800 IN MX 5 ASPMX2.GOOGLEMAIL.COM. @ 10800 IN MX 3 ALT2.ASPMX.L.GOOGLE.COM. @ 10800 IN MX 3 ALT1.ASPMX.L.GOOGLE.COM. @ 10800 IN MX 1 ASPMX.L.GOOGLE.COM. google8a70835987f31e34 10800 IN CNAME google.com. Does adding the SPF TXT record mean I should literally have something like that: @ 10800 IN A 217.42.42.42 @ 10800 IN MX 5 ASPMX3.GOOGLEMAIL.COM. @ 10800 IN MX 5 ASPMX2.GOOGLEMAIL.COM. @ 3600 IN TXT "v=spf1 include:_spf.google.com ~all" @ 10800 IN MX 3 ALT2.ASPMX.L.GOOGLE.COM. @ 10800 IN MX 3 ALT1.ASPMX.L.GOOGLE.COM. @ 10800 IN MX 1 ASPMX.L.GOOGLE.COM. google8a70835987f31e34 10800 IN CNAME google.com. I made that one up and included right in the middle to show how confused I am. What I'd like to know is the exact syntax and where/how I should put this TXT record.

    Read the article

  • In CSS, want to override my a:link and a:hover directives to for a specific span

    - by brendan
    This will probably be a softball for you CSS folks... I have a site like this: <div id="header"> <span class="myheader">This is the name of my awesome site!!!!</span> </div> <div id="content">whole bunch of other stuff</div> <div="sidemenu"><ul><li>something</li><li>something else</li></ul> <div id="footer">Some footer stuff will go here....</div> In my css I have some directives to format the hyperlinks: a:link { text-decoration: none; color : #ff6600; border: 0px; -moz-outline-style: none;} a:active { text-decoration: underline; color : #ff6600; border: 0px; -moz-outline-style: none;} a:visited { text-decoration: none; color : #ff6600; border: 0px; -moz-outline-style: none;} a:hover { text-decoration: underline; color : #000; border: 0px; -moz-outline-style: none;} a:focus { outline: none;-moz-outline-style: none;} Now here is the problem. In my header I have some text that is a link, but I do not want to to format it like all the other links in the site. So basically I want my a:link, a:hover, etc to ignore anything in the "header" div. How can I do this? Assume I need to override this for that div/span?

    Read the article

  • What is your favourite cleverly written functional code?

    - by sdcvvc
    What are your favourite short, mind-blowing snippets in functional languages? My two favourite ones are (Haskell): powerset = filterM (const [True, False]) foldl f v xs = foldr (\x g a -> g (f a x)) id xs v -- from Hutton's tutorial (I tagged the question as Haskell, but examples in all languages - including non-FP ones - are welcome as long as they are in functional spirit.)

    Read the article

  • Optimize LINQ Query for use with jQuery Autocomplete

    - by rockinthesixstring
    I'm working on building an HTTPHandler that will serve up plain text for use with jQuery Autocomplete. I have it working now except for when I insert the first bit of text it does not take me to the right portion of the alphabet. Example: If I enter Ne my drop down returns Nlabama Arkansas Notice the "N" from Ne and the "labama" from "Alabama" As I type the third character New, then the jQuery returns the "N" section of the results. My current code looks like this Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest ' the page contenttype is plain text' HttpContext.Current.Response.ContentType = "text/plain" ' store the querystring as a variable' Dim qs As Nullable(Of Integer) = Integer.TryParse(HttpContext.Current.Request.QueryString("ID"), Nothing) ' use the RegionsDataContext' Using RegionDC As New DAL.RegionsDataContext 'create a (q)uery variable' Dim q As Object ' if the querystring PID is not blank' ' then we want to return results based on the PID' If Not qs Is Nothing Then ' that fit within the Parent ID' q = (From r In RegionDC.bt_Regions _ Where r.PID = qs _ Select r.Region).ToArray ' now we loop through the array' ' and write out the ressults' For Each item In q HttpContext.Current.Response.Write(item & vbCrLf) Next End If End Using End Sub So where I'm at now is the fact that I stumbled on the "Part" portion of the Autocomplete method whereby I should only return information that is contained within the Part. My question is, how would I implement this concept into my HTTPHandler without doing a fresh SQLQuery on every character change? IE: I do the SQL Query on the QueryString("ID"), and then on every subsequent load of the same ID, we just filter down the "Part". http://www.example.com/ReturnRegions.axd?ID=[someID]&Part=[string]

    Read the article

  • how can add an extra select in this query?

    - by BulgedSnowy
    i've three tables related. images: id | filename | filesize | ... nodes: image_id | tag_id tags: id | name And i'm using this query to search images containing x tags SELECT images.* FROM images INNER JOIN nodes ON images.id = nodes.image_id WHERE tag_id IN (SELECT tags.id FROM tags WHERE tags.tag IN ("tag1","tag2")) GROUP BY images.id HAVING COUNT(*)= 2 The problem is that i need to retrieve also all images contained by the retrieved image, and i need this in the same query. This the actual query wich search retrieve all tags contained by the image: SELECT tag FROM nodes JOIN tags ON nodes.tag_id = tags.id WHERE image_id = images.id and nodes.private = images.private ORDER BY tag How can i mix this two to have only one query?

    Read the article

  • UITableViewCell imageView.contentMode doesn't work in 3.0

    - by JustinXXVII
    In UITableViewCellStyleDefault, setting the contentMode on the imageView has no result. If I change my build SDK to version 3.1, everything again works. I don't get any warnings or errors when compiling on 3.0 but this code: cell.imageView.contentMode = UIViewContentModeScaleAspectFit; cell.imageView.image = [UIImage imageNamed:[[NSString stringWithFormat:@"%@head.jpg",[gametype objectAtIndex:indexPath.row]]lowercaseString]]; seems to default to the UIViewContentModeCenter, so all of my pictures exceed the cell boundaries and encroach on neighboring cells. Let me reiterate that if I change my target to 3.1 everything works correctly and all pictures are scaled accordingly to fit in the default imageView Is this a known bug?

    Read the article

  • Changing the size of the UISearchBar TextField ?

    - by Padraig
    I have a UITableView with an Index on the side; I want to add a UISearchBar to it, but the index overlaps with the "x" to clear the search. I've noticed in the Contacts application, the textfield within the UISearchBar is resized to accommodate this, but I can't work out how to do this in my own app. I have tried the following in my viewDidLoad, but it does not seem to work. UITextField * textField = (UITextField *)[[self.search subviews] objectAtIndex:0]; CGRect r = textField.frame; [textField setFrame:CGRectMake(r.origin.x, r.origin.y, r.size.height, r.size.width-30)]; Any ideas?

    Read the article

  • Images are overflowing their container in IE8 with Fancybox

    - by alex
    In a sort of follow up to this question, I have another problem in IE8. When clicking the gallery and the lightbox appears, the images are overflowing their containing element (by the looks of things). Has anyone ever experienced this before? Of course, the good guys (Firefox/Safari/etc) display it perfectly. How do I fix this? Thanks UPDATE Should I just got with a new Lightbox?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >