Search Results

Search found 557 results on 23 pages for 'anthony aziz'.

Page 12/23 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Maintain aspect ratio on browser window resize?

    - by Anthony
    I have a simple page with images, and when the user clicks the image, it opens up a new browser window with the image filling the area. I have the css set on the new window so that the image height and width are both 100% (and overflow is set to hidden) so that the window can be resized. But what I need is for the window to maintain aspect ratio if the user resizes it. Right now, I'm stuck because I'm not getting how the event works, but I think I'm making this harder than it needs to be. Right now I have: $(function(){ $(window).resize(function() { var height = $(this).attr("innerHeight"); var width = $(this).attr("innerWidth"); if(height/width != .75){ window.resizeTo(width,width*.75); } }); }); Before I added the conditional, the window would immediately start shrinking (apparently opening a new window fires the resize event). Adding the conditional preventing this from happening when the window opens, but any resizing starts the shrinking again. Is it just because the height and width are never exactly the right ratio (should I manually set the width to a round number ever time) or is there something else I'm doing wrong? Or is there some other way to get what I'm after that's more straightforward?

    Read the article

  • Kohana 2.3.4 ORM pivot table query

    - by anthony
    I'm trying to query a pivot table with Kohana's ORM and I'm wondering if there is a built in function I'm missing. Currently I only have 2 models setup for the tables "categories" and "products". There is a pivot table "categories_products", but I don't need a model for it when inserting data with this: $product = ORM::factory('product'); $product->add(ORM::factory('category', $addCat)); However, I can't figure out how to query it without creating a model for it. The "join_table" function only returns the name of the pivot table (which I thought selected the table at first). If you can save data to the pivot table without a model, it seems to me that you should be able to retrieve data in a similar way. Any ideas?

    Read the article

  • WinForm PDF viewer with programatic search functionality

    - by Anthony Shaw
    We are currently using PDFTron's PDFView WinForm control to view PDF's in a WinForm application. I can load the file and search the file to highlight a certain text value. We have run into an issue where we have expired our trial license period and do not wish to shell out the $900/seat licensing on 15-20 computers. Does anybody know if the ActiveX Adobe Reader control can support the searching functionality programatically? I've tried that and the FoxIt Reader OCX control and neither seem to have this feature exposed (unless it's hidden really well) Does anybody have any suggestions for other freeware/open source viewers, or less-expensive viewers? TIA!

    Read the article

  • package is not found, even though it's in both build classpath and runtime classpath

    - by Anthony
    I am unable to compile a Java program because the compiler cannot find some of the packages needed even though they are in both the build classpath and runtime classpath. Other packages it can find just fine. The image below shows the problem. I have highlighted the gdata-media package in eclipse, as its the first package on the console that its not able to find: Click for full size What am I doing wrong?

    Read the article

  • Create a screen like the iPhone home screen with Scrollview and Buttons

    - by Anthony Chan
    Hi, I'm working on a project and need to create a screen similar to the iPhone home screen: A scrollview with multiple pages A bunch of icons When not in edit mode, swipe through different pages (even I started the touch on an icon) When not in edit mode, tap an icon to do something When in edit mode, drag the icon to swap places, and even swap to different pages When in edit mode, tap an icon to remove it Previously I read from several forums that I have to subclass UIScrollview in order to have touch input for the UIViews on top of it. So I subclassed it overriding the methods to handle touches: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { //If not dragging, send event to next responder if (!self.dragging) [self.nextResponder touchesBegan:touches withEvent:event]; else [super touchesBegan:touches withEvent:event]; } In general I've override the touchesBegan:, touchesMoved: and touchesEnded: methods similarly. Then in the view controller, I added to following code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; UIView *hitView = (UIView *)touch.view; if ([hitView isKindOfClass:[UIView class]]) { [hitView doSomething]; NSLog(@"touchesBegan"); } } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { // Some codes to move the icons NSLog(@"touchesMoved"); } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"touchesEnded"); } When I run the app, I have the touchesBegan method detected correctly. However, when I tried to drag the icon, the icon just moved a tiny bit and then the page started to scroll. In console, it logged with 2 or 3 "touchesMoved" message only. However, I learned from another project that it should logged tonnes of "touchesMoved" message as long as I'm still dragging on the screen. (I'm suspecting I have the delaysContentTouches set to YES, so it delays a little bit when I tried to drag the icons. After that minor delay, it sends to signal back to the scrollview to scroll through the page. Please correct me if I'm wrong.) So if any help on the code to perform the above tasks would be greatly appreciated. I've stuck in this place for nearly a week with no hope. Thanks a lot.

    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

  • Linq to Sql saying that item by 'Customer' already exists. Choose a different name.

    - by Anthony Potts
    I have been going round and round with a linq to sql file while using svn for quite some time. The latest is that my dbml file shows as having an error which states that An item named "Customer" already exists. Please choose a different name. And then it repeats that again. In fact, it says it for almost every object. What is my fix? I have tried renaming the one named Customer, but that didn't fix it. I don't know where to go to fix this. I went to the .dbml file and don't see any duplication, and I went to the .dbml.layout file and didn't see any duplication there either.

    Read the article

  • How to perform kCATransitionPush animation without any transparency / fade effects

    - by Anthony
    I'm trying to duplicate the "slide up from the bottom" animation that [UIViewController presentModalViewController:animated:] performs but without calling it because I don't want a modal view. The below core animation code comes very close but appears to be changing transparency values of the views during it. At the start of the animation you can partially see through the view sliding up. By the middle/end of the animation the view we are sliding over is fully transparent so we can see behind it. I'd like both to remain fully opaque during this animation. Any ideas on how to stop transparency changes in this code or to otherwise get the "slide up animation" I am looking for without requiring a modal view? UIViewController *nextViewController = [[UIViewController alloc] autorelease]; nextViewController.view.backgroundColor = [UIColor redColor]; CATransition *animation = [CATransition animation]; animation.duration = 3.5; animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; animation.type = kCATransitionPush; animation.subtype = kCATransitionFromTop; [self.navigationController pushViewController:nextViewController animated:NO]; [self.navigationController.view.layer addAnimation:animation forKey:nil];

    Read the article

  • facebook PermissionDialog

    - by Anthony
    <script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script> <script type="text/javascript"> FB.init('cef61789d5df166ac00c9fe13007c110', "xd_receiver.htm"); FB.Connect.showPermissionDialog("offline_access"); </script> After a user login i am using the above code to get the Dialog box. Why itsnt showing permission dialog??

    Read the article

  • Why I cannot get correct class of a custom class through isKindOfClass?

    - by Anthony Chan
    Hi, I've created a custom class AnimalView which is a subclass of UIView containing a UILabel and a UIImageView. @interface AnimalView : UIView { UILabel *nameLabel; UIImageView *picture; } Then I added in several AnimalView onto the ViewController.view. In the touchesBegan:withEvent: method, I wanted to detect if the touched object is an AnimalView or not. Here is the code for the viewController: @implementation AppViewController - (void)viewDidLoad { UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:... [self.view addSubview scrollview]; for (int i = 0; i<10; i++) { AnimalView *newAnimal = [[AnimalView alloc] init]; // customization of newAnimal [scrollview addSubview:newAnimal; } } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; UIView *hitView = touch.view; if ([hitView isKindOfClass:[AnimalView class]]) { AnimalView *animal = (AnimalView *)hitView; [animal doSomething]; } } However, nothing happened when I clicked on the animal. When I checked the class of hitView by NSLog(@"%@", [hitView class]), it always shows UIView instead of AnimalView. Is it true that the AnimalView changed to a UIView when it is added onto the ViewController? Is there any way I can get back the original class of a custom class?

    Read the article

  • How do I store a Java KeyStore password?

    - by Anthony D
    In my web application I access a private key that is stored in a Java KeyStore. I would like to know what is the best/recommended way to store the password for the KeyStore and private key. I've considered using a properties file but that does not seem very secure for use in a production environment (storing password in a plain text file). Also, hard-coding the password in my code is not an option I'm willing to entertain. Thanks.

    Read the article

  • Hierarchical data in Linq - options and performance

    - by Anthony
    I have some hierarchical data - each entry has an id and a (nullable) parent entry id. I want to retrieve all entries in the tree under a given entry. This is in a SQL Server 2005 database. I am querying it with LINQ to SQL in C# 3.5. LINQ to SQL does not support Common Table Expressions directly. My choices are to assemble the data in code with several LINQ queries, or to make a view on the database that surfaces a CTE. Which option (or another option) do you think will perform better when data volumes get large? Is SQL Server 2008's HierarchyId type supported in Linq to SQL?

    Read the article

  • What is Northwind.EmployeesRow

    - by Anthony
    I am doing a tutorial where you use a templatefield in the gridview control to call a function. I don't understand the code for the function. What is the object Northwind.EmployeesRow? This is the tutorial I am doing. http://msdn.microsoft.com/en-us/library/bb288032%28v=MSDN.10%29.aspx#aspnett12ustmpfldsvb_topic5 And this is the code for the function. Protected Function DisplayDaysOnJob(ByVal employee As Northwind.EmployeesRow) As String If employee.IsHireDateNull() Then Return "Unknown" Else ' Returns the number of days between the current ' date/time and HireDate Dim ts As TimeSpan = DateTime.Now.Subtract(employee.HireDate) Return ts.Days.ToString("#,##0") End If End Function

    Read the article

  • Silverlight 4 Data Binding with anonymous types.

    - by Anthony
    Does anyone know if you can use data binding with anonymous types in Silverlight 4? I know you can't in previous versions of silverlight, you can only databind to public class properties and anonymous type properties are internal. Just wondering if anyone has tried it in silverlight 4? Thanks in advanced

    Read the article

  • PHP Scope Resolution Operator Question

    - by anthony
    I'm having trouble with the MyClass::function(); style of calling methods and can't figure out why. Here's an example (I'm using Kohana framework btw): class Test_Core { public $var1 = "lots of testing"; public function output() { $print_out = $this->var1; echo $print_out; } } I try to use the following to call it, but it returns $var1 as undefined: Test::output() However, this works fine: $test = new Test(); $test->output(); I generally use this style of calling objects as opposed to the "new Class" style, but I can't figure out why it doesn't want to work.

    Read the article

  • OSX: Why is GetProcessInformation() causing a segfault?

    - by anthony
    Here's my C method to get the pid of the Finder process. GetProcessInformation() is causing a segfault. Why? Here's the function: static OSStatus GetFinderPID(pid_t *pid) { ProcessSerialNumber psn = {kNoProcess, kNoProcess}; ProcessInfoRec info; OSStatus status = noErr; info.processInfoLength = sizeof(ProcessInfoRec); info.processName = nil; while (!status) { status = GetNextProcess(&psn); if (!status) { status = GetProcessInformation(&psn, &info); } if (!status && info.processType == 'FNDR' && info.processSignature == 'MACS') { return GetProcessPID(&psn, pid); } } return status; } Here's the backtrace: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000032aaaba7 0x00007fffffe00623 in __bzero () (gdb) bt #0 0x00007fffffe00623 in __bzero () #1 0x00007fff833adaed in CreateFSRef () #2 0x00007fff833ab53b in FSPathMakeRefInternal () #3 0x00007fff852fc32d in _CFGetFSRefFromURL () #4 0x00007fff852fbfe0 in CFURLGetFSRef () #5 0x00007fff85dd273f in GetProcessInformation () #6 0x0000000100000bef in GetFinderPID [inlined] () at /path/to/main.c:21

    Read the article

  • C# dictionary uniqueness for sibling classes using IEquatable<T>

    - by anthony
    I would like to store insances of two classes in a dictionary structure and use IEquatable to determine uniqueness of these instances. Both of these classes share an (abstract) base class. Consider the following classes: abstract class Foo { ... } class SubFoo1 : Foo { ... } class SubFoo2 : Foo { ... } The dictionary will be delcared: Dictionary<Foo, Bar> Which classes should be declared as IEquatable? And what should the generic type T be for those declarations? Is this even possible?

    Read the article

  • WinForms binding

    - by Anthony
    I have some controls bound to a BindingSource control. I want to do a calculation when the value changes in one control and set the result on another control. Do i update the textbox the property is bound to or do i update the underlying entity which would update the control anyway(i hope)? When i change textbox A...textbox B is updated with the new calculated result..this works fine...but i have noticed that when i Leave textbox A..textbox B reverts back to its original value...what is going on here!

    Read the article

  • Java book for programmer with intermediate experience

    - by Anthony Forloney
    I am well aware of this previous question here and have heard great things about those books. I actually bought two of them, Effective Java and Java in a Nutshell as an early Christmas present. I am looking for a good Java book, or books, to further continue my understanding of Java from a recent college graduate point of view. I have learned Java in college and would consider it to be the language I am most comfortable with. Can anyone recommend a good "intermediate" Java book for a situation like mine? This question should be community, I just don't know how to migrate it. I apologize for any inconvenience. Thank you in advance.

    Read the article

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