Search Results

Search found 6679 results on 268 pages for 'cube processing'.

Page 51/268 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • Cilk or Cilk++ or OpenMP

    - by Aman Deep Gautam
    I'm creating a multi-threaded application in Linux. here is the scenario: Suppose I am having x instance of a class BloomFilter and I have some y GB of data(greater than memory available). I need to test membership for this y GB of data in each of the bloom filter instance. It is pretty much clear that parallel programming will help to speed up the task moreover since I am only reading the data so it can be shared across all processes or threads. Now I am confused about which one to use Cilk, Cilk++ or OpenMP(which one is better). Also I am confused about which one to go for Multithreading or Multiprocessing

    Read the article

  • What is the fastest way to find duplicates in multiple BIG txt files?

    - by user2950750
    I am really in deep water here and I need a lifeline. I have 10 txt files. Each file has up to 100.000.000 lines of data. Each line is simply a number representing something else. Numbers go up to 9 digits. I need to (somehow) scan these 10 files and find the numbers that appear in all 10 files. And here comes the tricky part. I have to do it in less than 2 seconds. I am not a developer, so I need an explanation for dummies. I have done enough research to learn that hash tables and map reduce might be something that I can make use of. But can it really be used to make it this fast, or do I need more advanced solutions? I have also been thinking about cutting up the files into smaller files. To that 1 file with 100.000.000 lines is transformed into 100 files with 1.000.000 lines. But I do not know what is best: 10 files with 100 million lines or 1000 files with 1 million lines? When I try to open the 100 million line file, it takes forever. So I think, maybe, it is just too big to be used. But I don't know if you can write code that will scan it without opening. Speed is the most important factor in this, and I need to know if it can be done as fast as I need it, or if I have to store my data in another way, for example, in a database like mysql or something. Thank you in advance to anybody that can give some good feedback.

    Read the article

  • Codeigniter Image Library Cropping an Image with 2 sets of coordinates to make square anywhere?

    - by chris
    Spending time reading through the docs, and searching for examples. I understand cropping an image from top 0, and left 0 is pretty straight forward. However. I would like to pass 2 sets of coordinates, a starting point and an ending point. Four Points, a Square that is defined anywhere. However from the examples I am finding, and from what I gather the rendition is not going to let me do this. codeigniter so I am seeking confirmation on this thought, is it true that I can only provide end points from 0, and it crops a square based on said end points or can I actually specify an x start, an x end, and similar for y? Or is there some other technique I can use within codeigniter that will allow me to pass for coordinates for starting and ending points?

    Read the article

  • Handling Corrupted JPEGs in C#

    - by ddango
    We have a process that pulls images from a remote server. Most of the time, we're good to go, the images are valid, we don't timeout, etc. However, every once and awhile we see this error similar to this: Unhandled Exception: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderPa rameters encoderParams) at ConsoleApplication1.Program.Main(String[] args) in C:\images\ConsoleApplic ation1\ConsoleApplication1\Program.cs:line 24 After not being able to reproduce it locally, we looked closer at the image, and realized that there were artifacts, making us suspect corruption. Created an ugly little unit test with only the image in question, and was unable to reproduce the error on Windows 7 as was expected. But after running our unit test on Windows Server 2008, we see this error every time. Is there a way to specify non-strictness for jpegs when writing them? Some sort of check/fix we can use? Unit test snippet: var r = ReadFile("C:\\images\\ConsoleApplication1\\test.jpg"); using (var imgStream = new MemoryStream(r)) { using (var ms = new MemoryStream()) { var guid = Guid.NewGuid(); var fileName = "C:\\images\\ConsoleApplication1\\t" + guid + ".jpg"; Image.FromStream(imgStream).Save(ms, ImageFormat.Jpeg); using (FileStream fs = File.Create(fileName)) { fs.Write(ms.GetBuffer(), 0, ms.GetBuffer().Length); } } }

    Read the article

  • Bandpass filter of FFT applied image. (Like ImageJ bandpass filter algorithm)

    - by maximus
    There is a good function that I need, which is implemented in Java program: ImageJ I need to understand the algorithm used there. The function has several parameters: link text And before using FFT it converts image to a special one: The Bandpass Filter uses a special algorithm to reduce edge artifacts (before the Fourier transform, the image is extended in size by attaching mirrored copies of image parts outside the original image, thus no jumps occur at the edges) Can you tell me more about this special transform? Actually tiling mirrored image. I am writing on C++ and wish to rewrite that part of the program on C++.

    Read the article

  • Parallel Haskell in order to find the divisors of a huge number

    - by Dragno
    I have written the following program using Parallel Haskell to find the divisors of 1 billion. import Control.Parallel parfindDivisors :: Integer->[Integer] parfindDivisors n = f1 `par` (f2 `par` (f1 ++ f2)) where f1=filter g [1..(quot n 4)] f2=filter g [(quot n 4)+1..(quot n 2)] g z = n `rem` z == 0 main = print (parfindDivisors 1000000000) I've compiled the program with ghc -rtsopts -threaded findDivisors.hs and I run it with: findDivisors.exe +RTS -s -N2 -RTS I have found a 50% speedup compared to the simple version which is this: findDivisors :: Integer->[Integer] findDivisors n = filter g [1..(quot n 2)] where g z = n `rem` z == 0 My processor is a dual core 2 duo from Intel. I was wondering if there can be any improvement in above code. Because in the statistics that program prints says: Parallel GC work balance: 1.01 (16940708 / 16772868, ideal 2) and SPARKS: 2 (1 converted, 0 overflowed, 0 dud, 0 GC'd, 1 fizzled) What are these converted , overflowed , dud, GC'd, fizzled and how can help to improve the time.

    Read the article

  • What's the fastest way to approximate the period of data using Octave?

    - by John
    I have a set of data that is periodic (but not sinusoidal). I have a set of time values in one vector and a set of amplitudes in a second vector. I'd like to quickly approximate the period of the function. Any suggestions? Specifically, here's my current code. I'd like to approximate the period of the vector x(:,2) against the vector t. Ultimately, I'd like to do this for lots of initial conditions and calculate the period of each and plot the result. function xdot = f (x,t) xdot(1) =x(2); xdot(2) =-sin(x(1)); endfunction x0=[1;1.75]; #eventually, I'd like to try lots of values for x0(2) t = linspace (0, 50, 200); x = lsode ("f", x0, t) plot(x(:,1),x(:,2)); Thank you! John

    Read the article

  • openmp program elapsed time not scaling with increased threads

    - by Griff
    I've got this openmp fortran program doing an embarrassingly parallel problem - do loop over 512^3 elements. See output below. Why would there be such strange behavior in the elapsed time as a function of threads? I thought it would peak at a sweet spot then slowly degrade. This clearly isn't happening. Perhaps I misunderstand something about openmp. Threads, omp_get_wtime 1, 103.76298500015400 2, 65.346454000100493 4, 45.923643999965861 7, 38.074195000110194 8, 36.968765000114217 9, 39.45981499995105 10,40.753379000118002 12,39.577559999888763 14,37.909950000001118

    Read the article

  • Resize image on upload php

    - by blasteralfred
    Hi, I have a php script for image upload as below <?php $LibID = $_POST[name]; define ("MAX_SIZE","10000"); function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } $errors=0; $image=$_FILES['image']['name']; if ($image) { $filename = stripslashes($_FILES['image']['name']); $extension = getExtension($filename); $extension = strtolower($extension); if (($extension != "jpg") && ($extension != "jpeg")) { echo '<h1>Unknown extension!</h1>'; $errors=1; exit(); } else { $size=filesize($_FILES['image']['tmp_name']); if ($size > MAX_SIZE*1024) { echo '<h1>You have exceeded the size limit!</h1>'; $errors=1; exit(); } $image_name=$LibID.'.'.$extension; $newname="uimages/".$image_name; $copied = copy($_FILES['image']['tmp_name'], $newname); if (!$copied) { echo '<h1>image upload unsuccessfull!</h1>'; $errors=1; exit(); }}} ?> which uploads the image file to a folder "uimages" in the root. I have made changes in the html file for the compact display of the image by defining "max-height" and "max-width". But i want to resize the image file on upload. The image file may have a maximum width of 100px and maximum height of 150px. The image proportions must be constrained. That is, the image may be smaller than the above dimensions, but, it should not exceed the limit. How can I make this possible?? Thanks in advance :) blasteralfred..

    Read the article

  • Video encoding by servlet with MEncoder

    - by Andrey
    Hello. I was developing an application for video encoding on the server and got a problem with encoding video with MEncoder. This decoder doesn't work correctly when runned by a command line with Runtime.getRuntime().exec(“D:\mencoder\mnc\mencoder.exe video1.avi -o outvideo1.flv -of lavf -oac mp3lame -lameopts abr:br=64 -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=300:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=320:240,harddup -quiet”) ; The decoder launches and works in windows console with my parameters, but when it's run from a servlet it just hangs in process list and doesn't do anything before the web-server is stopped. When trying to use decoder from a simple java applcation, it runs correctly. Thanks for help.

    Read the article

  • Problems with video conversions through the web (local host)

    - by ron-d
    Hello, I get the following errors when I attempt video format conversions called from the local host: “An invalid media type was specified” for M4V to WMV conversions. “One or more arguments are invalid” for MP4 to WMV conversions. Here are the details of the problems: I’ve written a dll in C# that accepts videos in the formats AVI, WMV, M4V and MP4 and performs the following actions: Creates a copy of the input video in WMV format . Creates a WAV file of the input video audio portion. Creates a JPG image from a frame of the input video. I attached the dll to an ASP.NET web project that performs the dll actions. When tested through the developer studio, the actions are performed as intended for all formats. When I place the web project in place to be read when the local host is called through the web browser, the following behavior takes place: WMV format: All actions performed as intended. AVI format: Creates WMV file – OK Creates JPG image – OK Creates empty WAV file – problem. M4V format: Creates empty WAV file – problem. Does not create WMV file -problem Does not create JPG file –problem Throws me the error “An invalid media type was specified” MP4 format: Creates empty WAV file – problem. Does not create WMV file -problem Does not create JPG file –problem Throws me the error “One or more arguments are invalid” When I check their security property, all the files have the same permission access parameters (when I check their security property. Can anyone guide me as to how to solve these problems when the web project is called from the local host? Thank you.

    Read the article

  • Aligning multiple images into one image?

    - by Gerald Kaszuba
    What is a good method to align images together that may have different rotations, exposures, etc, but have the same background or other fixed reference? Adobe Photoshop can do this with its "Photomerge" feature. How can I do this programatically? Is there an Open Source application that does it?

    Read the article

  • BlackBerry Technical Specification

    - by Sam
    I'm having trouble locating BlackBerry techical specifications and their website is a mess. They also don't have a number that I can use to easily contact them. This isn't exactly a coding question, but what does the BlackBerry audio API look like, and where can I get technical specifications on audio? Specifically, I'm trying to find out more information on Audio-In, specifically, through the Mic-In on the 3.5 mm jack. Unfortunately, before I can proceed, I need to know such things like sampling rate, data width, etc. Direction to the right resource or if you know off of the top of your head is appreciated.

    Read the article

  • Determine coordinates of rotated rectangle

    - by MathieuK
    I'm creating an utility application that should detect and report the coordinates of the corners of a transparent rectangle (alpha=0) within an image. So far, I've set up a system with Javascript + Canvas that displays the image and starts a floodfill-like operation when I click inside the transparent rectangle in the image. It correctly determines the bounding box of the floodfill operation and as such can provide me the correct coordinates. Here's my implementation so-far: http://www.scriptorama.nl/image/ (works in recent Firefox / Safari ). However, the bounding box approach breaks down then the transparent rectangle is rotated (CW or CCW) as the resulting bounding box no longer properly represents the proper width and height. I've tried to come up with a few alternatives to detect to corners, but have not been able to think up a proper solution. So, does anyone have any suggestions on how I might approach this so I can properly detect the coordinates of 4 corners of the rotated rectangle?

    Read the article

  • Standardizing camera input in OpenCV? (Contrast/Saturation/Brightness etc..)

    - by karpathy
    I am building an application using OpenCV that uses the webcam and runs some vision algorithms. I would like to make this application available on the internet after I am done, but I am concerned about the vast differences in camera settings on every computer, and I am worried that the algorithm may break if the settings are too different from mine. Is there any way, after capturing the frame, to post process it and make sure that the contrast is X, brightness is Y, and saturation is Z? I think the Camera settings themselves can not be changed from code directly using the current OpenCV Python bindings. Would anyone be able to tell me about how I could calculate some of these parameters from the image and adjust them appropriately using OpenCV?

    Read the article

  • how to generate abstract for a video?

    - by George2
    Hello everyone, For a video file (e.g. wmv file or other format), I need to generate abstract for the video. The abstract is expected to be in text format. Any mature tools or algorithms? Better (not a must) if open source tools/SDKs so that I can modify for my special needs. thanks in advance, George

    Read the article

  • How to decide between using PLINQ and LINQ at runtime?

    - by Hamish Grubijan
    Or decide between a parallel and a sequential operation in general. It is hard to know without testing whether parallel or sequential implementation is best due to overhead. Obviously it will take some time to train "the decider" which method to use. I would say that this method cannot be perfect, so it is probabilistic in nature. The x,y,z do influence "the decider". I think a very naive implementation would be to give both 1/2 chance at the beginning and then start favoring them according to past performance. This disregards x,y,z, however. I suspect that this question would be better answered by academics than practitioners. Anyhow, please share your heuristic, your experience if any, your tips on this. Sample code: public interface IComputer { decimal Compute(decimal x, decimal y, decimal z); } public class SequentialComputer : IComputer { public decimal Compute( ... // sequential implementation } public class ParallelComputer : IComputer { public decimal Compute( ... // parallel implementation } public class HybridComputer : IComputer { private SequentialComputer sc; private ParallelComputer pc; private TheDecider td; // Helps to decide between the two. public HybridComputer() { sc = new SequentialComputer(); pc = new ParallelComputer(); td = TheDecider(); } public decimal Compute(decimal x, decimal y, decimal z) { decimal result; decimal time; if (td.PickOneOfTwo() == 0) { // Time this and save result into time. result = sc.Compute(...); } else { // Time this and save result into time. result = pc.Compute(); } td.Train(time); return result; } }

    Read the article

  • How to read and save data from text file with variable number of columns in a Matrix in Matlab

    - by khan
    I have a text file with integer values. each row contains information about specific object. But unfortunately each row has different number of column. because of which when i try to use file_content = load('txtfile.txt'); it gives me error message that previous number of columns does not match. i also tried to use fgetl, fscanf, etc function but was unsuccessful. Can anybody give me a piece of code, or help me how to read a txt file and save in matrix in matlab. Three sample rows are given below. 1 1 1 1 1 95 17 54 111 92 17 54 111 92 17 54 111 92 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 54 109 92 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 58 109 96 15 58 109 96 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 58 109 96 15 56 109 94 15 56 109 94 15 58 109 96 15 58 109 96 15 56 109 94 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 17 58 111 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 56 109 94 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 1 1 1 2 96 185 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 15 56 109 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 54 107 92 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 13 56 107 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 54 109 92 15 54 109 92 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 1 1 1 3 186 245 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 56 109 94 15 58 109 96 15 58 109 96 15 58 109 96 15 58 109 96 13 58 107 96 13 56 107 94 13 56 107 94 13 58 107 96 13 58 107 96 13 58 107 96 13 58 107 96 13 58 107 96 13 56 107 94 13 58 107 96 13 58 107 96 13 58 107 96 13 58 107 96 13 58 107 96 13 58 107 96 13 58 107 96 13 58 107 96 13 58 107 96 13 58 107 96 13 58 107 96 13 60 107 98 13 58 107 96 13 58 107 96 15 58 109 96 13 58 107 96 As you can see the rows doesn't have equal number of columns. So how can i read and save it in a Matrix. Any help in this regards will be highly appreciated. Thanks

    Read the article

  • Java - Robot keyPress issue

    - by Trimbitas Sorin
    I'm trying to send keystrokes (like a virtual keyboard) from my Java code, but I encounter some issues. It works perfectly on normal applications (for example, Notepad, browsers, etc.), but not on games (fullscreen or windowed mode). This is the stripped code I'm using: import java.awt.Robot; import java.awt.AWTException; import java.awt.event.InputEvent; Robot robot; robot.keyPress(KeyEvent.VK_A); robot.keyRelease(KeyEvent.VK_A); How can this problem be fixed?

    Read the article

  • Threshold of blurry image - part 2

    - by 1''
    How can I threshold this blurry image to make the digits as clear as possible? In a previous post, I tried adaptively thresholding a blurry image (left), which resulted in distorted and disconnected digits (right): Since then, I've tried using a morphological closing operation as described in this post to make the brightness of the image uniform: If I adaptively threshold this image, I don't get significantly better results. However, because the brightness is approximately uniform, I can now use an ordinary threshold: This is a lot better than before, but I have two problems: I had to manually choose the threshold value. Although the closing operation results in uniform brightness, the level of brightness might be different for other images. Different parts of the image would do better with slight variations in the threshold level. For instance, the 9 and 7 in the top left come out partially faded and should have a lower threshold, while some of the 6s have fused into 8s and should have a higher threshold. I thought that going back to an adaptive threshold, but with a very large block size (1/9th of the image) would solve both problems. Instead, I end up with a weird "halo effect" where the centre of the image is a lot brighter, but the edges are about the same as the normally-thresholded image: Edit: remi suggested morphologically opening the thresholded image at the top right of this post. This doesn't work too well. Using elliptical kernels, only a 3x3 is small enough to avoid obliterating the image entirely, and even then there are significant breakages in the digits:

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >