Search Results

Search found 11 results on 1 pages for 'hallik'.

Page 1/1 | 1 

  • ImportError: No module named QtWebKit

    - by Hallik
    I am on centos5. I installed python26 source with a make altinstall. Then I did a: yum install qt4 yum install qt4-devel yum install qt4-doc From riverbankcomputing.co.uk I downloaded the source for sip 4.10.2, compiled and installed fine. Then from the same site I downloaded and compiled from source PyQt-x11-4.7.3 Both installs were using the python26 version (/usr/local/bin/python2.6). So configure.py, make, and make install worked with no errors. Finally, I tried to run this script, but got the error in the subject of this post: import sys import signal from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import QWebPage def onLoadFinished(result): if not result: print "Request failed" sys.exit(1) #screen = QtGui.QDesktopWidget().screenGeometry() size = webpage.mainFrame().contentsSize() # Set the size of the (virtual) browser window webpage.setViewportSize(webpage.mainFrame().contentsSize()) # Paint this frame into an image image = QImage(webpage.viewportSize(), QImage.Format_ARGB32) painter = QPainter(image) webpage.mainFrame().render(painter) painter.end() image.save("output2.png") sys.exit(0) app = QApplication(sys.argv) signal.signal(signal.SIGINT, signal.SIG_DFL) webpage = QWebPage() webpage.connect(webpage, SIGNAL("loadFinished(bool)"), onLoadFinished) webpage.mainFrame().load(QUrl("http://www.google.com")) sys.exit(app.exec_()) Even in the beginning of the configure for pyqt4, I saw it say QtWebKit should be installed, but apparently it's not? What's going on? I just did a find, and it looks like it wasn't installed. What are my options? [root@localhost ~]# find / -name '*QtWebKit*' /root/PyQt-x11-gpl-4.7.3/sip/QtWebKit /root/PyQt-x11-gpl-4.7.3/sip/QtWebKit/QtWebKitmod.sip /root/PyQt-x11-gpl-4.7.3/cfgtest_QtWebKit.cpp

    Read the article

  • Google Radar Chart: Not plotting data

    - by Hallik
    Hi. I have different types of data that I have normalized just with base10, so everything is on a 10 point scale. There are two data points, and the legend for them show up fine. All the points around the radar show up fine and so do the labels for them, but I don't see any filled in data. Outside of the labels and axis, the chart is blank. Below is the actual image tag I render, then I split up the variables on each line for easy readability. Anyone mind telling me why it isn't working? <img src="http://chart.apis.google.com/chart?cht=rs&amp;chm=B,3366CC60,0,1.0,5.0|B,CC4D3360,1,1.0,5.0&chs=600x500&chd=t:4.6756775443385,4.7031365524912,1.8646655408171,1.8358167047079,4.2483837215455,4.1367786166752,|5.0319252700625,5.0370797208146,1.8415340693163,1.8591105937857,4.3392150450337,4.1434876641017&chco=3366CC,CC4D33&chls=2.0,4.0,0.0|2.0,4.0,0.0&chxt=x&chxl=0:|Label1|Label2|label3|Label4|Label5|Label6&chxr=0,0.0,10.0&chdl=Data Object 1|Data Object 2&"/> cht=rs& chm=B,3366CC60,0,1.0,5.0|B,CC4D3360,1,1.0,5.0& chs=600x500& chd=t:4.6756775443385,4.7031365524912,1.8646655408171,1.8358167047079,4.2483837215455,4.1367786166752,|5.0319252700625,5.0370797208146,1.8415340693163,1.8591105937857,4.3392150450337,4.1434876641017& chco=3366CC,CC4D33& chls=2.0,4.0,0.0|2.0,4.0,0.0& chxt=x& chxl=0:|Label1|Label2|label3|Label4|Label5|Label6& chxr=0,0.0,10.0& chdl=Data Object 1|Data Object 2& This is the radar chart page, I can't tell what I am doing wrong. http://code.google.com/apis/chart/docs/gallery/radar_charts.html

    Read the article

  • Most efficient way to extract bit flags

    - by Hallik
    I have these possible bit flags. 1, 2, 4, 8, 16, 64, 128, 256, 512, 2048, 4096, 16384, 32768, 65536 So each number is like a true/false statement on the server side. So if the first 3 items, and only the first 3 items are marked "true" on the server side, the web service will return a 7. Or if all 14 items above are true, I would still get a single number back from the web service which is is the sum of all those numbers. What is the best way to handle the number I get back to find out which items are marked as "true"?

    Read the article

  • Tracking Mouse Stop

    - by Hallik
    I am trying to track mouse movements in the browser, and if a user stops their mouse for 0.5 seconds, to execute some code. I have put a breakpoint in the code below in firebug, and it breaks on the var mousestop = function(evt) line, but then jumps to the return statement. Am I missing something simple? Why isn't it executing the POST statement? I am tracking mouse clicks in a similar way, and it posts to the server just fine. Just not mouse stops. $.fn.saveStops = function() { $(this).bind('mousemove.clickmap', function(evt) { var mousestop = function(evt) { $.post('/heat-save.php', { x:evt.pageX, y:evt.pageY, click:"false", w:window.innerWidth, h:window.innerHeight, l:escape(document.location.pathname) }); }, thread; return function() { clearTimeout(thread); thread = setTimeout(mousestop, 500); }; }); };

    Read the article

  • Resume Activity with back button

    - by Hallik
    I have an application I am creating with a DashboardActivity & a SettingsActivity. On the dashboard, I have one object displayed, but when I go into settings, I want to be able to select/deselect X options. Once the user clicks the back button, I save that data locally and to the server. Once the phone receives a success message from the server that it was stored properly, I want to reload the dashboard. I thought I would do this with the onPause and onResume, but they are called when the DashboardActivity is first created. What would be the best way to reload the dashboard by calling my web service after the settings were saved to the server? Here is what I am doing when the back button is hit @Override public boolean onKeyDown(int keyCode, KeyEvent event) { //Save data to the server once the user hits the back button if ((keyCode == KeyEvent.KEYCODE_BACK)) { SchoolSearchActivity.this.divisionProxy = new DivisionProxy(SchoolSearchActivity.this.saveUserDivisionHandler); SchoolSearchActivity.this.divisionProxy.submitUserDivisions(SchoolSearchActivity.this.userDivisions, SchoolSearchActivity.this.user_id); //SchoolSearchActivity.this.finish(); //Toast.makeText(SchoolSearchActivity.this, "Divisions Saved",Toast.LENGTH_LONG).show(); } return true; } The above opens an HTTP connection, and when the response is received, the handler processes the response. I am going to: 1) throw up a progress dialog box letting the user know it's being submitted to the server, and once a response is received, 2) go back to the previous activity and call the "refresh" webservice again. What's the best way to accomplish 1 & 2?

    Read the article

  • Using glDrawElements does not draw my .obj file

    - by Hallik
    I am trying to correctly import an .OBJ file from 3ds Max. I got this working using glBegin() & glEnd() from a previous question on here, but had really poor performance obviously, so I am trying to use glDrawElements now. I am importing a chessboard, its game pieces, etc. The board, each game piece, and each square on the board is stored in a struct GroupObject. The way I store the data is like this: struct Vertex { float position[3]; float texCoord[2]; float normal[3]; float tangent[4]; float bitangent[3]; }; struct Material { float ambient[4]; float diffuse[4]; float specular[4]; float shininess; // [0 = min shininess, 1 = max shininess] float alpha; // [0 = fully transparent, 1 = fully opaque] std::string name; std::string colorMapFilename; std::string bumpMapFilename; std::vector<int> indices; int id; }; //A chess piece or square struct GroupObject { std::vector<Material *> materials; std::string objectName; std::string groupName; int index; }; All vertices are triangles, so there are always 3 points. When I am looping through the faces f section in the obj file, I store the v0, v1, & v2 in the Material-indices. (I am doing v[0-2] - 1 to account for obj files being 1-based and my vectors being 0-based. So when I get to the render method, I am trying to loop through every object, which loops through every material attached to that object. I set the material information and try and use glDrawElements. However, the screen is black. I was able to draw the model just fine when I looped through each distinct material with all the indices associated with that material, and it drew the model fine. This time around, so I can use the stencil buffer for selecting GroupObjects, I changed up the loop, but the screen is black. Here is my render loop. The only thing I changed was the for loop(s) so they go through each object, and each material in the object in turn. void GLEngine::drawModel() { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Vertex arrays setup glEnableClientState( GL_VERTEX_ARRAY ); glVertexPointer(3, GL_FLOAT, model.getVertexSize(), model.getVertexBuffer()->position); glEnableClientState( GL_NORMAL_ARRAY ); glNormalPointer(GL_FLOAT, model.getVertexSize(), model.getVertexBuffer()->normal); glClientActiveTexture( GL_TEXTURE0 ); glEnableClientState( GL_TEXTURE_COORD_ARRAY ); glTexCoordPointer(2, GL_FLOAT, model.getVertexSize(), model.getVertexBuffer()->texCoord); glUseProgram(blinnPhongShader); objects = model.getObjects(); // Loop through objects... for( int i=0 ; i < objects.size(); i++ ) { ModelOBJ::GroupObject *object = objects[i]; // Loop through materials used by object... for( int j=0 ; j<object->materials.size() ; j++ ) { ModelOBJ::Material *pMaterial = object->materials[j]; glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, pMaterial->ambient); glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pMaterial->diffuse); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, pMaterial->specular); glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, pMaterial->shininess * 128.0f); // Draw faces, letting OpenGL loop through them glDrawElements( GL_TRIANGLES, pMaterial->indices.size(), GL_UNSIGNED_INT, &pMaterial->indices ); } } if (model.hasNormals()) glDisableClientState(GL_NORMAL_ARRAY); if (model.hasTextureCoords()) { glClientActiveTexture(GL_TEXTURE0); glDisableClientState(GL_TEXTURE_COORD_ARRAY); } if (model.hasPositions()) glDisableClientState(GL_VERTEX_ARRAY); glBindTexture(GL_TEXTURE_2D, 0); glUseProgram(0); glDisable(GL_BLEND); } I don't know what I am missing that's important. If it's also helpful, here is where I read a 'f' face line and store the info in the obj importer in the pMaterial-indices. else if (sscanf(buffer, "%d/%d/%d", &v[0], &vt[0], &vn[0]) == 3) // v/vt/vn { fscanf(pFile, "%d/%d/%d", &v[1], &vt[1], &vn[1]); fscanf(pFile, "%d/%d/%d", &v[2], &vt[2], &vn[2]); v[0] = (v[0] < 0) ? v[0] + numVertices - 1 : v[0] - 1; v[1] = (v[1] < 0) ? v[1] + numVertices - 1 : v[1] - 1; v[2] = (v[2] < 0) ? v[2] + numVertices - 1 : v[2] - 1; currentMaterial->indices.push_back(v[0]); currentMaterial->indices.push_back(v[1]); currentMaterial->indices.push_back(v[2]); Again, this worked drawing it all together only separated by materials, so I haven't changed code anywhere else except added the indices to the materials within objects, and the loop in the draw method. Before everything was showing up black, now with the setup as above, I am getting an unhandled exception write violation on the glDrawElements line. I did a breakpoint there, and there are over 600 elements in the pMaterial-indices array, so it's not empty, it has indices to use. When I set the glDrawElements like this, it gives me the black screen but no errors glDrawElements( GL_TRIANGLES, pMaterial->indices.size(), GL_UNSIGNED_INT, &pMaterial->indices[0] ); I have also tried adding this when I loop through the faces on import if ( currentMaterial->startIndex == -1 ) currentMaterial->startIndex = v[0]; currentMaterial->triangleCount++; And when drawing... //in draw method glDrawElements( GL_TRIANGLES, pMaterial->triangleCount * 3, GL_UNSIGNED_INT, model.getIndexBuffer() + pMaterial->startIndex );

    Read the article

  • Parsing html for domain links

    - by Hallik
    I have a script that parses an html page for all the links within it. I am getting all of them fine, but I have a list of domains I want to compare it against. So a sample list contains list=['www.domain.com', 'sub.domain.com'] But I may have a list of links that look like http://domain.com http://sub.domain.com/some/other/page I can strip off the http:// just fine, but in the two example links I just posted, they both should match. The first I would like to match against the www.domain.com, and the second, I would like to match against the subdomain in the list. Right now I am using url2lib for parsing the html. What are my options in completely this task?

    Read the article

  • 503 server response for Googlebot

    - by Hallik
    I put an .htaccess file in my webroot with the following contents RewriteBase / RewriteCond %{HTTP_USER_AGENT} ^.*(Googlebot|Googlebot|Mediapartners|Adsbot|Feedfetcher)-?(Google|Image)? [NC] RewriteRule .* /var/www/503.html This website is in maintenance mode, and I don't want anything indexed yet. I tested the code with a firefox User-Agent switcher plugin, and looking at the access log it shows this at the end of each log entry, but watching in TamperData or Firebug, it still returns a 200 server response instead of a 503. What am I doing wrong? "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" contents of /var/www/503.html <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>503 - Service temporary unavailable</title> </head> <body> <h1>503 - Service temporary unavailable</h1> <p>Sorry, this website is currently down for maintainance please retry later</p> </body> </html> I get this in my error log. LogLevel debug, would that go into the vhost in a specific place? Every answer I see on google is something different. Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

    Read the article

  • Determine mouse click for all screen resolutions

    - by Hallik
    I have some simple javascript that determines where a click happens within a browser here: var clickDoc = (document.documentElement != undefined && document.documentElement.clientHeight != 0) ? document.documentElement : document.body; var x = evt.clientX; var y = evt.clientY; var w = clickDoc.clientWidth != undefined ? clickDoc.clientWidth : window.innerWidth; var h = clickDoc.clientHeight != undefined ? clickDoc.clientHeight : window.innerHeight; var scrollx = window.pageXOffset == undefined ? clickDoc.scrollLeft : window.pageXOffset; var scrolly = window.pageYOffset == undefined ? clickDoc.scrollTop : window.pageYOffset; params = '&x=' + (x + scrollx) + '&y=' + (y + scrolly) + '&w=' + w + '&random=' + Date(); All of this data gets stored in a DB. Later I retrieve it and display where all the clicks happened on that page. This works fine if I do all my clicks in one resolution, and then display it back in the same resolution, but this not the case. there can be large amounts of resolutions used. In my test case I was clicking on the screen with a screen resolution of 1260x1080. I retrieved all the data and displayed it in the same resolution. But when I use a different monitor (tried 1024x768 and 1920x1080. The marks shift to the incorrect spot. My question is, if I am storing the width and height of the client, and the x/y position of the click. If 3 different users all with different screen resolutions click on the same word, and a 4th user goes to view where all of those clicks happened, how can I plot the x/y position correctly to show that everyone clicked in the same space, no matter the resolution? If this belongs in a better section, please let me know as well.

    Read the article

  • Compare string with all values in array

    - by Hallik
    I am trying to fumble through python, and learn the best way to do things. I have a string where I am doing a compare with another string to see if there is a match: if paid[j].find(d)>=0: #BLAH BLAH If 'd' were an array, what is the most efficient way to see if the string contained in paid[j] has a match to any value in 'd'?

    Read the article

  • Catch/Intercept all mouse clicks

    - by Hallik
    I have this simple script that catches all mouse clicks, unless you click on something that actually works. Links, flash videos, etc. How can I adjust this so no matter what a user clicks on, before the video loads, new page loads, etc. It sends the simple GET request I built? (function($) { $.fn.saveClicks = function() { $(this).bind('mousedown.clickmap', function(evt) { var clickDocument = (document.documentElement != undefined && document.documentElement.clientHeight != 0) ? document.documentElement : document.body; var width = clickHeatDocument.clientWidth != undefined ? clickDocument.clientWidth : window.innerWidth; var height = clickHeatDocument.clientHeight != undefined ? clickDocument.clientHeight : window.innerHeight; var scrollx = window.pageXOffset == undefined ? clickDocument.scrollLeft : window.pageXOffset; var scrolly = window.pageYOffset == undefined ? clickDocument.scrollTop : window.pageYOffset; var x = evt.clientX + scrollx; var y = evt.clientY + scrolly; $.get('/click-save.php', { "x":evt.pageX, "y":evt.pageY, "click":"true", "w":width, "h":height, "l":escape(document.location.pathname), "d":escape(document.domain) }); }); }; })(jQuery); $(function() { $(document).saveClicks(); });

    Read the article

1