Posts

Compressing IplImage to JPEG using libjpeg in OpenCV -

So I have this problem. I have an ipype that I have to compress with JPEG and do something with it "libus Input colorspace goes to the function of jpeg_start_compress () with an error when it use libzpeg8b.The code exhaust. Here's my code. #include "highgui.h" #include & lt; Stdio.h & gt; #include "jpeglib.h" #include "cv.h" # Include & lt; Iostream & gt; # Include & lt; Fstream & gt; using namespace std; Using namespace cv; #pragma Comment (lib, "jpeglib.lib") bool ipl2jpeg (IplImage * frame, unsigned char ** outbuffer, unsigned long * outlen) {IplImage * img = new IplImage; Memcpy (img, frame, frame & gt; n shape); Unsigned four * outdata = (uchar *) img- & gt; Image data; Struct jpeg_compress_struct cinfo = {0}; Struct jpeg_error_mgr Ger; JSAMPROW row_ptr [1]; Int row_stride; * Outbuffer = Faucet; * Outlines = 0; Cinfo.err = jpeg_std_error (& jerr); Jpeg_create_compress (& amp; cinfo); Jp...

objective c - iphone copyWithZone memory leak - need help -

I have a hard time finding out what I am doing, so I hope someone correct me Can indicate in direction I am working on an app where there is an array of objects, each of these objects can have an array of objects and therefore (for the purpose of navigation) there is an indicator on its master object when I am one of these items I am facing a memory leak, I am trying to make a copy. @interface listItem: NSObject & lt; NSCopying & gt; {ListItem * MasterItem; NSString * strText; NSMutableArray * listItems; Bool bool don; NSDate * itemDate; } @ Property (non-nominal, retention) list * System * MasterItem; @property (non-constructive, retaining) NSString * strText; @protecti (nontomic, retten) nsmutbailarra * listimetermine; @property (nontomic, raten) NSDT * motherdate; @profile BOOL bool don; @end @implementation ListItem @ synthesize strText, listItems, boolDone, MasterItem, itemDate; - (id) init {if (self = [super init]) {self.strteext = noil; Self.listItems = Zero; Self...

objective c - Creating bundles in Cocoa -

What is the best way to create empty bundles in cocoa? The bundle in OS X is actually nothing but a folder, the only difference is that you have to click on the right content to "Show the contents of the package", right? Well, I need a bundle in that sense. After that I will put some files of my choice in it, such as a group of plast files. The reason for this is that my file structure (in this, the App Support folder) looks good at the root level. Related questions: How do I tell OS X that a folder is ending should be treated as a bundle with ".myappFoo"? The first place for information is Apple Developer Doctor In the following Whenever any state is correct, the Finder accepts one package: The directory has a known file name extension: .app, .bundle. Frame, .plugin, .kxt, and so on. The directory contains an extension that shows some other application claim package type; See the document package. The directory has its package bit sets. MyA...

eclipse - How do I set a canonical uri on jetty and redirect www users to non www address? -

It's been a bit annoying to me, I appreciate the solution very much. I am currently using Jetty (Jetty-7.3.3.0 v20110202) to host a stationary site. I intend to host written applications using JRuby in the future. I chose Jaiti in the first place because someone told me that there was a low memory footprint I am open to suggestions. I want to redirect the user to a canonical address. The above method just does not work for me and I do not know why. I want my canonical address and want to be guided by any visitor SEO friendly. I just want to use Jetty XML files for configuration. I say that there is a lack of JT documentation, but I am not a Java programmer, so I am probably wrong. I managed to fix it, after the guide included in the link included in the question. What was not indicated is that you have your site. The virtualhost section in the xml file This is commented by default in the test.xml file example, and definitely need to be inconsistent to work on...

PHP: getting data from Oracle 10g database -

I am working with PHP using wamp server 2.0 and my database is Oracle 10g. I am new to Php and I am trying to get data from database. There are two columns in my table. I want to show 1 column data. After executing I get the blank page without data from the database (and yes, there is data in my database). How can I fix this? & lt;? Php $ c = oci_connect ("system", "123", "localhost / xi"); If (! $ C) {echo "Unable to connect:" Var_dump (oci_error ()); Die (); } $ S = oci_parse ($ c, "select from tab1 to col2"); Oci_execute ($ s, OCI_DEFAULT); While ($ line = oci_fetch ($ s)) {echo $ line ['name']. "& Lt; br & gt;"; } // Commit to saving changes ... oci_commit ($ c); // logoff from Oracle ... oci_free_statement ($ s); Oci_close ($ c); ? & Gt; The result copies in an internal buffer that you have to access for example Using BTW: If you have set a high value and have started, you may ...

javascript - HTML5 video loading time -

I am trying to calculate the time of measurement of html5 video. I use javascript to use html5 video event loadstart and canplaythrough : media.addEventListener ('loadstart'getStartTime () {SetTime = New date (.) GetTime ();}, false) and end with the same event set to be set as canplaythrough . I did not get any data though Can someone please direct me how to measure the time of video loading using javascript. Thank you for your response, but the solution is to trust me using jQuery. However, I was thinking that it is possible with javascript. I've attached a copy of my code: Load the load video () {var timeNow = Date.now (), timestartlod, timefinal load; My videos = new array (); MyVideos [0] = "trailer.mp34"; MyVideos [1] = "trailer.ogg"; MyVideos [2] = "Trailer. M4V"; Var video id = document.getElementById ('idForVideo'); Var video = document.createElement ('video'); (Var i = 0; i } However I get undefin...

ruby on rails - How can I empty all the results in the database? -

I have the db: seed function that can add initial data to the database The database is cleaned so that it removes all the contents of the database, but leave the tables there so that I do not need to run all the migration again? If you set up a clean database again, then you should not run the migration, Code should be loaded by schema.rb DB: schema: Load (Large projects will have code in migration which will no longer run, for example, because the name of the class changed I went). rake db: drop db: make db: schema: load db: bead