Search Results

Search found 2776 results on 112 pages for 'overlapping matches'.

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

  • UIButton overlapping problem in the UIView?

    - by sai
    im trying to create buttons as ahierarchy, first some buttons are displayed if i click any of the buttons it will navigate to the next viewcontroller displaying some more buttons. But here my problem is butons are overlapped with one another . means the buttons that should not be displayed are also comming along with those should be . my code is for(.................) { butt = [[UIButton alloc] initWithFrame:CGRectMake(...)]; image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[arr objectAtIndex:i]]]]; imageView = [[[UIImageView alloc] initWithImage:image] autorelease]; [butt setBackgroundImage:imageView.image forState:UIControlStateNormal]; [butt setTag:i]; [butt addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside]; [containerView addSubview:butt]; [butt release]; x+=butt.frame.size.width+2*hgap; i+=1; if (i==count+1) //[arr count] { printf("\nIN BREAK BUTTON\n"); break; } } y=y+(butt.frame.size.height+2*vgap); } Thankyou for the solution.

    Read the article

  • Django QuerySet ordering by number of reverse ForeignKey matches

    - by msanders
    I have the following Django models: class Foo(models.Model): title = models.CharField(_(u'Title'), max_length=600) class Bar(models.Model): foo = models.ForeignKey(Foo) eg_id = models.PositiveIntegerField(_(u'Example ID'), default=0) I wish to return a list of Foo objects which have a reverse relationship with Bar objects that have a eg_id value contained in a list of values. So I have: id_list = [7, 8, 9, 10] qs = Foo.objects.filter(bar__eg_id__in=id_list) How do I order the matching Foo objects according to the number of related Bar objects which have an eg_id value in the id_list?

    Read the article

  • Regex - find and replace complete string occurrences only (not partial matches)

    - by vittore
    I'm not very good at regex but maybe there's a simple way to achieve this task. I'm given a string like "bla @a bla @a1 bla" I'm also given pairs like {"a", "a2"} , {"a1", "a13"}, and I need to replace @a with @a2 for the first pair, and @a1 with @a13 for the second one. The problem is when i use String.Replace and look for @a, it also replaces @a1 but it should not. I need it to completely match @a and avoid partially matching it in other places. Note: the given string could also be brackets, commas, dots and so on. However, pairs will always be [a-z]*[0-9]+ Help me with regex replace, please. Cheers

    Read the article

  • Perl : get substring which matches regex error

    - by Michael Mao
    I am very new to Perl, so please bear with my simple question: Here is the sample output: Most successful agents in the Emarket climate are (in order of success): 1. agent10896761 ($-8008) 2. flightsandroomsonly ($-10102) 3. agent10479475hv ($-10663) Most successful agents in the Emarket climate are (in order of success): 1. agent10896761 ($-7142) 2. agent10479475hv ($-8982) 3. flightsandroomsonly ($-9124) I am interested only in agent names as well as their corresponding balances, so I am hoping to get the following output: agent10896761 -8008 flightsandroomsonly -10102 agent10479475hv -10663 agent10896761 -7142 agent10479475hv -8982 flightsandroomsonly -9124 For later processes. This is the code I've got so far: #!/usr/bin/perl -w open(MYINPUTFILE, $ARGV[0]); while(<MYINPUTFILE>) { my($line) = $_; chomp($line); # regex match test if($line =~ m/agent10479475/) { if($line =~ m/($-[0-9]+)/) { print "$1\n"; } } if($line =~ m/flightsandroomsonly/) { print "$line\n"; } } The second regex match has nothing wrong, 'cause that is printing out the whole line. However, for the first regex match, I've got some other output such like: $ ./compareResults.pl 3.txt 2. flightsandroomsonly ($-10102) 0479475 0479475 3. flightsandroomsonly ($-9124) 1. flightsandroomsonly ($-8053) 0479475 1. flightsandroomsonly ($-6126) 0479475 If I "escape" the braces like this if($line =~ m/\($-[0-9]+\)/) { print "$1\n"; } Then there is never a match for the first regex... So I'm stuck with a problem of making that particular regex work. Any hints for this? Many thanks in advance.

    Read the article

  • wpf and win32 overlapping issue

    - by priya-hatipkar
    I have a wpf Window, which has wpf control and windows forms control hosted in WindowsFormsHost. The expected behavior is that the WPF control should be rendered on top of WindowsFormsHost. Unfortunately, this is a limitation in the interop story, WindowsFormsHost elements are always drawn on top, and don't get affected by z-order. http://msdn.microsoft.com/en-us/library/ms742522.aspx Is there any workaround to solve this problem? Regards, Priya

    Read the article

  • good methods for boolean operations on overlapping polygons

    - by BenjaminGolder
    What is the best open source library for performing boolean operations (union, intersect, subtract) on shapefiles? What do you like to use? OGR looks like it probably has this capability, though I'm having trouble finding the particular commands in their documentation. Shapely definitely does this, and is easy to understand. PostGIS appears to also have some commands for this. But there must be more, and I'm having trouble finding them. I don't have much experience with any of the, and would appreciate any opinions on these or other libraries. Thanks!

    Read the article

  • Rails, RSpec and Webrat: Expected output matches rendered output but still getting error in view spe

    - by Anthony Burns
    Hello all, I've just gotten started using BDD with RSpec/Cucumber/Webrat and Rails and I've run into some frustration trying to get my view spec to pass. First of all, I am running Ruby 1.9.1p129 with Rails 2.3.2, RSpec and RSpec-Rails 1.2.6, Cucumber 0.3.11, and Webrat 0.4.4. Here is the code relevant to my question config/routes.rb: map.b_posts 'backend/posts', :controller => 'backend/posts', :action => 'backend_index', :conditions => { :method => :get } map.connect 'backend/posts', :controller => 'backend/posts', :action => 'create', :conditions => { :method => :post } views/backend/posts/create.html.erb: <% form_tag do %> <% end %> *spec/views/backend/posts/create.html.erb_spec.rb:* describe "backend/posts/create.html.erb" do it "should render a form to create a post" do render "backend/posts/create.html.erb" response.should have_selector("form", :method => 'post', :action => b_posts_path) do |form| # Nothing here yet. end end end Here is the relevant part of the output when I run script/spec: 'backend/posts/create.html.erb should render a form to create a post' FAILED expected following output to contain a <form method='post' action='/backend/posts'/> tag: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body><form action="/backend/posts" method="post"> </form></body></html> It would appear to me that what have_selector is looking for is exactly what the template generates, yet the example still fails. I am very much looking forward to seeing my error (because I have a feeling it is my error). Any help is much appreciated!

    Read the article

  • Strange, regex.split Method matches one null element

    - by dontoo
    Regex rx = new Regex(@"[+-]"); string[] substrings = rx.Split(expression); expression = "-9a3dcbh-3bca-4ab4cf-3hc" //This is the iput string I want to split that string between + or -. My VS debugger shows substring array like this: substrings[0] = null //???Why substrings[1] = 9a3dcbh substrings[2] = 3bca substrings[3] = 4ab4cf substrings[4] = 3hc Why is the first element of arry null, is it because I am matching +-, and there is no + in my input string?

    Read the article

  • PagerView overlapping PagerTabStrip / PagerTitleStrip

    - by user1256169
    I've been trying for about a week to get my PagerView not to overlap the TitleStrip. I've tried absolutely everything I can think of, and one StackOverflow question that looked like the same question, had an answer that wasn't applicable. It appears that both the PagerTitleStrip and the TextView start at 0,0 (left,top) Any help would be appreciated. Note that I can't use any XML (inc Layout.xml) so it's all done programatically. Here's a full working example of my problem: package com.example.projname; import android.app.Activity; import android.os.Bundle; import android.support.v4.view.PagerAdapter; import android.support.v4.view.PagerTabStrip; import android.support.v4.view.ViewPager; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.widget.TextView; public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MyPagerAdapter myPagerAdapter = new MyPagerAdapter(); PagerTabStrip myPagerTabStrip = new PagerTabStrip(this); myPagerTabStrip.setGravity(Gravity.TOP); ViewPager viewPager = new ViewPager(this); viewPager.addView(myPagerTabStrip, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); viewPager.setAdapter(myPagerAdapter); setContentView(viewPager); } class MyPagerAdapter extends PagerAdapter { public final String[] Titles = { "Title One", "Title Two", "Title Three", "Title Four", "Title Five" }; @Override public int getCount() { return Titles.length; } @Override public boolean isViewFromObject(View view, Object object) { return (view == object); } @Override public CharSequence getPageTitle(int position) { return Titles[position]; } @Override public Object instantiateItem(ViewGroup container, int position) { TextView textView = new TextView(getApplicationContext()); String myString = new String("Page " + (position + 1) + "\r\n"); textView.setText(myString + myString + myString + myString + myString + myString); container.addView(textView); return textView; } @Override public void destroyItem(ViewGroup container, int position, Object object) { container.removeView((View) object); } } } Edit: Adding a screenshot of the problem:

    Read the article

  • CSS vertical centering split background image not overlapping

    - by user295292
    is it possible to split 2 images vertically and when resizing the browser, it wont overlap but stay vertically centered? can the left image stay fixed so the right side of it won't cut off(overlap) this is what i have now, but when resizing the browser smaller, it pushes the left image underneath the right. rather have the images cut off on the outer sides and never overlap each other in the middle, make sense? #wrapper { width:1680px; max-width:1680px; height:500px; margin: 0 auto; } #left-image { width: 50%; position:absolute; left: auto; height:500px; } #right-image { width: 50%; position:absolute; right: 0px; height:500px; }

    Read the article

  • CSS vertcial centering split background image not overlapping

    - by user295292
    is it possible to split 2 images vertically and when resizing the browser, it wont overlap but stay vertically centered? can the left image stay fixed so the right side of it won't cut off(overlap) this is what i have now, but when resizing the browser smaller, it pushes the left image underneath the right. rather have the images cut off on the outer sides and never overlap each other in the middle, make sense? wrapper { width:1680px; max-width:1680px; height:500px; margin: 0 auto; } left-image { width: 50%; position:absolute; left: auto; height:500px; } right-image { width: 50%; position:absolute; right: 0px; height:500px; }

    Read the article

  • How to get regular expression matches between two boundaries

    - by Rubans
    Hi, I have the following text: started: Project: ProjectA, Configuration: Release Any CPU ------ I would like to get just the actual project name which in this example is "ProjectA". I do have a regular expression "started:(\s)Project:(\s).*," which will give me "started: Project: ProjectA," and then I can use further basic string searching to return the project name but was wondering if there is any way I can just grab the actual project name without doing the extra string searching, maybe using a correct regular expression. What I need is the string value between boundaries "started: Project: " and ",". Any ideas?

    Read the article

  • Spring AOP pointcut that matches annotation on interface

    - by seanizer
    Hello, this is my first post here, so I apologize in advance for any stupidity on my side. I have a service class implemented in Java 6 / Spring 3 that needs an annotation to restrict access by role. I have defined an annotation called RequiredPermission that has as its value attribute one or more values from an enum called OperationType: public @interface RequiredPermission { /** * One or more {@link OperationType}s that map to the permissions required * to execute this method. * * @return */ OperationType[] value();} public enum OperationType { TYPE1, TYPE2; } package com.mycompany.myservice; public interface MyService{ @RequiredPermission(OperationType.TYPE1) void myMethod( MyParameterObject obj ); } package com.mycompany.myserviceimpl; public class MyServiceImpl implements MyService{ public myMethod( MyParameterObject obj ){ // do stuff here } } I also have the following aspect definition: /** * Security advice around methods that are annotated with * {@link RequiredPermission}. * * @param pjp * @param param * @param requiredPermission * @return * @throws Throwable */ @Around(value = "execution(public *" + " com.mycompany.myserviceimpl.*(..))" + " && args(param)" + // parameter object " && @annotation( requiredPermission )" // permission annotation , argNames = "param,requiredPermission") public Object processRequest(final ProceedingJoinPoint pjp, final MyParameterObject param, final RequiredPermission requiredPermission) throws Throwable { if(userService.userHasRoles(param.getUsername(),requiredPermission.values()){ return pjp.proceed(); }else{ throw new SorryButYouAreNotAllowedToDoThatException( param.getUsername(),requiredPermission.value()); } } The parameter object contains a user name and I want to look up the required role for the user before allowing access to the method. When I put the annotation on the method in MyServiceImpl, everything works just fine, the pointcut is matched and the aspect kicks in. However, I believe the annotation is part of the service contract and should be published with the interface in a separate API package. And obviously, I would not like to put the annotation on both service definition and implementation (DRY). I know there are cases in Spring AOP where aspects are triggered by annotations one interface methods (e.g. Transactional). Is there a special syntax here or is it just plain impossible out of the box. PS: I have not posted my spring config, as it seems to be working just fine. And no, those are neither my original class nor method names. Thanks in advance, Sean PPS: Actually, here is the relevant part of my spring config: <aop:aspectj-autoproxy proxy-target-class="false" /> <bean class="com.mycompany.aspect.MyAspect"> <property name="userService" ref="userService" /> </bean>

    Read the article

  • LINQ If .Any matches .Any

    - by molgan
    Hello I have 2 string arrays, and I would like to return if any of them exists in _authRole array. How is that done? string[] _userRoles = userdata.Split(','); string[] _authRoles = AuthRoles.Split(','); bool isAuthorized = _authRoles.Any(_userRoles ??); /M

    Read the article

  • Binding scattered/overlapping images to a WPF Canvas

    - by bufferz
    I am porting a GDI application over to WPF, where I displayed several dozen images onto Form, then drew polygons, circles, rectangles, etc over the top of these images using GDI Pens and Brushes. I'm starting to get the hang of WPF binding and would like to store all of these images and markup graphics in my ViewModel. My VM contains an ObservableCollection of my custom DrawingEntitys, DrawingEntity contains DependencyProperties for BitmapSource, Height, Width, CanvasTopLeftY, and CanvasTopLeftX, that I update frequently in the collection. I know my binding is working, I just can't figure out how to bind and draw this collection onto a Canvas. I've played around with ItemsControl and ItemsSource to death, too many different ways to list here. I can display the DrawingEntity.Bitmaps onto the canvas but Canvas.Top won't bind to CanvasTopLeftY in the DrawingEntity, everything is overlapped at 0,0. I think I'm missing an obvious strategy. Any ideas?

    Read the article

  • Why are these divs overlapping?

    - by acidzombie24
    I putting wmd on my website. After putting code in and giving it a spin i see this image below. How can i make the preview div not overlap with the textarea? -edit- the black is the css background of div wmd-preview some html <div id="wmd-editor" class="wmd-panel"><div id="wmd-button-bar"></div> <textarea id="wmd-input" name="body" rows="10" cols="89"></textarea> ... </div></form><div id="wmd-preview" class="wmd-panel"></div>

    Read the article

  • How to non-greedy multiple lookbehind matches

    - by ArtK
    Source: <prefix><content1><suffix1><prefix><content2><suffix2> Engine: PCRE RegEx1: (?<=<prefix>)(.*)(?=<suffix1>) RegEx2: (?<=<prefix>)(.*)(?=<suffix2>) Result1: <content1> Result2: <content1><suffix1><prefix><content2> The desired result for RegEx2 is just <content2> but it is obviously greedy. How do I make RegEx2 non-greedy and use only the last matching lookbehind? [I hope I have translated this correctly from the NoteTab syntax. I don't do much RegEx coding. The <prefix>, <content> & <suffix> terms are just meant to represent arbitrary strings. Only the "<" in the "?<=" lookbehind command is significant.] I suspect it is something simple but after too many hours of searching I'm giving up on solving it myself. Thanks for the help Art

    Read the article

  • Define a regex, which matches one digit twice and all others once

    - by Amin
    As part of a larger regex I would like to match the following restrictions: The string has 11 digits All digits are numbers Within the first 10 digits one number [0-9] (and one only!) must be listed twice This means the following should match: 12345678914 12235879600 Whereas these should not: 12345678903 -> none of the numbers at digits 1 to 10 appears twice 14427823482 -> one number appears more than twice 72349121762 -> two numbers appear twice I have tried to use a lookahead, but all I'm managing is that the regex counts a certain digit, i.e.: (?!.*0\1{2}) That does not do what I need. Is my query even possible with regex?

    Read the article

  • SQL Overlapping and Multi-Column Indexes

    - by durilai
    I am attempting to tune some stored procedures and have a question on indexes. I have used the tuning advisor and they recommended two indexes, both for the same table. The issue is one index is for one column and the other is for multiple columns, of which it includes the same column from the first. My question is why and what is the difference? CREATE NONCLUSTERED INDEX [_dta_index_Table1_5_2079723603__K23_K17_K13_K12_K2_K10_K22_K14_K19_K20_K9_K11_5_6_7_15_18] ON [dbo].[Table1] ( [EfctvEndDate] ASC, [StuLangCodeKey] ASC, [StuBirCntryCodeKey] ASC, [StuBirStOrProvncCodeKey] ASC, [StuKey] ASC, [GndrCodeKey] ASC, [EfctvStartDate] ASC, [StuHspncEnctyIndctr] ASC, [StuEnctyMsngIndctr] ASC, [StuRaceMsngIndctr] ASC, [StuBirDate] ASC, [StuBirCityName] ASC ) INCLUDE ( [StuFstNameLgl], [StuLastOrSrnmLgl], [StuMdlNameLgl], [StuIneligSnorImgrntIndctr], [StuExpctdGrdtngClYear] ) WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [PRIMARY] go CREATE NONCLUSTERED INDEX [_dta_index_Table1_5_2079723603__K23] ON [dbo].[Table1] ( [EfctvEndDate] ASC )WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [PRIMARY]

    Read the article

  • Overlapping labels in Qt fridge magnets example

    - by bullettime
    I want to modify the fridge magnets example provided with Qt in a way that when I drag a label and drop it over another, it will push the label beneath the dragged label to the side, so they will never overlap one another. I've seen how collision is detected in the colliding mice example, where it uses a QGraphicsScene to draw the QGraphicsItem mice on, and scene()-collidingItems(this) to see which mice are colliding. The problem is that the fridge magnets example uses a class that inherits QWidget in place of QGraphicsScene, so there's no collidingItems() method to check when we have a collision. How do I go about doing that?

    Read the article

  • Determine if a url matches a Route, and pull out the terms if it does

    - by Kevin Montrose
    I've got a big old log file I'm trying to break down in terms of routes. Essentially, I'm getting input of a path (/questions/31415 for example) and a list of all the registered Routes. What I want out is a Route and the parameters specified in the route (so in, /questions/{id}/{answer} I'd get id and answers out). I've got a working solution that basically generates a nasty bit of regex on the fly with named groups to do matching and parsing all-in-one. My gut tells me this is a brittle way to do it, and frankly there has to be a better way, right?

    Read the article

  • Routing a location that matches one controller to another

    - by Luca Romagnoli
    Hi I have a controller named "places" with some actions like "view", "new", "create" When a user goes to mysite.com/places I want to execute the action "show" of another controller called "cores" So I've put this in the routes.rb file: map.connect '/:id/show', :controller => "cores", :action => "show" But it doesn't work. I receive this error: Processing PlacesController#show (for 127.0.0.1 at 2010-04-16 00:52:07) [GET] ActionController::UnknownAction (No action responded to show. Actions: admin_denied, admin_required, auto_complete_for_location, auto_complete_for_name, change_location, create, create_facebook_session, create_facebook_session_with_secret, edit, exist, facebook_params, facebook_session, facebook_session_expired, facebook_session_parameters, get_form, is_admin?, new, one_or_true, redirect_to, render_publisher_error, render_publisher_interface, render_publisher_response, set_facebook_session, top_redirect_to, update, wants_interface?, and zero_or_false): How can i do to map that action in another controller? thanks

    Read the article

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