w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
If frame named "xyz" exists, then switch to that frame
There may be more elegant solutions but this gets the job done: (defun switch-to-frame (frame-name) (interactive "sFrame name:") (let ((frames (frame-list))) (catch 'break (while frames (let ((frame (car frames))) (if (equal (frame-parameter frame 'name) frame-name) (throw 'break (select-frame-set-input-focus frame)) (setq frames (cdr frames))))))))

Categories : Emacs

in web driver is it possible to switch from one frame to another frame in the same webpage
You will need to return to defaultContent before switching to frame-2 UNLESS frame-2 is located within frame-1. <iframe id="1"></iframe> <iframe id="2"></iframe> The above would require: driver.switchTo().frame("1"); //doSomething in frame 1 driver.switchTo().defaultContent(); driver.switchTo().frame("2"); //doSomething in frame 2 But if the DOM looks like this: <iframe id="1"> <iframe id="2"></iframe> </iframe> Then you would use: driver.switchTo().frame("1"); driver.switchTo().frame("2"); //doSomething in frame 2 driver.switchTo().defaultContent();

Categories : Java

Why does changing a UITextView's frame origin completely disfigure my entire frame size?
Solved this a while ago. Assigning the textView's center property instead of its frame solves the problem. CGPoint center = self.smallTextView.view.center; center.x -=20.0; self.smallTextView.center = center; Even still, assigning the textView's frame with a different origin still causes the bug, even in iOS 7. But assigning the center works just fine.

Categories : IOS

Changing UIView frame size does not change UITableview frame origin y
Firstly, I don't believe you should be subclassing a UITableViewController to achieve what you want. A UITableViewController is useful when you know that your view will only contain a UITableView, in my opinion adding anything else to one defeats the purpose. To solve your problem though, in the bottom of your code snippet uncomment out the line where you change the frame of your tableview (assuming self.restOfView is your tableView) and instead of call [self.restOfView reloadData] call: [self.restOfView setNeedsDisplay]; reloadData just calls the tableView data source methods again, setNeedsDisplay redraws the object. I think that will work.

Categories : IOS

Is there a shortcut for (self.frame.origin.y + self.frame.size.height)?
This should do the trick: CGFloat res = CGRectGetMaxY(self.frame); Documentation can be found here. EDIT: according to explanation from rob mayoff (see comments) this is a little more expensive than simply summing origin.y + size.height in code.

Categories : IOS

Why MySQL Switch-Case is not selecting the right values?
"PS" is simply a string. It's NOT the alias you created, so you're comparing a string against an integer, and mysql will auto-convert that "PS" string to an int, making it 0, so ALL of the cases match. You want CASE WHEN PS < 20 THEN 1 ^^---note lack of quotes

Categories : Mysql

Blocking frame switch with Java
The best solution is to use a modal dialog. If this is not an option, you will have to create a handler yourself that fires whenever a frame gets focus and checks if it is the right frame. If not, the handler must focus on the important frame.

Categories : Java

R selecting all rows from a data frame that don't appear in another
Make a new row-ID column in test2, merge the data frames, and select those rows whose IDs aren't in the merged result. test2 <- cbind(test2, id=seq_len(nrow(test2))) matches <- merge(test1, test2)$id test2 <- test2[-matches, ]

Categories : R

Selenium IDE - selecting an button outside the frame
If the control is outside of the frame Selenium is pointing to, then you need to switch back to default content, and possibly switch to the frame the control is in. Driver.SwitchTo().DefaultContent(); Driver.SwitchTo().Frame(frameID);

Categories : Selenium

R - data frame switch rows and columns
> library(reshape2) > dat <- data.frame(category=c("A","B","A","B","C"),fan_id=c(10702397,10702397,35003154,35003154,35003154),likes=c(1,4,1,1,2)) > dcast(dat,fan_id~category,fill=0) Using likes as value column: use value.var to override. fan_id A B C 1 10702397 1 4 0 2 35003154 1 1 2

Categories : R

Android Studio (0.1.6-0.2.13) non-jumbo instruction error
I've fixed it by going to the Preferences (⌘/Ctrl+,) ➤ Compiler and unchecking the "Use external build". I then went to Build ➤ Rebuild Project and it worked fine. I hope this will help someone else too. Edit: Please note that since Android Studio 0.2.13 (I didn't use anything between 0.2.9 and 0.2.13 so I haven't noticed when it went away) There is no "Use external build" option. To overcome this issue now you need to do this: Go to the Preferences (⌘/Ctrl+,) ➤ Compiler ➤ Android Compilers and check the "Force jumbo mode".

Categories : Java

Reducing size of switch statement in emulator?
This approach seems reasonable to me. It is certainly how I would do it (I have written a few CPU emulators and similar types of code). The nearest alternative is a set of function pointers, but some of your cases will probably be rather simple (e.g. cpu_regs.flags &= ~CARRY or if (cpu_regs.flags & CARRY) do_rel_jump(next_byte());, so using function pointers will slow you down. You can bunch all the "No Operation Specified yet" to one place, that will make it a lot shorter in number of lines, but the number of cases will of course still be the same [unless you put it in default:].

Categories : C++

How can I get the size of the inner part of a frame?
Try using getContentPane and getWidth/getHeight: getContentPane().getWidth() getContentPane().getHeight() Tested with a simple 1440x900 frame and I get 1424x862

Categories : Java

Why doesn't my managed object see the other managed objects that are in a to many relationship to it?
In a recent application I wrote I noticed that the setter for my relationship was not working and I had to write my own implementation based on another S.O. answer. Try adding the custom setter to your model and see if it works. -(void)add{objectName}Object:({ObjectName} *)value{ NSMutableSet* tempSet = [NSMutableSet setWithSet:self.{objectName}]; [tempSet addObject:value]; self.{objectName} = tempSet; }

Categories : IOS

How to set AVCaptureVideoDataOutput capture frame size?
Try this code AVCaptureVideoPreviewLayer *newCaptureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:[self.captureManager session]]; newCaptureVideoPreviewLayer.frame = bounds;//CGRectMake(bounds.origin.x, bounds.origin.y, bounds.size.height, bounds.size.width);

Categories : IOS

size of a stack frame always fixed?
The standard does not say anything about it (it does not even require you to have a stack), and with C++14 likely something like alloca will be needed since it will likely get a "light" version of C99 VLAs.

Categories : C++

How can I get the size of a component when using a layout for my frame?
You can try the JPanel methods, getWidth() and getHeight(): int getWidth(); int getHeight(); They will return the height and width of the JPanel. You can also get the bounds of the JPanel using the method getBounds(): Rectangle getBounds(); It will return a Rectangle of the bounds. You can use it to get the location and size of the JPanel.

Categories : Java

change size of Frame even if there widget python
Because you are using place, you have two solutions: you can use place to set the width and height to zero, or you can turn geometry propagation off. Using place to set the width and height place allows you to define the width and the height of the placed widget, so in your click function you can do this: def click(): frame.place_configure(width=0, height=0) Turning geometry propagation off A frame is resized to fit its contents by something called "geometry propagation". If you turn this off, you can control the size of the frame with the width and height options of the frame itself. Usually it's better to let Tkinter decide the size for you, but sometimes there's a need to have an explicit size, which is why it's possible to turn geometry propagation off. Since you are using g

Categories : Python

Frame size in init differs after touch
The size of the UIScreen includes the status bar and any other elements such as the Nav bar and the Tab bar so on an iPhone 4S or lower will be 480. The size of the UIView will only be the usable space. If you do not need the status bar you could hide it so then you have the full size of the screen to play with. Better still get the size of the view you are loading so you could do CGRect frame = self.view.superview.bounds; Instead of using the UIScreen

Categories : IOS

What is the proper frame size of the MPVolumeView control?
As far as I was able to test it, you can make the MPVolumeView as big as you want and the slider somehow stays stuck on the top, not aligned. You can subclass MPVolumeView and implement volumeSliderRectForBounds: to set the slider's frame in the volume view's bounds. See my answer here.

Categories : IOS

Adjust Subviews Size To Superview Frame
I wouldn't mess around with the superview's frame like that if your only intention is to keep its subviews hidden. Instead, I suggest you use [subNavigation setHidden:YES];. This will hide its subviews as well. If however you are insistent on this approach, I suggest you do as @rokjarc said in his comment and work on the superview's bounds. You should also look into clipping the subviews of subNavigation. [subNavigation setClipsToBounds:YES];

Categories : IOS

WebView not reacting to frame size changes in resizeSubviewsWithOldSize
I may have solved this myself. Turned off the "Auto Layout" feature in Interface Builder. I've never been a fan of any of the automatic layout features in IB; I prefer to do my own layout in code (easier to archive, find, change, copy, etc.). I've been working in iOS for a while and haven't run into Auto Layout before. So none of the commented-out lines at the end of the code quoted in the question are necessary -- just set the frame.

Categories : Objective C

Set frame size image inside UITableView
You have set set the frame on your UIImageView subview: if(indexPath.row %2) { cell.yourImageView.frame = CGRectMake(200,70,50,50) } else { cell.yourImageView.frame = CGRectMake(100,70,50,50) }

Categories : IOS

Change font size inside a frame with javascript?
It looks like your frames are the same domain so thats good. What you can do is insert a CSS file onto your frames using javascript, and then target whatever you want. Something similar to this question: var cssLink = document.createElement("link"); cssLink.href = "style.css"; cssLink .rel = "stylesheet"; cssLink .type = "text/css"; frames['body'].document.head.appendChild(cssLink); and in that css file add something like: #people tr{ font-size:12pt; }

Categories : Javascript

change the size of frame and it's contents accroding to screen
There's a good post about getting screen size here: http://stackoverflow.com/a/1016941/356708 Once you have that, you can manually set the size of your layout. This post shows some details about that: http://stackoverflow.com/a/11911123/356708 You can probably use pixels across-the-board, but not knowing what exactly you're doing, you might want to stick with something like DIP (example at same link)

Categories : Android

EAGLView: rotation doesn't change frame size
SOLVED! The solution was in setting UIView's autoresizeMask property [self setAutoresizingMask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; Thanx for Daij-Djan!

Categories : IOS

Dynamically scale SVG image to the frame/window size
We can use an AffineTransform and the setToScale method File f = new File("awesome_tiger.svg"); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); SVGUniverse svgUniverse = new SVGUniverse(); try { SVGDiagram diagram = svgUniverse.getDiagram(svgUniverse.loadSVG(f.toURI().toURL())); try { AffineTransform at = new AffineTransform(); at.setToScale(jdpPane.getWidth()/diagram.getWidth(), jdpPane.getWidth()/diagram.getWidth()); g.transform(at); diagram.render(g); } catch(Exception e2) {System.out.println(e2);}} catch (Exception ex) {System.out.println(ex);} this is the code with which I am overriding the paint() method

Categories : Java

Split Data Frame into Rows of Fixed Size
Something like the following may help numBreaks <- nrow(DAT)%/%300 + 1 for( i in seq(numBreaks)){ smallDAT <- DAT[((i-1)*300+1):(min(nrow(DAT), i*300)), ] ..... }

Categories : R

UIScrollView mysteriously changing frame and content size
If you're using autolayout you should be changing the constraints, not setting the scrollview's frame. See my answer to a similar question here. It has some links to examples of how to set constraints programmatically. Also, in which method are you setting the frame and contentSize? Since you are using a storyboard, if it is in viewDidLoad or viewWillAppear: it would be better to move this code to viewDidLayoutSubviews instead.

Categories : Iphone

Auto Layout: can't get the frame size of UICollectionViewCell subViews
In the end I added top, right, bottom and left spacing constraints on the imageview (to the superview), added IBOutlets to them and used something like this: CGFloat height = self.contentView.bounds.size.height - self.topConstraint.constant - self.bottomConstraint.constant; CGFloat width = self.contentView.bounds.size.width - self.leftConstraint.constant - self.rightConstraint.constant;

Categories : IOS

Why size of Jtext area is Changing on selecting other componenets on Jframe form
I think this is because the final else statement , you didn't specify else what (I mean you need to specify the else statement with rd_10inch only ), so you do it with the other component else if (rd_10inch.isSelected())/////////////////here i specify the else on the third button only { jScrollPane2.setSize(400,400); txt_sysnp.setSize(400,400); System.out.println("******** 10inch : "+rd_10inch.isSelected()); }

Categories : Java

Auto-close Bootstrap accordion panel when switch to mobile screen size
So I eventually figured out how to do this, posting it in case it's of help to anyone. Alter the HTML to: <div class="accordion" id="refine"> <div class="hidden-phone"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#refine" href="#refine-search"> <legend> <h2>Refine your search</h2></legend> </a> </div> </div> <div class="visible-phone"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#refine" href="#refine-search"> <legend> <h2>Refine your search (press

Categories : Twitter

Delphi webbrowser clone video include frame size
I've seen something similar. If you use Adobe Flash to play the video, you could use Navigate to a URL directly to the .swf file and this would show the file sized to the size of your TWebBrowser component. If you also add what is needed to suppress the border of the TWebBrowser component, it might result in what you're looking for.

Categories : Delphi

Any advantage of using 'self.view.frame.size.height', over storing it in a variable instead?
I'll suggest storing the value in a variable and using that will be better. If you call self.view.frame.size.height it will be calculated each time. They'll affect the performance. doing: int counter = self.view.frame.size.width; for(int loop=0;loop<counter;loop++) { } is better than: for(int loop=0;loop<self.view.frame.size.width;loop++) { } In certain scenarios, if the width and height is changing dynamically(animation logic), and you need to do something based on the values then using self.view.frame.size.width will be a good thing.

Categories : IOS

How do you subset a data frame in R based on a minimum sample size
You can use interaction and table to see the number of observation for each interaction (mydata is your data) and then use %in% to subset the data. mydata$inter<-with(mydata,interaction(Factor1,Factor2)) table(mydata$inter) A.1 B.1 A.2 B.2 2 1 3 3 mydata[!mydata$inter %in% c("A.1","B.1"), ] Factor1 Factor2 Value inter 3 A 2 1.21 A.2 4 A 2 0.75 A.2 5 A 2 0.53 A.2 7 B 2 0.21 B.2 8 B 2 0.18 B.2 9 B 2 1.42 B.2 Updated as per @Ananda's comment:You can use following one line code after creating the interaction variable. mydata[mydata$inter %in% names(which(table(mydata$inter) > 2)), ]

Categories : R

UITableView Content size is not updated even after reload when I change its frame dynamically
This Problem Generated Because If you change new Frame/design of UITableView then also made changes in UITableView and also your changeable Frame of UITableView is Bigger then your View So may be last two rows you can not be seem. You need to set/update each Time frame of UITableView as. myTableView.frame = CGRectMake(yourX, yourY, self.view.frame.size.width, self.view.frame.size.height - yourY);

Categories : IOS

Jump when initially adjusting UITextView frame size in UIView animation
A bit late but I just had the same issue when resizing a uitextview and think it is related to the scrolling of the text view. This is my code that has 0 bounce when animating the height. I use an NSLayoutConstraint to adapt my height. - (void)textViewDidChange:(UITextView *)textView { CGSize size = [messageView sizeThatFits:CGSizeMake(messageView.frame.size.width, FLT_MAX)]; [UIView animateWithDuration:0.4f animations:^{ messageHeightConstraint.constant = size.height; [self.view layoutIfNeeded]; } completion:^(BOOL finished) { [messageView scrollRangeToVisible:NSMakeRange([messageView.text length], 0)]; } ]; }

Categories : IOS

make a UIButton imageView Bigger than the frame and then back to its original size?
Layers have a property masksToBounds and UIView has clipsToBounds. Most likely the button has these set to YES on the primary view or subviews. Its possible you can discover which ones have these set to YES, and set them temporarily to NO.

Categories : IOS

Working With Large SpriteSheets; how to assign frame position, size and number?
What you are looking to do, is work with a Texture Atlas, which is essentially an index of images contained inside of your spritesheet. You can then import the data into your environment to process the sprites contained inside of your image. Typically you would have all the sprites separate, and you would use a sprite packing tool, that would create a spritesheet, and a texture atlas for you to use. In this case, you already have a spritesheet packed, therefore you would need to calculate the atlas yourself.

Categories : C#

Dex: How to set dex.force.jumbo=true in Maven pom via android-maven-plugin?
Yes it ain't supported yet. But it's coming, maybe in 3.8.3 : https://github.com/jayway/maven-android-plugin/pull/271

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.