Daily Archives

Articles indexed Tuesday May 4 2010

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

  • RubyQT QGraphicsview scale images to fit window

    - by shadowskill
    I'm trying to make an image scale inside of a QGraphicsView and having zero success. I did find this C++ question with what seemed to be the same problem:http://stackoverflow.com/questions/2489754/qgraphicsview-scrolling-and-image-scaling-cropping I borrowed the approach of overriding the drawback/foreground. However when I run the script I'm greeted with a method_missing error: method_missing: undefined method drawPixmap for #<Qt::Painter:0x7ff11eb9b088> QPaintDevice: Cannot destroy paint device that is being painted What should I be doing to get the QGraphicsView to behave the way I want? class Imageview < Qt::GraphicsView attr_reader :pixmap def initialize(parent=nil) # @parent=parent super() @pixmap=pixmap Qt::MetaObject.connectSlotsByName(self) end def loadimage(pixmap) @pixmap=pixmap end def drawForeground(painter, rect) #size=event.size() #item= self.items()[0] #Qt::GraphicsPixmapItem.new #pixmap=@pixmap #painter=Qt::Painter.new [email protected](Qt::Size.new(rect.width,rect.height),Qt::KeepAspectRatio, Qt::SmoothTransformation) # painter.begin(self) painter.drawPixmap(rect,sized,Qt::Rect.new(0.0, 0.0, sized.width,sized.height)) #painter.end() # item.setPixmap(sized) #painter.end self.centerOn(1.0,1.0) #item.scale() # item.setTransformationMode(Qt::FastTransformation) # self.fitInView(item) end def updateSceneRect painter=Qt::Painter.new() drawForeground(painter,self.sceneRect) end end app=Qt::Application.new(ARGV) #grview=Imageview.new pic=Qt::Pixmap.new('pic') grview=Imageview.new() grview.loadimage(pic) scene=Qt::GraphicsScene.new #scene.addPixmap(pic) grview.setScene(scene) #grview.fitInView(scene) grview.renderHint=Qt::Painter::Antialiasing | Qt::Painter::SmoothPixmapTransform grview.backgroundBrush = Qt::Brush.new(Qt::Color.new(230, 200, 167)) grview.show app.exec

    Read the article

  • In .NET, What Is Fastest Way to Initialize Multi-Dimensional Array to Non-Default Value

    - by AMissico
    How do I initialize a multi-dimensional array of a primitive type as fast as possible? I am stuck with using multi-dimensional arrays. My problem is performance. The following routine initializes a 100x100 array in approx. 500 ticks. Removing the int.MaxValue initialization results in approx. 180 ticks just for the looping. Approximately 100 ticks to create the array without looping and without initializing to int.MaxValue. Routines similiar to this are called a few tens-of-thousands to several million times. I am open to suggestions on how to optimize this non-default initialization of an array. One idea I had is to use a smaller primitive type when available. For instance, using byte instead of int, saves 100 ticks. I would be happy with this, but I am hoping that I don't have to change the primitive data type. public int[,] CreateArray(Size size) { int[,] array = new int[size.Width, size.Height]; for (int x = 0; x < size.Width; x++) { for (int y = 0; y < size.Height; y++) { array[x, y] = int.MaxValue; } } return array; }

    Read the article

  • How to move user content in Wix Installer

    - by Simeon Pilgrim
    To support Window Vista in my game, I have changed were the save files are placed (From under Program Files to My Documents) for both XP and Vista installations. Now I would like to be able to move the current XP users save games from the old location to the new location. I think I can correctly trigger this via the upgrade checking code like so: <Upgrade Id="PLACE-GUID-HERE"> <UpgradeVersion OnlyDetect="yes" Minimum="$(var.ProductVersion)" IncludeMinimum="no" Property="NEWERVERSIONDETECTED" /> <UpgradeVersion OnlyDetect="no" Minimum="1.1.0" IncludeMinimum="yes" Maximum="$(var.ProductVersion)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" /> <UpgradeVersion OnlyDetect="no" Maximum="1.1.0" IncludeMaximum="no" Property="MOVESAVEFILESUPGRADED" /> </Upgrade> where 1.0.x was the old way and 1.1.x will be the new way, thus I could do something in a custom action based on MOVESAVEFILESUPGRADED, but the heart of the problem, I cant see how to move non-installed files from one location to another.

    Read the article

  • how to order a group result with Linq?

    - by Aaron
    How can I order the results from "group ... by... into..." statement in linq? For instance: var queryResult = from records in container.tableWhatever where records.Time >= DateTime.Today group records by tableWhatever.tableHeader.UserId into userRecords select new { UserID = userRecords.Key, Records = userRecords }; The query returns records in table "contain.tableWhatever" grouped by "UserId". I want the returned results within each group ordered by time decending. How can I do that? More specific, assume the above query return only one group like the following: {UserID = 1, Records= {name1 5/3/2010_7:10pm; name2 5/3/2010_8:10pm; name3 5/3/2010_9:10pm} } After insert the orderby statement in the above query, the returned results should be like this: {UserID = 1, Records= {name3 5/3/2010_9:10pm; name2 5/3/2010_8:10pm; name1 5/3/2010_7:10pm} } Thanks for help!

    Read the article

  • Setting DNS suffix for multiple network adapters in a VM

    - by arun_bh
    Is there a way to set the DNS Suffix for multiple network adapters in a VM using the sysprep file? We are trying to setup Windows 2003 VMs with 2 network adapters. In the one adapter case the sysprep we are able to set the suffix using DNSDomain. But this doesnt work in the 2 adapter case. The The VM is setup corrently though without any issues but one of our apps relies on the DNS Suffix value to work correctly. Thanks in advance.

    Read the article

  • Why would searching in Websphere Portal Administration exclude some results?

    - by Scott Leis
    I have logged into a website based on Websphere Portal 6.0, gone to the Administration console, then to Portlet Management - Portlets. At a guess, there are about 200 portlets on this server. 22 portlets have a title starting with "IGM", but if I use the "Title starts with" search option and enter "igm" (or any case variation), only one of these portlets is found. The portlets excluded from the "Title starts with" search are also excluded from the "Title contains" search, but some of them can be found with the "Unique name contains" search (noting that only 5 of these have a unique name). Why would title searches exclude these portlets? I also see similar behaviour in other areas of the Portal administration. E.g. going to Portal Settings - Custom Unique Names - Pages, and performing title searches excludes some results, depending on the search terms entered.

    Read the article

  • DundeeWealth Selects Oracle CRM On Demand as Core Platform

    - by andrea.mulder
    "Oracle CRM On Demand enhances our existing Oracle platform, providing an integrated solution with incredible flexibility, mobility, agility and lowered total cost of ownership," said To Anh Tran, Senior Vice President of Business Transformation and Technology at DundeeWealth Inc. "Using Oracle as a partner in the expansion of DundeeWealth's CRM processes reinforces our client-centric approach to customer service and we believe it gives us a competitive advantage. As we begin our deployment, we are confident that Oracle is with us every step of the way." Click here to read more about more about DundeeWealth's plans.

    Read the article

  • Cannot insert non latin symbols in MySQL

    - by glebreutov
    I'm writing web-app using MySQL version 5.1.45, Tomcat 5.5.28 and Hibernate 3 When I'm trying to save string that contains non-latin characters (for example ??????) error occurs: 1589 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1366, SQLState: HY000 1589 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: '\xD0\xA3\xD0\xBF\xD1\x8F...' for column 'name' at row 1 Hibernate connection settings <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url">jdbc:mysql://localhost/E2012?characterEncoding=UTF8&amp;useUnicode=true</property> <property name="connection.username">***</property> <property name="connection.password">***</property> <property name="hibernate.connection.charSet">UTF8</property> MySQL config My.cnf [client] default-character-set=utf8 [mysqld] default-character-set=utf8 Even query set name utf-8 doesn't resolve problem Thanks for help!

    Read the article

  • how to display a dialog if user can't download file

    - by tom smith
    hi. dealing with php/html/javascript. i'm trying to figure out a good/best approach to allowing a user to download a file. i can have the traditional href link, that interfaces with the back end php app to download the file. however, i want to have the app display some sort of dialog/alert if the user isn't able (basedon acl/permissions) to download the file... does this have to ba an ajax thing, as i don't want to do a page refresh... thoughts/comments/pointers to code samples are appreciated. thanks. -tom

    Read the article

  • Distribute CouchDB as part of a Rails app?

    - by AaronThomson
    I am working on a Rails project and the Architect has asked me to investigate bundling CouchDB into to application so that it can be deployed by Capistrano across multiple platforms and managed by Rake. My expectation was that I could set up the Erlang VM on the various environments and then distribute the CouchDB application with Capistrano. However I can't find any option to download CouchDB without the Erlang runtime. I can, however see an option to build CouchDB from source which I assume is platform dependent. I am new to Erlang and CouchBD, am I missing something? Is there a way to bundle CouchDB into a Rails app and distribute it across multiple platforms?

    Read the article

  • Apache module, is it possible to have asynchronous processing

    - by prashant2361
    Hi, I have a requirement where I need to send continous updates to my clients. Client is browser in this case. We have some data which updates every sec, so once client connects to our server, we maintain a persistent connection and keep pushing data to the client. I am looking for suggestions of this implementation at the server end. Basically what I need is this: 1. client connects to server. I maintain the socket and metadata about the socket. metadata contains what updates need to be send to this client 2. server process now waits for new client connections 3. One other process will have the list of all the sockets opened and will go through each of them and send the updates if required. Can we do something like this in apache module: 1. apache process gets the new connection. It maintains the state for the connection. It keeps the state in some global memory and returns back to root process to signify that it is done so that it can accept the new connection 2. the apache process though has returned the status to root process but it is also executing parallely where it going through its global store and sending updates to the client, if any. So can a apache process do these things: 1. Have more than one connection associated with it 2. Asynchronously waiting for new connection and at the same time processing the previous connections? Regards Prashant

    Read the article

  • Read a variable from a variable cookie jquerycookie.

    - by Ozaki
    TLDR How could I tell "page.html" which one of 3 or so cookies to look at when the cookie is set on the previous page? Currently: When a link is clicked save text of link to cookie When "page.html" is loaded get the value of the cookie Loads the getjson call as per value of the cookie. E.g: <a href="page.html">link1</a> -c1 <a href="page.html">link2</a> -c2 <a href="page.html">link3</a> -c3 See previous discussion here Now that is all good and well apart from the fact if I were to say open them in multiple tabs. It changes the cookie and correctly loads the right data. But if I were to refresh one of these tabs it will load the most recently open data rather than what it should be. So if I were to save a cookie as c1 with a value of link1 c2 with a value of link2 c3 with a value of link3 How could I tell "page.html" which cookie it should be looking at, therefore not breaking the back/forward/refresh buttons on the browser when multiple tabs are open?

    Read the article

  • Word on HTML document point.

    - by leolobato
    Hey guys, How can I figure out which word is at the point where the user tapped on a UIWebView? I am able to detect the CGPoint for the tap (subclassing UIWindow like this), and I can actually get the DOM element on that point using javascript. But I know very little of javascript and DOM to figure out how can I actually get which word the user tapped on. Is that possible? Here's what I have right now: int scrollPosition = [[webView stringByEvaluatingJavaScriptFromString:@"window.pageYOffset"] intValue]; NSString *js = [NSString stringWithFormat:@"document.elementFromPoint(%f, %f).tagName", point.x, point.y+scrollPosition]; NSString *value = [webView stringByEvaluatingJavaScriptFromString:js]; NSLog(@"element: %@", value);

    Read the article

  • Which method of creating javascript objects is better?

    - by Germaine
    I've seen objects defined in two different ways, which function similarly, but are, of course, fundamentally different. You can do it either like this: var myobject = {property: 'hello', act: function() { this.property += ' world'; }}; and like this: function myobject() { this.property = 'hello'; this.act = function() { this.property += 'world'; } } The second method could create objects like so var newobj = new myobject(); but you could do something similar using the first notation by making the object the return value of a function. The new keyword has the advantage of being able to pass parameters that can be used to initialize the properties of the object, but you could just as easily add an init function to the first kind of object. Just wondering if besides these two differences, if there was a fundamental difference that made one method definitely better than the other method.

    Read the article

  • Problem in displaying the movie file in silverlight

    - by BALAMURUGAN
    I am developing a portal for online theatre system. I will show the movie in online website daily in shows(like 6-10 PM Shows). I am using Silverlight to display the video in web application. I am holding my movie file in Windows Azure Blob. I am having a problem displaying the movie file. Consider if ay user login to web system @6 The movie will show from starting.. If the user login to the system @7 the movie should start whats going now in the screen for other user not from the begining of the movie. How can I achieve tis.

    Read the article

  • open source business intelligence solutions

    - by opensas
    which open source business intelligence solution would you recommend? All I need is to build some cubes and let the end user play with dimensions, filter data, sort, etc, and once it's done being able to export it to excel... I'd like the solution to be as simple and easy on resources as possible, and also I'd like it to be as much open source as possible, by the way. I've heard that many solutions available do have many restrictions when it comes to there community version. I'd like to ear your advices and the pros/cons of each alternative, to help me choose the right tool, and if you could point me to some basic demo and tutorial to get started. thanks a lot ps: I'm using sql server databases, they aren't huge databases (in general less than a million records) and I doesn't necessarily have to work on "live" data... ps: some useful links: http://en.wikipedia.org/wiki/Business_intelligence_tools#Open_source_free_products http://www.manageability.org/blog/stuff/open-source-java-business-intelligence http://www.jaspersoft.com/jasperanalysis http://community.pentaho.com/projects/bi_platform/ http://community.pentaho.com/faq/platform_licensing.php http://www.eclipse.org/birt/phoenix/ http://www.spagoworld.org/xwiki/bin/view/SpagoWorld/ http://docs.google.com/viewer?a=v&q=cache:vhsqMQXwCUkJ:www.ow2.org/xwiki/bin/download/Activities/EuropeLocalChapterWebinars/ELCWebinarOSBI.pdf+open+source+business+intelligence&hl=en&pid=bl&srcid=ADGEESgpJJ2MqaKprJQOF2jX2UXCZQjg_asv8d7EVYtq0Vma-e-tR1tFxS-I0SOW0IhJC5acYc94rkDOrgP1WckCp_vk4qhKqR9y2Klp_u9cL8hlXoKoUpMkpAd5wabu61A4W0y15E5P&sig=AHIEtbRJ5FAI-3YK-qtayPjKkF_CwOgZag

    Read the article

  • Customising event delegates in the jQuery validation plug-in

    - by Russell
    I am currently setting up the jQuery validation plug-in for use in our project. By default, there are some events automatically set up for handling. I.e. focus in/out, key up events on all inputs fire validation. I want it to only fire when the submit button is clicked. This functionality seems to be in-built into the plug-in, which is making it difficult to do this (without modifying the plug-in code, Not What I Want To Do). I have found the eventDelegate function calls in the plugin code prototype method: $(this.currentForm) .validateDelegate(":text, :password, :file, select, textarea", "focusin focusout keyup", delegate) .validateDelegate(":radio, :checkbox, select, option", "click", delegate); When I remove these lines from the plug-in I get my result, however I would much rather do something Outside the plug-in to achieve this. Can anybody please help me? If you need any more details, please let me know. I have searched google with little success. Thanks

    Read the article

  • The Silverlight Group's First Blog Post

    - by TheSilverlightGroup
    Welcome to The Silverlight Group's first blog post! First of all, we just want to introduce ourselves. The Silverlight Group is a new Microsoft vendor company whose primary officers are David Silverlight himself as Chief Software Architect & Kim Schmidt as "Connection String", a form of CEO. So, for a simple introduction, there you have it We will be updating this blog on a regular basis, so please visit us often & share your thoughts with us, as we will with you. Thanks for visiting us while we get set up!

    Read the article

  • All applications quit when printing on imac OS X 10.5.8

    - by Tamany
    I recently ran a software update. I'm not sure if my problems are associated with this but I'm pretty sure they are as I printed successfully before update. I checked the log at time of printing: 03/05/2010 22:03:15 Microsoft Word[697] *** -[NSCFString _getValue:forType:]: unrecognized selector sent to instance 0x17a82b50 03/05/2010 22:03:15 [0x0-0x51051].com.microsoft.Word[697] Ignoring Quickdraw drawing between QDBeginCGContext and QDEndCGContext 03/05/2010 22:03:16 [0x0-0x51051].com.microsoft.Word[697] Ignoring Quickdraw drawing between QDBeginCGContext and QDEndCGContext 03/05/2010 22:03:16 [0x0-0x51051].com.microsoft.Word[697] Ignoring Quickdraw drawing between QDBeginCGContext and QDEndCGContext 03/05/2010 22:03:16 [0x0-0x51051].com.microsoft.Word[697] Ignoring Quickdraw drawing between QDBeginCGContext and QDEndCGContext 03/05/2010 22:03:16 [0x0-0x51051].com.microsoft.Word[697] Ignoring Quickdraw drawing between QDBeginCGContext and QDEndCGContext 03/05/2010 22:03:16 [0x0-0x51051].com.microsoft.Word[697] Ignoring Quickdraw drawing between QDBeginCGContext and QDEndCGContext 03/05/2010 22:03:17 [0x0-0x51051].com.microsoft.Word[697] Mon May 3 22:03:17 leopards-imac-2.local Word[697] <Error>: The function `CGPDFDocumentGetMediaBox' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance. Please use `CGPDFPageGetBoxRect' instead. 03/05/2010 22:22:09 Microsoft Word[697] *** -[NSCFString _getValue:forType:]: unrecognized selector sent to instance 0x1b036500 Any thoughts on how to fix this?

    Read the article

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