Search Results

Search found 14593 results on 584 pages for 'pat inside'.

Page 50/584 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • UIDatePicker inside UIScrollView with pages

    - by Jason Martens
    I have a UIScrollView with 2 pages, and I can scroll horizontally between them. However, on one of my pages, I have a UIDatePicker, and the scroll view is intercepting the vertical touch events so I can no longer manipulate the date picker (except by clicking or tapping). Is there some way to tell the ScrollView to send the vertical touch events to the date picker, but send the horizontal touch events to the scroll view to switch pages?

    Read the article

  • scanf segfaults and various other anomalies inside while loop

    - by Shadow
    while(1){ //Command prompt char *command; printf("%s>",current_working_directory); scanf("%s",command);<--seg faults after input has been received. printf("\ncommand:%s\n",command); } I am getting a few different errors and they don't really seem reproducible(except for the segfault at this point .<). This code worked fine about 10 minutes ago, then it infinite looped the printf command and now it seg faults on the line mentioned above. The only thing I changed was scanf("%s",command); to what it currently is. If I change the command variable to be an array it works, obviously this is because the storage is set aside for it. 1) I got prosecuted about telling someone that they needed to malloc a pointer* (But that usually seems to solve the problem such as making it an array) 2) the command I am entering is "magic" 5 characters so there shouldn't be any crazy stack overflow. 3) I am running on mac OSX 10.6 with newest version of xCode(non-OS4) and standard gcc 4) this is how I compile the program: gcc --std=c99 -W sfs.c Just trying to figure out what is going on. Being this is for a school project I am never going to have to see again, I will just code some noob work around that would make my boss cry :) But for afterwards I would love to figure out why this is happening and not just make some fix for it, and if there is some fix for it why that fix works.

    Read the article

  • Image inside a button not positioned correctly in Firefox

    - by Dominic Rodger
    I have the following markup: <p class="managebox"> <button value="Add page"> <img src="page_add.png" alt="Add more content" /> Add Page </button> </p> And the following CSS: p.managebox { position: relative; } p.managebox button { display: block; padding: 5px 7px 4px 30px; position: relative; } p.managebox button img { position: absolute; left: 7px; } In IE 8 I get this: In Chrome 4.0 I get this: In Firefox 3.6 I get this: Does anyone know what I'm doing wrong? One thing I've just realised that may be relevant - if I use an a instead of button, it works fine.

    Read the article

  • WPF ToolBar Separator shrinks to nothing when inside a StackPanel

    - by qntmfred
    Given the very simple wpf app <Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="800"> <Grid> <ToolBar Height="50" > <MenuItem Header="Test1" /> <MenuItem Header="Test2" /> <StackPanel Orientation="Horizontal"> <Separator /> <MenuItem Header="Test3" /> <MenuItem Header="Test4" /> <MenuItem Header="Test5" /> </StackPanel> </ToolBar> </Grid> </Window> The Separator element shrinks to nothing. If I put the Separator just before the StackPanel begins, it will show up. Why does this happen? Is there a style setting that can be applied somewhere to avoid this?

    Read the article

  • How can i use 'log' inside a src/groovy/ class

    - by firnnauriel
    I'm encountering this error: groovy.lang.MissingPropertyException: No such property: log for class: org.utils.MyClass Here's the content of the class: package org.utils class MyClass { int organizationCount = 0 public int getOrganizationCount(){ log.debug "There are ${organizationCount} organization(s) found." return organizationCount } } Do i need to add an import statement? What do i need to add? Note that the class is located in src/groovy/org/utils. I know that the 'log' variable is accessible in controllers, services, etc. Not sure in 'src' classes. Thanks.

    Read the article

  • can anyone help how to get data from a plist, precisely inside the array

    - by jix
    Can anyone help me with getting data from this plist? I'm having trouble accessing the values of the three objects in the plist. i can see all the list of countries in my tableView, but i can't see the prices when i tap on a cell . any help please thanks MY PLIST <plist version="1.0"> <dict> <key>Afghanistan 3</key> <array> <string>RC $1.65</string> <string>CC $2.36</string> <string>EC 0</string> </array> <key>Albania 1</key> <array> <string>RC FREE</string> <string>CC $1.01</string> </array> <key>Algeria 2</key> <array> <string>RC $0.27</string> <string>CC $0.85</string> </array> <key>Andorra 2</key> <array> <string>RC FREE</string> <string>CC $0.93</string> also my code that i have implemented in xcode 4.5 . cc is the calling rate that is in item 0 in the plist rc is the receiving rate that is in item 1 in the plist ec is the extra rate that is in item 2 in the plist how can i see the cc ,rc, & ec each in a label when i click the cell in the next view controller ? MY CODE NSString *ratesFile = [[NSBundle mainBundle] pathForResource:@"rates" ofType:@"plist"]; rates = [[NSDictionary alloc]initWithContentsOfFile:ratesFile]; NSArray * dictionaryKeys = [rates allKeys]; name = [dictionaryKeys sortedArrayUsingSelector:@selector(compare:)]; cc = [rates objectForKey:@"Item 0"]; rc = [rates objectForKey:@"Item 1"]; ec = [rates objectForKey:@"Item 2"]; - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [rates count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } NSString *countryName = [name objectAtIndex:indexPath.row]; cell.textLabel.text = countryName; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSString *ccRate = [cc objectAtIndex:indexPath.row]; if (!self.detailViewController) { self.detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil]; } self.detailViewController.detailItem = ccRate; [self.navigationController pushViewController:self.detailViewController animated:YES]; } thank in advance

    Read the article

  • Jquery cant get facebox working inside ajax call

    - by John
    From my main page I call an ajax file via jquery, in that ajax file is some additional jquery code. Original link looks like this: <a href="/page1.php" class="guest-action notify-function"><img src="/icon1.png"></a> Then the code: $(document).ready(function(){ $('a[rel*=facebox]').facebox(); $('.guest-action').click( function() { $.get( $(this).attr('href'), function(responseText) { $.jGrowl(responseText); }); return false; }); $('.notify-function').click( function() { $(this).find('img').attr('src','/icon2.png'); $(this).attr('href','/page2.php'); $(this).removeClass('guest-action').removeClass('notify-function').attr('rel','facebox'); }); }); So basically after notify-function is clicked I am changing the icon and the url of the link, I then am removing the classes so that the click wont be ran again and add rel="facebox" to the link so that the facebox window will pop up if they try to click the new icon2.png that shows up. The problem is after I click the initial icon everything works just fine except when I try to click the new icon2.png it still executes the jgrowl code from the guest-action. But when I view the source it shows this: <a href="/page2.php" rel="facebox" class=""><img src="/icon2.png"></a> So it seemed that should work right? What am I doing wrong? I tried adding the facebox code to the main page that is calling the ajax file as well and still same issue.

    Read the article

  • match "//" comments with regex but not inside a quote

    - by Wireless102
    I need to match and replace some comments. for example: $test = "the url is http://www.google.com";// comment "<-- that quote needs to be matched I want to match the comments outside of the quotes, and replace any "'s in the comments with &quot;'s. I have tried a number of patterns and different ways of running them but with no luck. The regex will be run with javascript to match php "//" comments UPDATE: I took the regex from borkweb below and modified it. used a function from http://ejohn.org/blog/search-and-dont-replace/ and came up with this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript"> function t_replace(data){ var q = {}, ret = ""; data.replace(/(?:((["'\/]*(("[^"]*")|('[^']*'))?[\s]*)?[\/\/|#][^"|^']*))/g, function(value){ q[key] = value; }); for ( var key in q ){ ret = q[key]; } var text = data.split(ret); var out = ret + text[1]; out = out.replace(/"/g,"&quot;"); out = out.replace(/'/g,"&apos;"); return text[0] + out; } </script> </head> <body> <script type="text/javascript"> document.write(t_replace("$test = \"the url is http://www.google.com\";// c'o\"mment \"\"\"<-- that quote needs to be matched")+"<br>"); document.write(t_replace("$test = 'the url is http://www.google.com';# c'o\"mment \"\"\"<-- that quote needs to be matched")); </script> </body> </html> it handles all the line comments outside of single or double quotes. Is there anyway I could optimize this function?

    Read the article

  • binding a command inside a listbox item to a property on the viewmodel parent

    - by gideon
    I've been working on this for about an hour and looked at all related SO questions. My problem is very simple: I have HomePageVieModel: HomePageVieModel +IList<NewsItem> AllNewsItems +ICommand OpenNews My markup: <Window DataContext="{Binding HomePageViewModel../> <ListBox ItemsSource="{Binding Path=AllNewsItems}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock> <Hyperlink Command="{Binding Path=OpenNews}"> <TextBlock Text="{Binding Path=NewsContent}" /> </Hyperlink> </TextBlock> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> The list shows fine with all the items, but for the life of me whatever I try for the Command won't work: <Hyperlink Command="{Binding Path=OpenNewsItem, RelativeSource={RelativeSource AncestorType=vm:HomePageViewModel, AncestorLevel=1}}"> <Hyperlink Command="{Binding Path=OpenNewsItem, RelativeSource={RelativeSource AncestorType=vm:HomePageViewModel,**Mode=FindAncestor}**}"> <Hyperlink Command="{Binding Path=OpenNewsItem, RelativeSource={RelativeSource AncestorType=vm:HomePageViewModel,**Mode=TemplatedParent}**}"> I just always get : System.Windows.Data Error: 4 : Cannot find source for binding with reference ..... Update I am setting my ViewModel like this? Didn't think this would matter: <Window.DataContext> <Binding Path="HomePage" Source="{StaticResource Locator}"/> </Window.DataContext> I use the ViewModelLocator class from the MVVMLight toolkit which does the magic.

    Read the article

  • Using a string inside the DocumentBuilder parse method (need it for parsing XML using XPath)

    - by dierre
    Hi guys! I'm trying to create a RESTful webservice using a Java Servlet. The problem is I have to pass via POST method to a webserver a request. The content of this request is not a parameter but the body itself. So I basically send from ruby something like this: url = URI.parse(@host) req = Net::HTTP::Post.new('/WebService/WebServiceServlet') req['Content-Type'] = "text/xml" # req.basic_auth 'account', 'password' req.body = data response = Net::HTTP.start(url.host, url.port){ |http| puts http.request(req).body } Then I have to retrieve the body of this request in my servlet. I use the classic readline, so I have a string. The problem is when I have to parse it as XML: private void useXML( final String soft, final PrintWriter out) throws ParserConfigurationException, SAXException, IOException, XPathExpressionException, FileNotFoundException { DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); domFactory.setNamespaceAware(true); // never forget this! DocumentBuilder builder = domFactory.newDocumentBuilder(); Document doc = builder.parse(soft); XPathFactory factory = XPathFactory.newInstance(); XPath xpath = factory.newXPath(); XPathExpression expr = xpath.compile("//software/text()"); Object result = expr.evaluate(doc, XPathConstants.NODESET); NodeList nodes = (NodeList) result; for (int i = 0; i < nodes.getLength(); i++) { out.println(nodes.item(i).getNodeValue()); } } The problem is that builder.parse() accepts: parse(File f), parse(InputSource is), parse(InputStream is). Is there any way I can transform my xml string in an InputSource or something like that? I know it could be a dummy question but Java is not my thing, I'm forced to use it and I'm not very skilled.

    Read the article

  • stealing inside the move constructor

    - by FredOverflow
    During the implementation of the move constructor of a toy class, I noticed a pattern: array2D(array2D&& that) { data_ = that.data_; that.data_ = 0; height_ = that.height_; that.height_ = 0; width_ = that.width_; that.width_ = 0; size_ = that.size_; that.size_ = 0; } The pattern obviously being: member = that.member; that.member = 0; So I wrote a preprocessor macro to make stealing less verbose and error-prone: #define STEAL(member) member = that.member; that.member = 0; Now the implementation looks as following: array2D(array2D&& that) { STEAL(data_); STEAL(height_); STEAL(width_); STEAL(size_); } Are there any downsides to this? Is there a cleaner solution that does not require the preprocessor?

    Read the article

  • replacing Fragment inside onActivityResult() geting error

    - by ajay
    When am lancing camera using Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, CAMERA_REQUEST);) And then we getting callback after taking pic to the onActivityResult(){ //HERE AM CALL ING ANOTHER FRAGMENT FragmentManager fm = getFragmentManager(); fm.beginTransaction().replace( R.id.tab_upload, new uploadingActivty(), "tabId").setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN) .addToBackStack(null).commit(); } Then we getting error as 11-21 16:13:44.316: E/AndroidRuntime(30944): Caused by: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState Any idea?

    Read the article

  • how to format the data inside the DataGridTemplateColumn in datagrid

    - by prince23
    hi, this is my xaml code where i have 2 fields placed under one template column. now i am getting the format the output like this so that i can specify the space betweeen these 2 columns Color red image1 green image2 green image2 white image6 so that output looks good. How can i define space between them so that it looks like the above one right now thw output is like this color Redimage1 greenimage2 greenimage2 whiteimage6 <sdk:DataGridTemplateColumn Header="Color" Width="80"> <sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate> <StackPanel Loaded ="StackPanel_Loaded" Orientation="Horizontal" Background="Transparent"> <TextBlock Text="{Binding Color}" TextWrapping="NoWrap" HorizontalAlignment="Center" Foreground="Blue"></TextBlock> <Image x:Name="imgTargetScore" Source ="{Binding ColorImage}" Width="20" Height="20" Stretch ="Fill"/> </StackPanel> </DataTemplate> </sdk:DataGridTemplateColumn.CellTemplate> </sdk:DataGridTemplateColumn> loking forward for an solution thanks in advance prince

    Read the article

  • How to highlight text automatically inside an UIAlertView text field

    - by user333624
    Hello everyone I have an UIAlertView with a textfield that shows a default value and two buttons, one to cancel and the other one to confirm. What I am trying to do is that when the alert view is popped up the default value is highlighted so the user can override the whole value faster than manually erasing it. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Title" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Continue",nil]; [alerta addTextFieldWithValue:@"87893" label:@"value"]; UITextField *textField = [alert textField]; campoTexto.highlighted = YES; campoTexto.keyboardType = UIKeyboardTypeNumbersAndPunctuation; [alertt show]; [alert release]; } for some reason there is a highlighted attribute for the textfield but it doesn't seem to work and there is no trail of that attribute in the Class documentation.

    Read the article

  • php - regex - catch string inside multiple tags

    - by aSeptik
    Hi all guys! still on regex! ;-))) Assuming we have an html file with a lot of <tr> rows with same structure like this below, where (.*?) is the content i need to extract! <tr align= # ><th width= # ><a OnClick="(.*?)"href= # >(.*?)</a><td width= # >(.*?)<td width= # align= # >(.*?)</td></tr> maybe with a nice preg_match_all() ? thanks for the time! Luca Filosofi!

    Read the article

  • finding a point on an ellipse circumference which is inside a rectangle having center point, height

    - by Shlomi Assaf
    Hi all. I have a rectangle in .NET in which I draw an ellipse. I know the width, height and center point of that rectangle. Ofcourse the cetner point of the rectangle is also the center point of the ellipse. I know how to calculate a point on a circle, however I have no clue about an ellipse. I have those parameters and an angle, i need the point on the ellipse, can someone post the formula? I saw somewhere you need to calculate 2 points in which 2 raduises will go, the sum of the radiuses will be fixed and they will change in size accordingly. I dont know how to do that, I only have the rectange height, width and center point and ofcourse the angle I wish to find the point at. thanks for any help Shlomi

    Read the article

  • BeautifulSoup: just get inside of a tag, no matter how many enclosing tags there are

    - by AP257
    I'm trying to scrape all the inner html from the <p> elements in a web page using BeautifulSoup. There are internal tags, but I don't care, I just want to get the internal text. For example, for: <p>Red</p> <p><i>Blue</i></p> <p>Yellow</p> <p>Light <b>green</b></p> How can I extract: Red Blue Yellow Light green Neither .string nor .contents[0] does what I need. Nor does .extract(), because I don't want to have to specify the internal tags in advance - I want to deal with any that may occur. Is there a 'just get the visible HTML' type of method in BeautifulSoup? ----UPDATE------ On advice, trying: p_tags = page.findAll('p',text=True) for i, p_tag in enumerate(p_tags): print str(p_tag) But that doesn't help - it just prints out: Red <i>Blue</i> Yellow Light <b>green</b>

    Read the article

  • Using lock(obj) inside a recursive call

    - by Amby
    As per my understanding a lock is not released until the runtime completes the code block of the lock(obj) ( because when the block completes it calls Monitor.Exit(obj). With this understanding i am not able to understand the reason behind the behaviour of the following code. private static string obj = ""; private static void RecurseSome(int number) { Console.WriteLine(number); lock (obj) { RecurseSome(++number); } } //Call: RecurseSome(0) //Output: 0 1 2 3...... stack overflow exception There must be some concept that i am missing. Please help.

    Read the article

  • Open a file with su/sudo inside Emacs

    - by Chris Conway
    Suppose I want to open a file in an existing Emacs session using su or sudo, without dropping down to a shell and doing sudoedit or sudo emacs. One way to do this is (require 'tramp) C-c C-f /sudo::/path/to/file but this requires an expensive round-trip through SSH. Is there a more direct way? [EDIT] @JBB is right. I want to be able to invoke su/sudo to save as well as open. It would be OK (but not ideal) to re-authorize when saving. What I'm looking for is variations of find-file and save-buffer that can be "piped" through su/sudo.

    Read the article

  • Dynamic positioning inside relative div

    - by ian
    I'm trying to get a color picker javascript widget working in a page with a bunch of "stuff" in it that I can't change. Some of the "stuff" is causing the color picker to appear well below the link when clicked. I've reduced it to a simple example below. <html> <head> <script type="text/javascript"> function setPos(aname,dname) { var o=document.getElementById(aname); var ol=o.offsetLeft; while ((o=o.offsetParent) != null) { ol += o.offsetLeft; } o=document.getElementById(aname); var ot=o.offsetTop + 25; while((o=o.offsetParent) != null) { ot += o.offsetTop; } document.getElementById(dname).style.left = ol + "px"; document.getElementById(dname).style.top = ot + "px"; } </script> <style> h1 {height: 50px;} #divMain {position: relative;} </style> </head> <body> <h1></h1> <div id="divMain"> <a href="#" onClick="setPos('link1','div1');return false;" name="link1" id="link1">link 1</a> <div id="div1" style="position:absolute;border-style:solid;left:200px;top:200px;">div 1</div> </div> </body> </html> What's supposed to happen is when you click "link 1", "div1" should move directly below "link 1". What actually happens is that "div 1" appears well below "link 1". If you remove position: relative; from the CSS definition for divMain, "div 1" is positioned correctly. How can I position "div 1" directly beneath "link 1" without removing position: relative;?

    Read the article

  • Horizontal Scrollview inside ListView item?

    - by lanks
    I have a ListView item layout that is using a HorizontalScrollView in the center. I have used the android attribute "android:descendantFocusability="blocksDescendants"" on my parent LinearLayout so that the ListView items are still selectable. The problem I am having is that when clicking the part of the ListView item which is the HorizontalScrollView, the ListView item click event is not called. How can I get the click event of the HorizontalScrollView to call the ListView list item click event?

    Read the article

  • Quickest way to run a linux dev-environment inside windows

    - by Industrial
    Hi everyone, I get more and more trouble from running WAMP on my XP computer to solve my local development needs. It feels like as more and more things just go wrong or could not be installed at all to a Windows version of PHP. I have been looking for an alternative and found AndLinux plus this link. Would it be a good idea to get an Ubuntu box running virtually on my XP computer to simulate the production web server?

    Read the article

  • Returning from method inside a @synchronized block

    - by Michael Waterfall
    I'd just like to know if it's advised to return from a method within a @synchronized block? For example: - (id)test { @synchronized(self) { if (a) return @"A"; else return @"B"; } } As opposed to: - (id)test { NSString *value; @synchronized(self) { if (a) value = @"A"; else value = @"B"; } return value; } This sample is rather simplistic, but sometimes in a complex method it would make things simpler to be able to return from within a @synchronized block.

    Read the article

  • PHP: codecomments inside functions prevents it work

    - by Karem
    $query = $connect->prepare("SELECT firstname, lastname FROM users WHERE id = '$id'"); $query->execute(); $row = $query->fetch(); // $full_name = $row["firstname"] . " ".$row["lastname"]; $full_name = $row["firstname"] . " ".substr($row["lastname"], 0, 1)."."; return $full_name; If i remove the line that is a comment ( // ), it will return $full_name, if its there then it wont work. I also tried commenting with #, but it still wont work(wont return anything) as soon as there is a codecomment weird issue

    Read the article

  • div popup inside td

    - by sims
    I have a table with a bunch of cells. (No way! Amazing! :P) Some of the cells have a small div that when you put your mouse over, it gets bigger so you can read all the text. This works well and all. However, since html elements that come later in the document have a higher z-index, when the div gets bigger it is underneath the other divs in the other cells. Some html code: <table> <tr> <td> limited info <div style="position: relative;"> <div style="position: absolute; top: 0; left: 0; width: 1em; height: 1em;" onmouseover="tooltipshow(this)" onmouseout="tooltiphide(this)"> informative long text is here </div> </div> </td> <td> some short info <div style="position: relative;"> <div style="position: absolute; top: 0; left: 0; width: 1em; height: 1em;" onmouseover="tooltipshow(this)" onmouseout="tooltiphide(this)"> longer explanation about what is really going on that covers the div up there ^^^. darn! </div> </div> </td> </tr> </table> Some js code: function tooltipshow(obj) { obj.style.width = '30em'; obj.style.zIndex = '100'; } function tooltiphide(obj) { obj.style.width = '1em'; obj.style.zIndex = '20'; } It doesn't matter if I set z-index dynamically to something higher onmouseover. It's like z-index has no affect. I think it has something to do with the table. I've tested this in FF3. When I'm feeling particularly macho, I'll test it in IE.

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >