Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: How to detect internet connection!
« Last post by 440bx on Today at 04:51:04 pm »
No... external IP, and not even my direct IP. You are being silly. (or have not sufficient understanding how routing works)
Look up my original postings. Both links are still up after all those years. Also demonstrates the difference.  :-X :-X.... Plz take note... You deserve my mild insults...
And YES testing an internet connection can only be done through a full connection. Happens to be my job.. just in case...Anything else can be spoofed from a local network.
(Hence that site is fully static and doesn't need https)
Your posts indicate that your job most likely consists in arguing about things you know nothing, it is likely due to your extensive experience in that area that it might very well be the only thing you do well.

Very impressive!

I enjoy the amusement (another thing you provide for free)... keep going :)
2
General / Re: How to detect internet connection!
« Last post by Thaddy on Today at 04:38:48 pm »
In my case I give you your ip for free.... 8-)
You're really funny.  Every internet connection you make has your ip.  So nice of you to give one's IP for free... a real Santa Ip you are. :)
No... external IP, and not even my direct IP. You are being silly. (or have not sufficient understanding how routing works)
Look up my original postings. Both links are still up after all those years. Also demonstrates the difference.  :-X :-X.... Plz take note... You deserve my mild insults...
And YES testing an internet connection can only be done through a full connection. Happens to be my job.. just in case...Anything else can be spoofed from a local network.
(Hence that site is fully static and doesn't need https)
3
Packages and Libraries / Re: CEF4Delphi now supports Lazarus/FPC
« Last post by salvadordf on Today at 04:29:28 pm »
I just uploaded a new CEF4Delphi version with almost all the demos you sent me.

I had to delete a few Lazarus demos because :
  • MDI forms weren't working properly
  • I couldn't find a virtual keyboard for Lazarus
  • Some unexpected issues with DLLs

CEF4Delphi is now updated to CEF 74.1.19 which includes Chromium 74.0.3729.157

Thank you very much avra!!!  :D
4
General / Re: How to detect internet connection!
« Last post by metallaro1980 on Today at 03:53:27 pm »
i am using mine

Code: Pascal  [Select]
  1. function TForm1.CheckInternet:boolean;
  2. var mypro1 : tprocess;
  3. var tmplst : tstringlist;
  4. var zk:integer;
  5. var tmpbuffer:string;
  6. var okbuffer:string;
  7. var artmp : array of string;
  8. var recev : integer;
  9. begin
  10.   try
  11.   mypro1 := tprocess.Create(nil);
  12.   tmplst := tstringlist.create;
  13.   mypro1.Executable:= 'ping';
  14.   mypro1.Parameters.Add('-c 5');
  15.   mypro1.parameters.add('8.8.8.8');
  16.   mypro1.Options := mypro1.Options + [poWaitOnExit, poUsePipes];
  17.   mypro1.Execute;
  18.   tmplst.loadfromstream(mypro1.output);
  19.   okbuffer := '';
  20.  
  21.   for zk := 0 to tmplst.Count - 1 do
  22.   begin
  23.     tmpbuffer := tmplst[zk];
  24.     if (pos('received', tmpbuffer) > 0) then
  25.     begin
  26.       okbuffer := tmpbuffer;
  27.       break;
  28.     end;
  29.   end;
  30.  
  31.   if (okbuffer = '') then
  32.   begin
  33.     result := false;
  34.     exit;
  35.   end
  36.   else
  37.   begin
  38.     tmpbuffer := '';
  39.     artmp := okbuffer.Split(',');
  40.     okbuffer := '';
  41.     for zk := 0 to length(artmp) - 1 do
  42.     begin
  43.       if (pos('received', artmp[zk]) > 0) then
  44.       begin
  45.         okbuffer := trim(artmp[zk]);
  46.         break;
  47.       end;
  48.     end;
  49.     if (okbuffer = '') then
  50.     begin
  51.       result := false;
  52.       exit;
  53.     end
  54.     else
  55.     begin
  56.        okbuffer := replacestr(okbuffer, 'received', '');
  57.        okbuffer := trim(okbuffer);
  58.        if isnumber(okbuffer) then
  59.        begin
  60.          recev := strtoint(okbuffer);
  61.          if (recev = 0) then
  62.          begin
  63.            result := false;
  64.            exit;
  65.          end
  66.          else
  67.          begin
  68.            result :=  true;
  69.            exit;
  70.          end;
  71.  
  72.        end
  73.        else
  74.        begin
  75.          result := false;
  76.          exit;
  77.        end;
  78.     end;
  79.  
  80.   end;
  81.  
  82.  
  83.   finally
  84.     mypro1.Free;
  85.   end;
  86.  
  87.  
  88. end;                          

here my source of my program to detect the internet ip in Lazarus
http://andreaverdi.altervista.org/linux/GetIP.zip

5
Beginners / Re: Sending email with Indy
« Last post by justnewbie on Today at 03:53:04 pm »
New question:
I want to send an email to some recipients. The email is the same, except a random number within it (simplified example of course).
This is my bad code:
Code: Pascal  [Select]
  1. ...
  2.  
  3. with TIdText.Create(MailMessage.MessageParts, nil) do
  4. begin
  5.       Body.Text := Memo1.Text;
  6.       ContentType := 'text/plain';
  7.       ParentPart := 0;
  8. end;  
  9.  
  10. ...
  11.  
  12. try
  13.   try      
  14.     SMTP.Connect;
  15.  
  16.     for i := 0 to ListBox1.Count - 1 do
  17.       begin
  18.         MailMessage.Recipients.EMailAddresses := ListBox1.Items[i];
  19.         Body.Text := Body.Text + InToStr(Random(1000)); // This line has no effect
  20.         SMTP.Send(MailMessage);        
  21.       end;
  22.  
  23.     except on E:Exception do
  24.       Memo2.Lines.Insert(0, 'ERROR: ' + E.Message);
  25.     end;
  26. finally
  27.   if SMTP.Connected then SMTP.Disconnect;
  28. end;
  29.  
  30. ...

Can you help me?
6
Beginners / Re: [WANTED] Intrusive data structures
« Last post by julkas on Today at 03:38:02 pm »
Another Intrusive Linked List example in C - https://www.cs.helsinki.fi/group/cpro/harj5_13.pdf.
It's based on C offsetof, container_of macros (https://en.wikipedia.org/wiki/Offsetof).

How to program this example in pure Pascal?

Thanks.

BTW. Boost.Intrusive - https://theboostcpplibraries.com/boost.intrusive.
7
Beginners / Re: [WANTED] Intrusive data structures
« Last post by Martin_fr on Today at 01:49:31 pm »
The link does not load from where I live. Google cache works....

You can put fields or references (pointers) into that record (the record I gave you is a blueprint for the header)

You can nest records, too.

Code: Pascal  [Select]
  1.     type
  2.       PMyLinkedHead = ^TMyLinkedHead;  // Forward declaration pointer to the record
  3.       TMyLinkedHead = record
  4.         Prev, Next: PMyLinkedHead;
  5.       end;
  6.  
  7.   TData = record
  8.     // ...
  9.   end;
  10.  
  11.   TListEntry = record
  12.      Head: TMyLinkedHead;
  13.      Data: TData;
  14.   end;
  15.  
Note you must then write

ListEntry.Head.Next^
or
ListEntry.Data.Foo...


I do not know what you want to do on top of that.

Also there is one point I do not know the exact answer, so you may need to google it.

Compilers "align" they fields (the add padding).

record a: byte; b: int64; end;
will create a structure that may have 3 or 7 empty bytes after "a".

I do not know what gcc does...
You can change that by using "packed", or changing compiler settings.
But I do not have the details...

The point is, if you call a c-library, it does not care how your code looks. It cares where in memory each bit of the data is.


you should change the "title" of your post.
Edit your first post in this thread, and change the title: "Linked lists" or "self referring structures" ....



8
General / Re: How to detect internet connection!
« Last post by 440bx on Today at 12:06:56 pm »
In my case I give you your ip for free.... 8-)
You're really funny.  Every internet connection you make has your ip.  So nice of you to give one's IP for free... a real Santa Ip you are. :)
9
Networking and Web Programming / Re: LNet beginner with basic problems
« Last post by Thaddy on Today at 11:41:54 am »
The much easier answer is to check if you are using the right protocols: No SSL(at all)  but at a minimum TLS 1.1 or higher....
10
General / Re: How to detect internet connection!
« Last post by Thaddy on Today at 11:33:03 am »
PS: I haven't tried his method but, it looks reasonable and, seems to be along the lines of what you're asking for.
Well... I have tried it some ions ago that's why I have this service. (Actually two, one is more advanced and detects redirects, see much older postings for context).
Boils down to: the only way to test for an internet connection is by making a connection to a reliable server.
In my case I give you your ip for free.... 8-) and as a string...not polluted by any html.... :P

Also... well... check my websites....Boring...
Pages: [1] 2 3 ... 10