Search Results

Search found 3309 results on 133 pages for 'relative positioning'.

Page 20/133 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • How does file creation work in Java

    - by Ankur
    I am trying to create a file using File newFile = new File("myFile"); However no file called "myFile" is created. This is within a Web application Project i.e. proper form to be pakaged as a WAR but I am calling it as part of a main method (just to see how this works). How can I make it so that a new file is created at a location relative to the current one i.e not have to put in an absolute path.

    Read the article

  • Accessing JAR resources

    - by Pablo Fernandez
    I have a jar file with resources (mainly configuration for caches, logging, etc) that I want to distribute. I'm having a problem with the relative paths for those resources, so I did what I've found in another stackoverflow question, which said that this was a valid way: ClassInTheSamePackageOfTheResource.class.getResourceAsStream('resource.xml'); Sadly this does not work. Any ideas? Thanks! PS: Obviously I cannot use absolute paths, and I'd like to avoid environment variables if possible

    Read the article

  • image url helper for sinatra?

    - by yaya3
    I'm looking for an image url helper for sinatra that allows me to do something similar to staticmatic's, where I can shortcut to a relative path like so... =img "me.jpg" Can anybody point me in the direction to where this might be online, or where I could learn how to write one, or provide an example of one they have already written Many thanks

    Read the article

  • WPF - simple relative path - FindAncestor

    - by user309392
    In the XAML below the ToolTip correctly binds to RelativeSource Self. However, I can't for the life of me work out how to get the TextBlock in the commented block to refer to SelectedItem.Description <Controls:RadComboBoxWithCommand x:Name="cmbPacking" Grid.Row="2" Grid.Column="5" ItemsSource="{Binding PackingComboSource}" DisplayMemberPath="DisplayMember" SelectedValuePath="SelectedValue" SelectedValue="{Binding ElementName=dataGrid1, Path=SelectedItem.PackingID}" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem.Description}" IsSynchronizedWithCurrentItem="True" Style="{StaticResource comboBox}"> <!-- <Controls:RadComboBoxWithCommand.ToolTip>--> <!-- <TextBlock Text="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem.Description}" TextWrapping="Wrap" Width="50"/>--> <!-- </Controls:RadComboBoxWithCommand.ToolTip>--> </Controls:RadComboBoxWithCommand> I would appreciate any suggestions Thanks - Jeremy

    Read the article

  • CSS issue with elements spanning columns

    - by bigFoot
    Hi folks. Overview: I'm trying to create a relatively simple page layout detailed below and running into problems no matter how I try to approach it. Concept: - A standard-size-block layout. I'll quote unit widths: each content block is 240px square with 5px of margin around it. - A left column of fixed width of 1 unit (245px - 1 block + margin to left). No problems here. - A right column of variable width to fill the remaining space. No problems here either. - In the left column, a number of 1unit x 1unit blocks fixed down the column. Also some blank space at the top - again, not a problem. - In the right column: a number of free-floating blocks of standard unit-sizes which float around and fill the space given to them by the browser window. No problems here. - Lastly, a single element, 2 units wide, which sits half in the left column and half in the right column, and which the blocks in the right column still float around. Here be dragons. Please see here for a diagram: http://is.gd/bPUGI Problem: No matter how I approach this, it goes wrong. Below is code for my existing attempt at a solution. My current problem is that the 1x1 blocks on the right do not respect the 2x1 block, and as a result half of the 2x1 block is overwritten by a 1x1 block in the right-hand column. I'm aware that this is almost certainly an issue with position: absolute taking things out of flow. However, can't really find a way round that which doesn't just throw up another problem instead. Code: <html> <head> <title>wat</title> <style type="text/css"> body { background: #ccc; color: #000; padding: 0px 5px 5px 0px; margin: 0px; } #leftcol { width: 245px; margin-top: 490px; position: absolute; } #rightcol { left: 245px; position: absolute; } #bigblock { float: left; position: relative; margin-top: -240px; background: red; } .cblock { margin: 5px 0px 0px 5px; float: left; overflow: hidden; display: block; background: #fff; } .w1 { width: 240px; } .w2 { width: 485px; } .l1 { height: 240px; } </head> <body> <div class="cblock w2 l1" id="bigblock"> <h1>DRAGONS</h1> <p>Here be they</p> </div> <div id="leftcol"> <div class="cblock w1 l1"> <h1>Left 1</h1> <p>1x1 block</p> </div> </div> <div id="rightcol"> <div class="cblock w1 l1"> <h1>Right 1</h1> <p>1x1 block</p> </div> <div class="cblock w1 l1"> <h1>Right 2</h1> <p>1x1 block</p> </div> <div class="cblock w1 l1"> <h1>Right 3</h1> <p>1x1 block</p> </div> <div class="cblock w1 l1"> <h1>Right 4</h1> <p>1x1 block</p> </div> <div class="cblock w1 l1"> <h1>Right 5</h1> <p>1x1 block</p> </div> <div class="cblock w1 l1"> <h1>Right 6</h1> <p>1x1 block</p> </div> <div class="cblock w1 l1"> <h1>Right 7</h1> <p>1x1 block</p> </div> </div> </body> </html> Constraints: One final note that I need cross-browser compatibility, though I'm more than happy to enforce this with JS if necessary. That said, if a CSS-only solution exists, I'd be extremely happy. Thanks in advance!

    Read the article

  • hta/ javascript How to execute an application with relative path

    - by user1644062
    I'm building a .hta (with javascript) from which i want to launch several applications. But when i execute my .hta i get the error message can't find file this is the code: <script type="text/javascript" language="javascript"> function RunFile(path) { var relpath = window.location.href; var fullpath = relpath + path; WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run(fullpath, 1, false); } RunFile("\file.exe"); </script>

    Read the article

  • CSS Hidden DIV Scroll to view

    - by Dasa
    <DIV CLASS="fact" ID="xnews-4" > <DIV CLASS="storyheadline"> <DIV CLASS="vote up"><A ID="xvotes-4" HREF="javascript:vote(0,258160,4,'f3d3d9c1885fb8508bdbde825d0dfd6e',10)">1</A><A ID="xvote-4" HREF="javascript:vote(0,258160,4,'f3d3d9c1885fb8508bdbde825d0dfd6e',10)"><strong>Vote</strong></A> </DIV> <DIV CLASS="title" ID="title-4"><H2><A HREF="/story.php?title=this-article-is-about-the-song">This article is about the song.</A></H2> </DIV> </DIV> <DIV CLASS="storycontent subtext hidden" ID="plus4" style="display: none;"> <DIV>Posted by <A HREF="/user.php?login=fact-o-matic">fact-o-matic</A> 2 minutes ago | Source: Editorial<SPAN ID="ls_adminlinks-4" style="display:none"> </SPAN> </DIV> <DIV> <DIV CLASS="floatleft"> <A HREF="/story.php?title=this-article-is-about-the-song"> Read More</A>&nbsp;|<SPAN ID="ls_comments_url-4"> <SPAN CLASS="linksummaryDiscuss"><A HREF="/story.php?title=this-article-is-about-the-song#discuss" CLASS="comments">Discuss</A></SPAN></SPAN> <SPAN ID="xreport-4"><SPAN CLASS="linksummaryBury">| <A HREF="javascript:vote(0,258160,4,'f3d3d9c1885fb8508bdbde825d0dfd6e',-10)">Bury</A></SPAN></SPAN> |&nbsp; <span id="emailto-4" style="display:none"></span><span id="linksummaryAddLink"> <a href="javascript://" onclick="var replydisplay=document.getElementById('addto-4').style.display ? '' : 'none';document.getElementById('addto-4').style.display = replydisplay;"> Add To</a>&nbsp; </span> <span id="addto-4" style="display:none"> <div style="position:absolute;display:block;background:#fff;padding:10px;margin:10px 0 0 100px;font-size:12px;border:2px solid #000;"> &nbsp;&nbsp;<a title="submit 'This article is about the song.' to del.icio.us" href="http://del.icio.us/post" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.factmeme.com%2Fstory.php%3Ftitle%3Dthis-article-is-about-the-song&amp;title=This+article+is+about+the+song.', '','toolbar=no,width=700,height=400'); return false;"><img src="http://www.factmeme.com/modules/social_bookmark/images/delicious.png" border="0" alt="submit 'This article is about the song.' to del.icio.us" /></a> &nbsp;&nbsp;<a title="submit 'This article is about the song.' to digg" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.factmeme.com%2Fstory.php%3Ftitle%3Dthis-article-is-about-the-song&amp;title=This article is about the song.&amp;bodytext="><img src="http://www.factmeme.com/modules/social_bookmark/images/digg.png" border="0" alt="submit 'This article is about the song.' to digg" /></a> &nbsp;&nbsp;<a title="submit 'This article is about the song.' to reddit" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.factmeme.com%2Fstory.php%3Ftitle%3Dthis-article-is-about-the-song&amp;title=This article is about the song."><img src="http://www.factmeme.com/modules/social_bookmark/images/reddit.gif" border="0" alt="submit 'This article is about the song.' to reddit" /></a> &nbsp;&nbsp;<a title="submit 'This article is about the song.' to facebook" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.factmeme.com%2Fstory.php%3Ftitle%3Dthis-article-is-about-the-song&t=This article is about the song."><img src="http://www.factmeme.com/modules/social_bookmark/images/facebook.gif" border="0" alt="submit 'This article is about the song.' to facebook" /></a> &nbsp;&nbsp;<a title="submit 'This article is about the song.' to technorati" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.factmeme.com%2Fstory.php%3Ftitle%3Dthis-article-is-about-the-song"><img src="http://www.factmeme.com/modules/social_bookmark/images/technorati.gif" border="0" alt="submit 'This article is about the song.' to technorati" /></a> &nbsp;&nbsp;<a title="submit 'This article is about the song.' to slashdot" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.factmeme.com%2Fstory.php%3Ftitle%3Dthis-article-is-about-the-song&title=This article is about the song."><img src="http://www.factmeme.com/modules/social_bookmark/images/slashdot.gif" border="0" alt="submit 'This article is about the song.' to slashdot" /></a> &nbsp;&nbsp;<a title="submit 'This article is about the song.' to Stumbleupon" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.factmeme.com%2Fstory.php%3Ftitle%3Dthis-article-is-about-the-song&amp;title=This article is about the song."><img src="http://www.factmeme.com/modules/social_bookmark/images/icon-stumbleupon.gif" border="0" alt="submit 'This article is about the song.' to Stumbleupon" /></a> &nbsp;&nbsp;<a title="submit 'This article is about the song.' to Windows Live" href="https://favorites.live.com/quickadd.aspx?url=http%3A%2F%2Fwww.factmeme.com%2Fstory.php%3Ftitle%3Dthis-article-is-about-the-song&title=This article is about the song."><img src="http://www.factmeme.com/modules/social_bookmark/images/windowslive.gif" border="0" alt="submit 'This article is about the song.' to Windows Live" /></a> &nbsp;&nbsp;<a title="submit 'This article is about the song.' to squidoo" href="http://www.squidoo.com/lensmaster/bookmark?http%3A%2F%2Fwww.factmeme.com%2Fstory.php%3Ftitle%3Dthis-article-is-about-the-song"><img src="http://www.factmeme.com/modules/social_bookmark/images/squidoo.gif" border="0" alt="submit 'This article is about the song.' to squidoo" /></a> &nbsp;&nbsp;<a title="submit 'This article is about the song.' to yahoo" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.factmeme.com%2Fstory.php%3Ftitle%3Dthis-article-is-about-the-song&amp;title=This article is about the song."><img src="http://www.factmeme.com/modules/social_bookmark/images/yahoomyweb.png" border="0" alt="submit 'This article is about the song.' to yahoo" /></a> &nbsp;&nbsp;<a title="submit 'This article is about the song.' to google" href="http://www.google.com/bookmarks/mark?op=edit&bkmk=http%3A%2F%2Fwww.factmeme.com%2Fstory.php%3Ftitle%3Dthis-article-is-about-the-song&title=This article is about the song."><img src="http://www.factmeme.com/modules/social_bookmark/images/googlebookmarks.gif" border="0" alt="submit 'This article is about the song.' to google" /></a> &nbsp;&nbsp;<a title="submit 'This article is about the song.' to ask" href=" http://myjeeves.ask.com/mysearch/BookmarkIt?v=1.2&t=webpages&url=http%3A%2F%2Fwww.factmeme.com%2Fstory.php%3Ftitle%3Dthis-article-is-about-the-song&title=This article is about the song."><img src="http://www.factmeme.com/modules/social_bookmark/images/ask.gif" border="0" alt="submit 'This article is about the song.' to ask" /></a> <hr /> <p style="font-size:16px;font-weight:bold;margin:0px;">Story URL</p> <script type="text/javascript"> function select_all() { var text_val=eval("document.storyurl.thisurl"); text_val.focus(); text_val.select(); } </script> <form name="storyurl"><input type="text" name="thisurl" size="92" onClick="select_all();" value="http://www.factmeme.com/story.php?title=this-article-is-about-the-song"></form> </div> </span> </DIV> <DIV CLASS="floatright"> <A HREF="/index.php?category=culture">Culture</A> | <A HREF="/search.php?search=Olavi&amp;tag=true">Olavi</A> <A HREF="/search.php?search=Olavi&amp;tag=true">All</A> </DIV> </DIV></DIV> <DIV CLASS="more show"></DIV> </DIV> when I click on the add to, a box is supposed to popup with options to add the story to other websites The problem is that nothing appears to happen, even though something is actually happening, the only way to see the add too box is to click on scroll to view in inspect element in firefox and even then the box appears in the wrong place I am almost certain that it is a positioning conflict but I cant work it out How can I fix it

    Read the article

  • Relative width for a CSS layout, fixed and fluid mix

    - by Alec Smart
    Hello, I am trying to make a chatroom layout like the following: Now my problem is that I am not sure how to have the container box occupy the whole width and height (with valid doctype) and then make the center div grow if the window grows keeping the rest constant. i am well aware of js/css. so i just need some beginning guideline. i would like to avoid javascript to process and then set heights and widths.

    Read the article

  • Relative XPath node selection with C# XmlDocument

    - by lox
    Imagine the following XML document: <root> <person_data> <person> <name>John</name> <age>35</age> </person> <person> <name>Jim</name> <age>50</age> </person> </person_data> <locations> <location> <name>John</name> <country>USA</country> </location> <location> <name>Jim</name> <country>Japan</country> </location> </locations> </root> I then select the person node for Jim: XmlNode personNode = doc.SelectSingleNode("//person[name = 'Jim']"); And now from this node with a single XPath select I would like to retrieve Jim's location node. Something like: XmlNode locationNode = personNode.SelectSingleNode("//location[name = {reference to personNode}/name]"); Since I am selecting based on the personNode it would be handy if I could reference it in the select. Is this possible?.. is the connection there? Sure I could put in a few extra lines of code and put the name into a variable and use this in the XPath string but that is not what I am asking.

    Read the article

  • Scaling MKMapView Annotations relative to the zoom level

    - by Jonathan
    The Problem I'm trying to create a visual radius circle around a annonation, that remains at a fixed size in real terms. Eg. So If i set the radius to 100m, as you zoom out of the Map view the radius circle gets progressively smaller. I've been able to achieve the scaling, however the radius rect/circle seems to "Jitter" away from the Pin Placemark as the user manipulates the view. The Manifestation Here is a video of the behaviour. The Implementation The annotations are added to the Mapview in the usual fashion, and i've used the delegate method on my UIViewController Subclass (MapViewController) to see when the region changes. -(void)mapView:(MKMapView *)pMapView regionDidChangeAnimated:(BOOL)animated{ //Get the map view MKCoordinateRegion region; CGRect rect; //Scale the annotations for( id<MKAnnotation> annotation in [[self mapView] annotations] ){ if( [annotation isKindOfClass: [Location class]] && [annotation conformsToProtocol:@protocol(MKAnnotation)] ){ //Approximately 200 m radius region.span.latitudeDelta = 0.002f; region.span.longitudeDelta = 0.002f; region.center = [annotation coordinate]; rect = [[self mapView] convertRegion:foo toRectToView: self.mapView]; if( [[[self mapView] viewForAnnotation: annotation] respondsToSelector:@selector(setRadiusFrame:)] ){ [[[self mapView] viewForAnnotation: annotation] setRadiusFrame:rect]; } } } The Annotation object (LocationAnnotationView)is a subclass of the MKAnnotationView and it's setRadiusFrame looks like this -(void) setRadiusFrame:(CGRect) rect{ CGPoint centerPoint; //Invert centerPoint.x = (rect.size.width/2) * -1; centerPoint.y = 0 + 55 + ((rect.size.height/2) * -1); rect.origin = centerPoint; [self.radiusView setFrame:rect]; } And finally the radiusView object is a subclass of a UIView, that overrides the drawRect method to draw the translucent circles. setFrame is also over ridden in this UIView subclass, but it only serves to call [UIView setNeedsDisplay] in addition to [UIView setFrame:] to ensure that the view is redrawn after the frame has been updated. The radiusView object's (CircleView) drawRect method looks like this -(void) drawRect:(CGRect)rect{ //NSLog(@"[CircleView drawRect]"); [self setBackgroundColor:[UIColor clearColor]]; //Declarations CGContextRef context; CGMutablePathRef path; //Assignments context = UIGraphicsGetCurrentContext(); path = CGPathCreateMutable(); //Alter the rect so the circle isn't cliped //Calculate the biggest size circle if( rect.size.height > rect.size.width ){ rect.size.height = rect.size.width; } else if( rect.size.height < rect.size.width ){ rect.size.width = rect.size.height; } rect.size.height -= 4; rect.size.width -= 4; rect.origin.x += 2; rect.origin.y += 2; //Create paths CGPathAddEllipseInRect(path, NULL, rect ); //Create colors [[self areaColor] setFill]; CGContextAddPath( context, path); CGContextFillPath( context ); [[self borderColor] setStroke]; CGContextSetLineWidth( context, 2.0f ); CGContextSetLineCap(context, kCGLineCapSquare); CGContextAddPath(context, path ); CGContextStrokePath( context ); CGPathRelease( path ); //CGContextRestoreGState( context ); } Thanks for bearing with me, any help is appreciated. Jonathan

    Read the article

  • Relative Resizing of Forms in C#

    - by xarzu
    What is the magic that makes components cling to the edges of a form? I had thought that one must use the resize event of the form and them force each element in the form to resize. But then I saw some sample code which, even when I am editing the form, the elements seem to adhere to a percentage of the space they take up in the form rather than a set diminsion. In other words, when I am editing the form and resizing it, the panels and the parts inside the form bend their shape such that the edges remain a few pixels from the edges. But in my own program I have not been able to find where I can duplicate this feature. When I run my program, this (http://i67.photobucket.com/albums/h292/Athono/microsoft/001.jpg) goes to this (http://i67.photobucket.com/albums/h292/Athono/microsoft/002.jpg)

    Read the article

  • Android relative layout problem

    - by DixieFlatline
    Hello! I just can't display the button at the bottom of the screen. I have 2 textviews and 2 edittexts set as gone, and they become visible when user clicks checkbox. It's only then that my button gets positioned properly Otherwise it sits on top of the app at launch of my app.(see here: http://www.shrani.si/f/3V/10G/4nnH4DtV/layoutproblem.png) I also tried android:layout_alignParentBottom="true" but that doesnt help either. <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="wrap_content"> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/txt1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Krajevna skupnost: " android:layout_alignParentTop="true" /> <Spinner android:id="@+id/spinner1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:prompt="@string/ks_prompt" android:layout_below="@id/txt1" /> <TextView android:id="@+id/txt2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Zadeva: " android:layout_below="@id/spinner1" /> <Spinner android:id="@+id/spinner2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:prompt="@string/pod_prompt" android:layout_below="@id/txt2" /> <TextView android:id="@+id/tv1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Zadeva: " android:layout_below="@id/spinner2" /> <EditText android:id="@+id/prvi" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/tv1" /> <TextView android:id="@+id/tv2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/prvi" android:text="Vsebina: " /> <EditText android:id="@+id/drugi" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/tv2" /> <CheckBox android:id="@+id/cek" android:text="Obvešcaj o odgovoru" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/drugi" /> <TextView android:id="@+id/tv3" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/cek" android:text="Email: " android:visibility="gone"/> <EditText android:id="@+id/tretji" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/tv3" android:visibility="gone" /> <TextView android:id="@+id/tv4" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/tretji" android:visibility="gone" android:text="Telefon: " /> <EditText android:id="@+id/cetrti" android:layout_width="fill_parent" android:layout_height="wrap_content" android:visibility="gone" android:layout_below="@id/tv4" /> <Button android:id="@+id/gumb" android:text="Klikni" android:typeface="serif" android:textStyle="bold" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:layout_below="@id/cetrti" /> </RelativeLayout> </ScrollView>

    Read the article

  • Relative Resizing of Forms in .NET

    - by xarzu
    What is the magic that makes components cling to the edges of a form? I had thought that one must use the resize event of the form and them force each element in the form to resize. But then I saw some sample code which, even when I am editing the form, the elements seem to adhere to a percentage of the space they take up in the form rather than a set diminsion. In other words, when I am editing the form and resizing it, the panels and the parts inside the form bend their shape such that the edges remain a few pixels from the edges. But in my own program I have not been able to find where I can duplicate this feature. When I run my program, this goes to this

    Read the article

  • Relative paths in C#

    - by Suraj
    I need some help with paths please! Basically I have a project with the following folder structure: Project (root directory which contains the .sln file etc.) Project/MyProj (contains the code) Project/MyProjTest (the test folder) Project/TestResults Now with this Project I need to have a common folder where I can stick a bunch of files for use with the Application without having to copy the files to multiple locations etc. What is the best way to do this? Ideally I would like to have the folder as Project/ResourcesFolder, so that both the Code folder and Test folder can access it. Now if this is the case how do I call this folder from within C#? I've tried Application.StartupPath, Environment.GetCurrentDirectory but they both just return the CURRENT folder which is not what I want. Thanks in advance.

    Read the article

  • How do I place widgets above and below a listview with Relative Layout

    - by Jay Askren
    I have a list view and want to put stuff both above(on the y axis) and below(y axis) it including images, text views, and a row of buttons. Below is a simplified version of what I am creating. Unfortunately the list covers(i.e. above on the z axis) the header so the header text is not visible instead of being underneath (on the y axis) <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:id="@+id/footer" android:text="footer" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentBottom="true" /> <ListView android:id="@+id/list_view" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_above="@id/footer" android:background="#ff9999ff"/> <TextView android:id="@+id/header" android:text="header" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentTop="true" android:layout_above="@id/list_view" android:baselineAlignBottom="false" /> </RelativeLayout> Here is the corresponding Activity class: public class SampleListActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list_activity); } }

    Read the article

  • Jquery Cycle Plugin Question - turning off relative links to photos so it goes to a URL

    - by alpdog14
    I am using Jquery Cycle Plugin and it has a side panel that highlights as the photos change and currently when I click on the text the associated photo pulls up then I have to click on the photo to go to the URL but I would like the text itself to link to the URL. I have looked at the fn.cycle.defaults but not sure what to change and I tried a few things but nothing works. If anyone can help me figure this out it would be most helpful. Here are the fn.cycle.defaults: fx: 'fade', // one of: fade, shuffle, zoom, scrollLeft, etc timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance) continuous: 0, // true to start next transition immediately after current one completes speed: 1000, // speed of the transition (any valid fx speed value) speedIn: null, // speed of the 'in' transition speedOut: null, // speed of the 'out' transition next: null, // id of element to use as click trigger for next slide prev: null, // id of element to use as click trigger for previous slide prevNextClick: null, // callback fn for prev/next clicks: function(isNext, zeroBasedSlideIndex, slideElement) pager: null, // id of element to use as pager container pagerClick: null, // callback fn for pager clicks: function(zeroBasedSlideIndex, slideElement) pagerEvent: null, // event which drives the pager navigation pagerAnchorBuilder: null, // callback fn for building anchor links before: null, // transition callback (scope set to element to be shown) after: null, // transition callback (scope set to element that was shown) end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options) easing: null, // easing method for both in and out transitions easeIn: null, // easing for "in" transition easeOut: null, // easing for "out" transition shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 } animIn: null, // properties that define how the slide animates in animOut: null, // properties that define how the slide animates out cssBefore: null, // properties that define the initial state of the slide before transitioning in cssAfter: null, // properties that defined the state of the slide after transitioning out fxFn: null, // function used to control the transition height: 'auto', // container height startingSlide: 0, // zero-based index of the first slide to be displayed sync: 1, // true if in/out transitions should occur simultaneously random: 0, // true for random, false for sequence (not applicable to shuffle fx) fit: 0, // force slides to fit container pause: true, // true to enable "pause on hover" autostop: 0, // true to end slideshow after X transitions (where X == slide count) autostopCount: 0, // number of transitions (optionally used with autostop to define X) delay: 0, // additional delay (in ms) for first transition (hint: can be negative) slideExpr: null, // expression for selecting slides (if something other than all children is required) cleartype: 0, // true if clearType corrections should be applied (for IE) nowrap: 0 // true to prevent slideshow from wrapping }; I have tried changing the pageClick and pagerEvent but nothing seems to be working. Please help!!!

    Read the article

  • Reusing XSL template to be invoked with different relative XPaths

    - by meomaxy
    Here is my contrived example that illustrates what I am attempting to accomplish. I have an input XML file that I wish to flatten for further processing. Input file: <BICYCLES> <BICYCLE> <COLOR>BLUE</COLOR> <WHEELS> <WHEEL> <WHEEL_TYPE>FRONT</WHEEL_TYPE> <FLAT>NO</FLAT> <REFLECTORS> <REFLECTOR> <REFLECTOR_NUM>1</REFLECTOR_NUM> <COLOR>RED</COLOR> <SHAPE>SQUARE</SHAPE> </REFLECTOR> <REFLECTOR> <REFLECTOR_NUM>2</REFLECTOR_NUM> <COLOR>WHITE</COLOR> <SHAPE>ROUND</SHAPE> </REFLECTOR> </REFLECTORS> </WHEEL> <WHEEL> <WHEEL_TYPE>REAR</WHEEL_TYPE> <FLAT>NO</FLAT> </WHEEL> </WHEELS> </BICYCLE> </BICYCLES> The input is a list of <BICYCLE> nodes. Each <BICYCLE> has a <COLOR> and optionally has <WHEELS>. <WHEELS> is a list of <WHEEL> nodes, each of which has a few attributes, and optionally has <REFLECTORS>. <REFLECTORS> is a list of <REFLECTOR> nodes, each of which has a few attributes. The goal is to flatten this XML. This is the XSL I'm using: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions"> <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes" xml:space="preserve"/> <xsl:template match="/"> <BICYCLES> <xsl:apply-templates/> </BICYCLES> </xsl:template> <xsl:template match="BICYCLE"> <xsl:choose> <xsl:when test="WHEELS"> <xsl:apply-templates select="WHEELS"/> </xsl:when> <xsl:otherwise> <BICYCLE> <COLOR><xsl:value-of select="COLOR"/></COLOR> <WHEEL_TYPE/> <FLAT/> <REFLECTOR_NUM/> <COLOR/> <SHAPE/> </BICYCLE> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="WHEELS"> <xsl:apply-templates select="WHEEL"/> </xsl:template> <xsl:template match="WHEEL"> <xsl:choose> <xsl:when test="REFLECTORS"> <xsl:apply-templates select="REFLECTORS"/> </xsl:when> <xsl:otherwise> <BICYCLE> <COLOR><xsl:value-of select="../../COLOR"/></COLOR> <WHEEL_TYPE><xsl:value-of select="WHEEL_TYPE"/></WHEEL_TYPE> <FLAT><xsl:value-of select="FLAT"/></FLAT> <REFLECTOR_NUM/> <COLOR/> <SHAPE/> </BICYCLE> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="REFLECTORS"> <xsl:apply-templates select="REFLECTOR"/> </xsl:template> <xsl:template match="REFLECTOR"> <BICYCLE> <COLOR><xsl:value-of select="../../../../COLOR"/></COLOR> <WHEEL_TYPE><xsl:value-of select="../../WHEEL_TYPE"/></WHEEL_TYPE> <FLAT><xsl:value-of select="../../FLAT"/></FLAT> <REFLECTOR_NUM><xsl:value-of select="REFLECTOR_NUM"/></REFLECTOR_NUM> <COLOR><xsl:value-of select="COLOR"/></COLOR> <SHAPE><xsl:value-of select="SHAPE"/></SHAPE> </BICYCLE> </xsl:template> </xsl:stylesheet> The output is: <BICYCLES xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <BICYCLE> <COLOR>BLUE</COLOR> <WHEEL_TYPE>FRONT</WHEEL_TYPE> <FLAT>NO</FLAT> <REFLECTOR_NUM>1</REFLECTOR_NUM> <COLOR>RED</COLOR> <SHAPE>SQUARE</SHAPE> </BICYCLE> <BICYCLE> <COLOR>BLUE</COLOR> <WHEEL_TYPE>FRONT</WHEEL_TYPE> <FLAT>NO</FLAT> <REFLECTOR_NUM>2</REFLECTOR_NUM> <COLOR>WHITE</COLOR> <SHAPE>ROUND</SHAPE> </BICYCLE> <BICYCLE> <COLOR>BLUE</COLOR> <WHEEL_TYPE>REAR</WHEEL_TYPE> <FLAT>NO</FLAT> <REFLECTOR_NUM/> <COLOR/> <SHAPE/> </BICYCLE> </BICYCLES> What I don't like about this is that I'm outputting the color attribute in several forms: <COLOR><xsl:value-of select="../../../../COLOR"/></COLOR> <COLOR><xsl:value-of select="../../COLOR"/></COLOR> <COLOR><xsl:value-of select="COLOR"/></COLOR> <COLOR/> It seems like there ought to be a way to make a named template and invoke it from the various places where it is needed and pass some parameter that represents the path back to the <BICYCLE> node to which it refers. Is there a way to clean this up, say with a named template for bicycle fields, for wheel fields and for reflector fields? In the real world example this is based on, there are many more attributes to a "bicycle" than just color, and I want to make this XSL easy to change to include or exclude fields without having to change the XSL in multiple places.

    Read the article

  • OpenCV: Shift/Align face image relative to reference Image (Image Registration)

    - by Abhischek
    I am new to OpenCV2 and working on a project in emotion recognition and would like to align a facial image in relation to a reference facial image. I would like to get the image translation working before moving to rotation. Current idea is to run a search within a limited range on both x and y coordinates and use the sum of squared differences as error metric to select the optimal x/y parameters to align the image. I'm using the OpenCV face_cascade function to detect the face images, all images are resized to a fixed (128x128). Question: Which parameters of the Mat image do I need to modify to shift the image in a positive/negative direction on both x and y axis? I believe setImageROI is no longer supported by Mat datatypes? I have the ROIs for both faces available however I am unsure how to use them. void alignImage(vector<Rect> faceROIstore, vector<Mat> faceIMGstore) { Mat refimg = faceIMGstore[1]; //reference image Mat dispimg = faceIMGstore[52]; // "displaced" version of reference image //Rect refROI = faceROIstore[1]; //Bounding box for face in reference image //Rect dispROI = faceROIstore[52]; //Bounding box for face in displaced image Mat aligned; matchTemplate(dispimg, refimg, aligned, CV_TM_SQDIFF_NORMED); imshow("Aligned image", aligned); } The idea for this approach is based on Image Alignment Tutorial by Richard Szeliski Working on Windows with OpenCV 2.4. Any suggestions are much appreciated.

    Read the article

  • Getting the relative path

    - by Brigadier Jigar
    I have to fetch all the files from a folder and i am using the function GetFiles() like string[] dirImages = Directory.GetFiles(strPathYearImages + intYear , "*.png"); where strPathYearImages="Images\Holiday\2010\" but when i write the whole path like string[] dirImages = Directory.GetFiles(@"E:\IWP\Images\Holiday\"+ intYear , "*.png"); i get the required result. How to solve this problem? I dont want to use the whole path. Help me out. Regards, Jigar <3

    Read the article

  • Log4j Relative Path to Tomcat7 Log Directory File Not Found

    - by Nik
    I have this log4j XML file: <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <appender name="gemFile" class="org.apache.log4j.RollingFileAppender"> <param name="File" value="file:${catalina.home}/logs/GEM.log" /> <param name="MaxBackupIndex" value="5" /> <param name="MaxFileSize" value="3MB" /> <param name="Append" value="true" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%t] %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %c{1} - %m%n" /> </layout> </appender> <root> <priority value ="info" /> <appender-ref ref="gemFile" /> </root> </log4j:configuration> ${catalina.home} resolves to C:\Apps\Apache\Tomcat7. When I deploy my WAR file, I get log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: file:C:\Apps\Apache\Tomcat7\logs\GEM.log (The filename, directory name, or volume label syntax is incorrect) stack trace... It is true that the log file does not exist (the folder structure does), but if I set the file directly to that path (<param name="File" value="C:/Apps/Apache/Tomcat7/logs/GEM.log" />) it works fine. Why can't I use the replacement string?

    Read the article

  • Link to RSS/Atom feed, relative, doesn't work in Firefox

    - by Adrian Smith
    I have a weird problem. I generate a HTML page, hosted let's say at http://www.x.com/stuff which contains <head> <link type="application/atom+xml" rel="alternate" href="/stuff/feed"/> .. </head> The result is: In IE7 all works well - you can click on the feed icon in the browser and the feed is displayed In Firefox, view source, click on the linked /stuff/feed and you see the source of the feed, so that works as expected In Firefox, view the page (not source), then click on the feed icon in the address bar, I get an error that it can't retrieve the URL feed://http//www.x.com/stuff/feed So the problem is, that it's appending feed:// to the front of the URL and then taking out the colon : after the http. I understand that feed: is HTTP anyway so perhaps the adding of that isn't a big problem. But anyway, the fact is, that URL Firefox generates out of my <link> tag doesn't work. I have considered making the URL absolute, but I haven't found any evidence that those URLs have to be absolute, nor can I understand why that would be the case. And for various reasons it would be inconvenient in my code to generate an absolute URL. I can do it if necessary but I would prefer to see proof (e.g. specification, or Mozilla bug report) that it's necessary before making my code messy What do you think? Does anyone know of any evidence that the URL should be absolute? Or am I doing something else wrong? It seems such a simple/obvious tag, where nothing could go wrong, but I can't get it to work.

    Read the article

  • Ruby: opening files relative to home directory

    - by Peter
    In Ruby, the following fails with Errno::ENOENT: No such file or directory, even if the file exists: open('~/some_file') However, you can do this: open(File.expand_path('~/some_file')) Two questions: Why doesn't open process the tilde as pointing to the home directory? Is there a slicker way than using File.expand_path?

    Read the article

  • zend_date relative time

    - by flufferok
    Hi, i want to make stackoverflow timestamps(X minutes ago, etc). How i can make it using zend_date? I found http://stackoverflow.com/questions/1639892/how-to-calculate-time-passed-with-php-or-zend-date this realisation, but it uses other library. Are there any different ways?

    Read the article

  • Reference XSLT-file using a project relative way (instead of an absolute path)

    - by Binary255
    The file at xsltFileName is in my project WebSite2 (at the root-level of the project). I currently use an absolute path to get the XSLT file name: XslCompiledTransform xslt = new XslCompiledTransform(); String xsltFileName = "file:///C:\\Documents and Settings\\kentl\\My Documents\\Visual Studio 2005\\WebSites\\WebSite2\\page.xsl"; xslt.Load(xsltFileName); I would like to have a solution without an absolute path. What would be the cleanest way?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >