473,785 Members | 2,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET: Problem converting fluid sim code from c++

6 New Member
I found nice realtime fluid simulation code created with c++. I converted it to vb.net but i have run into trouble. You can find original c++ code here: http://www.dgp.toronto.edu/people/st...DROM_GDC03.zip . Here's my vb.net solver part of code:

Expand|Select|Wrap|Line Numbers
  1.     Sub set_bnd(ByVal N As Integer, ByVal b As Integer, ByVal x(,) As Single)
  2.  
  3.         Dim i As Integer
  4.  
  5.         For i = 1 To (N + 1)
  6.  
  7.             If b = 1 Then
  8.                 x(0, i) = -x(1, i)
  9.             Else
  10.                 x(0, i) = x(1, i)
  11.             End If
  12.  
  13.             If b = 1 Then
  14.                 x(N + 1, i) = -x(N, i)
  15.             Else
  16.                 x(N + 1, i) = x(N, i)
  17.             End If
  18.  
  19.             If b = 2 Then
  20.                 x(i, 0) = -x(i, 1)
  21.             Else
  22.                 x(i, 0) = x(i, 1)
  23.             End If
  24.  
  25.             If b = 2 Then
  26.                 x(i, N + 1) = -x(i, N)
  27.             Else
  28.                 x(i, N + 1) = x(i, N)
  29.             End If
  30.         Next
  31.  
  32.         x(0, 0) = 0.5F * (x(1, 0) + x(0, 1))
  33.         x(0, N + 1) = 0.5F * (x(1, N + 1) + x(0, N))
  34.         x(N + 1, 0) = 0.5F * (x(N, 0) + x(N + 1, 1))
  35.         x(N + 1, N + 1) = 0.5F * (x(N, N + 1) + x(N + 1, N))
  36.     End Sub
  37.  
  38.     Sub lin_solve(ByVal N As Integer, ByVal b As Integer, ByVal x(,) As Single, ByVal x0(,) As Single, ByVal a As Single, ByVal c As Single)
  39.  
  40.         Dim i, j, k As Integer
  41.  
  42.         For k = 0 To 20
  43.             For i = 1 To N + 1
  44.                 For j = 1 To N + 1
  45.  
  46.                     x(i, j) = (x0(i, j) + a * (x(i - 1, j) + x(i + 1, j) + x(i, j - 1) + x(i, j + 1))) / (c)
  47.                 Next
  48.             Next
  49.             set_bnd(N, b, x)
  50.         Next
  51.     End Sub
  52.  
  53.     Sub add_source(ByVal N As Integer, ByVal x(,) As Single, ByVal s(,) As Single, ByVal dt As Single)
  54.         Dim i, j As Integer
  55.         Dim size As Integer = (N + 2)
  56.  
  57.         For i = 0 To size
  58.             For j = 0 To size
  59.                 x(i, j) += dt * s(i, j)
  60.             Next
  61.         Next
  62.     End Sub
  63.  
  64.     'Diffusion
  65.     Sub diffuse(ByVal N As Integer, ByVal b As Integer, ByVal x(,) As Single, ByVal x0(,) As Single, ByVal diff As Single, ByVal dt As Single)
  66.         Dim a As Single
  67.         a = dt * diff * N * N
  68.  
  69.         lin_solve(N, b, x, x0, a, 1 + 4 * a)
  70.     End Sub
  71.  
  72.     'Advection
  73.     Sub advect(ByVal N As Integer, ByVal b As Integer, ByVal d(,) As Single, ByVal d0(,) As Single, ByVal u(,) As Single, ByVal v(,) As Single, ByVal dt As Single)
  74.         Dim i, j, i0, j0, i1, j1 As Integer
  75.         Dim x, y, s0, t0, s1, t1, dt0 As Single
  76.  
  77.         dt0 = dt * N
  78.  
  79.         For i = 1 To N
  80.             For j = 1 To N
  81.  
  82.                 x = i - dt0 * u(i, j)
  83.                 y = j - dt0 * v(i, j)
  84.  
  85.                 If x < 0.5F Then x = 0.5F
  86.                 If x > (N + 0.5F) Then x = N + 0.5F
  87.  
  88.                 i0 = CInt(x)
  89.                 i1 = i0 + 1
  90.  
  91.                 If y < 0.5F Then y = 0.5F
  92.                 If y > (N + 0.5F) Then y = N + 0.5F
  93.  
  94.                 j0 = CInt(y)
  95.                 j1 = j0 + 1
  96.  
  97.                 s1 = x - i0
  98.                 s0 = 1 - s1
  99.                 t1 = y - j0
  100.                 t0 = 1 - t1
  101.  
  102.                 d(i, j) = s0 * (t0 * d0(i0, j0) + t1 * d0(i0, j1)) + s1 * (t0 * d0(i1, j0) + t1 * d0(i1, j1))
  103.             Next
  104.         Next
  105.  
  106.         set_bnd(N, b, d)
  107.     End Sub
  108.  
  109.     Sub project(ByVal N As Integer, ByVal u(,) As Single, ByVal v(,) As Single, ByVal p(,) As Single, ByVal div(,) As Single)
  110.         Dim i, j As Integer
  111.         Dim h As Single
  112.  
  113.         h = 1.0F / N
  114.  
  115.         For i = 1 To N + 1
  116.             For j = 1 To N + 1
  117.                 div(i, j) = -0.5F * h * (u(i + 1, j) - u(i - 1, j) + v(i, j + 1) - v(i, j - 1))
  118.                 p(i, j) = 0
  119.             Next
  120.         Next
  121.  
  122.         set_bnd(N, 0, div)
  123.         set_bnd(N, 0, p)
  124.  
  125.         lin_solve(N, 0, p, div, 1, 4)
  126.  
  127.         For i = 1 To N + 1
  128.             For j = 1 To N + 1
  129.                 u(i, j) -= 0.5F * (p(i + 1, j) - p(i - 1, j)) / h
  130.                 v(i, j) -= 0.5F * (p(i, j + 1) - p(i, j - 1)) / h
  131.             Next
  132.         Next
  133.  
  134.         set_bnd(N, 1, u)
  135.         set_bnd(N, 2, v)
  136.     End Sub
  137.  
  138.     Sub dens_step(ByVal N As Integer, ByVal x(,) As Single, ByVal x0(,) As Single, ByVal u(,) As Single, ByVal v(,) As Single, ByVal diff As Single, ByVal dt As Single)
  139.  
  140.         Array.Clear(temp, 0, Size1D)
  141.  
  142.         add_source(N, x, x0, dt)
  143.  
  144.         'Swap arrays
  145.         Array.Copy(x, temp, Size1D)
  146.         Array.Copy(x, x0, Size1D)
  147.         Array.Copy(temp, x, Size1D)
  148.  
  149.         diffuse(N, 0, x, x0, diff, dt)
  150.  
  151.         Array.Clear(temp, 0, Size1D)
  152.  
  153.         'Swap arrays
  154.         Array.Copy(x, temp, Size1D)
  155.         Array.Copy(x, x0, Size1D)
  156.         Array.Copy(temp, x, Size1D)
  157.  
  158.         advect(N, 0, x, x0, u, v, dt)
  159.     End Sub
  160.  
  161.     Sub vel_step(ByVal N As Integer, ByVal u(,) As Single, ByVal v(,) As Single, ByVal u0(,) As Single, ByVal v0(,) As Single, ByVal visc As Single, ByVal dt As Single)
  162.  
  163.         add_source(N, u, u0, dt)
  164.         add_source(N, v, v0, dt)
  165.  
  166.         Array.Clear(temp, 0, Size1D)
  167.  
  168.         Array.Copy(u, temp, Size1D)
  169.         Array.Copy(u, u0, Size1D)
  170.         Array.Copy(temp, u, Size1D)
  171.  
  172.         diffuse(N, 1, u, u0, visc, dt)
  173.  
  174.         Array.Clear(temp, 0, Size1D)
  175.  
  176.         Array.Copy(v, temp, Size1D)
  177.         Array.Copy(v, v0, Size1D)
  178.         Array.Copy(temp, v, Size1D)
  179.  
  180.         diffuse(N, 2, v, v0, visc, dt)
  181.  
  182.         project(N, u, v, u0, v0)
  183.  
  184.         Array.Clear(temp, 0, Size1D)
  185.  
  186.         Array.Copy(u, temp, Size1D)
  187.         Array.Copy(u, u0, Size1D)
  188.         Array.Copy(temp, u, Size1D)
  189.  
  190.         Array.Clear(temp, 0, Size1D)
  191.  
  192.         Array.Copy(v, temp, Size1D)
  193.         Array.Copy(v, v0, Size1D)
  194.         Array.Copy(temp, v, Size1D)
  195.  
  196.         advect(N, 1, u, u0, u0, v0, dt)
  197.         advect(N, 2, v, v0, u0, v0, dt)
  198.  
  199.         project(N, u, v, u0, v0)
  200.     End Sub
  201. End Class
  202.  
Simulation seems to become very unstable with vb.net. I think problem is somewhere in vel_step, which calculates velocity components. Because when displaying velocity vectorfield its very unstable and flickering. When I tried to debug code I saw that some of the values become -1.#IND which means I'm dividing with zero or doing something else wrong. But I havent found any part where division by zero might happen and I think this is not the case.

I have checked and rechecked my code. Calculations are identical to c++. Maybe there's something wrong with .net and it cant perform this amount of calculations. :D
Sep 5 '07 #1
9 2117
Mantu
6 New Member
Here's the rest of code if you want to compile it:

Expand|Select|Wrap|Line Numbers
  1. Imports Tao.OpenGl
  2. Imports Tao.FreeGlut
  3.  
  4. Public Class NavierStokes
  5.  
  6.     'Resolution params
  7.     Dim N, size, Size1D As Integer
  8.     'Simulation params
  9.     Dim dt, diff, visc, force, source As Single
  10.  
  11.     Dim win_x, win_y As Integer
  12.  
  13.     Dim dvel As Boolean
  14.  
  15.     Dim omx, omy, mouX, mouY As Integer
  16.     Dim mouse_down() As Boolean = {False, False, False}
  17.  
  18.     'Using 2d arrays to store data instead of 1d like in C++ code.
  19.     Dim u(,), u_prev(,) As Single
  20.     Dim v(,), v_prev(,) As Single
  21.     Dim dens(,), dens_prev(,) As Single
  22.  
  23.     Dim temp(,) As Single
  24.  
  25.     Public Sub New()
  26.         'Give some values to params
  27.         N = 50
  28.         size = (N + 2)
  29.         Size1D = size * size
  30.         dt = 0.1F
  31.         visc = 0.0008F 'Here's something strange c++ uses zeros here,
  32.         diff = 0.0009F 'if you put zeros now simulation behaves strange.
  33.         force = 5.0F
  34.         source = 100.0F
  35.  
  36.         win_x = 512
  37.         win_y = 512
  38.  
  39.         omx = 0
  40.         omy = 0
  41.         mouX = 0
  42.         mouY = 0
  43.  
  44.         dvel = False
  45.  
  46.         'Defines how much space arrays need.
  47.         ReDim u(size, size)
  48.         ReDim u_prev(size, size)
  49.         ReDim v(size, size)
  50.         ReDim v_prev(size, size)
  51.         ReDim dens(size, size)
  52.         ReDim dens_prev(size, size)
  53.         ReDim temp(size, size)
  54.     End Sub
  55.  
  56.     Sub clear_data()
  57.         Array.Clear(u, 0, Size1D)
  58.         Array.Clear(u_prev, 0, Size1D)
  59.         Array.Clear(v, 0, Size1D)
  60.         Array.Clear(v_prev, 0, Size1D)
  61.         Array.Clear(dens, 0, Size1D)
  62.         Array.Clear(dens_prev, 0, Size1D)
  63.     End Sub
  64.  
  65.     Sub pre_display()
  66.         Gl.glViewport(0, 0, win_x, win_y)
  67.         Gl.glMatrixMode(Gl.GL_PROJECTION)
  68.         Gl.glLoadIdentity()
  69.         Gl.glOrtho(0, 1, 0, 1, 0, 100)
  70.         Gl.glClearColor(0.0F, 0.0F, 0.0F, 1.0F)
  71.         Gl.glClear(Gl.GL_COLOR_BUFFER_BIT)
  72.     End Sub
  73.  
  74.     Sub post_display()
  75.         Glut.glutSwapBuffers()
  76.     End Sub
  77.  
  78.     Sub draw_velocity()
  79.         Dim i, j As Integer
  80.         Dim x, y, h As Single
  81.  
  82.         h = 1.0F / N
  83.  
  84.         Gl.glColor3f(1.0F, 0.0F, 0.0F)
  85.         Gl.glLineWidth(1.0F)
  86.  
  87.         Gl.glBegin(Gl.GL_LINES)
  88.         For i = 1 To (N + 1)
  89.  
  90.             x = (i - 0.5F) * h
  91.             For j = 1 To (N + 1)
  92.  
  93.                 y = (j - 0.5F) * h
  94.                 Gl.glVertex2f(x, y)
  95.                 Gl.glVertex2f(x + u(i, j), y + v(i, j))
  96.             Next
  97.         Next
  98.         Gl.glEnd()
  99.     End Sub
  100.  
  101.     Sub draw_density()
  102.         Dim i, j As Integer
  103.         Dim x, y, h, d00, d01, d10, d11 As Single
  104.  
  105.         h = 1.0F / N
  106.  
  107.         Gl.glBegin(Gl.GL_QUADS)
  108.         For i = 0 To (N + 1)
  109.  
  110.             x = (i - 0.5F) * h
  111.             For j = 0 To (N + 1)
  112.  
  113.                 y = (j - 0.5F) * h
  114.                 d00 = dens(i, j)
  115.                 d01 = dens(i, j + 1)
  116.                 d10 = dens(i + 1, j)
  117.                 d11 = dens(i + 1, j + 1)
  118.  
  119.                 Gl.glColor3f(d00, d00, d00)
  120.                 Gl.glVertex2f(x, y)
  121.                 Gl.glColor3f(d10, d10, d10)
  122.                 Gl.glVertex2f(x + h, y)
  123.                 Gl.glColor3f(d11, d11, d11)
  124.                 Gl.glVertex2f(x + h, y + h)
  125.                 Gl.glColor3f(d01, d01, d01)
  126.                 Gl.glVertex2f(x, y + h)
  127.             Next
  128.         Next
  129.         Gl.glEnd()
  130.     End Sub
  131.  
  132.     Sub get_from_UI(ByVal d(,) As Single, ByVal u(,) As Single, ByVal v(,) As Single)
  133.         Dim i, j As Integer
  134.  
  135.         Array.Clear(d, 0, Size1D)
  136.         Array.Clear(u, 0, Size1D)
  137.         Array.Clear(v, 0, Size1D)
  138.  
  139.         If Not mouse_down(Glut.GLUT_LEFT_BUTTON) And Not mouse_down(Glut.GLUT_RIGHT_BUTTON) Then
  140.             Return
  141.         End If
  142.  
  143.         i = CInt((mouX / CSng(win_x)) * N + 1)
  144.         j = CInt(((win_y - CSng(mouY)) / CSng(win_y)) * CSng(N) + 1.0)
  145.  
  146.         If i < 1 Or i > N Or j < 1 Or j > N Then
  147.             Return
  148.         End If
  149.  
  150.         If mouse_down(Glut.GLUT_LEFT_BUTTON) Then
  151.  
  152.             u(i, j) = force * (mouX - omx)
  153.             v(i, j) = force * (omy - mouY)
  154.         End If
  155.  
  156.         If mouse_down(Glut.GLUT_RIGHT_BUTTON) Then
  157.  
  158.             d(i, j) = source
  159.         End If
  160.  
  161.         omx = mouX
  162.         omy = mouY
  163.     End Sub
  164.  
  165.     Sub key_func(ByVal key As Byte, ByVal x As Integer, ByVal y As Integer)
  166.  
  167.         If key = 99 Then
  168.             clear_data()
  169.         End If
  170.  
  171.         If key = 118 Then
  172.             dvel = Not dvel
  173.         End If
  174.     End Sub
  175.  
  176.     Sub mouse_func(ByVal button As Integer, ByVal state As Integer, ByVal x As Integer, ByVal y As Integer)
  177.  
  178.         mouX = x
  179.         mouY = y
  180.         omx = mouX
  181.         omy = mouY
  182.  
  183.         mouse_down(button) = (state = Glut.GLUT_DOWN)
  184.     End Sub
  185.  
  186.     Sub motion_func(ByVal x As Integer, ByVal y As Integer)
  187.  
  188.         mouX = x
  189.         mouY = y
  190.     End Sub
  191.  
  192.     Sub reshape_func(ByVal width As Integer, ByVal height As Integer)
  193.  
  194.         Glut.glutReshapeWindow(width, height)
  195.         win_x = width
  196.         win_y = height
  197.     End Sub
  198.  
  199.     Sub idle_func()
  200.  
  201.         get_from_UI(dens_prev, u_prev, v_prev)
  202.         vel_step(N, u, v, u_prev, v_prev, visc, dt)
  203.         dens_step(N, dens, dens_prev, u, v, diff, dt)
  204.  
  205.         Glut.glutPostRedisplay()
  206.     End Sub
  207.  
  208.     Sub display_func()
  209.  
  210.         pre_display()
  211.  
  212.         If dvel Then
  213.             draw_velocity()
  214.         Else
  215.             draw_density()
  216.         End If
  217.  
  218.         post_display()
  219.     End Sub
  220.  
  221.     Sub open_glut_window()
  222.  
  223.         Glut.glutInitDisplayMode(Glut.GLUT_RGBA Or Glut.GLUT_DOUBLE)
  224.         Glut.glutInitWindowPosition(0, 0)
  225.         Glut.glutInitWindowSize(win_x, win_y)
  226.         Glut.glutCreateWindow("NavierStokes")
  227.         Gl.glClearColor(0.0F, 0.0F, 0.0F, 1.0F)
  228.         Gl.glClear(Gl.GL_COLOR_BUFFER_BIT)
  229.         Glut.glutSwapBuffers()
  230.         Gl.glClear(Gl.GL_COLOR_BUFFER_BIT)
  231.         Glut.glutSwapBuffers()
  232.  
  233.         pre_display()
  234.  
  235.         Glut.glutKeyboardFunc(New Glut.KeyboardCallback(AddressOf key_func))
  236.         Glut.glutMouseFunc(New Glut.MouseCallback(AddressOf mouse_func))
  237.         Glut.glutMotionFunc(New Glut.MotionCallback(AddressOf motion_func))
  238.         Glut.glutReshapeFunc(New Glut.ReshapeCallback(AddressOf reshape_func))
  239.         Glut.glutIdleFunc(New Glut.IdleCallback(AddressOf idle_func))
  240.         Glut.glutDisplayFunc(New Glut.DisplayCallback(AddressOf display_func))
  241.     End Sub
  242.  
  243.     Public Shared Sub Main()
  244.  
  245.         Dim NavierStokes As Navier_Stokes2.NavierStokes
  246.         NavierStokes = New Navier_Stokes2.NavierStokes
  247.  
  248.         Glut.glutInit()
  249.         NavierStokes.clear_data()
  250.         NavierStokes.open_glut_window()
  251.         Glut.glutMainLoop()
  252.     End Sub
  253.  
I'm using Tao Framework for opengl and glut. You can get it here:
http://taoframework.com/
Sep 5 '07 #2
Plater
7,872 Recognized Expert Expert
Hmm, I haven't looked close but it sounds like you are either overflowing your bounds, or something that you thought would be kept as a floating point is getting converted to integer. I saw singles and integers used but no real typecasting. So it is very likely you have fallen victem to it.
For example:
Expand|Select|Wrap|Line Numbers
  1. float f=0.0;
  2. int a=10;
  3. int b=3;
  4.  
  5. f=a/b;
  6.  
One might assume that f=3.333 (to some percision), however, it will just be 3, you will need to typecast things out to retain the fraction values
Sep 5 '07 #3
Mantu
6 New Member
Well I checked every part where typecasting might happen. I used Cint and Csng where were typeconversions , but it didn't work. I don't know about overflowing could you tell where this could happen? Or does anyone else have other suggestions?
Sep 5 '07 #4
Plater
7,872 Recognized Expert Expert
Anywhere you do math with integers.
For example
Expand|Select|Wrap|Line Numbers
  1. Dim h As Single
  2.  
  3. h = 1.0F / N
  4.  
Here you have a floating point number 1.0F being divided by an integer, the result will be the interger portion. So if N=2 then h=0, if N=1 then f=1 and the like.
You will need to fix THOSE kind of occurances
Sep 5 '07 #5
Mantu
6 New Member
How you would fix this I tried to but it's still the same.
Sep 5 '07 #6
Plater
7,872 Recognized Expert Expert
Might be overkill but should work:
Expand|Select|Wrap|Line Numbers
  1. Dim h As Single
  2.  
  3. h = (Single)(1.0F / (Single)N)
  4.  
Sep 5 '07 #7
Mantu
6 New Member
Do you mean:
Expand|Select|Wrap|Line Numbers
  1. Dim h As Single
  2.  
  3. h = CSng(1.0F / CSng(N))
  4.  
I tried to change every thing according to this but doesn't work, this is really driving me nuts.
Sep 5 '07 #8
Mantu
6 New Member
I found something:
http://techlists.org/archives/progra...msg04100.shtml
The same code is converted to python but why vb.net can't do it?
Sep 5 '07 #9
Plater
7,872 Recognized Expert Expert
Try c#?
I find it's much easier to understand.
Sep 5 '07 #10

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

Similar topics

2
3708
by: Alberto Santini | last post by:
I ported a Jos Stam's demo about Fluid mech to check the difference of speed between C implementation and Python. I think I achieved good results with Python and there is space to improve, without to extend the program with C routine, I mean. -- Good hack, Alberto Santini (http://www.albertosantini.it/)
12
2389
by: JB | last post by:
Hi All, Is it acceptable to use a fixed width vertical navigation column within a fluid 2 or 3 column layout? Example. Left Column (navigation) fixed width of say 180px Right Column (main content) fluid width to fit rest of window
2
1242
by: ntuyen01 | last post by:
Hi All, I create a long form, (user have to Scroll down to Click the submit button) on the form i have couple fields using the control "RequiredFieldValidator". Now the user click on the "submit" button, error will display if the user does not enter the required field (it works fine), but the user does not see the error unless they scroll up the form. Is there a way in the asp.net to make the page go up to the top or to the error field...
0
3669
by: shamirza | last post by:
· When was .NET announced? Bill Gates delivered a keynote at Forum 2000, held June 22, 2000, outlining the .NET 'vision'. The July 2000 PDC had a number of sessions on .NET technology, and delegates were given CDs containing a pre-release version of the .NET framework/SDK and Visual Studio.NET. · When was the first version of .NET released? The final version of the 1.0 SDK and runtime was made publicly available around 6pm PST on...
12
2452
by: Dudely | last post by:
I want to be a good little author and use CSS. Therefore, I'm attempting to convert my tables to the equivalent CSS. Unfortunately, I can't reproduce the same results. Can someone take a look at http://www.greengoldcapital.info/test/test.shtml and see if you can tell me what I'm doing wrong? What you see there is of course a mess at this point, as I've tried numerous ways to get this done and left most of those trials intact in
2
8556
by: lister | last post by:
I want to center a fluid DIV horizontally. I've tried making the margins auto, but this doesn't work. Can anyone help? CSS drives me nuts! demo here: http://www.thebunnyshed.co.uk/centertest.htm ps. is there a simpler / cleaner way to create the above layout? I do my best to stay away from DIV soup, but it still ends up horrible :-(
1
1943
by: lister | last post by:
Hi, I have a div with fluid content, below which I want a scrollable div. I can't work out how to style the scrollable div to say "use the rest of the space in the container". The best I can come up with is having the scrollable div abolutely positioned as in my demo, but this is horrible as it doesn't follow the fluid stuff.
18
2511
by: Nik Coughlin | last post by:
I am halfway through writing a tutorial on image slicing for fluid CSS layouts, I would love some feedback on what I've done up until this point: http://nrkn.com/index.html I am still writing parts 3 & 4, "optimising the layout" and "alpha transparency". Also, does anyone know why I don't get numbers or bullets on my ul and ol in Internet Explorer (6 or 7)?
3
3778
by: hzgt9b | last post by:
I want a page with a centered div containing two rows. Top row has an image and some text. The bottom row needs to have three columns. I'd love to have the 1st column set to a fixed width then have the 2nd and 3rd columns fill the remaining space but I've given up on that and am willing to settle for the second row to have a fluid 3-column layout (or something else simple). Anyway, I've developed a page where the second row has this 3...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9958
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8986
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7506
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.