Daily Archives

Articles indexed Saturday May 8 2010

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

  • Not able to install GDB on Fedora..

    - by RBA
    How to download and install GDB(GNU Debugger) on Fedora Linux Machine.. I have tried downloading from gnu website 7.1 package, but then it fails during ./configure and then make command... Please share the source from where i can get information on the same. Thanks..

    Read the article

  • GLSL shader render to texture not saving alpha value

    - by quadelirus
    I am rendering to a texture using a GLSL shader and then sending that texture as input to a second shader. For the first texture I am using RGB channels to send color data to the second GLSL shader, but I want to use the alpha channel to send a floating point number that the second shader will use as part of its program. The problem is that when I read the texture in the second shader the alpha value is always 1.0. I tested this in the following way: at the end of the first shader I did this: gl_FragColor(r, g, b, 0.1); and then in the second texture I read the value of the first texture using something along the lines of vec4 f = texture2D(previous_tex, pos); if (f.a != 1.0) { gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); return; } No pixels in my output are black, whereas if I change the above code to read gl_FragColor(r, g, 0.1, 1.0); //Notice I'm now sending 0.1 for blue and in the second shader vec4 f = texture2D(previous_tex, pos); if (f.b != 1.0) { gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); return; } All the appropriate pixels are black. This means that for some reason when I set the alpha value to something other than 1.0 in the first shader and render to a texture, it is still seen as being 1.0 by the second shader. Before I render to texture I glDisable(GL_BLEND); It seems pretty clear to me that the problem has to do with OpenGL handling alpha values in some way that isn't obvious to me since I can use the blue channel in the way I want, and figured someone out there will instantly see the problem.

    Read the article

  • How to add correct cancellation when downloading a file with the example in the samples of the new P

    - by Mike
    Hello everybody, I have downloaded the last samples of the Parallel Programming team, and I don't succeed in adding correctly the possibility to cancel the download of a file. Here is the code I ended to have: var wreq = (HttpWebRequest)WebRequest.Create(uri); // Fire start event DownloadStarted(this, new DownloadStartedEventArgs(remoteFilePath)); long totalBytes = 0; wreq.DownloadDataInFileAsync(tmpLocalFile, cancellationTokenSource.Token, allowResume, totalBytesAction => { totalBytes = totalBytesAction; }, readBytes => { Log.Debug("Progression : {0} / {1} => {2}%", readBytes, totalBytes, 100 * (double)readBytes / totalBytes); DownloadProgress(this, new DownloadProgressEventArgs(remoteFilePath, readBytes, totalBytes, (int)(100 * readBytes / totalBytes))); }) .ContinueWith( (antecedent ) => { if (antecedent.IsFaulted) Log.Debug(antecedent.Exception.Message); //Fire end event SetEndDownload(antecedent.IsCanceled, antecedent.Exception, tmpLocalFile, 0); }, cancellationTokenSource.Token); I want to fire an end event after the download is finished, hence the ContinueWith. I slightly changed the code of the samples to add the CancellationToken and the 2 delegates to get the size of the file to download, and the progression of the download: return webRequest.GetResponseAsync() .ContinueWith(response => { if (totalBytesAction != null) totalBytesAction(response.Result.ContentLength); response.Result.GetResponseStream().WriteAllBytesAsync(filePath, ct, resumeDownload, progressAction).Wait(ct); }, ct); I had to add the call to the Wait function, because if I don't, the method exits and the end event is fired too early. Here are the modified method extensions (lot of code, apologies :p) public static Task WriteAllBytesAsync(this Stream stream, string filePath, CancellationToken ct, bool resumeDownload = false, Action<long> progressAction = null) { if (stream == null) throw new ArgumentNullException("stream"); // Copy from the source stream to the memory stream and return the copied data return stream.CopyStreamToFileAsync(filePath, ct, resumeDownload, progressAction); } public static Task CopyStreamToFileAsync(this Stream source, string destinationPath, CancellationToken ct, bool resumeDownload = false, Action<long> progressAction = null) { if (source == null) throw new ArgumentNullException("source"); if (destinationPath == null) throw new ArgumentNullException("destinationPath"); // Open the output file for writing var destinationStream = FileAsync.OpenWrite(destinationPath); // Copy the source to the destination stream, then close the output file. return CopyStreamToStreamAsync(source, destinationStream, ct, progressAction).ContinueWith(t => { var e = t.Exception; destinationStream.Close(); if (e != null) throw e; }, ct, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Current); } public static Task CopyStreamToStreamAsync(this Stream source, Stream destination, CancellationToken ct, Action<long> progressAction = null) { if (source == null) throw new ArgumentNullException("source"); if (destination == null) throw new ArgumentNullException("destination"); return Task.Factory.Iterate(CopyStreamIterator(source, destination, ct, progressAction)); } private static IEnumerable<Task> CopyStreamIterator(Stream input, Stream output, CancellationToken ct, Action<long> progressAction = null) { // Create two buffers. One will be used for the current read operation and one for the current // write operation. We'll continually swap back and forth between them. byte[][] buffers = new byte[2][] { new byte[BUFFER_SIZE], new byte[BUFFER_SIZE] }; int filledBufferNum = 0; Task writeTask = null; int readBytes = 0; // Until there's no more data to be read or cancellation while (true) { ct.ThrowIfCancellationRequested(); // Read from the input asynchronously var readTask = input.ReadAsync(buffers[filledBufferNum], 0, buffers[filledBufferNum].Length); // If we have no pending write operations, just yield until the read operation has // completed. If we have both a pending read and a pending write, yield until both the read // and the write have completed. yield return writeTask == null ? readTask : Task.Factory.ContinueWhenAll(new[] { readTask, writeTask }, tasks => tasks.PropagateExceptions()); // If no data was read, nothing more to do. if (readTask.Result <= 0) break; readBytes += readTask.Result; if (progressAction != null) progressAction(readBytes); // Otherwise, write the written data out to the file writeTask = output.WriteAsync(buffers[filledBufferNum], 0, readTask.Result); // Swap buffers filledBufferNum ^= 1; } } So basically, at the end of the chain of called methods, I let the CancellationToken throw an OperationCanceledException if a Cancel has been requested. What I hoped was to get IsFaulted == true in the appealing code and to fire the end event with the canceled flags and the correct exception. But what I get is an unhandled exception on the line response.Result.GetResponseStream().WriteAllBytesAsync(filePath, ct, resumeDownload, progressAction).Wait(ct); telling me that I don't catch an AggregateException. I've tried various things, but I don't succeed to make the whole thing work properly. Does anyone of you have played enough with that library and may help me? Thanks in advance Mike

    Read the article

  • masking a UIImage

    - by iworkinprogress
    I'm working on an app that can change the borders or a rectangular UIImage. The borders will vary, but will look like the UIImage was cut out with scissors, or something to that affect. What is the best way to do this? My first thought is to prep a bunch of transparent PNGs with the correct border effect I'm looking for, and then somehow use that as a mask for my UIImage. Is this the right path? Or is there a more flexible programmatic way to do this?

    Read the article

  • Photoshop: HSL Color picker plugin?

    - by Ian Boyd
    Is there a plugin that can let Photoshop use a HSL color picker, rather than HSV (which Adobe calls HSB)? In other words, any/all of the following locations could have an HSL option: Or perhaps a plugin with it's own color picker. Reference RGB HSL HSV (aka HSB) ============= =============== ================ (1, 0, 0 ) ( 0°, 1, 0.5 ) ( 0°, 1, 1 ) (0.5, 1, 0.5) (120°, 1, 0.75) (120°, 0.5, 1 ) (0, 0, 0.5) (240°, 1, 0.25) (240°, 1, 0.5)

    Read the article

  • Batch Conversion of PaperPort MAX Files

    - by Matthew
    I've got a library of MAX files from an old Visioneer Scanner that used ScanSoft PaperPort. I don't have the PC that I used to scan them anymore, and I don't have the CD for PaperPort. Does anyone know of a utility I can use to open and convert .MAX files to something more useful like a JPEG? (I'd prefer something that batch converts -- but if I can get a utility that will even allow one conversion, I could probably figure out how to use AutoHotkey or something like that to automate.) Thanks for your help

    Read the article

  • Does Displaytag stash the "media type" in a page or request attribute?

    - by Pointy
    When you enable "export" from Displaytag, the tag code gives you links with special magic parameters that the tag recognizes as indicators that the table contents should be exported (as CSV, Excel, whatever). Well I'm interested in detecting the media type so that (for example) I can exclude columns that make no sense in an export (embedded action buttons, for one thing, or checkboxes for row selection). I suppose I could write a table decorator and use that to stick the media type on the request, but it'd be nice to avoid that if the tag already does it. The documentation is not clear on the subject; I guess I can start digging through the source code too.

    Read the article

  • Determine image src in onload and onerror event handlers in IE

    - by Bill
    How can I determine the image src of the image that triggered the event in the onload and onerror event handlers in IE? This example code I threw together: <script language="javascript" type="text/javascript" src="jquery.js"></script> <script language="javascript" type="text/javascript"> function loadImages() { var goodImage = new Image(); var missingImage = new Image(); $(goodImage).bind('load', function(event){ $("#log").append( $(event.target).attr('src') + ' WAS FOUND <br>'); }); $(missingImage).bind('load', function(event){ $("#log").append( $(event.target).attr('src') + ' WAS FOUND <br>' ); }); $(goodImage).bind('error', function(event){ $("#log").append( $(event.target).attr('src') + ' IS MISSING <br>'); }); $(missingImage).bind('error', function(event){ $("#log").append( $(event.target).attr('src') + ' IS MISSING <br>'); }); goodImage.src = 'GOOD-IMAGE.GIF'; // this image exists missingImage.src = 'MISSING-IMAGE.GIF'; // this image doesn't exist } </script> </head> <body onload="loadImages();"> <div id="log"></div> works in FF but in IE8 it prints out undefined for the $(event.target).attr('src') part. I thought jQuery was supposed to normalize the event object for IE so that it acted like other browsers? I've tried a number of permutations but haven't been able to get anything to work in IE8. Anyway if anyone has a suggestion on how to figure out the image src in the onload and onerror event handlers that works in IE I would really appreciate it. Or even how to figure out after the images have loaded which have loaded and which haven't (but not graphically - I need to generate an array containing the filenames of the images that didn't load). Thanks!

    Read the article

  • Where to add the PHP script and MYSQL Dump code in the LAMP server?

    - by primal
    Hi, I dont know if this is the right place to ask this question. But as time is limited and here I have always got the right answers I am asking it away. I want to setup a login page on a local server so as to communicate with it via android. As time permits, I googled and found out the necessary php script and mySQL code needed for the same. I don't know where to add these code in the local server and connect them. :( (This is mainly for testing purpose as we would develop a website in Django latter on.) Any help would be much appreciated..

    Read the article

  • why my server has a dir named "?"

    - by liuxingruo
    These are all the dirs in my server: ? bin boot dev etc home lib lost+found media media2 misc mnt net opt proc root sbin selinux srv sys tmp usr var why there is a "?" dir? Thanks very much. BTW: the touch command was found on my server(wiered). I list the bin dir: alsacard cp dd env hostname loadkeys more ps sed tcptraceroute alsaunmute cpio df ex igawk loadkeys.static mount pwd setfont traceroute6 arch csh dmesg false ipcalc logger mountpoint raw setserial tracert awk cut dnsdomainname fgrep kbd_mode login mv red sh view basename date doexec gawk keyctl ls netstat redhat_lsb_init sleep ypdomainname bash dbus-cleanup-sockets domainname gettext kill mail nice rm sort cat dbus-daemon dumpkeys grep ksh mailx nisdomainname rmdir stty chgrp dbus-monitor echo gtar ksh93 mkdir pgawk rpm su chmod dbus-send ed gunzip link mknod ping rvi sync chown dbus-uuidgen egrep gzip ln mktemp ping6 rview tar touch is missing, how can i get it back?

    Read the article

  • Role of Combinators in Concatenative/Tacit Programming Languages.

    - by Bubba88
    Hi! I have a question about what exact role do higher-order compinators (or function producers) hold in concatenative/tacit programming. Additionally I would like to ask if there is another way to implement concatenative programming language rather than directly manipulating the stack. This might look like a newbie question, so if you feel like it, you can freely direct me to external source.

    Read the article

  • What to add to git repo?

    - by Ryan
    I am doing a video player. I have the following in my project folder: these four dirs should each be on their own line: /source /sample_applications /images /videos Right now the repo just includes the /source directory...which is code only. It is on my local computer. I am thinking of adding it to git hub. My question is: should I add the sample apps, the images and the videos to the repo? Is that something that people normally do and that other people want people to do? Can git even handle videos(noob here)?

    Read the article

  • NSUserDefaults not present on first run on simulator

    - by Ben Collins
    I've got some settings saved in my Settings.bundle, and I try to use them in application:didFinishLaunchingWithOptions, but on a first run on the simulator accessing objects by key always returns nil (or 0 in the case of ints). Once I go to the settings screen and then exit, they work fine for every run thereafter. What's going on? Isn't the point of using default values in the Settings.bundle to be able to use them without requiring the user to enter them first?

    Read the article

  • Having trouble getting phpmyadmin installed in Ubuntu.

    - by George Edison
    Okay. I installed apache2 and php on my Ubuntu 10.04 machine. I copied the phpmyadmin files to /var/www/phpmyadmin so that the hierarchy looks like this: -var (755) -www (144) -phpmyadmin (644) -index.php... etc. (644) -index.html (644) The numbers in brackets are the permissions. What permissions should the phpmyadmin folder have? What am I doing wrong?

    Read the article

  • Big O and Little o

    - by hyperdude
    If algorithm A has complexity O(n) and algorithm B has complexity o(n^2), what, if anything, can we say about the relationship between A and B? Note: the complexity of A is expressed using big-Oh, and the complexity of B is expressed using little-Oh.

    Read the article

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