Jesper T

Members
  • Content count

    2530
  • Joined

  • Last visited

Community Reputation

322 Neutral

About Jesper T

  • Rank
    Contributor
  1. Here's a challenge (decryption)

    This seems more and more orchestrated. It looks like they were hoping he would try to run and hide when the accusations first were made. But he cooperated with the Swedish police and only left the country after confirming with the Swedish police that it was okay. And then suddenly they go through interpol and create new headlines about him being wanted across the world, giving the impression that he is on the run.
  2. You could update based on number of votes. For example, say more than 500 have voted -> update.
  3. Black Holes(????????)

    Quote:Original post by Promit mikeman, I did some research today and this is the short version. From the reference frame of an outside observer, nothing ever crosses the event horizon. Ever. Everything lives frozen on the edge, and some people actually refer to black holes as "frozen stars". This is not an "optical illusion" but a direct result of time dilation. However, from the frame of any outside observer, it doesn't matter. The thing falling in ends up very close to the event horizon in a very small amount of time, and it quickly becomes valid to simply treat the whole thing as one object. Having a hollow sphere of stuff frozen at the edge is exactly the same as if they'd actually fallen in -- at least, for any practical purpose not involving messy quantum effects that boundary (which we haven't solved, AFAICT). As for formation, I believe that gets into the problem that we're completely lost on what structure a black hole contains, if any. A black hole event horizon can arise at fairly low densities given enough mass, and you do hit the center in finite proper time, so from any reference frame inside the horizon I guess stuff is just flowing in like nothing special's happening. The weird part only happens from external frames. Somebody please correct me if I've made any mistakes here... And what do you suppose happens with the Schwarzschild radius as objects with mass-energy gets piled up steadily closer and denser outside it? a) it stays the same, b) it shrinks! or c) it grows?
  4. Black Holes(????????)

    Quote:Original post by taby In fact, I have written papers that are currently under review which rely on the idea that the singularity at the centre of a black hole is fictitious. If you're saying that the equations are bogus, or that black hole's don't exist, please read Oppenheimer's work. "Pressure is a source of gravitation" might be an important thing to remember when considering stellar collapse. Interesting. Do you provide arguments that they should be fictitious or are you simply exploring "what if" they are? Quote:And for what it's worth, every single physicist knows that an infinite mass-energy density at the singularity cannot possibly be correct. Regardless, all of general relativity's other predictions match observation in EVERY SINGLE TEST we've thrown at it. The theory is not bogus because of a single problem. I'm afraid you're wrong here. I'd say that mass energy density could possibly be something like a Dirac delta like the charge density we use to model the electron (and I'm a physicist).
  5. Black Holes(????????)

    What I mean is that the Schwarzschild radius does not actually describe a static sphere whenever another object is nearby. So an outside observer might not ever see any object fall into a black hole but he might see the event horizon change its shape so that the object is swallowed anyway (the Schwarzschild radius is not a physical object so it can change FTL just like a bright spot from a laser can move from point to point FLT).
  6. Black Holes(????????)

    I understand mikemans point. A black hole might form but (if we ignore quantum tunneling) the time dilation seems to prevent it from growing from an outside observers perspective. However we must not forget that an object falling into the black hole also has its own gravity, which will bend the Schwarzschild radius of the black hole out towards itself.
  7. So has the discrediting campaign started? The only thing that makes me suspicious is how ridiculously obvious it appears to be.
  8. It is rare to see a home built implementation to be faster than the equivalent standard. At least for this particular purpose. I suppose the built-in could be optimized for other types of operations though.
  9. So I decided to test the built in complex class against a complex class I wrote a while back. Surprisingly, the class I wrote (which is fairly unoptimized btw) was about 4.6 times faster at calculating a mandelbrot fractal image than the built in class. Here is the test program #include <iostream> #include <fstream> #include <ctime> #include <cmath> #include <complex> #include "Complex.h" const int R = 255; const int N = 3000; unsigned __int8 pictar[N*N]; using namespace std; int mandelbrotBI(const complex<double> &P, complex<double> &Z, const int cnt) { if(cnt >= R || norm(Z) > 4.0) return cnt; Z = Z*Z + P; return mandelbrotBI(P, Z, cnt + 1); } double calcBI(void) { clock_t t0 = clock(); double NInv = 1.0/static_cast<double>(N - 1); for(int m = 0; m < N; m++) for(int n = 0; n < N; n++) { complex<double>P(4.2*(static_cast<double>(m)*NInv - 0.5), 4.2*(static_cast<double>(n)*NInv - 0.5)); complex<double>Z(0.0, 0.0); int q = mandelbrotBI(P, Z, 0); pictar[m*N + n] = static_cast<unsigned __int8>(q); } clock_t t1 = clock(); return static_cast<double>(t1 - t0)/static_cast<double>(CLOCKS_PER_SEC); } int mandelbrotMy(const Complex<double> &P, Complex<double> &Z, const int cnt) { if(cnt >= R || absSq(Z) > 4.0) return cnt; Z = Z*Z + P; return mandelbrotMy(P, Z, cnt + 1); } double calcMy(void) { clock_t t0 = clock(); double NInv = 1.0/static_cast<double>(N - 1); for(int m = 0; m < N; m++) for(int n = 0; n < N; n++) { Complex<double>P(4.2*(static_cast<double>(m)*NInv - 0.5), 4.2*(static_cast<double>(n)*NInv - 0.5)); Complex<double>Z(0.0, 0.0); int q = mandelbrotMy(P, Z, 0); pictar[m*N + n] = static_cast<unsigned __int8>(q); } clock_t t1 = clock(); return static_cast<double>(t1 - t0)/static_cast<double>(CLOCKS_PER_SEC); } int main() { cout << "Calculating " << N << " by " << N << " mandelbrot using built in complex.."; double tBI = calcBI(); cout << "done.\nTime: " << tBI << " sec\nSaving.. "; ofstream savfBI("mandelbrotBI_3000x3000x8bit.raw", ios::out | ios::binary); savfBI.write((char *)pictar, N*N*sizeof(unsigned __int8)); cout << "done.\n"; cout << "Calculating " << N << " by " << N << " mandelbrot using my Complex.."; double tMy = calcMy(); cout << "done.\nTime: " << tMy << " sec\nSaving.. "; ofstream savfMy("mandelbrotMy_3000x3000x8bit.raw", ios::out | ios::binary); savfMy.write((char *)pictar, N*N*sizeof(unsigned __int8)); cout << "done.\n"; cout << "\ncalcBI() / calcMy() = " << tBI/tMy << endl; return 0; } And the my complex implementation #ifndef COMPLEX_H_INCLUDED #define COMPLEX_H_INCLUDED #include <cmath> #include <iostream> #include <fstream> #include <iomanip> template <class T> class Complex { public: enum { D = 2 }; Complex(const Complex<T> &S) : a(S.a), b(S.b) { } Complex(const T U[D]) : a(U[0]), b(U[1]) { } Complex(const T &sa = (T)0, const T &sb = (T)0) : a(sa), b(sb) { } const Complex<T> & set(const T &, const T &); const Complex<T> operator + (const Complex<T> &) const; const Complex<T> operator - (const Complex<T> &) const; const Complex<T> operator * (const Complex<T> &) const; const Complex<T> operator / (const Complex<T> &) const; const Complex<T> operator + (const T &) const; const Complex<T> operator - (const T &) const; const Complex<T> operator * (const T &) const; const Complex<T> operator / (const T &) const; const Complex<T> & operator = (const Complex<T> &); const Complex<T> & operator += (const Complex<T> &); const Complex<T> & operator -= (const Complex<T> &); const Complex<T> & operator *= (const Complex<T> &); const Complex<T> & operator /= (const Complex<T> &); const Complex<T> & operator = (const T &); const Complex<T> & operator += (const T &); const Complex<T> & operator -= (const T &); const Complex<T> & operator *= (const T &); const Complex<T> & operator /= (const T &); const Complex<T> operator - () const; const T & operator [] (const int) const; T & operator [] (const int); std::ofstream & saveBin(std::ofstream &) const; std::ifstream & loadBin(std::ifstream &); T normalize(void); ~Complex(void) { } union { T V[D]; struct { T a, b; }; }; }; template <class T> inline const T abs(const Complex<T> &A) { return sqrt(A.a*A.a + A.b*A.b); } template <class T> inline const T absSq(const Complex<T> &A) { return A.a*A.a + A.b*A.b; } template <class T> inline const T arg(const Complex<T> &A) { return atan2(A.b, A.a); } template <class T> const Complex<T> conj(const Complex<T> &A) { return Complex<T>(A.a, -A.b); } template <class T> inline const T re(const Complex<T> &A) { return A.a; } template <class T> inline const T im(const Complex<T> &A) { return A.b; } template <class T> inline Complex<T> sqrt(const Complex<T> &C) { T l = abs(C); T p = 0.5*arg(C); return Complex<T>(l*cos(p), l*sin(p)); } template <class T> inline Complex<T> exp(const Complex<T> &C) { T k = exp(C.a); return Complex<T>(cos(C.b)*k, sin(C.b)*k); } template <class T> inline Complex<T> pow(const Complex<T> &C, const T &m) { T l = pow(abs(C), m); T p = m*arg(C); return Complex<T>(l*cos(p), l*sin(p)); } template <class T> inline Complex<T> pow(const T &a, const Complex<T> &C) { T p = pow(a, C.a); T l = log(C.a); return Complex<T>(p*cos(C.b*l), p*sin(C.b*l)); } template <class T> std::ostream & operator << (std::ostream &vout, const Complex<T> &Q) { return vout << "" << std::setw(14) << Q.a << " + " << std::setw(14) << Q.b << "i"; } template <class T> inline const Complex<T> operator + (const T &l, const Complex<T> &R) { return Complex<T>(l + R.a, R.b); } template <class T> inline const Complex<T> operator - (const T &l, const Complex<T> &R) { return Complex<T>(l - R.a, -R.b); } template <class T> inline const Complex<T> operator * (const T &l, const Complex<T> &R) { return Complex<T>(l*R.a, l*R.b); } template <class T> inline const Complex<T> operator / (const T &l, const Complex<T> &R) { T z = absSq(R); return Complex<T>(l*R.a/z, -l*R.b/z); } template <class T> inline const Complex<T> & Complex<T>::set(const T &sa, const T &sb) { a = sa; b = sb; return *this; } template <class T> inline const Complex<T> Complex<T>::operator + (const Complex<T> &R) const { return Complex<T>(a + R.a, b + R.b); } template <class T> inline const Complex<T> Complex<T>::operator - (const Complex<T> &R) const { return Complex<T>(a - R.a, b - R.b); } template <class T> inline const Complex<T> Complex<T>::operator * (const Complex<T> &R) const { return Complex<T>(a*R.a - b*R.b, a*R.b + b*R.a); } template <class T> inline const Complex<T> Complex<T>::operator / (const Complex<T> &R) const { T z = abs(R); return Complex<T>((a*R.a + b*R.b)/z, (b*R.a - a*R.b)/z); } template <class T> inline const Complex<T> Complex<T>::operator + (const T &r) const { return Complex<T>(a + r, b); } template <class T> inline const Complex<T> Complex<T>::operator - (const T &r) const { return Complex<T>(a - r, b); } template <class T> inline const Complex<T> Complex<T>::operator * (const T &r) const { return Complex<T>(a*r, b*r); } template <class T> inline const Complex<T> Complex<T>::operator / (const T &r) const { return Complex<T>(a/r, b/r); } template <class T> inline const Complex<T> & Complex<T>::operator = (const Complex<T> &R) { return set(R.a, R.b); } template <class T> inline const Complex<T> & Complex<T>::operator += (const Complex<T> &R) { return set(a + R.a, b + R.b); } template <class T> inline const Complex<T> & Complex<T>::operator -= (const Complex<T> &R) { return set(a - R.a, b - R.b); } template <class T> inline const Complex<T> & Complex<T>::operator *= (const Complex<T> &R) { return set(a*R.a - a*R.b, a*R.b + b*R.a); } template <class T> inline const Complex<T> & Complex<T>::operator /= (const Complex<T> &R) { T z = abs(R); return set((a*R.a + a*R.b)/z, (b*R.a - a*R.b)/z); } template <class T> inline const Complex<T> & Complex<T>::operator = (const T &r) { return set(r, static_cast<T>(0)); } template <class T> inline const Complex<T> & Complex<T>::operator += (const T &r) { return set(a + r, b); } template <class T> inline const Complex<T> & Complex<T>::operator -= (const T &r) { return set(a - r, b); } template <class T> inline const Complex<T> & Complex<T>::operator *= (const T &r) { return set(a*r, b*r); } template <class T> inline const Complex<T> & Complex<T>::operator /= (const T &r) { return set(a/r, b/r); } template <class T> inline const Complex <T> Complex<T>::operator - () const { return Complex(-a, -b); } template <class T> inline const T & Complex<T>::operator [] (const int en) const { return V[en]; } template <class T> inline T & Complex<T>::operator [] (const int en) { return V[en]; } template <class T> inline std::ofstream & Complex<T>::saveBin(std::ofstream &savf) const { savf.write((char *)V, D*sizeof(T)); return savf; } template <class T> inline std::ifstream & Complex<T>::loadBin(std::ifstream &loaf) { loaf.read((char *)V, D*sizeof(T)); return loaf; } template <class T> inline T Complex<T>::normalize(void) { T l = sqrt(a*a + b*b); if(fabs(l) > (T)0) { a /= l; b /= l; } return l; } #endif I'm using MinGW on 64bit windows (compiled in release mode). Anyone care to test it with a different compiler maybe? I think it is odd that would be so slow..
  10. Operator Efficiency in C++

    In my experience (gnu gcc) the compiler will make the necessary optimizations if you you make it a member function. You're using a different compiler though so you might get different results.
  11. "averaging" several vectors

    You could convert them into polar coordinates and then take the average. That might give you a more intuitive average direction. However this might also produce some strange results, for example the angle 0 is the same as 2pi, but the average of those is pi, which points in the oposite direction of the two originals.
  12. Indefinite integral I can't figure out

    I'm not familiar with the US education system, but I guess the first time a student will need the erf function is while working with probability and normal distributions. In Norway thats high school level. However they don't call it the erf function at that stage. Instead students are taught to use a table or numeric integration on the calculator to evaluate integrals.
  13. Indefinite integral I can't figure out

    You'll get the erf function as mathematica says. What they (probably) want you to show is that you can factorize the expression so that you get from exp(2x - x^2) to exp(1)*exp(-(1 - x)^2) And do a substitution, for example 1 - x = t And integrate exp(-t^2) Where you'll get the erf(t) function (times the constant and 0.5*sqrt(pi))
  14. Stargate Universe and other recent shows

    Hope SGU dont get the "silly alien of the week" syndrome. I like the fact that the aliens actually seem to be alien, not just people with some kind of english accent dressed up in a funny way and a bit of makeup.
  15. Barack Obama Wins Nobel Peace Prize

    The award has become somewhat less of a reward for past achievements and more of a motivation to work for peace in the future. In this respect it doesn't necessarily make sense to select someone solely based on their personal effort. If one take into account the effect and influence of this effort, as well as the extra motivation and moral obligation the price may give the recipient, then Obama might be a sensible choice.