Wikipedia:Reference desk/Archives/Computing/2015 September 13

= September 13 =

Wired problem in win 10
Don't know what is the right terminology in English to use in Google so I ask here:

In folders with much images, I can't navigate with right and left arrows between images --- If I do, it navigated randomly and not logically as I had with windows 7. This problem damages my work, please help, — Preceding unsigned comment added by Ben-Yeudith (talk • contribs) 02:01, 13 September 2015 (UTC)


 * I'll bet it's not random, but in some order like by file creation date. Of course, that doesn't actually solve the problem. StuRat (talk) 23:28, 13 September 2015 (UTC)

what is the reason why the games in the PSN store are so expensive?
the companies don´t need to publish and press any blu-ray and print a booklet and a dvd cover and it is not necessary to hold and keep them in any store or hall waiting for real customers... but the psn games in the PSN store are every time more expensive. --Motorolakzrz (talk) 03:16, 13 September 2015 (UTC)


 * Copied from an answer above: Because people pay for it? Costs do not matter. You pay the market price no matter what it takes to produce something.--YX-1000A (talk) 03:52, 13 September 2015 (UTC)


 * If you had perfect competition, then the price should indeed be driven down close to the production cost (or even below, in certain circumstances, like a price war).  So, the high prices imply a lack of competition, perhaps for legal reasons like copyrights.  StuRat (talk) 23:39, 13 September 2015 (UTC)


 * The cost of bulk duplicating a DVD, with a nice case and a cover picture for 10,000+ quantities is about $0.25 - the cost of offering a download is not zero, but it's certainly less than $0.25.


 * The other $30, $40, $50...whatever is the cost of employing several hundred developers for several years - paying for some of the cost of console manufacture (consoles are sold at a loss, which is made up from game sales) - paying to license the console toolkit and whatever "middleware" is used. Typically there are costs to license music, pay voice actors, you name it.  There is also the hidden cost of paying for the games you made that were flops and made a loss.


 * Overall, only a very tiny percentage is the cost of making the physical disk - so you wouldn't expect a whole lot of difference between the two prices.
 * SteveBaker (talk) 04:28, 13 September 2015 (UTC)


 * One reason for the price difference is that some stores choose to take a hit on their margin in order to sell a product cheaper than others and enable them to make money by moving large volumes of stock. - X201 (talk) 06:02, 13 September 2015 (UTC)


 * That may be the reason some of the time - but definitely not always: last week, I wanted to buy a complete set of StarWars movies. Amazon.com charge $89.99 to stream all six movies online - or $87.99 for physical DVD's with free shipping - both have 9 hours(!) of bonuses, etc.  So it's a similar pricing deal.  But in this case, Amazon is hardly competing against itself!  It's hard to see why they'd prefer me to buy the physical disks.  Clearly it's cheaper to stream than to manufacture physical disks and pay shipping, but the price doesn't reflect that.  Perhaps their concern is that in selling me the online version (which I can watch as many times as I want) - they are signing up to give me a potentially unlimited amount of bandwidth if I wanted to watch those same movies over and over.  Maybe shipping the physical disks really is cheaper? SteveBaker (talk) 06:43, 13 September 2015 (UTC)
 * To someone who has enough junk in their lives, $90 to stream might sound better than $88 for a bunch of discs with a bunch of mediocre cast interviews. Remember also that the price for the retail discs are set as part of a market; if one retailer is selling discs for $89, you probably want to sell for $88 or less if you want to get a bunch of sales (obviously price-setting is more complex than "always must beat your competitor", but that's an okay start for this discussion), whereas the online streaming price is negotiated between Amazon and the rightsholder; they don't get to set the price themselves. Wholesale discs are always significantly cheaper than their MSRP because retailers need to make money on the margins to pay for the costs of storing them, displaying them in a storefront, etc, so retail discs probably cost Amazon less (before the costs of warehousing, fulfillment, etc) than the digital rights, as well. 97.90.151.30 (talk) 09:48, 13 September 2015 (UTC)

To your star wars problem I would guess that George Lucas is the reason. He isn´t allowing amazon to sell the streams less than your 89,99. On the DVD layers he has no rights any more, amazon could resell them for 1 cent if they want without having problems, but selling the stream for 1 cent would make Lucas angry...--Motorolakzrz (talk) 07:27, 13 September 2015 (UTC)

Discrete Fourier Transform Trouble
I need to do a 2-D Fourier Transform on a unit sphere. It has two components, the first one is a standard Fourier Transform. The input 2-D image (function) is experimental, therefore I need to use Discrete Fourier Transform. There are many published algorithms for Fast Discrete Fourier Transform (FFT) and even C and Fortran codes. I tested several and found them performing admirably. When I use the Inverse Transform I restore the original image (function) on all parallels (theta angles). It is not where my problem lies.

When I add the second component (Orthogonal Polynomials) something happens and I cannot restore the original 2-D function. So, I decided to try not FFT but direct DFT coded from a formula. I got a very strange result. The formulas for DFT are:

Forward Transform:

Inverse Transform:

To demonstrate the problem I am going to use Wikipedia's Blackman-Harris Window. The Fortran code for the function is:

REAL*8 function blackmanHarrisWindow (k, N)  REAL*8 :: PI   integer*4 :: k,N,N1 PI = 3.1415926535897932384626433832795 N1 = N-1HERE blackmanHarrisWindow = 0.35875-0.48829*cos(2.0*PI*k/N1)+0.14128*cos(4.0* &                          PI*k/N1)+0.01168*cos(6.0*PI*k/N1) end function

I however found that the graphic generated by this code, posted on MediaFire, BlackMan-Harris-Original.png file (HERE) (In Camera folder) is more reminiscent of the next listed Flat Top Window.

GFortran code to handle the transform is here:

program main use librow_fft_mod DOUBLE COMPLEX, DIMENSION, POINTER :: Input, Output REAL*8 :: xx, blackmanHarrisWindow integer :: NN = 1024, jj=1, sv, ii  ALLOCATE (Input(NN),Output(NN)) do while (jj < NN) xx = blackmanHarrisWindow (jj,NN) Input(jj) = CMPLX (xx,0.0D0) jj = jj + 1 enddo call fourierStraight (NN,Input,Output) Input = CMPLX(0.0D0,0.0D0) call fourierBack (NN,Output,input) end program main

librow_fft_mod is an interface file for dummy arrays Input and Output.

The code for Forward and Inverse DFT follows:

subroutine fourierStraight (NN,Input,Output) ! a subroutine to calculate Fourier Transform without invoking the algorithm of FFT ! http://www.robots.ox.ac.uk/~sjrob/Teaching/SP/l7.pdf   pg 85 integer*4, intent (in) :: NN  DOUBLE COMPLEX, DIMENSION, Intent (IN), POINTER :: Input DOUBLE COMPLEX, DIMENSION, Intent (OUT), POINTER :: Output integer*4 :: kk,ll DOUBLE COMPLEX :: res real*8 :: pi2 = 6.28318530718 Output = DCMPLX (0.0D0,0.0D0) do ll = 0,NN-1 res = DCMPLX (0.0D0,0.0D0) do kk = 0,ll res = res + real (Input(kk+1)) * DCMPLX (DCOS (kk * pi2/NN), - DSIN (kk * pi2/NN)) enddo Output(ll+1) = res enddo end subroutine fourierStraight

subroutine fourierBack (NN,Input,Output) ! http://www.robots.ox.ac.uk/~sjrob/Teaching/SP/l7.pdf    pg 86 ! not FFT - straight calculations. integer*4, intent (in) :: NN  DOUBLE COMPLEX, DIMENSION, Intent (IN), POINTER :: Input DOUBLE COMPLEX, DIMENSION, Intent (OUT), POINTER :: Output integer*4 :: kk,ll DOUBLE COMPLEX :: res real*8 :: pi2 = 6.28318530718 Output = DCMPLX (0.0D0,0.0D0) do ll = 0,NN-1 res = DCMPLX (0.0D0,0.0D0) do kk = 0,ll res = res + Input(kk+1) * DCMPLX (DCOS (kk * pi2/NN), DSIN (kk * pi2/NN)) enddo Output(ll+1) = res/NN enddo end subroutine fourierBack

You can see that the restored function differs from the original. It is again HERE, Blackman-Harris-Restoration.png. (In Camera folder)

If you compare the code for both functions with the original formulas you can see that I dropped one multiplier, the factor n which in the code is represented by integer $$ll$$ (Fortran is case insensitive and it necessitated the substitution). If you include this factor in the formula the restored function appears to be very bizarre. The image is HERE (File3.png In Camera folder)

The code for the changed function looks like this (for Forward Transfer):

do kk = 0,ll res = res + real (Input(kk+1)) * DCMPLX (DCOS (ll*kk * pi2/NN), - DSIN (ll*kk * pi2/NN)) enddo

Similarly for the Inverse transfer the $$ll$$ multiplier is added.

WHAT AM I DOING WRONG?

I am posting here because I know StuRat, for instance, does GFortran coding and he gave me the original push 2 or 3 year ago when I started using it. So, I hope to find some help here. All calculations are done under Ubuntu 14.04 operating system. Thanks. --AboutFace 22 (talk) 21:21, 13 September 2015 (UTC)


 * I don't think a real*8 (8 bytes) will store PI to the precision you've defined. I suggest you print it out to see what precision has been lost.  Would that loss of precision be a potential source of the problem ? StuRat (talk) 22:52, 13 September 2015 (UTC)

You are correct. The precision is lost, I mean real*8 gets its 14 digits I think, that's it, but this is plenty for the computations at hand. Even single precision would be sufficient. --AboutFace 22 (talk) 23:00, 13 September 2015 (UTC)


 * OK, then on to debugging. Do you have an example of some test data where you know what the correct transform should be ?  If so, hopefully you could compare the results step by step with what you get, and determine where the difference originates. StuRat (talk) 23:18, 13 September 2015 (UTC)

Well, the code is elementary. I hoped that someone would take a fresh look, yourself including. Not much of debugging is needed here, I think. — Preceding unsigned comment added by AboutFace 22 (talk • contribs) 00:05, 14 September 2015 (UTC)


 * I haven't checked Fortran syntax issues or looked at the Mediafire files you uploaded, which I couldn't access, but in terms of the math: your kk loops should run from 0 to NN-1, and not from 0 to ll-1. And you need to restore the "n"-multiplier (ll in your code) in the $$e^{-jk2\pi n/N}$$ term, else you are not computing the DFT (ditto for inverse). Abecedare (talk) 14:26, 14 September 2015 (UTC)

@Abecedare, thank you for the comment. I did not realize the files I uploaded are not really accessible by anyone else. Kind of a bummer. I will be able to think about what you said in about 6 hours, now at work. It seems you are correct. I've felt it was something really silly I missed. --AboutFace 22 (talk) 16:42, 14 September 2015 (UTC)

@Abecedare, thank you much. Now it works perfectly well. I wonder how I missed it. --AboutFace 22 (talk) 00:32, 15 September 2015 (UTC)

Avprobe: Peculiar piping?
I am trying to grep the output of avprobe, but something like avprobe file.mp4 | grep is not working. I know that I could do avprobe file.mp4 &>> file.txt && grep file.txt but I wonder whether this can be simplified. I also want to know why the firs option does not work.--Scicurious (talk) 21:52, 13 September 2015 (UTC)


 * Try

avprobe file.mp4 2>&1 | grep keyword
 * -- Finlay McWalterᚠTalk 22:38, 13 September 2015 (UTC)


 * Thanks, that worked. But why does the program send the juicy information of the mp4 to stderr? stdout is just "# avprobe output." stderr gets the information about type of media, duration, sampling, frames, bit-rate, ... .--Scicurious (talk) 02:32, 14 September 2015 (UTC)


 * Yes, I think the program is wrong to send that info to stderr rather than stdout. avprobe is a pretty thin skin over libav, and (because of its nature as a streaming library) they may have adopted the standard that stdout is for actual media streams and stderr for all printing. -- Finlay McWalterᚠTalk 08:20, 14 September 2015 (UTC)

Windows 10 memory hogging
I have a PC, a Hewlett Packard laptop ENVY series computer. It came with a 930 gigabyte hard drive and 8 gigs of ram. When I got it at about the end of 2012, it came with Windows 8. I went through a number of upgrades and I had about 100 gigabytes in use then, that is, about 830 gigabytes free. I recently upgraded to Windows 10, which is where my problems started. After I upgraded, which took about 45 minutes, it seemed successfully and at that point the computer had 715 gigs free; the computer seemed to be working with windows 10 okay. I let the computer go to sleep, and didn't come back to it for about 3 days. When I "woke" it, I saw that my disk drive said it was almost entirely full – there was a warning in the screen that said "Let's click on storage to see what is taking up so much space". I checked and the entire hard drive was full, except for a few megabytes (I think it was about 5). I have restarted multiple times, no difference. It seems impossible for Windows 10 to actually be taking up this much space. Any ideas what might be going on?--108.54.167.196 (talk) 23:19, 13 September 2015 (UTC)


 * Just to clarify, there's not actually a problem with the RAM/memory being full, is there ? It's just disk space that's full, correct ?  I would look for a huge recently created file, or maybe thousands of small files recently created.  The name(s) of that file(s) might be a clue.StuRat (talk) 23:22, 13 September 2015 (UTC)


 * Yes, that is correct: 8 gigs off ram are still listed as free. What would be the most exedient way to do that? I'm sorry but I'm not the most experienced.--108.54.167.196 (talk) 23:28, 13 September 2015 (UTC)


 * A visual representation (like a pie chart) of the space taken up by each folder would help. I'm not sure if Windows 10 offers that option.  Ideally, you could compare a snapshot before and after and see which folder got bigger, then repeat the experiment looking at sub-folders in that folder, etc.  I'm assuming here that you have some way to go back before the space was eaten up.  Did you try emptying all the temp folders ? StuRat (talk) 23:45, 13 September 2015 (UTC)


 * I agree. WinDirStat is a good program for finding out what folders/files are large. But the question is why it happened in the first place - it may happen again if you clean up the files..  (This isn't normal.) Bubba73 You talkin' to me? 00:01, 14 September 2015 (UTC)


 * Yes, it will happen again, and that will help them track down the folder(s) and file name(s). Once they know that, then we might be able to figure out what's creating those files and disable it or fix it. StuRat (talk) 16:29, 14 September 2015 (UTC)