By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,844 Members | 1,918 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,844 IT Pros & Developers. It's quick & easy.

Russian Sorting Halves Danilin

P: 7
Russian Sorting Halves Danilin

Russian Sorting Halves and fast and human
sorts 1'000'000 in 2.2 seconds on QB64
sorts 1'000'000 in 0.3 seconds on PureBasic

me interested implementation of algorithm in language C#

number of elements is written to file with c:/N.txt or use variable n
array d(n) can be read from a file or synthesized in a program

Russian Sorting Halves Danilin visualisation

Russian Sorting Halves and fast and human
sorts 1'000'000 in 0.2 seconds on C# Csharp

Expand|Select|Wrap|Line Numbers
  1. // RUSSIAN SORTING HALVES DANILIN
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.IO;
  7. namespace davApp
  8. {
  9.     class Program
  10.     {
  11.         private long age;
  12.         static long[] a;
  13.         static long[] d;
  14.  
  15.         static void Main(string[] args)
  16.         {
  17.             int n = 0;
  18.             // READ NUMBERS
  19.             var inpFile = new StreamReader("N.txt");
  20.             n = Convert.ToInt32(inpFile.ReadLine());
  21.             inpFile.Close();
  22.  
  23.             var age = 1 + Math.Log(n) / Math.Log(2);
  24.  
  25.             Console.WriteLine(n);
  26.  
  27.             a = new long[n + 1];
  28.             d = new long[n + 1];
  29.  
  30.             for (int i = 1; i <= n; i++)
  31.                 d[i] = n - i + 1;
  32.  
  33.             //var rand = new Random();
  34.             // RANDOM [1;n]
  35.             //for (int i = 1; i <= n; i++)
  36.             //    d[i] = rand.Next(1, n);
  37.  
  38.             // READ N LINE FROM FILE
  39.             //inpFile = new StreamReader("ISX.txt");
  40.             //for (int i = 1; i <= n; i++)
  41.             //    d[i] = Convert.ToInt64(inpFile.ReadLine());
  42.             //inpFile.Close();
  43.  
  44.             // WRITE ON SCREEN
  45.             int m = Math.Min(n, 20);
  46.             for (int i = 1; i <= m; i++)
  47.                 Console.Write("{0} ", d[i]);
  48.             Console.WriteLine();
  49.  
  50.             // RUSSIAN SORTING HALVES DANILIN
  51.             var start = DateTime.Now;
  52.             if (age > 0)
  53.                 dav(1, n, 1, age);
  54.             var finish = DateTime.Now;
  55.  
  56.             Console.WriteLine("{0} second", (finish - start).TotalSeconds);
  57.  
  58.             // WRITE ON SCREEN
  59.             Console.WriteLine("[1..{0}]", m);
  60.             for (int i = 1; i <= m; i++)
  61.                 Console.Write("{0} ", d[i]);
  62.             Console.WriteLine();
  63.  
  64.             // WRITE ON SCREEN
  65.             Console.WriteLine("[{0}..{1}]", n - m + 1, n);
  66.             for (int i = n - m + 1; i <= n; i++)
  67.                 Console.Write("{0} ", d[i]);
  68.             Console.WriteLine();
  69.  
  70.             // WRITE IN FILE
  71.             var outFile = new StreamWriter("dav.txt");
  72.             for (int i = 1; i <= m; i++)
  73.                 outFile.WriteLine(d[i]);
  74.             outFile.WriteLine();
  75.  
  76.             for (int i = n - m + 1; i <= n; i++)
  77.                 outFile.WriteLine(d[i]);
  78.             outFile.WriteLine();
  79.             outFile.Close();
  80.  
  81.             Console.WriteLine("Press any key");
  82.             Console.ReadKey();
  83.         }
  84.  
  85.         static void dav(int ab, int yz, int part, double age)
  86.         {
  87.             if (yz - ab < 1)
  88.                 return;
  89.  
  90.             long summa = 0;
  91.             for (int i = ab; i <= yz; i++)
  92.                 summa = summa + d[i];
  93.  
  94.             double middle = summa / (yz - ab + 1.0);
  95.  
  96.             var abc = ab - 1;
  97.             var xyz = yz + 1;
  98.  
  99.             for (int i = ab; i <= yz; i++)
  100.                 if (d[i] < middle)
  101.                 {
  102.                     abc = abc + 1;
  103.                     a[abc] = d[i];
  104.                 }
  105.                 else
  106.                 {
  107.                     xyz = xyz - 1;
  108.                     a[xyz] = d[i];
  109.                 }
  110.  
  111.             for (int i = ab; i <= yz; i++)
  112.                 d[i] = a[i];
  113.  
  114.             if (part < age)
  115.             {
  116.                 if (abc >= ab) dav(ab, abc, part + 1, age);
  117.                 if (xyz <= yz) dav(xyz, yz, part + 1, age);
  118.             }
  119.             return;
  120.         }
  121.     }
  122. }
Russian Sorting Halves and fast and human
sorts 1'000'000 in 2.2 seconds on QB64
sorts 1'000'000 in 0.3 seconds on PureBasic
sorts 1'000'000 in 0.2 seconds on C# Csharp
sorts 1'000'000 in 0.15 seconds on Freebasic
Oct 30 '18 #1
Share this Question
Share on Google+
6 Replies


P: 7

P: 7
a 4 times acceleration proof

Expand|Select|Wrap|Line Numbers
  1. // Russian Sorting Halves 4 part accelerate bubble sorting 
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6.  
  7. namespace octoberApp
  8. {
  9.     class Program
  10.     {
  11.         static int n;
  12.         static double[] d;
  13.         static double[] a;
  14.         static double[] v;
  15.         static int[] q;
  16.  
  17.         static void Main(string[] args)
  18.         {
  19.             n = 57539; 
  20.  
  21.             d = new double[n+1];
  22.             a = new double[n+1];
  23.             v = new double[n+1];
  24.             q = new int[5+1];
  25.             var rand = new Random();
  26.             for (int i = 1; i <= n; i++)
  27.                 d[i] = Math.Truncate(rand.NextDouble() * n);
  28.  
  29.             for (int i = 1; i <= 10; i++)
  30.                 Console.Write("{0} ", d[i]);
  31.             Console.WriteLine();
  32.  
  33.             for (int i = n - 9; i <= n; i++)
  34.                 Console.Write("{0} ", d[i]);
  35.             Console.WriteLine();
  36.             Console.WriteLine();
  37.  
  38.             var start = DateTime.Now;
  39.             var s = 0;
  40.             //ALL
  41.             double summa = 0;
  42.             for (int i = 1; i <= n; i++)
  43.                 summa += d[i];
  44.             double middle = summa / n;
  45.             var y = 1;
  46.             var z = 0;
  47.  
  48.             for (int i = 1; i <= n; i++)
  49.                 if (d[i] < middle)
  50.                 {
  51.                     a[y] = d[i]; y++;
  52.                 }
  53.                 else
  54.                 {
  55.                     a[n - z] = d[i];
  56.                     z++;
  57.                 }
  58.  
  59.             q[3] = y - 1;
  60.             Console.WriteLine("ALL middle = {0}", middle);
  61.  
  62.             for (int i = 1; i <= 10; i++)
  63.                 Console.Write("{0} ", a[i]);
  64.             Console.WriteLine();
  65.             Console.WriteLine();
  66.             for (int i = n - 9; i <= n; i++)
  67.                 Console.Write("{0} ", a[i]);
  68.             Console.WriteLine();
  69.             Console.WriteLine();
  70.  
  71.             // 1 FROM 2
  72.             summa = 0;
  73.             for (int i = 1; i <= q[3]; i++)
  74.                 summa += a[i];
  75.  
  76.             middle = summa / q[3];
  77.             y = 1;
  78.             z = 0;
  79.             Console.WriteLine("1 FROM 2 = {0} 1 ...{1}", middle, q[3]);
  80.  
  81.             for (int i = 1; i <= q[3]; i++)
  82.                 if (a[i] < middle)
  83.                 {
  84.                     v[y] = a[i]; y++;
  85.                 }
  86.                 else
  87.                 {
  88.                     v[q[3] - z] = a[i];
  89.                     z++;
  90.                 }
  91.  
  92.             for (int i = 1; i <= 10; i++)
  93.                 Console.Write("{0} ", v[i]);
  94.             Console.WriteLine();
  95.             for (int i = q[3] - 9; i <= q[3]; i++)
  96.                 Console.Write("{0} ", v[i]);
  97.             Console.WriteLine();
  98.             Console.WriteLine();
  99.  
  100.             q[2] = y - 1;
  101.  
  102.             // 2 FROM 2
  103.             summa = 0;
  104.             for (int i = q[3] + 1; i <= n; i++)
  105.                 summa += a[i];
  106.             middle = summa / (1 + n - q[3]);
  107.             y = q[3];
  108.             z = 0;
  109.             Console.WriteLine("2 FROM 2 = {0} {1}...{2}", middle, q[3] + 1, n);
  110.             for (int i = q[3]; i <= n; i++)
  111.                 if (a[i] < middle)
  112.                 {
  113.                     v[y] = a[i]; y++;
  114.                 }
  115.                 else
  116.                 {
  117.                     v[n - z] = a[i];
  118.                     z++;
  119.                 }
  120.             for (int i = q[3]; i <= q[3] + 10; i++)
  121.                 Console.Write("{0} ", v[i]);
  122.             Console.WriteLine();
  123.             for (int i = n - 9; i <= n; i++)
  124.                 Console.Write("{0} ", v[i]);
  125.             Console.WriteLine();
  126.             Console.WriteLine();
  127.  
  128.             q[4] = y - 1;
  129.             q[1] = 2;
  130.             q[5] = n;
  131.  
  132.             //BUBBLE
  133.             Console.WriteLine("1= {0} 2= {1} 3= {2} 4= {3} 5= {4}", 1, q[2], q[3], q[4], n);
  134.             Console.WriteLine();
  135.  
  136.             for (int t = 1; t <= 4; t++)
  137.                 for (int i = q[t] - 1; i <= q[t + 1]; i++)
  138.                     for (int j = i + 1; j <= q[t + 1]; j++)
  139.                         if (v[i] > v[j])
  140.                         {
  141.                             var x = v[i];
  142.                             v[i] = v[j];
  143.                             v[j] = x;
  144.                             s++;
  145.                         }
  146.  
  147.             var finish = DateTime.Now;
  148.  
  149.             for (int i = 1; i <= 10; i++)
  150.                 Console.Write("{0} ", v[i]);
  151.             Console.WriteLine();
  152.  
  153.             for (int i = n - 9; i <= n; i++)
  154.                 Console.Write("{0} ", v[i]);
  155.             Console.WriteLine();
  156.             Console.WriteLine();
  157.             Console.WriteLine("DA RUS 4 {0} second swap {1}", (finish - start).TotalSeconds, s);
  158.  
  159.  
  160.             var outFile = new System.IO.StreamWriter("RUoct.txt");
  161.             outFile.WriteLine("DA RUS 4 {0} second swap {1}", (finish - start).TotalSeconds, s);
  162.             outFile.WriteLine("{0} 4 parts bubble ", n);
  163.  
  164.             for (int i = 1; i <= n / 2; i++)
  165.                 outFile.WriteLine(v[i]);
  166.             for (int i = n / 2; i <= n; i++)
  167.                 outFile.WriteLine(v[i]);
  168.  
  169.             outFile.Close();
  170.  
  171.             start = DateTime.Now;
  172.             s = 0;
  173.  
  174.             for (int i = 1; i <= n; i++)
  175.                 for (int j = i + 1; j <= n; j++)
  176.                     if (d[i] > d[j])
  177.                     {
  178.                         var x = d[i];
  179.                         d[i] = d[j];
  180.                         d[j] = x;
  181.                         s++;
  182.                     }
  183.             finish = DateTime.Now;
  184.  
  185.             Console.WriteLine("BUBBLE {0} second swap {1}", (finish - start).TotalSeconds, s);
  186.  
  187.             Console.WriteLine("Press any key");
  188.             Console.ReadKey();
  189.         }
  190.     }
  191. }
a 4 times acceleration proof





division of array into 4 parts occurs instantly
name q(3) will be replaced by a simpler name

but separation attempts for 2 nested loops
broken about order of midpoints 3 2 4

which leads to arrays with 2nd brackets
which complicates understanding and better apply

speaking variables of type middle3
leaving 3 cycles separate
Oct 30 '18 #3

P: 7
We learn C# knowing Basic & Excel & qb64

? Why C# & Basic & Excel & qb64?
because C# & qb64 are compiled

I have a C# csc.exe compiler in Win7
and compile through an individual bat

Excel: even micro-sized environments
Basic: qb64 compatible with Win7

qb64 quadratic equation:

Expand|Select|Wrap|Line Numbers
  1. ' quadratic equation QB64 DAV 
  2.  
  3. INPUT "INPUT A"; A
  4. INPUT "INPUT B"; B
  5. INPUT "INPUT C"; C
  6.  
  7. D = B ^ 2 - 4 * A * C
  8.  
  9. IF D < 0 THEN PRINT "D<0 ": END
  10.  
  11. PRINT "ANSWER: "
  12. PRINT "D ="; D
  13.  
  14. X1 = (-B + SQR(D)) / (2 * A)
  15. X2 = (-B - SQR(D)) / (2 * A)
  16.  
  17. PRINT "X1 ="; X1
  18. PRINT "X2 ="; X2
  19.  
  20. END
C# quadratic equation without checking d<0:

Expand|Select|Wrap|Line Numbers
  1. // quadratic equation C# DAV  
  2. using System;
  3. using System.Text;
  4. using System.IO;
  5. namespace DAV 
  6. {
  7.     class Program
  8.         {
  9.     static void Main(string[] args)
  10.     {
  11. Console.Write("INPUT A: ");
  12. long a = Convert.ToInt32(Console.ReadLine());
  13. Console.Write("INPUT B: ");
  14. long b = Convert.ToInt32(Console.ReadLine());
  15. Console.Write("INPUT C: ");
  16. long c = Convert.ToInt32(Console.ReadLine());
  17.  
  18. long d = (b * b - 4 * a * c);
  19. Console.WriteLine("ANSWER: ");
  20. Console.Write("D = "); 
  21. Console.WriteLine(d);
  22.  
  23. var x1 = (-b + Math.Sqrt(d)) / (2 * a);
  24. var x2 = (-b - Math.Sqrt(d)) / (2 * a);
  25.  
  26. Console.Write("X1 = "); 
  27. Console.WriteLine(x1);
  28. Console.Write("X2 = "); 
  29. Console.WriteLine(x2);
  30.  
  31.         Console.ReadKey();
  32.         }
  33.     }
  34. }
excel quadratic equation without checking d<0:
excel: copy and paste in A1

Expand|Select|Wrap|Line Numbers
  1. 6
  2. 7
  3. 2
  4. =A2^2-4*A1*A3
  5. =(-A2+(A4^(1/2)))/(2*A1)
  6. =(-A2-(A4^(1/2)))/(2*A1)
further need to examine conditions
creating a toy "guess number"
Mar 22 '19 #4

P: 7
qb64 for 1 minute created main lines and for minutes issued
C# in 3 hours created by internet tips with new ideas

Expand|Select|Wrap|Line Numbers
  1. 'qb64 dav guess number from 0 to 100 with counting of steps 
  2. RANDOMIZE TIMER
  3. s = INT(RND * 100)
  4. t = 0
  5.  
  6. 10 PRINT: t = t + 1:
  7. INPUT "your variant"; a
  8.  
  9. IF a < s THEN PRINT "need MORE": GOTO 10
  10. IF a > s THEN PRINT "need less": GOTO 10
  11. PRINT "win by"; t; "steps"
  12. END
Expand|Select|Wrap|Line Numbers
  1. '//C# dav guess number from 0 to 100 with counting of steps 
  2. using System;
  3. using System.Text;
  4. namespace DAV 
  5. {
  6.     class Program
  7.         {
  8.     static void Main(string[] args) 
  9.     {
  10. Random rand = new Random();
  11. int s = rand.Next(100);
  12. int t = 0;
  13.  
  14. dav:
  15. Console.WriteLine();
  16. t++;
  17.  
  18. Console.Write("your variant ");
  19. string d = Console.ReadLine();
  20. int a = Convert.ToInt32(d);
  21.  
  22. if(a > s)
  23.     {
  24.     Console.WriteLine("need less");
  25.     goto dav;
  26.     }
  27. else if(a < s)
  28.     {
  29.     Console.WriteLine("need MORE");
  30.     goto dav;
  31.     }
  32. Console.Write("win by ");
  33. Console.Write(t);
  34. Console.Write(" steps"); 
  35.         Console.ReadKey();
  36.         }
  37.     }
  38. }
Mar 22 '19 #5

P: 7
Expand|Select|Wrap|Line Numbers
  1. 'milliard & billion qb64 DAV guess 1 number of 1'OOO'000'ooo by 30 steps
  2.  
  3. RANDOMIZE TIMER
  4. h2 = INT(RND * 10 ^ 9)
  5. h1 = 0
  6. c = INT(RND * h2) 'comp
  7. h = INT(RND * h2) 'human
  8. t = 0
  9.  
  10. 10 t = t + 1
  11. PRINT t, c, h,
  12.  
  13. IF h < c THEN PRINT "MORE": a = h: h = INT((h + h2) / 2): h1 = a: GOTO 10
  14. IF h > c THEN PRINT "less": a = h: h = INT((h1 + h) / 2): h2 = a: GOTO 10
  15. PRINT "win by "; t; " steps"
  16. END
C# compiler feature noticed
remark that there is a mistake at beginning of program
may mean a lack of characters } at end

example for a range from 0 to 100
Expand|Select|Wrap|Line Numbers
  1. 1    40    11    MORE
  2. 2    40    55    less
  3. 3    40    33    MORE
  4. 4    40    44    less
  5. 5    40    38    MORE
  6. 6    40    41    less
  7. 7    40    39    MORE
  8. 8    40    40    win by 8 steps
BasiC# qbc# C##


Online C# compiler detected
and dozens more languages without qbasic
working without registration

and there typing program is possible
save state with program

for example program C # Billion
guessing 1 of 1'000'OOO'ooo
=log(10^9;2) in 30 moves

rextester.com/JRGX29275

Expand|Select|Wrap|Line Numbers
  1. //milliard & billion C# DAV guess 1 number of 1000000000 by 30 steps  
  2. using System;
  3. using System.Text;
  4. namespace DAV
  5. {
  6.     class Program
  7.     {
  8.     static void Main(string[] args)
  9.     {
  10. int h2 = 1000000000;//or 500
  11. int h1 = 0;
  12. Random rand = new Random();
  13. int c = rand.Next(h2); //computer
  14. int h = rand.Next(h2); //human or h2/2;
  15. int t = 0;
  16.  
  17. dav:
  18. t++;
  19. Console.WriteLine();
  20. Console.Write(t);
  21. Console.Write("  ");
  22. Console.Write(c);
  23. Console.Write("  ");
  24. Console.Write(h);
  25. Console.Write("  ");
  26.  
  27. if(h < c)
  28.     {
  29.     Console.Write("MORE");
  30.     int a = h;
  31.     h = (h + h2) / 2;
  32.     h1 = a;
  33.     goto dav;
  34.     }
  35. else if(h > c)
  36.     {
  37.     Console.Write("less");
  38.     int a = h;
  39.     h = (h1 + h) / 2;
  40.     h2 = a;
  41.     goto dav;
  42.     }
  43. Console.Write("win by ");
  44. Console.Write(t);
  45. Console.Write(" steps");
  46.         Console.ReadKey();
  47.         }
  48.     }
  49. }

Searching see programs stored ... 5 years
and for certain still there is an online compiler C#
and really are through Yandex search

but since interested in graphics
while I use cs & bat
Mar 28 '19 #6

P: 7
we draw 5D relief creating a random array of heights

on QB64 in 5 minutes and plus in an hour
beauty and versatility

[IMG]reliefqb.gif[/IMG]

Expand|Select|Wrap|Line Numbers
  1. ' 5d relief and array
  2. SCREEN 12: RANDOMIZE TIMER: DIM a(12,12)
  3. FOR t=1 TO 12 ' quantity
  4.     FOR x=1 TO 12: FOR y=1 TO 12
  5. a(x,y)=INT(RND*20)'heights
  6.     NEXT: NEXT: CLS
  7.     FOR y=1 TO 12: FOR x=1 TO 11
  8. LINE (50+20*x+20*y, 400-20*y-a(x,y))-(50+20*(x+1)+20*y, 400-20*y-a(x+1,y)), y
  9.     NEXT: NEXT
  10.     FOR x=1 TO 12: FOR y=1 TO 11
  11. LINE (50+20*x+20*y, 400-20*y-a(x,y))-(50+20*(x+1)+20*y, 400-20*(y+1)-a(x,y+1)), x
  12.     NEXT: NEXT:SLEEP 1
  13. NEXT
  14. END
on C# pendulum program is used
because of what remained incomprehensible lines about timer
and random function depends on outside / inside cycles
and to understand another program created random

how to clear screen is still unclear and builds slowly
and it is unclear how to set color of lines by variables

[IMG]reliefcs.gif[/IMG]

still as task manager shows
simple C# program or array fills memory
and only at end does memory clear line save

Expand|Select|Wrap|Line Numbers
  1. //RELIEF
  2. using System;
  3. using System.Drawing;
  4. using System.Windows.Forms;
  5. class RELIEF
  6. {
  7. Timer timer; // it is not clear
  8. Form form;
  9.  
  10. int[,] a = new int[22, 22];
  11. static void Main(string[] args) 
  12. {
  13. var p = new RELIEF();
  14. }
  15. public RELIEF()
  16. {
  17.     form = new Form() { Text = "RELIEF", Width = 600, Height = 360 };
  18.     timer = new Timer() { Interval = 200 }; // it is not clear
  19.     timer.Tick += delegate(object sender, EventArgs e) // it is not clear
  20.     {
  21.     Random rand = new Random();
  22. // heights
  23.     for (int x = 1; x <=12; x++)
  24.     {
  25.     for (int y = 1; y <=12; y++)
  26.     a[x,y]=rand.Next(20);
  27.     }
  28. // parallels X
  29.     for (int y = 1; y <=12; y++)
  30.     {
  31.     for (int x = 1; x <=11; x++)
  32.         {
  33.     var x1 = 50 + 20*x + 20*y; 
  34.     var y1 = 300 - 20*y - a[x,y];
  35.     var x2 = 50 + 20*(x+1) + 20*y;
  36.     var y2 = 300 - 20*y - a[x+1,y];
  37.  
  38.     Bitmap dblBuffer = new Bitmap(form.Width, form.Height);
  39.     Graphics g = Graphics.FromImage(dblBuffer);
  40.     Graphics f = Graphics.FromHwnd(form.Handle);
  41.  
  42.     g.DrawLine(Pens.Red, new Point(x1, y1), new Point(x2, y2));
  43. //    f.Clear(Color.Green); // clear screen
  44.     f.DrawImage(dblBuffer, new Point(0, 0));
  45.      }
  46.     }
  47. // parallels Y
  48.     for (int x = 1; x <=12; x++)
  49.     {
  50.     for (int y = 1; y <=11; y++)
  51.     {
  52.     var x1 = 50 + 20*x + 20*y; 
  53.     var y1 = 300 - 20*y - a[x, y];
  54.     var x2 = 50 + 20*(x+1) + 20*y;
  55.     var y2 = 300 - 20*(y+1) - a[x, y+1];
  56.  
  57.     Bitmap dblBuffer = new Bitmap(form.Width, form.Height);
  58.     Graphics g = Graphics.FromImage(dblBuffer);
  59.     Graphics f = Graphics.FromHwnd(form.Handle);
  60.  
  61.     g.DrawLine(Pens.Red, new Point(x1, y1), new Point(x2, y2));
  62. //    f.Clear(Color.Green); // clear screen
  63.     f.DrawImage(dblBuffer, new Point(0, 0));
  64.     }
  65.     }
  66. Array.Clear(a, 0, 22); // clears memory
  67.     };
  68.     timer.Start(); // it is not clear
  69.     Application.Run(form);
  70.     }     
  71. }
besides C# pendulum is C # diagonal simpler
and no other C# program is included
so as in basic: 1 file = 1 program

that's why my given 5D relief program is important.
drawing at least something predictable
and at same time we study nested loops

and I'm still looking for compilable graphics programs:

1 file = 1 program
1bas=1exe & 1cs=1exe

and already created studies about strings
Mar 29 '19 #7

Post your reply

Sign in to post your reply or Sign up for a free account.